plaza-sdk 1.0.3 → 1.1.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/lib/cjs/common/index.d.ts +1 -0
- package/lib/cjs/common/params.d.ts +4 -0
- package/lib/cjs/common/params.js +1 -0
- package/lib/cjs/modules/alif-shop-api/common/interfaces.js +1 -0
- package/lib/cjs/modules/alif-shop-api/common/types.js +1 -0
- package/lib/cjs/modules/alif-shop-api/common/utils.js +1 -0
- package/lib/cjs/modules/alif-shop-api/core/auth/api.d.ts +3 -0
- package/lib/cjs/modules/alif-shop-api/core/auth/api.js +1 -0
- package/lib/cjs/modules/alif-shop-api/core/auth/index.d.ts +1 -0
- package/lib/cjs/modules/alif-shop-api/core/auth/index.js +1 -0
- package/lib/cjs/modules/alif-shop-api/core/auth/types.d.ts +14 -0
- package/lib/cjs/modules/alif-shop-api/core/auth/types.js +1 -0
- package/lib/cjs/modules/alif-shop-api/core/index.d.ts +1 -0
- package/lib/cjs/modules/alif-shop-api/core/index.js +1 -0
- package/lib/cjs/modules/alif-shop-api/index.d.ts +1 -0
- package/lib/cjs/modules/alif-shop-api/index.js +1 -0
- package/lib/cjs/modules/index.js +1 -1
- package/lib/cjs/modules/uzum-market-api/core/auth/api.d.ts +4 -0
- package/lib/cjs/modules/uzum-market-api/core/auth/api.js +1 -0
- package/lib/cjs/modules/uzum-market-api/core/auth/enums.d.ts +6 -0
- package/lib/cjs/modules/uzum-market-api/core/auth/enums.js +1 -0
- package/lib/cjs/modules/uzum-market-api/core/auth/index.d.ts +1 -0
- package/lib/cjs/modules/uzum-market-api/core/auth/index.js +1 -0
- package/lib/cjs/modules/uzum-market-api/core/auth/params.js +1 -0
- package/lib/cjs/modules/uzum-market-api/core/auth/types.d.ts +42 -0
- package/lib/cjs/modules/uzum-market-api/core/auth/types.js +1 -0
- package/lib/cjs/modules/uzum-market-api/core/index.d.ts +1 -0
- package/lib/cjs/modules/uzum-market-api/core/index.js +1 -1
- package/lib/cjs/modules/uzum-market-api/index.d.ts +1 -1
- package/lib/cjs/modules/uzum-market-api/index.js +1 -1
- package/lib/esm/common/index.d.ts +1 -0
- package/lib/esm/common/params.d.ts +4 -0
- package/lib/esm/common/params.js +1 -0
- package/lib/esm/modules/alif-shop-api/common/interfaces.js +1 -0
- package/lib/esm/modules/alif-shop-api/common/types.js +1 -0
- package/lib/esm/modules/alif-shop-api/common/utils.js +1 -0
- package/lib/esm/modules/alif-shop-api/core/auth/api.d.ts +3 -0
- package/lib/esm/modules/alif-shop-api/core/auth/api.js +1 -0
- package/lib/esm/modules/alif-shop-api/core/auth/index.d.ts +1 -0
- package/lib/esm/modules/alif-shop-api/core/auth/index.js +1 -0
- package/lib/esm/modules/alif-shop-api/core/auth/types.d.ts +14 -0
- package/lib/esm/modules/alif-shop-api/core/auth/types.js +1 -0
- package/lib/esm/modules/alif-shop-api/core/index.d.ts +1 -0
- package/lib/esm/modules/alif-shop-api/core/index.js +1 -0
- package/lib/esm/modules/alif-shop-api/index.d.ts +1 -0
- package/lib/esm/modules/alif-shop-api/index.js +1 -0
- package/lib/esm/modules/index.js +1 -1
- package/lib/esm/modules/uzum-market-api/core/auth/api.d.ts +4 -0
- package/lib/esm/modules/uzum-market-api/core/auth/api.js +1 -0
- package/lib/esm/modules/uzum-market-api/core/auth/enums.d.ts +6 -0
- package/lib/esm/modules/uzum-market-api/core/auth/enums.js +1 -0
- package/lib/esm/modules/uzum-market-api/core/auth/index.d.ts +1 -0
- package/lib/esm/modules/uzum-market-api/core/auth/index.js +1 -0
- package/lib/esm/modules/uzum-market-api/core/auth/params.js +1 -0
- package/lib/esm/modules/uzum-market-api/core/auth/types.d.ts +42 -0
- package/lib/esm/modules/uzum-market-api/core/auth/types.js +1 -0
- package/lib/esm/modules/uzum-market-api/core/index.d.ts +1 -0
- package/lib/esm/modules/uzum-market-api/core/index.js +1 -1
- package/lib/esm/modules/uzum-market-api/index.d.ts +1 -1
- package/lib/esm/modules/uzum-market-api/index.js +1 -1
- package/package.json +13 -10
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.GetToken=async(e,n)=>{const t={username:n.username,password:n.password,client_id:"merchant-frontend",grant_type:"password"};return e.post("/merchants/protocol/openid-connect/token",t,{headers:{"content-type":"application/x-www-form-urlencoded"}})};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./api";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./api.js");exports.GetToken=e.GetToken;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare namespace IAuth {
|
|
2
|
+
namespace GetToken {
|
|
3
|
+
interface Response {
|
|
4
|
+
access_token: string;
|
|
5
|
+
expires_in: number;
|
|
6
|
+
refresh_expires_in: number;
|
|
7
|
+
refresh_token: string;
|
|
8
|
+
token_type: "Bearer" & (string & {});
|
|
9
|
+
"not-before-policy": number;
|
|
10
|
+
session_state: string;
|
|
11
|
+
scope: string;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./auth";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./auth/api.js");exports.GetToken=e.GetToken;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./core";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./core/auth/api.js");exports.GetToken=e.GetToken;
|
package/lib/cjs/modules/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var e=require("./uzum-market-api/common/utils.js"),t=require("./uzum-market-api/core/auth/api.js"),r=require("./uzum-market-api/core/products/api.js");exports.pasteAuthHeader=e.pasteAuthHeader,exports.CheckToken=t.CheckToken,exports.GetToken=t.GetToken,exports.AddPromotion=r.AddPromotion,exports.ArchiveProduct=r.ArchiveProduct,exports.CheckSkuExists=r.CheckSkuExists,exports.CreateProduct=r.CreateProduct,exports.GetProduct=r.GetProduct,exports.InvolvedProductsList=r.InvolvedProductsList,exports.ProductDescription=r.ProductDescription,exports.ProductsList=r.ProductsList,exports.RemovePromotion=r.RemovePromotion,exports.SendSkuData=r.SendSkuData,exports.UnarchiveProduct=r.UnarchiveProduct;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CallerParam, UsernamePasswordParams } from "@/common";
|
|
2
|
+
import * as Types from "./types";
|
|
3
|
+
export declare const GetToken: CallerParam<UsernamePasswordParams, Types.AuthApi.GetToken.Response>;
|
|
4
|
+
export declare const CheckToken: CallerParam<string, Types.AuthApi.CheckToken.Response>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e={"content-type":"application/x-www-form-urlencoded",authorization:"Basic YjJiLWZyb250OmNsaWVudFNlY3JldA=="};exports.CheckToken=async(s,t)=>s.post("/auth/seller/check_token",{token:t},{headers:e}),exports.GetToken=async(s,t)=>s.post("/oauth/token",{grant_type:"password",username:t.username,password:t.password,referer:""},{headers:e});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var E;exports.AUTHORITIES=void 0,(E=exports.AUTHORITIES||(exports.AUTHORITIES={})).ROLE_CUSTOMER="ROLE_CUSTOMER",E.PHONE_VERIFIED="PHONE_VERIFIED",E.VERIFIED="VERIFIED",E.ROLE_SELLER="ROLE_SELLER";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./api";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./api.js");exports.CheckToken=e.CheckToken,exports.GetToken=e.GetToken;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { AUTHORITIES } from "./enums";
|
|
2
|
+
export declare namespace AuthEntity {
|
|
3
|
+
type Authority = keyof typeof AUTHORITIES;
|
|
4
|
+
interface User {
|
|
5
|
+
user_name: string;
|
|
6
|
+
uzumCustomerId: string;
|
|
7
|
+
active: boolean;
|
|
8
|
+
locale: string;
|
|
9
|
+
authorities: AuthEntity.Authority[];
|
|
10
|
+
client_id: string;
|
|
11
|
+
segments: string[];
|
|
12
|
+
firstName: string;
|
|
13
|
+
accountId: number;
|
|
14
|
+
phoneNumber: string;
|
|
15
|
+
sellerId: number;
|
|
16
|
+
permissions: Record<string, number[]>;
|
|
17
|
+
scope: string[];
|
|
18
|
+
customerId: number;
|
|
19
|
+
registrationDate: string;
|
|
20
|
+
organizations: Record<string, {
|
|
21
|
+
role: string;
|
|
22
|
+
permissions: string[];
|
|
23
|
+
}>;
|
|
24
|
+
banned: boolean;
|
|
25
|
+
exp: number;
|
|
26
|
+
email: string;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export declare namespace AuthApi {
|
|
30
|
+
namespace GetToken {
|
|
31
|
+
interface Response {
|
|
32
|
+
access_token: string;
|
|
33
|
+
token_type: "bearer";
|
|
34
|
+
refresh_token: string;
|
|
35
|
+
expires_in: number;
|
|
36
|
+
scope: string;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
namespace CheckToken {
|
|
40
|
+
type Response = AuthEntity.User;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t=require("./products/api.js");exports.
|
|
1
|
+
"use strict";var t=require("./auth/api.js"),o=require("./products/api.js");exports.CheckToken=t.CheckToken,exports.GetToken=t.GetToken,exports.AddPromotion=o.AddPromotion,exports.ArchiveProduct=o.ArchiveProduct,exports.CheckSkuExists=o.CheckSkuExists,exports.CreateProduct=o.CreateProduct,exports.GetProduct=o.GetProduct,exports.InvolvedProductsList=o.InvolvedProductsList,exports.ProductDescription=o.ProductDescription,exports.ProductsList=o.ProductsList,exports.RemovePromotion=o.RemovePromotion,exports.SendSkuData=o.SendSkuData,exports.UnarchiveProduct=o.UnarchiveProduct;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./common/utils";
|
|
2
|
-
export * from "./core
|
|
2
|
+
export * from "./core";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var e=require("./common/utils.js"),t=require("./core/auth/api.js"),o=require("./core/products/api.js");exports.pasteAuthHeader=e.pasteAuthHeader,exports.CheckToken=t.CheckToken,exports.GetToken=t.GetToken,exports.AddPromotion=o.AddPromotion,exports.ArchiveProduct=o.ArchiveProduct,exports.CheckSkuExists=o.CheckSkuExists,exports.CreateProduct=o.CreateProduct,exports.GetProduct=o.GetProduct,exports.InvolvedProductsList=o.InvolvedProductsList,exports.ProductDescription=o.ProductDescription,exports.ProductsList=o.ProductsList,exports.RemovePromotion=o.RemovePromotion,exports.SendSkuData=o.SendSkuData,exports.UnarchiveProduct=o.UnarchiveProduct;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=async(e,n)=>{const o={username:n.username,password:n.password,client_id:"merchant-frontend",grant_type:"password"};return e.post("/merchants/protocol/openid-connect/token",o,{headers:{"content-type":"application/x-www-form-urlencoded"}})};export{e as GetToken};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./api";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{GetToken}from"./api.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare namespace IAuth {
|
|
2
|
+
namespace GetToken {
|
|
3
|
+
interface Response {
|
|
4
|
+
access_token: string;
|
|
5
|
+
expires_in: number;
|
|
6
|
+
refresh_expires_in: number;
|
|
7
|
+
refresh_token: string;
|
|
8
|
+
token_type: "Bearer" & (string & {});
|
|
9
|
+
"not-before-policy": number;
|
|
10
|
+
session_state: string;
|
|
11
|
+
scope: string;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./auth";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{GetToken}from"./auth/api.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./core";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{GetToken}from"./core/auth/api.js";
|
package/lib/esm/modules/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{pasteAuthHeader}from"./uzum-market-api/common/utils.js";export{AddPromotion,ArchiveProduct,CheckSkuExists,CreateProduct,GetProduct,InvolvedProductsList,ProductDescription,ProductsList,RemovePromotion,SendSkuData,UnarchiveProduct}from"./uzum-market-api/core/products/api.js";
|
|
1
|
+
export{pasteAuthHeader}from"./uzum-market-api/common/utils.js";export{CheckToken,GetToken}from"./uzum-market-api/core/auth/api.js";export{AddPromotion,ArchiveProduct,CheckSkuExists,CreateProduct,GetProduct,InvolvedProductsList,ProductDescription,ProductsList,RemovePromotion,SendSkuData,UnarchiveProduct}from"./uzum-market-api/core/products/api.js";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CallerParam, UsernamePasswordParams } from "@/common";
|
|
2
|
+
import * as Types from "./types";
|
|
3
|
+
export declare const GetToken: CallerParam<UsernamePasswordParams, Types.AuthApi.GetToken.Response>;
|
|
4
|
+
export declare const CheckToken: CallerParam<string, Types.AuthApi.CheckToken.Response>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={"content-type":"application/x-www-form-urlencoded",authorization:"Basic YjJiLWZyb250OmNsaWVudFNlY3JldA=="},a=async(a,s)=>a.post("/oauth/token",{grant_type:"password",username:s.username,password:s.password,referer:""},{headers:e}),s=async(a,s)=>a.post("/auth/seller/check_token",{token:s},{headers:e});export{s as CheckToken,a as GetToken};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var E;!function(E){E.ROLE_CUSTOMER="ROLE_CUSTOMER",E.PHONE_VERIFIED="PHONE_VERIFIED",E.VERIFIED="VERIFIED",E.ROLE_SELLER="ROLE_SELLER"}(E||(E={}));export{E as AUTHORITIES};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./api";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{CheckToken,GetToken}from"./api.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { AUTHORITIES } from "./enums";
|
|
2
|
+
export declare namespace AuthEntity {
|
|
3
|
+
type Authority = keyof typeof AUTHORITIES;
|
|
4
|
+
interface User {
|
|
5
|
+
user_name: string;
|
|
6
|
+
uzumCustomerId: string;
|
|
7
|
+
active: boolean;
|
|
8
|
+
locale: string;
|
|
9
|
+
authorities: AuthEntity.Authority[];
|
|
10
|
+
client_id: string;
|
|
11
|
+
segments: string[];
|
|
12
|
+
firstName: string;
|
|
13
|
+
accountId: number;
|
|
14
|
+
phoneNumber: string;
|
|
15
|
+
sellerId: number;
|
|
16
|
+
permissions: Record<string, number[]>;
|
|
17
|
+
scope: string[];
|
|
18
|
+
customerId: number;
|
|
19
|
+
registrationDate: string;
|
|
20
|
+
organizations: Record<string, {
|
|
21
|
+
role: string;
|
|
22
|
+
permissions: string[];
|
|
23
|
+
}>;
|
|
24
|
+
banned: boolean;
|
|
25
|
+
exp: number;
|
|
26
|
+
email: string;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export declare namespace AuthApi {
|
|
30
|
+
namespace GetToken {
|
|
31
|
+
interface Response {
|
|
32
|
+
access_token: string;
|
|
33
|
+
token_type: "bearer";
|
|
34
|
+
refresh_token: string;
|
|
35
|
+
expires_in: number;
|
|
36
|
+
scope: string;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
namespace CheckToken {
|
|
40
|
+
type Response = AuthEntity.User;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{AddPromotion,ArchiveProduct,CheckSkuExists,CreateProduct,GetProduct,InvolvedProductsList,ProductDescription,ProductsList,RemovePromotion,SendSkuData,UnarchiveProduct}from"./products/api.js";
|
|
1
|
+
export{CheckToken,GetToken}from"./auth/api.js";export{AddPromotion,ArchiveProduct,CheckSkuExists,CreateProduct,GetProduct,InvolvedProductsList,ProductDescription,ProductsList,RemovePromotion,SendSkuData,UnarchiveProduct}from"./products/api.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./common/utils";
|
|
2
|
-
export * from "./core
|
|
2
|
+
export * from "./core";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{pasteAuthHeader}from"./common/utils.js";export{AddPromotion,ArchiveProduct,CheckSkuExists,CreateProduct,GetProduct,InvolvedProductsList,ProductDescription,ProductsList,RemovePromotion,SendSkuData,UnarchiveProduct}from"./core/products/api.js";
|
|
1
|
+
export{pasteAuthHeader}from"./common/utils.js";export{CheckToken,GetToken}from"./core/auth/api.js";export{AddPromotion,ArchiveProduct,CheckSkuExists,CreateProduct,GetProduct,InvolvedProductsList,ProductDescription,ProductsList,RemovePromotion,SendSkuData,UnarchiveProduct}from"./core/products/api.js";
|
package/package.json
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plaza-sdk",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"outputDir": "./lib",
|
|
5
5
|
"exports": {
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"uzum-market": "./lib/esm/modules/uzum-market-api/index.js"
|
|
6
|
+
".": {
|
|
7
|
+
"import": "./lib/esm/index.js",
|
|
8
|
+
"require": "./lib/cjs/index.js"
|
|
10
9
|
},
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"uzum-market": "./lib/cjs/modules/uzum-market-api/index.js"
|
|
10
|
+
"./uzum-market": {
|
|
11
|
+
"import": "./lib/esm/modules/uzum-market-api/index.js",
|
|
12
|
+
"require": "./lib/cjs/modules/uzum-market-api/index.js"
|
|
15
13
|
},
|
|
16
|
-
"
|
|
14
|
+
"./alif-shop": {
|
|
15
|
+
"import": "./lib/esm/modules/alif-shop-api/index.js",
|
|
16
|
+
"require": "./lib/cjs/modules/alif-shop-api/index.js"
|
|
17
|
+
}
|
|
17
18
|
},
|
|
19
|
+
"types": "./lib/esm/index.d.ts",
|
|
18
20
|
"main": "lib/cjs/index.js",
|
|
19
21
|
"module": "lib/esm/index.js",
|
|
20
22
|
"files": [
|
|
@@ -32,6 +34,7 @@
|
|
|
32
34
|
"publishConfig": {
|
|
33
35
|
"access": "public"
|
|
34
36
|
},
|
|
37
|
+
"sideEffects": false,
|
|
35
38
|
"engines": {
|
|
36
39
|
"npm": "please-use-yarn",
|
|
37
40
|
"yarn": ">= 1",
|