@pexcode/dlis-sdk 1.0.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 (115) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +332 -0
  3. package/dist/api/core/ApiError.d.ts +10 -0
  4. package/dist/api/core/ApiError.js +15 -0
  5. package/dist/api/core/ApiRequestOptions.d.ts +13 -0
  6. package/dist/api/core/ApiRequestOptions.js +2 -0
  7. package/dist/api/core/ApiResult.d.ts +7 -0
  8. package/dist/api/core/ApiResult.js +2 -0
  9. package/dist/api/core/CancelablePromise.d.ts +20 -0
  10. package/dist/api/core/CancelablePromise.js +116 -0
  11. package/dist/api/core/OpenAPI.d.ts +16 -0
  12. package/dist/api/core/OpenAPI.js +14 -0
  13. package/dist/api/core/request.d.ts +34 -0
  14. package/dist/api/core/request.js +294 -0
  15. package/dist/api/index.d.ts +46 -0
  16. package/dist/api/index.js +48 -0
  17. package/dist/api/models/AppLevel.d.ts +5 -0
  18. package/dist/api/models/AppLevel.js +13 -0
  19. package/dist/api/models/BillingType.d.ts +5 -0
  20. package/dist/api/models/BillingType.js +13 -0
  21. package/dist/api/models/BranchId.d.ts +1 -0
  22. package/dist/api/models/BranchId.js +2 -0
  23. package/dist/api/models/BranchLedgerAttributes.d.ts +23 -0
  24. package/dist/api/models/BranchLedgerAttributes.js +2 -0
  25. package/dist/api/models/CalculateCostAttributes.d.ts +14 -0
  26. package/dist/api/models/CalculateCostAttributes.js +2 -0
  27. package/dist/api/models/CheckBlackListAttribute.d.ts +7 -0
  28. package/dist/api/models/CheckBlackListAttribute.js +2 -0
  29. package/dist/api/models/ClientAttributes.d.ts +26 -0
  30. package/dist/api/models/ClientAttributes.js +2 -0
  31. package/dist/api/models/ClientCreationAttributes.d.ts +12 -0
  32. package/dist/api/models/ClientCreationAttributes.js +2 -0
  33. package/dist/api/models/ClientTypeEnum.d.ts +4 -0
  34. package/dist/api/models/ClientTypeEnum.js +12 -0
  35. package/dist/api/models/CostId.d.ts +1 -0
  36. package/dist/api/models/CostId.js +2 -0
  37. package/dist/api/models/Currencies.d.ts +7 -0
  38. package/dist/api/models/Currencies.js +15 -0
  39. package/dist/api/models/EndpointId.d.ts +1 -0
  40. package/dist/api/models/EndpointId.js +2 -0
  41. package/dist/api/models/HttpSuccess.d.ts +5 -0
  42. package/dist/api/models/HttpSuccess.js +2 -0
  43. package/dist/api/models/LedgerCategory.d.ts +7 -0
  44. package/dist/api/models/LedgerCategory.js +15 -0
  45. package/dist/api/models/LedgerStatus.d.ts +5 -0
  46. package/dist/api/models/LedgerStatus.js +13 -0
  47. package/dist/api/models/LedgerType.d.ts +4 -0
  48. package/dist/api/models/LedgerType.js +12 -0
  49. package/dist/api/models/MovementsStatusAttributes.d.ts +6 -0
  50. package/dist/api/models/MovementsStatusAttributes.js +14 -0
  51. package/dist/api/models/PackageId.d.ts +1 -0
  52. package/dist/api/models/PackageId.js +2 -0
  53. package/dist/api/models/PackagePlatform.d.ts +6 -0
  54. package/dist/api/models/PackagePlatform.js +14 -0
  55. package/dist/api/models/PackageType.d.ts +4 -0
  56. package/dist/api/models/PackageType.js +12 -0
  57. package/dist/api/models/PlatformEnum.d.ts +8 -0
  58. package/dist/api/models/PlatformEnum.js +16 -0
  59. package/dist/api/models/ProofOfDeliveryType.d.ts +5 -0
  60. package/dist/api/models/ProofOfDeliveryType.js +13 -0
  61. package/dist/api/models/ReferenceType.d.ts +4 -0
  62. package/dist/api/models/ReferenceType.js +12 -0
  63. package/dist/api/models/SdkId.d.ts +1 -0
  64. package/dist/api/models/SdkId.js +2 -0
  65. package/dist/api/models/SdkInfoAttributes.d.ts +25 -0
  66. package/dist/api/models/SdkInfoAttributes.js +2 -0
  67. package/dist/api/models/SdkLedgerOverview.d.ts +6 -0
  68. package/dist/api/models/SdkLedgerOverview.js +2 -0
  69. package/dist/api/models/SdkPackagesCreationAttributes.d.ts +26 -0
  70. package/dist/api/models/SdkPackagesCreationAttributes.js +2 -0
  71. package/dist/api/models/ShippingOption.d.ts +5 -0
  72. package/dist/api/models/ShippingOption.js +13 -0
  73. package/dist/api/models/ShippingServiceData.d.ts +10 -0
  74. package/dist/api/models/ShippingServiceData.js +2 -0
  75. package/dist/api/models/Sizes.d.ts +5 -0
  76. package/dist/api/models/Sizes.js +13 -0
  77. package/dist/api/models/TenantId.d.ts +1 -0
  78. package/dist/api/models/TenantId.js +2 -0
  79. package/dist/api/models/UserId.d.ts +1 -0
  80. package/dist/api/models/UserId.js +2 -0
  81. package/dist/api/models/appAttributes.d.ts +4 -0
  82. package/dist/api/models/appAttributes.js +2 -0
  83. package/dist/api/models/branchesAttributes.d.ts +28 -0
  84. package/dist/api/models/branchesAttributes.js +2 -0
  85. package/dist/api/models/citiesAttributes.d.ts +12 -0
  86. package/dist/api/models/citiesAttributes.js +2 -0
  87. package/dist/api/models/costModelAttributes.d.ts +29 -0
  88. package/dist/api/models/costModelAttributes.js +2 -0
  89. package/dist/api/models/limitedSdkAttributes.d.ts +11 -0
  90. package/dist/api/models/limitedSdkAttributes.js +2 -0
  91. package/dist/api/models/movementsAttributes.d.ts +19 -0
  92. package/dist/api/models/movementsAttributes.js +2 -0
  93. package/dist/api/models/packagesAttributes.d.ts +70 -0
  94. package/dist/api/models/packagesAttributes.js +2 -0
  95. package/dist/api/models/packagesGroupAttributes.d.ts +8 -0
  96. package/dist/api/models/packagesGroupAttributes.js +2 -0
  97. package/dist/api/models/regionsAttributes.d.ts +11 -0
  98. package/dist/api/models/regionsAttributes.js +2 -0
  99. package/dist/api/models/sdksAttributes.d.ts +23 -0
  100. package/dist/api/models/sdksAttributes.js +2 -0
  101. package/dist/api/services/RegionsControllerService.d.ts +30 -0
  102. package/dist/api/services/RegionsControllerService.js +49 -0
  103. package/dist/api/services/SdkControllerService.d.ts +54 -0
  104. package/dist/api/services/SdkControllerService.js +94 -0
  105. package/dist/api/services/SdkPackagesControllerService.d.ts +55 -0
  106. package/dist/api/services/SdkPackagesControllerService.js +109 -0
  107. package/dist/api/services/SdkRegionsControllerService.d.ts +17 -0
  108. package/dist/api/services/SdkRegionsControllerService.js +36 -0
  109. package/dist/api-handler.d.ts +10 -0
  110. package/dist/api-handler.js +26 -0
  111. package/dist/index.d.ts +36 -0
  112. package/dist/index.js +130 -0
  113. package/dist/sdk.spec.d.ts +1 -0
  114. package/dist/sdk.spec.js +150 -0
  115. package/package.json +38 -0
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RegionsControllerService = void 0;
4
+ const OpenAPI_1 = require("../core/OpenAPI");
5
+ const request_1 = require("../core/request");
6
+ class RegionsControllerService {
7
+ /**
8
+ * @param regionId
9
+ * @returns any Ok
10
+ * @throws ApiError
11
+ */
12
+ static getCities(regionId) {
13
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
14
+ method: 'GET',
15
+ url: '/api/regions/cities/{regionId}',
16
+ path: {
17
+ 'regionId': regionId,
18
+ },
19
+ });
20
+ }
21
+ /**
22
+ * @param countryId
23
+ * @returns any Ok
24
+ * @throws ApiError
25
+ */
26
+ static getRegions(countryId) {
27
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
28
+ method: 'GET',
29
+ url: '/api/regions/{countryId}',
30
+ path: {
31
+ 'countryId': countryId,
32
+ },
33
+ });
34
+ }
35
+ /**
36
+ * @param requestBody
37
+ * @returns any Ok
38
+ * @throws ApiError
39
+ */
40
+ static createNewCity(requestBody) {
41
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
42
+ method: 'POST',
43
+ url: '/api/regions/create-city',
44
+ body: requestBody,
45
+ mediaType: 'application/json',
46
+ });
47
+ }
48
+ }
49
+ exports.RegionsControllerService = RegionsControllerService;
@@ -0,0 +1,54 @@
1
+ import type { branchesAttributes } from '../models/branchesAttributes';
2
+ import type { BranchLedgerAttributes } from '../models/BranchLedgerAttributes';
3
+ import type { CalculateCostAttributes } from '../models/CalculateCostAttributes';
4
+ import type { HttpSuccess } from '../models/HttpSuccess';
5
+ import type { SdkInfoAttributes } from '../models/SdkInfoAttributes';
6
+ import type { SdkLedgerOverview } from '../models/SdkLedgerOverview';
7
+ import type { ShippingServiceData } from '../models/ShippingServiceData';
8
+ import type { CancelablePromise } from '../core/CancelablePromise';
9
+ export declare class SdkControllerService {
10
+ /**
11
+ * @returns any Ok
12
+ * @throws ApiError
13
+ */
14
+ static getTenantBranches(): CancelablePromise<Array<branchesAttributes>>;
15
+ /**
16
+ * @returns any Ok
17
+ * @throws ApiError
18
+ */
19
+ static getMyInfo(): CancelablePromise<SdkInfoAttributes>;
20
+ /**
21
+ * @param cityId
22
+ * @returns any Ok
23
+ * @throws ApiError
24
+ */
25
+ static getListOfCity(cityId: number): CancelablePromise<Array<branchesAttributes>>;
26
+ /**
27
+ * @param requestBody
28
+ * @returns any Ok
29
+ * @throws ApiError
30
+ */
31
+ static calculateCost(requestBody: CalculateCostAttributes): CancelablePromise<ShippingServiceData>;
32
+ /**
33
+ * @param year
34
+ * @param month
35
+ * @returns any Ok
36
+ * @throws ApiError
37
+ */
38
+ static getLedgerList(year?: number, month?: number): CancelablePromise<Array<BranchLedgerAttributes>>;
39
+ /**
40
+ * @returns any Ok
41
+ * @throws ApiError
42
+ */
43
+ static getLedgerOverView(): CancelablePromise<SdkLedgerOverview>;
44
+ /**
45
+ * @param requestBody
46
+ * @returns any Ok
47
+ * @throws ApiError
48
+ */
49
+ static setWebhook(requestBody: {
50
+ host: string;
51
+ webhookToken: string;
52
+ path: string;
53
+ }): CancelablePromise<HttpSuccess>;
54
+ }
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SdkControllerService = void 0;
4
+ const OpenAPI_1 = require("../core/OpenAPI");
5
+ const request_1 = require("../core/request");
6
+ class SdkControllerService {
7
+ /**
8
+ * @returns any Ok
9
+ * @throws ApiError
10
+ */
11
+ static getTenantBranches() {
12
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
13
+ method: 'GET',
14
+ url: '/sdk/v2/tenant-branches',
15
+ });
16
+ }
17
+ /**
18
+ * @returns any Ok
19
+ * @throws ApiError
20
+ */
21
+ static getMyInfo() {
22
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
23
+ method: 'GET',
24
+ url: '/sdk/v2/me-info',
25
+ });
26
+ }
27
+ /**
28
+ * @param cityId
29
+ * @returns any Ok
30
+ * @throws ApiError
31
+ */
32
+ static getListOfCity(cityId) {
33
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
34
+ method: 'GET',
35
+ url: '/sdk/v2/place/{city}',
36
+ query: {
37
+ 'cityId': cityId,
38
+ },
39
+ });
40
+ }
41
+ /**
42
+ * @param requestBody
43
+ * @returns any Ok
44
+ * @throws ApiError
45
+ */
46
+ static calculateCost(requestBody) {
47
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
48
+ method: 'POST',
49
+ url: '/sdk/v2/shipping/cost',
50
+ body: requestBody,
51
+ mediaType: 'application/json',
52
+ });
53
+ }
54
+ /**
55
+ * @param year
56
+ * @param month
57
+ * @returns any Ok
58
+ * @throws ApiError
59
+ */
60
+ static getLedgerList(year, month) {
61
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
62
+ method: 'GET',
63
+ url: '/sdk/v2/ledger',
64
+ query: {
65
+ 'year': year,
66
+ 'month': month,
67
+ },
68
+ });
69
+ }
70
+ /**
71
+ * @returns any Ok
72
+ * @throws ApiError
73
+ */
74
+ static getLedgerOverView() {
75
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
76
+ method: 'GET',
77
+ url: '/sdk/v2/ledger-overview',
78
+ });
79
+ }
80
+ /**
81
+ * @param requestBody
82
+ * @returns any Ok
83
+ * @throws ApiError
84
+ */
85
+ static setWebhook(requestBody) {
86
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
87
+ method: 'POST',
88
+ url: '/sdk/v2/set-webhook',
89
+ body: requestBody,
90
+ mediaType: 'application/json',
91
+ });
92
+ }
93
+ }
94
+ exports.SdkControllerService = SdkControllerService;
@@ -0,0 +1,55 @@
1
+ import type { CheckBlackListAttribute } from '../models/CheckBlackListAttribute';
2
+ import type { ClientAttributes } from '../models/ClientAttributes';
3
+ import type { HttpSuccess } from '../models/HttpSuccess';
4
+ import type { PackageId } from '../models/PackageId';
5
+ import type { packagesAttributes } from '../models/packagesAttributes';
6
+ import type { SdkPackagesCreationAttributes } from '../models/SdkPackagesCreationAttributes';
7
+ import type { CancelablePromise } from '../core/CancelablePromise';
8
+ export declare class SdkPackagesControllerService {
9
+ /**
10
+ * @param id
11
+ * @returns any Ok
12
+ * @throws ApiError
13
+ */
14
+ static getPackageDetails(id: PackageId): CancelablePromise<packagesAttributes>;
15
+ /**
16
+ * @param page
17
+ * @param pageSize
18
+ * @returns any Ok
19
+ * @throws ApiError
20
+ */
21
+ static getList(page?: number, pageSize?: number): CancelablePromise<Array<packagesAttributes>>;
22
+ /**
23
+ * @param requestBody
24
+ * @returns any Ok
25
+ * @throws ApiError
26
+ */
27
+ static createNewPackage(requestBody: SdkPackagesCreationAttributes): CancelablePromise<packagesAttributes>;
28
+ /**
29
+ * @param id
30
+ * @returns any Ok
31
+ * @throws ApiError
32
+ */
33
+ static sendDataToCEnter(id: PackageId): CancelablePromise<HttpSuccess>;
34
+ /**
35
+ * @param id
36
+ * @returns any Ok
37
+ * @throws ApiError
38
+ */
39
+ static canceled(id: PackageId): CancelablePromise<HttpSuccess>;
40
+ /**
41
+ * @param id
42
+ * @param requestBody
43
+ * @returns any Ok
44
+ * @throws ApiError
45
+ */
46
+ static reportPackage(id: PackageId, requestBody: {
47
+ reportId: number;
48
+ }): CancelablePromise<HttpSuccess>;
49
+ /**
50
+ * @param requestBody
51
+ * @returns any Ok
52
+ * @throws ApiError
53
+ */
54
+ static checkBlackList(requestBody: CheckBlackListAttribute): CancelablePromise<ClientAttributes>;
55
+ }
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SdkPackagesControllerService = void 0;
4
+ const OpenAPI_1 = require("../core/OpenAPI");
5
+ const request_1 = require("../core/request");
6
+ class SdkPackagesControllerService {
7
+ /**
8
+ * @param id
9
+ * @returns any Ok
10
+ * @throws ApiError
11
+ */
12
+ static getPackageDetails(id) {
13
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
14
+ method: 'GET',
15
+ url: '/sdk/v2/packages/package-details/{id}',
16
+ path: {
17
+ 'id': id,
18
+ },
19
+ });
20
+ }
21
+ /**
22
+ * @param page
23
+ * @param pageSize
24
+ * @returns any Ok
25
+ * @throws ApiError
26
+ */
27
+ static getList(page = 1, pageSize = 10) {
28
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
29
+ method: 'GET',
30
+ url: '/sdk/v2/packages/list',
31
+ query: {
32
+ 'page': page,
33
+ 'page_size': pageSize,
34
+ },
35
+ });
36
+ }
37
+ /**
38
+ * @param requestBody
39
+ * @returns any Ok
40
+ * @throws ApiError
41
+ */
42
+ static createNewPackage(requestBody) {
43
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
44
+ method: 'POST',
45
+ url: '/sdk/v2/packages/create',
46
+ body: requestBody,
47
+ mediaType: 'application/json',
48
+ });
49
+ }
50
+ /**
51
+ * @param id
52
+ * @returns any Ok
53
+ * @throws ApiError
54
+ */
55
+ static sendDataToCEnter(id) {
56
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
57
+ method: 'GET',
58
+ url: '/sdk/v2/packages/sentDataToCenter/{id}',
59
+ path: {
60
+ 'id': id,
61
+ },
62
+ });
63
+ }
64
+ /**
65
+ * @param id
66
+ * @returns any Ok
67
+ * @throws ApiError
68
+ */
69
+ static canceled(id) {
70
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
71
+ method: 'PATCH',
72
+ url: '/sdk/v2/packages/cancel/{id}',
73
+ path: {
74
+ 'id': id,
75
+ },
76
+ });
77
+ }
78
+ /**
79
+ * @param id
80
+ * @param requestBody
81
+ * @returns any Ok
82
+ * @throws ApiError
83
+ */
84
+ static reportPackage(id, requestBody) {
85
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
86
+ method: 'POST',
87
+ url: '/sdk/v2/packages/report/{id}',
88
+ path: {
89
+ 'id': id,
90
+ },
91
+ body: requestBody,
92
+ mediaType: 'application/json',
93
+ });
94
+ }
95
+ /**
96
+ * @param requestBody
97
+ * @returns any Ok
98
+ * @throws ApiError
99
+ */
100
+ static checkBlackList(requestBody) {
101
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
102
+ method: 'POST',
103
+ url: '/sdk/v2/packages/check-black-list',
104
+ body: requestBody,
105
+ mediaType: 'application/json',
106
+ });
107
+ }
108
+ }
109
+ exports.SdkPackagesControllerService = SdkPackagesControllerService;
@@ -0,0 +1,17 @@
1
+ import type { citiesAttributes } from '../models/citiesAttributes';
2
+ import type { regionsAttributes } from '../models/regionsAttributes';
3
+ import type { CancelablePromise } from '../core/CancelablePromise';
4
+ export declare class SdkRegionsControllerService {
5
+ /**
6
+ * @param regionId
7
+ * @returns any Ok
8
+ * @throws ApiError
9
+ */
10
+ static getCities(regionId: number): CancelablePromise<Array<citiesAttributes>>;
11
+ /**
12
+ * @param countryId
13
+ * @returns any Ok
14
+ * @throws ApiError
15
+ */
16
+ static getRegions(countryId: number): CancelablePromise<Array<regionsAttributes>>;
17
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SdkRegionsControllerService = void 0;
4
+ const OpenAPI_1 = require("../core/OpenAPI");
5
+ const request_1 = require("../core/request");
6
+ class SdkRegionsControllerService {
7
+ /**
8
+ * @param regionId
9
+ * @returns any Ok
10
+ * @throws ApiError
11
+ */
12
+ static getCities(regionId) {
13
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
14
+ method: 'GET',
15
+ url: '/sdk/regions/cities/{regionId}',
16
+ path: {
17
+ 'regionId': regionId,
18
+ },
19
+ });
20
+ }
21
+ /**
22
+ * @param countryId
23
+ * @returns any Ok
24
+ * @throws ApiError
25
+ */
26
+ static getRegions(countryId) {
27
+ return (0, request_1.request)(OpenAPI_1.OpenAPI, {
28
+ method: 'GET',
29
+ url: '/sdk/regions/{countryId}',
30
+ path: {
31
+ 'countryId': countryId,
32
+ },
33
+ });
34
+ }
35
+ }
36
+ exports.SdkRegionsControllerService = SdkRegionsControllerService;
@@ -0,0 +1,10 @@
1
+ interface HttpError {
2
+ status: number;
3
+ message: string;
4
+ messageKey: string;
5
+ }
6
+ export declare function ApiCall<T>(service: () => Promise<T>): Promise<{
7
+ result?: T;
8
+ error?: HttpError;
9
+ }>;
10
+ export {};
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApiCall = ApiCall;
4
+ function traceError(error) {
5
+ const exceptionError = error;
6
+ return exceptionError.body;
7
+ }
8
+ async function exceptionHandler(error) {
9
+ const exceptionError = traceError(error);
10
+ if (exceptionError) {
11
+ console.log(exceptionError.message);
12
+ console.log(exceptionError.messageKey);
13
+ console.log(exceptionError.status);
14
+ throw new Error(exceptionError.message);
15
+ }
16
+ }
17
+ async function ApiCall(service) {
18
+ try {
19
+ const result = await service();
20
+ return { result };
21
+ }
22
+ catch (error) {
23
+ await exceptionHandler(error);
24
+ return { error: traceError(error) };
25
+ }
26
+ }
@@ -0,0 +1,36 @@
1
+ import { branchesAttributes } from "./api/models/branchesAttributes";
2
+ import { CalculateCostAttributes } from "./api/models/CalculateCostAttributes";
3
+ import { CheckBlackListAttribute } from "./api/models/CheckBlackListAttribute";
4
+ import { HttpSuccess } from "./api/models/HttpSuccess";
5
+ import { packagesAttributes } from "./api/models/packagesAttributes";
6
+ import { SdkPackagesCreationAttributes } from "./api/models/SdkPackagesCreationAttributes";
7
+ import { SdkInfoAttributes } from "./api/models/SdkInfoAttributes";
8
+ import { ShippingServiceData } from "./api/models/ShippingServiceData";
9
+ import { regionsAttributes } from "./api/models/regionsAttributes";
10
+ import { citiesAttributes } from "./api/models/citiesAttributes";
11
+ import { BranchLedgerAttributes } from "./api/models/BranchLedgerAttributes";
12
+ import { SdkLedgerOverview } from "./api/models/SdkLedgerOverview";
13
+ export declare class DLISystem {
14
+ constructor(baseUrl: string, tokenKey: string);
15
+ GetList(page?: number, pageSize?: number): Promise<packagesAttributes[]>;
16
+ getCompanyListOfCity(cityId: number): Promise<branchesAttributes[]>;
17
+ MyInfo(): Promise<SdkInfoAttributes>;
18
+ getTenantBranches(): Promise<branchesAttributes[]>;
19
+ GetPackageDetails(id: string): Promise<packagesAttributes>;
20
+ CheckBlackList(query: CheckBlackListAttribute): Promise<CheckBlackListAttribute>;
21
+ CancelOne(id: string): Promise<HttpSuccess>;
22
+ ReportOne(id: string, body: any): Promise<HttpSuccess>;
23
+ CreatePackage(payload: SdkPackagesCreationAttributes): Promise<packagesAttributes>;
24
+ CalculateCost(params: CalculateCostAttributes): Promise<ShippingServiceData>;
25
+ SendDataToCenter(id: string): Promise<HttpSuccess>;
26
+ GetRegionsList(countryId: number): Promise<regionsAttributes[]>;
27
+ GetCitiesListInByRegion(regionId: number): Promise<citiesAttributes[]>;
28
+ GetMyLedger(year?: number, month?: number): Promise<BranchLedgerAttributes[]>;
29
+ GetMyLedgerOverview(): Promise<SdkLedgerOverview>;
30
+ SetWebhook(payload: {
31
+ host: string;
32
+ webhookToken: string;
33
+ path: string;
34
+ }): Promise<HttpSuccess>;
35
+ }
36
+ export { DLISystem as QDSystem };
package/dist/index.js ADDED
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QDSystem = exports.DLISystem = void 0;
4
+ const api_handler_1 = require("./api-handler");
5
+ const OpenAPI_1 = require("./api/core/OpenAPI");
6
+ const SdkControllerService_1 = require("./api/services/SdkControllerService");
7
+ const SdkPackagesControllerService_1 = require("./api/services/SdkPackagesControllerService");
8
+ const SdkRegionsControllerService_1 = require("./api/services/SdkRegionsControllerService");
9
+ const SDK_api_ver = "v3";
10
+ class DLISystem {
11
+ constructor(baseUrl, tokenKey) {
12
+ OpenAPI_1.OpenAPI.TOKEN = tokenKey;
13
+ OpenAPI_1.OpenAPI.BASE = baseUrl;
14
+ OpenAPI_1.OpenAPI.HEADERS = { 'x-version': SDK_api_ver };
15
+ }
16
+ async GetList(page = 1, pageSize = 10) {
17
+ const { result, error } = await (0, api_handler_1.ApiCall)(() => SdkPackagesControllerService_1.SdkPackagesControllerService.getList(page, pageSize));
18
+ if (result) {
19
+ return result;
20
+ }
21
+ throw error;
22
+ }
23
+ async getCompanyListOfCity(cityId) {
24
+ const { result, error } = await (0, api_handler_1.ApiCall)(() => SdkControllerService_1.SdkControllerService.getListOfCity(cityId));
25
+ if (result) {
26
+ return result;
27
+ }
28
+ throw error;
29
+ }
30
+ async MyInfo() {
31
+ const { result, error } = await (0, api_handler_1.ApiCall)(() => SdkControllerService_1.SdkControllerService.getMyInfo());
32
+ if (result) {
33
+ return result;
34
+ }
35
+ throw error;
36
+ }
37
+ async getTenantBranches() {
38
+ const { result, error } = await (0, api_handler_1.ApiCall)(() => SdkControllerService_1.SdkControllerService.getTenantBranches());
39
+ if (result) {
40
+ return result;
41
+ }
42
+ throw error;
43
+ }
44
+ async GetPackageDetails(id) {
45
+ const { result, error } = await (0, api_handler_1.ApiCall)(() => SdkPackagesControllerService_1.SdkPackagesControllerService.getPackageDetails(id));
46
+ if (result) {
47
+ return result;
48
+ }
49
+ throw error;
50
+ }
51
+ async CheckBlackList(query) {
52
+ const { result, error } = await (0, api_handler_1.ApiCall)(() => SdkPackagesControllerService_1.SdkPackagesControllerService.checkBlackList(query));
53
+ if (result) {
54
+ return result;
55
+ }
56
+ throw error;
57
+ }
58
+ async CancelOne(id) {
59
+ const { result, error } = await (0, api_handler_1.ApiCall)(() => SdkPackagesControllerService_1.SdkPackagesControllerService.canceled(id));
60
+ if (result) {
61
+ return result;
62
+ }
63
+ throw error;
64
+ }
65
+ async ReportOne(id, body) {
66
+ const { result, error } = await (0, api_handler_1.ApiCall)(() => SdkPackagesControllerService_1.SdkPackagesControllerService.reportPackage(id, body));
67
+ if (result) {
68
+ return result;
69
+ }
70
+ throw error;
71
+ }
72
+ async CreatePackage(payload) {
73
+ const { result, error } = await (0, api_handler_1.ApiCall)(() => SdkPackagesControllerService_1.SdkPackagesControllerService.createNewPackage(payload));
74
+ if (result) {
75
+ return result;
76
+ }
77
+ throw error;
78
+ }
79
+ async CalculateCost(params) {
80
+ const { result, error } = await (0, api_handler_1.ApiCall)(() => SdkControllerService_1.SdkControllerService.calculateCost(params));
81
+ if (result) {
82
+ return result;
83
+ }
84
+ throw error;
85
+ }
86
+ async SendDataToCenter(id) {
87
+ const { result, error } = await (0, api_handler_1.ApiCall)(() => SdkPackagesControllerService_1.SdkPackagesControllerService.sendDataToCEnter(id));
88
+ if (result) {
89
+ return result;
90
+ }
91
+ throw error;
92
+ }
93
+ async GetRegionsList(countryId) {
94
+ const { result, error } = await (0, api_handler_1.ApiCall)(() => SdkRegionsControllerService_1.SdkRegionsControllerService.getRegions(countryId));
95
+ if (result) {
96
+ return result;
97
+ }
98
+ throw error;
99
+ }
100
+ async GetCitiesListInByRegion(regionId) {
101
+ const { result, error } = await (0, api_handler_1.ApiCall)(() => SdkRegionsControllerService_1.SdkRegionsControllerService.getCities(regionId));
102
+ if (result) {
103
+ return result;
104
+ }
105
+ throw error;
106
+ }
107
+ async GetMyLedger(year, month) {
108
+ const { result, error } = await (0, api_handler_1.ApiCall)(() => SdkControllerService_1.SdkControllerService.getLedgerList(year, month));
109
+ if (result) {
110
+ return result;
111
+ }
112
+ throw error;
113
+ }
114
+ async GetMyLedgerOverview() {
115
+ const { result, error } = await (0, api_handler_1.ApiCall)(() => SdkControllerService_1.SdkControllerService.getLedgerOverView());
116
+ if (result) {
117
+ return result;
118
+ }
119
+ throw error;
120
+ }
121
+ async SetWebhook(payload) {
122
+ const { result, error } = await (0, api_handler_1.ApiCall)(() => SdkControllerService_1.SdkControllerService.setWebhook(payload));
123
+ if (result) {
124
+ return result;
125
+ }
126
+ throw error;
127
+ }
128
+ }
129
+ exports.DLISystem = DLISystem;
130
+ exports.QDSystem = DLISystem;
@@ -0,0 +1 @@
1
+ export {};