plaza-sdk 1.3.20 → 1.3.22
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/lib/browser/bundle.iife.js +1 -1
- package/lib/browser/bundle.umd.js +1 -1
- package/lib/cjs/common/index.js +1 -1
- package/lib/cjs/common/utils.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/modules/alif-shop-api/core/index.js +1 -1
- package/lib/cjs/modules/alif-shop-api/core/management/api.js +1 -1
- package/lib/cjs/modules/alif-shop-api/core/management/index.js +1 -1
- package/lib/cjs/modules/alif-shop-api/index.js +1 -1
- package/lib/esm/common/index.js +1 -1
- package/lib/esm/common/utils.js +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/modules/alif-shop-api/core/index.js +1 -1
- package/lib/esm/modules/alif-shop-api/core/management/api.js +1 -1
- package/lib/esm/modules/alif-shop-api/core/management/index.js +1 -1
- package/lib/esm/modules/alif-shop-api/index.js +1 -1
- package/lib/types/src/common/index.d.ts +2 -2
- package/lib/types/src/common/types.d.ts +3 -1
- package/lib/types/src/common/utils.d.ts +7 -1
- package/lib/types/src/index.d.ts +2 -2
- package/lib/types/src/modules/alif-shop-api/core/index.d.ts +2 -2
- package/lib/types/src/modules/alif-shop-api/core/management/api.d.ts +4 -3
- package/lib/types/src/modules/alif-shop-api/core/management/index.d.ts +2 -2
- package/lib/types/src/modules/alif-shop-api/core/management/params.d.ts +2 -2
- package/lib/types/src/modules/alif-shop-api/index.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var plazaSdk=function(
|
|
1
|
+
var plazaSdk=function(t){"use strict";return t.bindHttp=function(t,r){return(...e)=>t(r,...e)},t.getNumber=(t,r=0)=>{if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return isNaN(e)?r:e}return r},t.pasteAuthHeader=t=>({...t?{Authorization:`Bearer ${t}`}:{}}),t.pasteAuthHeaderAndApikey=(t,r="2qHIakuLe5",e="apikey")=>({...t?{Authorization:`Bearer ${t}`}:{},[e]:r,locale:"ru"}),t.withHttp=function(t,r){return(...e)=>t(r,...e)},t.wrapWithHttp=t=>r=>(...e)=>r(t,...e),t}({});
|
|
@@ -1 +1 @@
|
|
|
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";e.getNumber=(e,t=0)=>{if("number"==typeof e)return e;if("string"==typeof e){const
|
|
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";e.bindHttp=function(e,t){return(...n)=>e(t,...n)},e.getNumber=(e,t=0)=>{if("number"==typeof e)return e;if("string"==typeof e){const n=parseFloat(e);return isNaN(n)?t:n}return t},e.pasteAuthHeader=e=>({...e?{Authorization:`Bearer ${e}`}:{}}),e.pasteAuthHeaderAndApikey=(e,t="2qHIakuLe5",n="apikey")=>({...e?{Authorization:`Bearer ${e}`}:{},[n]:t,locale:"ru"}),e.withHttp=function(e,t){return(...n)=>e(t,...n)},e.wrapWithHttp=e=>t=>(...n)=>t(e,...n)});
|
package/lib/cjs/common/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var t=require("./utils.js");exports.bindHttp=t.bindHttp,exports.getNumber=t.getNumber,exports.pasteAuthHeader=t.pasteAuthHeader,exports.pasteAuthHeaderAndApikey=t.pasteAuthHeaderAndApikey,exports.withHttp=t.withHttp,exports.wrapWithHttp=t.wrapWithHttp;
|
package/lib/cjs/common/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.
|
|
1
|
+
"use strict";exports.bindHttp=function(t,e){return(...r)=>t(e,...r)},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.pasteAuthHeader=t=>({...t?{Authorization:`Bearer ${t}`}:{}}),exports.pasteAuthHeaderAndApikey=(t,e="2qHIakuLe5",r="apikey")=>({...t?{Authorization:`Bearer ${t}`}:{},[r]:e,locale:"ru"}),exports.withHttp=function(t,e){return(...r)=>t(e,...r)},exports.wrapWithHttp=t=>e=>(...r)=>e(t,...r);
|
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var t=require("./common/utils.js");exports.bindHttp=t.bindHttp,exports.getNumber=t.getNumber,exports.pasteAuthHeader=t.pasteAuthHeader,exports.pasteAuthHeaderAndApikey=t.pasteAuthHeaderAndApikey,exports.withHttp=t.withHttp,exports.wrapWithHttp=t.wrapWithHttp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./auth/api.js"),t=require("./products/api.js"),r=require("./management/api.js"),
|
|
1
|
+
"use strict";var e=require("./auth/api.js"),t=require("./products/api.js"),r=require("./management/api.js"),o=require("./applications/api.js");exports.GetToken=e.GetToken,exports.RefreshToken=e.RefreshToken,exports.SingleWarehouseProduct=t.SingleWarehouseProduct,exports.UpdateWarehouseProduct=t.UpdateWarehouseProduct,exports.WarehouseCategoriesList=t.WarehouseCategoriesList,exports.WarehouseList=t.WarehouseList,exports.CheckReport=r.CheckReport,exports.DownloadReport=r.DownloadReport,exports.GenerateReport=r.GenerateReport,exports.ReportsList=r.ReportsList,exports.ApplicationsList=o.ApplicationsList,exports.DeliverableWithType=o.DeliverableWithType,exports.SingleApplication=o.SingleApplication;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../../../common/utils.js");exports.CheckReport=(r,t)=>r.get("/excel/excel/v1/reports/check",{params:{report_id:t.report_id},headers:e.pasteAuthHeaderAndApikey(t?.token)}),exports.GenerateReport=(r,t,
|
|
1
|
+
"use strict";var e=require("../../../../common/utils.js");exports.CheckReport=(r,t)=>r.get("/excel/excel/v1/reports/check",{params:{report_id:t.report_id},headers:e.pasteAuthHeaderAndApikey(t?.token)}),exports.DownloadReport=(r,t)=>r.get("/excel/excel/v1/reports/download",{params:{report_id:t.report_id},responseType:"blob",headers:e.pasteAuthHeaderAndApikey(t?.token)}),exports.GenerateReport=(r,t,p)=>r.post("/excel/excel/v1/reports/generate",p,{headers:e.pasteAuthHeaderAndApikey(t?.token)}),exports.ReportsList=(r,t)=>r.get("/excel/excel/v1/reports",{params:{app:t.app},headers:e.pasteAuthHeaderAndApikey(t?.token)});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./api.js");exports.CheckReport=e.CheckReport,exports.GenerateReport=e.GenerateReport,exports.ReportsList=e.ReportsList;
|
|
1
|
+
"use strict";var e=require("./api.js");exports.CheckReport=e.CheckReport,exports.DownloadReport=e.DownloadReport,exports.GenerateReport=e.GenerateReport,exports.ReportsList=e.ReportsList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./core/auth/api.js"),r=require("./core/products/api.js"),
|
|
1
|
+
"use strict";var e=require("./core/auth/api.js"),r=require("./core/products/api.js"),o=require("./core/management/api.js"),t=require("./core/applications/api.js");exports.GetToken=e.GetToken,exports.RefreshToken=e.RefreshToken,exports.SingleWarehouseProduct=r.SingleWarehouseProduct,exports.UpdateWarehouseProduct=r.UpdateWarehouseProduct,exports.WarehouseCategoriesList=r.WarehouseCategoriesList,exports.WarehouseList=r.WarehouseList,exports.CheckReport=o.CheckReport,exports.DownloadReport=o.DownloadReport,exports.GenerateReport=o.GenerateReport,exports.ReportsList=o.ReportsList,exports.ApplicationsList=t.ApplicationsList,exports.DeliverableWithType=t.DeliverableWithType,exports.SingleApplication=t.SingleApplication;
|
package/lib/esm/common/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{getNumber,pasteAuthHeader,pasteAuthHeaderAndApikey}from"./utils.js";
|
|
1
|
+
export{bindHttp,getNumber,pasteAuthHeader,pasteAuthHeaderAndApikey,withHttp,wrapWithHttp}from"./utils.js";
|
package/lib/esm/common/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const r=(r,
|
|
1
|
+
const r=(r,t=0)=>{if("number"==typeof r)return r;if("string"==typeof r){const e=parseFloat(r);return isNaN(e)?t:e}return t},t=r=>({...r?{Authorization:`Bearer ${r}`}:{}}),e=(r,t="2qHIakuLe5",e="apikey")=>({...r?{Authorization:`Bearer ${r}`}:{},[e]:t,locale:"ru"});function n(r,t){return(...e)=>r(t,...e)}const o=r=>t=>(...e)=>t(r,...e);function u(r,t){return(...e)=>r(t,...e)}export{n as bindHttp,r as getNumber,t as pasteAuthHeader,e as pasteAuthHeaderAndApikey,u as withHttp,o as wrapWithHttp};
|
package/lib/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{getNumber,pasteAuthHeader,pasteAuthHeaderAndApikey}from"./common/utils.js";
|
|
1
|
+
export{bindHttp,getNumber,pasteAuthHeader,pasteAuthHeaderAndApikey,withHttp,wrapWithHttp}from"./common/utils.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{GetToken,RefreshToken}from"./auth/api.js";export{SingleWarehouseProduct,UpdateWarehouseProduct,WarehouseCategoriesList,WarehouseList}from"./products/api.js";export{CheckReport,GenerateReport,ReportsList}from"./management/api.js";export{ApplicationsList,DeliverableWithType,SingleApplication}from"./applications/api.js";
|
|
1
|
+
export{GetToken,RefreshToken}from"./auth/api.js";export{SingleWarehouseProduct,UpdateWarehouseProduct,WarehouseCategoriesList,WarehouseList}from"./products/api.js";export{CheckReport,DownloadReport,GenerateReport,ReportsList}from"./management/api.js";export{ApplicationsList,DeliverableWithType,SingleApplication}from"./applications/api.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{pasteAuthHeaderAndApikey as e}from"../../../../common/utils.js";const r=(r,t
|
|
1
|
+
import{pasteAuthHeaderAndApikey as e}from"../../../../common/utils.js";const r=(r,o,t)=>r.post("/excel/excel/v1/reports/generate",t,{headers:e(o?.token)}),o=(r,o)=>r.get("/excel/excel/v1/reports/check",{params:{report_id:o.report_id},headers:e(o?.token)}),t=(r,o)=>r.get("/excel/excel/v1/reports",{params:{app:o.app},headers:e(o?.token)}),p=(r,o)=>r.get("/excel/excel/v1/reports/download",{params:{report_id:o.report_id},responseType:"blob",headers:e(o?.token)});export{o as CheckReport,p as DownloadReport,r as GenerateReport,t as ReportsList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{CheckReport,GenerateReport,ReportsList}from"./api.js";
|
|
1
|
+
export{CheckReport,DownloadReport,GenerateReport,ReportsList}from"./api.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{GetToken,RefreshToken}from"./core/auth/api.js";export{SingleWarehouseProduct,UpdateWarehouseProduct,WarehouseCategoriesList,WarehouseList}from"./core/products/api.js";export{CheckReport,GenerateReport,ReportsList}from"./core/management/api.js";export{ApplicationsList,DeliverableWithType,SingleApplication}from"./core/applications/api.js";
|
|
1
|
+
export{GetToken,RefreshToken}from"./core/auth/api.js";export{SingleWarehouseProduct,UpdateWarehouseProduct,WarehouseCategoriesList,WarehouseList}from"./core/products/api.js";export{CheckReport,DownloadReport,GenerateReport,ReportsList}from"./core/management/api.js";export{ApplicationsList,DeliverableWithType,SingleApplication}from"./core/applications/api.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { BooleanNullable, CallerNoParam, CallerParam, CallerParamPayload, CallerPayload, NumberNullable, NumberRange, StringNullable } from './types.js';
|
|
2
|
-
export { getNumber, pasteAuthHeader, pasteAuthHeaderAndApikey } from './utils.js';
|
|
1
|
+
export { BooleanNullable, BoundFunction, CallerNoParam, CallerParam, CallerParamPayload, CallerPayload, NumberNullable, NumberRange, StringNullable, TailParameters } from './types.js';
|
|
2
|
+
export { bindHttp, getNumber, pasteAuthHeader, pasteAuthHeaderAndApikey, withHttp, wrapWithHttp } from './utils.js';
|
|
3
3
|
export { SlugParams, TokenParams, UsernamePasswordParams } from './params.js';
|
|
4
4
|
export { IMultiLang, IMultiLangArray } from './interfaces.js';
|
|
5
5
|
import 'axios';
|
|
@@ -8,5 +8,7 @@ type StringNullable = string | null;
|
|
|
8
8
|
type NumberNullable = number | null;
|
|
9
9
|
type BooleanNullable = boolean | null;
|
|
10
10
|
type NumberRange<From extends number, To extends number, Acc extends number[] = [], Result extends number[] = []> = Acc["length"] extends To ? [...Result, To][number] : Acc["length"] extends From ? NumberRange<From, To, [...Acc, 1], [Acc["length"]]> : Result extends [] ? NumberRange<From, To, [...Acc, 1], []> : NumberRange<From, To, [...Acc, 1], [...Result, Acc["length"]]>;
|
|
11
|
+
type TailParameters<T> = T extends (x: any, ...rest: infer P) => any ? P : never;
|
|
12
|
+
type BoundFunction<F> = F extends (http: AxiosInstance, ...args: infer P) => infer R ? (...args: P) => R : never;
|
|
11
13
|
|
|
12
|
-
export type { BooleanNullable, CallerNoParam, CallerParam, CallerParamPayload, CallerPayload, NumberNullable, NumberRange, StringNullable };
|
|
14
|
+
export type { BooleanNullable, BoundFunction, CallerNoParam, CallerParam, CallerParamPayload, CallerPayload, NumberNullable, NumberRange, StringNullable, TailParameters };
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { BoundFunction, TailParameters } from './types.js';
|
|
3
|
+
|
|
1
4
|
declare const getNumber: (value: unknown, defaultValue?: number) => number;
|
|
2
5
|
declare const pasteAuthHeader: (token?: string) => {
|
|
3
6
|
Authorization?: string | undefined;
|
|
@@ -6,5 +9,8 @@ declare const pasteAuthHeaderAndApikey: (token?: string, apikey?: string, apikey
|
|
|
6
9
|
locale: string;
|
|
7
10
|
Authorization?: string | undefined;
|
|
8
11
|
};
|
|
12
|
+
declare function bindHttp<F extends (http: AxiosInstance, ...args: any[]) => any>(fn: F, http: AxiosInstance): BoundFunction<F>;
|
|
13
|
+
declare const wrapWithHttp: (http: AxiosInstance) => <F extends (http: AxiosInstance, ...args: any[]) => any>(fn: F) => (...args: TailParameters<F>) => ReturnType<F>;
|
|
14
|
+
declare function withHttp<H extends AxiosInstance, A extends any[], R>(fn: (http: H, ...args: A) => R, http: H): (...args: A) => R;
|
|
9
15
|
|
|
10
|
-
export { getNumber, pasteAuthHeader, pasteAuthHeaderAndApikey };
|
|
16
|
+
export { bindHttp, getNumber, pasteAuthHeader, pasteAuthHeaderAndApikey, withHttp, wrapWithHttp };
|
package/lib/types/src/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { BooleanNullable, CallerNoParam, CallerParam, CallerParamPayload, CallerPayload, NumberNullable, NumberRange, StringNullable } from './common/types.js';
|
|
2
|
-
export { getNumber, pasteAuthHeader, pasteAuthHeaderAndApikey } from './common/utils.js';
|
|
1
|
+
export { BooleanNullable, BoundFunction, CallerNoParam, CallerParam, CallerParamPayload, CallerPayload, NumberNullable, NumberRange, StringNullable, TailParameters } from './common/types.js';
|
|
2
|
+
export { bindHttp, getNumber, pasteAuthHeader, pasteAuthHeaderAndApikey, withHttp, wrapWithHttp } from './common/utils.js';
|
|
3
3
|
export { SlugParams, TokenParams, UsernamePasswordParams } from './common/params.js';
|
|
4
4
|
export { IMultiLang, IMultiLangArray } from './common/interfaces.js';
|
|
5
5
|
import 'axios';
|
|
@@ -3,9 +3,9 @@ export { AuthApi } from './auth/types.js';
|
|
|
3
3
|
export { SingleWarehouseProduct, UpdateWarehouseProduct, WarehouseCategoriesList, WarehouseList } from './products/api.js';
|
|
4
4
|
export { ProductsApi, ProductsEntity } from './products/types.js';
|
|
5
5
|
export { ProductIdBasedParams, WarehouseProductsListParams } from './products/params.js';
|
|
6
|
-
export { CheckReport, GenerateReport, ReportsList } from './management/api.js';
|
|
6
|
+
export { CheckReport, DownloadReport, GenerateReport, ReportsList } from './management/api.js';
|
|
7
7
|
export { AlifManagementApi, AlifManagementEntity } from './management/types.js';
|
|
8
|
-
export {
|
|
8
|
+
export { ReportIdBasedParams, ReportsListParams } from './management/params.js';
|
|
9
9
|
export { ApplicationsList, DeliverableWithType, SingleApplication } from './applications/api.js';
|
|
10
10
|
export { ApplicationsApi, ApplicationsEntity } from './applications/types.js';
|
|
11
11
|
export { ApplicationIdBasedParams, ApplicationsParams } from './applications/params.js';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { CallerParamPayload, CallerParam } from '../../../../common/types.js';
|
|
2
2
|
import { TokenParams } from '../../../../common/params.js';
|
|
3
3
|
import { AlifManagementApi } from './types.js';
|
|
4
|
-
import {
|
|
4
|
+
import { ReportIdBasedParams, ReportsListParams } from './params.js';
|
|
5
5
|
import 'axios';
|
|
6
6
|
|
|
7
7
|
declare const GenerateReport: CallerParamPayload<TokenParams, AlifManagementApi.GenerateReport.Request, AlifManagementApi.GenerateReport.Response>;
|
|
8
|
-
declare const CheckReport: CallerParam<
|
|
8
|
+
declare const CheckReport: CallerParam<ReportIdBasedParams, AlifManagementApi.CheckReport.Response>;
|
|
9
9
|
declare const ReportsList: CallerParam<ReportsListParams, AlifManagementApi.ReportsList.Response>;
|
|
10
|
+
declare const DownloadReport: CallerParam<ReportIdBasedParams, Blob>;
|
|
10
11
|
|
|
11
|
-
export { CheckReport, GenerateReport, ReportsList };
|
|
12
|
+
export { CheckReport, DownloadReport, GenerateReport, ReportsList };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { CheckReport, GenerateReport, ReportsList } from './api.js';
|
|
1
|
+
export { CheckReport, DownloadReport, GenerateReport, ReportsList } from './api.js';
|
|
2
2
|
export { AlifManagementApi, AlifManagementEntity } from './types.js';
|
|
3
|
-
export {
|
|
3
|
+
export { ReportIdBasedParams, ReportsListParams } from './params.js';
|
|
4
4
|
import '../../../../common/types.js';
|
|
5
5
|
import 'axios';
|
|
6
6
|
import '../../../../common/params.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { TokenParams } from '../../../../common/params.js';
|
|
2
2
|
|
|
3
|
-
interface
|
|
3
|
+
interface ReportIdBasedParams extends TokenParams {
|
|
4
4
|
report_id: string;
|
|
5
5
|
}
|
|
6
6
|
interface ReportsListParams extends TokenParams {
|
|
7
7
|
app: string;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export type {
|
|
10
|
+
export type { ReportIdBasedParams, ReportsListParams };
|
|
@@ -3,9 +3,9 @@ export { AuthApi } from './core/auth/types.js';
|
|
|
3
3
|
export { SingleWarehouseProduct, UpdateWarehouseProduct, WarehouseCategoriesList, WarehouseList } from './core/products/api.js';
|
|
4
4
|
export { ProductsApi, ProductsEntity } from './core/products/types.js';
|
|
5
5
|
export { ProductIdBasedParams, WarehouseProductsListParams } from './core/products/params.js';
|
|
6
|
-
export { CheckReport, GenerateReport, ReportsList } from './core/management/api.js';
|
|
6
|
+
export { CheckReport, DownloadReport, GenerateReport, ReportsList } from './core/management/api.js';
|
|
7
7
|
export { AlifManagementApi, AlifManagementEntity } from './core/management/types.js';
|
|
8
|
-
export {
|
|
8
|
+
export { ReportIdBasedParams, ReportsListParams } from './core/management/params.js';
|
|
9
9
|
export { ApplicationsList, DeliverableWithType, SingleApplication } from './core/applications/api.js';
|
|
10
10
|
export { ApplicationsApi, ApplicationsEntity } from './core/applications/types.js';
|
|
11
11
|
export { ApplicationIdBasedParams, ApplicationsParams } from './core/applications/params.js';
|