plaza-sdk 1.3.1 → 1.3.3

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(e){"use strict";return e.getNumber=(e,r=0)=>{if("number"==typeof e)return e;if("string"==typeof e){const t=parseFloat(e);return isNaN(t)?r:t}return r},e.pasteAuthHeader=e=>({Authorization:`Bearer ${e}`}),e.pasteAuthHeaderAndApikey=(e,r="2qHIakuLe5",t="apikey")=>({Authorization:`Bearer ${e}`,[t]:r,locale:"ru"}),e}({});
1
+ var plazaSdk=function(e){"use strict";return e.getNumber=(e,r=0)=>{if("number"==typeof e)return e;if("string"==typeof e){const t=parseFloat(e);return isNaN(t)?r:t}return r},e.pasteAuthHeader=e=>({...e?{Authorization:`Bearer ${e}`}:{}}),e.pasteAuthHeaderAndApikey=(e,r="2qHIakuLe5",t="apikey")=>({...e?{Authorization:`Bearer ${e}`}:{},[t]:r,locale:"ru"}),e}({});
@@ -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 o=parseFloat(e);return isNaN(o)?t:o}return t},e.pasteAuthHeader=e=>({Authorization:`Bearer ${e}`}),e.pasteAuthHeaderAndApikey=(e,t="2qHIakuLe5",o="apikey")=>({Authorization:`Bearer ${e}`,[o]:t,locale:"ru"})});
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 o=parseFloat(e);return isNaN(o)?t:o}return t},e.pasteAuthHeader=e=>({...e?{Authorization:`Bearer ${e}`}:{}}),e.pasteAuthHeaderAndApikey=(e,t="2qHIakuLe5",o="apikey")=>({...e?{Authorization:`Bearer ${e}`}:{},[o]:t,locale:"ru"})});
@@ -1 +1 @@
1
- "use strict";exports.getNumber=(e,r=0)=>{if("number"==typeof e)return e;if("string"==typeof e){const t=parseFloat(e);return isNaN(t)?r:t}return r},exports.pasteAuthHeader=e=>({Authorization:`Bearer ${e}`}),exports.pasteAuthHeaderAndApikey=(e,r="2qHIakuLe5",t="apikey")=>({Authorization:`Bearer ${e}`,[t]:r,locale:"ru"});
1
+ "use strict";exports.getNumber=(e,r=0)=>{if("number"==typeof e)return e;if("string"==typeof e){const t=parseFloat(e);return isNaN(t)?r:t}return r},exports.pasteAuthHeader=e=>({...e?{Authorization:`Bearer ${e}`}:{}}),exports.pasteAuthHeaderAndApikey=(e,r="2qHIakuLe5",t="apikey")=>({...e?{Authorization:`Bearer ${e}`}:{},[t]:r,locale:"ru"});
@@ -1 +1 @@
1
- "use strict";var a=require("../../../../common/utils.js");exports.ApplicationsList=async(i,{token:s,...t})=>i.get("/application/applications/applications",{params:t,headers:a.pasteAuthHeaderAndApikey(s)});
1
+ "use strict";var e=require("../../../../common/utils.js");exports.ApplicationsList=(i,{token:a,...p})=>i.get("/application/applications/applications",{params:p,headers:e.pasteAuthHeaderAndApikey(a)}),exports.DeliverableWithType=(i,a)=>i.get(`/delivery/deliveries/deliverable/${a.applicationId}/with-type`,{params:{deliverable_type:"application"},headers:e.pasteAuthHeaderAndApikey(a?.token)}),exports.SingleApplication=(i,a)=>i.get(`/application/applications/applications/${a.applicationId}`,{headers:e.pasteAuthHeaderAndApikey(a?.token)});
@@ -1 +1 @@
1
- "use strict";var i=require("./api.js");exports.ApplicationsList=i.ApplicationsList;
1
+ "use strict";var i=require("./api.js");exports.ApplicationsList=i.ApplicationsList,exports.DeliverableWithType=i.DeliverableWithType,exports.SingleApplication=i.SingleApplication;
@@ -1 +1 @@
1
- "use strict";var e=require("./auth/api.js"),r=require("./products/api.js"),s=require("./applications/api.js");exports.GetToken=e.GetToken,exports.RefreshToken=e.RefreshToken,exports.SingleWarehouseProduct=r.SingleWarehouseProduct,exports.UpdateWarehouseProduct=r.UpdateWarehouseProduct,exports.WarehouseList=r.WarehouseList,exports.ApplicationsList=s.ApplicationsList;
1
+ "use strict";var e=require("./auth/api.js"),r=require("./products/api.js"),t=require("./applications/api.js");exports.GetToken=e.GetToken,exports.RefreshToken=e.RefreshToken,exports.SingleWarehouseProduct=r.SingleWarehouseProduct,exports.UpdateWarehouseProduct=r.UpdateWarehouseProduct,exports.WarehouseList=r.WarehouseList,exports.ApplicationsList=t.ApplicationsList,exports.DeliverableWithType=t.DeliverableWithType,exports.SingleApplication=t.SingleApplication;
@@ -1 +1 @@
1
- "use strict";var e=require("./core/auth/api.js"),r=require("./core/products/api.js"),o=require("./core/applications/api.js");exports.GetToken=e.GetToken,exports.RefreshToken=e.RefreshToken,exports.SingleWarehouseProduct=r.SingleWarehouseProduct,exports.UpdateWarehouseProduct=r.UpdateWarehouseProduct,exports.WarehouseList=r.WarehouseList,exports.ApplicationsList=o.ApplicationsList;
1
+ "use strict";var e=require("./core/auth/api.js"),r=require("./core/products/api.js"),o=require("./core/applications/api.js");exports.GetToken=e.GetToken,exports.RefreshToken=e.RefreshToken,exports.SingleWarehouseProduct=r.SingleWarehouseProduct,exports.UpdateWarehouseProduct=r.UpdateWarehouseProduct,exports.WarehouseList=r.WarehouseList,exports.ApplicationsList=o.ApplicationsList,exports.DeliverableWithType=o.DeliverableWithType,exports.SingleApplication=o.SingleApplication;
@@ -1 +1 @@
1
- const r=(r,e=0)=>{if("number"==typeof r)return r;if("string"==typeof r){const t=parseFloat(r);return isNaN(t)?e:t}return e},e=r=>({Authorization:`Bearer ${r}`}),t=(r,e="2qHIakuLe5",t="apikey")=>({Authorization:`Bearer ${r}`,[t]:e,locale:"ru"});export{r as getNumber,e as pasteAuthHeader,t as pasteAuthHeaderAndApikey};
1
+ const r=(r,e=0)=>{if("number"==typeof r)return r;if("string"==typeof r){const t=parseFloat(r);return isNaN(t)?e:t}return e},e=r=>({...r?{Authorization:`Bearer ${r}`}:{}}),t=(r,e="2qHIakuLe5",t="apikey")=>({...r?{Authorization:`Bearer ${r}`}:{},[t]:e,locale:"ru"});export{r as getNumber,e as pasteAuthHeader,t as pasteAuthHeaderAndApikey};
@@ -1 +1 @@
1
- import{pasteAuthHeaderAndApikey as a}from"../../../../common/utils.js";const o=async(o,{token:p,...t})=>o.get("/application/applications/applications",{params:t,headers:a(p)});export{o as ApplicationsList};
1
+ import{pasteAuthHeaderAndApikey as a}from"../../../../common/utils.js";const e=(e,{token:i,...p})=>e.get("/application/applications/applications",{params:p,headers:a(i)}),i=(e,i)=>e.get(`/application/applications/applications/${i.applicationId}`,{headers:a(i?.token)}),p=(e,i)=>e.get(`/delivery/deliveries/deliverable/${i.applicationId}/with-type`,{params:{deliverable_type:"application"},headers:a(i?.token)});export{e as ApplicationsList,p as DeliverableWithType,i as SingleApplication};
@@ -1 +1 @@
1
- export{ApplicationsList}from"./api.js";
1
+ export{ApplicationsList,DeliverableWithType,SingleApplication}from"./api.js";
@@ -1 +1 @@
1
- export{GetToken,RefreshToken}from"./auth/api.js";export{SingleWarehouseProduct,UpdateWarehouseProduct,WarehouseList}from"./products/api.js";export{ApplicationsList}from"./applications/api.js";
1
+ export{GetToken,RefreshToken}from"./auth/api.js";export{SingleWarehouseProduct,UpdateWarehouseProduct,WarehouseList}from"./products/api.js";export{ApplicationsList,DeliverableWithType,SingleApplication}from"./applications/api.js";
@@ -1 +1 @@
1
- export{GetToken,RefreshToken}from"./core/auth/api.js";export{SingleWarehouseProduct,UpdateWarehouseProduct,WarehouseList}from"./core/products/api.js";export{ApplicationsList}from"./core/applications/api.js";
1
+ export{GetToken,RefreshToken}from"./core/auth/api.js";export{SingleWarehouseProduct,UpdateWarehouseProduct,WarehouseList}from"./core/products/api.js";export{ApplicationsList,DeliverableWithType,SingleApplication}from"./core/applications/api.js";
@@ -1,5 +1,5 @@
1
1
  interface TokenParams {
2
- token: string;
2
+ token?: string;
3
3
  }
4
4
  interface UsernamePasswordParams {
5
5
  username: string;
@@ -1,11 +1,10 @@
1
1
  declare const getNumber: (value: unknown, defaultValue?: number) => number;
2
- declare const pasteAuthHeader: (token: string) => {
3
- Authorization: string;
2
+ declare const pasteAuthHeader: (token?: string) => {
3
+ Authorization?: string | undefined;
4
4
  };
5
- declare const pasteAuthHeaderAndApikey: (token: string, apikey?: string, apikeyFieldName?: string) => {
6
- [x: string]: string;
7
- Authorization: string;
5
+ declare const pasteAuthHeaderAndApikey: (token?: string, apikey?: string, apikeyFieldName?: string) => {
8
6
  locale: string;
7
+ Authorization?: string | undefined;
9
8
  };
10
9
 
11
10
  export { getNumber, pasteAuthHeader, pasteAuthHeaderAndApikey };
@@ -1,10 +1,12 @@
1
1
  import { CallerParam } from '../../../../common/types.js';
2
2
  import { ApplicationsApi } from './types.js';
3
- import { ApplicationsParams } from './params.js';
3
+ import { ApplicationsParams, ApplicationIdBasedParams } from './params.js';
4
4
  import 'axios';
5
5
  import '../../common/interfaces.js';
6
6
  import '../../../../common/params.js';
7
7
 
8
8
  declare const ApplicationsList: CallerParam<ApplicationsParams, ApplicationsApi.List.Response>;
9
+ declare const SingleApplication: CallerParam<ApplicationIdBasedParams, ApplicationsApi.Single.Response>;
10
+ declare const DeliverableWithType: CallerParam<ApplicationIdBasedParams>;
9
11
 
10
- export { ApplicationsList };
12
+ export { ApplicationsList, DeliverableWithType, SingleApplication };
@@ -1,6 +1,6 @@
1
- export { ApplicationsList } from './api.js';
1
+ export { ApplicationsList, DeliverableWithType, SingleApplication } from './api.js';
2
2
  export { ApplicationsApi, ApplicationsEntity } from './types.js';
3
- export { ApplicationsParams } from './params.js';
3
+ export { ApplicationIdBasedParams, ApplicationsParams } from './params.js';
4
4
  import '../../../../common/types.js';
5
5
  import 'axios';
6
6
  import '../../common/interfaces.js';
@@ -17,5 +17,8 @@ interface ApplicationsParams extends TokenParams {
17
17
  search_param: "phone" | "fio" | "passport" | "pinfl" | "application_id" | (string & {});
18
18
  status_key: ApplicationsEntity.Statuses | (string & {});
19
19
  }
20
+ interface ApplicationIdBasedParams extends TokenParams {
21
+ applicationId: string;
22
+ }
20
23
 
21
- export type { ApplicationsParams };
24
+ export type { ApplicationIdBasedParams, ApplicationsParams };
@@ -3,9 +3,77 @@ import { IPaginatedResponse } from '../../common/interfaces.js';
3
3
  declare namespace ApplicationsEntity {
4
4
  type Sources = "MERCHANT" | "MERCHANT_MOBILE" | "ALIFSHOP" | "ALIFSHOP_MOBILE" | "ALIFMOBI" | "ALIFSHOP_MINI_APP" | "ONLINE" | "E-COMMERCE" | "COMPLIANCE";
5
5
  type Statuses = "NEW" | "REVIEWING" | "APPROVED" | "REJECTED" | "COMPLETED" | "CANCELLED" | "DELETED" | "TO_DELIVERY";
6
+ interface Deliverable {
7
+ id: number;
8
+ deliverable_type: string;
9
+ deliverable_id: number;
10
+ type: string;
11
+ type_service: string;
12
+ created_at: string;
13
+ sender: {
14
+ location: {
15
+ city: string;
16
+ region: string;
17
+ street: string;
18
+ district: string;
19
+ index_id: unknown | null;
20
+ point_id: unknown | null;
21
+ };
22
+ sender_info: {
23
+ name: string;
24
+ contact_phone: string;
25
+ contact_person: string;
26
+ };
27
+ };
28
+ receiver: {
29
+ location: {
30
+ city: string;
31
+ region: string;
32
+ street: string;
33
+ district: string;
34
+ index_id: unknown | null;
35
+ latitude: unknown | null;
36
+ point_id: unknown | null;
37
+ longitude: unknown | null;
38
+ };
39
+ receiver_info: {
40
+ contact_phone: string;
41
+ contact_person: string;
42
+ };
43
+ };
44
+ status: {
45
+ id: number;
46
+ key: string;
47
+ name_ru: string;
48
+ name_uz: string;
49
+ };
50
+ status_tag: {
51
+ key: string;
52
+ value: string;
53
+ body_ru: string;
54
+ body_uz: string;
55
+ };
56
+ products_info: [
57
+ {
58
+ name: string;
59
+ price: number;
60
+ }
61
+ ];
62
+ alif_delivery: {
63
+ application_id_from_alif_delivery: string;
64
+ alif_delivery_status_key: string;
65
+ driver_id: number;
66
+ };
67
+ delivery_status_id: number;
68
+ alif_delivery_order_id: string;
69
+ date_pickup: string;
70
+ weight: number;
71
+ volume: number;
72
+ entity_created_at: string;
73
+ }
6
74
  interface ApplicationStatus {
7
75
  id: number;
8
- key: "APPROVED";
76
+ key: Statuses;
9
77
  title_ru: string;
10
78
  body: string;
11
79
  class: string;
@@ -19,7 +87,38 @@ declare namespace ApplicationsEntity {
19
87
  phone: string;
20
88
  client_status_key: "IDENTIFIED";
21
89
  }
90
+ interface ApplicationPurchaseStatus {
91
+ id: number;
92
+ application_id: number;
93
+ status: string;
94
+ created_at: string;
95
+ updated_at: string;
96
+ }
22
97
  interface Application {
98
+ id: number;
99
+ application_id: number;
100
+ good_name: string;
101
+ good: {
102
+ name: string;
103
+ };
104
+ good_type: {
105
+ id: number;
106
+ name: string;
107
+ is_markable: boolean;
108
+ };
109
+ good_type_id: number;
110
+ price: number;
111
+ quantity: number;
112
+ sku: string;
113
+ ikpu: string;
114
+ warehouse_item_id: number;
115
+ marking: unknown | null;
116
+ imeis: unknown[];
117
+ created_at: string;
118
+ updated_at: string;
119
+ deleted_at: string | null;
120
+ }
121
+ interface ApplicationProduct {
23
122
  amount: number;
24
123
  application_condition_id: number;
25
124
  application_status: ApplicationsEntity.ApplicationStatus;
@@ -60,10 +159,23 @@ declare namespace ApplicationsEntity {
60
159
  updated_from_str: "CRM" | "CREDITS" | (string & {});
61
160
  confirmed_by_merchant: false;
62
161
  }
162
+ interface SingleApplicationProduct extends ApplicationProduct {
163
+ contract: unknown | null;
164
+ application_items: Application[];
165
+ alif_purchase_status: ApplicationPurchaseStatus;
166
+ }
63
167
  }
64
168
  declare namespace ApplicationsApi {
65
169
  namespace List {
66
- type Response = IPaginatedResponse<ApplicationsEntity.Application[]>;
170
+ type Response = IPaginatedResponse<ApplicationsEntity.ApplicationProduct[]>;
171
+ }
172
+ namespace Single {
173
+ type Response = ApplicationsEntity.SingleApplicationProduct;
174
+ }
175
+ namespace DeliverableList {
176
+ interface Response {
177
+ data: ApplicationsEntity.Deliverable[];
178
+ }
67
179
  }
68
180
  }
69
181
 
@@ -3,9 +3,9 @@ export { AuthApi } from './auth/types.js';
3
3
  export { SingleWarehouseProduct, UpdateWarehouseProduct, 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 { ApplicationsList } from './applications/api.js';
6
+ export { ApplicationsList, DeliverableWithType, SingleApplication } from './applications/api.js';
7
7
  export { ApplicationsApi, ApplicationsEntity } from './applications/types.js';
8
- export { ApplicationsParams } from './applications/params.js';
8
+ export { ApplicationIdBasedParams, ApplicationsParams } from './applications/params.js';
9
9
  export { AlifShopEntity } from './types.js';
10
10
  import '../../../common/types.js';
11
11
  import 'axios';
@@ -3,9 +3,9 @@ export { AuthApi } from './core/auth/types.js';
3
3
  export { SingleWarehouseProduct, UpdateWarehouseProduct, 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 { ApplicationsList } from './core/applications/api.js';
6
+ export { ApplicationsList, DeliverableWithType, SingleApplication } from './core/applications/api.js';
7
7
  export { ApplicationsApi, ApplicationsEntity } from './core/applications/types.js';
8
- export { ApplicationsParams } from './core/applications/params.js';
8
+ export { ApplicationIdBasedParams, ApplicationsParams } from './core/applications/params.js';
9
9
  export { AlifShopEntity } from './core/types.js';
10
10
  import '../../common/types.js';
11
11
  import 'axios';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plaza-sdk",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "outputDir": "./lib",
5
5
  "exports": {
6
6
  ".": {