plaza-sdk 2.4.0 → 2.4.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
var plazaSdk=function(t){"use strict";const e=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`;return t.bindHttp=function(t,e){return(...a)=>t(e,...a)},t.formatDate=e,t.getNumber=(t,e=0)=>{if("number"==typeof t)return t;if("string"==typeof t){const a=parseFloat(t);return isNaN(a)?e:a}return e},t.getOneMonthRange=t=>{const a=e(t),r=t.getFullYear(),n=t.getMonth(),i=t.getDate(),u=new Date(r,n-1,1),o=new Date(u.getFullYear(),u.getMonth()+1,0).getDate(),p=Math.min(i,o);u.setDate(p);return{dateFrom:e(u),dateTo:a}},t.pasteApiKeyHeader=(t,e="Api-Key")=>({...t?{[e]:t}:{}}),t.pasteAuthHeader=t=>({...t?{Authorization:`Bearer ${t}`}:{}}),t.pasteAuthHeaderAndApikey=(t,e="2qHIakuLe5",a="apikey")=>({...t?{Authorization:`Bearer ${t}`}:{},[a]:e,locale:"ru"}),t.pasteAuthHeaderWithoutAccessKey=t=>({...t?{Authorization:t}:{}}),t.withHttp=function(t,e){return(...a)=>t(e,...a)},t.wrapWithHttp=t=>e=>(...a)=>e(t,...a),t}({});
|
|
1
|
+
var plazaSdk=function(t){"use strict";const e=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`;return t.bindHttp=function(t,e){return(...a)=>t(e,...a)},t.formatDate=e,t.getNumber=(t,e=0)=>{if("number"==typeof t)return t;if("string"==typeof t){const a=parseFloat(t);return isNaN(a)?e:a}return e},t.getOneMonthRange=(t=new Date)=>{const a=e(t),r=t.getFullYear(),n=t.getMonth(),i=t.getDate(),u=new Date(r,n-1,1),o=new Date(u.getFullYear(),u.getMonth()+1,0).getDate(),p=Math.min(i,o);u.setDate(p);return{dateFrom:e(u),dateTo:a}},t.pasteApiKeyHeader=(t,e="Api-Key")=>({...t?{[e]:t}:{}}),t.pasteAuthHeader=t=>({...t?{Authorization:`Bearer ${t}`}:{}}),t.pasteAuthHeaderAndApikey=(t,e="2qHIakuLe5",a="apikey")=>({...t?{Authorization:`Bearer ${t}`}:{},[a]:e,locale:"ru"}),t.pasteAuthHeaderWithoutAccessKey=t=>({...t?{Authorization:t}:{}}),t.withHttp=function(t,e){return(...a)=>t(e,...a)},t.wrapWithHttp=t=>e=>(...a)=>e(t,...a),t}({});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).plazaSdk={})}(this,function(e){"use strict";const t=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`;e.bindHttp=function(e,t){return(...a)=>e(t,...a)},e.formatDate=t,e.getNumber=(e,t=0)=>{if("number"==typeof e)return e;if("string"==typeof e){const a=parseFloat(e);return isNaN(a)?t:a}return t},e.getOneMonthRange=(e=new Date)=>{const a=t(e),n=e.getFullYear(),r=e.getMonth(),o=e.getDate(),i=new Date(n,r-1,1),u=new Date(i.getFullYear(),i.getMonth()+1,0).getDate(),p=Math.min(o,u);i.setDate(p);return{dateFrom:t(i),dateTo:a}},e.pasteApiKeyHeader=(e,t="Api-Key")=>({...e?{[t]:e}:{}}),e.pasteAuthHeader=e=>({...e?{Authorization:`Bearer ${e}`}:{}}),e.pasteAuthHeaderAndApikey=(e,t="2qHIakuLe5",a="apikey")=>({...e?{Authorization:`Bearer ${e}`}:{},[a]:t,locale:"ru"}),e.pasteAuthHeaderWithoutAccessKey=e=>({...e?{Authorization:e}:{}}),e.withHttp=function(e,t){return(...a)=>e(t,...a)},e.wrapWithHttp=e=>t=>(...a)=>t(e,...a)});
|
package/lib/cjs/common/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`;exports.bindHttp=function(t,e){return(...r)=>t(e,...r)},exports.formatDate=t,exports.getNumber=(t,e=0)=>{if("number"==typeof t)return t;if("string"==typeof t){const r=parseFloat(t);return isNaN(r)?e:r}return e},exports.getOneMonthRange=e=>{const r=t(e),a=e.getFullYear(),o=e.getMonth(),n=e.getDate(),p=new Date(a,o-1,1),s=new Date(p.getFullYear(),p.getMonth()+1,0).getDate(),i=Math.min(n,s);p.setDate(i);return{dateFrom:t(p),dateTo:r}},exports.pasteApiKeyHeader=(t,e="Api-Key")=>({...t?{[e]:t}:{}}),exports.pasteAuthHeader=t=>({...t?{Authorization:`Bearer ${t}`}:{}}),exports.pasteAuthHeaderAndApikey=(t,e="2qHIakuLe5",r="apikey")=>({...t?{Authorization:`Bearer ${t}`}:{},[r]:e,locale:"ru"}),exports.pasteAuthHeaderWithoutAccessKey=t=>({...t?{Authorization:t}:{}}),exports.withHttp=function(t,e){return(...r)=>t(e,...r)},exports.wrapWithHttp=t=>e=>(...r)=>e(t,...r);
|
|
1
|
+
"use strict";const t=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`;exports.bindHttp=function(t,e){return(...r)=>t(e,...r)},exports.formatDate=t,exports.getNumber=(t,e=0)=>{if("number"==typeof t)return t;if("string"==typeof t){const r=parseFloat(t);return isNaN(r)?e:r}return e},exports.getOneMonthRange=(e=new Date)=>{const r=t(e),a=e.getFullYear(),o=e.getMonth(),n=e.getDate(),p=new Date(a,o-1,1),s=new Date(p.getFullYear(),p.getMonth()+1,0).getDate(),i=Math.min(n,s);p.setDate(i);return{dateFrom:t(p),dateTo:r}},exports.pasteApiKeyHeader=(t,e="Api-Key")=>({...t?{[e]:t}:{}}),exports.pasteAuthHeader=t=>({...t?{Authorization:`Bearer ${t}`}:{}}),exports.pasteAuthHeaderAndApikey=(t,e="2qHIakuLe5",r="apikey")=>({...t?{Authorization:`Bearer ${t}`}:{},[r]:e,locale:"ru"}),exports.pasteAuthHeaderWithoutAccessKey=t=>({...t?{Authorization:t}:{}}),exports.withHttp=function(t,e){return(...r)=>t(e,...r)},exports.wrapWithHttp=t=>e=>(...r)=>e(t,...r);
|
package/lib/esm/common/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=(t,e=0)=>{if("number"==typeof t)return t;if("string"==typeof t){const r=parseFloat(t);return isNaN(r)?e:r}return e},e=t=>({...t?{Authorization:`Bearer ${t}`}:{}}),r=(t,e="Api-Key")=>({...t?{[e]:t}:{}}),n=t=>({...t?{Authorization:t}:{}}),a=(t,e="2qHIakuLe5",r="apikey")=>({...t?{Authorization:`Bearer ${t}`}:{},[r]:e,locale:"ru"});function o(t,e){return(...r)=>t(e,...r)}const i=t=>e=>(...r)=>e(t,...r);function u(t,e){return(...r)=>t(e,...r)}const g=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`,l=t=>{const e=g(t),r=t.getFullYear(),n=t.getMonth(),a=t.getDate(),o=new Date(r,n-1,1),i=new Date(o.getFullYear(),o.getMonth()+1,0).getDate(),u=Math.min(a,i);o.setDate(u);return{dateFrom:g(o),dateTo:e}};export{o as bindHttp,g as formatDate,t as getNumber,l as getOneMonthRange,r as pasteApiKeyHeader,e as pasteAuthHeader,a as pasteAuthHeaderAndApikey,n as pasteAuthHeaderWithoutAccessKey,u as withHttp,i as wrapWithHttp};
|
|
1
|
+
const t=(t,e=0)=>{if("number"==typeof t)return t;if("string"==typeof t){const r=parseFloat(t);return isNaN(r)?e:r}return e},e=t=>({...t?{Authorization:`Bearer ${t}`}:{}}),r=(t,e="Api-Key")=>({...t?{[e]:t}:{}}),n=t=>({...t?{Authorization:t}:{}}),a=(t,e="2qHIakuLe5",r="apikey")=>({...t?{Authorization:`Bearer ${t}`}:{},[r]:e,locale:"ru"});function o(t,e){return(...r)=>t(e,...r)}const i=t=>e=>(...r)=>e(t,...r);function u(t,e){return(...r)=>t(e,...r)}const g=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`,l=(t=new Date)=>{const e=g(t),r=t.getFullYear(),n=t.getMonth(),a=t.getDate(),o=new Date(r,n-1,1),i=new Date(o.getFullYear(),o.getMonth()+1,0).getDate(),u=Math.min(a,i);o.setDate(u);return{dateFrom:g(o),dateTo:e}};export{o as bindHttp,g as formatDate,t as getNumber,l as getOneMonthRange,r as pasteApiKeyHeader,e as pasteAuthHeader,a as pasteAuthHeaderAndApikey,n as pasteAuthHeaderWithoutAccessKey,u as withHttp,i as wrapWithHttp};
|
|
@@ -32,6 +32,6 @@ declare const formatDate: (d: Date) => string;
|
|
|
32
32
|
* ni "YYYY-MM-DD" formatida qaytaradi.
|
|
33
33
|
* @returns {DateRange}
|
|
34
34
|
*/
|
|
35
|
-
declare const getOneMonthRange: (day
|
|
35
|
+
declare const getOneMonthRange: (day?: Date) => DateRange;
|
|
36
36
|
|
|
37
37
|
export { bindHttp, formatDate, getNumber, getOneMonthRange, pasteApiKeyHeader, pasteAuthHeader, pasteAuthHeaderAndApikey, pasteAuthHeaderWithoutAccessKey, withHttp, wrapWithHttp };
|