@orchesty/connector-base 1.0.0 → 1.0.1

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 (126) hide show
  1. package/dist/package.json +4 -1
  2. package/package.json +4 -1
  3. package/CHANGELOG.md +0 -7
  4. package/coverage/clover.xml +0 -328
  5. package/coverage/coverage-final.json +0 -21
  6. package/coverage/lcov-report/base.css +0 -224
  7. package/coverage/lcov-report/block-navigation.js +0 -87
  8. package/coverage/lcov-report/favicon.png +0 -0
  9. package/coverage/lcov-report/index.html +0 -161
  10. package/coverage/lcov-report/prettify.css +0 -1
  11. package/coverage/lcov-report/prettify.js +0 -2
  12. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  13. package/coverage/lcov-report/sorter.js +0 -210
  14. package/coverage/lcov-report/src/BaseApplication.ts.html +0 -286
  15. package/coverage/lcov-report/src/Batch/ABaseBatch.ts.html +0 -337
  16. package/coverage/lcov-report/src/Batch/InventoryProductsData.ts.html +0 -385
  17. package/coverage/lcov-report/src/Batch/InventoryProductsList.ts.html +0 -388
  18. package/coverage/lcov-report/src/Batch/JournalList.ts.html +0 -319
  19. package/coverage/lcov-report/src/Batch/OrderExtraFields.ts.html +0 -220
  20. package/coverage/lcov-report/src/Batch/index.html +0 -176
  21. package/coverage/lcov-report/src/Connector/ABaseConnector.ts.html +0 -250
  22. package/coverage/lcov-report/src/Connector/CourierFields.ts.html +0 -244
  23. package/coverage/lcov-report/src/Connector/CouriersList.ts.html +0 -151
  24. package/coverage/lcov-report/src/Connector/CreatePackage.ts.html +0 -268
  25. package/coverage/lcov-report/src/Connector/CreatePackageManual.ts.html +0 -223
  26. package/coverage/lcov-report/src/Connector/GetLabel.ts.html +0 -205
  27. package/coverage/lcov-report/src/Connector/Inventories.ts.html +0 -187
  28. package/coverage/lcov-report/src/Connector/InventoryWarehouses.ts.html +0 -172
  29. package/coverage/lcov-report/src/Connector/OrderPaymentsHistory.ts.html +0 -229
  30. package/coverage/lcov-report/src/Connector/OrderStatusList.ts.html +0 -163
  31. package/coverage/lcov-report/src/Connector/Orders.ts.html +0 -529
  32. package/coverage/lcov-report/src/Connector/SetOrderStatus.ts.html +0 -178
  33. package/coverage/lcov-report/src/Connector/UpdateInventoryProductsStock.ts.html +0 -193
  34. package/coverage/lcov-report/src/Connector/index.html +0 -296
  35. package/coverage/lcov-report/src/index.html +0 -116
  36. package/coverage/lcov-report/test/dataProvider.ts.html +0 -232
  37. package/coverage/lcov-report/test/index.html +0 -116
  38. package/coverage/lcov.info +0 -620
  39. package/jest.config.js +0 -13
  40. package/src/BaseApplication.ts +0 -67
  41. package/src/Batch/ABaseBatch.ts +0 -84
  42. package/src/Batch/InventoryProductsData.ts +0 -100
  43. package/src/Batch/InventoryProductsList.ts +0 -101
  44. package/src/Batch/JournalList.ts +0 -78
  45. package/src/Batch/OrderExtraFields.ts +0 -45
  46. package/src/Batch/__tests__/Data/InventoryProductsData/input.json +0 -6
  47. package/src/Batch/__tests__/Data/InventoryProductsData/mock.json +0 -82
  48. package/src/Batch/__tests__/Data/InventoryProductsData/output.json +0 -11
  49. package/src/Batch/__tests__/Data/InventoryProductsList/input.json +0 -8
  50. package/src/Batch/__tests__/Data/InventoryProductsList/mock.json +0 -37
  51. package/src/Batch/__tests__/Data/InventoryProductsList/output.json +0 -15
  52. package/src/Batch/__tests__/Data/JournalList/input.json +0 -9
  53. package/src/Batch/__tests__/Data/JournalList/mock.json +0 -23
  54. package/src/Batch/__tests__/Data/JournalList/output.json +0 -15
  55. package/src/Batch/__tests__/Data/OrderExtraFields/input.json +0 -6
  56. package/src/Batch/__tests__/Data/OrderExtraFields/mock.json +0 -23
  57. package/src/Batch/__tests__/Data/OrderExtraFields/output.json +0 -15
  58. package/src/Batch/__tests__/InventoryProductsData.ts +0 -17
  59. package/src/Batch/__tests__/InventoryProductsList.ts +0 -17
  60. package/src/Batch/__tests__/JournalList.ts +0 -17
  61. package/src/Batch/__tests__/OrderExtraFields.ts +0 -17
  62. package/src/Connector/ABaseConnector.ts +0 -55
  63. package/src/Connector/CourierFields.ts +0 -53
  64. package/src/Connector/CouriersList.ts +0 -22
  65. package/src/Connector/CreatePackage.ts +0 -61
  66. package/src/Connector/CreatePackageManual.ts +0 -46
  67. package/src/Connector/GetLabel.ts +0 -40
  68. package/src/Connector/Inventories.ts +0 -34
  69. package/src/Connector/InventoryWarehouses.ts +0 -29
  70. package/src/Connector/OrderPaymentsHistory.ts +0 -48
  71. package/src/Connector/OrderStatusList.ts +0 -26
  72. package/src/Connector/Orders.ts +0 -148
  73. package/src/Connector/SetOrderStatus.ts +0 -31
  74. package/src/Connector/UpdateInventoryProductsStock.ts +0 -36
  75. package/src/Connector/__tests__/CourierFields.ts +0 -17
  76. package/src/Connector/__tests__/CouriersList.ts +0 -17
  77. package/src/Connector/__tests__/CreatePackage.ts +0 -17
  78. package/src/Connector/__tests__/CreatePackageManual.ts +0 -17
  79. package/src/Connector/__tests__/Data/CourierFields/input.json +0 -8
  80. package/src/Connector/__tests__/Data/CourierFields/mock.json +0 -106
  81. package/src/Connector/__tests__/Data/CourierFields/output.json +0 -106
  82. package/src/Connector/__tests__/Data/CouriersList/input.json +0 -6
  83. package/src/Connector/__tests__/Data/CouriersList/mock.json +0 -57
  84. package/src/Connector/__tests__/Data/CouriersList/output.json +0 -57
  85. package/src/Connector/__tests__/Data/CreatePackage/input.json +0 -37
  86. package/src/Connector/__tests__/Data/CreatePackage/mock.json +0 -10
  87. package/src/Connector/__tests__/Data/CreatePackage/output.json +0 -10
  88. package/src/Connector/__tests__/Data/CreatePackageManual/input.json +0 -12
  89. package/src/Connector/__tests__/Data/CreatePackageManual/mock.json +0 -9
  90. package/src/Connector/__tests__/Data/CreatePackageManual/output.json +0 -9
  91. package/src/Connector/__tests__/Data/GetLabel/input.json +0 -9
  92. package/src/Connector/__tests__/Data/GetLabel/mock.json +0 -9
  93. package/src/Connector/__tests__/Data/GetLabel/output.json +0 -9
  94. package/src/Connector/__tests__/Data/Inventories/input.json +0 -6
  95. package/src/Connector/__tests__/Data/Inventories/mock.json +0 -51
  96. package/src/Connector/__tests__/Data/Inventories/output.json +0 -51
  97. package/src/Connector/__tests__/Data/InventoryWarehouses/input.json +0 -6
  98. package/src/Connector/__tests__/Data/InventoryWarehouses/mock.json +0 -25
  99. package/src/Connector/__tests__/Data/InventoryWarehouses/output.json +0 -25
  100. package/src/Connector/__tests__/Data/OrderPaymentsHistory/input.json +0 -8
  101. package/src/Connector/__tests__/Data/OrderPaymentsHistory/mock.json +0 -18
  102. package/src/Connector/__tests__/Data/OrderPaymentsHistory/output.json +0 -18
  103. package/src/Connector/__tests__/Data/OrderStatusList/input.json +0 -6
  104. package/src/Connector/__tests__/Data/OrderStatusList/mock.json +0 -54
  105. package/src/Connector/__tests__/Data/OrderStatusList/output.json +0 -54
  106. package/src/Connector/__tests__/Data/Orders/input.json +0 -8
  107. package/src/Connector/__tests__/Data/Orders/mock.json +0 -89
  108. package/src/Connector/__tests__/Data/Orders/output.json +0 -89
  109. package/src/Connector/__tests__/Data/SetOrderStatus/input.json +0 -9
  110. package/src/Connector/__tests__/Data/SetOrderStatus/mock.json +0 -7
  111. package/src/Connector/__tests__/Data/SetOrderStatus/output.json +0 -6
  112. package/src/Connector/__tests__/Data/UpdateInventoryProductsStock/input.json +0 -18
  113. package/src/Connector/__tests__/Data/UpdateInventoryProductsStock/mock.json +0 -9
  114. package/src/Connector/__tests__/Data/UpdateInventoryProductsStock/output.json +0 -9
  115. package/src/Connector/__tests__/GetLabel.ts +0 -17
  116. package/src/Connector/__tests__/Inventories.ts +0 -17
  117. package/src/Connector/__tests__/InventoryWarehouses.ts +0 -17
  118. package/src/Connector/__tests__/OrderPaymentsHistory.ts +0 -17
  119. package/src/Connector/__tests__/OrderStatusList.ts +0 -17
  120. package/src/Connector/__tests__/Orders.ts +0 -17
  121. package/src/Connector/__tests__/SetOrderStatus.ts +0 -17
  122. package/src/Connector/__tests__/UpdateInventoryProductsStock.ts +0 -17
  123. package/test/dataProvider.ts +0 -49
  124. package/tsconfig.json +0 -8
  125. package/tsconfig.prod.json +0 -13
  126. package/tsconfig.prod.tsbuildinfo +0 -1
@@ -1,37 +0,0 @@
1
- {
2
- "http": "POST https://api.baselinker.com/connector.php",
3
- "code": 200,
4
- "body": {
5
- "status": "SUCCESS",
6
- "products": {
7
- "2685": {
8
- "id": 2685,
9
- "ean": "63576363463",
10
- "sku": "PL53F",
11
- "name": "Nike PL35 shoes",
12
- "prices": {
13
- "105": 20.99,
14
- "106": 23.99
15
- },
16
- "stock": {
17
- "bl_206": 5,
18
- "bl_207": 7
19
- }
20
- },
21
- "2686": {
22
- "id": 2686,
23
- "ean": "6345623525",
24
- "sku": "ZF55F",
25
- "name": "Adidas ZF3 shoes",
26
- "prices": {
27
- "105": 21.99,
28
- "106": 24.99
29
- },
30
- "stock": {
31
- "bl_206": 8,
32
- "bl_207": 9
33
- }
34
- }
35
- }
36
- }
37
- }
@@ -1,15 +0,0 @@
1
- {
2
- "headers": {
3
- "user": "TestUser"
4
- },
5
- "data": [
6
- {
7
- "body": "{\"id\":2685,\"ean\":\"63576363463\",\"sku\":\"PL53F\",\"name\":\"Nike PL35 shoes\",\"prices\":{\"105\":20.99,\"106\":23.99},\"stock\":{\"bl_206\":5,\"bl_207\":7}}",
8
- "headers": {}
9
- },
10
- {
11
- "body": "{\"id\":2686,\"ean\":\"6345623525\",\"sku\":\"ZF55F\",\"name\":\"Adidas ZF3 shoes\",\"prices\":{\"105\":21.99,\"106\":24.99},\"stock\":{\"bl_206\":8,\"bl_207\":9}}",
12
- "headers": {}
13
- }
14
- ]
15
- }
@@ -1,9 +0,0 @@
1
- {
2
- "headers": {
3
- "user": "TestUser"
4
- },
5
- "data": {
6
- "lastLogId": 307,
7
- "logsTypes": [1]
8
- }
9
- }
@@ -1,23 +0,0 @@
1
- {
2
- "http": "POST https://api.baselinker.com/connector.php",
3
- "code": 200,
4
- "body": {
5
- "status": "SUCCESS",
6
- "logs": [
7
- {
8
- "log_id": 456269,
9
- "log_type": 13,
10
- "order_id": 6911942,
11
- "object_id": 0,
12
- "date": 1516369287
13
- },
14
- {
15
- "log_id": 456278,
16
- "log_type": 7,
17
- "order_id": 8911945,
18
- "object_id": 5107899,
19
- "date": 1516369390
20
- }
21
- ]
22
- }
23
- }
@@ -1,15 +0,0 @@
1
- {
2
- "headers": {
3
- "user": "TestUser"
4
- },
5
- "data": [
6
- {
7
- "body": "{\"log_id\":456269,\"log_type\":13,\"order_id\":6911942,\"object_id\":0,\"date\":1516369287}",
8
- "headers": {}
9
- },
10
- {
11
- "body": "{\"log_id\":456278,\"log_type\":7,\"order_id\":8911945,\"object_id\":5107899,\"date\":1516369390}",
12
- "headers": {}
13
- }
14
- ]
15
- }
@@ -1,6 +0,0 @@
1
- {
2
- "headers": {
3
- "user": "TestUser"
4
- },
5
- "data": {}
6
- }
@@ -1,23 +0,0 @@
1
- {
2
- "http": "POST https://api.baselinker.com/connector.php",
3
- "code": 200,
4
- "body": {
5
- "status": "SUCCESS",
6
- "extra_fields": [
7
- {
8
- "extra_field_id": 1,
9
- "name": "Text",
10
- "editor_type": "text"
11
- },
12
- {
13
- "extra_field_id": 2,
14
- "name": "Checkbox",
15
- "editor_type": "checkbox",
16
- "options": [
17
- "0",
18
- "1"
19
- ]
20
- }
21
- ]
22
- }
23
- }
@@ -1,15 +0,0 @@
1
- {
2
- "headers": {
3
- "user": "TestUser"
4
- },
5
- "data": [
6
- {
7
- "body": "{\"extra_field_id\":1,\"name\":\"Text\",\"editor_type\":\"text\"}",
8
- "headers": {}
9
- },
10
- {
11
- "body": "{\"extra_field_id\":2,\"name\":\"Checkbox\",\"editor_type\":\"checkbox\",\"options\":[\"0\",\"1\"]}",
12
- "headers": {}
13
- }
14
- ]
15
- }
@@ -1,17 +0,0 @@
1
- import { container } from '@orchesty/nodejs-connectors/test/TestAbstract';
2
- import NodeTester from '@orchesty/nodejs-sdk/dist/test/Testers/NodeTester';
3
- import init from '../../../test/dataProvider';
4
- import { NAME as INVENTORY_PRODUCTS_DATA } from '../InventoryProductsData';
5
-
6
- let tester: NodeTester;
7
-
8
- describe('Tests for InventoryProductsData', () => {
9
- beforeAll(() => {
10
- tester = new NodeTester(container, __filename);
11
- init();
12
- });
13
-
14
- it('process - ok', async () => {
15
- await tester.testBatch(INVENTORY_PRODUCTS_DATA);
16
- });
17
- });
@@ -1,17 +0,0 @@
1
- import { container } from '@orchesty/nodejs-connectors/test/TestAbstract';
2
- import NodeTester from '@orchesty/nodejs-sdk/dist/test/Testers/NodeTester';
3
- import init from '../../../test/dataProvider';
4
- import { NAME as INVENTORY_PRODUCTS_LIST } from '../InventoryProductsList';
5
-
6
- let tester: NodeTester;
7
-
8
- describe('Tests for InventoryProductsList', () => {
9
- beforeAll(() => {
10
- tester = new NodeTester(container, __filename);
11
- init();
12
- });
13
-
14
- it('process - ok', async () => {
15
- await tester.testBatch(INVENTORY_PRODUCTS_LIST);
16
- });
17
- });
@@ -1,17 +0,0 @@
1
- import { container } from '@orchesty/nodejs-connectors/test/TestAbstract';
2
- import NodeTester from '@orchesty/nodejs-sdk/dist/test/Testers/NodeTester';
3
- import init from '../../../test/dataProvider';
4
- import { NAME as JOURNAL_LIST } from '../JournalList';
5
-
6
- let tester: NodeTester;
7
-
8
- describe('Tests for JournalList', () => {
9
- beforeAll(() => {
10
- tester = new NodeTester(container, __filename);
11
- init();
12
- });
13
-
14
- it('process - ok', async () => {
15
- await tester.testBatch(JOURNAL_LIST);
16
- });
17
- });
@@ -1,17 +0,0 @@
1
- import { container } from '@orchesty/nodejs-connectors/test/TestAbstract';
2
- import NodeTester from '@orchesty/nodejs-sdk/dist/test/Testers/NodeTester';
3
- import init from '../../../test/dataProvider';
4
- import { NAME as ORDER_EXTRA_FIELDS } from '../OrderExtraFields';
5
-
6
- let tester: NodeTester;
7
-
8
- describe('Tests for OrderExtraFields', () => {
9
- beforeAll(() => {
10
- tester = new NodeTester(container, __filename);
11
- init();
12
- });
13
-
14
- it('process - ok', async () => {
15
- await tester.testBatch(ORDER_EXTRA_FIELDS);
16
- });
17
- });
@@ -1,55 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import FormData from 'form-data';
5
-
6
- export const SUCCESS = 'SUCCESS';
7
-
8
- export default abstract class ABaseConnector<T, K> extends AConnector {
9
-
10
- public constructor(private readonly useInForm = false) {
11
- super();
12
- }
13
-
14
- protected abstract getMethod(): string;
15
-
16
- public async processAction(dto: ProcessDto<T>): Promise<ProcessDto<K>> {
17
- const req = await this.getApplication().getRequestDto(
18
- dto,
19
- await this.getApplicationInstallFromProcess(dto, this.useInForm ? null : true),
20
- HttpMethods.POST,
21
- undefined,
22
- this.prepareBody(this.getMethod(), await this.getParameters(dto)),
23
- );
24
- const resp = await this.getSender().send<IResponse>(req, [200]);
25
- const { status, ...jsonBody } = resp.getJsonBody();
26
- if (status !== SUCCESS) {
27
- throw new Error(`Request failed. Reason: ${resp.getBody()}`);
28
- }
29
-
30
- return this.processOutputData(dto, jsonBody);
31
- }
32
-
33
- // eslint-disable-next-line @typescript-eslint/require-await
34
- protected async getParameters(_dto: ProcessDto<T>): Promise<object> {
35
- return [];
36
- }
37
-
38
- protected prepareBody(method: string, parameters: object): FormData {
39
- const body = new FormData();
40
- body.append('method', method);
41
- body.append('parameters', JSON.stringify(parameters));
42
-
43
- return body;
44
- }
45
-
46
- // eslint-disable-next-line @typescript-eslint/require-await
47
- protected async processOutputData(dto: ProcessDto<T>, jsonBody: object): Promise<ProcessDto<K>> {
48
- return dto.setNewJsonData(jsonBody as K);
49
- }
50
-
51
- }
52
-
53
- export interface IResponse {
54
- status: string;
55
- }
@@ -1,53 +0,0 @@
1
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
2
- import ABaseConnector from './ABaseConnector';
3
-
4
- export const NAME = 'courier-fields';
5
-
6
- export default class CourierFields extends ABaseConnector<IInput, IOutput> {
7
-
8
- public getName(): string {
9
- return NAME;
10
- }
11
-
12
- protected getMethod(): string {
13
- return 'getCourierFields';
14
- }
15
-
16
- // eslint-disable-next-line @typescript-eslint/require-await
17
- protected async getParameters(dto: ProcessDto<IInput>): Promise<object> {
18
- const { courierCode } = dto.getJsonData();
19
-
20
- return {
21
- // eslint-disable-next-line @typescript-eslint/naming-convention
22
- courier_code: courierCode,
23
- };
24
- }
25
-
26
- }
27
-
28
- export interface IInput {
29
- courierCode: string
30
- }
31
-
32
- /* eslint-disable @typescript-eslint/naming-convention */
33
- export interface IOutput {
34
- multi_packages: false,
35
- fields: {
36
- id: string;
37
- name: string;
38
- type: string;
39
- desc?: string;
40
- value?: string|number;
41
- options?: Record<number, string>;
42
- show_field?: unknown;
43
- }[],
44
- package_fields:
45
- {
46
- id: string;
47
- name: string;
48
- type: string;
49
- options?: Record<number, string>;
50
- default?: number;
51
- }[]
52
- }
53
- /* eslint-enable @typescript-eslint/naming-convention */
@@ -1,22 +0,0 @@
1
- import ABaseConnector from './ABaseConnector';
2
-
3
- export const NAME = 'couriers-list';
4
-
5
- export default class CouriersList extends ABaseConnector<unknown, IOutput> {
6
-
7
- public getName(): string {
8
- return NAME;
9
- }
10
-
11
- protected getMethod(): string {
12
- return 'getCouriersList';
13
- }
14
-
15
- }
16
-
17
- export interface IOutput {
18
- couriers: {
19
- code: string;
20
- name: string;
21
- }[];
22
- }
@@ -1,61 +0,0 @@
1
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
2
- import ABaseConnector from './ABaseConnector';
3
-
4
- export const NAME = 'create-package';
5
-
6
- export default class CreatePackage extends ABaseConnector<IInput, IOutput> {
7
-
8
- public getName(): string {
9
- return NAME;
10
- }
11
-
12
- protected getMethod(): string {
13
- return 'createPackage';
14
- }
15
-
16
- // eslint-disable-next-line @typescript-eslint/require-await
17
- protected async getParameters(dto: ProcessDto<IInput>): Promise<object> {
18
- const { orderId, courierCode, accountId, fields, packages } = dto.getJsonData();
19
-
20
- /* eslint-disable @typescript-eslint/naming-convention */
21
- return {
22
- order_id: orderId,
23
- courier_code: courierCode,
24
- account_id: accountId,
25
- fields,
26
- packages: packages.map((item) => ({
27
- size_length: item.length,
28
- size_height: item.height,
29
- size_width: item.width,
30
- weight: item.weight,
31
- })),
32
- };
33
- /* eslint-enable @typescript-eslint/naming-convention */
34
- }
35
-
36
- }
37
-
38
- export interface IInput {
39
- orderId: number;
40
- courierCode: string;
41
- fields: {
42
- id: string;
43
- value: string;
44
- }[],
45
- packages:
46
- {
47
- length:number;
48
- height:number;
49
- width:number;
50
- weight:number;
51
- }[]
52
- accountId?: number;
53
- }
54
-
55
- /* eslint-disable @typescript-eslint/naming-convention */
56
- export interface IOutput {
57
- package_id: number;
58
- package_number: string;
59
- courier_inner_number: string;
60
- }
61
- /* eslint-enable @typescript-eslint/naming-convention */
@@ -1,46 +0,0 @@
1
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
2
- import ABaseConnector from './ABaseConnector';
3
-
4
- export const NAME = 'create-package-manual';
5
-
6
- export default class CreatePackageManual extends ABaseConnector<IInput, IOutput> {
7
-
8
- public getName(): string {
9
- return NAME;
10
- }
11
-
12
- protected getMethod(): string {
13
- return 'createPackageManual';
14
- }
15
-
16
- // eslint-disable-next-line @typescript-eslint/require-await
17
- protected async getParameters(dto: ProcessDto<IInput>): Promise<object> {
18
- const { orderId, courierCode, packageNumber, pickupDate, returnShipment } = dto.getJsonData();
19
-
20
- /* eslint-disable @typescript-eslint/naming-convention */
21
- return {
22
- order_id: orderId,
23
- courier_code: courierCode,
24
- package_number: packageNumber,
25
- pickup_date: pickupDate,
26
- return_shipment: returnShipment,
27
- };
28
- /* eslint-enable @typescript-eslint/naming-convention */
29
- }
30
-
31
- }
32
-
33
- export interface IInput {
34
- orderId: number;
35
- courierCode: string;
36
- packageNumber: string;
37
- pickupDate: string;
38
- returnShipment: boolean;
39
- }
40
-
41
- /* eslint-disable @typescript-eslint/naming-convention */
42
- export interface IOutput {
43
- package_id: number;
44
- package_number: string;
45
- }
46
- /* eslint-enable @typescript-eslint/naming-convention */
@@ -1,40 +0,0 @@
1
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
2
- import ABaseConnector from './ABaseConnector';
3
-
4
- export const NAME = 'get-label';
5
-
6
- export default class GetLabel extends ABaseConnector<IInput, IOutput> {
7
-
8
- public getName(): string {
9
- return NAME;
10
- }
11
-
12
- protected getMethod(): string {
13
- return 'getLabel';
14
- }
15
-
16
- // eslint-disable-next-line @typescript-eslint/require-await
17
- protected async getParameters(dto: ProcessDto<IInput>): Promise<object> {
18
- const { courierCode, packageId, packageNumber } = dto.getJsonData();
19
-
20
- /* eslint-disable @typescript-eslint/naming-convention */
21
- return {
22
- courier_code: courierCode,
23
- package_id: packageId,
24
- package_number: packageNumber,
25
- };
26
- /* eslint-enable @typescript-eslint/naming-convention */
27
- }
28
-
29
- }
30
-
31
- export interface IInput {
32
- courierCode: string;
33
- packageId: number;
34
- packageNumber?: string;
35
- }
36
-
37
- export interface IOutput {
38
- extension: string;
39
- label: string;
40
- }
@@ -1,34 +0,0 @@
1
- import ABaseConnector from './ABaseConnector';
2
-
3
- export const NAME = 'inventories';
4
-
5
- export default class Inventories extends ABaseConnector<unknown, IOutput> {
6
-
7
- public getName(): string {
8
- return NAME;
9
- }
10
-
11
- protected getMethod(): string {
12
- return 'getInventories';
13
- }
14
-
15
- }
16
-
17
- /* eslint-disable @typescript-eslint/naming-convention */
18
- export interface IOutput {
19
- inventories:
20
- {
21
- inventory_id: number;
22
- name: string;
23
- description: string;
24
- languages: string[];
25
- default_language: string;
26
- price_groups: number[];
27
- default_price_group: number;
28
- warehouses: string[];
29
- default_warehouse: string;
30
- reservations: boolean;
31
- is_default: boolean;
32
- }[]
33
- }
34
- /* eslint-enable @typescript-eslint/naming-convention */
@@ -1,29 +0,0 @@
1
- import ABaseConnector from './ABaseConnector';
2
-
3
- export const NAME = 'inventory-warehouses';
4
-
5
- export default class InventoryWarehouses extends ABaseConnector<unknown, IOutput> {
6
-
7
- public getName(): string {
8
- return NAME;
9
- }
10
-
11
- protected getMethod(): string {
12
- return 'getInventoryWarehouses';
13
- }
14
-
15
- }
16
-
17
- /* eslint-disable @typescript-eslint/naming-convention */
18
- export interface IOutput {
19
- warehouses:
20
- {
21
- warehouse_type: string;
22
- warehouse_id: number;
23
- name: string;
24
- description: string;
25
- stock_edition: boolean;
26
- is_default: boolean;
27
- }[]
28
- }
29
- /* eslint-enable @typescript-eslint/naming-convention */
@@ -1,48 +0,0 @@
1
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
2
- import ABaseConnector from './ABaseConnector';
3
-
4
- export const NAME = 'order-payments-history';
5
-
6
- export default class OrderPaymentsHistory extends ABaseConnector<IInput, IOutput> {
7
-
8
- public getName(): string {
9
- return NAME;
10
- }
11
-
12
- protected getMethod(): string {
13
- return 'getOrderPaymentsHistory';
14
- }
15
-
16
- // eslint-disable-next-line @typescript-eslint/require-await
17
- protected async getParameters(dto: ProcessDto<IInput>): Promise<object> {
18
- const { orderId, showFullHistory } = dto.getJsonData();
19
-
20
- /* eslint-disable @typescript-eslint/naming-convention */
21
- return {
22
- order_id: orderId,
23
- show_full_history: showFullHistory,
24
- };
25
- /* eslint-enable @typescript-eslint/naming-convention */
26
- }
27
-
28
- }
29
-
30
- export interface IInput {
31
- orderId: number;
32
- showFullHistory: boolean;
33
- }
34
-
35
- /* eslint-disable @typescript-eslint/naming-convention */
36
- export interface IOutput {
37
- payments:
38
- {
39
- paid_before: string;
40
- paid_after: string;
41
- total_price: string;
42
- date: string;
43
- currency: string;
44
- external_payment_id: string;
45
- comment: string;
46
- }[]
47
- }
48
- /* eslint-enable @typescript-eslint/naming-convention */
@@ -1,26 +0,0 @@
1
- import ABaseConnector from './ABaseConnector';
2
-
3
- export const NAME = 'order-status-list';
4
-
5
- export default class OrderStatusList extends ABaseConnector<unknown, IOutput> {
6
-
7
- public getName(): string {
8
- return NAME;
9
- }
10
-
11
- protected getMethod(): string {
12
- return 'getOrderStatusList';
13
- }
14
-
15
- }
16
-
17
- /* eslint-disable @typescript-eslint/naming-convention */
18
- export interface IOutput {
19
- statuses:
20
- {
21
- id: number;
22
- name: string;
23
- name_for_customer: string;
24
- }[]
25
- }
26
- /* eslint-enable @typescript-eslint/naming-convention */