opengate-js 12.13.0 → 12.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bower.json +1 -1
- package/dist/{opengate-api-bower-12.13.0.js → opengate-api-bower-12.14.0.js} +8 -10
- package/dist/opengate-api-bower-12.14.0.js.map +1 -0
- package/dist/{opengate-api-bower-12.13.0.min.js → opengate-api-bower-12.14.0.min.js} +2 -2
- package/dist/{opengate-api-bower-12.13.0.min.js.map → opengate-api-bower-12.14.0.min.js.map} +1 -1
- package/dist/src/connectorsFunctions/_CONNECTOR_FUNCTIONS_ENUMS.js +1 -1
- package/dist/src/connectorsFunctions/_CONNECTOR_FUNCTIONS_ENUMS.js.map +1 -1
- package/dist/src/connectorsFunctions/catalog/ConnectorFunctions.js +2 -4
- package/dist/src/connectorsFunctions/catalog/ConnectorFunctions.js.map +1 -1
- package/docs/ast/source/connectorsFunctions/_CONNECTOR_FUNCTIONS_ENUMS.js.json +164 -18
- package/docs/ast/source/connectorsFunctions/catalog/ConnectorFunctions.js.json +7310 -7449
- package/docs/class/src/connectorsFunctions/catalog/ConnectorFunctions.js~ConnectorFunctions.html +16 -16
- package/docs/dump.json +34 -34
- package/docs/file/src/connectorsFunctions/_CONNECTOR_FUNCTIONS_ENUMS.js.html +1 -1
- package/docs/file/src/connectorsFunctions/catalog/ConnectorFunctions.js.html +2 -4
- package/docs/package.json +1 -1
- package/docs/source.html +233 -233
- package/package.json +1 -1
- package/src/connectorsFunctions/_CONNECTOR_FUNCTIONS_ENUMS.js +1 -1
- package/src/connectorsFunctions/catalog/ConnectorFunctions.js +2 -4
- package/dist/opengate-api-bower-12.13.0.js.map +0 -1
|
@@ -28,7 +28,7 @@ r(r("\\/\\/("+r("("+p+")@")+"?("+T+")"+r("\\:("+j+")")+"?)")+"?("+N+"|"+U+"|"+z+
|
|
|
28
28
|
}(),o=e("./operations/Operations"),s=n(o),u=e("./users/UserFinder"),c=n(u),l=e("./geocluster/GeoclusterFinder"),p=n(l),f=e("./geocluster/Geocluster"),d=n(f),h=e("./security/Certificates"),m=n(h),v=e("./users/Users"),y=n(v),g=e("./organizations/OrganizationFinder"),_=n(g),b=e("./channels/ChannelFinder"),w=n(b),E=e("./searching/builder/AreasSearchBuilder"),x=n(E),A=e("./searching/builder/DatasetsCatalogSearchBuilder"),O=n(A),S=e("./areas/AreaFinder"),P=n(S),D=e("./searching/builder/BulkSearchBuilder"),k=n(D),C=e("./searching/builder/BulkExecutionSearchBuilder"),T=n(C),j=e("./bulk/BulkFinder"),F=n(j),B=e("./bulk/BulkExecutionFinder"),R=n(B),M=e("./channels/Channels"),I=n(M),N=e("./areas/Areas"),U=n(N),L=e("./datasets/Datasets"),z=n(L),q=e("./timeseries/Timeseries"),G=n(q),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("./timeseriesFunctionsCatalog/TimeseriesFunctionFinder"),ae=n(ie),oe=e("./timeseriesFunctionsCatalog/TimeseriesFunction"),se=n(oe),ue=e("./timeseriesFunctionsCatalog/TimeseriesFunctionsHelper"),ce=n(ue),le=e("./operationTypes/OperationType"),pe=n(le),fe=e("./operationTypes/OperationTypeFinder"),de=n(fe),he=e("./operationTypes/OperationTypeCatalog"),me=n(he),ve=e("./security/CertificateFinder"),ye=n(ve),ge=e("./operations/OperationFinder"),_e=n(ge),be=e("./searching/FilterBuilder"),we=n(be),Ee=e("./searching/SelectBuilder"),xe=n(Ee),Ae=e("./operations/OperationActions"),Oe=n(Ae),Se=e("./operations/PeriodicityActions"),Pe=n(Se),De=e("./util/Expression"),ke=n(De),Ce=e("./util/SelectElement"),Te=n(Ce),je=e("./searching/builder/RawSearchBuilder"),Fe=n(je),Be=e("./searching/builder/DevicesSearchBuilder"),Re=n(Be),Me=e("./searching/builder/SubscribersSearchBuilder"),Ie=n(Me),Ne=e("./searching/builder/SubscriptionsSearchBuilder"),Ue=n(Ne),Le=e("./searching/builder/AssetsSearchBuilder"),ze=n(Le),qe=e("./searching/builder/TicketsSearchBuilder"),Ge=n(qe),Ve=e("./searching/builder/TasksSearchBuilder"),He=n(Ve),We=e("./searching/builder/OperationsSearchBuilder"),Ye=n(We),$e=e("./searching/builder/ExecutionsSearchBuilder"),Ke=n($e),Je=e("./searching/builder/ExecutionsHistorySearchBuilder"),Qe=n(Je),Xe=e("./searching/builder/AlarmsSearchBuilder"),Ze=n(Xe),et=e("./searching/builder/DatamodelsSearchBuilder"),tt=n(et),rt=e("./searching/builder/FeedsSearchBuilder"),nt=n(rt),it=e("./searching/builder/DatastreamsSearchBuilder"),at=n(it),ot=e("./searching/builder/DatapointsSearchBuilder"),st=n(ot),ut=e("./searching/builder/BundlesSearchBuilder"),ct=n(ut),lt=e("./searching/builder/CertificatesSearchBuilder"),pt=n(lt),ft=e("./searching/builder/HardwaresSearchBuilder"),dt=n(ft),ht=e("./searching/builder/SoftwaresSearchBuilder"),mt=n(ht),vt=e("./searching/builder/OperationalStatusSearchBuilder"),yt=n(vt),gt=e("./searching/builder/ServiceGroupSearchBuilder"),_t=n(gt),bt=e("./searching/builder/AdministrativeStateSearchBuilder"),wt=n(bt),Et=e("./searching/builder/CommunicationsModuleTypeSearchBuilder"),xt=n(Et),At=e("./searching/builder/FieldsDefinitionSearchBuilder"),Ot=n(At),St=e("./searching/builder/BasicTypesSearchBuilder"),Pt=n(St),Dt=e("./searching/builder/MobilePhoneProviderSearchBuilder"),kt=n(Dt),Ct=e("./searching/builder/IoTDatastreamPeriodSearchBuilder"),Tt=n(Ct),jt=e("./searching/builder/ResourceTypeSearchBuilder"),Ft=n(jt),Bt=e("./searching/builder/AllowedResourceTypeSearchBuilder"),Rt=n(Bt),Mt=e("./searching/builder/IoTDatastreamAccessSearchBuilder"),It=n(Mt),Nt=e("./searching/builder/IoTDatastreamStoragePeriodSearchBuilder"),Ut=n(Nt),Lt=e("./searching/builder/TicketSeveritySearchBuilder"),zt=n(Lt),qt=e("./searching/builder/TicketPrioritySearchBuilder"),Gt=n(qt),Vt=e("./searching/builder/TicketStatusSearchBuilder"),Ht=n(Vt),Wt=e("./searching/builder/RulesSearchBuilder"),Yt=n(Wt),$t=e("./searching/builder/OperationTypesSearchBuilder"),Kt=n($t),Jt=e("./searching/builder/UsersSearchBuilder"),Qt=n(Jt),Xt=e("./searching/builder/DomainsSearchBuilder"),Zt=n(Xt),er=e("./searching/builder/PlansSearchBuilder"),tr=n(er),rr=e("./searching/builder/DevicesPlansSearchBuilder"),nr=n(rr),ir=e("./bundles/Bundles"),ar=n(ir),or=e("./bundles/BundleFinder"),sr=n(or),ur=e("./organizations/Organizations"),cr=n(ur),lr=e("./domains/Domains"),pr=n(lr),fr=e("./domains/DomainsFinder"),dr=n(fr),hr=e("./entities/DeviceFinder"),mr=n(hr),vr=e("./entities/TicketFinder"),yr=n(vr),gr=e("./entities/SubscriptionsFinder"),_r=n(gr),br=e("./entities/SubscribersFinder"),wr=n(br),Er=e("./collection/devices/DeviceMessage"),xr=n(Er),Ar=e("./collection/devices/collect/Datastreams"),Or=n(Ar),Sr=e("./collection/devices/collect/Datapoint"),Pr=n(Sr),Dr=e("./collection/devices/collect/Hardware"),kr=n(Dr),Cr=e("./collection/devices/collect/Software"),Tr=n(Cr),jr=e("./collection/devices/collect/Storage"),Fr=n(jr),Br=e("./collection/devices/collect/Usage"),Rr=n(Br),Mr=e("./collection/devices/collect/PowerSupply"),Ir=n(Mr),Nr=e("./collection/devices/collect/CommsModuleMessage"),Ur=n(Nr),Lr=e("./collection/devices/collect/Mobile"),zr=n(Lr),qr=e("./collection/devices/collect/Subscriber"),Gr=n(qr),Vr=e("./collection/devices/collect/Subscription"),Hr=n(Vr),Wr=e("./workgroups/WorkgroupRelations"),Yr=n(Wr),$r=e("./workgroups/Workgroups"),Kr=n($r),Jr=e("./workgroups/WorkgroupFinder"),Qr=n(Jr),Xr=e("./searching/builder/WorkgroupsSearchBuilder"),Zr=n(Xr),en=e("./workgroups/WorkgroupRelationsFinder"),tn=n(en),rn=e("./searching/builder/UserProfilesSearchBuilder"),nn=n(rn),an=e("./iot/datamodels/Datamodels"),on=n(an),sn=e("./iot/datamodels/DatamodelsHelper"),un=n(sn),cn=e("./iot/datamodels/DatamodelsFinder"),ln=n(cn),pn=e("./iot/catalog/Datastream"),fn=n(pn),dn=e("./iot/catalog/Qrating"),hn=n(dn),mn=e("./provision/entities/EntityBuilder"),vn=n(mn),yn=e("./provision/bulk/BulkExecutionBuilder"),gn=n(yn),_n=e("./searching/builder/EntitiesSearchBuilder"),bn=n(_n),wn=e("./searching/builder/DatasetEntitiesSearchBuilder"),En=n(wn),xn=e("./searching/builder/DatasetSearchBuilder"),An=n(xn),On=e("./searching/builder/TimeserieSearchBuilder"),Sn=n(On),Pn=e("./searching/builder/CountryCodesSearchBuilder"),Dn=n(Pn),kn=e("./searching/builder/TimezoneSearchBuilder"),Cn=n(kn),Tn=e("./searching/builder/UserLanguagesSearchBuilder"),jn=n(Tn),Fn=e("./provisionProcessors/provisionProcessors"),Bn=n(Fn),Rn=e("./provisionProcessors/provisionProcessorsFinder"),Mn=n(Rn),In=e("./entities/EntityFinder"),Nn=n(In),Un=e("./alarms/AlarmActions"),Ln=n(Un),zn=e("superagent"),qn=n(zn),Gn=e("./connectorsFunctions/configuration/ConnectorFunctionsHelper"),Vn=n(Gn),Hn=e("./connectorsFunctions/configuration/ConnectorFunctionsFinder"),Wn=n(Hn),Yn=e("./connectorsFunctions/configuration/ConnectorFunctions"),$n=n(Yn),Kn=e("./connectorsFunctions/catalog/ConnectorFunctions"),Jn=n(Kn),Qn=e("./connectorsFunctions/catalog/ConnectorFunctionsCatalogFinder"),Xn=n(Qn),Zn=e("./connectorsFunctions/catalog/ConnectorFunctionsCatalog"),ei=n(Zn),ti=e("./pipelines/PipelineFinder"),ri=n(ti),ni=e("./transformers/TransformerFinder"),ii=n(ni),ai=e("./AIModels/AIModelsFinder"),oi=n(ai),si=e("./transformers/Transformers"),ui=n(si),ci=e("./AIModels/AIModels"),li=n(ci),pi=e("./pipelines/Pipelines"),fi=n(pi),di=e("./manufacturers/Manufacturer"),hi=n(di),mi=e("./manufacturers/Model"),vi=n(mi),yi=e("./manufacturers/ManufacturerFinder"),gi=n(yi),_i=e("./manufacturers/ModelFinder"),bi=n(_i),wi=e("./provision/country/CountriesCatalog"),Ei=n(wi),xi=function(){var e=void 0,t=qn.default.Request.prototype.end;return qn.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}}(),Ai=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&&xi(n.hooks.beforeStart),this.Napi=t,this.Sapi=r,this.EX=ke.default,this.SE=Te.default,this.operations=new s.default(this),this.alarms=new Ln.default(this),this.entityBuilder=new vn.default(this)}return a(e,[{key:"newUserFinder",value:function(){return new c.default(this)}},{key:"newGeoclusterFinder",value:function(){return new p.default(this)}},{key:"geoclusterBuilder",value:function(){return new d.default(this)}},{key:"newOrganizationFinder",value:function(){return new _.default(this)}},{key:"newChannelFinder",value:function(){return new w.default(this)}},{key:"areasSearchBuilder",value:function(){return new x.default(this)}},{key:"datasetsCatalogSearchBuilder",value:function(){return new O.default(this)}},{key:"bulkSearchBuilder",value:function(){return new k.default(this)}},{key:"bulkExecutionSearchBuilder",value:function(){return new T.default(this)}},{key:"newBulkFinder",value:function(){return new F.default(this)}},{key:"newBulkExecutionFinder",value:function(){return new R.default(this)}},{key:"newAreaFinder",value:function(){return new P.default(this)}},{key:"newOperationFinder",value:function(){return new _e.default(this)}},{key:"newOperationTypeFinder",value:function(){return new de.default(this)}},{key:"newOperationTypeCatalog",value:function(){return new me.default(this)}},{key:"newCountriesCatalog",value:function(){return new Ei.default(this)}},{key:"operationTypeBuilder",value:function(e,t,r){return new pe.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 ye.default(this)}},{key:"newDeviceFinder",value:function(){return new mr.default(this)}},{key:"newTicketFinder",value:function(){return new yr.default(this)}},{key:"newSubscriptionsFinder",value:function(){return new _r.default(this)}},{key:"newSubscribersFinder",value:function(){return new wr.default(this)}},{key:"newEntityFinder",value:function(){return new Nn.default(this)}},{key:"newFilterBuilder",value:function(){return new we.default}},{key:"newSelectBuilder",value:function(){return new xe.default}},{key:"rawSearchBuilder",value:function(){return new Fe.default(this)}},{key:"usersSearchBuilder",value:function(){return new Qt.default(this)}},{key:"domainsSearchBuilder",value:function(){return new Zt.default(this)}},{key:"devicesSearchBuilder",value:function(){return new Re.default(this)}},{key:"assetsSearchBuilder",value:function(){return new ze.default(this)}},{key:"subscribersSearchBuilder",value:function(){return new Ie.default(this)}},{key:"subscriptionsSearchBuilder",value:function(){return new Ue.default(this)}},{key:"ticketsSearchBuilder",value:function(){return new Ge.default(this)}},{key:"communicationsModuleTypeSearchBuilder",value:function(){return new xt.default(this)}},{key:"fieldsDefinitionSearchBuilder",value:function(){return new Ot.default(this)}},{key:"mobilePhoneProviderSearchBuilder",value:function(){return new kt.default(this)}},{key:"ioTDatastreamPeriodSearchBuilder",value:function(){return new Tt.default(this)}},{key:"resourceTypeSearchBuilder",value:function(){return new Ft.default(this)}},{key:"allowedResourceTypeSearchBuilder",value:function(){return new Rt.default(this)}},{key:"ioTDatastreamAccessSearchBuilder",value:function(){return new It.default(this)}},{key:"ioTDatastreamStoragePeriodSearchBuilder",value:function(){return new Ut.default(this)}},{key:"ticketSeveritySearchBuilder",value:function(){return new zt.default(this)}},{key:"ticketPrioritySearchBuilder",value:function(){return new Gt.default(this)}},{key:"ticketStatusSearchBuilder",value:function(){return new Ht.default(this)}},{key:"rulesSearchBuilder",value:function(){return new Yt.default(this)}},{key:"operationTypesSearchBuilder",value:function(){return new Kt.default(this)}},{key:"tasksSearchBuilder",value:function(){return new He.default(this)}},{key:"operationsSearchBuilder",value:function(){return new Ye.default(this)}},{key:"executionsSearchBuilder",value:function(){return new Ke.default(this)}},{key:"executionsHistorySearchBuilder",value:function(){return new Qe.default(this)}},{key:"alarmsSearchBuilder",value:function(){return new Ze.default(this)}},{key:"datastreamsSearchBuilder",value:function(){return new at.default(this)}},{key:"datamodelsSearchBuilder",value:function(){return new tt.default(this)}},{key:"feedsSearchBuilder",value:function(){return new nt.default(this)}},{key:"datapointsSearchBuilder",value:function(){return new st.default(this)}},{key:"bundlesSearchBuilder",value:function(){return new ct.default(this)}},{key:"certificatesSearchBuilder",value:function(){return new pt.default(this)}},{key:"basicTypesSearchBuilder",value:function(){return new Pt.default(this)}},{key:"entitiesSearchBuilder",value:function(){return new bn.default(this)}},{key:"datasetEntitiesSearchBuilder",value:function(e,t){return new En.default(this,e,t)}},{key:"datasetSearchBuilder",value:function(e,t){return new An.default(this,e,t)}},{key:"timeserieSearchBuilder",value:function(e,t){return new Sn.default(this,e,t)}},{key:"plansSearchBuilder",value:function(){return new tr.default(this)}},{key:"devicesPlansSearchBuilder",value:function(){return new nr.default(this)}},{key:"bundlesBuilder",value:function(){return new ar.default(this)}},{key:"newBundleFinder",value:function(){return new sr.default(this)}},{key:"organizationsBuilder",value:function(){return new cr.default(this)}},{key:"domainsBuilder",value:function(){return new pr.default(this)}},{key:"newDomainFinder",value:function(){return new dr.default(this)}},{key:"usersBuilder",value:function(){return new y.default(this)}},{key:"certificatesBuilder",value:function(){return new m.default(this)}},{key:"hardwaresSearchBuilder",value:function(){return new dt.default(this)}},{key:"softwaresSearchBuilder",value:function(){return new mt.default(this)}},{key:"operationalStatusSearchBuilder",value:function(){return new yt.default(this)}},{key:"serviceGroupSearchBuilder",value:function(){return new _t.default(this)}},{key:"administrativeStateSearchBuilder",value:function(){return new wt.default(this)}},{key:"deviceMessageBuilder",value:function(){return new xr.default(this)}},{key:"datastreamBuilder",value:function(){return new Or.default(this)}},{key:"datapointsBuilder",value:function(){return new Pr.default(this)}},{key:"hardwareMessageBuilder",value:function(){return new kr.default(this)}},{key:"softwareMessageBuilder",value:function(){return new Tr.default(this)}},{key:"storageMessageBuilder",value:function(){return new Fr.default(this)}},{key:"usageMessageBuilder",value:function(){return new Rr.default(this)}},{key:"powerSupplyMessageBuilder",value:function(){return new Ir.default(this)}},{key:"commsModuleMessageMessageBuilder",value:function(){return new Ur.default(this)}},{key:"subscriberMessageBuilder",value:function(){return new Gr.default(this)}},{key:"subscriptionMessageBuilder",value:function(){return new Hr.default(this)}},{key:"mobileMessageMessageBuilder",value:function(){return new zr.default(this)}},{key:"newOperationActions",value:function(e){return new Oe.default(this,e)}},{key:"newPeriodicityActions",value:function(e){return new Pe.default(this,e)}},{key:"workgroupRelationsBuilder",value:function(){return new Yr.default(this)}},{key:"newWorkgroupRelationsFinder",value:function(){return new tn.default(this)}},{key:"workgroupsBuilder",value:function(){return new Kr.default(this)}},{key:"newWorkgroupFinder",value:function(){return new Qr.default(this)}},{key:"workgroupsSearchBuilder",value:function(){return new Zr.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 G.default(this)}},{key:"newTimeseriesFunctionFinder",value:function(){return new ae.default(this)}},{key:"timeseriesFunctionBuilder",value:function(e,t){return new se.default(this,e,t)}},{key:"newTimeseriesFunctionsHelper",value:function(){return new ce.default(this)}},{key:"channelsSearchBuilder",value:function(){return new H.default(this)}},{key:"userProfilesSearchBuilder",value:function(){return new nn.default(this)}},{key:"datamodelsBuilder",value:function(e){return new on.default(this,e)}},{key:"datamodelsHelper",value:function(e,t){return new un.default(this,e,t)}},{key:"newDatamodelsFinder",value:function(){return new ln.default(this)}},{key:"datastreamsBuilder",value:function(){return new fn.default(this)}},{key:"bulkExecutionBuilder",value:function(e,t,r){return new gn.default(this,e,t,r)}},{key:"qratingsBuilder",value:function(){return new hn.default(this)}},{key:"countryCodesSearchBuilder",value:function(){return new Dn.default(this)}},{key:"timezoneSearchBuilder",value:function(){return new Cn.default(this)}},{key:"userLanguagesSearchBuilder",value:function(){return new jn.default(this)}},{key:"newConnectorFunctionsFinder",value:function(){return new Wn.default(this)}},{key:"newConnectorFunctionsCatalogFinder",value:function(){return new Xn.default(this)}},{key:"newConnectorFunctionsCatalog",value:function(){return new ei.default(this)}},{key:"newConnectorFunctionsHelper",value:function(){return new Vn.default(this)}},{key:"connectorFunctionsBuilder",value:function(e,t,r,n){return new $n.default(this,e,t,r,n)}},{key:"connectorFunctionsCatalogBuilder",value:function(e,t){return new Jn.default(this,e,t)}},{key:"provisionProcessorsBuilder",value:function(){return new Bn.default(this)}},{key:"newProvisionProcessorsFinder",value:function(){return new Mn.default(this)}},{key:"newPipelineFinder",value:function(){return new ri.default(this)}},{key:"newTransformerFinder",value:function(){return new ii.default(this)}},{key:"newAIModelFinder",value:function(){return new oi.default(this)}},{key:"transformersBuilder",value:function(){return new ui.default(this)}},{key:"aiModelsBuilder",value:function(){return new li.default(this)}},{key:"pipelinesBuilder",value:function(){return new fi.default(this)}},{key:"manufacturersBuilder",value:function(){return new hi.default(this)}},{key:"manufacturerModelsBuilder",value:function(){return new vi.default(this)}},{key:"newManufacturersFinder",value:function(){return new gi.default(this)}},{key:"newModelFinder",value:function(){return new bi.default(this)}}]),e}();r.default=Ai,t.exports=r.default},{"./AIModels/AIModels":139,"./AIModels/AIModelsFinder":140,"./alarms/AlarmActions":144,"./areas/AreaFinder":149,"./areas/Areas":150,"./bulk/BulkExecutionFinder":152,"./bulk/BulkFinder":153,"./bundles/BundleFinder":155,"./bundles/Bundles":156,"./channels/ChannelFinder":163,"./channels/Channels":164,"./collection/devices/DeviceMessage":165,"./collection/devices/collect/CommsModuleMessage":166,"./collection/devices/collect/Datapoint":167,"./collection/devices/collect/Datastreams":168,"./collection/devices/collect/Hardware":170,"./collection/devices/collect/Mobile":171,"./collection/devices/collect/PowerSupply":172,"./collection/devices/collect/Software":173,"./collection/devices/collect/Storage":174,"./collection/devices/collect/Subscriber":175,"./collection/devices/collect/Subscription":176,"./collection/devices/collect/Usage":177,"./connectorsFunctions/catalog/ConnectorFunctions":187,"./connectorsFunctions/catalog/ConnectorFunctionsCatalog":188,"./connectorsFunctions/catalog/ConnectorFunctionsCatalogFinder":189,"./connectorsFunctions/configuration/ConnectorFunctions":190,"./connectorsFunctions/configuration/ConnectorFunctionsFinder":191,"./connectorsFunctions/configuration/ConnectorFunctionsHelper":192,"./datasets/DatasetFinder":193,"./datasets/Datasets":194,"./domains/Domains":195,"./domains/DomainsFinder":196,"./entities/DeviceFinder":197,"./entities/EntityFinder":198,"./entities/SubscribersFinder":199,"./entities/SubscriptionsFinder":200,"./entities/TicketFinder":201,"./geocluster/Geocluster":202,"./geocluster/GeoclusterFinder":203,"./iot/catalog/Datastream":205,"./iot/catalog/Qrating":206,"./iot/datamodels/Datamodels":207,"./iot/datamodels/DatamodelsFinder":208,"./iot/datamodels/DatamodelsHelper":209,"./manufacturers/Manufacturer":210,"./manufacturers/ManufacturerFinder":211,"./manufacturers/Model":213,"./manufacturers/ModelFinder":214,"./operationTypes/OperationType":216,"./operationTypes/OperationTypeCatalog":217,"./operationTypes/OperationTypeFinder":218,"./operations/OperationActions":219,"./operations/OperationFinder":220,"./operations/Operations":221,"./operations/PeriodicityActions":222,"./organizations/OrganizationFinder":237,"./organizations/Organizations":238,"./pipelines/PipelineFinder":239,"./pipelines/Pipelines":240,"./provision/bulk/BulkExecutionBuilder":242,"./provision/country/CountriesCatalog":243,"./provision/entities/EntityBuilder":249,"./provisionProcessors/provisionProcessors":256,"./provisionProcessors/provisionProcessorsFinder":257,"./rulesConfiguration/RuleConfigurations":258,"./rulesConfiguration/RuleConfigurationsCatalog":259,"./rulesConfiguration/RuleConfigurationsFinder":260,"./rulesConfiguration/RuleConfigurationsHelper":261,"./searching/FilterBuilder":268,"./searching/SelectBuilder":271,"./searching/builder/AdministrativeStateSearchBuilder":274,"./searching/builder/AlarmsSearchBuilder":275,"./searching/builder/AllowedResourceTypeSearchBuilder":276,"./searching/builder/AreasSearchBuilder":277,"./searching/builder/AssetsSearchBuilder":278,"./searching/builder/BasicTypesSearchBuilder":279,"./searching/builder/BulkExecutionSearchBuilder":280,"./searching/builder/BulkSearchBuilder":281,"./searching/builder/BundlesSearchBuilder":282,"./searching/builder/CertificatesSearchBuilder":283,"./searching/builder/ChannelsSearchBuilder":284,"./searching/builder/CommunicationsModuleTypeSearchBuilder":285,"./searching/builder/CountryCodesSearchBuilder":286,"./searching/builder/DatamodelsSearchBuilder":287,"./searching/builder/DatapointsSearchBuilder":288,"./searching/builder/DatasetEntitiesSearchBuilder":289,"./searching/builder/DatasetSearchBuilder":290,"./searching/builder/DatasetsCatalogSearchBuilder":291,"./searching/builder/DatastreamsSearchBuilder":292,"./searching/builder/DevicesPlansSearchBuilder":293,"./searching/builder/DevicesSearchBuilder":294,"./searching/builder/DomainsSearchBuilder":295,"./searching/builder/EntitiesSearchBuilder":296,"./searching/builder/ExecutionsHistorySearchBuilder":297,"./searching/builder/ExecutionsSearchBuilder":298,"./searching/builder/FeedsSearchBuilder":299,"./searching/builder/FieldsDefinitionSearchBuilder":300,"./searching/builder/HardwaresSearchBuilder":302,"./searching/builder/IoTDatastreamAccessSearchBuilder":303,"./searching/builder/IoTDatastreamPeriodSearchBuilder":304,"./searching/builder/IoTDatastreamStoragePeriodSearchBuilder":305,"./searching/builder/MobilePhoneProviderSearchBuilder":306,"./searching/builder/OperationTypesSearchBuilder":307,"./searching/builder/OperationalStatusSearchBuilder":308,"./searching/builder/OperationsSearchBuilder":309,"./searching/builder/PlansSearchBuilder":310,"./searching/builder/RawSearchBuilder":312,"./searching/builder/ResourceTypeSearchBuilder":313,"./searching/builder/RulesSearchBuilder":314,"./searching/builder/ServiceGroupSearchBuilder":317,"./searching/builder/SoftwaresSearchBuilder":318,"./searching/builder/SubscribersSearchBuilder":319,"./searching/builder/SubscriptionsSearchBuilder":320,"./searching/builder/TasksSearchBuilder":321,"./searching/builder/TicketPrioritySearchBuilder":322,"./searching/builder/TicketSeveritySearchBuilder":323,"./searching/builder/TicketStatusSearchBuilder":324,"./searching/builder/TicketsSearchBuilder":325,"./searching/builder/TimeserieSearchBuilder":326,"./searching/builder/TimezoneSearchBuilder":327,"./searching/builder/UserLanguagesSearchBuilder":328,"./searching/builder/UserProfilesSearchBuilder":329,"./searching/builder/UsersSearchBuilder":330,"./searching/builder/WorkgroupsSearchBuilder":331,"./security/CertificateFinder":333,"./security/Certificates":334,"./timeseries/Timeseries":338,"./timeseries/TimeseriesFinder":339,"./timeseriesFunctionsCatalog/TimeseriesFunction":341,"./timeseriesFunctionsCatalog/TimeseriesFunctionFinder":342,"./timeseriesFunctionsCatalog/TimeseriesFunctionsHelper":343,"./transformers/TransformerFinder":344,"./transformers/Transformers":345,"./users/UserFinder":346,"./users/Users":347,"./util/Expression":349,"./util/SelectElement":351,"./workgroups/WorkgroupFinder":357,"./workgroups/WorkgroupRelations":358,"./workgroups/WorkgroupRelationsFinder":359,"./workgroups/Workgroups":360,superagent:131}],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")}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 a=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},o=e("./GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(e){function t(e,r,i,o){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provision/"+r,i,o)}return i(t,e),t}(s.default);r.default=u,t.exports=r.default},{"./GenericFinder":141}],144:[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 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}}(),o=e("./actions/AlarmAttendBuilder"),s=n(o),u=e("./actions/AlarmCloseBuilder"),c=n(u),l=function(){function e(t){i(this,e),this._ogapi=t}return a(e,[{key:"newCloseBuilder",value:function(){return new c.default(this._ogapi)}},{key:"newAttendBuilder",value:function(){return new s.default(this._ogapi)}}]),e}();r.default=l,t.exports=r.default},{"./actions/AlarmAttendBuilder":147,"./actions/AlarmCloseBuilder":148}],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")}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}}(),a=e("q"),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=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=o.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=s,t.exports=r.default},{q:120}],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")}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}}(),a=e("./Alarm"),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=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 o.default(this._ogapi,this._resource,this._build)}}]),e}();r.default=s,t.exports=r.default},{"./Alarm":145}],147:[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 a=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},o=e("./AlarmActionBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"ATTEND")}return i(t,e),t}(s.default);r.default=u,t.exports=r.default},{"./AlarmActionBuilder":146}],148:[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 a=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},o=e("./AlarmActionBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"CLOSE")}return i(t,e),t}(s.default);r.default=u,t.exports=r.default},{"./AlarmActionBuilder":146}],149:[function(e,t,r){"use strict"
|
|
29
29
|
;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 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}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("../ProvisionGenericFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations","area","Area/s not found")}return i(t,e),a(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}(u.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":143}],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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("./TYPE_ENUM"),c=e("../provision/BaseProvision"),l=n(c),p=e("../util/formats/check_types"),f=n(p),d=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations/",void 0,["identifier","organization","type","coordinates"])}return a(t,e),o(t,[{key:"_buildURL",value:function(){return"provision/organizations/"+this._organization+"/areas/"+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._checkStringAndLength(e,50,"identifier"),this._identifier=e,this}},{key:"withName",value:function(e){return f.default._checkStringAndLength(e,50,"name"),this._name=e,this}},{key:"withColor",value:function(e){return f.default._checkStringAndLength(e,50,"color"),this._color=e,this}},{key:"withDescription",value:function(e){return f.default._checkStringAndLength(e,50,"description"),this._description=e,this}},{key:"withOrder",value:function(e){return f.default._checkNumber(e,"order"),this._order=e,this}},{key:"withGeometry",value:function(e,t){return f.default._checkType(e,u.TYPE_ENUM),f.default._checkArray(t,"coordinates"),this._type=e,this._coordinates=t,this}},{key:"withEntities",value:function(e){return f.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=s(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this);return delete e.identifier,e}}]),t}(l.default);r.default=d,t.exports=r.default},{"../provision/BaseProvision":241,"../util/formats/check_types":353,"./TYPE_ENUM":151}],151:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["Polygon","Point","LineString"];r.TYPE_ENUM=n},{}],152:[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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../GenericFinder"),c=n(u),l=e("q"),p=(n(l),e("http-status-codes")),f=(n(p),["application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]);r.MIME_TYPES_ENUM=f;var d=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provisionProcessors/provision/organizations","value","Bulk not found")}return a(t,e),o(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===f.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(f)+"'>");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=d},{"../GenericFinder":141,"http-status-codes":76,q:120}],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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../ProvisionGenericFinder"),c=n(u),l=e("q"),p=(n(l),e("http-status-codes")),f=(n(p),function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations","bulk/async","Bulk not found"),this._raw=!1}return a(t,e),o(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=f,t.exports=r.default},{"../ProvisionGenericFinder":143,"http-status-codes":76,q:120}],154:[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},{}],155:[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 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}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("../ProvisionGenericFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"bundles","bundle","Bundle not found")}return i(t,e),a(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}(u.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":143}],156:[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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("./ACTION_ENUM"),c=e("./deployment/DeploymentElement"),l=n(c),p=e("q"),f=n(p),d=e("../provision/BaseProvision"),h=n(d),m=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/bundles")}return a(t,e),o(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===u.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(u.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=f.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=f.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=f.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 a=0;if(e._deploymentElements[i]._validators&&e._deploymentElements[i]._validators.length>0)for(a=0;a<e._deploymentElements[i]._validators.length;a++)"TRUSTED_BOOT"===e._deploymentElements[i]._validators[a].mode&&(n+=1)}if(n>1)throw new Error("OGAPI_422_ONE_TRUSTED_BOOT_ALLOWED")}e._allPromisesOk=!0;var o=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,s(t)})}():t.resolve(n)}():s({statusCode:r.statusCode})},s=function(r){e.delete(),t.reject(r)};return e.create().then(o).catch(s),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=f.default.defer(),n=r.promise,i=function(e){201===e.statusCode?r.resolve(e):a({statusCode:e.statusCode})},a=function(e){r.reject(e)};return this._ogapi.newBundleFinder().findByNameAndVersion(this._name,this._version).then(function(n){204===n.statusCode?s(Object.getPrototypeOf(t.prototype),"create",e).call(e).then(i).catch(a):r.reject({errors:[{code:204,message:"OGAPI_400_BUNDLE_EXIST"}],statusCode:400})}).catch(function(n){404===n.statusCode?s(Object.getPrototypeOf(t.prototype),"create",e).call(e).then(i).catch(a):r.reject({errors:[{code:204,message:"OGAPI_400_BUNDLE_EXIST"}],statusCode:400})}),n}},{key:"update",value:function(){var e=f.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}(h.default);r.default=m,t.exports=r.default},{"../provision/BaseProvision":241,"./ACTION_ENUM":154,"./deployment/DeploymentElement":157,q:120}],157:[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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("./OPERATION_ENUM"),c=e("./OPTION_ENUM"),l=e("./TYPE_ENUM"),p=e("./TYPE_VALIDATORS_ENUM"),f=e("./MODE_VALIDATORS_ENUM"),d=e("q"),h=n(d),m=e("../../provision/BaseProvision"),v=n(m),y=function(e){function t(e,r,n,a){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,r,n+"/deploymentElements"),this._progressEvent=a,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 a(t,e),o(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===u.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(u.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===f.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(f.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=f.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===p.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(p.TYPE_VALIDATORS_ENUM)+"'>");if(t.type=i,t.mode===f.MODE_VALIDATORS_ENUM[0]){if(!e.value)throw new Error("Parameter value is required when mode is "+f.MODE_VALIDATORS_ENUM[0]);var a=e.value;if("string"!=typeof a)throw new Error("Parameter value must be a string");t.value=a}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=h.default.defer(),a=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)}),a}},{key:"deploy",value:function(){return this.createWithFile(this._rawFile)}},{key:"update",value:function(){throw new Error("OGAPI_DEPLOYMENT_ELEMENT_NOT_UPDATED")}}]),t}(v.default);r.default=y,t.exports=r.default},{"../../provision/BaseProvision":241,"./MODE_VALIDATORS_ENUM":158,"./OPERATION_ENUM":159,"./OPTION_ENUM":160,"./TYPE_ENUM":161,"./TYPE_VALIDATORS_ENUM":162,q:120}],158:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["PLATFORM","TRUSTED_BOOT"];r.MODE_VALIDATORS_ENUM=n},{}],159:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["INSTALL","UNINSTALL","UPGRADE"];r.OPERATION_ENUM=n},{}],160:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["MANDATORY","OPTIONAL"];r.OPTION_ENUM=n},{}],161:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["SOFTWARE","FIRMWARE","CONFIGURATION","PARAMETERS"];r.TYPE_ENUM=n},{}],162:[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},{}],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")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../ProvisionGenericFinder"),c=n(u),l=e("q"),p=n(l),f=e("http-status-codes"),d=n(f),h=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations","channel","Channel not found")}return a(t,e),o(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=p.default.defer(),i=n.promise;return this._executeWorkgroupRelation().then(function(e){if(204===e.statusCode)n.reject({data:r,statusCode:d.default.NO_CONTENT});else{var t=e.data,i=[];for(var a in t.channels)i.push({organization:t.channels[a].organization,name:t.channels[a].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,a=p.default.defer(),o=a.promise;return n._executeWorkgroupRelation().then(function(e){if(204===e.statusCode)a.reject({data:i,statusCode:d.default.NOT_FOUND});else{var t=e.data,r=[];for(var o in t.channels)n._organization===t.channels[o].organization&&r.push({organization:t.channels[o].organization,name:t.channels[o].channel});r.length>0?a.resolve({data:r,statusCode:e.statusCode}):a.reject({data:i,statusCode:d.default.NOT_FOUND})}}).catch(function(e){a.reject(e)}),o}},{key:"_executeWorkgroupRelation",value:function(){var e="provision/domains/"+this._domain+"/workgroups/"+this._workgroup+"/relations",t=p.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:d.default.NOT_FOUND}):t.resolve({data:e.body.workgroupRelation,statusCode:e.statusCode})}).catch(function(e){t.reject(e)}),r}}]),t}(c.default);r.default=h,t.exports=r.default},{"../ProvisionGenericFinder":143,"http-status-codes":76,q:120}],164:[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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),
|
|
30
30
|
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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("q"),c=(n(u),e("../provision/BaseProvision")),l=n(c),p=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations",void 0,["name","organization"]),this._ogapi=e}return a(t,e),o(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=s(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this);return delete e.channel.name,e}}]),t}(l.default);r.default=p,t.exports=r.default},{"../provision/BaseProvision":241,q:120}],165:[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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("q"),c=n(u),l=e("./collect/Event"),p=n(l),f=e("../devices/collect/Datastreams"),d=n(f),h=function(e){function t(e,r,n){i(this,t),s(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 a(t,e),o(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 d.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=s(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}(p.default);r.default=h,t.exports=r.default},{"../devices/collect/Datastreams":168,"./collect/Event":169,q:120}],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 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}}(),o=e("./enum/ANTENNA_STATUS_ENUM"),s=e("./Hardware"),u=n(s),c=e("./Software"),l=n(c),p=e("./Mobile"),f=n(p),d=e("./Subscriber"),h=n(d),m=e("./Subscription"),v=n(m),y=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 a(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 u.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,o.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 f.default))throw new Error("Parameter mobile must be Mobile type");return this._mobile=e,this}},{key:"withSubscriber",value:function(e){if(!(e instanceof h.default))throw new Error("Parameter subscriber must be Subscriber type");return this._subscriber=e,this}},{key:"withSubscription",value:function(e){if(!(e instanceof v.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=y,t.exports=r.default},{"./Hardware":170,"./Mobile":171,"./Software":173,"./Subscriber":175,"./Subscription":176,"./enum/ANTENNA_STATUS_ENUM":179}],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}}(),a=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=a,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}}(),a=e("./Datapoint"),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=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 o.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=s,t.exports=r.default},{"./Datapoint":167}],169:[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 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}}(),o=e("q"),s=(n(o),e("./Hardware")),u=n(s),c=e("./Software"),l=n(c),p=e("./Usage"),f=n(p),d=e("./Storage"),h=n(d),m=e("./PowerSupply"),v=n(m),y=e("./CommsModuleMessage"),g=n(y),_=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 a(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 u.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,_.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 f.default))throw new Error("Parameter cpuUsage must be Usage type");return this._cpuUsage=e,this}},{key:"withRam",value:function(e){if(!(e instanceof h.default))throw new Error("Parameter ram must be Storage type");return this._ram=e,this}},{key:"withVolatilStorage",value:function(e){if(!(e instanceof h.default))throw new Error("Parameter volatilStorage must be Storage type");return this._volatilStorage=e,this}},{key:"withNonVolatilStorage",value:function(e){if(!(e instanceof h.default))throw new Error("Parameter nonVolatilStorage must be Storage type");return this._nonVolatilStorage=e,this}},{key:"withPowerSupply",value:function(e){if(!(e instanceof v.default))throw new Error("Parameter powerSupply must be PowerSupply type");return this._powerSupply=e,this}},{key:"withCommsModule",value:function(e){if(!(e instanceof g.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),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":166,"./Hardware":170,"./PowerSupply":172,"./Software":173,"./Storage":174,"./Usage":177,"./enum/LEVEL_TREND_ENUM":182,"./enum/TEMPERATURE_STATUS_ENUM":185,q:120}],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}}(),a=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=a,t.exports=r.default},{}],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")}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}}(),a=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=a,t.exports=r.default},{}],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}}(),a=e("./enum/POWER_SUPPLY_SOURCE_ENUM"),o=e("./enum/BATTERY_CHARGE_STATUS_ENUM"),s=e("./enum/BATTERY_CHARGE_LEVEL_STATUS_ENUM"),u=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,a.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,o.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,u.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,s.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":180,"./enum/BATTERY_CHARGE_STATUS_ENUM":181,"./enum/LEVEL_TREND_ENUM":182,"./enum/POWER_SUPPLY_SOURCE_ENUM":183}],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}}(),a=e("q"),o=(function(e){e&&e.__esModule}(a),e("./enum/SOFTWARE_TYPE_ENUM")),s=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,o.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){
|
|
31
|
-
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=s,t.exports=r.default},{"./enum/SOFTWARE_TYPE_ENUM":184,q:120}],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")}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 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}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("./Usage"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this._unit=void 0,this._total=void 0}return i(t,e),a(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=o(Object.getPrototypeOf(t.prototype),"composeElement",this).call(this);return{unit:this._unit,total:this._total,usage:e}}}]),t}(u.default);r.default=c,t.exports=r.default},{"./Usage":177}],175:[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}}(),a=e("./Hardware"),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=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 o.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=s,t.exports=r.default},{"./Hardware":170}],176:[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}}(),a=e("./enum/ADDRESS_TYPE_ENUM"),o=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,a.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=o,t.exports=r.default},{"./enum/ADDRESS_TYPE_ENUM":178}],177:[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}}(),a=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=a,t.exports=r.default},{}],178:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["IPV4","IPV6","MAC"];r.ADDRESS_TYPE_ENUM=n},{}],179:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["OK","SHORT_CIRCUIT","OPEN","UNKONW"];r.ANTENNA_STATUS_ENUM=n},{}],180:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["CHARGING","CHARGED"];r.BATTERY_CHARGE_LEVEL_STATUS_ENUM=n},{}],181:[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},{}],182:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["RISING","DECREASING","FLAT","EMPTY"];r.LEVEL_TREND_ENUM=n},{}],183:[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},{}],184:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["FIRMWARE","SOFTWARE"];r.SOFTWARE_TYPE_ENUM=n},{}],185:[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},{}],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 a=["TEXT","JSON","BINARY"];r.CONNECTOR_FUNCTION_PAYLOAD_TYPES=a;var o=["https://","wss://","mqtts://"];r.CONNECTOR_FUNCTION_SOUTH_PROTOCOLS=o},{}],187:[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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../../InternalOpenGateAPI"),c=(n(u),e("../../provision/BaseProvision")),l=n(c),p=e("../_CONNECTOR_FUNCTIONS_ENUMS"),f=function(e){function t(e,r,n){if(i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/catalog",void 0,["name","operationalStatus","type","cloneable","javascript","payloadType"]),r&&this.withIdentifier(r),n)for(var a=Object.keys(n),o=0;o<a.length;o++){var u=a[o],c=n[u];if(c){var l=u.charAt(0).toUpperCase+u.slice(1);this["with"+l](c)}}}return a(t,e),o(t,[{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:"withOperationalStatus",value:function(e){if("string"!=typeof e||!this._checkValues(e,p.CONNECTOR_FUNCTION_OPERATIONAL_STATUS))throw new Error("Parameter operational status must be a string and must be one of these values: "+p.CONNECTOR_FUNCTION_OPERATIONAL_STATUS);return this._operationalStatus=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:"withType",value:function(e){if("string"!=typeof e||!this._checkValues(e,p.CONNECTOR_FUNCTION_TYPES))throw new Error("Parameter type must be a string and must be one of these values: "+p.CONNECTOR_FUNCTION_TYPES);return this._type=e,this}},{key:"withCloneable",value:function(e){if("boolean"!=typeof e)throw new Error("Parameter cloneable must be a boolean");return this._cloneable=e,this}},{key:"withNorthCriterias",value:function(e){if(!(e instanceof Array))throw new Error({message:"Parameter northCriterias requires an array",parameter:"northCriterias"});return this._northCriterias=e,this}},{key:"addNorthCriteria",value:function(e){if("object"!=typeof e||!e.path||"string"!=typeof e.path||!e.value||"object"!=typeof e.value)throw new Error({message:"Parameter northCriteria requires path and value",parameter:"northCriteria"});return this._northCriterias||(this._northCriterias=[]),this._northCriterias.push(e),this}},{key:"withSouthCriterias",value:function(e){var t=this;if(!(e instanceof Array))throw new Error({message:"Parameter southCriterias requires an array",parameter:"southCriterias"});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("southCriteria must be a string");return this._southCriterias||(this._southCriterias=[]),this._southCriterias.push(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:"withPayloadType",value:function(e){if("string"!=typeof e||!this._checkValues(e,p.CONNECTOR_FUNCTION_PAYLOAD_TYPES))throw new Error("Parameter payload type must be a string and must be one of these values: "+p.CONNECTOR_FUNCTION_PAYLOAD_TYPES);return this._payloadType=e,this}},{key:"_composeElement",value:function(){return{name:this._name,description:this._description?this._description:void 0,operationalStatus:this._operationalStatus,operationName:"REQUEST"===this._type?this._operationName:void 0,type:this._type,cloneable:this._cloneable,northCriterias:this._northCriterias,southCriterias:this._southCriterias,javascript:this._javascript,payloadType:this._payloadType}}},{key:"_checkRequiredParameters",value:function(e){if(e&&void 0===this._identifier)throw new Error({message:"Parameter identifier must be defined",parameter:"identifier"});try{s(Object.getPrototypeOf(t.prototype),"_checkRequiredParameters",this).call(this)}catch(e){throw e}switch(this._type){case"REQUEST":if(void 0===this._operationName||void 0===this._northCriterias||0===this._northCriterias.length)throw new Error("Parameters operationName and northCriteria must be defined when type REQUEST");if("JSON"!==this._payloadType)throw new Error("Parameter payload type must be JSON when type REQUEST");break;case"COLLECTION":case"RESPONSE":if(void 0===this._southCriterias||0===this._southCriterias.length)throw new Error("Parameters southCriteria must be defined when type COLLECTION or RESPONSE")}}},{key:"_buildURL",value:function(){return"connectorFunctions/"+this._resource+"/"+this._identifier}},{key:"create",value:function(){return this._checkRequiredParameters(),this._doSouthPost("connectorFunctions/"+this._resource,this._composeElement())}},{key:"update",value:function(){return this._checkRequiredParameters(!0),this._doSouthPut(this._buildURL(),this._composeElement())}},{key:"delete",value:function(){if(void 0===this._identifier)throw new Error({message:"Parameter identifier must be defined",parameter:"identifier"});return this._doSouthDelete()}}]),t}(l.default);r.default=f,t.exports=r.default},{"../../InternalOpenGateAPI":142,"../../provision/BaseProvision":241,"../_CONNECTOR_FUNCTIONS_ENUMS":186}],188:[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 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}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("../../GenericFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"connectorFunctions/provision/catalog","connectorFunctions","Connector functions not found")}return i(t,e),a(t,[{key:"getConnectorFunctionsCatalog",value:function(){return this._execute(!0)}},{key:"_composeUrl",value:function(){return this._baseUrl}}]),t}(u.default);r.default=c,t.exports=r.default},{"../../GenericFinder":141}],189:[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 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}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("../../GenericFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"connectorFunctions/provision/catalog","connectorFunctions","Connector functions not found")}return i(t,e),a(t,[{key:"findByConnectorFunctionsId",value:function(e){return this._withId(e),this._execute(!0)}}]),t}(u.default);r.default=c,t.exports=r.default},{"../../GenericFinder":141}],190:[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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../../provision/BaseProvision"),c=n(u),l=e("../_CONNECTOR_FUNCTIONS_ENUMS"),p=e("q"),f=n(p),d=function(e){function t(e,r,n,a,o){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations"),this.withOrganization(r),this.withChannel(n),a&&this.withIdentifier(a),o&&(o.name&&this.withName(o.name),o.operationName&&this.withOperationName(o.operationName),o.operationalStatus&&this.withOperationalStatus(o.operationalStatus),o.type&&this.withType(o.type),o.payloadType&&this.withPayloadType(o.payloadType),o.description&&this.withDescription(o.description),o.northCriterias&&this.withNorthCriterias(o.northCriterias),o.southCriterias&&this.withSouthCriterias(o.southCriterias),o.javascript&&this.withJavascript(o.javascript))}return a(t,e),o(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=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":241,"../_CONNECTOR_FUNCTIONS_ENUMS":186,q:120}],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 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}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("../../GenericFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"connectorFunctions/provision/organizations","connectorFunctions","Connector functions not found")}return i(t,e),a(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}(u.default);r.default=c,t.exports=r.default},{"../../GenericFinder":141}],192:[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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../../GenericFinder"),c=n(u),l=e("q"),p=n(l),f=e("http-status-codes"),d=n(f),h=e("../_CONNECTOR_FUNCTIONS_ENUMS"),m=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"connectorFunctions"),this._jsHeaders={accept:"application/javascript"},this._mdHeaders={accept:"text/markdown"}}return a(t,e),o(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=p.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:d.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}},{key:"getSouthCriteriasProtocols",value:function(){return h.CONNECTOR_FUNCTION_SOUTH_PROTOCOLS}},{key:"getPayloadTypes",value:function(){return h.CONNECTOR_FUNCTION_PAYLOAD_TYPES}}]),t}(c.default);r.default=m,t.exports=r.default},{"../../GenericFinder":141,"../_CONNECTOR_FUNCTIONS_ENUMS":186,"http-status-codes":76,q:120}],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 a=function(){function e(e,t){
|
|
31
|
+
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=s,t.exports=r.default},{"./enum/SOFTWARE_TYPE_ENUM":184,q:120}],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")}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 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}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("./Usage"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this._unit=void 0,this._total=void 0}return i(t,e),a(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=o(Object.getPrototypeOf(t.prototype),"composeElement",this).call(this);return{unit:this._unit,total:this._total,usage:e}}}]),t}(u.default);r.default=c,t.exports=r.default},{"./Usage":177}],175:[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}}(),a=e("./Hardware"),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=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 o.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=s,t.exports=r.default},{"./Hardware":170}],176:[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}}(),a=e("./enum/ADDRESS_TYPE_ENUM"),o=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,a.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=o,t.exports=r.default},{"./enum/ADDRESS_TYPE_ENUM":178}],177:[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}}(),a=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=a,t.exports=r.default},{}],178:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["IPV4","IPV6","MAC"];r.ADDRESS_TYPE_ENUM=n},{}],179:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["OK","SHORT_CIRCUIT","OPEN","UNKONW"];r.ANTENNA_STATUS_ENUM=n},{}],180:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["CHARGING","CHARGED"];r.BATTERY_CHARGE_LEVEL_STATUS_ENUM=n},{}],181:[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},{}],182:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["RISING","DECREASING","FLAT","EMPTY"];r.LEVEL_TREND_ENUM=n},{}],183:[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},{}],184:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["FIRMWARE","SOFTWARE"];r.SOFTWARE_TYPE_ENUM=n},{}],185:[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},{}],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 a=["TEXT","JSON","BINARY"];r.CONNECTOR_FUNCTION_PAYLOAD_TYPES=a;var o=["https://","wss://","mqtts://","snmps://","dlms://"];r.CONNECTOR_FUNCTION_SOUTH_PROTOCOLS=o},{}],187:[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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../../InternalOpenGateAPI"),c=(n(u),e("../../provision/BaseProvision")),l=n(c),p=e("../_CONNECTOR_FUNCTIONS_ENUMS"),f=function(e){function t(e,r,n){if(i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/catalog",void 0,["name","operationalStatus","type","cloneable","javascript","payloadType"]),r&&this.withIdentifier(r),n)for(var a=Object.keys(n),o=0;o<a.length;o++){var u=a[o],c=n[u],l=u.charAt(0).toUpperCase()+u.slice(1);this["with"+l](c)}}return a(t,e),o(t,[{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:"withOperationalStatus",value:function(e){if("string"!=typeof e||!this._checkValues(e,p.CONNECTOR_FUNCTION_OPERATIONAL_STATUS))throw new Error("Parameter operational status must be a string and must be one of these values: "+p.CONNECTOR_FUNCTION_OPERATIONAL_STATUS);return this._operationalStatus=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:"withType",value:function(e){if("string"!=typeof e||!this._checkValues(e,p.CONNECTOR_FUNCTION_TYPES))throw new Error("Parameter type must be a string and must be one of these values: "+p.CONNECTOR_FUNCTION_TYPES);return this._type=e,this}},{key:"withCloneable",value:function(e){if("boolean"!=typeof e)throw new Error("Parameter cloneable must be a boolean");return this._cloneable=e,this}},{key:"withNorthCriterias",value:function(e){if(!(e instanceof Array))throw new Error({message:"Parameter northCriterias requires an array",parameter:"northCriterias"});return this._northCriterias=e,this}},{key:"addNorthCriteria",value:function(e){if("object"!=typeof e||!e.path||"string"!=typeof e.path||!e.value||"object"!=typeof e.value)throw new Error({message:"Parameter northCriteria requires path and value",parameter:"northCriteria"});return this._northCriterias||(this._northCriterias=[]),this._northCriterias.push(e),this}},{key:"withSouthCriterias",value:function(e){var t=this;if(!(e instanceof Array))throw new Error({message:"Parameter southCriterias requires an array",parameter:"southCriterias"});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("southCriteria must be a string");return this._southCriterias||(this._southCriterias=[]),this._southCriterias.push(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:"withPayloadType",value:function(e){if("string"!=typeof e||!this._checkValues(e,p.CONNECTOR_FUNCTION_PAYLOAD_TYPES))throw new Error("Parameter payload type must be a string and must be one of these values: "+p.CONNECTOR_FUNCTION_PAYLOAD_TYPES);return this._payloadType=e,this}},{key:"_composeElement",value:function(){return{name:this._name,description:this._description?this._description:void 0,operationalStatus:this._operationalStatus,operationName:"REQUEST"===this._type?this._operationName:void 0,type:this._type,cloneable:this._cloneable,northCriterias:this._northCriterias,southCriterias:this._southCriterias,javascript:this._javascript,payloadType:this._payloadType}}},{key:"_checkRequiredParameters",value:function(e){if(e&&void 0===this._identifier)throw new Error({message:"Parameter identifier must be defined",parameter:"identifier"});try{s(Object.getPrototypeOf(t.prototype),"_checkRequiredParameters",this).call(this)}catch(e){throw e}switch(this._type){case"REQUEST":if(void 0===this._operationName||void 0===this._northCriterias||0===this._northCriterias.length)throw new Error("Parameters operationName and northCriteria must be defined when type REQUEST");if("JSON"!==this._payloadType)throw new Error("Parameter payload type must be JSON when type REQUEST");break;case"COLLECTION":case"RESPONSE":if(void 0===this._southCriterias||0===this._southCriterias.length)throw new Error("Parameters southCriteria must be defined when type COLLECTION or RESPONSE")}}},{key:"_buildURL",value:function(){return"connectorFunctions/"+this._resource+"/"+this._identifier}},{key:"create",value:function(){return this._checkRequiredParameters(),this._doSouthPost("connectorFunctions/"+this._resource,this._composeElement())}},{key:"update",value:function(){return this._checkRequiredParameters(!0),this._doSouthPut(this._buildURL(),this._composeElement())}},{key:"delete",value:function(){if(void 0===this._identifier)throw new Error({message:"Parameter identifier must be defined",parameter:"identifier"});return this._doSouthDelete()}}]),t}(l.default);r.default=f,t.exports=r.default},{"../../InternalOpenGateAPI":142,"../../provision/BaseProvision":241,"../_CONNECTOR_FUNCTIONS_ENUMS":186}],188:[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 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}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("../../GenericFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"connectorFunctions/provision/catalog","connectorFunctions","Connector functions not found")}return i(t,e),a(t,[{key:"getConnectorFunctionsCatalog",value:function(){return this._execute(!0)}},{key:"_composeUrl",value:function(){return this._baseUrl}}]),t}(u.default);r.default=c,t.exports=r.default},{"../../GenericFinder":141}],189:[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 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}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("../../GenericFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"connectorFunctions/provision/catalog","connectorFunctions","Connector functions not found")}return i(t,e),a(t,[{key:"findByConnectorFunctionsId",value:function(e){return this._withId(e),this._execute(!0)}}]),t}(u.default);r.default=c,t.exports=r.default},{"../../GenericFinder":141}],190:[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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../../provision/BaseProvision"),c=n(u),l=e("../_CONNECTOR_FUNCTIONS_ENUMS"),p=e("q"),f=n(p),d=function(e){function t(e,r,n,a,o){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations"),this.withOrganization(r),this.withChannel(n),a&&this.withIdentifier(a),o&&(o.name&&this.withName(o.name),o.operationName&&this.withOperationName(o.operationName),o.operationalStatus&&this.withOperationalStatus(o.operationalStatus),o.type&&this.withType(o.type),o.payloadType&&this.withPayloadType(o.payloadType),o.description&&this.withDescription(o.description),o.northCriterias&&this.withNorthCriterias(o.northCriterias),o.southCriterias&&this.withSouthCriterias(o.southCriterias),o.javascript&&this.withJavascript(o.javascript))}return a(t,e),o(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=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":241,"../_CONNECTOR_FUNCTIONS_ENUMS":186,q:120}],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 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}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("../../GenericFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"connectorFunctions/provision/organizations","connectorFunctions","Connector functions not found")}return i(t,e),a(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}(u.default);r.default=c,t.exports=r.default},{"../../GenericFinder":141}],192:[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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../../GenericFinder"),c=n(u),l=e("q"),p=n(l),f=e("http-status-codes"),d=n(f),h=e("../_CONNECTOR_FUNCTIONS_ENUMS"),m=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"connectorFunctions"),this._jsHeaders={accept:"application/javascript"},this._mdHeaders={accept:"text/markdown"}}return a(t,e),o(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=p.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:d.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}},{key:"getSouthCriteriasProtocols",value:function(){return h.CONNECTOR_FUNCTION_SOUTH_PROTOCOLS}},{key:"getPayloadTypes",value:function(){return h.CONNECTOR_FUNCTION_PAYLOAD_TYPES}}]),t}(c.default);r.default=m,t.exports=r.default},{"../../GenericFinder":141,"../_CONNECTOR_FUNCTIONS_ENUMS":186,"http-status-codes":76,q:120}],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 a=function(){function e(e,t){
|
|
32
32
|
for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.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(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("../GenericFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"datasets/provision/organizations","datasets")}return i(t,e),a(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}(u.default);r.default=c,t.exports=r.default},{"../GenericFinder":141}],194:[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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../provision/BaseProvision"),c=n(u),l=e("../util/formats/check_types"),p=n(l),f=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations/",void 0,["name","organization","columns","identifierColumn"])}return a(t,e),o(t,[{key:"_buildURL",value:function(){var e="datasets/provision/organizations/"+this._organization+"/"+this._identifier;return this._onlyPlan&&(e+="?onlyPlan=true"),e}},{key:"withOrganization",value:function(e){return p.default._checkStringAndLength(e,50,"organization"),this._organization=e,this}},{key:"withIdentifier",value:function(e){return p.default._checkString(e,"identifier"),this._identifier=e,this}},{key:"withName",value:function(e){return p.default._checkString(e,"name"),this._name=e,this}},{key:"withIdentifierColumn",value:function(e){return p.default._checkString(e,"identifierColumn"),this._identifierColumn=e,this}},{key:"withDescription",value:function(e){return e&&p.default._checkString(e,"description"),this._description=e,this}},{key:"withColumns",value:function(e){return p.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:"_composeUpdateElement",value:function(){return{name:this._name,description:this._description,type:this._type,identifierColumn:this._identifierColumn,columns:this._columns}}},{key:"onlyPlan",value:function(){return this._onlyPlan=!0,this}}]),t}(c.default);r.default=f,t.exports=r.default},{"../provision/BaseProvision":241,"../util/formats/check_types":353}],195:[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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("q"),c=(n(u),e("../provision/BaseProvision")),l=n(c),p=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/domains"),this._ogapi=e}return a(t,e),o(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=s(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this);return delete e.domain.name,e}}]),t}(l.default);r.default=p,t.exports=r.default},{"../provision/BaseProvision":241,q:120}],196:[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 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}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("../ProvisionGenericFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"domains","domain","Domain not found")}return i(t,e),a(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}(u.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":143}],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 a=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},o=e("./EntityFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"device","Device not found")}return i(t,e),t}(s.default);r.default=u,t.exports=r.default},{"./EntityFinder":198}],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")}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 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}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("../ProvisionGenericFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e,r,i,a){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations",r||"entity",i||"Entity not found"),this._entitySource=a||"entities",this._flattened=!1}return i(t,e),a(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}(u.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":143}],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")}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 a=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},o=e("./EntityFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"subscriber","Subscriber not found")}return i(t,e),t}(s.default);r.default=u,t.exports=r.default},{"./EntityFinder":198}],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")}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 a=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},o=e("./EntityFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"subscription","Subscription not found")}return i(t,e),t}(s.default);r.default=u,t.exports=r.default},{"./EntityFinder":198}],201:[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 a=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},o=e("./EntityFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"ticket","Ticket not found","tickets")}return i(t,e),t}(s.default);r.default=u,t.exports=r.default},{"./EntityFinder":198}],202:[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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("q"),c=n(u),l=e("../provision/BaseProvision"),p=n(l),f=e("../util/formats/check_types"),d=n(f),h=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/geocluster",void 0,"identifier")}return a(t,e),o(t,[{key:"_buildURL",value:function(){return"provision/geocluster/"+this._identifier+"/clustering"}},{key:"withIdentifier",value:function(e){return d.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 s(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}(p.default);r.default=h,t.exports=r.default},{"../provision/BaseProvision":241,"../util/formats/check_types":353,q:120}],203:[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 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}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("../ProvisionGenericFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"geocluster","geocluster","Geocluster not found")}return i(t,e),a(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}(u.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":143}],204:[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}}(),a=e("./Datastream"),o=(function(e){e&&e.__esModule}(a),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=o,t.exports=r.default},{"./Datastream":205}],205:[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}}(),a=e("ajv"),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=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 o.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=s,t.exports=r.default},{ajv:2}],206:[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}}(),a=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=a,t.exports=r.default},{}],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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../../provision/BaseProvision"),c=n(u),l=e("../catalog/Category"),p=n(l),f=e("../catalog/Datastream"),d=(n(f),"/organizations");r.PRE_RESOURCE=d;var h="/datamodels";r.DATAMODELS_RESOURCE=h;var m=function(e){function t(e,r){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,d),this._isValidString(r,"organization",50),this._organization=r,this._categories=[],this._resourceType=[],this._resource=this._resource+"/"+this._organization+h}return a(t,e),o(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 p.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");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=m},{"../../provision/BaseProvision":241,"../catalog/Category":204,"../catalog/Datastream":205}],208:[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 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}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("../../ProvisionGenericFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s);r.DATAMODEL_RESOURCE="/datamodels/";var c=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations/","datamodels","Datamodel not found")}return i(t,e),a(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}(u.default);r.default=c},{"../../ProvisionGenericFinder":143}],209:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){
|
|
33
33
|
if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../../provision/BaseProvision"),c=n(u),l=e("../catalog/Category"),p=n(l),f=e("../catalog/Datastream"),d=(n(f),"/organizations");r.PRE_RESOURCE=d;r.POST_RESOURCE="/datamodels";var h=function(e){function t(e,r,n){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,d),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 a(t,e),o(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 p.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,a){i.identifier===e&&(r=a,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 p.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,a){switch(i.identifier){case e:r=a;break;case t.identifier:n=a}}),-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,a){r.identifier===e&&(n=a,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=h},{"../../provision/BaseProvision":241,"../catalog/Category":204,"../catalog/Datastream":205}],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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../provision/BaseProvision"),c=n(u),l=e("./ManufacturerMedia"),p=n(l),f=e("./Model"),d=n(f),h=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/manufacturers",void 0,["identifier","name"])}return a(t,e),o(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 p.default(this._ogapi,this._identifier)}},{key:"modelBuilder",value:function(){if(!this._identifier)throw new Error("Required manufacturer identifier and name");return new d.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=h,t.exports=r.default},{"../provision/BaseProvision":241,"./ManufacturerMedia":212,"./Model":213}],211:[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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../ProvisionGenericFinder"),c=n(u),l=e("q"),p=n(l),f=e("http-status-codes"),d=n(f),h=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"manufacturers","manufacturer","Manufacturer not found")}return a(t,e),o(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=p.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:d.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=h,t.exports=r.default},{"../ProvisionGenericFinder":143,"http-status-codes":76,q:120}],212:[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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("q"),c=n(u),l=e("../provision/BaseProvision"),p=n(l),f=function(e){function t(e,r){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/manufacturers/"+r+"/media",void 0,["identifier","name"])}return a(t,e),o(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(),a=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)}),a}}]),t}(p.default);r.default=f,t.exports=r.default},{"../provision/BaseProvision":241,q:120}],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")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../provision/BaseProvision"),c=n(u),l=e("./Manufacturer"),p=n(l),f=e("./ModelMedia"),d=n(f),h=function(e){function t(e,r){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/models",void 0,["identifier","name","manufacturer"]),this._manufacturer=r}return a(t,e),o(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 p.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 p.default(this._ogapi)),this._manufacturer.withName(e),this}},{key:"mediaBuilder",value:function(){if(!this._identifier)throw new Error("Required model identifier");return new d.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=h,t.exports=r.default},{"../provision/BaseProvision":241,"./Manufacturer":210,"./ModelMedia":215}],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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../ProvisionGenericFinder"),c=n(u),l=e("q"),p=n(l),f=e("http-status-codes"),d=n(f),h=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"models","model","Model not found")}return a(t,e),o(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=p.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:d.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=h,t.exports=r.default},{"../ProvisionGenericFinder":143,"http-status-codes":76,q:120}],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")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("q"),c=n(u),l=e("../provision/BaseProvision"),p=n(l),f=function(e){function t(e,r){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/models/"+r+"/media",void 0,["identifier"])}return a(t,e),o(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(),a=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)}),a}}]),t}(p.default);r.default=f,t.exports=r.default},{"../provision/BaseProvision":241,q:120}],216:[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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../provision/BaseProvision"),c=n(u),l=e("q"),p=n(l),f=function(e){function t(e,r,n,a){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations"),this.withOrganization(r),n&&this.withIdentifier(n),a&&(a.name&&this.withName(a.name),a.title&&this.withTitle(a.title),a.description&&this.withDescription(a.description),a.fromCatalog&&this.fromCatalog(a.fromCatalog),!n&&a.fromCatalog||(a.steps&&this.withSteps(a.steps),a.parameters&&this.withParameters(a.parameters),a.models&&this.withModels(a.models),a.applicableTo&&this.applicableTo(a.applicableTo)))}return a(t,e),o(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=p.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=f,t.exports=r.default},{"../provision/BaseProvision":241,q:120}],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")}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 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}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("../GenericFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"operationTypes/catalog","operationType","Operation types not found")}return i(t,e),a(t,[{key:"getOperationTypes",value:function(){return this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl}}]),t}(u.default);r.default=c,t.exports=r.default},{"../GenericFinder":141}],218:[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 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}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("../GenericFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"operationTypes/provision/organizations","operationTypes","Operation type not found")}return i(t,e),a(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}(u.default);r.default=c,t.exports=r.default},{"../GenericFinder":141}],219:[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 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}}(),o=e("q"),s=n(o),u=e("moment"),c=n(u),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 a(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",
|
|
34
34
|
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=s.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=s.default.defer(),i=n.promise;return r._ogapi.newOperationFinder().findById(r._operationId).then(function(i){var a=i.data;if(a&&0!=Object.keys(a).length){var o=a.taskId;if(o)switch(r._resource=r._resource+o,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=o,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=s.default.defer(),n=r.promise,i=this;return i._ogapi.newOperationFinder().findById(i._operationId).then(function(n){var a=n.data;a?function(){var n=!!a.operation&&a.operation.active;n?i.pause().then(function(a){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=s.default.defer(),a=i.promise,o={};return o[n._key]=e,this._ogapi.Napi.put(this._resource,o).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))}),a}},{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:116,q:120}],220:[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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../GenericFinder"),c=n(u),l=e("q"),p=n(l),f=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this._limit=void 0}return a(t,e),o(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=p.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=p.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=f,t.exports=r.default},{"../GenericFinder":141,q:120}],221:[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 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}}(),o=e("./catalog/BaseOperationBuilder"),s=n(o),u=e("./catalog/period/PeriodicityUpdateBuilder"),c=n(u),l=e("q"),p=n(l),f=e("merge"),d=n(f),h=function(){function e(t){i(this,e),this._ogapi=t,this._operations=[],this._operationNames=[]}return a(e,[{key:"updatePeriodicityBuilder",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"operationId"});var t=p.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=p.default.defer(),r=t.promise,n=e.toUpperCase(),i=this._findOperation(n),a=this;return void 0===i?this._loadOperationCatalog().then(function(){var e=a._findOperation(n);void 0===e?t.reject("Operation <'"+n+"'> unavailable."):t.resolve(a._createBuilder(e.config))}):t.resolve(this._createBuilder(i.config)),r}},{key:"getOperationList",value:function(){return(0,d.default)(!0,this._operationNames)}},{key:"_createBuilder",value:function(e){return new s.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=p.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 a=n[i].name.toUpperCase();e._operationNames.push(a),e._operations.push({name:a,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=h,t.exports=r.default},{"./catalog/BaseOperationBuilder":224,"./catalog/period/PeriodicityUpdateBuilder":232,merge:112,q:120}],222:[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}}(),a=e("q"),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=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=o.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=o.default.defer(),i=n.promise;return r._ogapi.newOperationFinder().findPeriodicityByPeriodicityId(r._taskId).then(function(i){var a=i.data;if(a&&0!=Object.keys(a).length){var o=a.id;switch(r._resource=r._resource+o,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=o,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=o.default.defer(),n=r.promise,i=this;return i._ogapi.newOperationFinder().findPeriodicityByPeriodicityId(i._taskId).then(function(n){var a=n.data;a?function(){var n=!!a.task&&"ACTIVE"===a.task.state;n?i.pause().then(function(a){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=o.default.defer(),a=i.promise,s={};return s[n._key]=e,this._ogapi.Napi.put(this._resource,s).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))}),a}},{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=s,t.exports=r.default},{q:120}],223:[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}}(),a=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=a,t.exports=r.default},{}],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 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}}(),o=e("merge"),s=n(o),u=e("./Operation"),c=n(u),l=e("./parameters/ParameterBuilderFactory"),p=(n(l),e("./AppendEntitiesBy")),f=n(p),d=e("./period/ExecuteEachBuilder"),h=n(d),m=e("./period/ExecuteEveryBuilder"),v=n(m),y=e("moment"),g=n(y),_=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}},x=function(){function e(t,r){i(this,e),this._ajv=new w.default({useDefaults:"empty",coerceTypes:!0}),this.appendEntitiesBy=new f.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 a(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:g.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 a=Array.prototype.slice.call(arguments),o=this._getName(a.slice(1,3)),s=this._getEnd(a.slice(1,3));return this._build.active=n,new v.default(this,e,o,s,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 a=Array.prototype.slice.call(arguments),o=this._getName(a.slice(1,3)),s=this._getEnd(a.slice(1,3));return this._build.active=n,new h.default(this,e,o,s,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:g.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(g.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(g.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(g.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,s.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,a=this._build.schedule.stop;if(void 0!==i.repeating.period){var o=void 0;switch(i.repeating.period.unit){case"DAYS":o=g.default.duration(i.repeating.period.each,"days").asMilliseconds();break;case"HOURS":o=g.default.duration(i.repeating.period.each,"hours").asMilliseconds();break;case"MINUTES":o=g.default.duration(i.repeating.period.each,"minutes").asMilliseconds()}void 0!==a&&"number"==typeof a.delayed?a.delayed>=o&&n.push("You can not execute an operation with a job timeout greater than the repetition period."):(a=g.default.duration(o,"milliseconds").asMinutes()-1,console.info("Not specified the job timeout. By default, timeout will be "+a+" minutes"),this.withJobTimeout(a))}}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 u=new c.default(this._ogapi,e,r);return this._build=t,u}},{key:"_convertToTask",value:function(e){var t=e.task;this.executeImmediately();var r=this._convertToJob(this._build),n=(0,g.default)(new Date),i=(0,g.default)(t.start),a={task:{active:!0,name:t.name,description:t.description,job:r.job,schedule:{start:{date:i.format(_.DATE_FORMAT)},repeating:t.repeating}}};if(void 0!==t.stop&&(void 0!==t.stop.date?a.task.schedule.stop={date:(0,g.default)(t.stop.date).format(_.DATE_FORMAT)}:a.task.schedule.stop=t.stop),g.default.max(n,i)==n){if(void 0!==t.stop&&void 0!==t.stop.date){var o=(0,g.default)(t.stop.date);if(g.default.max(n,o)==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 a.task.schedule.start}return a}},{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=x,t.exports=r.default},{"./../../util/DATE_FORMAT":348,"./AppendEntitiesBy":223,"./Operation":225,"./parameters/ParameterBuilderFactory":227,"./period/ExecuteEachBuilder":229,"./period/ExecuteEveryBuilder":230,ajv:2,merge:112,moment:116}],225:[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}}(),a=e("q"),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=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=o.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=o.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=s,t.exports=r.default},{q:120}],226:[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 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}}(),o=e("moment"),s=(function(e){e&&e.__esModule}(o),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 a(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){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=s,t.exports=r.default},{moment:116}],227:[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"),a=(function(e){e&&e.__esModule}(i),function e(t,r,i){n(this,e)});r.default=a,t.exports=r.default},{"./BaseParameterBuilderWithParent":226}],228:[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},{}],229:[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 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}}(),o=e("merge"),s=n(o),u=e("moment"),c=n(u),l=function(){function e(t,r,n,a,o){if(i(this,e),this._parent=t,this._skeleton={start:r,stop:a,name:n,description:o,repeating:{period:{each:void 0,unit:void 0}}},void 0!==a){var s=void 0;if("number"==typeof a){if(a<=0)throw new Error("Invalid stop value. Number of repetitions must be greater than 0.");s={executions:a}}else if(a.constructor===Date){var u=(0,c.default)(r),l=(0,c.default)(a);if(c.default.max(u,l)==u)throw new Error("Invalid stop date on executeEach method. Start date must be earlier than stop date.");s={date:a}}this._skeleton.stop=s}}return a(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,s.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:116}],230:[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")}
|
|
@@ -44,4 +44,4 @@ configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__prot
|
|
|
44
44
|
text:'const date = {\n "fromString": function (stringDate) {\n return new Date(stringDate);\n },\n \n "toString": function (date) {\n return date.toISOString();\n },\n "compare": function (date1, date2) {\n if (typeof date1 === \'string\') date1 = this.fromString(date1);\n if (typeof date2 === \'string\') date2 = this.fromString(date2);\n return date1.getTime() - date2.getTime();\n }\n };\n \n const data = {\n "exists": function (value) {\n return value !== null && value !== undefined;\n },\n "undefinedToNull": function (obj) {\n if(!this.exists(obj)) return null;\n \n if(obj.constructor === Array) {\n for(var element in obj){\n obj[element] = this.undefinedToNull(obj[element]);\n }\n return obj;\n } else if(obj.constructor === Object) {\n Object.keys(obj).forEach((key) => {\n obj[key] = this.undefinedToNull(obj[key]);\n });\n return obj;\n } else {\n return obj;\n }\n }\n };\n \n const result = {\n "OK_RESULT": "OK",\n "columns": {},\n \n "ok": function (value, ...extraParams) {\n var result = {\n "executionResult": this.OK_RESULT,\n "value": value,\n "extra": {}\n };\n \n for (var extraArg in extraParams) {\n Object.assign(result.extra, extraParams[extraArg]);\n }\n log.trace("aggResult: ", result);\n return result;\n },\n \n "error": function (caughtError) {\n if (caughtError instanceof Error) {\n log.error("Caught error: ", caughtError.message, " - ", caughtError.cause);\n var exceptionResult = {\n "executionResult": caughtError.message\n };\n log.trace("exceptionResult: ", exceptionResult);\n return exceptionResult;\n } else {\n log.error("Caught error: ", caughtError);\n var exceptionResult = {\n "executionResult": caughtError\n };\n log.trace("exceptionResult: ", exceptionResult);\n return exceptionResult;\n }\n }\n };\n \n const aggFunct = {\n "AVG": function (receivedValues, currentValue, extra) {\n var newCount = receivedValues.length;\n var newSum = 0;\n for (var recVal in receivedValues) {\n newSum = newSum + receivedValues[recVal].value;\n }\n if (extra) {\n if (data.exists(extra.COUNT)) newCount = newCount + extra.COUNT;\n if (data.exists(extra.SUM)) newSum = newSum + extra.SUM;\n }\n var newValue = newSum / newCount;\n return result.ok(newValue, { "SUM": newSum }, { "COUNT": newCount });\n },\n \n "MIN": function (receivedValues, currentValue, extra) {\n var newValue = currentValue;\n for (var recVal in receivedValues) {\n if (!data.exists(newValue) || receivedValues[recVal].value < newValue) {\n newValue = receivedValues[recVal].value;\n }\n }\n return result.ok(newValue);\n },\n \n "LAST": function (receivedValues, currentValue, extra) {\n var newAt;\n var newValue = currentValue;\n if (extra) {\n if (data.exists(extra.AT)) newAt = extra.AT;\n }\n for (var recVal in receivedValues) {\n if (!data.exists(newAt) || date.compare(receivedValues[recVal].at, newAt) > 0) {\n newAt = receivedValues[recVal].at;\n newValue = receivedValues[recVal].value;\n }\n }\n return result.ok(newValue, { "AT": newAt });\n },\n \n "MAX": function (receivedValues, currentValue, extra) {\n var newValue = currentValue;\n for (var recVal in receivedValues) {\n if (!data.exists(newValue) || receivedValues[recVal].value > newValue) {\n newValue = receivedValues[recVal].value;\n }\n }\n return result.ok(newValue);\n },\n \n "COUNT": function (receivedValues, currentValue, extra) {\n var newValue = receivedValues.length;\n if (data.exists(currentValue)) {\n newValue = newValue + currentValue;\n }\n return result.ok(newValue);\n },\n \n "GEO_AVG": function (receivedValues, currentValue, extra) {\n var newCount = receivedValues.length;\n var newProduct = 1;\n for (var recVal in receivedValues) {\n newProduct = newProduct * receivedValues[recVal].value;\n }\n if (extra) {\n if (data.exists(extra.COUNT)) newCount = newCount + extra.COUNT;\n if (data.exists(extra.PRODUCT)) newProduct = newProduct * extra.PRODUCT;\n }\n var newValue = Math.pow(newProduct, 1 / newCount);\n return result.ok(newValue, { "PRODUCT": newProduct }, { "COUNT": newCount });\n },\n \n "SUM": function (receivedValues, currentValue, extra) {\n var newValue = 0;\n for (var recVal in receivedValues) {\n newValue = newValue + receivedValues[recVal].value;\n }\n if (data.exists(currentValue)) {\n newValue = newValue + currentValue;\n }\n return result.ok(newValue);\n },\n \n "MEDIAN": function (receivedValues, currentValue, extra) {\n var receivedValuesFlattened = receivedValues.map(function (rv) { return rv.value });\n var completeArray;\n if (extra && extra.VAL_ARRAY) {\n completeArray = extra.VAL_ARRAY.concat(receivedValuesFlattened)\n } else {\n completeArray = receivedValuesFlattened;\n }\n completeArray.sort(function (a, b) { return a - b });\n var middle_index = Math.floor(completeArray.length / 2);\n var newMedian;\n if (completeArray.length % 2) {\n newMedian = completeArray[middle_index];\n } else {\n newMedian = (completeArray[middle_index - 1] + completeArray[middle_index]) / 2.0;\n }\n return result.ok(newMedian, { "VAL_ARRAY": completeArray });\n },\n \n "VARIANCE": function (receivedValues, currentValue, extra) {\n var receivedValuesFlattened = receivedValues.map(function (rv) { return rv.value });\n var completeArray;\n if (extra && extra.VAL_ARRAY) {\n completeArray = extra.VAL_ARRAY.concat(receivedValuesFlattened)\n } else {\n completeArray = receivedValuesFlattened;\n }\n \n var sum = 0;\n completeArray.map(e => sum += e);\n var avg = sum / completeArray.length;\n var newValue = 0;\n for (var item in completeArray) {\n newValue = newValue + Math.pow(completeArray[item] - avg, 2);\n }\n newValue = newValue / completeArray.length;\n return result.ok(newValue, { "VAL_ARRAY": completeArray });\n },\n \n "FIRST": function (receivedValues, currentValue, extra) {\n var newAt;\n var newValue = currentValue;\n if (extra) {\n if (data.exists(extra.AT)) newAt = extra.AT;\n }\n for (var recVal in receivedValues) {\n if (!data.exists(newAt) || date.compare(receivedValues[recVal].at, newAt) < 0) {\n newAt = receivedValues[recVal].at;\n newValue = receivedValues[recVal].value;\n }\n }\n return result.ok(newValue, { "AT": newAt });\n },\n \n "STD_DEVIATION": function (receivedValues, currentValue, extra) {\n var variance = this.VARIANCE(receivedValues, currentValue, extra);\n var newValue = Math.sqrt(variance.value);\n return result.ok(newValue, { "VAL_ARRAY": variance.extra.VAL_ARRAY });\n }\n };\n \n module.exports = {\n date,\n data,\n result,\n aggFunct\n } \n '},statusCode:200}),t}},{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=p.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:d.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=m,t.exports=r.default},{"../GenericFinder":141,"./TYPES_ENUM":340,"http-status-codes":76,q:120}],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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../GenericFinder"),c=n(u),l=e("q"),p=(n(l),e("http-status-codes")),f=(n(p),function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"ai","list","Transformer not found","north")}return a(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+"/transformers"+(this._identifier?"/"+this._identifier+(this._filename?"/"+this._filename:""):"")}}]),t}(c.default));r.default=f,t.exports=r.default},{"../GenericFinder":141,"http-status-codes":76,q:120}],345:[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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("q"),c=n(u),l=e("../provision/BaseProvision"),p=n(l),f=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations",void 0,["organization","files"],"north/ai"),this._ogapi=e}return a(t,e),o(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=s(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}(p.default);r.default=f,t.exports=r.default},{"../provision/BaseProvision":241,q:120}],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 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}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("../ProvisionGenericFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"users","user","User not found")}return i(t,e),a(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}(u.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":143}],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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../provision/BaseProvision"),c=n(u),l=e("q"),p=(n(l),e("lodash")),f=n(p),d=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/users",void 0,["email","workgroup","domain","profile","countryCode","langCode"])}return a(t,e),o(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,f.default.isEmpty(this._email)||f.default.isEmpty(this._password)||f.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(f.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,f.default.isEmpty(this._email))throw new Error("OGAPI_USER_MAIL_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED");if(f.default.isEmpty(this._newPassword))throw new Error("OGAPI_USER_PASSWORD_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED");if(f.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,f.default.isEmpty(this._email)||f.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=d,t.exports=r.default},{"../provision/BaseProvision":241,lodash:111,q:120}],348:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.DATE_FORMAT="";r.TIME_FORMAT="HH:mm:ssZ"},{}],349:[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 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}}(),o=function(){function e(){i(this,e)}return a(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=o,t.exports=r.default},{}],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")}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}}(),o=e("merge"),s=n(o),u=e("urlencode"),c=n(u),l=e("superagent"),p=n(l),f=e("q"),d=n(f),h=e("lodash"),m=n(h),v=e("mime-types"),y=n(v),g=e("superagent-mocker"),_=n(g),b=(0,_.default)(p.default),w=function(){function e(t,r){i(this,e),this._options=s.default.recursive(!0,this.default(),t),this._headers=r,m.default.isEmpty(t.mocks)||this._applyMocks(t.mocks)}return a(e,[{key:"_applyMocks",value:function(e){var t=this;Object.keys(e).filter(function(t){return!m.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];b[r](t._options.url+n,function(t){if("function"==typeof i)return console.log("Function returned"),i(t);var a=e[r][n];return console.log("Data returned:",a),a.headers||(a.headers={}),a})})})}},{key:"default",value:function(){return{timeout:5e3}}},{key:"_url",value:function(e){return e.url}},{key:"get",value:function(e,t,r,n,i,a){var o=this._createUrl(e,n,a);console.info("GET",o);var s=p.default.get(o);return this._createPromiseRequest(s,null,t,r,i)}},{key:"patch",value:function(e,t,r,n,i,a){var o=this._createUrl(e,i,a);console.info("PATCH",o);var s=p.default.patch(o).send(t);return this._createPromiseRequest(s,null,r,n)}},{key:"post",value:function(e,t,r,n,i,a){var o=this._createUrl(e,i,a);console.info("POST",o);var s=p.default.post(o).send(t);return this._createPromiseRequest(s,null,r,n)}},{key:"post_multipart",value:function(e,t,r,n,i,a,o){var s=this._createUrl(e,a,o);console.info("POST_MULTIPART",s);var u=p.default.post(s);return this._prepareMultipartForm(t,u),this._createPromiseRequest(u,r,n,i)}},{key:"put",value:function(e,t,r,n,i,a){var o=this._createUrl(e,i,a);console.info("PUT",o);var s=p.default.put(o).send(t);return n?n["Content-Type"]="application/json":n={"Content-Type":"application/json"},this._createPromiseRequest(s,null,r,n)}},{key:"put_multipart",value:function(e,t,r,n,i,a,o){var s=this._createUrl(e,a,o);console.info("PUT_MULTIPART",s);var u=p.default.put(s);return this._prepareMultipartForm(t,u),this._createPromiseRequest(u,r,n,i)}},{key:"_prepareMultipartForm",value:function(e,t){var r=!0;Object.keys(e).forEach(function(n){switch(n){case"meta":case"json":case"file":t.field(n,e[n]),delete e[n];break;case"metadata":t.attach(n,e[n]),r=!1;break;case"hardwareMedia":case"certificate":case"processorBulkFile":t.attach("file",e[n]),r=!1;break;case"files":e[n].forEach(function(e,r){if(e.path){var i=e.path.replace(/^.*[\\\/]/,""),a=y.default.lookup(i);a?t.attach(n,e,{filename:i,contentType:a}):i.endsWith(".py")?t.attach(n,e,{filename:i,contentType:"text/x-python"}):t.attach(n,e,{filename:i})}else t.attach(n,e)}),delete e[n],r=!1;break;case"script":case"modelFile":t.field(n,e[n]),delete e[n],r=!1;break;case"bulkFile":t.set("Content-Type",e.ext),e=e.bulkFile}}),r&&t.send(e)}},{key:"delete",value:function(e,t,r,n,i,a){var o=this._createUrl(e,n,a);console.info("DELETE",o);var s;return s=i?p.default.del(o).send(i):p.default.del(o),this._createPromiseRequest(s,null,t,r)}},{key:"_createUrl",value:function(e,t,r){var n=[];if(t)for(var i=Object.keys(t),a=0;a<i.length;a++){var o=i[a],s=o+"="+t[o];e=0===a?e+"?"+s:e+"&"+s}var u=e.split("/"),l=u.length;return u.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 a=r;void 0!==a&&null!==a||(a=this._options.timeout);var o=d.default.defer(),s=o.promise,u=this._options.apiKey,c=this._options.jwt,l=-1===a?e:e.timeout(a);if(c&&!this._isSouth?l=l.set("Authorization","Bearer "+c):u&&(l=l.set("X-ApiKey",this._options.apiKey)),n)for(var p=Object.keys(n),f=0;f<p.length;f++){var h=p[f];void 0!==n[h]&&(l=l.set(h,n[h]))}if(t)for(var m in t)l=l.on(m,t[m]);return i&&e.responseType("blob"),l=l.end(function(e,t){if(null!==e){console.error("OGAPI ERROR: ");try{console.log(JSON.stringify(e))}catch(e){console.log(e)}var r=void 0,n=void 0,i=e.status?e.status:void 0,a={errors:[{code:i,message:"OGAPI: Something is broken. Please contact with your administrator."}]};void 0!==e.response?(r=e.response.body?e.response.body:a,n=e.response.headers,i=e.status):i?(r=e.message,i=408):(r=a,i=500),o.reject({statusCode:i,data:r,headers:n})}else o.resolve(t)}),s}}]),e}();r.default=w,t.exports=r.default},{lodash:111,merge:112,"mime-types":115,q:120,superagent:131,"superagent-mocker":129,urlencode:138}],351:[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}}(),a=function(){function e(){n(this,e)}return i(e,null,[{key:"element",value:function(e,t){return{name:e,fields:t}}}]),e}();r.default=a,t.exports=r.default},{}],352:[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 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)}}
|
|
45
45
|
return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("./NorthAmpliaREST"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e,r){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r),this._isSouth=!0}return i(t,e),a(t,[{key:"_url",value:function(e){return e.south.url}}]),t}(u.default);r.default=c,t.exports=r.default},{"./NorthAmpliaREST":350}],353:[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}-[01]d-[0-3]dT[0-2]d:[0-5]d:[0-5]d.d+([+-][0-2]d:[0-5]d|Z))|(d{4}-[01]d-[0-3]dT[0-2]d:[0-5]d:[0-5]d([+-][0-2]d:[0-5]d|Z))|(d{4}-[01]d-[0-3]dT[0-2]d:[0-5]d([+-][0-2]d:[0-5]d|Z))").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})}}},{}],354:[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 a(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 o,s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.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=e("q"),c=n(u),l=e("lodash"),p=n(l),f=e("./source-precompiled/Fields"),d=e("./IotFields"),h=f.GENERATED_FIELDS;for(var m in d.IOT_FIELDS)if(h[m])for(var v in d.IOT_FIELDS[m])h[m][v]=d.IOT_FIELDS[m][v];else h[m]=d.IOT_FIELDS[m];var y=new RegExp("^(.+)._current\\.?(.+)?$"),g=new RegExp("\\[[0-9]+\\]"),_=(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"},x={DEVICE_PART_SUBSCRIBER:"subscriber",DEVICE_PART_SUBSCRIPTION:"subscription",DEVICE_PART_COMMSMODULE:"communicationsModule",DEVICE_PART_DEVICE:"device"},A=["relColl","relProv"],O=["DEVICE_PART_SUBSCRIBER","DEVICE_PART_SUBSCRIPTION","DEVICE_PART_COMMSMODULE","DEVICE_PART_DEVICE"],S=["subscriber","subscription","communicationsModule","device"],P="search",D={get:function(e){if(O.indexOf(_[e])>=0)return"complex";switch(_[e]){case"SearchOnDatamodel":return P;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,a=t.selectAll,o=t.extraData&&t.extraData.organization,s=e._ogapi.datamodelsSearchBuilder(),u={and:[]};return e._resourceTypes&&u.and.push({in:{"datamodels.allowedResourceTypes":e._resourceTypes}}),o&&u.and.push({eq:{"datamodels.organizationName":o}}),i&&u.and.push({eq:{"datamodels.categories.datastreams.identifier":i}}),u.and.length>0&&s.filter(u),s.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||a?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},C=function(e,t,r,n){var i=r.selectedField,a=[],o=r.extraData.organization,s=r.extraData[t.entity];e._ogapi[t.api]()[t.method](o,s).then(function(t){if(200===t.statusCode){t.data.identifierColumn&&a.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&&a.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"}}),t.data.bucketInitColumn&&a.push({identifier:t.data.bucketInitColumn,name:t.data.bucketInitColumn,path:"provision.administration.identifier._current.at",indexed:!0,sort:!0,notFilterable:!1,filter:"YES",type:"date-time",schema:{type:"string",format:"datetime"}});var o=p.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){o=o.filter(function(e){return i===(e.name||e.alias)});var s=o[0],u=s.path.match(y),c=u[1].replace(g,"[]");r.selectedField=c}k(e,r).then(function(e){o.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,a.push(t)}),n.resolve(a)}).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)})},T=(o={},a(o,P,function(e,t){k(this,e).then(function(e){t.resolve(e)}).catch(function(e){t.reject(e)})}),a(o,"simple",function(e,t){var r=e.context,n=e.primaryType,i=e.selectedField,a=[];if(r[n]instanceof Array)i?function(){var e=0,t=null;for(e=0;null===t&&e<r[n].length;e++)!function(){var a=r[n][e];a.toLowerCase()===i.toLowerCase()||a.toLowerCase()===i.toLowerCase()+"name"?t=a:b[n]&&(b[n]instanceof Array?b[n].forEach(function(e){a.toLowerCase()!==e+i.toLowerCase()&&a.toLowerCase()!==e+"."+i.toLowerCase()&&a.toLowerCase()!==e+i.toLowerCase()+"name"&&a.toLowerCase()!==e+"."+i.toLowerCase()+"name"||t||(t=a)}):a.toLowerCase()!==b[n]+i.toLowerCase()&&a.toLowerCase()!==b[n]+"."+i.toLowerCase()&&a.toLowerCase()!==b[n]+i.toLowerCase()+"name"&&a.toLowerCase()!==b[n]+"."+i.toLowerCase()+"name"||(t=a))}();t&&a.push(t)}():a=r[n].slice();else if(i)if(r[n][i])a.push(r[n][i]);else for(var o=Object.keys(r[n]),s=0;s<o.length;s++)r[n][o[s]].toLowerCase().indexOf(i.toLowerCase())>-1&&a.push(r[n][o[s]]);else for(var o=Object.keys(r[n]),s=0;s<o.length;s++)a.push(r[n][o[s]]);t.resolve(a.slice())}),a(o,"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 a=e.states,o=e.context,s=e.primaryType,u={1:function(e,t){return t[s].concat(S.filter(n,x[s]))},2:function(e,t){try{return i(e,r(e[0],t).concat(A))}catch(e){return[]}},3:function(e,t){var n=e[1];if(-1===A.indexOf(n))return[];try{return i(e,r(e[0],t))}catch(e){return[]}}},c=a.length,l=u[c];return void 0===l?t.resolve([]):t.resolve(l(a,o))}),a(o,"dataset",function(e,t){C(this,{api:"newDatasetFinder",method:"findByOrganizationAndDatasetId",entity:"dataset"},e,t)}),a(o,"timeserie",function(e,t){C(this,{api:"newTimeserieFinder",method:"findByOrganizationAndTimeserieId",entity:"timeserie"},e,t)}),o),j=function(){function e(t,r,n){i(this,e),this._ogapi=t,this._url=r,this._type=D.get(r),this._extraData=n,this._type===P&&(this._resourceTypes=w.get(r))}return s(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:h[_[this._url]],primaryType:_[this._url],extraData:this._extraData};return T[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:h[_[this._url]],primaryType:_[this._url],selectAll:!0,extraData:this._extraData};return T[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:h[_[this._url]],primaryType:_[this._url],selectedField:e,extraData:this._extraData};return T[this._type].call(this,r,t),t.promise}}]),e}();r.default=j,t.exports=r.default},{"./IotFields":355,"./source-precompiled/Fields":356,lodash:111,q:120}],355:[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},{}],356:[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},{}],357:[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 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}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("../ProvisionGenericFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"domains","workgroup","Workgroup not found")}return i(t,e),a(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}(u.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":143}],358:[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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../provision/BaseProvision"),c=n(u),l=e("./Workgroups"),p=n(l),f=e("../channels/Channels"),d=n(f),h=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/domains",void 0,["workgroup","channels"]),this._ogapi=e,this._action="CREATE"}return a(t,e),o(t,[{key:"withWorkgroup",value:function(e){if(e.constructor.prototype!=p.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!=d.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=h,t.exports=r.default},{"../channels/Channels":164,"../provision/BaseProvision":241,"./Workgroups":360}],359:[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 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}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("../ProvisionGenericFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"domains","workgroup","Workgroup relation not found")}return i(t,e),a(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}(u.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":143}],360:[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 a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value: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),
|
|
46
46
|
Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("q"),c=n(u),l=e("../provision/BaseProvision"),p=n(l),f=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/domains",void 0,["name","domainName"]),this._ogapi=e}return a(t,e),o(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}(p.default);r.default=f,t.exports=r.default},{"../provision/BaseProvision":241,q:120}]},{},[1]);
|
|
47
|
-
//# sourceMappingURL=opengate-api-bower-12.
|
|
47
|
+
//# sourceMappingURL=opengate-api-bower-12.14.0.min.js.map
|