@orchesty/connector-expedico 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.
- package/CHANGELOG.md +7 -0
- package/LICENSE +190 -0
- package/coverage/clover.xml +107 -0
- package/coverage/coverage-final.json +6 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +161 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov-report/src/Batch/ExpedicoGetTrackingInfo.ts.html +280 -0
- package/coverage/lcov-report/src/Batch/index.html +116 -0
- package/coverage/lcov-report/src/Connector/ExpedicoCreateParcel.ts.html +349 -0
- package/coverage/lcov-report/src/Connector/ExpedicoGetCarriers.ts.html +235 -0
- package/coverage/lcov-report/src/Connector/index.html +131 -0
- package/coverage/lcov-report/src/ExpedicoApplication.ts.html +316 -0
- package/coverage/lcov-report/src/index.html +116 -0
- package/coverage/lcov-report/test/dataProvider.ts.html +196 -0
- package/coverage/lcov-report/test/index.html +116 -0
- package/coverage/lcov.info +156 -0
- package/dist/Batch/ExpedicoGetTrackingInfo.d.ts +30 -0
- package/dist/Batch/ExpedicoGetTrackingInfo.js +28 -0
- package/dist/Connector/ExpedicoCreateParcel.d.ts +43 -0
- package/dist/Connector/ExpedicoCreateParcel.js +32 -0
- package/dist/Connector/ExpedicoGetCarriers.d.ts +30 -0
- package/dist/Connector/ExpedicoGetCarriers.js +20 -0
- package/dist/ExpedicoApplication.d.ts +17 -0
- package/dist/ExpedicoApplication.js +89 -0
- package/dist/package.json +22 -0
- package/jest.config.js +13 -0
- package/package.json +22 -0
- package/src/Batch/ExpedicoGetTrackingInfo.ts +65 -0
- package/src/Batch/__tests__/Data/ExpedicoGetTrackingInfo/input.json +11 -0
- package/src/Batch/__tests__/Data/ExpedicoGetTrackingInfo/mock.json +52 -0
- package/src/Batch/__tests__/Data/ExpedicoGetTrackingInfo/output.json +15 -0
- package/src/Batch/__tests__/ExpedicoGetTrackingInfo.ts +17 -0
- package/src/Connector/ExpedicoCreateParcel.ts +88 -0
- package/src/Connector/ExpedicoGetCarriers.ts +50 -0
- package/src/Connector/__tests__/Data/ExpedicoCreateParcel/input.json +35 -0
- package/src/Connector/__tests__/Data/ExpedicoCreateParcel/mock.json +10 -0
- package/src/Connector/__tests__/Data/ExpedicoCreateParcel/output.json +10 -0
- package/src/Connector/__tests__/Data/ExpedicoGetCarriers/input.json +6 -0
- package/src/Connector/__tests__/Data/ExpedicoGetCarriers/mock.json +65 -0
- package/src/Connector/__tests__/Data/ExpedicoGetCarriers/output.json +66 -0
- package/src/Connector/__tests__/ExpedicoCreateParcel.ts +17 -0
- package/src/Connector/__tests__/ExpedicoGetCarriers.ts +17 -0
- package/src/ExpedicoApplication.ts +77 -0
- package/test/dataProvider.ts +37 -0
- package/tsconfig.json +8 -0
- package/tsconfig.prod.json +13 -0
- package/tsconfig.prod.tsbuildinfo +1 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.NAME = void 0;
|
|
40
|
+
const CoreFormsEnum_1 = __importStar(require("@orchesty/nodejs-sdk/dist/lib/Application/Base/CoreFormsEnum"));
|
|
41
|
+
const Field_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Application/Model/Form/Field"));
|
|
42
|
+
const FieldType_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Application/Model/Form/FieldType"));
|
|
43
|
+
const Form_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Application/Model/Form/Form"));
|
|
44
|
+
const FormStack_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Application/Model/Form/FormStack"));
|
|
45
|
+
const ABasicApplication_1 = require("@orchesty/nodejs-sdk/dist/lib/Authorization/Type/Basic/ABasicApplication");
|
|
46
|
+
const RequestDto_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Transport/Curl/RequestDto"));
|
|
47
|
+
const Base64_1 = require("@orchesty/nodejs-sdk/dist/lib/Utils/Base64");
|
|
48
|
+
const Headers_1 = require("@orchesty/nodejs-sdk/dist/lib/Utils/Headers");
|
|
49
|
+
exports.NAME = 'expedico';
|
|
50
|
+
class ExpedicoApplication extends ABasicApplication_1.ABasicApplication {
|
|
51
|
+
baseUrl;
|
|
52
|
+
constructor(isDev = false) {
|
|
53
|
+
super();
|
|
54
|
+
this.baseUrl = isDev ? 'https://dev.expedico.eu/api/v2/' : 'https://expedico.eu/api/v2/';
|
|
55
|
+
}
|
|
56
|
+
getName() {
|
|
57
|
+
return exports.NAME;
|
|
58
|
+
}
|
|
59
|
+
getPublicName() {
|
|
60
|
+
return 'Expedico';
|
|
61
|
+
}
|
|
62
|
+
getDescription() {
|
|
63
|
+
return 'Single point for your ecommerce parcel delivery, returns handling and fulfillment services in Europe';
|
|
64
|
+
}
|
|
65
|
+
getFormStack() {
|
|
66
|
+
const form = new Form_1.default(CoreFormsEnum_1.default.AUTHORIZATION_FORM, (0, CoreFormsEnum_1.getFormName)(CoreFormsEnum_1.default.AUTHORIZATION_FORM))
|
|
67
|
+
.addField(new Field_1.default(FieldType_1.default.TEXT, ABasicApplication_1.USER, 'ApiKey', undefined, true))
|
|
68
|
+
.addField(new Field_1.default(FieldType_1.default.PASSWORD, ABasicApplication_1.PASSWORD, 'Password', undefined, true));
|
|
69
|
+
return new FormStack_1.default().addForm(form);
|
|
70
|
+
}
|
|
71
|
+
getRequestDto(dto, applicationInstall, method, url, data) {
|
|
72
|
+
const request = new RequestDto_1.default(`${this.baseUrl}${url}`, method, dto);
|
|
73
|
+
const user = applicationInstall.getSettings()[CoreFormsEnum_1.default.AUTHORIZATION_FORM][ABasicApplication_1.USER];
|
|
74
|
+
const password = applicationInstall.getSettings()[CoreFormsEnum_1.default.AUTHORIZATION_FORM][ABasicApplication_1.PASSWORD];
|
|
75
|
+
request.setHeaders({
|
|
76
|
+
[Headers_1.CommonHeaders.CONTENT_TYPE]: Headers_1.JSON_TYPE,
|
|
77
|
+
[Headers_1.CommonHeaders.ACCEPT]: '*/*',
|
|
78
|
+
[Headers_1.CommonHeaders.AUTHORIZATION]: `Basic ${(0, Base64_1.encode)(`${user}:${password}`)}`,
|
|
79
|
+
});
|
|
80
|
+
if (data) {
|
|
81
|
+
request.setJsonBody(data);
|
|
82
|
+
}
|
|
83
|
+
return request;
|
|
84
|
+
}
|
|
85
|
+
getLogo() {
|
|
86
|
+
return 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADoAAAA8CAYAAAA34qk1AAAAAXNSR0IArs4c6QAAFTZJREFUaEPVmwmUHWWVx39V9ert/V7vHZJAQgIJIJsQMJkIYUtENG4oIucocgYBFTxK5LgdhxHGGQGXcR9lcRQlCBEwERmGJSIJh0USEkkChOwhS+/db3/1qr4596uq7pdON3QacWbqnEc3/V69+u537/3f//3fL4ZSSvEWX/IAAxj7Sf4nDPnQW3QZb7Whso+GYeB6ij1dDrs6HQZKHrWaAgWpuMnMKVGmtNlELANPoQ2u35i/xQa8ZYaK92SBPYMuqzaVWPpsgRWvOlDy3asC7xkKolG46MQoV52X4ZjJUZ5/pYQdszh2apSGhKl9/GaNfVOGhqEYei1cjPxdXivXFbjhjzk299S0fbWIgRUYGOZL6Dm7BrEIXHt+AxefmOCSH3aRSFp88O1x3j8nSUdTREfGRK8JGSqLVJ7C9WDjrgrrt5a56MwM0Yipd17ef2RNgctu6yOWMdjjgiP3BK+Ri5Xli9+mRwzSFjx0bTtLn8zxgz8X6XYVs1ImX39PmgtOa8C2xLuHns+HbGgILC9sK/OTx/Pct6HC4uPi/PyTzTrH5HJqik/f0cPT26tslFwcxyV3Jg1ImfCnz7WzdnOJJfcPUogZRDzwiorzZkf5wqIG5s2OC3QdUjgfkqE6JIH7Vw+yZFmOig1RE86YEeP2y1qI2v5uC6A8vKbApT/rI9Fss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ML6wDPyb8Z7fxdDD/b0gTPW+vfr//mIjzBvneb2Nwnd8Xj6f/sz/wOlT1alVJRzwAAAAABJRU5ErkJggg==';
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.default = ExpedicoApplication;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@orchesty/connector-expedico",
|
|
3
|
+
"description": "",
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"url": "https://github.com/Orchesty/orchesty-nodejs-connectors",
|
|
7
|
+
"repository": "https://github.com/Orchesty/orchesty-nodejs-connectors",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "rm -rf dist && rm -rf tsconfig.prod.tsbuildinfo && tsc -d -p tsconfig.prod.json && cp package.json ./dist/package.json",
|
|
10
|
+
"test": "jest --coverage --forceExit --passWithNoTests",
|
|
11
|
+
"lint": "eslint src test --fix",
|
|
12
|
+
"lint-ci": "eslint src test"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [],
|
|
15
|
+
"author": "info@hanaboso.com",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@orchesty/nodejs-sdk": "^4.3.6"
|
|
18
|
+
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=24"
|
|
21
|
+
}
|
|
22
|
+
}
|
package/jest.config.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const baseConfig = require('../../jest.config.js');
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
...baseConfig,
|
|
5
|
+
roots: ["<rootDir>/src"],
|
|
6
|
+
setupFiles: ["<rootDir>/../../.jest/testEnvs.ts"],
|
|
7
|
+
setupFilesAfterEnv: ["<rootDir>/../../.jest/testLifecycle.ts"],
|
|
8
|
+
globalSetup: "<rootDir>/../../.jest/globalSetup.ts",
|
|
9
|
+
moduleNameMapper: {
|
|
10
|
+
"^@orchesty/nodejs-connectors/test/(.*)$": "<rootDir>/../../test/$1",
|
|
11
|
+
"^@orchesty/nodejs-connectors/lib/(.*)$": "<rootDir>/../../lib/$1",
|
|
12
|
+
},
|
|
13
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@orchesty/connector-expedico",
|
|
3
|
+
"description": "",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"url": "https://github.com/Orchesty/orchesty-nodejs-connectors",
|
|
7
|
+
"repository": "https://github.com/Orchesty/orchesty-nodejs-connectors",
|
|
8
|
+
"keywords": [],
|
|
9
|
+
"author": "info@hanaboso.com",
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@orchesty/nodejs-sdk": "^4.3.6"
|
|
12
|
+
},
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=24"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "rm -rf dist && rm -rf tsconfig.prod.tsbuildinfo && tsc -d -p tsconfig.prod.json && cp package.json ./dist/package.json",
|
|
18
|
+
"test": "jest --coverage --forceExit --passWithNoTests",
|
|
19
|
+
"lint": "eslint src test --fix",
|
|
20
|
+
"lint-ci": "eslint src test"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import ABatchNode from '@orchesty/nodejs-sdk/dist/lib/Batch/ABatchNode';
|
|
2
|
+
import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
|
|
3
|
+
import BatchProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/BatchProcessDto';
|
|
4
|
+
|
|
5
|
+
export const NAME = 'expedico-get-tracking-info';
|
|
6
|
+
|
|
7
|
+
export default class ExpedicoGetTrackingInfo extends ABatchNode {
|
|
8
|
+
|
|
9
|
+
public getName(): string {
|
|
10
|
+
return NAME;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
public async processAction(dto: BatchProcessDto<IInput>): Promise<BatchProcessDto> {
|
|
14
|
+
const { parcelIds } = dto.getJsonData();
|
|
15
|
+
|
|
16
|
+
const req = await this.getApplication()
|
|
17
|
+
.getRequestDto(
|
|
18
|
+
dto,
|
|
19
|
+
await this.getApplicationInstallFromProcess(dto),
|
|
20
|
+
HttpMethods.POST,
|
|
21
|
+
'parcels_tracking',
|
|
22
|
+
{
|
|
23
|
+
data: {
|
|
24
|
+
parcel_ids: parcelIds,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
);
|
|
28
|
+
const resp = await this.getSender().send<IResponse>(req, [200]);
|
|
29
|
+
const respData = resp.getJsonBody();
|
|
30
|
+
|
|
31
|
+
dto.setItemList(Object.values(respData.data));
|
|
32
|
+
|
|
33
|
+
return dto;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface IResponse {
|
|
39
|
+
data: Record<string, IParcelTracking>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface IParcelTracking {
|
|
43
|
+
parcelStatusId: number;
|
|
44
|
+
trackingHistory: {
|
|
45
|
+
attributes: {
|
|
46
|
+
dateTime: string;
|
|
47
|
+
parcelId: number;
|
|
48
|
+
parcelStatusId: number;
|
|
49
|
+
statusDescription?: unknown;
|
|
50
|
+
trackingCode: string;
|
|
51
|
+
};
|
|
52
|
+
relationships: {
|
|
53
|
+
packet: {
|
|
54
|
+
links: {
|
|
55
|
+
related: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
type: string;
|
|
60
|
+
}[];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface IInput {
|
|
64
|
+
parcelIds: number[];
|
|
65
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"http": "POST https://expedico.eu/api/v2/parcels_tracking",
|
|
3
|
+
"code": 200,
|
|
4
|
+
"body": {
|
|
5
|
+
"data": {
|
|
6
|
+
"1225955070094": {
|
|
7
|
+
"parcelStatusId": 200,
|
|
8
|
+
"trackingHistory": [
|
|
9
|
+
{
|
|
10
|
+
"attributes": {
|
|
11
|
+
"dateTime": "2023-03-08T10:16:27Z",
|
|
12
|
+
"parcelId": 1225955070094,
|
|
13
|
+
"parcelStatusId": 200,
|
|
14
|
+
"statusDescription": null,
|
|
15
|
+
"trackingCode": "62091150493"
|
|
16
|
+
},
|
|
17
|
+
"relationships": {
|
|
18
|
+
"packet": {
|
|
19
|
+
"links": {
|
|
20
|
+
"related": "/api/v2/parcels/1225955070094"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"type": "parcel_events"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
"1225955070095": {
|
|
29
|
+
"parcelStatusId": 200,
|
|
30
|
+
"trackingHistory": [
|
|
31
|
+
{
|
|
32
|
+
"attributes": {
|
|
33
|
+
"dateTime": "2023-03-08T10:16:27Z",
|
|
34
|
+
"parcelId": 1225955070095,
|
|
35
|
+
"parcelStatusId": 200,
|
|
36
|
+
"statusDescription": null,
|
|
37
|
+
"trackingCode": "62091150493"
|
|
38
|
+
},
|
|
39
|
+
"relationships": {
|
|
40
|
+
"packet": {
|
|
41
|
+
"links": {
|
|
42
|
+
"related": "/api/v2/parcels/1225955070094"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"type": "parcel_events"
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"headers": {
|
|
3
|
+
"user": "defaultUser"
|
|
4
|
+
},
|
|
5
|
+
"data": [
|
|
6
|
+
{
|
|
7
|
+
"body": "{\"parcelStatusId\":200,\"trackingHistory\":[{\"attributes\":{\"dateTime\":\"2023-03-08T10:16:27Z\",\"parcelId\":1225955070094,\"parcelStatusId\":200,\"statusDescription\":null,\"trackingCode\":\"62091150493\"},\"relationships\":{\"packet\":{\"links\":{\"related\":\"/api/v2/parcels/1225955070094\"}}},\"type\":\"parcel_events\"}]}",
|
|
8
|
+
"headers": {}
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"body": "{\"parcelStatusId\":200,\"trackingHistory\":[{\"attributes\":{\"dateTime\":\"2023-03-08T10:16:27Z\",\"parcelId\":1225955070095,\"parcelStatusId\":200,\"statusDescription\":null,\"trackingCode\":\"62091150493\"},\"relationships\":{\"packet\":{\"links\":{\"related\":\"/api/v2/parcels/1225955070094\"}}},\"type\":\"parcel_events\"}]}",
|
|
12
|
+
"headers": {}
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { container } from '@orchesty/nodejs-sdk';
|
|
2
|
+
import NodeTester from '@orchesty/nodejs-sdk/dist/test/Testers/NodeTester';
|
|
3
|
+
import init from '../../../test/dataProvider';
|
|
4
|
+
import { NAME as EXPEDICO_GET_TRACKING_INFO } from '../ExpedicoGetTrackingInfo';
|
|
5
|
+
|
|
6
|
+
let tester: NodeTester;
|
|
7
|
+
|
|
8
|
+
describe('Tests for ActiveCampaignListAccountsBatch', () => {
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
tester = new NodeTester(container, __filename);
|
|
11
|
+
init();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('process - ok', async () => {
|
|
15
|
+
await tester.testBatch(EXPEDICO_GET_TRACKING_INFO);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
|
|
2
|
+
import ResponseDto from '@orchesty/nodejs-sdk/dist/lib/Transport/Curl/ResponseDto';
|
|
3
|
+
import { IResultRanges } from '@orchesty/nodejs-sdk/dist/lib/Transport/Curl/ResultCodeRange';
|
|
4
|
+
import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
|
|
5
|
+
import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
|
|
6
|
+
|
|
7
|
+
export const NAME = 'expedico-create-parcel';
|
|
8
|
+
|
|
9
|
+
export default class ExpedicoCreateParcel extends AConnector {
|
|
10
|
+
|
|
11
|
+
protected errorCodes: IResultRanges = { success: 201, stopAndFail: 422 };
|
|
12
|
+
|
|
13
|
+
public getName(): string {
|
|
14
|
+
return NAME;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public async processAction(dto: ProcessDto<IInput>): Promise<ProcessDto<IOutput>> {
|
|
18
|
+
const data = this.getJsonData(dto);
|
|
19
|
+
|
|
20
|
+
const requestDto = await this.getApplication().getRequestDto(
|
|
21
|
+
dto,
|
|
22
|
+
await this.getApplicationInstallFromProcess(dto),
|
|
23
|
+
HttpMethods.POST,
|
|
24
|
+
'parcels',
|
|
25
|
+
data,
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
return this.setJsonData(
|
|
29
|
+
dto,
|
|
30
|
+
await this.getSender().send(requestDto, this.errorCodes),
|
|
31
|
+
dto.getJsonData(),
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
36
|
+
protected setJsonData(dto: ProcessDto, response: ResponseDto, data: IInput): ProcessDto<IOutput> {
|
|
37
|
+
const { id,
|
|
38
|
+
'carrier-barcode': carrierBarcode,
|
|
39
|
+
'carrier-tracking-code': carrierTrackingCode,
|
|
40
|
+
} = response.getHeaders();
|
|
41
|
+
|
|
42
|
+
return dto.setNewJsonData({
|
|
43
|
+
id,
|
|
44
|
+
carrierBarcode,
|
|
45
|
+
carrierTrackingCode,
|
|
46
|
+
} as IOutput);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
protected getJsonData(dto: ProcessDto<IInput>): IInput {
|
|
50
|
+
return dto.getJsonData();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface IAddress {
|
|
56
|
+
firstname: string;
|
|
57
|
+
lastname: string;
|
|
58
|
+
city: string;
|
|
59
|
+
zipCode: string;
|
|
60
|
+
street: string;
|
|
61
|
+
streetNumber: string;
|
|
62
|
+
email: string;
|
|
63
|
+
phone: string;
|
|
64
|
+
country: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface IInput {
|
|
68
|
+
data: IData;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface IData {
|
|
72
|
+
orderNumber: string;
|
|
73
|
+
weightInKg: number;
|
|
74
|
+
senderId: number;
|
|
75
|
+
recipient: IAddress;
|
|
76
|
+
carrierPickupDate: string;
|
|
77
|
+
carrier?: string;
|
|
78
|
+
sender?: IAddress;
|
|
79
|
+
currency?: string;
|
|
80
|
+
codAmount?: number;
|
|
81
|
+
pickupPoint?: number;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface IOutput {
|
|
85
|
+
id: number;
|
|
86
|
+
carrierBarcode: number;
|
|
87
|
+
carrierTrackingCode: number;
|
|
88
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
|
|
5
|
+
export const NAME = 'expedico-get-carriers';
|
|
6
|
+
|
|
7
|
+
export default class ExpedicoGetCarriers extends AConnector {
|
|
8
|
+
|
|
9
|
+
public getName(): string {
|
|
10
|
+
return NAME;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
public async processAction(dto: ProcessDto): Promise<ProcessDto<IOutput>> {
|
|
14
|
+
const requestDto = await this.getApplication().getRequestDto(
|
|
15
|
+
dto,
|
|
16
|
+
await this.getApplicationInstallFromProcess(dto),
|
|
17
|
+
HttpMethods.GET,
|
|
18
|
+
'carriers',
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const resp = await this.getSender().send<IOutput>(requestDto, [200]);
|
|
22
|
+
|
|
23
|
+
return dto.setNewJsonData(resp.getJsonBody());
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface IOutput {
|
|
29
|
+
data: {
|
|
30
|
+
attributes: {
|
|
31
|
+
labelEn: string;
|
|
32
|
+
sys: string;
|
|
33
|
+
};
|
|
34
|
+
id: string;
|
|
35
|
+
links: {
|
|
36
|
+
self: string;
|
|
37
|
+
};
|
|
38
|
+
relationships: {
|
|
39
|
+
countries: {
|
|
40
|
+
links: {
|
|
41
|
+
related: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
} ;
|
|
45
|
+
type: string;
|
|
46
|
+
}[];
|
|
47
|
+
jsonapi: {
|
|
48
|
+
version: string;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"headers": {
|
|
3
|
+
"user": "TestUser"
|
|
4
|
+
},
|
|
5
|
+
"data": {
|
|
6
|
+
"data": {
|
|
7
|
+
"carrier": "bg_speedy",
|
|
8
|
+
"weightInKg": 1,
|
|
9
|
+
"sender": {
|
|
10
|
+
"firstname": "neco",
|
|
11
|
+
"lastname": "neco",
|
|
12
|
+
"city": "Hradec Králové",
|
|
13
|
+
"zipCode": "50004",
|
|
14
|
+
"street": "neco",
|
|
15
|
+
"streetNumber": "21",
|
|
16
|
+
"email": "neco@neco.cz",
|
|
17
|
+
"phone": "+420777777777",
|
|
18
|
+
"country": "cz"
|
|
19
|
+
},
|
|
20
|
+
"recipient": {
|
|
21
|
+
"firstname": "neco",
|
|
22
|
+
"lastname": "neco",
|
|
23
|
+
"city": "Kiten",
|
|
24
|
+
"zipCode": "8183",
|
|
25
|
+
"street": "neco",
|
|
26
|
+
"streetNumber": "21",
|
|
27
|
+
"email": "neco@neco.cz",
|
|
28
|
+
"phone": "+420777777777",
|
|
29
|
+
"country": "bg"
|
|
30
|
+
},
|
|
31
|
+
"carrierPickupDate": "2023-03-03",
|
|
32
|
+
"orderNumber": "1"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"http": "GET https://expedico.eu/api/v2/carriers",
|
|
3
|
+
"code": 200,
|
|
4
|
+
"body": {
|
|
5
|
+
"data": [
|
|
6
|
+
{
|
|
7
|
+
"attributes": {
|
|
8
|
+
"labelEn": "HU DPD",
|
|
9
|
+
"sys": "hu_dpd"
|
|
10
|
+
},
|
|
11
|
+
"id": "131",
|
|
12
|
+
"links": {
|
|
13
|
+
"self": "/api/v2/carriers/131"
|
|
14
|
+
},
|
|
15
|
+
"relationships": {
|
|
16
|
+
"countries": {
|
|
17
|
+
"links": {
|
|
18
|
+
"related": "/api/v2/countries?filter[carrier_id]=131"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"type": "carriers"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"attributes": {
|
|
26
|
+
"labelEn": "HU Express One",
|
|
27
|
+
"sys": "hu_expressone"
|
|
28
|
+
},
|
|
29
|
+
"id": "132",
|
|
30
|
+
"links": {
|
|
31
|
+
"self": "/api/v2/carriers/132"
|
|
32
|
+
},
|
|
33
|
+
"relationships": {
|
|
34
|
+
"countries": {
|
|
35
|
+
"links": {
|
|
36
|
+
"related": "/api/v2/countries?filter[carrier_id]=132"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"type": "carriers"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"attributes": {
|
|
44
|
+
"labelEn": "BG Speedy",
|
|
45
|
+
"sys": "bg_speedy"
|
|
46
|
+
},
|
|
47
|
+
"id": "133",
|
|
48
|
+
"links": {
|
|
49
|
+
"self": "/api/v2/carriers/133"
|
|
50
|
+
},
|
|
51
|
+
"relationships": {
|
|
52
|
+
"countries": {
|
|
53
|
+
"links": {
|
|
54
|
+
"related": "/api/v2/countries?filter[carrier_id]=133"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"type": "carriers"
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"jsonapi": {
|
|
62
|
+
"version": "1.0"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"headers": {
|
|
3
|
+
"user": "TestUser"
|
|
4
|
+
},
|
|
5
|
+
"data": {
|
|
6
|
+
"data": [
|
|
7
|
+
{
|
|
8
|
+
"attributes": {
|
|
9
|
+
"labelEn": "HU DPD",
|
|
10
|
+
"sys": "hu_dpd"
|
|
11
|
+
},
|
|
12
|
+
"id": "131",
|
|
13
|
+
"links": {
|
|
14
|
+
"self": "/api/v2/carriers/131"
|
|
15
|
+
},
|
|
16
|
+
"relationships": {
|
|
17
|
+
"countries": {
|
|
18
|
+
"links": {
|
|
19
|
+
"related": "/api/v2/countries?filter[carrier_id]=131"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"type": "carriers"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"attributes": {
|
|
27
|
+
"labelEn": "HU Express One",
|
|
28
|
+
"sys": "hu_expressone"
|
|
29
|
+
},
|
|
30
|
+
"id": "132",
|
|
31
|
+
"links": {
|
|
32
|
+
"self": "/api/v2/carriers/132"
|
|
33
|
+
},
|
|
34
|
+
"relationships": {
|
|
35
|
+
"countries": {
|
|
36
|
+
"links": {
|
|
37
|
+
"related": "/api/v2/countries?filter[carrier_id]=132"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"type": "carriers"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"attributes": {
|
|
45
|
+
"labelEn": "BG Speedy",
|
|
46
|
+
"sys": "bg_speedy"
|
|
47
|
+
},
|
|
48
|
+
"id": "133",
|
|
49
|
+
"links": {
|
|
50
|
+
"self": "/api/v2/carriers/133"
|
|
51
|
+
},
|
|
52
|
+
"relationships": {
|
|
53
|
+
"countries": {
|
|
54
|
+
"links": {
|
|
55
|
+
"related": "/api/v2/countries?filter[carrier_id]=133"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"type": "carriers"
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"jsonapi": {
|
|
63
|
+
"version": "1.0"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|