@artaio/node-api 1.8.0 → 1.9.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.
- package/dist/lib/ArtaClient.js +57 -144
- package/dist/lib/arta.js +29 -30
- package/dist/lib/endpoint/addressVerifications.js +13 -16
- package/dist/lib/endpoint/attachment.js +13 -16
- package/dist/lib/endpoint/emailRules.js +16 -19
- package/dist/lib/endpoint/emailSubscriptions.js +16 -19
- package/dist/lib/endpoint/endpoint.js +44 -160
- package/dist/lib/endpoint/hostedSessions.js +19 -70
- package/dist/lib/endpoint/invoicePayments.js +17 -27
- package/dist/lib/endpoint/invoices.js +11 -14
- package/dist/lib/endpoint/keys.js +15 -18
- package/dist/lib/endpoint/logs.js +17 -27
- package/dist/lib/endpoint/metadata.js +63 -64
- package/dist/lib/endpoint/organization.js +12 -67
- package/dist/lib/endpoint/payments.js +17 -27
- package/dist/lib/endpoint/requests.js +35 -113
- package/dist/lib/endpoint/selfShipCollectionAvailabilityChecks.js +6 -47
- package/dist/lib/endpoint/selfShipCollections.js +13 -16
- package/dist/lib/endpoint/shipments.d.ts +3 -0
- package/dist/lib/endpoint/shipments.js +21 -23
- package/dist/lib/endpoint/tags.js +13 -16
- package/dist/lib/endpoint/trackings.js +12 -66
- package/dist/lib/endpoint/uploads.js +13 -16
- package/dist/lib/endpoint/webhookDeliveries.js +9 -12
- package/dist/lib/endpoint/webhooks.js +37 -112
- package/dist/lib/error.js +14 -35
- package/dist/lib/logging.js +18 -48
- package/dist/lib/net/FetchHttpClient.js +43 -108
- package/dist/lib/queryParams.js +5 -6
- package/dist/lib/types.d.ts +3 -3
- package/dist/lib/utils.js +10 -17
- package/dist/package.json +24 -18
- package/package.json +24 -18
package/dist/lib/queryParams.js
CHANGED
|
@@ -5,16 +5,15 @@ exports.defaultQueryParams = {
|
|
|
5
5
|
page: 1,
|
|
6
6
|
page_size: 20,
|
|
7
7
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
for (
|
|
11
|
-
var _b = _a[_i], key = _b[0], value = _b[1];
|
|
8
|
+
const parseQueryParams = (params) => {
|
|
9
|
+
let parsedParams = '';
|
|
10
|
+
for (const [key, value] of Object.entries(params)) {
|
|
12
11
|
if (key && value) {
|
|
13
12
|
if (parsedParams === '') {
|
|
14
|
-
parsedParams =
|
|
13
|
+
parsedParams = `?${key}=${value}`;
|
|
15
14
|
}
|
|
16
15
|
else {
|
|
17
|
-
parsedParams +=
|
|
16
|
+
parsedParams += `&${key}=${value}`;
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
19
|
}
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -221,7 +221,7 @@ export type Shipment = {
|
|
|
221
221
|
package_id?: (number | null) | undefined;
|
|
222
222
|
resolution?: (string | null) | undefined;
|
|
223
223
|
status: "in_progress" | "new" | "resolved";
|
|
224
|
-
type: "change_of_address_request" | "customs_information_required" | "damaged_items" | "direct_payment_required" | "held_at_customs" | "inaccurate_object_details" | "incorrect_address" | "lost_in_transit" | "not_ready_for_delivery" | "not_ready_for_release" | "other" | "prepayment_required" | "requested_hold_to_collect" | "requested_hold_to_deliver" | "wrong_item";
|
|
224
|
+
type: "change_of_address_request" | "customs_information_required" | "damaged_items" | "direct_payment_required" | "held_at_customs" | "inaccurate_object_details" | "incorrect_address" | "label_hold" | "lost_in_transit" | "not_ready_for_delivery" | "not_ready_for_release" | "other" | "prepayment_required" | "requested_hold_to_collect" | "requested_hold_to_deliver" | "wrong_item";
|
|
225
225
|
}[] | null) | undefined;
|
|
226
226
|
hosted_session_id?: (number | null) | undefined;
|
|
227
227
|
insurance_policy?: ({
|
|
@@ -773,7 +773,7 @@ export type Package = {
|
|
|
773
773
|
weight_unit: string;
|
|
774
774
|
width: number;
|
|
775
775
|
};
|
|
776
|
-
export type ShipmentExceptionTypeId = "change_of_address_request" | "customs_information_required" | "damaged_items" | "direct_payment_required" | "held_at_customs" | "inaccurate_object_details" | "incorrect_address" | "lost_in_transit" | "not_ready_for_delivery" | "not_ready_for_release" | "other" | "prepayment_required" | "requested_hold_to_collect" | "requested_hold_to_deliver" | "wrong_item";
|
|
776
|
+
export type ShipmentExceptionTypeId = "change_of_address_request" | "customs_information_required" | "damaged_items" | "direct_payment_required" | "held_at_customs" | "inaccurate_object_details" | "incorrect_address" | "label_hold" | "lost_in_transit" | "not_ready_for_delivery" | "not_ready_for_release" | "other" | "prepayment_required" | "requested_hold_to_collect" | "requested_hold_to_deliver" | "wrong_item";
|
|
777
777
|
export type ShipmentException = {
|
|
778
778
|
updated_at: Date;
|
|
779
779
|
created_at: Date;
|
|
@@ -782,7 +782,7 @@ export type ShipmentException = {
|
|
|
782
782
|
package_id?: (number | null) | undefined;
|
|
783
783
|
resolution?: (string | null) | undefined;
|
|
784
784
|
status: "in_progress" | "new" | "resolved";
|
|
785
|
-
type: "change_of_address_request" | "customs_information_required" | "damaged_items" | "direct_payment_required" | "held_at_customs" | "inaccurate_object_details" | "incorrect_address" | "lost_in_transit" | "not_ready_for_delivery" | "not_ready_for_release" | "other" | "prepayment_required" | "requested_hold_to_collect" | "requested_hold_to_deliver" | "wrong_item";
|
|
785
|
+
type: "change_of_address_request" | "customs_information_required" | "damaged_items" | "direct_payment_required" | "held_at_customs" | "inaccurate_object_details" | "incorrect_address" | "label_hold" | "lost_in_transit" | "not_ready_for_delivery" | "not_ready_for_release" | "other" | "prepayment_required" | "requested_hold_to_collect" | "requested_hold_to_deliver" | "wrong_item";
|
|
786
786
|
};
|
|
787
787
|
export type ShipmentSchedule = {
|
|
788
788
|
delivery_end?: (Date | null) | undefined;
|
package/dist/lib/utils.js
CHANGED
|
@@ -1,32 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.parseService = void 0;
|
|
15
4
|
exports.createDateAsUTC = createDateAsUTC;
|
|
16
5
|
exports.convertDatesToUtc = convertDatesToUtc;
|
|
17
6
|
function createDateAsUTC(dateStr) {
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
const date = new Date(dateStr);
|
|
8
|
+
const timestamp = Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
|
|
20
9
|
return new Date(timestamp);
|
|
21
10
|
}
|
|
22
11
|
function convertDatesToUtc(artaResponse) {
|
|
23
|
-
return
|
|
12
|
+
return {
|
|
13
|
+
...artaResponse,
|
|
14
|
+
created_at: artaResponse.created_at
|
|
24
15
|
? createDateAsUTC(artaResponse.created_at)
|
|
25
|
-
: undefined,
|
|
16
|
+
: undefined,
|
|
17
|
+
updated_at: artaResponse.updated_at
|
|
26
18
|
? createDateAsUTC(artaResponse.updated_at)
|
|
27
|
-
: undefined
|
|
19
|
+
: undefined,
|
|
20
|
+
};
|
|
28
21
|
}
|
|
29
|
-
|
|
22
|
+
const parseService = (s) => {
|
|
30
23
|
s.amount = Number(s.amount);
|
|
31
24
|
if (s.included_services) {
|
|
32
25
|
s.included_services.forEach(exports.parseService);
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artaio/node-api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.1",
|
|
4
4
|
"description": "The Arta Node library provides a seamless integration to Arta API for backend applications using both Typescript or Javascript.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "npm run build:types && tsc -p tsconfig-build.json",
|
|
@@ -35,24 +35,25 @@
|
|
|
35
35
|
"Selman Uysal <selman@arta.io>"
|
|
36
36
|
],
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@commitlint/cli": "^
|
|
39
|
-
"@commitlint/config-conventional": "^
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"@
|
|
43
|
-
"eslint": "^
|
|
44
|
-
"eslint-config-prettier": "^
|
|
45
|
-
"eslint-plugin-import": "^2.
|
|
46
|
-
"eslint-plugin-n": "^
|
|
47
|
-
"eslint-plugin-promise": "^
|
|
48
|
-
"husky": "^9.
|
|
49
|
-
"jest": "^
|
|
50
|
-
"nock": "^14.0.
|
|
38
|
+
"@commitlint/cli": "^20.0.0",
|
|
39
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
40
|
+
"@eslint/js": "^9.0.0",
|
|
41
|
+
"@types/jest": "^30.0.0",
|
|
42
|
+
"@types/node": "^18.19.130",
|
|
43
|
+
"eslint": "^9.0.0",
|
|
44
|
+
"eslint-config-prettier": "^10.0.0",
|
|
45
|
+
"eslint-plugin-import": "^2.32.0",
|
|
46
|
+
"eslint-plugin-n": "^17.0.0",
|
|
47
|
+
"eslint-plugin-promise": "^7.0.0",
|
|
48
|
+
"husky": "^9.1.7",
|
|
49
|
+
"jest": "^30.0.0",
|
|
50
|
+
"nock": "^14.0.12",
|
|
51
51
|
"pinst": "^3.0.0",
|
|
52
|
-
"prettier": "3.
|
|
53
|
-
"ts-jest": "^29.
|
|
52
|
+
"prettier": "3.8.1",
|
|
53
|
+
"ts-jest": "^29.4.9",
|
|
54
54
|
"ts-node": "^10.9.2",
|
|
55
|
-
"typescript": "^
|
|
55
|
+
"typescript": "^6.0.0",
|
|
56
|
+
"typescript-eslint": "^8.0.0",
|
|
56
57
|
"zod": "^3.22.4",
|
|
57
58
|
"zod-to-ts": "^1.2.0"
|
|
58
59
|
},
|
|
@@ -62,5 +63,10 @@
|
|
|
62
63
|
"engines": {
|
|
63
64
|
"node": ">=18.x"
|
|
64
65
|
},
|
|
65
|
-
"license": "MIT"
|
|
66
|
+
"license": "MIT",
|
|
67
|
+
"overrides": {
|
|
68
|
+
"zod-to-ts": {
|
|
69
|
+
"typescript": "$typescript"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
66
72
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artaio/node-api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.1",
|
|
4
4
|
"description": "The Arta Node library provides a seamless integration to Arta API for backend applications using both Typescript or Javascript.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "npm run build:types && tsc -p tsconfig-build.json",
|
|
@@ -35,24 +35,25 @@
|
|
|
35
35
|
"Selman Uysal <selman@arta.io>"
|
|
36
36
|
],
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@commitlint/cli": "^
|
|
39
|
-
"@commitlint/config-conventional": "^
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"@
|
|
43
|
-
"eslint": "^
|
|
44
|
-
"eslint-config-prettier": "^
|
|
45
|
-
"eslint-plugin-import": "^2.
|
|
46
|
-
"eslint-plugin-n": "^
|
|
47
|
-
"eslint-plugin-promise": "^
|
|
48
|
-
"husky": "^9.
|
|
49
|
-
"jest": "^
|
|
50
|
-
"nock": "^14.0.
|
|
38
|
+
"@commitlint/cli": "^20.0.0",
|
|
39
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
40
|
+
"@eslint/js": "^9.0.0",
|
|
41
|
+
"@types/jest": "^30.0.0",
|
|
42
|
+
"@types/node": "^18.19.130",
|
|
43
|
+
"eslint": "^9.0.0",
|
|
44
|
+
"eslint-config-prettier": "^10.0.0",
|
|
45
|
+
"eslint-plugin-import": "^2.32.0",
|
|
46
|
+
"eslint-plugin-n": "^17.0.0",
|
|
47
|
+
"eslint-plugin-promise": "^7.0.0",
|
|
48
|
+
"husky": "^9.1.7",
|
|
49
|
+
"jest": "^30.0.0",
|
|
50
|
+
"nock": "^14.0.12",
|
|
51
51
|
"pinst": "^3.0.0",
|
|
52
|
-
"prettier": "3.
|
|
53
|
-
"ts-jest": "^29.
|
|
52
|
+
"prettier": "3.8.1",
|
|
53
|
+
"ts-jest": "^29.4.9",
|
|
54
54
|
"ts-node": "^10.9.2",
|
|
55
|
-
"typescript": "^
|
|
55
|
+
"typescript": "^6.0.0",
|
|
56
|
+
"typescript-eslint": "^8.0.0",
|
|
56
57
|
"zod": "^3.22.4",
|
|
57
58
|
"zod-to-ts": "^1.2.0"
|
|
58
59
|
},
|
|
@@ -62,5 +63,10 @@
|
|
|
62
63
|
"engines": {
|
|
63
64
|
"node": ">=18.x"
|
|
64
65
|
},
|
|
65
|
-
"license": "MIT"
|
|
66
|
+
"license": "MIT",
|
|
67
|
+
"overrides": {
|
|
68
|
+
"zod-to-ts": {
|
|
69
|
+
"typescript": "$typescript"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
66
72
|
}
|