@devoinc/app-developer-kit
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -19,3 +19,3 @@ import { IQueryClient } from '../clients/query/QueryClient.interface'; | ||
getQueryClient(): Promise<IQueryClient>; | ||
getAlertsClient(alertsUrl: string): Promise<IAlertsClient>; | ||
getAlertsClient(): Promise<IAlertsClient>; | ||
abstract createNotiPop(request: NotiPopRequest): Promise<void>; | ||
@@ -22,0 +22,0 @@ abstract getUserInfo(): Promise<UserInfo>; |
@@ -20,6 +20,4 @@ import { IClient as IAlertsClient } from '@devoinc/alerts-api-client'; | ||
* @public | ||
* | ||
* @param alertsUrl - The alerts API URL. | ||
*/ | ||
getAlertsClient(alertsUrl: string): Promise<IAlertsClient>; | ||
getAlertsClient(): Promise<IAlertsClient>; | ||
/** | ||
@@ -26,0 +24,0 @@ * Create a notification on the screen. |
@@ -1,2 +0,2 @@ | ||
import{client as e}from"@devoinc/browser-sdk";import{Client as t}from"@devoinc/alerts-api-client";import*as n from"@devoinc/alerts-api-client";export{n as AlertsApiClient};const r=e=>new Promise(((t,n)=>{let r=!1;document.addEventListener("applicationBuilderDependencies",(e=>{var o;e.preventDefault();const s=e,i=null===(o=null==s?void 0:s.detail)||void 0===o?void 0:o.dependencies;i?(r=!0,t(i)):n(new Error("Devo dependencies not found"))})),document.dispatchEvent(new CustomEvent("getVappDeps")),window.setTimeout((()=>{r||n(new Error("Initialization timeout"))}),e)})),o=e=>{document.addEventListener("beforeChangeContainer",(t=>{t.preventDefault(),e()}))},s={processQuery:e=>{const t=s.processQueryDates(e.queryString,e.dates);return{queryString:e.queryString,dates:t}},processQueryDates:(e,t)=>{let n=t;return e.startsWith("from my.lookuplist.")&&(n=s.getDateForLookupTable()),n},getDateForLookupTable:()=>{const e=new Date,t=new Date(e);t.setDate(e.getDate()-1);return{from:t.setHours(0,0,0,0)-60*t.getTimezoneOffset()*1e3,to:e.setHours(0,0,0,0)-60*e.getTimezoneOffset()*1e3}}};class i{constructor(e){this._userInfo=e}runQuery(e){return new Promise(((t,n)=>{const r=this.getBrowserSDKClient();let o;const i=[],a=s.processQuery(e);r.streamFetch({query:a.queryString,dateFrom:a.dates.from,dateTo:a.dates.to},{data:e=>{this.processEventData(e,o,(e=>{i.push(e)}))},meta:e=>{o=e},error:e=>{n(e)},done:()=>{t(i)}})}))}runCompactQuery(e){return new Promise(((t,n)=>{const r=this.getBrowserSDKClient(),o=s.processQuery(e);r.streamFetch({query:o.queryString,dateFrom:o.dates.from,dateTo:o.dates.to},{meta:e=>{const n={fields:{}};e.forEach(((e,t)=>{n.fields[e.name]={index:t,type:e.type}})),t(n)},error:e=>{n(e)}})}))}runStreamQuery(e,t,n,r){let o;const s=this.getBrowserSDKClient().streamFetch({query:e,dateFrom:t||new Date(Date.now()),dateTo:-1},{data:e=>{this.processEventData(e,o,n)},meta:e=>{o=e},error:e=>{r(e)},done:()=>{r(new Error("Stream query is done"))}});return()=>{s.abort()}}getBrowserSDKClient(){const t=this._userInfo.credentials,n=t.serrea,r=t.apiKey,o=t.apiSecret;return e({url:n,apiKey:r,apiSecret:o})}processEventData(e,t,n){e.forEach((e=>{const r={};t&&t.forEach(((t,n)=>{const o=t.name;r[o]=e[n]})),n(r)}))}}class a{constructor(e){this._token=e}getAuthorization(){return this._token}}class c extends class{async getQueryClient(){const e=await this.getUserInfo();return new i(e)}async getAlertsClient(e){const n=(await this.getUserInfo()).credentials.standAloneToken,r=new a(n);return new t(r,e)}}{constructor(e){super(),this._config=e,o((()=>this.onAppUnmount()))}async getUserInfo(){return(await this.getRuntimeDependencies()).userInfo}async goToQuery(e){(await this.getRuntimeDependencies()).goToQuery(e.queryString,e.dates)}async createNotiPop(e){const t=await this.getRuntimeDependencies();t.NotiPop&&new t.NotiPop(e)}async getRuntimeDependencies(){var e,t,n;let o;if(null===(e=this._config)||void 0===e?void 0:e.standaloneDependencies)o=this._config.standaloneDependencies;else{const e=null!==(n=null===(t=this._config)||void 0===t?void 0:t.timeout)&&void 0!==n?n:5e3;o=await r(e)}return o}onAppUnmount(){var e;const t=null===(e=this._config)||void 0===e?void 0:e.onAppUnmount;t&&t()}}class u{static init(e){const t=new c(e);return this._instance=t,this._instance}static getInstance(){if(!this._instance)throw new Error("DevoAppProvider is not initialized");return this._instance}}u._instance=void 0;export{u as DevoAppProvider}; | ||
import{client as e}from"@devoinc/browser-sdk";import{Client as t}from"@devoinc/alerts-api-client";import*as n from"@devoinc/alerts-api-client";export{n as AlertsApiClient};const r=e=>new Promise(((t,n)=>{let r=!1;document.addEventListener("applicationBuilderDependencies",(e=>{var s;e.preventDefault();const o=e,i=null===(s=null==o?void 0:o.detail)||void 0===s?void 0:s.dependencies;i?(r=!0,t(i)):n(new Error("Devo dependencies not found"))})),document.dispatchEvent(new CustomEvent("getVappDeps")),window.setTimeout((()=>{r||n(new Error("Initialization timeout"))}),e)})),s=e=>{document.addEventListener("beforeChangeContainer",(t=>{t.preventDefault(),e()}))},o={processQuery:e=>{const t=o.processQueryDates(e.queryString,e.dates);return{queryString:e.queryString,dates:t}},processQueryDates:(e,t)=>{let n=t;return e.startsWith("from my.lookuplist.")&&(n=o.getDateForLookupTable()),n},getDateForLookupTable:()=>{const e=new Date,t=new Date(e);t.setDate(e.getDate()-1);return{from:t.setHours(0,0,0,0)-60*t.getTimezoneOffset()*1e3,to:e.setHours(0,0,0,0)-60*e.getTimezoneOffset()*1e3}}};class i{constructor(e){this._userInfo=e}runQuery(e){return new Promise(((t,n)=>{const r=this.getBrowserSDKClient();let s;const i=[],a=o.processQuery(e);r.streamFetch({query:a.queryString,dateFrom:a.dates.from,dateTo:a.dates.to},{data:e=>{this.processEventData(e,s,(e=>{i.push(e)}))},meta:e=>{s=e},error:e=>{n(e)},done:()=>{t(i)}})}))}runCompactQuery(e){return new Promise(((t,n)=>{const r=this.getBrowserSDKClient(),s=o.processQuery(e);r.streamFetch({query:s.queryString,dateFrom:s.dates.from,dateTo:s.dates.to},{meta:e=>{const n={fields:{}};e.forEach(((e,t)=>{n.fields[e.name]={index:t,type:e.type}})),t(n)},error:e=>{n(e)}})}))}runStreamQuery(e,t,n,r){let s;const o=this.getBrowserSDKClient().streamFetch({query:e,dateFrom:t||new Date(Date.now()),dateTo:-1},{data:e=>{this.processEventData(e,s,n)},meta:e=>{s=e},error:e=>{r(e)},done:()=>{r(new Error("Stream query is done"))}});return()=>{o.abort()}}getBrowserSDKClient(){const t=this._userInfo.credentials,n=t.serrea,r=t.apiKey,s=t.apiSecret;return e({url:n,apiKey:r,apiSecret:s})}processEventData(e,t,n){e.forEach((e=>{const r={};t&&t.forEach(((t,n)=>{const s=t.name;r[s]=e[n]})),n(r)}))}}class a{constructor(e){this._token=e}getAuthorization(){return this._token}}class c extends class{async getQueryClient(){const e=await this.getUserInfo();return new i(e)}async getAlertsClient(){const e=await this.getUserInfo(),n=e.credentials.standAloneToken,r=new a(n),s=e.credentials.alertsURI;return new t(r,s)}}{constructor(e){super(),this._config=e,s((()=>this.onAppUnmount()))}async getUserInfo(){return(await this.getRuntimeDependencies()).userInfo}async goToQuery(e){(await this.getRuntimeDependencies()).goToQuery(e.queryString,e.dates)}async createNotiPop(e){const t=await this.getRuntimeDependencies();t.NotiPop&&new t.NotiPop(e)}async getRuntimeDependencies(){var e,t,n;let s;if(null===(e=this._config)||void 0===e?void 0:e.standaloneDependencies)s=this._config.standaloneDependencies;else{const e=null!==(n=null===(t=this._config)||void 0===t?void 0:t.timeout)&&void 0!==n?n:5e3;s=await r(e)}return s}onAppUnmount(){var e;const t=null===(e=this._config)||void 0===e?void 0:e.onAppUnmount;t&&t()}}class u{static init(e){const t=new c(e);return this._instance=t,this._instance}static getInstance(){if(!this._instance)throw new Error("DevoAppProvider is not initialized");return this._instance}}u._instance=void 0;export{u as DevoAppProvider}; | ||
//# sourceMappingURL=index.esm.js.map |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@devoinc/browser-sdk"),t=require("@devoinc/alerts-api-client");function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var r=n(t);const o=e=>new Promise(((t,n)=>{let r=!1;document.addEventListener("applicationBuilderDependencies",(e=>{var o;e.preventDefault();const s=e,i=null===(o=null==s?void 0:s.detail)||void 0===o?void 0:o.dependencies;i?(r=!0,t(i)):n(new Error("Devo dependencies not found"))})),document.dispatchEvent(new CustomEvent("getVappDeps")),window.setTimeout((()=>{r||n(new Error("Initialization timeout"))}),e)})),s=e=>{document.addEventListener("beforeChangeContainer",(t=>{t.preventDefault(),e()}))},i={processQuery:e=>{const t=i.processQueryDates(e.queryString,e.dates);return{queryString:e.queryString,dates:t}},processQueryDates:(e,t)=>{let n=t;return e.startsWith("from my.lookuplist.")&&(n=i.getDateForLookupTable()),n},getDateForLookupTable:()=>{const e=new Date,t=new Date(e);t.setDate(e.getDate()-1);return{from:t.setHours(0,0,0,0)-60*t.getTimezoneOffset()*1e3,to:e.setHours(0,0,0,0)-60*e.getTimezoneOffset()*1e3}}};class a{constructor(e){this._userInfo=e}runQuery(e){return new Promise(((t,n)=>{const r=this.getBrowserSDKClient();let o;const s=[],a=i.processQuery(e);r.streamFetch({query:a.queryString,dateFrom:a.dates.from,dateTo:a.dates.to},{data:e=>{this.processEventData(e,o,(e=>{s.push(e)}))},meta:e=>{o=e},error:e=>{n(e)},done:()=>{t(s)}})}))}runCompactQuery(e){return new Promise(((t,n)=>{const r=this.getBrowserSDKClient(),o=i.processQuery(e);r.streamFetch({query:o.queryString,dateFrom:o.dates.from,dateTo:o.dates.to},{meta:e=>{const n={fields:{}};e.forEach(((e,t)=>{n.fields[e.name]={index:t,type:e.type}})),t(n)},error:e=>{n(e)}})}))}runStreamQuery(e,t,n,r){let o;const s=this.getBrowserSDKClient().streamFetch({query:e,dateFrom:t||new Date(Date.now()),dateTo:-1},{data:e=>{this.processEventData(e,o,n)},meta:e=>{o=e},error:e=>{r(e)},done:()=>{r(new Error("Stream query is done"))}});return()=>{s.abort()}}getBrowserSDKClient(){const t=this._userInfo.credentials,n=t.serrea,r=t.apiKey,o=t.apiSecret;return e.client({url:n,apiKey:r,apiSecret:o})}processEventData(e,t,n){e.forEach((e=>{const r={};t&&t.forEach(((t,n)=>{const o=t.name;r[o]=e[n]})),n(r)}))}}class c{constructor(e){this._token=e}getAuthorization(){return this._token}}class u extends class{async getQueryClient(){const e=await this.getUserInfo();return new a(e)}async getAlertsClient(e){const n=(await this.getUserInfo()).credentials.standAloneToken,r=new c(n);return new t.Client(r,e)}}{constructor(e){super(),this._config=e,s((()=>this.onAppUnmount()))}async getUserInfo(){return(await this.getRuntimeDependencies()).userInfo}async goToQuery(e){(await this.getRuntimeDependencies()).goToQuery(e.queryString,e.dates)}async createNotiPop(e){const t=await this.getRuntimeDependencies();t.NotiPop&&new t.NotiPop(e)}async getRuntimeDependencies(){var e,t,n;let r;if(null===(e=this._config)||void 0===e?void 0:e.standaloneDependencies)r=this._config.standaloneDependencies;else{const e=null!==(n=null===(t=this._config)||void 0===t?void 0:t.timeout)&&void 0!==n?n:5e3;r=await o(e)}return r}onAppUnmount(){var e;const t=null===(e=this._config)||void 0===e?void 0:e.onAppUnmount;t&&t()}}class d{static init(e){const t=new u(e);return this._instance=t,this._instance}static getInstance(){if(!this._instance)throw new Error("DevoAppProvider is not initialized");return this._instance}}d._instance=void 0,exports.AlertsApiClient=r,exports.DevoAppProvider=d; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@devoinc/browser-sdk"),t=require("@devoinc/alerts-api-client");function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var r=n(t);const s=e=>new Promise(((t,n)=>{let r=!1;document.addEventListener("applicationBuilderDependencies",(e=>{var s;e.preventDefault();const o=e,i=null===(s=null==o?void 0:o.detail)||void 0===s?void 0:s.dependencies;i?(r=!0,t(i)):n(new Error("Devo dependencies not found"))})),document.dispatchEvent(new CustomEvent("getVappDeps")),window.setTimeout((()=>{r||n(new Error("Initialization timeout"))}),e)})),o=e=>{document.addEventListener("beforeChangeContainer",(t=>{t.preventDefault(),e()}))},i={processQuery:e=>{const t=i.processQueryDates(e.queryString,e.dates);return{queryString:e.queryString,dates:t}},processQueryDates:(e,t)=>{let n=t;return e.startsWith("from my.lookuplist.")&&(n=i.getDateForLookupTable()),n},getDateForLookupTable:()=>{const e=new Date,t=new Date(e);t.setDate(e.getDate()-1);return{from:t.setHours(0,0,0,0)-60*t.getTimezoneOffset()*1e3,to:e.setHours(0,0,0,0)-60*e.getTimezoneOffset()*1e3}}};class a{constructor(e){this._userInfo=e}runQuery(e){return new Promise(((t,n)=>{const r=this.getBrowserSDKClient();let s;const o=[],a=i.processQuery(e);r.streamFetch({query:a.queryString,dateFrom:a.dates.from,dateTo:a.dates.to},{data:e=>{this.processEventData(e,s,(e=>{o.push(e)}))},meta:e=>{s=e},error:e=>{n(e)},done:()=>{t(o)}})}))}runCompactQuery(e){return new Promise(((t,n)=>{const r=this.getBrowserSDKClient(),s=i.processQuery(e);r.streamFetch({query:s.queryString,dateFrom:s.dates.from,dateTo:s.dates.to},{meta:e=>{const n={fields:{}};e.forEach(((e,t)=>{n.fields[e.name]={index:t,type:e.type}})),t(n)},error:e=>{n(e)}})}))}runStreamQuery(e,t,n,r){let s;const o=this.getBrowserSDKClient().streamFetch({query:e,dateFrom:t||new Date(Date.now()),dateTo:-1},{data:e=>{this.processEventData(e,s,n)},meta:e=>{s=e},error:e=>{r(e)},done:()=>{r(new Error("Stream query is done"))}});return()=>{o.abort()}}getBrowserSDKClient(){const t=this._userInfo.credentials,n=t.serrea,r=t.apiKey,s=t.apiSecret;return e.client({url:n,apiKey:r,apiSecret:s})}processEventData(e,t,n){e.forEach((e=>{const r={};t&&t.forEach(((t,n)=>{const s=t.name;r[s]=e[n]})),n(r)}))}}class c{constructor(e){this._token=e}getAuthorization(){return this._token}}class u extends class{async getQueryClient(){const e=await this.getUserInfo();return new a(e)}async getAlertsClient(){const e=await this.getUserInfo(),n=e.credentials.standAloneToken,r=new c(n),s=e.credentials.alertsURI;return new t.Client(r,s)}}{constructor(e){super(),this._config=e,o((()=>this.onAppUnmount()))}async getUserInfo(){return(await this.getRuntimeDependencies()).userInfo}async goToQuery(e){(await this.getRuntimeDependencies()).goToQuery(e.queryString,e.dates)}async createNotiPop(e){const t=await this.getRuntimeDependencies();t.NotiPop&&new t.NotiPop(e)}async getRuntimeDependencies(){var e,t,n;let r;if(null===(e=this._config)||void 0===e?void 0:e.standaloneDependencies)r=this._config.standaloneDependencies;else{const e=null!==(n=null===(t=this._config)||void 0===t?void 0:t.timeout)&&void 0!==n?n:5e3;r=await s(e)}return r}onAppUnmount(){var e;const t=null===(e=this._config)||void 0===e?void 0:e.onAppUnmount;t&&t()}}class d{static init(e){const t=new u(e);return this._instance=t,this._instance}static getInstance(){if(!this._instance)throw new Error("DevoAppProvider is not initialized");return this._instance}}d._instance=void 0,exports.AlertsApiClient=r,exports.DevoAppProvider=d; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@devoinc/app-developer-kit", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Devo Web Browser Applications Development Kit", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
68715
745