opengate-js 12.9.2 → 12.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bower.json +1 -1
- package/dist/{opengate-api-bower-12.9.2.js → opengate-api-bower-12.9.4.js} +218 -123
- package/dist/opengate-api-bower-12.9.4.js.map +1 -0
- package/dist/{opengate-api-bower-12.9.2.min.js → opengate-api-bower-12.9.4.min.js} +16 -16
- package/dist/opengate-api-bower-12.9.4.min.js.map +1 -0
- package/dist/src/AIModels/AIModelsFinder.js +11 -12
- package/dist/src/AIModels/AIModelsFinder.js.map +1 -1
- package/dist/src/searching/SearchWithoutLimit.js +66 -0
- package/dist/src/searching/SearchWithoutLimit.js.map +1 -0
- package/dist/src/searching/builder/OperationTypesSearchBuilder.js +42 -15
- package/dist/src/searching/builder/OperationTypesSearchBuilder.js.map +1 -1
- package/docs/ast/source/AIModels/AIModelsFinder.js.json +664 -903
- package/docs/ast/source/searching/SearchWithoutLimit.js.json +4149 -0
- package/docs/ast/source/searching/builder/OperationTypesSearchBuilder.js.json +3107 -180
- package/docs/class/src/AIModels/AIModels.js~AIModels.html +1 -0
- package/docs/class/src/AIModels/AIModelsFinder.js~AIModelsFinder.html +5 -11
- package/docs/class/src/GenericFinder.js~GenericFinder.html +1 -0
- package/docs/class/src/InternalOpenGateAPI.js~InternalOpenGateAPI.html +1 -0
- package/docs/class/src/ProvisionGenericFinder.js~ProvisionGenericFinder.html +1 -0
- package/docs/class/src/alarms/AlarmActions.js~AlarmActions.html +1 -0
- package/docs/class/src/alarms/actions/Alarm.js~Operation.html +1 -0
- package/docs/class/src/alarms/actions/AlarmActionBuilder.js~AlarmActionBuilder.html +1 -0
- package/docs/class/src/alarms/actions/AlarmAttendBuilder.js~AlarmAttendBuilder.html +1 -0
- package/docs/class/src/alarms/actions/AlarmCloseBuilder.js~AlarmCloseBuilder.html +1 -0
- package/docs/class/src/areas/AreaFinder.js~AreaFinder.html +1 -0
- package/docs/class/src/areas/Areas.js~Areas.html +1 -0
- package/docs/class/src/bulk/BulkExecutionFinder.js~BulkExecutionFinder.html +1 -0
- package/docs/class/src/bulk/BulkFinder.js~BulkFinder.html +1 -0
- package/docs/class/src/bundles/BundleFinder.js~BundleFinder.html +1 -0
- package/docs/class/src/bundles/Bundles.js~Bundles.html +1 -0
- package/docs/class/src/bundles/deployment/DeploymentElement.js~DeploymentElement.html +1 -0
- package/docs/class/src/channels/ChannelFinder.js~ChannelFinder.html +1 -0
- package/docs/class/src/channels/Channels.js~Channels.html +1 -0
- package/docs/class/src/collection/devices/DeviceMessage.js~DeviceMessage.html +1 -0
- package/docs/class/src/collection/devices/collect/CommsModuleMessage.js~CommsModuleMessage.html +1 -0
- package/docs/class/src/collection/devices/collect/Datapoint.js~Datapoint.html +1 -0
- package/docs/class/src/collection/devices/collect/Datastreams.js~Datastream.html +1 -0
- package/docs/class/src/collection/devices/collect/Event.js~Event.html +1 -0
- package/docs/class/src/collection/devices/collect/Hardware.js~Hardware.html +1 -0
- package/docs/class/src/collection/devices/collect/Location.js~Location.html +1 -0
- package/docs/class/src/collection/devices/collect/Mobile.js~Mobile.html +1 -0
- package/docs/class/src/collection/devices/collect/PowerSupply.js~PowerSupply.html +1 -0
- package/docs/class/src/collection/devices/collect/Software.js~Software.html +1 -0
- package/docs/class/src/collection/devices/collect/Storage.js~Storage.html +1 -0
- package/docs/class/src/collection/devices/collect/Subscriber.js~Subscriber.html +1 -0
- package/docs/class/src/collection/devices/collect/Subscription.js~Subscription.html +1 -0
- package/docs/class/src/collection/devices/collect/Temperature.js~Temperature.html +1 -0
- package/docs/class/src/collection/devices/collect/Usage.js~Usage.html +1 -0
- package/docs/class/src/connectorsFunctionsConfiguration/ConnectorFunctions.js~ConnectorFunctions.html +1 -0
- package/docs/class/src/connectorsFunctionsConfiguration/ConnectorFunctionsFinder.js~ConnectorFunctionsFinder.html +1 -0
- package/docs/class/src/connectorsFunctionsConfiguration/ConnectorFunctionsHelper.js~ConnectorFunctionsHelper.html +1 -0
- package/docs/class/src/datasets/DatasetFinder.js~DatasetFinder.html +1 -0
- package/docs/class/src/datasets/Datasets.js~Datasets.html +1 -0
- package/docs/class/src/domains/Domains.js~Domains.html +1 -0
- package/docs/class/src/domains/DomainsFinder.js~DomainFinder.html +1 -0
- package/docs/class/src/entities/DeviceFinder.js~DeviceFinder.html +1 -0
- package/docs/class/src/entities/EntityFinder.js~EntityFinder.html +1 -0
- package/docs/class/src/entities/SubscribersFinder.js~SubscribersFinder.html +1 -0
- package/docs/class/src/entities/SubscriptionsFinder.js~SubscriptionsFinder.html +1 -0
- package/docs/class/src/entities/TicketFinder.js~TicketFinder.html +1 -0
- package/docs/class/src/geocluster/Geocluster.js~Geocluster.html +1 -0
- package/docs/class/src/geocluster/GeoclusterFinder.js~GeoclusterFinder.html +1 -0
- package/docs/class/src/iot/catalog/Category.js~Category.html +1 -0
- package/docs/class/src/iot/catalog/Datastream.js~Datastream.html +1 -0
- package/docs/class/src/iot/catalog/Qrating.js~Qrating.html +1 -0
- package/docs/class/src/iot/datamodels/Datamodels.js~Datamodels.html +1 -0
- package/docs/class/src/iot/datamodels/DatamodelsFinder.js~DatamodelsFinder.html +1 -0
- package/docs/class/src/iot/datamodels/DatamodelsHelper.js~DatamodelsHelper.html +1 -0
- package/docs/class/src/manufacturers/Manufacturer.js~Manufacturers.html +1 -0
- package/docs/class/src/manufacturers/ManufacturerFinder.js~ManufacturerFinder.html +1 -0
- package/docs/class/src/manufacturers/ManufacturerMedia.js~ManufacturerMedia.html +1 -0
- package/docs/class/src/manufacturers/Model.js~Models.html +1 -0
- package/docs/class/src/manufacturers/ModelFinder.js~ModelFinder.html +1 -0
- package/docs/class/src/manufacturers/ModelMedia.js~ModelMedia.html +1 -0
- package/docs/class/src/operationTypes/OperationType.js~OperationType.html +1 -0
- package/docs/class/src/operationTypes/OperationTypeCatalog.js~OperationTypesCatalog.html +1 -0
- package/docs/class/src/operationTypes/OperationTypeFinder.js~OperationTypeFinder.html +1 -0
- package/docs/class/src/operations/OperationActions.js~OperationActions.html +1 -0
- package/docs/class/src/operations/OperationFinder.js~OperationFinder.html +1 -0
- package/docs/class/src/operations/Operations.js~Operations.html +1 -0
- package/docs/class/src/operations/PeriodicityActions.js~PeriodicityActions.html +1 -0
- package/docs/class/src/operations/catalog/AppendEntitiesBy.js~AppendEntitiesBy.html +1 -0
- package/docs/class/src/operations/catalog/BaseOperationBuilder.js~BaseOperationBuilder.html +1 -0
- package/docs/class/src/operations/catalog/Operation.js~Operation.html +1 -0
- package/docs/class/src/operations/catalog/parameters/BaseParameterBuilderWithParent.js~BaseParameterBuilderWithParent.html +1 -0
- package/docs/class/src/operations/catalog/parameters/ParameterBuilderFactory.js~ParameterBuilderFactory.html +1 -0
- package/docs/class/src/operations/catalog/period/ExecuteEachBuilder.js~ExecuteEachBuilder.html +1 -0
- package/docs/class/src/operations/catalog/period/ExecuteEveryBuilder.js~ExecuteEveryBuilder.html +1 -0
- package/docs/class/src/operations/catalog/period/PeriodicityUpdateBuilder.js~PeriodicityUpdateBuilder.html +1 -0
- package/docs/class/src/operations/catalog/period/pattern/ByGeneric.js~ByGeneric.html +1 -0
- package/docs/class/src/operations/catalog/period/pattern/ByMonth.js~ByMonth.html +1 -0
- package/docs/class/src/operations/catalog/period/pattern/ByWeek.js~ByWeek.html +1 -0
- package/docs/class/src/operations/catalog/period/pattern/ByYear.js~ByYear.html +1 -0
- package/docs/class/src/organizations/OrganizationFinder.js~OrganizationFinder.html +1 -0
- package/docs/class/src/organizations/Organizations.js~Organizations.html +1 -0
- package/docs/class/src/pipelines/PipelineFinder.js~PipelineFinder.html +1 -0
- package/docs/class/src/pipelines/Pipelines.js~Pipelines.html +1 -0
- package/docs/class/src/provision/BaseProvision.js~BaseProvision.html +1 -0
- package/docs/class/src/provision/bulk/BulkExecutionBuilder.js~BulkExecutionBuilder.html +1 -0
- package/docs/class/src/provision/country/CountriesCatalog.js~CountriesCatalog.html +1 -0
- package/docs/class/src/provision/entities/AssetBuilder.js~AssetBuilder.html +1 -0
- package/docs/class/src/provision/entities/BulkBuilder.js~BulkBuilder.html +1 -0
- package/docs/class/src/provision/entities/ComplexBuilder.js~ComplexBuilder.html +1 -0
- package/docs/class/src/provision/entities/CsvBulkBuilder.js~CsvBulkBuilder.html +1 -0
- package/docs/class/src/provision/entities/DeviceBuilder.js~DeviceBuilder.html +1 -0
- package/docs/class/src/provision/entities/EntityBuilder.js~EntityBuilder.html +1 -0
- package/docs/class/src/provision/entities/JsonBulkBuilder.js~JsonBulkBuilder.html +1 -0
- package/docs/class/src/provision/entities/JsonFlattenedBulkBuilder.js~JsonFlattenedBulkBuilder.html +1 -0
- package/docs/class/src/provision/entities/SimpleBuilder.js~SimpleBuilder.html +1 -0
- package/docs/class/src/provision/entities/SubscriberBuilder.js~SubscriberBuilder.html +1 -0
- package/docs/class/src/provision/entities/SubscriptionBuilder.js~SubscriptionBuilder.html +1 -0
- package/docs/class/src/provision/entities/TicketBuilder.js~TicketBuilder.html +1 -0
- package/docs/class/src/provisionProcessors/provisionProcessors.js~ProvisionProcessors.html +1 -0
- package/docs/class/src/provisionProcessors/provisionProcessorsFinder.js~provisionProcessorsFinder.html +1 -0
- package/docs/class/src/rulesConfiguration/RuleConfigurations.js~RuleConfigurations.html +1 -0
- package/docs/class/src/rulesConfiguration/RuleConfigurationsActions.js~RuleConfigurationsActions.html +1 -0
- package/docs/class/src/rulesConfiguration/RuleConfigurationsCatalog.js~RuleConfigurationsCatalog.html +1 -0
- package/docs/class/src/rulesConfiguration/RuleConfigurationsFinder.js~RuleConfigurationsFinder.html +1 -0
- package/docs/class/src/rulesConfiguration/RuleConfigurationsHelper.js~RuleConfigurationsHelper.html +1 -0
- package/docs/class/src/searching/AssetSearch.js~AssetSearch.html +1 -0
- package/docs/class/src/searching/BaseSearch.js~BaseSearch.html +2 -1
- package/docs/class/src/searching/DeviceSearch.js~DeviceSearch.html +1 -0
- package/docs/class/src/searching/EntitySearch.js~EntitySearch.html +1 -0
- package/docs/class/src/searching/FilterBuilder.js~FilterBuilder.html +1 -0
- package/docs/class/src/searching/Search.js~Search.html +1 -0
- package/docs/class/src/searching/SearchWithoutLimit.js~SearchWithoutLimit.html +636 -0
- package/docs/class/src/searching/SelectBuilder.js~SelectBuilder.html +1 -0
- package/docs/class/src/searching/StaticSearch.js~StaticSearch.html +1 -0
- package/docs/class/src/searching/WPSearch.js~WPSearch.html +1 -0
- package/docs/class/src/searching/builder/AdministrativeStateSearchBuilder.js~AdministrativeStateSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/AlarmsSearchBuilder.js~AlarmsSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/AllowedResourceTypeSearchBuilder.js~AllowedResourceTypeSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/AreasSearchBuilder.js~AreasSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/AssetsSearchBuilder.js~AssetsSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/BasicTypesSearchBuilder.js~BasicTypesSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/BulkExecutionSearchBuilder.js~BulkExecutionSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/BulkSearchBuilder.js~BulkSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/BundlesSearchBuilder.js~BundlesSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/CertificatesSearchBuilder.js~CertificatesSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/ChannelsSearchBuilder.js~ChannelsSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/CommunicationsModuleTypeSearchBuilder.js~CommunicationsModuleTypeSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/CountryCodesSearchBuilder.js~CountryCodesSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/DatamodelsSearchBuilder.js~DatamodelsSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/DatapointsSearchBuilder.js~DatapointsSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/DatasetEntitiesSearchBuilder.js~DatasetEntitiesSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/DatasetSearchBuilder.js~DatasetSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/DatasetsCatalogSearchBuilder.js~DatasetsCatalogSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/DatastreamsSearchBuilder.js~DatastreamsSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/DevicesPlansSearchBuilder.js~DevicesPlansSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/DevicesSearchBuilder.js~DevicesSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/DomainsSearchBuilder.js~DomainsSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/EntitiesSearchBuilder.js~EntitiesSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/ExecutionsHistorySearchBuilder.js~ExecutionsHistorySearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/ExecutionsSearchBuilder.js~ExecutionsSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/FeedsSearchBuilder.js~FeedsSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/FieldsDefinitionSearchBuilder.js~FieldsDefinitionSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/FlattenedSearchBuilder.js~FlattenedSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/HardwaresSearchBuilder.js~HardwaresSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/IoTDatastreamAccessSearchBuilder.js~IoTDatastreamAccessSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/IoTDatastreamPeriodSearchBuilder.js~IoTDatastreamPeriodSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/IoTDatastreamStoragePeriodSearchBuilder.js~IoTDatastreamStoragePeriodSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/MobilePhoneProviderSearchBuilder.js~MobilePhoneProviderSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/OperationTypesSearchBuilder.js~OperationTypesBuilder.html +113 -1
- package/docs/class/src/searching/builder/OperationalStatusSearchBuilder.js~OperationalStatusSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/OperationsSearchBuilder.js~OperationsSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/OrganizationsSearchBuilder.js~OrganizationsSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/PlansSearchBuilder.js~PlansSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/PreFilteredSearchBuilder.js~PreFilteredSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/RawSearchBuilder.js~RawSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/ResourceTypeSearchBuilder.js~ResourceTypeSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/RuleConfigurationSeveritySearchBuilder.js~RuleConfigurationSeveritySearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/RuleModeSearchBuilder.js~RuleModeSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/RuleTypeSearchBuilder.js~RuleTypeSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/RulesSearchBuilder.js~RulesSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/SearchBuilder.js~SearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/SearchWithSummaryBuilder.js~SearchWithSummaryBuilder.html +1 -0
- package/docs/class/src/searching/builder/ServiceGroupSearchBuilder.js~ServiceGroupSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/SoftwaresSearchBuilder.js~SoftwaresSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/SubscribersSearchBuilder.js~SubscribersSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/SubscriptionsSearchBuilder.js~SubscriptionsSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/TasksSearchBuilder.js~TasksSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/TicketPrioritySearchBuilder.js~TicketPrioritySearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/TicketSeveritySearchBuilder.js~TicketSeveritySearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/TicketStatusSearchBuilder.js~TicketStatusSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/TicketsSearchBuilder.js~TicketsSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/TimeserieSearchBuilder.js~TimeserieSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/TimezoneSearchBuilder.js~TimezoneSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/UserLanguagesSearchBuilder.js~UserLanguagesSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/UserProfilesSearchBuilder.js~UserProfilesSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/UsersSearchBuilder.js~UsersSearchBuilder.html +1 -0
- package/docs/class/src/searching/builder/WorkgroupsSearchBuilder.js~WorkgroupsSearchBuilder.html +1 -0
- package/docs/class/src/searching/error/SearchBuilderError.js~SearchBuilderError.html +1 -0
- package/docs/class/src/security/CertificateFinder.js~CertificateFinder.html +1 -0
- package/docs/class/src/security/Certificates.js~Certificates.html +1 -0
- package/docs/class/src/security/Security.js~Security.html +1 -0
- package/docs/class/src/timeseries/Timeseries.js~Timeseries.html +1 -0
- package/docs/class/src/timeseries/TimeseriesFinder.js~TimeseriesFinder.html +1 -0
- package/docs/class/src/transformers/TransformerFinder.js~TransformerFinder.html +1 -0
- package/docs/class/src/transformers/Transformers.js~Transformers.html +1 -0
- package/docs/class/src/users/UserFinder.js~UserFinder.html +1 -0
- package/docs/class/src/users/Users.js~User.html +1 -0
- package/docs/class/src/util/Expression.js~Expression.html +1 -0
- package/docs/class/src/util/NorthAmpliaREST.js~NorthAmpliaREST.html +1 -0
- package/docs/class/src/util/SelectElement.js~SelectElement.html +1 -0
- package/docs/class/src/util/SouthAmpliaREST.js~SouthAmpliaREST.html +1 -0
- package/docs/class/src/util/searchingFields/FieldFinder.js~FieldFinder.html +1 -0
- package/docs/class/src/workgroups/WorkgroupFinder.js~WorkgroupFinder.html +1 -0
- package/docs/class/src/workgroups/WorkgroupRelations.js~WorkgroupRelations.html +1 -0
- package/docs/class/src/workgroups/WorkgroupRelationsFinder.js~WorkgroupRelationsFinder.html +1 -0
- package/docs/class/src/workgroups/Workgroups.js~Workgroups.html +1 -0
- package/docs/coverage.json +10 -5
- package/docs/dump.json +1353 -1134
- package/docs/file/src/AIModels/AIModels.js.html +1 -0
- package/docs/file/src/AIModels/AIModelsFinder.js.html +6 -6
- package/docs/file/src/GenericFinder.js.html +1 -0
- package/docs/file/src/InternalOpenGateAPI.js.html +1 -0
- package/docs/file/src/ProvisionGenericFinder.js.html +1 -0
- package/docs/file/src/alarms/AlarmActions.js.html +1 -0
- package/docs/file/src/alarms/actions/Alarm.js.html +1 -0
- package/docs/file/src/alarms/actions/AlarmActionBuilder.js.html +1 -0
- package/docs/file/src/alarms/actions/AlarmAttendBuilder.js.html +1 -0
- package/docs/file/src/alarms/actions/AlarmCloseBuilder.js.html +1 -0
- package/docs/file/src/areas/AreaFinder.js.html +1 -0
- package/docs/file/src/areas/Areas.js.html +1 -0
- package/docs/file/src/areas/TYPE_ENUM.js.html +1 -0
- package/docs/file/src/bulk/BulkExecutionFinder.js.html +1 -0
- package/docs/file/src/bulk/BulkFinder.js.html +1 -0
- package/docs/file/src/bundles/ACTION_ENUM.js.html +1 -0
- package/docs/file/src/bundles/BundleFinder.js.html +1 -0
- package/docs/file/src/bundles/Bundles.js.html +1 -0
- package/docs/file/src/bundles/deployment/DeploymentElement.js.html +1 -0
- package/docs/file/src/bundles/deployment/MODE_VALIDATORS_ENUM.js.html +1 -0
- package/docs/file/src/bundles/deployment/OPERATION_ENUM.js.html +1 -0
- package/docs/file/src/bundles/deployment/OPTION_ENUM.js.html +1 -0
- package/docs/file/src/bundles/deployment/TYPE_ENUM.js.html +1 -0
- package/docs/file/src/bundles/deployment/TYPE_VALIDATORS_ENUM.js.html +1 -0
- package/docs/file/src/channels/ChannelFinder.js.html +1 -0
- package/docs/file/src/channels/Channels.js.html +1 -0
- package/docs/file/src/collection/devices/DeviceMessage.js.html +1 -0
- package/docs/file/src/collection/devices/collect/CommsModuleMessage.js.html +1 -0
- package/docs/file/src/collection/devices/collect/Datapoint.js.html +1 -0
- package/docs/file/src/collection/devices/collect/Datastreams.js.html +1 -0
- package/docs/file/src/collection/devices/collect/Event.js.html +1 -0
- package/docs/file/src/collection/devices/collect/Hardware.js.html +1 -0
- package/docs/file/src/collection/devices/collect/Location.js.html +1 -0
- package/docs/file/src/collection/devices/collect/Mobile.js.html +1 -0
- package/docs/file/src/collection/devices/collect/PowerSupply.js.html +1 -0
- package/docs/file/src/collection/devices/collect/Software.js.html +1 -0
- package/docs/file/src/collection/devices/collect/Storage.js.html +1 -0
- package/docs/file/src/collection/devices/collect/Subscriber.js.html +1 -0
- package/docs/file/src/collection/devices/collect/Subscription.js.html +1 -0
- package/docs/file/src/collection/devices/collect/Temperature.js.html +1 -0
- package/docs/file/src/collection/devices/collect/Usage.js.html +1 -0
- package/docs/file/src/collection/devices/collect/enum/ADDRESS_TYPE_ENUM.js.html +1 -0
- package/docs/file/src/collection/devices/collect/enum/ANTENNA_STATUS_ENUM.js.html +1 -0
- package/docs/file/src/collection/devices/collect/enum/BATTERY_CHARGE_LEVEL_STATUS_ENUM.js.html +1 -0
- package/docs/file/src/collection/devices/collect/enum/BATTERY_CHARGE_STATUS_ENUM.js.html +1 -0
- package/docs/file/src/collection/devices/collect/enum/LEVEL_TREND_ENUM.js.html +1 -0
- package/docs/file/src/collection/devices/collect/enum/POWER_SUPPLY_SOURCE_ENUM.js.html +1 -0
- package/docs/file/src/collection/devices/collect/enum/SOFTWARE_TYPE_ENUM.js.html +1 -0
- package/docs/file/src/collection/devices/collect/enum/TEMPERATURE_STATUS_ENUM.js.html +1 -0
- package/docs/file/src/connectorsFunctionsConfiguration/ConnectorFunctions.js.html +1 -0
- package/docs/file/src/connectorsFunctionsConfiguration/ConnectorFunctionsFinder.js.html +1 -0
- package/docs/file/src/connectorsFunctionsConfiguration/ConnectorFunctionsHelper.js.html +1 -0
- package/docs/file/src/connectorsFunctionsConfiguration/enum/_CONNECTOR_FUNCTIONS_ENUMS.js.html +1 -0
- package/docs/file/src/datasets/DatasetFinder.js.html +1 -0
- package/docs/file/src/datasets/Datasets.js.html +1 -0
- package/docs/file/src/domains/Domains.js.html +1 -0
- package/docs/file/src/domains/DomainsFinder.js.html +1 -0
- package/docs/file/src/entities/DeviceFinder.js.html +1 -0
- package/docs/file/src/entities/EntityFinder.js.html +1 -0
- package/docs/file/src/entities/SubscribersFinder.js.html +1 -0
- package/docs/file/src/entities/SubscriptionsFinder.js.html +1 -0
- package/docs/file/src/entities/TicketFinder.js.html +1 -0
- package/docs/file/src/geocluster/Geocluster.js.html +1 -0
- package/docs/file/src/geocluster/GeoclusterFinder.js.html +1 -0
- package/docs/file/src/iot/catalog/Category.js.html +1 -0
- package/docs/file/src/iot/catalog/Datastream.js.html +1 -0
- package/docs/file/src/iot/catalog/Qrating.js.html +1 -0
- package/docs/file/src/iot/datamodels/Datamodels.js.html +1 -0
- package/docs/file/src/iot/datamodels/DatamodelsFinder.js.html +1 -0
- package/docs/file/src/iot/datamodels/DatamodelsHelper.js.html +1 -0
- package/docs/file/src/manufacturers/Manufacturer.js.html +1 -0
- package/docs/file/src/manufacturers/ManufacturerFinder.js.html +1 -0
- package/docs/file/src/manufacturers/ManufacturerMedia.js.html +1 -0
- package/docs/file/src/manufacturers/Model.js.html +1 -0
- package/docs/file/src/manufacturers/ModelFinder.js.html +1 -0
- package/docs/file/src/manufacturers/ModelMedia.js.html +1 -0
- package/docs/file/src/operationTypes/OperationType.js.html +1 -0
- package/docs/file/src/operationTypes/OperationTypeCatalog.js.html +1 -0
- package/docs/file/src/operationTypes/OperationTypeFinder.js.html +1 -0
- package/docs/file/src/operations/OperationActions.js.html +1 -0
- package/docs/file/src/operations/OperationFinder.js.html +1 -0
- package/docs/file/src/operations/Operations.js.html +1 -0
- package/docs/file/src/operations/PeriodicityActions.js.html +1 -0
- package/docs/file/src/operations/catalog/AppendEntitiesBy.js.html +1 -0
- package/docs/file/src/operations/catalog/BaseOperationBuilder.js.html +1 -0
- package/docs/file/src/operations/catalog/Operation.js.html +1 -0
- package/docs/file/src/operations/catalog/parameters/BaseParameterBuilderWithParent.js.html +1 -0
- package/docs/file/src/operations/catalog/parameters/ParameterBuilderFactory.js.html +1 -0
- package/docs/file/src/operations/catalog/period/DAYS_ENUM.js.html +1 -0
- package/docs/file/src/operations/catalog/period/ExecuteEachBuilder.js.html +1 -0
- package/docs/file/src/operations/catalog/period/ExecuteEveryBuilder.js.html +1 -0
- package/docs/file/src/operations/catalog/period/MONTHS_ENUM.js.html +1 -0
- package/docs/file/src/operations/catalog/period/PeriodicityUpdateBuilder.js.html +1 -0
- package/docs/file/src/operations/catalog/period/pattern/ByGeneric.js.html +1 -0
- package/docs/file/src/operations/catalog/period/pattern/ByMonth.js.html +1 -0
- package/docs/file/src/operations/catalog/period/pattern/ByWeek.js.html +1 -0
- package/docs/file/src/operations/catalog/period/pattern/ByYear.js.html +1 -0
- package/docs/file/src/organizations/OrganizationFinder.js.html +1 -0
- package/docs/file/src/organizations/Organizations.js.html +1 -0
- package/docs/file/src/pipelines/PipelineFinder.js.html +1 -0
- package/docs/file/src/pipelines/Pipelines.js.html +1 -0
- package/docs/file/src/provision/BaseProvision.js.html +1 -0
- package/docs/file/src/provision/bulk/BulkExecutionBuilder.js.html +1 -0
- package/docs/file/src/provision/country/CountriesCatalog.js.html +1 -0
- package/docs/file/src/provision/entities/AssetBuilder.js.html +1 -0
- package/docs/file/src/provision/entities/BulkBuilder.js.html +1 -0
- package/docs/file/src/provision/entities/ComplexBuilder.js.html +1 -0
- package/docs/file/src/provision/entities/CsvBulkBuilder.js.html +1 -0
- package/docs/file/src/provision/entities/DeviceBuilder.js.html +1 -0
- package/docs/file/src/provision/entities/EntityBuilder.js.html +1 -0
- package/docs/file/src/provision/entities/JsonBulkBuilder.js.html +1 -0
- package/docs/file/src/provision/entities/JsonFlattenedBulkBuilder.js.html +1 -0
- package/docs/file/src/provision/entities/SimpleBuilder.js.html +1 -0
- package/docs/file/src/provision/entities/SubscriberBuilder.js.html +1 -0
- package/docs/file/src/provision/entities/SubscriptionBuilder.js.html +1 -0
- package/docs/file/src/provision/entities/TicketBuilder.js.html +1 -0
- package/docs/file/src/provisionProcessors/provisionProcessors.js.html +1 -0
- package/docs/file/src/provisionProcessors/provisionProcessorsFinder.js.html +1 -0
- package/docs/file/src/rulesConfiguration/RuleConfigurations.js.html +1 -0
- package/docs/file/src/rulesConfiguration/RuleConfigurationsActions.js.html +1 -0
- package/docs/file/src/rulesConfiguration/RuleConfigurationsCatalog.js.html +1 -0
- package/docs/file/src/rulesConfiguration/RuleConfigurationsFinder.js.html +1 -0
- package/docs/file/src/rulesConfiguration/RuleConfigurationsHelper.js.html +1 -0
- package/docs/file/src/rulesConfiguration/_RuleCondition.js.html +1 -0
- package/docs/file/src/rulesConfiguration/_RuleNotification.js.html +1 -0
- package/docs/file/src/searching/AssetSearch.js.html +1 -0
- package/docs/file/src/searching/BaseSearch.js.html +1 -0
- package/docs/file/src/searching/DeviceSearch.js.html +1 -0
- package/docs/file/src/searching/EntitySearch.js.html +1 -0
- package/docs/file/src/searching/FilterBuilder.js.html +1 -0
- package/docs/file/src/searching/Search.js.html +1 -0
- package/docs/file/src/searching/SearchWithoutLimit.js.html +331 -0
- package/docs/file/src/searching/SelectBuilder.js.html +1 -0
- package/docs/file/src/searching/StaticSearch.js.html +1 -0
- package/docs/file/src/searching/WPSearch.js.html +1 -0
- package/docs/file/src/searching/builder/AdministrativeStateSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/AlarmsSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/AllowedResourceTypeSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/AreasSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/AssetsSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/BasicTypesSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/BulkExecutionSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/BulkSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/BundlesSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/CertificatesSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/ChannelsSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/CommunicationsModuleTypeSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/CountryCodesSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/DatamodelsSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/DatapointsSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/DatasetEntitiesSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/DatasetSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/DatasetsCatalogSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/DatastreamsSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/DevicesPlansSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/DevicesSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/DomainsSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/EntitiesSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/ExecutionsHistorySearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/ExecutionsSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/FeedsSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/FieldsDefinitionSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/FlattenedSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/HardwaresSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/IoTDatastreamAccessSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/IoTDatastreamPeriodSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/IoTDatastreamStoragePeriodSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/MobilePhoneProviderSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/OperationTypesSearchBuilder.js.html +28 -1
- package/docs/file/src/searching/builder/OperationalStatusSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/OperationsSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/OrganizationsSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/PlansSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/PreFilteredSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/RawSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/ResourceTypeSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/RuleConfigurationSeveritySearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/RuleModeSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/RuleTypeSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/RulesSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/SearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/SearchWithSummaryBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/ServiceGroupSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/SoftwaresSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/SubscribersSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/SubscriptionsSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/TasksSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/TicketPrioritySearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/TicketSeveritySearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/TicketStatusSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/TicketsSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/TimeserieSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/TimezoneSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/UserLanguagesSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/UserProfilesSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/UsersSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/builder/WorkgroupsSearchBuilder.js.html +1 -0
- package/docs/file/src/searching/error/SearchBuilderError.js.html +1 -0
- package/docs/file/src/security/ADMINISTRATIVE_STATE_ENUM.js.html +1 -0
- package/docs/file/src/security/CertificateFinder.js.html +1 -0
- package/docs/file/src/security/Certificates.js.html +1 -0
- package/docs/file/src/security/MIME_TYPES_ENUM.js.html +1 -0
- package/docs/file/src/security/Security.js.html +1 -0
- package/docs/file/src/security/USAGES_ENUM.js.html +1 -0
- package/docs/file/src/timeseries/Timeseries.js.html +1 -0
- package/docs/file/src/timeseries/TimeseriesFinder.js.html +1 -0
- package/docs/file/src/transformers/TransformerFinder.js.html +1 -0
- package/docs/file/src/transformers/Transformers.js.html +1 -0
- package/docs/file/src/users/UserFinder.js.html +1 -0
- package/docs/file/src/users/Users.js.html +1 -0
- package/docs/file/src/util/DATE_FORMAT.js.html +1 -0
- package/docs/file/src/util/Expression.js.html +1 -0
- package/docs/file/src/util/NorthAmpliaREST.js.html +1 -0
- package/docs/file/src/util/SelectElement.js.html +1 -0
- package/docs/file/src/util/SouthAmpliaREST.js.html +1 -0
- package/docs/file/src/util/formats/check_types.js.html +1 -0
- package/docs/file/src/util/searchingFields/FieldFinder.js.html +1 -0
- package/docs/file/src/util/searchingFields/IotFields.js.html +1 -0
- package/docs/file/src/util/searchingFields/source-precompiled/Fields.js.html +1 -0
- package/docs/file/src/workgroups/WorkgroupFinder.js.html +1 -0
- package/docs/file/src/workgroups/WorkgroupRelations.js.html +1 -0
- package/docs/file/src/workgroups/WorkgroupRelationsFinder.js.html +1 -0
- package/docs/file/src/workgroups/Workgroups.js.html +1 -0
- package/docs/identifiers.html +29 -0
- package/docs/index.html +1 -0
- package/docs/manual/index.html +28 -0
- package/docs/package.json +1 -1
- package/docs/script/search_index.js +27 -3
- package/docs/source.html +237 -228
- package/docs/test-file/client/autogeneratedFields/fields.spec.js.html +1 -0
- package/docs/test-file/client/bundles/bundles.spec.js.html +1 -0
- package/docs/test-file/client/collection/iot.spec.js.html +1 -0
- package/docs/test-file/client/device/device.spec.js.html +1 -0
- package/docs/test-file/client/provision/devices.provision.spec.js.html +1 -0
- package/docs/test-file/client/searching/FilterBuilder.spec.js.html +1 -0
- package/docs/test-file/client/searching/datapoints.search.spec.js.html +1 -0
- package/docs/test-file/client/searching/module.searching.spec.js.html +1 -0
- package/docs/test-file/client/searching/rawsearch.spec.js.html +1 -0
- package/docs/test-file/client/searching/search.spec.js.html +1 -0
- package/docs/test-file/client/security/certificates.spec.js.html +1 -0
- package/docs/test-file/client/users/find.spec.js.html +1 -0
- package/docs/test-file/client/users/user.spec.js.html +1 -0
- package/docs/test.html +1 -0
- package/docs/variable/index.html +1 -0
- package/package.json +1 -1
- package/src/AIModels/AIModelsFinder.js +5 -6
- package/src/searching/SearchWithoutLimit.js +33 -0
- package/src/searching/builder/OperationTypesSearchBuilder.js +27 -1
- package/dist/opengate-api-bower-12.9.2.js.map +0 -1
- package/dist/opengate-api-bower-12.9.2.min.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function e(t,r,n){function i(a,u){if(!r[a]){if(!t[a]){var s="function"==typeof require&&require;if(!u&&s)return s(a,!0);if(o)return o(a,!0);throw new Error("Cannot find module '"+a+"'")}var c=r[a]={exports:{}};t[a][0].call(c.exports,function(e){var r=t[a][1][e];return i(r||e)},c,c.exports,e,t,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a<n.length;a++)i(n[a]);return i}({1:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./src/InternalOpenGateAPI"),s=n(u),c=e("./src/util/NorthAmpliaREST"),l=n(c),f=e("./src/util/SouthAmpliaREST"),d=n(f),h=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,new l.default(e),new d.default(e),e)}return o(t,e),t}(s.default);r.default=h,window.OpenGateAPI=h,t.exports=r.default},{"./src/InternalOpenGateAPI":139,"./src/util/NorthAmpliaREST":339,"./src/util/SouthAmpliaREST":341}],2:[function(e,t,r){"use strict";function n(e){if(!(this instanceof n))return new n(e);e=this._opts=U.copy(e)||{},k(this),this._schemas={},this._refs={},this._fragments={},this._formats=R(e.format),this._cache=e.cache||new x,this._loadingSchemas={},this._compilations=[],this.RULES=I(),this._getId=v(e),e.loopRequired=e.loopRequired||1/0,"property"==e.errorDataPath&&(e._errorDataPathProperty=!0),void 0===e.serialize&&(e.serialize=M),this._metaOpts=C(this),e.formats&&S(this),e.keywords&&P(this),A(this),"object"==typeof e.meta&&this.addMetaSchema(e.meta),e.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),O(this)}function i(e,t){var r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var n=this._addSchema(e);r=n.validate||this._compile(n)}var i=r(t);return!0!==r.$async&&(this.errors=r.errors),i}function o(e,t){var r=this._addSchema(e,void 0,t);return r.validate||this._compile(r)}function a(e,t,r,n){if(Array.isArray(e)){for(var i=0;i<e.length;i++)this.addSchema(e[i],void 0,r,n);return this}var o=this._getId(e);if(void 0!==o&&"string"!=typeof o)throw new Error("schema id must be string");return t=j.normalizeId(t||o),D(this,t),this._schemas[t]=this._addSchema(e,r,n,!0),this}function u(e,t,r){return this.addSchema(e,t,r,!0),this}function s(e,t){var r=e.$schema;if(void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(!(r=r||this._opts.defaultMeta||c(this)))return this.logger.warn("meta-schema not available"),this.errors=null,!0;var n=this.validate(r,e);if(!n&&t){var i="schema is invalid: "+this.errorsText();if("log"!=this._opts.validateSchema)throw new Error(i);this.logger.error(i)}return n}function c(e){var t=e._opts.meta;return e._opts.defaultMeta="object"==typeof t?e._getId(t)||t:e.getSchema(G)?G:void 0,e._opts.defaultMeta}function l(e){var t=d(this,e);switch(typeof t){case"object":return t.validate||this._compile(t);case"string":return this.getSchema(t);case"undefined":return f(this,e)}}function f(e,t){var r=j.schema.call(e,{schema:{}},t);if(r){var n=r.schema,i=r.root,o=r.baseId,a=F.call(e,n,i,void 0,o);return e._fragments[t]=new B({ref:t,fragment:!0,schema:n,root:i,baseId:o,validate:a}),a}}function d(e,t){return t=j.normalizeId(t),e._schemas[t]||e._refs[t]||e._fragments[t]}function h(e){if(e instanceof RegExp)return p(this,this._schemas,e),p(this,this._refs,e),this;switch(typeof e){case"undefined":return p(this,this._schemas),p(this,this._refs),this._cache.clear(),this;case"string":var t=d(this,e);return t&&this._cache.del(t.cacheKey),delete this._schemas[e],delete this._refs[e],this;case"object":var r=this._opts.serialize,n=r?r(e):e;this._cache.del(n);var i=this._getId(e);i&&(i=j.normalizeId(i),delete this._schemas[i],delete this._refs[i])}return this}function p(e,t,r){for(var n in t){var i=t[n];i.meta||r&&!r.test(n)||(e._cache.del(i.cacheKey),delete t[n])}}function y(e,t,r,n){if("object"!=typeof e&&"boolean"!=typeof e)throw new Error("schema should be object or boolean");var i=this._opts.serialize,o=i?i(e):e,a=this._cache.get(o);if(a)return a;n=n||!1!==this._opts.addUsedSchema;var u=j.normalizeId(this._getId(e));u&&n&&D(this,u);var s,c=!1!==this._opts.validateSchema&&!t;c&&!(s=u&&u==j.normalizeId(e.$schema))&&this.validateSchema(e,!0);var l=j.ids.call(this,e),f=new B({id:u,schema:e,localRefs:l,cacheKey:o,meta:r});return"#"!=u[0]&&n&&(this._refs[u]=f),this._cache.put(o,f),c&&s&&this.validateSchema(e,!0),f}function m(e,t){function r(){var t=e.validate,n=t.apply(this,arguments);return r.errors=t.errors,n}if(e.compiling)return e.validate=r,r.schema=e.schema,r.errors=null,r.root=t||r,!0===e.schema.$async&&(r.$async=!0),r;e.compiling=!0;var n;e.meta&&(n=this._opts,this._opts=this._metaOpts);var i;try{i=F.call(this,e.schema,t,e.localRefs)}catch(t){throw delete e.validate,t}finally{e.compiling=!1,e.meta&&(this._opts=n)}return e.validate=i,e.refs=i.refs,e.refVal=i.refVal,e.root=i.root,i}function v(e){switch(e.schemaId){case"auto":return b;case"id":return _;default:return g}}function _(e){return e.$id&&this.logger.warn("schema $id ignored",e.$id),e.id}function g(e){return e.id&&this.logger.warn("schema id ignored",e.id),e.$id}function b(e){if(e.$id&&e.id&&e.$id!=e.id)throw new Error("schema $id is different from id");return e.$id||e.id}function w(e,t){if(!(e=e||this.errors))return"No errors";t=t||{};for(var r=void 0===t.separator?", ":t.separator,n=void 0===t.dataVar?"data":t.dataVar,i="",o=0;o<e.length;o++){var a=e[o];a&&(i+=n+a.dataPath+" "+a.message+r)}return i.slice(0,-r.length)}function E(e,t){return"string"==typeof t&&(t=new RegExp(t)),this._formats[e]=t,this}function A(t){var r;if(t._opts.$data&&(r=e("./refs/data.json"),t.addMetaSchema(r,r.$id,!0)),!1!==t._opts.meta){var n=e("./refs/json-schema-draft-07.json");t._opts.$data&&(n=N(n,V)),t.addMetaSchema(n,G,!0),t._refs["http://json-schema.org/schema"]=G}}function O(e){var t=e._opts.schemas;if(t)if(Array.isArray(t))e.addSchema(t);else for(var r in t)e.addSchema(t[r],r)}function S(e){for(var t in e._opts.formats){var r=e._opts.formats[t];e.addFormat(t,r)}}function P(e){for(var t in e._opts.keywords){var r=e._opts.keywords[t];e.addKeyword(t,r)}}function D(e,t){if(e._schemas[t]||e._refs[t])throw new Error('schema with key or id "'+t+'" already exists')}function C(e){for(var t=U.copy(e._opts),r=0;r<q.length;r++)delete t[q[r]];return t}function k(e){var t=e._opts.logger;if(!1===t)e.logger={log:T,warn:T,error:T};else{if(void 0===t&&(t=console),!("object"==typeof t&&t.log&&t.warn&&t.error))throw new Error("logger must implement log, warn and error methods");e.logger=t}}function T(){}var F=e("./compile"),j=e("./compile/resolve"),x=e("./cache"),B=e("./compile/schema_obj"),M=e("fast-json-stable-stringify"),R=e("./compile/formats"),I=e("./compile/rules"),N=e("./data"),U=e("./compile/util");t.exports=n,n.prototype.validate=i,n.prototype.compile=o,n.prototype.addSchema=a,n.prototype.addMetaSchema=u,n.prototype.validateSchema=s,n.prototype.getSchema=l,n.prototype.removeSchema=h,n.prototype.addFormat=E,n.prototype.errorsText=w,n.prototype._addSchema=y,n.prototype._compile=m,n.prototype.compileAsync=e("./compile/async");var L=e("./keyword");n.prototype.addKeyword=L.add,n.prototype.getKeyword=L.get,n.prototype.removeKeyword=L.remove,n.prototype.validateKeyword=L.validate;var z=e("./compile/error_classes");n.ValidationError=z.Validation,n.MissingRefError=z.MissingRef,n.$dataMetaSchema=N;var G="http://json-schema.org/draft-07/schema",q=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],V=["/properties"]},{"./cache":3,"./compile":7,"./compile/async":4,"./compile/error_classes":5,"./compile/formats":6,"./compile/resolve":8,"./compile/rules":9,"./compile/schema_obj":10,"./compile/util":12,"./data":13,"./keyword":41,"./refs/data.json":42,"./refs/json-schema-draft-07.json":43,"fast-json-stable-stringify":75}],3:[function(e,t,r){"use strict";var n=t.exports=function(){this._cache={}};n.prototype.put=function(e,t){this._cache[e]=t},n.prototype.get=function(e){return this._cache[e]},n.prototype.del=function(e){delete this._cache[e]},n.prototype.clear=function(){this._cache={}}},{}],4:[function(e,t,r){"use strict";function n(e,t,r){function o(e){var t=e.$schema;return t&&!u.getSchema(t)?n.call(u,{$ref:t},!0):Promise.resolve()}function a(e){try{return u._compile(e)}catch(r){if(r instanceof i)return function(r){function n(){delete u._loadingSchemas[s]}function i(e){return u._refs[e]||u._schemas[e]}var s=r.missingSchema;if(i(s))throw new Error("Schema "+s+" is loaded but "+r.missingRef+" cannot be resolved");var c=u._loadingSchemas[s];return c||(c=u._loadingSchemas[s]=u._opts.loadSchema(s),c.then(n,n)),c.then(function(e){if(!i(s))return o(e).then(function(){i(s)||u.addSchema(e,s,void 0,t)})}).then(function(){return a(e)})}(r);throw r}}var u=this;if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");"function"==typeof t&&(r=t,t=void 0);var s=o(e).then(function(){var r=u._addSchema(e,void 0,t);return r.validate||a(r)});return r&&s.then(function(e){r(null,e)},r),s}var i=e("./error_classes").MissingRef;t.exports=n},{"./error_classes":5}],5:[function(e,t,r){"use strict";function n(e){this.message="validation failed",this.errors=e,this.ajv=this.validation=!0}function i(e,t,r){this.message=r||i.message(e,t),this.missingRef=a.url(e,t),this.missingSchema=a.normalizeId(a.fullPath(this.missingRef))}function o(e){return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var a=e("./resolve");t.exports={Validation:o(n),MissingRef:o(i)},i.message=function(e,t){return"can't resolve reference "+t+" from id "+e}},{"./resolve":8}],6:[function(e,t,r){"use strict";function n(e){return e="full"==e?"full":"fast",l.copy(n[e])}function i(e){return e%4==0&&(e%100!=0||e%400==0)}function o(e){var t=e.match(f);if(!t)return!1;var r=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(2==n&&i(r)?29:d[n])}function a(e,t){var r=e.match(h);if(!r)return!1;var n=r[1],i=r[2],o=r[3],a=r[5];return(n<=23&&i<=59&&o<=59||23==n&&59==i&&60==o)&&(!t||a)}function u(e){var t=e.split(A);return 2==t.length&&o(t[0])&&a(t[1],!0)}function s(e){return O.test(e)&&y.test(e)}function c(e){if(S.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}var l=e("./util"),f=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,d=[0,31,28,31,30,31,30,31,31,30,31,30,31],h=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,p=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,y=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,m=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,v=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,_=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,g=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,b=/^(?:\/(?:[^~/]|~0|~1)*)*$/,w=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,E=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;t.exports=n,n.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":v,url:_,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:p,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:c,uuid:g,"json-pointer":b,"json-pointer-uri-fragment":w,"relative-json-pointer":E},n.full={date:o,time:a,"date-time":u,uri:s,"uri-reference":m,"uri-template":v,url:_,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:p,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:c,uuid:g,"json-pointer":b,"json-pointer-uri-fragment":w,"relative-json-pointer":E};var A=/t|\s/i,O=/\/|:/,S=/[^\\]\\Z/},{"./util":12}],7:[function(e,t,r){"use strict";function n(e,t,r,a){function b(){var e=L.validate,t=e.apply(this,arguments);return b.errors=e.errors,t}function w(e,r,i,o){var a=!r||r&&r.schema==e;if(r.schema!=t.schema)return n.call(T,e,r,i,o);var y=!0===e.$async,b=m({isTop:!0,schema:e,isRoot:a,baseId:o,root:r,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:p.MissingRef,RULES:G,validate:m,util:h,resolve:d,resolveRef:E,usePattern:D,useDefault:C,useCustomRule:k,opts:F,formats:z,logger:T.logger,self:T});b=f(j,c)+f(B,u)+f(R,s)+f(N,l)+b,F.processCode&&(b=F.processCode(b));var w;try{w=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",b)(T,G,z,t,j,R,N,_,v,g),j[0]=w}catch(e){throw T.logger.error("Error compiling schema, function code:",b),e}return w.schema=e,w.errors=null,w.refs=x,w.refVal=j,w.root=a?w:r,y&&(w.$async=!0),!0===F.sourceCode&&(w.source={code:b,patterns:B,defaults:R}),w}function E(e,i,o){i=d.url(e,i);var a,u,s=x[i];if(void 0!==s)return a=j[s],u="refVal["+s+"]",P(a,u);if(!o&&t.refs){var c=t.refs[i];if(void 0!==c)return a=t.refVal[c],u=A(i,a),P(a,u)}u=A(i);var l=d.call(T,w,t,i);if(void 0===l){var f=r&&r[i];f&&(l=d.inlineRef(f,F.inlineRefs)?f:n.call(T,f,t,r,e))}if(void 0!==l)return S(i,l),P(l,u);O(i)}function A(e,t){var r=j.length;return j[r]=t,x[e]=r,"refVal"+r}function O(e){delete x[e]}function S(e,t){var r=x[e];j[r]=t}function P(e,t){return"object"==typeof e||"boolean"==typeof e?{code:t,schema:e,inline:!0}:{code:t,$async:e&&!!e.$async}}function D(e){var t=M[e];return void 0===t&&(t=M[e]=B.length,B[t]=e),"pattern"+t}function C(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return h.toQuotedString(e);case"object":if(null===e)return"null";var t=y(e),r=I[t];return void 0===r&&(r=I[t]=R.length,R[r]=e),"default"+r}}function k(e,t,r,n){if(!1!==T._opts.validateSchema){var i=e.definition.dependencies;if(i&&!i.every(function(e){return Object.prototype.hasOwnProperty.call(r,e)}))throw new Error("parent schema must have all required keywords: "+i.join(","));var o=e.definition.validateSchema;if(o){if(!o(t)){var a="keyword schema is invalid: "+T.errorsText(o.errors);if("log"!=T._opts.validateSchema)throw new Error(a);T.logger.error(a)}}}var u,s=e.definition.compile,c=e.definition.inline,l=e.definition.macro;if(s)u=s.call(T,t,r,n);else if(l)u=l.call(T,t,r,n),!1!==F.validateSchema&&T.validateSchema(u,!0);else if(c)u=c.call(T,n,e.keyword,t,r);else if(!(u=e.definition.validate))return;if(void 0===u)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var f=N.length;return N[f]=u,{code:"customRule"+f,validate:u}}var T=this,F=this._opts,j=[void 0],x={},B=[],M={},R=[],I={},N=[];t=t||{schema:e,refVal:j,refs:x};var U=i.call(this,e,t,a),L=this._compilations[U.index];if(U.compiling)return L.callValidate=b;var z=this._formats,G=this.RULES;try{var q=w(e,t,r,a);L.validate=q;var V=L.callValidate;return V&&(V.schema=q.schema,V.errors=null,V.refs=q.refs,V.refVal=q.refVal,V.root=q.root,V.$async=q.$async,F.sourceCode&&(V.source=q.source)),q}finally{o.call(this,e,t,a)}}function i(e,t,r){var n=a.call(this,e,t,r);return n>=0?{index:n,compiling:!0}:(n=this._compilations.length,this._compilations[n]={schema:e,root:t,baseId:r},{index:n,compiling:!1})}function o(e,t,r){var n=a.call(this,e,t,r);n>=0&&this._compilations.splice(n,1)}function a(e,t,r){for(var n=0;n<this._compilations.length;n++){var i=this._compilations[n];if(i.schema==e&&i.root==t&&i.baseId==r)return n}return-1}function u(e,t){return"var pattern"+e+" = new RegExp("+h.toQuotedString(t[e])+");"}function s(e){return"var default"+e+" = defaults["+e+"];"}function c(e,t){return void 0===t[e]?"":"var refVal"+e+" = refVal["+e+"];"}function l(e){return"var customRule"+e+" = customRules["+e+"];"}function f(e,t){if(!e.length)return"";for(var r="",n=0;n<e.length;n++)r+=t(n,e);return r}var d=e("./resolve"),h=e("./util"),p=e("./error_classes"),y=e("fast-json-stable-stringify"),m=e("../dotjs/validate"),v=h.ucs2length,_=e("fast-deep-equal"),g=p.Validation;t.exports=n},{"../dotjs/validate":40,"./error_classes":5,"./resolve":8,"./util":12,"fast-deep-equal":74,"fast-json-stable-stringify":75}],8:[function(e,t,r){"use strict";function n(e,t,r){var o=this._refs[r];if("string"==typeof o){if(!this._refs[o])return n.call(this,e,t,o);o=this._refs[o]}if((o=o||this._schemas[r])instanceof _)return u(o.schema,this._opts.inlineRefs)?o.schema:o.validate||this._compile(o);var a,s,c,l=i.call(this,t,r);return l&&(a=l.schema,t=l.root,c=l.baseId),a instanceof _?s=a.validate||e.call(this,a.schema,t,void 0,c):void 0!==a&&(s=u(a,this._opts.inlineRefs)?a:e.call(this,a,t,void 0,c)),s}function i(e,t){var r=y.parse(t),n=f(r),i=l(this._getId(e.schema));if(0===Object.keys(e.schema).length||n!==i){var u=d(n),s=this._refs[u];if("string"==typeof s)return o.call(this,e,s,r);if(s instanceof _)s.validate||this._compile(s),e=s;else{if(!((s=this._schemas[u])instanceof _))return;if(s.validate||this._compile(s),u==d(t))return{schema:s,root:e,baseId:i};e=s}if(!e.schema)return;i=l(this._getId(e.schema))}return a.call(this,r,i,e.schema,e)}function o(e,t,r){var n=i.call(this,e,t);if(n){var o=n.schema,u=n.baseId;e=n.root;var s=this._getId(o);return s&&(u=h(u,s)),a.call(this,r,u,o,e)}}function a(e,t,r,n){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var o=e.fragment.split("/"),a=1;a<o.length;a++){var u=o[a];if(u){if(u=v.unescapeFragment(u),void 0===(r=r[u]))break;var s;if(!b[u]&&(s=this._getId(r),s&&(t=h(t,s)),r.$ref)){var c=h(t,r.$ref),l=i.call(this,n,c);l&&(r=l.schema,n=l.root,t=l.baseId)}}}return void 0!==r&&r!==n.schema?{schema:r,root:n,baseId:t}:void 0}}function u(e,t){return!1!==t&&(void 0===t||!0===t?s(e):t?c(e)<=t:void 0)}function s(e){var t;if(Array.isArray(e)){for(var r=0;r<e.length;r++)if("object"==typeof(t=e[r])&&!s(t))return!1}else for(var n in e){if("$ref"==n)return!1;if("object"==typeof(t=e[n])&&!s(t))return!1}return!0}function c(e){var t,r=0;if(Array.isArray(e)){for(var n=0;n<e.length;n++)if(t=e[n],"object"==typeof t&&(r+=c(t)),r==1/0)return 1/0}else for(var i in e){if("$ref"==i)return 1/0;if(w[i])r++;else if(t=e[i],"object"==typeof t&&(r+=c(t)+1),r==1/0)return 1/0}return r}function l(e,t){return!1!==t&&(e=d(e)),f(y.parse(e))}function f(e){return y.serialize(e).split("#")[0]+"#"}function d(e){return e?e.replace(E,""):""}function h(e,t){return t=d(t),y.resolve(e,t)}function p(e){var t=d(this._getId(e)),r={"":t},n={"":l(t,!1)},i={},o=this;return g(e,{allKeys:!0},function(e,t,a,u,s,c,l){if(""!==t){var f=o._getId(e),h=r[u],p=n[u]+"/"+s;if(void 0!==l&&(p+="/"+("number"==typeof l?l:v.escapeFragment(l))),"string"==typeof f){f=h=d(h?y.resolve(h,f):f);var _=o._refs[f];if("string"==typeof _&&(_=o._refs[_]),_&&_.schema){if(!m(e,_.schema))throw new Error('id "'+f+'" resolves to more than one schema')}else if(f!=d(p))if("#"==f[0]){if(i[f]&&!m(e,i[f]))throw new Error('id "'+f+'" resolves to more than one schema');i[f]=e}else o._refs[f]=p}r[t]=h,n[t]=p}}),i}var y=e("uri-js"),m=e("fast-deep-equal"),v=e("./util"),_=e("./schema_obj"),g=e("json-schema-traverse");t.exports=n,n.normalizeId=d,n.fullPath=l,n.url=h,n.ids=p,n.inlineRef=u,n.schema=i;var b=v.toHash(["properties","patternProperties","enum","dependencies","definitions"]),w=v.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]),E=/#\/?$/},{"./schema_obj":10,"./util":12,"fast-deep-equal":74,"json-schema-traverse":101,"uri-js":134}],9:[function(e,t,r){"use strict";var n=e("../dotjs"),i=e("./util").toHash;t.exports=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],t=["type","$comment"],r=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],o=["number","integer","string","array","object","boolean","null"];return e.all=i(t),e.types=i(o),e.forEach(function(r){r.rules=r.rules.map(function(r){var i;if("object"==typeof r){var o=Object.keys(r)[0];i=r[o],r=o,i.forEach(function(r){t.push(r),e.all[r]=!0})}return t.push(r),e.all[r]={keyword:r,code:n[r],implements:i}}),e.all.$comment={keyword:"$comment",code:n.$comment},r.type&&(e.types[r.type]=r)}),e.keywords=i(t.concat(r)),e.custom={},e}},{"../dotjs":29,"./util":12}],10:[function(e,t,r){"use strict";function n(e){i.copy(e,this)}var i=e("./util");t.exports=n},{"./util":12}],11:[function(e,t,r){"use strict";t.exports=function(e){for(var t,r=0,n=e.length,i=0;i<n;)r++,(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<n&&56320==(64512&(t=e.charCodeAt(i)))&&i++;return r}},{}],12:[function(e,t,r){"use strict";function n(e,t){t=t||{};for(var r in e)t[r]=e[r];return t}function i(e,t,r){var n=r?" !== ":" === ",i=r?" || ":" && ",o=r?"!":"",a=r?"":"!";switch(e){case"null":return t+n+"null";case"array":return o+"Array.isArray("+t+")";case"object":return"("+o+t+i+"typeof "+t+n+'"object"'+i+a+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+n+'"number"'+i+a+"("+t+" % 1)"+i+t+n+t+")";default:return"typeof "+t+n+'"'+e+'"'}}function o(e,t){switch(e.length){case 1:return i(e[0],t,!0);default:var r="",n=u(e);n.array&&n.object&&(r=n.null?"(":"(!"+t+" || ",r+="typeof "+t+' !== "object")',delete n.null,delete n.array,delete n.object),n.number&&delete n.integer;for(var o in n)r+=(r?" && ":"")+i(o,t,!0);return r}}function a(e,t){if(Array.isArray(t)){for(var r=[],n=0;n<t.length;n++){var i=t[n];P[i]?r[r.length]=i:"array"===e&&"array"===i&&(r[r.length]=i)}if(r.length)return r}else{if(P[t])return[t];if("array"===e&&"array"===t)return["array"]}}function u(e){for(var t={},r=0;r<e.length;r++)t[e[r]]=!0;return t}function s(e){return"number"==typeof e?"["+e+"]":D.test(e)?"."+e:"['"+c(e)+"']"}function c(e){return e.replace(C,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function l(e,t){t+="[^0-9]";var r=e.match(new RegExp(t,"g"));return r?r.length:0}function f(e,t,r){return t+="([^0-9])",r=r.replace(/\$/g,"$$$$"),e.replace(new RegExp(t,"g"),r+"$1")}function d(e){return e.replace(k,"").replace(T,"").replace(F,"if (!($1))")}function h(e,t){var r=e.match(j);return r&&2==r.length&&(e=t?e.replace(B,"").replace(I,N):e.replace(x,"").replace(M,R)),r=e.match(U),r&&3===r.length?e.replace(L,""):e}function p(e,t){if("boolean"==typeof e)return!e;for(var r in e)if(t[r])return!0}function y(e,t,r){if("boolean"==typeof e)return!e&&"not"!=r;for(var n in e)if(n!=r&&t[n])return!0}function m(e,t){if("boolean"!=typeof e)for(var r in e)if(!t[r])return r}function v(e){return"'"+c(e)+"'"}function _(e,t,r,n){return w(e,r?"'/' + "+t+(n?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):n?"'[' + "+t+" + ']'":"'[\\'' + "+t+" + '\\']'")}function g(e,t,r){return w(e,v(r?"/"+O(t):s(t)))}function b(e,t,r){var n,i,o,a;if(""===e)return"rootData";if("/"==e[0]){if(!z.test(e))throw new Error("Invalid JSON-pointer: "+e);i=e,o="rootData"}else{if(!(a=e.match(G)))throw new Error("Invalid JSON-pointer: "+e);if(n=+a[1],"#"==(i=a[2])){if(n>=t)throw new Error("Cannot access property/index "+n+" levels up, current level is "+t);return r[t-n]}if(n>t)throw new Error("Cannot access data "+n+" levels up, current level is "+t);if(o="data"+(t-n||""),!i)return o}for(var u=o,c=i.split("/"),l=0;l<c.length;l++){var f=c[l];f&&(o+=s(S(f)),u+=" && "+o)}return u}function w(e,t){return'""'==e?t:(e+" + "+t).replace(/' \+ '/g,"")}function E(e){return S(decodeURIComponent(e))}function A(e){return encodeURIComponent(O(e))}function O(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function S(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}t.exports={copy:n,checkDataType:i,checkDataTypes:o,coerceToTypes:a,toHash:u,getProperty:s,escapeQuotes:c,equal:e("fast-deep-equal"),ucs2length:e("./ucs2length"),varOccurences:l,varReplace:f,cleanUpCode:d,finalCleanUpCode:h,schemaHasRules:p,schemaHasRulesExcept:y,schemaUnknownRules:m,toQuotedString:v,getPathExpr:_,getPath:g,getData:b,unescapeFragment:E,unescapeJsonPointer:S,escapeFragment:A,escapeJsonPointer:O}
|
|
1
|
+
!function e(t,r,n){function i(a,u){if(!r[a]){if(!t[a]){var s="function"==typeof require&&require;if(!u&&s)return s(a,!0);if(o)return o(a,!0);throw new Error("Cannot find module '"+a+"'")}var c=r[a]={exports:{}};t[a][0].call(c.exports,function(e){var r=t[a][1][e];return i(r||e)},c,c.exports,e,t,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a<n.length;a++)i(n[a]);return i}({1:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./src/InternalOpenGateAPI"),s=n(u),c=e("./src/util/NorthAmpliaREST"),l=n(c),f=e("./src/util/SouthAmpliaREST"),d=n(f),h=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,new l.default(e),new d.default(e),e)}return o(t,e),t}(s.default);r.default=h,window.OpenGateAPI=h,t.exports=r.default},{"./src/InternalOpenGateAPI":139,"./src/util/NorthAmpliaREST":340,"./src/util/SouthAmpliaREST":342}],2:[function(e,t,r){"use strict";function n(e){if(!(this instanceof n))return new n(e);e=this._opts=U.copy(e)||{},k(this),this._schemas={},this._refs={},this._fragments={},this._formats=R(e.format),this._cache=e.cache||new x,this._loadingSchemas={},this._compilations=[],this.RULES=I(),this._getId=v(e),e.loopRequired=e.loopRequired||1/0,"property"==e.errorDataPath&&(e._errorDataPathProperty=!0),void 0===e.serialize&&(e.serialize=M),this._metaOpts=C(this),e.formats&&S(this),e.keywords&&P(this),A(this),"object"==typeof e.meta&&this.addMetaSchema(e.meta),e.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),O(this)}function i(e,t){var r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var n=this._addSchema(e);r=n.validate||this._compile(n)}var i=r(t);return!0!==r.$async&&(this.errors=r.errors),i}function o(e,t){var r=this._addSchema(e,void 0,t);return r.validate||this._compile(r)}function a(e,t,r,n){if(Array.isArray(e)){for(var i=0;i<e.length;i++)this.addSchema(e[i],void 0,r,n);return this}var o=this._getId(e);if(void 0!==o&&"string"!=typeof o)throw new Error("schema id must be string");return t=j.normalizeId(t||o),D(this,t),this._schemas[t]=this._addSchema(e,r,n,!0),this}function u(e,t,r){return this.addSchema(e,t,r,!0),this}function s(e,t){var r=e.$schema;if(void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(!(r=r||this._opts.defaultMeta||c(this)))return this.logger.warn("meta-schema not available"),this.errors=null,!0;var n=this.validate(r,e);if(!n&&t){var i="schema is invalid: "+this.errorsText();if("log"!=this._opts.validateSchema)throw new Error(i);this.logger.error(i)}return n}function c(e){var t=e._opts.meta;return e._opts.defaultMeta="object"==typeof t?e._getId(t)||t:e.getSchema(G)?G:void 0,e._opts.defaultMeta}function l(e){var t=d(this,e);switch(typeof t){case"object":return t.validate||this._compile(t);case"string":return this.getSchema(t);case"undefined":return f(this,e)}}function f(e,t){var r=j.schema.call(e,{schema:{}},t);if(r){var n=r.schema,i=r.root,o=r.baseId,a=F.call(e,n,i,void 0,o);return e._fragments[t]=new B({ref:t,fragment:!0,schema:n,root:i,baseId:o,validate:a}),a}}function d(e,t){return t=j.normalizeId(t),e._schemas[t]||e._refs[t]||e._fragments[t]}function h(e){if(e instanceof RegExp)return p(this,this._schemas,e),p(this,this._refs,e),this;switch(typeof e){case"undefined":return p(this,this._schemas),p(this,this._refs),this._cache.clear(),this;case"string":var t=d(this,e);return t&&this._cache.del(t.cacheKey),delete this._schemas[e],delete this._refs[e],this;case"object":var r=this._opts.serialize,n=r?r(e):e;this._cache.del(n);var i=this._getId(e);i&&(i=j.normalizeId(i),delete this._schemas[i],delete this._refs[i])}return this}function p(e,t,r){for(var n in t){var i=t[n];i.meta||r&&!r.test(n)||(e._cache.del(i.cacheKey),delete t[n])}}function y(e,t,r,n){if("object"!=typeof e&&"boolean"!=typeof e)throw new Error("schema should be object or boolean");var i=this._opts.serialize,o=i?i(e):e,a=this._cache.get(o);if(a)return a;n=n||!1!==this._opts.addUsedSchema;var u=j.normalizeId(this._getId(e));u&&n&&D(this,u);var s,c=!1!==this._opts.validateSchema&&!t;c&&!(s=u&&u==j.normalizeId(e.$schema))&&this.validateSchema(e,!0);var l=j.ids.call(this,e),f=new B({id:u,schema:e,localRefs:l,cacheKey:o,meta:r});return"#"!=u[0]&&n&&(this._refs[u]=f),this._cache.put(o,f),c&&s&&this.validateSchema(e,!0),f}function m(e,t){function r(){var t=e.validate,n=t.apply(this,arguments);return r.errors=t.errors,n}if(e.compiling)return e.validate=r,r.schema=e.schema,r.errors=null,r.root=t||r,!0===e.schema.$async&&(r.$async=!0),r;e.compiling=!0;var n;e.meta&&(n=this._opts,this._opts=this._metaOpts);var i;try{i=F.call(this,e.schema,t,e.localRefs)}catch(t){throw delete e.validate,t}finally{e.compiling=!1,e.meta&&(this._opts=n)}return e.validate=i,e.refs=i.refs,e.refVal=i.refVal,e.root=i.root,i}function v(e){switch(e.schemaId){case"auto":return b;case"id":return _;default:return g}}function _(e){return e.$id&&this.logger.warn("schema $id ignored",e.$id),e.id}function g(e){return e.id&&this.logger.warn("schema id ignored",e.id),e.$id}function b(e){if(e.$id&&e.id&&e.$id!=e.id)throw new Error("schema $id is different from id");return e.$id||e.id}function w(e,t){if(!(e=e||this.errors))return"No errors";t=t||{};for(var r=void 0===t.separator?", ":t.separator,n=void 0===t.dataVar?"data":t.dataVar,i="",o=0;o<e.length;o++){var a=e[o];a&&(i+=n+a.dataPath+" "+a.message+r)}return i.slice(0,-r.length)}function E(e,t){return"string"==typeof t&&(t=new RegExp(t)),this._formats[e]=t,this}function A(t){var r;if(t._opts.$data&&(r=e("./refs/data.json"),t.addMetaSchema(r,r.$id,!0)),!1!==t._opts.meta){var n=e("./refs/json-schema-draft-07.json");t._opts.$data&&(n=N(n,V)),t.addMetaSchema(n,G,!0),t._refs["http://json-schema.org/schema"]=G}}function O(e){var t=e._opts.schemas;if(t)if(Array.isArray(t))e.addSchema(t);else for(var r in t)e.addSchema(t[r],r)}function S(e){for(var t in e._opts.formats){var r=e._opts.formats[t];e.addFormat(t,r)}}function P(e){for(var t in e._opts.keywords){var r=e._opts.keywords[t];e.addKeyword(t,r)}}function D(e,t){if(e._schemas[t]||e._refs[t])throw new Error('schema with key or id "'+t+'" already exists')}function C(e){for(var t=U.copy(e._opts),r=0;r<q.length;r++)delete t[q[r]];return t}function k(e){var t=e._opts.logger;if(!1===t)e.logger={log:T,warn:T,error:T};else{if(void 0===t&&(t=console),!("object"==typeof t&&t.log&&t.warn&&t.error))throw new Error("logger must implement log, warn and error methods");e.logger=t}}function T(){}var F=e("./compile"),j=e("./compile/resolve"),x=e("./cache"),B=e("./compile/schema_obj"),M=e("fast-json-stable-stringify"),R=e("./compile/formats"),I=e("./compile/rules"),N=e("./data"),U=e("./compile/util");t.exports=n,n.prototype.validate=i,n.prototype.compile=o,n.prototype.addSchema=a,n.prototype.addMetaSchema=u,n.prototype.validateSchema=s,n.prototype.getSchema=l,n.prototype.removeSchema=h,n.prototype.addFormat=E,n.prototype.errorsText=w,n.prototype._addSchema=y,n.prototype._compile=m,n.prototype.compileAsync=e("./compile/async");var L=e("./keyword");n.prototype.addKeyword=L.add,n.prototype.getKeyword=L.get,n.prototype.removeKeyword=L.remove,n.prototype.validateKeyword=L.validate;var z=e("./compile/error_classes");n.ValidationError=z.Validation,n.MissingRefError=z.MissingRef,n.$dataMetaSchema=N;var G="http://json-schema.org/draft-07/schema",q=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],V=["/properties"]},{"./cache":3,"./compile":7,"./compile/async":4,"./compile/error_classes":5,"./compile/formats":6,"./compile/resolve":8,"./compile/rules":9,"./compile/schema_obj":10,"./compile/util":12,"./data":13,"./keyword":41,"./refs/data.json":42,"./refs/json-schema-draft-07.json":43,"fast-json-stable-stringify":75}],3:[function(e,t,r){"use strict";var n=t.exports=function(){this._cache={}};n.prototype.put=function(e,t){this._cache[e]=t},n.prototype.get=function(e){return this._cache[e]},n.prototype.del=function(e){delete this._cache[e]},n.prototype.clear=function(){this._cache={}}},{}],4:[function(e,t,r){"use strict";function n(e,t,r){function o(e){var t=e.$schema;return t&&!u.getSchema(t)?n.call(u,{$ref:t},!0):Promise.resolve()}function a(e){try{return u._compile(e)}catch(r){if(r instanceof i)return function(r){function n(){delete u._loadingSchemas[s]}function i(e){return u._refs[e]||u._schemas[e]}var s=r.missingSchema;if(i(s))throw new Error("Schema "+s+" is loaded but "+r.missingRef+" cannot be resolved");var c=u._loadingSchemas[s];return c||(c=u._loadingSchemas[s]=u._opts.loadSchema(s),c.then(n,n)),c.then(function(e){if(!i(s))return o(e).then(function(){i(s)||u.addSchema(e,s,void 0,t)})}).then(function(){return a(e)})}(r);throw r}}var u=this;if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");"function"==typeof t&&(r=t,t=void 0);var s=o(e).then(function(){var r=u._addSchema(e,void 0,t);return r.validate||a(r)});return r&&s.then(function(e){r(null,e)},r),s}var i=e("./error_classes").MissingRef;t.exports=n},{"./error_classes":5}],5:[function(e,t,r){"use strict";function n(e){this.message="validation failed",this.errors=e,this.ajv=this.validation=!0}function i(e,t,r){this.message=r||i.message(e,t),this.missingRef=a.url(e,t),this.missingSchema=a.normalizeId(a.fullPath(this.missingRef))}function o(e){return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var a=e("./resolve");t.exports={Validation:o(n),MissingRef:o(i)},i.message=function(e,t){return"can't resolve reference "+t+" from id "+e}},{"./resolve":8}],6:[function(e,t,r){"use strict";function n(e){return e="full"==e?"full":"fast",l.copy(n[e])}function i(e){return e%4==0&&(e%100!=0||e%400==0)}function o(e){var t=e.match(f);if(!t)return!1;var r=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(2==n&&i(r)?29:d[n])}function a(e,t){var r=e.match(h);if(!r)return!1;var n=r[1],i=r[2],o=r[3],a=r[5];return(n<=23&&i<=59&&o<=59||23==n&&59==i&&60==o)&&(!t||a)}function u(e){var t=e.split(A);return 2==t.length&&o(t[0])&&a(t[1],!0)}function s(e){return O.test(e)&&y.test(e)}function c(e){if(S.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}var l=e("./util"),f=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,d=[0,31,28,31,30,31,30,31,31,30,31,30,31],h=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,p=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,y=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,m=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,v=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,_=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,g=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,b=/^(?:\/(?:[^~/]|~0|~1)*)*$/,w=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,E=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;t.exports=n,n.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":v,url:_,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:p,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:c,uuid:g,"json-pointer":b,"json-pointer-uri-fragment":w,"relative-json-pointer":E},n.full={date:o,time:a,"date-time":u,uri:s,"uri-reference":m,"uri-template":v,url:_,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:p,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:c,uuid:g,"json-pointer":b,"json-pointer-uri-fragment":w,"relative-json-pointer":E};var A=/t|\s/i,O=/\/|:/,S=/[^\\]\\Z/},{"./util":12}],7:[function(e,t,r){"use strict";function n(e,t,r,a){function b(){var e=L.validate,t=e.apply(this,arguments);return b.errors=e.errors,t}function w(e,r,i,o){var a=!r||r&&r.schema==e;if(r.schema!=t.schema)return n.call(T,e,r,i,o);var y=!0===e.$async,b=m({isTop:!0,schema:e,isRoot:a,baseId:o,root:r,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:p.MissingRef,RULES:G,validate:m,util:h,resolve:d,resolveRef:E,usePattern:D,useDefault:C,useCustomRule:k,opts:F,formats:z,logger:T.logger,self:T});b=f(j,c)+f(B,u)+f(R,s)+f(N,l)+b,F.processCode&&(b=F.processCode(b));var w;try{w=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",b)(T,G,z,t,j,R,N,_,v,g),j[0]=w}catch(e){throw T.logger.error("Error compiling schema, function code:",b),e}return w.schema=e,w.errors=null,w.refs=x,w.refVal=j,w.root=a?w:r,y&&(w.$async=!0),!0===F.sourceCode&&(w.source={code:b,patterns:B,defaults:R}),w}function E(e,i,o){i=d.url(e,i);var a,u,s=x[i];if(void 0!==s)return a=j[s],u="refVal["+s+"]",P(a,u);if(!o&&t.refs){var c=t.refs[i];if(void 0!==c)return a=t.refVal[c],u=A(i,a),P(a,u)}u=A(i);var l=d.call(T,w,t,i);if(void 0===l){var f=r&&r[i];f&&(l=d.inlineRef(f,F.inlineRefs)?f:n.call(T,f,t,r,e))}if(void 0!==l)return S(i,l),P(l,u);O(i)}function A(e,t){var r=j.length;return j[r]=t,x[e]=r,"refVal"+r}function O(e){delete x[e]}function S(e,t){var r=x[e];j[r]=t}function P(e,t){return"object"==typeof e||"boolean"==typeof e?{code:t,schema:e,inline:!0}:{code:t,$async:e&&!!e.$async}}function D(e){var t=M[e];return void 0===t&&(t=M[e]=B.length,B[t]=e),"pattern"+t}function C(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return h.toQuotedString(e);case"object":if(null===e)return"null";var t=y(e),r=I[t];return void 0===r&&(r=I[t]=R.length,R[r]=e),"default"+r}}function k(e,t,r,n){if(!1!==T._opts.validateSchema){var i=e.definition.dependencies;if(i&&!i.every(function(e){return Object.prototype.hasOwnProperty.call(r,e)}))throw new Error("parent schema must have all required keywords: "+i.join(","));var o=e.definition.validateSchema;if(o){if(!o(t)){var a="keyword schema is invalid: "+T.errorsText(o.errors);if("log"!=T._opts.validateSchema)throw new Error(a);T.logger.error(a)}}}var u,s=e.definition.compile,c=e.definition.inline,l=e.definition.macro;if(s)u=s.call(T,t,r,n);else if(l)u=l.call(T,t,r,n),!1!==F.validateSchema&&T.validateSchema(u,!0);else if(c)u=c.call(T,n,e.keyword,t,r);else if(!(u=e.definition.validate))return;if(void 0===u)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var f=N.length;return N[f]=u,{code:"customRule"+f,validate:u}}var T=this,F=this._opts,j=[void 0],x={},B=[],M={},R=[],I={},N=[];t=t||{schema:e,refVal:j,refs:x};var U=i.call(this,e,t,a),L=this._compilations[U.index];if(U.compiling)return L.callValidate=b;var z=this._formats,G=this.RULES;try{var q=w(e,t,r,a);L.validate=q;var V=L.callValidate;return V&&(V.schema=q.schema,V.errors=null,V.refs=q.refs,V.refVal=q.refVal,V.root=q.root,V.$async=q.$async,F.sourceCode&&(V.source=q.source)),q}finally{o.call(this,e,t,a)}}function i(e,t,r){var n=a.call(this,e,t,r);return n>=0?{index:n,compiling:!0}:(n=this._compilations.length,this._compilations[n]={schema:e,root:t,baseId:r},{index:n,compiling:!1})}function o(e,t,r){var n=a.call(this,e,t,r);n>=0&&this._compilations.splice(n,1)}function a(e,t,r){for(var n=0;n<this._compilations.length;n++){var i=this._compilations[n];if(i.schema==e&&i.root==t&&i.baseId==r)return n}return-1}function u(e,t){return"var pattern"+e+" = new RegExp("+h.toQuotedString(t[e])+");"}function s(e){return"var default"+e+" = defaults["+e+"];"}function c(e,t){return void 0===t[e]?"":"var refVal"+e+" = refVal["+e+"];"}function l(e){return"var customRule"+e+" = customRules["+e+"];"}function f(e,t){if(!e.length)return"";for(var r="",n=0;n<e.length;n++)r+=t(n,e);return r}var d=e("./resolve"),h=e("./util"),p=e("./error_classes"),y=e("fast-json-stable-stringify"),m=e("../dotjs/validate"),v=h.ucs2length,_=e("fast-deep-equal"),g=p.Validation;t.exports=n},{"../dotjs/validate":40,"./error_classes":5,"./resolve":8,"./util":12,"fast-deep-equal":74,"fast-json-stable-stringify":75}],8:[function(e,t,r){"use strict";function n(e,t,r){var o=this._refs[r];if("string"==typeof o){if(!this._refs[o])return n.call(this,e,t,o);o=this._refs[o]}if((o=o||this._schemas[r])instanceof _)return u(o.schema,this._opts.inlineRefs)?o.schema:o.validate||this._compile(o);var a,s,c,l=i.call(this,t,r);return l&&(a=l.schema,t=l.root,c=l.baseId),a instanceof _?s=a.validate||e.call(this,a.schema,t,void 0,c):void 0!==a&&(s=u(a,this._opts.inlineRefs)?a:e.call(this,a,t,void 0,c)),s}function i(e,t){var r=y.parse(t),n=f(r),i=l(this._getId(e.schema));if(0===Object.keys(e.schema).length||n!==i){var u=d(n),s=this._refs[u];if("string"==typeof s)return o.call(this,e,s,r);if(s instanceof _)s.validate||this._compile(s),e=s;else{if(!((s=this._schemas[u])instanceof _))return;if(s.validate||this._compile(s),u==d(t))return{schema:s,root:e,baseId:i};e=s}if(!e.schema)return;i=l(this._getId(e.schema))}return a.call(this,r,i,e.schema,e)}function o(e,t,r){var n=i.call(this,e,t);if(n){var o=n.schema,u=n.baseId;e=n.root;var s=this._getId(o);return s&&(u=h(u,s)),a.call(this,r,u,o,e)}}function a(e,t,r,n){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var o=e.fragment.split("/"),a=1;a<o.length;a++){var u=o[a];if(u){if(u=v.unescapeFragment(u),void 0===(r=r[u]))break;var s;if(!b[u]&&(s=this._getId(r),s&&(t=h(t,s)),r.$ref)){var c=h(t,r.$ref),l=i.call(this,n,c);l&&(r=l.schema,n=l.root,t=l.baseId)}}}return void 0!==r&&r!==n.schema?{schema:r,root:n,baseId:t}:void 0}}function u(e,t){return!1!==t&&(void 0===t||!0===t?s(e):t?c(e)<=t:void 0)}function s(e){var t;if(Array.isArray(e)){for(var r=0;r<e.length;r++)if("object"==typeof(t=e[r])&&!s(t))return!1}else for(var n in e){if("$ref"==n)return!1;if("object"==typeof(t=e[n])&&!s(t))return!1}return!0}function c(e){var t,r=0;if(Array.isArray(e)){for(var n=0;n<e.length;n++)if(t=e[n],"object"==typeof t&&(r+=c(t)),r==1/0)return 1/0}else for(var i in e){if("$ref"==i)return 1/0;if(w[i])r++;else if(t=e[i],"object"==typeof t&&(r+=c(t)+1),r==1/0)return 1/0}return r}function l(e,t){return!1!==t&&(e=d(e)),f(y.parse(e))}function f(e){return y.serialize(e).split("#")[0]+"#"}function d(e){return e?e.replace(E,""):""}function h(e,t){return t=d(t),y.resolve(e,t)}function p(e){var t=d(this._getId(e)),r={"":t},n={"":l(t,!1)},i={},o=this;return g(e,{allKeys:!0},function(e,t,a,u,s,c,l){if(""!==t){var f=o._getId(e),h=r[u],p=n[u]+"/"+s;if(void 0!==l&&(p+="/"+("number"==typeof l?l:v.escapeFragment(l))),"string"==typeof f){f=h=d(h?y.resolve(h,f):f);var _=o._refs[f];if("string"==typeof _&&(_=o._refs[_]),_&&_.schema){if(!m(e,_.schema))throw new Error('id "'+f+'" resolves to more than one schema')}else if(f!=d(p))if("#"==f[0]){if(i[f]&&!m(e,i[f]))throw new Error('id "'+f+'" resolves to more than one schema');i[f]=e}else o._refs[f]=p}r[t]=h,n[t]=p}}),i}var y=e("uri-js"),m=e("fast-deep-equal"),v=e("./util"),_=e("./schema_obj"),g=e("json-schema-traverse");t.exports=n,n.normalizeId=d,n.fullPath=l,n.url=h,n.ids=p,n.inlineRef=u,n.schema=i;var b=v.toHash(["properties","patternProperties","enum","dependencies","definitions"]),w=v.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]),E=/#\/?$/},{"./schema_obj":10,"./util":12,"fast-deep-equal":74,"json-schema-traverse":101,"uri-js":134}],9:[function(e,t,r){"use strict";var n=e("../dotjs"),i=e("./util").toHash;t.exports=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],t=["type","$comment"],r=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],o=["number","integer","string","array","object","boolean","null"];return e.all=i(t),e.types=i(o),e.forEach(function(r){r.rules=r.rules.map(function(r){var i;if("object"==typeof r){var o=Object.keys(r)[0];i=r[o],r=o,i.forEach(function(r){t.push(r),e.all[r]=!0})}return t.push(r),e.all[r]={keyword:r,code:n[r],implements:i}}),e.all.$comment={keyword:"$comment",code:n.$comment},r.type&&(e.types[r.type]=r)}),e.keywords=i(t.concat(r)),e.custom={},e}},{"../dotjs":29,"./util":12}],10:[function(e,t,r){"use strict";function n(e){i.copy(e,this)}var i=e("./util");t.exports=n},{"./util":12}],11:[function(e,t,r){"use strict";t.exports=function(e){for(var t,r=0,n=e.length,i=0;i<n;)r++,(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<n&&56320==(64512&(t=e.charCodeAt(i)))&&i++;return r}},{}],12:[function(e,t,r){"use strict";function n(e,t){t=t||{};for(var r in e)t[r]=e[r];return t}function i(e,t,r){var n=r?" !== ":" === ",i=r?" || ":" && ",o=r?"!":"",a=r?"":"!";switch(e){case"null":return t+n+"null";case"array":return o+"Array.isArray("+t+")";case"object":return"("+o+t+i+"typeof "+t+n+'"object"'+i+a+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+n+'"number"'+i+a+"("+t+" % 1)"+i+t+n+t+")";default:return"typeof "+t+n+'"'+e+'"'}}function o(e,t){switch(e.length){case 1:return i(e[0],t,!0);default:var r="",n=u(e);n.array&&n.object&&(r=n.null?"(":"(!"+t+" || ",r+="typeof "+t+' !== "object")',delete n.null,delete n.array,delete n.object),n.number&&delete n.integer;for(var o in n)r+=(r?" && ":"")+i(o,t,!0);return r}}function a(e,t){if(Array.isArray(t)){for(var r=[],n=0;n<t.length;n++){var i=t[n];P[i]?r[r.length]=i:"array"===e&&"array"===i&&(r[r.length]=i)}if(r.length)return r}else{if(P[t])return[t];if("array"===e&&"array"===t)return["array"]}}function u(e){for(var t={},r=0;r<e.length;r++)t[e[r]]=!0;return t}function s(e){return"number"==typeof e?"["+e+"]":D.test(e)?"."+e:"['"+c(e)+"']"}function c(e){return e.replace(C,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function l(e,t){t+="[^0-9]";var r=e.match(new RegExp(t,"g"));return r?r.length:0}function f(e,t,r){return t+="([^0-9])",r=r.replace(/\$/g,"$$$$"),e.replace(new RegExp(t,"g"),r+"$1")}function d(e){return e.replace(k,"").replace(T,"").replace(F,"if (!($1))")}function h(e,t){var r=e.match(j);return r&&2==r.length&&(e=t?e.replace(B,"").replace(I,N):e.replace(x,"").replace(M,R)),r=e.match(U),r&&3===r.length?e.replace(L,""):e}function p(e,t){if("boolean"==typeof e)return!e;for(var r in e)if(t[r])return!0}function y(e,t,r){if("boolean"==typeof e)return!e&&"not"!=r;for(var n in e)if(n!=r&&t[n])return!0}function m(e,t){if("boolean"!=typeof e)for(var r in e)if(!t[r])return r}function v(e){return"'"+c(e)+"'"}function _(e,t,r,n){return w(e,r?"'/' + "+t+(n?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):n?"'[' + "+t+" + ']'":"'[\\'' + "+t+" + '\\']'")}function g(e,t,r){return w(e,v(r?"/"+O(t):s(t)))}function b(e,t,r){var n,i,o,a;if(""===e)return"rootData";if("/"==e[0]){if(!z.test(e))throw new Error("Invalid JSON-pointer: "+e);i=e,o="rootData"}else{if(!(a=e.match(G)))throw new Error("Invalid JSON-pointer: "+e);if(n=+a[1],"#"==(i=a[2])){if(n>=t)throw new Error("Cannot access property/index "+n+" levels up, current level is "+t);return r[t-n]}if(n>t)throw new Error("Cannot access data "+n+" levels up, current level is "+t);if(o="data"+(t-n||""),!i)return o}for(var u=o,c=i.split("/"),l=0;l<c.length;l++){var f=c[l];f&&(o+=s(S(f)),u+=" && "+o)}return u}function w(e,t){return'""'==e?t:(e+" + "+t).replace(/' \+ '/g,"")}function E(e){return S(decodeURIComponent(e))}function A(e){return encodeURIComponent(O(e))}function O(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function S(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}t.exports={copy:n,checkDataType:i,checkDataTypes:o,coerceToTypes:a,toHash:u,getProperty:s,escapeQuotes:c,equal:e("fast-deep-equal"),ucs2length:e("./ucs2length"),varOccurences:l,varReplace:f,cleanUpCode:d,finalCleanUpCode:h,schemaHasRules:p,schemaHasRulesExcept:y,schemaUnknownRules:m,toQuotedString:v,getPathExpr:_,getPath:g,getData:b,unescapeFragment:E,unescapeJsonPointer:S,escapeFragment:A,escapeJsonPointer:O}
|
|
2
2
|
;var P=u(["string","number","integer","boolean","null"]),D=/^[a-z$_][a-z$_0-9]*$/i,C=/'|\\/g,k=/else\s*{\s*}/g,T=/if\s*\([^)]+\)\s*\{\s*\}(?!\s*else)/g,F=/if\s*\(([^)]+)\)\s*\{\s*\}\s*else(?!\s*if)/g,j=/[^v.]errors/g,x=/var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g,B=/var errors = 0;|var vErrors = null;/g,M="return errors === 0;",R="validate.errors = null; return true;",I=/if \(errors === 0\) return data;\s*else throw new ValidationError\(vErrors\);/,N="return data;",U=/[^A-Za-z_$]rootData[^A-Za-z0-9_$]/g,L=/if \(rootData === undefined\) rootData = data;/,z=/^\/(?:[^~]|~0|~1)*$/,G=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/},{"./ucs2length":11,"fast-deep-equal":74}],13:[function(e,t,r){"use strict";var n=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];t.exports=function(e,t){for(var r=0;r<t.length;r++){e=JSON.parse(JSON.stringify(e));var i,o=t[r].split("/"),a=e;for(i=1;i<o.length;i++)a=a[o[i]];for(i=0;i<n.length;i++){var u=n[i],s=a[u];s&&(a[u]={anyOf:[s,{$ref:"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#"}]})}}return e}},{}],14:[function(e,t,r){"use strict";var n=e("./refs/json-schema-draft-07.json");t.exports={$id:"https://github.com/epoberezkin/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:n.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:n.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}},{"./refs/json-schema-draft-07.json":43}],15:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n,i,o=" ",a=e.level,u=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,d="data"+(u||""),h=e.opts.$data&&s&&s.$data;h?(o+=" var schema"+a+" = "+e.util.getData(s.$data,u,e.dataPathArr)+"; ",i="schema"+a):i=s;var p="maximum"==t,y=p?"exclusiveMaximum":"exclusiveMinimum",m=e.schema[y],v=e.opts.$data&&m&&m.$data,_=p?"<":">",g=p?">":"<",n=void 0;if(v){var b=e.util.getData(m.$data,u,e.dataPathArr),w="exclusive"+a,E="exclType"+a,A="exclIsNumber"+a,O="op"+a,S="' + "+O+" + '";o+=" var schemaExcl"+a+" = "+b+"; ",b="schemaExcl"+a,o+=" var "+w+"; var "+E+" = typeof "+b+"; if ("+E+" != 'boolean' && "+E+" != 'undefined' && "+E+" != 'number') { ";var n=y,P=P||[];P.push(o),o="",!1!==e.createErrors?(o+=" { keyword: '"+(n||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(o+=" , message: '"+y+" should be boolean' "),e.opts.verbose&&(o+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),o+=" } "):o+=" {} ";var D=o;o=P.pop(),!e.compositeRule&&f?e.async?o+=" throw new ValidationError(["+D+"]); ":o+=" validate.errors = ["+D+"]; return false; ":o+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+=" } else if ( ",h&&(o+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),o+=" "+E+" == 'number' ? ( ("+w+" = "+i+" === undefined || "+b+" "+_+"= "+i+") ? "+d+" "+g+"= "+b+" : "+d+" "+g+" "+i+" ) : ( ("+w+" = "+b+" === true) ? "+d+" "+g+"= "+i+" : "+d+" "+g+" "+i+" ) || "+d+" !== "+d+") { var op"+a+" = "+w+" ? '"+_+"' : '"+_+"='; ",void 0===s&&(n=y,l=e.errSchemaPath+"/"+y,i=b,h=v)}else{var A="number"==typeof m,S=_;if(A&&h){var O="'"+S+"'";o+=" if ( ",h&&(o+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),o+=" ( "+i+" === undefined || "+m+" "+_+"= "+i+" ? "+d+" "+g+"= "+m+" : "+d+" "+g+" "+i+" ) || "+d+" !== "+d+") { "}else{A&&void 0===s?(w=!0,n=y,l=e.errSchemaPath+"/"+y,i=m,g+="="):(A&&(i=Math[p?"min":"max"](m,s)),m===(!A||i)?(w=!0,n=y,l=e.errSchemaPath+"/"+y,g+="="):(w=!1,S+="="));var O="'"+S+"'";o+=" if ( ",h&&(o+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),o+=" "+d+" "+g+" "+i+" || "+d+" !== "+d+") { "}}n=n||t;var P=P||[];P.push(o),o="",!1!==e.createErrors?(o+=" { keyword: '"+(n||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { comparison: "+O+", limit: "+i+", exclusive: "+w+" } ",!1!==e.opts.messages&&(o+=" , message: 'should be "+S+" ",o+=h?"' + "+i:i+"'"),e.opts.verbose&&(o+=" , schema: ",o+=h?"validate.schema"+c:""+s,o+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),o+=" } "):o+=" {} ";var D=o;return o=P.pop(),!e.compositeRule&&f?e.async?o+=" throw new ValidationError(["+D+"]); ":o+=" validate.errors = ["+D+"]; return false; ":o+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+=" } ",f&&(o+=" else { "),o}},{}],16:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n,i,o=" ",a=e.level,u=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,d="data"+(u||""),h=e.opts.$data&&s&&s.$data;h?(o+=" var schema"+a+" = "+e.util.getData(s.$data,u,e.dataPathArr)+"; ",i="schema"+a):i=s;var p="maxItems"==t?">":"<";o+="if ( ",h&&(o+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),o+=" "+d+".length "+p+" "+i+") { ";var n=t,y=y||[];y.push(o),o="",!1!==e.createErrors?(o+=" { keyword: '"+(n||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(o+=" , message: 'should NOT have ",o+="maxItems"==t?"more":"fewer",o+=" than ",o+=h?"' + "+i+" + '":""+s,o+=" items' "),e.opts.verbose&&(o+=" , schema: ",o+=h?"validate.schema"+c:""+s,o+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),o+=" } "):o+=" {} ";var m=o;return o=y.pop(),!e.compositeRule&&f?e.async?o+=" throw new ValidationError(["+m+"]); ":o+=" validate.errors = ["+m+"]; return false; ":o+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+="} ",f&&(o+=" else { "),o}},{}],17:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n,i,o=" ",a=e.level,u=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,d="data"+(u||""),h=e.opts.$data&&s&&s.$data;h?(o+=" var schema"+a+" = "+e.util.getData(s.$data,u,e.dataPathArr)+"; ",i="schema"+a):i=s;var p="maxLength"==t?">":"<";o+="if ( ",h&&(o+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),!1===e.opts.unicode?o+=" "+d+".length ":o+=" ucs2length("+d+") ",o+=" "+p+" "+i+") { ";var n=t,y=y||[];y.push(o),o="",!1!==e.createErrors?(o+=" { keyword: '"+(n||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(o+=" , message: 'should NOT be ",o+="maxLength"==t?"longer":"shorter",o+=" than ",o+=h?"' + "+i+" + '":""+s,o+=" characters' "),e.opts.verbose&&(o+=" , schema: ",o+=h?"validate.schema"+c:""+s,o+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),o+=" } "):o+=" {} ";var m=o;return o=y.pop(),!e.compositeRule&&f?e.async?o+=" throw new ValidationError(["+m+"]); ":o+=" validate.errors = ["+m+"]; return false; ":o+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+="} ",f&&(o+=" else { "),o}},{}],18:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n,i,o=" ",a=e.level,u=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,d="data"+(u||""),h=e.opts.$data&&s&&s.$data;h?(o+=" var schema"+a+" = "+e.util.getData(s.$data,u,e.dataPathArr)+"; ",i="schema"+a):i=s;var p="maxProperties"==t?">":"<";o+="if ( ",h&&(o+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),o+=" Object.keys("+d+").length "+p+" "+i+") { ";var n=t,y=y||[];y.push(o),o="",!1!==e.createErrors?(o+=" { keyword: '"+(n||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(o+=" , message: 'should NOT have ",o+="maxProperties"==t?"more":"fewer",o+=" than ",o+=h?"' + "+i+" + '":""+s,o+=" properties' "),e.opts.verbose&&(o+=" , schema: ",o+=h?"validate.schema"+c:""+s,o+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),o+=" } "):o+=" {} ";var m=o;return o=y.pop(),!e.compositeRule&&f?e.async?o+=" throw new ValidationError(["+m+"]); ":o+=" validate.errors = ["+m+"]; return false; ":o+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+="} ",f&&(o+=" else { "),o}},{}],19:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n=" ",i=e.schema[t],o=e.schemaPath+e.util.getProperty(t),a=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,s=e.util.copy(e),c="";s.level++;var l="valid"+s.level,f=s.baseId,d=!0,h=i;if(h)for(var p,y=-1,m=h.length-1;y<m;)p=h[y+=1],(e.opts.strictKeywords?"object"==typeof p&&Object.keys(p).length>0:e.util.schemaHasRules(p,e.RULES.all))&&(d=!1,s.schema=p,s.schemaPath=o+"["+y+"]",s.errSchemaPath=a+"/"+y,n+=" "+e.validate(s)+" ",s.baseId=f,u&&(n+=" if ("+l+") { ",c+="}"));return u&&(n+=d?" if (true) { ":" "+c.slice(0,-1)+" "),n=e.util.cleanUpCode(n)}},{}],20:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],u=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),f="valid"+i,d="errs__"+i,h=e.util.copy(e),p="";h.level++;var y="valid"+h.level;if(a.every(function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0:e.util.schemaHasRules(t,e.RULES.all)})){var m=h.baseId;n+=" var "+d+" = errors; var "+f+" = false; ";var v=e.compositeRule;e.compositeRule=h.compositeRule=!0;var _=a;if(_)for(var g,b=-1,w=_.length-1;b<w;)g=_[b+=1],h.schema=g,h.schemaPath=u+"["+b+"]",h.errSchemaPath=s+"/"+b,n+=" "+e.validate(h)+" ",h.baseId=m,n+=" "+f+" = "+f+" || "+y+"; if (!"+f+") { ",p+="}";e.compositeRule=h.compositeRule=v,n+=" "+p+" if (!"+f+") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+=" } else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.opts.allErrors&&(n+=" } "),n=e.util.cleanUpCode(n)}else c&&(n+=" if (true) { ");return n}},{}],21:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n=" ",i=e.schema[t],o=e.errSchemaPath+"/"+t,a=(e.opts.allErrors,e.util.toQuotedString(i));return!0===e.opts.$comment?n+=" console.log("+a+");":"function"==typeof e.opts.$comment&&(n+=" self._opts.$comment("+a+", "+e.util.toQuotedString(o)+", validate.root.schema);"),n}},{}],22:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],u=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),f="valid"+i,d=e.opts.$data&&a&&a.$data;d&&(n+=" var schema"+i+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; "),d||(n+=" var schema"+i+" = validate.schema"+u+";"),n+="var "+f+" = equal("+l+", schema"+i+"); if (!"+f+") { ";var h=h||[];h.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { allowedValue: schema"+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be equal to constant' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var p=n;return n=h.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+p+"]); ":n+=" validate.errors = ["+p+"]; return false; ":n+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" }",c&&(n+=" else { "),n}},{}],23:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],u=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),f="valid"+i,d="errs__"+i,h=e.util.copy(e);h.level++;var p="valid"+h.level,y="i"+i,m=h.dataLevel=e.dataLevel+1,v="data"+m,_=e.baseId,g=e.opts.strictKeywords?"object"==typeof a&&Object.keys(a).length>0:e.util.schemaHasRules(a,e.RULES.all);if(n+="var "+d+" = errors;var "+f+";",g){var b=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.schema=a,h.schemaPath=u,h.errSchemaPath=s,n+=" var "+p+" = false; for (var "+y+" = 0; "+y+" < "+l+".length; "+y+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,y,e.opts.jsonPointers,!0);var w=l+"["+y+"]";h.dataPathArr[m]=y;var E=e.validate(h);h.baseId=_,e.util.varOccurences(E,v)<2?n+=" "+e.util.varReplace(E,v,w)+" ":n+=" var "+v+" = "+w+"; "+E+" ",n+=" if ("+p+") break; } ",e.compositeRule=h.compositeRule=b,n+=" if (!"+p+") {"}else n+=" if ("+l+".length == 0) {";var A=A||[];A.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should contain a valid item' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var O=n;return n=A.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+O+"]); ":n+=" validate.errors = ["+O+"]; return false; ":n+=" var err = "+O+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { ",g&&(n+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } "),e.opts.allErrors&&(n+=" } "),n=e.util.cleanUpCode(n)}},{}],24:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n,i,o=" ",a=e.level,u=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,d="data"+(u||""),h="valid"+a,p="errs__"+a,y=e.opts.$data&&s&&s.$data;y?(o+=" var schema"+a+" = "+e.util.getData(s.$data,u,e.dataPathArr)+"; ",i="schema"+a):i=s;var m,v,_,g,b,w=this,E="definition"+a,A=w.definition,O="";if(y&&A.$data){b="keywordValidate"+a;var S=A.validateSchema;o+=" var "+E+" = RULES.custom['"+t+"'].definition; var "+b+" = "+E+".validate;"}else{if(!(g=e.useCustomRule(w,s,e.schema,e)))return;i="validate.schema"+c,b=g.code,m=A.compile,v=A.inline,_=A.macro}var P=b+".errors",D="i"+a,C="ruleErr"+a,k=A.async;if(k&&!e.async)throw new Error("async keyword in sync schema");if(v||_||(o+=P+" = null;"),o+="var "+p+" = errors;var "+h+";",y&&A.$data&&(O+="}",o+=" if ("+i+" === undefined) { "+h+" = true; } else { ",S&&(O+="}",o+=" "+h+" = "+E+".validateSchema("+i+"); if ("+h+") { ")),v)A.statements?o+=" "+g.validate+" ":o+=" "+h+" = "+g.validate+"; ";else if(_){var T=e.util.copy(e),O="";T.level++;var F="valid"+T.level;T.schema=g.validate,T.schemaPath="";var j=e.compositeRule;e.compositeRule=T.compositeRule=!0;var x=e.validate(T).replace(/validate\.schema/g,b);e.compositeRule=T.compositeRule=j,o+=" "+x}else{var B=B||[];B.push(o),o="",o+=" "+b+".call( ",e.opts.passContext?o+="this":o+="self",m||!1===A.schema?o+=" , "+d+" ":o+=" , "+i+" , "+d+" , validate.schema"+e.schemaPath+" ",o+=" , (dataPath || '')",'""'!=e.errorPath&&(o+=" + "+e.errorPath);var M=u?"data"+(u-1||""):"parentData",R=u?e.dataPathArr[u]:"parentDataProperty";o+=" , "+M+" , "+R+" , rootData ) ";var I=o;o=B.pop(),!1===A.errors?(o+=" "+h+" = ",k&&(o+="await "),o+=I+"; "):k?(P="customErrors"+a,o+=" var "+P+" = null; try { "+h+" = await "+I+"; } catch (e) { "+h+" = false; if (e instanceof ValidationError) "+P+" = e.errors; else throw e; } "):o+=" "+P+" = null; "+h+" = "+I+"; "}if(A.modifying&&(o+=" if ("+M+") "+d+" = "+M+"["+R+"];"),o+=""+O,A.valid)f&&(o+=" if (true) { ");else{o+=" if ( ",void 0===A.valid?(o+=" !",o+=_?""+F:""+h):o+=" "+!A.valid+" ",o+=") { ",n=w.keyword;var B=B||[];B.push(o),o="";var B=B||[];B.push(o),o="",!1!==e.createErrors?(o+=" { keyword: '"+(n||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { keyword: '"+w.keyword+"' } ",!1!==e.opts.messages&&(o+=" , message: 'should pass \""+w.keyword+"\" keyword validation' "),e.opts.verbose&&(o+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),o+=" } "):o+=" {} ";var N=o;o=B.pop(),!e.compositeRule&&f?e.async?o+=" throw new ValidationError(["+N+"]); ":o+=" validate.errors = ["+N+"]; return false; ":o+=" var err = "+N+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var U=o;o=B.pop(),v?A.errors?"full"!=A.errors&&(o+=" for (var "+D+"="+p+"; "+D+"<errors; "+D+"++) { var "+C+" = vErrors["+D+"]; if ("+C+".dataPath === undefined) "+C+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+C+".schemaPath === undefined) { "+C+'.schemaPath = "'+l+'"; } ',e.opts.verbose&&(o+=" "+C+".schema = "+i+"; "+C+".data = "+d+"; "),o+=" } "):!1===A.errors?o+=" "+U+" ":(o+=" if ("+p+" == errors) { "+U+" } else { for (var "+D+"="+p+"; "+D+"<errors; "+D+"++) { var "+C+" = vErrors["+D+"]; if ("+C+".dataPath === undefined) "+C+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+C+".schemaPath === undefined) { "+C+'.schemaPath = "'+l+'"; } ',e.opts.verbose&&(o+=" "+C+".schema = "+i+"; "+C+".data = "+d+"; "),o+=" } } "):_?(o+=" var err = ",!1!==e.createErrors?(o+=" { keyword: '"+(n||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { keyword: '"+w.keyword+"' } ",!1!==e.opts.messages&&(o+=" , message: 'should pass \""+w.keyword+"\" keyword validation' "),e.opts.verbose&&(o+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),o+=" } "):o+=" {} ",o+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&f&&(e.async?o+=" throw new ValidationError(vErrors); ":o+=" validate.errors = vErrors; return false; ")):!1===A.errors?o+=" "+U+" ":(o+=" if (Array.isArray("+P+")) { if (vErrors === null) vErrors = "+P+"; else vErrors = vErrors.concat("+P+"); errors = vErrors.length; for (var "+D+"="+p+"; "+D+"<errors; "+D+"++) { var "+C+" = vErrors["+D+"]; if ("+C+".dataPath === undefined) "+C+".dataPath = (dataPath || '') + "+e.errorPath+"; "+C+'.schemaPath = "'+l+'"; ',e.opts.verbose&&(o+=" "+C+".schema = "+i+"; "+C+".data = "+d+"; "),o+=" } } else { "+U+" } "),o+=" } ",f&&(o+=" else { ")}return o}},{}],25:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],u=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),f="errs__"+i,d=e.util.copy(e),h="";d.level++;var p="valid"+d.level,y={},m={},v=e.opts.ownProperties;for(w in a){var _=a[w],g=Array.isArray(_)?m:y;g[w]=_}n+="var "+f+" = errors;";var b=e.errorPath;n+="var missing"+i+";";for(var w in m)if(g=m[w],g.length){if(n+=" if ( "+l+e.util.getProperty(w)+" !== undefined ",v&&(n+=" && Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(w)+"') "),c){n+=" && ( ";var E=g;if(E)for(var A,O=-1,S=E.length-1;O<S;){A=E[O+=1],O&&(n+=" || ");var P=e.util.getProperty(A),D=l+P;n+=" ( ( "+D+" === undefined ",v&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(A)+"') "),n+=") && (missing"+i+" = "+e.util.toQuotedString(e.opts.jsonPointers?A:P)+") ) "}n+=")) { ";var C="missing"+i,k="' + "+C+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(b,C,!0):b+" + "+C);var T=T||[];T.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { property: '"+e.util.escapeQuotes(w)+"', missingProperty: '"+k+"', depsCount: "+g.length+", deps: '"+e.util.escapeQuotes(1==g.length?g[0]:g.join(", "))+"' } ",!1!==e.opts.messages&&(n+=" , message: 'should have ",1==g.length?n+="property "+e.util.escapeQuotes(g[0]):n+="properties "+e.util.escapeQuotes(g.join(", ")),n+=" when property "+e.util.escapeQuotes(w)+" is present' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var F=n;n=T.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+F+"]); ":n+=" validate.errors = ["+F+"]; return false; ":n+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{n+=" ) { ";var j=g;if(j)for(var A,x=-1,B=j.length-1;x<B;){A=j[x+=1];var P=e.util.getProperty(A),k=e.util.escapeQuotes(A),D=l+P;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(b,A,e.opts.jsonPointers)),n+=" if ( "+D+" === undefined ",v&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(A)+"') "),n+=") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { property: '"+e.util.escapeQuotes(w)+"', missingProperty: '"+k+"', depsCount: "+g.length+", deps: '"+e.util.escapeQuotes(1==g.length?g[0]:g.join(", "))+"' } ",!1!==e.opts.messages&&(n+=" , message: 'should have ",1==g.length?n+="property "+e.util.escapeQuotes(g[0]):n+="properties "+e.util.escapeQuotes(g.join(", ")),n+=" when property "+e.util.escapeQuotes(w)+" is present' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}n+=" } ",c&&(h+="}",n+=" else { ")}e.errorPath=b;var M=d.baseId;for(var w in y){var _=y[w];(e.opts.strictKeywords?"object"==typeof _&&Object.keys(_).length>0:e.util.schemaHasRules(_,e.RULES.all))&&(n+=" "+p+" = true; if ( "+l+e.util.getProperty(w)+" !== undefined ",v&&(n+=" && Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(w)+"') "),n+=") { ",d.schema=_,d.schemaPath=u+e.util.getProperty(w),d.errSchemaPath=s+"/"+e.util.escapeFragment(w),n+=" "+e.validate(d)+" ",d.baseId=M,n+=" } ",c&&(n+=" if ("+p+") { ",h+="}"))}return c&&(n+=" "+h+" if ("+f+" == errors) {"),n=e.util.cleanUpCode(n)}},{}],26:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],u=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),f="valid"+i,d=e.opts.$data&&a&&a.$data;d&&(n+=" var schema"+i+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ");var h="i"+i,p="schema"+i;d||(n+=" var "+p+" = validate.schema"+u+";"),n+="var "+f+";",d&&(n+=" if (schema"+i+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+i+")) "+f+" = false; else {"),n+=f+" = false;for (var "+h+"=0; "+h+"<"+p+".length; "+h+"++) if (equal("+l+", "+p+"["+h+"])) { "+f+" = true; break; }",d&&(n+=" } "),n+=" if (!"+f+") { ";var y=y||[];y.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { allowedValues: schema"+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var m=n;return n=y.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" }",c&&(n+=" else { "),n}},{}],27:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],u=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||"");if(!1===e.opts.format)return c&&(n+=" if (true) { "),n;var f,d=e.opts.$data&&a&&a.$data;d?(n+=" var schema"+i+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ",f="schema"+i):f=a;var h=e.opts.unknownFormats,p=Array.isArray(h);if(d){var y="format"+i,m="isObject"+i,v="formatType"+i;n+=" var "+y+" = formats["+f+"]; var "+m+" = typeof "+y+" == 'object' && !("+y+" instanceof RegExp) && "+y+".validate; var "+v+" = "+m+" && "+y+".type || 'string'; if ("+m+") { ",e.async&&(n+=" var async"+i+" = "+y+".async; "),n+=" "+y+" = "+y+".validate; } if ( ",d&&(n+=" ("+f+" !== undefined && typeof "+f+" != 'string') || "),n+=" (","ignore"!=h&&(n+=" ("+f+" && !"+y+" ",p&&(n+=" && self._opts.unknownFormats.indexOf("+f+") == -1 "),n+=") || "),n+=" ("+y+" && "+v+" == '"+r+"' && !(typeof "+y+" == 'function' ? ",e.async?n+=" (async"+i+" ? await "+y+"("+l+") : "+y+"("+l+")) ":n+=" "+y+"("+l+") ",n+=" : "+y+".test("+l+"))))) {"}else{var y=e.formats[a];if(!y){if("ignore"==h)return e.logger.warn('unknown format "'+a+'" ignored in schema at path "'+e.errSchemaPath+'"'),c&&(n+=" if (true) { "),n;if(p&&h.indexOf(a)>=0)return c&&(n+=" if (true) { "),n;throw new Error('unknown format "'+a+'" is used in schema at path "'+e.errSchemaPath+'"')}var m="object"==typeof y&&!(y instanceof RegExp)&&y.validate,v=m&&y.type||"string";if(m){var _=!0===y.async;y=y.validate}if(v!=r)return c&&(n+=" if (true) { "),n;if(_){if(!e.async)throw new Error("async format in sync schema");var g="formats"+e.util.getProperty(a)+".validate";n+=" if (!(await "+g+"("+l+"))) { "}else{n+=" if (! ";var g="formats"+e.util.getProperty(a);m&&(g+=".validate"),n+="function"==typeof y?" "+g+"("+l+") ":" "+g+".test("+l+") ",n+=") { "}}var b=b||[];b.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { format: ",n+=d?""+f:""+e.util.toQuotedString(a),n+=" } ",!1!==e.opts.messages&&(n+=" , message: 'should match format \"",n+=d?"' + "+f+" + '":""+e.util.escapeQuotes(a),n+="\"' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+u:""+e.util.toQuotedString(a),n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var w=n;return n=b.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+w+"]); ":n+=" validate.errors = ["+w+"]; return false; ":n+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { "),n}},{}],28:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],u=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),f="valid"+i,d="errs__"+i,h=e.util.copy(e);h.level++;var p="valid"+h.level,y=e.schema.then,m=e.schema.else,v=void 0!==y&&(e.opts.strictKeywords?"object"==typeof y&&Object.keys(y).length>0:e.util.schemaHasRules(y,e.RULES.all)),_=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0:e.util.schemaHasRules(m,e.RULES.all)),g=h.baseId;if(v||_){var b;h.createErrors=!1,h.schema=a,h.schemaPath=u,h.errSchemaPath=s,n+=" var "+d+" = errors; var "+f+" = true; ";var w=e.compositeRule;e.compositeRule=h.compositeRule=!0,n+=" "+e.validate(h)+" ",h.baseId=g,h.createErrors=!0,n+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.compositeRule=h.compositeRule=w,v?(n+=" if ("+p+") { ",h.schema=e.schema.then,h.schemaPath=e.schemaPath+".then",h.errSchemaPath=e.errSchemaPath+"/then",n+=" "+e.validate(h)+" ",h.baseId=g,n+=" "+f+" = "+p+"; ",v&&_?(b="ifClause"+i,n+=" var "+b+" = 'then'; "):b="'then'",n+=" } ",_&&(n+=" else { ")):n+=" if (!"+p+") { ",_&&(h.schema=e.schema.else,h.schemaPath=e.schemaPath+".else",h.errSchemaPath=e.errSchemaPath+"/else",n+=" "+e.validate(h)+" ",h.baseId=g,n+=" "+f+" = "+p+"; ",v&&_?(b="ifClause"+i,n+=" var "+b+" = 'else'; "):b="'else'",n+=" } "),n+=" if (!"+f+") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { failingKeyword: "+b+" } ",!1!==e.opts.messages&&(n+=" , message: 'should match \"' + "+b+" + '\" schema' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+=" } ",c&&(n+=" else { "),n=e.util.cleanUpCode(n)}else c&&(n+=" if (true) { ");return n}},{}],29:[function(e,t,r){"use strict";t.exports={$ref:e("./ref"),allOf:e("./allOf"),anyOf:e("./anyOf"),$comment:e("./comment"),const:e("./const"),contains:e("./contains"),dependencies:e("./dependencies"),enum:e("./enum"),format:e("./format"),if:e("./if"),items:e("./items"),maximum:e("./_limit"),minimum:e("./_limit"),maxItems:e("./_limitItems"),minItems:e("./_limitItems"),maxLength:e("./_limitLength"),minLength:e("./_limitLength"),maxProperties:e("./_limitProperties"),minProperties:e("./_limitProperties"),multipleOf:e("./multipleOf"),not:e("./not"),oneOf:e("./oneOf"),pattern:e("./pattern"),properties:e("./properties"),propertyNames:e("./propertyNames"),required:e("./required"),uniqueItems:e("./uniqueItems"),validate:e("./validate")}},{"./_limit":15,"./_limitItems":16,"./_limitLength":17,"./_limitProperties":18,"./allOf":19,"./anyOf":20,"./comment":21,"./const":22,"./contains":23,"./dependencies":25,"./enum":26,"./format":27,"./if":28,"./items":30,"./multipleOf":31,"./not":32,"./oneOf":33,"./pattern":34,"./properties":35,"./propertyNames":36,"./ref":37,"./required":38,"./uniqueItems":39,"./validate":40}],30:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],u=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),f="valid"+i,d="errs__"+i,h=e.util.copy(e),p="";h.level++;var y="valid"+h.level,m="i"+i,v=h.dataLevel=e.dataLevel+1,_="data"+v,g=e.baseId;if(n+="var "+d+" = errors;var "+f+";",Array.isArray(a)){var b=e.schema.additionalItems;if(!1===b){n+=" "+f+" = "+l+".length <= "+a.length+"; ";var w=s;s=e.errSchemaPath+"/additionalItems",n+=" if (!"+f+") { ";var E=E||[];E.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { limit: "+a.length+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have more than "+a.length+" items' "),e.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var A=n;n=E.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+A+"]); ":n+=" validate.errors = ["+A+"]; return false; ":n+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",s=w,c&&(p+="}",n+=" else { ")}var O=a;if(O)for(var S,P=-1,D=O.length-1;P<D;)if(S=O[P+=1],e.opts.strictKeywords?"object"==typeof S&&Object.keys(S).length>0:e.util.schemaHasRules(S,e.RULES.all)){n+=" "+y+" = true; if ("+l+".length > "+P+") { ";var C=l+"["+P+"]";h.schema=S,h.schemaPath=u+"["+P+"]",h.errSchemaPath=s+"/"+P,h.errorPath=e.util.getPathExpr(e.errorPath,P,e.opts.jsonPointers,!0),
|
|
3
3
|
h.dataPathArr[v]=P;var k=e.validate(h);h.baseId=g,e.util.varOccurences(k,_)<2?n+=" "+e.util.varReplace(k,_,C)+" ":n+=" var "+_+" = "+C+"; "+k+" ",n+=" } ",c&&(n+=" if ("+y+") { ",p+="}")}if("object"==typeof b&&(e.opts.strictKeywords?"object"==typeof b&&Object.keys(b).length>0:e.util.schemaHasRules(b,e.RULES.all))){h.schema=b,h.schemaPath=e.schemaPath+".additionalItems",h.errSchemaPath=e.errSchemaPath+"/additionalItems",n+=" "+y+" = true; if ("+l+".length > "+a.length+") { for (var "+m+" = "+a.length+"; "+m+" < "+l+".length; "+m+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var C=l+"["+m+"]";h.dataPathArr[v]=m;var k=e.validate(h);h.baseId=g,e.util.varOccurences(k,_)<2?n+=" "+e.util.varReplace(k,_,C)+" ":n+=" var "+_+" = "+C+"; "+k+" ",c&&(n+=" if (!"+y+") break; "),n+=" } } ",c&&(n+=" if ("+y+") { ",p+="}")}}else if(e.opts.strictKeywords?"object"==typeof a&&Object.keys(a).length>0:e.util.schemaHasRules(a,e.RULES.all)){h.schema=a,h.schemaPath=u,h.errSchemaPath=s,n+=" for (var "+m+" = 0; "+m+" < "+l+".length; "+m+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var C=l+"["+m+"]";h.dataPathArr[v]=m;var k=e.validate(h);h.baseId=g,e.util.varOccurences(k,_)<2?n+=" "+e.util.varReplace(k,_,C)+" ":n+=" var "+_+" = "+C+"; "+k+" ",c&&(n+=" if (!"+y+") break; "),n+=" }"}return c&&(n+=" "+p+" if ("+d+" == errors) {"),n=e.util.cleanUpCode(n)}},{}],31:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n,i=" ",o=e.level,a=e.dataLevel,u=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,f="data"+(a||""),d=e.opts.$data&&u&&u.$data;d?(i+=" var schema"+o+" = "+e.util.getData(u.$data,a,e.dataPathArr)+"; ",n="schema"+o):n=u,i+="var division"+o+";if (",d&&(i+=" "+n+" !== undefined && ( typeof "+n+" != 'number' || "),i+=" (division"+o+" = "+f+" / "+n+", ",e.opts.multipleOfPrecision?i+=" Math.abs(Math.round(division"+o+") - division"+o+") > 1e-"+e.opts.multipleOfPrecision+" ":i+=" division"+o+" !== parseInt(division"+o+") ",i+=" ) ",d&&(i+=" ) "),i+=" ) { ";var h=h||[];h.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { multipleOf: "+n+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be multiple of ",i+=d?"' + "+n:n+"'"),e.opts.verbose&&(i+=" , schema: ",i+=d?"validate.schema"+s:""+u,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var p=i;return i=h.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+p+"]); ":i+=" validate.errors = ["+p+"]; return false; ":i+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i}},{}],32:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],u=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),f="errs__"+i,d=e.util.copy(e);d.level++;var h="valid"+d.level;if(e.opts.strictKeywords?"object"==typeof a&&Object.keys(a).length>0:e.util.schemaHasRules(a,e.RULES.all)){d.schema=a,d.schemaPath=u,d.errSchemaPath=s,n+=" var "+f+" = errors; ";var p=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.createErrors=!1;var y;d.opts.allErrors&&(y=d.opts.allErrors,d.opts.allErrors=!1),n+=" "+e.validate(d)+" ",d.createErrors=!0,y&&(d.opts.allErrors=y),e.compositeRule=d.compositeRule=p,n+=" if ("+h+") { ";var m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be valid' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var v=n;n=m.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } ",e.opts.allErrors&&(n+=" } ")}else n+=" var err = ",!1!==e.createErrors?(n+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be valid' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(n+=" if (false) { ");return n}},{}],33:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],u=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),f="valid"+i,d="errs__"+i,h=e.util.copy(e),p="";h.level++;var y="valid"+h.level,m=h.baseId,v="prevValid"+i,_="passingSchemas"+i;n+="var "+d+" = errors , "+v+" = false , "+f+" = false , "+_+" = null; ";var g=e.compositeRule;e.compositeRule=h.compositeRule=!0;var b=a;if(b)for(var w,E=-1,A=b.length-1;E<A;)w=b[E+=1],(e.opts.strictKeywords?"object"==typeof w&&Object.keys(w).length>0:e.util.schemaHasRules(w,e.RULES.all))?(h.schema=w,h.schemaPath=u+"["+E+"]",h.errSchemaPath=s+"/"+E,n+=" "+e.validate(h)+" ",h.baseId=m):n+=" var "+y+" = true; ",E&&(n+=" if ("+y+" && "+v+") { "+f+" = false; "+_+" = ["+_+", "+E+"]; } else { ",p+="}"),n+=" if ("+y+") { "+f+" = "+v+" = true; "+_+" = "+E+"; }";return e.compositeRule=h.compositeRule=g,n+=p+"if (!"+f+") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { passingSchemas: "+_+" } ",!1!==e.opts.messages&&(n+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+="} else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; }",e.opts.allErrors&&(n+=" } "),n}},{}],34:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n,i=" ",o=e.level,a=e.dataLevel,u=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,f="data"+(a||""),d=e.opts.$data&&u&&u.$data;d?(i+=" var schema"+o+" = "+e.util.getData(u.$data,a,e.dataPathArr)+"; ",n="schema"+o):n=u;var h=d?"(new RegExp("+n+"))":e.usePattern(u);i+="if ( ",d&&(i+=" ("+n+" !== undefined && typeof "+n+" != 'string') || "),i+=" !"+h+".test("+f+") ) { ";var p=p||[];p.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { pattern: ",i+=d?""+n:""+e.util.toQuotedString(u),i+=" } ",!1!==e.opts.messages&&(i+=" , message: 'should match pattern \"",i+=d?"' + "+n+" + '":""+e.util.escapeQuotes(u),i+="\"' "),e.opts.verbose&&(i+=" , schema: ",i+=d?"validate.schema"+s:""+e.util.toQuotedString(u),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var y=i;return i=p.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+y+"]); ":i+=" validate.errors = ["+y+"]; return false; ":i+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i}},{}],35:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],u=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),f="errs__"+i,d=e.util.copy(e),h="";d.level++;var p="valid"+d.level,y="key"+i,m="idx"+i,v=d.dataLevel=e.dataLevel+1,_="data"+v,g="dataProperties"+i,b=Object.keys(a||{}),w=e.schema.patternProperties||{},E=Object.keys(w),A=e.schema.additionalProperties,O=b.length||E.length,S=!1===A,P="object"==typeof A&&Object.keys(A).length,D=e.opts.removeAdditional,C=S||P||D,k=e.opts.ownProperties,T=e.baseId,F=e.schema.required;if(F&&(!e.opts.$data||!F.$data)&&F.length<e.opts.loopRequired)var j=e.util.toHash(F);if(n+="var "+f+" = errors;var "+p+" = true;",k&&(n+=" var "+g+" = undefined;"),C){if(n+=k?" "+g+" = "+g+" || Object.keys("+l+"); for (var "+m+"=0; "+m+"<"+g+".length; "+m+"++) { var "+y+" = "+g+"["+m+"]; ":" for (var "+y+" in "+l+") { ",O){if(n+=" var isAdditional"+i+" = !(false ",b.length)if(b.length>8)n+=" || validate.schema"+u+".hasOwnProperty("+y+") ";else{var x=b;if(x)for(var B,M=-1,R=x.length-1;M<R;)B=x[M+=1],n+=" || "+y+" == "+e.util.toQuotedString(B)+" "}if(E.length){var I=E;if(I)for(var N,U=-1,L=I.length-1;U<L;)N=I[U+=1],n+=" || "+e.usePattern(N)+".test("+y+") "}n+=" ); if (isAdditional"+i+") { "}if("all"==D)n+=" delete "+l+"["+y+"]; ";else{var z=e.errorPath,G="' + "+y+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,y,e.opts.jsonPointers)),S)if(D)n+=" delete "+l+"["+y+"]; ";else{n+=" "+p+" = false; ";var q=s;s=e.errSchemaPath+"/additionalProperties";var V=V||[];V.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { additionalProperty: '"+G+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is an invalid additional property":n+="should NOT have additional properties",n+="' "),e.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var H=n;n=V.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+H+"]); ":n+=" validate.errors = ["+H+"]; return false; ":n+=" var err = "+H+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s=q,c&&(n+=" break; ")}else if(P)if("failing"==D){n+=" var "+f+" = errors; ";var W=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.schema=A,d.schemaPath=e.schemaPath+".additionalProperties",d.errSchemaPath=e.errSchemaPath+"/additionalProperties",d.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,y,e.opts.jsonPointers);var Y=l+"["+y+"]";d.dataPathArr[v]=y;var $=e.validate(d);d.baseId=T,e.util.varOccurences($,_)<2?n+=" "+e.util.varReplace($,_,Y)+" ":n+=" var "+_+" = "+Y+"; "+$+" ",n+=" if (!"+p+") { errors = "+f+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+l+"["+y+"]; } ",e.compositeRule=d.compositeRule=W}else{d.schema=A,d.schemaPath=e.schemaPath+".additionalProperties",d.errSchemaPath=e.errSchemaPath+"/additionalProperties",d.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,y,e.opts.jsonPointers);var Y=l+"["+y+"]";d.dataPathArr[v]=y;var $=e.validate(d);d.baseId=T,e.util.varOccurences($,_)<2?n+=" "+e.util.varReplace($,_,Y)+" ":n+=" var "+_+" = "+Y+"; "+$+" ",c&&(n+=" if (!"+p+") break; ")}e.errorPath=z}O&&(n+=" } "),n+=" } ",c&&(n+=" if ("+p+") { ",h+="}")}var K=e.opts.useDefaults&&!e.compositeRule;if(b.length){var J=b;if(J)for(var B,Q=-1,X=J.length-1;Q<X;){B=J[Q+=1];var Z=a[B];if(e.opts.strictKeywords?"object"==typeof Z&&Object.keys(Z).length>0:e.util.schemaHasRules(Z,e.RULES.all)){var ee=e.util.getProperty(B),Y=l+ee,te=K&&void 0!==Z.default;d.schema=Z,d.schemaPath=u+ee,d.errSchemaPath=s+"/"+e.util.escapeFragment(B),d.errorPath=e.util.getPath(e.errorPath,B,e.opts.jsonPointers),d.dataPathArr[v]=e.util.toQuotedString(B);var $=e.validate(d);if(d.baseId=T,e.util.varOccurences($,_)<2){$=e.util.varReplace($,_,Y);var re=Y}else{var re=_;n+=" var "+_+" = "+Y+"; "}if(te)n+=" "+$+" ";else{if(j&&j[B]){n+=" if ( "+re+" === undefined ",k&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(B)+"') "),n+=") { "+p+" = false; ";var z=e.errorPath,q=s,ne=e.util.escapeQuotes(B);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(z,B,e.opts.jsonPointers)),s=e.errSchemaPath+"/required";var V=V||[];V.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { missingProperty: '"+ne+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+ne+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var H=n;n=V.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+H+"]); ":n+=" validate.errors = ["+H+"]; return false; ":n+=" var err = "+H+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s=q,e.errorPath=z,n+=" } else { "}else c?(n+=" if ( "+re+" === undefined ",k&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(B)+"') "),n+=") { "+p+" = true; } else { "):(n+=" if ("+re+" !== undefined ",k&&(n+=" && Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(B)+"') "),n+=" ) { ");n+=" "+$+" } "}}c&&(n+=" if ("+p+") { ",h+="}")}}if(E.length){var ie=E;if(ie)for(var N,oe=-1,ae=ie.length-1;oe<ae;){N=ie[oe+=1];var Z=w[N];if(e.opts.strictKeywords?"object"==typeof Z&&Object.keys(Z).length>0:e.util.schemaHasRules(Z,e.RULES.all)){d.schema=Z,d.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(N),d.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(N),n+=k?" "+g+" = "+g+" || Object.keys("+l+"); for (var "+m+"=0; "+m+"<"+g+".length; "+m+"++) { var "+y+" = "+g+"["+m+"]; ":" for (var "+y+" in "+l+") { ",n+=" if ("+e.usePattern(N)+".test("+y+")) { ",d.errorPath=e.util.getPathExpr(e.errorPath,y,e.opts.jsonPointers);var Y=l+"["+y+"]";d.dataPathArr[v]=y;var $=e.validate(d);d.baseId=T,e.util.varOccurences($,_)<2?n+=" "+e.util.varReplace($,_,Y)+" ":n+=" var "+_+" = "+Y+"; "+$+" ",c&&(n+=" if (!"+p+") break; "),n+=" } ",c&&(n+=" else "+p+" = true; "),n+=" } ",c&&(n+=" if ("+p+") { ",h+="}")}}}return c&&(n+=" "+h+" if ("+f+" == errors) {"),n=e.util.cleanUpCode(n)}},{}],36:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],u=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),f="errs__"+i,d=e.util.copy(e);d.level++;var h="valid"+d.level;if(n+="var "+f+" = errors;",e.opts.strictKeywords?"object"==typeof a&&Object.keys(a).length>0:e.util.schemaHasRules(a,e.RULES.all)){d.schema=a,d.schemaPath=u,d.errSchemaPath=s;var p="key"+i,y="idx"+i,m="i"+i,v="' + "+p+" + '",_=d.dataLevel=e.dataLevel+1,g="data"+_,b="dataProperties"+i,w=e.opts.ownProperties,E=e.baseId;w&&(n+=" var "+b+" = undefined; "),n+=w?" "+b+" = "+b+" || Object.keys("+l+"); for (var "+y+"=0; "+y+"<"+b+".length; "+y+"++) { var "+p+" = "+b+"["+y+"]; ":" for (var "+p+" in "+l+") { ",n+=" var startErrs"+i+" = errors; ";var A=p,O=e.compositeRule;e.compositeRule=d.compositeRule=!0;var S=e.validate(d);d.baseId=E,e.util.varOccurences(S,g)<2?n+=" "+e.util.varReplace(S,g,A)+" ":n+=" var "+g+" = "+A+"; "+S+" ",e.compositeRule=d.compositeRule=O,n+=" if (!"+h+") { for (var "+m+"=startErrs"+i+"; "+m+"<errors; "+m+"++) { vErrors["+m+"].propertyName = "+p+"; } var err = ",!1!==e.createErrors?(n+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { propertyName: '"+v+"' } ",!1!==e.opts.messages&&(n+=" , message: 'property name \\'"+v+"\\' is invalid' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),c&&(n+=" break; "),n+=" } }"}return c&&(n+=" if ("+f+" == errors) {"),n=e.util.cleanUpCode(n)}},{}],37:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n,i,o=" ",a=e.level,u=e.dataLevel,s=e.schema[t],c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,f="data"+(u||""),d="valid"+a;if("#"==s||"#/"==s)e.isRoot?(n=e.async,i="validate"):(n=!0===e.root.schema.$async,i="root.refVal[0]");else{var h=e.resolveRef(e.baseId,s,e.isRoot);if(void 0===h){var p=e.MissingRefError.message(e.baseId,s);if("fail"==e.opts.missingRefs){e.logger.error(p);var y=y||[];y.push(o),o="",!1!==e.createErrors?(o+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { ref: '"+e.util.escapeQuotes(s)+"' } ",!1!==e.opts.messages&&(o+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(s)+"' "),e.opts.verbose&&(o+=" , schema: "+e.util.toQuotedString(s)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),o+=" } "):o+=" {} ";var m=o;o=y.pop(),!e.compositeRule&&l?e.async?o+=" throw new ValidationError(["+m+"]); ":o+=" validate.errors = ["+m+"]; return false; ":o+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l&&(o+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,s,p);e.logger.warn(p),l&&(o+=" if (true) { ")}}else if(h.inline){var v=e.util.copy(e);v.level++;var _="valid"+v.level;v.schema=h.schema,v.schemaPath="",v.errSchemaPath=s;var g=e.validate(v).replace(/validate\.schema/g,h.code);o+=" "+g+" ",l&&(o+=" if ("+_+") { ")}else n=!0===h.$async||e.async&&!1!==h.$async,i=h.code}if(i){var y=y||[];y.push(o),o="",e.opts.passContext?o+=" "+i+".call(this, ":o+=" "+i+"( ",o+=" "+f+", (dataPath || '')",'""'!=e.errorPath&&(o+=" + "+e.errorPath);o+=" , "+(u?"data"+(u-1||""):"parentData")+" , "+(u?e.dataPathArr[u]:"parentDataProperty")+", rootData) ";var b=o;if(o=y.pop(),n){if(!e.async)throw new Error("async schema referenced by sync schema");l&&(o+=" var "+d+"; "),o+=" try { await "+b+"; ",l&&(o+=" "+d+" = true; "),o+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",l&&(o+=" "+d+" = false; "),o+=" } ",l&&(o+=" if ("+d+") { ")}else o+=" if (!"+b+") { if (vErrors === null) vErrors = "+i+".errors; else vErrors = vErrors.concat("+i+".errors); errors = vErrors.length; } ",l&&(o+=" else { ")}return o}},{}],38:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],u=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),f="valid"+i,d=e.opts.$data&&a&&a.$data;d&&(n+=" var schema"+i+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ");var h="schema"+i;if(!d)if(a.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var p=[],y=a;if(y)for(var m,v=-1,_=y.length-1;v<_;){m=y[v+=1];var g=e.schema.properties[m];g&&(e.opts.strictKeywords?"object"==typeof g&&Object.keys(g).length>0:e.util.schemaHasRules(g,e.RULES.all))||(p[p.length]=m)}}else var p=a;if(d||p.length){var b=e.errorPath,w=d||p.length>=e.opts.loopRequired,E=e.opts.ownProperties;if(c)if(n+=" var missing"+i+"; ",w){d||(n+=" var "+h+" = validate.schema"+u+"; ");var A="i"+i,O="schema"+i+"["+A+"]",S="' + "+O+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(b,O,e.opts.jsonPointers)),n+=" var "+f+" = true; ",d&&(n+=" if (schema"+i+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+i+")) "+f+" = false; else {"),n+=" for (var "+A+" = 0; "+A+" < "+h+".length; "+A+"++) { "+f+" = "+l+"["+h+"["+A+"]] !== undefined ",E&&(n+=" && Object.prototype.hasOwnProperty.call("+l+", "+h+"["+A+"]) "),n+="; if (!"+f+") break; } ",d&&(n+=" } "),n+=" if (!"+f+") { ";var P=P||[];P.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { missingProperty: '"+S+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+S+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var D=n;n=P.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+D+"]); ":n+=" validate.errors = ["+D+"]; return false; ":n+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { "}else{n+=" if ( ";var C=p;if(C)for(var k,A=-1,T=C.length-1;A<T;){k=C[A+=1],A&&(n+=" || ");var F=e.util.getProperty(k),j=l+F;n+=" ( ( "+j+" === undefined ",E&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(k)+"') "),n+=") && (missing"+i+" = "+e.util.toQuotedString(e.opts.jsonPointers?k:F)+") ) "}n+=") { ";var O="missing"+i,S="' + "+O+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(b,O,!0):b+" + "+O);var P=P||[];P.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { missingProperty: '"+S+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+S+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var D=n;n=P.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+D+"]); ":n+=" validate.errors = ["+D+"]; return false; ":n+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { "}else if(w){d||(n+=" var "+h+" = validate.schema"+u+"; ");var A="i"+i,O="schema"+i+"["+A+"]",S="' + "+O+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(b,O,e.opts.jsonPointers)),d&&(n+=" if ("+h+" && !Array.isArray("+h+")) { var err = ",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { missingProperty: '"+S+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+S+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+h+" !== undefined) { "),n+=" for (var "+A+" = 0; "+A+" < "+h+".length; "+A+"++) { if ("+l+"["+h+"["+A+"]] === undefined ",E&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", "+h+"["+A+"]) "),n+=") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { missingProperty: '"+S+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+S+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",d&&(n+=" } ")}else{var x=p;if(x)for(var k,B=-1,M=x.length-1;B<M;){k=x[B+=1];var F=e.util.getProperty(k),S=e.util.escapeQuotes(k),j=l+F;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(b,k,e.opts.jsonPointers)),n+=" if ( "+j+" === undefined ",E&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(k)+"') "),n+=") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { missingProperty: '"+S+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+S+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=b}else c&&(n+=" if (true) {");return n}},{}],39:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n,i=" ",o=e.level,a=e.dataLevel,u=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,f="data"+(a||""),d="valid"+o,h=e.opts.$data&&u&&u.$data;if(h?(i+=" var schema"+o+" = "+e.util.getData(u.$data,a,e.dataPathArr)+"; ",n="schema"+o):n=u,(u||h)&&!1!==e.opts.uniqueItems){h&&(i+=" var "+d+"; if ("+n+" === false || "+n+" === undefined) "+d+" = true; else if (typeof "+n+" != 'boolean') "+d+" = false; else { "),i+=" var i = "+f+".length , "+d+" = true , j; if (i > 1) { ";var p=e.schema.items&&e.schema.items.type,y=Array.isArray(p);if(!p||"object"==p||"array"==p||y&&(p.indexOf("object")>=0||p.indexOf("array")>=0))i+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+f+"[i], "+f+"[j])) { "+d+" = false; break outer; } } } ";else{i+=" var itemIndices = {}, item; for (;i--;) { var item = "+f+"[i]; ";var m="checkDataType"+(y?"s":"");i+=" if ("+e.util[m](p,"item",!0)+") continue; ",y&&(i+=" if (typeof item == 'string') item = '\"' + item; "),i+=" if (typeof itemIndices[item] == 'number') { "+d+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}i+=" } ",h&&(i+=" } "),i+=" if (!"+d+") { ";var v=v||[];v.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(i+=" , schema: ",i+=h?"validate.schema"+s:""+u,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var _=i;i=v.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+_+"]); ":i+=" validate.errors = ["+_+"]; return false; ":i+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",l&&(i+=" else { ")}else l&&(i+=" if (true) { ");return i}},{}],40:[function(e,t,r){"use strict";t.exports=function(e,t,r){function n(e){for(var t=e.rules,r=0;r<t.length;r++)if(i(t[r]))return!0}function i(t){return void 0!==e.schema[t.keyword]||t.implements&&o(t)}function o(t){for(var r=t.implements,n=0;n<r.length;n++)if(void 0!==e.schema[r[n]])return!0}var a="",u=!0===e.schema.$async,s=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),c=e.self._getId(e.schema);if(e.opts.strictKeywords){var l=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(l){var f="unknown keyword: "+l;if("log"!==e.opts.strictKeywords)throw new Error(f);e.logger.warn(f)}}if(e.isTop&&(a+=" var validate = ",u&&(e.async=!0,a+="async "),a+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",c&&(e.opts.sourceCode||e.opts.processCode)&&(a+=" /*# sourceURL="+c+" */ ")),"boolean"==typeof e.schema||!s&&!e.schema.$ref){var d,h=e.level,p=e.dataLevel,y=e.schema["false schema"],m=e.schemaPath+e.util.getProperty("false schema"),v=e.errSchemaPath+"/false schema",_=!e.opts.allErrors,g="data"+(p||""),b="valid"+h;if(!1===e.schema){e.isTop?_=!0:a+=" var "+b+" = false; ";var w=w||[];w.push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(d||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(v)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'boolean schema is false' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),a+=" } "):a+=" {} ";var E=a;a=w.pop(),!e.compositeRule&&_?e.async?a+=" throw new ValidationError(["+E+"]); ":a+=" validate.errors = ["+E+"]; return false; ":a+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?a+=u?" return data; ":" validate.errors = null; return true; ":a+=" var "+b+" = true; ";return e.isTop&&(a+=" }; return validate; "),a}if(e.isTop){var A=e.isTop,h=e.level=0,p=e.dataLevel=0,g="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[void 0],void 0!==e.schema.default&&e.opts.useDefaults&&e.opts.strictDefaults){var O="default is ignored in the schema root";if("log"!==e.opts.strictDefaults)throw new Error(O);e.logger.warn(O)}a+=" var vErrors = null; ",a+=" var errors = 0; ",a+=" if (rootData === undefined) rootData = data; "}else{var h=e.level,p=e.dataLevel,g="data"+(p||"");if(c&&(e.baseId=e.resolve.url(e.baseId,c)),u&&!e.async)throw new Error("async schema in sync schema");a+=" var errs_"+h+" = errors;"}var d,b="valid"+h,_=!e.opts.allErrors,S="",P="",D=e.schema.type,C=Array.isArray(D);if(D&&e.opts.nullable&&!0===e.schema.nullable&&(C?-1==D.indexOf("null")&&(D=D.concat("null")):"null"!=D&&(D=[D,"null"],C=!0)),C&&1==D.length&&(D=D[0],C=!1),e.schema.$ref&&s){if("fail"==e.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');!0!==e.opts.extendRefs&&(s=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(a+=" "+e.RULES.all.$comment.code(e,"$comment")),D){if(e.opts.coerceTypes)var k=e.util.coerceToTypes(e.opts.coerceTypes,D);var T=e.RULES.types[D];if(k||C||!0===T||T&&!n(T)){var m=e.schemaPath+".type",v=e.errSchemaPath+"/type",m=e.schemaPath+".type",v=e.errSchemaPath+"/type",F=C?"checkDataTypes":"checkDataType";if(a+=" if ("+e.util[F](D,g,!0)+") { ",k){var j="dataType"+h,x="coerced"+h;a+=" var "+j+" = typeof "+g+"; ","array"==e.opts.coerceTypes&&(a+=" if ("+j+" == 'object' && Array.isArray("+g+")) "+j+" = 'array'; "),a+=" var "+x+" = undefined; ";var B="",M=k;if(M)for(var R,I=-1,N=M.length-1;I<N;)R=M[I+=1],I&&(a+=" if ("+x+" === undefined) { ",B+="}"),"array"==e.opts.coerceTypes&&"array"!=R&&(a+=" if ("+j+" == 'array' && "+g+".length == 1) { "+x+" = "+g+" = "+g+"[0]; "+j+" = typeof "+g+"; } "),"string"==R?a+=" if ("+j+" == 'number' || "+j+" == 'boolean') "+x+" = '' + "+g+"; else if ("+g+" === null) "+x+" = ''; ":"number"==R||"integer"==R?(a+=" if ("+j+" == 'boolean' || "+g+" === null || ("+j+" == 'string' && "+g+" && "+g+" == +"+g+" ","integer"==R&&(a+=" && !("+g+" % 1)"),a+=")) "+x+" = +"+g+"; "):"boolean"==R?a+=" if ("+g+" === 'false' || "+g+" === 0 || "+g+" === null) "+x+" = false; else if ("+g+" === 'true' || "+g+" === 1) "+x+" = true; ":"null"==R?a+=" if ("+g+" === '' || "+g+" === 0 || "+g+" === false) "+x+" = null; ":"array"==e.opts.coerceTypes&&"array"==R&&(a+=" if ("+j+" == 'string' || "+j+" == 'number' || "+j+" == 'boolean' || "+g+" == null) "+x+" = ["+g+"]; ");a+=" "+B+" if ("+x+" === undefined) { ";var w=w||[];w.push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(d||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(v)+" , params: { type: '",a+=C?""+D.join(","):""+D,a+="' } ",!1!==e.opts.messages&&(a+=" , message: 'should be ",a+=C?""+D.join(","):""+D,a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+m+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),a+=" } "):a+=" {} ";var E=a;a=w.pop(),!e.compositeRule&&_?e.async?a+=" throw new ValidationError(["+E+"]); ":a+=" validate.errors = ["+E+"]; return false; ":a+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { "
|
|
4
4
|
;var U=p?"data"+(p-1||""):"parentData",L=p?e.dataPathArr[p]:"parentDataProperty";a+=" "+g+" = "+x+"; ",p||(a+="if ("+U+" !== undefined)"),a+=" "+U+"["+L+"] = "+x+"; } "}else{var w=w||[];w.push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(d||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(v)+" , params: { type: '",a+=C?""+D.join(","):""+D,a+="' } ",!1!==e.opts.messages&&(a+=" , message: 'should be ",a+=C?""+D.join(","):""+D,a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+m+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),a+=" } "):a+=" {} ";var E=a;a=w.pop(),!e.compositeRule&&_?e.async?a+=" throw new ValidationError(["+E+"]); ":a+=" validate.errors = ["+E+"]; return false; ":a+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}a+=" } "}}if(e.schema.$ref&&!s)a+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",_&&(a+=" } if (errors === ",a+=A?"0":"errs_"+h,a+=") { ",P+="}");else{var z=e.RULES;if(z)for(var T,G=-1,q=z.length-1;G<q;)if(T=z[G+=1],n(T)){if(T.type&&(a+=" if ("+e.util.checkDataType(T.type,g)+") { "),e.opts.useDefaults)if("object"==T.type&&e.schema.properties){var y=e.schema.properties,V=Object.keys(y),H=V;if(H)for(var W,Y=-1,$=H.length-1;Y<$;){W=H[Y+=1];var K=y[W];if(void 0!==K.default){var J=g+e.util.getProperty(W);if(e.compositeRule){if(e.opts.strictDefaults){var O="default is ignored for: "+J;if("log"!==e.opts.strictDefaults)throw new Error(O);e.logger.warn(O)}}else a+=" if ("+J+" === undefined ","empty"==e.opts.useDefaults&&(a+=" || "+J+" === null || "+J+" === '' "),a+=" ) "+J+" = ","shared"==e.opts.useDefaults?a+=" "+e.useDefault(K.default)+" ":a+=" "+JSON.stringify(K.default)+" ",a+="; "}}}else if("array"==T.type&&Array.isArray(e.schema.items)){var Q=e.schema.items;if(Q)for(var K,I=-1,X=Q.length-1;I<X;)if(K=Q[I+=1],void 0!==K.default){var J=g+"["+I+"]";if(e.compositeRule){if(e.opts.strictDefaults){var O="default is ignored for: "+J;if("log"!==e.opts.strictDefaults)throw new Error(O);e.logger.warn(O)}}else a+=" if ("+J+" === undefined ","empty"==e.opts.useDefaults&&(a+=" || "+J+" === null || "+J+" === '' "),a+=" ) "+J+" = ","shared"==e.opts.useDefaults?a+=" "+e.useDefault(K.default)+" ":a+=" "+JSON.stringify(K.default)+" ",a+="; "}}var Z=T.rules;if(Z)for(var ee,te=-1,re=Z.length-1;te<re;)if(ee=Z[te+=1],i(ee)){var ne=ee.code(e,ee.keyword,T.type);ne&&(a+=" "+ne+" ",_&&(S+="}"))}if(_&&(a+=" "+S+" ",S=""),T.type&&(a+=" } ",D&&D===T.type&&!k)){a+=" else { ";var m=e.schemaPath+".type",v=e.errSchemaPath+"/type",w=w||[];w.push(a),a="",!1!==e.createErrors?(a+=" { keyword: '"+(d||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(v)+" , params: { type: '",a+=C?""+D.join(","):""+D,a+="' } ",!1!==e.opts.messages&&(a+=" , message: 'should be ",a+=C?""+D.join(","):""+D,a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+m+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),a+=" } "):a+=" {} ";var E=a;a=w.pop(),!e.compositeRule&&_?e.async?a+=" throw new ValidationError(["+E+"]); ":a+=" validate.errors = ["+E+"]; return false; ":a+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } "}_&&(a+=" if (errors === ",a+=A?"0":"errs_"+h,a+=") { ",P+="}")}}return _&&(a+=" "+P+" "),A?(u?(a+=" if (errors === 0) return data; ",a+=" else throw new ValidationError(vErrors); "):(a+=" validate.errors = vErrors; ",a+=" return errors === 0; "),a+=" }; return validate;"):a+=" var "+b+" = errors === errs_"+h+";",a=e.util.cleanUpCode(a),A&&(a=e.util.finalCleanUpCode(a,u)),a}},{}],41:[function(e,t,r){"use strict";function n(e,t){function r(e,t,r){for(var i,o=0;o<n.length;o++){var a=n[o];if(a.type==t){i=a;break}}i||(i={type:t,rules:[]},n.push(i));var u={keyword:e,definition:r,custom:!0,code:s,implements:r.implements};i.rules.push(u),n.custom[e]=u}var n=this.RULES;if(n.keywords[e])throw new Error("Keyword "+e+" is already defined");if(!u.test(e))throw new Error("Keyword "+e+" is not a valid identifier");if(t){this.validateKeyword(t,!0);var i=t.type;if(Array.isArray(i))for(var o=0;o<i.length;o++)r(e,i[o],t);else r(e,i,t);var a=t.metaSchema;a&&(t.$data&&this._opts.$data&&(a={anyOf:[a,{$ref:"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#"}]}),t.validateSchema=this.compile(a,!0))}return n.keywords[e]=n.all[e]=!0,this}function i(e){var t=this.RULES.custom[e];return t?t.definition:this.RULES.keywords[e]||!1}function o(e){var t=this.RULES;delete t.keywords[e],delete t.all[e],delete t.custom[e];for(var r=0;r<t.length;r++)for(var n=t[r].rules,i=0;i<n.length;i++)if(n[i].keyword==e){n.splice(i,1);break}return this}function a(e,t){a.errors=null;var r=this._validateKeyword=this._validateKeyword||this.compile(c,!0);if(r(e))return!0;if(a.errors=r.errors,t)throw new Error("custom keyword definition is invalid: "+this.errorsText(r.errors));return!1}var u=/^[a-z_$][a-z0-9_$-]*$/i,s=e("./dotjs/custom"),c=e("./definition_schema");t.exports={add:n,get:i,remove:o,validate:a}},{"./definition_schema":14,"./dotjs/custom":24}],42:[function(e,t,r){t.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}},{}],43:[function(e,t,r){t.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}},{}],44:[function(e,t,r){function n(e,t){return h.isUndefined(t)?""+t:!h.isNumber(t)||!isNaN(t)&&isFinite(t)?h.isFunction(t)||h.isRegExp(t)?t.toString():t:t.toString()}function i(e,t){return h.isString(e)?e.length<t?e:e.slice(0,t):e}function o(e){return i(JSON.stringify(e.actual,n),128)+" "+e.operator+" "+i(JSON.stringify(e.expected,n),128)}function a(e,t,r,n,i){throw new m.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function u(e,t){e||a(e,!0,t,"==",m.ok)}function s(e,t){if(e===t)return!0;if(h.isBuffer(e)&&h.isBuffer(t)){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return h.isDate(e)&&h.isDate(t)?e.getTime()===t.getTime():h.isRegExp(e)&&h.isRegExp(t)?e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase:h.isObject(e)||h.isObject(t)?l(e,t):e==t}function c(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function l(e,t){if(h.isNullOrUndefined(e)||h.isNullOrUndefined(t))return!1;if(e.prototype!==t.prototype)return!1;if(c(e))return!!c(t)&&(e=p.call(e),t=p.call(t),s(e,t));try{var r,n,i=v(e),o=v(t)}catch(e){return!1}if(i.length!=o.length)return!1;for(i.sort(),o.sort(),n=i.length-1;n>=0;n--)if(i[n]!=o[n])return!1;for(n=i.length-1;n>=0;n--)if(r=i[n],!s(e[r],t[r]))return!1;return!0}function f(e,t){return!(!e||!t)&&("[object RegExp]"==Object.prototype.toString.call(t)?t.test(e):e instanceof t||!0===t.call({},e))}function d(e,t,r,n){var i;h.isString(r)&&(n=r,r=null);try{t()}catch(e){i=e}if(n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&a(i,r,"Missing expected exception"+n),!e&&f(i,r)&&a(i,r,"Got unwanted exception"+n),e&&i&&r&&!f(i,r)||!e&&i)throw i}var h=e("util/"),p=Array.prototype.slice,y=Object.prototype.hasOwnProperty,m=t.exports=u;m.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=o(this),this.generatedMessage=!0);var t=e.stackStartFunction||a;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=t.name,u=n.indexOf("\n"+i);if(u>=0){var s=n.indexOf("\n",u+1);n=n.substring(s+1)}this.stack=n}}},h.inherits(m.AssertionError,Error),m.fail=a,m.ok=u,m.equal=function(e,t,r){e!=t&&a(e,t,r,"==",m.equal)},m.notEqual=function(e,t,r){e==t&&a(e,t,r,"!=",m.notEqual)},m.deepEqual=function(e,t,r){s(e,t)||a(e,t,r,"deepEqual",m.deepEqual)},m.notDeepEqual=function(e,t,r){s(e,t)&&a(e,t,r,"notDeepEqual",m.notDeepEqual)},m.strictEqual=function(e,t,r){e!==t&&a(e,t,r,"===",m.strictEqual)},m.notStrictEqual=function(e,t,r){e===t&&a(e,t,r,"!==",m.notStrictEqual)},m.throws=function(e,t,r){d.apply(this,[!0].concat(p.call(arguments)))},m.doesNotThrow=function(e,t){d.apply(this,[!1].concat(p.call(arguments)))},m.ifError=function(e){if(e)throw e};var v=Object.keys||function(e){var t=[];for(var r in e)y.call(e,r)&&t.push(r);return t}},{"util/":47}],45:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],46:[function(e,t,r){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],47:[function(e,t,r){(function(t,n){function i(e,t){var n={seen:[],stylize:a};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(t)?n.showHidden=t:t&&r._extend(n,t),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=o),s(n,e,n.depth)}function o(e,t){var r=i.styles[t];return r?"["+i.colors[r][0]+"m"+e+"["+i.colors[r][1]+"m":e}function a(e,t){return e}function u(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function s(e,t,n){if(e.customInspect&&t&&P(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(n,e);return g(i)||(i=s(e,i,n)),i}var o=c(e,t);if(o)return o;var a=Object.keys(t),y=u(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(t)),S(t)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return l(t);if(0===a.length){if(P(t)){var m=t.name?": "+t.name:"";return e.stylize("[Function"+m+"]","special")}if(E(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(O(t))return e.stylize(Date.prototype.toString.call(t),"date");if(S(t))return l(t)}var v="",_=!1,b=["{","}"];if(p(t)&&(_=!0,b=["[","]"]),P(t)){v=" [Function"+(t.name?": "+t.name:"")+"]"}if(E(t)&&(v=" "+RegExp.prototype.toString.call(t)),O(t)&&(v=" "+Date.prototype.toUTCString.call(t)),S(t)&&(v=" "+l(t)),0===a.length&&(!_||0==t.length))return b[0]+v+b[1];if(n<0)return E(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var w;return w=_?f(e,t,n,y,a):a.map(function(r){return d(e,t,n,y,r,_)}),e.seen.pop(),h(w,v,b)}function c(e,t){if(w(t))return e.stylize("undefined","undefined");if(g(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return _(t)?e.stylize(""+t,"number"):y(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,r,n,i){for(var o=[],a=0,u=t.length;a<u;++a)F(t,String(a))?o.push(d(e,t,r,n,String(a),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(d(e,t,r,n,i,!0))}),o}function d(e,t,r,n,i,o){var a,u,c;if(c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},c.get?u=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(u=e.stylize("[Setter]","special")),F(n,i)||(a="["+i+"]"),u||(e.seen.indexOf(c.value)<0?(u=m(r)?s(e,c.value,null):s(e,c.value,r-1),u.indexOf("\n")>-1&&(u=o?u.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+u.split("\n").map(function(e){return" "+e}).join("\n"))):u=e.stylize("[Circular]","special")),w(a)){if(o&&i.match(/^\d+$/))return u;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+u}function h(e,t,r){var n=0;return e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function p(e){return Array.isArray(e)}function y(e){return"boolean"==typeof e}function m(e){return null===e}function v(e){return null==e}function _(e){return"number"==typeof e}function g(e){return"string"==typeof e}function b(e){return"symbol"==typeof e}function w(e){return void 0===e}function E(e){return A(e)&&"[object RegExp]"===C(e)}function A(e){return"object"==typeof e&&null!==e}function O(e){return A(e)&&"[object Date]"===C(e)}function S(e){return A(e)&&("[object Error]"===C(e)||e instanceof Error)}function P(e){return"function"==typeof e}function D(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function C(e){return Object.prototype.toString.call(e)}function k(e){return e<10?"0"+e.toString(10):e.toString(10)}function T(){var e=new Date,t=[k(e.getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":");return[e.getDate(),M[e.getMonth()],t].join(" ")}function F(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var j=/%[sdj%]/g;r.format=function(e){if(!g(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(i(arguments[r]));return t.join(" ")}for(var r=1,n=arguments,o=n.length,a=String(e).replace(j,function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),u=n[r];r<o;u=n[++r])m(u)||!A(u)?a+=" "+u:a+=" "+i(u);return a},r.deprecate=function(e,i){function o(){if(!a){if(t.throwDeprecation)throw new Error(i);t.traceDeprecation?console.trace(i):console.error(i),a=!0}return e.apply(this,arguments)}if(w(n.process))return function(){return r.deprecate(e,i).apply(this,arguments)};if(!0===t.noDeprecation)return e;var a=!1;return o};var x,B={};r.debuglog=function(e){if(w(x)&&(x=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!B[e])if(new RegExp("\\b"+e+"\\b","i").test(x)){var n=t.pid;B[e]=function(){var t=r.format.apply(r,arguments);console.error("%s %d: %s",e,n,t)}}else B[e]=function(){};return B[e]},r.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=p,r.isBoolean=y,r.isNull=m,r.isNullOrUndefined=v,r.isNumber=_,r.isString=g,r.isSymbol=b,r.isUndefined=w,r.isRegExp=E,r.isObject=A,r.isDate=O,r.isError=S,r.isFunction=P,r.isPrimitive=D,r.isBuffer=e("./support/isBuffer");var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];r.log=function(){console.log("%s - %s",T(),r.format.apply(r,arguments))},r.inherits=e("inherits"),r._extend=function(e,t){if(!t||!A(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(this,e("FWaASH"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":46,FWaASH:50,inherits:45}],48:[function(e,t,r){!function(e){"use strict";function t(e){var t=e.charCodeAt(0);return t===o||t===l?62:t===a||t===f?63:t<u?-1:t<u+10?t-u+26+26:t<c+26?t-c:t<s+26?t-s+26:void 0}function r(e){function r(e){c[f++]=e}var n,o,a,u,s,c;if(e.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var l=e.length;s="="===e.charAt(l-2)?2:"="===e.charAt(l-1)?1:0,c=new i(3*e.length/4-s),a=s>0?e.length-4:e.length;var f=0;for(n=0,o=0;n<a;n+=4,o+=3)u=t(e.charAt(n))<<18|t(e.charAt(n+1))<<12|t(e.charAt(n+2))<<6|t(e.charAt(n+3)),r((16711680&u)>>16),r((65280&u)>>8),r(255&u);return 2===s?(u=t(e.charAt(n))<<2|t(e.charAt(n+1))>>4,r(255&u)):1===s&&(u=t(e.charAt(n))<<10|t(e.charAt(n+1))<<4|t(e.charAt(n+2))>>2,r(u>>8&255),r(255&u)),c}function n(e){function t(e){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)}var r,n,i,o=e.length%3,a="";for(r=0,i=e.length-o;r<i;r+=3)n=(e[r]<<16)+(e[r+1]<<8)+e[r+2],a+=function(e){return t(e>>18&63)+t(e>>12&63)+t(e>>6&63)+t(63&e)}(n);switch(o){case 1:n=e[e.length-1],a+=t(n>>2),a+=t(n<<4&63),a+="==";break;case 2:n=(e[e.length-2]<<8)+e[e.length-1],a+=t(n>>10),a+=t(n>>4&63),a+=t(n<<2&63),a+="="}return a}var i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="+".charCodeAt(0),a="/".charCodeAt(0),u="0".charCodeAt(0),s="a".charCodeAt(0),c="A".charCodeAt(0),l="-".charCodeAt(0),f="_".charCodeAt(0);e.toByteArray=r,e.fromByteArray=n}(void 0===r?this.base64js={}:r)},{}],49:[function(e,t,r){},{}],50:[function(e,t,r){function n(){}var i=t.exports={};i.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var r=[];return window.addEventListener("message",function(e){var t=e.source;if((t===window||null===t)&&"process-tick"===e.data&&(e.stopPropagation(),r.length>0)){r.shift()()}},!0),function(e){r.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),i.title="browser",i.browser=!0,i.env={},i.argv=[],i.on=n,i.addListener=n,i.once=n,i.off=n,i.removeListener=n,i.removeAllListeners=n,i.emit=n,i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")}},{}],51:[function(e,t,r){function n(e){if(e&&!u.isEncoding(e))throw new Error("Unknown encoding: "+e)}function i(e){return e.toString(this.encoding)}function o(e){var t=this.charReceived=e.length%2;return this.charLength=t?2:0,t}function a(e){var t=this.charReceived=e.length%3;return this.charLength=t?3:0,t}var u=e("buffer").Buffer,s=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),n(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=o;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=a;break;default:return void(this.write=i)}this.charBuffer=new u(6),this.charReceived=0,this.charLength=0};s.prototype.write=function(e){for(var t="",r=0;this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,r,n),this.charReceived+=n-r,r=n,this.charReceived<this.charLength)return"";t=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var i=t.charCodeAt(t.length-1);if(!(i>=55296&&i<=56319)){if(this.charReceived=this.charLength=0,n==e.length)return t;e=e.slice(n,e.length);break}this.charLength+=this.surrogateSize,t=""}var o=this.detectIncompleteChar(e),a=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-o,a),this.charReceived=o,a-=o),t+=e.toString(this.encoding,0,a);var a=t.length-1,i=t.charCodeAt(a);if(i>=55296&&i<=56319){var u=this.surrogateSize;return this.charLength+=u,this.charReceived+=u,this.charBuffer.copy(this.charBuffer,u,0,u),this.charBuffer.write(t.charAt(t.length-1),this.encoding),t.substring(0,a)}return t},s.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}return t},s.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;t+=n.slice(0,r).toString(i)}return t}},{buffer:52}],52:[function(e,t,r){function n(e,t,r){if(!(this instanceof n))return new n(e,t,r);var i=typeof e;if("base64"===t&&"string"===i)for(e=C(e);e.length%4!=0;)e+="=";var o;if("number"===i)o=T(e);else if("string"===i)o=n.byteLength(e,t);else{if("object"!==i)throw new Error("First argument needs to be a number, array or string.");o=T(e.length)}var a;n._useTypedArrays?a=n._augment(new Uint8Array(o)):(a=this,a.length=o,a._isBuffer=!0);var u;if(n._useTypedArrays&&"number"==typeof e.byteLength)a._set(e);else if(j(e))for(u=0;u<o;u++)n.isBuffer(e)?a[u]=e.readUInt8(u):a[u]=e[u];else if("string"===i)a.write(e,0,t);else if("number"===i&&!n._useTypedArrays&&!r)for(u=0;u<o;u++)a[u]=0;return a}function i(e,t,r,i){r=Number(r)||0;var o=e.length-r;i?(i=Number(i))>o&&(i=o):i=o;var a=t.length;q(a%2==0,"Invalid hex string"),i>a/2&&(i=a/2);for(var u=0;u<i;u++){var s=parseInt(t.substr(2*u,2),16);q(!isNaN(s),"Invalid hex string"),e[r+u]=s}return n._charsWritten=2*u,u}function o(e,t,r,i){return n._charsWritten=N(B(t),e,r,i)}function a(e,t,r,i){return n._charsWritten=N(M(t),e,r,i)}function u(e,t,r,n){return a(e,t,r,n)}function s(e,t,r,i){return n._charsWritten=N(I(t),e,r,i)}function c(e,t,r,i){return n._charsWritten=N(R(t),e,r,i)}function l(e,t,r){return 0===t&&r===e.length?V.fromByteArray(e):V.fromByteArray(e.slice(t,r))}function f(e,t,r){var n="",i="";r=Math.min(e.length,r);for(var o=t;o<r;o++)e[o]<=127?(n+=U(i)+String.fromCharCode(e[o]),i=""):i+="%"+e[o].toString(16);return n+U(i)}function d(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;i++)n+=String.fromCharCode(e[i]);return n}function h(e,t,r){return d(e,t,r)}function p(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;o++)i+=x(e[o]);return i}function y(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function m(e,t,r,n){n||(q("boolean"==typeof r,"missing or invalid endian"),q(void 0!==t&&null!==t,"missing offset"),q(t+1<e.length,"Trying to read beyond buffer length"));var i=e.length;if(!(t>=i)){var o;return r?(o=e[t],t+1<i&&(o|=e[t+1]<<8)):(o=e[t]<<8,t+1<i&&(o|=e[t+1])),o}}function v(e,t,r,n){n||(q("boolean"==typeof r,"missing or invalid endian"),q(void 0!==t&&null!==t,"missing offset"),q(t+3<e.length,"Trying to read beyond buffer length"));var i=e.length;if(!(t>=i)){var o;return r?(t+2<i&&(o=e[t+2]<<16),t+1<i&&(o|=e[t+1]<<8),o|=e[t],t+3<i&&(o+=e[t+3]<<24>>>0)):(t+1<i&&(o=e[t+1]<<16),t+2<i&&(o|=e[t+2]<<8),t+3<i&&(o|=e[t+3]),o+=e[t]<<24>>>0),o}}function _(e,t,r,n){if(n||(q("boolean"==typeof r,"missing or invalid endian"),q(void 0!==t&&null!==t,"missing offset"),q(t+1<e.length,"Trying to read beyond buffer length")),!(t>=e.length)){var i=m(e,t,r,!0);return 32768&i?-1*(65535-i+1):i}}function g(e,t,r,n){if(n||(q("boolean"==typeof r,"missing or invalid endian"),q(void 0!==t&&null!==t,"missing offset"),q(t+3<e.length,"Trying to read beyond buffer length")),!(t>=e.length)){var i=v(e,t,r,!0);return 2147483648&i?-1*(4294967295-i+1):i}}function b(e,t,r,n){return n||(q("boolean"==typeof r,"missing or invalid endian"),q(t+3<e.length,"Trying to read beyond buffer length")),H.read(e,t,r,23,4)}function w(e,t,r,n){return n||(q("boolean"==typeof r,"missing or invalid endian"),q(t+7<e.length,"Trying to read beyond buffer length")),H.read(e,t,r,52,8)}function E(e,t,r,n,i){i||(q(void 0!==t&&null!==t,"missing value"),q("boolean"==typeof n,"missing or invalid endian"),q(void 0!==r&&null!==r,"missing offset"),q(r+1<e.length,"trying to write beyond buffer length"),L(t,65535));var o=e.length;if(!(r>=o))for(var a=0,u=Math.min(o-r,2);a<u;a++)e[r+a]=(t&255<<8*(n?a:1-a))>>>8*(n?a:1-a)}function A(e,t,r,n,i){i||(q(void 0!==t&&null!==t,"missing value"),q("boolean"==typeof n,"missing or invalid endian"),q(void 0!==r&&null!==r,"missing offset"),q(r+3<e.length,"trying to write beyond buffer length"),L(t,4294967295));var o=e.length;if(!(r>=o))for(var a=0,u=Math.min(o-r,4);a<u;a++)e[r+a]=t>>>8*(n?a:3-a)&255}function O(e,t,r,n,i){i||(q(void 0!==t&&null!==t,"missing value"),q("boolean"==typeof n,"missing or invalid endian"),q(void 0!==r&&null!==r,"missing offset"),q(r+1<e.length,"Trying to write beyond buffer length"),z(t,32767,-32768)),r>=e.length||(t>=0?E(e,t,r,n,i):E(e,65535+t+1,r,n,i))}function S(e,t,r,n,i){i||(q(void 0!==t&&null!==t,"missing value"),q("boolean"==typeof n,"missing or invalid endian"),q(void 0!==r&&null!==r,"missing offset"),q(r+3<e.length,"Trying to write beyond buffer length"),z(t,2147483647,-2147483648)),r>=e.length||(t>=0?A(e,t,r,n,i):A(e,4294967295+t+1,r,n,i))}function P(e,t,r,n,i){i||(q(void 0!==t&&null!==t,"missing value"),q("boolean"==typeof n,"missing or invalid endian"),q(void 0!==r&&null!==r,"missing offset"),q(r+3<e.length,"Trying to write beyond buffer length"),G(t,3.4028234663852886e38,-3.4028234663852886e38)),r>=e.length||H.write(e,t,r,n,23,4)}function D(e,t,r,n,i){i||(q(void 0!==t&&null!==t,"missing value"),q("boolean"==typeof n,"missing or invalid endian"),q(void 0!==r&&null!==r,"missing offset"),q(r+7<e.length,"Trying to write beyond buffer length"),G(t,1.7976931348623157e308,-1.7976931348623157e308)),r>=e.length||H.write(e,t,r,n,52,8)}function C(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function k(e,t,r){return"number"!=typeof e?r:(e=~~e)>=t?t:e>=0?e:(e+=t,e>=0?e:0)}function T(e){return e=~~Math.ceil(+e),e<0?0:e}function F(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}function j(e){return F(e)||n.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function x(e){return e<16?"0"+e.toString(16):e.toString(16)}function B(e){for(var t=[],r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n<=127)t.push(e.charCodeAt(r));else{var i=r;n>=55296&&n<=57343&&r++;for(var o=encodeURIComponent(e.slice(i,r+1)).substr(1).split("%"),a=0;a<o.length;a++)t.push(parseInt(o[a],16))}}return t}function M(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t}function R(e){for(var t,r,n,i=[],o=0;o<e.length;o++)t=e.charCodeAt(o),r=t>>8,n=t%256,i.push(n),i.push(r);return i}function I(e){return V.toByteArray(e)}function N(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);i++)t[i+r]=e[i];return i}function U(e){try{return decodeURIComponent(e)}catch(e){return String.fromCharCode(65533)}}function L(e,t){q("number"==typeof e,"cannot write a non-number as a number"),q(e>=0,"specified a negative value for writing an unsigned value"),q(e<=t,"value is larger than maximum value for type"),q(Math.floor(e)===e,"value has a fractional component")}function z(e,t,r){q("number"==typeof e,"cannot write a non-number as a number"),q(e<=t,"value larger than maximum allowed value"),q(e>=r,"value smaller than minimum allowed value"),q(Math.floor(e)===e,"value has a fractional component")}function G(e,t,r){q("number"==typeof e,"cannot write a non-number as a number"),q(e<=t,"value larger than maximum allowed value"),q(e>=r,"value smaller than minimum allowed value")}function q(e,t){if(!e)throw new Error(t||"Failed assertion")}var V=e("base64-js"),H=e("ieee754");r.Buffer=n,r.SlowBuffer=n,r.INSPECT_MAX_BYTES=50,n.poolSize=8192,n._useTypedArrays=function(){try{var e=new ArrayBuffer(0),t=new Uint8Array(e);return t.foo=function(){return 42},42===t.foo()&&"function"==typeof t.subarray}catch(e){return!1}}(),n.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},n.isBuffer=function(e){return!(null===e||void 0===e||!e._isBuffer)},n.byteLength=function(e,t){var r;switch(e+="",t||"utf8"){case"hex":r=e.length/2;break;case"utf8":case"utf-8":r=B(e).length;break;case"ascii":case"binary":case"raw":r=e.length;break;case"base64":r=I(e).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=2*e.length;break;default:throw new Error("Unknown encoding")}return r},n.concat=function(e,t){if(q(F(e),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===e.length)return new n(0);if(1===e.length)return e[0];var r;if("number"!=typeof t)for(t=0,r=0;r<e.length;r++)t+=e[r].length;var i=new n(t),o=0;for(r=0;r<e.length;r++){var a=e[r];a.copy(i,o),o+=a.length}return i},n.prototype.write=function(e,t,r,n){if(isFinite(t))isFinite(r)||(n=r,r=void 0);else{var l=n;n=t,t=r,r=l}t=Number(t)||0;var f=this.length-t;r?(r=Number(r))>f&&(r=f):r=f,n=String(n||"utf8").toLowerCase();var d;switch(n){case"hex":d=i(this,e,t,r);break;case"utf8":case"utf-8":d=o(this,e,t,r);break;case"ascii":d=a(this,e,t,r);break;case"binary":d=u(this,e,t,r);break;case"base64":d=s(this,e,t,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":d=c(this,e,t,r);break;default:throw new Error("Unknown encoding")}return d},n.prototype.toString=function(e,t,r){var n=this;if(e=String(e||"utf8").toLowerCase(),t=Number(t)||0,(r=void 0!==r?Number(r):r=n.length)===t)return"";var i;switch(e){case"hex":i=p(n,t,r);break;case"utf8":case"utf-8":i=f(n,t,r);break;case"ascii":i=d(n,t,r);break;case"binary":i=h(n,t,r);break;case"base64":i=l(n,t,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":i=y(n,t,r);break;default:throw new Error("Unknown encoding")}return i},n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},n.prototype.copy=function(e,t,r,i){var o=this;if(r||(r=0),i||0===i||(i=this.length),t||(t=0),i!==r&&0!==e.length&&0!==o.length){q(i>=r,"sourceEnd < sourceStart"),q(t>=0&&t<e.length,"targetStart out of bounds"),q(r>=0&&r<o.length,"sourceStart out of bounds"),q(i>=0&&i<=o.length,"sourceEnd out of bounds"),i>this.length&&(i=this.length),e.length-t<i-r&&(i=e.length-t+r);var a=i-r
|
|
@@ -20,22 +20,22 @@ if(null===(e=Lt(xi,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this.
|
|
|
20
20
|
ordinal:function(e){var t=e%10;return e+(1===W(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),r.lang=w("moment.lang is deprecated. Use moment.locale instead.",rt),r.langData=w("moment.langData is deprecated. Use moment.localeData instead.",ot);var Go=Math.abs,qo=Vn("ms"),Vo=Vn("s"),Ho=Vn("m"),Wo=Vn("h"),Yo=Vn("d"),$o=Vn("w"),Ko=Vn("M"),Jo=Vn("Q"),Qo=Vn("y"),Xo=Yn("milliseconds"),Zo=Yn("seconds"),ea=Yn("minutes"),ta=Yn("hours"),ra=Yn("days"),na=Yn("months"),ia=Yn("years"),oa=Math.round,aa={ss:44,s:45,m:45,h:22,d:26,w:null,M:11},ua=Math.abs,sa=Mt.prototype;return sa.isValid=xt,sa.abs=Bn,sa.add=Rn,sa.subtract=In,sa.as=Gn,sa.asMilliseconds=qo,sa.asSeconds=Vo,sa.asMinutes=Ho,sa.asHours=Wo,sa.asDays=Yo,sa.asWeeks=$o,sa.asMonths=Ko,sa.asQuarters=Jo,sa.asYears=Qo,sa.valueOf=qn,sa._bubble=Un,sa.clone=Hn,sa.get=Wn,sa.milliseconds=Xo,sa.seconds=Zo,sa.minutes=ea,sa.hours=ta,sa.days=ra,sa.weeks=$n,sa.months=na,sa.years=ia,sa.humanize=Zn,sa.toISOString=ti,sa.toString=ti,sa.toJSON=ti,sa.locale=Tr,sa.localeData=Fr,sa.toIsoString=w("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ti),sa.lang=To,k("X",0,0,"unix"),k("x",0,0,"valueOf"),X("x",Fi),X("X",Bi),re("X",function(e,t,r){r._d=new Date(1e3*parseFloat(e))}),re("x",function(e,t,r){r._d=new Date(W(e))}),r.version="2.29.4",function(e){ri=e}(Ct),r.fn=Lo,r.min=Tt,r.max=Ft,r.now=Ao,r.utc=d,r.unix=An,r.months=kn,r.isDate=c,r.locale=rt,r.invalid=m,r.duration=er,r.isMoment=g,r.weekdays=Fn,r.parseZone=On,r.localeData=ot,r.isDuration=Rt,r.monthsShort=Tn,r.weekdaysMin=xn,r.defineLocale=nt,r.updateLocale=it,r.locales=at,r.weekdaysShort=jn,r.normalizeUnits=L,r.relativeTimeRounding=Qn,r.relativeTimeThreshold=Xn,r.calendarFormat=fr,r.prototype=Lo,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r})},{}],114:[function(e,t,r){(function(e){function t(e,t){for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e){"string"!=typeof e&&(e+="");var t,r=0,n=-1,i=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!i){r=t+1;break}}else-1===n&&(i=!1,n=t+1);return-1===n?"":e.slice(r,n)}function i(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n<e.length;n++)t(e[n],n,e)&&r.push(e[n]);return r}r.resolve=function(){for(var r="",n=!1,o=arguments.length-1;o>=-1&&!n;o--){var a=o>=0?arguments[o]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(r=a+"/"+r,n="/"===a.charAt(0))}return r=t(i(r.split("/"),function(e){return!!e}),!n).join("/"),(n?"/":"")+r||"."},r.normalize=function(e){var n=r.isAbsolute(e),a="/"===o(e,-1);return e=t(i(e.split("/"),function(e){return!!e}),!n).join("/"),e||n||(e="."),e&&a&&(e+="/"),(n?"/":"")+e},r.isAbsolute=function(e){return"/"===e.charAt(0)},r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(i(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},r.relative=function(e,t){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=r.resolve(e).substr(1),t=r.resolve(t).substr(1);for(var i=n(e.split("/")),o=n(t.split("/")),a=Math.min(i.length,o.length),u=a,s=0;s<a;s++)if(i[s]!==o[s]){u=s;break}for(var c=[],s=u;s<i.length;s++)c.push("..");return c=c.concat(o.slice(u)),c.join("/")},r.sep="/",r.delimiter=":",r.dirname=function(e){if("string"!=typeof e&&(e+=""),0===e.length)return".";for(var t=e.charCodeAt(0),r=47===t,n=-1,i=!0,o=e.length-1;o>=1;--o)if(47===(t=e.charCodeAt(o))){if(!i){n=o;break}}else i=!1;return-1===n?r?"/":".":r&&1===n?"/":e.slice(0,n)},r.basename=function(e,t){var r=n(e);return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},r.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,r=0,n=-1,i=!0,o=0,a=e.length-1;a>=0;--a){var u=e.charCodeAt(a);if(47!==u)-1===n&&(i=!1,n=a+1),46===u?-1===t?t=a:1!==o&&(o=1):-1!==t&&(o=-1);else if(!i){r=a+1;break}}return-1===t||-1===n||0===o||1===o&&t===n-1&&t===r+1?"":e.slice(t,n)};var o="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)}}).call(this,e("FWaASH"))},{FWaASH:50}],115:[function(e,t,r){function n(e,t){for(var r,n=[],i=0,o=0,a="",u=t&&t.delimiter||"/";null!=(r=_.exec(e));){var l=r[0],f=r[1],d=r.index;if(a+=e.slice(o,d),o=d+l.length,f)a+=f[1];else{var h=e[o],p=r[2],y=r[3],m=r[4],v=r[5],g=r[6],b=r[7];a&&(n.push(a),a="");var w=null!=p&&null!=h&&h!==p,E="+"===g||"*"===g,A="?"===g||"*"===g,O=r[2]||u,S=m||v;n.push({name:y||i++,prefix:p||"",delimiter:O,optional:A,repeat:E,partial:w,asterisk:!!b,pattern:S?c(S):b?".*":"[^"+s(O)+"]+?"})}}return o<e.length&&(a+=e.substr(o)),a&&n.push(a),n}function i(e,t){return u(n(e,t))}function o(e){return encodeURI(e).replace(/[\/?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function a(e){return encodeURI(e).replace(/[?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function u(e){for(var t=new Array(e.length),r=0;r<e.length;r++)"object"==typeof e[r]&&(t[r]=new RegExp("^(?:"+e[r].pattern+")$"));return function(r,n){for(var i="",u=r||{},s=n||{},c=s.pretty?o:encodeURIComponent,l=0;l<e.length;l++){var f=e[l];if("string"!=typeof f){var d,h=u[f.name];if(null==h){if(f.optional){f.partial&&(i+=f.prefix);continue}throw new TypeError('Expected "'+f.name+'" to be defined')}if(v(h)){if(!f.repeat)throw new TypeError('Expected "'+f.name+'" to not repeat, but received `'+JSON.stringify(h)+"`");if(0===h.length){if(f.optional)continue;throw new TypeError('Expected "'+f.name+'" to not be empty')}for(var p=0;p<h.length;p++){if(d=c(h[p]),!t[l].test(d))throw new TypeError('Expected all "'+f.name+'" to match "'+f.pattern+'", but received `'+JSON.stringify(d)+"`");i+=(0===p?f.prefix:f.delimiter)+d}}else{if(d=f.asterisk?a(h):c(h),!t[l].test(d))throw new TypeError('Expected "'+f.name+'" to match "'+f.pattern+'", but received "'+d+'"');i+=f.prefix+d}}else i+=f}return i}}function s(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function c(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function l(e,t){return e.keys=t,e}function f(e){return e.sensitive?"":"i"}function d(e,t){var r=e.source.match(/\((?!\?)/g);if(r)for(var n=0;n<r.length;n++)t.push({name:n,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return l(e,t)}function h(e,t,r){for(var n=[],i=0;i<e.length;i++)n.push(m(e[i],t,r).source);return l(new RegExp("(?:"+n.join("|")+")",f(r)),t)}function p(e,t,r){return y(n(e,r),t,r)}function y(e,t,r){v(t)||(r=t||r,t=[]),r=r||{};for(var n=r.strict,i=!1!==r.end,o="",a=0;a<e.length;a++){var u=e[a];if("string"==typeof u)o+=s(u);else{var c=s(u.prefix),d="(?:"+u.pattern+")";t.push(u),u.repeat&&(d+="(?:"+c+d+")*"),d=u.optional?u.partial?c+"("+d+")?":"(?:"+c+"("+d+"))?":c+"("+d+")",o+=d}}var h=s(r.delimiter||"/"),p=o.slice(-h.length)===h;return n||(o=(p?o.slice(0,-h.length):o)+"(?:"+h+"(?=$))?"),o+=i?"$":n&&p?"":"(?="+h+"|$)",l(new RegExp("^"+o,f(r)),t)}function m(e,t,r){return v(t)||(r=t||r,t=[]),r=r||{},e instanceof RegExp?d(e,t):v(e)?h(e,t,r):p(e,t,r)}var v=e("isarray");t.exports=m,t.exports.parse=n,t.exports.compile=i,t.exports.tokensToFunction=u,t.exports.tokensToRegExp=y;var _=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g")},{isarray:100}],116:[function(e,t,r){var n=t.exports={};n.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var r=[];return window.addEventListener("message",function(e){var t=e.source;if((t===window||null===t)&&"process-tick"===e.data&&(e.stopPropagation(),r.length>0)){r.shift()()}},!0),function(e){r.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),n.title="browser",n.browser=!0,n.env={},n.argv=[],n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")}},{}],117:[function(e,t,r){(function(e){!function(e){"use strict";if("function"==typeof bootstrap)bootstrap("promise",e);else if("object"==typeof r&&"object"==typeof t)t.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeQ=e}else{if("undefined"==typeof window&&"undefined"==typeof self)throw new Error("This environment was not anticipated by Q. Please file a bug.");var n="undefined"!=typeof window?window:self,i=n.Q;n.Q=e(),n.Q.noConflict=function(){return n.Q=i,this}}}(function(){"use strict";function t(e){return function(){return Y.apply(e,arguments)}}function r(e){return e===Object(e)}function n(e){return"[object StopIteration]"===re(e)||e instanceof q}function i(e,t){if(z&&t.stack&&"object"==typeof e&&null!==e&&e.stack){for(var r=[],n=t;n;n=n.source)n.stack&&(!e.__minimumStackCounter__||e.__minimumStackCounter__>n.stackCounter)&&(Z(e,"__minimumStackCounter__",{value:n.stackCounter,configurable:!0}),r.unshift(n.stack));r.unshift(e.stack);var i=r.join("\n"+ne+"\n"),a=o(i);Z(e,"stack",{value:a,configurable:!0})}}function o(e){for(var t=e.split("\n"),r=[],n=0;n<t.length;++n){var i=t[n];s(i)||a(i)||!i||r.push(i)}return r.join("\n")}function a(e){return-1!==e.indexOf("(module.js:")||-1!==e.indexOf("(node.js:")}function u(e){var t=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(e);if(t)return[t[1],Number(t[2])];var r=/at ([^ ]+):(\d+):(?:\d+)$/.exec(e);if(r)return[r[1],Number(r[2])];var n=/.*@(.+):(\d+)$/.exec(e);return n?[n[1],Number(n[2])]:void 0}function s(e){var t=u(e);if(!t)return!1;var r=t[0],n=t[1];return r===G&&n>=V&&n<=ce}function c(){if(z)try{throw new Error}catch(n){var e=n.stack.split("\n"),t=e[0].indexOf("@")>0?e[1]:e[2],r=u(t);if(!r)return;return G=r[0],r[1]}}function l(e){return e instanceof p?e:_(e)?D(e):P(e)}function f(){function e(e){t=e,l.longStackSupport&&z&&(o.source=e),K(r,function(t,r){l.nextTick(function(){e.promiseDispatch.apply(e,r)})},void 0),r=void 0,n=void 0}var t,r=[],n=[],i=X(f.prototype),o=X(p.prototype);if(o.promiseDispatch=function(e,i,o){var a=$(arguments);r?(r.push(a),"when"===i&&o[1]&&n.push(o[1])):l.nextTick(function(){t.promiseDispatch.apply(t,a)})},o.valueOf=function(){if(r)return o;var e=m(t);return v(e)&&(t=e),e},o.inspect=function(){return t?t.inspect():{state:"pending"}},l.longStackSupport&&z)try{throw new Error}catch(e){o.stack=e.stack.substring(e.stack.indexOf("\n")+1),o.stackCounter=ie++}return i.promise=o,i.resolve=function(r){t||e(l(r))},i.fulfill=function(r){t||e(P(r))},i.reject=function(r){t||e(S(r))},i.notify=function(e){t||K(n,function(t,r){l.nextTick(function(){r(e)})},void 0)},i}function d(e){if("function"!=typeof e)throw new TypeError("resolver must be a function.");var t=f();try{e(t.resolve,t.reject,t.notify)}catch(e){t.reject(e)}return t.promise}function h(e){return d(function(t,r){for(var n=0,i=e.length;n<i;n++)l(e[n]).then(t,r)})}function p(e,t,r){void 0===t&&(t=function(e){return S(new Error("Promise does not support operation: "+e))}),void 0===r&&(r=function(){return{state:"unknown"}});var n=X(p.prototype);if(n.promiseDispatch=function(r,i,o){var a;try{a=e[i]?e[i].apply(n,o):t.call(n,i,o)}catch(e){a=S(e)}r&&r(a)},n.inspect=r,r){var i=r();"rejected"===i.state&&(n.exception=i.reason),n.valueOf=function(){var e=r();return"pending"===e.state||"rejected"===e.state?n:e.value}}return n}function y(e,t,r,n){return l(e).then(t,r,n)}function m(e){if(v(e)){var t=e.inspect();if("fulfilled"===t.state)return t.value}return e}function v(e){return e instanceof p}function _(e){return r(e)&&"function"==typeof e.then}function g(e){return v(e)&&"pending"===e.inspect().state}function b(e){return!v(e)||"fulfilled"===e.inspect().state}function w(e){return v(e)&&"rejected"===e.inspect().state}function E(){oe.length=0,ae.length=0,se||(se=!0)}function A(t,r){se&&("object"==typeof e&&"function"==typeof e.emit&&l.nextTick.runAfter(function(){-1!==J(ae,t)&&(e.emit("unhandledRejection",r,t),ue.push(t))}),ae.push(t),r&&void 0!==r.stack?oe.push(r.stack):oe.push("(no stack) "+r))}function O(t){if(se){var r=J(ae,t);-1!==r&&("object"==typeof e&&"function"==typeof e.emit&&l.nextTick.runAfter(function(){var n=J(ue,t);-1!==n&&(e.emit("rejectionHandled",oe[r],t),ue.splice(n,1))}),ae.splice(r,1),oe.splice(r,1))}}function S(e){var t=p({when:function(t){return t&&O(this),t?t(e):this}},function(){return this},function(){return{state:"rejected",reason:e}});return A(t,e),t}function P(e){return p({when:function(){return e},get:function(t){return e[t]},set:function(t,r){e[t]=r},delete:function(t){delete e[t]},post:function(t,r){return null===t||void 0===t?e.apply(void 0,r):e[t].apply(e,r)},apply:function(t,r){return e.apply(t,r)},keys:function(){return te(e)}},void 0,function(){return{state:"fulfilled",value:e}})}function D(e){var t=f();return l.nextTick(function(){try{e.then(t.resolve,t.reject,t.notify)}catch(e){t.reject(e)}}),t.promise}function C(e){return p({isDef:function(){}},function(t,r){return B(e,t,r)},function(){return l(e).inspect()})}function k(e,t,r){return l(e).spread(t,r)}function T(e){return function(){function t(e,t){var a;if("undefined"==typeof StopIteration){try{a=r[e](t)}catch(e){return S(e)}return a.done?l(a.value):y(a.value,i,o)}try{a=r[e](t)}catch(e){return n(e)?l(e.value):S(e)}return y(a,i,o)}var r=e.apply(this,arguments),i=t.bind(t,"next"),o=t.bind(t,"throw");return i()}}function F(e){l.done(l.async(e)())}function j(e){throw new q(e)}function x(e){return function(){return k([this,M(arguments)],function(t,r){return e.apply(t,r)})}}function B(e,t,r){return l(e).dispatch(t,r)}function M(e){return y(e,function(e){var t=0,r=f();return K(e,function(n,i,o){var a;v(i)&&"fulfilled"===(a=i.inspect()).state?e[o]=a.value:(++t,y(i,function(n){e[o]=n,0==--t&&r.resolve(e)},r.reject,function(e){r.notify({index:o,value:e})}))},void 0),0===t&&r.resolve(e),r.promise})}function R(e){if(0===e.length)return l.resolve();var t=l.defer(),r=0;return K(e,function(n,i,o){function a(e){t.resolve(e)}function u(e){if(0===--r){var n=e||new Error(""+e);n.message="Q can't get fulfillment value from any promise, all promises were rejected. Last error message: "+n.message,t.reject(n)}}function s(e){t.notify({index:o,value:e})}var c=e[o];r++,y(c,a,u,s)},void 0),t.promise}function I(e){return y(e,function(e){return e=Q(e,l),y(M(Q(e,function(e){return y(e,H,H)})),function(){return e})})}function N(e){return l(e).allSettled()}function U(e,t){return l(e).then(void 0,void 0,t)}function L(e,t){return l(e).nodeify(t)}var z=!1;try{throw new Error}catch(e){z=!!e.stack}var G,q,V=c(),H=function(){},W=function(){function t(){for(var e,t;n.next;)n=n.next,e=n.task,n.task=void 0,t=n.domain,t&&(n.domain=void 0,t.enter()),r(e,t);for(;s.length;)e=s.pop(),r(e);o=!1}function r(e,r){try{e()}catch(e){if(u)throw r&&r.exit(),setTimeout(t,0),r&&r.enter(),e;setTimeout(function(){throw e},0)}r&&r.exit()}var n={task:void 0,next:null},i=n,o=!1,a=void 0,u=!1,s=[];if(W=function(t){i=i.next={task:t,domain:u&&e.domain,next:null},o||(o=!0,a())},"object"==typeof e&&"[object process]"===e.toString()&&e.nextTick)u=!0,a=function(){e.nextTick(t)};else if("function"==typeof setImmediate)a="undefined"!=typeof window?setImmediate.bind(window,t):function(){setImmediate(t)};else if("undefined"!=typeof MessageChannel){var c=new MessageChannel;c.port1.onmessage=function(){a=l,c.port1.onmessage=t,t()};var l=function(){c.port2.postMessage(0)};a=function(){setTimeout(t,0),l()}}else a=function(){setTimeout(t,0)};return W.runAfter=function(e){s.push(e),o||(o=!0,a())},W}(),Y=Function.call,$=t(Array.prototype.slice),K=t(Array.prototype.reduce||function(e,t){var r=0,n=this.length;if(1===arguments.length)for(;;){if(r in this){t=this[r++];break}if(++r>=n)throw new TypeError}for(;r<n;r++)r in this&&(t=e(t,this[r],r));return t}),J=t(Array.prototype.indexOf||function(e){for(var t=0;t<this.length;t++)if(this[t]===e)return t;return-1}),Q=t(Array.prototype.map||function(e,t){var r=this,n=[];return K(r,function(i,o,a){n.push(e.call(t,o,a,r))},void 0),n}),X=Object.create||function(e){function t(){}return t.prototype=e,new t},Z=Object.defineProperty||function(e,t,r){return e[t]=r.value,e},ee=t(Object.prototype.hasOwnProperty),te=Object.keys||function(e){var t=[];for(var r in e)ee(e,r)&&t.push(r);return t},re=t(Object.prototype.toString);q="undefined"!=typeof ReturnValue?ReturnValue:function(e){this.value=e};var ne="From previous event:";l.resolve=l,l.nextTick=W,l.longStackSupport=!1;var ie=1;"object"==typeof e&&e&&e.env&&e.env.Q_DEBUG&&(l.longStackSupport=!0),l.defer=f,f.prototype.makeNodeResolver=function(){var e=this;return function(t,r){t?e.reject(t):arguments.length>2?e.resolve($(arguments,1)):e.resolve(r)}},l.Promise=d,l.promise=d,d.race=h,d.all=M,d.reject=S,d.resolve=l,l.passByCopy=function(e){return e},p.prototype.passByCopy=function(){return this},l.join=function(e,t){return l(e).join(t)},p.prototype.join=function(e){return l([this,e]).spread(function(e,t){if(e===t)return e;throw new Error("Q can't join: not the same: "+e+" "+t)})},l.race=h,p.prototype.race=function(){return this.then(l.race)},l.makePromise=p,p.prototype.toString=function(){return"[object Promise]"},p.prototype.then=function(e,t,r){function n(t){try{return"function"==typeof e?e(t):t}catch(e){return S(e)}}function o(e){if("function"==typeof t){i(e,u);try{return t(e)}catch(e){return S(e)}}return S(e)}function a(e){return"function"==typeof r?r(e):e}var u=this,s=f(),c=!1;return l.nextTick(function(){u.promiseDispatch(function(e){c||(c=!0,s.resolve(n(e)))},"when",[function(e){c||(c=!0,s.resolve(o(e)))}])}),u.promiseDispatch(void 0,"when",[void 0,function(e){var t,r=!1;try{t=a(e)}catch(e){if(r=!0,!l.onerror)throw e;l.onerror(e)}r||s.notify(t)}]),s.promise},l.tap=function(e,t){return l(e).tap(t)},p.prototype.tap=function(e){return e=l(e),this.then(function(t){return e.fcall(t).thenResolve(t)})},l.when=y,p.prototype.thenResolve=function(e){return this.then(function(){return e})},l.thenResolve=function(e,t){return l(e).thenResolve(t)},p.prototype.thenReject=function(e){return this.then(function(){throw e})},l.thenReject=function(e,t){return l(e).thenReject(t)},l.nearer=m,l.isPromise=v,l.isPromiseAlike=_,l.isPending=g,p.prototype.isPending=function(){return"pending"===this.inspect().state},l.isFulfilled=b,p.prototype.isFulfilled=function(){return"fulfilled"===this.inspect().state},l.isRejected=w,p.prototype.isRejected=function(){return"rejected"===this.inspect().state};var oe=[],ae=[],ue=[],se=!0;l.resetUnhandledRejections=E,l.getUnhandledReasons=function(){return oe.slice()},l.stopUnhandledRejectionTracking=function(){E(),se=!1},E(),l.reject=S,l.fulfill=P,l.master=C,l.spread=k,p.prototype.spread=function(e,t){return this.all().then(function(t){return e.apply(void 0,t)},t)},l.async=T,l.spawn=F,l.return=j,l.promised=x,l.dispatch=B,p.prototype.dispatch=function(e,t){var r=this,n=f();return l.nextTick(function(){r.promiseDispatch(n.resolve,e,t)}),n.promise},l.get=function(e,t){return l(e).dispatch("get",[t])},p.prototype.get=function(e){return this.dispatch("get",[e])},l.set=function(e,t,r){return l(e).dispatch("set",[t,r])},p.prototype.set=function(e,t){return this.dispatch("set",[e,t])},l.del=l.delete=function(e,t){return l(e).dispatch("delete",[t])},p.prototype.del=p.prototype.delete=function(e){return this.dispatch("delete",[e])},l.mapply=l.post=function(e,t,r){return l(e).dispatch("post",[t,r])},p.prototype.mapply=p.prototype.post=function(e,t){return this.dispatch("post",[e,t])},l.send=l.mcall=l.invoke=function(e,t){return l(e).dispatch("post",[t,$(arguments,2)])},p.prototype.send=p.prototype.mcall=p.prototype.invoke=function(e){return this.dispatch("post",[e,$(arguments,1)])},l.fapply=function(e,t){return l(e).dispatch("apply",[void 0,t])},p.prototype.fapply=function(e){return this.dispatch("apply",[void 0,e])},l.try=l.fcall=function(e){return l(e).dispatch("apply",[void 0,$(arguments,1)])},p.prototype.fcall=function(){return this.dispatch("apply",[void 0,$(arguments)])},l.fbind=function(e){var t=l(e),r=$(arguments,1);return function(){return t.dispatch("apply",[this,r.concat($(arguments))])}},p.prototype.fbind=function(){var e=this,t=$(arguments);return function(){return e.dispatch("apply",[this,t.concat($(arguments))])}},l.keys=function(e){return l(e).dispatch("keys",[])},p.prototype.keys=function(){return this.dispatch("keys",[])},l.all=M,p.prototype.all=function(){return M(this)},l.any=R,p.prototype.any=function(){return R(this)},l.allResolved=function(e,t,r){return function(){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(t+" is deprecated, use "+r+" instead.",new Error("").stack),e.apply(e,arguments)}}(I,"allResolved","allSettled"),p.prototype.allResolved=function(){return I(this)},l.allSettled=N,p.prototype.allSettled=function(){return this.then(function(e){return M(Q(e,function(e){function t(){return e.inspect()}return e=l(e),e.then(t,t)}))})},l.fail=l.catch=function(e,t){return l(e).then(void 0,t)},p.prototype.fail=p.prototype.catch=function(e){return this.then(void 0,e)},l.progress=U,p.prototype.progress=function(e){return this.then(void 0,void 0,e)},l.fin=l.finally=function(e,t){return l(e).finally(t)},p.prototype.fin=p.prototype.finally=function(e){if(!e||"function"!=typeof e.apply)throw new Error("Q can't apply finally callback");return e=l(e),this.then(function(t){return e.fcall().then(function(){return t})},function(t){return e.fcall().then(function(){throw t})})},l.done=function(e,t,r,n){return l(e).done(t,r,n)},p.prototype.done=function(t,r,n){var o=function(e){l.nextTick(function(){if(i(e,a),!l.onerror)throw e;l.onerror(e)})},a=t||r||n?this.then(t,r,n):this;"object"==typeof e&&e&&e.domain&&(o=e.domain.bind(o)),a.then(void 0,o)},l.timeout=function(e,t,r){return l(e).timeout(t,r)},p.prototype.timeout=function(e,t){var r=f(),n=setTimeout(function(){t&&"string"!=typeof t||(t=new Error(t||"Timed out after "+e+" ms"),t.code="ETIMEDOUT"),r.reject(t)},e);return this.then(function(e){clearTimeout(n),r.resolve(e)},function(e){clearTimeout(n),r.reject(e)},r.notify),r.promise},l.delay=function(e,t){return void 0===t&&(t=e,e=void 0),l(e).delay(t)},p.prototype.delay=function(e){return this.then(function(t){var r=f();return setTimeout(function(){r.resolve(t)},e),r.promise})},l.nfapply=function(e,t){return l(e).nfapply(t)},p.prototype.nfapply=function(e){var t=f(),r=$(e);return r.push(t.makeNodeResolver()),this.fapply(r).fail(t.reject),t.promise},l.nfcall=function(e){var t=$(arguments,1);return l(e).nfapply(t)},p.prototype.nfcall=function(){var e=$(arguments),t=f();return e.push(t.makeNodeResolver()),this.fapply(e).fail(t.reject),t.promise},l.nfbind=l.denodeify=function(e){if(void 0===e)throw new Error("Q can't wrap an undefined function");var t=$(arguments,1);return function(){var r=t.concat($(arguments)),n=f();return r.push(n.makeNodeResolver()),l(e).fapply(r).fail(n.reject),n.promise}},p.prototype.nfbind=p.prototype.denodeify=function(){var e=$(arguments);return e.unshift(this),l.denodeify.apply(void 0,e)},l.nbind=function(e,t){var r=$(arguments,2);return function(){function n(){return e.apply(t,arguments)}var i=r.concat($(arguments)),o=f();return i.push(o.makeNodeResolver()),l(n).fapply(i).fail(o.reject),o.promise}},p.prototype.nbind=function(){var e=$(arguments,0);return e.unshift(this),l.nbind.apply(void 0,e)},l.nmapply=l.npost=function(e,t,r){return l(e).npost(t,r)},p.prototype.nmapply=p.prototype.npost=function(e,t){var r=$(t||[]),n=f();return r.push(n.makeNodeResolver()),this.dispatch("post",[e,r]).fail(n.reject),n.promise},l.nsend=l.nmcall=l.ninvoke=function(e,t){var r=$(arguments,2),n=f();return r.push(n.makeNodeResolver()),l(e).dispatch("post",[t,r]).fail(n.reject),n.promise},p.prototype.nsend=p.prototype.nmcall=p.prototype.ninvoke=function(e){var t=$(arguments,1),r=f();return t.push(r.makeNodeResolver()),this.dispatch("post",[e,t]).fail(r.reject),r.promise},l.nodeify=L,p.prototype.nodeify=function(e){if(!e)return this;this.then(function(t){l.nextTick(function(){e(null,t)})},function(t){l.nextTick(function(){e(t)})})},l.noConflict=function(){throw new Error("Q.noConflict only works when Q is used as a global")};var ce=c();return l})}).call(this,e("FWaASH"))},{FWaASH:50}],118:[function(e,t,r){(function(r){"use strict";var n,i=e("buffer"),o=i.Buffer,a={};for(n in i)i.hasOwnProperty(n)&&"SlowBuffer"!==n&&"Buffer"!==n&&(a[n]=i[n]);var u=a.Buffer={};for(n in o)o.hasOwnProperty(n)&&"allocUnsafe"!==n&&"allocUnsafeSlow"!==n&&(u[n]=o[n]);if(a.Buffer.prototype=o.prototype,u.from&&u.from!==Uint8Array.from||(u.from=function(e,t,r){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return o(e,t,r)}),u.alloc||(u.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var n=o(e);return t&&0!==t.length?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n}),!a.kStringMaxLength)try{a.kStringMaxLength=r.binding("buffer").kStringMaxLength}catch(e){}a.constants||(a.constants={MAX_LENGTH:a.kMaxLength},a.kStringMaxLength&&(a.constants.MAX_STRING_LENGTH=a.kStringMaxLength)),t.exports=a}).call(this,e("FWaASH"))},{FWaASH:50,buffer:52}],119:[function(e,t,r){var n=e("escodegen").generate;t.exports=function(e,t){t||(t={});var r={},i=function e(i,o){if("Literal"===i.type)return i.value;if("UnaryExpression"===i.type){var a=e(i.argument);return"+"===i.operator?+a:"-"===i.operator?-a:"~"===i.operator?~a:"!"===i.operator?!a:r}if("ArrayExpression"===i.type){for(var u=[],s=0,c=i.elements.length;s<c;s++){var l=e(i.elements[s]);if(l===r)return r;u.push(l)}return u}if("ObjectExpression"===i.type){for(var f={},s=0;s<i.properties.length;s++){var d=i.properties[s],h=null===d.value?d.value:e(d.value);if(h===r)return r;f[d.key.value||d.key.name]=h}return f}if("BinaryExpression"===i.type||"LogicalExpression"===i.type){var c=e(i.left);if(c===r)return r;var p=e(i.right);if(p===r)return r;var y=i.operator;return"=="===y?c==p:"==="===y?c===p:"!="===y?c!=p:"!=="===y?c!==p:"+"===y?c+p:"-"===y?c-p:"*"===y?c*p:"/"===y?c/p:"%"===y?c%p:"<"===y?c<p:"<="===y?c<=p:">"===y?c>p:">="===y?c>=p:"|"===y?c|p:"&"===y?c&p:"^"===y?c^p:"&&"===y?c&&p:"||"===y?c||p:r}if("Identifier"===i.type)return{}.hasOwnProperty.call(t,i.name)?t[i.name]:r;if("ThisExpression"===i.type)return{}.hasOwnProperty.call(t,"this")?t.this:r;if("CallExpression"===i.type){var m=e(i.callee);if(m===r)return r;if("function"!=typeof m)return r;var v=i.callee.object?e(i.callee.object):r;v===r&&(v=null);for(var _=[],s=0,c=i.arguments.length;s<c;s++){var l=e(i.arguments[s]);if(l===r)return r;_.push(l)}return m.apply(v,_)}if("MemberExpression"===i.type){var f=e(i.object);if(f===r||"function"==typeof f)return r;if("Identifier"===i.property.type)return f[i.property.name];var d=e(i.property);return d===r?r:f[d]}if("ConditionalExpression"===i.type){var a=e(i.test);return a===r?r:e(a?i.consequent:i.alternate)}if("ExpressionStatement"===i.type){var a=e(i.expression);return a===r?r:a}if("ReturnStatement"===i.type)return e(i.argument);if("FunctionExpression"===i.type){var g=i.body.body,b={};Object.keys(t).forEach(function(e){b[e]=t[e]});for(var s=0;s<i.params.length;s++){var w=i.params[s];if("Identifier"!=w.type)return r;t[w.name]=null}for(var s in g)if(e(g[s])===r)return r;t=b;var E=Object.keys(t),A=E.map(function(e){return t[e]});return Function(E.join(", "),"return "+n(i)).apply(null,A)}if("TemplateLiteral"===i.type){for(var O="",s=0;s<i.expressions.length;s++)O+=e(i.quasis[s]),O+=e(i.expressions[s]);return O+=e(i.quasis[s])}if("TaggedTemplateExpression"===i.type){var S=e(i.tag),P=i.quasi,D=P.quasis.map(e),C=P.expressions.map(e);return S.apply(null,[D].concat(C))}return"TemplateElement"===i.type?i.value.cooked:r}(e);return i===r?void 0:i}},{escodegen:54}],120:[function(e,t,r){function n(e){if(!(this instanceof n))return new n(e);u.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",i)}function i(){if(!this.allowHalfOpen&&!this._writableState.ended){var e=this;a(function(){e.end()})}}t.exports=n;var o=e("inherits"),a=e("process/browser.js").nextTick,u=e("./readable.js"),s=e("./writable.js");o(n,u),n.prototype.write=s.prototype.write,n.prototype.end=s.prototype.end,n.prototype._write=s.prototype._write},{"./readable.js":123,"./writable.js":125,inherits:99,"process/browser.js":116}],121:[function(e,t,r){function n(){i.call(this)}t.exports=n;var i=e("events").EventEmitter;e("inherits")(n,i),n.Readable=e("./readable.js"),n.Writable=e("./writable.js"),n.Duplex=e("./duplex.js"),n.Transform=e("./transform.js"),n.PassThrough=e("./passthrough.js"),n.Stream=n,n.prototype.pipe=function(e,t){function r(t){e.writable&&!1===e.write(t)&&c.pause&&c.pause()}function n(){c.readable&&c.resume&&c.resume()}function o(){l||(l=!0,e.end())}function a(){l||(l=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(s(),0===i.listenerCount(this,"error"))throw e}function s(){c.removeListener("data",r),e.removeListener("drain",n),c.removeListener("end",o),c.removeListener("close",a),c.removeListener("error",u),e.removeListener("error",u),c.removeListener("end",s),c.removeListener("close",s),e.removeListener("close",s)}var c=this;c.on("data",r),e.on("drain",n),e._isStdio||t&&!1===t.end||(c.on("end",o),c.on("close",a));var l=!1;return c.on("error",u),e.on("error",u),c.on("end",s),c.on("close",s),e.on("close",s),e.emit("pipe",c),e}},{"./duplex.js":120,"./passthrough.js":122,"./readable.js":123,"./transform.js":124,"./writable.js":125,events:73,inherits:99}],122:[function(e,t,r){function n(e){if(!(this instanceof n))return new n(e);i.call(this,e)}t.exports=n;var i=e("./transform.js");e("inherits")(n,i),n.prototype._transform=function(e,t,r){r(null,e)}},{"./transform.js":124,inherits:99}],123:[function(e,t,r){(function(r){function n(t,r){t=t||{};var n=t.highWaterMark;this.highWaterMark=n||0===n?n:16384,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=!1,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.calledRead=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!t.objectMode,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(A||(A=e("string_decoder").StringDecoder),this.decoder=new A(t.encoding),this.encoding=t.encoding)}function i(e){if(!(this instanceof i))return new i(e);this._readableState=new n(e,this),this.readable=!0,S.call(this)}function o(e,t,r,n,i){var o=c(t,r);if(o)e.emit("error",o);else if(null===r||void 0===r)t.reading=!1,t.ended||l(e,t);else if(t.objectMode||r&&r.length>0)if(t.ended&&!i){var u=new Error("stream.push() after EOF");e.emit("error",u)}else if(t.endEmitted&&i){var u=new Error("stream.unshift() after end event");e.emit("error",u)}else!t.decoder||i||n||(r=t.decoder.write(r)),t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):(t.reading=!1,t.buffer.push(r)),t.needReadable&&f(e),h(e,t);else i||(t.reading=!1);return a(t)}function a(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}
|
|
21
21
|
function u(e){if(e>=C)e=C;else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function s(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:isNaN(e)||null===e?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:e<=0?0:(e>t.highWaterMark&&(t.highWaterMark=u(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function c(e,t){var r=null;return P.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||r||(r=new TypeError("Invalid non-string/buffer chunk")),r}function l(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.length>0?f(e):b(e)}function f(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,t.sync?D(function(){d(e)}):d(e))}function d(e){e.emit("readable")}function h(e,t){t.readingMore||(t.readingMore=!0,D(function(){p(e,t)}))}function p(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function y(e){return function(){var t=e._readableState;0===--t.awaitDrain&&m(e)}}function m(e){function t(e,t,i){!1===e.write(r)&&n.awaitDrain++}var r,n=e._readableState;for(n.awaitDrain=0;n.pipesCount&&null!==(r=e.read());)if(1===n.pipesCount?t(n.pipes,0,null):w(n.pipes,t),e.emit("data",r),n.awaitDrain>0)return;if(0===n.pipesCount)return n.flowing=!1,void(O.listenerCount(e,"data")>0&&_(e));n.ranOut=!0}function v(){this._readableState.ranOut&&(this._readableState.ranOut=!1,m(this))}function _(e,t){if(e._readableState.flowing)throw new Error("Cannot switch to old mode now.");var r=t||!1,n=!1;e.readable=!0,e.pipe=S.prototype.pipe,e.on=e.addListener=S.prototype.on,e.on("readable",function(){n=!0;for(var t;!r&&null!==(t=e.read());)e.emit("data",t);null===t&&(n=!1,e._readableState.needReadable=!0)}),e.pause=function(){r=!0,this.emit("pause")},e.resume=function(){r=!1,n?D(function(){e.emit("readable")}):this.read(0),this.emit("resume")},e.emit("readable")}function g(e,t){var r,n=t.buffer,i=t.length,o=!!t.decoder,a=!!t.objectMode;if(0===n.length)return null;if(0===i)r=null;else if(a)r=n.shift();else if(!e||e>=i)r=o?n.join(""):P.concat(n,i),n.length=0;else if(e<n[0].length){var u=n[0];r=u.slice(0,e),n[0]=u.slice(e)}else if(e===n[0].length)r=n.shift();else{r=o?"":new P(e);for(var s=0,c=0,l=n.length;c<l&&s<e;c++){var u=n[0],f=Math.min(e-s,u.length);o?r+=u.slice(0,f):u.copy(r,s,0,f),f<u.length?n[0]=u.slice(f):n.shift(),s+=f}}return r}function b(e){var t=e._readableState;if(t.length>0)throw new Error("endReadable called on non-empty stream");!t.endEmitted&&t.calledRead&&(t.ended=!0,D(function(){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}))}function w(e,t){for(var r=0,n=e.length;r<n;r++)t(e[r],r)}function E(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}t.exports=i,i.ReadableState=n;var A,O=e("events").EventEmitter,S=e("./index.js"),P=e("buffer").Buffer,D=e("process/browser.js").nextTick;e("inherits")(i,S),i.prototype.push=function(e,t){var r=this._readableState;return"string"!=typeof e||r.objectMode||(t=t||r.defaultEncoding)!==r.encoding&&(e=new P(e,t),t=""),o(this,r,e,t,!1)},i.prototype.unshift=function(e){return o(this,this._readableState,e,"",!0)},i.prototype.setEncoding=function(t){A||(A=e("string_decoder").StringDecoder),this._readableState.decoder=new A(t),this._readableState.encoding=t};var C=8388608;i.prototype.read=function(e){var t=this._readableState;t.calledRead=!0;var r=e;if(("number"!=typeof e||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return f(this),null;if(0===(e=s(e,t))&&t.ended)return 0===t.length&&b(this),null;var n=t.needReadable;t.length-e<=t.highWaterMark&&(n=!0),(t.ended||t.reading)&&(n=!1),n&&(t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),n&&!t.reading&&(e=s(r,t));var i;return i=e>0?g(e,t):null,null===i&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),t.ended&&!t.endEmitted&&0===t.length&&b(this),i},i.prototype._read=function(e){this.emit("error",new Error("not implemented"))},i.prototype.pipe=function(e,t){function n(e){e===l&&o()}function i(){e.end()}function o(){e.removeListener("close",u),e.removeListener("finish",s),e.removeListener("drain",p),e.removeListener("error",a),e.removeListener("unpipe",n),l.removeListener("end",i),l.removeListener("end",o),e._writableState&&!e._writableState.needDrain||p()}function a(t){c(),0===_&&0===O.listenerCount(e,"error")&&e.emit("error",t)}function u(){e.removeListener("finish",s),c()}function s(){e.removeListener("close",u),c()}function c(){l.unpipe(e)}var l=this,f=this._readableState;switch(f.pipesCount){case 0:f.pipes=e;break;case 1:f.pipes=[f.pipes,e];break;default:f.pipes.push(e)}f.pipesCount+=1;var d=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr,h=d?i:o;f.endEmitted?D(h):l.once("end",h),e.on("unpipe",n);var p=y(l);e.on("drain",p);var _=O.listenerCount(e,"error");return e.once("error",a),e.once("close",u),e.once("finish",s),e.emit("pipe",l),f.flowing||(this.on("readable",v),f.flowing=!0,D(function(){m(l)})),e},i.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,this.removeListener("readable",v),t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,this.removeListener("readable",v),t.flowing=!1;for(var i=0;i<n;i++)r[i].emit("unpipe",this);return this}var i=E(t.pipes,e);return-1===i?this:(t.pipes.splice(i,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},i.prototype.on=function(e,t){var r=S.prototype.on.call(this,e,t);if("data"!==e||this._readableState.flowing||_(this),"readable"===e&&this.readable){var n=this._readableState;n.readableListening||(n.readableListening=!0,n.emittedReadable=!1,n.needReadable=!0,n.reading?n.length&&f(this):this.read(0))}return r},i.prototype.addListener=i.prototype.on,i.prototype.resume=function(){_(this),this.read(0),this.emit("resume")},i.prototype.pause=function(){_(this,!0),this.emit("pause")},i.prototype.wrap=function(e){var t=this._readableState,r=!1,n=this;e.on("end",function(){if(t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&n.push(e)}n.push(null)}),e.on("data",function(i){if(t.decoder&&(i=t.decoder.write(i)),i&&(t.objectMode||i.length)){n.push(i)||(r=!0,e.pause())}});for(var i in e)"function"==typeof e[i]&&void 0===this[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));return w(["error","close","destroy","pause","resume"],function(t){e.on(t,function(e){return n.emit.apply(n,t,e)})}),n._read=function(t){r&&(r=!1,e.resume())},n},i._fromList=g}).call(this,e("FWaASH"))},{"./index.js":121,FWaASH:50,buffer:52,events:73,inherits:99,"process/browser.js":116,string_decoder:51}],124:[function(e,t,r){function n(e,t){this.afterTransform=function(e,r){return i(t,e,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function i(e,t,r){var n=e._transformState;n.transforming=!1;var i=n.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));n.writechunk=null,n.writecb=null,null!==r&&void 0!==r&&e.push(r),i&&i(t);var o=e._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&e._read(o.highWaterMark)}function o(e){if(!(this instanceof o))return new o(e);u.call(this,e);var t=(this._transformState=new n(e,this),this);this._readableState.needReadable=!0,this._readableState.sync=!1,this.once("finish",function(){"function"==typeof this._flush?this._flush(function(e){a(t,e)}):a(t)})}function a(e,t){if(t)return e.emit("error",t);var r=e._writableState,n=(e._readableState,e._transformState);if(r.length)throw new Error("calling transform done when ws.length != 0");if(n.transforming)throw new Error("calling transform done when still transforming");return e.push(null)}t.exports=o;var u=e("./duplex.js");e("inherits")(o,u),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},o.prototype._transform=function(e,t,r){throw new Error("not implemented")},o.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},o.prototype._read=function(e){var t=this._transformState;t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0}},{"./duplex.js":120,inherits:99}],125:[function(e,t,r){function n(e,t,r){this.chunk=e,this.encoding=t,this.callback=r}function i(e,t){e=e||{};var r=e.highWaterMark;this.highWaterMark=r||0===r?r:16384,this.objectMode=!!e.objectMode,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var n=!1===e.decodeStrings;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){h(t,e)},this.writecb=null,this.writelen=0,this.buffer=[]}function o(e){if(!(this instanceof o||this instanceof A.Duplex))return new o(e);this._writableState=new i(e,this),this.writable=!0,A.call(this)}function a(e,t,r){var n=new Error("write after end");e.emit("error",n),O(function(){r(n)})}function u(e,t,r,n){var i=!0;if(!S.isBuffer(r)&&"string"!=typeof r&&null!==r&&void 0!==r&&!t.objectMode){var o=new TypeError("Invalid non-string/buffer chunk");e.emit("error",o),O(function(){n(o)}),i=!1}return i}function s(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=new S(t,r)),t}function c(e,t,r,i,o){r=s(t,r,i);var a=t.objectMode?1:r.length;t.length+=a;var u=t.length<t.highWaterMark;return t.needDrain=!u,t.writing?t.buffer.push(new n(r,i,o)):l(e,t,a,r,i,o),u}function l(e,t,r,n,i,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,e._write(n,i,t.onwrite),t.sync=!1}function f(e,t,r,n,i){r?O(function(){i(n)}):i(n),e.emit("error",n)}function d(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function h(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(d(r),t)f(e,r,n,t,i);else{var o=v(e,r);o||r.bufferProcessing||!r.buffer.length||m(e,r),n?O(function(){p(e,r,o,i)}):p(e,r,o,i)}}function p(e,t,r,n){r||y(e,t),n(),r&&_(e,t)}function y(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function m(e,t){t.bufferProcessing=!0;for(var r=0;r<t.buffer.length;r++){var n=t.buffer[r],i=n.chunk,o=n.encoding,a=n.callback;if(l(e,t,t.objectMode?1:i.length,i,o,a),t.writing){r++;break}}t.bufferProcessing=!1,r<t.buffer.length?t.buffer=t.buffer.slice(r):t.buffer.length=0}function v(e,t){return t.ending&&0===t.length&&!t.finished&&!t.writing}function _(e,t){var r=v(e,t);return r&&(t.finished=!0,e.emit("finish")),r}function g(e,t,r){t.ending=!0,_(e,t),r&&(t.finished?O(r):e.once("finish",r)),t.ended=!0}t.exports=o,o.WritableState=i;var b="undefined"!=typeof Uint8Array?function(e){return e instanceof Uint8Array}:function(e){return e&&e.constructor&&"Uint8Array"===e.constructor.name},w="undefined"!=typeof ArrayBuffer?function(e){return e instanceof ArrayBuffer}:function(e){return e&&e.constructor&&"ArrayBuffer"===e.constructor.name},E=e("inherits"),A=e("./index.js"),O=e("process/browser.js").nextTick,S=e("buffer").Buffer;E(o,A),o.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))},o.prototype.write=function(e,t,r){var n=this._writableState,i=!1;return"function"==typeof t&&(r=t,t=null),!S.isBuffer(e)&&b(e)&&(e=new S(e)),w(e)&&"undefined"!=typeof Uint8Array&&(e=new S(new Uint8Array(e))),S.isBuffer(e)?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=function(){}),n.ended?a(this,n,r):u(this,n,e,r)&&(i=c(this,n,e,t,r)),i},o.prototype._write=function(e,t,r){r(new Error("not implemented"))},o.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),void 0!==e&&null!==e&&this.write(e,t),n.ending||n.finished||g(this,n,r)}},{"./index.js":121,buffer:52,inherits:99,"process/browser.js":116}],126:[function(e,t,r){"use strict";function n(e){if(e._patchedBySuperagentMocker)return n;e._patchedBySuperagentMocker=!0;for(var t in m)if(m.hasOwnProperty(t)){var r=m[t];a(e,t,r)}var i=e.Request.prototype,o=y.end=e.Request.prototype.end;i.end=function(e){var t=this._superagentMockerState;if(t&&t.current){var r=t.current;setTimeout(function(t){try{var n=r(t);if(/20[0-6]/.test(n.status))e&&e(null,n);else{var i=new Error(n.status);i.status=n.status,i.response=n,e&&e(i,null)}}catch(t){e&&e(t,null)}},c(n.timeout),t.request)}else o.call(this,e)};var h=y.set=i.set;i.set=function(e,t){var r=this._superagentMockerState;if(!r||!r.current)return h.call(this,e,t);if(u(e)){for(var n in e)this.set(n,e[n]);return this}if("string"!=typeof e)throw new TypeError("Header keys must be strings.");return r.request.headers[e.toLowerCase()]=t,this};var p=y.send=i.send;i.send=function(e){var t=this._superagentMockerState;return t&&t.current?(u(e)?t.request.body=d(t.current.body,e):t.request.body=e,this):p.call(this,e)};var v=y.query=i.query;return i.query=function(e){var t=this._superagentMockerState;if(!t||!t.current)return v.call(this,e);var r={};return s(e)?r=l(e):u(e)&&(r=f(e)),t.request.query=d(t.request.query,r),this},n}function i(e,t,r){return p.reduce(function(n,i){var o=i.match(e,t,r);return o||n},null)}function o(e,t,r){return p.push(new v({url:t,handler:r,method:e})),n}function a(e,t,r){var n=y[t]=e[t];e[t]=function(e,t,o){var a=i(r,e,t),u=n.call(this,e,t,o);return u._superagentMockerState={current:a,request:{headers:{},body:{},query:{}}},u}}function u(e){return null!=e&&"object"==typeof e}function s(e){return"string"==typeof e}function c(e){return"function"==typeof e?e():e}function l(e){return e.split("&").reduce(function(e,t){var r=t.split("="),n=r.shift(),i=r.shift();return n&&i&&(e[n]=i),e},{})}function f(e){return Object.keys(e).reduce(function(t,r){return t[r]=String(e[r]),t},{})}function d(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];if(u(r))for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}return e}var h=e("path-to-regexp");t.exports=n,n.get=o.bind(null,"GET"),n.post=o.bind(null,"POST"),n.put=o.bind(null,"PUT"),n.del=o.bind(null,"DELETE"),n.patch=o.bind(null,"PATCH"),n.timeout=0;var p=[],y={};n.clearRoutes=function(){p.splice(0,p.length)};var m={get:"GET",post:"POST",put:"PUT",del:"DELETE",patch:"PATCH"};n.clearRoute=function(e,t){e=m[e]||e,p=p.filter(function(r){return!(r.url===t&&r.method===e)})},n.unmock=function(e){["get","post","put","patch","del"].forEach(function(t){e[t]=y[t]});var t=e.Request.prototype;["end","set","send"].forEach(function(e){t[e]=y[e]}),delete e._patchedBySuperagentMocker};var v=function(e){this.url=e.url,this.handler=e.handler,this.method=e.method,this.regexp=h(this.url,this.keys=[])};v.prototype.match=function(e,t,r){if(this.method!==e)return!1;var n={},i=this.regexp.exec(t);if(!i)return!1;for(var o=1,a=i.length;o<a;++o){var s=this.keys[o-1],c=i[o];void 0===c&&hasOwnProperty.call(n,s.name)||(n[s.name]=c)}var l=this;return function(e){return d({status:200},l.handler({url:t,params:n||{},body:u(e.body)?d(r,e.body):e.body,headers:e.headers,query:e.query}))}}},{"path-to-regexp":115}],127:[function(e,t,r){function n(){this._defaults=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert"].forEach(function(e){n.prototype[e]=function(){return this._defaults.push({fn:e,arguments:arguments}),this}}),n.prototype._setDefaults=function(e){this._defaults.forEach(function(t){e[t.fn].apply(e,t.arguments)})},t.exports=n},{}],128:[function(e,t,r){function n(){}function i(e){if(!y(e))return e;var t=[];for(var r in e)o(t,r,e[r]);return t.join("&")}function o(e,t,r){if(null!=r)if(Array.isArray(r))r.forEach(function(r){o(e,t,r)});else if(y(r))for(var n in r)o(e,t+"["+n+"]",r[n]);else e.push(encodeURIComponent(t)+"="+encodeURIComponent(r));else null===r&&e.push(encodeURIComponent(t))}function a(e){for(var t,r,n={},i=e.split("&"),o=0,a=i.length;o<a;++o)t=i[o],r=t.indexOf("="),-1==r?n[decodeURIComponent(t)]="":n[decodeURIComponent(t.slice(0,r))]=decodeURIComponent(t.slice(r+1));return n}function u(e){for(var t,r,n,i,o=e.split(/\r?\n/),a={},u=0,s=o.length;u<s;++u)r=o[u],-1!==(t=r.indexOf(":"))&&(n=r.slice(0,t).toLowerCase(),i=g(r.slice(t+1)),a[n]=i);return a}function s(e){return/[\/+]json($|[^-\w])/.test(e)}function c(e){this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!=this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var t=this.xhr.status;1223===t&&(t=204),this._setStatusProperties(t),this.header=this.headers=u(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&e._responseType?this.body=this.xhr.response:this.body="HEAD"!=this.req.method?this._parseBody(this.text?this.text:this.xhr.response):null}function l(e,t){var r=this;this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",function(){var e=null,t=null;try{t=new c(r)}catch(t){return e=new Error("Parser is unable to parse the response"),e.parse=!0,e.original=t,r.xhr?(e.rawResponse=void 0===r.xhr.responseType?r.xhr.responseText:r.xhr.response,e.status=r.xhr.status?r.xhr.status:null,e.statusCode=e.status):(e.rawResponse=null,e.status=null),r.callback(e)}r.emit("response",t);var n;try{r._isResponseOK(t)||(n=new Error(t.statusText||"Unsuccessful HTTP response"))}catch(e){n=e}n?(n.original=e,n.response=t,n.status=t.status,r.callback(n,t)):r.callback(null,t)})}function f(e,t,r){var n=_("DELETE",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n}var d;"undefined"!=typeof window?d=window:"undefined"!=typeof self?d=self:(console.warn("Using browser-only version of superagent in non-browser environment"),d=this);var h=e("component-emitter"),p=e("./request-base"),y=e("./is-object"),m=e("./response-base"),v=e("./agent-base"),_=r=t.exports=function(e,t){return"function"==typeof t?new r.Request("GET",e).end(t):1==arguments.length?new r.Request("GET",e):new r.Request(e,t)};r.Request=l,_.getXHR=function(){if(!(!d.XMLHttpRequest||d.location&&"file:"==d.location.protocol&&d.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}throw Error("Browser-only version of superagent could not find XHR")};var g="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};_.serializeObject=i,_.parseString=a,_.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},_.serialize={"application/x-www-form-urlencoded":i,"application/json":JSON.stringify},_.parse={"application/x-www-form-urlencoded":a,"application/json":JSON.parse},m(c.prototype),c.prototype._parseBody=function(e){var t=_.parse[this.type];return this.req._parser?this.req._parser(this,e):(!t&&s(this.type)&&(t=_.parse["application/json"]),t&&e&&(e.length||e instanceof Object)?t(e):null)},c.prototype.toError=function(){var e=this.req,t=e.method,r=e.url,n="cannot "+t+" "+r+" ("+this.status+")",i=new Error(n);return i.status=this.status,i.method=t,i.url=r,i},_.Response=c,h(l.prototype),p(l.prototype),l.prototype.type=function(e){return this.set("Content-Type",_.types[e]||e),this},l.prototype.accept=function(e){return this.set("Accept",_.types[e]||e),this},l.prototype.auth=function(e,t,r){1===arguments.length&&(t=""),"object"==typeof t&&null!==t&&(r=t,t=""),r||(r={type:"function"==typeof btoa?"basic":"auto"});var n=function(e){if("function"==typeof btoa)return btoa(e);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(e,t,r,n)},l.prototype.query=function(e){return"string"!=typeof e&&(e=i(e)),e&&this._query.push(e),this},l.prototype.attach=function(e,t,r){if(t){if(this._data)throw Error("superagent can't mix .send() and .attach()");this._getFormData().append(e,t,r||t.name)}return this},l.prototype._getFormData=function(){return this._formData||(this._formData=new d.FormData),this._formData},l.prototype.callback=function(e,t){if(this._shouldRetry(e,t))return this._retry();var r=this._callback;this.clearTimeout(),e&&(this._maxRetries&&(e.retries=this._retries-1),this.emit("error",e)),r(e,t)},l.prototype.crossDomainError=function(){var e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},l.prototype.buffer=l.prototype.ca=l.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},l.prototype.pipe=l.prototype.write=function(){throw Error("Streaming is not supported in browser version of superagent")},l.prototype._isHost=function(e){return e&&"object"==typeof e&&!Array.isArray(e)&&"[object Object]"!==Object.prototype.toString.call(e)},l.prototype.end=function(e){return this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=e||n,this._finalizeQueryString(),this._end()},l.prototype._end=function(){var e=this,t=this.xhr=_.getXHR(),r=this._formData||this._data;this._setTimeouts(),t.onreadystatechange=function(){var r=t.readyState;if(r>=2&&e._responseTimeoutTimer&&clearTimeout(e._responseTimeoutTimer),4==r){var n;try{n=t.status}catch(e){n=0}if(!n){if(e.timedout||e._aborted)return;return e.crossDomainError()}e.emit("end")}};var n=function(t,r){r.total>0&&(r.percent=r.loaded/r.total*100),r.direction=t,e.emit("progress",r)};if(this.hasListeners("progress"))try{t.onprogress=n.bind(null,"download"),t.upload&&(t.upload.onprogress=n.bind(null,"upload"))}catch(e){}try{this.username&&this.password?t.open(this.method,this.url,!0,this.username,this.password):t.open(this.method,this.url,!0)}catch(e){return this.callback(e)}if(this._withCredentials&&(t.withCredentials=!0),!this._formData&&"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof r&&!this._isHost(r)){var i=this._header["content-type"],o=this._serializer||_.serialize[i?i.split(";")[0]:""];!o&&s(i)&&(o=_.serialize["application/json"]),o&&(r=o(r))}for(var a in this.header)null!=this.header[a]&&this.header.hasOwnProperty(a)&&t.setRequestHeader(a,this.header[a]);return this._responseType&&(t.responseType=this._responseType),this.emit("request",this),t.send(void 0!==r?r:null),this},_.agent=function(){return new v},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach(function(e){v.prototype[e.toLowerCase()]=function(t,r){var n=new _.Request(e,t);return this._setDefaults(n),r&&n.end(r),n}}),v.prototype.del=v.prototype.delete,_.get=function(e,t,r){var n=_("GET",e);return"function"==typeof t&&(r=t,t=null),t&&n.query(t),r&&n.end(r),n},_.head=function(e,t,r){var n=_("HEAD",e);return"function"==typeof t&&(r=t,t=null),t&&n.query(t),r&&n.end(r),n},_.options=function(e,t,r){var n=_("OPTIONS",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},_.del=f,_.delete=f,_.patch=function(e,t,r){var n=_("PATCH",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},_.post=function(e,t,r){var n=_("POST",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},_.put=function(e,t,r){var n=_("PUT",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n}},{"./agent-base":127,"./is-object":129,"./request-base":130,"./response-base":131,"component-emitter":53}],129:[function(e,t,r){"use strict";function n(e){return null!==e&&"object"==typeof e}t.exports=n},{}],130:[function(e,t,r){"use strict";function n(e){if(e)return i(e)}function i(e){for(var t in n.prototype)e[t]=n.prototype[t];return e}var o=e("./is-object");t.exports=n,n.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,this},n.prototype.parse=function(e){return this._parser=e,this},n.prototype.responseType=function(e){return this._responseType=e,this},n.prototype.serialize=function(e){return this._serializer=e,this},n.prototype.timeout=function(e){if(!e||"object"!=typeof e)return this._timeout=e,this._responseTimeout=0,this;for(var t in e)switch(t){case"deadline":this._timeout=e.deadline;break;case"response":this._responseTimeout=e.response;break;default:console.warn("Unknown timeout option",t)}return this},n.prototype.retry=function(e,t){return 0!==arguments.length&&!0!==e||(e=1),e<=0&&(e=0),this._maxRetries=e,this._retries=0,this._retryCallback=t,this};var a=["ECONNRESET","ETIMEDOUT","EADDRINFO","ESOCKETTIMEDOUT"];n.prototype._shouldRetry=function(e,t){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var r=this._retryCallback(e,t);if(!0===r)return!0;if(!1===r)return!1}catch(e){console.error(e)}if(t&&t.status&&t.status>=500&&501!=t.status)return!0;if(e){if(e.code&&~a.indexOf(e.code))return!0;if(e.timeout&&"ECONNABORTED"==e.code)return!0;if(e.crossDomain)return!0}return!1},n.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this._end()},n.prototype.then=function(e,t){if(!this._fullfilledPromise){var r=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(function(e,t){r.end(function(r,n){r?t(r):e(n)})})}return this._fullfilledPromise.then(e,t)},n.prototype.catch=function(e){return this.then(void 0,e)},n.prototype.use=function(e){return e(this),this},n.prototype.ok=function(e){if("function"!=typeof e)throw Error("Callback required");return this._okCallback=e,this},n.prototype._isResponseOK=function(e){return!!e&&(this._okCallback?this._okCallback(e):e.status>=200&&e.status<300)},n.prototype.get=function(e){return this._header[e.toLowerCase()]},n.prototype.getHeader=n.prototype.get,n.prototype.set=function(e,t){if(o(e)){for(var r in e)this.set(r,e[r]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},n.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},n.prototype.field=function(e,t){if(null===e||void 0===e)throw new Error(".field(name, val) name can not be empty");if(this._data&&console.error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()"),o(e)){for(var r in e)this.field(r,e[r]);return this}if(Array.isArray(t)){for(var n in t)this.field(e,t[n]);return this}if(null===t||void 0===t)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof t&&(t=""+t),this._getFormData().append(e,t),this},n.prototype.abort=function(){return this._aborted?this:(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort"),this)},n.prototype._auth=function(e,t,r,n){switch(r.type){case"basic":this.set("Authorization","Basic "+n(e+":"+t));break;case"auto":this.username=e,this.password=t;break;case"bearer":this.set("Authorization","Bearer "+e)}return this},n.prototype.withCredentials=function(e){return void 0==e&&(e=!0),this._withCredentials=e,this},n.prototype.redirects=function(e){return this._maxRedirects=e,this},n.prototype.maxResponseSize=function(e){if("number"!=typeof e)throw TypeError("Invalid argument");return this._maxResponseSize=e,this},n.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},n.prototype.send=function(e){var t=o(e),r=this._header["content-type"];if(this._formData&&console.error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()"),t&&!this._data)Array.isArray(e)?this._data=[]:this._isHost(e)||(this._data={});else if(e&&this._data&&this._isHost(this._data))throw Error("Can't merge these send calls");if(t&&o(this._data))for(var n in e)this._data[n]=e[n];else"string"==typeof e?(r||this.type("form"),r=this._header["content-type"],this._data="application/x-www-form-urlencoded"==r?this._data?this._data+"&"+e:e:(this._data||"")+e):this._data=e;return!t||this._isHost(e)?this:(r||this.type("json"),this)},n.prototype.sortQuery=function(e){return this._sort=void 0===e||e,this},n.prototype._finalizeQueryString=function(){var e=this._query.join("&");if(e&&(this.url+=(this.url.indexOf("?")>=0?"&":"?")+e),this._query.length=0,this._sort){var t=this.url.indexOf("?");if(t>=0){var r=this.url.substring(t+1).split("&");"function"==typeof this._sort?r.sort(this._sort):r.sort(),this.url=this.url.substring(0,t)+"?"+r.join("&")}}},n.prototype._appendQueryString=function(){console.trace("Unsupported")},n.prototype._timeoutError=function(e,t,r){if(!this._aborted){var n=new Error(e+t+"ms exceeded");n.timeout=t,n.code="ECONNABORTED",n.errno=r,this.timedout=!0,this.abort(),this.callback(n)}},n.prototype._setTimeouts=function(){var e=this;this._timeout&&!this._timer&&(this._timer=setTimeout(function(){e._timeoutError("Timeout of ",e._timeout,"ETIME")},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(function(){e._timeoutError("Response timeout of ",e._responseTimeout,"ETIMEDOUT")},this._responseTimeout))}},{"./is-object":129}],131:[function(e,t,r){"use strict";function n(e){if(e)return i(e)}function i(e){for(var t in n.prototype)e[t]=n.prototype[t];return e}var o=e("./utils");t.exports=n,n.prototype.get=function(e){return this.header[e.toLowerCase()]},n.prototype._setHeaderProperties=function(e){var t=e["content-type"]||"";this.type=o.type(t);var r=o.params(t);for(var n in r)this[n]=r[n];this.links={};try{e.link&&(this.links=o.parseLinks(e.link))}catch(e){}},n.prototype._setStatusProperties=function(e){var t=e/100|0;this.status=this.statusCode=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.redirect=3==t,this.clientError=4==t,this.serverError=5==t,this.error=(4==t||5==t)&&this.toError(),this.created=201==e,this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.forbidden=403==e,this.notFound=404==e,this.unprocessableEntity=422==e}},{"./utils":132}],132:[function(e,t,r){"use strict";r.type=function(e){return e.split(/ *; */).shift()},r.params=function(e){return e.split(/ *; */).reduce(function(e,t){var r=t.split(/ *= */),n=r.shift(),i=r.shift();return n&&i&&(e[n]=i),e},{})},r.parseLinks=function(e){return e.split(/ *, */).reduce(function(e,t){var r=t.split(/ *; */),n=r[0].slice(1,-1);return e[r[1].split(/ *= */)[1].slice(1,-1)]=n,e},{})},r.cleanHeader=function(e,t){return delete e["content-type"],delete e["content-length"],delete e["transfer-encoding"],delete e.host,t&&(delete e.authorization,delete e.cookie),e}},{}],133:[function(e,t,r){(function(e){!function(){var n="object"==typeof self&&self.self===self&&self||"object"==typeof e&&e.global===e&&e||this||{},i=n._,o=Array.prototype,a=Object.prototype,u="undefined"!=typeof Symbol?Symbol.prototype:null,s=o.push,c=o.slice,l=a.toString,f=a.hasOwnProperty,d=Array.isArray,h=Object.keys,p=Object.create,y=function(){},m=function(e){return e instanceof m?e:this instanceof m?void(this._wrapped=e):new m(e)}
|
|
22
22
|
;void 0===r||r.nodeType?n._=m:(void 0!==t&&!t.nodeType&&t.exports&&(r=t.exports=m),r._=m),m.VERSION="1.9.1";var v,_=function(e,t,r){if(void 0===t)return e;switch(null==r?3:r){case 1:return function(r){return e.call(t,r)};case 3:return function(r,n,i){return e.call(t,r,n,i)};case 4:return function(r,n,i,o){return e.call(t,r,n,i,o)}}return function(){return e.apply(t,arguments)}},g=function(e,t,r){return m.iteratee!==v?m.iteratee(e,t):null==e?m.identity:m.isFunction(e)?_(e,t,r):m.isObject(e)&&!m.isArray(e)?m.matcher(e):m.property(e)};m.iteratee=v=function(e,t){return g(e,t,1/0)};var b=function(e,t){return t=null==t?e.length-1:+t,function(){for(var r=Math.max(arguments.length-t,0),n=Array(r),i=0;i<r;i++)n[i]=arguments[i+t];switch(t){case 0:return e.call(this,n);case 1:return e.call(this,arguments[0],n);case 2:return e.call(this,arguments[0],arguments[1],n)}var o=Array(t+1);for(i=0;i<t;i++)o[i]=arguments[i];return o[t]=n,e.apply(this,o)}},w=function(e){if(!m.isObject(e))return{};if(p)return p(e);y.prototype=e;var t=new y;return y.prototype=null,t},E=function(e){return function(t){return null==t?void 0:t[e]}},A=function(e,t){return null!=e&&f.call(e,t)},O=function(e,t){for(var r=t.length,n=0;n<r;n++){if(null==e)return;e=e[t[n]]}return r?e:void 0},S=Math.pow(2,53)-1,P=E("length"),D=function(e){var t=P(e);return"number"==typeof t&&t>=0&&t<=S};m.each=m.forEach=function(e,t,r){t=_(t,r);var n,i;if(D(e))for(n=0,i=e.length;n<i;n++)t(e[n],n,e);else{var o=m.keys(e);for(n=0,i=o.length;n<i;n++)t(e[o[n]],o[n],e)}return e},m.map=m.collect=function(e,t,r){t=g(t,r);for(var n=!D(e)&&m.keys(e),i=(n||e).length,o=Array(i),a=0;a<i;a++){var u=n?n[a]:a;o[a]=t(e[u],u,e)}return o};var C=function(e){var t=function(t,r,n,i){var o=!D(t)&&m.keys(t),a=(o||t).length,u=e>0?0:a-1;for(i||(n=t[o?o[u]:u],u+=e);u>=0&&u<a;u+=e){var s=o?o[u]:u;n=r(n,t[s],s,t)}return n};return function(e,r,n,i){var o=arguments.length>=3;return t(e,_(r,i,4),n,o)}};m.reduce=m.foldl=m.inject=C(1),m.reduceRight=m.foldr=C(-1),m.find=m.detect=function(e,t,r){var n=D(e)?m.findIndex:m.findKey,i=n(e,t,r);if(void 0!==i&&-1!==i)return e[i]},m.filter=m.select=function(e,t,r){var n=[];return t=g(t,r),m.each(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n},m.reject=function(e,t,r){return m.filter(e,m.negate(g(t)),r)},m.every=m.all=function(e,t,r){t=g(t,r);for(var n=!D(e)&&m.keys(e),i=(n||e).length,o=0;o<i;o++){var a=n?n[o]:o;if(!t(e[a],a,e))return!1}return!0},m.some=m.any=function(e,t,r){t=g(t,r);for(var n=!D(e)&&m.keys(e),i=(n||e).length,o=0;o<i;o++){var a=n?n[o]:o;if(t(e[a],a,e))return!0}return!1},m.contains=m.includes=m.include=function(e,t,r,n){return D(e)||(e=m.values(e)),("number"!=typeof r||n)&&(r=0),m.indexOf(e,t,r)>=0},m.invoke=b(function(e,t,r){var n,i;return m.isFunction(t)?i=t:m.isArray(t)&&(n=t.slice(0,-1),t=t[t.length-1]),m.map(e,function(e){var o=i;if(!o){if(n&&n.length&&(e=O(e,n)),null==e)return;o=e[t]}return null==o?o:o.apply(e,r)})}),m.pluck=function(e,t){return m.map(e,m.property(t))},m.where=function(e,t){return m.filter(e,m.matcher(t))},m.findWhere=function(e,t){return m.find(e,m.matcher(t))},m.max=function(e,t,r){var n,i,o=-1/0,a=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e){e=D(e)?e:m.values(e);for(var u=0,s=e.length;u<s;u++)null!=(n=e[u])&&n>o&&(o=n)}else t=g(t,r),m.each(e,function(e,r,n){((i=t(e,r,n))>a||i===-1/0&&o===-1/0)&&(o=e,a=i)});return o},m.min=function(e,t,r){var n,i,o=1/0,a=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e){e=D(e)?e:m.values(e);for(var u=0,s=e.length;u<s;u++)null!=(n=e[u])&&n<o&&(o=n)}else t=g(t,r),m.each(e,function(e,r,n){((i=t(e,r,n))<a||i===1/0&&o===1/0)&&(o=e,a=i)});return o},m.shuffle=function(e){return m.sample(e,1/0)},m.sample=function(e,t,r){if(null==t||r)return D(e)||(e=m.values(e)),e[m.random(e.length-1)];var n=D(e)?m.clone(e):m.values(e),i=P(n);t=Math.max(Math.min(t,i),0);for(var o=i-1,a=0;a<t;a++){var u=m.random(a,o),s=n[a];n[a]=n[u],n[u]=s}return n.slice(0,t)},m.sortBy=function(e,t,r){var n=0;return t=g(t,r),m.pluck(m.map(e,function(e,r,i){return{value:e,index:n++,criteria:t(e,r,i)}}).sort(function(e,t){var r=e.criteria,n=t.criteria;if(r!==n){if(r>n||void 0===r)return 1;if(r<n||void 0===n)return-1}return e.index-t.index}),"value")};var k=function(e,t){return function(r,n,i){var o=t?[[],[]]:{};return n=g(n,i),m.each(r,function(t,i){var a=n(t,i,r);e(o,t,a)}),o}};m.groupBy=k(function(e,t,r){A(e,r)?e[r].push(t):e[r]=[t]}),m.indexBy=k(function(e,t,r){e[r]=t}),m.countBy=k(function(e,t,r){A(e,r)?e[r]++:e[r]=1});var T=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;m.toArray=function(e){return e?m.isArray(e)?c.call(e):m.isString(e)?e.match(T):D(e)?m.map(e,m.identity):m.values(e):[]},m.size=function(e){return null==e?0:D(e)?e.length:m.keys(e).length},m.partition=k(function(e,t,r){e[r?0:1].push(t)},!0),m.first=m.head=m.take=function(e,t,r){return null==e||e.length<1?null==t?void 0:[]:null==t||r?e[0]:m.initial(e,e.length-t)},m.initial=function(e,t,r){return c.call(e,0,Math.max(0,e.length-(null==t||r?1:t)))},m.last=function(e,t,r){return null==e||e.length<1?null==t?void 0:[]:null==t||r?e[e.length-1]:m.rest(e,Math.max(0,e.length-t))},m.rest=m.tail=m.drop=function(e,t,r){return c.call(e,null==t||r?1:t)},m.compact=function(e){return m.filter(e,Boolean)};var F=function(e,t,r,n){n=n||[];for(var i=n.length,o=0,a=P(e);o<a;o++){var u=e[o];if(D(u)&&(m.isArray(u)||m.isArguments(u)))if(t)for(var s=0,c=u.length;s<c;)n[i++]=u[s++];else F(u,t,r,n),i=n.length;else r||(n[i++]=u)}return n};m.flatten=function(e,t){return F(e,t,!1)},m.without=b(function(e,t){return m.difference(e,t)}),m.uniq=m.unique=function(e,t,r,n){m.isBoolean(t)||(n=r,r=t,t=!1),null!=r&&(r=g(r,n));for(var i=[],o=[],a=0,u=P(e);a<u;a++){var s=e[a],c=r?r(s,a,e):s;t&&!r?(a&&o===c||i.push(s),o=c):r?m.contains(o,c)||(o.push(c),i.push(s)):m.contains(i,s)||i.push(s)}return i},m.union=b(function(e){return m.uniq(F(e,!0,!0))}),m.intersection=function(e){for(var t=[],r=arguments.length,n=0,i=P(e);n<i;n++){var o=e[n];if(!m.contains(t,o)){var a;for(a=1;a<r&&m.contains(arguments[a],o);a++);a===r&&t.push(o)}}return t},m.difference=b(function(e,t){return t=F(t,!0,!0),m.filter(e,function(e){return!m.contains(t,e)})}),m.unzip=function(e){for(var t=e&&m.max(e,P).length||0,r=Array(t),n=0;n<t;n++)r[n]=m.pluck(e,n);return r},m.zip=b(m.unzip),m.object=function(e,t){for(var r={},n=0,i=P(e);n<i;n++)t?r[e[n]]=t[n]:r[e[n][0]]=e[n][1];return r};var j=function(e){return function(t,r,n){r=g(r,n);for(var i=P(t),o=e>0?0:i-1;o>=0&&o<i;o+=e)if(r(t[o],o,t))return o;return-1}};m.findIndex=j(1),m.findLastIndex=j(-1),m.sortedIndex=function(e,t,r,n){r=g(r,n,1);for(var i=r(t),o=0,a=P(e);o<a;){var u=Math.floor((o+a)/2);r(e[u])<i?o=u+1:a=u}return o};var x=function(e,t,r){return function(n,i,o){var a=0,u=P(n);if("number"==typeof o)e>0?a=o>=0?o:Math.max(o+u,a):u=o>=0?Math.min(o+1,u):o+u+1;else if(r&&o&&u)return o=r(n,i),n[o]===i?o:-1;if(i!==i)return o=t(c.call(n,a,u),m.isNaN),o>=0?o+a:-1;for(o=e>0?a:u-1;o>=0&&o<u;o+=e)if(n[o]===i)return o;return-1}};m.indexOf=x(1,m.findIndex,m.sortedIndex),m.lastIndexOf=x(-1,m.findLastIndex),m.range=function(e,t,r){null==t&&(t=e||0,e=0),r||(r=t<e?-1:1);for(var n=Math.max(Math.ceil((t-e)/r),0),i=Array(n),o=0;o<n;o++,e+=r)i[o]=e;return i},m.chunk=function(e,t){if(null==t||t<1)return[];for(var r=[],n=0,i=e.length;n<i;)r.push(c.call(e,n,n+=t));return r};var B=function(e,t,r,n,i){if(!(n instanceof t))return e.apply(r,i);var o=w(e.prototype),a=e.apply(o,i);return m.isObject(a)?a:o};m.bind=b(function(e,t,r){if(!m.isFunction(e))throw new TypeError("Bind must be called on a function");var n=b(function(i){return B(e,n,t,this,r.concat(i))});return n}),m.partial=b(function(e,t){var r=m.partial.placeholder,n=function(){for(var i=0,o=t.length,a=Array(o),u=0;u<o;u++)a[u]=t[u]===r?arguments[i++]:t[u];for(;i<arguments.length;)a.push(arguments[i++]);return B(e,n,this,this,a)};return n}),m.partial.placeholder=m,m.bindAll=b(function(e,t){t=F(t,!1,!1);var r=t.length;if(r<1)throw new Error("bindAll must be passed function names");for(;r--;){var n=t[r];e[n]=m.bind(e[n],e)}}),m.memoize=function(e,t){var r=function(n){var i=r.cache,o=""+(t?t.apply(this,arguments):n);return A(i,o)||(i[o]=e.apply(this,arguments)),i[o]};return r.cache={},r},m.delay=b(function(e,t,r){return setTimeout(function(){return e.apply(null,r)},t)}),m.defer=m.partial(m.delay,m,1),m.throttle=function(e,t,r){var n,i,o,a,u=0;r||(r={});var s=function(){u=!1===r.leading?0:m.now(),n=null,a=e.apply(i,o),n||(i=o=null)},c=function(){var c=m.now();u||!1!==r.leading||(u=c);var l=t-(c-u);return i=this,o=arguments,l<=0||l>t?(n&&(clearTimeout(n),n=null),u=c,a=e.apply(i,o),n||(i=o=null)):n||!1===r.trailing||(n=setTimeout(s,l)),a};return c.cancel=function(){clearTimeout(n),u=0,n=i=o=null},c},m.debounce=function(e,t,r){var n,i,o=function(t,r){n=null,r&&(i=e.apply(t,r))},a=b(function(a){if(n&&clearTimeout(n),r){var u=!n;n=setTimeout(o,t),u&&(i=e.apply(this,a))}else n=m.delay(o,t,this,a);return i});return a.cancel=function(){clearTimeout(n),n=null},a},m.wrap=function(e,t){return m.partial(t,e)},m.negate=function(e){return function(){return!e.apply(this,arguments)}},m.compose=function(){var e=arguments,t=e.length-1;return function(){for(var r=t,n=e[t].apply(this,arguments);r--;)n=e[r].call(this,n);return n}},m.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},m.before=function(e,t){var r;return function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=null),r}},m.once=m.partial(m.before,2),m.restArguments=b;var M=!{toString:null}.propertyIsEnumerable("toString"),R=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],I=function(e,t){var r=R.length,n=e.constructor,i=m.isFunction(n)&&n.prototype||a,o="constructor";for(A(e,o)&&!m.contains(t,o)&&t.push(o);r--;)(o=R[r])in e&&e[o]!==i[o]&&!m.contains(t,o)&&t.push(o)};m.keys=function(e){if(!m.isObject(e))return[];if(h)return h(e);var t=[];for(var r in e)A(e,r)&&t.push(r);return M&&I(e,t),t},m.allKeys=function(e){if(!m.isObject(e))return[];var t=[];for(var r in e)t.push(r);return M&&I(e,t),t},m.values=function(e){for(var t=m.keys(e),r=t.length,n=Array(r),i=0;i<r;i++)n[i]=e[t[i]];return n},m.mapObject=function(e,t,r){t=g(t,r);for(var n=m.keys(e),i=n.length,o={},a=0;a<i;a++){var u=n[a];o[u]=t(e[u],u,e)}return o},m.pairs=function(e){for(var t=m.keys(e),r=t.length,n=Array(r),i=0;i<r;i++)n[i]=[t[i],e[t[i]]];return n},m.invert=function(e){for(var t={},r=m.keys(e),n=0,i=r.length;n<i;n++)t[e[r[n]]]=r[n];return t},m.functions=m.methods=function(e){var t=[];for(var r in e)m.isFunction(e[r])&&t.push(r);return t.sort()};var N=function(e,t){return function(r){var n=arguments.length;if(t&&(r=Object(r)),n<2||null==r)return r;for(var i=1;i<n;i++)for(var o=arguments[i],a=e(o),u=a.length,s=0;s<u;s++){var c=a[s];t&&void 0!==r[c]||(r[c]=o[c])}return r}};m.extend=N(m.allKeys),m.extendOwn=m.assign=N(m.keys),m.findKey=function(e,t,r){t=g(t,r);for(var n,i=m.keys(e),o=0,a=i.length;o<a;o++)if(n=i[o],t(e[n],n,e))return n};var U=function(e,t,r){return t in r};m.pick=b(function(e,t){var r={},n=t[0];if(null==e)return r;m.isFunction(n)?(t.length>1&&(n=_(n,t[1])),t=m.allKeys(e)):(n=U,t=F(t,!1,!1),e=Object(e));for(var i=0,o=t.length;i<o;i++){var a=t[i],u=e[a];n(u,a,e)&&(r[a]=u)}return r}),m.omit=b(function(e,t){var r,n=t[0];return m.isFunction(n)?(n=m.negate(n),t.length>1&&(r=t[1])):(t=m.map(F(t,!1,!1),String),n=function(e,r){return!m.contains(t,r)}),m.pick(e,n,r)}),m.defaults=N(m.allKeys,!0),m.create=function(e,t){var r=w(e);return t&&m.extendOwn(r,t),r},m.clone=function(e){return m.isObject(e)?m.isArray(e)?e.slice():m.extend({},e):e},m.tap=function(e,t){return t(e),e},m.isMatch=function(e,t){var r=m.keys(t),n=r.length;if(null==e)return!n;for(var i=Object(e),o=0;o<n;o++){var a=r[o];if(t[a]!==i[a]||!(a in i))return!1}return!0};var L,z;L=function(e,t,r,n){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!==e)return t!==t;var i=typeof e;return("function"===i||"object"===i||"object"==typeof t)&&z(e,t,r,n)},z=function(e,t,r,n){e instanceof m&&(e=e._wrapped),t instanceof m&&(t=t._wrapped);var i=l.call(e);if(i!==l.call(t))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return u.valueOf.call(e)===u.valueOf.call(t)}var o="[object Array]"===i;if(!o){if("object"!=typeof e||"object"!=typeof t)return!1;var a=e.constructor,s=t.constructor;if(a!==s&&!(m.isFunction(a)&&a instanceof a&&m.isFunction(s)&&s instanceof s)&&"constructor"in e&&"constructor"in t)return!1}r=r||[],n=n||[];for(var c=r.length;c--;)if(r[c]===e)return n[c]===t;if(r.push(e),n.push(t),o){if((c=e.length)!==t.length)return!1;for(;c--;)if(!L(e[c],t[c],r,n))return!1}else{var f,d=m.keys(e);if(c=d.length,m.keys(t).length!==c)return!1;for(;c--;)if(f=d[c],!A(t,f)||!L(e[f],t[f],r,n))return!1}return r.pop(),n.pop(),!0},m.isEqual=function(e,t){return L(e,t)},m.isEmpty=function(e){return null==e||(D(e)&&(m.isArray(e)||m.isString(e)||m.isArguments(e))?0===e.length:0===m.keys(e).length)},m.isElement=function(e){return!(!e||1!==e.nodeType)},m.isArray=d||function(e){return"[object Array]"===l.call(e)},m.isObject=function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},m.each(["Arguments","Function","String","Number","Date","RegExp","Error","Symbol","Map","WeakMap","Set","WeakSet"],function(e){m["is"+e]=function(t){return l.call(t)==="[object "+e+"]"}}),m.isArguments(arguments)||(m.isArguments=function(e){return A(e,"callee")});var G=n.document&&n.document.childNodes;"function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof G&&(m.isFunction=function(e){return"function"==typeof e||!1}),m.isFinite=function(e){return!m.isSymbol(e)&&isFinite(e)&&!isNaN(parseFloat(e))},m.isNaN=function(e){return m.isNumber(e)&&isNaN(e)},m.isBoolean=function(e){return!0===e||!1===e||"[object Boolean]"===l.call(e)},m.isNull=function(e){return null===e},m.isUndefined=function(e){return void 0===e},m.has=function(e,t){if(!m.isArray(t))return A(e,t);for(var r=t.length,n=0;n<r;n++){var i=t[n];if(null==e||!f.call(e,i))return!1;e=e[i]}return!!r},m.noConflict=function(){return n._=i,this},m.identity=function(e){return e},m.constant=function(e){return function(){return e}},m.noop=function(){},m.property=function(e){return m.isArray(e)?function(t){return O(t,e)}:E(e)},m.propertyOf=function(e){return null==e?function(){}:function(t){return m.isArray(t)?O(e,t):e[t]}},m.matcher=m.matches=function(e){return e=m.extendOwn({},e),function(t){return m.isMatch(t,e)}},m.times=function(e,t,r){var n=Array(Math.max(0,e));t=_(t,r,1);for(var i=0;i<e;i++)n[i]=t(i);return n},m.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))},m.now=Date.now||function(){return(new Date).getTime()};var q={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},V=m.invert(q),H=function(e){var t=function(t){return e[t]},r="(?:"+m.keys(e).join("|")+")",n=RegExp(r),i=RegExp(r,"g");return function(e){return e=null==e?"":""+e,n.test(e)?e.replace(i,t):e}};m.escape=H(q),m.unescape=H(V),m.result=function(e,t,r){m.isArray(t)||(t=[t]);var n=t.length;if(!n)return m.isFunction(r)?r.call(e):r;for(var i=0;i<n;i++){var o=null==e?void 0:e[t[i]];void 0===o&&(o=r,i=n),e=m.isFunction(o)?o.call(e):o}return e};var W=0;m.uniqueId=function(e){var t=++W+"";return e?e+t:t},m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var Y=/(.)^/,$={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},K=/\\|'|\r|\n|\u2028|\u2029/g,J=function(e){return"\\"+$[e]};m.template=function(e,t,r){!t&&r&&(t=r),t=m.defaults({},t,m.templateSettings);var n=RegExp([(t.escape||Y).source,(t.interpolate||Y).source,(t.evaluate||Y).source].join("|")+"|$","g"),i=0,o="__p+='";e.replace(n,function(t,r,n,a,u){return o+=e.slice(i,u).replace(K,J),i=u+t.length,r?o+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":n?o+="'+\n((__t=("+n+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),t}),o+="';\n",t.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";var a;try{a=new Function(t.variable||"obj","_",o)}catch(e){throw e.source=o,e}var u=function(e){return a.call(this,e,m)};return u.source="function("+(t.variable||"obj")+"){\n"+o+"}",u},m.chain=function(e){var t=m(e);return t._chain=!0,t};var Q=function(e,t){return e._chain?m(t).chain():t};m.mixin=function(e){return m.each(m.functions(e),function(t){var r=m[t]=e[t];m.prototype[t]=function(){var e=[this._wrapped];return s.apply(e,arguments),Q(this,r.apply(m,e))}}),m},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=o[e];m.prototype[e]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==e&&"splice"!==e||0!==r.length||delete r[0],Q(this,r)}}),m.each(["concat","join","slice"],function(e){var t=o[e];m.prototype[e]=function(){return Q(this,t.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return String(this._wrapped)},"function"==typeof define&&define.amd&&define("underscore",[],function(){return m})}()}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],134:[function(e,t,r){!function(e,n){"object"==typeof r&&void 0!==t?n(r):"function"==typeof define&&define.amd?define(["exports"],n):n(e.URI=e.URI||{})}(this,function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length>1){t[0]=t[0].slice(0,-1);for(var n=t.length-1,i=1;i<n;++i)t[i]=t[i].slice(1,-1);return t[n]=t[n].slice(1),t.join("")}return t[0]}function r(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function i(e){return e.toUpperCase()}function o(e){return void 0!==e&&null!==e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function a(e,t){var r=e;if(t)for(var n in t)r[n]=t[n];return r}function u(e){var n=t("[0-9]","[A-Fa-f]"),i=r(r("%[EFef]"+n+"%"+n+n+"%"+n+n)+"|"+r("%[89A-Fa-f]"+n+"%"+n+n)+"|"+r("%"+n+n)),o="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",a=t("[\\:\\/\\?\\#\\[\\]\\@]",o),u=e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",s=e?"[\\uE000-\\uF8FF]":"[]",c=t("[A-Za-z]","[0-9]","[\\-\\.\\_\\~]",u),l=r("[A-Za-z]"+t("[A-Za-z]","[0-9]","[\\+\\-\\.]")+"*"),f=r(r(i+"|"+t(c,o,"[\\:]"))+"*"),d=(r(r("25[0-5]")+"|"+r("2[0-4][0-9]")+"|"+r("1[0-9][0-9]")+"|"+r("[1-9][0-9]")+"|[0-9]"),r(r("25[0-5]")+"|"+r("2[0-4][0-9]")+"|"+r("1[0-9][0-9]")+"|"+r("0?[1-9][0-9]")+"|0?0?[0-9]")),h=r(d+"\\."+d+"\\."+d+"\\."+d),p=r(n+"{1,4}"),y=r(r(p+"\\:"+p)+"|"+h),m=r(r(p+"\\:")+"{6}"+y),v=r("\\:\\:"+r(p+"\\:")+"{5}"+y),_=r(r(p)+"?\\:\\:"+r(p+"\\:")+"{4}"+y),g=r(r(r(p+"\\:")+"{0,1}"+p)+"?\\:\\:"+r(p+"\\:")+"{3}"+y),b=r(r(r(p+"\\:")+"{0,2}"+p)+"?\\:\\:"+r(p+"\\:")+"{2}"+y),w=r(r(r(p+"\\:")+"{0,3}"+p)+"?\\:\\:"+p+"\\:"+y),E=r(r(r(p+"\\:")+"{0,4}"+p)+"?\\:\\:"+y),A=r(r(r(p+"\\:")+"{0,5}"+p)+"?\\:\\:"+p),O=r(r(r(p+"\\:")+"{0,6}"+p)+"?\\:\\:"),S=r([m,v,_,g,b,w,E,A,O].join("|")),P=r(r(c+"|"+i)+"+"),D=(r(S+"\\%25"+P),r(S+r("\\%25|\\%(?!"+n+"{2})")+P)),C=r("[vV]"+n+"+\\."+t(c,o,"[\\:]")+"+"),k=r("\\["+r(D+"|"+S+"|"+C)+"\\]"),T=r(r(i+"|"+t(c,o))+"*"),F=r(k+"|"+h+"(?!"+T+")|"+T),j=r("[0-9]*"),x=r(r(f+"@")+"?"+F+r("\\:"+j)+"?"),B=r(i+"|"+t(c,o,"[\\:\\@]")),M=r(B+"*"),R=r(B+"+"),I=r(r(i+"|"+t(c,o,"[\\@]"))+"+"),N=r(r("\\/"+M)+"*"),U=r("\\/"+r(R+N)+"?"),L=r(I+N),z=r(R+N),G="(?!"+B+")",q=(r(N+"|"+U+"|"+L+"|"+z+"|"+G),r(r(B+"|"+t("[\\/\\?]",s))+"*")),V=r(r(B+"|[\\/\\?]")+"*"),H=r(r("\\/\\/"+x+N)+"|"+U+"|"+z+"|"+G),W=r(l+"\\:"+H+r("\\?"+q)+"?"+r("\\#"+V)+"?"),Y=r(r("\\/\\/"+x+N)+"|"+U+"|"+L+"|"+G),$=r(Y+r("\\?"+q)+"?"+r("\\#"+V)+"?");r(W+"|"+$),r(l+"\\:"+H+r("\\?"+q)+"?"),r(r("\\/\\/("+r("("+f+")@")+"?("+F+")"+r("\\:("+j+")")+"?)")+"?("+N+"|"+U+"|"+z+"|"+G+")"),r("\\?("+q+")"),r("\\#("+V+")"),r(r("\\/\\/("+r("("+f+")@")+"?("+F+")"+r("\\:("+j+")")+"?)")+"?("+N+"|"+U+"|"+L+"|"+G+")"),r("\\?("+q+")"),r("\\#("+V+")"),r(r("\\/\\/("+r("("+f+")@")+"?("+F+")"+r("\\:("+j+")")+"?)")+"?("+N+"|"+U+"|"+z+"|"+G+")"),r("\\?("+q+")"),r("\\#("+V+")"),r("("+f+")@"),r("\\:("+j+")");return{NOT_SCHEME:new RegExp(t("[^]","[A-Za-z]","[0-9]","[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(t("[^\\%\\:]",c,o),"g"),NOT_HOST:new RegExp(t("[^\\%\\[\\]\\:]",c,o),"g"),NOT_PATH:new RegExp(t("[^\\%\\/\\:\\@]",c,o),"g"),NOT_PATH_NOSCHEME:new RegExp(t("[^\\%\\/\\@]",c,o),"g"),NOT_QUERY:new RegExp(t("[^\\%]",c,o,"[\\:\\@\\/\\?]",s),"g"),NOT_FRAGMENT:new RegExp(t("[^\\%]",c,o,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(t("[^]",c,o),"g"),UNRESERVED:new RegExp(c,"g"),OTHER_CHARS:new RegExp(t("[^\\%]",c,a),"g"),PCT_ENCODED:new RegExp(i,"g"),IPV4ADDRESS:new RegExp("^("+h+")$"),IPV6ADDRESS:new RegExp("^\\[?("+S+")"+r(r("\\%25|\\%(?!"+n+"{2})")+"("+P+")")+"?\\]?$")}}function s(e){throw new RangeError(I[e])}function c(e,t){for(var r=[],n=e.length;n--;)r[n]=t(e[n]);return r}function l(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),e=e.replace(R,"."),n+c(e.split("."),t).join(".")}function f(e){for(var t=[],r=0,n=e.length;r<n;){var i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){var o=e.charCodeAt(r++);56320==(64512&o)?t.push(((1023&i)<<10)+(1023&o)+65536):(t.push(i),r--)}else t.push(i)}return t}function d(e){var t=e.charCodeAt(0);return t<16?"%0"+t.toString(16).toUpperCase():t<128?"%"+t.toString(16).toUpperCase():t<2048?"%"+(t>>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function h(e){for(var t="",r=0,n=e.length;r<n;){var i=parseInt(e.substr(r+1,2),16);if(i<128)t+=String.fromCharCode(i),r+=3;else if(i>=194&&i<224){if(n-r>=6){var o=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&i)<<6|63&o)}else t+=e.substr(r,6);r+=6}else if(i>=224){if(n-r>=9){var a=parseInt(e.substr(r+4,2),16),u=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&i)<<12|(63&a)<<6|63&u)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function p(e,t){function r(e){var r=h(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,d).replace(t.PCT_ENCODED,i)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,d).replace(t.PCT_ENCODED,i)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,d).replace(t.PCT_ENCODED,i)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,d).replace(t.PCT_ENCODED,i)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,d).replace(t.PCT_ENCODED,i)),e}function y(e){return e.replace(/^0*(.*)/,"$1")||"0"}function m(e,t){var r=e.match(t.IPV4ADDRESS)||[],n=F(r,2),i=n[1];return i?i.split(".").map(y).join("."):e}function v(e,t){var r=e.match(t.IPV6ADDRESS)||[],n=F(r,3),i=n[1],o=n[2];if(i){for(var a=i.toLowerCase().split("::").reverse(),u=F(a,2),s=u[0],c=u[1],l=c?c.split(":").map(y):[],f=s.split(":").map(y),d=t.IPV4ADDRESS.test(f[f.length-1]),h=d?7:8,p=f.length-h,v=Array(h),_=0;_<h;++_)v[_]=l[_]||f[p+_]||"";d&&(v[h-1]=m(v[h-1],t));var g=v.reduce(function(e,t,r){if(!t||"0"===t){var n=e[e.length-1];n&&n.index+n.length===r?n.length++:e.push({index:r,length:1})}return e},[]),b=g.sort(function(e,t){return t.length-e.length})[0],w=void 0;if(b&&b.length>1){var E=v.slice(0,b.index),A=v.slice(b.index+b.length);w=E.join(":")+"::"+A.join(":")}else w=v.join(":");return o&&(w+="%"+o),w}return e}function _(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},n=!1!==t.iri?T:k;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var i=e.match(J);if(i){Q?(r.scheme=i[1],r.userinfo=i[3],r.host=i[4],r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=i[7],r.fragment=i[8],isNaN(r.port)&&(r.port=i[5])):(r.scheme=i[1]||void 0,r.userinfo=-1!==e.indexOf("@")?i[3]:void 0,r.host=-1!==e.indexOf("//")?i[4]:void 0,r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=-1!==e.indexOf("?")?i[7]:void 0,r.fragment=-1!==e.indexOf("#")?i[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),r.host&&(r.host=v(m(r.host,n),n)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var o=K[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||o&&o.unicodeSupport)p(r,n);else{if(r.host&&(t.domainHost||o&&o.domainHost))try{r.host=$.toASCII(r.host.replace(n.PCT_ENCODED,h).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}p(r,k)}o&&o.parse&&o.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}function g(e,t){var r=!1!==t.iri?T:k,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(v(m(String(e.host),r),r).replace(r.IPV6ADDRESS,function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"})),"number"==typeof e.port&&(n.push(":"),n.push(e.port.toString(10))),n.length?n.join(""):void 0}function b(e){for(var t=[];e.length;)if(e.match(X))e=e.replace(X,"");else if(e.match(Z))e=e.replace(Z,"/");else if(e.match(ee))e=e.replace(ee,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(te);if(!r)throw new Error("Unexpected dot segment condition");var n=r[0];e=e.slice(n.length),t.push(n)}return t.join("")}function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?T:k,n=[],i=K[(t.scheme||e.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||i&&i.domainHost)try{e.host=t.iri?$.toUnicode(e.host):$.toASCII(e.host.replace(r.PCT_ENCODED,h).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}p(e,r),"suffix"!==t.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var o=g(e,t);if(void 0!==o&&("suffix"!==t.reference&&n.push("//"),n.push(o),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var a=e.path;t.absolutePath||i&&i.absolutePath||(a=b(a)),void 0===o&&(a=a.replace(/^\/\//,"/%2F")),n.push(a)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function E(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments[3],i={};return n||(e=_(w(e,r),r),t=_(w(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=b(t.path||""),i.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=b(t.path||""),i.query=t.query):(t.path?("/"===t.path.charAt(0)?i.path=b(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path:i.path="/"+t.path,i.path=b(i.path)),i.query=t.query):(i.path=e.path,void 0!==t.query?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function A(e,t,r){var n=a({scheme:"null"},r);return w(E(_(e,n),_(t,n),n,!0),n)}function O(e,t){return"string"==typeof e?e=w(_(e,t),t):"object"===n(e)&&(e=_(w(e,t),t)),e}function S(e,t,r){return"string"==typeof e?e=w(_(e,r),r):"object"===n(e)&&(e=w(e,r)),"string"==typeof t?t=w(_(t,r),r):"object"===n(t)&&(t=w(t,r)),e===t}function P(e,t){return e&&e.toString().replace(t&&t.iri?T.ESCAPE:k.ESCAPE,d)}function D(e,t){return e&&e.toString().replace(t&&t.iri?T.PCT_ENCODED:k.PCT_ENCODED,h)}function C(e){var t=h(e);return t.match(ce)?t:e}var k=u(!1),T=u(!0),F=function(){function e(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{!n&&u.return&&u.return()}finally{if(i)throw o}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),j=function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)},x=2147483647,B=/^xn--/,M=/[^\0-\x7E]/,R=/[\x2E\u3002\uFF0E\uFF61]/g,I={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},N=Math.floor,U=String.fromCharCode,L=function(e){return String.fromCodePoint.apply(String,j(e))},z=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:36},G=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},q=function(e,t,r){var n=0;for(e=r?N(e/700):e>>1,e+=N(e/t);e>455;n+=36)e=N(e/35);return N(n+36*e/(e+38))},V=function(e){var t=[],r=e.length,n=0,i=128,o=72,a=e.lastIndexOf("-");a<0&&(a=0);for(var u=0;u<a;++u)e.charCodeAt(u)>=128&&s("not-basic"),t.push(e.charCodeAt(u));for(var c=a>0?a+1:0;c<r;){for(var l=n,f=1,d=36;;d+=36){c>=r&&s("invalid-input");var h=z(e.charCodeAt(c++));(h>=36||h>N((x-n)/f))&&s("overflow"),n+=h*f;var p=d<=o?1:d>=o+26?26:d-o;if(h<p)break;var y=36-p;f>N(x/y)&&s("overflow"),f*=y}var m=t.length+1;o=q(n-l,m,0==l),N(n/m)>x-i&&s("overflow"),i+=N(n/m),n%=m,t.splice(n++,0,i)}return String.fromCodePoint.apply(String,t)},H=function(e){var t=[];e=f(e);var r=e.length,n=128,i=0,o=72,a=!0,u=!1,c=void 0;try{for(var l,d=e[Symbol.iterator]();!(a=(l=d.next()).done);a=!0){var h=l.value;h<128&&t.push(U(h))}}catch(e){u=!0,c=e}finally{try{!a&&d.return&&d.return()}finally{if(u)throw c}}var p=t.length,y=p;for(p&&t.push("-");y<r;){var m=x,v=!0,_=!1,g=void 0;try{for(var b,w=e[Symbol.iterator]();!(v=(b=w.next()).done);v=!0){var E=b.value;E>=n&&E<m&&(m=E)}}catch(e){_=!0,g=e}finally{try{!v&&w.return&&w.return()}finally{if(_)throw g}}var A=y+1;m-n>N((x-i)/A)&&s("overflow"),i+=(m-n)*A,n=m;var O=!0,S=!1,P=void 0;try{for(var D,C=e[Symbol.iterator]();!(O=(D=C.next()).done);O=!0){var k=D.value;if(k<n&&++i>x&&s("overflow"),k==n){for(var T=i,F=36;;F+=36){var j=F<=o?1:F>=o+26?26:F-o;if(T<j)break;var B=T-j,M=36-j;t.push(U(G(j+B%M,0))),T=N(B/M)}t.push(U(G(T,0))),o=q(i,A,y==p),i=0,++y}}}catch(e){S=!0,P=e}finally{try{!O&&C.return&&C.return()}finally{if(S)throw P}}++i,++n}return t.join("")},W=function(e){return l(e,function(e){return B.test(e)?V(e.slice(4).toLowerCase()):e})},Y=function(e){return l(e,function(e){return M.test(e)?"xn--"+H(e):e})},$={version:"2.1.0",ucs2:{decode:f,encode:L},decode:V,encode:H,toASCII:Y,toUnicode:W},K={},J=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Q=void 0==="".match(/(){0}/)[1],X=/^\.\.?\//,Z=/^\/\.(\/|$)/,ee=/^\/\.\.(\/|$)/,te=/^\/?(?:.|\n)*?(?=\/|$)/,re={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){return e.port!==("https"!==String(e.scheme).toLowerCase()?80:443)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},ne={scheme:"https",domainHost:re.domainHost,parse:re.parse,serialize:re.serialize
|
|
23
|
-
},ie={},oe="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ae="[0-9A-Fa-f]",ue=r(r("%[EFef][0-9A-Fa-f]%"+ae+ae+"%"+ae+ae)+"|"+r("%[89A-Fa-f][0-9A-Fa-f]%"+ae+ae)+"|"+r("%"+ae+ae)),se=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),ce=new RegExp(oe,"g"),le=new RegExp(ue,"g"),fe=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',se),"g"),de=new RegExp(t("[^]",oe,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),he=de,pe={scheme:"mailto",parse:function(e,t){var r=e,n=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var i=!1,o={},a=r.query.split("&"),u=0,s=a.length;u<s;++u){var c=a[u].split("=");switch(c[0]){case"to":for(var l=c[1].split(","),f=0,d=l.length;f<d;++f)n.push(l[f]);break;case"subject":r.subject=D(c[1],t);break;case"body":r.body=D(c[1],t);break;default:i=!0,o[D(c[0],t)]=D(c[1],t)}}i&&(r.headers=o)}r.query=void 0;for(var h=0,p=n.length;h<p;++h){var y=n[h].split("@");if(y[0]=D(y[0]),t.unicodeSupport)y[1]=D(y[1],t).toLowerCase();else try{y[1]=$.toASCII(D(y[1],t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[h]=y.join("@")}return r},serialize:function(e,t){var r=e,n=o(e.to);if(n){for(var a=0,u=n.length;a<u;++a){var s=String(n[a]),c=s.lastIndexOf("@"),l=s.slice(0,c).replace(le,C).replace(le,i).replace(fe,d),f=s.slice(c+1);try{f=t.iri?$.toUnicode(f):$.toASCII(D(f,t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}n[a]=l+"@"+f}r.path=n.join(",")}var h=e.headers=e.headers||{};e.subject&&(h.subject=e.subject),e.body&&(h.body=e.body);var p=[];for(var y in h)h[y]!==ie[y]&&p.push(y.replace(le,C).replace(le,i).replace(de,d)+"="+h[y].replace(le,C).replace(le,i).replace(he,d));return p.length&&(r.query=p.join("&")),r}},ye=/^([^\:]+)\:(.*)/,me={scheme:"urn",parse:function(e,t){var r=e.path&&e.path.match(ye),n=e;if(r){var i=t.scheme||n.scheme||"urn",o=r[1].toLowerCase(),a=r[2],u=i+":"+(t.nid||o),s=K[u];n.nid=o,n.nss=a,n.path=void 0,s&&(n=s.parse(n,t))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,t){var r=t.scheme||e.scheme||"urn",n=e.nid,i=r+":"+(t.nid||n),o=K[i];o&&(e=o.serialize(e,t));var a=e,u=e.nss;return a.path=(n||t.nid)+":"+u,a}},ve=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,_e={scheme:"urn:uuid",parse:function(e,t){var r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&r.uuid.match(ve)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e,t){var r=e;return r.nss=(e.uuid||"").toLowerCase(),r}};K[re.scheme]=re,K[ne.scheme]=ne,K[pe.scheme]=pe,K[me.scheme]=me,K[_e.scheme]=_e,e.SCHEMES=K,e.pctEncChar=d,e.pctDecChars=h,e.parse=_,e.removeDotSegments=b,e.serialize=w,e.resolveComponents=E,e.resolve=A,e.normalize=O,e.equal=S,e.escapeComponent=P,e.unescapeComponent=D,Object.defineProperty(e,"__esModule",{value:!0})})},{}],135:[function(e,t,r){(function(r){"use strict";function n(e){return!e||("utf8"===(e=e.toLowerCase())||"utf-8"===e)}function i(e,t){if(n(t))return encodeURIComponent(e);for(var r=h.encode(e,t),i="",o="",a=0;a<r.length;a++)o=r[a].toString("16"),1===o.length&&(o="0"+o),i+="%"+o;return i=i.toUpperCase()}function o(e,t){if(n(t))return decodeURIComponent(e);for(var i=[],o=0;o<e.length;)"%"===e[o]?(o++,i.push(parseInt(e.substring(o,o+2),16)),o+=2):(i.push(e.charCodeAt(o)),o++);var a=new r(i);return h.decode(a,t)}function a(e,t,r,n){"object"==typeof t&&(n=t,t=null),t=t||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var a=/\+/g;e=e.split(t);var s=1e3,c=null;n&&("number"==typeof n.maxKeys&&(s=n.maxKeys),"string"==typeof n.charset&&(c=n.charset));var l=e.length;s>0&&l>s&&(l=s);for(var f=0;f<l;++f){var d,h,p,y,m=e[f].replace(a,"%20"),v=m.indexOf(r);if(v>=0?(d=m.substr(0,v),h=m.substr(v+1)):(d=m,h=""),d&&d.indexOf("%")>=0)try{p=o(d,c)}catch(e){p=d}else p=d;if(h&&h.indexOf("%")>=0)try{y=o(h,c)}catch(e){y=h}else y=h;u(i,p)?Array.isArray(i[p])?i[p].push(y):i[p]=[i[p],y]:i[p]=y}return i}function u(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function s(e){return/^[\x00-\x7F]*$/.test(e)}function c(e,t){return e=String(e),e=s(e)?encodeURIComponent(e):i(e,t)}function l(e,t,r){if(!t)throw new TypeError("stringify expects an object");return t+"="+c(e,r.charset)}function f(e,t,r){var n=[];if(!t)throw new TypeError("stringify expects an object");for(var i=0;i<e.length;i++)n.push(p(e[i],t+"["+i+"]",r));return n.join("&")}function d(e,t,r){for(var n,o=[],a=Object.keys(e),u=r.charset,s=0,l=a.length;s<l;++s)""!==(n=a[s])&&(null===e[n]?o.push(i(n,u)+"="):o.push(p(e[n],t?t+"["+c(n,u)+"]":c(n,u),r)));return o.join("&")}var h=e("iconv-lite"),p=function(e,t,r){"string"!=typeof t&&(r=t||{},t=null);var n=r.charset||"utf-8";return Array.isArray(e)?f(e,t,r):"[object Object]"==={}.toString.call(e)?d(e,t,r):"string"==typeof e?l(e,t,r):t+"="+c(String(e),n)};t.exports=i,t.exports.encode=i,t.exports.decode=o,t.exports.parse=a,t.exports.stringify=p}).call(this,e("buffer").Buffer)},{buffer:52,"iconv-lite":96}],136:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("q"),c=n(s),l=e("../provision/BaseProvision"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/ai",void 0,["organization","file"],"north/ai"),this._ogapi=e}return o(t,e),a(t,[{key:"_buildURL",value:function(){return this._organization+"/models/"+this._identifier}},{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"identifier"});return this._identifier=e,this}},{key:"withOrganization",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"organization"});return this._organization=e,this}},{key:"withFile",value:function(e){this._file=e}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),this._resource=this._organization+"/models",{modelFile:this._file||void 0}}},{key:"_composeUpdateElement",value:function(){return u(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this)}},{key:"prediction",value:function(e){var t=c.default.defer(),r=t.promise;return this._ogapi.Napi.post(this._buildURL()+"/prediction",e,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then(function(e){t.resolve({statusCode:e.statusCode,body:e.body})}).catch(function(e){t.reject(e)}),r}},{key:"create",value:function(){var e=this._composeElement(),t=c.default.defer();return this._ogapi.Napi.post_multipart(this._resource,{modelFile:e.modelFile},{},this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then(function(e){switch(e.statusCode){case 200:var r=""!=e.text?JSON.parse(e.text):{},n=e.status;t.resolve({data:r,statusCode:n});break;case 201:var n=e.status,i=e.header&&e.header.location;t.resolve({location:i,statusCode:n});break;case 204:t.resolve(e);break;default:t.reject({errors:e.data.errors,statusCode:e.statusCode})}}).catch(function(e){t.reject(e)}),t.promise}},{key:"update",value:function(){var e=this._composeElement(),t=c.default.defer();return this._ogapi.Napi.put_multipart(this._buildURL(),{modelFile:e.modelFile},{},this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then(function(e){switch(e.statusCode){case 200:var r=""!=e.text?JSON.parse(e.text):{},n=e.status;t.resolve({data:r,statusCode:n});break;default:t.reject({errors:e.data.errors,statusCode:e.statusCode})}}).catch(function(e){t.reject(e)}),t.promise}}]),t}(f.default);r.default=d,t.exports=r.default},{"../provision/BaseProvision":235,q:117}],137:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"ai","list","AIModel not found","north")}return i(t,e),o(t,[{key:"findByOrganization",value:function(e){return this._organization=e,this._execute()}},{key:"findByOrganizationAndIdentifier",value:function(e,t){return this._organization=e,this._identifier=t,this._execute()}},{key:"downloadByOrganizationAndIdentifierAndFilename",value:function(e,t,r){return this._organization=e,this._identifier=t,this._filename=r,this._download()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/models"+(this._identifier?"/"+this._identifier+(this._filename?"/"+this._filename:""):"")}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":138}],138:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("q"),u=n(a),s=e("http-status-codes"),c=n(s),l=function(){function e(t,r,n,o,a){i(this,e),this._api=t.Napi,this._baseUrl=r,this._entity=n,this._error_not_found=o,this._id=void 0,this._headers=void 0,this._urlParameters=void 0,this._serviceBaseURL=a}return o(e,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._id}},{key:"_withId",value:function(e){return this._id=e,this}},{key:"_getExtraHeaders",value:function(){return this._headers}},{key:"_setExtraHeaders",value:function(e){if(this._headers)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._headers[n]=e[n]}else this._headers=e}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this.parameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"_execute",value:function(){var e=u.default.defer(),t=e.promise,r=this._entity,n=this._error_not_found;return this._api.get(this._composeUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters(),!1,this._getServiceBaseURL()).then(function(t){if(204===t.statusCode)e.reject({error:n,statusCode:c.default.NOT_FOUND});else{var i=t.body[r]&&t.body.provision?t.body:t.body[r];e.resolve({data:i||t.body,statusCode:t.statusCode})}}).catch(function(t){400===t.statusCode&&(t.statusCode=c.default.NOT_FOUND),e.reject(t)}),t}},{key:"_downloadUrl",value:function(){return this._composeUrl()}},{key:"_download",value:function(e){var t=u.default.defer(),r=t.promise,n=this._error_not_found;return this._api.get(this._downloadUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters(),!e,this._getServiceBaseURL()).then(function(e){204===e.statusCode?t.reject({data:n,statusCode:c.default.NOT_FOUND}):t.resolve({data:e,statusCode:e.statusCode})}).catch(function(e){t.reject(e)}),r}},{key:"_getServiceBaseURL",value:function(){return this._serviceBaseURL}}]),e}();r.default=l,t.exports=r.default},{"http-status-codes":76,q:117}],139:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("./operations/Operations"),u=n(a),s=e("./users/UserFinder"),c=n(s),l=e("./geocluster/GeoclusterFinder"),f=n(l),d=e("./geocluster/Geocluster"),h=n(d),p=e("./security/Certificates"),y=n(p),m=e("./users/Users"),v=n(m),_=e("./organizations/OrganizationFinder"),g=n(_),b=e("./channels/ChannelFinder"),w=n(b),E=e("./searching/builder/AreasSearchBuilder"),A=n(E),O=e("./searching/builder/DatasetsCatalogSearchBuilder"),S=n(O),P=e("./areas/AreaFinder"),D=n(P),C=e("./searching/builder/BulkSearchBuilder"),k=n(C),T=e("./searching/builder/BulkExecutionSearchBuilder"),F=n(T),j=e("./bulk/BulkFinder"),x=n(j),B=e("./bulk/BulkExecutionFinder"),M=n(B),R=e("./channels/Channels"),I=n(R),N=e("./areas/Areas"),U=n(N),L=e("./datasets/Datasets"),z=n(L),G=e("./timeseries/Timeseries"),q=n(G),V=e("./searching/builder/ChannelsSearchBuilder"),H=n(V),W=e("./rulesConfiguration/RuleConfigurations"),Y=n(W),$=e("./rulesConfiguration/RuleConfigurationsFinder"),K=n($),J=e("./rulesConfiguration/RuleConfigurationsCatalog"),Q=n(J),X=e("./rulesConfiguration/RuleConfigurationsHelper"),Z=n(X),ee=e("./datasets/DatasetFinder"),te=n(ee),re=e("./timeseries/TimeseriesFinder"),ne=n(re),ie=e("./operationTypes/OperationType"),oe=n(ie),ae=e("./operationTypes/OperationTypeFinder"),ue=n(ae),se=e("./operationTypes/OperationTypeCatalog"),ce=n(se),le=e("./security/CertificateFinder"),fe=n(le),de=e("./operations/OperationFinder"),he=n(de),pe=e("./searching/FilterBuilder"),ye=n(pe),me=e("./searching/SelectBuilder"),ve=n(me),_e=e("./operations/OperationActions"),ge=n(_e),be=e("./operations/PeriodicityActions"),we=n(be),Ee=e("./util/Expression"),Ae=n(Ee),Oe=e("./util/SelectElement"),Se=n(Oe),Pe=e("./searching/builder/RawSearchBuilder"),De=n(Pe),Ce=e("./searching/builder/DevicesSearchBuilder"),ke=n(Ce),Te=e("./searching/builder/SubscribersSearchBuilder"),Fe=n(Te),je=e("./searching/builder/SubscriptionsSearchBuilder"),xe=n(je),Be=e("./searching/builder/AssetsSearchBuilder"),Me=n(Be),Re=e("./searching/builder/TicketsSearchBuilder"),Ie=n(Re),Ne=e("./searching/builder/TasksSearchBuilder"),Ue=n(Ne),Le=e("./searching/builder/OperationsSearchBuilder"),ze=n(Le),Ge=e("./searching/builder/ExecutionsSearchBuilder"),qe=n(Ge),Ve=e("./searching/builder/ExecutionsHistorySearchBuilder"),He=n(Ve),We=e("./searching/builder/AlarmsSearchBuilder"),Ye=n(We),$e=e("./searching/builder/DatamodelsSearchBuilder"),Ke=n($e),Je=e("./searching/builder/FeedsSearchBuilder"),Qe=n(Je),Xe=e("./searching/builder/DatastreamsSearchBuilder"),Ze=n(Xe),et=e("./searching/builder/DatapointsSearchBuilder"),tt=n(et),rt=e("./searching/builder/BundlesSearchBuilder"),nt=n(rt),it=e("./searching/builder/CertificatesSearchBuilder"),ot=n(it),at=e("./searching/builder/HardwaresSearchBuilder"),ut=n(at),st=e("./searching/builder/SoftwaresSearchBuilder"),ct=n(st),lt=e("./searching/builder/OperationalStatusSearchBuilder"),ft=n(lt),dt=e("./searching/builder/ServiceGroupSearchBuilder"),ht=n(dt),pt=e("./searching/builder/AdministrativeStateSearchBuilder"),yt=n(pt),mt=e("./searching/builder/CommunicationsModuleTypeSearchBuilder"),vt=n(mt),_t=e("./searching/builder/FieldsDefinitionSearchBuilder"),gt=n(_t),bt=e("./searching/builder/BasicTypesSearchBuilder"),wt=n(bt),Et=e("./searching/builder/MobilePhoneProviderSearchBuilder"),At=n(Et),Ot=e("./searching/builder/IoTDatastreamPeriodSearchBuilder"),St=n(Ot),Pt=e("./searching/builder/ResourceTypeSearchBuilder"),Dt=n(Pt),Ct=e("./searching/builder/AllowedResourceTypeSearchBuilder"),kt=n(Ct),Tt=e("./searching/builder/IoTDatastreamAccessSearchBuilder"),Ft=n(Tt),jt=e("./searching/builder/IoTDatastreamStoragePeriodSearchBuilder"),xt=n(jt),Bt=e("./searching/builder/TicketSeveritySearchBuilder"),Mt=n(Bt),Rt=e("./searching/builder/TicketPrioritySearchBuilder"),It=n(Rt),Nt=e("./searching/builder/TicketStatusSearchBuilder"),Ut=n(Nt),Lt=e("./searching/builder/RulesSearchBuilder"),zt=n(Lt),Gt=e("./searching/builder/OperationTypesSearchBuilder"),qt=n(Gt),Vt=e("./searching/builder/UsersSearchBuilder"),Ht=n(Vt),Wt=e("./searching/builder/DomainsSearchBuilder"),Yt=n(Wt),$t=e("./searching/builder/PlansSearchBuilder"),Kt=n($t),Jt=e("./searching/builder/DevicesPlansSearchBuilder"),Qt=n(Jt),Xt=e("./bundles/Bundles"),Zt=n(Xt),er=e("./bundles/BundleFinder"),tr=n(er),rr=e("./organizations/Organizations"),nr=n(rr),ir=e("./domains/Domains"),or=n(ir),ar=e("./domains/DomainsFinder"),ur=n(ar),sr=e("./entities/DeviceFinder"),cr=n(sr),lr=e("./entities/TicketFinder"),fr=n(lr),dr=e("./entities/SubscriptionsFinder"),hr=n(dr),pr=e("./entities/SubscribersFinder"),yr=n(pr),mr=e("./collection/devices/DeviceMessage"),vr=n(mr),_r=e("./collection/devices/collect/Datastreams"),gr=n(_r),br=e("./collection/devices/collect/Datapoint"),wr=n(br),Er=e("./collection/devices/collect/Hardware"),Ar=n(Er),Or=e("./collection/devices/collect/Software"),Sr=n(Or),Pr=e("./collection/devices/collect/Storage"),Dr=n(Pr),Cr=e("./collection/devices/collect/Usage"),kr=n(Cr),Tr=e("./collection/devices/collect/PowerSupply"),Fr=n(Tr),jr=e("./collection/devices/collect/CommsModuleMessage"),xr=n(jr),Br=e("./collection/devices/collect/Mobile"),Mr=n(Br),Rr=e("./collection/devices/collect/Subscriber"),Ir=n(Rr),Nr=e("./collection/devices/collect/Subscription"),Ur=n(Nr),Lr=e("./workgroups/WorkgroupRelations"),zr=n(Lr),Gr=e("./workgroups/Workgroups"),qr=n(Gr),Vr=e("./workgroups/WorkgroupFinder"),Hr=n(Vr),Wr=e("./searching/builder/WorkgroupsSearchBuilder"),Yr=n(Wr),$r=e("./workgroups/WorkgroupRelationsFinder"),Kr=n($r),Jr=e("./searching/builder/UserProfilesSearchBuilder"),Qr=n(Jr),Xr=e("./iot/datamodels/Datamodels"),Zr=n(Xr),en=e("./iot/datamodels/DatamodelsHelper"),tn=n(en),rn=e("./iot/datamodels/DatamodelsFinder"),nn=n(rn),on=e("./iot/catalog/Datastream"),an=n(on),un=e("./iot/catalog/Qrating"),sn=n(un),cn=e("./provision/entities/EntityBuilder"),ln=n(cn),fn=e("./provision/bulk/BulkExecutionBuilder"),dn=n(fn),hn=e("./searching/builder/EntitiesSearchBuilder"),pn=n(hn),yn=e("./searching/builder/DatasetEntitiesSearchBuilder"),mn=n(yn),vn=e("./searching/builder/DatasetSearchBuilder"),_n=n(vn),gn=e("./searching/builder/TimeserieSearchBuilder"),bn=n(gn),wn=e("./searching/builder/CountryCodesSearchBuilder"),En=n(wn),An=e("./searching/builder/TimezoneSearchBuilder"),On=n(An),Sn=e("./searching/builder/UserLanguagesSearchBuilder"),Pn=n(Sn),Dn=e("./provisionProcessors/provisionProcessors"),Cn=n(Dn),kn=e("./provisionProcessors/provisionProcessorsFinder"),Tn=n(kn),Fn=e("./entities/EntityFinder"),jn=n(Fn),xn=e("./alarms/AlarmActions"),Bn=n(xn),Mn=e("superagent"),Rn=n(Mn),In=e("./connectorsFunctionsConfiguration/ConnectorFunctionsHelper"),Nn=n(In),Un=e("./connectorsFunctionsConfiguration/ConnectorFunctionsFinder"),Ln=n(Un),zn=e("./connectorsFunctionsConfiguration/ConnectorFunctions"),Gn=n(zn),qn=e("./pipelines/PipelineFinder"),Vn=n(qn),Hn=e("./transformers/TransformerFinder"),Wn=n(Hn),Yn=e("./AIModels/AIModelsFinder"),$n=n(Yn),Kn=e("./transformers/Transformers"),Jn=n(Kn),Qn=e("./AIModels/AIModels"),Xn=n(Qn),Zn=e("./pipelines/Pipelines"),ei=n(Zn),ti=e("./manufacturers/Manufacturer"),ri=n(ti),ni=e("./manufacturers/Model"),ii=n(ni),oi=e("./manufacturers/ManufacturerFinder"),ai=n(oi),ui=e("./manufacturers/ModelFinder"),si=n(ui),ci=e("./provision/country/CountriesCatalog"),li=n(ci),fi=function(){var e=void 0,t=Rn.default.Request.prototype.end;return Rn.default.Request.prototype.end=function(r){return e&&e.call&&e(this),t.call(this,function(e,t){"function"==typeof r&&r(e,t)})},function(t){e=t}}(),di=function(){function e(t,r,n){if(i(this,e),this.constructor===e)throw new Error("Cannot construct Abstract instances directly");if("object"!=typeof t)throw new Error("Must instance mandatory parameter: northAmpliaREST");if("object"!=typeof r)throw new Error("Must instance mandatory parameter: southAmpliaREST");n.hooks&&n.hooks.beforeStart&&"function"==typeof n.hooks.beforeStart&&fi(n.hooks.beforeStart),this.Napi=t,this.Sapi=r,this.EX=Ae.default,this.SE=Se.default,this.operations=new u.default(this),this.alarms=new Bn.default(this),this.entityBuilder=new ln.default(this)}return o(e,[{key:"newUserFinder",value:function(){return new c.default(this)}},{key:"newGeoclusterFinder",value:function(){return new f.default(this)}},{key:"geoclusterBuilder",value:function(){return new h.default(this)}},{key:"newOrganizationFinder",value:function(){return new g.default(this)}},{key:"newChannelFinder",value:function(){return new w.default(this)}},{key:"areasSearchBuilder",value:function(){return new A.default(this)}},{key:"datasetsCatalogSearchBuilder",value:function(){return new S.default(this)}},{key:"bulkSearchBuilder",value:function(){return new k.default(this)}},{key:"bulkExecutionSearchBuilder",value:function(){return new F.default(this)}},{key:"newBulkFinder",value:function(){return new x.default(this)}},{key:"newBulkExecutionFinder",value:function(){return new M.default(this)}},{key:"newAreaFinder",value:function(){return new D.default(this)}},{key:"newOperationFinder",value:function(){return new he.default(this)}},{key:"newOperationTypeFinder",value:function(){return new ue.default(this)}},{key:"newOperationTypeCatalog",value:function(){return new ce.default(this)}},{key:"newCountriesCatalog",value:function(){return new li.default(this)}},{key:"operationTypeBuilder",value:function(e,t,r){return new oe.default(this,e,t,r)}},{key:"newRuleConfigurationsFinder",value:function(){return new K.default(this)}},{key:"newRuleConfigurationsHelper",value:function(){return new Z.default(this)}},{key:"newDatasetFinder",value:function(){return new te.default(this)}},{key:"newTimeserieFinder",value:function(){return new ne.default(this)}},{key:"newRuleConfigurationsCatalog",value:function(){return new Q.default(this)}},{key:"ruleConfigurationBuilder",value:function(e,t,r,n){return new Y.default(this,e,t,r,n)}},{key:"newCertificateFinder",value:function(){return new fe.default(this)}},{key:"newDeviceFinder",value:function(){return new cr.default(this)}},{key:"newTicketFinder",value:function(){return new fr.default(this)}},{key:"newSubscriptionsFinder",value:function(){return new hr.default(this)}},{key:"newSubscribersFinder",value:function(){return new yr.default(this)}},{key:"newEntityFinder",value:function(){return new jn.default(this)}},{key:"newFilterBuilder",value:function(){return new ye.default}},{key:"newSelectBuilder",value:function(){return new ve.default}},{key:"rawSearchBuilder",value:function(){return new De.default(this)}},{key:"usersSearchBuilder",value:function(){return new Ht.default(this)}},{key:"domainsSearchBuilder",value:function(){return new Yt.default(this)}},{key:"devicesSearchBuilder",value:function(){return new ke.default(this)}},{key:"assetsSearchBuilder",value:function(){return new Me.default(this)}},{key:"subscribersSearchBuilder",value:function(){return new Fe.default(this)}},{key:"subscriptionsSearchBuilder",value:function(){return new xe.default(this)}},{key:"ticketsSearchBuilder",value:function(){return new Ie.default(this)}},{key:"communicationsModuleTypeSearchBuilder",value:function(){return new vt.default(this)}},{key:"fieldsDefinitionSearchBuilder",value:function(){return new gt.default(this)}},{key:"mobilePhoneProviderSearchBuilder",value:function(){return new At.default(this)}},{key:"ioTDatastreamPeriodSearchBuilder",value:function(){return new St.default(this)}},{key:"resourceTypeSearchBuilder",value:function(){return new Dt.default(this)}},{key:"allowedResourceTypeSearchBuilder",value:function(){return new kt.default(this)}},{key:"ioTDatastreamAccessSearchBuilder",value:function(){return new Ft.default(this)}},{key:"ioTDatastreamStoragePeriodSearchBuilder",value:function(){return new xt.default(this)}},{key:"ticketSeveritySearchBuilder",value:function(){return new Mt.default(this)}},{key:"ticketPrioritySearchBuilder",value:function(){return new It.default(this)}},{key:"ticketStatusSearchBuilder",value:function(){return new Ut.default(this)}},{key:"rulesSearchBuilder",value:function(){return new zt.default(this)}},{key:"operationTypesSearchBuilder",value:function(){return new qt.default(this)}},{key:"tasksSearchBuilder",value:function(){return new Ue.default(this)}},{key:"operationsSearchBuilder",value:function(){return new ze.default(this)}},{key:"executionsSearchBuilder",value:function(){return new qe.default(this)}},{key:"executionsHistorySearchBuilder",value:function(){return new He.default(this)}},{key:"alarmsSearchBuilder",value:function(){return new Ye.default(this)}},{key:"datastreamsSearchBuilder",value:function(){return new Ze.default(this)}},{key:"datamodelsSearchBuilder",value:function(){return new Ke.default(this)}},{key:"feedsSearchBuilder",value:function(){return new Qe.default(this)}},{key:"datapointsSearchBuilder",value:function(){return new tt.default(this)}},{key:"bundlesSearchBuilder",value:function(){return new nt.default(this)}},{key:"certificatesSearchBuilder",value:function(){return new ot.default(this)}},{key:"basicTypesSearchBuilder",value:function(){return new wt.default(this)}},{key:"entitiesSearchBuilder",value:function(){return new pn.default(this)}},{key:"datasetEntitiesSearchBuilder",value:function(e,t){return new mn.default(this,e,t)}},{key:"datasetSearchBuilder",value:function(e,t){return new _n.default(this,e,t)}},{key:"timeserieSearchBuilder",value:function(e,t){return new bn.default(this,e,t)}},{key:"plansSearchBuilder",value:function(){return new Kt.default(this)}},{key:"devicesPlansSearchBuilder",value:function(){return new Qt.default(this)}},{key:"bundlesBuilder",value:function(){return new Zt.default(this)}},{key:"newBundleFinder",value:function(){return new tr.default(this)}},{key:"organizationsBuilder",value:function(){return new nr.default(this)}},{key:"domainsBuilder",value:function(){return new or.default(this)}},{key:"newDomainFinder",value:function(){return new ur.default(this)}},{key:"usersBuilder",value:function(){return new v.default(this)}},{key:"certificatesBuilder",value:function(){return new y.default(this)}},{key:"hardwaresSearchBuilder",value:function(){return new ut.default(this)}},{key:"softwaresSearchBuilder",value:function(){return new ct.default(this)}},{key:"operationalStatusSearchBuilder",value:function(){return new ft.default(this)}},{key:"serviceGroupSearchBuilder",value:function(){return new ht.default(this)}},{key:"administrativeStateSearchBuilder",value:function(){return new yt.default(this)}},{key:"deviceMessageBuilder",value:function(){return new vr.default(this)}},{key:"datastreamBuilder",value:function(){return new gr.default(this)}},{key:"datapointsBuilder",value:function(){return new wr.default(this)}},{key:"hardwareMessageBuilder",value:function(){return new Ar.default(this)}},{key:"softwareMessageBuilder",value:function(){return new Sr.default(this)}},{key:"storageMessageBuilder",value:function(){return new Dr.default(this)}},{key:"usageMessageBuilder",value:function(){return new kr.default(this)}},{key:"powerSupplyMessageBuilder",value:function(){return new Fr.default(this)}},{key:"commsModuleMessageMessageBuilder",value:function(){return new xr.default(this)}},{key:"subscriberMessageBuilder",value:function(){return new Ir.default(this)}},{key:"subscriptionMessageBuilder",value:function(){return new Ur.default(this)}},{key:"mobileMessageMessageBuilder",value:function(){return new Mr.default(this)}},{key:"newOperationActions",value:function(e){return new ge.default(this,e)}},{key:"newPeriodicityActions",value:function(e){return new we.default(this,e)}},{key:"workgroupRelationsBuilder",value:function(){return new zr.default(this)}},{key:"newWorkgroupRelationsFinder",value:function(){return new Kr.default(this)}},{key:"workgroupsBuilder",value:function(){return new qr.default(this)}},{key:"newWorkgroupFinder",value:function(){return new Hr.default(this)}},{key:"workgroupsSearchBuilder",value:function(){return new Yr.default(this)}},{key:"channelsBuilder",value:function(){return new I.default(this)}},{key:"areasBuilder",value:function(){return new U.default(this)}},{key:"datasetsBuilder",value:function(){return new z.default(this)}},{key:"timeseriesBuilder",value:function(){return new q.default(this)}},{key:"channelsSearchBuilder",value:function(){return new H.default(this)}},{key:"userProfilesSearchBuilder",value:function(){return new Qr.default(this)}},{key:"datamodelsBuilder",value:function(e){return new Zr.default(this,e)}},{key:"datamodelsHelper",value:function(e,t){return new tn.default(this,e,t)}},{key:"newDatamodelsFinder",value:function(){return new nn.default(this)}},{key:"datastreamsBuilder",value:function(){return new an.default(this)}},{key:"bulkExecutionBuilder",value:function(e,t,r){return new dn.default(this,e,t,r)}},{key:"qratingsBuilder",value:function(){return new sn.default(this)}},{key:"countryCodesSearchBuilder",value:function(){return new En.default(this)}},{key:"timezoneSearchBuilder",value:function(){return new On.default(this)}},{key:"userLanguagesSearchBuilder",value:function(){return new Pn.default(this)}},{key:"newConnectorFunctionsFinder",value:function(){return new Ln.default(this)}},{key:"newConnectorFunctionsHelper",value:function(){return new Nn.default(this)}},{key:"connectorFunctionsBuilder",value:function(e,t,r,n){return new Gn.default(this,e,t,r,n)}},{key:"provisionProcessorsBuilder",value:function(){return new Cn.default(this)}},{key:"newProvisionProcessorsFinder",value:function(){return new Tn.default(this)}},{key:"newPipelineFinder",value:function(){return new Vn.default(this)}},{key:"newTransformerFinder",value:function(){return new Wn.default(this)}},{key:"newAIModelFinder",value:function(){return new $n.default(this)}},{key:"transformersBuilder",value:function(){return new Jn.default(this)}},{key:"aiModelsBuilder",value:function(){return new Xn.default(this)}},{key:"pipelinesBuilder",value:function(){return new ei.default(this)}},{key:"manufacturersBuilder",value:function(){return new ri.default(this)}},{key:"manufacturerModelsBuilder",value:function(){return new ii.default(this)}},{key:"newManufacturersFinder",value:function(){return new ai.default(this)}},{key:"newModelFinder",value:function(){return new si.default(this)}}]),e}();r.default=di,t.exports=r.default},{"./AIModels/AIModels":136,"./AIModels/AIModelsFinder":137,"./alarms/AlarmActions":141,
|
|
24
|
-
"./areas/AreaFinder":146,"./areas/Areas":147,"./bulk/BulkExecutionFinder":149,"./bulk/BulkFinder":150,"./bundles/BundleFinder":152,"./bundles/Bundles":153,"./channels/ChannelFinder":160,"./channels/Channels":161,"./collection/devices/DeviceMessage":162,"./collection/devices/collect/CommsModuleMessage":163,"./collection/devices/collect/Datapoint":164,"./collection/devices/collect/Datastreams":165,"./collection/devices/collect/Hardware":167,"./collection/devices/collect/Mobile":168,"./collection/devices/collect/PowerSupply":169,"./collection/devices/collect/Software":170,"./collection/devices/collect/Storage":171,"./collection/devices/collect/Subscriber":172,"./collection/devices/collect/Subscription":173,"./collection/devices/collect/Usage":174,"./connectorsFunctionsConfiguration/ConnectorFunctions":183,"./connectorsFunctionsConfiguration/ConnectorFunctionsFinder":184,"./connectorsFunctionsConfiguration/ConnectorFunctionsHelper":185,"./datasets/DatasetFinder":187,"./datasets/Datasets":188,"./domains/Domains":189,"./domains/DomainsFinder":190,"./entities/DeviceFinder":191,"./entities/EntityFinder":192,"./entities/SubscribersFinder":193,"./entities/SubscriptionsFinder":194,"./entities/TicketFinder":195,"./geocluster/Geocluster":196,"./geocluster/GeoclusterFinder":197,"./iot/catalog/Datastream":199,"./iot/catalog/Qrating":200,"./iot/datamodels/Datamodels":201,"./iot/datamodels/DatamodelsFinder":202,"./iot/datamodels/DatamodelsHelper":203,"./manufacturers/Manufacturer":204,"./manufacturers/ManufacturerFinder":205,"./manufacturers/Model":207,"./manufacturers/ModelFinder":208,"./operationTypes/OperationType":210,"./operationTypes/OperationTypeCatalog":211,"./operationTypes/OperationTypeFinder":212,"./operations/OperationActions":213,"./operations/OperationFinder":214,"./operations/Operations":215,"./operations/PeriodicityActions":216,"./organizations/OrganizationFinder":231,"./organizations/Organizations":232,"./pipelines/PipelineFinder":233,"./pipelines/Pipelines":234,"./provision/bulk/BulkExecutionBuilder":236,"./provision/country/CountriesCatalog":237,"./provision/entities/EntityBuilder":243,"./provisionProcessors/provisionProcessors":250,"./provisionProcessors/provisionProcessorsFinder":251,"./rulesConfiguration/RuleConfigurations":252,"./rulesConfiguration/RuleConfigurationsCatalog":253,"./rulesConfiguration/RuleConfigurationsFinder":254,"./rulesConfiguration/RuleConfigurationsHelper":255,"./searching/FilterBuilder":262,"./searching/SelectBuilder":264,"./searching/builder/AdministrativeStateSearchBuilder":267,"./searching/builder/AlarmsSearchBuilder":268,"./searching/builder/AllowedResourceTypeSearchBuilder":269,"./searching/builder/AreasSearchBuilder":270,"./searching/builder/AssetsSearchBuilder":271,"./searching/builder/BasicTypesSearchBuilder":272,"./searching/builder/BulkExecutionSearchBuilder":273,"./searching/builder/BulkSearchBuilder":274,"./searching/builder/BundlesSearchBuilder":275,"./searching/builder/CertificatesSearchBuilder":276,"./searching/builder/ChannelsSearchBuilder":277,"./searching/builder/CommunicationsModuleTypeSearchBuilder":278,"./searching/builder/CountryCodesSearchBuilder":279,"./searching/builder/DatamodelsSearchBuilder":280,"./searching/builder/DatapointsSearchBuilder":281,"./searching/builder/DatasetEntitiesSearchBuilder":282,"./searching/builder/DatasetSearchBuilder":283,"./searching/builder/DatasetsCatalogSearchBuilder":284,"./searching/builder/DatastreamsSearchBuilder":285,"./searching/builder/DevicesPlansSearchBuilder":286,"./searching/builder/DevicesSearchBuilder":287,"./searching/builder/DomainsSearchBuilder":288,"./searching/builder/EntitiesSearchBuilder":289,"./searching/builder/ExecutionsHistorySearchBuilder":290,"./searching/builder/ExecutionsSearchBuilder":291,"./searching/builder/FeedsSearchBuilder":292,"./searching/builder/FieldsDefinitionSearchBuilder":293,"./searching/builder/HardwaresSearchBuilder":295,"./searching/builder/IoTDatastreamAccessSearchBuilder":296,"./searching/builder/IoTDatastreamPeriodSearchBuilder":297,"./searching/builder/IoTDatastreamStoragePeriodSearchBuilder":298,"./searching/builder/MobilePhoneProviderSearchBuilder":299,"./searching/builder/OperationTypesSearchBuilder":300,"./searching/builder/OperationalStatusSearchBuilder":301,"./searching/builder/OperationsSearchBuilder":302,"./searching/builder/PlansSearchBuilder":303,"./searching/builder/RawSearchBuilder":305,"./searching/builder/ResourceTypeSearchBuilder":306,"./searching/builder/RulesSearchBuilder":307,"./searching/builder/ServiceGroupSearchBuilder":310,"./searching/builder/SoftwaresSearchBuilder":311,"./searching/builder/SubscribersSearchBuilder":312,"./searching/builder/SubscriptionsSearchBuilder":313,"./searching/builder/TasksSearchBuilder":314,"./searching/builder/TicketPrioritySearchBuilder":315,"./searching/builder/TicketSeveritySearchBuilder":316,"./searching/builder/TicketStatusSearchBuilder":317,"./searching/builder/TicketsSearchBuilder":318,"./searching/builder/TimeserieSearchBuilder":319,"./searching/builder/TimezoneSearchBuilder":320,"./searching/builder/UserLanguagesSearchBuilder":321,"./searching/builder/UserProfilesSearchBuilder":322,"./searching/builder/UsersSearchBuilder":323,"./searching/builder/WorkgroupsSearchBuilder":324,"./security/CertificateFinder":326,"./security/Certificates":327,"./timeseries/Timeseries":331,"./timeseries/TimeseriesFinder":332,"./transformers/TransformerFinder":333,"./transformers/Transformers":334,"./users/UserFinder":335,"./users/Users":336,"./util/Expression":338,"./util/SelectElement":340,"./workgroups/WorkgroupFinder":346,"./workgroups/WorkgroupRelations":347,"./workgroups/WorkgroupRelationsFinder":348,"./workgroups/Workgroups":349,superagent:128}],140:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("q"),s=(n(u),e("http-status-codes")),c=(n(s),e("./GenericFinder")),l=n(c),f=function(e){function t(e,r,n,o){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provision/"+r,n,o)}return o(t,e),t}(l.default);r.default=f,t.exports=r.default},{"./GenericFinder":138,"http-status-codes":76,q:117}],141:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("./actions/AlarmAttendBuilder"),u=n(a),s=e("./actions/AlarmCloseBuilder"),c=n(s),l=function(){function e(t){i(this,e),this._ogapi=t}return o(e,[{key:"newCloseBuilder",value:function(){return new c.default(this._ogapi)}},{key:"newAttendBuilder",value:function(){return new u.default(this._ogapi)}}]),e}();r.default=l,t.exports=r.default},{"./actions/AlarmAttendBuilder":144,"./actions/AlarmCloseBuilder":145}],142:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("q"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t,r,i){n(this,e),this._ogapi=t,this._resource=r,this._postObj=i}return i(e,[{key:"execute",value:function(){var e=this,t=a.default.defer();return this._ogapi.Napi.post(this._resource,this._postObj).then(function(r){var n=void 0;try{n=JSON.parse(r.text)}catch(t){console.warn("Error parsing response data when execute post action to "+e._resource)}t.resolve({data:n||{},statusCode:r.statusCode,location:r.header.location})}).catch(function(e){e.data||(e.data={}),e.data.errors||(e.data.errors=["string"==typeof e?{message:e}:e]),t.reject(e)}),t.promise}}]),e}();r.default=u,t.exports=r.default},{q:117}],143:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("./Alarm"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t,r){if(n(this,e),this._ogapi=t,this._action=r,this._resource="alarms",this._build={alarms:[],notes:void 0,action:r},this.constructor===e)throw new Error("Cannot construct Abstract instances directly")}return i(e,[{key:"addAlarmId",value:function(e){if("string"!=typeof e)throw new Error("Parameter alarmId must be a string");return this._build.alarms.push(e),this}},{key:"withNotes",value:function(e){if("string"!=typeof e)throw new Error("Parameter notes must be a string");return this._build.notes=e,this}},{key:"build",value:function(){if(0===this._build.alarms.length)throw new Error("Builder error. You must append at least one alarmId with addAlarmId method");return"string"!=typeof this._build.notes&&delete this._build.notes,new a.default(this._ogapi,this._resource,this._build)}}]),e}();r.default=u,t.exports=r.default},{"./Alarm":142}],144:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("./AlarmActionBuilder"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"ATTEND")}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"./AlarmActionBuilder":143}],145:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("./AlarmActionBuilder"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"CLOSE")}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"./AlarmActionBuilder":143}],146:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../ProvisionGenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations","area","Area/s not found")}return i(t,e),o(t,[{key:"findByOrganizationAndIdentifier",value:function(e,t){return this._checkString(e,"organization"),this._checkString(t,"identifier"),this._organization=e,this._identifier=t,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/areas/"+this._identifier}},{key:"_checkString",value:function(e,t){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER")}}]),t}(s.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":140}],147:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./TYPE_ENUM"),c=e("../provision/BaseProvision"),l=n(c),f=e("../util/formats/check_types"),d=n(f),h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations/",void 0,["identifier","organization","type","coordinates"])}return o(t,e),a(t,[{key:"_buildURL",value:function(){return"provision/organizations/"+this._organization+"/areas/"+this._identifier}},{key:"withOrganization",value:function(e){return d.default._checkStringAndLength(e,50,"organization"),this._organization=e,this}},{key:"withIdentifier",value:function(e){return d.default._checkStringAndLength(e,50,"identifier"),this._identifier=e,this}},{key:"withName",value:function(e){return d.default._checkStringAndLength(e,50,"name"),this._name=e,this}},{key:"withColor",value:function(e){return d.default._checkStringAndLength(e,50,"color"),this._color=e,this}},{key:"withDescription",value:function(e){return d.default._checkStringAndLength(e,50,"description"),this._description=e,this}},{key:"withOrder",value:function(e){return d.default._checkNumber(e,"order"),this._order=e,this}},{key:"withGeometry",value:function(e,t){return d.default._checkType(e,s.TYPE_ENUM),d.default._checkArray(t,"coordinates"),this._type=e,this._coordinates=t,this}},{key:"withEntities",value:function(e){return d.default._checkArray(e,"entities"),this._entities=e,this}},{key:"_composeElement",value:function(){return this._resource="provision/organizations/"+this._organization+"/areas/",{identifier:this._identifier,name:this._name,description:this._description,order:this._order,color:this._color,geometry:{type:this._type,coordinates:this._coordinates},entities:this._entities}}},{key:"_composeUpdateElement",value:function(){var e=u(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this);return delete e.identifier,e}}]),t}(l.default);r.default=h,t.exports=r.default},{"../provision/BaseProvision":235,"../util/formats/check_types":342,"./TYPE_ENUM":148}],148:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["Polygon","Point","LineString"];r.TYPE_ENUM=n},{}],149:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../GenericFinder"),c=n(s),l=e("q"),f=(n(l),e("http-status-codes")),d=(n(f),["application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]);r.MIME_TYPES_ENUM=d;var h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provisionProcessors/provision/organizations","value","Bulk not found")}return o(t,e),a(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/bulk/"+this._id+(this._details?"/details":"")}},{key:"findByOrganizationAndId",value:function(e,t,r){if(this._organization=e,this._id=t,this._details=!1,r){var n="";if(void 0===d.find(function(e){return e==this},r)&&(n=r),""!==n)throw new Error("Parameter mimetype is not allowed. Parameter value <'"+JSON.stringify(n)+"'>, mimetype allowed <'"+JSON.stringify(d)+"'>");return this._details=!0,this._setExtraHeaders({accept:r}),this._download()}return this._details=!1,this._setExtraHeaders({accept:void 0}),this._execute()}}]),t}(c.default);r.default=h},{"../GenericFinder":138,"http-status-codes":76,q:117}],150:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../ProvisionGenericFinder"),c=n(s),l=e("q"),f=(n(l),e("http-status-codes")),d=(n(f),function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations","bulk/async","Bulk not found"),this._raw=!1}return o(t,e),a(t,[{key:"findByOrganizationAndId",value:function(e,t,r,n){return this._organization=e,this._id=t,this._setUrlParameters({format:r}),n&&this._setExtraHeaders({accept:n}),this._download(!0)}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/"+this._entity+"/"+this._id}}]),t}(c.default));r.default=d,t.exports=r.default},{"../ProvisionGenericFinder":140,"http-status-codes":76,q:117}],151:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["HARDWARE_RESET","SOFTWARE_RESET","COMMS_DOWN","COMMS_UP","COMMS_RESET"];r.ACTION_ENUM=n},{}],152:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../ProvisionGenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"bundles","bundle","Bundle not found")}return i(t,e),o(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._name+"/versions/"+this._version}},{key:"findByNameAndVersion",value:function(e,t){return this._name=e,this._version=t,this._execute()}}]),t}(s.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":140}],153:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./ACTION_ENUM"),c=e("./deployment/DeploymentElement"),l=n(c),f=e("q"),d=n(f),h=e("../provision/BaseProvision"),p=n(h),y=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/bundles")}return o(t,e),a(t,[{key:"withName",value:function(e){if("string"!=typeof e||e.length>255)throw new Error("OGAPI_NAME_PARAMETER_MAX_LENGTH_255");return this._name=e,this}},{key:"withVersion",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"version"});return this._version=e,this}},{key:"withHardware",value:function(e){if("string"!=typeof e)throw new Error("Parameter hardware must be a string");return this._hardware=e,this}},{key:"withWorkgroup",value:function(e){if("string"!=typeof e)throw new Error("Parameter workgroup must be a string");return this._workgroup=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_250",parameter:"description"});return this._description=e,this}},{key:"withTimeout",value:function(e){if("number"!=typeof e)throw new Error("Parameter ms must be a number");return this._timeout=e,this}},{key:"_checkActions",value:function(e,t){if(void 0===e||e.constructor!==Array)throw new Error("Parameter "+t+" must be typeof Array");for(var r=[],n=0;n<e.length;n++){void 0===s.ACTION_ENUM.find(function(e){return e==this},e[n])&&r.push(e[n])}if(0!==r.length)throw new Error("Any action into parameter "+t+" is not allowed. Parameter value <'"+JSON.stringify(r)+"'>, "+t+" allowed <'"+JSON.stringify(s.ACTION_ENUM)+"'>");return e}},{key:"withPreaction",value:function(e){return this._preaction=this._checkActions(e,"preaction"),this}},{key:"withPostaction",value:function(e){return this._postaction=this._checkActions(e,"postaction"),this}},{key:"withUserNotes",value:function(e){if("string"!=typeof e||e.length>250)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_250",parameter:"notes"});return this._userNotes=e,this}},{key:"withActive",value:function(e){if("boolean"!=typeof e)throw new Error("Parameter active must be a boolean");return this._active=e,this}},{key:"_composeElement",value:function(){if(void 0===this._name||void 0===this._version)throw new Error("Parameters name, version must be defined");return{bundle:{name:this._name||void 0,version:this._version||void 0,hardware:this._hardware||void 0,workgroup:this._workgroup||void 0,description:this._description||void 0,preaction:this._preaction||void 0,postaction:this._postaction||void 0,userNotes:this._userNotes||void 0,active:this._active||void 0}}}},{key:"_buildURL",value:function(){if(void 0===this._name||void 0===this._version)throw new Error("Parameters name, version must be defined");return this._resource+"/"+this._name+"/versions/"+this._version}},{key:"activate",value:function(){var e=d.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),{bundle:{active:!0}},void 0,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:[{code:t.statusCode,message:"OGAPI_BUNDLE_NOT_ACTIVE"}],statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}},{key:"deactivate",value:function(){var e=d.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),{bundle:{active:!1}},void 0,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:[{code:t.statusCode,message:"OGAPI_BUNDLE_NOT_DEACTIVE"}],statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}},{key:"addDeploymentElement",value:function(e){if(void 0===this._name||void 0===this._version)throw new Error("Parameters name, version must be defined");this._deploymentElements||(this._deploymentElements=[]);var t=new l.default(this._parent,this._ogapi,encodeURI(this._buildURL()),e);return this._deploymentElements.push(t),this._deploymentElements[this._deploymentElements.length-1]}},{key:"deployAndActivate",value:function(){var e=this,t=d.default.defer(),r=t.promise;if(e._deploymentElements&&e._deploymentElements.length>0){var n=0,i=0;for(i=0;i<e._deploymentElements.length;i++){var o=0;if(e._deploymentElements[i]._validators&&e._deploymentElements[i]._validators.length>0)for(o=0;o<e._deploymentElements[i]._validators.length;o++)"TRUSTED_BOOT"===e._deploymentElements[i]._validators[o].mode&&(n+=1)}if(n>1)throw new Error("OGAPI_422_ONE_TRUSTED_BOOT_ALLOWED")}e._allPromisesOk=!0;var a=function(r){201===r.statusCode?function(){var n=r;e._deploymentElements&&e._deploymentElements.length>0?function(){var r=[];e._deploymentElements.forEach(function(e){r.push(e.deploy())}),Promise.all(r).then(function(){e._allPromisesOk&&e.activate().then(function(e,r){t.resolve(n)}).catch(function(e){t.reject(e)})}).catch(function(t){e._allPromisesOk=!1,u(t)})}():t.resolve(n)}():u({statusCode:r.statusCode})},u=function(r){e.delete(),t.reject(r)};return e.create().then(a).catch(u),r}},{key:"create",value:function(){var e=this;if(void 0===this._name||void 0===this._version||void 0===this._hardware||void 0===this._workgroup)throw new Error("Parameters name, version, hardware and workgroup must be defined");var r=d.default.defer(),n=r.promise,i=function(e){201===e.statusCode?r.resolve(e):o({statusCode:e.statusCode})},o=function(e){r.reject(e)};return this._ogapi.newBundleFinder().findByNameAndVersion(this._name,this._version).then(function(n){204===n.statusCode?u(Object.getPrototypeOf(t.prototype),"create",e).call(e).then(i).catch(o):r.reject({errors:[{code:204,message:"OGAPI_400_BUNDLE_EXIST"}],statusCode:400})}).catch(function(n){404===n.statusCode?u(Object.getPrototypeOf(t.prototype),"create",e).call(e).then(i).catch(o):r.reject({errors:[{code:204,message:"OGAPI_400_BUNDLE_EXIST"}],statusCode:400})}),n}},{key:"update",value:function(){var e=d.default.defer(),t=e.promise,r=this._composeElement();return delete r.bundle.name,delete r.bundle.version,delete r.bundle.workgroup,delete r.bundle.hardware,this._ogapi.Napi.put(this._buildURL(),r,void 0,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:[{code:t.statusCode,message:"OGAPI_400_BUNDLE_NOT_UPDATED"}],statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(p.default);r.default=y,t.exports=r.default},{"../provision/BaseProvision":235,"./ACTION_ENUM":151,"./deployment/DeploymentElement":154,q:117}],154:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}
|
|
23
|
+
},ie={},oe="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ae="[0-9A-Fa-f]",ue=r(r("%[EFef][0-9A-Fa-f]%"+ae+ae+"%"+ae+ae)+"|"+r("%[89A-Fa-f][0-9A-Fa-f]%"+ae+ae)+"|"+r("%"+ae+ae)),se=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),ce=new RegExp(oe,"g"),le=new RegExp(ue,"g"),fe=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',se),"g"),de=new RegExp(t("[^]",oe,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),he=de,pe={scheme:"mailto",parse:function(e,t){var r=e,n=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var i=!1,o={},a=r.query.split("&"),u=0,s=a.length;u<s;++u){var c=a[u].split("=");switch(c[0]){case"to":for(var l=c[1].split(","),f=0,d=l.length;f<d;++f)n.push(l[f]);break;case"subject":r.subject=D(c[1],t);break;case"body":r.body=D(c[1],t);break;default:i=!0,o[D(c[0],t)]=D(c[1],t)}}i&&(r.headers=o)}r.query=void 0;for(var h=0,p=n.length;h<p;++h){var y=n[h].split("@");if(y[0]=D(y[0]),t.unicodeSupport)y[1]=D(y[1],t).toLowerCase();else try{y[1]=$.toASCII(D(y[1],t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[h]=y.join("@")}return r},serialize:function(e,t){var r=e,n=o(e.to);if(n){for(var a=0,u=n.length;a<u;++a){var s=String(n[a]),c=s.lastIndexOf("@"),l=s.slice(0,c).replace(le,C).replace(le,i).replace(fe,d),f=s.slice(c+1);try{f=t.iri?$.toUnicode(f):$.toASCII(D(f,t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}n[a]=l+"@"+f}r.path=n.join(",")}var h=e.headers=e.headers||{};e.subject&&(h.subject=e.subject),e.body&&(h.body=e.body);var p=[];for(var y in h)h[y]!==ie[y]&&p.push(y.replace(le,C).replace(le,i).replace(de,d)+"="+h[y].replace(le,C).replace(le,i).replace(he,d));return p.length&&(r.query=p.join("&")),r}},ye=/^([^\:]+)\:(.*)/,me={scheme:"urn",parse:function(e,t){var r=e.path&&e.path.match(ye),n=e;if(r){var i=t.scheme||n.scheme||"urn",o=r[1].toLowerCase(),a=r[2],u=i+":"+(t.nid||o),s=K[u];n.nid=o,n.nss=a,n.path=void 0,s&&(n=s.parse(n,t))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,t){var r=t.scheme||e.scheme||"urn",n=e.nid,i=r+":"+(t.nid||n),o=K[i];o&&(e=o.serialize(e,t));var a=e,u=e.nss;return a.path=(n||t.nid)+":"+u,a}},ve=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,_e={scheme:"urn:uuid",parse:function(e,t){var r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&r.uuid.match(ve)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e,t){var r=e;return r.nss=(e.uuid||"").toLowerCase(),r}};K[re.scheme]=re,K[ne.scheme]=ne,K[pe.scheme]=pe,K[me.scheme]=me,K[_e.scheme]=_e,e.SCHEMES=K,e.pctEncChar=d,e.pctDecChars=h,e.parse=_,e.removeDotSegments=b,e.serialize=w,e.resolveComponents=E,e.resolve=A,e.normalize=O,e.equal=S,e.escapeComponent=P,e.unescapeComponent=D,Object.defineProperty(e,"__esModule",{value:!0})})},{}],135:[function(e,t,r){(function(r){"use strict";function n(e){return!e||("utf8"===(e=e.toLowerCase())||"utf-8"===e)}function i(e,t){if(n(t))return encodeURIComponent(e);for(var r=h.encode(e,t),i="",o="",a=0;a<r.length;a++)o=r[a].toString("16"),1===o.length&&(o="0"+o),i+="%"+o;return i=i.toUpperCase()}function o(e,t){if(n(t))return decodeURIComponent(e);for(var i=[],o=0;o<e.length;)"%"===e[o]?(o++,i.push(parseInt(e.substring(o,o+2),16)),o+=2):(i.push(e.charCodeAt(o)),o++);var a=new r(i);return h.decode(a,t)}function a(e,t,r,n){"object"==typeof t&&(n=t,t=null),t=t||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var a=/\+/g;e=e.split(t);var s=1e3,c=null;n&&("number"==typeof n.maxKeys&&(s=n.maxKeys),"string"==typeof n.charset&&(c=n.charset));var l=e.length;s>0&&l>s&&(l=s);for(var f=0;f<l;++f){var d,h,p,y,m=e[f].replace(a,"%20"),v=m.indexOf(r);if(v>=0?(d=m.substr(0,v),h=m.substr(v+1)):(d=m,h=""),d&&d.indexOf("%")>=0)try{p=o(d,c)}catch(e){p=d}else p=d;if(h&&h.indexOf("%")>=0)try{y=o(h,c)}catch(e){y=h}else y=h;u(i,p)?Array.isArray(i[p])?i[p].push(y):i[p]=[i[p],y]:i[p]=y}return i}function u(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function s(e){return/^[\x00-\x7F]*$/.test(e)}function c(e,t){return e=String(e),e=s(e)?encodeURIComponent(e):i(e,t)}function l(e,t,r){if(!t)throw new TypeError("stringify expects an object");return t+"="+c(e,r.charset)}function f(e,t,r){var n=[];if(!t)throw new TypeError("stringify expects an object");for(var i=0;i<e.length;i++)n.push(p(e[i],t+"["+i+"]",r));return n.join("&")}function d(e,t,r){for(var n,o=[],a=Object.keys(e),u=r.charset,s=0,l=a.length;s<l;++s)""!==(n=a[s])&&(null===e[n]?o.push(i(n,u)+"="):o.push(p(e[n],t?t+"["+c(n,u)+"]":c(n,u),r)));return o.join("&")}var h=e("iconv-lite"),p=function(e,t,r){"string"!=typeof t&&(r=t||{},t=null);var n=r.charset||"utf-8";return Array.isArray(e)?f(e,t,r):"[object Object]"==={}.toString.call(e)?d(e,t,r):"string"==typeof e?l(e,t,r):t+"="+c(String(e),n)};t.exports=i,t.exports.encode=i,t.exports.decode=o,t.exports.parse=a,t.exports.stringify=p}).call(this,e("buffer").Buffer)},{buffer:52,"iconv-lite":96}],136:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("q"),c=n(s),l=e("../provision/BaseProvision"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/ai",void 0,["organization","file"],"north/ai"),this._ogapi=e}return o(t,e),a(t,[{key:"_buildURL",value:function(){return this._organization+"/models/"+this._identifier}},{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"identifier"});return this._identifier=e,this}},{key:"withOrganization",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"organization"});return this._organization=e,this}},{key:"withFile",value:function(e){this._file=e}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),this._resource=this._organization+"/models",{modelFile:this._file||void 0}}},{key:"_composeUpdateElement",value:function(){return u(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this)}},{key:"prediction",value:function(e){var t=c.default.defer(),r=t.promise;return this._ogapi.Napi.post(this._buildURL()+"/prediction",e,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then(function(e){t.resolve({statusCode:e.statusCode,body:e.body})}).catch(function(e){t.reject(e)}),r}},{key:"create",value:function(){var e=this._composeElement(),t=c.default.defer();return this._ogapi.Napi.post_multipart(this._resource,{modelFile:e.modelFile},{},this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then(function(e){switch(e.statusCode){case 200:var r=""!=e.text?JSON.parse(e.text):{},n=e.status;t.resolve({data:r,statusCode:n});break;case 201:var n=e.status,i=e.header&&e.header.location;t.resolve({location:i,statusCode:n});break;case 204:t.resolve(e);break;default:t.reject({errors:e.data.errors,statusCode:e.statusCode})}}).catch(function(e){t.reject(e)}),t.promise}},{key:"update",value:function(){var e=this._composeElement(),t=c.default.defer();return this._ogapi.Napi.put_multipart(this._buildURL(),{modelFile:e.modelFile},{},this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then(function(e){switch(e.statusCode){case 200:var r=""!=e.text?JSON.parse(e.text):{},n=e.status;t.resolve({data:r,statusCode:n});break;default:t.reject({errors:e.data.errors,statusCode:e.statusCode})}}).catch(function(e){t.reject(e)}),t.promise}}]),t}(f.default);r.default=d,t.exports=r.default},{"../provision/BaseProvision":235,q:117}],137:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"ai","list","AIModel not found","north")}return i(t,e),o(t,[{key:"findByOrganization",value:function(e){return this._organization=e,this._execute()}},{key:"findByOrganizationAndIdentifier",value:function(e,t){return this._organization=e,this._identifier=t,this._execute()}},{key:"downloadByOrganizationAndIdentifier",value:function(e,t){return this._organization=e,this._identifier=t,this._filename=!0,this._download()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/models"+(this._identifier?"/"+this._identifier+(this._filename?"/file":""):"")}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":138}],138:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("q"),u=n(a),s=e("http-status-codes"),c=n(s),l=function(){function e(t,r,n,o,a){i(this,e),this._api=t.Napi,this._baseUrl=r,this._entity=n,this._error_not_found=o,this._id=void 0,this._headers=void 0,this._urlParameters=void 0,this._serviceBaseURL=a}return o(e,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._id}},{key:"_withId",value:function(e){return this._id=e,this}},{key:"_getExtraHeaders",value:function(){return this._headers}},{key:"_setExtraHeaders",value:function(e){if(this._headers)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._headers[n]=e[n]}else this._headers=e}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this.parameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"_execute",value:function(){var e=u.default.defer(),t=e.promise,r=this._entity,n=this._error_not_found;return this._api.get(this._composeUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters(),!1,this._getServiceBaseURL()).then(function(t){if(204===t.statusCode)e.reject({error:n,statusCode:c.default.NOT_FOUND});else{var i=t.body[r]&&t.body.provision?t.body:t.body[r];e.resolve({data:i||t.body,statusCode:t.statusCode})}}).catch(function(t){400===t.statusCode&&(t.statusCode=c.default.NOT_FOUND),e.reject(t)}),t}},{key:"_downloadUrl",value:function(){return this._composeUrl()}},{key:"_download",value:function(e){var t=u.default.defer(),r=t.promise,n=this._error_not_found;return this._api.get(this._downloadUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters(),!e,this._getServiceBaseURL()).then(function(e){204===e.statusCode?t.reject({data:n,statusCode:c.default.NOT_FOUND}):t.resolve({data:e,statusCode:e.statusCode})}).catch(function(e){t.reject(e)}),r}},{key:"_getServiceBaseURL",value:function(){return this._serviceBaseURL}}]),e}();r.default=l,t.exports=r.default},{"http-status-codes":76,q:117}],139:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("./operations/Operations"),u=n(a),s=e("./users/UserFinder"),c=n(s),l=e("./geocluster/GeoclusterFinder"),f=n(l),d=e("./geocluster/Geocluster"),h=n(d),p=e("./security/Certificates"),y=n(p),m=e("./users/Users"),v=n(m),_=e("./organizations/OrganizationFinder"),g=n(_),b=e("./channels/ChannelFinder"),w=n(b),E=e("./searching/builder/AreasSearchBuilder"),A=n(E),O=e("./searching/builder/DatasetsCatalogSearchBuilder"),S=n(O),P=e("./areas/AreaFinder"),D=n(P),C=e("./searching/builder/BulkSearchBuilder"),k=n(C),T=e("./searching/builder/BulkExecutionSearchBuilder"),F=n(T),j=e("./bulk/BulkFinder"),x=n(j),B=e("./bulk/BulkExecutionFinder"),M=n(B),R=e("./channels/Channels"),I=n(R),N=e("./areas/Areas"),U=n(N),L=e("./datasets/Datasets"),z=n(L),G=e("./timeseries/Timeseries"),q=n(G),V=e("./searching/builder/ChannelsSearchBuilder"),H=n(V),W=e("./rulesConfiguration/RuleConfigurations"),Y=n(W),$=e("./rulesConfiguration/RuleConfigurationsFinder"),K=n($),J=e("./rulesConfiguration/RuleConfigurationsCatalog"),Q=n(J),X=e("./rulesConfiguration/RuleConfigurationsHelper"),Z=n(X),ee=e("./datasets/DatasetFinder"),te=n(ee),re=e("./timeseries/TimeseriesFinder"),ne=n(re),ie=e("./operationTypes/OperationType"),oe=n(ie),ae=e("./operationTypes/OperationTypeFinder"),ue=n(ae),se=e("./operationTypes/OperationTypeCatalog"),ce=n(se),le=e("./security/CertificateFinder"),fe=n(le),de=e("./operations/OperationFinder"),he=n(de),pe=e("./searching/FilterBuilder"),ye=n(pe),me=e("./searching/SelectBuilder"),ve=n(me),_e=e("./operations/OperationActions"),ge=n(_e),be=e("./operations/PeriodicityActions"),we=n(be),Ee=e("./util/Expression"),Ae=n(Ee),Oe=e("./util/SelectElement"),Se=n(Oe),Pe=e("./searching/builder/RawSearchBuilder"),De=n(Pe),Ce=e("./searching/builder/DevicesSearchBuilder"),ke=n(Ce),Te=e("./searching/builder/SubscribersSearchBuilder"),Fe=n(Te),je=e("./searching/builder/SubscriptionsSearchBuilder"),xe=n(je),Be=e("./searching/builder/AssetsSearchBuilder"),Me=n(Be),Re=e("./searching/builder/TicketsSearchBuilder"),Ie=n(Re),Ne=e("./searching/builder/TasksSearchBuilder"),Ue=n(Ne),Le=e("./searching/builder/OperationsSearchBuilder"),ze=n(Le),Ge=e("./searching/builder/ExecutionsSearchBuilder"),qe=n(Ge),Ve=e("./searching/builder/ExecutionsHistorySearchBuilder"),He=n(Ve),We=e("./searching/builder/AlarmsSearchBuilder"),Ye=n(We),$e=e("./searching/builder/DatamodelsSearchBuilder"),Ke=n($e),Je=e("./searching/builder/FeedsSearchBuilder"),Qe=n(Je),Xe=e("./searching/builder/DatastreamsSearchBuilder"),Ze=n(Xe),et=e("./searching/builder/DatapointsSearchBuilder"),tt=n(et),rt=e("./searching/builder/BundlesSearchBuilder"),nt=n(rt),it=e("./searching/builder/CertificatesSearchBuilder"),ot=n(it),at=e("./searching/builder/HardwaresSearchBuilder"),ut=n(at),st=e("./searching/builder/SoftwaresSearchBuilder"),ct=n(st),lt=e("./searching/builder/OperationalStatusSearchBuilder"),ft=n(lt),dt=e("./searching/builder/ServiceGroupSearchBuilder"),ht=n(dt),pt=e("./searching/builder/AdministrativeStateSearchBuilder"),yt=n(pt),mt=e("./searching/builder/CommunicationsModuleTypeSearchBuilder"),vt=n(mt),_t=e("./searching/builder/FieldsDefinitionSearchBuilder"),gt=n(_t),bt=e("./searching/builder/BasicTypesSearchBuilder"),wt=n(bt),Et=e("./searching/builder/MobilePhoneProviderSearchBuilder"),At=n(Et),Ot=e("./searching/builder/IoTDatastreamPeriodSearchBuilder"),St=n(Ot),Pt=e("./searching/builder/ResourceTypeSearchBuilder"),Dt=n(Pt),Ct=e("./searching/builder/AllowedResourceTypeSearchBuilder"),kt=n(Ct),Tt=e("./searching/builder/IoTDatastreamAccessSearchBuilder"),Ft=n(Tt),jt=e("./searching/builder/IoTDatastreamStoragePeriodSearchBuilder"),xt=n(jt),Bt=e("./searching/builder/TicketSeveritySearchBuilder"),Mt=n(Bt),Rt=e("./searching/builder/TicketPrioritySearchBuilder"),It=n(Rt),Nt=e("./searching/builder/TicketStatusSearchBuilder"),Ut=n(Nt),Lt=e("./searching/builder/RulesSearchBuilder"),zt=n(Lt),Gt=e("./searching/builder/OperationTypesSearchBuilder"),qt=n(Gt),Vt=e("./searching/builder/UsersSearchBuilder"),Ht=n(Vt),Wt=e("./searching/builder/DomainsSearchBuilder"),Yt=n(Wt),$t=e("./searching/builder/PlansSearchBuilder"),Kt=n($t),Jt=e("./searching/builder/DevicesPlansSearchBuilder"),Qt=n(Jt),Xt=e("./bundles/Bundles"),Zt=n(Xt),er=e("./bundles/BundleFinder"),tr=n(er),rr=e("./organizations/Organizations"),nr=n(rr),ir=e("./domains/Domains"),or=n(ir),ar=e("./domains/DomainsFinder"),ur=n(ar),sr=e("./entities/DeviceFinder"),cr=n(sr),lr=e("./entities/TicketFinder"),fr=n(lr),dr=e("./entities/SubscriptionsFinder"),hr=n(dr),pr=e("./entities/SubscribersFinder"),yr=n(pr),mr=e("./collection/devices/DeviceMessage"),vr=n(mr),_r=e("./collection/devices/collect/Datastreams"),gr=n(_r),br=e("./collection/devices/collect/Datapoint"),wr=n(br),Er=e("./collection/devices/collect/Hardware"),Ar=n(Er),Or=e("./collection/devices/collect/Software"),Sr=n(Or),Pr=e("./collection/devices/collect/Storage"),Dr=n(Pr),Cr=e("./collection/devices/collect/Usage"),kr=n(Cr),Tr=e("./collection/devices/collect/PowerSupply"),Fr=n(Tr),jr=e("./collection/devices/collect/CommsModuleMessage"),xr=n(jr),Br=e("./collection/devices/collect/Mobile"),Mr=n(Br),Rr=e("./collection/devices/collect/Subscriber"),Ir=n(Rr),Nr=e("./collection/devices/collect/Subscription"),Ur=n(Nr),Lr=e("./workgroups/WorkgroupRelations"),zr=n(Lr),Gr=e("./workgroups/Workgroups"),qr=n(Gr),Vr=e("./workgroups/WorkgroupFinder"),Hr=n(Vr),Wr=e("./searching/builder/WorkgroupsSearchBuilder"),Yr=n(Wr),$r=e("./workgroups/WorkgroupRelationsFinder"),Kr=n($r),Jr=e("./searching/builder/UserProfilesSearchBuilder"),Qr=n(Jr),Xr=e("./iot/datamodels/Datamodels"),Zr=n(Xr),en=e("./iot/datamodels/DatamodelsHelper"),tn=n(en),rn=e("./iot/datamodels/DatamodelsFinder"),nn=n(rn),on=e("./iot/catalog/Datastream"),an=n(on),un=e("./iot/catalog/Qrating"),sn=n(un),cn=e("./provision/entities/EntityBuilder"),ln=n(cn),fn=e("./provision/bulk/BulkExecutionBuilder"),dn=n(fn),hn=e("./searching/builder/EntitiesSearchBuilder"),pn=n(hn),yn=e("./searching/builder/DatasetEntitiesSearchBuilder"),mn=n(yn),vn=e("./searching/builder/DatasetSearchBuilder"),_n=n(vn),gn=e("./searching/builder/TimeserieSearchBuilder"),bn=n(gn),wn=e("./searching/builder/CountryCodesSearchBuilder"),En=n(wn),An=e("./searching/builder/TimezoneSearchBuilder"),On=n(An),Sn=e("./searching/builder/UserLanguagesSearchBuilder"),Pn=n(Sn),Dn=e("./provisionProcessors/provisionProcessors"),Cn=n(Dn),kn=e("./provisionProcessors/provisionProcessorsFinder"),Tn=n(kn),Fn=e("./entities/EntityFinder"),jn=n(Fn),xn=e("./alarms/AlarmActions"),Bn=n(xn),Mn=e("superagent"),Rn=n(Mn),In=e("./connectorsFunctionsConfiguration/ConnectorFunctionsHelper"),Nn=n(In),Un=e("./connectorsFunctionsConfiguration/ConnectorFunctionsFinder"),Ln=n(Un),zn=e("./connectorsFunctionsConfiguration/ConnectorFunctions"),Gn=n(zn),qn=e("./pipelines/PipelineFinder"),Vn=n(qn),Hn=e("./transformers/TransformerFinder"),Wn=n(Hn),Yn=e("./AIModels/AIModelsFinder"),$n=n(Yn),Kn=e("./transformers/Transformers"),Jn=n(Kn),Qn=e("./AIModels/AIModels"),Xn=n(Qn),Zn=e("./pipelines/Pipelines"),ei=n(Zn),ti=e("./manufacturers/Manufacturer"),ri=n(ti),ni=e("./manufacturers/Model"),ii=n(ni),oi=e("./manufacturers/ManufacturerFinder"),ai=n(oi),ui=e("./manufacturers/ModelFinder"),si=n(ui),ci=e("./provision/country/CountriesCatalog"),li=n(ci),fi=function(){var e=void 0,t=Rn.default.Request.prototype.end;return Rn.default.Request.prototype.end=function(r){return e&&e.call&&e(this),t.call(this,function(e,t){"function"==typeof r&&r(e,t)})},function(t){e=t}}(),di=function(){function e(t,r,n){if(i(this,e),this.constructor===e)throw new Error("Cannot construct Abstract instances directly");if("object"!=typeof t)throw new Error("Must instance mandatory parameter: northAmpliaREST");if("object"!=typeof r)throw new Error("Must instance mandatory parameter: southAmpliaREST");n.hooks&&n.hooks.beforeStart&&"function"==typeof n.hooks.beforeStart&&fi(n.hooks.beforeStart),this.Napi=t,this.Sapi=r,this.EX=Ae.default,this.SE=Se.default,this.operations=new u.default(this),this.alarms=new Bn.default(this),this.entityBuilder=new ln.default(this)}return o(e,[{key:"newUserFinder",value:function(){return new c.default(this)}},{key:"newGeoclusterFinder",value:function(){return new f.default(this)}},{key:"geoclusterBuilder",value:function(){return new h.default(this)}},{key:"newOrganizationFinder",value:function(){return new g.default(this)}},{key:"newChannelFinder",value:function(){return new w.default(this)}},{key:"areasSearchBuilder",value:function(){return new A.default(this)}},{key:"datasetsCatalogSearchBuilder",value:function(){return new S.default(this)}},{key:"bulkSearchBuilder",value:function(){return new k.default(this)}},{key:"bulkExecutionSearchBuilder",value:function(){return new F.default(this)}},{key:"newBulkFinder",value:function(){return new x.default(this)}},{key:"newBulkExecutionFinder",value:function(){return new M.default(this)}},{key:"newAreaFinder",value:function(){return new D.default(this)}},{key:"newOperationFinder",value:function(){return new he.default(this)}},{key:"newOperationTypeFinder",value:function(){return new ue.default(this)}},{key:"newOperationTypeCatalog",value:function(){return new ce.default(this)}},{key:"newCountriesCatalog",value:function(){return new li.default(this)}},{key:"operationTypeBuilder",value:function(e,t,r){return new oe.default(this,e,t,r)}},{key:"newRuleConfigurationsFinder",value:function(){return new K.default(this)}},{key:"newRuleConfigurationsHelper",value:function(){return new Z.default(this)}},{key:"newDatasetFinder",value:function(){return new te.default(this)}},{key:"newTimeserieFinder",value:function(){return new ne.default(this)}},{key:"newRuleConfigurationsCatalog",value:function(){return new Q.default(this)}},{key:"ruleConfigurationBuilder",value:function(e,t,r,n){return new Y.default(this,e,t,r,n)}},{key:"newCertificateFinder",value:function(){return new fe.default(this)}},{key:"newDeviceFinder",value:function(){return new cr.default(this)}},{key:"newTicketFinder",value:function(){return new fr.default(this)}},{key:"newSubscriptionsFinder",value:function(){return new hr.default(this)}},{key:"newSubscribersFinder",value:function(){return new yr.default(this)}},{key:"newEntityFinder",value:function(){return new jn.default(this)}},{key:"newFilterBuilder",value:function(){return new ye.default}},{key:"newSelectBuilder",value:function(){return new ve.default}},{key:"rawSearchBuilder",value:function(){return new De.default(this)}},{key:"usersSearchBuilder",value:function(){return new Ht.default(this)}},{key:"domainsSearchBuilder",value:function(){return new Yt.default(this)}},{key:"devicesSearchBuilder",value:function(){return new ke.default(this)}},{key:"assetsSearchBuilder",value:function(){return new Me.default(this)}},{key:"subscribersSearchBuilder",value:function(){return new Fe.default(this)}},{key:"subscriptionsSearchBuilder",value:function(){return new xe.default(this)}},{key:"ticketsSearchBuilder",value:function(){return new Ie.default(this)}},{key:"communicationsModuleTypeSearchBuilder",value:function(){return new vt.default(this)}},{key:"fieldsDefinitionSearchBuilder",value:function(){return new gt.default(this)}},{key:"mobilePhoneProviderSearchBuilder",value:function(){return new At.default(this)}},{key:"ioTDatastreamPeriodSearchBuilder",value:function(){return new St.default(this)}},{key:"resourceTypeSearchBuilder",value:function(){return new Dt.default(this)}},{key:"allowedResourceTypeSearchBuilder",value:function(){return new kt.default(this)}},{key:"ioTDatastreamAccessSearchBuilder",value:function(){return new Ft.default(this)}},{key:"ioTDatastreamStoragePeriodSearchBuilder",value:function(){return new xt.default(this)}},{key:"ticketSeveritySearchBuilder",value:function(){return new Mt.default(this)}},{key:"ticketPrioritySearchBuilder",value:function(){return new It.default(this)}},{key:"ticketStatusSearchBuilder",value:function(){return new Ut.default(this)}},{key:"rulesSearchBuilder",value:function(){return new zt.default(this)}},{key:"operationTypesSearchBuilder",value:function(){return new qt.default(this)}},{key:"tasksSearchBuilder",value:function(){return new Ue.default(this)}},{key:"operationsSearchBuilder",value:function(){return new ze.default(this)}},{key:"executionsSearchBuilder",value:function(){return new qe.default(this)}},{key:"executionsHistorySearchBuilder",value:function(){return new He.default(this)}},{key:"alarmsSearchBuilder",value:function(){return new Ye.default(this)}},{key:"datastreamsSearchBuilder",value:function(){return new Ze.default(this)}},{key:"datamodelsSearchBuilder",value:function(){return new Ke.default(this)}},{key:"feedsSearchBuilder",value:function(){return new Qe.default(this)}},{key:"datapointsSearchBuilder",value:function(){return new tt.default(this)}},{key:"bundlesSearchBuilder",value:function(){return new nt.default(this)}},{key:"certificatesSearchBuilder",value:function(){return new ot.default(this)}},{key:"basicTypesSearchBuilder",value:function(){return new wt.default(this)}},{key:"entitiesSearchBuilder",value:function(){return new pn.default(this)}},{key:"datasetEntitiesSearchBuilder",value:function(e,t){return new mn.default(this,e,t)}},{key:"datasetSearchBuilder",value:function(e,t){return new _n.default(this,e,t)}},{key:"timeserieSearchBuilder",value:function(e,t){return new bn.default(this,e,t)}},{key:"plansSearchBuilder",value:function(){return new Kt.default(this)}},{key:"devicesPlansSearchBuilder",value:function(){return new Qt.default(this)}},{key:"bundlesBuilder",value:function(){return new Zt.default(this)}},{key:"newBundleFinder",value:function(){return new tr.default(this)}},{key:"organizationsBuilder",value:function(){return new nr.default(this)}},{key:"domainsBuilder",value:function(){return new or.default(this)}},{key:"newDomainFinder",value:function(){return new ur.default(this)}},{key:"usersBuilder",value:function(){return new v.default(this)}},{key:"certificatesBuilder",value:function(){return new y.default(this)}},{key:"hardwaresSearchBuilder",value:function(){return new ut.default(this)}},{key:"softwaresSearchBuilder",value:function(){return new ct.default(this)}},{key:"operationalStatusSearchBuilder",value:function(){return new ft.default(this)}},{key:"serviceGroupSearchBuilder",value:function(){return new ht.default(this)}},{key:"administrativeStateSearchBuilder",value:function(){return new yt.default(this)}},{key:"deviceMessageBuilder",value:function(){return new vr.default(this)}},{key:"datastreamBuilder",value:function(){return new gr.default(this)}},{key:"datapointsBuilder",value:function(){return new wr.default(this)}},{key:"hardwareMessageBuilder",value:function(){return new Ar.default(this)}},{key:"softwareMessageBuilder",value:function(){return new Sr.default(this)}},{key:"storageMessageBuilder",value:function(){return new Dr.default(this)}},{key:"usageMessageBuilder",value:function(){return new kr.default(this)}},{key:"powerSupplyMessageBuilder",value:function(){return new Fr.default(this)}},{key:"commsModuleMessageMessageBuilder",value:function(){return new xr.default(this)}},{key:"subscriberMessageBuilder",value:function(){return new Ir.default(this)}},{key:"subscriptionMessageBuilder",value:function(){return new Ur.default(this)}},{key:"mobileMessageMessageBuilder",value:function(){return new Mr.default(this)}},{key:"newOperationActions",value:function(e){return new ge.default(this,e)}},{key:"newPeriodicityActions",value:function(e){return new we.default(this,e)}},{key:"workgroupRelationsBuilder",value:function(){return new zr.default(this)}},{key:"newWorkgroupRelationsFinder",value:function(){return new Kr.default(this)}},{key:"workgroupsBuilder",value:function(){return new qr.default(this)}},{key:"newWorkgroupFinder",value:function(){return new Hr.default(this)}},{key:"workgroupsSearchBuilder",value:function(){return new Yr.default(this)}},{key:"channelsBuilder",value:function(){return new I.default(this)}},{key:"areasBuilder",value:function(){return new U.default(this)}},{key:"datasetsBuilder",value:function(){return new z.default(this)}},{key:"timeseriesBuilder",value:function(){return new q.default(this)}},{key:"channelsSearchBuilder",value:function(){return new H.default(this)}},{key:"userProfilesSearchBuilder",value:function(){return new Qr.default(this)}},{key:"datamodelsBuilder",value:function(e){return new Zr.default(this,e)}},{key:"datamodelsHelper",value:function(e,t){return new tn.default(this,e,t)}},{key:"newDatamodelsFinder",value:function(){return new nn.default(this)}},{key:"datastreamsBuilder",value:function(){return new an.default(this)}},{key:"bulkExecutionBuilder",value:function(e,t,r){return new dn.default(this,e,t,r)}},{key:"qratingsBuilder",value:function(){return new sn.default(this)}},{key:"countryCodesSearchBuilder",value:function(){return new En.default(this)}},{key:"timezoneSearchBuilder",value:function(){return new On.default(this)}},{key:"userLanguagesSearchBuilder",value:function(){return new Pn.default(this)}},{key:"newConnectorFunctionsFinder",value:function(){return new Ln.default(this)}},{key:"newConnectorFunctionsHelper",value:function(){return new Nn.default(this)}},{key:"connectorFunctionsBuilder",value:function(e,t,r,n){return new Gn.default(this,e,t,r,n)}},{key:"provisionProcessorsBuilder",value:function(){return new Cn.default(this)}},{key:"newProvisionProcessorsFinder",value:function(){return new Tn.default(this)}},{key:"newPipelineFinder",value:function(){return new Vn.default(this)}},{key:"newTransformerFinder",value:function(){return new Wn.default(this)}},{key:"newAIModelFinder",value:function(){return new $n.default(this)}},{key:"transformersBuilder",value:function(){return new Jn.default(this)}},{key:"aiModelsBuilder",value:function(){return new Xn.default(this)}},{key:"pipelinesBuilder",value:function(){return new ei.default(this)}},{key:"manufacturersBuilder",value:function(){return new ri.default(this)}},{key:"manufacturerModelsBuilder",value:function(){return new ii.default(this)}},{key:"newManufacturersFinder",value:function(){return new ai.default(this)}},{key:"newModelFinder",value:function(){return new si.default(this)}}]),e}();r.default=di,t.exports=r.default},{"./AIModels/AIModels":136,"./AIModels/AIModelsFinder":137,"./alarms/AlarmActions":141,"./areas/AreaFinder":146,
|
|
24
|
+
"./areas/Areas":147,"./bulk/BulkExecutionFinder":149,"./bulk/BulkFinder":150,"./bundles/BundleFinder":152,"./bundles/Bundles":153,"./channels/ChannelFinder":160,"./channels/Channels":161,"./collection/devices/DeviceMessage":162,"./collection/devices/collect/CommsModuleMessage":163,"./collection/devices/collect/Datapoint":164,"./collection/devices/collect/Datastreams":165,"./collection/devices/collect/Hardware":167,"./collection/devices/collect/Mobile":168,"./collection/devices/collect/PowerSupply":169,"./collection/devices/collect/Software":170,"./collection/devices/collect/Storage":171,"./collection/devices/collect/Subscriber":172,"./collection/devices/collect/Subscription":173,"./collection/devices/collect/Usage":174,"./connectorsFunctionsConfiguration/ConnectorFunctions":183,"./connectorsFunctionsConfiguration/ConnectorFunctionsFinder":184,"./connectorsFunctionsConfiguration/ConnectorFunctionsHelper":185,"./datasets/DatasetFinder":187,"./datasets/Datasets":188,"./domains/Domains":189,"./domains/DomainsFinder":190,"./entities/DeviceFinder":191,"./entities/EntityFinder":192,"./entities/SubscribersFinder":193,"./entities/SubscriptionsFinder":194,"./entities/TicketFinder":195,"./geocluster/Geocluster":196,"./geocluster/GeoclusterFinder":197,"./iot/catalog/Datastream":199,"./iot/catalog/Qrating":200,"./iot/datamodels/Datamodels":201,"./iot/datamodels/DatamodelsFinder":202,"./iot/datamodels/DatamodelsHelper":203,"./manufacturers/Manufacturer":204,"./manufacturers/ManufacturerFinder":205,"./manufacturers/Model":207,"./manufacturers/ModelFinder":208,"./operationTypes/OperationType":210,"./operationTypes/OperationTypeCatalog":211,"./operationTypes/OperationTypeFinder":212,"./operations/OperationActions":213,"./operations/OperationFinder":214,"./operations/Operations":215,"./operations/PeriodicityActions":216,"./organizations/OrganizationFinder":231,"./organizations/Organizations":232,"./pipelines/PipelineFinder":233,"./pipelines/Pipelines":234,"./provision/bulk/BulkExecutionBuilder":236,"./provision/country/CountriesCatalog":237,"./provision/entities/EntityBuilder":243,"./provisionProcessors/provisionProcessors":250,"./provisionProcessors/provisionProcessorsFinder":251,"./rulesConfiguration/RuleConfigurations":252,"./rulesConfiguration/RuleConfigurationsCatalog":253,"./rulesConfiguration/RuleConfigurationsFinder":254,"./rulesConfiguration/RuleConfigurationsHelper":255,"./searching/FilterBuilder":262,"./searching/SelectBuilder":265,"./searching/builder/AdministrativeStateSearchBuilder":268,"./searching/builder/AlarmsSearchBuilder":269,"./searching/builder/AllowedResourceTypeSearchBuilder":270,"./searching/builder/AreasSearchBuilder":271,"./searching/builder/AssetsSearchBuilder":272,"./searching/builder/BasicTypesSearchBuilder":273,"./searching/builder/BulkExecutionSearchBuilder":274,"./searching/builder/BulkSearchBuilder":275,"./searching/builder/BundlesSearchBuilder":276,"./searching/builder/CertificatesSearchBuilder":277,"./searching/builder/ChannelsSearchBuilder":278,"./searching/builder/CommunicationsModuleTypeSearchBuilder":279,"./searching/builder/CountryCodesSearchBuilder":280,"./searching/builder/DatamodelsSearchBuilder":281,"./searching/builder/DatapointsSearchBuilder":282,"./searching/builder/DatasetEntitiesSearchBuilder":283,"./searching/builder/DatasetSearchBuilder":284,"./searching/builder/DatasetsCatalogSearchBuilder":285,"./searching/builder/DatastreamsSearchBuilder":286,"./searching/builder/DevicesPlansSearchBuilder":287,"./searching/builder/DevicesSearchBuilder":288,"./searching/builder/DomainsSearchBuilder":289,"./searching/builder/EntitiesSearchBuilder":290,"./searching/builder/ExecutionsHistorySearchBuilder":291,"./searching/builder/ExecutionsSearchBuilder":292,"./searching/builder/FeedsSearchBuilder":293,"./searching/builder/FieldsDefinitionSearchBuilder":294,"./searching/builder/HardwaresSearchBuilder":296,"./searching/builder/IoTDatastreamAccessSearchBuilder":297,"./searching/builder/IoTDatastreamPeriodSearchBuilder":298,"./searching/builder/IoTDatastreamStoragePeriodSearchBuilder":299,"./searching/builder/MobilePhoneProviderSearchBuilder":300,"./searching/builder/OperationTypesSearchBuilder":301,"./searching/builder/OperationalStatusSearchBuilder":302,"./searching/builder/OperationsSearchBuilder":303,"./searching/builder/PlansSearchBuilder":304,"./searching/builder/RawSearchBuilder":306,"./searching/builder/ResourceTypeSearchBuilder":307,"./searching/builder/RulesSearchBuilder":308,"./searching/builder/ServiceGroupSearchBuilder":311,"./searching/builder/SoftwaresSearchBuilder":312,"./searching/builder/SubscribersSearchBuilder":313,"./searching/builder/SubscriptionsSearchBuilder":314,"./searching/builder/TasksSearchBuilder":315,"./searching/builder/TicketPrioritySearchBuilder":316,"./searching/builder/TicketSeveritySearchBuilder":317,"./searching/builder/TicketStatusSearchBuilder":318,"./searching/builder/TicketsSearchBuilder":319,"./searching/builder/TimeserieSearchBuilder":320,"./searching/builder/TimezoneSearchBuilder":321,"./searching/builder/UserLanguagesSearchBuilder":322,"./searching/builder/UserProfilesSearchBuilder":323,"./searching/builder/UsersSearchBuilder":324,"./searching/builder/WorkgroupsSearchBuilder":325,"./security/CertificateFinder":327,"./security/Certificates":328,"./timeseries/Timeseries":332,"./timeseries/TimeseriesFinder":333,"./transformers/TransformerFinder":334,"./transformers/Transformers":335,"./users/UserFinder":336,"./users/Users":337,"./util/Expression":339,"./util/SelectElement":341,"./workgroups/WorkgroupFinder":347,"./workgroups/WorkgroupRelations":348,"./workgroups/WorkgroupRelationsFinder":349,"./workgroups/Workgroups":350,superagent:128}],140:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("q"),s=(n(u),e("http-status-codes")),c=(n(s),e("./GenericFinder")),l=n(c),f=function(e){function t(e,r,n,o){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provision/"+r,n,o)}return o(t,e),t}(l.default);r.default=f,t.exports=r.default},{"./GenericFinder":138,"http-status-codes":76,q:117}],141:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("./actions/AlarmAttendBuilder"),u=n(a),s=e("./actions/AlarmCloseBuilder"),c=n(s),l=function(){function e(t){i(this,e),this._ogapi=t}return o(e,[{key:"newCloseBuilder",value:function(){return new c.default(this._ogapi)}},{key:"newAttendBuilder",value:function(){return new u.default(this._ogapi)}}]),e}();r.default=l,t.exports=r.default},{"./actions/AlarmAttendBuilder":144,"./actions/AlarmCloseBuilder":145}],142:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("q"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t,r,i){n(this,e),this._ogapi=t,this._resource=r,this._postObj=i}return i(e,[{key:"execute",value:function(){var e=this,t=a.default.defer();return this._ogapi.Napi.post(this._resource,this._postObj).then(function(r){var n=void 0;try{n=JSON.parse(r.text)}catch(t){console.warn("Error parsing response data when execute post action to "+e._resource)}t.resolve({data:n||{},statusCode:r.statusCode,location:r.header.location})}).catch(function(e){e.data||(e.data={}),e.data.errors||(e.data.errors=["string"==typeof e?{message:e}:e]),t.reject(e)}),t.promise}}]),e}();r.default=u,t.exports=r.default},{q:117}],143:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("./Alarm"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t,r){if(n(this,e),this._ogapi=t,this._action=r,this._resource="alarms",this._build={alarms:[],notes:void 0,action:r},this.constructor===e)throw new Error("Cannot construct Abstract instances directly")}return i(e,[{key:"addAlarmId",value:function(e){if("string"!=typeof e)throw new Error("Parameter alarmId must be a string");return this._build.alarms.push(e),this}},{key:"withNotes",value:function(e){if("string"!=typeof e)throw new Error("Parameter notes must be a string");return this._build.notes=e,this}},{key:"build",value:function(){if(0===this._build.alarms.length)throw new Error("Builder error. You must append at least one alarmId with addAlarmId method");return"string"!=typeof this._build.notes&&delete this._build.notes,new a.default(this._ogapi,this._resource,this._build)}}]),e}();r.default=u,t.exports=r.default},{"./Alarm":142}],144:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("./AlarmActionBuilder"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"ATTEND")}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"./AlarmActionBuilder":143}],145:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("./AlarmActionBuilder"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"CLOSE")}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"./AlarmActionBuilder":143}],146:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../ProvisionGenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations","area","Area/s not found")}return i(t,e),o(t,[{key:"findByOrganizationAndIdentifier",value:function(e,t){return this._checkString(e,"organization"),this._checkString(t,"identifier"),this._organization=e,this._identifier=t,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/areas/"+this._identifier}},{key:"_checkString",value:function(e,t){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER")}}]),t}(s.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":140}],147:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./TYPE_ENUM"),c=e("../provision/BaseProvision"),l=n(c),f=e("../util/formats/check_types"),d=n(f),h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations/",void 0,["identifier","organization","type","coordinates"])}return o(t,e),a(t,[{key:"_buildURL",value:function(){return"provision/organizations/"+this._organization+"/areas/"+this._identifier}},{key:"withOrganization",value:function(e){return d.default._checkStringAndLength(e,50,"organization"),this._organization=e,this}},{key:"withIdentifier",value:function(e){return d.default._checkStringAndLength(e,50,"identifier"),this._identifier=e,this}},{key:"withName",value:function(e){return d.default._checkStringAndLength(e,50,"name"),this._name=e,this}},{key:"withColor",value:function(e){return d.default._checkStringAndLength(e,50,"color"),this._color=e,this}},{key:"withDescription",value:function(e){return d.default._checkStringAndLength(e,50,"description"),this._description=e,this}},{key:"withOrder",value:function(e){return d.default._checkNumber(e,"order"),this._order=e,this}},{key:"withGeometry",value:function(e,t){return d.default._checkType(e,s.TYPE_ENUM),d.default._checkArray(t,"coordinates"),this._type=e,this._coordinates=t,this}},{key:"withEntities",value:function(e){return d.default._checkArray(e,"entities"),this._entities=e,this}},{key:"_composeElement",value:function(){return this._resource="provision/organizations/"+this._organization+"/areas/",{identifier:this._identifier,name:this._name,description:this._description,order:this._order,color:this._color,geometry:{type:this._type,coordinates:this._coordinates},entities:this._entities}}},{key:"_composeUpdateElement",value:function(){var e=u(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this);return delete e.identifier,e}}]),t}(l.default);r.default=h,t.exports=r.default},{"../provision/BaseProvision":235,"../util/formats/check_types":343,"./TYPE_ENUM":148}],148:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["Polygon","Point","LineString"];r.TYPE_ENUM=n},{}],149:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../GenericFinder"),c=n(s),l=e("q"),f=(n(l),e("http-status-codes")),d=(n(f),["application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]);r.MIME_TYPES_ENUM=d;var h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provisionProcessors/provision/organizations","value","Bulk not found")}return o(t,e),a(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/bulk/"+this._id+(this._details?"/details":"")}},{key:"findByOrganizationAndId",value:function(e,t,r){if(this._organization=e,this._id=t,this._details=!1,r){var n="";if(void 0===d.find(function(e){return e==this},r)&&(n=r),""!==n)throw new Error("Parameter mimetype is not allowed. Parameter value <'"+JSON.stringify(n)+"'>, mimetype allowed <'"+JSON.stringify(d)+"'>");return this._details=!0,this._setExtraHeaders({accept:r}),this._download()}return this._details=!1,this._setExtraHeaders({accept:void 0}),this._execute()}}]),t}(c.default);r.default=h},{"../GenericFinder":138,"http-status-codes":76,q:117}],150:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../ProvisionGenericFinder"),c=n(s),l=e("q"),f=(n(l),e("http-status-codes")),d=(n(f),function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations","bulk/async","Bulk not found"),this._raw=!1}return o(t,e),a(t,[{key:"findByOrganizationAndId",value:function(e,t,r,n){return this._organization=e,this._id=t,this._setUrlParameters({format:r}),n&&this._setExtraHeaders({accept:n}),this._download(!0)}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/"+this._entity+"/"+this._id}}]),t}(c.default));r.default=d,t.exports=r.default},{"../ProvisionGenericFinder":140,"http-status-codes":76,q:117}],151:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["HARDWARE_RESET","SOFTWARE_RESET","COMMS_DOWN","COMMS_UP","COMMS_RESET"];r.ACTION_ENUM=n},{}],152:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../ProvisionGenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"bundles","bundle","Bundle not found")}return i(t,e),o(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._name+"/versions/"+this._version}},{key:"findByNameAndVersion",value:function(e,t){return this._name=e,this._version=t,this._execute()}}]),t}(s.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":140}],153:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./ACTION_ENUM"),c=e("./deployment/DeploymentElement"),l=n(c),f=e("q"),d=n(f),h=e("../provision/BaseProvision"),p=n(h),y=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/bundles")}return o(t,e),a(t,[{key:"withName",value:function(e){if("string"!=typeof e||e.length>255)throw new Error("OGAPI_NAME_PARAMETER_MAX_LENGTH_255");return this._name=e,this}},{key:"withVersion",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"version"});return this._version=e,this}},{key:"withHardware",value:function(e){if("string"!=typeof e)throw new Error("Parameter hardware must be a string");return this._hardware=e,this}},{key:"withWorkgroup",value:function(e){if("string"!=typeof e)throw new Error("Parameter workgroup must be a string");return this._workgroup=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_250",parameter:"description"});return this._description=e,this}},{key:"withTimeout",value:function(e){if("number"!=typeof e)throw new Error("Parameter ms must be a number");return this._timeout=e,this}},{key:"_checkActions",value:function(e,t){if(void 0===e||e.constructor!==Array)throw new Error("Parameter "+t+" must be typeof Array");for(var r=[],n=0;n<e.length;n++){void 0===s.ACTION_ENUM.find(function(e){return e==this},e[n])&&r.push(e[n])}if(0!==r.length)throw new Error("Any action into parameter "+t+" is not allowed. Parameter value <'"+JSON.stringify(r)+"'>, "+t+" allowed <'"+JSON.stringify(s.ACTION_ENUM)+"'>");return e}},{key:"withPreaction",value:function(e){return this._preaction=this._checkActions(e,"preaction"),this}},{key:"withPostaction",value:function(e){return this._postaction=this._checkActions(e,"postaction"),this}},{key:"withUserNotes",value:function(e){if("string"!=typeof e||e.length>250)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_250",parameter:"notes"});return this._userNotes=e,this}},{key:"withActive",value:function(e){if("boolean"!=typeof e)throw new Error("Parameter active must be a boolean");return this._active=e,this}},{key:"_composeElement",value:function(){if(void 0===this._name||void 0===this._version)throw new Error("Parameters name, version must be defined");return{bundle:{name:this._name||void 0,version:this._version||void 0,hardware:this._hardware||void 0,workgroup:this._workgroup||void 0,description:this._description||void 0,preaction:this._preaction||void 0,postaction:this._postaction||void 0,userNotes:this._userNotes||void 0,active:this._active||void 0}}}},{key:"_buildURL",value:function(){if(void 0===this._name||void 0===this._version)throw new Error("Parameters name, version must be defined");return this._resource+"/"+this._name+"/versions/"+this._version}},{key:"activate",value:function(){var e=d.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),{bundle:{active:!0}},void 0,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:[{code:t.statusCode,message:"OGAPI_BUNDLE_NOT_ACTIVE"}],statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}},{key:"deactivate",value:function(){var e=d.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),{bundle:{active:!1}},void 0,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:[{code:t.statusCode,message:"OGAPI_BUNDLE_NOT_DEACTIVE"}],statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}},{key:"addDeploymentElement",value:function(e){if(void 0===this._name||void 0===this._version)throw new Error("Parameters name, version must be defined");this._deploymentElements||(this._deploymentElements=[]);var t=new l.default(this._parent,this._ogapi,encodeURI(this._buildURL()),e);return this._deploymentElements.push(t),this._deploymentElements[this._deploymentElements.length-1]}},{key:"deployAndActivate",value:function(){var e=this,t=d.default.defer(),r=t.promise;if(e._deploymentElements&&e._deploymentElements.length>0){var n=0,i=0;for(i=0;i<e._deploymentElements.length;i++){var o=0;if(e._deploymentElements[i]._validators&&e._deploymentElements[i]._validators.length>0)for(o=0;o<e._deploymentElements[i]._validators.length;o++)"TRUSTED_BOOT"===e._deploymentElements[i]._validators[o].mode&&(n+=1)}if(n>1)throw new Error("OGAPI_422_ONE_TRUSTED_BOOT_ALLOWED")}e._allPromisesOk=!0;var a=function(r){201===r.statusCode?function(){var n=r;e._deploymentElements&&e._deploymentElements.length>0?function(){var r=[];e._deploymentElements.forEach(function(e){r.push(e.deploy())}),Promise.all(r).then(function(){e._allPromisesOk&&e.activate().then(function(e,r){t.resolve(n)}).catch(function(e){t.reject(e)})}).catch(function(t){e._allPromisesOk=!1,u(t)})}():t.resolve(n)}():u({statusCode:r.statusCode})},u=function(r){e.delete(),t.reject(r)};return e.create().then(a).catch(u),r}},{key:"create",value:function(){var e=this;if(void 0===this._name||void 0===this._version||void 0===this._hardware||void 0===this._workgroup)throw new Error("Parameters name, version, hardware and workgroup must be defined");var r=d.default.defer(),n=r.promise,i=function(e){201===e.statusCode?r.resolve(e):o({statusCode:e.statusCode})},o=function(e){r.reject(e)};return this._ogapi.newBundleFinder().findByNameAndVersion(this._name,this._version).then(function(n){204===n.statusCode?u(Object.getPrototypeOf(t.prototype),"create",e).call(e).then(i).catch(o):r.reject({errors:[{code:204,message:"OGAPI_400_BUNDLE_EXIST"}],statusCode:400})}).catch(function(n){404===n.statusCode?u(Object.getPrototypeOf(t.prototype),"create",e).call(e).then(i).catch(o):r.reject({errors:[{code:204,message:"OGAPI_400_BUNDLE_EXIST"}],statusCode:400})}),n}},{key:"update",value:function(){var e=d.default.defer(),t=e.promise,r=this._composeElement();return delete r.bundle.name,delete r.bundle.version,delete r.bundle.workgroup,delete r.bundle.hardware,this._ogapi.Napi.put(this._buildURL(),r,void 0,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:[{code:t.statusCode,message:"OGAPI_400_BUNDLE_NOT_UPDATED"}],statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(p.default);r.default=y,t.exports=r.default},{"../provision/BaseProvision":235,"./ACTION_ENUM":151,"./deployment/DeploymentElement":154,q:117}],154:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}
|
|
25
25
|
},s=e("./OPERATION_ENUM"),c=e("./OPTION_ENUM"),l=e("./TYPE_ENUM"),f=e("./TYPE_VALIDATORS_ENUM"),d=e("./MODE_VALIDATORS_ENUM"),h=e("q"),p=n(h),y=e("../../provision/BaseProvision"),m=n(y),v=function(e){function t(e,r,n,o){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,r,n+"/deploymentElements"),this._progressEvent=o,this._resource=n+"/deploymentElements",this.validation=!1,this._name=void 0,this._version=void 0,this._type=void 0,this._path=void 0,this._order=void 0,this._operation=void 0,this._option=void 0,this._fileName=void 0,this._downloadUrl=void 0,this._validators=void 0,this._oldName=void 0,this._oldVersion=void 0,this._oldPath=void 0}return o(t,e),a(t,[{key:"withName",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"name"});return this._name=e,this}},{key:"withVersion",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"version"});return this._version=e,this}},{key:"withType",value:function(e){if(void 0===e||"string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"type"});var t="";if(void 0===l.TYPE_ENUM.find(function(e){return e==this},e)&&(t=e),""!==t)throw new Error({message:"OGAPI_NOT_ALLOWED_PARAMETER",parameter:JSON.stringify(t),allowed:JSON.stringify(l.TYPE_ENUM)});return this._type=e,this}},{key:"withPath",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"path"});return this._path=e,this}},{key:"withOrder",value:function(e){return this._order=e,this}},{key:"withOperation",value:function(e){if(void 0===e||"string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"operation"});var t="";if(void 0===s.OPERATION_ENUM.find(function(e){return e==this},e)&&(t=e),""!==t)throw new Error("Parameter operation is not allowed. Parameter value <'"+JSON.stringify(t)+"'>, operation allowed <'"+JSON.stringify(s.OPERATION_ENUM)+"'>");return this._operation=e,this}},{key:"withOption",value:function(e){if(void 0===e||"string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"option"});var t="";if(void 0===c.OPTION_ENUM.find(function(e){return e==this},e)&&(t=e),""!==t)throw new Error("Parameter option is not allowed. Parameter value <'"+JSON.stringify(t)+"'>, option allowed <'"+JSON.stringify(c.OPTION_ENUM)+"'>");return this._option=e,this}},{key:"withValidators",value:function(e){var t={},r=[];if(void 0===e||e.constructor!==Array)throw new Error("Parameter validators must be typeof Array");for(var n=!1,i=0;i<e.length;i++){if(t=this._checkValidator(e[i]),"TRUSTED_BOOT"===t.mode){if(n)throw new Error("OGAPI_422_ONE_TRUSTED_BOOT_ALLOWED_DEPLOY_ELEMENT");n=!0}r.push(t)}return this._validators=r,this}},{key:"_checkValidator",value:function(e){var t={};if(e.mode){var r="",n=e.mode;if(void 0===n||"string"!=typeof n)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"type"});if(void 0===d.MODE_VALIDATORS_ENUM.find(function(e){return e==this},n)&&(r=n),""!==r)throw new Error("Parameter type is not allowed. Parameter value <'"+JSON.stringify(r)+"'>, type allowed <'"+JSON.stringify(d.MODE_VALIDATORS_ENUM)+"'>");if("TRUSTED_BOOT"===n&&("TRUSTED_BOOT"!==n||"FIRMWARE"!==this._type))throw new Error("TRUSTED_BOOT validator only allowed for FIRMWARE deployment element");t.mode=n}else t.mode=d.MODE_VALIDATORS_ENUM[0];if(!e.type)throw new Error("Parameter type is required");var r="",i=e.type;if(void 0===i||"string"!=typeof i)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"type"});if(void 0===f.TYPE_VALIDATORS_ENUM.find(function(e){return e==this},i)&&(r=i),""!==r)throw new Error("Parameter type is not allowed. Parameter value <'"+JSON.stringify(r)+"'>, type allowed <'"+JSON.stringify(f.TYPE_VALIDATORS_ENUM)+"'>");if(t.type=i,t.mode===d.MODE_VALIDATORS_ENUM[0]){if(!e.value)throw new Error("Parameter value is required when mode is "+d.MODE_VALIDATORS_ENUM[0]);var o=e.value;if("string"!=typeof o)throw new Error("Parameter value must be a string");t.value=o}return t}},{key:"withDownloadUrl",value:function(e){if("string"!=typeof e)throw new Error("Parameter downloadUrl must be a string");return this._downloadUrl=e,this}},{key:"withFileName",value:function(e){if("string"!=typeof e)throw new Error("Parameter fileName must be a string");return this._fileName=e,this}},{key:"withValidation",value:function(e){if("boolean"!=typeof e)throw new Error("Parameter validation must be a boolean");return this.validation=e,this}},{key:"withOldName",value:function(e){if("string"!=typeof e)throw new Error("Parameter old name must be a string");return this._oldName=e,this}},{key:"withOldVersion",value:function(e){if("string"!=typeof e)throw new Error("Parameter old version must be a string");return this._oldVersion=e,this}},{key:"withOldPath",value:function(e){if("string"!=typeof e)throw new Error("Parameter old path must be a string");return this._oldPath=e,this}},{key:"withFile",value:function(e){return this._rawFile=e,this}},{key:"_composeUrlCreate",value:function(){if(void 0===this._name||void 0===this._version||""===this._name||""===this._version)throw new Error("Method not allowed - You must to define the name and version");return this._setUrlParameters({fileValidationRequired:this.validation}),this._resource}},{key:"_composeElement",value:function(){if("UPGRADE"===this._operation){if(void 0===this._name||void 0===this._version||void 0===this._type||void 0===this._path||void 0===this._order||void 0===this._operation||void 0===this._oldName||void 0===this._oldVersion||void 0===this._oldPath)throw new Error("Method not allowed - You must define the basic element [name, version, type, path, order, operation, oldName, oldVersion and oldPath ]")}else if(void 0===this._name||void 0===this._version||void 0===this._type||void 0===this._path||void 0===this._order||void 0===this._operation||void 0===this._option)throw new Error("Method not allowed - You must define the basic element [name, version, type, path, order, option and operation]");return{deploymentElement:{name:this._name||void 0,version:this._version||void 0,type:this._type||void 0,path:this._path||void 0,order:this._order||void 0,operation:this._operation||void 0,option:this._option||void 0,fileName:this._fileName||void 0,downloadUrl:this._downloadUrl||void 0,validators:this._validators||void 0,oldName:this._oldName||void 0,oldVersion:this._oldVersion||void 0,oldPath:this._oldPath||void 0}}}},{key:"withTimeout",value:function(e){if("number"!=typeof e)throw new Error("Parameter ms must be a number");return this._timeout=e,this}},{key:"_buildURL",value:function(){if(void 0===this._name||void 0===this._version)throw new Error("Parameters name, version must be defined");return this._resource+"/"+this._name+"/version/"+this._version}},{key:"createWithFile",value:function(e){var t=void 0;if("string"!=typeof e){t=new FormData;var r=new Blob([JSON.stringify(this._composeElement())],{type:"application/octet-stream"});t.append("meta",r),e&&t.append("file",e)}else t={},t.meta=JSON.stringify(this._composeElement()),e&&(t.file=e);var n={};void 0!=this._progressEvent&&(n={progress:this._progressEvent});var i=p.default.defer(),o=i.promise;return this._ogapi.Napi.post_multipart(this._composeUrlCreate(),t,n,this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(e){201===e.statusCode?i.resolve({location:e.header.location,statusCode:e.statusCode}):i.reject({errors:[{code:e.statusCode,message:"OGAPI_FILE_NOT_CREATE"}],statusCode:e.statusCode})}).catch(function(e){i.reject(e)}),o}},{key:"deploy",value:function(){return this.createWithFile(this._rawFile)}},{key:"update",value:function(){throw new Error("OGAPI_DEPLOYMENT_ELEMENT_NOT_UPDATED")}}]),t}(m.default);r.default=v,t.exports=r.default},{"../../provision/BaseProvision":235,"./MODE_VALIDATORS_ENUM":155,"./OPERATION_ENUM":156,"./OPTION_ENUM":157,"./TYPE_ENUM":158,"./TYPE_VALIDATORS_ENUM":159,q:117}],155:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["PLATFORM","TRUSTED_BOOT"];r.MODE_VALIDATORS_ENUM=n},{}],156:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["INSTALL","UNINSTALL","UPGRADE"];r.OPERATION_ENUM=n},{}],157:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["MANDATORY","OPTIONAL"];r.OPTION_ENUM=n},{}],158:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["SOFTWARE","FIRMWARE","CONFIGURATION","PARAMETERS"];r.TYPE_ENUM=n},{}],159:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["MD2","MD5","SHA-1","SHA-256","SHA-384","SHA-512","CERTIFICATE_SIGN"];r.TYPE_VALIDATORS_ENUM=n},{}],160:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../ProvisionGenericFinder"),c=n(s),l=e("q"),f=n(l),d=e("http-status-codes"),h=n(d),p=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations","channel","Channel not found")}return o(t,e),a(t,[{key:"findByOrganizationAndName",value:function(e,t){return this._organization=e,this._name=t,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/channels/"+this._name}},{key:"findByDomainAndWorkgroup",value:function(e,t){this._domain=e,this._workgroup=t;var r=this._error_not_found,n=f.default.defer(),i=n.promise;return this._executeWorkgroupRelation().then(function(e){if(204===e.statusCode)n.reject({data:r,statusCode:h.default.NO_CONTENT});else{var t=e.data,i=[];for(var o in t.channels)i.push({organization:t.channels[o].organization,name:t.channels[o].channel});n.resolve({data:i,statusCode:e.statusCode})}}).catch(function(e){n.reject(e)}),i}},{key:"findByDomainAndWorkgroupAndOrganization",value:function(e,t,r){var n=this;n._domain=e,n._workgroup=t,n._organization=r;var i=n._error_not_found,o=f.default.defer(),a=o.promise;return n._executeWorkgroupRelation().then(function(e){if(204===e.statusCode)o.reject({data:i,statusCode:h.default.NOT_FOUND});else{var t=e.data,r=[];for(var a in t.channels)n._organization===t.channels[a].organization&&r.push({organization:t.channels[a].organization,name:t.channels[a].channel});r.length>0?o.resolve({data:r,statusCode:e.statusCode}):o.reject({data:i,statusCode:h.default.NOT_FOUND})}}).catch(function(e){o.reject(e)}),a}},{key:"_executeWorkgroupRelation",value:function(){var e="provision/domains/"+this._domain+"/workgroups/"+this._workgroup+"/relations",t=f.default.defer(),r=t.promise,n=this._error_not_found;return this._api.get(e,void 0,this._getExtraHeaders(),this._getUrlParameters()).then(function(e){204===e.statusCode?t.reject({data:n,statusCode:h.default.NOT_FOUND}):t.resolve({data:e.body.workgroupRelation,statusCode:e.statusCode})}).catch(function(e){t.reject(e)}),r}}]),t}(c.default);r.default=p,t.exports=r.default},{"../ProvisionGenericFinder":140,"http-status-codes":76,q:117}],161:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("q"),c=(n(s),e("../provision/BaseProvision")),l=n(c),f=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations",void 0,["name","organization"]),this._ogapi=e}return o(t,e),a(t,[{key:"_buildURL",value:function(){return"provision/organizations/"+this._organization+"/channels/"+this._name}},{key:"withName",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"name"});return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_250",parameter:"description"});return this._description=e,this}},{key:"withOrganization",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"organization"});return this._organization=e,this}},{key:"withCertificate",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"certificate"});return this._certificates||(this._certificates=[]),this._certificates.push(e),this}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),this._resource="provision/organizations/"+this._organization+"/channels",{channel:{name:this._name||void 0,description:this._description||void 0,certificates:this._certificates||void 0}}}},{key:"_composeUpdateElement",value:function(){var e=u(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this);return delete e.channel.name,e}}]),t}(l.default);r.default=f,t.exports=r.default},{"../provision/BaseProvision":235,q:117}],162:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("q"),c=n(s),l=e("./collect/Event"),f=n(l),d=e("../devices/collect/Datastreams"),h=n(d),p=function(e){function t(e,r,n){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this._ogapi=e,this._resource="devices",this._iotMessage=void 0,this._dmmMessage=void 0,this._id=void 0,this._version=void 0,this._dataStreamVersion=void 0,this._deviceId=void 0,this._datastreams=[]}return o(t,e),a(t,[{key:"withId",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"id"});return this._id=e,this}},{key:"withDataStreamVersion",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"version"});return this._dataStreamVersion=e,this}},{key:"withDmmVersion",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"version"});return this._version=e,this}},{key:"withDeviceId",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"device"});return this._deviceId=e,this}},{key:"withDataStream",value:function(e){return e instanceof h.default&&this._datastreams.push(e.composeElement()),this}},{key:"_buildIotURL",value:function(){if(void 0===this._id)throw new Error("Parameters id must be defined");return this._resource+"/"+this._id+"/collect/iot"}},{key:"_buildDmmURL",value:function(){if(void 0===this._id)throw new Error("Parameters id must be defined");return this._resource+"/"+this._id+"/collect/dmm"}},{key:"_composeIotMessage",value:function(){if(void 0===this._datastreams||void 0===this._dataStreamVersion)throw new Error("Parameters datastreams and version must be defined");return{version:this._dataStreamVersion,device:this._deviceId,datastreams:this._datastreams}}},{key:"_composeDmmMessage",value:function(){if(void 0===this._version)throw new Error("Parameters id must be defined");var e=u(Object.getPrototypeOf(t.prototype),"composeElement",this).call(this);return{version:this._version,event:e}}},{key:"create",value:function(){var e=c.default.defer(),t=e.promise,r=[];return this._datastreams.length>0&&r.push(this._ogapi.Sapi.post(this._buildIotURL(),this._composeIotMessage()).then(function(e){if(201!==e.statusCode)throw new Error("IOT NOT CREATED")})),void 0!==this._version&&r.push(this._ogapi.Sapi.post(this._buildDmmURL(),this._composeDmmMessage()).then(function(e){if(201!==e.statusCode)throw new Error("DMM NOT CREATED")})),c.default.all(r).catch(function(t){e.reject({errors:t,statusCode:400})}).done(function(t){e.resolve({statusCode:201})}),t}}]),t}(f.default);r.default=p,t.exports=r.default},{"../devices/collect/Datastreams":165,"./collect/Event":166,q:117}],163:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("./enum/ANTENNA_STATUS_ENUM"),u=e("./Hardware"),s=n(u),c=e("./Software"),l=n(c),f=e("./Mobile"),d=n(f),h=e("./Subscriber"),p=n(h),y=e("./Subscription"),m=n(y),v=function(){function e(t){i(this,e),this._ogapi=t,this._id=void 0,this._name=void 0,this._type=void 0,this._hardware=void 0,this._operationalStatus=void 0,this._antennaStatus=void 0,this._softwareList=[],this._mobile=void 0,this._subscriber=void 0,this._subscription=void 0}return o(e,[{key:"withId",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"id"});return this._id=e,this}},{key:"withName",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"name"});return this._name=e,this}},{key:"withType",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"type"});return this._type=e,this}},{key:"withHardware",value:function(e){if(!(e instanceof s.default))throw new Error("Parameter hardware must be hardware type");return this._hardware=e,this}},{key:"withOperationalStatus",value:function(e){return this._ogapi.operationalStatusSearchBuilder().withEntityType("COMMUNICATIONS_MODULE").withId(e).build().execute().then(function(e){if(204===e.statusCode)throw new Error("Operational Status not found")}),this._operationalStatus=e,this}},{key:"withAntennaStatus",value:function(e){if("string"!=typeof e)throw new Error("Parameter antennaStatus must be a string");return this._antennaStatus=this._checkValues(e,a.ANTENNA_STATUS_ENUM),this}},{key:"withSoftware",value:function(e){if(!(e instanceof l.default))throw new Error("Parameter software must be software type");return this._softwareList.push(e.composeElement()),this}},{key:"withMobile",value:function(e){if(!(e instanceof d.default))throw new Error("Parameter mobile must be Mobile type");return this._mobile=e,this}},{key:"withSubscriber",value:function(e){if(!(e instanceof p.default))throw new Error("Parameter subscriber must be Subscriber type");return this._subscriber=e,this}},{key:"withSubscription",value:function(e){if(!(e instanceof m.default))throw new Error("Parameter subscription must be Subscription type");return this._subscription=e,this}},{key:"_checkValues",value:function(e,t){var r=[];return void 0===t.find(function(e){return e==this},e)&&r.push(e),0!==r.length&&console.warn("Parameter value not allowed <'"+JSON.stringify(r)+"'>, allowed <'"+JSON.stringify(t)+"'>"),e}},{key:"composeElement",value:function(){var e={id:this._id,name:this._name,type:this._type,hardware:this._hardware.composeElement(),operationalStatus:this._operationalStatus,antennaStatus:this._antennaStatus};return this._softwareList.length>0&&(e.softwareList=this._softwareList),void 0!==this._mobile&&(e.mobile=this._mobile.composeElement()),void 0!==this._subscriber&&(e.subscriber=this._subscriber.composeElement()),void 0!==this._subscription&&(e.subscription=this._subscription.composeElement()),e}}]),e}();r.default=v,t.exports=r.default},{"./Hardware":167,"./Mobile":168,"./Software":170,"./Subscriber":172,"./Subscription":173,"./enum/ANTENNA_STATUS_ENUM":176}],164:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(){function e(){n(this,e),this._from=void 0,this._at=void 0,this._value=void 0,this._tags=void 0}return i(e,[{key:"withFrom",value:function(e){if(null!==e){if("number"!=typeof e)throw new Error("OGAPI_MUST_BE_NUMBER_PARAMETER");this._from=e}return this}},{key:"withAt",value:function(e){if(null!==e){if("number"!=typeof e)throw new Error("OGAPI_MUST_BE_NUMBER_PARAMETER");this._at=e}return this}},{key:"withValue",value:function(e){if(void 0===e||0===e.length)throw new Error("OGAPI_DEFINED_PARAMETER");return this._value=e,this}},{key:"withTags",value:function(e){if(null!==e){if(e.constructor!==Array||0===e.length)throw new Error({message:"OGAPI_ARRAY_PARAMETER",parameter:"tags"});this._tags=e}return this}},{key:"composeElement",value:function(){if(void 0===this._value||0===this._value.length)throw new Error({message:"OGAPI_DEFINED_PARAMETER",parameter:"value"});return{from:this._from||void 0,at:this._at||void 0,value:this._value,tags:this._tags||void 0}}}]),e}();r.default=o,t.exports=r.default},{}],165:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("./Datapoint"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(){n(this,e),this._id=void 0,this._feed=void 0,this._datapoints=[]}return i(e,[{key:"withId",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER_ID");return this._id=e,this}},{key:"withFeed",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER_FEED");return this._feed=e,this}},{key:"withDatapoint",value:function(e){if(!(e instanceof a.default))throw new Error("OGAPI_PARAMETER_DATAPOINT");return this._datapoints.push(e.composeElement()),this}},{key:"composeElement",value:function(){if(void 0===this._id||0===this._id.length||0===this._datapoints.length)throw new Error("Parameter id must be defined and dapoint list must have at least one element");return{id:this._id,feed:this._feed,datapoints:this._datapoints}}}]),e}();r.default=u,t.exports=r.default},{"./Datapoint":164}],166:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("q"),u=(n(a),e("./Hardware")),s=n(u),c=e("./Software"),l=n(c),f=e("./Usage"),d=n(f),h=e("./Storage"),p=n(h),y=e("./PowerSupply"),m=n(y),v=e("./CommsModuleMessage"),_=n(v),g=e("./enum/TEMPERATURE_STATUS_ENUM"),b=e("./enum/LEVEL_TREND_ENUM"),w=function(){function e(t){i(this,e),this._ogapi=t,this._event_id=void 0,this._deviceId=void 0,this._path=void 0,this._name=void 0,this._description=void 0,this._hardware=void 0,this._operationalStatus=void 0,this._softwareList=[],this._location=void 0,this._temperature=void 0,this._cpuUsage=void 0,this._ram=void 0,this._volatilStorage=void 0,this._nonVolatilStorage=void 0,this._powerSupply=void 0,this._upTime=void 0,this._communicationsModulesList=[]}return o(e,[{key:"withEventId",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"EventId"});return this._event_id=e,this}},{key:"withDeviceId",value:function(e){if("string"!=typeof e)throw new Error("deviceId cannot be empty");return this._deviceId=e,this}},{key:"withPath",value:function(e){if(e.constructor!==Array||0===e.length)throw new Error("Parameter path must be an Array and cannot be empty");return this._path=e,this}},{key:"withEventName",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter name must be String type and cannot be empty");return this._name=e,this}},{key:"withEventDescription",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter description must be String type and cannot be empty");return this._description=e,this}},{key:"withHardware",value:function(e){if(!(e instanceof s.default))throw new Error("Parameter hardware must be Hardware type");return this._hardware=e,this}},{key:"withOperationalStatus",value:function(e){return this._ogapi.operationalStatusSearchBuilder().withEntityType("ASSET").withId(e).build().execute().then(function(e){if(204===e.statusCode)throw new Error("Operational Status not found")}),this._operationalStatus=e,this}},{key:"withSoftware",value:function(e){if(!(e instanceof l.default))throw new Error("Parameter software must be software type");return this._softwareList.push(e.composeElement()),this}},{key:"withDateLocation",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter date must be String type and cannot be empty");return void 0===this._location&&(this._location={coordinates:{}}),this._location.timestamp=e,this}},{key:"withLatitude",value:function(e){if("number"!=typeof e||0===e.length)throw new Error("Parameter latitude must be number type and cannot be empty");return void 0===this._location&&(this._location={coordinates:{}}),this._location.coordinates.latitude=e,this}},{key:"withLongitude",value:function(e){if("number"!=typeof e||0===e.length)throw new Error("Parameter longitude must be number type and cannot be empty");return void 0===this._location&&(this._location={coordinates:{}}),this._location.coordinates.longitude=e,this}},{key:"withCurrentTemperature",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter currentTemperature must be string type and cannot be empty");return void 0===this._temperature&&(this._temperature={}),this._temperature.current=e,this}},{key:"withUnitTemperature",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter unitTemperature must be string type and cannot be empty");return void 0===this._temperature&&(this._temperature={}),this._temperature.unit=e,this}},{key:"withStatusTemperature",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter unitTemperature must be string type and cannot be empty");return void 0===this._temperature&&(this._temperature={}),this._temperature.status=this._checkValues(e,g.TEMPERATURE_STATUS_ENUM),this}},{key:"withTrendTemperature",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter unitTemperature must be string type and cannot be empty");return void 0===this._temperature&&(this._temperature={}),this._temperature.trend=this._checkValues(e,b.LEVEL_TREND_ENUM),this}},{key:"withTemperatureAverage",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter averageTemperature must be string type and cannot be empty");return void 0===this._temperature&&(this._temperature={}),this._temperature.average=e,this}},{key:"withMinimumTemperature",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter minimumTemperature must be string type and cannot be empty");return void 0===this._temperature&&(this._temperature={}),this._temperature.minimum=e,this}},{key:"withMaximumTemperature",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter maximumTemperature must be string type and cannot be empty");return void 0===this._temperature&&(this._temperature={}),this._temperature.maximum=e,this}},{key:"withCpuUsage",value:function(e){if(!(e instanceof d.default))throw new Error("Parameter cpuUsage must be Usage type");return this._cpuUsage=e,this}},{key:"withRam",value:function(e){if(!(e instanceof p.default))throw new Error("Parameter ram must be Storage type");return this._ram=e,this}},{key:"withVolatilStorage",value:function(e){if(!(e instanceof p.default))throw new Error("Parameter volatilStorage must be Storage type");return this._volatilStorage=e,this}},{key:"withNonVolatilStorage",value:function(e){if(!(e instanceof p.default))throw new Error("Parameter nonVolatilStorage must be Storage type");return this._nonVolatilStorage=e,this}},{key:"withPowerSupply",value:function(e){if(!(e instanceof m.default))throw new Error("Parameter powerSupply must be PowerSupply type");return this._powerSupply=e,this}},{key:"withCommsModule",value:function(e){if(!(e instanceof _.default))throw new Error("Parameter communicationsModules must be CommsModuleMessage type");return this._communicationsModulesList.push(e.composeElement()),this}},{key:"withUpTime",value:function(e){if("number"!=typeof e||0===e.length)throw new Error("Parameter upTime must be number type and cannot be empty");return this._upTime=e,this}},{key:"_checkValues",value:function(e,t){var r=[];return void 0===t.find(function(e){return e==this},e)&&r.push(e),
|
|
26
26
|
0!==r.length&&console.warn("Parameter value not allowed <'"+JSON.stringify(r)+"'>, allowed <'"+JSON.stringify(t)+"'>"),e}},{key:"composeElement",value:function(){var e={id:this._event_id,device:{id:this._deviceId,path:this._path,name:this._name,description:this._description,operationalStatus:this._operationalStatus}};return void 0!==this._hardware&&(e.device.hardware=this._hardware.composeElement()),this._softwareList.length>0&&(e.device.softwareList=this._softwareList),void 0!==this._location&&(e.device.location=this._location),void 0!==this._temperature&&(e.device.temperature=this._temperature),void 0!==this._cpuUsage&&(e.device.cpuUsage=this._cpuUsage.composeElement()),void 0!==this._ram&&(e.device.ram=this._ram.composeElement()),void 0!==this._volatilStorage&&(e.device.volatilStorage=this._volatilStorage.composeElement()),void 0!==this._nonVolatilStorage&&(e.device.nonVolatilStorage=this._nonVolatilStorage.composeElement()),void 0!==this._powerSupply&&(e.device.powerSupply=this._powerSupply.composeElement()),this._communicationsModulesList.length>0&&(e.device.communicationsModules=this._communicationsModulesList),void 0!==this._upTime&&(e.device.upTime=this._upTime),e}}]),e}();r.default=w,t.exports=r.default},{"./CommsModuleMessage":163,"./Hardware":167,"./PowerSupply":169,"./Software":170,"./Storage":171,"./Usage":174,"./enum/LEVEL_TREND_ENUM":179,"./enum/TEMPERATURE_STATUS_ENUM":182,q:117}],167:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(){function e(){n(this,e),this._serialnumber=void 0,this._manufacturerName=void 0,this._manufacturerOui=void 0,this._modelName=void 0,this._modelVersion=void 0,this._clockDate=void 0}return i(e,[{key:"withSerialnumber",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter serial number must be a string and cannot be empty");return this._serialnumber=e,this}},{key:"withManufacturerName",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter manufacturer Name must be a string and cannot be empty");return this._manufacturerName=e,this}},{key:"withManufacturerOui",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter manufacturer code must be a string and cannot be empty");return this._manufacturerOui=e,this}},{key:"withModelName",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter model Name must be a string and cannot be empty");return this._modelName=e,this}},{key:"withModelVersion",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter model Version must be a string and cannot be empty");return this._modelVersion=e,this}},{key:"withClockDate",value:function(e){if(!this._isValidDate(e))throw new Error("The clockDate parameter has a wrong format. Example of rigth format is 2015-07-16T19:20:30+01:00");return this._clockDate=e,this}},{key:"_isValidDate",value:function(e){if(""===e||null===e)return!1;var t=e.match(/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})\+(\d{2}):(\d{2})/);if(null===t||"object"!=typeof t)return!1;if("object"!=typeof t&&null!==t&&3!==t.size)return!1;var r=!0,n=(new Date).getFullYear();return(t[1].length<4||t[1]<1999||t[1]>n)&&(r=!1),(t[2].length<2||t[2]<1||t[2]>12)&&(r=!1),(t[3].length<2||t[3]<1||t[3]>31)&&(r=!1),r}},{key:"composeElement",value:function(){return{serialnumber:this._serialnumber,manufacturer:{name:this._manufacturerName,oui:this._manufacturerOui||""},model:{name:this._modelName||"",version:this._modelVersion||""},clockDate:this._clockDate}}}]),e}();r.default=o,t.exports=r.default},{}],168:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(){function e(){n(this,e),this._mr=void 0,this._apn=void 0,this._bcch=void 0,this._cgi=void 0,this._cellId=void 0,this._lac=void 0,this._ratType=void 0,this._plmn=void 0,this._timingAdvance=void 0,this._signalStrength=void 0,this._signalStrengthMax=void 0,this._signalStrengthMin=void 0,this._signalQuality=void 0,this._signalQualityMax=void 0,this._signalQualityMin=void 0}return i(e,[{key:"withMr",value:function(e){if("string"!=typeof e)throw new Error("Parameter mr usage must be String type ");return this._mr=e,this}},{key:"withApn",value:function(e){if("string"!=typeof e)throw new Error("Parameter apn usage must be String type ");return this._apn=e,this}},{key:"withBcch",value:function(e){if("string"!=typeof e)throw new Error("Parameter bcch usage must be String type ");return this._bcch=e,this}},{key:"withCgi",value:function(e){if("string"!=typeof e)throw new Error("Parameter cgi usage must be String type ");return this._cgi=e,this}},{key:"withCellId",value:function(e){if("string"!=typeof e)throw new Error("Parameter cellId usage must be String type ");return this._cellId=e,this}},{key:"withLac",value:function(e){if("string"!=typeof e)throw new Error("Parameter lac usage must be String type ");return this._lac=e,this}},{key:"withRatType",value:function(e){if("string"!=typeof e)throw new Error("Parameter ratType usage must be String type ");return this._ratType=e,this}},{key:"withPlmn",value:function(e){if("string"!=typeof e)throw new Error("Parameter plmn usage must be String type ");return this._plmn=e,this}},{key:"withTimingAdvance",value:function(e){if("string"!=typeof e)throw new Error("Parameter timingAdvance usage must be String type ");return this._timingAdvance=e,this}},{key:"withSignalStrength",value:function(e){if("string"!=typeof e)throw new Error("Parameter signalStrength usage must be String type ");return this._signalStrength=e,this}},{key:"withSignalStrengthMax",value:function(e){if("string"!=typeof e)throw new Error("Parameter signalStrengthMax usage must be String type ");return this._signalStrengthMax=e,this}},{key:"withsignalStrengthMin",value:function(e){if("string"!=typeof e)throw new Error("Parameter signalStrengthMin usage must be String type ");return this._signalStrengthMin=e,this}},{key:"withsignalQuality",value:function(e){if("string"!=typeof e)throw new Error("Parameter signalQuality usage must be String type ");return this._signalQuality=e,this}},{key:"withsignalQualityMax",value:function(e){if("string"!=typeof e)throw new Error("Parameter signalQualityMax usage must be String type ");return this._signalQualityMax=e,this}},{key:"withsignalQualityMin",value:function(e){if("string"!=typeof e)throw new Error("Parameter signalQualityMin usage must be String type ");return this._signalQualityMin=e,this}},{key:"composeElement",value:function(){return{mr:this._mr,apn:this._apn,bcch:this._bcch,cgi:this._cgi,cellId:this._cellId,lac:this._lac,ratType:this._ratType,plmn:this._plmn,timingAdvance:this._timingAdvance,signalStrength:this._signalStrength,signalStrengthMax:this._signalStrengthMax,signalStrengthMin:this._signalStrengthMin,signalQuality:this._signalQuality,signalQualityMax:this._signalQualityMax,signalQualityMin:this._signalQualityMin}}}]),e}();r.default=o,t.exports=r.default},{}],169:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("./enum/POWER_SUPPLY_SOURCE_ENUM"),a=e("./enum/BATTERY_CHARGE_STATUS_ENUM"),u=e("./enum/BATTERY_CHARGE_LEVEL_STATUS_ENUM"),s=e("./enum/LEVEL_TREND_ENUM"),c=function(){function e(){n(this,e),this._source=void 0,this._status=void 0,this._trend=void 0,this._batteryStatus=void 0,this._percentage=void 0,this._outageDate=void 0,this._outageDuration=void 0}return i(e,[{key:"withSource",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter source must be string type and cannot be empty");return this._source=this._checkValues(e,o.POWER_SUPPLY_SOURCE_ENUM),this}},{key:"withStatus",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter status must be string type and cannot be empty");return this._status=this._checkValues(e,a.BATTERY_CHARGE_STATUS_ENUM),this}},{key:"withBatteryChargeLevelTrend",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter trend must be string type and cannot be empty");return this._trend=this._checkValues(e,s.LEVEL_TREND_ENUM),this}},{key:"withBatteryChargeLevelStatus",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter Battery Charge Level Status must be string type and cannot be empty");return this._batteryStatus=this._checkValues(e,u.BATTERY_CHARGE_LEVEL_STATUS_ENUM),this}},{key:"withBatteryChargeLevelPercentage",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter percentage must be string type and cannot be empty");return this._percentage=e,this}},{key:"withOutageDate",value:function(e){if(!this._isValidDate(e))throw new Error("The outageDate parameter has a wrong format. Example of rigth format is 2015-07-16T19:20:30+01:00");return this._outageDate=e,this}},{key:"withOutageDuration",value:function(e){if("number"!=typeof e||0===e.length)throw new Error("Parameter duration must be number type and cannot be empty");return this._outageDuration=e,this}},{key:"_checkValues",value:function(e,t){var r=[];return void 0===t.find(function(e){return e==this},e)&&r.push(e),0!==r.length&&console.warn("Parameter value not allowed <'"+JSON.stringify(r)+"'>, allowed <'"+JSON.stringify(t)+"'>"),e}},{key:"_isValidDate",value:function(e){if(""===e||null===e)return!1;var t=e.match(/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})\+(\d{2}):(\d{2})/);if(null===t||"object"!=typeof t)return!1;if("object"!=typeof t&&null!==t&&3!==t.size)return!1;var r=!0,n=(new Date).getFullYear();return(t[1].length<4||t[1]<1999||t[1]>n)&&(r=!1),(t[2].length<2||t[2]<1||t[2]>12)&&(r=!1),(t[3].length<2||t[3]<1||t[3]>31)&&(r=!1),r}},{key:"composeElement",value:function(){var e={source:this._source,status:this._status,batteryChargeLevel:{trend:this._trend,status:this._batteryStatus,percentage:this._percentage}};return void 0===this._outageDate&&void 0===this._outageDuration||(e.outage={timestamp:this._outageDate,duration:this._outageDuration}),e}}]),e}();r.default=c,t.exports=r.default},{"./enum/BATTERY_CHARGE_LEVEL_STATUS_ENUM":177,"./enum/BATTERY_CHARGE_STATUS_ENUM":178,"./enum/LEVEL_TREND_ENUM":179,"./enum/POWER_SUPPLY_SOURCE_ENUM":180}],170:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("q"),a=(function(e){e&&e.__esModule}(o),e("./enum/SOFTWARE_TYPE_ENUM")),u=function(){function e(){n(this,e),this._name=void 0,this._type=void 0,this._version=void 0,this._date=void 0}return i(e,[{key:"withName",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter name must be a string and cannot be empty");return this._name=e,this}},{key:"withType",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter type must be a string and cannot be empty");return this._type=this._checkValues(e,a.SOFTWARE_TYPE_ENUM),this}},{key:"withVersion",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter version must be a string and cannot be empty");return this._version=e,this}},{key:"withDate",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter date must be a string and cannot be empty");return this._date=e,this}},{key:"_checkValues",value:function(e,t){var r=[];return void 0===t.find(function(e){return e==this},e)&&r.push(e),0!==r.length&&console.warn("Parameter value not allowed <'"+JSON.stringify(r)+"'>, allowed <'"+JSON.stringify(t)+"'>"),e}},{key:"composeElement",value:function(){return{name:this._name,type:this._type,version:this._version,date:this._date}}}]),e}();r.default=u,t.exports=r.default},{"./enum/SOFTWARE_TYPE_ENUM":181,q:117}],171:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./Usage"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this._unit=void 0,this._total=void 0}return i(t,e),o(t,[{key:"withUnit",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter unit must be String type and cannot be empty");return this._unit=e,this}},{key:"withTotal",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter total must be string type and cannot be empty");return this._total=e,this}},{key:"composeElement",value:function(){var e=a(Object.getPrototypeOf(t.prototype),"composeElement",this).call(this);return{unit:this._unit,total:this._total,usage:e}}}]),t}(s.default);r.default=c,t.exports=r.default},{"./Usage":174}],172:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("./Hardware"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(){n(this,e),this._id=void 0,this._name=void 0,this._type=void 0,this._hardware=void 0}return i(e,[{key:"withId",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter id must be a string and cannot be empty");return this._id=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter name must be a string and cannot be empty");return this._name=e,this}},{key:"withType",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter type must be a string and cannot be empty");return this._type=e,this}},{key:"withHardware",value:function(e){if(!(e instanceof a.default))throw new Error("Parameter hardware must be hardware type");return this._hardware=e,this}},{key:"composeElement",value:function(){var e={id:this._id,name:this._name,type:this._type};return void 0!==this._hardware&&(e.hardware=this._hardware.composeElement()),e}}]),e}();r.default=u,t.exports=r.default},{"./Hardware":167}],173:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("./enum/ADDRESS_TYPE_ENUM"),a=function(){function e(){n(this,e),this._id=void 0,this._name=void 0,this._type=void 0,this._description=void 0,this._operator=void 0,this._imsi=void 0,this._msisdn=void 0,this._addressType=void 0,this._addressValue=void 0,this._addressApn=void 0}return i(e,[{key:"withId",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter id must be a string and cannot be empty");return this._id=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter name must be a string and cannot be empty");return this._name=e,this}},{key:"withType",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter type must be a string and cannot be empty");return this._type=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter description must be a string and cannot be empty");return this._description=e,this}},{key:"withOperator",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter operator must be a string and cannot be empty");return this._operator=e,this}},{key:"withImsi",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter imsi must be a string and cannot be empty");return this._imsi=e,this}},{key:"withMsisdn",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter msisdn must be a string and cannot be empty");return this._msisdn=e,this}},{key:"withAddressType",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter addressType must be a string and cannot be empty");return this._addressType=this._checkValues(e,o.ADDRESS_TYPE_ENUM),this}},{key:"withAddressValue",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter addressValue must be a string and cannot be empty");return this._addressValue=e,this}},{key:"withAddressApn",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter addressApn must be a string and cannot be empty");return this._addressApn=e,this}},{key:"_checkValues",value:function(e,t){var r=[];return void 0===t.find(function(e){return e==this},e)&&r.push(e),0!==r.length&&console.warn("Parameter value not allowed <'"+JSON.stringify(r)+"'>, allowed <'"+JSON.stringify(t)+"'>"),e}},{key:"composeElement",value:function(){return{id:this._id,name:this._name,type:this._type,description:this._description,operator:this._operator,imsi:this._imsi,msisdn:this._msisdn,address:{type:this._addressType,value:this._addressValue,apn:this._addressApn}}}}]),e}();r.default=a,t.exports=r.default},{"./enum/ADDRESS_TYPE_ENUM":175}],174:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(){function e(){n(this,e),this._usageUnit=void 0,this._current=void 0,this._average=void 0,this._maximum=void 0,this._minimum=void 0}return i(e,[{key:"withUsageUnit",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter unit usage must be String type and cannot be empty");return this._usageUnit=e,this}},{key:"withCurrent",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter current must be string type and cannot be empty");return this._current=e,this}},{key:"withAverage",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter average must be string type and cannot be empty");return this._average=e,this}},{key:"withMaximum",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter maximum must be string type and cannot be empty");return this._maximum=e,this}},{key:"withMinimum",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter minimum must be string type and cannot be empty");return this._minimum=e,this}},{key:"composeElement",value:function(){return{unit:this._usageUnit,current:this._current,average:this._average,maximum:this._maximum,minimum:this._minimum}}}]),e}();r.default=o,t.exports=r.default},{}],175:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["IPV4","IPV6","MAC"];r.ADDRESS_TYPE_ENUM=n},{}],176:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["OK","SHORT_CIRCUIT","OPEN","UNKONW"];r.ANTENNA_STATUS_ENUM=n},{}],177:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["CHARGING","CHARGED"];r.BATTERY_CHARGE_LEVEL_STATUS_ENUM=n},{}],178:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["NORMAL","LOW_CRITICAL","LOW_WARNING","MEDIUM","COMPLETE"];r.BATTERY_CHARGE_STATUS_ENUM=n},{}],179:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["RISING","DECREASING","FLAT","EMPTY"];r.LEVEL_TREND_ENUM=n},{}],180:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["NETWORK_PLUGGED","DIESEL_GENERATOR","SOLAR","BATTERY","OTHER"];r.POWER_SUPPLY_SOURCE_ENUM=n},{}],181:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["FIRMWARE","SOFTWARE"];r.SOFTWARE_TYPE_ENUM=n},{}],182:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["NORMAL","LOW_CRITICAL","LOW_WARNING","HIGH_WARNING","HIGH_CRITICAL"];r.TEMPERATURE_STATUS_ENUM=n},{}],183:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../provision/BaseProvision"),c=n(s),l=e("./enum/_CONNECTOR_FUNCTIONS_ENUMS"),f=e("q"),d=n(f),h=function(e){function t(e,r,n,o,a){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations"),this.withOrganization(r),this.withChannel(n),o&&this.withIdentifier(o),a&&(a.name&&this.withName(a.name),a.operationName&&this.withOperationName(a.operationName),a.operationalStatus&&this.withOperationalStatus(a.operationalStatus),a.type&&this.withType(a.type),a.payloadType&&this.withPayloadType(a.payloadType),a.description&&this.withDescription(a.description),a.northCriterias&&this.withNorthCriterias(a.northCriterias),a.southCriterias&&this.withSouthCriterias(a.southCriterias),a.javascript&&this.withJavascript(a.javascript))}return o(t,e),a(t,[{key:"withOrganization",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter organization must be a string, cannot be empty and has a maximum length of 50");return this._organization=e,this}},{key:"withChannel",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter channel must be a string, cannot be empty and has a maximum length of 50");return this._channel=e,this}},{key:"withIdentifier",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter identifier must be a string, cannot be empty and has a maximum length of 50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter name must be a string, cannot be empty and has a maximum length of 50");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_250",parameter:"description"});return this._description=e,this}},{key:"withOperationName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter operation name must be a string, cannot be empty and has a maximum length of 50");return this._operationName=e,this}},{key:"withJavascript",value:function(e){if("string"!=typeof e)throw new Error("Parameter javascript must be a string");return this._javascript=e,this}},{key:"withNorthCriterias",value:function(e){if(!(e instanceof Array)||0===e.length)throw new Error("Parameter north criteria must be an array and cannot be empty");return this._northCriterias=e,this}},{key:"withSouthCriterias",value:function(e){var t=this;if(!(e instanceof Array)||0===e.length)throw new Error("Parameter south criteria must be an array and cannot be empty");return e.forEach(function(e){try{t.addSouthCriteria(e)}catch(e){throw t._southCriterias=null,e}}),this}},{key:"addSouthCriteria",value:function(e){if("string"!=typeof e)throw new Error("South criteria must be a string");return this._southCriterias||(this._southCriterias=[]),this._southCriterias.push(e),this}},{key:"withType",value:function(e){if("string"!=typeof e||!this._checkValues(e,l.CONNECTOR_FUNCTION_TYPES))throw new Error("Parameter type must be a string and must be one of these values: "+l.CONNECTOR_FUNCTION_TYPES);return this._type=e,this}},{key:"withPayloadType",value:function(e){if("string"!=typeof e||!this._checkValues(e,l.CONNECTOR_FUNCTION_PAYLOAD_TYPES))throw new Error("Parameter payload type must be a string and must be one of these values: "+l.CONNECTOR_FUNCTION_PAYLOAD_TYPES);return this._payloadType=e,this}},{key:"withOperationalStatus",value:function(e){if("string"!=typeof e||!this._checkValues(e,l.CONNECTOR_FUNCTION_OPERATIONAL_STATUS))throw new Error("Parameter operational status must be a string and must be one of these values: "+l.CONNECTOR_FUNCTION_OPERATIONAL_STATUS);return this._operationalStatus=e,this}},{key:"_composeElement",value:function(){return{identifier:this._identifier,name:this._name,operationalStatus:this._operationalStatus,operationName:"COLLECTION"!==this._type?this._operationName:void 0,type:this._type,payloadType:this._payloadType,javascript:this._javascript,description:this._description?this._description:void 0,northCriterias:"REQUEST"===this._type?this._northCriterias:void 0,southCriterias:"REQUEST"!==this._type?this._southCriterias:void 0}}},{key:"_checkRequiredParameters",value:function(e){if(e){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel||void 0===this._operationalStatus||void 0===this._type||void 0===this._payloadType||void 0===this._javascript)throw new Error("Parameters organization, channel, operational status, type, payloadType, javascript and identifier must be defined")}else if(void 0===this._name||void 0===this._organization||void 0===this._channel||void 0===this._operationalStatus||void 0===this._type||void 0===this._payloadType||void 0===this._javascript)throw new Error("Parameters organization, channel, operational status, type, payloadType, javascript and name must be defined");if("REQUEST"===this._type&&"JSON"!==this._payloadType)throw new Error("Parameter payload type must be JSON when type REQUEST")}},{key:"_buildURL",value:function(){return"connectorFunctions/"+this._resource+"/"+this._organization+"/channels/"+this._channel+"/"}},{key:"create",value:function(){return this._checkRequiredParameters(),this._doNorthPost(this._buildURL(),this._composeElement())}},{key:"update",value:function(){return this._checkRequiredParameters(!0),this._doNorthPut(this._buildURL()+this._identifier,this._composeElement())}},{key:"delete",value:function(){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel)throw new Error("Parameters organization, channel and name must be defined");var e=d.default.defer(),t=e.promise;return this._ogapi.Napi.delete(this._buildURL()+this._identifier).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=h,t.exports=r.default},{"../provision/BaseProvision":235,"./enum/_CONNECTOR_FUNCTIONS_ENUMS":186,q:117}],184:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"connectorFunctions/provision/organizations","connectorFunctions","Connector functions not found")}return i(t,e),o(t,[{key:"findByOrganizationAndChannel",value:function(e,t){var r=this;return r._organization=e,r._channel=t,this._execute()}},{key:"findByOrganizationAndChannelAndName",value:function(e,t,r){var n=this;return n._organization=e,n._channel=t,n._name=r,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/channels/"+this._channel+(this._name?"/"+this._name:"")}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":138}],185:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0})
|
|
27
|
-
;var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../GenericFinder"),c=n(s),l=e("q"),f=n(l),d=e("http-status-codes"),h=n(d),p=e("./enum/_CONNECTOR_FUNCTIONS_ENUMS"),y=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"connectorFunctions"),this._jsHeaders={accept:"application/javascript"},this._mdHeaders={accept:"text/markdown"}}return o(t,e),a(t,[{key:"getdDummyFunctions",value:function(){return this._setExtraHeaders(this._jsHeaders),this._id="doc/jsApi/javascript",this._execute()}},{key:"getDocPrivateJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/jsApi/internal",this._execute()}},{key:"getDocJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/jsApi/client",this._execute()}},{key:"_execute",value:function(){var e=f.default.defer(),t=e.promise,r=this._error_not_found;return this._api.get(this._composeUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){204===t.statusCode?e.reject({error:r,statusCode:h.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}},{key:"getSouthCriteriasProtocols",value:function(){return p.CONNECTOR_FUNCTION_SOUTH_PROTOCOLS}},{key:"getPayloadTypes",value:function(){return p.CONNECTOR_FUNCTION_PAYLOAD_TYPES}}]),t}(c.default);r.default=y,t.exports=r.default},{"../GenericFinder":138,"./enum/_CONNECTOR_FUNCTIONS_ENUMS":186,"http-status-codes":76,q:117}],186:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["DISABLED","PRODUCTION","TEST"];r.CONNECTOR_FUNCTION_OPERATIONAL_STATUS=n;var i=["COLLECTION","REQUEST","RESPONSE"];r.CONNECTOR_FUNCTION_TYPES=i;var o=["TEXT","JSON","BINARY"];r.CONNECTOR_FUNCTION_PAYLOAD_TYPES=o;var a=["https://","wss://","mqtts://"];r.CONNECTOR_FUNCTION_SOUTH_PROTOCOLS=a},{}],187:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"datasets/provision/organizations","datasets")}return i(t,e),o(t,[{key:"findByOrganization",value:function(e){return this._withId(e),this._execute()}},{key:"findByOrganizationAndDatasetId",value:function(e,t){return this._withId(e+"/"+t),this._execute()}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":138}],188:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../provision/BaseProvision"),c=n(s),l=e("../util/formats/check_types"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations/",void 0,["name","organization","columns","identifierColumn"])}return o(t,e),a(t,[{key:"_buildURL",value:function(){return"datasets/provision/organizations/"+this._organization+"/"+this._identifier}},{key:"withOrganization",value:function(e){return f.default._checkStringAndLength(e,50,"organization"),this._organization=e,this}},{key:"withIdentifier",value:function(e){return f.default._checkString(e,"identifier"),this._identifier=e,this}},{key:"withName",value:function(e){return f.default._checkString(e,"name"),this._name=e,this}},{key:"withIdentifierColumn",value:function(e){return f.default._checkString(e,"identifierColumn"),this._identifierColumn=e,this}},{key:"withDescription",value:function(e){return e&&f.default._checkString(e,"description"),this._description=e,this}},{key:"withColumns",value:function(e){return f.default._checkArray(e,"columns"),this._columns=e,this}},{key:"_composeElement",value:function(){return this._resource="datasets/provision/organizations/"+this._organization,{name:this._name,description:this._description,type:this._type,identifierColumn:this._identifierColumn,columns:this._columns}}},{key:"update",value:function(){throw new Error("OGAPI_DAATASET_NOT_UPDATED")}}]),t}(c.default);r.default=d,t.exports=r.default},{"../provision/BaseProvision":235,"../util/formats/check_types":342}],189:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("q"),c=(n(s),e("../provision/BaseProvision")),l=n(c),f=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/domains"),this._ogapi=e}return o(t,e),a(t,[{key:"withName",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_NAME_PARAMETER_MAX_LENGTH_50");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error("OGAPI_DESCRIPTION_PARAMETER_MAX_LENGTH_250");return this._description=e,this}},{key:"withParentDomain",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_DOMAIN_PARAMETER_MAX_LENGTH_50");return this._parentDomain=e,this}},{key:"_composeElement",value:function(){if(void 0===this._name)throw new Error({message:"OGAPI_DEFINED_PARAMETER",parameter:"name"});return{domain:{name:this._name||void 0,description:this._description||void 0,parentDomain:this._parentDomain||void 0}}}},{key:"_buildURL",value:function(){return this._resource+"/"+this._name}},{key:"_composeUpdateElement",value:function(){var e=u(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this);return delete e.domain.name,e}}]),t}(l.default);r.default=f,t.exports=r.default},{"../provision/BaseProvision":235,q:117}],190:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../ProvisionGenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"domains","domain","Domain not found")}return i(t,e),o(t,[{key:"_composeUrl",value:function(){return this._setUrlParameters({hierarchy:this._hierarchy}),this._baseUrl+"/"+this._name}},{key:"findByName",value:function(e){return this._name=e,this._hierarchy="false",this._execute()}},{key:"findByNameWithHierarchy",value:function(e){return this._name=e,this._hierarchy="true",this._execute()}}]),t}(s.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":140}],191:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("./EntityFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"device","Device not found")}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"./EntityFinder":192}],192:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../ProvisionGenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e,r,i,o){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations",r||"entity",i||"Entity not found"),this._entitySource=o||"entities",this._flattened=!1}return i(t,e),o(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/"+this._entitySource+"/"+this._id}},{key:"findByOrganizationAndId",value:function(e,t,r){return this._organization=e,this._id=t,this._setUrlParameters({flattened:!!r}),this._execute()}}]),t}(s.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":140}],193:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("./EntityFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"subscriber","Subscriber not found")}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"./EntityFinder":192}],194:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("./EntityFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"subscription","Subscription not found")}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"./EntityFinder":192}],195:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("./EntityFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"ticket","Ticket not found","tickets")}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"./EntityFinder":192}],196:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("q"),c=n(s),l=e("../provision/BaseProvision"),f=n(l),d=e("../util/formats/check_types"),h=n(d),p=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/geocluster",void 0,"identifier")}return o(t,e),a(t,[{key:"_buildURL",value:function(){return"provision/geocluster/"+this._identifier+"/clustering"}},{key:"withIdentifier",value:function(e){return h.default._checkStringAndLength(e,50,"identifier"),this._identifier=e,this}},{key:"_composeElement",value:function(){this._resource="provision/geocluster/"+this._identifier+"/clustering"}},{key:"_composeElementUpdate",value:function(){return u(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this)}},{key:"update",value:function(){var e=c.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),this._composeElementUpdate(),void 0,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):200===t.status?e.resolve({statusCode:t.status}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(f.default);r.default=p,t.exports=r.default},{"../provision/BaseProvision":235,"../util/formats/check_types":342,q:117}],197:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../ProvisionGenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"geocluster","geocluster","Geocluster not found")}return i(t,e),o(t,[{key:"findById",value:function(e){return this._id=e,this._setUrlParameters(),this._execute()}},{key:"findAll",value:function(){return this._id=void 0,this._setUrlParameters(),this._execute()}},{key:"findFeatures",value:function(e,t){var r=t.zoom,n=t.topRight,i=t.bottomLeft;return this._id=e,this._setUrlParameters({zoom:r,topRight:n,bottomLeft:i}),this._execute()}},{key:"_composeUrl",value:function(){return this._id?this._getUrlParameters()?this._baseUrl+"/"+this._id+"/view":this._baseUrl+"/"+this._id:this._baseUrl}}]),t}(s.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":140}],198:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("./Datastream"),a=(function(e){e&&e.__esModule}(o),function(){function e(t,r,i){n(this,e),this._ogapi=t,this._isValidString(r,"identifier",50),this._identifier=r,this._datastreams=i||[]}return i(e,[{key:"withName",value:function(e){return this._isValidString(e,"name",100),this._name=e,this}},{key:"addDatastream",value:function(e){if(!e||"object"!=typeof e)throw new Error("Datastream must be an object");return this._datastreams.push(e),this}},{key:"addDatastreams",value:function(e){var t=this;if(!Array.isArray(e))throw new Error("Datastreams must be an array");var r=[];if(e.forEach(function(e,n){try{t.addDatastream(e)}catch(e){r.push("Error on datastream with index ["+n+"]: "+e)}}),r.length>0)throw new Error("Error adding datastreams: "+JSON.stringify(r));return this}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r+" on Category")}},{key:"_composeElement",value:function(){if(!this._identifier)throw new Error("identifier is required on Category");return{identifier:this._identifier,name:this._name?this._name:void 0,datastreams:this._datastreams}}}]),e}());r.default=a,t.exports=r.default},{"./Datastream":199}],199:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("ajv"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(){n(this,e)}return i(e,[{key:"withId",value:function(e){return this._isValidString(e,"id",100),this._id=e,this}},{key:"withName",value:function(e){return this._isValidString(e,"name",100),this._name=e,this}},{key:"withDescription",value:function(e){return e&&this._isValidString(e,"description",500),this._description=e,this}},{key:"withUnit",value:function(e,t,r){return this._isValidString(e,"type",500),this._isValidString(t,"label",500),this._isValidString(r,"symbol",10),this._unit={type:e,label:t,symbol:r},this}},{key:"withPeriod",value:function(e){return this._isValidString(e,"period",500),this._period=e,this}},{key:"withSchema",value:function(e){if(!e||"object"!=typeof e)throw new Error("Schema must be an object or a string on Datastream");return this._schema=e,this}},{key:"withTags",value:function(e){if(e){if(!Array.isArray(e))throw new Error("Tags must be an array on Datastream");this._tags=e}return this}},{key:"addQrating",value:function(e){if(!e||"object"!=typeof e)throw new Error("Qrating must be an instance of object on Datastream");return this._qrating=e,this}},{key:"withStorage",value:function(e,t){if(this._isValidString(e,"period",500),!t||"number"!=typeof t)throw new Error("Total must be a number on Datastream");return this._storage={total:t,period:e},this}},{key:"withAccess",value:function(e){if(this._isValidString(e,"access",50),!e)throw new Error("Access must be a valid string");return this._access=e,this}},{key:"withHardwaresIds",value:function(e){if(e&&!Array.isArray(e))throw new Error("hardware Ids must be an array on Datastream");return this._hardwares=e,this}},{key:"build",value:function(){if(!this._id)throw new Error("Id is required on Datastream");if(!this._name)throw new Error("Name is required on Datastream");if(!this._unit)throw new Error("Unit is required on Datastream");if(!this._period)throw new Error("Period is required on Datastream");if(!this._schema)throw new Error("Schema is required on Datastream");try{(new a.default).compile(this._schema)}catch(e){throw new Error("Schema not valid: "+e)}return{identifier:this._id,name:this._name,description:this._description,period:this._period,tags:this._tags,unit:this._unit,schema:this._schema,qrating:this._qrating,storage:this._storage,hardwareIds:this._hardwares,access:this._access}}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r+" on Datastream")}}]),e}();r.default=u,t.exports=r.default},{ajv:2}],200:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(){function e(){n(this,e)}return i(e,[{key:"withMinRequired",value:function(e,t){return this._isValidString(e,"label",50),this._isValidNumber(t,"value"),this._minRequired={label:e,value:t},this}},{key:"withMinDesired",value:function(e,t){return this._isValidString(e,"label",50),this._isValidNumber(t,"value"),this._minDesired={label:e,value:t},this}},{key:"withIdeal",value:function(e,t){return this._isValidString(e,"label",50),this._isValidNumber(t,"value"),this._ideal={label:e,value:t},this}},{key:"withMaxDesired",value:function(e,t){return this._isValidString(e,"label",50),this._isValidNumber(t,"value"),this._maxDesired={label:e,value:t},this}},{key:"withMaxAllowed",value:function(e,t){return this._isValidString(e,"label",50),this._isValidNumber(t,"value"),this._maxAllowed={label:e,value:t},this}},{key:"withMaxScore",value:function(e){return this._isValidNumber(e,"maxScore"),this._maxScore=e,this}},{key:"withCumulativePeriodDivisor",value:function(e){return e&&this._isValidNumber(e,"cumulativePeriodDivisor"),this._cumulativePeriodDivisor=e,this}},{key:"withConversionMatrix",value:function(e){if(e&&"object"!=typeof e)throw new Error("ConversionMatrix must be an object on Qrating");return this._conversionMatrix=e,this}},{key:"withVersion",value:function(e){return this._isValidString(e,"version",100),this._version=e,this}},{key:"build",value:function(){if(!this._version)throw new Error("Version is required on Qrating");if(!this._minRequired)throw new Error("MinRequired is required on Qrating");if(!this._minDesired)throw new Error("MinDesired is required on Qrating");if(!this._ideal)throw new Error("Ideal is required on Qrating");if(!this._maxDesired)throw new Error("MaxDesired is required on Qrating");if(!this._maxAllowed)throw new Error("MaxAllowed is required on Qrating");if(!this._maxScore)throw new Error("MaxScore is required on Qrating");return{min_required:this._minRequired,min_desired:this._minDesired,ideal:this._ideal,max_desired:this._minDesired,max_allowed:this._maxAllowed,max_score:this._maxScore,cumulative_period_divisor:this._cumulativePeriodDivisor,conversion_matrix:this._conversionMatrix,version:this._version}}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r+" on Qrating")}},{key:"_isValidNumber",value:function(e,t){if("number"!=typeof e)throw new Error("Parameter "+t+" must be a number, cannot be empty on Qrating")}}]),e}();r.default=o,t.exports=r.default},{}],201:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../../provision/BaseProvision"),c=n(s),l=e("../catalog/Category"),f=n(l),d=e("../catalog/Datastream"),h=(n(d),"/organizations");r.PRE_RESOURCE=h;var p="/datamodels";r.DATAMODELS_RESOURCE=p;var y=function(e){function t(e,r){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,h),this._isValidString(r,"organization",50),this._organization=r,this._categories=[],this._resourceType=[],this._resource=this._resource+"/"+this._organization+p}return o(t,e),a(t,[{key:"withIdentifier",value:function(e){return this._isValidString(e,"identifier",100),this._identifier=e,this}},{key:"withName",value:function(e){return this._isValidString(e,"name",100),this._name=e,this}},{key:"withVersion",value:function(e){return this._isValidString(e,"version",100),this._version=e,this}},{key:"withDescription",value:function(e){return e&&this._isValidString(e,"description",100),this._description=e,this}},{key:"addAllowedResourceType",value:function(e){return e&&this._isValidString(e,"resourceType",100),this._resourceType.push(e),this}},{key:"addCategory",value:function(e,t){var r=e.identifier;if(!r||this._isValidString(r,"category",100))throw new Error("Category identifier is required");this._categories.forEach(function(e,t){if(r===e.identifier)throw new Error("Category "+r+" already exists.")});var n=new f.default(this._ogapi,r);return e.name&&n.withName(e.name),t&&t.length>0&&n.addDatastreams(t),this._categories.push(n._composeElement()),this}},{key:"addDatastream",value:function(e,t){this._isValidString(e,"category",100);var r=-1;if(this._categories.forEach(function(t,n){t.identifier===e&&(r=n)}),-1===r)throw new Error("Category "+e+" not exists for this datamodel. Use addCategory instead.");return this._categories[r].datastreams?this._categories[r].datastreams.push(t):this._categories[r].datastreams=[t],this}},{key:"_composeElement",value:function(){if(!this._name)throw new Error("name is required on IoTDatamodel")
|
|
27
|
+
;var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../GenericFinder"),c=n(s),l=e("q"),f=n(l),d=e("http-status-codes"),h=n(d),p=e("./enum/_CONNECTOR_FUNCTIONS_ENUMS"),y=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"connectorFunctions"),this._jsHeaders={accept:"application/javascript"},this._mdHeaders={accept:"text/markdown"}}return o(t,e),a(t,[{key:"getdDummyFunctions",value:function(){return this._setExtraHeaders(this._jsHeaders),this._id="doc/jsApi/javascript",this._execute()}},{key:"getDocPrivateJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/jsApi/internal",this._execute()}},{key:"getDocJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/jsApi/client",this._execute()}},{key:"_execute",value:function(){var e=f.default.defer(),t=e.promise,r=this._error_not_found;return this._api.get(this._composeUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){204===t.statusCode?e.reject({error:r,statusCode:h.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}},{key:"getSouthCriteriasProtocols",value:function(){return p.CONNECTOR_FUNCTION_SOUTH_PROTOCOLS}},{key:"getPayloadTypes",value:function(){return p.CONNECTOR_FUNCTION_PAYLOAD_TYPES}}]),t}(c.default);r.default=y,t.exports=r.default},{"../GenericFinder":138,"./enum/_CONNECTOR_FUNCTIONS_ENUMS":186,"http-status-codes":76,q:117}],186:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["DISABLED","PRODUCTION","TEST"];r.CONNECTOR_FUNCTION_OPERATIONAL_STATUS=n;var i=["COLLECTION","REQUEST","RESPONSE"];r.CONNECTOR_FUNCTION_TYPES=i;var o=["TEXT","JSON","BINARY"];r.CONNECTOR_FUNCTION_PAYLOAD_TYPES=o;var a=["https://","wss://","mqtts://"];r.CONNECTOR_FUNCTION_SOUTH_PROTOCOLS=a},{}],187:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"datasets/provision/organizations","datasets")}return i(t,e),o(t,[{key:"findByOrganization",value:function(e){return this._withId(e),this._execute()}},{key:"findByOrganizationAndDatasetId",value:function(e,t){return this._withId(e+"/"+t),this._execute()}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":138}],188:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../provision/BaseProvision"),c=n(s),l=e("../util/formats/check_types"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations/",void 0,["name","organization","columns","identifierColumn"])}return o(t,e),a(t,[{key:"_buildURL",value:function(){return"datasets/provision/organizations/"+this._organization+"/"+this._identifier}},{key:"withOrganization",value:function(e){return f.default._checkStringAndLength(e,50,"organization"),this._organization=e,this}},{key:"withIdentifier",value:function(e){return f.default._checkString(e,"identifier"),this._identifier=e,this}},{key:"withName",value:function(e){return f.default._checkString(e,"name"),this._name=e,this}},{key:"withIdentifierColumn",value:function(e){return f.default._checkString(e,"identifierColumn"),this._identifierColumn=e,this}},{key:"withDescription",value:function(e){return e&&f.default._checkString(e,"description"),this._description=e,this}},{key:"withColumns",value:function(e){return f.default._checkArray(e,"columns"),this._columns=e,this}},{key:"_composeElement",value:function(){return this._resource="datasets/provision/organizations/"+this._organization,{name:this._name,description:this._description,type:this._type,identifierColumn:this._identifierColumn,columns:this._columns}}},{key:"update",value:function(){throw new Error("OGAPI_DAATASET_NOT_UPDATED")}}]),t}(c.default);r.default=d,t.exports=r.default},{"../provision/BaseProvision":235,"../util/formats/check_types":343}],189:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("q"),c=(n(s),e("../provision/BaseProvision")),l=n(c),f=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/domains"),this._ogapi=e}return o(t,e),a(t,[{key:"withName",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_NAME_PARAMETER_MAX_LENGTH_50");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error("OGAPI_DESCRIPTION_PARAMETER_MAX_LENGTH_250");return this._description=e,this}},{key:"withParentDomain",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_DOMAIN_PARAMETER_MAX_LENGTH_50");return this._parentDomain=e,this}},{key:"_composeElement",value:function(){if(void 0===this._name)throw new Error({message:"OGAPI_DEFINED_PARAMETER",parameter:"name"});return{domain:{name:this._name||void 0,description:this._description||void 0,parentDomain:this._parentDomain||void 0}}}},{key:"_buildURL",value:function(){return this._resource+"/"+this._name}},{key:"_composeUpdateElement",value:function(){var e=u(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this);return delete e.domain.name,e}}]),t}(l.default);r.default=f,t.exports=r.default},{"../provision/BaseProvision":235,q:117}],190:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../ProvisionGenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"domains","domain","Domain not found")}return i(t,e),o(t,[{key:"_composeUrl",value:function(){return this._setUrlParameters({hierarchy:this._hierarchy}),this._baseUrl+"/"+this._name}},{key:"findByName",value:function(e){return this._name=e,this._hierarchy="false",this._execute()}},{key:"findByNameWithHierarchy",value:function(e){return this._name=e,this._hierarchy="true",this._execute()}}]),t}(s.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":140}],191:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("./EntityFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"device","Device not found")}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"./EntityFinder":192}],192:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../ProvisionGenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e,r,i,o){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations",r||"entity",i||"Entity not found"),this._entitySource=o||"entities",this._flattened=!1}return i(t,e),o(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/"+this._entitySource+"/"+this._id}},{key:"findByOrganizationAndId",value:function(e,t,r){return this._organization=e,this._id=t,this._setUrlParameters({flattened:!!r}),this._execute()}}]),t}(s.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":140}],193:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("./EntityFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"subscriber","Subscriber not found")}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"./EntityFinder":192}],194:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("./EntityFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"subscription","Subscription not found")}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"./EntityFinder":192}],195:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("./EntityFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"ticket","Ticket not found","tickets")}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"./EntityFinder":192}],196:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("q"),c=n(s),l=e("../provision/BaseProvision"),f=n(l),d=e("../util/formats/check_types"),h=n(d),p=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/geocluster",void 0,"identifier")}return o(t,e),a(t,[{key:"_buildURL",value:function(){return"provision/geocluster/"+this._identifier+"/clustering"}},{key:"withIdentifier",value:function(e){return h.default._checkStringAndLength(e,50,"identifier"),this._identifier=e,this}},{key:"_composeElement",value:function(){this._resource="provision/geocluster/"+this._identifier+"/clustering"}},{key:"_composeElementUpdate",value:function(){return u(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this)}},{key:"update",value:function(){var e=c.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),this._composeElementUpdate(),void 0,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):200===t.status?e.resolve({statusCode:t.status}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(f.default);r.default=p,t.exports=r.default},{"../provision/BaseProvision":235,"../util/formats/check_types":343,q:117}],197:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../ProvisionGenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"geocluster","geocluster","Geocluster not found")}return i(t,e),o(t,[{key:"findById",value:function(e){return this._id=e,this._setUrlParameters(),this._execute()}},{key:"findAll",value:function(){return this._id=void 0,this._setUrlParameters(),this._execute()}},{key:"findFeatures",value:function(e,t){var r=t.zoom,n=t.topRight,i=t.bottomLeft;return this._id=e,this._setUrlParameters({zoom:r,topRight:n,bottomLeft:i}),this._execute()}},{key:"_composeUrl",value:function(){return this._id?this._getUrlParameters()?this._baseUrl+"/"+this._id+"/view":this._baseUrl+"/"+this._id:this._baseUrl}}]),t}(s.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":140}],198:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("./Datastream"),a=(function(e){e&&e.__esModule}(o),function(){function e(t,r,i){n(this,e),this._ogapi=t,this._isValidString(r,"identifier",50),this._identifier=r,this._datastreams=i||[]}return i(e,[{key:"withName",value:function(e){return this._isValidString(e,"name",100),this._name=e,this}},{key:"addDatastream",value:function(e){if(!e||"object"!=typeof e)throw new Error("Datastream must be an object");return this._datastreams.push(e),this}},{key:"addDatastreams",value:function(e){var t=this;if(!Array.isArray(e))throw new Error("Datastreams must be an array");var r=[];if(e.forEach(function(e,n){try{t.addDatastream(e)}catch(e){r.push("Error on datastream with index ["+n+"]: "+e)}}),r.length>0)throw new Error("Error adding datastreams: "+JSON.stringify(r));return this}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r+" on Category")}},{key:"_composeElement",value:function(){if(!this._identifier)throw new Error("identifier is required on Category");return{identifier:this._identifier,name:this._name?this._name:void 0,datastreams:this._datastreams}}}]),e}());r.default=a,t.exports=r.default},{"./Datastream":199}],199:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("ajv"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(){n(this,e)}return i(e,[{key:"withId",value:function(e){return this._isValidString(e,"id",100),this._id=e,this}},{key:"withName",value:function(e){return this._isValidString(e,"name",100),this._name=e,this}},{key:"withDescription",value:function(e){return e&&this._isValidString(e,"description",500),this._description=e,this}},{key:"withUnit",value:function(e,t,r){return this._isValidString(e,"type",500),this._isValidString(t,"label",500),this._isValidString(r,"symbol",10),this._unit={type:e,label:t,symbol:r},this}},{key:"withPeriod",value:function(e){return this._isValidString(e,"period",500),this._period=e,this}},{key:"withSchema",value:function(e){if(!e||"object"!=typeof e)throw new Error("Schema must be an object or a string on Datastream");return this._schema=e,this}},{key:"withTags",value:function(e){if(e){if(!Array.isArray(e))throw new Error("Tags must be an array on Datastream");this._tags=e}return this}},{key:"addQrating",value:function(e){if(!e||"object"!=typeof e)throw new Error("Qrating must be an instance of object on Datastream");return this._qrating=e,this}},{key:"withStorage",value:function(e,t){if(this._isValidString(e,"period",500),!t||"number"!=typeof t)throw new Error("Total must be a number on Datastream");return this._storage={total:t,period:e},this}},{key:"withAccess",value:function(e){if(this._isValidString(e,"access",50),!e)throw new Error("Access must be a valid string");return this._access=e,this}},{key:"withHardwaresIds",value:function(e){if(e&&!Array.isArray(e))throw new Error("hardware Ids must be an array on Datastream");return this._hardwares=e,this}},{key:"build",value:function(){if(!this._id)throw new Error("Id is required on Datastream");if(!this._name)throw new Error("Name is required on Datastream");if(!this._unit)throw new Error("Unit is required on Datastream");if(!this._period)throw new Error("Period is required on Datastream");if(!this._schema)throw new Error("Schema is required on Datastream");try{(new a.default).compile(this._schema)}catch(e){throw new Error("Schema not valid: "+e)}return{identifier:this._id,name:this._name,description:this._description,period:this._period,tags:this._tags,unit:this._unit,schema:this._schema,qrating:this._qrating,storage:this._storage,hardwareIds:this._hardwares,access:this._access}}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r+" on Datastream")}}]),e}();r.default=u,t.exports=r.default},{ajv:2}],200:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(){function e(){n(this,e)}return i(e,[{key:"withMinRequired",value:function(e,t){return this._isValidString(e,"label",50),this._isValidNumber(t,"value"),this._minRequired={label:e,value:t},this}},{key:"withMinDesired",value:function(e,t){return this._isValidString(e,"label",50),this._isValidNumber(t,"value"),this._minDesired={label:e,value:t},this}},{key:"withIdeal",value:function(e,t){return this._isValidString(e,"label",50),this._isValidNumber(t,"value"),this._ideal={label:e,value:t},this}},{key:"withMaxDesired",value:function(e,t){return this._isValidString(e,"label",50),this._isValidNumber(t,"value"),this._maxDesired={label:e,value:t},this}},{key:"withMaxAllowed",value:function(e,t){return this._isValidString(e,"label",50),this._isValidNumber(t,"value"),this._maxAllowed={label:e,value:t},this}},{key:"withMaxScore",value:function(e){return this._isValidNumber(e,"maxScore"),this._maxScore=e,this}},{key:"withCumulativePeriodDivisor",value:function(e){return e&&this._isValidNumber(e,"cumulativePeriodDivisor"),this._cumulativePeriodDivisor=e,this}},{key:"withConversionMatrix",value:function(e){if(e&&"object"!=typeof e)throw new Error("ConversionMatrix must be an object on Qrating");return this._conversionMatrix=e,this}},{key:"withVersion",value:function(e){return this._isValidString(e,"version",100),this._version=e,this}},{key:"build",value:function(){if(!this._version)throw new Error("Version is required on Qrating");if(!this._minRequired)throw new Error("MinRequired is required on Qrating");if(!this._minDesired)throw new Error("MinDesired is required on Qrating");if(!this._ideal)throw new Error("Ideal is required on Qrating");if(!this._maxDesired)throw new Error("MaxDesired is required on Qrating");if(!this._maxAllowed)throw new Error("MaxAllowed is required on Qrating");if(!this._maxScore)throw new Error("MaxScore is required on Qrating");return{min_required:this._minRequired,min_desired:this._minDesired,ideal:this._ideal,max_desired:this._minDesired,max_allowed:this._maxAllowed,max_score:this._maxScore,cumulative_period_divisor:this._cumulativePeriodDivisor,conversion_matrix:this._conversionMatrix,version:this._version}}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r+" on Qrating")}},{key:"_isValidNumber",value:function(e,t){if("number"!=typeof e)throw new Error("Parameter "+t+" must be a number, cannot be empty on Qrating")}}]),e}();r.default=o,t.exports=r.default},{}],201:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../../provision/BaseProvision"),c=n(s),l=e("../catalog/Category"),f=n(l),d=e("../catalog/Datastream"),h=(n(d),"/organizations");r.PRE_RESOURCE=h;var p="/datamodels";r.DATAMODELS_RESOURCE=p;var y=function(e){function t(e,r){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,h),this._isValidString(r,"organization",50),this._organization=r,this._categories=[],this._resourceType=[],this._resource=this._resource+"/"+this._organization+p}return o(t,e),a(t,[{key:"withIdentifier",value:function(e){return this._isValidString(e,"identifier",100),this._identifier=e,this}},{key:"withName",value:function(e){return this._isValidString(e,"name",100),this._name=e,this}},{key:"withVersion",value:function(e){return this._isValidString(e,"version",100),this._version=e,this}},{key:"withDescription",value:function(e){return e&&this._isValidString(e,"description",100),this._description=e,this}},{key:"addAllowedResourceType",value:function(e){return e&&this._isValidString(e,"resourceType",100),this._resourceType.push(e),this}},{key:"addCategory",value:function(e,t){var r=e.identifier;if(!r||this._isValidString(r,"category",100))throw new Error("Category identifier is required");this._categories.forEach(function(e,t){if(r===e.identifier)throw new Error("Category "+r+" already exists.")});var n=new f.default(this._ogapi,r);return e.name&&n.withName(e.name),t&&t.length>0&&n.addDatastreams(t),this._categories.push(n._composeElement()),this}},{key:"addDatastream",value:function(e,t){this._isValidString(e,"category",100);var r=-1;if(this._categories.forEach(function(t,n){t.identifier===e&&(r=n)}),-1===r)throw new Error("Category "+e+" not exists for this datamodel. Use addCategory instead.");return this._categories[r].datastreams?this._categories[r].datastreams.push(t):this._categories[r].datastreams=[t],this}},{key:"_composeElement",value:function(){if(!this._name)throw new Error("name is required on IoTDatamodel")
|
|
28
28
|
;if(!this._version)throw new Error("version is required on IoTDatamodel");if(!this._resourceType)throw new Error("allowedResourceTypes is required on IoTDatamodel");return{identifier:this._identifier,name:this._name,version:this._version,description:this._description,allowedResourceTypes:this._resourceType,categories:this._categories.length>0?this._categories:void 0}}},{key:"_buildURL",value:function(){return this._resource}},{key:"update",value:function(){throw new Error("Update not supported on this builder. Use datamodelsHelper instead.")}},{key:"delete",value:function(){throw new Error("Delete not supported on this builder. Use datamodelsHelper instead.")}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r+"on IoTDatamodel")}}]),t}(c.default);r.default=y},{"../../provision/BaseProvision":235,"../catalog/Category":198,"../catalog/Datastream":199}],202:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../../ProvisionGenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u);r.DATAMODEL_RESOURCE="/datamodels/";var c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations/","datamodels","Datamodel not found")}return i(t,e),o(t,[{key:"_composeUrl",value:function(){return this._baseUrl+this._organization+"/datamodels/"+this._id}},{key:"findByOrganizationAndId",value:function(e,t){return this._organization=e,this._id=t,this._execute()}}]),t}(s.default);r.default=c},{"../../ProvisionGenericFinder":140}],203:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../../provision/BaseProvision"),c=n(s),l=e("../catalog/Category"),f=n(l),d=e("../catalog/Datastream"),h=(n(d),"/organizations");r.PRE_RESOURCE=h;r.POST_RESOURCE="/datamodels";var p=function(e){function t(e,r,n){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,h),this._isValidString(r,"organization",50),this._organization=r,this._datamodel=n,this._name=this._datamodel.name,this._isValidString(this._name,"name of object datamodel",100),this._version=this._datamodel.version,this._isValidString(this._version,"version of object datamodel",100),this._description=this._datamodel.description,this._categories=this._datamodel.categories,this._identifier=this._datamodel.identifier}return o(t,e),a(t,[{key:"withIdentifier",value:function(e){return this._isValidString(e,"identifier",100),this._identifier=e,this}},{key:"withName",value:function(e){return this._isValidString(e,"name",100),this._name=e,this}},{key:"withVersion",value:function(e){return this._isValidString(e,"version",100),this._version=e,this}},{key:"withDescription",value:function(e){return e&&this._isValidString(e,"description",100),this._description=e,this}},{key:"addCategory",value:function(e,t){this._categories?this._categories.forEach(function(t,r){if(t.identifier===e.identifier)throw new Error("Category "+e.identifier+" already exists.")}):this._categories=[];var r=new f.default(this._ogapi,e.identifier);return e.name&&r.withName(e.name),t&&t.length>0&&r.addDatastreams(t),this._categories.push(r._composeElement()),this}},{key:"addDatastream",value:function(e,t){this._isValidString(e,"category",100);var r=-1;if(this._categories.forEach(function(t,n){t.identifier===e&&(r=n)}),-1===r)throw new Error("Category "+e+" not exists for this datamodel. Use addCategory instead.");return this._categories[r].datastreams?this._categories[r].datastreams.push(t):this._categories[r].datastreams=[t],this}},{key:"removeCategory",value:function(e){this._isValidString(e,"category",100);var t=-1;if(this._categories.forEach(function(r,n){r.identifier===e&&(t=n)}),-1===t)throw new Error("Category "+e+" not exists for this datamodel");return this._categories.splice(t,1),this}},{key:"removeDatastream",value:function(e,t){this._isValidString(e,"category",100);var r=-1,n=-1;if(this._categories.forEach(function(i,o){i.identifier===e&&(r=o,i.datastreams.forEach(function(e,r){e.identifier===t&&(n=r)}))}),-1===r)throw new Error("Category "+e+" not exists for this datamodel");if(-1===n)throw new Error("Datastream "+t+" not exists for this datamodel and category "+e);this._categories[r].datastreams.splice(n,1);var i=new f.default(this._ogapi,e,this._categories[r].datastreams);return this._categories[r].name&&i.withName(this._categories[r].name),this._categories.splice(r,1),this._categories.push(i._composeElement()),this}},{key:"updateCategory",value:function(e,t){this._isValidString(e,"old category",100);var r=-1,n=-1;if(this._categories.forEach(function(i,o){switch(i.identifier){case e:r=o;break;case t.identifier:n=o}}),-1!=n)throw new Error("New category "+t.identifier+" already exists.");if(-1===r)throw new Error("Category "+e+" not exists for this datamodel.");return this._categories[r].name=t.name,this}},{key:"updateDatastream",value:function(e,t,r){if(this._isValidString(e,"category",100),this._isValidString(t,"id datastream",100),!r||"object"!=typeof r)throw new Error("Datastream must be an object");var n=-1,i=-1;if(this._categories.forEach(function(r,o){r.identifier===e&&(n=o,r.datastreams.forEach(function(e,r){e.identifier===t&&(i=r)}))}),-1===n)throw new Error("Category "+e+" not exists for this datamodel. Create it, use method addCategory instead");if(-1===i)throw new Error("Datastream "+t+" not exists for this datamodel and category "+e+". Create it, use method addDatastream instead.");return this._categories[n].datastreams[i]=r,this}},{key:"_composeElement",value:function(){return{identifier:this._identifier,name:this._name,version:this._version,description:this._description,categories:this._categories}}},{key:"_buildURL",value:function(){return this._resource+"/"+this._organization+"/datamodels/"+this._identifier}},{key:"create",value:function(){throw new Error("Create not supported on this builder. Use DatamodelsBuilder instead.")}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r+" on DatamodelsHelper")}}]),t}(c.default);r.default=p},{"../../provision/BaseProvision":235,"../catalog/Category":198,"../catalog/Datastream":199}],204:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../provision/BaseProvision"),c=n(s),l=e("./ManufacturerMedia"),f=n(l),d=e("./Model"),h=n(d),p=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/manufacturers",void 0,["identifier","name"])}return o(t,e),a(t,[{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._description=e,this}},{key:"withNotes",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._notes=e,this}},{key:"withUrl",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._manufUrl=e,this}},{key:"withFax",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._fax=e,this}},{key:"withTelephone",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._telephone=e,this}},{key:"withAddress",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._address=e,this}},{key:"withEmail",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._email=e,this}},{key:"mediaBuilder",value:function(){if(!this._identifier)throw new Error("Required manufacturer identifier");return new f.default(this._ogapi,this._identifier)}},{key:"modelBuilder",value:function(){if(!this._identifier)throw new Error("Required manufacturer identifier and name");return new h.default(this._ogapi,this)}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),{manufacturer:{id:this._identifier||void 0,name:this._name||void 0,description:this._description||void 0,telephone:this._telephone||void 0,address:this._address||void 0,fax:this._fax||void 0,url:this._manufUrl||void 0,notes:this._notes||void 0,email:this._email||void 0}}}},{key:"_composeUpdateElement",value:function(){var e=this._composeElement();return delete e.manufacturer.id,e}},{key:"_buildURL",value:function(){return this._resource+"/"+this._identifier}}]),t}(c.default);r.default=p,t.exports=r.default},{"../provision/BaseProvision":235,"./ManufacturerMedia":206,"./Model":207}],205:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../ProvisionGenericFinder"),c=n(s),l=e("q"),f=n(l),d=e("http-status-codes"),h=n(d),p=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"manufacturers","manufacturer","Manufacturer not found")}return o(t,e),a(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._identifier+(this._mediaIdentifier?"/media/"+this._mediaIdentifier+"?format=raw":"")}},{key:"findById",value:function(e){return this._identifier=e,this._execute()}},{key:"findMediaById",value:function(e,t){return this._identifier=e,this._mediaIdentifier=t,this._download()}},{key:"_download",value:function(){var e=f.default.defer(),t=e.promise,r=this._error_not_found;return this._api.get(this._composeUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters(),!0).then(function(t){204===t.statusCode?e.reject({data:r,statusCode:h.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=p,t.exports=r.default},{"../ProvisionGenericFinder":140,"http-status-codes":76,q:117}],206:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("q"),c=n(s),l=e("../provision/BaseProvision"),f=n(l),d=function(e){function t(e,r){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/manufacturers/"+r+"/media",void 0,["identifier","name"])}return o(t,e),a(t,[{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._name=e,this}},{key:"withFile",value:function(e){if(!e)throw new Error("OGAPI_NOT_EMPTY_PARAMETER");return this._file=e,this}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),{media:{id:this._identifier||void 0,name:this._name||void 0}}}},{key:"_buildURL",value:function(){return this._resource+"/"+this._identifier}},{key:"update",value:function(){throw new Exception("OGAPI_METHOD_NOT_SUPPORTED")}},{key:"create",value:function(e){var t=void 0;if(e)if("string"!=typeof e){t=new FormData;var r=new Blob([this._composeElement()],{type:"application/json"});t.append("json",r),e&&t.append("file",e)}else t={},t.json=JSON.stringify(this._composeElement()),e&&(t.hardwareMedia=e);else{t=new FormData;var r=new Blob([JSON.stringify(this._composeElement())],{type:"application/octet-stream"});t.append("json",r),t.append("file",this._file)}var n={};void 0!=this._progressEvent&&(n={progress:this._progressEvent});var i=c.default.defer(),o=i.promise;return this._ogapi.Napi.post_multipart(this._resource,t,n,this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(e){201===e.statusCode?i.resolve({location:e.header.location,statusCode:e.statusCode}):i.reject({errors:[{code:e.statusCode,message:"OGAPI_FILE_NOT_CREATE"}],statusCode:e.statusCode})}).catch(function(e){i.reject(e)}),o}}]),t}(f.default);r.default=d,t.exports=r.default},{"../provision/BaseProvision":235,q:117}],207:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../provision/BaseProvision"),c=n(s),l=e("./Manufacturer"),f=n(l),d=e("./ModelMedia"),h=n(d),p=function(e){function t(e,r){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/models",void 0,["identifier","name","manufacturer"]),this._manufacturer=r}return o(t,e),a(t,[{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._description=e,this}},{key:"withNotes",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._notes=e,this}},{key:"withUrl",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._modelUrl=e,this}},{key:"withVersion",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._version=e,this}},{key:"withManufacturerIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._manufacturer||(this._manufacturer=new f.default(this._ogapi)),this._manufacturer.withIdentifier(e),this}},{key:"withManufacturerName",value:function(e){if(!e)throw new Error("OGAPI_STRING_PARAMETER");return this._manufacturer||(this._manufacturer=new f.default(this._ogapi)),this._manufacturer.withName(e),this}},{key:"mediaBuilder",value:function(){if(!this._identifier)throw new Error("Required model identifier");return new h.default(this._ogapi,this._identifier)}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),{model:{id:this._identifier||void 0,name:this._name||void 0,description:this._description||void 0,version:this._version||void 0,notes:this._notes||void 0,url:this._modelUrl||void 0,manufacturer:{id:this._manufacturer._identifier||void 0,name:this._manufacturer._name||void 0}}}}},{key:"_composeUpdateElement",value:function(){var e=this._composeElement();return delete e.model.id,e}},{key:"_buildURL",value:function(){return this._resource+"/"+this._identifier}}]),t}(c.default);r.default=p,t.exports=r.default},{"../provision/BaseProvision":235,"./Manufacturer":204,"./ModelMedia":209}],208:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../ProvisionGenericFinder"),c=n(s),l=e("q"),f=n(l),d=e("http-status-codes"),h=n(d),p=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"models","model","Model not found")}return o(t,e),a(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._identifier+(this._mediaIdentifier?"/media/"+this._mediaIdentifier+"?format=raw":"")}},{key:"findById",value:function(e){return this._identifier=e,this._execute()}},{key:"findMediaById",value:function(e,t){return this._identifier=e,this._mediaIdentifier=t,this._download()}},{key:"_download",value:function(){var e=f.default.defer(),t=e.promise,r=this._error_not_found;return this._api.get(this._composeUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters(),!0).then(function(t){204===t.statusCode?e.reject({data:r,statusCode:h.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=p,t.exports=r.default},{"../ProvisionGenericFinder":140,"http-status-codes":76,q:117}],209:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("q"),c=n(s),l=e("../provision/BaseProvision"),f=n(l),d=function(e){function t(e,r){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/models/"+r+"/media",void 0,["identifier"])}return o(t,e),a(t,[{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._name=e,this}},{key:"withFileName",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._fileName=e,this}},{key:"withFile",value:function(e){if(!e)throw new Error("OGAPI_NOT_EMPTY_PARAMETER");return this._file=e,this}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),{media:{id:this._identifier||void 0,name:this._name||void 0}}}},{key:"_buildURL",value:function(){return this._resource+"/"+this._identifier}},{key:"update",value:function(){throw new Exception("OGAPI_METHOD_NOT_SUPPORTED")}},{key:"create",value:function(e){var t=void 0;if(e)if("string"!=typeof e){t=new FormData;var r=new Blob([this._composeElement()],{type:"application/json"});t.append("json",r),e&&t.append("file",e)}else t={},t.json=JSON.stringify(this._composeElement()),e&&(t.hardwareMedia=e);else{t=new FormData;var r=new Blob([JSON.stringify(this._composeElement())],{type:"application/octet-stream"});t.append("json",r),t.append("file",this._file)}var n={};void 0!=this._progressEvent&&(n={progress:this._progressEvent});var i=c.default.defer(),o=i.promise;return this._ogapi.Napi.post_multipart(this._resource,t,n,this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(e){201===e.statusCode?i.resolve({location:e.header.location,statusCode:e.statusCode}):i.reject({errors:[{code:e.statusCode,message:"OGAPI_FILE_NOT_CREATE"}],statusCode:e.statusCode})}).catch(function(e){i.reject(e)}),o}}]),t}(f.default);r.default=d,t.exports=r.default},{"../provision/BaseProvision":235,q:117}],210:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../provision/BaseProvision"),c=n(s),l=e("q"),f=n(l),d=function(e){function t(e,r,n,o){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations"),this.withOrganization(r),n&&this.withIdentifier(n),o&&(o.name&&this.withName(o.name),o.title&&this.withTitle(o.title),o.description&&this.withDescription(o.description),o.fromCatalog&&this.fromCatalog(o.fromCatalog),!n&&o.fromCatalog||(o.steps&&this.withSteps(o.steps),o.parameters&&this.withParameters(o.parameters),o.models&&this.withModels(o.models),o.applicableTo&&this.applicableTo(o.applicableTo)))}return o(t,e),a(t,[{key:"withIdentifier",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter name must be a string, cannot be empty and has a maximum length of 50");return this._identifier=e,this}},{key:"withOrganization",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter organization must be a string, cannot be empty and has a maximum length of 50");return this._organization=e,this}},{key:"withTitle",value:function(e){if("string"!=typeof e)throw new Error("Parameter title must be a string, cannot be empty and has a maximum length of 50");return this._title=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter name must be a string, cannot be empty and has a maximum length of 50");return this._name=e,this}},{key:"withDescription",value:function(e){return this._description=e||void 0,this}},{key:"withParameters",value:function(e){return this._parameters=e||void 0,this}},{key:"fromCatalog",value:function(e){return this._fromCatalog=e,this}},{key:"withSteps",value:function(e){return this._steps=e||void 0,this}},{key:"withModels",value:function(e){return this._models=e||void 0,this}},{key:"applicableTo",value:function(e){return this._applicableTo=e||void 0,this}},{key:"_composeElement",value:function(e){return{name:this._name,title:this._title,description:this._description?this._description:void 0,parameters:this._parameters||void 0,fromCatalog:this._fromCatalog||void 0,steps:this._steps||void 0,models:this._models||void 0,applicableTo:this._applicableTo||void 0}}},{key:"_checkRequiredParameters",value:function(e){if(e){if(void 0===this._identifier||void 0===this._organization||void 0===this._name||void 0===this._title)throw new Error("Parameters organization, title and name must be defined")}else if(void 0===this._name||void 0===this._organization||void 0===this._title)throw new Error("Parameters organization, title and name must be defined")}},{key:"_buildURL",value:function(){return"operationTypes/"+this._resource+"/"+this._organization}},{key:"create",value:function(){return this._checkRequiredParameters(),this._doNorthPost(this._buildURL(),this._composeElement())}},{key:"update",value:function(){return this._checkRequiredParameters(!0),this._doNorthPut(this._buildURL()+"/"+this._identifier,this._composeElement(!0))}},{key:"delete",value:function(){if(void 0===this._identifier||void 0===this._organization)throw new Error("Parameters organization and name must be defined");var e=f.default.defer(),t=e.promise;return this._ogapi.Napi.delete(this._buildURL()+"/"+this._identifier).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=d,t.exports=r.default},{"../provision/BaseProvision":235,q:117}],211:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"operationTypes/catalog","operationType","Operation types not found")}return i(t,e),o(t,[{key:"getOperationTypes",value:function(){return this._execute()}},{key:"_composeUrl",
|
|
29
|
-
value:function(){return this._baseUrl}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":138}],212:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"operationTypes/provision/organizations","operationTypes","Operation type not found")}return i(t,e),o(t,[{key:"findByOrganizationAndName",value:function(e,t){var r=this;return r._organization=e,r._name=t,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/"+this._name}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":138}],213:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("q"),u=n(a),s=e("moment"),c=n(s),l=function(){function e(t,r){if(i(this,e),"string"!=typeof r)throw new Error("Parameter operationId must be a string");this._ogapi=t,this._resource="operation",this._operationId=r}return o(e,[{key:"active",value:function(){var e={request:{active:!0}};return this._key="job",this._resource=this._resource+"/jobs/"+this._operationId,this._update(e)}},{key:"pause",value:function(){var e={request:{active:!1}};return this._key="job",this._resource=this._resource+"/jobs/"+this._operationId,this._update(e)}},{key:"cancel",value:function(){return this._id=this._operationId,this._resource=this._resource+"/jobs/"+this._id,this._cancel(this._resource)}},{key:"activePeriodicity",value:function(){var e={active:!0};return this._key="task",this._resource=this._resource+"/tasks/",this._periodicityActions("ACTIVE",e)}},{key:"pausePeriodicity",value:function(){var e={active:!1};return this._key="task",this._resource=this._resource+"/tasks/",this._periodicityActions("PAUSE",e)}},{key:"cancelPeriodicity",value:function(){return this._resource=this._resource+"/tasks/",this._periodicityActions("CANCEL")}},{key:"executeNow",value:function(){var e={request:{schedule:{start:{}}}};return this._readAndUpdate(e,!0)}},{key:"executeLater",value:function(e){if("number"!=typeof e)throw new Error("Parameter minutes must be typeof number");var t={request:{schedule:{start:{delayed:c.default.duration(e,"minutes").asMilliseconds()}}}};return this._readAndUpdate(t)}},{key:"changeCallback",value:function(e){if("string"!=typeof e)throw new Error("Parameter url must be a string");var t={request:{callback:e}};return this._readAndUpdate(t)}},{key:"_cancel",value:function(){var e=this,t=u.default.defer(),r=t.promise;return this._ogapi.Napi.delete(this._resource).then(function(r){200===r.statusCode?t.resolve({statusCode:r.statusCode,data:{id:e._id}}):t.reject({errors:r.errors,statusCode:r.statusCode})}).catch(function(r){t.reject(e._formatError(r))}),r}},{key:"_periodicityActions",value:function(e,t){var r=this,n=u.default.defer(),i=n.promise;return r._ogapi.newOperationFinder().findById(r._operationId).then(function(i){var o=i.data;if(o&&0!=Object.keys(o).length){var a=o.taskId;if(a)switch(r._resource=r._resource+a,e){case"PAUSE":case"ACTIVE":r._update(t).then(function(e){n.resolve(e)}).catch(function(e){n.reject(e)});break;case"CANCEL":r._id=a,r._cancel().then(function(e){n.resolve(e)}).catch(function(e){n.reject(e)});break;default:n.reject({errors:"Not implemented action: "+e})}else n.reject({errors:"Operation is not periodic!"})}else n.reject({errors:"Operation with id "+r._operationId+" not exists"})}).catch(function(e){n.reject(e)}),i}},{key:"_readAndUpdate",value:function(e,t){var r=u.default.defer(),n=r.promise,i=this;return i._ogapi.newOperationFinder().findById(i._operationId).then(function(n){var o=n.data;o?function(){var n=!!o.operation&&o.operation.active;n?i.pause().then(function(o){i._update(e,t||n).then(function(e){r.resolve(e)}).catch(function(e){r.reject(i._formatError(e))})}).catch(function(e){r.reject(i._formatError(e))}):i._update(e,t||n).then(function(e){r.resolve(e)}).catch(function(e){r.reject(i._formatError(e))})}():r.reject("Operation with id "+i._operationId+" not exists")}).catch(function(e){r.reject(i._formatError(e))}),n}},{key:"_update",value:function(e,t){var r=this,n=this,i=u.default.defer(),o=i.promise,a={};return a[n._key]=e,this._ogapi.Napi.put(this._resource,a).then(function(e){if(t)n.active().then(function(e){i.resolve(e)}).catch(function(e){i.reject(this._formatError(e))});else if(200===e.status){var r=""!=e.text?JSON.parse(e.text):{};e.status;i.resolve(e)}else i.reject({errors:e.errors,statusCode:e.status})}).catch(function(e){i.reject(r._formatError(e))}),o}},{key:"_formatError",value:function(e){return e.data||(e.data={}),e.data.errors||(e.data.errors=["string"==typeof e?{message:e}:e]),e}}]),e}();r.default=l,t.exports=r.default},{moment:113,q:117}],214:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../GenericFinder"),c=n(s),l=e("q"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this._limit=void 0}return o(t,e),a(t,[{key:"findById",value:function(e){return this._id=e,this._baseUrl="operation/jobs",this._entity="job",this._error_not_found="Operation not found",this._execute()}},{key:"findPeriodicityById",value:function(e){this._id=e;var t=this,r=f.default.defer(),n=r.promise;return t.findById(e).then(function(e){var n=e.data;n&&0!=Object.keys(n).length?(t._id=e.data.taskId,t._baseUrl="operation/tasks",t._entity="task",t._error_not_found="Operation is not periodic!",t._execute().then(function(e){e.data.id=t._id,r.resolve(e)}).catch(function(e){r.reject(e)})):r.reject({errors:t._error_not_found})}).catch(function(e){r.reject(e)}),n}},{key:"findPeriodicityByPeriodicityId",value:function(e){var t=this,r=f.default.defer(),n=r.promise;return t._id=e,t._baseUrl="operation/tasks",t._entity="task",t._execute().then(function(e){e.data.id=t._id,r.resolve(e)}).catch(function(e){r.reject(e)}),n}},{key:"findExecutionsById",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?10:arguments[1],r=arguments.length<=2||void 0===arguments[2]?1:arguments[2];if(this._id=e,this._baseUrl="operation/jobs",this._entity="operations",this._error_not_found="Executions not found","number"!=typeof t)throw new Error("size parameter must be a number");return("number"!=typeof r||r<1)&&(r=1),this._limit={size:t,start:r},this._execute()}},{key:"_composeUrl",value:function(){if("operations"===this._entity){this._limit&&this._setUrlParameters({start:this._limit.start,size:this._limit.size});return this._baseUrl+"/"+this._id+"/operations"}return this._baseUrl+"/"+this._id}}]),t}(c.default);r.default=d,t.exports=r.default},{"../GenericFinder":138,q:117}],215:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("./catalog/BaseOperationBuilder"),u=n(a),s=e("./catalog/period/PeriodicityUpdateBuilder"),c=n(s),l=e("q"),f=n(l),d=e("merge"),h=n(d),p=function(){function e(t){i(this,e),this._ogapi=t,this._operations=[],this._operationNames=[]}return o(e,[{key:"updatePeriodicityBuilder",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"operationId"});var t=f.default.defer(),r=t.promise,n=this;return this._ogapi.newOperationFinder().findPeriodicityById(e).then(function(e){t.resolve(n._createPeriodicBuilder(e.data))}).catch(function(e){t.reject(e)}),r}},{key:"builderByOperationName",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"name"});var t=f.default.defer(),r=t.promise,n=e.toUpperCase(),i=this._findOperation(n),o=this;return void 0===i?this._loadOperationCatalog().then(function(){var e=o._findOperation(n);void 0===e?t.reject("Operation <'"+n+"'> unavailable."):t.resolve(o._createBuilder(e.config))}):t.resolve(this._createBuilder(i.config)),r}},{key:"getOperationList",value:function(){return(0,h.default)(!0,this._operationNames)}},{key:"_createBuilder",value:function(e){return new u.default(this._ogapi,e)}},{key:"_createPeriodicBuilder",value:function(e){return new c.default(this._ogapi,e.id,e)}},{key:"_loadOperationCatalog",value:function(){var e=this,t=f.default.defer(),r=t.promise;return this._ogapi.operationTypesSearchBuilder().build().execute().then(function(r){if(200===r.statusCode){var n=r.data;for(var i in n){var o=n[i].name.toUpperCase();e._operationNames.push(o),e._operations.push({name:o,config:n[i]})}}t.resolve(e)}).catch(function(r){t.resolve(e)}),r}},{key:"_findOperation",value:function(e){return this._operations.find(function(e){return e.name==this},e)}}]),e}();r.default=p,t.exports=r.default},{"./catalog/BaseOperationBuilder":218,"./catalog/period/PeriodicityUpdateBuilder":226,merge:112,q:117}],216:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("q"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t,r){if(n(this,e),"string"!=typeof r)throw new Error("Parameter taskId must be a string");this._ogapi=t,this._resource="operation/tasks/",this._taskId=r,this._key="task"}return i(e,[{key:"activate",value:function(){var e={active:!0};return this._periodicityActions("ACTIVE",e)}},{key:"pause",value:function(){var e={active:!1};return this._periodicityActions("PAUSE",e)}},{key:"cancel",value:function(){return this._periodicityActions("CANCEL")}},{key:"_cancel",value:function(){var e=this,t=a.default.defer(),r=t.promise;return this._ogapi.Napi.delete(this._resource).then(function(r){200===r.statusCode?t.resolve({statusCode:r.statusCode,data:{id:e._id}}):t.reject({errors:r.errors,statusCode:r.statusCode})}).catch(function(r){t.reject(e._formatError(r))}),r}},{key:"_periodicityActions",value:function(e,t){var r=this,n=a.default.defer(),i=n.promise;return r._ogapi.newOperationFinder().findPeriodicityByPeriodicityId(r._taskId).then(function(i){var o=i.data;if(o&&0!=Object.keys(o).length){var a=o.id;switch(r._resource=r._resource+a,e){case"PAUSE":case"ACTIVE":r._update(t).then(function(e){n.resolve(e)}).catch(function(e){n.reject(e)});break;case"CANCEL":r._id=a,r._cancel().then(function(e){n.resolve(e)}).catch(function(e){n.reject(e)});break;default:n.reject({errors:"Not implemented action: "+e})}}else n.reject("Periodicity with id "+r._taskId+" not exists")}).catch(function(e){n.reject(e)}),i}},{key:"_readAndUpdate",value:function(e,t){var r=a.default.defer(),n=r.promise,i=this;return i._ogapi.newOperationFinder().findPeriodicityByPeriodicityId(i._taskId).then(function(n){var o=n.data;o?function(){var n=!!o.task&&"ACTIVE"===o.task.state;n?i.pause().then(function(o){i._update(e,t||n).then(function(e){r.resolve(e)}).catch(function(e){r.reject(i._formatError(e))})}).catch(function(e){r.reject(i._formatError(e))}):i._update(e,t||n).then(function(e){r.resolve(e)}).catch(function(e){r.reject(i._formatError(e))})}():r.reject("Periodicity with id "+i._taskId+" not exists")}).catch(function(e){r.reject(i._formatError(e))}),n}},{key:"_update",value:function(e,t){var r=this,n=this,i=a.default.defer(),o=i.promise,u={};return u[n._key]=e,this._ogapi.Napi.put(this._resource,u).then(function(e){t?n.active().then(function(e){i.resolve(e)}).catch(function(e){i.reject(this._formatError(e))}):200===e.status?i.resolve(e):i.reject({errors:e.errors,statusCode:e.status})}).catch(function(e){i.reject(r._formatError(e))}),o}},{key:"_formatError",value:function(e){return e.data||(e.data={}),e.data.errors||(e.data.errors=["string"==typeof e?{message:e}:e]),e}}]),e}();r.default=u,t.exports=r.default},{q:117}],217:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(){function e(t,r){n(this,e),this._ogapi=t,this._parent=r}return i(e,[{key:"filter",value:function(e,t){if(void 0===this._parent._config.applicableTo.find(function(e){return e==this},t))throw new Error("Entity type <'"+t+"'> not allowed to operation <'"+this._parent._config.name+"'>. Entity types allowed <'"+JSON.stringify(this._parent._config.applicableTo)+"'>");return this._parent._entityTypeWhenFilter=t,void 0!==this._parent._build.target&&console.warn("An Operation only allow one kind of way to append entities. Filter | Tag | List of entities. Now Filter will remove the last way appended ."),void 0!==e._filterTemplate?this._parent._build.target={filter:e._filterTemplate.filter}:this._parent._build.target={filter:e},this._parent}},{key:"list",value:function(e){var t=this;if(void 0===e||e.constructor!==Array)throw new Error("Parameter entities must be typeof Array");return void 0!==this._parent._build.target&&console.warn("An Operation only allow one kind of way to append entities. Filter | Tag | List of entities. Now List of entities will remove the last way appended ."),this._parent._build.target={append:{}},e.forEach(function(e){if(e.constructor===String)t._parent._build.target.append.entities||(t._parent._build.target.append.entities=[]),t._parent._build.target.append.entities.push(e);else{if(!e.id||!e.parameters)throw new Error("Entity parameters must include id and parameters: "+JSON.stringify(e));t._parent._build.target.append.entitiesWithParameters||(t._parent._build.target.append.entitiesWithParameters=[]),t._parent._build.target.append.entitiesWithParameters.push(e)}}),this._parent}},{key:"tag",value:function(e){return void 0!==this._parent._build.target&&console.warn("An Operation only allow one kind of way to append entities. Filter | Tag | List of entities. Now Tag will remove the last way appended ."),this._parent._build.target={append:{tags:[e]}},this._parent}}]),e}();r.default=o,t.exports=r.default},{}],218:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("merge"),u=n(a),s=e("./Operation"),c=n(s),l=e("./parameters/ParameterBuilderFactory"),f=(n(l),e("./AppendEntitiesBy")),d=n(f),h=e("./period/ExecuteEachBuilder"),p=n(h),y=e("./period/ExecuteEveryBuilder"),m=n(y),v=e("moment"),_=n(v),g=e("./../../util/DATE_FORMAT"),b=e("ajv"),w=n(b),E={gte:function(e){if(e<this)throw new Error("Value expected must be greater than <"+this+">. Value setted <"+e+">")},list:function(e){if(void 0===this.find(function(e){return e==this},e))throw new Error("Value must be one of these: "+JSON.stringify(this))},editable:function(e){return!0}},A=function(){function e(t,r){i(this,e),this._ajv=new w.default({useDefaults:"empty",coerceTypes:!0}),this.appendEntitiesBy=new d.default(t,this),this._config=r,this._ogapi=t,this._resourcesAvailables={job:"/jobs",task:"/tasks"},this._entityTypeWhenFilter=void 0,this._build={operationParameters:{ackTimeout:0,timeout:9e4,retries:0,retriesDelay:0,retryResultList:[]},name:r.name,schedule:{}},void 0!==r.parameters&&(this._build.parameters={})}return o(e,[{key:"withNotes",value:function(e){if(null===e)return delete this._build.userNotes,this;if("string"!=typeof e)throw new Error("Parameter notes must be a string");return this._build.userNotes=e,this}},{key:"withCallback",value:function(e){if(null===e)return delete this._build.callback,delete this._build.notify,this;if("string"!=typeof e)throw new Error("Parameter url must be a string");return this._build.callback=e,this._build.notify=!0,this}},{key:"withScatteringMaxSpread",value:function(e){if(null===e&&void 0!==this._build.schedule.scattering)return delete this._build.schedule.scattering.maxSpread,this;if("number"!=typeof e)throw new Error("Parameter percentage must be a number");if(e<0||e>100)throw new Error("The value of percentage parameter must be between 0-100");return void 0===this._build.schedule.scattering&&(this._build.schedule.scattering={}),this._build.schedule.scattering.maxSpread=e,this}},{key:"withScatteringStrategy",value:function(e,t){if(null===e&&void 0!==this._build.schedule.scattering)return delete this._build.schedule.scattering.strategy,this;if("number"!=typeof e)throw new Error("Parameter factor must be a number");if(e<0||e>100)throw new Error("The value of factor parameter must be between 0-100");return void 0===this._build.schedule.scattering&&(this._build.schedule.scattering={}),this._build.schedule.scattering.strategy={field:"subscription.collected.cellInfo",factor:e},"number"==typeof t&&(this._build.schedule.scattering.strategy.warningMaxRate=t),this}},{key:"executeImmediately",value:function(){return this._build.active=!0,void 0!==this._build.schedule&&delete this._build.schedule.start,delete this._build.task,this}},{key:"executeIDLE",value:function(){throw new Error("Not implemented yet")}},{key:"executeLater",value:function(e){var t=arguments.length<=1||void 0===arguments[1]||arguments[1];if("number"!=typeof e)throw new Error("Parameter minutes must be typeof number");return this._build.active=t,void 0===this._build.schedule&&(this._build.schedule={}),this._build.schedule.start={delayed:_.default.duration(e,"minutes").asMilliseconds()},delete this._build.task,this}},{key:"executeEvery",value:function(e,t,r,n,i){if(void 0===n&&(n=!0),void 0===e||e.constructor!==Date)throw new Error("Parameter date must be typeof Date");var o=Array.prototype.slice.call(arguments),a=this._getName(o.slice(1,3)),u=this._getEnd(o.slice(1,3));return this._build.active=n,new m.default(this,e,a,u,i)}},{key:"executeEach",value:function(e,t,r,n,i){if(void 0===n&&(n=!0),void 0===e||e.constructor!==Date)throw new Error("Parameter date must be typeof Date");var o=Array.prototype.slice.call(arguments),a=this._getName(o.slice(1,3)),u=this._getEnd(o.slice(1,3));return this._build.active=n,new p.default(this,e,a,u,i)}},{key:"_getName",value:function(e){for(var t=0;t<e.length;t++)if("string"==typeof e[t])return e[t];return this._build.name+" "+this._ogapi.Napi._options.apiKey}},{key:"_getEnd",value:function(e){for(var t=0;t<e.length;t++)if("number"==typeof e[t]||e[t]&&e[t].constructor===Date)return e[t]}},{key:"withJobTimeout",value:function(e){if(null===e)return delete this._build.schedule.stop,this;if("number"!=typeof e)throw new Error("Parameter minutes must be a number");return this._build.schedule.stop={delayed:_.default.duration(e,"minutes").asMilliseconds()},this}},{key:"withAckTimeout",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"milliseconds":arguments[1];return this._addSpecificParameter(_.default.duration(e,t).asMilliseconds(),"ackTimeout"),this}},{key:"withTimeout",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"milliseconds":arguments[1];return this._addSpecificParameter(_.default.duration(e,t).asMilliseconds(),"timeout"),this}},{key:"withRetriesDelay",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"milliseconds":arguments[1];return this._addSpecificParameter(_.default.duration(e,t).asMilliseconds(),"retriesDelay"),this}},{key:"withOperationRetries",value:function(e){return this._addSpecificParameter(e,"retryResultList"),this}},{key:"withRetries",value:function(e){return this._addSpecificParameter(e,"retries"),this}},{key:"withParameters",value:function(e){if(this._config.parameters)return this._build.parameters=e,this._checkMandatoryParameters(),this;throw new Error("This operation does not support parameters")}},{key:"withParameter",value:function(e,t){if(this._config.parameters)return this._build.parameters||(this._build.parameters={}),this._build.parameters[e]=t,this;throw new Error("This operation does not support parameters")}},{key:"build",value:function(){var e=void 0,t=(0,u.default)(!0,this._build),r=void 0,n=[];try{this._checkMandatoryParameters()}catch(e){n.push(e.message)}if(void 0===this._build.task&&void 0===this._build.schedule.start&&void 0===this._build.active&&(console.info("Not specified the way to execute [executeImmediately, executeIDLE, executeLater]. By default executeImmediately will be the way"),this.executeImmediately()),void 0===this._build.target&&this._build.active&&n.push("Must be entities appended if you want execute immediately. You must invoke appendEntitiesBy.list or appendEntitiesBy.tags or appendEntitiesBy.filter"),void 0!==this._build.target&&void 0!==this._build.target.filter&&"string"!=typeof this._entityTypeWhenFilter&&n.push("Must be selected the entity type allowed when filter is the way to append entities. Allowed entity types <'"+JSON.stringify(this._config.applicableTo)+"'>"),void 0!==this._build.task){var i=this._build.task,o=this._build.schedule.stop;if(void 0!==i.repeating.period){var a=void 0;switch(i.repeating.period.unit){case"DAYS":a=_.default.duration(i.repeating.period.each,"days").asMilliseconds();break;case"HOURS":a=_.default.duration(i.repeating.period.each,"hours").asMilliseconds();break;case"MINUTES":a=_.default.duration(i.repeating.period.each,"minutes").asMilliseconds()}void 0!==o&&"number"==typeof o.delayed?o.delayed>=a&&n.push("You can not execute an operation with a job timeout greater than the repetition period."):(o=_.default.duration(a,"milliseconds").asMinutes()-1,console.info("Not specified the job timeout. By default, timeout will be "+o+" minutes"),this.withJobTimeout(o))}}if(n.length>0)throw this._build=t,n;void 0===this._build.schedule.stop&&(console.info("Not specified the job timeout. By default, timeout will be 30 days"),this.withJobTimeout(43200)),void 0!==this._build.task?(e=this._resourcesAvailables.task,r=this._convertToTask(this._build)):(e=this._resourcesAvailables.job,r=this._convertToJob(this._build)),void 0!==this._build.target&&void 0!==this._build.target.filter&&(e=e+"?entityType="+this._entityTypeWhenFilter);var s=new c.default(this._ogapi,e,r);return this._build=t,s}},{key:"_convertToTask",value:function(e){var t=e.task;this.executeImmediately();var r=this._convertToJob(this._build),n=(0,_.default)(new Date),i=(0,_.default)(t.start),o={task:{active:!0,name:t.name,description:t.description,job:r.job,schedule:{start:{date:i.format(g.DATE_FORMAT)},repeating:t.repeating}}};if(void 0!==t.stop&&(void 0!==t.stop.date?o.task.schedule.stop={date:(0,_.default)(t.stop.date).format(g.DATE_FORMAT)}:o.task.schedule.stop=t.stop),_.default.max(n,i)==n){if(void 0!==t.stop&&void 0!==t.stop.date){var a=(0,_.default)(t.stop.date);if(_.default.max(n,a)==n)throw new Error("Can not create operation object because stop operation period is earlier than current date. It happened because you passed a lot of time between configuration of an operation and create the operation.")}delete o.task.schedule.start}return o}},{key:"_convertToJob",value:function(e){return 0===e.operationParameters.ackTimeout&&delete e.operationParameters.ackTimeout,{job:{request:e}}}},{key:"_addSpecificParameter",value:function(e,t){this._build.operationParameters[t]=e}},{key:"_checkParam",value:function(e,t){if("number"===t.type&&"number"!=typeof e)throw new Error(t.name+": Expected number but found "+typeof e);for(var r in t.attributes)"function"==typeof E[r]&&E[r].call(t.attributes[r],e)}},{key:"_checkMandatoryParameters",value:function(){if(this._config.parameters&&this._config.parameters.schema){var e=this._ajv.compile(this._config.parameters.schema);if(!e(this._build.parameters))throw new Error(e.errors)}}}]),e}();r.default=A,t.exports=r.default},{"./../../util/DATE_FORMAT":337,"./AppendEntitiesBy":217,"./Operation":219,"./parameters/ParameterBuilderFactory":221,"./period/ExecuteEachBuilder":223,"./period/ExecuteEveryBuilder":224,ajv:2,merge:112,moment:113}],219:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("q"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t,r,i){n(this,e),this._ogapi=t,this._resource="operation"+r,this._postObj=i}return i(e,[{key:"updatePeriodicity",value:function(){var e=this,t=a.default.defer(),r=this._resource.substring(this._resource.lastIndexOf("/")+1);return this._ogapi.Napi.put(this._resource,this._postObj).then(function(n){var i=void 0;try{i=JSON.parse(n.text)}catch(t){console.warn("Error parsing response data when execute post action to "+e._resource)}t.resolve({data:i||{},statusCode:n.statusCode,id:r})}).catch(function(e){e.data||(e.data={}),e.data.errors||(e.data.errors=["string"==typeof e?{message:e}:e]),t.reject(e)}),t.promise}},{key:"execute",value:function(){var e=this,t=a.default.defer();return this._ogapi.Napi.post(this._resource,this._postObj).then(function(r){var n=void 0;try{n=JSON.parse(r.text)}catch(t){console.warn("Error parsing response data when execute post action to "+e._resource)}t.resolve({data:n||{},statusCode:r.statusCode,location:r.header.location})}).catch(function(e){e.data||(e.data={}),e.data.errors||(e.data.errors=["string"==typeof e?{message:e}:e]),t.reject(e)}),t.promise}}]),e}();r.default=u,t.exports=r.default},{q:117}],220:[function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("moment"),u=(function(e){e&&e.__esModule}(a),function(){function e(t,r,n){i(this,e),this._parent=n,this._build="array"===r.type?[]:void 0,this._config=r,this[function(e){return function(e){var t=void 0;switch(e.type){case"array":t="add";break;default:t="with"}return t}(e)+e.name[0].toUpperCase()+e.name.slice(1)}(r)]=this._appendParameterValue}return o(e,[{key:"_appendParameterValue",value:function(e){return this._isTypeValueAllow(e)?this._isAllowValue(e)?("array"===this._config.type?this._build.push(e):this._build=e,this):(console.warn("Parameter <'"+this._config.name+"'> not allow value setted <'"+e+"'>. Only are allowed this configuration:"+JSON.stringify(this._config.attributes)),this):(console.warn("Parameter <'"+this._config.name+"'> not allow type of value setted <'"+typeof e+"'>. Only are allowed this type: "+this._getType()),this)}},{key:"_isString",value:function(){return"string"===this._config.type||"string"===this._config.subtype}},{key:"_isObject",value:function(){return"object"===this._config.type||"object"===this._config.subtype}},{key:"_isNumber",value:function(){return"number"===this._config.type||"number"===this._config.subtype}},{key:"_isArray",value:function(){return"array"===this._config.type||"array"===this._config.subtype}},{key:"_isBoolean",value:function(){return"boolean"===this._config.type||"boolean"===this._config.subtype}},{key:"_isDate",value:function(){return"date"===this._config.type||"date"===this._config.subtype}},{key:"_isTime",value:function(){return"time"===this._config.type||"time"===this._config.subtype}},{key:"_getType",value:function(){return this._isArray()?"array":this._isString()||this._isDate()||this._isTime()?"string":this._isObject()?"object":this._isNumber()?"number":this._isBoolean()?"boolean":"unknown"}},{key:"_isTypeValueAllow",value:function(e){var t=!0,r=typeof e;return(this._isString()||this._isTime()||this._isDate())&&"string"!==r&&(t=!1),this._isNumber()&&"number"!==r&&(t=!1),this._isObject()&&"object"!==r&&(t=!1),this._isBoolean()&&"boolean"!==r&&(t=!1),t}},{key:"_isAllowValue",value:function(e){if(void 0!==this._config.attributes){var t=this._config.attributes;if(void 0!==t.list)return void 0!==t.list.find(function(e){return e==this},e)}return!0}},{key:"build",value:function(){if(this._config.required&&(void 0===this._build||0===this._build.length))throw new Error("Parameter <'"+this._config.name+"'> is required and their value is not defined");var e={name:this._config.name,value:n({},this._getType(),this._build)};return void 0!==this._build&&0!==this._build.length||(e=void 0),e}},{key:"buildAndAppend",value:function(){var e=this.build();if(void 0!==e){
|
|
30
|
-
var t=this._parent._build.parameters.findIndex(function(e){return e.name==this.name},e);-1===t?this._parent._build.parameters.push(e):this._parent._build.parameters[t]=e}return this._parent}}]),e}());r.default=u,t.exports=r.default},{moment:113}],221:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=e("./BaseParameterBuilderWithParent"),o=(function(e){e&&e.__esModule}(i),function e(t,r,i){n(this,e)});r.default=o,t.exports=r.default},{"./BaseParameterBuilderWithParent":220}],222:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["MON","TUE","WED","THU","FRI","SAT","SUN"];r.DAYS_ENUM=n},{}],223:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("merge"),u=n(a),s=e("moment"),c=n(s),l=function(){function e(t,r,n,o,a){if(i(this,e),this._parent=t,this._skeleton={start:r,stop:o,name:n,description:a,repeating:{period:{each:void 0,unit:void 0}}},void 0!==o){var u=void 0;if("number"==typeof o){if(o<=0)throw new Error("Invalid stop value. Number of repetitions must be greater than 0.");u={executions:o}}else if(o.constructor===Date){var s=(0,c.default)(r),l=(0,c.default)(o);if(c.default.max(s,l)==s)throw new Error("Invalid stop date on executeEach method. Start date must be earlier than stop date.");u={date:o}}this._skeleton.stop=u}}return o(e,[{key:"minutes",value:function(e){if("number"!=typeof e)throw new Error("Parameter minutes must be typeof number");return this._addPeriod(e,"MINUTES")}},{key:"hours",value:function(e){if("number"!=typeof e)throw new Error("Parameter hours must be typeof number");return this._addPeriod(e,"HOURS")}},{key:"days",value:function(e){if("number"!=typeof e)throw new Error("Parameter days must be typeof number");return this._addPeriod(e,"DAYS")}},{key:"_addPeriod",value:function(e,t){var r=(0,u.default)(!0,this._skeleton);return r.repeating.period.each=e,r.repeating.period.unit=t,this._parent._build.task=r,this._parent}}]),e}();r.default=l,t.exports=r.default},{merge:112,moment:113}],224:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("./MONTHS_ENUM"),u=e("./pattern/ByWeek"),s=n(u),c=e("./pattern/ByYear"),l=n(c),f=e("./pattern/ByMonth"),d=n(f),h=e("./pattern/ByGeneric"),p=n(h),y=function(){function e(t,r,n,o,a){i(this,e),this.year=new l.default(t,r,n,o,a),this.week=new s.default(t,r,n,o,a),this._day=new p.default(t,r,n,o,a),this._date=r,this._end=o,this._parent=t,this._periodicityName=n,this._description=a}return o(e,[{key:"day",value:function(){return this._day._build()}},{key:"month",value:function(e){var t=this._parent._task;if(void 0===e||e.constructor!==Array){var r=!0;if(t){var n=t.schedule.repeating.pattern;if(n){var i=n.monthly;i&&(r=!1,e=i.months)}}if(r)throw new Error("Parameter months must be typeof Array")}if(0===e.length)throw new Error("Parameter months must have at least one month");for(var o=[],u=0;u<e.length;u++){var s=a.MONTHS_ENUM.find(function(e){return e==this},e[u]);void 0===s&&o.push(s)}if(0!==o.length)throw new Error("Any month into parameter months is not allowed. Parameter value <'"+JSON.stringify(o)+"'>, Months allowed <'"+JSON.stringify(a.MONTHS_ENUM)+"'>");return new d.default(this._parent,this._date,this._periodicityName,e,this._end,this._description)}}]),e}();r.default=y,t.exports=r.default},{"./MONTHS_ENUM":225,"./pattern/ByGeneric":227,"./pattern/ByMonth":228,"./pattern/ByWeek":229,"./pattern/ByYear":230}],225:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"];r.MONTHS_ENUM=n},{}],226:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("merge"),u=n(a),s=e("moment"),c=n(s),l=e("../Operation"),f=n(l),d=e("./ExecuteEveryBuilder"),h=n(d),p=e("./ExecuteEachBuilder"),y=n(p),m=e("./pattern/ByGeneric"),v=n(m),_=e("./../../../util/DATE_FORMAT"),g=function(){function e(t,r,n){i(this,e),this._ogapi=t,this._task=n,this.task_id=r,this._resource="/tasks/"+this.task_id,this._build=(0,u.default)(!0,this._task.job.request)}return o(e,[{key:"executeEvery",value:function(e,t){var r=Array.prototype.slice.call(arguments),n=this._getEnd(r.slice(1,3));return e=this._getStart(e),this._byGeneric=new v.default(this,e,null,t)._build(),new h.default(this,e,null,n)}},{key:"executeEach",value:function(e,t){var r=Array.prototype.slice.call(arguments),n=this._getEnd(r.slice(1,3)),i=this._task.schedule;if(e=this._getStart(e),i&&i.repeating&&i.repeating.period){var o=i.repeating.period;return new y.default(this,e,null,n)._addPeriod(o.each,o.unit)}return new y.default(this,e,null,n)}},{key:"_getStart",value:function(e){var t=this._task.schedule;return!e&&t.start&&t.start.date&&(e=new Date(t.start.date)),e}},{key:"_getEnd",value:function(e){for(var t=0;t<e.length;t++)if("number"==typeof e[t]||e[t].constructor===Date)return e[t];var r=this._task.schedule;if(r.stop&&r.stop.date)return new Date(r.stop.date)}},{key:"build",value:function(){var e=(0,u.default)(!0,this._build),t=void 0,r=[];if(void 0!==this._build.task){var n=this._build.task,i=this._build.schedule.stop;if(void 0!==n.repeating.period){var o=void 0;switch(n.repeating.period.unit){case"DAYS":o=c.default.duration(n.repeating.period.each,"days").asMilliseconds();break;case"HOURS":o=c.default.duration(n.repeating.period.each,"hours").asMilliseconds();break;case"MINUTES":o=c.default.duration(n.repeating.period.each,"minutes").asMilliseconds()}void 0!==i&&"number"==typeof i.delayed&&i.delayed>=o&&r.push("You can not execute an operation with a job timeout greater than the repetition period.")}}if(r.length>0)throw this._build=e,r;void 0!==this._build.task&&(t=this._updateTask(this._build));var a=new f.default(this._ogapi,this._resource,t);return this._build=e,a}},{key:"_updateTask",value:function(e){var t=e.task,r=(0,c.default)(new Date),n=(0,c.default)(t.start),i={task:{schedule:{}}};try{t.start&&(i.task.schedule.start={date:n.format(_.DATE_FORMAT)}),t.stop&&(i.task.schedule.stop={date:(0,c.default)(t.stop).format(_.DATE_FORMAT)}),t.repeating&&(i.task.schedule.repeating=t.repeating)}catch(e){}if(delete i.task.schedule.name,void 0!==t.stop&&(void 0!==t.stop.date?i.task.schedule.stop={date:(0,c.default)(t.stop.date).format(_.DATE_FORMAT)}:i.task.schedule.stop=t.stop),c.default.max(r,n)==r){if(void 0!==t.stop&&void 0!==t.stop.date){var o=(0,c.default)(t.stop.date);if(c.default.max(r,o)==r)throw new Error("Can not create operation object because stop operation period is earlier than current date. It happened because you passed a lot of time between configuration of an operation and create the operation.")}delete i.task.schedule.start}return i}}]),e}();r.default=g,t.exports=r.default},{"../Operation":219,"./../../../util/DATE_FORMAT":337,"./ExecuteEachBuilder":223,"./ExecuteEveryBuilder":224,"./pattern/ByGeneric":227,merge:112,moment:113}],227:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("moment"),u=n(a),s=e("merge"),c=n(s),l=e("./../../../../util/DATE_FORMAT"),f=function(){function e(t,r,n,o,a){if(i(this,e),this._parent=t,this._skeleton={start:r,stop:o,name:n,description:a,repeating:{pattern:{time:(0,u.default)(r).format(l.TIME_FORMAT)}}},void 0!==o){var s=void 0;if("number"==typeof o)s={executions:o};else if(o.constructor===Date){var c=(0,u.default)(r),f=(0,u.default)(o);if(u.default.max(c,f)==c)throw new Error("Invalid stop date on executeEvery method. Start date must be earlier than stop date.");s={date:o}}this._skeleton.stop=s}}return o(e,[{key:"_create",value:function(){return(0,c.default)(!0,this._skeleton)}},{key:"_build",value:function(){return this._parent._build.task=this._create(),this._parent}}]),e}();r.default=f,t.exports=r.default},{"./../../../../util/DATE_FORMAT":337,merge:112,moment:113}],228:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./ByGeneric"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e,r,i,o,u,s){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,i,u,s),this._months=o;var c=e._task;if(c){var l=c.schedule.repeating.pattern;if(l){var f=l.monthly;f&&(this._day=f.day,a(Object.getPrototypeOf(t.prototype),"_build",this).call(this))}}}return i(t,e),o(t,[{key:"day",value:function(e){if("number"!=typeof e)throw new Error("Parameter day must be typeof number");if(e>31||e<1)throw new Error("Parameter day must be greater than 1 and less than 31");return this._day=e,this._build()}},{key:"_create",value:function(){var e=a(Object.getPrototypeOf(t.prototype),"_create",this).call(this);return e.repeating.pattern.monthly={day:this._day,months:this._months},e}}]),t}(s.default);r.default=c,t.exports=r.default},{"./ByGeneric":227}],229:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./ByGeneric"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=e("./../DAYS_ENUM"),l=function(e){function t(e,r,i,o,u){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,i,o,u)}return i(t,e),o(t,[{key:"days",value:function(e){if(void 0===e||e.constructor!==Array)throw new Error("Parameter days must be typeof Array");if(0===e.length)throw new Error("Parameter days must have at least one day");for(var t=[],r=0;r<e.length;r++){var n=c.DAYS_ENUM.find(function(e){return e==this},e[r]);void 0===n&&t.push(n)}if(0!==t.length)throw new Error("Any day into parameter days is not allowed. Parameter value <'"+JSON.stringify(e)+"'>, Months allowed <'"+JSON.stringify(c.DAYS_ENUM)+"'>");return this._days=e,this._build()}},{key:"_create",value:function(){var e=a(Object.getPrototypeOf(t.prototype),"_create",this).call(this);return e.repeating.pattern.weekly={days:this._days},e}}]),t}(s.default);r.default=l,t.exports=r.default},{"./../DAYS_ENUM":222,"./ByGeneric":227}],230:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./ByGeneric"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=e("./../MONTHS_ENUM"),l=function(e){function t(e,r,i,o,u){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,i,o,u);var s=e._task;if(s){var c=s.schedule.repeating.pattern;if(c){var l=c.yearly;l&&(this._day=l.day,this._month=l.month,a(Object.getPrototypeOf(t.prototype),"_build",this).call(this))}}}return i(t,e),o(t,[{key:"day",value:function(e){if("number"!=typeof e){if(!this._day)throw new Error("Parameter day must be typeof number");month=this._day}if(e>31||e<1)throw new Error("Parameter day must be greater than 1 and less than 31");return this._day=e,void 0===this._month?this:this._parent._task?(this._build(),this):this._build()}},{key:"month",value:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e){if("string"!=typeof e){if(!this._month)throw new Error("OGAPI_PARAMETER_MONTH_MUST_BE_STRING");e=this._month}if(void 0===c.MONTHS_ENUM.find(function(e){return e==this},e))throw new Error("Any month into parameter months is not allowed. Parameter value <'"+e+"'>, Months allowed <'"+JSON.stringify(c.MONTHS_ENUM)+"'>");return this._month=e,void 0===this._day?this:this._parent._task?(this._build(),this):this._build()})},{key:"_create",value:function(){var e=a(Object.getPrototypeOf(t.prototype),"_create",this).call(this);return e.repeating.pattern.yearly={day:this._day,month:this._month},e}}]),t}(s.default);r.default=l,t.exports=r.default},{"./../MONTHS_ENUM":225,"./ByGeneric":227}],231:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../ProvisionGenericFinder"),c=n(s),l=e("q"),f=n(l),d=e("http-status-codes"),h=n(d),p=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations","organization","Organization not found")}return o(t,e),a(t,[{key:"findByName",value:function(e){return this._id=e,this._execute()}},{key:"findByDomainAndWorkgroup",value:function(e,t){this._domain=e,this._workgroup=t;var r=f.default.defer(),n=r.promise,i=this._error_not_found;return this._executeWorkgroupRelation().then(function(e){if(204===e.statusCode)r.reject({data:i,statusCode:h.default.NOT_FOUND});else{var t=e.data,n={},o=[];for(var a in t.channels)n[t.channels[a].organization]||(n[t.channels[a].organization]=t.channels[a].organization,o.push({name:t.channels[a].organization}));o.length>0?r.resolve({data:o,statusCode:e.statusCode}):r.reject({data:i,statusCode:h.default.NOT_FOUND})}}).catch(function(e){r.reject(e)}),n}},{key:"_executeWorkgroupRelation",value:function(){var e="provision/domains/"+this._domain+"/workgroups/"+this._workgroup+"/relations",t=f.default.defer(),r=t.promise,n=this._error_not_found;return this._api.get(e,void 0,this._getExtraHeaders(),this._getUrlParameters()).then(function(e){204===e.statusCode?t.reject({data:n,statusCode:h.default.NOT_FOUND}):t.resolve({data:e.body.workgroupRelation,statusCode:e.statusCode})}).catch(function(e){t.reject(e)}),r}}]),t}(c.default);r.default=p,t.exports=r.default},{"../ProvisionGenericFinder":140,"http-status-codes":76,q:117}],232:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../provision/BaseProvision"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e,r){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations"+(void 0===r?"":r)),this._name=void 0,this._description=void 0,this._countryCode=void 0,this._langCode=void 0,this._timeZone=void 0,this._zoom=void 0,this._location=void 0}return i(t,e),o(t,[{key:"withName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._name=e,this}},{key:"withDomain",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._domain=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_250");return this._description=e,this}},{key:"withCountryCode",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER");return this._countryCode=e.toUpperCase(),this}},{key:"withLangCode",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER");return this._langCode=e.toLowerCase(),this}},{key:"withTimeZone",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER");return this._timeZone=e,this}},{key:"withPlan",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER");return this._plan=e,this}},{key:"withOnlyAssignedDomainCertificates",value:function(e){if("boolean"!=typeof e||!0!==e&&!1!==e)throw new Error("Parameter OnlyAssignedDomainCertificates must be a boolean and cannot be empty");return this._onlyDomainCerts=e,this}},{key:"withZoom",value:function(e){if("number"!=typeof(e*=1)||e<0||e>19)throw new Error("Parameter zoom must be a number between 0 and 19");return this._zoom=e,this}},{key:"withLocation",value:function(e,t){if(e*=1,t*=1,"number"!=typeof e||"number"!=typeof t)throw new Error("Latitude and longitude parameters must be numbers");if(e<-90||e>90)throw new Error("Parameter latitude value must be between -90 and 90");if(t<-180||t>180)throw new Error("Parameter longitude value must be between -180 and 180");return this._location={latitude:e,longitude:t},this}},{key:"withAuth",value:function(e){if(!e||!e.type)throw new Error("Auth cannot be empty and must have type at least");this._security||(this._security={}),this._security.auth=e}},{key:"withPasswordPolicy",value:function(e){if(!e)throw new Error("Password policy cannot be empty");this._security||(this._security={}),this._security.policies={password:{checkStrength:!!e.checkStrength,expirationPeriod:e.expirationPeriod||0}}}},{key:"_composeElement",value:function(){if(void 0===this._name||void 0===this._langCode||void 0===this._countryCode)throw new Error("Parameters name, country code and lang code must be defined");var e={};void 0!=this._zoom&&(e.zoom=this._zoom),void 0!=this._location&&(e.location=this._location);var t={organization:{name:this._name||void 0,description:this._description||void 0,plan:this._plan||void 0,countryCode:this._countryCode||void 0,langCode:this._langCode||void 0,timezone:this._timeZone||void 0,onlyAssignedDomainCertificates:"boolean"!=typeof this._onlyDomainCerts?this._onlyDomainCerts:void 0}};return this._domain&&(t.organization.domain=this._domain),(e.zoom||e.location)&&(t.organization.mapDefault=e),this._security&&(t.organization.security=this._security),t}},{key:"_composeUpdateElement",value:function(){if(this._domain)throw new Error("The domain parameter is not allowed in the update");var e=this._composeElement();return delete e.organization.name,e}},{key:"_buildURL",value:function(){if(void 0===this._name)throw new Error("Parameter name must be defined");return this._resource+"/"+this._name}}]),t}(s.default);r.default=c,t.exports=r.default},{"../provision/BaseProvision":235}],233:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"ai","list","Pipeline not found","north")}return i(t,e),o(t,[{key:"findByOrganization",value:function(e){return this._organization=e,this._execute()}},{key:"findByOrganizationAndIdentifier",value:function(e,t){return this._organization=e,this._identifier=t,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/pipelines"+(this._identifier?"/"+this._identifier:"")}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":138}],234:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("q"),c=n(s),l=e("../provision/BaseProvision"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations",void 0,["name","actions","organization"],"north/ai"),this._ogapi=e}return o(t,e),a(t,[{key:"_buildURL",value:function(){return this._organization+"/pipelines/"+this._identifier}},{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"identifier"});return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"name"});return this._name=e,this}},{key:"withOrganization",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"organization"});return this._organization=e,this}},{key:"withActions",value:function(e){var t=this;if(!(e instanceof Array))throw new Error({message:"Parameter actions requires an array",parameter:"actions"});this._actions=[],e.forEach(function(e){t.addAction(e)})}},{key:"addAction",value:function(e){if("object"!=typeof e||!e.name||"string"!=typeof e.name||!e.type||"string"!=typeof e.type)throw new Error({message:"Parameter action requires name and type",parameter:"actions"});this._actions||(this._actions=[]),this._actions.push(e)}},{key:"prediction",value:function(e,t,r){var n=c.default.defer(),i=n.promise,o={input:e};t&&r&&(o.collect={deviceId:t,datastream:r});var n=c.default.defer(),i=n.promise;return this._ogapi.Napi.post(this._buildURL()+"/prediction",o,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then(function(e){n.resolve({statusCode:e.statusCode,body:e.body})}).catch(function(e){n.reject(e)}),i}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),this._resource=this._organization+"/pipelines",{name:this._name||void 0,actions:this._actions||void 0}}}]),t}(f.default);r.default=d,t.exports=r.default},{"../provision/BaseProvision":235,q:117}],235:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("q"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t,r,i,o,a){if(void 0===o&&(o=[]),n(this,e),this.constructor===e)throw new Error("Cannot construct Abstract instances directly");if("function"!=typeof this._composeElement)throw new Error("Must override method: composeElement");if("function"!=typeof this._buildURL)throw new Error("Must override method: _buildURL");i&&(this._timeout="number"!=typeof i?t.Napi._options.timeout:i),this._ogapi=t,this._resource="provision"+r,this._requiredParameters=o,this._headers=void 0,this._urlParameters=void 0,this._serviceBaseURL=a}return i(e,[{key:"_checkRequiredParameters",value:function(){var e=[];if(this._requiredParameters&&this._requiredParameters.length>0){for(var t=0;t<this._requiredParameters.length;t++)void 0===this[this._requiredParameters[t]]&&void 0===this["_"+this._requiredParameters[t]]&&e.push(this._requiredParameters[t]);if(e.length>0)throw new Error("There are required parameters that have not been set. Missing parameters: "+JSON.stringify(e).replace(new RegExp('"',"g"),""))}}},{key:"create",value:function(){var e=this;this._checkRequiredParameters();var t=a.default.defer(),r=t.promise,n=this._composeElement();return this._ogapi.Napi.post(this._resource,n,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then(function(r){201===r.statusCode?("function"==typeof e._onCreated&&e._onCreated(r.header.location),t.resolve({location:r.header.location,statusCode:r.statusCode})):t.reject({errors:r.errors,statusCode:r.statusCode})}).catch(function(e){t.reject(e)}),r}},{key:"delete",value:function(e){var t=a.default.defer(),r=t.promise;return this._ogapi.Napi.delete(this._buildURL(),this._timeout,this._getExtraHeaders(),this._getUrlParameters(),e,this._getServiceBaseURL()).then(function(e){200===e.statusCode?t.resolve({statusCode:e.statusCode}):t.reject({errors:e.errors,statusCode:e.statusCode})}).catch(function(e){t.reject(e)}),r}},{key:"update",value:function(){var e=a.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),this._composeUpdateElement(),this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):200===t.status?e.resolve({statusCode:t.status}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}},{key:"_composeUpdateElement",value:function(){return this._composeElement()}},{key:"_doNorthPut",value:function(e,t){var r=a.default.defer(),n=r.promise;return this._ogapi.Napi.put(e,t,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then(function(e){200===e.statusCode?r.resolve({statusCode:e.statusCode}):200===e.status?r.resolve({statusCode:e.status}):r.reject({errors:e.errors,statusCode:e.statusCode})}).catch(function(e){r.reject(e)}),n}},{key:"_doNorthPost",
|
|
29
|
+
value:function(){return this._baseUrl}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":138}],212:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"operationTypes/provision/organizations","operationTypes","Operation type not found")}return i(t,e),o(t,[{key:"findByOrganizationAndName",value:function(e,t){var r=this;return r._organization=e,r._name=t,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/"+this._name}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":138}],213:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("q"),u=n(a),s=e("moment"),c=n(s),l=function(){function e(t,r){if(i(this,e),"string"!=typeof r)throw new Error("Parameter operationId must be a string");this._ogapi=t,this._resource="operation",this._operationId=r}return o(e,[{key:"active",value:function(){var e={request:{active:!0}};return this._key="job",this._resource=this._resource+"/jobs/"+this._operationId,this._update(e)}},{key:"pause",value:function(){var e={request:{active:!1}};return this._key="job",this._resource=this._resource+"/jobs/"+this._operationId,this._update(e)}},{key:"cancel",value:function(){return this._id=this._operationId,this._resource=this._resource+"/jobs/"+this._id,this._cancel(this._resource)}},{key:"activePeriodicity",value:function(){var e={active:!0};return this._key="task",this._resource=this._resource+"/tasks/",this._periodicityActions("ACTIVE",e)}},{key:"pausePeriodicity",value:function(){var e={active:!1};return this._key="task",this._resource=this._resource+"/tasks/",this._periodicityActions("PAUSE",e)}},{key:"cancelPeriodicity",value:function(){return this._resource=this._resource+"/tasks/",this._periodicityActions("CANCEL")}},{key:"executeNow",value:function(){var e={request:{schedule:{start:{}}}};return this._readAndUpdate(e,!0)}},{key:"executeLater",value:function(e){if("number"!=typeof e)throw new Error("Parameter minutes must be typeof number");var t={request:{schedule:{start:{delayed:c.default.duration(e,"minutes").asMilliseconds()}}}};return this._readAndUpdate(t)}},{key:"changeCallback",value:function(e){if("string"!=typeof e)throw new Error("Parameter url must be a string");var t={request:{callback:e}};return this._readAndUpdate(t)}},{key:"_cancel",value:function(){var e=this,t=u.default.defer(),r=t.promise;return this._ogapi.Napi.delete(this._resource).then(function(r){200===r.statusCode?t.resolve({statusCode:r.statusCode,data:{id:e._id}}):t.reject({errors:r.errors,statusCode:r.statusCode})}).catch(function(r){t.reject(e._formatError(r))}),r}},{key:"_periodicityActions",value:function(e,t){var r=this,n=u.default.defer(),i=n.promise;return r._ogapi.newOperationFinder().findById(r._operationId).then(function(i){var o=i.data;if(o&&0!=Object.keys(o).length){var a=o.taskId;if(a)switch(r._resource=r._resource+a,e){case"PAUSE":case"ACTIVE":r._update(t).then(function(e){n.resolve(e)}).catch(function(e){n.reject(e)});break;case"CANCEL":r._id=a,r._cancel().then(function(e){n.resolve(e)}).catch(function(e){n.reject(e)});break;default:n.reject({errors:"Not implemented action: "+e})}else n.reject({errors:"Operation is not periodic!"})}else n.reject({errors:"Operation with id "+r._operationId+" not exists"})}).catch(function(e){n.reject(e)}),i}},{key:"_readAndUpdate",value:function(e,t){var r=u.default.defer(),n=r.promise,i=this;return i._ogapi.newOperationFinder().findById(i._operationId).then(function(n){var o=n.data;o?function(){var n=!!o.operation&&o.operation.active;n?i.pause().then(function(o){i._update(e,t||n).then(function(e){r.resolve(e)}).catch(function(e){r.reject(i._formatError(e))})}).catch(function(e){r.reject(i._formatError(e))}):i._update(e,t||n).then(function(e){r.resolve(e)}).catch(function(e){r.reject(i._formatError(e))})}():r.reject("Operation with id "+i._operationId+" not exists")}).catch(function(e){r.reject(i._formatError(e))}),n}},{key:"_update",value:function(e,t){var r=this,n=this,i=u.default.defer(),o=i.promise,a={};return a[n._key]=e,this._ogapi.Napi.put(this._resource,a).then(function(e){if(t)n.active().then(function(e){i.resolve(e)}).catch(function(e){i.reject(this._formatError(e))});else if(200===e.status){var r=""!=e.text?JSON.parse(e.text):{};e.status;i.resolve(e)}else i.reject({errors:e.errors,statusCode:e.status})}).catch(function(e){i.reject(r._formatError(e))}),o}},{key:"_formatError",value:function(e){return e.data||(e.data={}),e.data.errors||(e.data.errors=["string"==typeof e?{message:e}:e]),e}}]),e}();r.default=l,t.exports=r.default},{moment:113,q:117}],214:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../GenericFinder"),c=n(s),l=e("q"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this._limit=void 0}return o(t,e),a(t,[{key:"findById",value:function(e){return this._id=e,this._baseUrl="operation/jobs",this._entity="job",this._error_not_found="Operation not found",this._execute()}},{key:"findPeriodicityById",value:function(e){this._id=e;var t=this,r=f.default.defer(),n=r.promise;return t.findById(e).then(function(e){var n=e.data;n&&0!=Object.keys(n).length?(t._id=e.data.taskId,t._baseUrl="operation/tasks",t._entity="task",t._error_not_found="Operation is not periodic!",t._execute().then(function(e){e.data.id=t._id,r.resolve(e)}).catch(function(e){r.reject(e)})):r.reject({errors:t._error_not_found})}).catch(function(e){r.reject(e)}),n}},{key:"findPeriodicityByPeriodicityId",value:function(e){var t=this,r=f.default.defer(),n=r.promise;return t._id=e,t._baseUrl="operation/tasks",t._entity="task",t._execute().then(function(e){e.data.id=t._id,r.resolve(e)}).catch(function(e){r.reject(e)}),n}},{key:"findExecutionsById",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?10:arguments[1],r=arguments.length<=2||void 0===arguments[2]?1:arguments[2];if(this._id=e,this._baseUrl="operation/jobs",this._entity="operations",this._error_not_found="Executions not found","number"!=typeof t)throw new Error("size parameter must be a number");return("number"!=typeof r||r<1)&&(r=1),this._limit={size:t,start:r},this._execute()}},{key:"_composeUrl",value:function(){if("operations"===this._entity){this._limit&&this._setUrlParameters({start:this._limit.start,size:this._limit.size});return this._baseUrl+"/"+this._id+"/operations"}return this._baseUrl+"/"+this._id}}]),t}(c.default);r.default=d,t.exports=r.default},{"../GenericFinder":138,q:117}],215:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("./catalog/BaseOperationBuilder"),u=n(a),s=e("./catalog/period/PeriodicityUpdateBuilder"),c=n(s),l=e("q"),f=n(l),d=e("merge"),h=n(d),p=function(){function e(t){i(this,e),this._ogapi=t,this._operations=[],this._operationNames=[]}return o(e,[{key:"updatePeriodicityBuilder",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"operationId"});var t=f.default.defer(),r=t.promise,n=this;return this._ogapi.newOperationFinder().findPeriodicityById(e).then(function(e){t.resolve(n._createPeriodicBuilder(e.data))}).catch(function(e){t.reject(e)}),r}},{key:"builderByOperationName",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"name"});var t=f.default.defer(),r=t.promise,n=e.toUpperCase(),i=this._findOperation(n),o=this;return void 0===i?this._loadOperationCatalog().then(function(){var e=o._findOperation(n);void 0===e?t.reject("Operation <'"+n+"'> unavailable."):t.resolve(o._createBuilder(e.config))}):t.resolve(this._createBuilder(i.config)),r}},{key:"getOperationList",value:function(){return(0,h.default)(!0,this._operationNames)}},{key:"_createBuilder",value:function(e){return new u.default(this._ogapi,e)}},{key:"_createPeriodicBuilder",value:function(e){return new c.default(this._ogapi,e.id,e)}},{key:"_loadOperationCatalog",value:function(){var e=this,t=f.default.defer(),r=t.promise;return this._ogapi.operationTypesSearchBuilder().build().execute().then(function(r){if(200===r.statusCode){var n=r.data;for(var i in n){var o=n[i].name.toUpperCase();e._operationNames.push(o),e._operations.push({name:o,config:n[i]})}}t.resolve(e)}).catch(function(r){t.resolve(e)}),r}},{key:"_findOperation",value:function(e){return this._operations.find(function(e){return e.name==this},e)}}]),e}();r.default=p,t.exports=r.default},{"./catalog/BaseOperationBuilder":218,"./catalog/period/PeriodicityUpdateBuilder":226,merge:112,q:117}],216:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("q"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t,r){if(n(this,e),"string"!=typeof r)throw new Error("Parameter taskId must be a string");this._ogapi=t,this._resource="operation/tasks/",this._taskId=r,this._key="task"}return i(e,[{key:"activate",value:function(){var e={active:!0};return this._periodicityActions("ACTIVE",e)}},{key:"pause",value:function(){var e={active:!1};return this._periodicityActions("PAUSE",e)}},{key:"cancel",value:function(){return this._periodicityActions("CANCEL")}},{key:"_cancel",value:function(){var e=this,t=a.default.defer(),r=t.promise;return this._ogapi.Napi.delete(this._resource).then(function(r){200===r.statusCode?t.resolve({statusCode:r.statusCode,data:{id:e._id}}):t.reject({errors:r.errors,statusCode:r.statusCode})}).catch(function(r){t.reject(e._formatError(r))}),r}},{key:"_periodicityActions",value:function(e,t){var r=this,n=a.default.defer(),i=n.promise;return r._ogapi.newOperationFinder().findPeriodicityByPeriodicityId(r._taskId).then(function(i){var o=i.data;if(o&&0!=Object.keys(o).length){var a=o.id;switch(r._resource=r._resource+a,e){case"PAUSE":case"ACTIVE":r._update(t).then(function(e){n.resolve(e)}).catch(function(e){n.reject(e)});break;case"CANCEL":r._id=a,r._cancel().then(function(e){n.resolve(e)}).catch(function(e){n.reject(e)});break;default:n.reject({errors:"Not implemented action: "+e})}}else n.reject("Periodicity with id "+r._taskId+" not exists")}).catch(function(e){n.reject(e)}),i}},{key:"_readAndUpdate",value:function(e,t){var r=a.default.defer(),n=r.promise,i=this;return i._ogapi.newOperationFinder().findPeriodicityByPeriodicityId(i._taskId).then(function(n){var o=n.data;o?function(){var n=!!o.task&&"ACTIVE"===o.task.state;n?i.pause().then(function(o){i._update(e,t||n).then(function(e){r.resolve(e)}).catch(function(e){r.reject(i._formatError(e))})}).catch(function(e){r.reject(i._formatError(e))}):i._update(e,t||n).then(function(e){r.resolve(e)}).catch(function(e){r.reject(i._formatError(e))})}():r.reject("Periodicity with id "+i._taskId+" not exists")}).catch(function(e){r.reject(i._formatError(e))}),n}},{key:"_update",value:function(e,t){var r=this,n=this,i=a.default.defer(),o=i.promise,u={};return u[n._key]=e,this._ogapi.Napi.put(this._resource,u).then(function(e){t?n.active().then(function(e){i.resolve(e)}).catch(function(e){i.reject(this._formatError(e))}):200===e.status?i.resolve(e):i.reject({errors:e.errors,statusCode:e.status})}).catch(function(e){i.reject(r._formatError(e))}),o}},{key:"_formatError",value:function(e){return e.data||(e.data={}),e.data.errors||(e.data.errors=["string"==typeof e?{message:e}:e]),e}}]),e}();r.default=u,t.exports=r.default},{q:117}],217:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(){function e(t,r){n(this,e),this._ogapi=t,this._parent=r}return i(e,[{key:"filter",value:function(e,t){if(void 0===this._parent._config.applicableTo.find(function(e){return e==this},t))throw new Error("Entity type <'"+t+"'> not allowed to operation <'"+this._parent._config.name+"'>. Entity types allowed <'"+JSON.stringify(this._parent._config.applicableTo)+"'>");return this._parent._entityTypeWhenFilter=t,void 0!==this._parent._build.target&&console.warn("An Operation only allow one kind of way to append entities. Filter | Tag | List of entities. Now Filter will remove the last way appended ."),void 0!==e._filterTemplate?this._parent._build.target={filter:e._filterTemplate.filter}:this._parent._build.target={filter:e},this._parent}},{key:"list",value:function(e){var t=this;if(void 0===e||e.constructor!==Array)throw new Error("Parameter entities must be typeof Array");return void 0!==this._parent._build.target&&console.warn("An Operation only allow one kind of way to append entities. Filter | Tag | List of entities. Now List of entities will remove the last way appended ."),this._parent._build.target={append:{}},e.forEach(function(e){if(e.constructor===String)t._parent._build.target.append.entities||(t._parent._build.target.append.entities=[]),t._parent._build.target.append.entities.push(e);else{if(!e.id||!e.parameters)throw new Error("Entity parameters must include id and parameters: "+JSON.stringify(e));t._parent._build.target.append.entitiesWithParameters||(t._parent._build.target.append.entitiesWithParameters=[]),t._parent._build.target.append.entitiesWithParameters.push(e)}}),this._parent}},{key:"tag",value:function(e){return void 0!==this._parent._build.target&&console.warn("An Operation only allow one kind of way to append entities. Filter | Tag | List of entities. Now Tag will remove the last way appended ."),this._parent._build.target={append:{tags:[e]}},this._parent}}]),e}();r.default=o,t.exports=r.default},{}],218:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("merge"),u=n(a),s=e("./Operation"),c=n(s),l=e("./parameters/ParameterBuilderFactory"),f=(n(l),e("./AppendEntitiesBy")),d=n(f),h=e("./period/ExecuteEachBuilder"),p=n(h),y=e("./period/ExecuteEveryBuilder"),m=n(y),v=e("moment"),_=n(v),g=e("./../../util/DATE_FORMAT"),b=e("ajv"),w=n(b),E={gte:function(e){if(e<this)throw new Error("Value expected must be greater than <"+this+">. Value setted <"+e+">")},list:function(e){if(void 0===this.find(function(e){return e==this},e))throw new Error("Value must be one of these: "+JSON.stringify(this))},editable:function(e){return!0}},A=function(){function e(t,r){i(this,e),this._ajv=new w.default({useDefaults:"empty",coerceTypes:!0}),this.appendEntitiesBy=new d.default(t,this),this._config=r,this._ogapi=t,this._resourcesAvailables={job:"/jobs",task:"/tasks"},this._entityTypeWhenFilter=void 0,this._build={operationParameters:{ackTimeout:0,timeout:9e4,retries:0,retriesDelay:0,retryResultList:[]},name:r.name,schedule:{}},void 0!==r.parameters&&(this._build.parameters={})}return o(e,[{key:"withNotes",value:function(e){if(null===e)return delete this._build.userNotes,this;if("string"!=typeof e)throw new Error("Parameter notes must be a string");return this._build.userNotes=e,this}},{key:"withCallback",value:function(e){if(null===e)return delete this._build.callback,delete this._build.notify,this;if("string"!=typeof e)throw new Error("Parameter url must be a string");return this._build.callback=e,this._build.notify=!0,this}},{key:"withScatteringMaxSpread",value:function(e){if(null===e&&void 0!==this._build.schedule.scattering)return delete this._build.schedule.scattering.maxSpread,this;if("number"!=typeof e)throw new Error("Parameter percentage must be a number");if(e<0||e>100)throw new Error("The value of percentage parameter must be between 0-100");return void 0===this._build.schedule.scattering&&(this._build.schedule.scattering={}),this._build.schedule.scattering.maxSpread=e,this}},{key:"withScatteringStrategy",value:function(e,t){if(null===e&&void 0!==this._build.schedule.scattering)return delete this._build.schedule.scattering.strategy,this;if("number"!=typeof e)throw new Error("Parameter factor must be a number");if(e<0||e>100)throw new Error("The value of factor parameter must be between 0-100");return void 0===this._build.schedule.scattering&&(this._build.schedule.scattering={}),this._build.schedule.scattering.strategy={field:"subscription.collected.cellInfo",factor:e},"number"==typeof t&&(this._build.schedule.scattering.strategy.warningMaxRate=t),this}},{key:"executeImmediately",value:function(){return this._build.active=!0,void 0!==this._build.schedule&&delete this._build.schedule.start,delete this._build.task,this}},{key:"executeIDLE",value:function(){throw new Error("Not implemented yet")}},{key:"executeLater",value:function(e){var t=arguments.length<=1||void 0===arguments[1]||arguments[1];if("number"!=typeof e)throw new Error("Parameter minutes must be typeof number");return this._build.active=t,void 0===this._build.schedule&&(this._build.schedule={}),this._build.schedule.start={delayed:_.default.duration(e,"minutes").asMilliseconds()},delete this._build.task,this}},{key:"executeEvery",value:function(e,t,r,n,i){if(void 0===n&&(n=!0),void 0===e||e.constructor!==Date)throw new Error("Parameter date must be typeof Date");var o=Array.prototype.slice.call(arguments),a=this._getName(o.slice(1,3)),u=this._getEnd(o.slice(1,3));return this._build.active=n,new m.default(this,e,a,u,i)}},{key:"executeEach",value:function(e,t,r,n,i){if(void 0===n&&(n=!0),void 0===e||e.constructor!==Date)throw new Error("Parameter date must be typeof Date");var o=Array.prototype.slice.call(arguments),a=this._getName(o.slice(1,3)),u=this._getEnd(o.slice(1,3));return this._build.active=n,new p.default(this,e,a,u,i)}},{key:"_getName",value:function(e){for(var t=0;t<e.length;t++)if("string"==typeof e[t])return e[t];return this._build.name+" "+this._ogapi.Napi._options.apiKey}},{key:"_getEnd",value:function(e){for(var t=0;t<e.length;t++)if("number"==typeof e[t]||e[t]&&e[t].constructor===Date)return e[t]}},{key:"withJobTimeout",value:function(e){if(null===e)return delete this._build.schedule.stop,this;if("number"!=typeof e)throw new Error("Parameter minutes must be a number");return this._build.schedule.stop={delayed:_.default.duration(e,"minutes").asMilliseconds()},this}},{key:"withAckTimeout",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"milliseconds":arguments[1];return this._addSpecificParameter(_.default.duration(e,t).asMilliseconds(),"ackTimeout"),this}},{key:"withTimeout",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"milliseconds":arguments[1];return this._addSpecificParameter(_.default.duration(e,t).asMilliseconds(),"timeout"),this}},{key:"withRetriesDelay",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"milliseconds":arguments[1];return this._addSpecificParameter(_.default.duration(e,t).asMilliseconds(),"retriesDelay"),this}},{key:"withOperationRetries",value:function(e){return this._addSpecificParameter(e,"retryResultList"),this}},{key:"withRetries",value:function(e){return this._addSpecificParameter(e,"retries"),this}},{key:"withParameters",value:function(e){if(this._config.parameters)return this._build.parameters=e,this._checkMandatoryParameters(),this;throw new Error("This operation does not support parameters")}},{key:"withParameter",value:function(e,t){if(this._config.parameters)return this._build.parameters||(this._build.parameters={}),this._build.parameters[e]=t,this;throw new Error("This operation does not support parameters")}},{key:"build",value:function(){var e=void 0,t=(0,u.default)(!0,this._build),r=void 0,n=[];try{this._checkMandatoryParameters()}catch(e){n.push(e.message)}if(void 0===this._build.task&&void 0===this._build.schedule.start&&void 0===this._build.active&&(console.info("Not specified the way to execute [executeImmediately, executeIDLE, executeLater]. By default executeImmediately will be the way"),this.executeImmediately()),void 0===this._build.target&&this._build.active&&n.push("Must be entities appended if you want execute immediately. You must invoke appendEntitiesBy.list or appendEntitiesBy.tags or appendEntitiesBy.filter"),void 0!==this._build.target&&void 0!==this._build.target.filter&&"string"!=typeof this._entityTypeWhenFilter&&n.push("Must be selected the entity type allowed when filter is the way to append entities. Allowed entity types <'"+JSON.stringify(this._config.applicableTo)+"'>"),void 0!==this._build.task){var i=this._build.task,o=this._build.schedule.stop;if(void 0!==i.repeating.period){var a=void 0;switch(i.repeating.period.unit){case"DAYS":a=_.default.duration(i.repeating.period.each,"days").asMilliseconds();break;case"HOURS":a=_.default.duration(i.repeating.period.each,"hours").asMilliseconds();break;case"MINUTES":a=_.default.duration(i.repeating.period.each,"minutes").asMilliseconds()}void 0!==o&&"number"==typeof o.delayed?o.delayed>=a&&n.push("You can not execute an operation with a job timeout greater than the repetition period."):(o=_.default.duration(a,"milliseconds").asMinutes()-1,console.info("Not specified the job timeout. By default, timeout will be "+o+" minutes"),this.withJobTimeout(o))}}if(n.length>0)throw this._build=t,n;void 0===this._build.schedule.stop&&(console.info("Not specified the job timeout. By default, timeout will be 30 days"),this.withJobTimeout(43200)),void 0!==this._build.task?(e=this._resourcesAvailables.task,r=this._convertToTask(this._build)):(e=this._resourcesAvailables.job,r=this._convertToJob(this._build)),void 0!==this._build.target&&void 0!==this._build.target.filter&&(e=e+"?entityType="+this._entityTypeWhenFilter);var s=new c.default(this._ogapi,e,r);return this._build=t,s}},{key:"_convertToTask",value:function(e){var t=e.task;this.executeImmediately();var r=this._convertToJob(this._build),n=(0,_.default)(new Date),i=(0,_.default)(t.start),o={task:{active:!0,name:t.name,description:t.description,job:r.job,schedule:{start:{date:i.format(g.DATE_FORMAT)},repeating:t.repeating}}};if(void 0!==t.stop&&(void 0!==t.stop.date?o.task.schedule.stop={date:(0,_.default)(t.stop.date).format(g.DATE_FORMAT)}:o.task.schedule.stop=t.stop),_.default.max(n,i)==n){if(void 0!==t.stop&&void 0!==t.stop.date){var a=(0,_.default)(t.stop.date);if(_.default.max(n,a)==n)throw new Error("Can not create operation object because stop operation period is earlier than current date. It happened because you passed a lot of time between configuration of an operation and create the operation.")}delete o.task.schedule.start}return o}},{key:"_convertToJob",value:function(e){return 0===e.operationParameters.ackTimeout&&delete e.operationParameters.ackTimeout,{job:{request:e}}}},{key:"_addSpecificParameter",value:function(e,t){this._build.operationParameters[t]=e}},{key:"_checkParam",value:function(e,t){if("number"===t.type&&"number"!=typeof e)throw new Error(t.name+": Expected number but found "+typeof e);for(var r in t.attributes)"function"==typeof E[r]&&E[r].call(t.attributes[r],e)}},{key:"_checkMandatoryParameters",value:function(){if(this._config.parameters&&this._config.parameters.schema){var e=this._ajv.compile(this._config.parameters.schema);if(!e(this._build.parameters))throw new Error(e.errors)}}}]),e}();r.default=A,t.exports=r.default},{"./../../util/DATE_FORMAT":338,"./AppendEntitiesBy":217,"./Operation":219,"./parameters/ParameterBuilderFactory":221,"./period/ExecuteEachBuilder":223,"./period/ExecuteEveryBuilder":224,ajv:2,merge:112,moment:113}],219:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("q"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t,r,i){n(this,e),this._ogapi=t,this._resource="operation"+r,this._postObj=i}return i(e,[{key:"updatePeriodicity",value:function(){var e=this,t=a.default.defer(),r=this._resource.substring(this._resource.lastIndexOf("/")+1);return this._ogapi.Napi.put(this._resource,this._postObj).then(function(n){var i=void 0;try{i=JSON.parse(n.text)}catch(t){console.warn("Error parsing response data when execute post action to "+e._resource)}t.resolve({data:i||{},statusCode:n.statusCode,id:r})}).catch(function(e){e.data||(e.data={}),e.data.errors||(e.data.errors=["string"==typeof e?{message:e}:e]),t.reject(e)}),t.promise}},{key:"execute",value:function(){var e=this,t=a.default.defer();return this._ogapi.Napi.post(this._resource,this._postObj).then(function(r){var n=void 0;try{n=JSON.parse(r.text)}catch(t){console.warn("Error parsing response data when execute post action to "+e._resource)}t.resolve({data:n||{},statusCode:r.statusCode,location:r.header.location})}).catch(function(e){e.data||(e.data={}),e.data.errors||(e.data.errors=["string"==typeof e?{message:e}:e]),t.reject(e)}),t.promise}}]),e}();r.default=u,t.exports=r.default},{q:117}],220:[function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("moment"),u=(function(e){e&&e.__esModule}(a),function(){function e(t,r,n){i(this,e),this._parent=n,this._build="array"===r.type?[]:void 0,this._config=r,this[function(e){return function(e){var t=void 0;switch(e.type){case"array":t="add";break;default:t="with"}return t}(e)+e.name[0].toUpperCase()+e.name.slice(1)}(r)]=this._appendParameterValue}return o(e,[{key:"_appendParameterValue",value:function(e){return this._isTypeValueAllow(e)?this._isAllowValue(e)?("array"===this._config.type?this._build.push(e):this._build=e,this):(console.warn("Parameter <'"+this._config.name+"'> not allow value setted <'"+e+"'>. Only are allowed this configuration:"+JSON.stringify(this._config.attributes)),this):(console.warn("Parameter <'"+this._config.name+"'> not allow type of value setted <'"+typeof e+"'>. Only are allowed this type: "+this._getType()),this)}},{key:"_isString",value:function(){return"string"===this._config.type||"string"===this._config.subtype}},{key:"_isObject",value:function(){return"object"===this._config.type||"object"===this._config.subtype}},{key:"_isNumber",value:function(){return"number"===this._config.type||"number"===this._config.subtype}},{key:"_isArray",value:function(){return"array"===this._config.type||"array"===this._config.subtype}},{key:"_isBoolean",value:function(){return"boolean"===this._config.type||"boolean"===this._config.subtype}},{key:"_isDate",value:function(){return"date"===this._config.type||"date"===this._config.subtype}},{key:"_isTime",value:function(){return"time"===this._config.type||"time"===this._config.subtype}},{key:"_getType",value:function(){return this._isArray()?"array":this._isString()||this._isDate()||this._isTime()?"string":this._isObject()?"object":this._isNumber()?"number":this._isBoolean()?"boolean":"unknown"}},{key:"_isTypeValueAllow",value:function(e){var t=!0,r=typeof e;return(this._isString()||this._isTime()||this._isDate())&&"string"!==r&&(t=!1),this._isNumber()&&"number"!==r&&(t=!1),this._isObject()&&"object"!==r&&(t=!1),this._isBoolean()&&"boolean"!==r&&(t=!1),t}},{key:"_isAllowValue",value:function(e){if(void 0!==this._config.attributes){var t=this._config.attributes;if(void 0!==t.list)return void 0!==t.list.find(function(e){return e==this},e)}return!0}},{key:"build",value:function(){if(this._config.required&&(void 0===this._build||0===this._build.length))throw new Error("Parameter <'"+this._config.name+"'> is required and their value is not defined");var e={name:this._config.name,value:n({},this._getType(),this._build)};return void 0!==this._build&&0!==this._build.length||(e=void 0),e}},{key:"buildAndAppend",value:function(){var e=this.build();if(void 0!==e){
|
|
30
|
+
var t=this._parent._build.parameters.findIndex(function(e){return e.name==this.name},e);-1===t?this._parent._build.parameters.push(e):this._parent._build.parameters[t]=e}return this._parent}}]),e}());r.default=u,t.exports=r.default},{moment:113}],221:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=e("./BaseParameterBuilderWithParent"),o=(function(e){e&&e.__esModule}(i),function e(t,r,i){n(this,e)});r.default=o,t.exports=r.default},{"./BaseParameterBuilderWithParent":220}],222:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["MON","TUE","WED","THU","FRI","SAT","SUN"];r.DAYS_ENUM=n},{}],223:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("merge"),u=n(a),s=e("moment"),c=n(s),l=function(){function e(t,r,n,o,a){if(i(this,e),this._parent=t,this._skeleton={start:r,stop:o,name:n,description:a,repeating:{period:{each:void 0,unit:void 0}}},void 0!==o){var u=void 0;if("number"==typeof o){if(o<=0)throw new Error("Invalid stop value. Number of repetitions must be greater than 0.");u={executions:o}}else if(o.constructor===Date){var s=(0,c.default)(r),l=(0,c.default)(o);if(c.default.max(s,l)==s)throw new Error("Invalid stop date on executeEach method. Start date must be earlier than stop date.");u={date:o}}this._skeleton.stop=u}}return o(e,[{key:"minutes",value:function(e){if("number"!=typeof e)throw new Error("Parameter minutes must be typeof number");return this._addPeriod(e,"MINUTES")}},{key:"hours",value:function(e){if("number"!=typeof e)throw new Error("Parameter hours must be typeof number");return this._addPeriod(e,"HOURS")}},{key:"days",value:function(e){if("number"!=typeof e)throw new Error("Parameter days must be typeof number");return this._addPeriod(e,"DAYS")}},{key:"_addPeriod",value:function(e,t){var r=(0,u.default)(!0,this._skeleton);return r.repeating.period.each=e,r.repeating.period.unit=t,this._parent._build.task=r,this._parent}}]),e}();r.default=l,t.exports=r.default},{merge:112,moment:113}],224:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("./MONTHS_ENUM"),u=e("./pattern/ByWeek"),s=n(u),c=e("./pattern/ByYear"),l=n(c),f=e("./pattern/ByMonth"),d=n(f),h=e("./pattern/ByGeneric"),p=n(h),y=function(){function e(t,r,n,o,a){i(this,e),this.year=new l.default(t,r,n,o,a),this.week=new s.default(t,r,n,o,a),this._day=new p.default(t,r,n,o,a),this._date=r,this._end=o,this._parent=t,this._periodicityName=n,this._description=a}return o(e,[{key:"day",value:function(){return this._day._build()}},{key:"month",value:function(e){var t=this._parent._task;if(void 0===e||e.constructor!==Array){var r=!0;if(t){var n=t.schedule.repeating.pattern;if(n){var i=n.monthly;i&&(r=!1,e=i.months)}}if(r)throw new Error("Parameter months must be typeof Array")}if(0===e.length)throw new Error("Parameter months must have at least one month");for(var o=[],u=0;u<e.length;u++){var s=a.MONTHS_ENUM.find(function(e){return e==this},e[u]);void 0===s&&o.push(s)}if(0!==o.length)throw new Error("Any month into parameter months is not allowed. Parameter value <'"+JSON.stringify(o)+"'>, Months allowed <'"+JSON.stringify(a.MONTHS_ENUM)+"'>");return new d.default(this._parent,this._date,this._periodicityName,e,this._end,this._description)}}]),e}();r.default=y,t.exports=r.default},{"./MONTHS_ENUM":225,"./pattern/ByGeneric":227,"./pattern/ByMonth":228,"./pattern/ByWeek":229,"./pattern/ByYear":230}],225:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"];r.MONTHS_ENUM=n},{}],226:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("merge"),u=n(a),s=e("moment"),c=n(s),l=e("../Operation"),f=n(l),d=e("./ExecuteEveryBuilder"),h=n(d),p=e("./ExecuteEachBuilder"),y=n(p),m=e("./pattern/ByGeneric"),v=n(m),_=e("./../../../util/DATE_FORMAT"),g=function(){function e(t,r,n){i(this,e),this._ogapi=t,this._task=n,this.task_id=r,this._resource="/tasks/"+this.task_id,this._build=(0,u.default)(!0,this._task.job.request)}return o(e,[{key:"executeEvery",value:function(e,t){var r=Array.prototype.slice.call(arguments),n=this._getEnd(r.slice(1,3));return e=this._getStart(e),this._byGeneric=new v.default(this,e,null,t)._build(),new h.default(this,e,null,n)}},{key:"executeEach",value:function(e,t){var r=Array.prototype.slice.call(arguments),n=this._getEnd(r.slice(1,3)),i=this._task.schedule;if(e=this._getStart(e),i&&i.repeating&&i.repeating.period){var o=i.repeating.period;return new y.default(this,e,null,n)._addPeriod(o.each,o.unit)}return new y.default(this,e,null,n)}},{key:"_getStart",value:function(e){var t=this._task.schedule;return!e&&t.start&&t.start.date&&(e=new Date(t.start.date)),e}},{key:"_getEnd",value:function(e){for(var t=0;t<e.length;t++)if("number"==typeof e[t]||e[t].constructor===Date)return e[t];var r=this._task.schedule;if(r.stop&&r.stop.date)return new Date(r.stop.date)}},{key:"build",value:function(){var e=(0,u.default)(!0,this._build),t=void 0,r=[];if(void 0!==this._build.task){var n=this._build.task,i=this._build.schedule.stop;if(void 0!==n.repeating.period){var o=void 0;switch(n.repeating.period.unit){case"DAYS":o=c.default.duration(n.repeating.period.each,"days").asMilliseconds();break;case"HOURS":o=c.default.duration(n.repeating.period.each,"hours").asMilliseconds();break;case"MINUTES":o=c.default.duration(n.repeating.period.each,"minutes").asMilliseconds()}void 0!==i&&"number"==typeof i.delayed&&i.delayed>=o&&r.push("You can not execute an operation with a job timeout greater than the repetition period.")}}if(r.length>0)throw this._build=e,r;void 0!==this._build.task&&(t=this._updateTask(this._build));var a=new f.default(this._ogapi,this._resource,t);return this._build=e,a}},{key:"_updateTask",value:function(e){var t=e.task,r=(0,c.default)(new Date),n=(0,c.default)(t.start),i={task:{schedule:{}}};try{t.start&&(i.task.schedule.start={date:n.format(_.DATE_FORMAT)}),t.stop&&(i.task.schedule.stop={date:(0,c.default)(t.stop).format(_.DATE_FORMAT)}),t.repeating&&(i.task.schedule.repeating=t.repeating)}catch(e){}if(delete i.task.schedule.name,void 0!==t.stop&&(void 0!==t.stop.date?i.task.schedule.stop={date:(0,c.default)(t.stop.date).format(_.DATE_FORMAT)}:i.task.schedule.stop=t.stop),c.default.max(r,n)==r){if(void 0!==t.stop&&void 0!==t.stop.date){var o=(0,c.default)(t.stop.date);if(c.default.max(r,o)==r)throw new Error("Can not create operation object because stop operation period is earlier than current date. It happened because you passed a lot of time between configuration of an operation and create the operation.")}delete i.task.schedule.start}return i}}]),e}();r.default=g,t.exports=r.default},{"../Operation":219,"./../../../util/DATE_FORMAT":338,"./ExecuteEachBuilder":223,"./ExecuteEveryBuilder":224,"./pattern/ByGeneric":227,merge:112,moment:113}],227:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("moment"),u=n(a),s=e("merge"),c=n(s),l=e("./../../../../util/DATE_FORMAT"),f=function(){function e(t,r,n,o,a){if(i(this,e),this._parent=t,this._skeleton={start:r,stop:o,name:n,description:a,repeating:{pattern:{time:(0,u.default)(r).format(l.TIME_FORMAT)}}},void 0!==o){var s=void 0;if("number"==typeof o)s={executions:o};else if(o.constructor===Date){var c=(0,u.default)(r),f=(0,u.default)(o);if(u.default.max(c,f)==c)throw new Error("Invalid stop date on executeEvery method. Start date must be earlier than stop date.");s={date:o}}this._skeleton.stop=s}}return o(e,[{key:"_create",value:function(){return(0,c.default)(!0,this._skeleton)}},{key:"_build",value:function(){return this._parent._build.task=this._create(),this._parent}}]),e}();r.default=f,t.exports=r.default},{"./../../../../util/DATE_FORMAT":338,merge:112,moment:113}],228:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./ByGeneric"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e,r,i,o,u,s){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,i,u,s),this._months=o;var c=e._task;if(c){var l=c.schedule.repeating.pattern;if(l){var f=l.monthly;f&&(this._day=f.day,a(Object.getPrototypeOf(t.prototype),"_build",this).call(this))}}}return i(t,e),o(t,[{key:"day",value:function(e){if("number"!=typeof e)throw new Error("Parameter day must be typeof number");if(e>31||e<1)throw new Error("Parameter day must be greater than 1 and less than 31");return this._day=e,this._build()}},{key:"_create",value:function(){var e=a(Object.getPrototypeOf(t.prototype),"_create",this).call(this);return e.repeating.pattern.monthly={day:this._day,months:this._months},e}}]),t}(s.default);r.default=c,t.exports=r.default},{"./ByGeneric":227}],229:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./ByGeneric"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=e("./../DAYS_ENUM"),l=function(e){function t(e,r,i,o,u){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,i,o,u)}return i(t,e),o(t,[{key:"days",value:function(e){if(void 0===e||e.constructor!==Array)throw new Error("Parameter days must be typeof Array");if(0===e.length)throw new Error("Parameter days must have at least one day");for(var t=[],r=0;r<e.length;r++){var n=c.DAYS_ENUM.find(function(e){return e==this},e[r]);void 0===n&&t.push(n)}if(0!==t.length)throw new Error("Any day into parameter days is not allowed. Parameter value <'"+JSON.stringify(e)+"'>, Months allowed <'"+JSON.stringify(c.DAYS_ENUM)+"'>");return this._days=e,this._build()}},{key:"_create",value:function(){var e=a(Object.getPrototypeOf(t.prototype),"_create",this).call(this);return e.repeating.pattern.weekly={days:this._days},e}}]),t}(s.default);r.default=l,t.exports=r.default},{"./../DAYS_ENUM":222,"./ByGeneric":227}],230:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./ByGeneric"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=e("./../MONTHS_ENUM"),l=function(e){function t(e,r,i,o,u){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,i,o,u);var s=e._task;if(s){var c=s.schedule.repeating.pattern;if(c){var l=c.yearly;l&&(this._day=l.day,this._month=l.month,a(Object.getPrototypeOf(t.prototype),"_build",this).call(this))}}}return i(t,e),o(t,[{key:"day",value:function(e){if("number"!=typeof e){if(!this._day)throw new Error("Parameter day must be typeof number");month=this._day}if(e>31||e<1)throw new Error("Parameter day must be greater than 1 and less than 31");return this._day=e,void 0===this._month?this:this._parent._task?(this._build(),this):this._build()}},{key:"month",value:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e){if("string"!=typeof e){if(!this._month)throw new Error("OGAPI_PARAMETER_MONTH_MUST_BE_STRING");e=this._month}if(void 0===c.MONTHS_ENUM.find(function(e){return e==this},e))throw new Error("Any month into parameter months is not allowed. Parameter value <'"+e+"'>, Months allowed <'"+JSON.stringify(c.MONTHS_ENUM)+"'>");return this._month=e,void 0===this._day?this:this._parent._task?(this._build(),this):this._build()})},{key:"_create",value:function(){var e=a(Object.getPrototypeOf(t.prototype),"_create",this).call(this);return e.repeating.pattern.yearly={day:this._day,month:this._month},e}}]),t}(s.default);r.default=l,t.exports=r.default},{"./../MONTHS_ENUM":225,"./ByGeneric":227}],231:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../ProvisionGenericFinder"),c=n(s),l=e("q"),f=n(l),d=e("http-status-codes"),h=n(d),p=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations","organization","Organization not found")}return o(t,e),a(t,[{key:"findByName",value:function(e){return this._id=e,this._execute()}},{key:"findByDomainAndWorkgroup",value:function(e,t){this._domain=e,this._workgroup=t;var r=f.default.defer(),n=r.promise,i=this._error_not_found;return this._executeWorkgroupRelation().then(function(e){if(204===e.statusCode)r.reject({data:i,statusCode:h.default.NOT_FOUND});else{var t=e.data,n={},o=[];for(var a in t.channels)n[t.channels[a].organization]||(n[t.channels[a].organization]=t.channels[a].organization,o.push({name:t.channels[a].organization}));o.length>0?r.resolve({data:o,statusCode:e.statusCode}):r.reject({data:i,statusCode:h.default.NOT_FOUND})}}).catch(function(e){r.reject(e)}),n}},{key:"_executeWorkgroupRelation",value:function(){var e="provision/domains/"+this._domain+"/workgroups/"+this._workgroup+"/relations",t=f.default.defer(),r=t.promise,n=this._error_not_found;return this._api.get(e,void 0,this._getExtraHeaders(),this._getUrlParameters()).then(function(e){204===e.statusCode?t.reject({data:n,statusCode:h.default.NOT_FOUND}):t.resolve({data:e.body.workgroupRelation,statusCode:e.statusCode})}).catch(function(e){t.reject(e)}),r}}]),t}(c.default);r.default=p,t.exports=r.default},{"../ProvisionGenericFinder":140,"http-status-codes":76,q:117}],232:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../provision/BaseProvision"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e,r){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations"+(void 0===r?"":r)),this._name=void 0,this._description=void 0,this._countryCode=void 0,this._langCode=void 0,this._timeZone=void 0,this._zoom=void 0,this._location=void 0}return i(t,e),o(t,[{key:"withName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._name=e,this}},{key:"withDomain",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._domain=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_250");return this._description=e,this}},{key:"withCountryCode",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER");return this._countryCode=e.toUpperCase(),this}},{key:"withLangCode",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER");return this._langCode=e.toLowerCase(),this}},{key:"withTimeZone",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER");return this._timeZone=e,this}},{key:"withPlan",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER");return this._plan=e,this}},{key:"withOnlyAssignedDomainCertificates",value:function(e){if("boolean"!=typeof e||!0!==e&&!1!==e)throw new Error("Parameter OnlyAssignedDomainCertificates must be a boolean and cannot be empty");return this._onlyDomainCerts=e,this}},{key:"withZoom",value:function(e){if("number"!=typeof(e*=1)||e<0||e>19)throw new Error("Parameter zoom must be a number between 0 and 19");return this._zoom=e,this}},{key:"withLocation",value:function(e,t){if(e*=1,t*=1,"number"!=typeof e||"number"!=typeof t)throw new Error("Latitude and longitude parameters must be numbers");if(e<-90||e>90)throw new Error("Parameter latitude value must be between -90 and 90");if(t<-180||t>180)throw new Error("Parameter longitude value must be between -180 and 180");return this._location={latitude:e,longitude:t},this}},{key:"withAuth",value:function(e){if(!e||!e.type)throw new Error("Auth cannot be empty and must have type at least");this._security||(this._security={}),this._security.auth=e}},{key:"withPasswordPolicy",value:function(e){if(!e)throw new Error("Password policy cannot be empty");this._security||(this._security={}),this._security.policies={password:{checkStrength:!!e.checkStrength,expirationPeriod:e.expirationPeriod||0}}}},{key:"_composeElement",value:function(){if(void 0===this._name||void 0===this._langCode||void 0===this._countryCode)throw new Error("Parameters name, country code and lang code must be defined");var e={};void 0!=this._zoom&&(e.zoom=this._zoom),void 0!=this._location&&(e.location=this._location);var t={organization:{name:this._name||void 0,description:this._description||void 0,plan:this._plan||void 0,countryCode:this._countryCode||void 0,langCode:this._langCode||void 0,timezone:this._timeZone||void 0,onlyAssignedDomainCertificates:"boolean"!=typeof this._onlyDomainCerts?this._onlyDomainCerts:void 0}};return this._domain&&(t.organization.domain=this._domain),(e.zoom||e.location)&&(t.organization.mapDefault=e),this._security&&(t.organization.security=this._security),t}},{key:"_composeUpdateElement",value:function(){if(this._domain)throw new Error("The domain parameter is not allowed in the update");var e=this._composeElement();return delete e.organization.name,e}},{key:"_buildURL",value:function(){if(void 0===this._name)throw new Error("Parameter name must be defined");return this._resource+"/"+this._name}}]),t}(s.default);r.default=c,t.exports=r.default},{"../provision/BaseProvision":235}],233:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"ai","list","Pipeline not found","north")}return i(t,e),o(t,[{key:"findByOrganization",value:function(e){return this._organization=e,this._execute()}},{key:"findByOrganizationAndIdentifier",value:function(e,t){return this._organization=e,this._identifier=t,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/pipelines"+(this._identifier?"/"+this._identifier:"")}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":138}],234:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("q"),c=n(s),l=e("../provision/BaseProvision"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations",void 0,["name","actions","organization"],"north/ai"),this._ogapi=e}return o(t,e),a(t,[{key:"_buildURL",value:function(){return this._organization+"/pipelines/"+this._identifier}},{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"identifier"});return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"name"});return this._name=e,this}},{key:"withOrganization",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"organization"});return this._organization=e,this}},{key:"withActions",value:function(e){var t=this;if(!(e instanceof Array))throw new Error({message:"Parameter actions requires an array",parameter:"actions"});this._actions=[],e.forEach(function(e){t.addAction(e)})}},{key:"addAction",value:function(e){if("object"!=typeof e||!e.name||"string"!=typeof e.name||!e.type||"string"!=typeof e.type)throw new Error({message:"Parameter action requires name and type",parameter:"actions"});this._actions||(this._actions=[]),this._actions.push(e)}},{key:"prediction",value:function(e,t,r){var n=c.default.defer(),i=n.promise,o={input:e};t&&r&&(o.collect={deviceId:t,datastream:r});var n=c.default.defer(),i=n.promise;return this._ogapi.Napi.post(this._buildURL()+"/prediction",o,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then(function(e){n.resolve({statusCode:e.statusCode,body:e.body})}).catch(function(e){n.reject(e)}),i}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),this._resource=this._organization+"/pipelines",{name:this._name||void 0,actions:this._actions||void 0}}}]),t}(f.default);r.default=d,t.exports=r.default},{"../provision/BaseProvision":235,q:117}],235:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("q"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t,r,i,o,a){if(void 0===o&&(o=[]),n(this,e),this.constructor===e)throw new Error("Cannot construct Abstract instances directly");if("function"!=typeof this._composeElement)throw new Error("Must override method: composeElement");if("function"!=typeof this._buildURL)throw new Error("Must override method: _buildURL");i&&(this._timeout="number"!=typeof i?t.Napi._options.timeout:i),this._ogapi=t,this._resource="provision"+r,this._requiredParameters=o,this._headers=void 0,this._urlParameters=void 0,this._serviceBaseURL=a}return i(e,[{key:"_checkRequiredParameters",value:function(){var e=[];if(this._requiredParameters&&this._requiredParameters.length>0){for(var t=0;t<this._requiredParameters.length;t++)void 0===this[this._requiredParameters[t]]&&void 0===this["_"+this._requiredParameters[t]]&&e.push(this._requiredParameters[t]);if(e.length>0)throw new Error("There are required parameters that have not been set. Missing parameters: "+JSON.stringify(e).replace(new RegExp('"',"g"),""))}}},{key:"create",value:function(){var e=this;this._checkRequiredParameters();var t=a.default.defer(),r=t.promise,n=this._composeElement();return this._ogapi.Napi.post(this._resource,n,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then(function(r){201===r.statusCode?("function"==typeof e._onCreated&&e._onCreated(r.header.location),t.resolve({location:r.header.location,statusCode:r.statusCode})):t.reject({errors:r.errors,statusCode:r.statusCode})}).catch(function(e){t.reject(e)}),r}},{key:"delete",value:function(e){var t=a.default.defer(),r=t.promise;return this._ogapi.Napi.delete(this._buildURL(),this._timeout,this._getExtraHeaders(),this._getUrlParameters(),e,this._getServiceBaseURL()).then(function(e){200===e.statusCode?t.resolve({statusCode:e.statusCode}):t.reject({errors:e.errors,statusCode:e.statusCode})}).catch(function(e){t.reject(e)}),r}},{key:"update",value:function(){var e=a.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),this._composeUpdateElement(),this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):200===t.status?e.resolve({statusCode:t.status}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}},{key:"_composeUpdateElement",value:function(){return this._composeElement()}},{key:"_doNorthPut",value:function(e,t){var r=a.default.defer(),n=r.promise;return this._ogapi.Napi.put(e,t,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then(function(e){200===e.statusCode?r.resolve({statusCode:e.statusCode}):200===e.status?r.resolve({statusCode:e.status}):r.reject({errors:e.errors,statusCode:e.statusCode})}).catch(function(e){r.reject(e)}),n}},{key:"_doNorthPost",
|
|
31
31
|
value:function(e,t,r){var n=this,i=a.default.defer(),o=i.promise;return this._ogapi.Napi.post(e,t,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then(function(e){var t={statusCode:e.statusCode};201===e.statusCode?("function"==typeof n._onCreated&&n._onCreated(e.header.location),t.location=e.header.location,r&&(t.data=e.body),i.resolve(t)):200===e.statusCode?(r&&(t.data=e.body),i.resolve(t)):(t.errors=e.errors,i.reject(t))}).catch(function(e){i.reject(e)}),o}},{key:"_getExtraHeaders",value:function(){return this._headers}},{key:"_setExtraHeaders",value:function(e){if(this._headers)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._headers[n]=e[n]}else this._headers=e}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this._urlParameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"_checkValues",value:function(e,t){var r=[];return void 0===t.find(function(e){return e==this},e)&&r.push(e),0!==r.length&&console.warn("Parameter value not allowed <'"+JSON.stringify(r)+"'>, allowed <'"+JSON.stringify(t)+"'>"),e}},{key:"_getServiceBaseURL",value:function(){return this._serviceBaseURL}}]),e}();r.default=u,t.exports=r.default},{q:117}],236:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../BaseProvision"),c=n(s),l=e("q"),f=n(l),d={xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};r.TYPES=d;var h=function(e){function t(e,r,n,o){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,void 0,o,["organization","processorId"]),this._timeout=o,this._organization=r,this._processorId=n,this._resource="provisionProcessors/provision/organizations/"+r+"/"+n+"/"}return o(t,e),a(t,[{key:"_composeElement",value:function(){return this}},{key:"_buildURL",value:function(){return this._resource+this._type}},{key:"plan",value:function(e,t,r){if("string"!=typeof t)throw new Error("Parameter extension must be a string (xls or xlsx) and cannot be empty");return this._extension=d[t],this._setUrlParameters({numberOfEntriesToProcess:r||1}),this._type="plan",this._setExtraHeaders({accept:"application/json"}),this._executeOperation(e)}},{key:"bulk",value:function(e,t){if(this._extension=d[t],"string"!=typeof this._extension)throw new Error("Parameter extension must be a string (xls or xlsx) and cannot be empty");return this._type="bulk",this._setExtraHeaders({accept:this._extension}),this._executeOperation(e)}},{key:"_executeOperation",value:function(e){var t=void 0;"string"!=typeof e?(t=new FormData,t.append("file",e)):(t={},t.processorBulkFile=e);var r=f.default.defer(),n=this._buildURL();return this._ogapi.Napi.post_multipart(n,t,{},this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(e){switch(e.statusCode){case 200:var t=""!=e.text?JSON.parse(e.text):{},n=e.status;r.resolve({data:t,statusCode:n});break;case 201:var n=e.status,i=e.location||e.headers.location||e.header.location;r.resolve({location:i,statusCode:n});break;case 204:r.resolve(e);break;default:r.reject({errors:e.data.errors,statusCode:e.statusCode})}}).catch(function(e){r.reject(e)}),r.promise}}]),t}(c.default);r.default=h},{"../BaseProvision":235,q:117}],237:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../../ProvisionGenericFinder"),c=n(s),l=e("jsonpath"),f=n(l),d=e("q"),h=n(d),p=e("http-status-codes"),y=n(p),m=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations","entity","Countries not found"),this.__filter=this._api._options._internalCountriesFilter}return o(t,e),a(t,[{key:"getCountries",value:function(){return this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this.__filter.organization+"/entities/"+this.__filter.identifier}},{key:"_execute",value:function(){var e=h.default.defer(),t=e.promise,r=this,n=this._error_not_found;return this._api.get(this._composeUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters(),!1,this._getServiceBaseURL()).then(function(t){if(204===t.statusCode)e.reject({error:n,statusCode:y.default.NOT_FOUND});else{var i=(f.default.query(t.body,"$."+r.__filter.ds+"._current.value")||[])[0];e.resolve({data:i,statusCode:t.statusCode})}}).catch(function(t){400===t.statusCode&&(t.statusCode=y.default.NOT_FOUND),e.reject(t)}),t}}]),t}(c.default);r.default=m,t.exports=r.default},{"../../ProvisionGenericFinder":140,"http-status-codes":76,jsonpath:104,q:117}],238:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SimpleBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c="provision.asset.identifier";r.AssetID=c;var l=function(e){function t(e,r,i,o,u,s){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/entities",i,o,u,s),this._entity.resourceType={_value:{_current:{value:"entity.asset"}}}}return i(t,e),o(t,[{key:"_getEntityKey",value:function(){return this._entity[c]}}]),t}(s.default);r.default=l},{"./SimpleBuilder":246}],239:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../BaseProvision"),c=n(s),l=e("q"),f=n(l),d=function(e){function t(e,r,n,o){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r),this._timeout=o,this._resource=r,this._extension=n}return o(t,e),a(t,[{key:"_composeElement",value:function(){return this}},{key:"_buildURL",value:function(){return this._resource}},{key:"create",value:function(e,t){return this._executeOperation(e,"CREATE",t)}},{key:"delete",value:function(e,t){return this._executeOperation(e,"DELETE",t)}},{key:"deleteAll",value:function(e,t){return this._executeOperation(e,"DELETE&full=true",t)}},{key:"update",value:function(e,t){return this._executeOperation(e,"UPDATE",t)}},{key:"patch",value:function(e,t){return this._executeOperation(e,"PATCH",t)}},{key:"_executeOperation",value:function(e,t,r){var n=void 0;if("string"!=typeof e){if(n={},e){var i=new Blob([e]);n.bulkFile=i}}else n={},e&&(n.bulkFile=e);var o=f.default.defer();n.ext=this._extension;var a=this._buildURL();return r&&this._setExtraHeaders({accept:"text/plain"}),this._setUrlParameters({action:t}),this._ogapi.Napi.post_multipart(a,n,{},this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(e){var t=e.statusCode;if(200===t||201===t)if(r&&!e.location){var n=e,i=e.statusCode;o.resolve({data:n,statusCode:i})}else o.resolve(e);else 204===t?o.resolve(e):o.reject({errors:e.data.errors,statusCode:e.statusCode})}).catch(function(e){o.reject(e)}),o.promise}}]),t}(c.default);r.default=d,t.exports=r.default},{"../BaseProvision":235,q:117}],240:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SimpleBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e,r,i,o,u,s){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,i,o,u,s)}return i(t,e),o(t,[{key:"initFromFlattened",value:function(e){var t=this;e&&Object.keys(e).length>0&&Object.keys(e).forEach(function(r){if(r.toLowerCase().startsWith("provision")){var n=e[r];n.forEach?n.forEach(function(e){e._index.value&&e._value&&e._value._current&&t.withComplex(r,e._index.value._current.value,e._value._current.value)}):t.with(r,n._value._current.value)}})}},{key:"_initFormJson",value:function(e,t,r){var n=this;if(e){Object.keys(e).forEach(function(i){var o=e[i],a=o._current,u=t?t+"."+i:i;if(a){var s=a.value;r?n.withComplex(u,r,s):n.with(u,s)}else Array.isArray(o)?o.forEach(function(e){n._initFromJson(e,u+"[]",e.identifier._current.value)}):n._initFromJson(o,u,r)})}}},{key:"initFromJson",value:function(e){var t=this,r={};e&&(r=e.provision)&&t._initFromJson(r,"provision")}},{key:"withComplex",value:function(e,t,r){if(!t)return console.warn("Communication module identifier not defined. This value wil be ignored"),this;if(1!==this.getAllowedDatastreams().filter(function(t){return t.identifier===e}).length)return console.warn("Datastream not found or operations can not be performed on it. This value will be ignored. Datastream Name: "+e),this;this._entity[e]||(this._entity[e]=[]);for(var n=!1,i=0;i<this._entity[e].length;i++){var o=this._entity[e][i];o._index&&o._index.value&&o._index.value===t&&(this._entity[e][i]={_index:{value:t},_value:{_current:{value:r}}},n=!0)}return n||this._entity[e].push({_index:{value:t},_value:{_current:{value:r}}}),this}}]),t}(s.default);r.default=c,t.exports=r.default},{"./SimpleBuilder":246}],241:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("./BulkBuilder"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e,r,i,a,u){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provision/organizations/"+r+"/bulk/"+(u?"async":i.toLowerCase()),"text/plain",a),u&&this._setUrlParameters({type:i.toUpperCase()})}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"./BulkBuilder":239}],242:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=e("./ComplexBuilder"),c=n(s),l=e("./SubscriberBuilder"),f=e("./SubscriptionBuilder"),d=e("http-status-codes"),h=n(d),p=e("q"),y=n(p),m=e("jsonpath"),v=n(m),_=function(){function e(t,r,n,i,a,u){o(this,e);var s=this,c={},d={};this._obj=r,this._url=n,this._ogapi=t,this._key=i,this._timeout=u||null,this._objClone=Object.assign({},r),this._deviceKeys=Object.keys(r).filter(function(e){return-1===e.indexOf("subscriber")&&-1===e.indexOf("subscription")}),this._subscriberKeys=Object.keys(r).filter(function(e){return-1!==e.indexOf("subscriber")}),this._subscriptionKeys=Object.keys(r).filter(function(e){return-1!==e.indexOf("subscription")}),this._administrationKeys=Object.keys(r).filter(function(e){return-1!==e.indexOf("provision.administration")}),this._wrappers=[],this._urlParameters=a,this._subscriberKeys.forEach(function(e){s._obj[e].forEach(function(t){c[t._index.value]||(c[t._index.value]={}),c[t._index.value][e]={_value:t._value}})}),this._subscriptionKeys.forEach(function(e){s._obj[e].forEach(function(t){d[t._index.value]||(d[t._index.value]={}),d[t._index.value][e]={_value:t._value}})}),Object.keys(d).forEach(function(e){var t=d[e];s._administrationKeys.forEach(function(e){t[e]=s._obj[e]}),s._wrappers.push(new g(s._ogapi,t,s._url.replace("devices","subscriptions").replace("/"+s._key._value._current.value,""),t[f.SubscriptionID]._value._current.value))}),Object.keys(c).forEach(function(e){var t=c[e];s._administrationKeys.forEach(function(e){t[e]=s._obj[e]}),s._wrappers.push(new g(s._ogapi,t,s._url.replace("devices","subscribers").replace("/"+s._key._value._current.value,""),t[l.SubscriberID]._value._current.value))})}return u(e,[{key:"_urlWithKey",value:function(){return this._url+"/"+this._key._value._current.value}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this._urlParameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"create",value:function(){var e=this,t=y.default.defer(),r={},n=this._objClone,i=[],o=this;return Object.keys(n).filter(function(e){return-1===e.indexOf("subscriber")&&-1===e.indexOf("subscription")}).forEach(function(e){r[e]=n[e]}),this._wrappers.forEach(function(e){i.push({wrapper:e,promise:e.execute(t,10)})}),y.default.allSettled(i.reduce(function(e,t){return e.push(t.promise),e},[])).then(function(){return t.notify({message:"OGAPI_201_ENTITIES_CREATED",type:"success",percentage:20}),t.notify({entity:o._key._value._current.value,message:"OGAPI_CREATING_DEVICE",type:"success",percentage:25}),o._ogapi.Napi.post(o._url,r,null,null,{flattened:!0}).then(function(r){if(o._wrappers.length>0)return t.notify({message:"OGAPI_ADDING_RELATED_ENTITIES",type:"success",percentage:55}),e._setUrlParameters({flattened:!0}),o._ogapi.Napi.put(o._urlWithKey(),n,e._timeout,null,e._getUrlParameters()).then(function(e){e.statusCode===h.default.OK?("function"==typeof o._onCreated&&o._onCreated(e.header.location),t.notify({entity:o._key._value._current.value,message:"OGAPI_DEVICE_CREATED ",type:"success",percentage:75}),t.resolve({location:e.header.location,statusCode:e.statusCode})):t.reject({errors:e.errors,statusCode:e.statusCode})});r.statusCode===h.default.CREATED?("function"==typeof o._onCreated&&o._onCreated(r.header.location),t.notify({entity:o._key._value._current.value,message:"OGAPI_DEVICE_CREATED",type:"success",percentage:75}),t.resolve({location:r.header.location,statusCode:r.statusCode})):t.reject({errors:r.errors,statusCode:r.statusCode})}).catch(function(e){if(e.statusCode===h.default.BAD_REQUEST){v.default.query(e,"$..message")[0].includes("Entity duplicated"),t.reject({errors:e.data.errors,statusCode:e.statusCode})}else t.reject({errors:e.data,statusCode:e.statusCode})})}).catch(function(e){e.data.errors.forEach(function(e){var r=e.description;e.label&&(r+=":"+e.label),t.notify({message:"Error: "+r,type:"error",percentage:80})});var r=[o.delete(t,90)];i.forEach(function(e){r.push(e.wrapper.delete(t,90))}),y.default.allSettled(r).then(function(){t.reject(e)}).catch(function(){t.reject(e)})}),t.promise}},{key:"update",value:function(){var e=this,t=y.default.defer(),r=this._objClone,n=[],i=this;return this._wrappers.forEach(function(e){n.push({wrapper:e,promise:e.execute(t,20)})}),y.default.allSettled(n.reduce(function(e,t){return e.push(t.promise),e},[])).then(function(){return t.notify({message:"OGAPI_201_ENTITIES_CREATED",type:"success",percentage:40}),t.notify({entity:i._key._value._current.value,message:"OGAPI_ADDING_RELATED_ENTITIES",type:"success",percentage:45}),e._setUrlParameters({flattened:!0}),i._ogapi.Napi.put(i._url,r,e._timeout,null,e._getUrlParameters()).then(function(e){e.statusCode===h.default.OK?("function"==typeof i._onCreated&&i._onCreated(e.header.location),t.notify({entity:i._key._value._current.value,message:"OGAPI_DEVICE_UPDATED",type:"success",percentage:90}),t.resolve({location:e.header.location,statusCode:e.statusCode})):t.reject({errors:e.errors,statusCode:e.statusCode})})}).catch(function(e){t.notify("OGAPI_SOMETHING_WRONG_UPDATING_DEVICE"),t.reject(e)}),t.promise}},{key:"patch",value:function(){var e=this,t=y.default.defer(),r=this._obj,n=[],i=this;return this._wrappers.forEach(function(e){n.push({wrapper:e,promise:e.execute(t,20)})}),y.default.allSettled(n.reduce(function(e,t){return e.push(t.promise),e},[])).then(function(){return t.notify({message:"OGAPI_201_ENTITIES_CREATED",type:"success",percentage:40}),t.notify({entity:i._key._value._current.value,message:"OGAPI_ADDING_RELATED_ENTITIES",type:"success",percentage:45}),e._setUrlParameters({flattened:!0}),i._ogapi.Napi.patch(i._url,r,e._timeout,null,e._getUrlParameters()).then(function(e){e.statusCode===h.default.OK?("function"==typeof i._onCreated&&i._onCreated(e.header.location),t.notify({entity:i._key._value._current.value,message:"OGAPI_DEVICE_UPDATED",type:"success",percentage:90}),t.resolve({location:e.header.location,statusCode:e.statusCode})):t.reject({errors:e.errors,statusCode:e.statusCode})})}).catch(function(e){t.notify("OGAPI_SOMETHING_WRONG_UPDATING_DEVICE"),t.reject(e)}),t.promise}},{key:"delete",value:function(e,t){var r=this;return this._ogapi.Napi.delete(this._urlWithKey()).then(function(n){e.notify({entity:r._key,message:"OGAPI_ENTITY_DELETED",type:"warning",percentage:t})})}}]),e}(),g=function(){function e(t,r,n,i){o(this,e),this._obj=r,this._url=n,this._ogapi=t,this._key=i,this._created=!1}return u(e,[{key:"_urlWithKey",value:function(){return this._url+"/"+this._key}},{key:"_checkExists",value:function(){return this._ogapi.Napi.get(this._urlWithKey()).then(function(e){return e.statusCode===h.default.OK}).catch(function(e){return console.warn(e),!1})}},{key:"execute",value:function(e,t){function r(e,t,r){i._obj["provision.administration.serviceGroup"]={_value:{_current:{value:"emptyServiceGroup"}}},i._ogapi.Napi.post(i._url,i._obj,null,null,{flattened:!0}).then(function(n){i._created=!0,e.notify({entity:i._key,message:"OGAPI_ENTITY_CREATED",type:"success",percentage:r}),t.resolve({message:"OGAPI_ENTITY_CREATED",entity:i._key})}).catch(function(n){console.error(n),e.notify({entity:i._key,message:"OGAPI_ENTITY_CREATED",type:"warning",percentage:r}),t.reject({entity:i._key,message:"OGAPI_SOMETHING_WRONG_CREATING"})})}var n=y.default.defer(),i=this;return this._checkExists().then(function(o){o?n.resolve({message:"OGAPI_ENTITY_ALREADY_CREATED",entity:i._key}):r(e,n,t)}).catch(function(o){o?n.resolve({message:"OGAPI_ENTITY_ALREADY_CREATED",entity:i._key}):r(e,n,t)}),n.promise}},{key:"delete",value:function(e,t){var r=this;return this._created?this._ogapi.Napi.delete(this._urlWithKey()).then(function(n){e.notify({entity:r._key,message:"OGAPI_ENTITY_DELETED",type:"warning",percentage:t})}):Q.fcall(function(){})}}]),e}(),b=function(e){function t(e,r,n,i,u,s){o(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/devices",n,i,u,s),this._organization=r}return i(t,e),u(t,[{key:"create",value:function(){return this._checkRequiredParameters(),new _(this._ogapi,this._composeElement(),this._resource,this._getEntityKey(),this._getUrlParameters(),this._timeout).create()}},{key:"update",value:function(){return new _(this._ogapi,this._composeElement(),this._buildURL(),this._getEntityKey(),this._getUrlParameters(),this._timeout).update()}},{key:"_getEntityKey",value:function(){return this._entity["provision.device.identifier"]}}]),t}(c.default);r.default=b,t.exports=r.default},{"./ComplexBuilder":240,"./SubscriberBuilder":247,"./SubscriptionBuilder":248,"http-status-codes":76,jsonpath:104,q:117}],243:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("q"),u=n(a),s=e("jsonpath"),c=n(s),l=e("ajv"),f=n(l),d=e("./AssetBuilder"),h=n(d),p=e("./DeviceBuilder"),y=n(p),m=e("./TicketBuilder"),v=n(m),_=e("./SubscriberBuilder"),g=n(_),b=e("./SubscriptionBuilder"),w=n(b),E=e("./CsvBulkBuilder"),A=n(E),O=e("./JsonFlattenedBulkBuilder"),S=n(O),P=e("./JsonBulkBuilder"),D=n(P),C=new f.default,k=["entities","tickets"],T=function(){function e(t){i(this,e);this._ogapi=t}return o(e,[{key:"_loadAllowedDatastreams",value:function(e,t,r){var n=this,i=u.default.defer(),o=i.promise,a=n._ogapi.newFilterBuilder();return a.and({like:{"datamodels.categories.datastreams.identifier":"provision"}}).and({eq:{"datamodels.organizationName":t}}).and({eq:{"datamodels.allowedResourceTypes":r}}),this._ogapi.datamodelsSearchBuilder().filter(a).build().execute().then(function(e){return n.schema={},e}).then(function(t){200!==t.statusCode&&i.reject({data:"OGAPI_DATASTREAM_NOT_FOUND",statusCode:204}),n._getJsonPathElements().then(function(){t.data=n._setDevicesProperties(t.data,e),i.resolve(t)}).catch(function(e){i.reject(e)})}).catch(function(e){i.reject(e)}),o}},{key:"_getJsonPathElements",value:function(){var e=u.default.defer(),t=e.promise;return this._ogapi.basicTypesSearchBuilder().withPath("$").build().execute().then(function(t){C.getSchema("/og_basic_types.json")&&C.removeSchema("/og_basic_types.json"),C.addSchema(t.data,"/og_basic_types.json"),e.resolve()}).catch(function(t){e.reject(t)}),t}},{key:"_setDevicesProperties",value:function(e,t){var r=this,n=c.default.query(e,"$.datamodels[*].categories[*].datastreams[?(@.calculated === false)]"),i={allowedDatastreams:[],schemas:{}};return r.complexFunctions=[],r.simpleFunctions=[],n.forEach(function(e,n){var o=e.identifier;if(o.startsWith("provision.administration")||o.startsWith(t))if(i.allowedDatastreams.push(e),o.includes("communicationModules")){var a=t.includes("subscriber")||t.includes("subscription");r.schema[o]={value:e.schema,complex:!a,function:a?"with":"withComplex"}}else r.schema[o]={value:e.schema,complex:!1,function:"with"}}),i.schemas=r.schema,i}},{key:"devicesBuilder",value:function(e,t){return this._genericBuilder(e,"entity.device","provision",function(r,n){return new y.default(this._ogapi,e,r,n,C,t)})}},{key:"assetsBuilder",value:function(e,t){return this._genericBuilder(e,"entity.asset","provision",function(r,n){return new h.default(this._ogapi,e,r,n,C,t)})}},{key:"ticketsBuilder",value:function(e,t){return this._genericBuilder(e,"ticket","provision",function(r,n){return new v.default(this._ogapi,e,r,n,C,t)})}},{key:"subscribersBuilder",value:function(e,t){return this._genericBuilder(e,"entity.subscriber","provision.device.communicationModules[].subscriber",function(r,n){return new g.default(this._ogapi,e,r,n,C,t)})}},{key:"subscriptionsBuilder",value:function(e,t){return this._genericBuilder(e,"entity.subscription","provision",function(r,n){return new w.default(this._ogapi,e,r,n,C,t)})}},{key:"newCsvBulkBuilder",value:function(e,t,r,n){return this._validateBulk(e,t),new A.default(this._ogapi,e,t,r,n)}},{key:"newJsonBulkBuilder",value:function(e,t,r,n){return this._validateBulk(e,t),new D.default(this._ogapi,e,t,r,n)}},{key:"newJsonFlattenedBulkBuilder",value:function(e,t,r,n){return this._validateBulk(e,t),new S.default(this._ogapi,e,t,r,n)}},{key:"_validateBulk",value:function(e,t){if(!e)throw new Error("Parameters organization must be defined");if(!t||-1===k.indexOf(t))throw new Error("The parameters resources must be defined and must be some of these values: entities or tickets")}},{key:"_genericBuilder",value:function(e,t,r,n){var i=this,o=u.default.defer();if(!e)throw new Error("Parameters organization must be defined");return this._loadAllowedDatastreams(r,e,t).then(function(e){200===e.statusCode?o.resolve(n.call(i,e.data.allowedDatastreams,e.data.schemas)):o.reject("OGAPI_DATASTREAM_NOT_FOUND")}).catch(function(e){o.reject(e)}),o.promise}}]),e}();r.default=T,t.exports=r.default},{"./AssetBuilder":238,"./CsvBulkBuilder":241,"./DeviceBuilder":242,"./JsonBulkBuilder":244,"./JsonFlattenedBulkBuilder":245,"./SubscriberBuilder":247,"./SubscriptionBuilder":248,"./TicketBuilder":249,ajv:2,jsonpath:104,q:117}],244:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("./BulkBuilder"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e,r,i,a,u){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provision/organizations/"+r+"/bulk/"+(u?"async":i.toLowerCase()),"application/json",a),u&&this._setUrlParameters({type:i.toUpperCase()})}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"./BulkBuilder":239}],245:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("./BulkBuilder"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e,r,i,a,u){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provision/organizations/"+r+"/bulk/"+(u?"async":i.toLowerCase()),"application/json",a),this._setUrlParameters({flattened:!0}),u&&this._setUrlParameters({flattened:!0,type:i.toUpperCase()})}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"./BulkBuilder":239}],246:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){
|
|
32
|
-
if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("http-status-codes"),c=n(s),l=e("../BaseProvision"),f=n(l),d=e("q"),h=n(d),p=e("lodash"),y=n(p),m=function(e){function t(e,r,n,o,a,s){if(i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations/"+r,s),"function"!=typeof this._getEntityKey)throw new Error("Must override method: _getEntityKey");this._setUrlParameters({flattened:!0}),this._entity={},this._allowedDatastreams=n,this._definedSchemas=o,this._jsonSchemaValidator=a}return o(t,e),a(t,[{key:"_buildURL",value:function(){return this._resource+"/"+this.getEntityKey()}},{key:"_validate",value:function(){var e=this,t=[];if(Object.keys(this._entity).forEach(function(r){"resourceType"!=r&&function(){if(!e._definedSchemas[r])throw new Error("Datastream is not allowed: "+r);var n=e._definedSchemas[r].value;if(e._entity[r].constructor===Array)e._entity[r].forEach(function(i){var o=i._value._current.value;e._jsonSchemaValidator.validate("/og_basic_types.json",o)||t.push(r+" ["+o+"] value is not allowed. The value should be formatted as follows: "+JSON.stringify(n))});else{var i=e._entity[r]._value._current.value;e._jsonSchemaValidator.validate("/og_basic_types.json",i)||t.push(r+" ["+i+"] value is not allowed. The value should be formatted as follows: "+JSON.stringify(n))}}()}),t.length>0)throw new Error(JSON.stringify(t).replace(new RegExp('"',"g"),""))}},{key:"_composeElement",value:function(){return this._validate(),this._entity}},{key:"getEntityKey",value:function(){return null!==this._getEntityKey()?this._getEntityKey()._value._current.value:null}},{key:"with",value:function(e,t){return void 0!==t&&0!==t.length||y.default.isArray(t)?1!==this.getAllowedDatastreams().filter(function(t){return t.identifier===e}).length?(console.warn("Datastream not found or operations can not be performed on it. This value will be ignored. Datastream Name: "+e),this):(this._entity[e]={_value:{_current:{value:t}}},this):(delete this._entity[e],this)}},{key:"getAllowedDatastreams",value:function(){return this._allowedDatastreams}},{key:"initFromFlattened",value:function(e){var t=this;e&&Object.keys(e).length>0&&Object.keys(e).forEach(function(r){if(r.toLowerCase().startsWith("provision")){var n=e[r];Array.isArray(n)&&(n=n[0]),t.with(r,n._value._current.value)}})}},{key:"_initFromJson",value:function(e,t){var r=this;if(e){Object.keys(e).forEach(function(n){var i=e[n],o=i._current,a=t?t+"."+n:n;o?r.with(a,o.value):Array.isArray(i)?r._initFromJson(i[0],a+"[]"):r._initFromJson(i,a)})}}},{key:"initFromJson",value:function(e){var t=this,r={};e&&(r=e.provision)&&t._initFromJson(r,"provision")}},{key:"deleteAll",value:function(){var e=h.default.defer(),t=e.promise;return this._setUrlParameters({full:!0}),this._ogapi.Napi.delete(this._buildURL(),this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){t.statusCode===c.default.OK?e.resolve({statusCode:t.statusCode}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}},{key:"update",value:function(){var e=h.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),this._composeUpdateElement(),this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):200===t.status?e.resolve({statusCode:t.status}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}},{key:"patch",value:function(){var e=h.default.defer(),t=e.promise;return this._ogapi.Napi.patch(this._buildURL(),this._composeUpdateElement(),this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):200===t.status?e.resolve({statusCode:t.status}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(f.default);r.default=m,t.exports=r.default},{"../BaseProvision":235,"http-status-codes":76,lodash:111,q:117}],247:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SimpleBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c="provision.device.communicationModules[].subscriber.identifier";r.SubscriberID=c;var l=function(e){function t(e,r,i,o,u,s){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/subscribers",i,o,u,s)}return i(t,e),o(t,[{key:"_getEntityKey",value:function(){return this._entity[c]}}]),t}(s.default);r.default=l},{"./SimpleBuilder":246}],248:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SimpleBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c="provision.device.communicationModules[].subscription.identifier";r.SubscriptionID=c;var l=function(e){function t(e,r,i,o,u,s){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/subscriptions",i,o,u,s)}return i(t,e),o(t,[{key:"_getEntityKey",value:function(){return this._entity[c]}}]),t}(s.default);r.default=l},{"./SimpleBuilder":246}],249:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SimpleBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c="provision.ticket.identifier";r.TicketID=c;var l=function(e){function t(e,r,i,o,u,s){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/tickets",i,o,u,s)}return i(t,e),o(t,[{key:"_getEntityKey",value:function(){return this._entity[c]}}]),t}(s.default);r.default=l},{"./SimpleBuilder":246}],250:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../provision/BaseProvision"),c=n(s),l=e("../util/formats/check_types"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations/",void 0,["name","organization","configurationParams","scriptProcessor"])}return o(t,e),a(t,[{key:"_buildURL",value:function(){return"provisionProcessors/provision/organizations/"+this._organization+"/"+this._identifier}},{key:"withOrganization",value:function(e){return f.default._checkStringAndLength(e,50,"organization"),this._organization=e,this}},{key:"withIdentifier",value:function(e){return f.default._checkString(e,"identifier"),this._identifier=e,this}},{key:"withName",value:function(e){return f.default._checkString(e,"name"),this._name=e,this}},{key:"withConfigurationParams",value:function(e){return f.default._checkObject(e,"configurationParams"),this._configurationParams=e,this}},{key:"withScriptProcessor",value:function(e){return f.default._checkObject(e,"scriptProcessor"),this._scriptProcessor=e,this}},{key:"_composeElement",value:function(){return this._resource="provisionProcessors/provision/organizations/"+this._organization,{name:this._name,configurationParams:this._configurationParams,scriptProcessor:this._scriptProcessor}}}]),t}(c.default);r.default=d,t.exports=r.default},{"../provision/BaseProvision":235,"../util/formats/check_types":342}],251:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provisionProcessors/provision/organizations","provisionPrecessors")}return i(t,e),o(t,[{key:"findByOrganization",value:function(e){return this._withId(e),this._execute()}},{key:"findByOrganizationAndProvisionProcessorId",value:function(e,t){return this._withId(e+"/"+t),this._execute()}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":138}],252:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../provision/BaseProvision"),c=n(s),l=e("./_RuleCondition"),f=(n(l),e("./_RuleNotification")),d=(n(f),e("q")),h=n(d),p=function(e){function t(e,r,n,o,a){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations"),this.withOrganization(r),this.withChannel(n),o&&this.withIdentifier(o),a&&(a.name&&this.withName(a.name),a.mode&&this.withMode(a.mode),a.type&&this.withType(a.type),a.description&&this.withDescription(a.description),null!==a.active&&void 0!==a.active&&this.withActive(a.active),null!==a.condition&&void 0!==a.condition&&this.withCondition(a.condition),a.actionsDelay&&this.withActionsDelay(a.actionsDelay),a.actions&&this.withActions(a.actions),a.parameters&&this.withParameters(a.parameters),a.javascript&&this.withJavascript(a.javascript))}return o(t,e),a(t,[{key:"withOrganization",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter organization must be a string, cannot be empty and has a maximum length of 50");return this._organization=e,this}},{key:"withChannel",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter channel must be a string, cannot be empty and has a maximum length of 50");return this._channel=e,this}},{key:"withIdentifier",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter identifier must be a string, cannot be empty and has a maximum length of 50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter name must be a string, cannot be empty and has a maximum length of 50");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_250",parameter:"description"});return this._description=e,this}},{key:"withJavascript",value:function(e){if("string"!=typeof e)throw new Error("Parameter name must be a string and cannot be empty");return this._javascript=e,this}},{key:"withMode",value:function(e){return this._mode=e,this}},{key:"withType",value:function(e){return this._type=e,this}},{key:"withActive",value:function(e){if("boolean"!=typeof e)throw new Error("Parameter active must be true or false");return this._active=e,this}},{key:"withActionsDelay",value:function(e){if("number"!=typeof e)throw new Error("Parameter actionsDelay must be a number");return this._actionsDelay=e,this}},{key:"withCondition",value:function(e){return this._condition=e||{},this}},{key:"withActions",value:function(e){return this._actions=e||{},this}},{key:"withParameters",value:function(e){return this._parameters=e||[],this}},{key:"_composeElement",value:function(){return{identifier:this._identifier,name:this._name,active:this._active,mode:this._mode,type:this._type,severity:this._severity,description:this._description?this._description:void 0,parameters:this._parameters,condition:"EASY"===this._mode?this._condition:void 0,actionsDelay:this._actionsDelay,actions:"EASY"===this._mode?this._actions:void 0,javascript:"ADVANCED"===this._mode?this._javascript:void 0}}},{key:"_checkRequiredParameters",value:function(e){if(e){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel||void 0===this._active||void 0===this._mode)throw new Error("Parameters organization, channel, active, mode and identifier must be defined")}else if(void 0===this._name||void 0===this._organization||void 0===this._channel||void 0===this._active||void 0===this._mode)throw new Error("Parameters organization, channel, active, mode and name must be defined")}},{key:"_buildURL",value:function(){return"rules/"+this._resource+"/"+this._organization+"/channels/"+this._channel+"/"}},{key:"create",value:function(){return this._checkRequiredParameters(),this._doNorthPost(this._buildURL(),this._composeElement())}},{key:"update",value:function(){return this._checkRequiredParameters(!0),this._doNorthPut(this._buildURL()+this._identifier,this._composeElement())}},{key:"updateParameters",value:function(e){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel)throw new Error("Parameters organization, channel and identifier must be defined");return this._doNorthPut(this._buildURL()+this._identifier+"/parameters",e||this._parameters||[])}},{key:"delete",value:function(){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel)throw new Error("Parameters organization, channel and name must be defined");var e=h.default.defer(),t=e.promise;return this._ogapi.Napi.delete(this._buildURL()+this._identifier).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=p,t.exports=r.default},{"../provision/BaseProvision":235,"./_RuleCondition":256,"./_RuleNotification":257,q:117}],253:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"rules/catalog","rulesTemplate","Rule templates not found")}return i(t,e),o(t,[{key:"getTemplates",value:function(){return this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":138}],254:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"rules/provision/organizations","rules","Rule configurations not found")}return i(t,e),o(t,[{key:"findByOrganizationAndChannelAndName",value:function(e,t,r){var n=this;return n._organization=e,n._channel=t,n._name=r,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/channels/"+this._channel+"/"+this._name}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":138}],255:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../GenericFinder"),c=n(s),l=e("q"),f=n(l),d=e("http-status-codes"),h=n(d),p=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"rules"),this._jsHeaders={accept:"application/javascript"},this._mdHeaders={accept:"text/markdown"}}return o(t,e),a(t,[{key:"getdDummyFunctions",value:function(){return this._setExtraHeaders(this._jsHeaders),this._id="js/dummyFunctions",this._execute()}},{key:"getDocPrivateJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/private/javascriptFunctions",this._execute()}},{key:"getDocJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/javascriptFunctions",this._execute()}},{key:"_execute",value:function(){var e=f.default.defer(),t=e.promise,r=this._error_not_found;return this._api.get(this._composeUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){204===t.statusCode?e.reject({error:r,statusCode:h.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=p,t.exports=r.default},{"../GenericFinder":138,"http-status-codes":76,q:117}],256:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("./RuleConfigurations"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t,r){if(n(this,e),t.constructor!==a.default)throw new Error("Parent must be a RuleConfigurations");this._ruleConfiguration=t,this._condition=r}return i(e,[{key:"setDelay",value:function(e){if("number"!=typeof e||typeof e<1)throw new Error("Parameter delay must be typeof number and higher than -1");return void 0===this._condition.delay?console.warn("Parameter delay cannot be setted for this condition"):this._condition.delay=1e3*e,this}},{key:"deactivateDelay",value:function(){return void 0===this._condition.delay?console.warn("Parameter delay cannot be setted for this condition"):this._condition.delay=-1,this}},{key:"setParameterValue",value:function(e,t){var r=this;if(this._condition.parameters&&this._condition.parameters.length>0){for(var n in this._condition.parameters){var i=this._condition.parameters[n];if(i.name===e){if(void 0===i.value)throw new Error("Value not allowed for parameter "+e+" in condition "+this._condition.name);return i.value=t||"",r}}throw new Error("Parameter "+e+" not exists for condition "+this._condition.name)}}},{key:"parent",value:function(){return this._ruleConfiguration}}]),e}();r.default=u,t.exports=r.default},{"./RuleConfigurations":252}],257:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("./RuleConfigurations"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t,r){if(n(this,e),t.constructor!==a.default)throw new Error("Parent must be a RuleConfigurations");this._ruleConfiguration=t,this._notification=r}return i(e,[{key:"setEnabled",value:function(e){if("boolean"!=typeof e)throw new Error("Bearer enabled must be true or false");return this._notification.enabled=e,this}},{key:"setBearerRecipients",value:function(e,t){var r=this;if(this._notification.bearers&&this._notification.bearers.length>0){for(var n in this._notification.bearers){var i=this._notification.bearers[n];if(i.name===e)return i.recipients=t,r}console.warn("Bearer "+e+" not exists for notification "+this._notification.name)}else console.warn("There is no bearers for notification "+this._notification.name);return r}},{key:"enableBearer",value:function(e){var t=this;if(this._notification.bearers&&this._notification.bearers.length>0){for(var r in this._notification.bearers){var n=this._notification.bearers[r];if(n.name===e)return n.enabled=!0,t}console.warn("Bearer "+e+" not exists for notification "+this._notification.name)}else console.warn("There is no bearers for notification "+this._notification.name);return t}},{key:"disableBearer",value:function(e){var t=this;if(this._notification.bearers&&this._notification.bearers.length>0){for(var r in this._notification.bearers){var n=this._notification.bearers[r];if(n.name===e)return n.enabled=!1,t}console.warn("Bearer "+e+" not exists for notification "+this._notification.name)}else console.warn("There is no bearers for notification "+this._notification.name);return t}},{key:"parent",value:function(){return this._ruleConfiguration}}]),e}();r.default=u,t.exports=r.default},{"./RuleConfigurations":252}],258:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./Search"),c=n(s),l=e("q"),f=n(l),d=function(e){function t(e,r,n,o,a,s,c,l,f){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,o,a,s,c,l,f)}return o(t,e),a(t,[{key:"execute",value:function(){var e=f.default.defer(),t=e.promise,r=this._getUrlParameters();return this._ogapi.Napi.post(this._resource,this._filter(),this._timeout,this._getExtraHeaders(),r).then(function(t){var r=t.body,n=t.statusCode;200===n&&(r.assets=r.entities,delete r.entities),e.resolve({data:r,statusCode:n})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=d,t.exports=r.default},{"./Search":263,q:117}],259:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("q"),u=n(a),s=e("merge"),c=(n(s),function(){function e(t,r,n,o){if(i(this,e),this.constructor===e)throw new Error("Cannot construct Abstract instances directly");if("function"!=typeof this._filter)throw new Error("Must override method: filter");this._timeout="number"!=typeof n?t.Napi._options.timeout:n,this._ogapi=t,this._resource=r,this._headers=void 0,this._urlParameters=void 0,this._serviceBaseURL=o}return o(e,[{key:"_getExtraHeaders",value:function(){return this._headers}},{key:"_setExtraHeaders",value:function(e){if(this._headers)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._headers[n]=e[n]}else this._headers=e}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this._urlParameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"execute",value:function(){
|
|
33
|
-
var e=u.default.defer(),t=e.promise;return this._ogapi.Napi.post(this._resource,this._filter(),this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then(function(t){var r=t.body,n=t.statusCode;e.resolve({data:r,statusCode:n})}).catch(function(t){e.reject(t)}),t}},{key:"downloadCsv",value:function(){var e=u.default.defer(),t=e.promise,r=this._filter();return r&&r.limit&&delete r.limit,this._setExtraHeaders({Accept:"text/plain"}),this._ogapi.Napi.post(this._resource,r,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then(function(t){var r=t,n=t.statusCode;e.resolve({data:r,statusCode:n})}).catch(function(t){e.reject(t)}),t}},{key:"_asyncPagingFilter",value:function(){var e=this._filter();return e.limit&&e.limit.size?e.limit.start=1:e.limit={size:1e3,start:1},e}},{key:"cancelAsyncPaging",value:function(e){"string"==typeof e&&e.length>0?this.cancel=e:this.cancel=!0}},{key:"_loadData",value:function(e){function t(){if(r.cancel||"string"==typeof r.cancel){var a="string"==typeof r.cancel?r.cancel:"Cancel process";n.reject({data:a,statusCode:403})}else r._ogapi.Napi.post(r._resource,i,r._timeout,r._getExtraHeaders(),r._getUrlParameters(),r._getServiceBaseURL()).then(function(r){var a=r.statusCode,u=r.body;if(!u&&r.text)try{var s=JSON.parse(r.text);s&&(u=s)}catch(e){console.error("Impossible to parse text from response")}if(200===a||200===a){o=!0;var c=u.data?u.data[e]:u[e];n.notify(c),c.length===i.limit.size?(i.limit.start+=1,t()):n.resolve({data:"DONE",statusCode:200})}else o?n.resolve({data:"DONE",statusCode:200}):n.reject({data:u,statusCode:a})}).catch(function(e){n.reject(e)})}var r=this,n=u.default.defer(),i=r._asyncPagingFilter(),o=!1;return t(),n.promise}},{key:"executeWithAsyncPaging",value:function(e){var t=u.default.defer(),r=t.promise;return this._loadData(e).then(function(e){t.resolve(e)},null,function(e){t.notify(e)}).catch(function(e){t.reject(e)}),r}},{key:"_getServiceBaseURL",value:function(){return this._serviceBaseURL}}]),e}());r.default=c,t.exports=r.default},{merge:112,q:117}],260:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./Search"),c=n(s),l=e("q"),f=n(l),d=function(e){function t(e,r,n,o,a,s,c,l,f){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,o,a,s,c,l,f)}return o(t,e),a(t,[{key:"execute",value:function(){var e=f.default.defer(),t=e.promise,r=this._getUrlParameters();return this._ogapi.Napi.post(this._resource,this._filter(),this._timeout,this._getExtraHeaders(),r).then(function(t){var n=t.body,i=t.statusCode;if(200===i&&n.entities){if(n.devices=n.entities,n.devices.length>0){var o=!1,a=r&&r.flattened||!1;for(o=0;o<n.devices.length;o++)if(a){if(n.devices[o]["device.identifier"]){var u=n.devices[o]["device.identifier"];(!u._value||u._value&&!u._value._current)&&delete n.devices[o]["device.identifier"]}}else n.devices[o].device&&n.devices[o].device.identifier&&!n.devices[o].device.identifier._current&&delete n.devices[o].device.identifier}delete n.entities}e.resolve({data:n,statusCode:i})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=d,t.exports=r.default},{"./Search":263,q:117}],261:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./Search"),c=n(s),l=e("q"),f=n(l),d=function(e){function t(e,r,n,o,a,s,c,l,f){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,o,a,s,c,l,f)}return o(t,e),a(t,[{key:"execute",value:function(){var e=f.default.defer(),t=e.promise,r=this._getUrlParameters();return this._ogapi.Napi.post(this._resource,this._filter(),this._timeout,this._getExtraHeaders(),r).then(function(t){var n=t.body,i=t.statusCode;if(200===i&&n.entities&&n.entities.length>0){var o=!1,a=r&&r.flattened||!1;for(o=0;o<n.entities.length;o++)if(a){if(n.entities[o]["device.identifier"]){var u=n.entities[o]["device.identifier"];(!u._value||u._value&&!u._value._current)&&delete n.entities[o]["device.identifier"]}}else n.entities[o].device&&n.entities[o].device.identifier&&!n.entities[o].device.identifier._current&&delete n.entities[o].device.identifier}e.resolve({data:n,statusCode:i})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=d,t.exports=r.default},{"./Search":263,q:117}],262:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("./../util/Expression"),a=(function(e){e&&e.__esModule}(o),function(){function e(){n(this,e),this._filterTemplate={filter:{}}}return i(e,[{key:"or",value:function(){void 0===this._filterTemplate.filter.or&&(this._filterTemplate.filter.or=[]),void 0!==this._filterTemplate.filter.and&&(console.warn('The filter not allow both elements [and,or], the item "and" are going to be removed.'),delete this._filterTemplate.filter.and);for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0;n<t.length;n++)this._filterTemplate.filter.or.push(t[n]);return this}},{key:"and",value:function(){void 0===this._filterTemplate.filter.and&&(this._filterTemplate.filter.and=[]),void 0!==this._filterTemplate.filter.or&&(console.warn('The filter not allow both elements [and,or], the item "or" are going to be removed.'),delete this._filterTemplate.filter.or);for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0;n<t.length;n++)this._filterTemplate.filter.and.push(t[n]);return this}}]),e}());r.default=a,t.exports=r.default},{"./../util/Expression":338}],263:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./BaseSearch"),c=n(s),l=e("merge"),f=n(l),d=function(e){function t(e,r,n,o,a,s,c,l,d){void 0===o&&(o={limit:{}}),i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"search"+r,l),this._setUrlParameters(d),this._postObj=(0,f.default)(n,o,s,c),"object"==typeof a&&(this._postObj=(0,f.default)(this._postObj,a))}return o(t,e),a(t,[{key:"_filter",value:function(){return this._postObj}}]),t}(c.default);r.default=d,t.exports=r.default},{"./BaseSearch":259,merge:112}],264:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("./../util/SelectElement"),a=(function(e){e&&e.__esModule}(o),function(){function e(){n(this,e),this._selectTemplate={select:[]}}return i(e,[{key:"add",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0;n<t.length;n++){var i=t[n],o=this._selectTemplate.select;if(0===o.length)this._selectTemplate.select.push(i);else{for(var a=!1,u=0;u<o.length;u++){var s=o[u];if(s.name===i.name){a=!0;for(var c=i.fields,l=0;l<c.length;l++){for(var f=c[n],d=!1,h=0;h<s.fields.length;h++)s.fields[h].field===f.field&&(d=!0,f.alias&&(s.fields[h].alias=f.alias));d||this._selectTemplate.select[u].fields.push(f)}}}a||this._selectTemplate.select.push(i)}}return this}}]),e}());r.default=a,t.exports=r.default},{"./../util/SelectElement":340}],265:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./Search"),c=n(s),l=e("q"),f=n(l),d=function(e){function t(e,r,n,o,a,s){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/catalog"+r,n,null,null,o),this._contentType=a,this._customFilters=s}return o(t,e),a(t,[{key:"execute",value:function(){var e=this,t=[],r=f.default.defer(),n=r.promise,i=e._content(e._contentType),o=e._customFilters&&e._customFilters.entityType,a=Object.keys(e._customFilters).length,u=a>1||1===a&&!o,s={};switch(o?s[o]=i[o]:s=i,e._contentType){case"operationalStatus":for(var c in s)s[c].forEach(function(r){(!e._customFilters.id||e._customFilters.id&&e._customFilters.id===r)&&t.push({entityType:c,id:r})});break;case"administrativeState":var l=function(e){var r=e;r.entityType=d,t.push(r)};for(var d in s){var h=s[d];for(var p in h)if(u){for(var y in e._customFilters)if(h[p][y]===e._customFilters[y]){l(h[p]);break}}else l(h[p])}break;case"fieldsDefinition":case"communicationsModuleType":var m=u&&e._customFilters.type;if(void 0===m){r.resolve({error:"Filters not allowed",statusCode:400});break}var v=m?s[m]:s;t=v;break;case"userProfile":for(var _ in s)(!e._customFilters.id||e._customFilters.id&&e._customFilters.id===_)&&s[_].length>0&&t.push({id:_,managed:s[_]});break;case"serviceGroups":o&&(t=s[o]);break;case"allowedResourceType":for(var g in s)(!e._customFilters.type||e._customFilters.type&&s[g].types.indexOf(e._customFilters.type)>-1)&&t.push(s[g].resourceType);break;case"ticketSeverity":case"ticketPriority":case"ticketStatus":case"ruleConfigurationSeverity":case"ruleMode":case"ruleType":case"ioTDatastreamPeriod":case"ioTDatastreamAccess":case"resourceType":case"countryCodes":case"timezones":case"userLanguages":case"ioTDatastreamStoragePeriod":if(m){r.resolve({error:"Filters not supported",statuscode:400});break}t=t.concat(s);break;default:r.resolve({data:{},statusCode:400})}if(t&&Object.keys(t).length>0){var b={};b[e._contentType]=t,r.resolve({data:b,statusCode:200})}else r.resolve({data:{},statusCode:204});return n}},{key:"_content",value:function(e){return{ticketSeverity:["CRITICAL","URGENT","WARNING","NORMAL"],ticketPriority:["MAJOR","MINOR","CRITICAL","BLOCKER"],ticketStatus:["CREATED","ASSIGNED","ANSWERED","RESTORED","RESOLVED","CLOSED"],serviceGroups:{ASSET:["noUpdate","emptyServiceGroup","emptyServiceGroup_onSession","emptyServiceGroup_onDemand","level1SecurityServiceGroup","level2SecurityServiceGroup","level3SecurityServiceGroup","trustedNoneSecurityServiceGroup","trustedNoneSecurityServiceGroup_onDemand","trustedLevel1SecurityServiceGroup","trustedLevel2SecurityServiceGroup","trustedLevel3SecurityServiceGroup"],SUBSCRIBER:["emptyServiceGroup"],SUBSCRIPTION:["emptyServiceGroup"],GATEWAY:["noUpdate","emptyServiceGroup","emptyServiceGroup_onSession","emptyServiceGroup_onDemand","level1SecurityServiceGroup","level2SecurityServiceGroup","level3SecurityServiceGroup","trustedNoneSecurityServiceGroup","trustedNoneSecurityServiceGroup_onDemand","trustedLevel1SecurityServiceGroup","trustedLevel2SecurityServiceGroup","trustedLevel3SecurityServiceGroup"]},administrativeState:{ASSET:[{id:"BANNED",description:"Asset banned, It means that received information of this asset is not going to be collected"},{id:"DELETED",description:"Asset removed from available stock"},{id:"IN_MAINTENANCE",description:"Asset in maintenance"},{id:"IN_STOCK",description:"Asset in stock"},{id:"IN_TRANSIT",description:"Asset in transit"},{id:"IN_USE",description:"Asset in use"},{id:"MISSING",description:"Asset missing"},{id:"ORDERED",description:"Asset ordered"},{id:"READY",description:"Asset ready for installation"},{id:"RETIRED",description:"Field entity withdrawal"}],GATEWAY:[{id:"REQUESTED",description:"Entity requested to the supplier"},{id:"READY",description:"Entity ready for installation"},{id:"REPAIR",description:"Entity under repair"},{id:"TESTING",description:"Entity in tests"},{id:"ACTIVE",description:"Field deployed entity"},{id:"SUSPENDED",description:"Suspended its operation"},{id:"DELETED",description:"Entity removed from available stock"},{id:"RETIRED",description:"Field entity withdrawal"},{id:"BANNED",description:"Entity banned, It means that received information of this entity is not going to be collected"}],COMMUNICATIONS_MODULE:[{id:"REQUESTED",description:"Entity requested to the supplier"},{id:"READY",description:"Entity ready for installation"},{id:"REPAIR",description:"Entity under repair"},{id:"TESTING",description:"Entity in tests"},{id:"ACTIVE",description:"Field deployed entity"},{id:"SUSPENDED",description:"Suspended its operation"},{id:"DELETED",description:"Entity removed from available stock"},{id:"RETIRED",description:"Field entity withdrawal"},{id:"BANNED",description:"Entity banned, It means that received information of this entity is not going to be collected"}],SUBSCRIBER:[{id:"REQUESTED",description:"Entity requested to the supplier"},{id:"READY",description:"Entity ready for installation"},{id:"REPAIR",description:"Entity under repair"},{id:"TESTING",description:"Entity in tests"},{id:"ACTIVE",description:"Field deployed entity"},{id:"SUSPENDED",description:"Suspended its operation"},{id:"DELETED",description:"Entity removed from available stock"},{id:"RETIRED",description:"Field entity withdrawal"},{id:"BANNED",description:"Entity banned, It means that received information of this entity is not going to be collected"}],SUBSCRIPTION:[{id:"REQUESTED",description:"Entity requested to the supplier"},{id:"READY",description:"Entity ready for installation"},{id:"REPAIR",description:"Entity under repair"},{id:"TESTING",description:"Entity in tests"},{id:"ACTIVE",description:"Field deployed entity"},{id:"SUSPENDED",description:"Suspended its operation"},{id:"DELETED",description:"Entity removed from available stock"},{id:"RETIRED",description:"Field entity withdrawal"},{id:"BANNED",description:"Entity banned, It means that received information of this entity is not going to be collected"}],CERTIFICATE:[{id:"NOT_ACTIVE",description:"NOT_ACTIVE"},{id:"ACTIVE",description:"ACTIVE"},{id:"REVOKED",description:"REVOKED"},{id:"EXPIRED",description:"EXPIRED"}]},operationalStatus:{ASSET:["UNKNOWN","NORMAL","ALARM","DOWN","SAFE_MODE","TAMPER","TEST"],GATEWAY:["UNKNOWN","NORMAL","ALARM","DOWN","SAFE_MODE","TAMPER","TEST"],COMMUNICATIONS_MODULE:["UNKNOWN","STOPPED","STARTING","RUNNING","STOPPING","ERROR"]},communicationsModuleType:{ADSL:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","subscriptionName","administrativeState","description","ADDRESS","HOME_OPERATOR","LOCATION"]}},CAN:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},ETH:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["subscriptionName","description","administrativeState","ADDRESS"]}},GENERIC:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","subscriptionName","description","administrativeState","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","subscriberName","description","administrativeState","ICC","SERIAL_NUMBER"]}},GSM:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","subscriptionName","description","administrativeState","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","subscriberName","description","administrativeState","ICC"]}},HAN:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},I2C:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},LOWPAN:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["administrativeState","subscriptionName","description"]}},LTE_M:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","subscriptionName","administrativeState","description","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION","RADIUS_USERNAME","RADIUS_PASSWORD","RADIUS_FRAMED_IP_NETMASK","MSISDN_VOICE"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","subscriberName","administrativeState","description","ICC"]}},MESH:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]}},MOBILE:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","subscriptionName","administrativeState","description","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION","RADIUS_USERNAME","RADIUS_PASSWORD","RADIUS_FRAMED_IP_NETMASK","MSISDN_VOICE","SUBSCRIPTION_ICC"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","subscriberName","administrativeState","description","ICC"]}},MULTIMOBILE:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","subscriptionName","administrativeState","description","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION","RADIUS_USERNAME","RADIUS_PASSWORD","RADIUS_FRAMED_IP_NETMASK","MSISDN_VOICE","SUBSCRIPTION_ICC"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","subscriberName","administrativeState","description","ICC"]}},NARROWBAND:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["administrativeState","subscriptionName","description","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","LOCATION"]},SUBSCRIBER:{mandatory:["generatedEntityKey"],optional:["administrativeState","subscriberName","description","ICC"]}},PLC:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["administrativeState","subscriptionName","description"]}},RS232:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},RS422:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},RS485:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},SIGFOX:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:["PAC"]},SUBSCRIPTION:{mandatory:["generatedEntityKey","subscriptionName","HOME_OPERATOR","administrativeState","description","SIGFOX_DEVICE_TYPE"]}},ZIGBEE:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["administrativeState","subscriptionName","description"]}}},ruleMode:["EASY","ADVANCED"],ruleType:["DATASTREAM","OPERATION","EVENT"],ruleConfigurationSeverity:["INFORMATIVE","URGENT","CRITICAL"],userProfile:{root:["admin_domain","admin","advanced","viewer","super_admin_domain"],super_admin_domain:["admin_domain","admin","advanced","viewer"],admin_domain:["admin_domain","admin","advanced","viewer"],admin:["admin","advanced","viewer"],advanced:[],viewer:[]},ioTDatastreamAccess:["READ","WRITE"],ioTDatastreamStoragePeriod:["SECONDS","MINUTES","HOURS","DAYS","MONTHS","YEARS","NEVER"],ioTDatastreamPeriod:["PULSE","CUMULATIVE","INSTANT"],resourceType:[{identifier:"entity.asset"},{identifier:"entity.device"},{identifier:"entity.subscriber"},{identifier:"entity.subscription"},{identifier:"ticket"}],allowedResourceType:[{resourceType:"entity.asset",types:["entity","asset"]},{resourceType:"entity.device",types:["entity","device"]},{resourceType:"entity.subscriber",types:["entity","subscriber"]},{resourceType:"entity.subscription",types:["entity","subscription"]},{resourceType:"ticket",types:["ticket"]},{resourceType:"organization",types:["organization"]},{resourceType:"channel",types:["channel"]}],fieldsDefinition:{string:{description:"Text based value",subtype:["text","password"]},boolean:{description:"Boolean based value",subtype:[]},calendar:{description:"Format is described in the ISO 8601 or in http://www.w3.org/TR/NOTE-datetime",subtype:["datetime","date","time"]},address:{description:"Network address value",subtype:["ip","ipv4","ipv6","mac48"]},number:{description:"Numeric value",subtype:["integer","float","percentage"]},enumeration:{description:"Choice list values",subtype:["string","number"]},array:{description:"Array of values",subtype:["string","number"]},coordinates:{description:"Object indicating coordinates and timestamp in geotime subtype",subtype:["geo","geotime","geojson"]},topology:{description:"Object indicating relations",subtype:["path","tree (not supported yet)"]},object:{description:"Not yet supported. For future uses only",subtype:[]}},userLanguages:[{code:"es",language:"Español/Spanish"},{code:"en",language:"Inglés/English"},{code:"pt",language:"Portugués/Portuguese"}],countryCodes:[{code:"AD",country:"Andorra",zone:"Europe/Andorra"},{code:"AE",country:"United Arab Emirates",zone:"Asia/Dubai"},{code:"AF",country:"Afghanistan",zone:"Asia/Kabul"},{code:"AG",country:"Antigua and Barbuda",zone:"America/Antigua"},{code:"AI",country:"Anguilla",zone:"America/Anguilla"},{code:"AL",country:"Albania",zone:"Europe/Tirane"},{code:"AM",country:"Armenia",zone:"Asia/Yerevan"},{code:"AN",country:"Netherlands Antilles",zone:"Netherlands Antilles"},{code:"AO",country:"Angola",zone:"Africa/Luanda"},{code:"AQ",country:"Antarctica",zone:"Antarctica/McMurdo"},{code:"AR",country:"Argentina",zone:"America/Argentina/Buenos_Aires"},{code:"AS",country:"American Samoa",zone:"Pacific/Pago_Pago"},{code:"AT",country:"Austria",zone:"Europe/Vienna"},{code:"AU",country:"Australia",zone:"Australia/Lord_Howe"},{code:"AW",country:"Aruba",zone:"America/Aruba"},{code:"AX",country:"Aland Islands",zone:"Europe/Mariehamn"},{code:"AZ",country:"Azerbaijan",zone:"Asia/Baku"},{code:"BA",country:"Bosnia and Herzegovina",zone:"Europe/Sarajevo"},{code:"BB",country:"Barbados",zone:"America/Barbados"},{code:"BD",country:"Bangladesh",zone:"Asia/Dhaka"},{code:"BE",country:"Belgium",zone:"Europe/Brussels"},{code:"BF",country:"Burkina Faso",zone:"Africa/Ouagadougou"},{code:"BG",country:"Bulgaria",zone:"Europe/Sofia"},{code:"BH",country:"Bahrain",zone:"Asia/Bahrain"},{code:"BI",country:"Burundi",zone:"Africa/Bujumbura"},{code:"BJ",country:"Benin",zone:"Africa/Porto-Novo"},{code:"BL",country:"Saint Barthélemy",zone:"America/St_Barthelemy"},{code:"BM",country:"Bermuda",zone:"Atlantic/Bermuda"},{code:"BN",country:"Brunei",zone:"Asia/Brunei"},{code:"BO",country:"Bolivia",zone:"America/La_Paz"},{code:"BQ",country:"Bonaire, Saint Eustatius and Saba",zone:"America/Kralendijk"},{code:"BR",country:"Brazil",zone:"America/Noronha"},{code:"BS",country:"Bahamas",zone:"America/Nassau"},{code:"BT",country:"Bhutan",zone:"Asia/Thimphu"},{code:"BV",country:"Bouvet Island",zone:"Bouvet Island"},{code:"BW",country:"Botswana",zone:"Africa/Gaborone"},{code:"BY",country:"Belarus",zone:"Europe/Minsk"},{code:"BZ",country:"Belize",zone:"America/Belize"},{code:"CA",country:"Canada",zone:"America/St_Johns"},{code:"CC",country:"Cocos Islands",zone:"Indian/Cocos"},{code:"CD",country:"Democratic Republic of the Congo",zone:"Africa/Kinshasa"},{code:"CF",country:"Central African Republic",zone:"Africa/Bangui"},{code:"CG",country:"Republic of the Congo",zone:"Africa/Brazzaville"},{code:"CH",country:"Switzerland",zone:"Europe/Zurich"},{code:"CI",country:"Ivory Coast",zone:"Africa/Abidjan"},{code:"CK",country:"Cook Islands",zone:"Pacific/Rarotonga"},{code:"CL",country:"Chile",zone:"America/Santiago"},{code:"CM",country:"Cameroon",zone:"Africa/Douala"},{code:"CN",country:"China",zone:"Asia/Shanghai"},{code:"CO",country:"Colombia",zone:"America/Bogota"},{code:"CR",country:"Costa Rica",zone:"America/Costa_Rica"},{code:"CS",country:"Serbia and Montenegro",zone:"Serbia and Montenegro"},{code:"CU",country:"Cuba",zone:"America/Havana"},{code:"CV",country:"Cape Verde",zone:"Atlantic/Cape_Verde"},{code:"CW",country:"Curaçao",zone:"America/Curacao"},{code:"CX",country:"Christmas Island",zone:"Indian/Christmas"},{code:"CY",country:"Cyprus",zone:"Asia/Nicosia"},{code:"CZ",country:"Czech Republic",zone:"Europe/Prague"},{code:"DE",country:"Germany",zone:"Europe/Berlin"},{code:"DJ",country:"Djibouti",zone:"Africa/Djibouti"},{code:"DK",country:"Denmark",zone:"Europe/Copenhagen"},{code:"DM",country:"Dominica",zone:"America/Dominica"},{code:"DO",country:"Dominican Republic",zone:"America/Santo_Domingo"},{code:"DZ",country:"Algeria",zone:"Africa/Algiers"},{code:"EC",country:"Ecuador",zone:"America/Guayaquil"},{code:"EE",country:"Estonia",zone:"Europe/Tallinn"},{code:"EG",country:"Egypt",zone:"Africa/Cairo"},{code:"EH",country:"Western Sahara",zone:"Africa/El_Aaiun"},{code:"ER",country:"Eritrea",zone:"Africa/Asmara"},{code:"ES",country:"Spain",zone:"Europe/Madrid"},{code:"ET",country:"Ethiopia",zone:"Africa/Addis_Ababa"},{code:"FI",country:"Finland",zone:"Europe/Helsinki"},{code:"FJ",country:"Fiji",zone:"Pacific/Fiji"},{code:"FK",country:"Falkland Islands",zone:"Atlantic/Stanley"},{code:"FM",country:"Micronesia",zone:"Pacific/Chuuk"},{code:"FO",country:"Faroe Islands",zone:"Atlantic/Faroe"},{code:"FR",country:"France",zone:"Europe/Paris"},{code:"GA",country:"Gabon",zone:"Africa/Libreville"},{code:"GB",country:"United Kingdom",zone:"Europe/London"},{code:"GD",country:"Grenada",zone:"America/Grenada"},{code:"GE",country:"Georgia",zone:"Asia/Tbilisi"},{code:"GF",country:"French Guiana",zone:"America/Cayenne"},{code:"GG",country:"Guernsey",zone:"Europe/Guernsey"},{code:"GH",country:"Ghana",zone:"Africa/Accra"},{code:"GI",country:"Gibraltar",zone:"Europe/Gibraltar"},{code:"GL",country:"Greenland",zone:"America/Godthab"},{code:"GM",country:"Gambia",zone:"Africa/Banjul"},{code:"GN",country:"Guinea",zone:"Africa/Conakry"},{code:"GP",country:"Guadeloupe",zone:"America/Guadeloupe"},{code:"GQ",country:"Equatorial Guinea",zone:"Africa/Malabo"},{code:"GR",country:"Greece",zone:"Europe/Athens"},{code:"GS",country:"South Georgia and the South Sandwich Islands",zone:"Atlantic/South_Georgia"},{code:"GT",country:"Guatemala",zone:"America/Guatemala"},{code:"GU",country:"Guam",zone:"Pacific/Guam"},{code:"GW",country:"Guinea-Bissau",zone:"Africa/Bissau"},{code:"GY",country:"Guyana",zone:"America/Guyana"},{code:"HK",country:"Hong Kong",zone:"Asia/Hong_Kong"},{code:"HM",country:"Heard Island and McDonald Islands",zone:"Heard Island and McDonald Islands"},{code:"HN",country:"Honduras",zone:"America/Tegucigalpa"},{code:"HR",country:"Croatia",zone:"Europe/Zagreb"},{code:"HT",country:"Haiti",zone:"America/Port-au-Prince"},{code:"HU",country:"Hungary",zone:"Europe/Budapest"},{code:"ID",country:"Indonesia",zone:"Asia/Jakarta"},{code:"IE",country:"Ireland",zone:"Europe/Dublin"},{code:"IL",country:"Israel",zone:"Asia/Jerusalem"},{code:"IM",country:"Isle of Man",zone:"Europe/Isle_of_Man"},{code:"IN",country:"India",zone:"Asia/Kolkata"},{code:"IO",country:"British Indian Ocean Territory",zone:"Indian/Chagos"},{code:"IQ",country:"Iraq",zone:"Asia/Baghdad"},{code:"IR",country:"Iran",zone:"Asia/Tehran"},{code:"IS",country:"Iceland",zone:"Atlantic/Reykjavik"},{code:"IT",country:"Italy",zone:"Europe/Rome"},{code:"JE",country:"Jersey",zone:"Europe/Jersey"},{code:"JM",country:"Jamaica",zone:"America/Jamaica"},{code:"JO",country:"Jordan",zone:"Asia/Amman"},{code:"JP",country:"Japan",zone:"Asia/Tokyo"},{code:"KE",country:"Kenya",zone:"Africa/Nairobi"},{code:"KG",country:"Kyrgyzstan",zone:"Asia/Bishkek"},{code:"KH",country:"Cambodia",zone:"Asia/Phnom_Penh"},{code:"KI",country:"Kiribati",zone:"Pacific/Tarawa"},{code:"KM",country:"Comoros",zone:"Indian/Comoro"},{code:"KN",country:"Saint Kitts and Nevis",zone:"America/St_Kitts"},{code:"KP",country:"North Korea",zone:"Asia/Pyongyang"},{code:"KR",country:"South Korea",zone:"Asia/Seoul"},{code:"KW",country:"Kuwait",zone:"Asia/Kuwait"},{code:"KY",country:"Cayman Islands",zone:"America/Cayman"},{code:"KZ",country:"Kazakhstan",zone:"Asia/Almaty"},{code:"LA",
|
|
34
|
-
country:"Laos",zone:"Asia/Vientiane"},{code:"LB",country:"Lebanon",zone:"Asia/Beirut"},{code:"LC",country:"Saint Lucia",zone:"America/St_Lucia"},{code:"LI",country:"Liechtenstein",zone:"Europe/Vaduz"},{code:"LK",country:"Sri Lanka",zone:"Asia/Colombo"},{code:"LR",country:"Liberia",zone:"Africa/Monrovia"},{code:"LS",country:"Lesotho",zone:"Africa/Maseru"},{code:"LT",country:"Lithuania",zone:"Europe/Vilnius"},{code:"LU",country:"Luxembourg",zone:"Europe/Luxembourg"},{code:"LV",country:"Latvia",zone:"Europe/Riga"},{code:"LY",country:"Libya",zone:"Africa/Tripoli"},{code:"MA",country:"Morocco",zone:"Africa/Casablanca"},{code:"MC",country:"Monaco",zone:"Europe/Monaco"},{code:"MD",country:"Moldova",zone:"Europe/Chisinau"},{code:"ME",country:"Montenegro",zone:"Europe/Podgorica"},{code:"MF",country:"Saint Martin",zone:"America/Marigot"},{code:"MG",country:"Madagascar",zone:"Indian/Antananarivo"},{code:"MH",country:"Marshall Islands",zone:"Pacific/Majuro"},{code:"MK",country:"Macedonia",zone:"Europe/Skopje"},{code:"ML",country:"Mali",zone:"Africa/Bamako"},{code:"MM",country:"Myanmar",zone:"Asia/Yangon"},{code:"MN",country:"Mongolia",zone:"Asia/Ulaanbaatar"},{code:"MO",country:"Macao",zone:"Asia/Macau"},{code:"MP",country:"Northern Mariana Islands",zone:"Pacific/Saipan"},{code:"MQ",country:"Martinique",zone:"America/Martinique"},{code:"MR",country:"Mauritania",zone:"Africa/Nouakchott"},{code:"MS",country:"Montserrat",zone:"America/Montserrat"},{code:"MT",country:"Malta",zone:"Europe/Malta"},{code:"MU",country:"Mauritius",zone:"Indian/Mauritius"},{code:"MV",country:"Maldives",zone:"Indian/Maldives"},{code:"MW",country:"Malawi",zone:"Africa/Blantyre"},{code:"MX",country:"Mexico",zone:"America/Mexico_City"},{code:"MY",country:"Malaysia",zone:"Asia/Kuala_Lumpur"},{code:"MZ",country:"Mozambique",zone:"Africa/Maputo"},{code:"NA",country:"Namibia",zone:"Africa/Windhoek"},{code:"NC",country:"New Caledonia",zone:"Pacific/Noumea"},{code:"NE",country:"Niger",zone:"Africa/Niamey"},{code:"NF",country:"Norfolk Island",zone:"Pacific/Norfolk"},{code:"NG",country:"Nigeria",zone:"Africa/Lagos"},{code:"NI",country:"Nicaragua",zone:"America/Managua"},{code:"NL",country:"Netherlands",zone:"Europe/Amsterdam"},{code:"NO",country:"Norway",zone:"Europe/Oslo"},{code:"NP",country:"Nepal",zone:"Asia/Kathmandu"},{code:"NR",country:"Nauru",zone:"Pacific/Nauru"},{code:"NU",country:"Niue",zone:"Pacific/Niue"},{code:"NZ",country:"New Zealand",zone:"Pacific/Auckland"},{code:"OM",country:"Oman",zone:"Asia/Muscat"},{code:"PA",country:"Panama",zone:"America/Panama"},{code:"PE",country:"Peru",zone:"America/Lima"},{code:"PF",country:"French Polynesia",zone:"Pacific/Tahiti"},{code:"PG",country:"Papua New Guinea",zone:"Pacific/Port_Moresby"},{code:"PH",country:"Philippines",zone:"Asia/Manila"},{code:"PK",country:"Pakistan",zone:"Asia/Karachi"},{code:"PL",country:"Poland",zone:"Europe/Warsaw"},{code:"PM",country:"Saint Pierre and Miquelon",zone:"America/Miquelon"},{code:"PN",country:"Pitcairn",zone:"Pacific/Pitcairn"},{code:"PR",country:"Puerto Rico",zone:"America/Puerto_Rico"},{code:"PS",country:"Palestinian Territory",zone:"Asia/Gaza"},{code:"PT",country:"Portugal",zone:"Europe/Lisbon"},{code:"PW",country:"Palau",zone:"Pacific/Palau"},{code:"PY",country:"Paraguay",zone:"America/Asuncion"},{code:"QA",country:"Qatar",zone:"Asia/Qatar"},{code:"RE",country:"Reunion",zone:"Indian/Reunion"},{code:"RO",country:"Romania",zone:"Europe/Bucharest"},{code:"RS",country:"Serbia",zone:"Europe/Belgrade"},{code:"RU",country:"Russia",zone:"Europe/Kaliningrad"},{code:"RW",country:"Rwanda",zone:"Africa/Kigali"},{code:"SA",country:"Saudi Arabia",zone:"Asia/Riyadh"},{code:"SB",country:"Solomon Islands",zone:"Pacific/Guadalcanal"},{code:"SC",country:"Seychelles",zone:"Indian/Mahe"},{code:"SD",country:"Sudan",zone:"Africa/Khartoum"},{code:"SE",country:"Sweden",zone:"Europe/Stockholm"},{code:"SG",country:"Singapore",zone:"Asia/Singapore"},{code:"SH",country:"Saint Helena",zone:"Atlantic/St_Helena"},{code:"SI",country:"Slovenia",zone:"Europe/Ljubljana"},{code:"SJ",country:"Svalbard and Jan Mayen",zone:"Arctic/Longyearbyen"},{code:"SK",country:"Slovakia",zone:"Europe/Bratislava"},{code:"SL",country:"Sierra Leone",zone:"Africa/Freetown"},{code:"SM",country:"San Marino",zone:"Europe/San_Marino"},{code:"SN",country:"Senegal",zone:"Africa/Dakar"},{code:"SO",country:"Somalia",zone:"Africa/Mogadishu"},{code:"SR",country:"Suriname",zone:"America/Paramaribo"},{code:"SS",country:"South Sudan",zone:"Africa/Juba"},{code:"ST",country:"Sao Tome and Principe",zone:"Africa/Sao_Tome"},{code:"SV",country:"El Salvador",zone:"America/El_Salvador"},{code:"SX",country:"Sint Maarten",zone:"America/Lower_Princes"},{code:"SY",country:"Syria",zone:"Asia/Damascus"},{code:"SZ",country:"Swaziland",zone:"Africa/Mbabane"},{code:"TC",country:"Turks and Caicos Islands",zone:"America/Grand_Turk"},{code:"TD",country:"Chad",zone:"Africa/Ndjamena"},{code:"TF",country:"French Southern Territories",zone:"Indian/Kerguelen"},{code:"TG",country:"Togo",zone:"Africa/Lome"},{code:"TH",country:"Thailand",zone:"Asia/Bangkok"},{code:"TJ",country:"Tajikistan",zone:"Asia/Dushanbe"},{code:"TK",country:"Tokelau",zone:"Pacific/Fakaofo"},{code:"TL",country:"East Timor",zone:"Asia/Dili"},{code:"TM",country:"Turkmenistan",zone:"Asia/Ashgabat"},{code:"TN",country:"Tunisia",zone:"Africa/Tunis"},{code:"TO",country:"Tonga",zone:"Pacific/Tongatapu"},{code:"TR",country:"Turkey",zone:"Europe/Istanbul"},{code:"TT",country:"Trinidad and Tobago",zone:"America/Port_of_Spain"},{code:"TV",country:"Tuvalu",zone:"Pacific/Funafuti"},{code:"TW",country:"Taiwan",zone:"Asia/Taipei"},{code:"TZ",country:"Tanzania",zone:"Africa/Dar_es_Salaam"},{code:"UA",country:"Ukraine",zone:"Europe/Kiev"},{code:"UG",country:"Uganda",zone:"Africa/Kampala"},{code:"UM",country:"United States Minor Outlying Islands",zone:"Pacific/Midway"},{code:"US",country:"United States",zone:"America/New_York"},{code:"UY",country:"Uruguay",zone:"America/Montevideo"},{code:"UZ",country:"Uzbekistan",zone:"Asia/Samarkand"},{code:"VA",country:"Vatican",zone:"Europe/Vatican"},{code:"VC",country:"Saint Vincent and the Grenadines",zone:"America/St_Vincent"},{code:"VE",country:"Venezuela",zone:"America/Caracas"},{code:"VG",country:"British Virgin Islands",zone:"America/Tortola"},{code:"VI",country:"U.S. Virgin Islands",zone:"America/St_Thomas"},{code:"VN",country:"Vietnam",zone:"Asia/Ho_Chi_Minh"},{code:"VU",country:"Vanuatu",zone:"Pacific/Efate"},{code:"WF",country:"Wallis and Futuna",zone:"Pacific/Wallis"},{code:"WS",country:"Samoa",zone:"Pacific/Apia"},{code:"XK",country:"Kosovo",zone:"Kosovo"},{code:"YE",country:"Yemen",zone:"Asia/Aden"},{code:"YT",country:"Mayotte",zone:"Indian/Mayotte"},{code:"ZA",country:"South Africa",zone:"Africa/Johannesburg"},{code:"ZM",country:"Zambia",zone:"Africa/Lusaka"},{code:"ZW",country:"Zimbabwe",zone:"Africa/Harare"}],timezones:["ACT","AET","Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmara","Africa/Asmera","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Timbuktu","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","AGT","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/ComodRivadavia","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Atikokan","America/Atka","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Buenos_Aires","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Catamarca","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Coral_Harbour","America/Cordoba","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Ensenada","America/Fort_Nelson","America/Fort_Wayne","America/Fortaleza","America/Glace_Bay","America/Godthab","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Indianapolis","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Indianapolis","America/Inuvik","America/Iqaluit","America/Jamaica","America/Jujuy","America/Juneau","America/Kentucky/Louisville","America/Kentucky/Monticello","America/Knox_IN","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Louisville","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Mendoza","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montreal","America/Montserrat","America/Nassau","America/New_York","America/Nipigon","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Ojinaga","America/Panama","America/Pangnirtung","America/Paramaribo","America/Phoenix","America/Port_of_Spain","America/Port-au-Prince","America/Porto_Acre","America/Porto_Velho","America/Puerto_Rico","America/Rainy_River","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Rosario","America/Santa_Isabel","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Shiprock","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Thunder_Bay","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Virgin","America/Whitehorse","America/Winnipeg","America/Yakutat","America/Yellowknife","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/McMurdo","Antarctica/Palmer","Antarctica/Rothera","Antarctica/South_Pole","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","ART","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Ashkhabad","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Calcutta","Asia/Chita","Asia/Choibalsan","Asia/Chongqing","Asia/Chungking","Asia/Colombo","Asia/Dacca","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Gaza","Asia/Harbin","Asia/Hebron","Asia/Ho_Chi_Minh","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Istanbul","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Kashgar","Asia/Kathmandu","Asia/Katmandu","Asia/Khandyga","Asia/Kolkata","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macao","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qyzylorda","Asia/Rangoon","Asia/Riyadh","Asia/Saigon","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Tel_Aviv","Asia/Thimbu","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ujung_Pandang","Asia/Ulaanbaatar","Asia/Ulan_Bator","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yekaterinburg","Asia/Yerevan","AST","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faeroe","Atlantic/Faroe","Atlantic/Jan_Mayen","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/ACT","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Canberra","Australia/Currie","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/LHI","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/North","Australia/NSW","Australia/Perth","Australia/Queensland","Australia/South","Australia/Sydney","Australia/Tasmania","Australia/Victoria","Australia/West","Australia/Yancowinna","BET","Brazil/Acre","Brazil/DeNoronha","Brazil/East","Brazil/West","BST","Canada/Atlantic","Canada/Central","Canada/East-Saskatchewan","Canada/Eastern","Canada/Mountain","Canada/Newfoundland","Canada/Pacific","Canada/Saskatchewan","Canada/Yukon","CAT","CET","Chile/Continental","Chile/EasterIsland","CNT","CST","CST6CDT","CTT","Cuba","EAT","ECT","EET","Egypt","Eire","EST","EST5EDT","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belfast","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kiev","Europe/Kirov","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Nicosia","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Tiraspol","Europe/Ulyanovsk","Europe/Uzhgorod","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zaporozhye","Europe/Zurich","GB","GB-Eire","GMT","GMT0","Greenwich","Hongkong","HST","Iceland","IET","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Iran","Israel","IST","Jamaica","Japan","JST","Kwajalein","Libya","MET","Mexico/BajaNorte","Mexico/BajaSur","Mexico/General","MIT","MST","MST7MDT","Navajo","NET","NST","NZ","NZ-CHAT","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Chuuk","Pacific/Easter","Pacific/Efate","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Johnston","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Pohnpei","Pacific/Ponape","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Samoa","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Truk","Pacific/Wake","Pacific/Wallis","Pacific/Yap","PLT","PNT","Poland","Portugal","PRC","PRT","PST","PST8PDT","ROK","Singapore","SST","SystemV/AST4","SystemV/AST4ADT","SystemV/CST6","SystemV/CST6CDT","SystemV/EST5","SystemV/EST5EDT","SystemV/HST10","SystemV/MST7","SystemV/MST7MDT","SystemV/PST8","SystemV/PST8PDT","SystemV/YST9","SystemV/YST9YDT","Turkey","UCT","Universal","US/Alaska","US/Aleutian","US/Arizona","US/Central","US/East-Indiana","US/Eastern","US/Hawaii","US/Indiana-Starke","US/Michigan","US/Mountain","US/Pacific","US/Pacific-New","US/Samoa","UTC","VST","W-SU","WET","Zulu"]}[e]}}]),t}(c.default);r.default=d,t.exports=r.default},{"./Search":263,q:117}],266:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./BaseSearch"),c=n(s),l=e("merge"),f=n(l),d=e("q"),h=n(d),p=function(e){function t(e,r,n,o,a,s,c,l,d){void 0===o&&(o={limit:{}}),i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,l),this._setUrlParameters(d),this._postObj=(0,f.default)(n,o,s,c),"object"==typeof a&&(this._postObj=(0,f.default)(this._postObj,a))}return o(t,e),a(t,[{key:"_filter",value:function(){return this._postObj}},{key:"_loadData",value:function(e){function t(){if(r.cancel||"string"==typeof r.cancel){var e="string"==typeof r.cancel?r.cancel:"Cancel process";n.reject({data:e,statusCode:403})}else r._ogapi.Napi.post(r._resource,i,r._timeout,r._getExtraHeaders(),r._getUrlParameters()).then(function(e){var r=e.statusCode,a=e.body;if(!a&&e.text)try{var u=JSON.parse(e.text);u&&(a=u)}catch(t){console.warn("Impossible to parse text from response: "+e.text)}200===r?(o=!0,n.notify(a),a.data.length===i.limit.size?(i.limit.start+=1,t()):n.resolve({data:"DONE",statusCode:200})):o?n.resolve({data:"DONE",statusCode:200}):n.reject({data:a,statusCode:r})}).catch(function(e){n.reject(e)})}var r=this,n=h.default.defer(),i=r._asyncPagingFilter(),o=!1;return t(),n.promise}}]),t}(c.default);r.default=p,t.exports=r.default},{"./BaseSearch":259,merge:112,q:117}],267:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/administrativeState",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"administrativeState",this.customFilters)}},{key:"withId",value:function(e){if("string"!=typeof e)throw new Error("Parameter id must be a string");return this.customFilters.id=e,this}},{key:"withEntityType",value:function(e){if("string"!=typeof e)throw new Error("Parameter entityType must be a string");return this.customFilters.entityType=e,this}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":265,"./SearchBuilder":308}],268:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="$_token";r.TOKEN_URL=d;var h=function(e){function t(e){var r=arguments.length<=1||void 0===arguments[1]?new f.default(e,"/alarms"):arguments[1];return function(){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{onDevices:"/devices",onSubscriptions:"/subscriptions"},r),this._url="/entities"+d+"/alarms"}.apply(this,arguments)}return o(t,e),a(t,[{key:"_buildUrl",value:function(){for(var e in this._routes)this._builderParams[e]&&(this._url=this._url.replace(d,this._routes[e]));return this._url=this._url.replace(d,""),u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(c.default);r.default=h},{"../../util/searchingFields/FieldFinder":343,"./SearchWithSummaryBuilder":309}],269:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/allowedResourceType",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"allowedResourceType",this.customFilters)}},{key:"withType",value:function(e){if("string"!=typeof e)throw new Error("Parameter type must be a string");return this.customFilters.type=e.toLowerCase(),this}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":265,"./SearchBuilder":308}],270:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/areas",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"./SearchBuilder":308}],271:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./PreFilteredSearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d=e("../AssetSearch"),h=n(d),p="/entities",y=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,p)),this._url=p}return o(t,e),a(t,[{key:"summary",value:function(){return this._url=this._url+"/summary",this}},{key:"_buildFilter",value:function(){var e={and:[{exists:{"provision.asset.identifier":!0}}]};if(this._builderParams.filter&&Object.keys(this._builderParams.filter).length>0){var t=this._builderParams.filter;void 0!==t._filterTemplate?e.and.push(t._filterTemplate.filter):e.and.push(t)}return{filter:e}}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"build",value:function(){return new h.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}},{key:"select",value:function(e){return this._builderParams.select=e||void 0,this}}]),t}(c.default);r.default=y,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"../AssetSearch":258,"./PreFilteredSearchBuilder":304}],272:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("q"),u=n(a),s=e("merge"),c=(n(s),e("jsonpath")),l=n(c),f=function(){function e(t,r){i(this,e),this._ogapi=t,this._resource="resources/schemaTypes/og_basic_types",this._headers=void 0,this._og_basic_types={},this.publicParameters=!1,this._urlParameters=void 0}return o(e,[{key:"_getExtraHeaders",value:function(){return this._headers}},{key:"_setExtraHeaders",value:function(e){if(this._headers)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._headers[n]=e[n]}else this._headers=e}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this.parameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"execute",value:function(){var e=this,t=u.default.defer(),r=t.promise;return this._setExtraHeaders({Accept:"application/json"}),this._ogapi.Napi.get(this._resource,this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(r){var n=r.body,i=r.statusCode;if(e._og_basic_types=n,l.default.apply(e._og_basic_types,"$..['$ref']",function(e,t){var r="$.."+e.replace("#/definitions/","");return l.default.query(n,r)[0]}).forEach(function(e){var t=l.default.stringify(e.path);l.default.value(n,t,e.value)}),e.path){var o=e.path.includes("$")?e.path:"$.."+e.path,a=l.default.query(n,o)[0]||{msg:"not Found"};t.resolve({data:a,statusCode:i})}else{if(e.publicParameters)for(var u in n.definitions)n.definitions[u].public&&!1!==n.definitions[u].public||delete n.definitions[u];t.resolve({data:n,statusCode:i})}}).catch(function(e){t.reject(e)}),r}},{key:"withPath",value:function(e){return this.path=e,this}},{key:"withPublicParameters",value:function(e){return this.publicParameters=e,this}},{key:"build",value:function(){return this}}]),e}();r.default=f,t.exports=r.default},{jsonpath:104,merge:112,q:117}],273:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}
|
|
35
|
-
},s=e("./SearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d=e("../WPSearch"),h=n(d),p="provisionProcessors/bulk/search",y=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,p)),this._url=p}return o(t,e),a(t,[{key:"build",value:function(){return new h.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}}]),t}(c.default);r.default=y,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"../WPSearch":266,"./SearchBuilder":308}],274:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/bulk/async",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"./SearchBuilder":308}],275:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/bundles",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"./SearchBuilder":308}],276:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/certificates",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d,this._fetch=!1,this._assignable=!1}return o(t,e),a(t,[{key:"assignable",value:function(){return this._assignable=!0,this}},{key:"administrable",value:function(){return this._assignable=!1,this}},{key:"withFetch",value:function(e){if(!0!==e&&!1!==e)throw new Error("Flag fecth incorrect");return this._fetch=e,this}},{key:"_buildUrl",value:function(){var e=this._url;return!0===this._fetch&&(this._urlParams.fetch=1),!0===this._assignable&&(this._urlParams.visibility="assignable"),e}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"./SearchBuilder":308}],277:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/channels",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d,this._summary=!1}return o(t,e),a(t,[{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}},{key:"summary",value:function(){return this._summary=!0,this}},{key:"_buildUrl",value:function(){return this._summary&&(this._url=this._url+"/summary"),u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"./SearchWithSummaryBuilder":309}],278:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/communicationsModuleType",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"communicationsModuleType",this.customFilters)}},{key:"withType",value:function(e){if("string"!=typeof e)throw new Error("Parameter type must be a string");return this.customFilters.type=e,this}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":265,"./SearchBuilder":308}],279:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/countryCodes",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"countryCodes",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":265,"./SearchBuilder":308}],280:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/datamodels",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"./SearchBuilder":308}],281:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("merge"),f=n(l),d=e("moment"),h=n(d),p=e("../../util/searchingFields/FieldFinder"),y=n(p),m=e("../../util/DATE_FORMAT"),v="/datapoints",_=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new y.default(e,v)),this._url=v,this.fluentFilter=e.newFilterBuilder(),this.tagsFilter=[]}return o(t,e),a(t,[{key:"withDeviceId",value:function(e){if("string"!=typeof e)throw new Error("Parameter deviceId must be a string");return this.fluentFilter.and(this._parent.EX.eq("datapoint.device",e)),this}},{key:"withDatastream",value:function(e){if("string"!=typeof e)throw new Error("Parameter datastreamId must be a string");return this.fluentFilter.and(this._parent.EX.eq("datapoint.datastream",e)),this}},{key:"withFeed",value:function(e){if("string"!=typeof e)throw new Error("Parameter feedId must be a string");return this.fluentFilter.and(this._parent.EX.eq("datapoint.feed",e)),this}},{key:"betweenDates",value:function(e,t){if("object"!=typeof e||e.constructor!==Date)throw new Error("Parameter fromDate must be a Date");if(this.fluentFilter.and(this._parent.EX.gt("datapoint.at",(0,h.default)(e).format(m.DATE_FORMAT))),void 0!==t){if(t.constructor!==Date)throw new Error("Parameter toDate must be a Date");this.fluentFilter.and(this._parent.EX.lt("datapoint.at",(0,h.default)(t).format(m.DATE_FORMAT)))}return this}},{key:"_buildFilter",value:function(){var e={filter:{}},t=(0,f.default)(!0,this.fluentFilter),r=this._builderParams.filter;if(t=t._filterTemplate.filter,"object"==typeof r._filterTemplate&&(r=r._filterTemplate.filter),void 0!==r&&Object.keys(r).length>0&&void 0!==t&&Object.keys(t).length>0)throw new Error("Incompatible filters. You only can create a filter using fluent mode [betweenDates, addTag, withDatastreamId, withDeviceId] methods or custom filter [filter] method");return void 0!==r&&Object.keys(r).length>0?e.filter=r:void 0!==t&&Object.keys(t).length>0&&(e.filter=t),e}},{key:"select",value:function(e){return this._builderParams.select=e,this}}]),t}(c.default);r.default=_,t.exports=r.default},{"../../util/DATE_FORMAT":337,"../../util/searchingFields/FieldFinder":343,"./SearchBuilder":308,merge:112,moment:113}],282:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d=e("../EntitySearch"),h=n(d),p="$_token";r.TOKEN_URL=p;var y=function(e){function t(e,r,n){var o=arguments.length<=3||void 0===arguments[3]?new f.default(e,"/entities"):arguments[3];return function(){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{onDevices:"/"},o),this._url="/organizations/"+r+"/datasets/"+n+p}.apply(this,arguments)}return o(t,e),a(t,[{key:"flattened",value:function(){return this._urlParams.flattened=!0,this}},{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}},{key:"disableCaseSensitive",value:function(e){return this._urlParams.caseSensitive=e||!1,this}},{key:"removeCaseSensitive",value:function(){return this._urlParams&&delete this._urlParams.caseSensitive,this}},{key:"_buildUrl",value:function(){for(var e in this._routes)this._builderParams[e]&&(this._url=this._url.replace(p,this._routes[e]));return this._url=this._url.replace(p,""),u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e||[],this}},{key:"build",value:function(){return new h.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}}]),t}(c.default);r.default=y},{"../../util/searchingFields/FieldFinder":343,"../EntitySearch":261,"./SearchWithSummaryBuilder":309}],283:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d=e("../WPSearch"),h=n(d),p="datasets";r.BASE_URL=p;var y=function(e){function t(e,r,n){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,p,{organization:r,dataset:n})),this._url=p+"/provision/organizations/"+r+"/"+n+"/data"}return o(t,e),a(t,[{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e||[],this}},{key:"build",value:function(){return new h.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}}]),t}(c.default);r.default=y},{"../../util/searchingFields/FieldFinder":343,"../WPSearch":266,"./SearchBuilder":308}],284:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/catalog/datasets",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"./SearchBuilder":308}],285:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../Search"),l=(n(c),e("../../util/searchingFields/FieldFinder")),f=n(l),d="/datastreams",h=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d}return o(t,e),t}(s.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"../Search":263,"./SearchBuilder":308}],286:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/catalog/plans/device",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d}return o(t,e),a(t,[{key:"withDomain",value:function(e){if("string"!=typeof e)throw new Error("Parameter domainName must be a string");return this._domainName=e,this}},{key:"_buildUrl",value:function(){if(!this._domainName)throw new Error("Parameter domainName must be defined");return this._url=d+"?domainName="+this._domainName,u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"./SearchWithSummaryBuilder":309}],287:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./PreFilteredSearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/entities",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d}return o(t,e),a(t,[{key:"summary",value:function(){return this._url=this._url+"/summary",this}},{key:"_buildFilter",value:function(){var e={and:[{exists:{"provision.device.identifier":!0}}]};if(this._builderParams.filter&&Object.keys(this._builderParams.filter).length>0){var t=this._builderParams.filter;void 0!==t._filterTemplate?e.and.push(t._filterTemplate.filter):e.and.push(t)}return{filter:e}}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"./PreFilteredSearchBuilder":304}],288:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/domains",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d,this._summary=!1}return o(t,e),a(t,[{key:"summary",value:function(){return this._summary=!0,this}},{key:"_buildUrl",value:function(){return this._summary&&(this._url=this._url+"/summary"),u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"./SearchWithSummaryBuilder":309}],289:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d=e("../EntitySearch"),h=n(d),p="$_token";r.TOKEN_URL=p;var y=function(e){function t(e){var r=arguments.length<=1||void 0===arguments[1]?new f.default(e,"/entities"):arguments[1];return function(){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{onDevices:"/devices"},r),this._url="/entities"+p}.apply(this,arguments)}return o(t,e),a(t,[{key:"flattened",value:function(){return this._urlParams.flattened=!0,this}},{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}},{key:"disableCaseSensitive",value:function(e){return this._urlParams.caseSensitive=e||!1,this}},{key:"removeCaseSensitive",value:function(){return this._urlParams&&delete this._urlParams.caseSensitive,this}},{key:"_buildUrl",value:function(){for(var e in this._routes)this._builderParams[e]&&(this._url=this._url.replace(p,this._routes[e]));return this._url=this._url.replace(p,""),u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e||[],this}},{key:"build",value:function(){return new h.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}}]),t}(c.default);r.default=y},{"../../util/searchingFields/FieldFinder":343,"../EntitySearch":261,"./SearchWithSummaryBuilder":309}],290:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchWithSummaryBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/operations/history",d=function(e){function t(e){var r=arguments.length<=1||void 0===arguments[1]?new l.default(e,"/operations/history"):arguments[1];return function(){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},r),this._url="/entities"+f}.apply(this,arguments)}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"./SearchWithSummaryBuilder":309}],291:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t)
|
|
36
|
-
;e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="$_token";r.TOKEN_URL=d;var h=function(e){function t(e){var r=arguments.length<=1||void 0===arguments[1]?new f.default(e,"/operations"):arguments[1];return function(){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{onDevices:"/devices",onSubscribers:"/subscribers",onSubscriptions:"/subscriptions",onCommunicationsModules:"/communicationsModules"},r),this._url="/entities"+d+"/operations"}.apply(this,arguments)}return o(t,e),a(t,[{key:"_buildUrl",value:function(){this._checkConstraintRoutes();for(var e in this._routes)this._builderParams[e]&&(this._url=this._url.replace(d,this._routes[e]));return u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(c.default);r.default=h},{"../../util/searchingFields/FieldFinder":343,"./SearchWithSummaryBuilder":309}],292:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/feeds",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"./SearchBuilder":308}],293:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/fieldsDefinition",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"fieldsDefinition",this.customFilters)}},{key:"withType",value:function(e){if("string"!=typeof e)throw new Error("Parameter type must be a string");return this.customFilters.type=e,this}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":265,"./SearchBuilder":308}],294:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../DeviceSearch"),f=n(l),d=function(e){function t(e,r,n){if(i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n),this.constructor===t)throw new Error("Cannot construct Abstract instances directly")}return o(t,e),a(t,[{key:"flattened",value:function(){return this._urlParams.flattened=!0,this}},{key:"_buildUrl",value:function(){return u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}},{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../DeviceSearch":260,"./SearchBuilder":308}],295:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/catalog/hardwares",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d}return o(t,e),a(t,[{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e,this}},{key:"flattened",value:function(){return this._urlParams.flattened=!0,this}},{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"./SearchWithSummaryBuilder":309}],296:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ioTDatastreamAccess",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ioTDatastreamAccess",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":265,"./SearchBuilder":308}],297:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ioTDatastreamPeriod",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ioTDatastreamPeriod",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":265,"./SearchBuilder":308}],298:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ioTDatastreamStoragePeriod",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ioTDatastreamStoragePeriod",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":265,"./SearchBuilder":308}],299:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/catalog/operators",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"./SearchBuilder":308}],300:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/operationTypes",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"./SearchBuilder":308}],301:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/operationalStatus",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"operationalStatus",this.customFilters)}},{key:"withId",value:function(e){if("string"!=typeof e)throw new Error("Parameter id must be a string");return this.customFilters.id=e,this}},{key:"withEntityType",value:function(e){if("string"!=typeof e)throw new Error("Parameter entityType must be a string");return this.customFilters.entityType=e,this}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":265,"./SearchBuilder":308}],302:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchWithSummaryBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/jobs",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"./SearchWithSummaryBuilder":309}],303:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/catalog/plans/organization",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d}return o(t,e),a(t,[{key:"withDomain",value:function(e){if("string"!=typeof e)throw new Error("Parameter domainName must be a string");return this._domainName=e,this}},{key:"_buildUrl",value:function(){if(!this._domainName)throw new Error("Parameter domainName must be defined");return this._url=d+"?domainName="+this._domainName,u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"./SearchWithSummaryBuilder":309}],304:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./FlattenedSearchBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e,r,i){if(n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,i),this.constructor===t)throw new Error("Cannot construct Abstract instances directly")}return i(t,e),o(t,[{key:"provisioned",value:function(){return this._provisioned=!0,this}},{key:"collected",value:function(){return this._collected=!0,this}},{key:"select",value:function(e){return this._builderParams.select=e||[],this}},{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}},{key:"disableCaseSensitive",value:function(e){return this._urlParams.caseSensitive=e||!1,this}},{key:"removeCaseSensitive",value:function(){return this._urlParams&&delete this._urlParams.caseSensitive,this}}]),t}(s.default);r.default=c,t.exports=r.default},{"./FlattenedSearchBuilder":294}],305:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=(e("./SearchBuilder"),e("../Search")),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t){n(this,e),this._api=t}return i(e,[{key:"from",value:function(e){if("string"!=typeof e)throw new Error("Url parameter is mandatory and must be a string");return this._url=e,this}},{key:"filter",value:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return this._filter={filter:e},this}},{key:"limit",value:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return this._limit={limit:e},this}},{key:"build",value:function(){if("string"!=typeof this._url)throw new Error("Url parameter is mandatory and must be a string");return new a.default(this._api,this._url,this._filter,this._limit,{})}}]),e}();r.default=u,t.exports=r.default},{"../Search":263,"./SearchBuilder":308}],306:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/resourceType",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"resourceType",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":265,"./SearchBuilder":308}],307:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/rules",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"./SearchBuilder":308}],308:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("../Search"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t,r,i){var o=this;if(n(this,e),this.constructor===e)throw new Error("Cannot construct Abstract instances directly");this._url="",this._fieldFinder=i,this._parent=t,this._routes=r,this._routesName=[],this._builderParams={summary:!1,sort:[],filter:{},limit:void 0,group:void 0,select:void 0};for(var a in this._routes)!function(e){o._routesName.push(e),o._builderParams[e]=!1,o[e]=function(){var t=arguments.length<=0||void 0===arguments[0]?e:arguments[0];return o._builderParams[t]=!0,o}}(a);this._urlParams={}}return i(e,[{key:"findFields",value:function(e){return this._fieldFinder.find(e)}},{key:"findAllFields",value:function(e){return this._fieldFinder.findAll(e)}},{key:"findFieldPath",value:function(e){return this._fieldFinder.findFieldPath(e)}},{key:"withTimeout",value:function(){var e=arguments.length<=0||void 0===arguments[0]?2e3:arguments[0];if("number"!=typeof e)throw new Error("Parameter ms must be a number");return this._builderParams.timeout=e,this}},{key:"filter",value:function(e){return this._builderParams.filter=e||{},this}},{key:"addSortAscendingBy",value:function(e){return this.addSortBy(e,"ASCENDING")}},{key:"addSortDescendingBy",value:function(e){return this.addSortBy(e,"DESCENDING")}},{key:"addSortBy",value:function(e,t){if(e&&t)if(this._builderParams.sort.length>0){var r=0,n=!1;for(r=0;r<this._builderParams.sort.length;r++)this._builderParams.sort[r].name===e&&(this._builderParams.sort[r].type=t,n=!0);n||this._builderParams.sort.push({name:e,type:t})}else this._builderParams.sort.push({name:e,type:t});return this}},{key:"removeSortBy",value:function(e){if(e){if(this._builderParams.sort.length>0){var t=0;for(t=0;t<this._builderParams.sort.length;t++)this._builderParams.sort[t].name===e&&(this._builderParams.sort.splice(t,t+1),t--)}}else this._builderParams.sort=[];return this}},{key:"limit",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1];if("number"!=typeof e)throw new Error("size parameter must be a number");return("number"!=typeof t||t<1)&&(t=1),this._builderParams.limit={size:e,start:t},this}},{key:"build",value:function(){try{return new a.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}catch(e){console.error("!errrrror!!!!!!",e)}}},{key:"_buildFilter",value:function(){var e=this._builderParams.filter;return void 0!==e._filterTemplate?e._filterTemplate:{filter:e}}},{key:"_buildSelect",value:function(){var e=this._builderParams.select;return void 0!==e&&void 0!==e._selectTemplate?e._selectTemplate:{select:e}}},{key:"_buildGroup",value:function(){var e=this._builderParams.group;return void 0!==e&&void 0!==e._groupTemplate?e._groupTemplate:{group:e}}},{key:"_buildLimit",value:function(){return void 0===this._builderParams.limit?{limit:{size:1e3,start:1}}:{limit:this._builderParams.limit}}},{key:"_buildSort",value:function(){if(0!==this._builderParams.sort.length)return{sort:{parameters:this._builderParams.sort}}}},{key:"_buildUrl",value:function(){if("string"!=typeof this._url||0===this._url.trim().length)throw new Error("Error on extends SearchBuilder, this._url is not defined.");return this._url}},{key:"_checkConstraintRoutes",value:function(){var e=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],t=!1;for(var r in this._routes){if(t&&this._builderParams[r]&&!e)throw new Error("Must select only one of this:"+JSON.stringify(this._routesName));t=t||this._builderParams[r]}if(!t)throw new Error("Must select one at least: "+JSON.stringify(this._routesName))}}]),e}();r.default=u,t.exports=r.default},{"../Search":263}],309:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}
|
|
37
|
-
},u=e("./SearchBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e,r,i){if(n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,i),this.constructor===t)throw new Error("Cannot construct Abstract instances directly")}return i(t,e),o(t,[{key:"summary",value:function(){return this._url=this._url+"/summary",this}}]),t}(s.default);r.default=c,t.exports=r.default},{"./SearchBuilder":308}],310:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d="serviceGroups",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/"+d,this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,d,this.customFilters)}},{key:"withEntityType",value:function(e){if("string"!=typeof e)throw new Error("Parameter entityType must be a string");return this.customFilters.entityType=e,this}}]),t}(c.default);r.default=h,t.exports=r.default},{"../StaticSearch":265,"./SearchBuilder":308}],311:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("merge"),f=n(l),d=e("../../util/searchingFields/FieldFinder"),h=n(d),p=["SOFTWARE","FIRMWARE"];r.SOFTWARE_TYPES_ENUM=p;var y="/catalog/softwares",m=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new h.default(e,y)),this._url=y,this.fluentFilter=e.newFilterBuilder(),this.tagsFilter=[]}return o(t,e),a(t,[{key:"withId",value:function(e){if("string"!=typeof e)throw new Error("Parameter softwareId must be a string");return this.fluentFilter.and(this._parent.EX.eq("softwareId",e)),this}},{key:"withName",value:function(e){if("string"!=typeof e)throw new Error("Parameter softwareName must be a string");return this.fluentFilter.and(this._parent.EX.eq("softwareName",e)),this}},{key:"withType",value:function(e){if("string"!=typeof e)throw new Error("Parameter version must be a string");var t="";if(void 0===p.find(function(e){return e==this},e)&&(t=e),""!==t)throw new Error("Parameter in TYPE is not allowed. Parameter value '"+JSON.stringify(t)+"', parameters allowed in administrativeState are: '"+JSON.stringify(p)+"'");return this.fluentFilter.and(this._parent.EX.eq("softwareType",e)),this}},{key:"withVersion",value:function(e){if("string"!=typeof e)throw new Error("Parameter version must be a string");return this.fluentFilter.and(this._parent.EX.eq("softwareVersion",e)),this}},{key:"withHardwareId",value:function(e){if("string"!=typeof e)throw new Error("Parameter hardwareId must be a string");return this.fluentFilter.and(this._parent.EX.eq("hardwareId",e)),this}},{key:"withModel",value:function(e){if("string"!=typeof e)throw new Error("Parameter modelName must be a string");return this.fluentFilter.and(this._parent.EX.eq("modelName",e)),this}},{key:"withModelVersion",value:function(e){if("string"!=typeof e)throw new Error("Parameter modelVersion must be a string");return this.fluentFilter.and(this._parent.EX.eq("modelVersion",e)),this}},{key:"withManufacturer",value:function(e){if("string"!=typeof e)throw new Error("Parameter manufacturerName must be a string");return this.fluentFilter.and(this._parent.EX.eq("manufacturerName",e)),this}},{key:"_buildFilter",value:function(){var e={filter:{}},t=(0,f.default)(!0,this.fluentFilter),r=this._builderParams.filter;if(t=t._filterTemplate.filter,"object"==typeof r._filterTemplate&&(r=r._filterTemplate.filter),void 0!==r&&Object.keys(r).length>0&&void 0!==t&&Object.keys(t).length>0)throw new Error("Incompatible filters. You only can create a filter using fluent mode [withId, withName, withVersion, withType, withHardwareId, withModel, withModelVersion, withManufacturer] methods or custom filter [filter] method");return void 0!==r&&Object.keys(r).length>0?e.filter=r:void 0!==t&&Object.keys(t).length>0&&(e.filter=t),e}}]),t}(c.default);r.default=m},{"../../util/searchingFields/FieldFinder":343,"./SearchWithSummaryBuilder":309,merge:112}],312:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./PreFilteredSearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/entities",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,"/subscribers")),this._url=d}return o(t,e),a(t,[{key:"_buildFilter",value:function(){var e={and:[{or:[]}]};if(!this._provisioned&&this._collected||e.and[0].or.push({exists:{"provision.device.communicationModules[].subscriber.identifier":!0}}),!this._collected&&this._provisioned||e.and[0].or.push({exists:{"device.communicationModules[].subscriber.identifier":!0}}),this._builderParams.filter&&Object.keys(this._builderParams.filter).length>0){var t=this._builderParams.filter;void 0!==t._filterTemplate?e.and.push(t._filterTemplate.filter):e.and.push(t)}return{filter:e}}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"./PreFilteredSearchBuilder":304}],313:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./PreFilteredSearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/entities",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,"/subscriptions")),this._url=d}return o(t,e),a(t,[{key:"_buildFilter",value:function(){var e={and:[{or:[]}]};if(!this._provisioned&&this._collected||e.and[0].or.push({exists:{"provision.device.communicationModules[].subscription.identifier":!0}}),!this._collected&&this._provisioned||e.and[0].or.push({exists:{"device.communicationModules[].subscription.identifier":!0}}),this._builderParams.filter&&Object.keys(this._builderParams.filter).length>0){var t=this._builderParams.filter;void 0!==t._filterTemplate?e.and.push(t._filterTemplate.filter):e.and.push(t)}return{filter:e}}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"./PreFilteredSearchBuilder":304}],314:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchWithSummaryBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/tasks",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"./SearchWithSummaryBuilder":309}],315:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ticketPriority",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ticketPriority",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":265,"./SearchBuilder":308}],316:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ticketSeverity",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ticketSeverity",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":265,"./SearchBuilder":308}],317:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ticketStatus",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ticketStatus",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":265,"./SearchBuilder":308}],318:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/tickets",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d}return o(t,e),a(t,[{key:"summary",value:function(){return this._url=this._url+"/summary",this}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e,this}},{key:"flattened",value:function(){return this._urlParams.flattened=!0,this}},{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"./SearchBuilder":308}],319:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d=e("../WPSearch"),h=n(d),p="timeseries";r.BASE_URL=p;var y=function(e){function t(e,r,n){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,p,{organization:r,timeserie:n})),this._url=p+"/provision/organizations/"+r+"/"+n+"/data"}return o(t,e),a(t,[{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e||[],this}},{key:"build",value:function(){return new h.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}}]),t}(c.default);r.default=y},{"../../util/searchingFields/FieldFinder":343,"../WPSearch":266,"./SearchBuilder":308}],320:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/timezones",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"timezones",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":265,"./SearchBuilder":308}],321:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/userLanguages",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"userLanguages",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":265,"./SearchBuilder":308}],322:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/userProfile",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"userProfile",this.customFilters)}},{key:"withId",value:function(e){if("string"!=typeof e)throw new Error("Parameter id must be a string");return this.customFilters.id=e,this}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":265,"./SearchBuilder":308}],323:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchWithSummaryBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/users",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"./SearchWithSummaryBuilder":309}],324:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchWithSummaryBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/workgroups",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":343,"./SearchWithSummaryBuilder":309}],325:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["NOT_ACTIVE","ACTIVE","REVOKED","EXPIRED"];r.ADMINISTRATIVE_STATE_ENUM=n},{}],326:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../ProvisionGenericFinder"),c=n(s),l=e("q"),f=n(l),d=e("http-status-codes"),h=n(d),p=e("./MIME_TYPES_ENUM"),y=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"security/certificates","certificate","Certificate not found")}return o(t,e),a(t,[{key:"findById",value:function(e){return this._id=e,this._execute()}},{key:"_downloadUrl",value:function(){return this._setUrlParameters({format:this._type}),this._composeUrl()}},{key:"findByIdAndFormat",value:function(e,t){var r="";if(void 0===p.MIME_TYPES_ENUM.find(function(e){return e==this},t)&&(r=t),""!==r)throw new Error("Parameter mimetype is not allowed. Parameter value <'"+JSON.stringify(r)+"'>, mimetype allowed <'"+JSON.stringify(p.MIME_TYPES_ENUM)+"'>");return this._id=e,this._type=t,this._download()}},{key:"_download",value:function(){var e=f.default.defer(),t=e.promise,r=this._error_not_found;return this._api.get(this._downloadUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){204===t.statusCode?e.reject({data:r,statusCode:h.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=y,t.exports=r.default},{"../ProvisionGenericFinder":140,"./MIME_TYPES_ENUM":328,"http-status-codes":76,q:117}],327:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),_get=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},_Security2=require("./Security"),_Security3=_interopRequireDefault(_Security2),_q=require("q"),_q2=_interopRequireDefault(_q),_ADMINISTRATIVE_STATE_ENUM=require("./ADMINISTRATIVE_STATE_ENUM"),_USAGES_ENUM=require("./USAGES_ENUM"),max_length_name=50,max_length_id=50,max_length_description=200,Certificates=function(_Security){function Certificates(e){_classCallCheck(this,Certificates),_get(Object.getPrototypeOf(Certificates.prototype),"constructor",this).call(this,e,"/certificates")}return _inherits(Certificates,_Security),_createClass(Certificates,[{key:"withId",value:function(e){
|
|
38
|
-
if("string"!=typeof e||0===e.length||e.length>max_length_id)throw new Error("Parameter id must be a string, cannot be empty and has a maximum length of "+max_length_id);return this._id=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||0===e.length||e.length>max_length_name)throw new Error("Parameter name must be a string, cannot be empty and has a maximum length of "+max_length_name);return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||0===e.length||e.length>max_length_description)throw new Error("Parameter description must be a string, cannot be empty and has a maximum length of "+max_length_description);return this._description=e,this}},{key:"withAdministrativeState",value:function(e){if("string"!=typeof e||e.length<=0)throw new Error("Parameter administrativeState must be typeof string and cannot be empty");var t="";if(void 0===_ADMINISTRATIVE_STATE_ENUM.ADMINISTRATIVE_STATE_ENUM.find(function(e){return e==this},e)&&(t=e),""!==t)throw new Error("Parameter in administrativeState is not allowed. Parameter value '"+JSON.stringify(t)+"', parameters allowed in administrativeState are: '"+JSON.stringify(_ADMINISTRATIVE_STATE_ENUM.ADMINISTRATIVE_STATE_ENUM)+"'");return this._administrativeState=e,this}},{key:"withUsages",value:function(e){if(void 0===e||e.constructor!==Array||0===e.length)throw new Error("Parameter usages must be typeof Array and cannot be empty");for(var t=[],r=0;r<e.length;r++){void 0===_USAGES_ENUM.USAGES_ENUM.find(function(e){return e==this},e[r])&&t.push(e[r])}if(0!==t.length)throw new Error("There are not any parameters allowed. Parameters value: '"+JSON.stringify(t)+"'. Usages parameters allowed are: '"+JSON.stringify(_USAGES_ENUM.USAGES_ENUM)+"'");return this._usages=e,this}},{key:"withHardware",value:function(e){var t=[];if(void 0===e||e.constructor!==Array||0===e.length)throw new Error("Parameter hardwares must be typeof Array and cannot be empty");for(var r=0;r<e.length;r++)if(this._checkHardware(e[r]))try{e[r]=JSON.parse(e[r])}catch(e){}else t.push(r+1);if(0!==t.length)throw new Error("The hardware attribute is not well formed, the message "+JSON.stringify(t)+" not correct. Remember: hardwareId or [manufacturer, model and modelVersion] must be defined");return this._hardware=e,this}},{key:"_checkHardware",value:function _checkHardware(hardware){"string"==typeof hardware&&(hardware=eval("("+hardware+")"));var length=Object.keys(hardware).length,valid=!1;return 1===length&&hardware.hardwareId&&"string"==typeof hardware.hardwareId&&hardware.hardwareId.length>0?valid=!0:3===length&&hardware.manufacturer&&hardware.model&&hardware.modelVersion&&"string"==typeof hardware.manufacturer&&"string"==typeof hardware.model&&"string"==typeof hardware.modelVersion&&hardware.manufacturer.length>0&&hardware.model.length>0&&hardware.modelVersion.length>0&&(valid=!0),valid}},{key:"withTags",value:function(e){if(void 0===e||e.constructor!==Array||e.length<=0)throw new Error("Parameter tags must be typeof Array and cannot be empty");for(var t=[],r=0;r<e.length;r++)(void 0===e[r]||"string"!=typeof e[r]||typeof e[r].length<=0)&&t.push(e[r]);if(0!==t.length)throw new Error("The following tags values are not allowed:"+JSON.stringify(t));return this._tags=e,this}},{key:"withParameters",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter parameters must be a string, cannot be empty");return this._parameters=e,this}},{key:"withDomains",value:function(e){if(void 0===e||e.constructor!==Array||e.length<=0)throw new Error("Parameter domains must be typeof Array and cannot be empty");for(var t=[],r=0;r<e.length;r++)(void 0===e[r]||"string"!=typeof e[r]||typeof e[r].length<=0)&&t.push(e[r]);if(0!==t.length)throw new Error("The following domains values are not allowed:"+JSON.stringify(t));return this._domains=e,this}},{key:"_composeElement",value:function(){if(void 0===this._name||void 0===this._administrativeState||void 0===this._usages)throw new Error("Parameters name, usages, administrativeState must be defined");return{certificate:{id:this._id||void 0,name:this._name||void 0,description:this._description||void 0,administrativeState:this._administrativeState||void 0,usages:this._usages||void 0,hardware:this._hardware||void 0,tags:this._tags||void 0,parameters:this._parameters||void 0,domains:this._domains||void 0}}}},{key:"create",value:function(e){var t=this,r=void 0;if("string"!=typeof e){r=new FormData;var n=new Blob([JSON.stringify(this._composeElement())],{type:"application/json"});r.append("json",n);var i=new Blob([e],{type:"application/x-pem-file"});e&&r.append("certificate",i)}else r={},r.json=JSON.stringify(this._composeElement()),r.certificate=e;var o=_q2.default.defer(),a=o.promise;return this._ogapi.Napi.post_multipart(this._resource,r,{},this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(e){var r=e.statusCode;201===r?("function"==typeof t._onCreated&&t._onCreated(e.header.location),o.resolve({location:e.header.location,statusCode:r})):o.reject({errors:e.errors,statusCode:r})}).catch(function(e){o.reject(e)}),a}},{key:"_onCreated",value:function(e){var t=e.split("/").pop(-1);this.withId(t)}},{key:"update",value:function(){var e=this._composeElement();delete e.certificate.id;var t=_q2.default.defer(),r=t.promise;return this._ogapi.Napi.put(this._buildURL(),e,void 0,this._getExtraHeaders(),this._getUrlParameters()).then(function(e){var r=e.body;void 0===r?t.reject("Cannot update the certificate"):t.resolve(r,e.statusCode)}).catch(function(e){t.reject(e)}),r}},{key:"_buildURL",value:function(){if(void 0===this._id)throw new Error("Parameters id must be defined");return this._resource+"/"+this._id}}]),Certificates}(_Security3.default);exports.default=Certificates,module.exports=exports.default},{"./ADMINISTRATIVE_STATE_ENUM":325,"./Security":329,"./USAGES_ENUM":330,q:117}],328:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["x-pem-file","pkcs7-mime","raw","text/plain"];r.MIME_TYPES_ENUM=n},{}],329:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("../provision/BaseProvision"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e,r,i){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/security"+(void 0===r?"":r),i)}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"../provision/BaseProvision":235}],330:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["FILE_VALIDATION","DEVICE_COMMUNICATIONS","DEVICE_ACCESS","CERT_SIGN"];r.USAGES_ENUM=n},{}],331:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../provision/BaseProvision"),c=n(s),l=e("../util/formats/check_types"),f=n(l),d="timeseries/provision/organizations/";r.URL=d;var h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations/",void 0,["name","organization","timeBucket","identifierColumn"])}return o(t,e),a(t,[{key:"_buildURL",value:function(){return d+this._organization+"/"+this._identifier}},{key:"withOrganization",value:function(e){return f.default._checkStringAndLength(e,50,"organization"),this._organization=e,this}},{key:"withIdentifier",value:function(e){return f.default._checkString(e,"identifier"),this._identifier=e,this}},{key:"withName",value:function(e){return f.default._checkStringAndPattern(e,"^[a-zA-Z0-9_@.-]*$","name"),this._name=e,this}},{key:"withIdentifierColumn",value:function(e){return f.default._checkString(e,"identifierColumn"),this._identifierColumn=e,this}},{key:"withTimeBucket",value:function(e){return f.default._checkNumber(e,"timeBucket"),this._timeBucket=e,this}},{key:"withDescription",value:function(e){return e&&f.default._checkString(e,"description"),this._description=e,this}},{key:"withColumns",value:function(e){return f.default._checkArray(e,"columns"),this._columns=e,this}},{key:"withBucketColumn",value:function(e){return f.default._checkStringAndPattern(e,"^[a-zA-Z0-9 _-]*$","bucketColumn"),this._bucketColumn=e,this}},{key:"withRetention",value:function(e){return f.default._checkNumber(e,"retention"),this._retention=e,this}},{key:"withOrigin",value:function(e){return f.default._checkISODateTime(e,"origin"),this._origin=e,this}},{key:"withContext",value:function(e){return f.default._checkArray(e,"context"),this._context=e,this}},{key:"_composeElement",value:function(){return this._resource=d+this._organization,this._timeBucket>0&&f.default._checkStringAndPattern(this._bucketColumn,"^[a-zA-Z0-9 _-]*$","bucketColumn"),{name:this._name,description:this._description,timeBucket:this._timeBucket,bucketColumn:this._timeBucket?this._bucketColumn:void 0,retention:this._retention,origin:this._origin,context:this._context||[],identifierColumn:this._identifierColumn,columns:this._columns||[]}}},{key:"update",value:function(){throw new Error("OGAPI_TIMESERIES_NOT_UPDATED")}}]),t}(c.default);r.default=h},{"../provision/BaseProvision":235,"../util/formats/check_types":342}],332:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"timeseries/provision/organizations","timeseries")}return i(t,e),o(t,[{key:"findByOrganization",value:function(e){return this._withId(e),this._execute()}},{key:"findByOrganizationAndTimeserieId",value:function(e,t){return this._withId(e+"/"+t),this._execute()}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":138}],333:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../GenericFinder"),c=n(s),l=e("q"),f=(n(l),e("http-status-codes")),d=(n(f),function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"ai","list","Transformer not found","north")}return o(t,e),a(t,[{key:"findByOrganization",value:function(e){return this._organization=e,this._execute()}},{key:"findByOrganizationAndIdentifier",value:function(e,t){return this._organization=e,this._identifier=t,this._execute()}},{key:"downloadByOrganizationAndIdentifierAndFilename",value:function(e,t,r){return this._organization=e,this._identifier=t,this._filename=r,this._download()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/transformers"+(this._identifier?"/"+this._identifier+(this._filename?"/"+this._filename:""):"")}}]),t}(c.default));r.default=d,t.exports=r.default},{"../GenericFinder":138,"http-status-codes":76,q:117}],334:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("q"),c=n(s),l=e("../provision/BaseProvision"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations",void 0,["organization","files"],"north/ai"),this._ogapi=e}return o(t,e),a(t,[{key:"_buildURL",value:function(){return this._organization+"/transformers/"+this._identifier}},{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"identifier"});return this._identifier=e,this}},{key:"withOrganization",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"organization"});return this._organization=e,this}},{key:"addFile",value:function(e){this._files||(this._files=[]),this._files.push(e)}},{key:"withFiles",value:function(e){if(!(e instanceof Array))throw new Error({message:"Parameter files requires an array",parameter:"files"});this._files=e}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),this._resource=this._organization+"/transformers",{files:this._files||void 0}}},{key:"_composeUpdateElement",value:function(){var e=u(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this);return delete e.name,e}},{key:"performTest",value:function(e){var t=c.default.defer(),r=t.promise;return this._ogapi.Napi.post(this._buildURL()+"/transform",e,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then(function(e){t.resolve({statusCode:e.statusCode,body:e.body})}).catch(function(e){t.reject(e)}),r}},{key:"create",value:function(){var e=this._composeElement(),t=c.default.defer();return this._ogapi.Napi.post_multipart(this._resource,{files:e.files},{},this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then(function(e){switch(e.statusCode){case 200:var r=""!=e.text?JSON.parse(e.text):{},n=e.status;t.resolve({data:r,statusCode:n});break;case 201:var n=e.status,i=e.header&&e.header.location;t.resolve({location:i,statusCode:n});break;case 204:t.resolve(e);break;default:t.reject({errors:e.data.errors,statusCode:e.statusCode})}}).catch(function(e){t.reject(e)}),t.promise}},{key:"update",value:function(){var e=this._composeElement(),t=c.default.defer();return this._ogapi.Napi.put_multipart(this._buildURL(),{files:e.files},{},this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then(function(e){switch(e.statusCode){case 200:var r=""!=e.text?JSON.parse(e.text):{},n=e.status;t.resolve({data:r,statusCode:n});break;default:t.reject({errors:e.data.errors,statusCode:e.statusCode})}}).catch(function(e){t.reject(e)}),t.promise}}]),t}(f.default);r.default=d,t.exports=r.default},{"../provision/BaseProvision":235,q:117}],335:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../ProvisionGenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"users","user","User not found")}return i(t,e),o(t,[{key:"findByEmail",value:function(e){return this._id=e,this._execute()}},{key:"findByEmailAndPassword",value:function(e,t){return this._id=e,this._setExtraHeaders({"X-ApiPass":t}),this._execute()}}]),t}(s.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":140}],336:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../provision/BaseProvision"),c=n(s),l=e("q"),f=(n(l),e("lodash")),d=n(f),h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/users",void 0,["email","workgroup","domain","profile","countryCode","langCode"])}return o(t,e),a(t,[{key:"withName",value:function(e){if("string"!=typeof e||e.length>100)throw new Error("Parameter name must be a string and has a maximum length of 100");return this._name=e,this}},{key:"withSurname",value:function(e){if("string"!=typeof e||e.length>100)throw new Error("Parameter surname must be a string and has a maximum length of 100");return this._surname=e,this}},{key:"withEmail",value:function(e){if("string"!=typeof e||e.length>100)throw new Error("Parameter email must be a string and has a maximum length of 100");return this._email=e,this}},{key:"withPassword",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("Parameter password must be a string and has a maximum length of 50");return this._password=e,this}},{key:"withWorkgroup",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_WORKGROUP");return this._workgroup=e,this}},{key:"withDomain",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_DOMAIN");return this._domain=e,this}},{key:"withProfile",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_PROFILE");return this._profile=e,this}},{key:"withCountryCode",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_COUNTRY_CODE");return this._countryCode=e,this}},{key:"withLangCode",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_LANGUAGE");return this._langCode=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_DESCRIPTION");return this._description=e,this}},{key:"withTimezone",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_TIMEZONE");return this._timezone=e,this}},{key:"with2FaType",value:function(e){if("string"!=typeof e||e.length>100)throw new Error("Parameter twoFaType must be a string and has a maximum length of 100");return this._twoFaType=e,this}},{key:"_buildURL",value:function(){if(void 0===this._email)throw new Error("OGAPI_EMAIL_MUST_BE_DEFINED");return this._resource+"/"+this._email}},{key:"_composeElement",value:function(){return{user:{name:this._name||void 0,surname:this._surname||void 0,password:this._password||void 0,description:this._description||void 0,email:this._email||void 0,workgroup:this._workgroup||void 0,domain:this._domain||void 0,profile:this._profile||void 0,countryCode:this._countryCode||void 0,langCode:this._langCode||void 0,timezone:this._timezone||void 0,"2FaType":this._twoFaType||void 0}}}},{key:"_composeUpdateElement",value:function(){if(this._password)throw new Error("OGAPI_PASSWORD_NOT_ALLOWED");if(void 0===this._email)throw new Error("OGAPI_USER_UPDATE_PARAMETER_MUST_BE_DEFINED");return{user:{name:this._name||void 0,surname:this._surname||void 0,description:this._description||void 0,email:this._email||void 0,workgroup:this._workgroup||void 0,domain:this._domain||void 0,profile:this._profile||void 0,countryCode:this._countryCode||void 0,langCode:this._langCode||void 0,timezone:this._timezone||void 0,"2FaType":this._twoFaType||void 0}}}},{key:"changePassword",value:function(e){if(this._newPassword=e,d.default.isEmpty(this._email)||d.default.isEmpty(this._password)||d.default.isEmpty(this._newPassword))throw new Error("OGAPI_USER_UPDATE_PASSWORD_PARAMETER_MUST_BE_DEFINED");var t={user:{password:this._newPassword}};return this._setExtraHeaders({"X-ApiPass":this._password}),this._doNorthPut(this._buildURL(),t)}},{key:"requestResetPassword",value:function(){if(d.default.isEmpty(this._email))throw new Error("OGAPI_USER_MAIL_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED");var e=this._buildURL()+"/reset";return this._doNorthPost(e)}},{key:"updatePassword",value:function(e,t){if(this._newPassword=e,this._tokenId=t,d.default.isEmpty(this._email))throw new Error("OGAPI_USER_MAIL_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED");if(d.default.isEmpty(this._newPassword))throw new Error("OGAPI_USER_PASSWORD_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED");if(d.default.isEmpty(t))throw new Error("OGAPI_USER_TOKENID_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED");var r={password:this._newPassword},n=this._buildURL()+"/reset/"+t;return this._doNorthPost(n,r)}},{key:"login",value:function(e,t,r){if(this._email=e,this._password=t,this._twoFaCode=r,d.default.isEmpty(this._email)||d.default.isEmpty(this._password))throw new Error("OGAPI_USER_LOGIN_EMAIL_AND_PASSWORD_PARAMETER_MUST_BE_DEFINED");var n={email:this._email,password:this._password,"2FaCode":this._twoFaCode||void 0},i=this._resource+"/login";return this._doNorthPost(i,n,!0)}}]),t}(c.default);r.default=h,t.exports=r.default},{"../provision/BaseProvision":235,lodash:111,q:117}],337:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.DATE_FORMAT="";r.TIME_FORMAT="HH:mm:ssZ"},{}],338:[function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(){function e(){i(this,e)}return o(e,null,[{key:"eq",value:function(e,t){return{eq:n({},e,t)}}},{key:"neq",value:function(e,t){return{neq:n({},e,t)}}},{key:"like",value:function(e,t){return{like:n({},e,t)}}},{key:"gt",value:function(e,t){return{gt:n({},e,t)}}},{key:"lt",value:function(e,t){return{lt:n({},e,t)}}},{key:"gte",value:function(e,t){return{gte:n({},e,t)}}},{key:"lte",value:function(e,t){return{lte:n({},e,t)}}},{key:"in",value:function(e,t){return{in:n({},e,t)}}},{key:"or",value:function(){for(var e={or:[]},t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];for(var i=0;i<r.length;i++)e.or.push(r[i]);return e}},{key:"and",value:function(){for(var e={and:[]},t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];for(var i=0;i<r.length;i++)e.and.push(r[i]);return e}}]),e}();r.default=a,t.exports=r.default},{}],339:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("merge"),u=n(a),s=e("urlencode"),c=n(s),l=e("superagent"),f=n(l),d=e("q"),h=n(d),p=e("lodash"),y=n(p),m=e("superagent-mocker"),v=n(m),_=(0,v.default)(f.default),g=function(){function e(t,r){i(this,e),this._options=u.default.recursive(!0,this.default(),t),this._headers=r,y.default.isEmpty(t.mocks)||this._applyMocks(t.mocks)}return o(e,[{key:"_applyMocks",value:function(e){var t=this;Object.keys(e).filter(function(t){return!y.default.isEmpty(e[t])}).forEach(function(r){console.log("Mocking "+r.toLocaleUpperCase()+" requests"),Object.keys(e[r]).forEach(function(n){console.log("Mocking url:",n);var i=e[r][n];_[r](t._options.url+n,function(t){if("function"==typeof i)return console.log("Function returned"),i(t);var o=e[r][n];return console.log("Data returned:",o),o.headers||(o.headers={}),o})})})}},{key:"default",value:function(){return{timeout:5e3}}},{key:"_url",value:function(e){return e.url}},{key:"get",value:function(e,t,r,n,i,o){var a=this._createUrl(e,n,o);console.info("GET",a);var u=f.default.get(a);return this._createPromiseRequest(u,null,t,r,i)}},{key:"patch",value:function(e,t,r,n,i,o){var a=this._createUrl(e,i,o);console.info("PATCH",a);var u=f.default.patch(a).send(t);return this._createPromiseRequest(u,null,r,n)}},{key:"post",value:function(e,t,r,n,i,o){var a=this._createUrl(e,i,o);console.info("POST",a);var u=f.default.post(a).send(t);return this._createPromiseRequest(u,null,r,n)}},{key:"post_multipart",value:function(e,t,r,n,i,o,a){var u=this._createUrl(e,o,a);console.info("POST_MULTIPART",u);var s=f.default.post(u),c=!0;return Object.keys(t).forEach(function(e){switch(e){case"meta":case"json":case"file":s.field(e,t[e]),delete t[e];break;case"hardwareMedia":case"certificate":case"processorBulkFile":s.attach("file",t[e]),c=!1;break;case"files":t[e].forEach(function(t,r){console.log(t.name),s.attach(e,t)}),delete t[e],c=!1;break;case"modelFile":s.field(e,t[e]),delete t[e],c=!1;break;case"bulkFile":s.set("Content-Type",t.ext),t=t.bulkFile}}),c&&s.send(t),this._createPromiseRequest(s,r,n,i)}},{key:"put",value:function(e,t,r,n,i,o){var a=this._createUrl(e,i,o);console.info("PUT",a);var u=f.default.put(a).send(t);return n?n["Content-Type"]="application/json":n={"Content-Type":"application/json"},this._createPromiseRequest(u,null,r,n)}},{key:"put_multipart",value:function(e,t,r,n,i,o,a){var u=this._createUrl(e,o,a);console.info("PUT_MULTIPART",u);var s=f.default.put(u),c=!0;return Object.keys(t).forEach(function(e){switch(e){case"meta":case"json":case"file":s.field(e,t[e]),delete t[e];break;case"hardwareMedia":case"certificate":case"processorBulkFile":s.attach("file",t[e]),c=!1;break;case"files":t[e].forEach(function(t,r){console.log(t.name),s.attach(e,t)}),delete t[e],c=!1;break;case"modelFile":s.field(e,t[e]),delete t[e],c=!1;break;case"bulkFile":s.set("Content-Type",t.ext),t=t.bulkFile}}),c&&s.send(t),this._createPromiseRequest(s,r,n,i)}},{key:"delete",value:function(e,t,r,n,i,o){var a=this._createUrl(e,n,o);console.info("DELETE",a);var u;return u=i?f.default.del(a).send(i):f.default.del(a),this._createPromiseRequest(u,null,t,r)}},{key:"_createUrl",value:function(e,t,r){var n=[];if(t)for(var i=Object.keys(t),o=0;o<i.length;o++){var a=i[o],u=a+"="+t[a];e=0===o?e+"?"+u:e+"&"+u}var s=e.split("/"),l=s.length;return s.forEach(function(e,t){if(t===l-1&&e.indexOf("?")>0){var r=e.substring(e.indexOf("?"),e.length),i=e.substring(0,e.indexOf("?"));n.push((0,c.default)(i)+r)}else n.push((0,c.default)(e))}),this._url(this._options)+"/"+this._getDefaultBaseURL(r)+"/"+n.join("/")}},{key:"_getDefaultBaseURL",value:function(e){return e||(this._isSouth?"v80":"north/v80")}},{key:"_createPromiseRequest",value:function(e,t,r,n,i){var o=r;void 0!==o&&null!==o||(o=this._options.timeout);var a=h.default.defer(),u=a.promise,s=this._options.apiKey,c=this._options.jwt,l=-1===o?e:e.timeout(o);if(c&&!this._isSouth?l=l.set("Authorization","Bearer "+c):s&&(l=l.set("X-ApiKey",this._options.apiKey)),n)for(var f=Object.keys(n),d=0;d<f.length;d++){var p=f[d]
|
|
39
|
-
;void 0!==n[p]&&(l=l.set(p,n[p]))}if(t)for(var y in t)l=l.on(y,t[y]);return i&&e.responseType("blob"),l=l.end(function(e,t){if(null!==e){console.error("OGAPI ERROR: "),console.error(e);var r=void 0,n=void 0,i=e.status?e.status:void 0,o={errors:[{code:i,message:"OGAPI: Something is broken. Please contact with your administrator."}]};void 0!==e.response?(r=e.response.body?e.response.body:o,n=e.response.headers,i=e.status):i?(r=e.message,i=408):(r=o,i=500),a.reject({statusCode:i,data:r,headers:n})}else a.resolve(t)}),u}}]),e}();r.default=g,t.exports=r.default},{lodash:111,merge:112,q:117,superagent:128,"superagent-mocker":126,urlencode:135}],340:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(){function e(){n(this,e)}return i(e,null,[{key:"element",value:function(e,t){return{name:e,fields:t}}}]),e}();r.default=o,t.exports=r.default},{}],341:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./NorthAmpliaREST"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e,r){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r),this._isSouth=!0}return i(t,e),o(t,[{key:"_url",value:function(e){return e.south.url}}]),t}(s.default);r.default=c,t.exports=r.default},{"./NorthAmpliaREST":339}],342:[function(e,t,r){"use strict";t.exports={_checkType:function(e,t){var r=[];if(void 0===t.find(function(e){return e==this},e)&&r.push(e),0!==r.length)throw new Error({message:"OGAPI_NOT_ALLOWED_PARAMETER",parameter:JSON.stringify(r),allowed:JSON.stringify(t)});return e},_checkISODateTime:function(e,t){if("string"!=typeof e||new RegExp("\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d+(Z|[+-]\\d{2}:\\d{2})").test(e))throw new Error([{message:"OGAPI_ISO_DATE_TIME_PARAMETER",parameter:t},{message:"OGAPI_STRING_PATTERN",parameter:t}]);try{new Date(e)}catch(e){throw new Error([{message:"OGAPI_ISO_DATE_TIME_PARAMETER",parameter:t},{message:"OGAPI_STRING_PATTERN",parameter:t}])}},_checkStringAndPattern:function(e,t,r){if("string"!=typeof e||!new RegExp(t).test(e))throw new Error([{message:"OGAPI_STRING_PARAMETER",parameter:r},{message:"OGAPI_STRING_PATTERN",parameter:r,pattern:t}])},_checkStringAndLength:function(e,t,r){if("string"!=typeof e||e.length>t)throw new Error([{message:"OGAPI_STRING_PARAMETER",parameter:r},{message:"OGAPI_MAX_LENGTH",parameter:t}])},_checkString:function(e,t){if("string"!=typeof e)throw new Error([{message:"OGAPI_STRING_PARAMETER",parameter:t}])},_checkNumber:function(e,t){if("number"!=typeof e)throw new Error([{message:"OGAPI_NUMBER_PARAMETER",parameter:t}])},_checkArray:function(e,t){if(!Array.isArray(e)||0===e.length)throw new Error({message:"OGAPI_ARRAY_PARAMETER",parameter:t})},_checkObject:function(e,t){if("object"!=typeof e)throw new Error({message:"OGAPI_OBJECT_PARAMETER",parameter:t})}}},{}],343:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(r,"__esModule",{value:!0});var a,u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=e("q"),c=n(s),l=e("lodash"),f=n(l),d=e("./source-precompiled/Fields"),h=e("./IotFields"),p=d.GENERATED_FIELDS;for(var y in h.IOT_FIELDS)if(p[y])for(var m in h.IOT_FIELDS[y])p[y][m]=h.IOT_FIELDS[y][m];else p[y]=h.IOT_FIELDS[y];var v=new RegExp("^(.+)._current\\.?(.+)?$"),_=new RegExp("\\[[0-9]+\\]"),g=(new RegExp("value\\.?"),{"/jobs":"JOB","/tasks":"TASKS","/alarms":"ENTITY_ALARM","/operations":"ENTITY_OPERATION","/operations/history":"ENTITY_OPERATION_HISTORY","/certificates":"CERTIFICATE","/bundles":"UPDATE_BUNDLE_VERSION","/datapoints":"DATAPOINTS","/datastreams":"DATASTREAMS","/datamodels":"DATAMODELS","/dmmQRating":"DMMQRATING","/iotQRating":"IOTQRATING","/catalog/softwares":"SOFTWARE_VERSION","/catalog/hardwares":"MANUFACTURER","/catalog/operators":"OPERATORS","/domains":"DOMAIN","/users":"USER","/areas":"AREAS","/bulk/async":"LEGACY_BULK","provisionProcessors/bulk/search":"BULK","/devices":"SearchOnDatamodel","/subscriptions":"SearchOnDatamodel","/subscribers":"SearchOnDatamodel","/entities":"SearchOnDatamodel","entity-asset":"SearchOnDatamodel","/tickets":"SearchOnDatamodel","/channels":"SearchOnDatamodel",datasets:"SearchOnDataset",timeseries:"SearchOnTimeseries","/catalog/plans/organization":"PLANS","/catalog/plans/device":"PLANS"}),b={ENTITY_ALARM:"alarm",UPDATE_BUNDLE_VERSION:"bundle",DATAPOINTS:"datapoints",ENTITY_OPERATION:["operation","job"]},w={get:function(e){switch(e){case"entity-asset":return["entity.asset"];case"/tickets":return["ticket"];case"/channels":return["channel"];default:return}}},E={subscriber:"DEVICE_PART_SUBSCRIBER",subscription:"DEVICE_PART_SUBSCRIPTION",communicationsModule:"DEVICE_PART_COMMSMODULE",device:"DEVICE_PART_DEVICE"},A={DEVICE_PART_SUBSCRIBER:"subscriber",DEVICE_PART_SUBSCRIPTION:"subscription",DEVICE_PART_COMMSMODULE:"communicationsModule",DEVICE_PART_DEVICE:"device"},O=["relColl","relProv"],S=["DEVICE_PART_SUBSCRIBER","DEVICE_PART_SUBSCRIPTION","DEVICE_PART_COMMSMODULE","DEVICE_PART_DEVICE"],P=["subscriber","subscription","communicationsModule","device"],D="search",C={get:function(e){if(S.indexOf(g[e])>=0)return"complex";switch(g[e]){case"SearchOnDatamodel":return D;case"SearchOnDataset":return"dataset";case"SearchOnTimeseries":return"timeserie";default:return"simple"}}},k=function(e,t){function r(e){for(var t=!0;t;){var r=e;t=!1;{if(!(r.length>0&&r[0].constructor===Array))return r;r=r.reduce(function(e,t){return e.concat(t)}),e=r,t=!0}}}var n=c.default.defer(),i=t.selectedField,o=t.selectAll,a=t.extraData&&t.extraData.organization,u=e._ogapi.datamodelsSearchBuilder(),s={and:[]};return e._resourceTypes&&s.and.push({in:{"datamodels.allowedResourceTypes":e._resourceTypes}}),a&&s.and.push({eq:{"datamodels.organizationName":a}}),i&&s.and.push({eq:{"datamodels.categories.datastreams.identifier":i}}),s.and.length>0&&u.filter(s),u.build().execute().then(function(e){var t=[];200===e.statusCode&&(t=e.data.datamodels.map(function(e){return(e.categories||[]).map(function(e){return(e.datastreams||[]).map(function(e){return i||o?e:e.identifier})})}),t=r(t)),i?n.resolve(t.find(function(e){return i===e.identifier})):n.resolve(t)}).catch(function(e){n.reject(e)}),n.promise},T=function(e,t,r,n){var i=r.selectedField,o=[],a=r.extraData.organization,u=r.extraData[t.entity];e._ogapi[t.api]()[t.method](a,u).then(function(t){if(200===t.statusCode){t.data.identifierColumn&&o.push({identifier:t.data.identifierColumn,name:t.data.identifierColumn,path:"provision.administration.identifier._current.value",indexed:!0,sort:!0,notFilterable:!1,filter:"YES",type:"string",schema:{type:"string"}}),t.data.bucketColumn&&o.push({identifier:t.data.bucketColumn,name:t.data.bucketColumn,path:"provision.administration.identifier._current.at",indexed:!0,sort:!0,notFilterable:!1,filter:"YES",type:"date-time",schema:{type:"string",format:"datetime"}});var a=f.default.concat(t.data.columns||[],t.data.context||[]);e._ogapi.basicTypesSearchBuilder().withPath("$").build().execute().then(function(t){t.data.definitions;if(r.selectAll=!0,i){a=a.filter(function(e){return i===(e.name||e.alias)});var u=a[0],s=u.path.match(v),c=s[1].replace(_,"[]");r.selectedField=c}k(e,r).then(function(e){a.forEach(function(t){"date-time"!==t.type?t.schema={type:t.type}:t.schema={type:"string",format:"datetime"},t.path.endsWith("._current.value")&&function(){var r=t.path.substring(0,t.path.indexOf("._current.value"));Array.isArray(e)&&e.find(function(e){return r===e.identifier})}(),t.identifier=t.name||t.alias,t.indexed="NO"!==t.filter,t.notFilterable="NO"===t.filter,o.push(t)}),n.resolve(o)}).catch(function(e){console.error(e),n.reject(e)})}).catch(function(e){console.error(e),n.reject(e)})}}).catch(function(e){console.error(e),n.reject(e)})},F=(a={},o(a,D,function(e,t){k(this,e).then(function(e){t.resolve(e)}).catch(function(e){t.reject(e)})}),o(a,"simple",function(e,t){var r=e.context,n=e.primaryType,i=e.selectedField,o=[];if(r[n]instanceof Array)i?function(){var e=0,t=null;for(e=0;null===t&&e<r[n].length;e++)!function(){var o=r[n][e];o.toLowerCase()===i.toLowerCase()||o.toLowerCase()===i.toLowerCase()+"name"?t=o:b[n]&&(b[n]instanceof Array?b[n].forEach(function(e){o.toLowerCase()!==e+i.toLowerCase()&&o.toLowerCase()!==e+"."+i.toLowerCase()&&o.toLowerCase()!==e+i.toLowerCase()+"name"&&o.toLowerCase()!==e+"."+i.toLowerCase()+"name"||t||(t=o)}):o.toLowerCase()!==b[n]+i.toLowerCase()&&o.toLowerCase()!==b[n]+"."+i.toLowerCase()&&o.toLowerCase()!==b[n]+i.toLowerCase()+"name"&&o.toLowerCase()!==b[n]+"."+i.toLowerCase()+"name"||(t=o))}();t&&o.push(t)}():o=r[n].slice();else if(i)if(r[n][i])o.push(r[n][i]);else for(var a=Object.keys(r[n]),u=0;u<a.length;u++)r[n][a[u]].toLowerCase().indexOf(i.toLowerCase())>-1&&o.push(r[n][a[u]]);else for(var a=Object.keys(r[n]),u=0;u<a.length;u++)o.push(r[n][a[u]]);t.resolve(o.slice())}),o(a,"complex",function(e,t){function r(e,t){var n=void 0;if(!(r=E[e])||!(n=t[r]))throw new Error("Invalid primaryType: "+e);return n.slice()}function n(e){return e!=this}function i(e,t){var r=[];return t.forEach(function(t){var n=e.slice(0,-1);n.push(t),r.push(n.join("."))}),r}var o=e.states,a=e.context,u=e.primaryType,s={1:function(e,t){return t[u].concat(P.filter(n,A[u]))},2:function(e,t){try{return i(e,r(e[0],t).concat(O))}catch(e){return[]}},3:function(e,t){var n=e[1];if(-1===O.indexOf(n))return[];try{return i(e,r(e[0],t))}catch(e){return[]}}},c=o.length,l=s[c];return void 0===l?t.resolve([]):t.resolve(l(o,a))}),o(a,"dataset",function(e,t){T(this,{api:"newDatasetFinder",method:"findByOrganizationAndDatasetId",entity:"dataset"},e,t)}),o(a,"timeserie",function(e,t){T(this,{api:"newTimeserieFinder",method:"findByOrganizationAndTimeserieId",entity:"timeserie"},e,t)}),a),j=function(){function e(t,r,n){i(this,e),this._ogapi=t,this._url=r,this._type=C.get(r),this._extraData=n,this._type===D&&(this._resourceTypes=w.get(r))}return u(e,[{key:"find",value:function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=c.default.defer(),r={states:e.split("."),context:p[g[this._url]],primaryType:g[this._url],extraData:this._extraData};return F[this._type].call(this,r,t),t.promise}},{key:"findAll",value:function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=c.default.defer(),r={states:e.split("."),context:p[g[this._url]],primaryType:g[this._url],selectAll:!0,extraData:this._extraData};return F[this._type].call(this,r,t),t.promise}},{key:"findFieldPath",value:function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=c.default.defer(),r={states:e,context:p[g[this._url]],primaryType:g[this._url],selectedField:e,extraData:this._extraData};return F[this._type].call(this,r,t),t.promise}}]),e}();r.default=j,t.exports=r.default},{"./IotFields":344,"./source-precompiled/Fields":345,lodash:111,q:117}],344:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={DATAPOINTS:{DATAPOINTS:["datapoints.organization","datapoints.channel","datapoints.datastreamId","datapoints.entityIdentifier","datapoints.subEntityIdentifier","datapoints.entityRelated","datapoints._current.feedId","datapoints._current.date","datapoints._current.at","datapoints._current.value","datapoints._current.tags","datapoints._current.scoring.performance","datapoints._current.scoring.qrating.min_required.value","datapoints._current.scoring.qrating.min_required.label","datapoints._current.scoring.qrating.min_desired.value","datapoints._current.scoring.qrating.min_desired.label","datapoints._current.scoring.qrating.ideal.value","datapoints._current.scoring.qrating.ideal.label","datapoints._current.scoring.qrating.max_desired.value","datapoints._current.scoring.qrating.max_desired.label","datapoints._current.scoring.qrating.max_allowed.value","datapoints._current.scoring.qrating.max_allowed.label","datapoints._current.scoring.qrating.max_score","datapoints._current.scoring.qrating.cumulative_period_divisor","datapoints._current.scoring.qrating.conversion_matrix","datapoints._current.scoring.qrating.version"]},DATAMODELS:{DATAMODELS:["datamodels.organizationName","datamodels.identifier","datamodels.name","datamodels.description","datamodels.version","datamodels.categories.name","datamodels.categories.identifier","datamodels.categories.datastreams.identifier","datamodels.categories.datastreams.name","datamodels.categories.datastreams.description","datamodels.categories.datastreams.hardwareIds","datamodels.categories.datastreams.unit","datamodels.categories.datastreams.unit.type","datamodels.categories.datastreams.unit.label","datamodels.categories.datastreams.unit.symbol","datamodels.categories.datastreams.period","datamodels.categories.datastreams.access","datamodels.categories.datastreams.schema","datamodels.categories.datastreams.storage","datamodels.categories.datastreams.storage.period","datamodels.categories.datastreams.storage.total","datamodels.categories.datastreams.tags","datamodels.categories.datastreams.views","datamodels.categories.datastreams.icon","datamodels.categories.datastreams.modifiable","datamodels.categories.datastreams.required","datamodels.categories.datastreams.qrating.min_required.value","datamodels.categories.datastreams.qrating.min_required.label","datamodels.categories.datastreams.qrating.min_desired.value","datamodels.categories.datastreams.qrating.min_desired.label","datamodels.categories.datastreams.qrating.ideal.value","datamodels.categories.datastreams.qrating.ideal.label","datamodels.categories.datastreams.qrating.max_desired.value","datamodels.categories.datastreams.qrating.max_desired.label","datamodels.categories.datastreams.qrating.max_allowed.value","datamodels.categories.datastreams.qrating.max_allowed.label","datamodels.categories.datastreams.qrating.max_score","datamodels.categories.datastreams.qrating.cumulative_period_divisor","datamodels.categories.datastreams.qrating.conversion_matrix","datamodels.categories.datastreams.qrating.version"]},DATASTREAMS:{DATASTREAMS:["datastreams.datastreamId","datastreams.name","datastreams.description","datastreams.unit.type","datastreams.unit.label","datastreams.unit.symbol","datastreams.period","datastreams._current.tags","datastreams._current.date","datastreams._current.value","datastreams.categoryId","datastreams.datamodelId","datastreams.access","datastreams.channel","datastreams.organization","datastreams.entityIdentifier","feeds.entityIdentifier","datastreams._id.subEntityIdentifier","datastreams._current.scoring.qrating.min_required.value","datastreams._current.scoring.qrating.min_required.label","datastreams._current.scoring.qrating.min_desired.value","datastreams._current.scoring.qrating.min_desired.label","datastreams._current.scoring.qrating.ideal.value","datastreams._current.scoring.qrating.ideal.label","datastreams._current.scoring.qrating.max_desired.value","datastreams._current.scoring.qrating.max_desired.label","datastreams._current.scoring.qrating.max_allowed.value","datastreams._current.scoring.qrating.max_allowed.label","datastreams._current.scoring.qrating.max_score","datastreams._current.scoring.qrating.cumulative_period_divisor","datastreams._current.scoring.qrating.max_score","datastreams._current.scoring.qrating.conversion_matrix","datastreams.version","feeds.identifier","datastreams._current.scoring.qrating.version","datastreams._current.scoring.scoringPerformance"]},DEVICE_PART_DEVICE:{IOT:["datastream.id","datastream.name","datastream.feed","datastream.device","datastream.description","datastream.unit.type","datastream.unit.label","datastream.unit.symbol","datastream.period","datastream.tags","datastream.updated","datastream.minValue","datastream.maxValue","datastream.currentValue","datastream.categoryName","datastream.profileId","datastream.profileName","datastream.profileDescription","datastream.profileVersion","datastream.qratingScoringQValue","datastream.qratingScoringQScore","datastream.qratingScoringQuality","datastream.qratingScoringPerformance","datastream.qratingMinRequiredValue","datastream.qratingMinRequiredLabel","datastream.qratingMinDesiredValue","datastream.qratingMinDesiredLabel","datastream.qratingIdealValue","datastream.qratingIdealLabel","datastream.qratingMaxDesiredValue","datastream.qratingMaxDesiredLabel","datastream.qratingMaxAllowedValue","datastream.qratingMaxAllowedLabel","datastream.qratingMaxScore","deviceId","feedId","deviceOrganization","profile.Name","profile.Description","profile.Version","profile.Score","profile.MaxScore","profile.Performance","profile.AvgPerformance","profile.Quality","category.Name","category.Score","category.MaxScore","category.Performance","category.AvgPerformance","category.Quality","device.Score","device.MaxScore","device.Performance","device.AvgPerformance","device.Quality","device.Channel","device.EntityType"]},USER:{USER:{email:"user.email",description:"user.description",workgroup:"workgroup.name",domain:"domain.name",profile:"profile.name",name:"user.name",surname:"user.surname",countryCode:"country.code",langCode:"language.code",timezone:"user.timezone"}},DOMAIN:{DOMAIN:["domain.name","domain.description"]},AREAS:{AREAS:{identifier:"areas.identifier",name:"areas.name",description:"areas.description",entities:"areas.entities",geometry:"areas.geometry",color:"areas.color",organization:"areas.organization"}},TASKS:{TASKS:["tasks.id","tasks.name","tasks.description","tasks.state","tasks.domain","tasks.workgroup","tasks.job.request.user"]},LEGACY_BULK:{LEGACY_BULK:{identifier:"bulks.identifier",organization:"bulks.organization",fileName:"bulks.request.fileName",userEmail:"bulks.request.userEmail",headerAccept:"bulks.request.header.accept",contentType:"bulks.request.header.contentType",headerCsvFormat:"bulks.request.header.csvFormat",paramsFlattened:"bulks.request.params.flattened",paramsAction:"bulks.request.params.action",paramsFull:"bulks.request.params.full",paramsType:"bulks.request.params.type",status:"bulks.status",startedDate:"bulks.startedDate",finishedDate:"bulks.finishedDate",processed:"bulks.summary.processed",successful:"bulks.summary.successful",error:"bulks.summary.error"}},BULK:{BULK:{identifier:"bulks.identifier",provisionProcessorId:"bulks.provisionProcessorId",organization:"bulks.organization",userEmail:"bulks.request.userEmail",fileName:"bulks.request.fileName",headerAccept:"bulks.request.header.accept",contentType:"bulks.request.header.contentType",status:"bulks.status",startedDate:"bulks.startedDate",finishedDate:"bulks.finishedDate",processed:"bulks.summary.processed",successful:"bulks.summary.successful",error:"bulks.summary.error"}},RULE:{RULE:{organizationId:"rule.organizationId",channelId:"rule.channelId",name:"rule.name",active:"rule.active"}},ENTITY_ALARM:{ENTITY_ALARM:{alarmId:"alarm.identifier",alarmSubEntityIdentifier:"alarm.subEntityIdentifier",entityId:"alarm.entityIdentifier",entityType:"alarm.resourceType",organizationName:"alarm.organization",channelName:"alarm.channel",alarmRuleName:"alarm.rule",alarmName:"alarm.name",alarmSeverity:"alarm.severity",alarmPriority:"alarm.priority",alarmDescription:"alarm.description",alarmStatus:"alarm.status",alarmOpenDate:"alarm.openingDate",alarmAttentionDate:"alarm.attentionDate",alarmAttentionUser:"alarm.attentionUser",alarmAttentionNote:"alarm.attentionNote",alarmClosureDate:"alarm.closureDate",alarmClosureUser:"alarm.closureUser",alarmClosureNote:"alarm.closureNote"}},GENERAL:{GENERAL:[]},EMPTY:{EMPTY:[]},OPERATORS:{OPERATORS:["operator.name"]},PLANS:{PLANS:["plan.identifier","plan.name","plan.flowRate.value","plan.flowRate.unit","plan.maxDeviceAmount","plan.maxStorageLifeTime.period","plan.maxStorageLifeTime.total","plan.defaultAssigned","plan.defaultProvision"]}};r.IOT_FIELDS=n},{}],345:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={ENTITY_OPERATION_HISTORY:{ENTITY_OPERATION_HISTORY:["applicationEmail","entityId","entityType","jobActivatedDate","jobId","jobUserNotes","operationAttemptCurrent","operationAttemptMax","operationDate","operationDetails","operationEndDate","operationId","operationInitDate","operationName","operationNotify","operationParameters","operationResult","operationStatus","operationSteps"]},ENTITY_OPERATION:{ENTITY_OPERATION:["applicationEmail","channelKey","channelName","domainKey","entityId","entityType","entityUk","jobActivatedDate","jobEntityTotal","jobErrorCode","jobErrorDescription","jobFinishedCancelledByEngine","jobFinishedCancelledByExternal","jobFinishedCancelledByExternalTimeout","jobFinishedCancelledByTimeout","jobFinishedCancelledByUser","jobFinishedCancelledTotal","jobFinishedDate","jobFinishedError","jobFinishedOotError","jobFinishedOotSuccessful","jobFinishedOotTotal","jobFinishedSuccessful","jobFinishedTotal","jobId","jobInProgressPendingExecution","jobInProgressScheduled","jobInProgressStarted","jobInProgressTotal","jobInProgressWaitingForConnection","jobJson","jobStartedDate","jobState","jobStatus","jobTotal","jobUser","jobUserNotes","notDeletable","operationAttemptCurrent","operationAttemptMax","operationDate","operationDetails","operationEndDate","operationId","operationInitDate","operationJson","operationName","operationNotify","operationResult","operationScheduleTimestamp","operationStatus","operationStatusKey","operationStepDescription","operationStepName","operationStepResponse","operationStepResult","operationStepTimestamp","operationTimeoutTimestamp","operationUserNotes","organizationKey","organizationName","profileKey","provAdministrativeState","provAdministrativeStateKey","provDefaultFeed","serviceGroupName","tag","taskEmpty_null","taskId","taskKey","taskName","taskState","taskStatus","workgroupKey","workgroupName"]},MANUFACTURER:{MANUFACTURER:["manufacturerAddress","manufacturerDescription","manufacturerEmail","manufacturerFax","manufacturerIdentifier","manufacturerMediaFileName","manufacturerMediaHeight","manufacturerMediaIdentifier","manufacturerMediaName","manufacturerMediaSize","manufacturerMediaTypeName","manufacturerMediaWidth","manufacturerName","manufacturerNotes","manufacturerTelephone","manufacturerUrl","modelDescription","modelIdentifier","modelMediaFileName","modelMediaHeight","modelMediaIdentifier","modelMediaName","modelMediaSize","modelMediaTypeName","modelMediaWidth","modelName","modelNotes","modelUrl","modelVersion"]},MODEL:{MODEL:["modelDescription","modelIdentifier","modelName","modelNotes","modelUrl","modelVersion"]},JOB:{JOB:["jobActivatedDate","jobActivatedTime","jobCallback","jobEntityTotal","jobErrorCode","jobErrorDescription","jobFinishedCancelledByEngine","jobFinishedCancelledByExternal","jobFinishedCancelledByExternalTimeout","jobFinishedCancelledByTimeout","jobFinishedCancelledByUser","jobFinishedCancelledTotal","jobFinishedDate","jobFinishedError","jobFinishedOotError","jobFinishedOotSuccessful","jobFinishedOotTotal","jobFinishedSuccessful","jobFinishedTime","jobFinishedTotal","jobId","jobInProgressPendingExecution","jobInProgressScheduled","jobInProgressStarted","jobInProgressTotal","jobInProgressWaitingForConnection","jobJson","jobOperationName","jobScheduledTime","jobStartedDate","jobState","jobStatus","jobTotal","jobTrap","jobUser","jobUserNotes","jobVisible","operationId","operationName","operationResult","operationStatusKey","taskCoremessage","taskId","taskKey","taskName","taskNextExecution","taskState","taskStatus"]},SOFTWARE_VERSION:{SOFTWARE_VERSION:["manufacturerAddress","manufacturerDescription","manufacturerEmail","manufacturerFax","manufacturerIdentifier","manufacturerName","manufacturerNotes","manufacturerTelephone","manufacturerUrl","modelDescription","modelIdentifier","modelName","modelNotes","modelUrl","modelVersion","softwareId","softwareName","softwareType","softwareVersion"]},UPDATE_BUNDLE_VERSION:{UPDATE_BUNDLE_VERSION:["bundleActionDef","bundleActionOrder","bundleActionType","bundleActive","bundleConstrained","bundleCreationDate","bundleDeploymentElementDownloadUrl","bundleDeploymentElementId","bundleDeploymentElementName","bundleDeploymentElementOperation","bundleDeploymentElementOption","bundleDeploymentElementOrder","bundleDeploymentElementPath","bundleDeploymentElementSize","bundleDeploymentElementType","bundleDeploymentElementValidators","bundleDeploymentElementVersion","bundleDescription","bundleHardware","bundleId","bundleName","bundleUserNotes","bundleVersion","bundleWorkgroup","updateBundleDate","updateBundleManufacturer","updateBundleModel","updateBundleName","updateBundleVersion","updateBundleVersionUuid","updateDescription"]},CERTIFICATE:{CERTIFICATE:["certificateAdministrativeState","certificateDescription","certificateDomain","certificateId","certificateIssuer","certificateManufacturer","certificateModel","certificateModelIdentifier","certificateModelVersion","certificateName","certificatePublicKeyAlgorithm","certificatePublicKeyFormat","certificatePublicKeySize","certificateSerialNumber","certificateSubject","certificateTag","certificateTrustChain","certificateUsage","certificateValidFrom","certificateValidUntil","certificateVersion"]}};r.GENERATED_FIELDS=n},{}],346:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../ProvisionGenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"domains","workgroup","Workgroup not found")}return i(t,e),o(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._domain+"/workgroups/"+this._name}},{key:"findByDomainAndName",value:function(e,t){return this._domain=e,this._name=t,this._execute()}}]),t}(s.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":140}],347:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../provision/BaseProvision"),c=n(s),l=e("./Workgroups"),f=n(l),d=e("../channels/Channels"),h=n(d),p=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/domains",void 0,["workgroup","channels"]),this._ogapi=e,this._action="CREATE"}return o(t,e),a(t,[{key:"withWorkgroup",value:function(e){if(e.constructor.prototype!=f.default.prototype)throw new Error("Parameter workgroup must be a workgroup");return this._workgroup=e,this}},{key:"withChannel",value:function(e){if(e.constructor.prototype!=h.default.prototype)throw new Error("Parameter channel must be a channel");return this._channels||(this._channels=[]),this._channels.push({organization:e._organization,channel:e._name}),this}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),this._resource="provision/domains/"+this._workgroup._domainName+"/workgroups/"+this._workgroup._name+"/relations",{workgroupRelation:{channels:this._channels?this._channels:void 0}}}},{key:"_buildURL",value:function(){return"provision/domains/"+this._workgroup._domainName+"/workgroups/"+this._workgroup._name+"/relations"}},{key:"create",value:function(){var e=this._composeElement(),t=this._resource;return this._setUrlParameters({action:"CREATE"}),this._doNorthPost(t,e)}},{key:"delete",value:function(){this._setUrlParameters({action:"DELETE"});var e=this._buildURL();if(this._channels){var t=this._composeElement();return this._doNorthPost(e,t)}return this._doNorthPost(e,{workgroupRelation:{channels:[]}})}},{key:"update",value:function(){throw new Error("Workgroup relation update not allowed")}}]),t}(c.default);r.default=p,t.exports=r.default},{"../channels/Channels":161,"../provision/BaseProvision":235,"./Workgroups":349}],348:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){
|
|
40
|
-
var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../ProvisionGenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"domains","workgroup","Workgroup relation not found")}return i(t,e),o(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._domain+"/workgroups/"+this._name+"/relations"}},{key:"findByDomainAndName",value:function(e,t){return this._domain=e,this._name=t,this._execute()}}]),t}(s.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":140}],
|
|
41
|
-
//# sourceMappingURL=opengate-api-bower-12.9.
|
|
32
|
+
if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("http-status-codes"),c=n(s),l=e("../BaseProvision"),f=n(l),d=e("q"),h=n(d),p=e("lodash"),y=n(p),m=function(e){function t(e,r,n,o,a,s){if(i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations/"+r,s),"function"!=typeof this._getEntityKey)throw new Error("Must override method: _getEntityKey");this._setUrlParameters({flattened:!0}),this._entity={},this._allowedDatastreams=n,this._definedSchemas=o,this._jsonSchemaValidator=a}return o(t,e),a(t,[{key:"_buildURL",value:function(){return this._resource+"/"+this.getEntityKey()}},{key:"_validate",value:function(){var e=this,t=[];if(Object.keys(this._entity).forEach(function(r){"resourceType"!=r&&function(){if(!e._definedSchemas[r])throw new Error("Datastream is not allowed: "+r);var n=e._definedSchemas[r].value;if(e._entity[r].constructor===Array)e._entity[r].forEach(function(i){var o=i._value._current.value;e._jsonSchemaValidator.validate("/og_basic_types.json",o)||t.push(r+" ["+o+"] value is not allowed. The value should be formatted as follows: "+JSON.stringify(n))});else{var i=e._entity[r]._value._current.value;e._jsonSchemaValidator.validate("/og_basic_types.json",i)||t.push(r+" ["+i+"] value is not allowed. The value should be formatted as follows: "+JSON.stringify(n))}}()}),t.length>0)throw new Error(JSON.stringify(t).replace(new RegExp('"',"g"),""))}},{key:"_composeElement",value:function(){return this._validate(),this._entity}},{key:"getEntityKey",value:function(){return null!==this._getEntityKey()?this._getEntityKey()._value._current.value:null}},{key:"with",value:function(e,t){return void 0!==t&&0!==t.length||y.default.isArray(t)?1!==this.getAllowedDatastreams().filter(function(t){return t.identifier===e}).length?(console.warn("Datastream not found or operations can not be performed on it. This value will be ignored. Datastream Name: "+e),this):(this._entity[e]={_value:{_current:{value:t}}},this):(delete this._entity[e],this)}},{key:"getAllowedDatastreams",value:function(){return this._allowedDatastreams}},{key:"initFromFlattened",value:function(e){var t=this;e&&Object.keys(e).length>0&&Object.keys(e).forEach(function(r){if(r.toLowerCase().startsWith("provision")){var n=e[r];Array.isArray(n)&&(n=n[0]),t.with(r,n._value._current.value)}})}},{key:"_initFromJson",value:function(e,t){var r=this;if(e){Object.keys(e).forEach(function(n){var i=e[n],o=i._current,a=t?t+"."+n:n;o?r.with(a,o.value):Array.isArray(i)?r._initFromJson(i[0],a+"[]"):r._initFromJson(i,a)})}}},{key:"initFromJson",value:function(e){var t=this,r={};e&&(r=e.provision)&&t._initFromJson(r,"provision")}},{key:"deleteAll",value:function(){var e=h.default.defer(),t=e.promise;return this._setUrlParameters({full:!0}),this._ogapi.Napi.delete(this._buildURL(),this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){t.statusCode===c.default.OK?e.resolve({statusCode:t.statusCode}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}},{key:"update",value:function(){var e=h.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),this._composeUpdateElement(),this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):200===t.status?e.resolve({statusCode:t.status}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}},{key:"patch",value:function(){var e=h.default.defer(),t=e.promise;return this._ogapi.Napi.patch(this._buildURL(),this._composeUpdateElement(),this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):200===t.status?e.resolve({statusCode:t.status}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(f.default);r.default=m,t.exports=r.default},{"../BaseProvision":235,"http-status-codes":76,lodash:111,q:117}],247:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SimpleBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c="provision.device.communicationModules[].subscriber.identifier";r.SubscriberID=c;var l=function(e){function t(e,r,i,o,u,s){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/subscribers",i,o,u,s)}return i(t,e),o(t,[{key:"_getEntityKey",value:function(){return this._entity[c]}}]),t}(s.default);r.default=l},{"./SimpleBuilder":246}],248:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SimpleBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c="provision.device.communicationModules[].subscription.identifier";r.SubscriptionID=c;var l=function(e){function t(e,r,i,o,u,s){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/subscriptions",i,o,u,s)}return i(t,e),o(t,[{key:"_getEntityKey",value:function(){return this._entity[c]}}]),t}(s.default);r.default=l},{"./SimpleBuilder":246}],249:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SimpleBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c="provision.ticket.identifier";r.TicketID=c;var l=function(e){function t(e,r,i,o,u,s){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/tickets",i,o,u,s)}return i(t,e),o(t,[{key:"_getEntityKey",value:function(){return this._entity[c]}}]),t}(s.default);r.default=l},{"./SimpleBuilder":246}],250:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../provision/BaseProvision"),c=n(s),l=e("../util/formats/check_types"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations/",void 0,["name","organization","configurationParams","scriptProcessor"])}return o(t,e),a(t,[{key:"_buildURL",value:function(){return"provisionProcessors/provision/organizations/"+this._organization+"/"+this._identifier}},{key:"withOrganization",value:function(e){return f.default._checkStringAndLength(e,50,"organization"),this._organization=e,this}},{key:"withIdentifier",value:function(e){return f.default._checkString(e,"identifier"),this._identifier=e,this}},{key:"withName",value:function(e){return f.default._checkString(e,"name"),this._name=e,this}},{key:"withConfigurationParams",value:function(e){return f.default._checkObject(e,"configurationParams"),this._configurationParams=e,this}},{key:"withScriptProcessor",value:function(e){return f.default._checkObject(e,"scriptProcessor"),this._scriptProcessor=e,this}},{key:"_composeElement",value:function(){return this._resource="provisionProcessors/provision/organizations/"+this._organization,{name:this._name,configurationParams:this._configurationParams,scriptProcessor:this._scriptProcessor}}}]),t}(c.default);r.default=d,t.exports=r.default},{"../provision/BaseProvision":235,"../util/formats/check_types":343}],251:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provisionProcessors/provision/organizations","provisionPrecessors")}return i(t,e),o(t,[{key:"findByOrganization",value:function(e){return this._withId(e),this._execute()}},{key:"findByOrganizationAndProvisionProcessorId",value:function(e,t){return this._withId(e+"/"+t),this._execute()}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":138}],252:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../provision/BaseProvision"),c=n(s),l=e("./_RuleCondition"),f=(n(l),e("./_RuleNotification")),d=(n(f),e("q")),h=n(d),p=function(e){function t(e,r,n,o,a){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations"),this.withOrganization(r),this.withChannel(n),o&&this.withIdentifier(o),a&&(a.name&&this.withName(a.name),a.mode&&this.withMode(a.mode),a.type&&this.withType(a.type),a.description&&this.withDescription(a.description),null!==a.active&&void 0!==a.active&&this.withActive(a.active),null!==a.condition&&void 0!==a.condition&&this.withCondition(a.condition),a.actionsDelay&&this.withActionsDelay(a.actionsDelay),a.actions&&this.withActions(a.actions),a.parameters&&this.withParameters(a.parameters),a.javascript&&this.withJavascript(a.javascript))}return o(t,e),a(t,[{key:"withOrganization",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter organization must be a string, cannot be empty and has a maximum length of 50");return this._organization=e,this}},{key:"withChannel",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter channel must be a string, cannot be empty and has a maximum length of 50");return this._channel=e,this}},{key:"withIdentifier",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter identifier must be a string, cannot be empty and has a maximum length of 50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter name must be a string, cannot be empty and has a maximum length of 50");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_250",parameter:"description"});return this._description=e,this}},{key:"withJavascript",value:function(e){if("string"!=typeof e)throw new Error("Parameter name must be a string and cannot be empty");return this._javascript=e,this}},{key:"withMode",value:function(e){return this._mode=e,this}},{key:"withType",value:function(e){return this._type=e,this}},{key:"withActive",value:function(e){if("boolean"!=typeof e)throw new Error("Parameter active must be true or false");return this._active=e,this}},{key:"withActionsDelay",value:function(e){if("number"!=typeof e)throw new Error("Parameter actionsDelay must be a number");return this._actionsDelay=e,this}},{key:"withCondition",value:function(e){return this._condition=e||{},this}},{key:"withActions",value:function(e){return this._actions=e||{},this}},{key:"withParameters",value:function(e){return this._parameters=e||[],this}},{key:"_composeElement",value:function(){return{identifier:this._identifier,name:this._name,active:this._active,mode:this._mode,type:this._type,severity:this._severity,description:this._description?this._description:void 0,parameters:this._parameters,condition:"EASY"===this._mode?this._condition:void 0,actionsDelay:this._actionsDelay,actions:"EASY"===this._mode?this._actions:void 0,javascript:"ADVANCED"===this._mode?this._javascript:void 0}}},{key:"_checkRequiredParameters",value:function(e){if(e){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel||void 0===this._active||void 0===this._mode)throw new Error("Parameters organization, channel, active, mode and identifier must be defined")}else if(void 0===this._name||void 0===this._organization||void 0===this._channel||void 0===this._active||void 0===this._mode)throw new Error("Parameters organization, channel, active, mode and name must be defined")}},{key:"_buildURL",value:function(){return"rules/"+this._resource+"/"+this._organization+"/channels/"+this._channel+"/"}},{key:"create",value:function(){return this._checkRequiredParameters(),this._doNorthPost(this._buildURL(),this._composeElement())}},{key:"update",value:function(){return this._checkRequiredParameters(!0),this._doNorthPut(this._buildURL()+this._identifier,this._composeElement())}},{key:"updateParameters",value:function(e){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel)throw new Error("Parameters organization, channel and identifier must be defined");return this._doNorthPut(this._buildURL()+this._identifier+"/parameters",e||this._parameters||[])}},{key:"delete",value:function(){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel)throw new Error("Parameters organization, channel and name must be defined");var e=h.default.defer(),t=e.promise;return this._ogapi.Napi.delete(this._buildURL()+this._identifier).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=p,t.exports=r.default},{"../provision/BaseProvision":235,"./_RuleCondition":256,"./_RuleNotification":257,q:117}],253:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"rules/catalog","rulesTemplate","Rule templates not found")}return i(t,e),o(t,[{key:"getTemplates",value:function(){return this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":138}],254:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"rules/provision/organizations","rules","Rule configurations not found")}return i(t,e),o(t,[{key:"findByOrganizationAndChannelAndName",value:function(e,t,r){var n=this;return n._organization=e,n._channel=t,n._name=r,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/channels/"+this._channel+"/"+this._name}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":138}],255:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../GenericFinder"),c=n(s),l=e("q"),f=n(l),d=e("http-status-codes"),h=n(d),p=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"rules"),this._jsHeaders={accept:"application/javascript"},this._mdHeaders={accept:"text/markdown"}}return o(t,e),a(t,[{key:"getdDummyFunctions",value:function(){return this._setExtraHeaders(this._jsHeaders),this._id="js/dummyFunctions",this._execute()}},{key:"getDocPrivateJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/private/javascriptFunctions",this._execute()}},{key:"getDocJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/javascriptFunctions",this._execute()}},{key:"_execute",value:function(){var e=f.default.defer(),t=e.promise,r=this._error_not_found;return this._api.get(this._composeUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){204===t.statusCode?e.reject({error:r,statusCode:h.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=p,t.exports=r.default},{"../GenericFinder":138,"http-status-codes":76,q:117}],256:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("./RuleConfigurations"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t,r){if(n(this,e),t.constructor!==a.default)throw new Error("Parent must be a RuleConfigurations");this._ruleConfiguration=t,this._condition=r}return i(e,[{key:"setDelay",value:function(e){if("number"!=typeof e||typeof e<1)throw new Error("Parameter delay must be typeof number and higher than -1");return void 0===this._condition.delay?console.warn("Parameter delay cannot be setted for this condition"):this._condition.delay=1e3*e,this}},{key:"deactivateDelay",value:function(){return void 0===this._condition.delay?console.warn("Parameter delay cannot be setted for this condition"):this._condition.delay=-1,this}},{key:"setParameterValue",value:function(e,t){var r=this;if(this._condition.parameters&&this._condition.parameters.length>0){for(var n in this._condition.parameters){var i=this._condition.parameters[n];if(i.name===e){if(void 0===i.value)throw new Error("Value not allowed for parameter "+e+" in condition "+this._condition.name);return i.value=t||"",r}}throw new Error("Parameter "+e+" not exists for condition "+this._condition.name)}}},{key:"parent",value:function(){return this._ruleConfiguration}}]),e}();r.default=u,t.exports=r.default},{"./RuleConfigurations":252}],257:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("./RuleConfigurations"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t,r){if(n(this,e),t.constructor!==a.default)throw new Error("Parent must be a RuleConfigurations");this._ruleConfiguration=t,this._notification=r}return i(e,[{key:"setEnabled",value:function(e){if("boolean"!=typeof e)throw new Error("Bearer enabled must be true or false");return this._notification.enabled=e,this}},{key:"setBearerRecipients",value:function(e,t){var r=this;if(this._notification.bearers&&this._notification.bearers.length>0){for(var n in this._notification.bearers){var i=this._notification.bearers[n];if(i.name===e)return i.recipients=t,r}console.warn("Bearer "+e+" not exists for notification "+this._notification.name)}else console.warn("There is no bearers for notification "+this._notification.name);return r}},{key:"enableBearer",value:function(e){var t=this;if(this._notification.bearers&&this._notification.bearers.length>0){for(var r in this._notification.bearers){var n=this._notification.bearers[r];if(n.name===e)return n.enabled=!0,t}console.warn("Bearer "+e+" not exists for notification "+this._notification.name)}else console.warn("There is no bearers for notification "+this._notification.name);return t}},{key:"disableBearer",value:function(e){var t=this;if(this._notification.bearers&&this._notification.bearers.length>0){for(var r in this._notification.bearers){var n=this._notification.bearers[r];if(n.name===e)return n.enabled=!1,t}console.warn("Bearer "+e+" not exists for notification "+this._notification.name)}else console.warn("There is no bearers for notification "+this._notification.name);return t}},{key:"parent",value:function(){return this._ruleConfiguration}}]),e}();r.default=u,t.exports=r.default},{"./RuleConfigurations":252}],258:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./Search"),c=n(s),l=e("q"),f=n(l),d=function(e){function t(e,r,n,o,a,s,c,l,f){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,o,a,s,c,l,f)}return o(t,e),a(t,[{key:"execute",value:function(){var e=f.default.defer(),t=e.promise,r=this._getUrlParameters();return this._ogapi.Napi.post(this._resource,this._filter(),this._timeout,this._getExtraHeaders(),r).then(function(t){var r=t.body,n=t.statusCode;200===n&&(r.assets=r.entities,delete r.entities),e.resolve({data:r,statusCode:n})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=d,t.exports=r.default},{"./Search":263,q:117}],259:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("q"),u=n(a),s=e("merge"),c=(n(s),function(){function e(t,r,n,o){if(i(this,e),this.constructor===e)throw new Error("Cannot construct Abstract instances directly");if("function"!=typeof this._filter)throw new Error("Must override method: filter");this._timeout="number"!=typeof n?t.Napi._options.timeout:n,this._ogapi=t,this._resource=r,this._headers=void 0,this._urlParameters=void 0,this._serviceBaseURL=o}return o(e,[{key:"_getExtraHeaders",value:function(){return this._headers}},{key:"_setExtraHeaders",value:function(e){if(this._headers)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._headers[n]=e[n]}else this._headers=e}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this._urlParameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"execute",value:function(){
|
|
33
|
+
var e=u.default.defer(),t=e.promise;return this._ogapi.Napi.post(this._resource,this._filter(),this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then(function(t){var r=t.body,n=t.statusCode;e.resolve({data:r,statusCode:n})}).catch(function(t){e.reject(t)}),t}},{key:"downloadCsv",value:function(){var e=u.default.defer(),t=e.promise,r=this._filter();return r&&r.limit&&delete r.limit,this._setExtraHeaders({Accept:"text/plain"}),this._ogapi.Napi.post(this._resource,r,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then(function(t){var r=t,n=t.statusCode;e.resolve({data:r,statusCode:n})}).catch(function(t){e.reject(t)}),t}},{key:"_asyncPagingFilter",value:function(){var e=this._filter();return e.limit&&e.limit.size?e.limit.start=1:e.limit={size:1e3,start:1},e}},{key:"cancelAsyncPaging",value:function(e){"string"==typeof e&&e.length>0?this.cancel=e:this.cancel=!0}},{key:"_loadData",value:function(e){function t(){if(r.cancel||"string"==typeof r.cancel){var a="string"==typeof r.cancel?r.cancel:"Cancel process";n.reject({data:a,statusCode:403})}else r._ogapi.Napi.post(r._resource,i,r._timeout,r._getExtraHeaders(),r._getUrlParameters(),r._getServiceBaseURL()).then(function(r){var a=r.statusCode,u=r.body;if(!u&&r.text)try{var s=JSON.parse(r.text);s&&(u=s)}catch(e){console.error("Impossible to parse text from response")}if(200===a||200===a){o=!0;var c=u.data?u.data[e]:u[e];n.notify(c),c.length===i.limit.size?(i.limit.start+=1,t()):n.resolve({data:"DONE",statusCode:200})}else o?n.resolve({data:"DONE",statusCode:200}):n.reject({data:u,statusCode:a})}).catch(function(e){n.reject(e)})}var r=this,n=u.default.defer(),i=r._asyncPagingFilter(),o=!1;return t(),n.promise}},{key:"executeWithAsyncPaging",value:function(e){var t=u.default.defer(),r=t.promise;return this._loadData(e).then(function(e){t.resolve(e)},null,function(e){t.notify(e)}).catch(function(e){t.reject(e)}),r}},{key:"_getServiceBaseURL",value:function(){return this._serviceBaseURL}}]),e}());r.default=c,t.exports=r.default},{merge:112,q:117}],260:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./Search"),c=n(s),l=e("q"),f=n(l),d=function(e){function t(e,r,n,o,a,s,c,l,f){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,o,a,s,c,l,f)}return o(t,e),a(t,[{key:"execute",value:function(){var e=f.default.defer(),t=e.promise,r=this._getUrlParameters();return this._ogapi.Napi.post(this._resource,this._filter(),this._timeout,this._getExtraHeaders(),r).then(function(t){var n=t.body,i=t.statusCode;if(200===i&&n.entities){if(n.devices=n.entities,n.devices.length>0){var o=!1,a=r&&r.flattened||!1;for(o=0;o<n.devices.length;o++)if(a){if(n.devices[o]["device.identifier"]){var u=n.devices[o]["device.identifier"];(!u._value||u._value&&!u._value._current)&&delete n.devices[o]["device.identifier"]}}else n.devices[o].device&&n.devices[o].device.identifier&&!n.devices[o].device.identifier._current&&delete n.devices[o].device.identifier}delete n.entities}e.resolve({data:n,statusCode:i})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=d,t.exports=r.default},{"./Search":263,q:117}],261:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./Search"),c=n(s),l=e("q"),f=n(l),d=function(e){function t(e,r,n,o,a,s,c,l,f){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,o,a,s,c,l,f)}return o(t,e),a(t,[{key:"execute",value:function(){var e=f.default.defer(),t=e.promise,r=this._getUrlParameters();return this._ogapi.Napi.post(this._resource,this._filter(),this._timeout,this._getExtraHeaders(),r).then(function(t){var n=t.body,i=t.statusCode;if(200===i&&n.entities&&n.entities.length>0){var o=!1,a=r&&r.flattened||!1;for(o=0;o<n.entities.length;o++)if(a){if(n.entities[o]["device.identifier"]){var u=n.entities[o]["device.identifier"];(!u._value||u._value&&!u._value._current)&&delete n.entities[o]["device.identifier"]}}else n.entities[o].device&&n.entities[o].device.identifier&&!n.entities[o].device.identifier._current&&delete n.entities[o].device.identifier}e.resolve({data:n,statusCode:i})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=d,t.exports=r.default},{"./Search":263,q:117}],262:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("./../util/Expression"),a=(function(e){e&&e.__esModule}(o),function(){function e(){n(this,e),this._filterTemplate={filter:{}}}return i(e,[{key:"or",value:function(){void 0===this._filterTemplate.filter.or&&(this._filterTemplate.filter.or=[]),void 0!==this._filterTemplate.filter.and&&(console.warn('The filter not allow both elements [and,or], the item "and" are going to be removed.'),delete this._filterTemplate.filter.and);for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0;n<t.length;n++)this._filterTemplate.filter.or.push(t[n]);return this}},{key:"and",value:function(){void 0===this._filterTemplate.filter.and&&(this._filterTemplate.filter.and=[]),void 0!==this._filterTemplate.filter.or&&(console.warn('The filter not allow both elements [and,or], the item "or" are going to be removed.'),delete this._filterTemplate.filter.or);for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0;n<t.length;n++)this._filterTemplate.filter.and.push(t[n]);return this}}]),e}());r.default=a,t.exports=r.default},{"./../util/Expression":339}],263:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./BaseSearch"),c=n(s),l=e("merge"),f=n(l),d=function(e){function t(e,r,n,o,a,s,c,l,d){void 0===o&&(o={limit:{}}),i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"search"+r,l),this._setUrlParameters(d),this._postObj=(0,f.default)(n,o,s,c),"object"==typeof a&&(this._postObj=(0,f.default)(this._postObj,a))}return o(t,e),a(t,[{key:"_filter",value:function(){return this._postObj}}]),t}(c.default);r.default=d,t.exports=r.default},{"./BaseSearch":259,merge:112}],264:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./BaseSearch"),c=n(s),l=e("merge"),f=n(l),d=function(e){function t(e,r,n,o,a,s,c,l){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"search"+r,c),this._setUrlParameters(l),this._postObj=(0,f.default)(n,a,s),"object"==typeof o&&(this._postObj=(0,f.default)(this._postObj,o))}return o(t,e),a(t,[{key:"_filter",value:function(){return this._postObj}}]),t}(c.default);r.default=d,t.exports=r.default},{"./BaseSearch":259,merge:112}],265:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("./../util/SelectElement"),a=(function(e){e&&e.__esModule}(o),function(){function e(){n(this,e),this._selectTemplate={select:[]}}return i(e,[{key:"add",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0;n<t.length;n++){var i=t[n],o=this._selectTemplate.select;if(0===o.length)this._selectTemplate.select.push(i);else{for(var a=!1,u=0;u<o.length;u++){var s=o[u];if(s.name===i.name){a=!0;for(var c=i.fields,l=0;l<c.length;l++){for(var f=c[n],d=!1,h=0;h<s.fields.length;h++)s.fields[h].field===f.field&&(d=!0,f.alias&&(s.fields[h].alias=f.alias));d||this._selectTemplate.select[u].fields.push(f)}}}a||this._selectTemplate.select.push(i)}}return this}}]),e}());r.default=a,t.exports=r.default},{"./../util/SelectElement":341}],266:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./Search"),c=n(s),l=e("q"),f=n(l),d=function(e){function t(e,r,n,o,a,s){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/catalog"+r,n,null,null,o),this._contentType=a,this._customFilters=s}return o(t,e),a(t,[{key:"execute",value:function(){var e=this,t=[],r=f.default.defer(),n=r.promise,i=e._content(e._contentType),o=e._customFilters&&e._customFilters.entityType,a=Object.keys(e._customFilters).length,u=a>1||1===a&&!o,s={};switch(o?s[o]=i[o]:s=i,e._contentType){case"operationalStatus":for(var c in s)s[c].forEach(function(r){(!e._customFilters.id||e._customFilters.id&&e._customFilters.id===r)&&t.push({entityType:c,id:r})});break;case"administrativeState":var l=function(e){var r=e;r.entityType=d,t.push(r)};for(var d in s){var h=s[d];for(var p in h)if(u){for(var y in e._customFilters)if(h[p][y]===e._customFilters[y]){l(h[p]);break}}else l(h[p])}break;case"fieldsDefinition":case"communicationsModuleType":var m=u&&e._customFilters.type;if(void 0===m){r.resolve({error:"Filters not allowed",statusCode:400});break}var v=m?s[m]:s;t=v;break;case"userProfile":for(var _ in s)(!e._customFilters.id||e._customFilters.id&&e._customFilters.id===_)&&s[_].length>0&&t.push({id:_,managed:s[_]});break;case"serviceGroups":o&&(t=s[o]);break;case"allowedResourceType":for(var g in s)(!e._customFilters.type||e._customFilters.type&&s[g].types.indexOf(e._customFilters.type)>-1)&&t.push(s[g].resourceType);break;case"ticketSeverity":case"ticketPriority":case"ticketStatus":case"ruleConfigurationSeverity":case"ruleMode":case"ruleType":case"ioTDatastreamPeriod":case"ioTDatastreamAccess":case"resourceType":case"countryCodes":case"timezones":case"userLanguages":case"ioTDatastreamStoragePeriod":if(m){r.resolve({error:"Filters not supported",statuscode:400});break}t=t.concat(s);break;default:r.resolve({data:{},statusCode:400})}if(t&&Object.keys(t).length>0){var b={};b[e._contentType]=t,r.resolve({data:b,statusCode:200})}else r.resolve({data:{},statusCode:204});return n}},{key:"_content",value:function(e){return{ticketSeverity:["CRITICAL","URGENT","WARNING","NORMAL"],ticketPriority:["MAJOR","MINOR","CRITICAL","BLOCKER"],ticketStatus:["CREATED","ASSIGNED","ANSWERED","RESTORED","RESOLVED","CLOSED"],serviceGroups:{ASSET:["noUpdate","emptyServiceGroup","emptyServiceGroup_onSession","emptyServiceGroup_onDemand","level1SecurityServiceGroup","level2SecurityServiceGroup","level3SecurityServiceGroup","trustedNoneSecurityServiceGroup","trustedNoneSecurityServiceGroup_onDemand","trustedLevel1SecurityServiceGroup","trustedLevel2SecurityServiceGroup","trustedLevel3SecurityServiceGroup"],SUBSCRIBER:["emptyServiceGroup"],SUBSCRIPTION:["emptyServiceGroup"],GATEWAY:["noUpdate","emptyServiceGroup","emptyServiceGroup_onSession","emptyServiceGroup_onDemand","level1SecurityServiceGroup","level2SecurityServiceGroup","level3SecurityServiceGroup","trustedNoneSecurityServiceGroup","trustedNoneSecurityServiceGroup_onDemand","trustedLevel1SecurityServiceGroup","trustedLevel2SecurityServiceGroup","trustedLevel3SecurityServiceGroup"]},administrativeState:{ASSET:[{id:"BANNED",description:"Asset banned, It means that received information of this asset is not going to be collected"},{id:"DELETED",description:"Asset removed from available stock"},{id:"IN_MAINTENANCE",description:"Asset in maintenance"},{id:"IN_STOCK",description:"Asset in stock"},{id:"IN_TRANSIT",description:"Asset in transit"},{id:"IN_USE",description:"Asset in use"},{id:"MISSING",description:"Asset missing"},{id:"ORDERED",description:"Asset ordered"},{id:"READY",description:"Asset ready for installation"},{id:"RETIRED",description:"Field entity withdrawal"}],GATEWAY:[{id:"REQUESTED",description:"Entity requested to the supplier"},{id:"READY",description:"Entity ready for installation"},{id:"REPAIR",description:"Entity under repair"},{id:"TESTING",description:"Entity in tests"},{id:"ACTIVE",description:"Field deployed entity"},{id:"SUSPENDED",description:"Suspended its operation"},{id:"DELETED",description:"Entity removed from available stock"},{id:"RETIRED",description:"Field entity withdrawal"},{id:"BANNED",description:"Entity banned, It means that received information of this entity is not going to be collected"}],COMMUNICATIONS_MODULE:[{id:"REQUESTED",description:"Entity requested to the supplier"},{id:"READY",description:"Entity ready for installation"},{id:"REPAIR",description:"Entity under repair"},{id:"TESTING",description:"Entity in tests"},{id:"ACTIVE",description:"Field deployed entity"},{id:"SUSPENDED",description:"Suspended its operation"},{id:"DELETED",description:"Entity removed from available stock"},{id:"RETIRED",description:"Field entity withdrawal"},{id:"BANNED",description:"Entity banned, It means that received information of this entity is not going to be collected"}],SUBSCRIBER:[{id:"REQUESTED",description:"Entity requested to the supplier"},{id:"READY",description:"Entity ready for installation"},{id:"REPAIR",description:"Entity under repair"},{id:"TESTING",description:"Entity in tests"},{id:"ACTIVE",description:"Field deployed entity"},{id:"SUSPENDED",description:"Suspended its operation"},{id:"DELETED",description:"Entity removed from available stock"},{id:"RETIRED",description:"Field entity withdrawal"},{id:"BANNED",description:"Entity banned, It means that received information of this entity is not going to be collected"}],SUBSCRIPTION:[{id:"REQUESTED",description:"Entity requested to the supplier"},{id:"READY",description:"Entity ready for installation"},{id:"REPAIR",description:"Entity under repair"},{id:"TESTING",description:"Entity in tests"},{id:"ACTIVE",description:"Field deployed entity"},{id:"SUSPENDED",description:"Suspended its operation"},{id:"DELETED",description:"Entity removed from available stock"},{id:"RETIRED",description:"Field entity withdrawal"},{id:"BANNED",description:"Entity banned, It means that received information of this entity is not going to be collected"}],CERTIFICATE:[{id:"NOT_ACTIVE",description:"NOT_ACTIVE"},{id:"ACTIVE",description:"ACTIVE"},{id:"REVOKED",description:"REVOKED"},{id:"EXPIRED",description:"EXPIRED"}]},operationalStatus:{ASSET:["UNKNOWN","NORMAL","ALARM","DOWN","SAFE_MODE","TAMPER","TEST"],GATEWAY:["UNKNOWN","NORMAL","ALARM","DOWN","SAFE_MODE","TAMPER","TEST"],COMMUNICATIONS_MODULE:["UNKNOWN","STOPPED","STARTING","RUNNING","STOPPING","ERROR"]},communicationsModuleType:{ADSL:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","subscriptionName","administrativeState","description","ADDRESS","HOME_OPERATOR","LOCATION"]}},CAN:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},ETH:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["subscriptionName","description","administrativeState","ADDRESS"]}},GENERIC:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","subscriptionName","description","administrativeState","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","subscriberName","description","administrativeState","ICC","SERIAL_NUMBER"]}},GSM:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","subscriptionName","description","administrativeState","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","subscriberName","description","administrativeState","ICC"]}},HAN:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},I2C:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},LOWPAN:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["administrativeState","subscriptionName","description"]}},LTE_M:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","subscriptionName","administrativeState","description","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION","RADIUS_USERNAME","RADIUS_PASSWORD","RADIUS_FRAMED_IP_NETMASK","MSISDN_VOICE"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","subscriberName","administrativeState","description","ICC"]}},MESH:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]}},MOBILE:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","subscriptionName","administrativeState","description","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION","RADIUS_USERNAME","RADIUS_PASSWORD","RADIUS_FRAMED_IP_NETMASK","MSISDN_VOICE","SUBSCRIPTION_ICC"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","subscriberName","administrativeState","description","ICC"]}},MULTIMOBILE:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","subscriptionName","administrativeState","description","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION","RADIUS_USERNAME","RADIUS_PASSWORD","RADIUS_FRAMED_IP_NETMASK","MSISDN_VOICE","SUBSCRIPTION_ICC"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","subscriberName","administrativeState","description","ICC"]}},NARROWBAND:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["administrativeState","subscriptionName","description","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","LOCATION"]},SUBSCRIBER:{mandatory:["generatedEntityKey"],optional:["administrativeState","subscriberName","description","ICC"]}},PLC:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["administrativeState","subscriptionName","description"]}},RS232:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},RS422:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},RS485:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},SIGFOX:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:["PAC"]},SUBSCRIPTION:{mandatory:["generatedEntityKey","subscriptionName","HOME_OPERATOR","administrativeState","description","SIGFOX_DEVICE_TYPE"]}},ZIGBEE:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["administrativeState","subscriptionName","description"]}}},ruleMode:["EASY","ADVANCED"],ruleType:["DATASTREAM","OPERATION","EVENT"],ruleConfigurationSeverity:["INFORMATIVE","URGENT","CRITICAL"],userProfile:{root:["admin_domain","admin","advanced","viewer","super_admin_domain"],super_admin_domain:["admin_domain","admin","advanced","viewer"],admin_domain:["admin_domain","admin","advanced","viewer"],admin:["admin","advanced","viewer"],advanced:[],viewer:[]},ioTDatastreamAccess:["READ","WRITE"],ioTDatastreamStoragePeriod:["SECONDS","MINUTES","HOURS","DAYS","MONTHS","YEARS","NEVER"],ioTDatastreamPeriod:["PULSE","CUMULATIVE","INSTANT"],resourceType:[{identifier:"entity.asset"},{identifier:"entity.device"},{identifier:"entity.subscriber"},{identifier:"entity.subscription"},{identifier:"ticket"}],allowedResourceType:[{resourceType:"entity.asset",types:["entity","asset"]},{resourceType:"entity.device",types:["entity","device"]},{resourceType:"entity.subscriber",types:["entity","subscriber"]},{resourceType:"entity.subscription",types:["entity","subscription"]},{resourceType:"ticket",types:["ticket"]},{resourceType:"organization",types:["organization"]},{resourceType:"channel",types:["channel"]}],fieldsDefinition:{string:{description:"Text based value",subtype:["text","password"]},boolean:{description:"Boolean based value",subtype:[]},calendar:{description:"Format is described in the ISO 8601 or in http://www.w3.org/TR/NOTE-datetime",subtype:["datetime","date","time"]},address:{description:"Network address value",subtype:["ip","ipv4","ipv6","mac48"]},number:{description:"Numeric value",subtype:["integer","float","percentage"]},enumeration:{description:"Choice list values",subtype:["string","number"]},array:{description:"Array of values",subtype:["string","number"]},coordinates:{description:"Object indicating coordinates and timestamp in geotime subtype",subtype:["geo","geotime","geojson"]},topology:{description:"Object indicating relations",subtype:["path","tree (not supported yet)"]},object:{description:"Not yet supported. For future uses only",subtype:[]}},userLanguages:[{code:"es",language:"Español/Spanish"},{code:"en",language:"Inglés/English"},{code:"pt",language:"Portugués/Portuguese"}],countryCodes:[{code:"AD",country:"Andorra",zone:"Europe/Andorra"},{code:"AE",country:"United Arab Emirates",zone:"Asia/Dubai"},{code:"AF",country:"Afghanistan",zone:"Asia/Kabul"},{code:"AG",country:"Antigua and Barbuda",zone:"America/Antigua"},{code:"AI",country:"Anguilla",zone:"America/Anguilla"},{code:"AL",country:"Albania",zone:"Europe/Tirane"},{code:"AM",country:"Armenia",zone:"Asia/Yerevan"},{code:"AN",country:"Netherlands Antilles",zone:"Netherlands Antilles"},{code:"AO",country:"Angola",zone:"Africa/Luanda"},{code:"AQ",country:"Antarctica",zone:"Antarctica/McMurdo"},{code:"AR",country:"Argentina",zone:"America/Argentina/Buenos_Aires"},{code:"AS",country:"American Samoa",zone:"Pacific/Pago_Pago"},{code:"AT",country:"Austria",zone:"Europe/Vienna"},{code:"AU",country:"Australia",zone:"Australia/Lord_Howe"},{code:"AW",country:"Aruba",zone:"America/Aruba"},{code:"AX",country:"Aland Islands",zone:"Europe/Mariehamn"},{code:"AZ",country:"Azerbaijan",zone:"Asia/Baku"},{code:"BA",country:"Bosnia and Herzegovina",zone:"Europe/Sarajevo"},{code:"BB",country:"Barbados",zone:"America/Barbados"},{code:"BD",country:"Bangladesh",zone:"Asia/Dhaka"},{code:"BE",country:"Belgium",zone:"Europe/Brussels"},{code:"BF",country:"Burkina Faso",zone:"Africa/Ouagadougou"},{code:"BG",country:"Bulgaria",zone:"Europe/Sofia"},{code:"BH",country:"Bahrain",zone:"Asia/Bahrain"},{code:"BI",country:"Burundi",zone:"Africa/Bujumbura"},{code:"BJ",country:"Benin",zone:"Africa/Porto-Novo"},{code:"BL",country:"Saint Barthélemy",zone:"America/St_Barthelemy"},{code:"BM",country:"Bermuda",zone:"Atlantic/Bermuda"},{code:"BN",country:"Brunei",zone:"Asia/Brunei"},{code:"BO",country:"Bolivia",zone:"America/La_Paz"},{code:"BQ",country:"Bonaire, Saint Eustatius and Saba",zone:"America/Kralendijk"},{code:"BR",country:"Brazil",zone:"America/Noronha"},{code:"BS",country:"Bahamas",zone:"America/Nassau"},{code:"BT",country:"Bhutan",zone:"Asia/Thimphu"},{code:"BV",country:"Bouvet Island",zone:"Bouvet Island"},{code:"BW",country:"Botswana",zone:"Africa/Gaborone"},{code:"BY",country:"Belarus",zone:"Europe/Minsk"},{code:"BZ",country:"Belize",zone:"America/Belize"},{code:"CA",country:"Canada",zone:"America/St_Johns"},{code:"CC",country:"Cocos Islands",zone:"Indian/Cocos"},{code:"CD",country:"Democratic Republic of the Congo",zone:"Africa/Kinshasa"},{code:"CF",country:"Central African Republic",zone:"Africa/Bangui"},{code:"CG",country:"Republic of the Congo",zone:"Africa/Brazzaville"},{code:"CH",country:"Switzerland",zone:"Europe/Zurich"},{code:"CI",country:"Ivory Coast",zone:"Africa/Abidjan"},{code:"CK",country:"Cook Islands",zone:"Pacific/Rarotonga"},{code:"CL",country:"Chile",zone:"America/Santiago"},{code:"CM",country:"Cameroon",zone:"Africa/Douala"},{code:"CN",country:"China",zone:"Asia/Shanghai"},{code:"CO",country:"Colombia",zone:"America/Bogota"},{code:"CR",country:"Costa Rica",zone:"America/Costa_Rica"},{code:"CS",country:"Serbia and Montenegro",zone:"Serbia and Montenegro"},{code:"CU",country:"Cuba",zone:"America/Havana"},{code:"CV",country:"Cape Verde",zone:"Atlantic/Cape_Verde"},{code:"CW",country:"Curaçao",zone:"America/Curacao"},{code:"CX",country:"Christmas Island",zone:"Indian/Christmas"},{code:"CY",country:"Cyprus",zone:"Asia/Nicosia"},{code:"CZ",country:"Czech Republic",zone:"Europe/Prague"},{code:"DE",country:"Germany",zone:"Europe/Berlin"},{code:"DJ",country:"Djibouti",zone:"Africa/Djibouti"},{code:"DK",country:"Denmark",zone:"Europe/Copenhagen"},{code:"DM",country:"Dominica",zone:"America/Dominica"},{code:"DO",country:"Dominican Republic",zone:"America/Santo_Domingo"},{code:"DZ",country:"Algeria",zone:"Africa/Algiers"},{code:"EC",country:"Ecuador",zone:"America/Guayaquil"},{code:"EE",country:"Estonia",zone:"Europe/Tallinn"},{code:"EG",country:"Egypt",zone:"Africa/Cairo"},{code:"EH",country:"Western Sahara",zone:"Africa/El_Aaiun"},{code:"ER",country:"Eritrea",zone:"Africa/Asmara"},{code:"ES",country:"Spain",zone:"Europe/Madrid"},{code:"ET",country:"Ethiopia",zone:"Africa/Addis_Ababa"},{code:"FI",country:"Finland",zone:"Europe/Helsinki"},{code:"FJ",country:"Fiji",zone:"Pacific/Fiji"},{code:"FK",country:"Falkland Islands",zone:"Atlantic/Stanley"},{code:"FM",country:"Micronesia",zone:"Pacific/Chuuk"},{code:"FO",country:"Faroe Islands",zone:"Atlantic/Faroe"},{code:"FR",country:"France",zone:"Europe/Paris"},{code:"GA",country:"Gabon",zone:"Africa/Libreville"},{code:"GB",country:"United Kingdom",zone:"Europe/London"},{code:"GD",country:"Grenada",zone:"America/Grenada"},{code:"GE",country:"Georgia",zone:"Asia/Tbilisi"},{code:"GF",country:"French Guiana",zone:"America/Cayenne"},{code:"GG",country:"Guernsey",zone:"Europe/Guernsey"},{code:"GH",country:"Ghana",zone:"Africa/Accra"},{code:"GI",country:"Gibraltar",zone:"Europe/Gibraltar"},{code:"GL",country:"Greenland",zone:"America/Godthab"},{code:"GM",country:"Gambia",zone:"Africa/Banjul"},{code:"GN",country:"Guinea",zone:"Africa/Conakry"},{code:"GP",country:"Guadeloupe",zone:"America/Guadeloupe"},{code:"GQ",country:"Equatorial Guinea",zone:"Africa/Malabo"},{code:"GR",country:"Greece",zone:"Europe/Athens"},{code:"GS",country:"South Georgia and the South Sandwich Islands",zone:"Atlantic/South_Georgia"},{code:"GT",country:"Guatemala",zone:"America/Guatemala"},{code:"GU",country:"Guam",zone:"Pacific/Guam"},{code:"GW",country:"Guinea-Bissau",zone:"Africa/Bissau"},{code:"GY",country:"Guyana",zone:"America/Guyana"},{code:"HK",country:"Hong Kong",zone:"Asia/Hong_Kong"},{code:"HM",country:"Heard Island and McDonald Islands",
|
|
34
|
+
zone:"Heard Island and McDonald Islands"},{code:"HN",country:"Honduras",zone:"America/Tegucigalpa"},{code:"HR",country:"Croatia",zone:"Europe/Zagreb"},{code:"HT",country:"Haiti",zone:"America/Port-au-Prince"},{code:"HU",country:"Hungary",zone:"Europe/Budapest"},{code:"ID",country:"Indonesia",zone:"Asia/Jakarta"},{code:"IE",country:"Ireland",zone:"Europe/Dublin"},{code:"IL",country:"Israel",zone:"Asia/Jerusalem"},{code:"IM",country:"Isle of Man",zone:"Europe/Isle_of_Man"},{code:"IN",country:"India",zone:"Asia/Kolkata"},{code:"IO",country:"British Indian Ocean Territory",zone:"Indian/Chagos"},{code:"IQ",country:"Iraq",zone:"Asia/Baghdad"},{code:"IR",country:"Iran",zone:"Asia/Tehran"},{code:"IS",country:"Iceland",zone:"Atlantic/Reykjavik"},{code:"IT",country:"Italy",zone:"Europe/Rome"},{code:"JE",country:"Jersey",zone:"Europe/Jersey"},{code:"JM",country:"Jamaica",zone:"America/Jamaica"},{code:"JO",country:"Jordan",zone:"Asia/Amman"},{code:"JP",country:"Japan",zone:"Asia/Tokyo"},{code:"KE",country:"Kenya",zone:"Africa/Nairobi"},{code:"KG",country:"Kyrgyzstan",zone:"Asia/Bishkek"},{code:"KH",country:"Cambodia",zone:"Asia/Phnom_Penh"},{code:"KI",country:"Kiribati",zone:"Pacific/Tarawa"},{code:"KM",country:"Comoros",zone:"Indian/Comoro"},{code:"KN",country:"Saint Kitts and Nevis",zone:"America/St_Kitts"},{code:"KP",country:"North Korea",zone:"Asia/Pyongyang"},{code:"KR",country:"South Korea",zone:"Asia/Seoul"},{code:"KW",country:"Kuwait",zone:"Asia/Kuwait"},{code:"KY",country:"Cayman Islands",zone:"America/Cayman"},{code:"KZ",country:"Kazakhstan",zone:"Asia/Almaty"},{code:"LA",country:"Laos",zone:"Asia/Vientiane"},{code:"LB",country:"Lebanon",zone:"Asia/Beirut"},{code:"LC",country:"Saint Lucia",zone:"America/St_Lucia"},{code:"LI",country:"Liechtenstein",zone:"Europe/Vaduz"},{code:"LK",country:"Sri Lanka",zone:"Asia/Colombo"},{code:"LR",country:"Liberia",zone:"Africa/Monrovia"},{code:"LS",country:"Lesotho",zone:"Africa/Maseru"},{code:"LT",country:"Lithuania",zone:"Europe/Vilnius"},{code:"LU",country:"Luxembourg",zone:"Europe/Luxembourg"},{code:"LV",country:"Latvia",zone:"Europe/Riga"},{code:"LY",country:"Libya",zone:"Africa/Tripoli"},{code:"MA",country:"Morocco",zone:"Africa/Casablanca"},{code:"MC",country:"Monaco",zone:"Europe/Monaco"},{code:"MD",country:"Moldova",zone:"Europe/Chisinau"},{code:"ME",country:"Montenegro",zone:"Europe/Podgorica"},{code:"MF",country:"Saint Martin",zone:"America/Marigot"},{code:"MG",country:"Madagascar",zone:"Indian/Antananarivo"},{code:"MH",country:"Marshall Islands",zone:"Pacific/Majuro"},{code:"MK",country:"Macedonia",zone:"Europe/Skopje"},{code:"ML",country:"Mali",zone:"Africa/Bamako"},{code:"MM",country:"Myanmar",zone:"Asia/Yangon"},{code:"MN",country:"Mongolia",zone:"Asia/Ulaanbaatar"},{code:"MO",country:"Macao",zone:"Asia/Macau"},{code:"MP",country:"Northern Mariana Islands",zone:"Pacific/Saipan"},{code:"MQ",country:"Martinique",zone:"America/Martinique"},{code:"MR",country:"Mauritania",zone:"Africa/Nouakchott"},{code:"MS",country:"Montserrat",zone:"America/Montserrat"},{code:"MT",country:"Malta",zone:"Europe/Malta"},{code:"MU",country:"Mauritius",zone:"Indian/Mauritius"},{code:"MV",country:"Maldives",zone:"Indian/Maldives"},{code:"MW",country:"Malawi",zone:"Africa/Blantyre"},{code:"MX",country:"Mexico",zone:"America/Mexico_City"},{code:"MY",country:"Malaysia",zone:"Asia/Kuala_Lumpur"},{code:"MZ",country:"Mozambique",zone:"Africa/Maputo"},{code:"NA",country:"Namibia",zone:"Africa/Windhoek"},{code:"NC",country:"New Caledonia",zone:"Pacific/Noumea"},{code:"NE",country:"Niger",zone:"Africa/Niamey"},{code:"NF",country:"Norfolk Island",zone:"Pacific/Norfolk"},{code:"NG",country:"Nigeria",zone:"Africa/Lagos"},{code:"NI",country:"Nicaragua",zone:"America/Managua"},{code:"NL",country:"Netherlands",zone:"Europe/Amsterdam"},{code:"NO",country:"Norway",zone:"Europe/Oslo"},{code:"NP",country:"Nepal",zone:"Asia/Kathmandu"},{code:"NR",country:"Nauru",zone:"Pacific/Nauru"},{code:"NU",country:"Niue",zone:"Pacific/Niue"},{code:"NZ",country:"New Zealand",zone:"Pacific/Auckland"},{code:"OM",country:"Oman",zone:"Asia/Muscat"},{code:"PA",country:"Panama",zone:"America/Panama"},{code:"PE",country:"Peru",zone:"America/Lima"},{code:"PF",country:"French Polynesia",zone:"Pacific/Tahiti"},{code:"PG",country:"Papua New Guinea",zone:"Pacific/Port_Moresby"},{code:"PH",country:"Philippines",zone:"Asia/Manila"},{code:"PK",country:"Pakistan",zone:"Asia/Karachi"},{code:"PL",country:"Poland",zone:"Europe/Warsaw"},{code:"PM",country:"Saint Pierre and Miquelon",zone:"America/Miquelon"},{code:"PN",country:"Pitcairn",zone:"Pacific/Pitcairn"},{code:"PR",country:"Puerto Rico",zone:"America/Puerto_Rico"},{code:"PS",country:"Palestinian Territory",zone:"Asia/Gaza"},{code:"PT",country:"Portugal",zone:"Europe/Lisbon"},{code:"PW",country:"Palau",zone:"Pacific/Palau"},{code:"PY",country:"Paraguay",zone:"America/Asuncion"},{code:"QA",country:"Qatar",zone:"Asia/Qatar"},{code:"RE",country:"Reunion",zone:"Indian/Reunion"},{code:"RO",country:"Romania",zone:"Europe/Bucharest"},{code:"RS",country:"Serbia",zone:"Europe/Belgrade"},{code:"RU",country:"Russia",zone:"Europe/Kaliningrad"},{code:"RW",country:"Rwanda",zone:"Africa/Kigali"},{code:"SA",country:"Saudi Arabia",zone:"Asia/Riyadh"},{code:"SB",country:"Solomon Islands",zone:"Pacific/Guadalcanal"},{code:"SC",country:"Seychelles",zone:"Indian/Mahe"},{code:"SD",country:"Sudan",zone:"Africa/Khartoum"},{code:"SE",country:"Sweden",zone:"Europe/Stockholm"},{code:"SG",country:"Singapore",zone:"Asia/Singapore"},{code:"SH",country:"Saint Helena",zone:"Atlantic/St_Helena"},{code:"SI",country:"Slovenia",zone:"Europe/Ljubljana"},{code:"SJ",country:"Svalbard and Jan Mayen",zone:"Arctic/Longyearbyen"},{code:"SK",country:"Slovakia",zone:"Europe/Bratislava"},{code:"SL",country:"Sierra Leone",zone:"Africa/Freetown"},{code:"SM",country:"San Marino",zone:"Europe/San_Marino"},{code:"SN",country:"Senegal",zone:"Africa/Dakar"},{code:"SO",country:"Somalia",zone:"Africa/Mogadishu"},{code:"SR",country:"Suriname",zone:"America/Paramaribo"},{code:"SS",country:"South Sudan",zone:"Africa/Juba"},{code:"ST",country:"Sao Tome and Principe",zone:"Africa/Sao_Tome"},{code:"SV",country:"El Salvador",zone:"America/El_Salvador"},{code:"SX",country:"Sint Maarten",zone:"America/Lower_Princes"},{code:"SY",country:"Syria",zone:"Asia/Damascus"},{code:"SZ",country:"Swaziland",zone:"Africa/Mbabane"},{code:"TC",country:"Turks and Caicos Islands",zone:"America/Grand_Turk"},{code:"TD",country:"Chad",zone:"Africa/Ndjamena"},{code:"TF",country:"French Southern Territories",zone:"Indian/Kerguelen"},{code:"TG",country:"Togo",zone:"Africa/Lome"},{code:"TH",country:"Thailand",zone:"Asia/Bangkok"},{code:"TJ",country:"Tajikistan",zone:"Asia/Dushanbe"},{code:"TK",country:"Tokelau",zone:"Pacific/Fakaofo"},{code:"TL",country:"East Timor",zone:"Asia/Dili"},{code:"TM",country:"Turkmenistan",zone:"Asia/Ashgabat"},{code:"TN",country:"Tunisia",zone:"Africa/Tunis"},{code:"TO",country:"Tonga",zone:"Pacific/Tongatapu"},{code:"TR",country:"Turkey",zone:"Europe/Istanbul"},{code:"TT",country:"Trinidad and Tobago",zone:"America/Port_of_Spain"},{code:"TV",country:"Tuvalu",zone:"Pacific/Funafuti"},{code:"TW",country:"Taiwan",zone:"Asia/Taipei"},{code:"TZ",country:"Tanzania",zone:"Africa/Dar_es_Salaam"},{code:"UA",country:"Ukraine",zone:"Europe/Kiev"},{code:"UG",country:"Uganda",zone:"Africa/Kampala"},{code:"UM",country:"United States Minor Outlying Islands",zone:"Pacific/Midway"},{code:"US",country:"United States",zone:"America/New_York"},{code:"UY",country:"Uruguay",zone:"America/Montevideo"},{code:"UZ",country:"Uzbekistan",zone:"Asia/Samarkand"},{code:"VA",country:"Vatican",zone:"Europe/Vatican"},{code:"VC",country:"Saint Vincent and the Grenadines",zone:"America/St_Vincent"},{code:"VE",country:"Venezuela",zone:"America/Caracas"},{code:"VG",country:"British Virgin Islands",zone:"America/Tortola"},{code:"VI",country:"U.S. Virgin Islands",zone:"America/St_Thomas"},{code:"VN",country:"Vietnam",zone:"Asia/Ho_Chi_Minh"},{code:"VU",country:"Vanuatu",zone:"Pacific/Efate"},{code:"WF",country:"Wallis and Futuna",zone:"Pacific/Wallis"},{code:"WS",country:"Samoa",zone:"Pacific/Apia"},{code:"XK",country:"Kosovo",zone:"Kosovo"},{code:"YE",country:"Yemen",zone:"Asia/Aden"},{code:"YT",country:"Mayotte",zone:"Indian/Mayotte"},{code:"ZA",country:"South Africa",zone:"Africa/Johannesburg"},{code:"ZM",country:"Zambia",zone:"Africa/Lusaka"},{code:"ZW",country:"Zimbabwe",zone:"Africa/Harare"}],timezones:["ACT","AET","Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmara","Africa/Asmera","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Timbuktu","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","AGT","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/ComodRivadavia","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Atikokan","America/Atka","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Buenos_Aires","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Catamarca","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Coral_Harbour","America/Cordoba","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Ensenada","America/Fort_Nelson","America/Fort_Wayne","America/Fortaleza","America/Glace_Bay","America/Godthab","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Indianapolis","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Indianapolis","America/Inuvik","America/Iqaluit","America/Jamaica","America/Jujuy","America/Juneau","America/Kentucky/Louisville","America/Kentucky/Monticello","America/Knox_IN","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Louisville","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Mendoza","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montreal","America/Montserrat","America/Nassau","America/New_York","America/Nipigon","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Ojinaga","America/Panama","America/Pangnirtung","America/Paramaribo","America/Phoenix","America/Port_of_Spain","America/Port-au-Prince","America/Porto_Acre","America/Porto_Velho","America/Puerto_Rico","America/Rainy_River","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Rosario","America/Santa_Isabel","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Shiprock","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Thunder_Bay","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Virgin","America/Whitehorse","America/Winnipeg","America/Yakutat","America/Yellowknife","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/McMurdo","Antarctica/Palmer","Antarctica/Rothera","Antarctica/South_Pole","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","ART","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Ashkhabad","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Calcutta","Asia/Chita","Asia/Choibalsan","Asia/Chongqing","Asia/Chungking","Asia/Colombo","Asia/Dacca","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Gaza","Asia/Harbin","Asia/Hebron","Asia/Ho_Chi_Minh","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Istanbul","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Kashgar","Asia/Kathmandu","Asia/Katmandu","Asia/Khandyga","Asia/Kolkata","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macao","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qyzylorda","Asia/Rangoon","Asia/Riyadh","Asia/Saigon","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Tel_Aviv","Asia/Thimbu","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ujung_Pandang","Asia/Ulaanbaatar","Asia/Ulan_Bator","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yekaterinburg","Asia/Yerevan","AST","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faeroe","Atlantic/Faroe","Atlantic/Jan_Mayen","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/ACT","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Canberra","Australia/Currie","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/LHI","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/North","Australia/NSW","Australia/Perth","Australia/Queensland","Australia/South","Australia/Sydney","Australia/Tasmania","Australia/Victoria","Australia/West","Australia/Yancowinna","BET","Brazil/Acre","Brazil/DeNoronha","Brazil/East","Brazil/West","BST","Canada/Atlantic","Canada/Central","Canada/East-Saskatchewan","Canada/Eastern","Canada/Mountain","Canada/Newfoundland","Canada/Pacific","Canada/Saskatchewan","Canada/Yukon","CAT","CET","Chile/Continental","Chile/EasterIsland","CNT","CST","CST6CDT","CTT","Cuba","EAT","ECT","EET","Egypt","Eire","EST","EST5EDT","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belfast","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kiev","Europe/Kirov","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Nicosia","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Tiraspol","Europe/Ulyanovsk","Europe/Uzhgorod","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zaporozhye","Europe/Zurich","GB","GB-Eire","GMT","GMT0","Greenwich","Hongkong","HST","Iceland","IET","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Iran","Israel","IST","Jamaica","Japan","JST","Kwajalein","Libya","MET","Mexico/BajaNorte","Mexico/BajaSur","Mexico/General","MIT","MST","MST7MDT","Navajo","NET","NST","NZ","NZ-CHAT","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Chuuk","Pacific/Easter","Pacific/Efate","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Johnston","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Pohnpei","Pacific/Ponape","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Samoa","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Truk","Pacific/Wake","Pacific/Wallis","Pacific/Yap","PLT","PNT","Poland","Portugal","PRC","PRT","PST","PST8PDT","ROK","Singapore","SST","SystemV/AST4","SystemV/AST4ADT","SystemV/CST6","SystemV/CST6CDT","SystemV/EST5","SystemV/EST5EDT","SystemV/HST10","SystemV/MST7","SystemV/MST7MDT","SystemV/PST8","SystemV/PST8PDT","SystemV/YST9","SystemV/YST9YDT","Turkey","UCT","Universal","US/Alaska","US/Aleutian","US/Arizona","US/Central","US/East-Indiana","US/Eastern","US/Hawaii","US/Indiana-Starke","US/Michigan","US/Mountain","US/Pacific","US/Pacific-New","US/Samoa","UTC","VST","W-SU","WET","Zulu"]}[e]}}]),t}(c.default);r.default=d,t.exports=r.default},{"./Search":263,q:117}],267:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./BaseSearch"),c=n(s),l=e("merge"),f=n(l),d=e("q"),h=n(d),p=function(e){function t(e,r,n,o,a,s,c,l,d){void 0===o&&(o={limit:{}}),i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,l),this._setUrlParameters(d),this._postObj=(0,f.default)(n,o,s,c),"object"==typeof a&&(this._postObj=(0,f.default)(this._postObj,a))}return o(t,e),a(t,[{key:"_filter",value:function(){return this._postObj}},{key:"_loadData",value:function(e){function t(){if(r.cancel||"string"==typeof r.cancel){var e="string"==typeof r.cancel?r.cancel:"Cancel process";n.reject({data:e,statusCode:403})}else r._ogapi.Napi.post(r._resource,i,r._timeout,r._getExtraHeaders(),r._getUrlParameters()).then(function(e){var r=e.statusCode,a=e.body;if(!a&&e.text)try{var u=JSON.parse(e.text);u&&(a=u)}catch(t){console.warn("Impossible to parse text from response: "+e.text)}200===r?(o=!0,n.notify(a),a.data.length===i.limit.size?(i.limit.start+=1,t()):n.resolve({data:"DONE",statusCode:200})):o?n.resolve({data:"DONE",statusCode:200}):n.reject({data:a,statusCode:r})}).catch(function(e){n.reject(e)})}var r=this,n=h.default.defer(),i=r._asyncPagingFilter(),o=!1;return t(),n.promise}}]),t}(c.default);r.default=p,t.exports=r.default},{"./BaseSearch":259,merge:112,q:117}],268:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/administrativeState",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"administrativeState",this.customFilters)}},{key:"withId",value:function(e){if("string"!=typeof e)throw new Error("Parameter id must be a string");return this.customFilters.id=e,this}},{key:"withEntityType",value:function(e){if("string"!=typeof e)throw new Error("Parameter entityType must be a string");return this.customFilters.entityType=e,this}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":266,"./SearchBuilder":309}],269:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="$_token";r.TOKEN_URL=d;var h=function(e){function t(e){var r=arguments.length<=1||void 0===arguments[1]?new f.default(e,"/alarms"):arguments[1];return function(){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{onDevices:"/devices",onSubscriptions:"/subscriptions"},r),this._url="/entities"+d+"/alarms"}.apply(this,arguments)}return o(t,e),a(t,[{key:"_buildUrl",value:function(){for(var e in this._routes)this._builderParams[e]&&(this._url=this._url.replace(d,this._routes[e]));return this._url=this._url.replace(d,""),u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(c.default);r.default=h},{"../../util/searchingFields/FieldFinder":344,"./SearchWithSummaryBuilder":310}],270:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/allowedResourceType",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"allowedResourceType",this.customFilters)}},{key:"withType",value:function(e){if("string"!=typeof e)throw new Error("Parameter type must be a string");return this.customFilters.type=e.toLowerCase(),this}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":266,"./SearchBuilder":309}],271:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/areas",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"./SearchBuilder":309}],272:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./PreFilteredSearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d=e("../AssetSearch"),h=n(d),p="/entities",y=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,p)),this._url=p}return o(t,e),a(t,[{key:"summary",value:function(){return this._url=this._url+"/summary",this}},{key:"_buildFilter",value:function(){var e={and:[{exists:{"provision.asset.identifier":!0}}]};if(this._builderParams.filter&&Object.keys(this._builderParams.filter).length>0){var t=this._builderParams.filter;void 0!==t._filterTemplate?e.and.push(t._filterTemplate.filter):e.and.push(t)}return{filter:e}}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"build",value:function(){return new h.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}},{key:"select",value:function(e){return this._builderParams.select=e||void 0,this}}]),t}(c.default);r.default=y,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"../AssetSearch":258,"./PreFilteredSearchBuilder":305}],273:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("q"),u=n(a),s=e("merge"),c=(n(s),e("jsonpath")),l=n(c),f=function(){function e(t,r){i(this,e),this._ogapi=t,this._resource="resources/schemaTypes/og_basic_types",this._headers=void 0,this._og_basic_types={},this.publicParameters=!1,this._urlParameters=void 0}return o(e,[{key:"_getExtraHeaders",value:function(){return this._headers}},{key:"_setExtraHeaders",value:function(e){if(this._headers)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._headers[n]=e[n]}else this._headers=e}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this.parameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"execute",value:function(){var e=this,t=u.default.defer(),r=t.promise;return this._setExtraHeaders({Accept:"application/json"}),this._ogapi.Napi.get(this._resource,this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(r){var n=r.body,i=r.statusCode;if(e._og_basic_types=n,l.default.apply(e._og_basic_types,"$..['$ref']",function(e,t){var r="$.."+e.replace("#/definitions/","");return l.default.query(n,r)[0]}).forEach(function(e){var t=l.default.stringify(e.path);l.default.value(n,t,e.value)}),e.path){var o=e.path.includes("$")?e.path:"$.."+e.path,a=l.default.query(n,o)[0]||{msg:"not Found"};t.resolve({data:a,
|
|
35
|
+
statusCode:i})}else{if(e.publicParameters)for(var u in n.definitions)n.definitions[u].public&&!1!==n.definitions[u].public||delete n.definitions[u];t.resolve({data:n,statusCode:i})}}).catch(function(e){t.reject(e)}),r}},{key:"withPath",value:function(e){return this.path=e,this}},{key:"withPublicParameters",value:function(e){return this.publicParameters=e,this}},{key:"build",value:function(){return this}}]),e}();r.default=f,t.exports=r.default},{jsonpath:104,merge:112,q:117}],274:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d=e("../WPSearch"),h=n(d),p="provisionProcessors/bulk/search",y=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,p)),this._url=p}return o(t,e),a(t,[{key:"build",value:function(){return new h.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}}]),t}(c.default);r.default=y,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"../WPSearch":267,"./SearchBuilder":309}],275:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/bulk/async",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"./SearchBuilder":309}],276:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/bundles",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"./SearchBuilder":309}],277:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/certificates",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d,this._fetch=!1,this._assignable=!1}return o(t,e),a(t,[{key:"assignable",value:function(){return this._assignable=!0,this}},{key:"administrable",value:function(){return this._assignable=!1,this}},{key:"withFetch",value:function(e){if(!0!==e&&!1!==e)throw new Error("Flag fecth incorrect");return this._fetch=e,this}},{key:"_buildUrl",value:function(){var e=this._url;return!0===this._fetch&&(this._urlParams.fetch=1),!0===this._assignable&&(this._urlParams.visibility="assignable"),e}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"./SearchBuilder":309}],278:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/channels",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d,this._summary=!1}return o(t,e),a(t,[{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}},{key:"summary",value:function(){return this._summary=!0,this}},{key:"_buildUrl",value:function(){return this._summary&&(this._url=this._url+"/summary"),u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"./SearchWithSummaryBuilder":310}],279:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/communicationsModuleType",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"communicationsModuleType",this.customFilters)}},{key:"withType",value:function(e){if("string"!=typeof e)throw new Error("Parameter type must be a string");return this.customFilters.type=e,this}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":266,"./SearchBuilder":309}],280:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/countryCodes",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"countryCodes",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":266,"./SearchBuilder":309}],281:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/datamodels",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"./SearchBuilder":309}],282:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("merge"),f=n(l),d=e("moment"),h=n(d),p=e("../../util/searchingFields/FieldFinder"),y=n(p),m=e("../../util/DATE_FORMAT"),v="/datapoints",_=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new y.default(e,v)),this._url=v,this.fluentFilter=e.newFilterBuilder(),this.tagsFilter=[]}return o(t,e),a(t,[{key:"withDeviceId",value:function(e){if("string"!=typeof e)throw new Error("Parameter deviceId must be a string");return this.fluentFilter.and(this._parent.EX.eq("datapoint.device",e)),this}},{key:"withDatastream",value:function(e){if("string"!=typeof e)throw new Error("Parameter datastreamId must be a string");return this.fluentFilter.and(this._parent.EX.eq("datapoint.datastream",e)),this}},{key:"withFeed",value:function(e){if("string"!=typeof e)throw new Error("Parameter feedId must be a string");return this.fluentFilter.and(this._parent.EX.eq("datapoint.feed",e)),this}},{key:"betweenDates",value:function(e,t){if("object"!=typeof e||e.constructor!==Date)throw new Error("Parameter fromDate must be a Date");if(this.fluentFilter.and(this._parent.EX.gt("datapoint.at",(0,h.default)(e).format(m.DATE_FORMAT))),void 0!==t){if(t.constructor!==Date)throw new Error("Parameter toDate must be a Date");this.fluentFilter.and(this._parent.EX.lt("datapoint.at",(0,h.default)(t).format(m.DATE_FORMAT)))}return this}},{key:"_buildFilter",value:function(){var e={filter:{}},t=(0,f.default)(!0,this.fluentFilter),r=this._builderParams.filter;if(t=t._filterTemplate.filter,"object"==typeof r._filterTemplate&&(r=r._filterTemplate.filter),void 0!==r&&Object.keys(r).length>0&&void 0!==t&&Object.keys(t).length>0)throw new Error("Incompatible filters. You only can create a filter using fluent mode [betweenDates, addTag, withDatastreamId, withDeviceId] methods or custom filter [filter] method");return void 0!==r&&Object.keys(r).length>0?e.filter=r:void 0!==t&&Object.keys(t).length>0&&(e.filter=t),e}},{key:"select",value:function(e){return this._builderParams.select=e,this}}]),t}(c.default);r.default=_,t.exports=r.default},{"../../util/DATE_FORMAT":338,"../../util/searchingFields/FieldFinder":344,"./SearchBuilder":309,merge:112,moment:113}],283:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d=e("../EntitySearch"),h=n(d),p="$_token";r.TOKEN_URL=p;var y=function(e){function t(e,r,n){var o=arguments.length<=3||void 0===arguments[3]?new f.default(e,"/entities"):arguments[3];return function(){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{onDevices:"/"},o),this._url="/organizations/"+r+"/datasets/"+n+p}.apply(this,arguments)}return o(t,e),a(t,[{key:"flattened",value:function(){return this._urlParams.flattened=!0,this}},{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}},{key:"disableCaseSensitive",value:function(e){return this._urlParams.caseSensitive=e||!1,this}},{key:"removeCaseSensitive",value:function(){return this._urlParams&&delete this._urlParams.caseSensitive,this}},{key:"_buildUrl",value:function(){for(var e in this._routes)this._builderParams[e]&&(this._url=this._url.replace(p,this._routes[e]));return this._url=this._url.replace(p,""),u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e||[],this}},{key:"build",value:function(){return new h.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}}]),t}(c.default);r.default=y},{"../../util/searchingFields/FieldFinder":344,"../EntitySearch":261,"./SearchWithSummaryBuilder":310}],284:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d=e("../WPSearch"),h=n(d),p="datasets";r.BASE_URL=p;var y=function(e){function t(e,r,n){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,p,{organization:r,dataset:n})),this._url=p+"/provision/organizations/"+r+"/"+n+"/data"}return o(t,e),a(t,[{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e||[],this}},{key:"build",value:function(){return new h.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}}]),t}(c.default);r.default=y},{"../../util/searchingFields/FieldFinder":344,"../WPSearch":267,"./SearchBuilder":309}],285:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/catalog/datasets",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"./SearchBuilder":309}],286:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../Search"),l=(n(c),e("../../util/searchingFields/FieldFinder")),f=n(l),d="/datastreams",h=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d}return o(t,e),t}(s.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"../Search":263,"./SearchBuilder":309}],287:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/catalog/plans/device",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d}return o(t,e),a(t,[{key:"withDomain",value:function(e){if("string"!=typeof e)throw new Error("Parameter domainName must be a string");return this._domainName=e,this}},{key:"_buildUrl",value:function(){if(!this._domainName)throw new Error("Parameter domainName must be defined");return this._url=d+"?domainName="+this._domainName,u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"./SearchWithSummaryBuilder":310}],288:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./PreFilteredSearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/entities",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d}return o(t,e),a(t,[{key:"summary",value:function(){return this._url=this._url+"/summary",this}},{key:"_buildFilter",value:function(){var e={and:[{exists:{"provision.device.identifier":!0}}]};if(this._builderParams.filter&&Object.keys(this._builderParams.filter).length>0){var t=this._builderParams.filter;void 0!==t._filterTemplate?e.and.push(t._filterTemplate.filter):e.and.push(t)}return{filter:e}}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"./PreFilteredSearchBuilder":305}],289:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/domains",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d,this._summary=!1}return o(t,e),a(t,[{key:"summary",value:function(){return this._summary=!0,this}},{key:"_buildUrl",value:function(){return this._summary&&(this._url=this._url+"/summary"),u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"./SearchWithSummaryBuilder":310}],290:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d=e("../EntitySearch"),h=n(d),p="$_token";r.TOKEN_URL=p;var y=function(e){function t(e){var r=arguments.length<=1||void 0===arguments[1]?new f.default(e,"/entities"):arguments[1];return function(){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{onDevices:"/devices"},r),this._url="/entities"+p}.apply(this,arguments)}return o(t,e),a(t,[{key:"flattened",value:function(){return this._urlParams.flattened=!0,this}},{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}},{key:"disableCaseSensitive",value:function(e){return this._urlParams.caseSensitive=e||!1,this}},{key:"removeCaseSensitive",value:function(){return this._urlParams&&delete this._urlParams.caseSensitive,this}},{key:"_buildUrl",value:function(){for(var e in this._routes)this._builderParams[e]&&(this._url=this._url.replace(p,this._routes[e]));return this._url=this._url.replace(p,""),u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e||[],this}},{key:"build",value:function(){return new h.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}}]),t}(c.default);r.default=y},{"../../util/searchingFields/FieldFinder":344,"../EntitySearch":261,"./SearchWithSummaryBuilder":310}],291:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){
|
|
36
|
+
if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchWithSummaryBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/operations/history",d=function(e){function t(e){var r=arguments.length<=1||void 0===arguments[1]?new l.default(e,"/operations/history"):arguments[1];return function(){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},r),this._url="/entities"+f}.apply(this,arguments)}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"./SearchWithSummaryBuilder":310}],292:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="$_token";r.TOKEN_URL=d;var h=function(e){function t(e){var r=arguments.length<=1||void 0===arguments[1]?new f.default(e,"/operations"):arguments[1];return function(){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{onDevices:"/devices",onSubscribers:"/subscribers",onSubscriptions:"/subscriptions",onCommunicationsModules:"/communicationsModules"},r),this._url="/entities"+d+"/operations"}.apply(this,arguments)}return o(t,e),a(t,[{key:"_buildUrl",value:function(){this._checkConstraintRoutes();for(var e in this._routes)this._builderParams[e]&&(this._url=this._url.replace(d,this._routes[e]));return u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(c.default);r.default=h},{"../../util/searchingFields/FieldFinder":344,"./SearchWithSummaryBuilder":310}],293:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/feeds",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"./SearchBuilder":309}],294:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/fieldsDefinition",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"fieldsDefinition",this.customFilters)}},{key:"withType",value:function(e){if("string"!=typeof e)throw new Error("Parameter type must be a string");return this.customFilters.type=e,this}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":266,"./SearchBuilder":309}],295:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../DeviceSearch"),f=n(l),d=function(e){function t(e,r,n){if(i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n),this.constructor===t)throw new Error("Cannot construct Abstract instances directly")}return o(t,e),a(t,[{key:"flattened",value:function(){return this._urlParams.flattened=!0,this}},{key:"_buildUrl",value:function(){return u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}},{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../DeviceSearch":260,"./SearchBuilder":309}],296:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/catalog/hardwares",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d}return o(t,e),a(t,[{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e,this}},{key:"flattened",value:function(){return this._urlParams.flattened=!0,this}},{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"./SearchWithSummaryBuilder":310}],297:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ioTDatastreamAccess",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ioTDatastreamAccess",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":266,"./SearchBuilder":309}],298:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ioTDatastreamPeriod",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ioTDatastreamPeriod",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":266,"./SearchBuilder":309}],299:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ioTDatastreamStoragePeriod",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ioTDatastreamStoragePeriod",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":266,"./SearchBuilder":309}],300:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/catalog/operators",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"./SearchBuilder":309}],301:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d=e("../SearchWithoutLimit"),h=n(d),p="/operationTypes",y=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,p)),this._url=p}return o(t,e),a(t,[{key:"build",value:function(){try{return new h.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}catch(e){console.error("!errrrror!!!!!!",e)}}}]),t}(c.default);r.default=y,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"../SearchWithoutLimit":264,"./SearchBuilder":309}],302:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/operationalStatus",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"operationalStatus",this.customFilters)}},{key:"withId",value:function(e){if("string"!=typeof e)throw new Error("Parameter id must be a string");return this.customFilters.id=e,this}},{key:"withEntityType",value:function(e){if("string"!=typeof e)throw new Error("Parameter entityType must be a string");return this.customFilters.entityType=e,this}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":266,"./SearchBuilder":309}],303:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchWithSummaryBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/jobs",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"./SearchWithSummaryBuilder":310}],304:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/catalog/plans/organization",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d}return o(t,e),a(t,[{key:"withDomain",value:function(e){if("string"!=typeof e)throw new Error("Parameter domainName must be a string");return this._domainName=e,this}},{key:"_buildUrl",value:function(){if(!this._domainName)throw new Error("Parameter domainName must be defined");return this._url=d+"?domainName="+this._domainName,u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"./SearchWithSummaryBuilder":310}],305:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./FlattenedSearchBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e,r,i){if(n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,i),this.constructor===t)throw new Error("Cannot construct Abstract instances directly")}return i(t,e),o(t,[{key:"provisioned",value:function(){return this._provisioned=!0,this}},{key:"collected",value:function(){return this._collected=!0,this}},{key:"select",value:function(e){return this._builderParams.select=e||[],this}},{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}},{key:"disableCaseSensitive",value:function(e){return this._urlParams.caseSensitive=e||!1,this}},{key:"removeCaseSensitive",value:function(){return this._urlParams&&delete this._urlParams.caseSensitive,this}}]),t}(s.default);r.default=c,t.exports=r.default},{"./FlattenedSearchBuilder":295}],306:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=(e("./SearchBuilder"),e("../Search")),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t){n(this,e),this._api=t}return i(e,[{key:"from",value:function(e){if("string"!=typeof e)throw new Error("Url parameter is mandatory and must be a string");return this._url=e,this}},{key:"filter",value:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return this._filter={filter:e},this}},{key:"limit",value:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return this._limit={limit:e},this}},{key:"build",value:function(){if("string"!=typeof this._url)throw new Error("Url parameter is mandatory and must be a string");return new a.default(this._api,this._url,this._filter,this._limit,{})}}]),e}();r.default=u,t.exports=r.default},{"../Search":263,"./SearchBuilder":309}],307:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/resourceType",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"resourceType",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":266,"./SearchBuilder":309}],308:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/rules",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"./SearchBuilder":309}],309:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("../Search"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t,r,i){var o=this;if(n(this,e),this.constructor===e)throw new Error("Cannot construct Abstract instances directly");this._url="",this._fieldFinder=i,this._parent=t,this._routes=r,this._routesName=[],this._builderParams={summary:!1,sort:[],filter:{},limit:void 0,group:void 0,select:void 0};for(var a in this._routes)!function(e){o._routesName.push(e),o._builderParams[e]=!1,o[e]=function(){var t=arguments.length<=0||void 0===arguments[0]?e:arguments[0];return o._builderParams[t]=!0,o}}(a);this._urlParams={}}return i(e,[{key:"findFields",value:function(e){return this._fieldFinder.find(e)}},{key:"findAllFields",value:function(e){return this._fieldFinder.findAll(e)}},{key:"findFieldPath",value:function(e){return this._fieldFinder.findFieldPath(e)}},{key:"withTimeout",value:function(){var e=arguments.length<=0||void 0===arguments[0]?2e3:arguments[0];if("number"!=typeof e)throw new Error("Parameter ms must be a number");return this._builderParams.timeout=e,this}},{key:"filter",value:function(e){return this._builderParams.filter=e||{},this}},{key:"addSortAscendingBy",value:function(e){return this.addSortBy(e,"ASCENDING")}},{key:"addSortDescendingBy",value:function(e){return this.addSortBy(e,"DESCENDING")}},{key:"addSortBy",value:function(e,t){if(e&&t)if(this._builderParams.sort.length>0){var r=0,n=!1;for(r=0;r<this._builderParams.sort.length;r++)this._builderParams.sort[r].name===e&&(this._builderParams.sort[r].type=t,n=!0);n||this._builderParams.sort.push({name:e,type:t})}else this._builderParams.sort.push({name:e,type:t});return this}},{key:"removeSortBy",value:function(e){if(e){if(this._builderParams.sort.length>0){var t=0;for(t=0;t<this._builderParams.sort.length;t++)this._builderParams.sort[t].name===e&&(this._builderParams.sort.splice(t,t+1),t--)}}else this._builderParams.sort=[];return this}},{key:"limit",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1];if("number"!=typeof e)throw new Error("size parameter must be a number");return("number"!=typeof t||t<1)&&(t=1),this._builderParams.limit={size:e,start:t},this}},{key:"build",value:function(){try{return new a.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}catch(e){console.error("!errrrror!!!!!!",e)}}},{key:"_buildFilter",value:function(){var e=this._builderParams.filter;return void 0!==e._filterTemplate?e._filterTemplate:{filter:e}}},{key:"_buildSelect",value:function(){var e=this._builderParams.select
|
|
37
|
+
;return void 0!==e&&void 0!==e._selectTemplate?e._selectTemplate:{select:e}}},{key:"_buildGroup",value:function(){var e=this._builderParams.group;return void 0!==e&&void 0!==e._groupTemplate?e._groupTemplate:{group:e}}},{key:"_buildLimit",value:function(){return void 0===this._builderParams.limit?{limit:{size:1e3,start:1}}:{limit:this._builderParams.limit}}},{key:"_buildSort",value:function(){if(0!==this._builderParams.sort.length)return{sort:{parameters:this._builderParams.sort}}}},{key:"_buildUrl",value:function(){if("string"!=typeof this._url||0===this._url.trim().length)throw new Error("Error on extends SearchBuilder, this._url is not defined.");return this._url}},{key:"_checkConstraintRoutes",value:function(){var e=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],t=!1;for(var r in this._routes){if(t&&this._builderParams[r]&&!e)throw new Error("Must select only one of this:"+JSON.stringify(this._routesName));t=t||this._builderParams[r]}if(!t)throw new Error("Must select one at least: "+JSON.stringify(this._routesName))}}]),e}();r.default=u,t.exports=r.default},{"../Search":263}],310:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e,r,i){if(n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,i),this.constructor===t)throw new Error("Cannot construct Abstract instances directly")}return i(t,e),o(t,[{key:"summary",value:function(){return this._url=this._url+"/summary",this}}]),t}(s.default);r.default=c,t.exports=r.default},{"./SearchBuilder":309}],311:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d="serviceGroups",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/"+d,this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,d,this.customFilters)}},{key:"withEntityType",value:function(e){if("string"!=typeof e)throw new Error("Parameter entityType must be a string");return this.customFilters.entityType=e,this}}]),t}(c.default);r.default=h,t.exports=r.default},{"../StaticSearch":266,"./SearchBuilder":309}],312:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("merge"),f=n(l),d=e("../../util/searchingFields/FieldFinder"),h=n(d),p=["SOFTWARE","FIRMWARE"];r.SOFTWARE_TYPES_ENUM=p;var y="/catalog/softwares",m=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new h.default(e,y)),this._url=y,this.fluentFilter=e.newFilterBuilder(),this.tagsFilter=[]}return o(t,e),a(t,[{key:"withId",value:function(e){if("string"!=typeof e)throw new Error("Parameter softwareId must be a string");return this.fluentFilter.and(this._parent.EX.eq("softwareId",e)),this}},{key:"withName",value:function(e){if("string"!=typeof e)throw new Error("Parameter softwareName must be a string");return this.fluentFilter.and(this._parent.EX.eq("softwareName",e)),this}},{key:"withType",value:function(e){if("string"!=typeof e)throw new Error("Parameter version must be a string");var t="";if(void 0===p.find(function(e){return e==this},e)&&(t=e),""!==t)throw new Error("Parameter in TYPE is not allowed. Parameter value '"+JSON.stringify(t)+"', parameters allowed in administrativeState are: '"+JSON.stringify(p)+"'");return this.fluentFilter.and(this._parent.EX.eq("softwareType",e)),this}},{key:"withVersion",value:function(e){if("string"!=typeof e)throw new Error("Parameter version must be a string");return this.fluentFilter.and(this._parent.EX.eq("softwareVersion",e)),this}},{key:"withHardwareId",value:function(e){if("string"!=typeof e)throw new Error("Parameter hardwareId must be a string");return this.fluentFilter.and(this._parent.EX.eq("hardwareId",e)),this}},{key:"withModel",value:function(e){if("string"!=typeof e)throw new Error("Parameter modelName must be a string");return this.fluentFilter.and(this._parent.EX.eq("modelName",e)),this}},{key:"withModelVersion",value:function(e){if("string"!=typeof e)throw new Error("Parameter modelVersion must be a string");return this.fluentFilter.and(this._parent.EX.eq("modelVersion",e)),this}},{key:"withManufacturer",value:function(e){if("string"!=typeof e)throw new Error("Parameter manufacturerName must be a string");return this.fluentFilter.and(this._parent.EX.eq("manufacturerName",e)),this}},{key:"_buildFilter",value:function(){var e={filter:{}},t=(0,f.default)(!0,this.fluentFilter),r=this._builderParams.filter;if(t=t._filterTemplate.filter,"object"==typeof r._filterTemplate&&(r=r._filterTemplate.filter),void 0!==r&&Object.keys(r).length>0&&void 0!==t&&Object.keys(t).length>0)throw new Error("Incompatible filters. You only can create a filter using fluent mode [withId, withName, withVersion, withType, withHardwareId, withModel, withModelVersion, withManufacturer] methods or custom filter [filter] method");return void 0!==r&&Object.keys(r).length>0?e.filter=r:void 0!==t&&Object.keys(t).length>0&&(e.filter=t),e}}]),t}(c.default);r.default=m},{"../../util/searchingFields/FieldFinder":344,"./SearchWithSummaryBuilder":310,merge:112}],313:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./PreFilteredSearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/entities",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,"/subscribers")),this._url=d}return o(t,e),a(t,[{key:"_buildFilter",value:function(){var e={and:[{or:[]}]};if(!this._provisioned&&this._collected||e.and[0].or.push({exists:{"provision.device.communicationModules[].subscriber.identifier":!0}}),!this._collected&&this._provisioned||e.and[0].or.push({exists:{"device.communicationModules[].subscriber.identifier":!0}}),this._builderParams.filter&&Object.keys(this._builderParams.filter).length>0){var t=this._builderParams.filter;void 0!==t._filterTemplate?e.and.push(t._filterTemplate.filter):e.and.push(t)}return{filter:e}}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"./PreFilteredSearchBuilder":305}],314:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./PreFilteredSearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/entities",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,"/subscriptions")),this._url=d}return o(t,e),a(t,[{key:"_buildFilter",value:function(){var e={and:[{or:[]}]};if(!this._provisioned&&this._collected||e.and[0].or.push({exists:{"provision.device.communicationModules[].subscription.identifier":!0}}),!this._collected&&this._provisioned||e.and[0].or.push({exists:{"device.communicationModules[].subscription.identifier":!0}}),this._builderParams.filter&&Object.keys(this._builderParams.filter).length>0){var t=this._builderParams.filter;void 0!==t._filterTemplate?e.and.push(t._filterTemplate.filter):e.and.push(t)}return{filter:e}}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"./PreFilteredSearchBuilder":305}],315:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchWithSummaryBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/tasks",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"./SearchWithSummaryBuilder":310}],316:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ticketPriority",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ticketPriority",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":266,"./SearchBuilder":309}],317:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ticketSeverity",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ticketSeverity",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":266,"./SearchBuilder":309}],318:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ticketStatus",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ticketStatus",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":266,"./SearchBuilder":309}],319:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/tickets",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d}return o(t,e),a(t,[{key:"summary",value:function(){return this._url=this._url+"/summary",this}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e,this}},{key:"flattened",value:function(){return this._urlParams.flattened=!0,this}},{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"./SearchBuilder":309}],320:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d=e("../WPSearch"),h=n(d),p="timeseries";r.BASE_URL=p;var y=function(e){function t(e,r,n){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,p,{organization:r,timeserie:n})),this._url=p+"/provision/organizations/"+r+"/"+n+"/data"}return o(t,e),a(t,[{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e||[],this}},{key:"build",value:function(){return new h.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}}]),t}(c.default);r.default=y},{"../../util/searchingFields/FieldFinder":344,"../WPSearch":267,"./SearchBuilder":309}],321:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/timezones",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"timezones",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":266,"./SearchBuilder":309}],322:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/userLanguages",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"userLanguages",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":266,"./SearchBuilder":309}],323:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/userProfile",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"userProfile",this.customFilters)}},{key:"withId",value:function(e){if("string"!=typeof e)throw new Error("Parameter id must be a string");return this.customFilters.id=e,this}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":266,"./SearchBuilder":309}],324:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchWithSummaryBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/users",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"./SearchWithSummaryBuilder":310}],325:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchWithSummaryBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/workgroups",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":344,"./SearchWithSummaryBuilder":310}],326:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["NOT_ACTIVE","ACTIVE","REVOKED","EXPIRED"];r.ADMINISTRATIVE_STATE_ENUM=n},{}],327:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../ProvisionGenericFinder"),c=n(s),l=e("q"),f=n(l),d=e("http-status-codes"),h=n(d),p=e("./MIME_TYPES_ENUM"),y=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"security/certificates","certificate","Certificate not found")}return o(t,e),a(t,[{key:"findById",value:function(e){return this._id=e,this._execute()}},{key:"_downloadUrl",value:function(){return this._setUrlParameters({format:this._type}),this._composeUrl()}},{key:"findByIdAndFormat",value:function(e,t){var r="";if(void 0===p.MIME_TYPES_ENUM.find(function(e){return e==this},t)&&(r=t),""!==r)throw new Error("Parameter mimetype is not allowed. Parameter value <'"+JSON.stringify(r)+"'>, mimetype allowed <'"+JSON.stringify(p.MIME_TYPES_ENUM)+"'>");return this._id=e,this._type=t,this._download()}},{key:"_download",value:function(){var e=f.default.defer(),t=e.promise,r=this._error_not_found
|
|
38
|
+
;return this._api.get(this._downloadUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){204===t.statusCode?e.reject({data:r,statusCode:h.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=y,t.exports=r.default},{"../ProvisionGenericFinder":140,"./MIME_TYPES_ENUM":329,"http-status-codes":76,q:117}],328:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),_get=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},_Security2=require("./Security"),_Security3=_interopRequireDefault(_Security2),_q=require("q"),_q2=_interopRequireDefault(_q),_ADMINISTRATIVE_STATE_ENUM=require("./ADMINISTRATIVE_STATE_ENUM"),_USAGES_ENUM=require("./USAGES_ENUM"),max_length_name=50,max_length_id=50,max_length_description=200,Certificates=function(_Security){function Certificates(e){_classCallCheck(this,Certificates),_get(Object.getPrototypeOf(Certificates.prototype),"constructor",this).call(this,e,"/certificates")}return _inherits(Certificates,_Security),_createClass(Certificates,[{key:"withId",value:function(e){if("string"!=typeof e||0===e.length||e.length>max_length_id)throw new Error("Parameter id must be a string, cannot be empty and has a maximum length of "+max_length_id);return this._id=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||0===e.length||e.length>max_length_name)throw new Error("Parameter name must be a string, cannot be empty and has a maximum length of "+max_length_name);return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||0===e.length||e.length>max_length_description)throw new Error("Parameter description must be a string, cannot be empty and has a maximum length of "+max_length_description);return this._description=e,this}},{key:"withAdministrativeState",value:function(e){if("string"!=typeof e||e.length<=0)throw new Error("Parameter administrativeState must be typeof string and cannot be empty");var t="";if(void 0===_ADMINISTRATIVE_STATE_ENUM.ADMINISTRATIVE_STATE_ENUM.find(function(e){return e==this},e)&&(t=e),""!==t)throw new Error("Parameter in administrativeState is not allowed. Parameter value '"+JSON.stringify(t)+"', parameters allowed in administrativeState are: '"+JSON.stringify(_ADMINISTRATIVE_STATE_ENUM.ADMINISTRATIVE_STATE_ENUM)+"'");return this._administrativeState=e,this}},{key:"withUsages",value:function(e){if(void 0===e||e.constructor!==Array||0===e.length)throw new Error("Parameter usages must be typeof Array and cannot be empty");for(var t=[],r=0;r<e.length;r++){void 0===_USAGES_ENUM.USAGES_ENUM.find(function(e){return e==this},e[r])&&t.push(e[r])}if(0!==t.length)throw new Error("There are not any parameters allowed. Parameters value: '"+JSON.stringify(t)+"'. Usages parameters allowed are: '"+JSON.stringify(_USAGES_ENUM.USAGES_ENUM)+"'");return this._usages=e,this}},{key:"withHardware",value:function(e){var t=[];if(void 0===e||e.constructor!==Array||0===e.length)throw new Error("Parameter hardwares must be typeof Array and cannot be empty");for(var r=0;r<e.length;r++)if(this._checkHardware(e[r]))try{e[r]=JSON.parse(e[r])}catch(e){}else t.push(r+1);if(0!==t.length)throw new Error("The hardware attribute is not well formed, the message "+JSON.stringify(t)+" not correct. Remember: hardwareId or [manufacturer, model and modelVersion] must be defined");return this._hardware=e,this}},{key:"_checkHardware",value:function _checkHardware(hardware){"string"==typeof hardware&&(hardware=eval("("+hardware+")"));var length=Object.keys(hardware).length,valid=!1;return 1===length&&hardware.hardwareId&&"string"==typeof hardware.hardwareId&&hardware.hardwareId.length>0?valid=!0:3===length&&hardware.manufacturer&&hardware.model&&hardware.modelVersion&&"string"==typeof hardware.manufacturer&&"string"==typeof hardware.model&&"string"==typeof hardware.modelVersion&&hardware.manufacturer.length>0&&hardware.model.length>0&&hardware.modelVersion.length>0&&(valid=!0),valid}},{key:"withTags",value:function(e){if(void 0===e||e.constructor!==Array||e.length<=0)throw new Error("Parameter tags must be typeof Array and cannot be empty");for(var t=[],r=0;r<e.length;r++)(void 0===e[r]||"string"!=typeof e[r]||typeof e[r].length<=0)&&t.push(e[r]);if(0!==t.length)throw new Error("The following tags values are not allowed:"+JSON.stringify(t));return this._tags=e,this}},{key:"withParameters",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter parameters must be a string, cannot be empty");return this._parameters=e,this}},{key:"withDomains",value:function(e){if(void 0===e||e.constructor!==Array||e.length<=0)throw new Error("Parameter domains must be typeof Array and cannot be empty");for(var t=[],r=0;r<e.length;r++)(void 0===e[r]||"string"!=typeof e[r]||typeof e[r].length<=0)&&t.push(e[r]);if(0!==t.length)throw new Error("The following domains values are not allowed:"+JSON.stringify(t));return this._domains=e,this}},{key:"_composeElement",value:function(){if(void 0===this._name||void 0===this._administrativeState||void 0===this._usages)throw new Error("Parameters name, usages, administrativeState must be defined");return{certificate:{id:this._id||void 0,name:this._name||void 0,description:this._description||void 0,administrativeState:this._administrativeState||void 0,usages:this._usages||void 0,hardware:this._hardware||void 0,tags:this._tags||void 0,parameters:this._parameters||void 0,domains:this._domains||void 0}}}},{key:"create",value:function(e){var t=this,r=void 0;if("string"!=typeof e){r=new FormData;var n=new Blob([JSON.stringify(this._composeElement())],{type:"application/json"});r.append("json",n);var i=new Blob([e],{type:"application/x-pem-file"});e&&r.append("certificate",i)}else r={},r.json=JSON.stringify(this._composeElement()),r.certificate=e;var o=_q2.default.defer(),a=o.promise;return this._ogapi.Napi.post_multipart(this._resource,r,{},this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(e){var r=e.statusCode;201===r?("function"==typeof t._onCreated&&t._onCreated(e.header.location),o.resolve({location:e.header.location,statusCode:r})):o.reject({errors:e.errors,statusCode:r})}).catch(function(e){o.reject(e)}),a}},{key:"_onCreated",value:function(e){var t=e.split("/").pop(-1);this.withId(t)}},{key:"update",value:function(){var e=this._composeElement();delete e.certificate.id;var t=_q2.default.defer(),r=t.promise;return this._ogapi.Napi.put(this._buildURL(),e,void 0,this._getExtraHeaders(),this._getUrlParameters()).then(function(e){var r=e.body;void 0===r?t.reject("Cannot update the certificate"):t.resolve(r,e.statusCode)}).catch(function(e){t.reject(e)}),r}},{key:"_buildURL",value:function(){if(void 0===this._id)throw new Error("Parameters id must be defined");return this._resource+"/"+this._id}}]),Certificates}(_Security3.default);exports.default=Certificates,module.exports=exports.default},{"./ADMINISTRATIVE_STATE_ENUM":326,"./Security":330,"./USAGES_ENUM":331,q:117}],329:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["x-pem-file","pkcs7-mime","raw","text/plain"];r.MIME_TYPES_ENUM=n},{}],330:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("../provision/BaseProvision"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e,r,i){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/security"+(void 0===r?"":r),i)}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"../provision/BaseProvision":235}],331:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["FILE_VALIDATION","DEVICE_COMMUNICATIONS","DEVICE_ACCESS","CERT_SIGN"];r.USAGES_ENUM=n},{}],332:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../provision/BaseProvision"),c=n(s),l=e("../util/formats/check_types"),f=n(l),d="timeseries/provision/organizations/";r.URL=d;var h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations/",void 0,["name","organization","timeBucket","identifierColumn"])}return o(t,e),a(t,[{key:"_buildURL",value:function(){return d+this._organization+"/"+this._identifier}},{key:"withOrganization",value:function(e){return f.default._checkStringAndLength(e,50,"organization"),this._organization=e,this}},{key:"withIdentifier",value:function(e){return f.default._checkString(e,"identifier"),this._identifier=e,this}},{key:"withName",value:function(e){return f.default._checkStringAndPattern(e,"^[a-zA-Z0-9_@.-]*$","name"),this._name=e,this}},{key:"withIdentifierColumn",value:function(e){return f.default._checkString(e,"identifierColumn"),this._identifierColumn=e,this}},{key:"withTimeBucket",value:function(e){return f.default._checkNumber(e,"timeBucket"),this._timeBucket=e,this}},{key:"withDescription",value:function(e){return e&&f.default._checkString(e,"description"),this._description=e,this}},{key:"withColumns",value:function(e){return f.default._checkArray(e,"columns"),this._columns=e,this}},{key:"withBucketColumn",value:function(e){return f.default._checkStringAndPattern(e,"^[a-zA-Z0-9 _-]*$","bucketColumn"),this._bucketColumn=e,this}},{key:"withRetention",value:function(e){return f.default._checkNumber(e,"retention"),this._retention=e,this}},{key:"withOrigin",value:function(e){return f.default._checkISODateTime(e,"origin"),this._origin=e,this}},{key:"withContext",value:function(e){return f.default._checkArray(e,"context"),this._context=e,this}},{key:"_composeElement",value:function(){return this._resource=d+this._organization,this._timeBucket>0&&f.default._checkStringAndPattern(this._bucketColumn,"^[a-zA-Z0-9 _-]*$","bucketColumn"),{name:this._name,description:this._description,timeBucket:this._timeBucket,bucketColumn:this._timeBucket?this._bucketColumn:void 0,retention:this._retention,origin:this._origin,context:this._context||[],identifierColumn:this._identifierColumn,columns:this._columns||[]}}},{key:"update",value:function(){throw new Error("OGAPI_TIMESERIES_NOT_UPDATED")}}]),t}(c.default);r.default=h},{"../provision/BaseProvision":235,"../util/formats/check_types":343}],333:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"timeseries/provision/organizations","timeseries")}return i(t,e),o(t,[{key:"findByOrganization",value:function(e){return this._withId(e),this._execute()}},{key:"findByOrganizationAndTimeserieId",value:function(e,t){return this._withId(e+"/"+t),this._execute()}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":138}],334:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../GenericFinder"),c=n(s),l=e("q"),f=(n(l),e("http-status-codes")),d=(n(f),function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"ai","list","Transformer not found","north")}return o(t,e),a(t,[{key:"findByOrganization",value:function(e){return this._organization=e,this._execute()}},{key:"findByOrganizationAndIdentifier",value:function(e,t){return this._organization=e,this._identifier=t,this._execute()}},{key:"downloadByOrganizationAndIdentifierAndFilename",value:function(e,t,r){return this._organization=e,this._identifier=t,this._filename=r,this._download()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/transformers"+(this._identifier?"/"+this._identifier+(this._filename?"/"+this._filename:""):"")}}]),t}(c.default));r.default=d,t.exports=r.default},{"../GenericFinder":138,"http-status-codes":76,q:117}],335:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("q"),c=n(s),l=e("../provision/BaseProvision"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations",void 0,["organization","files"],"north/ai"),this._ogapi=e}return o(t,e),a(t,[{key:"_buildURL",value:function(){return this._organization+"/transformers/"+this._identifier}},{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"identifier"});return this._identifier=e,this}},{key:"withOrganization",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"organization"});return this._organization=e,this}},{key:"addFile",value:function(e){this._files||(this._files=[]),this._files.push(e)}},{key:"withFiles",value:function(e){if(!(e instanceof Array))throw new Error({message:"Parameter files requires an array",parameter:"files"});this._files=e}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),this._resource=this._organization+"/transformers",{files:this._files||void 0}}},{key:"_composeUpdateElement",value:function(){var e=u(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this);return delete e.name,e}},{key:"performTest",value:function(e){var t=c.default.defer(),r=t.promise;return this._ogapi.Napi.post(this._buildURL()+"/transform",e,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then(function(e){t.resolve({statusCode:e.statusCode,body:e.body})}).catch(function(e){t.reject(e)}),r}},{key:"create",value:function(){var e=this._composeElement(),t=c.default.defer();return this._ogapi.Napi.post_multipart(this._resource,{files:e.files},{},this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then(function(e){switch(e.statusCode){case 200:var r=""!=e.text?JSON.parse(e.text):{},n=e.status;t.resolve({data:r,statusCode:n});break;case 201:var n=e.status,i=e.header&&e.header.location;t.resolve({location:i,statusCode:n});break;case 204:t.resolve(e);break;default:t.reject({errors:e.data.errors,statusCode:e.statusCode})}}).catch(function(e){t.reject(e)}),t.promise}},{key:"update",value:function(){var e=this._composeElement(),t=c.default.defer();return this._ogapi.Napi.put_multipart(this._buildURL(),{files:e.files},{},this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then(function(e){switch(e.statusCode){case 200:var r=""!=e.text?JSON.parse(e.text):{},n=e.status;t.resolve({data:r,statusCode:n});break;default:t.reject({errors:e.data.errors,statusCode:e.statusCode})}}).catch(function(e){t.reject(e)}),t.promise}}]),t}(f.default);r.default=d,t.exports=r.default},{"../provision/BaseProvision":235,q:117}],336:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../ProvisionGenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"users","user","User not found")}return i(t,e),o(t,[{key:"findByEmail",value:function(e){return this._id=e,this._execute()}},{key:"findByEmailAndPassword",value:function(e,t){return this._id=e,this._setExtraHeaders({"X-ApiPass":t}),this._execute()}}]),t}(s.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":140}],337:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../provision/BaseProvision"),c=n(s),l=e("q"),f=(n(l),e("lodash")),d=n(f),h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/users",void 0,["email","workgroup","domain","profile","countryCode","langCode"])}return o(t,e),a(t,[{key:"withName",value:function(e){if("string"!=typeof e||e.length>100)throw new Error("Parameter name must be a string and has a maximum length of 100");return this._name=e,this}},{key:"withSurname",value:function(e){if("string"!=typeof e||e.length>100)throw new Error("Parameter surname must be a string and has a maximum length of 100");return this._surname=e,this}},{key:"withEmail",value:function(e){if("string"!=typeof e||e.length>100)throw new Error("Parameter email must be a string and has a maximum length of 100");return this._email=e,this}},{key:"withPassword",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("Parameter password must be a string and has a maximum length of 50");return this._password=e,this}},{key:"withWorkgroup",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_WORKGROUP");return this._workgroup=e,this}},{key:"withDomain",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_DOMAIN");return this._domain=e,this}},{key:"withProfile",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_PROFILE");return this._profile=e,this}},{key:"withCountryCode",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_COUNTRY_CODE");return this._countryCode=e,this}},{key:"withLangCode",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_LANGUAGE");return this._langCode=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_DESCRIPTION");return this._description=e,this}},{key:"withTimezone",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_TIMEZONE");return this._timezone=e,this}},{key:"with2FaType",value:function(e){if("string"!=typeof e||e.length>100)throw new Error("Parameter twoFaType must be a string and has a maximum length of 100");return this._twoFaType=e,this}},{key:"_buildURL",value:function(){if(void 0===this._email)throw new Error("OGAPI_EMAIL_MUST_BE_DEFINED");return this._resource+"/"+this._email}},{key:"_composeElement",value:function(){return{user:{name:this._name||void 0,surname:this._surname||void 0,password:this._password||void 0,description:this._description||void 0,email:this._email||void 0,workgroup:this._workgroup||void 0,domain:this._domain||void 0,profile:this._profile||void 0,countryCode:this._countryCode||void 0,langCode:this._langCode||void 0,timezone:this._timezone||void 0,"2FaType":this._twoFaType||void 0}}}},{key:"_composeUpdateElement",value:function(){if(this._password)throw new Error("OGAPI_PASSWORD_NOT_ALLOWED");if(void 0===this._email)throw new Error("OGAPI_USER_UPDATE_PARAMETER_MUST_BE_DEFINED");return{user:{name:this._name||void 0,surname:this._surname||void 0,description:this._description||void 0,email:this._email||void 0,workgroup:this._workgroup||void 0,domain:this._domain||void 0,profile:this._profile||void 0,countryCode:this._countryCode||void 0,langCode:this._langCode||void 0,timezone:this._timezone||void 0,"2FaType":this._twoFaType||void 0}}}},{key:"changePassword",value:function(e){if(this._newPassword=e,d.default.isEmpty(this._email)||d.default.isEmpty(this._password)||d.default.isEmpty(this._newPassword))throw new Error("OGAPI_USER_UPDATE_PASSWORD_PARAMETER_MUST_BE_DEFINED");var t={user:{password:this._newPassword}};return this._setExtraHeaders({"X-ApiPass":this._password}),this._doNorthPut(this._buildURL(),t)}},{key:"requestResetPassword",value:function(){if(d.default.isEmpty(this._email))throw new Error("OGAPI_USER_MAIL_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED");var e=this._buildURL()+"/reset";return this._doNorthPost(e)}},{key:"updatePassword",value:function(e,t){if(this._newPassword=e,this._tokenId=t,d.default.isEmpty(this._email))throw new Error("OGAPI_USER_MAIL_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED");if(d.default.isEmpty(this._newPassword))throw new Error("OGAPI_USER_PASSWORD_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED");if(d.default.isEmpty(t))throw new Error("OGAPI_USER_TOKENID_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED");var r={password:this._newPassword},n=this._buildURL()+"/reset/"+t;return this._doNorthPost(n,r)}},{key:"login",value:function(e,t,r){if(this._email=e,this._password=t,this._twoFaCode=r,d.default.isEmpty(this._email)||d.default.isEmpty(this._password))throw new Error("OGAPI_USER_LOGIN_EMAIL_AND_PASSWORD_PARAMETER_MUST_BE_DEFINED");var n={email:this._email,password:this._password,"2FaCode":this._twoFaCode||void 0},i=this._resource+"/login";return this._doNorthPost(i,n,!0)}}]),t}(c.default);r.default=h,t.exports=r.default},{"../provision/BaseProvision":235,lodash:111,q:117}],338:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.DATE_FORMAT="";r.TIME_FORMAT="HH:mm:ssZ"},{}],339:[function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(){function e(){i(this,e)}return o(e,null,[{key:"eq",value:function(e,t){return{eq:n({},e,t)}}},{key:"neq",value:function(e,t){return{neq:n({},e,t)}}},{key:"like",value:function(e,t){return{like:n({},e,t)}}},{key:"gt",value:function(e,t){return{gt:n({},e,t)}}},{key:"lt",value:function(e,t){return{lt:n({},e,t)}}},{key:"gte",value:function(e,t){return{gte:n({},e,t)}}},{key:"lte",value:function(e,t){return{lte:n({},e,t)}}},{key:"in",value:function(e,t){return{in:n({},e,t)}}},{key:"or",value:function(){for(var e={or:[]},t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];for(var i=0;i<r.length;i++)e.or.push(r[i]);return e}},{key:"and",value:function(){for(var e={and:[]},t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];for(var i=0;i<r.length;i++)e.and.push(r[i]);return e}}]),e}();r.default=a,t.exports=r.default},{}],340:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("merge"),u=n(a),s=e("urlencode"),c=n(s),l=e("superagent"),f=n(l),d=e("q"),h=n(d),p=e("lodash"),y=n(p),m=e("superagent-mocker"),v=n(m),_=(0,v.default)(f.default),g=function(){function e(t,r){i(this,e),this._options=u.default.recursive(!0,this.default(),t),this._headers=r,y.default.isEmpty(t.mocks)||this._applyMocks(t.mocks)}return o(e,[{key:"_applyMocks",value:function(e){var t=this;Object.keys(e).filter(function(t){return!y.default.isEmpty(e[t])}).forEach(function(r){console.log("Mocking "+r.toLocaleUpperCase()+" requests"),Object.keys(e[r]).forEach(function(n){console.log("Mocking url:",n);var i=e[r][n];_[r](t._options.url+n,function(t){if("function"==typeof i)return console.log("Function returned"),i(t);var o=e[r][n];return console.log("Data returned:",o),o.headers||(o.headers={}),o})})})}},{key:"default",value:function(){return{timeout:5e3}}},{key:"_url",value:function(e){return e.url}},{key:"get",value:function(e,t,r,n,i,o){var a=this._createUrl(e,n,o);console.info("GET",a);var u=f.default.get(a);return this._createPromiseRequest(u,null,t,r,i)}},{key:"patch",value:function(e,t,r,n,i,o){var a=this._createUrl(e,i,o);console.info("PATCH",a);var u=f.default.patch(a).send(t);return this._createPromiseRequest(u,null,r,n)}},{key:"post",value:function(e,t,r,n,i,o){var a=this._createUrl(e,i,o);console.info("POST",a);var u=f.default.post(a).send(t);return this._createPromiseRequest(u,null,r,n)}},{key:"post_multipart",value:function(e,t,r,n,i,o,a){var u=this._createUrl(e,o,a);console.info("POST_MULTIPART",u);var s=f.default.post(u),c=!0;return Object.keys(t).forEach(function(e){switch(e){case"meta":case"json":case"file":s.field(e,t[e]),delete t[e];break;case"hardwareMedia":case"certificate":case"processorBulkFile":s.attach("file",t[e]),c=!1;break;case"files":t[e].forEach(function(t,r){console.log(t.name),s.attach(e,t)}),
|
|
39
|
+
delete t[e],c=!1;break;case"modelFile":s.field(e,t[e]),delete t[e],c=!1;break;case"bulkFile":s.set("Content-Type",t.ext),t=t.bulkFile}}),c&&s.send(t),this._createPromiseRequest(s,r,n,i)}},{key:"put",value:function(e,t,r,n,i,o){var a=this._createUrl(e,i,o);console.info("PUT",a);var u=f.default.put(a).send(t);return n?n["Content-Type"]="application/json":n={"Content-Type":"application/json"},this._createPromiseRequest(u,null,r,n)}},{key:"put_multipart",value:function(e,t,r,n,i,o,a){var u=this._createUrl(e,o,a);console.info("PUT_MULTIPART",u);var s=f.default.put(u),c=!0;return Object.keys(t).forEach(function(e){switch(e){case"meta":case"json":case"file":s.field(e,t[e]),delete t[e];break;case"hardwareMedia":case"certificate":case"processorBulkFile":s.attach("file",t[e]),c=!1;break;case"files":t[e].forEach(function(t,r){console.log(t.name),s.attach(e,t)}),delete t[e],c=!1;break;case"modelFile":s.field(e,t[e]),delete t[e],c=!1;break;case"bulkFile":s.set("Content-Type",t.ext),t=t.bulkFile}}),c&&s.send(t),this._createPromiseRequest(s,r,n,i)}},{key:"delete",value:function(e,t,r,n,i,o){var a=this._createUrl(e,n,o);console.info("DELETE",a);var u;return u=i?f.default.del(a).send(i):f.default.del(a),this._createPromiseRequest(u,null,t,r)}},{key:"_createUrl",value:function(e,t,r){var n=[];if(t)for(var i=Object.keys(t),o=0;o<i.length;o++){var a=i[o],u=a+"="+t[a];e=0===o?e+"?"+u:e+"&"+u}var s=e.split("/"),l=s.length;return s.forEach(function(e,t){if(t===l-1&&e.indexOf("?")>0){var r=e.substring(e.indexOf("?"),e.length),i=e.substring(0,e.indexOf("?"));n.push((0,c.default)(i)+r)}else n.push((0,c.default)(e))}),this._url(this._options)+"/"+this._getDefaultBaseURL(r)+"/"+n.join("/")}},{key:"_getDefaultBaseURL",value:function(e){return e||(this._isSouth?"v80":"north/v80")}},{key:"_createPromiseRequest",value:function(e,t,r,n,i){var o=r;void 0!==o&&null!==o||(o=this._options.timeout);var a=h.default.defer(),u=a.promise,s=this._options.apiKey,c=this._options.jwt,l=-1===o?e:e.timeout(o);if(c&&!this._isSouth?l=l.set("Authorization","Bearer "+c):s&&(l=l.set("X-ApiKey",this._options.apiKey)),n)for(var f=Object.keys(n),d=0;d<f.length;d++){var p=f[d];void 0!==n[p]&&(l=l.set(p,n[p]))}if(t)for(var y in t)l=l.on(y,t[y]);return i&&e.responseType("blob"),l=l.end(function(e,t){if(null!==e){console.error("OGAPI ERROR: "),console.error(e);var r=void 0,n=void 0,i=e.status?e.status:void 0,o={errors:[{code:i,message:"OGAPI: Something is broken. Please contact with your administrator."}]};void 0!==e.response?(r=e.response.body?e.response.body:o,n=e.response.headers,i=e.status):i?(r=e.message,i=408):(r=o,i=500),a.reject({statusCode:i,data:r,headers:n})}else a.resolve(t)}),u}}]),e}();r.default=g,t.exports=r.default},{lodash:111,merge:112,q:117,superagent:128,"superagent-mocker":126,urlencode:135}],341:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(){function e(){n(this,e)}return i(e,null,[{key:"element",value:function(e,t){return{name:e,fields:t}}}]),e}();r.default=o,t.exports=r.default},{}],342:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./NorthAmpliaREST"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e,r){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r),this._isSouth=!0}return i(t,e),o(t,[{key:"_url",value:function(e){return e.south.url}}]),t}(s.default);r.default=c,t.exports=r.default},{"./NorthAmpliaREST":340}],343:[function(e,t,r){"use strict";t.exports={_checkType:function(e,t){var r=[];if(void 0===t.find(function(e){return e==this},e)&&r.push(e),0!==r.length)throw new Error({message:"OGAPI_NOT_ALLOWED_PARAMETER",parameter:JSON.stringify(r),allowed:JSON.stringify(t)});return e},_checkISODateTime:function(e,t){if("string"!=typeof e||new RegExp("\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d+(Z|[+-]\\d{2}:\\d{2})").test(e))throw new Error([{message:"OGAPI_ISO_DATE_TIME_PARAMETER",parameter:t},{message:"OGAPI_STRING_PATTERN",parameter:t}]);try{new Date(e)}catch(e){throw new Error([{message:"OGAPI_ISO_DATE_TIME_PARAMETER",parameter:t},{message:"OGAPI_STRING_PATTERN",parameter:t}])}},_checkStringAndPattern:function(e,t,r){if("string"!=typeof e||!new RegExp(t).test(e))throw new Error([{message:"OGAPI_STRING_PARAMETER",parameter:r},{message:"OGAPI_STRING_PATTERN",parameter:r,pattern:t}])},_checkStringAndLength:function(e,t,r){if("string"!=typeof e||e.length>t)throw new Error([{message:"OGAPI_STRING_PARAMETER",parameter:r},{message:"OGAPI_MAX_LENGTH",parameter:t}])},_checkString:function(e,t){if("string"!=typeof e)throw new Error([{message:"OGAPI_STRING_PARAMETER",parameter:t}])},_checkNumber:function(e,t){if("number"!=typeof e)throw new Error([{message:"OGAPI_NUMBER_PARAMETER",parameter:t}])},_checkArray:function(e,t){if(!Array.isArray(e)||0===e.length)throw new Error({message:"OGAPI_ARRAY_PARAMETER",parameter:t})},_checkObject:function(e,t){if("object"!=typeof e)throw new Error({message:"OGAPI_OBJECT_PARAMETER",parameter:t})}}},{}],344:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(r,"__esModule",{value:!0});var a,u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=e("q"),c=n(s),l=e("lodash"),f=n(l),d=e("./source-precompiled/Fields"),h=e("./IotFields"),p=d.GENERATED_FIELDS;for(var y in h.IOT_FIELDS)if(p[y])for(var m in h.IOT_FIELDS[y])p[y][m]=h.IOT_FIELDS[y][m];else p[y]=h.IOT_FIELDS[y];var v=new RegExp("^(.+)._current\\.?(.+)?$"),_=new RegExp("\\[[0-9]+\\]"),g=(new RegExp("value\\.?"),{"/jobs":"JOB","/tasks":"TASKS","/alarms":"ENTITY_ALARM","/operations":"ENTITY_OPERATION","/operations/history":"ENTITY_OPERATION_HISTORY","/certificates":"CERTIFICATE","/bundles":"UPDATE_BUNDLE_VERSION","/datapoints":"DATAPOINTS","/datastreams":"DATASTREAMS","/datamodels":"DATAMODELS","/dmmQRating":"DMMQRATING","/iotQRating":"IOTQRATING","/catalog/softwares":"SOFTWARE_VERSION","/catalog/hardwares":"MANUFACTURER","/catalog/operators":"OPERATORS","/domains":"DOMAIN","/users":"USER","/areas":"AREAS","/bulk/async":"LEGACY_BULK","provisionProcessors/bulk/search":"BULK","/devices":"SearchOnDatamodel","/subscriptions":"SearchOnDatamodel","/subscribers":"SearchOnDatamodel","/entities":"SearchOnDatamodel","entity-asset":"SearchOnDatamodel","/tickets":"SearchOnDatamodel","/channels":"SearchOnDatamodel",datasets:"SearchOnDataset",timeseries:"SearchOnTimeseries","/catalog/plans/organization":"PLANS","/catalog/plans/device":"PLANS"}),b={ENTITY_ALARM:"alarm",UPDATE_BUNDLE_VERSION:"bundle",DATAPOINTS:"datapoints",ENTITY_OPERATION:["operation","job"]},w={get:function(e){switch(e){case"entity-asset":return["entity.asset"];case"/tickets":return["ticket"];case"/channels":return["channel"];default:return}}},E={subscriber:"DEVICE_PART_SUBSCRIBER",subscription:"DEVICE_PART_SUBSCRIPTION",communicationsModule:"DEVICE_PART_COMMSMODULE",device:"DEVICE_PART_DEVICE"},A={DEVICE_PART_SUBSCRIBER:"subscriber",DEVICE_PART_SUBSCRIPTION:"subscription",DEVICE_PART_COMMSMODULE:"communicationsModule",DEVICE_PART_DEVICE:"device"},O=["relColl","relProv"],S=["DEVICE_PART_SUBSCRIBER","DEVICE_PART_SUBSCRIPTION","DEVICE_PART_COMMSMODULE","DEVICE_PART_DEVICE"],P=["subscriber","subscription","communicationsModule","device"],D="search",C={get:function(e){if(S.indexOf(g[e])>=0)return"complex";switch(g[e]){case"SearchOnDatamodel":return D;case"SearchOnDataset":return"dataset";case"SearchOnTimeseries":return"timeserie";default:return"simple"}}},k=function(e,t){function r(e){for(var t=!0;t;){var r=e;t=!1;{if(!(r.length>0&&r[0].constructor===Array))return r;r=r.reduce(function(e,t){return e.concat(t)}),e=r,t=!0}}}var n=c.default.defer(),i=t.selectedField,o=t.selectAll,a=t.extraData&&t.extraData.organization,u=e._ogapi.datamodelsSearchBuilder(),s={and:[]};return e._resourceTypes&&s.and.push({in:{"datamodels.allowedResourceTypes":e._resourceTypes}}),a&&s.and.push({eq:{"datamodels.organizationName":a}}),i&&s.and.push({eq:{"datamodels.categories.datastreams.identifier":i}}),s.and.length>0&&u.filter(s),u.build().execute().then(function(e){var t=[];200===e.statusCode&&(t=e.data.datamodels.map(function(e){return(e.categories||[]).map(function(e){return(e.datastreams||[]).map(function(e){return i||o?e:e.identifier})})}),t=r(t)),i?n.resolve(t.find(function(e){return i===e.identifier})):n.resolve(t)}).catch(function(e){n.reject(e)}),n.promise},T=function(e,t,r,n){var i=r.selectedField,o=[],a=r.extraData.organization,u=r.extraData[t.entity];e._ogapi[t.api]()[t.method](a,u).then(function(t){if(200===t.statusCode){t.data.identifierColumn&&o.push({identifier:t.data.identifierColumn,name:t.data.identifierColumn,path:"provision.administration.identifier._current.value",indexed:!0,sort:!0,notFilterable:!1,filter:"YES",type:"string",schema:{type:"string"}}),t.data.bucketColumn&&o.push({identifier:t.data.bucketColumn,name:t.data.bucketColumn,path:"provision.administration.identifier._current.at",indexed:!0,sort:!0,notFilterable:!1,filter:"YES",type:"date-time",schema:{type:"string",format:"datetime"}});var a=f.default.concat(t.data.columns||[],t.data.context||[]);e._ogapi.basicTypesSearchBuilder().withPath("$").build().execute().then(function(t){t.data.definitions;if(r.selectAll=!0,i){a=a.filter(function(e){return i===(e.name||e.alias)});var u=a[0],s=u.path.match(v),c=s[1].replace(_,"[]");r.selectedField=c}k(e,r).then(function(e){a.forEach(function(t){"date-time"!==t.type?t.schema={type:t.type}:t.schema={type:"string",format:"datetime"},t.path.endsWith("._current.value")&&function(){var r=t.path.substring(0,t.path.indexOf("._current.value"));Array.isArray(e)&&e.find(function(e){return r===e.identifier})}(),t.identifier=t.name||t.alias,t.indexed="NO"!==t.filter,t.notFilterable="NO"===t.filter,o.push(t)}),n.resolve(o)}).catch(function(e){console.error(e),n.reject(e)})}).catch(function(e){console.error(e),n.reject(e)})}}).catch(function(e){console.error(e),n.reject(e)})},F=(a={},o(a,D,function(e,t){k(this,e).then(function(e){t.resolve(e)}).catch(function(e){t.reject(e)})}),o(a,"simple",function(e,t){var r=e.context,n=e.primaryType,i=e.selectedField,o=[];if(r[n]instanceof Array)i?function(){var e=0,t=null;for(e=0;null===t&&e<r[n].length;e++)!function(){var o=r[n][e];o.toLowerCase()===i.toLowerCase()||o.toLowerCase()===i.toLowerCase()+"name"?t=o:b[n]&&(b[n]instanceof Array?b[n].forEach(function(e){o.toLowerCase()!==e+i.toLowerCase()&&o.toLowerCase()!==e+"."+i.toLowerCase()&&o.toLowerCase()!==e+i.toLowerCase()+"name"&&o.toLowerCase()!==e+"."+i.toLowerCase()+"name"||t||(t=o)}):o.toLowerCase()!==b[n]+i.toLowerCase()&&o.toLowerCase()!==b[n]+"."+i.toLowerCase()&&o.toLowerCase()!==b[n]+i.toLowerCase()+"name"&&o.toLowerCase()!==b[n]+"."+i.toLowerCase()+"name"||(t=o))}();t&&o.push(t)}():o=r[n].slice();else if(i)if(r[n][i])o.push(r[n][i]);else for(var a=Object.keys(r[n]),u=0;u<a.length;u++)r[n][a[u]].toLowerCase().indexOf(i.toLowerCase())>-1&&o.push(r[n][a[u]]);else for(var a=Object.keys(r[n]),u=0;u<a.length;u++)o.push(r[n][a[u]]);t.resolve(o.slice())}),o(a,"complex",function(e,t){function r(e,t){var n=void 0;if(!(r=E[e])||!(n=t[r]))throw new Error("Invalid primaryType: "+e);return n.slice()}function n(e){return e!=this}function i(e,t){var r=[];return t.forEach(function(t){var n=e.slice(0,-1);n.push(t),r.push(n.join("."))}),r}var o=e.states,a=e.context,u=e.primaryType,s={1:function(e,t){return t[u].concat(P.filter(n,A[u]))},2:function(e,t){try{return i(e,r(e[0],t).concat(O))}catch(e){return[]}},3:function(e,t){var n=e[1];if(-1===O.indexOf(n))return[];try{return i(e,r(e[0],t))}catch(e){return[]}}},c=o.length,l=s[c];return void 0===l?t.resolve([]):t.resolve(l(o,a))}),o(a,"dataset",function(e,t){T(this,{api:"newDatasetFinder",method:"findByOrganizationAndDatasetId",entity:"dataset"},e,t)}),o(a,"timeserie",function(e,t){T(this,{api:"newTimeserieFinder",method:"findByOrganizationAndTimeserieId",entity:"timeserie"},e,t)}),a),j=function(){function e(t,r,n){i(this,e),this._ogapi=t,this._url=r,this._type=C.get(r),this._extraData=n,this._type===D&&(this._resourceTypes=w.get(r))}return u(e,[{key:"find",value:function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=c.default.defer(),r={states:e.split("."),context:p[g[this._url]],primaryType:g[this._url],extraData:this._extraData};return F[this._type].call(this,r,t),t.promise}},{key:"findAll",value:function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=c.default.defer(),r={states:e.split("."),context:p[g[this._url]],primaryType:g[this._url],selectAll:!0,extraData:this._extraData};return F[this._type].call(this,r,t),t.promise}},{key:"findFieldPath",value:function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=c.default.defer(),r={states:e,context:p[g[this._url]],primaryType:g[this._url],selectedField:e,extraData:this._extraData};return F[this._type].call(this,r,t),t.promise}}]),e}();r.default=j,t.exports=r.default},{"./IotFields":345,"./source-precompiled/Fields":346,lodash:111,q:117}],345:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={DATAPOINTS:{DATAPOINTS:["datapoints.organization","datapoints.channel","datapoints.datastreamId","datapoints.entityIdentifier","datapoints.subEntityIdentifier","datapoints.entityRelated","datapoints._current.feedId","datapoints._current.date","datapoints._current.at","datapoints._current.value","datapoints._current.tags","datapoints._current.scoring.performance","datapoints._current.scoring.qrating.min_required.value","datapoints._current.scoring.qrating.min_required.label","datapoints._current.scoring.qrating.min_desired.value","datapoints._current.scoring.qrating.min_desired.label","datapoints._current.scoring.qrating.ideal.value","datapoints._current.scoring.qrating.ideal.label","datapoints._current.scoring.qrating.max_desired.value","datapoints._current.scoring.qrating.max_desired.label","datapoints._current.scoring.qrating.max_allowed.value","datapoints._current.scoring.qrating.max_allowed.label","datapoints._current.scoring.qrating.max_score","datapoints._current.scoring.qrating.cumulative_period_divisor","datapoints._current.scoring.qrating.conversion_matrix","datapoints._current.scoring.qrating.version"]},DATAMODELS:{DATAMODELS:["datamodels.organizationName","datamodels.identifier","datamodels.name","datamodels.description","datamodels.version","datamodels.categories.name","datamodels.categories.identifier","datamodels.categories.datastreams.identifier","datamodels.categories.datastreams.name","datamodels.categories.datastreams.description","datamodels.categories.datastreams.hardwareIds","datamodels.categories.datastreams.unit","datamodels.categories.datastreams.unit.type","datamodels.categories.datastreams.unit.label","datamodels.categories.datastreams.unit.symbol","datamodels.categories.datastreams.period","datamodels.categories.datastreams.access","datamodels.categories.datastreams.schema","datamodels.categories.datastreams.storage","datamodels.categories.datastreams.storage.period","datamodels.categories.datastreams.storage.total","datamodels.categories.datastreams.tags","datamodels.categories.datastreams.views","datamodels.categories.datastreams.icon","datamodels.categories.datastreams.modifiable","datamodels.categories.datastreams.required","datamodels.categories.datastreams.qrating.min_required.value","datamodels.categories.datastreams.qrating.min_required.label","datamodels.categories.datastreams.qrating.min_desired.value","datamodels.categories.datastreams.qrating.min_desired.label","datamodels.categories.datastreams.qrating.ideal.value","datamodels.categories.datastreams.qrating.ideal.label","datamodels.categories.datastreams.qrating.max_desired.value","datamodels.categories.datastreams.qrating.max_desired.label","datamodels.categories.datastreams.qrating.max_allowed.value","datamodels.categories.datastreams.qrating.max_allowed.label","datamodels.categories.datastreams.qrating.max_score","datamodels.categories.datastreams.qrating.cumulative_period_divisor","datamodels.categories.datastreams.qrating.conversion_matrix","datamodels.categories.datastreams.qrating.version"]},DATASTREAMS:{DATASTREAMS:["datastreams.datastreamId","datastreams.name","datastreams.description","datastreams.unit.type","datastreams.unit.label","datastreams.unit.symbol","datastreams.period","datastreams._current.tags","datastreams._current.date","datastreams._current.value","datastreams.categoryId","datastreams.datamodelId","datastreams.access","datastreams.channel","datastreams.organization","datastreams.entityIdentifier","feeds.entityIdentifier","datastreams._id.subEntityIdentifier","datastreams._current.scoring.qrating.min_required.value","datastreams._current.scoring.qrating.min_required.label","datastreams._current.scoring.qrating.min_desired.value","datastreams._current.scoring.qrating.min_desired.label","datastreams._current.scoring.qrating.ideal.value","datastreams._current.scoring.qrating.ideal.label","datastreams._current.scoring.qrating.max_desired.value","datastreams._current.scoring.qrating.max_desired.label","datastreams._current.scoring.qrating.max_allowed.value","datastreams._current.scoring.qrating.max_allowed.label","datastreams._current.scoring.qrating.max_score","datastreams._current.scoring.qrating.cumulative_period_divisor","datastreams._current.scoring.qrating.max_score","datastreams._current.scoring.qrating.conversion_matrix","datastreams.version","feeds.identifier","datastreams._current.scoring.qrating.version","datastreams._current.scoring.scoringPerformance"]},DEVICE_PART_DEVICE:{IOT:["datastream.id","datastream.name","datastream.feed","datastream.device","datastream.description","datastream.unit.type","datastream.unit.label","datastream.unit.symbol","datastream.period","datastream.tags","datastream.updated","datastream.minValue","datastream.maxValue","datastream.currentValue","datastream.categoryName","datastream.profileId","datastream.profileName","datastream.profileDescription","datastream.profileVersion","datastream.qratingScoringQValue","datastream.qratingScoringQScore","datastream.qratingScoringQuality","datastream.qratingScoringPerformance","datastream.qratingMinRequiredValue","datastream.qratingMinRequiredLabel","datastream.qratingMinDesiredValue","datastream.qratingMinDesiredLabel","datastream.qratingIdealValue","datastream.qratingIdealLabel","datastream.qratingMaxDesiredValue","datastream.qratingMaxDesiredLabel","datastream.qratingMaxAllowedValue","datastream.qratingMaxAllowedLabel","datastream.qratingMaxScore","deviceId","feedId","deviceOrganization","profile.Name","profile.Description","profile.Version","profile.Score","profile.MaxScore","profile.Performance","profile.AvgPerformance","profile.Quality","category.Name","category.Score","category.MaxScore","category.Performance","category.AvgPerformance","category.Quality","device.Score","device.MaxScore","device.Performance","device.AvgPerformance","device.Quality","device.Channel","device.EntityType"]},USER:{USER:{email:"user.email",description:"user.description",workgroup:"workgroup.name",domain:"domain.name",profile:"profile.name",name:"user.name",surname:"user.surname",countryCode:"country.code",langCode:"language.code",timezone:"user.timezone"}},DOMAIN:{DOMAIN:["domain.name","domain.description"]},AREAS:{AREAS:{identifier:"areas.identifier",name:"areas.name",description:"areas.description",entities:"areas.entities",geometry:"areas.geometry",color:"areas.color",organization:"areas.organization"}},TASKS:{TASKS:["tasks.id","tasks.name","tasks.description","tasks.state","tasks.domain","tasks.workgroup","tasks.job.request.user"]},LEGACY_BULK:{LEGACY_BULK:{identifier:"bulks.identifier",organization:"bulks.organization",fileName:"bulks.request.fileName",userEmail:"bulks.request.userEmail",headerAccept:"bulks.request.header.accept",contentType:"bulks.request.header.contentType",headerCsvFormat:"bulks.request.header.csvFormat",paramsFlattened:"bulks.request.params.flattened",paramsAction:"bulks.request.params.action",paramsFull:"bulks.request.params.full",paramsType:"bulks.request.params.type",status:"bulks.status",startedDate:"bulks.startedDate",finishedDate:"bulks.finishedDate",processed:"bulks.summary.processed",successful:"bulks.summary.successful",error:"bulks.summary.error"}},BULK:{BULK:{identifier:"bulks.identifier",provisionProcessorId:"bulks.provisionProcessorId",organization:"bulks.organization",userEmail:"bulks.request.userEmail",fileName:"bulks.request.fileName",headerAccept:"bulks.request.header.accept",contentType:"bulks.request.header.contentType",status:"bulks.status",startedDate:"bulks.startedDate",finishedDate:"bulks.finishedDate",processed:"bulks.summary.processed",successful:"bulks.summary.successful",error:"bulks.summary.error"}},RULE:{RULE:{organizationId:"rule.organizationId",channelId:"rule.channelId",name:"rule.name",active:"rule.active"}},ENTITY_ALARM:{ENTITY_ALARM:{alarmId:"alarm.identifier",alarmSubEntityIdentifier:"alarm.subEntityIdentifier",entityId:"alarm.entityIdentifier",entityType:"alarm.resourceType",organizationName:"alarm.organization",channelName:"alarm.channel",alarmRuleName:"alarm.rule",alarmName:"alarm.name",alarmSeverity:"alarm.severity",alarmPriority:"alarm.priority",alarmDescription:"alarm.description",alarmStatus:"alarm.status",alarmOpenDate:"alarm.openingDate",alarmAttentionDate:"alarm.attentionDate",alarmAttentionUser:"alarm.attentionUser",alarmAttentionNote:"alarm.attentionNote",alarmClosureDate:"alarm.closureDate",alarmClosureUser:"alarm.closureUser",alarmClosureNote:"alarm.closureNote"}},GENERAL:{GENERAL:[]},EMPTY:{EMPTY:[]},OPERATORS:{OPERATORS:["operator.name"]},PLANS:{PLANS:["plan.identifier","plan.name","plan.flowRate.value","plan.flowRate.unit","plan.maxDeviceAmount","plan.maxStorageLifeTime.period","plan.maxStorageLifeTime.total","plan.defaultAssigned","plan.defaultProvision"]}};r.IOT_FIELDS=n},{}],346:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={ENTITY_OPERATION_HISTORY:{ENTITY_OPERATION_HISTORY:["applicationEmail","entityId","entityType","jobActivatedDate","jobId","jobUserNotes","operationAttemptCurrent","operationAttemptMax","operationDate","operationDetails","operationEndDate","operationId","operationInitDate","operationName","operationNotify","operationParameters","operationResult","operationStatus","operationSteps"]},ENTITY_OPERATION:{ENTITY_OPERATION:["applicationEmail","channelKey","channelName","domainKey","entityId","entityType","entityUk","jobActivatedDate","jobEntityTotal","jobErrorCode","jobErrorDescription","jobFinishedCancelledByEngine","jobFinishedCancelledByExternal","jobFinishedCancelledByExternalTimeout","jobFinishedCancelledByTimeout","jobFinishedCancelledByUser","jobFinishedCancelledTotal","jobFinishedDate","jobFinishedError","jobFinishedOotError","jobFinishedOotSuccessful","jobFinishedOotTotal","jobFinishedSuccessful","jobFinishedTotal","jobId","jobInProgressPendingExecution","jobInProgressScheduled","jobInProgressStarted","jobInProgressTotal","jobInProgressWaitingForConnection","jobJson","jobStartedDate","jobState","jobStatus","jobTotal","jobUser","jobUserNotes","notDeletable","operationAttemptCurrent","operationAttemptMax","operationDate","operationDetails","operationEndDate","operationId","operationInitDate","operationJson","operationName","operationNotify","operationResult","operationScheduleTimestamp","operationStatus","operationStatusKey","operationStepDescription","operationStepName","operationStepResponse","operationStepResult","operationStepTimestamp","operationTimeoutTimestamp","operationUserNotes","organizationKey","organizationName","profileKey","provAdministrativeState","provAdministrativeStateKey","provDefaultFeed","serviceGroupName","tag","taskEmpty_null","taskId","taskKey","taskName","taskState","taskStatus","workgroupKey","workgroupName"]},MANUFACTURER:{MANUFACTURER:["manufacturerAddress","manufacturerDescription","manufacturerEmail","manufacturerFax","manufacturerIdentifier","manufacturerMediaFileName","manufacturerMediaHeight","manufacturerMediaIdentifier","manufacturerMediaName","manufacturerMediaSize","manufacturerMediaTypeName","manufacturerMediaWidth","manufacturerName","manufacturerNotes","manufacturerTelephone","manufacturerUrl","modelDescription","modelIdentifier","modelMediaFileName","modelMediaHeight","modelMediaIdentifier","modelMediaName","modelMediaSize","modelMediaTypeName","modelMediaWidth","modelName","modelNotes","modelUrl","modelVersion"]},MODEL:{MODEL:["modelDescription","modelIdentifier","modelName","modelNotes","modelUrl","modelVersion"]},JOB:{JOB:["jobActivatedDate","jobActivatedTime","jobCallback","jobEntityTotal","jobErrorCode","jobErrorDescription","jobFinishedCancelledByEngine","jobFinishedCancelledByExternal","jobFinishedCancelledByExternalTimeout","jobFinishedCancelledByTimeout","jobFinishedCancelledByUser","jobFinishedCancelledTotal","jobFinishedDate","jobFinishedError","jobFinishedOotError","jobFinishedOotSuccessful","jobFinishedOotTotal","jobFinishedSuccessful","jobFinishedTime","jobFinishedTotal","jobId","jobInProgressPendingExecution","jobInProgressScheduled","jobInProgressStarted","jobInProgressTotal","jobInProgressWaitingForConnection","jobJson","jobOperationName","jobScheduledTime","jobStartedDate","jobState","jobStatus","jobTotal","jobTrap","jobUser","jobUserNotes","jobVisible","operationId","operationName","operationResult","operationStatusKey","taskCoremessage","taskId","taskKey","taskName","taskNextExecution","taskState","taskStatus"]},SOFTWARE_VERSION:{SOFTWARE_VERSION:["manufacturerAddress","manufacturerDescription","manufacturerEmail","manufacturerFax","manufacturerIdentifier","manufacturerName","manufacturerNotes","manufacturerTelephone","manufacturerUrl","modelDescription","modelIdentifier","modelName","modelNotes","modelUrl","modelVersion","softwareId","softwareName","softwareType","softwareVersion"]},UPDATE_BUNDLE_VERSION:{UPDATE_BUNDLE_VERSION:["bundleActionDef","bundleActionOrder","bundleActionType","bundleActive","bundleConstrained","bundleCreationDate","bundleDeploymentElementDownloadUrl","bundleDeploymentElementId","bundleDeploymentElementName","bundleDeploymentElementOperation","bundleDeploymentElementOption","bundleDeploymentElementOrder","bundleDeploymentElementPath","bundleDeploymentElementSize","bundleDeploymentElementType","bundleDeploymentElementValidators","bundleDeploymentElementVersion","bundleDescription","bundleHardware","bundleId","bundleName","bundleUserNotes","bundleVersion","bundleWorkgroup","updateBundleDate","updateBundleManufacturer","updateBundleModel","updateBundleName","updateBundleVersion","updateBundleVersionUuid","updateDescription"]},CERTIFICATE:{CERTIFICATE:["certificateAdministrativeState","certificateDescription","certificateDomain","certificateId","certificateIssuer","certificateManufacturer","certificateModel","certificateModelIdentifier","certificateModelVersion","certificateName","certificatePublicKeyAlgorithm","certificatePublicKeyFormat","certificatePublicKeySize","certificateSerialNumber","certificateSubject","certificateTag","certificateTrustChain","certificateUsage","certificateValidFrom","certificateValidUntil","certificateVersion"]}};r.GENERATED_FIELDS=n},{}],347:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../ProvisionGenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"domains","workgroup","Workgroup not found")}return i(t,e),o(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._domain+"/workgroups/"+this._name}},{key:"findByDomainAndName",value:function(e,t){return this._domain=e,this._name=t,this._execute()}}]),t}(s.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":140}],348:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../provision/BaseProvision"),c=n(s),l=e("./Workgroups"),f=n(l),d=e("../channels/Channels"),h=n(d),p=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/domains",void 0,["workgroup","channels"]),this._ogapi=e,this._action="CREATE"}return o(t,e),a(t,[{key:"withWorkgroup",value:function(e){
|
|
40
|
+
if(e.constructor.prototype!=f.default.prototype)throw new Error("Parameter workgroup must be a workgroup");return this._workgroup=e,this}},{key:"withChannel",value:function(e){if(e.constructor.prototype!=h.default.prototype)throw new Error("Parameter channel must be a channel");return this._channels||(this._channels=[]),this._channels.push({organization:e._organization,channel:e._name}),this}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),this._resource="provision/domains/"+this._workgroup._domainName+"/workgroups/"+this._workgroup._name+"/relations",{workgroupRelation:{channels:this._channels?this._channels:void 0}}}},{key:"_buildURL",value:function(){return"provision/domains/"+this._workgroup._domainName+"/workgroups/"+this._workgroup._name+"/relations"}},{key:"create",value:function(){var e=this._composeElement(),t=this._resource;return this._setUrlParameters({action:"CREATE"}),this._doNorthPost(t,e)}},{key:"delete",value:function(){this._setUrlParameters({action:"DELETE"});var e=this._buildURL();if(this._channels){var t=this._composeElement();return this._doNorthPost(e,t)}return this._doNorthPost(e,{workgroupRelation:{channels:[]}})}},{key:"update",value:function(){throw new Error("Workgroup relation update not allowed")}}]),t}(c.default);r.default=p,t.exports=r.default},{"../channels/Channels":161,"../provision/BaseProvision":235,"./Workgroups":350}],349:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../ProvisionGenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"domains","workgroup","Workgroup relation not found")}return i(t,e),o(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._domain+"/workgroups/"+this._name+"/relations"}},{key:"findByDomainAndName",value:function(e,t){return this._domain=e,this._name=t,this._execute()}}]),t}(s.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":140}],350:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("q"),c=n(s),l=e("../provision/BaseProvision"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/domains",void 0,["name","domainName"]),this._ogapi=e}return o(t,e),a(t,[{key:"withName",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"name"});return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_250",parameter:"description"});return this._description=e,this}},{key:"withAdministrative",value:function(e){return this._administrative=e,this}},{key:"withDomainName",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"domainName"});return this._domainName=e,this}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),this._resource="provision/domains/"+this._domainName+"/workgroups",{workgroup:{name:this._name||void 0,description:this._description||void 0,administrative:this._administrative||!1}}}},{key:"_composeElementUpdate",value:function(){return this._checkRequiredParameters(),this._resource="provision/domains/"+this._domainName+"/workgroups",{workgroup:{description:this._description||void 0}}}},{key:"_buildURL",value:function(){return"provision/domains/"+this._domainName+"/workgroups/"+this._name}},{key:"update",value:function(){var e=c.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),this._composeElementUpdate(),void 0,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):200===t.status?e.resolve({statusCode:t.status}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(f.default);r.default=d,t.exports=r.default},{"../provision/BaseProvision":235,q:117}]},{},[1]);
|
|
41
|
+
//# sourceMappingURL=opengate-api-bower-12.9.4.min.js.map
|