@skyservice-developers/vue-dev-kit 2.17.2 → 2.19.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/README.md +36 -1
- package/dist/{api-C6FKIf2t.js → money-BCv6JlZu.js} +194 -116
- package/dist/money-dyX9wNiC.cjs +1 -0
- package/dist/sdk/index.d.ts +2 -0
- package/dist/sdk/money.d.ts +29 -0
- package/dist/sdk.cjs +1 -1
- package/dist/sdk.js +32 -29
- package/dist/shared/ui/SkyDateRangePicker/SkyDateRangePicker.vue.d.ts +1 -1
- package/dist/shared/ui/SkyFilterDropdown/SkyFilterDropdown.vue.d.ts +38 -0
- package/dist/style.css +1 -1
- package/dist/vue-dev-kit.cjs +13 -13
- package/dist/vue-dev-kit.js +2308 -2274
- package/package.json +1 -1
- package/dist/api-DAgEQpwF.cjs +0 -1
package/package.json
CHANGED
package/dist/api-DAgEQpwF.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const k=require("ua-parser-js"),v="DASHBOARD",C=5e3;let P=0,f=null;function A(){return`sdk_${Date.now()}_${++P}`}function E(){return"APP_"+Math.random().toString(36).slice(2,10)}function L(t){f=t}function w(){return f||(f=E()),f}function s(t){window.parent.postMessage({...t,sender:w(),target:t.target||v},"*")}function g(t,e,r=C){return h()?new Promise(n=>{const o=A(),i=w(),a=setTimeout(()=>{window.removeEventListener("message",p),n(null)},r);function p(b){const c=b.data;(c==null?void 0:c.type)==="DATA_RESPONSE"&&(c==null?void 0:c.requestId)===o&&(!c.target||c.target===i)&&(clearTimeout(a),window.removeEventListener("message",p),n(c.data??null))}window.addEventListener("message",p),s({type:"DATA_REQUEST",requestId:o,source:t,key:e})}):Promise.resolve(null)}function T(t){s({type:"navigate",path:t})}function I(){s({type:"exit"})}const _=I;function d(t){return g("store",t)}function l(t){return g("localStorage",t)}function D(t){return g("window",t)}function W(){return d("company")}function R(){return d("user")}function U(){return l("token")}function N(){return l("lang")}function $(){return d("productCategories")}function O(t,e){s({type:"setLocalStorage",key:t,value:e})}function M(t){s({type:"setRocketMode",value:t})}function j(t,e){s({type:"trackVisit",name:t,path:e})}function x(t){s({type:"openExternalLink",url:t})}function B(){s({type:"openCrispChat"})}function q(t){s({type:"notification",text:t})}function G(t){s({type:"notification",text:t,variant:"error"})}function V(t){s({type:"notification",text:t,variant:"warn"})}function h(){try{return window.self!==window.top}catch{return!0}}const z=h;function F(t){function e(r){var n;((n=r.data)==null?void 0:n.sender)===v&&t(r.data)}return window.addEventListener("message",e),()=>window.removeEventListener("message",e)}function u(){if(typeof window>"u")return"browser";if(window.webkit!=null&&window.webkit.messageHandlers!==void 0)try{if(k(navigator.userAgent).browser.name==="WebKit")return"ios_webview"}catch(t){console.error(t)}return typeof Android<"u"?"android_webview":typeof window.cefQuery<"u"?"cef_webview":"browser"}function H(){return u()==="ios_webview"}function Q(){return u()==="android_webview"}function J(){return u()==="cef_webview"}function K(){return u()!=="browser"}const Y="https://api.cabinet.developer.skyservice.online/index.php";class m{constructor(e){this.permsCache=null,this.token=e.token,this.companyId=e.companyId,this.appId=e.appId,this.developerId=e.developerId,this.deploymentId=e.deploymentId,this.appName=e.appName;const r=e.domain.replace("dashboard","api");this.baseUrl=r.startsWith("http")?r:`https://${r}`}static create(e){return new m(e)}async get(e){const r=new URLSearchParams({token:this.token,companyId:this.companyId,...e}),n=await fetch(`${this.baseUrl}/?${r}`);if(!n.ok)throw new Error(`Skyservice API error: ${n.status}`);const o=await n.json();if(o.status!=="done")throw new Error(`Skyservice API returned status: ${o.status}`);return o.data}async post(e,r,n){const o=new URLSearchParams({token:this.token,...r}),i=await fetch(`${e}?${o}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!i.ok)throw new Error(`Skyservice API error: ${i.status}`);const a=await i.json();if(a.status!=="done")throw new Error(`Skyservice API returned status: ${a.status}`);return a.data}async getTradepoints(e){const r=await this.get({section:"tradepoints",action:"getTradepoints"});return e!=null&&e.includeDeleted?r.items:r.items.filter(n=>!n.deleted&&!n.frozen)}async getCategoryTree(e){const r=await this.get({section:"productCategory",action:"getCategories",...e?{tradepointId:String(e)}:{}});return S(r,e)}async getProducts(e){const r=await this.get({section:"products",action:"getProducts",pagelimit:"9999",ot:"desc",of:"nomenclatureId",...e!=null&&e.tradepointId?{tradepointId:String(e.tradepointId)}:{}});return ee(r.items,e==null?void 0:e.includeInactive)}async setAppActive({isActive:e,title:r,settings:n}){const o=e?"activateApp":"deactivateApp",i={company_id:this.companyId,app_id:this.appId,...this.developerId!==void 0&&{developer_id:this.developerId},...e&&n!==void 0&&{settings:n}},a=await this.post(Y,{section:"integrations",action:o},i);return this.deploymentId&&this.appName&&typeof window<"u"&&window.self!==window.top&&window.parent.postMessage({type:"sendActiveApp",id:a.id,is_active:e,deploymentId:this.deploymentId,appName:this.appName,title:r},"*"),a}async getPerms(e){const r=await this.loadPerms();return e===void 0?r:!!r[String(e)]}clearPermsCache(){this.permsCache=null}async loadPerms(){var r;if(this.permsCache)return this.permsCache;if(typeof window<"u")try{const n=await d("perms");if(n&&Object.keys(n).length>0)return this.permsCache=y(n),this.permsCache}catch{}const e=await this.get({section:"adminPanel",action:"getStart"});return this.permsCache=y((r=e==null?void 0:e.settings)==null?void 0:r.perms),this.permsCache}}function y(t){const e={};if(!t||typeof t!="object")return e;for(const[r,n]of Object.entries(t))e[r]=!!n;return e}function S(t,e){var n,o;const r=[];for(const i of t){if(e!=null&&!((n=i.tradepointShow)==null?void 0:n[String(e)]))continue;const a={id:i.id,pid:i.pid,name:i.name,active:i.active,background:i.background,show:i.show};i.img&&(a.img=i.img),(o=i.children)!=null&&o.length&&(a.children=S(i.children,e)),r.push(a)}return r}const X=new Set(["product","techcard"]),Z="/img/no.png";function ee(t,e){const r=[];for(const n of t)X.has(n.type)&&(!e&&!n.active||r.push({id:n.id,name:n.nomenclatureName,price:n.price,categoryId:n.categoryId,categoryName:n.categoryTitle||"",active:n.active,type:n.type,unit:n.unit,logo:n.logo&&n.logo!==Z?n.logo:""}));return r}exports.SkyserviceAPI=m;exports.exit=I;exports.getBack=_;exports.getCompany=W;exports.getLang=N;exports.getLocalStorageData=l;exports.getProductCategories=$;exports.getSenderId=w;exports.getStoreData=d;exports.getToken=U;exports.getUser=R;exports.getWindowData=D;exports.isAndroidWebview=Q;exports.isCefWebview=J;exports.isInIframe=z;exports.isInsideIframe=h;exports.isIosWebview=H;exports.isWebview=K;exports.navigate=T;exports.notify=q;exports.notifyError=G;exports.notifyWarn=V;exports.onMessage=F;exports.openCrispChat=B;exports.openExternalLink=x;exports.setLocalStorage=O;exports.setRocketMode=M;exports.setSenderId=L;exports.trackVisit=j;exports.webviewCheck=u;
|