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.
Files changed (61) hide show
  1. package/lib/cjs/common/index.d.ts +1 -0
  2. package/lib/cjs/common/params.d.ts +4 -0
  3. package/lib/cjs/common/params.js +1 -0
  4. package/lib/cjs/modules/alif-shop-api/common/interfaces.js +1 -0
  5. package/lib/cjs/modules/alif-shop-api/common/types.js +1 -0
  6. package/lib/cjs/modules/alif-shop-api/common/utils.js +1 -0
  7. package/lib/cjs/modules/alif-shop-api/core/auth/api.d.ts +3 -0
  8. package/lib/cjs/modules/alif-shop-api/core/auth/api.js +1 -0
  9. package/lib/cjs/modules/alif-shop-api/core/auth/index.d.ts +1 -0
  10. package/lib/cjs/modules/alif-shop-api/core/auth/index.js +1 -0
  11. package/lib/cjs/modules/alif-shop-api/core/auth/types.d.ts +14 -0
  12. package/lib/cjs/modules/alif-shop-api/core/auth/types.js +1 -0
  13. package/lib/cjs/modules/alif-shop-api/core/index.d.ts +1 -0
  14. package/lib/cjs/modules/alif-shop-api/core/index.js +1 -0
  15. package/lib/cjs/modules/alif-shop-api/index.d.ts +1 -0
  16. package/lib/cjs/modules/alif-shop-api/index.js +1 -0
  17. package/lib/cjs/modules/index.js +1 -1
  18. package/lib/cjs/modules/uzum-market-api/core/auth/api.d.ts +4 -0
  19. package/lib/cjs/modules/uzum-market-api/core/auth/api.js +1 -0
  20. package/lib/cjs/modules/uzum-market-api/core/auth/enums.d.ts +6 -0
  21. package/lib/cjs/modules/uzum-market-api/core/auth/enums.js +1 -0
  22. package/lib/cjs/modules/uzum-market-api/core/auth/index.d.ts +1 -0
  23. package/lib/cjs/modules/uzum-market-api/core/auth/index.js +1 -0
  24. package/lib/cjs/modules/uzum-market-api/core/auth/params.js +1 -0
  25. package/lib/cjs/modules/uzum-market-api/core/auth/types.d.ts +42 -0
  26. package/lib/cjs/modules/uzum-market-api/core/auth/types.js +1 -0
  27. package/lib/cjs/modules/uzum-market-api/core/index.d.ts +1 -0
  28. package/lib/cjs/modules/uzum-market-api/core/index.js +1 -1
  29. package/lib/cjs/modules/uzum-market-api/index.d.ts +1 -1
  30. package/lib/cjs/modules/uzum-market-api/index.js +1 -1
  31. package/lib/esm/common/index.d.ts +1 -0
  32. package/lib/esm/common/params.d.ts +4 -0
  33. package/lib/esm/common/params.js +1 -0
  34. package/lib/esm/modules/alif-shop-api/common/interfaces.js +1 -0
  35. package/lib/esm/modules/alif-shop-api/common/types.js +1 -0
  36. package/lib/esm/modules/alif-shop-api/common/utils.js +1 -0
  37. package/lib/esm/modules/alif-shop-api/core/auth/api.d.ts +3 -0
  38. package/lib/esm/modules/alif-shop-api/core/auth/api.js +1 -0
  39. package/lib/esm/modules/alif-shop-api/core/auth/index.d.ts +1 -0
  40. package/lib/esm/modules/alif-shop-api/core/auth/index.js +1 -0
  41. package/lib/esm/modules/alif-shop-api/core/auth/types.d.ts +14 -0
  42. package/lib/esm/modules/alif-shop-api/core/auth/types.js +1 -0
  43. package/lib/esm/modules/alif-shop-api/core/index.d.ts +1 -0
  44. package/lib/esm/modules/alif-shop-api/core/index.js +1 -0
  45. package/lib/esm/modules/alif-shop-api/index.d.ts +1 -0
  46. package/lib/esm/modules/alif-shop-api/index.js +1 -0
  47. package/lib/esm/modules/index.js +1 -1
  48. package/lib/esm/modules/uzum-market-api/core/auth/api.d.ts +4 -0
  49. package/lib/esm/modules/uzum-market-api/core/auth/api.js +1 -0
  50. package/lib/esm/modules/uzum-market-api/core/auth/enums.d.ts +6 -0
  51. package/lib/esm/modules/uzum-market-api/core/auth/enums.js +1 -0
  52. package/lib/esm/modules/uzum-market-api/core/auth/index.d.ts +1 -0
  53. package/lib/esm/modules/uzum-market-api/core/auth/index.js +1 -0
  54. package/lib/esm/modules/uzum-market-api/core/auth/params.js +1 -0
  55. package/lib/esm/modules/uzum-market-api/core/auth/types.d.ts +42 -0
  56. package/lib/esm/modules/uzum-market-api/core/auth/types.js +1 -0
  57. package/lib/esm/modules/uzum-market-api/core/index.d.ts +1 -0
  58. package/lib/esm/modules/uzum-market-api/core/index.js +1 -1
  59. package/lib/esm/modules/uzum-market-api/index.d.ts +1 -1
  60. package/lib/esm/modules/uzum-market-api/index.js +1 -1
  61. package/package.json +13 -10
@@ -1,3 +1,4 @@
1
1
  export * from "./types";
2
2
  export * from "./utils";
3
+ export * from "./params";
3
4
  export * from "./interfaces";
@@ -0,0 +1,4 @@
1
+ export interface UsernamePasswordParams {
2
+ username: string;
3
+ password: string;
4
+ }
@@ -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,3 @@
1
+ import { CallerPayload, UsernamePasswordParams } from "@/common";
2
+ import * as Types from "./types";
3
+ export declare const GetToken: CallerPayload<UsernamePasswordParams, Types.IAuth.GetToken.Response>;
@@ -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;
@@ -1 +1 @@
1
- "use strict";var t=require("./uzum-market-api/common/utils.js"),r=require("./uzum-market-api/core/products/api.js");exports.pasteAuthHeader=t.pasteAuthHeader,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;
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,6 @@
1
+ export declare enum AUTHORITIES {
2
+ "ROLE_CUSTOMER" = "ROLE_CUSTOMER",
3
+ "PHONE_VERIFIED" = "PHONE_VERIFIED",
4
+ "VERIFIED" = "VERIFIED",
5
+ "ROLE_SELLER" = "ROLE_SELLER"
6
+ }
@@ -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,2 @@
1
+ export * from "./auth";
1
2
  export * from "./products";
@@ -1 +1 @@
1
- "use strict";var t=require("./products/api.js");exports.AddPromotion=t.AddPromotion,exports.ArchiveProduct=t.ArchiveProduct,exports.CheckSkuExists=t.CheckSkuExists,exports.CreateProduct=t.CreateProduct,exports.GetProduct=t.GetProduct,exports.InvolvedProductsList=t.InvolvedProductsList,exports.ProductDescription=t.ProductDescription,exports.ProductsList=t.ProductsList,exports.RemovePromotion=t.RemovePromotion,exports.SendSkuData=t.SendSkuData,exports.UnarchiveProduct=t.UnarchiveProduct;
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/products";
2
+ export * from "./core";
@@ -1 +1 @@
1
- "use strict";var t=require("./common/utils.js"),o=require("./core/products/api.js");exports.pasteAuthHeader=t.pasteAuthHeader,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
+ "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;
@@ -1,3 +1,4 @@
1
1
  export * from "./types";
2
2
  export * from "./utils";
3
+ export * from "./params";
3
4
  export * from "./interfaces";
@@ -0,0 +1,4 @@
1
+ export interface UsernamePasswordParams {
2
+ username: string;
3
+ password: string;
4
+ }
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,3 @@
1
+ import { CallerPayload, UsernamePasswordParams } from "@/common";
2
+ import * as Types from "./types";
3
+ export declare const GetToken: CallerPayload<UsernamePasswordParams, Types.IAuth.GetToken.Response>;
@@ -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
+ 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";
@@ -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,6 @@
1
+ export declare enum AUTHORITIES {
2
+ "ROLE_CUSTOMER" = "ROLE_CUSTOMER",
3
+ "PHONE_VERIFIED" = "PHONE_VERIFIED",
4
+ "VERIFIED" = "VERIFIED",
5
+ "ROLE_SELLER" = "ROLE_SELLER"
6
+ }
@@ -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,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
+ }
@@ -1 +1,2 @@
1
+ export * from "./auth";
1
2
  export * from "./products";
@@ -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/products";
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",
3
+ "version": "1.1.0",
4
4
  "outputDir": "./lib",
5
5
  "exports": {
6
- "import": {
7
- "types": "./lib/esm/index.d.ts",
8
- "default": "./lib/esm/index.js",
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
- "require": {
12
- "types": "./lib/cjs/index.d.ts",
13
- "default": "./lib/cjs/index.js",
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
- "types": "./lib/esm/index.d.ts"
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",