@artaio/node-api 0.31.0 → 0.32.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/README.md +3 -1
- package/dist/lib/ArtaClient.js +13 -6
- package/dist/lib/MetadataTypes.d.ts +1 -93
- package/dist/lib/MetadataTypes.js +15 -0
- package/dist/lib/arta.d.ts +1 -1
- package/dist/lib/arta.js +2 -2
- package/dist/lib/endpoint/attachment.d.ts +4 -10
- package/dist/lib/endpoint/emailRules.d.ts +6 -12
- package/dist/lib/endpoint/emailSubscriptions.d.ts +6 -12
- package/dist/lib/endpoint/endpoint.d.ts +5 -5
- package/dist/lib/endpoint/endpoint.js +3 -2
- package/dist/lib/endpoint/hostedSessions.d.ts +12 -29
- package/dist/lib/endpoint/invoicePayments.d.ts +4 -15
- package/dist/lib/endpoint/invoices.d.ts +4 -18
- package/dist/lib/endpoint/keys.d.ts +6 -16
- package/dist/lib/endpoint/logs.d.ts +4 -20
- package/dist/lib/endpoint/metadata.d.ts +3 -3
- package/dist/lib/endpoint/organization.d.ts +2 -14
- package/dist/lib/endpoint/payments.d.ts +4 -12
- package/dist/lib/endpoint/requests.d.ts +17 -41
- package/dist/lib/endpoint/requests.js +17 -5
- package/dist/lib/endpoint/shipments.d.ts +6 -73
- package/dist/lib/endpoint/shipments.js +19 -13
- package/dist/lib/endpoint/trackings.d.ts +3 -19
- package/dist/lib/endpoint/uploads.d.ts +7 -18
- package/dist/lib/endpoint/webhookDeliveries.d.ts +4 -18
- package/dist/lib/endpoint/webhooks.d.ts +10 -13
- package/dist/lib/index.d.ts +9 -16
- package/dist/lib/net/FetchHttpClient.d.ts +13 -0
- package/dist/lib/net/FetchHttpClient.js +128 -0
- package/dist/lib/net/HttpClient.d.ts +3 -6
- package/dist/lib/types.d.ts +750 -0
- package/dist/lib/types.js +2 -0
- package/dist/package.json +15 -10
- package/dist/schemas/generate.d.ts +1 -0
- package/dist/schemas/generate.js +51 -0
- package/dist/schemas/index.d.ts +3204 -0
- package/dist/schemas/index.js +733 -0
- package/dist/test-integration/index.d.ts +2 -0
- package/dist/test-integration/index.js +7 -0
- package/dist/test-integration/keys.test.d.ts +1 -0
- package/dist/test-integration/keys.test.js +71 -0
- package/dist/test-integration/requests.test.d.ts +1 -0
- package/dist/test-integration/requests.test.js +87 -0
- package/dist/test-integration/shipments.test.d.ts +1 -0
- package/dist/test-integration/shipments.test.js +114 -0
- package/package.json +15 -10
- package/dist/lib/net/NodeHttpClient.d.ts +0 -20
- package/dist/lib/net/NodeHttpClient.js +0 -203
package/dist/package.json
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artaio/node-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"description": "The Arta Node library provides a seamless integration to Arta API for applications running on Node.js using both Typescript or Javascript.",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"build": "tsc -p tsconfig-build.json",
|
|
7
|
-
"
|
|
6
|
+
"build": "npm run build:types && tsc -p tsconfig-build.json",
|
|
7
|
+
"build:types": "npx ts-node ./schemas/generate.ts > lib/types.ts",
|
|
8
|
+
"test": "npm run lint && npm run test:unit",
|
|
9
|
+
"test:unit": "jest --coverage --detectOpenHandles --verbose ./test/",
|
|
10
|
+
"test:integration": "jest --coverage --verbose --testTimeout 30000 ./test-integration/",
|
|
8
11
|
"lint": "eslint .",
|
|
9
12
|
"lint:fix": "prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\"",
|
|
10
13
|
"postinstall": "husky install",
|
|
11
14
|
"prepublishOnly": "pinst --disable",
|
|
12
|
-
"postpublish": "pinst --enable"
|
|
15
|
+
"postpublish": "pinst --enable",
|
|
16
|
+
"prepare": "node -e \"try { (await import('husky')).default() } catch (e) { if (e.code !== 'ERR_MODULE_NOT_FOUND') throw e }\" --input-type module"
|
|
13
17
|
},
|
|
14
18
|
"types": "dist/lib/index.d.ts",
|
|
15
19
|
"module": "dist/lib/index.js",
|
|
@@ -34,8 +38,6 @@
|
|
|
34
38
|
"@commitlint/cli": "^18.2.0",
|
|
35
39
|
"@commitlint/config-conventional": "^18.1.0",
|
|
36
40
|
"@types/jest": "^29.5.7",
|
|
37
|
-
"@types/nock": "^11.1.0",
|
|
38
|
-
"@types/node": "^20.8.10",
|
|
39
41
|
"@typescript-eslint/eslint-plugin": "^6.9.1",
|
|
40
42
|
"@typescript-eslint/parser": "^6.9.1",
|
|
41
43
|
"eslint": "^8.52.0",
|
|
@@ -43,19 +45,22 @@
|
|
|
43
45
|
"eslint-plugin-import": "^2.29.0",
|
|
44
46
|
"eslint-plugin-n": "^16.2.0",
|
|
45
47
|
"eslint-plugin-promise": "^6.1.1",
|
|
46
|
-
"husky": "^
|
|
48
|
+
"husky": "^9.0.11",
|
|
47
49
|
"jest": "^29.7.0",
|
|
48
|
-
"nock": "^
|
|
50
|
+
"nock": "^14.0.0-beta.5",
|
|
49
51
|
"pinst": "^3.0.0",
|
|
50
52
|
"prettier": "3.0.3",
|
|
51
53
|
"ts-jest": "^29.1.1",
|
|
52
|
-
"
|
|
54
|
+
"ts-node": "^10.9.2",
|
|
55
|
+
"typescript": "^5.2.2",
|
|
56
|
+
"zod": "^3.22.4",
|
|
57
|
+
"zod-to-ts": "^1.2.0"
|
|
53
58
|
},
|
|
54
59
|
"bugs": {
|
|
55
60
|
"url": "https://github.com/artaio/arta-node-api/issues"
|
|
56
61
|
},
|
|
57
62
|
"engines": {
|
|
58
|
-
"node": ">=
|
|
63
|
+
"node": ">=18.x"
|
|
59
64
|
},
|
|
60
65
|
"license": "MIT"
|
|
61
66
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var zod_to_ts_1 = require("zod-to-ts");
|
|
4
|
+
var _1 = require(".");
|
|
5
|
+
var generate = function (schema, identifier) {
|
|
6
|
+
var node = (0, zod_to_ts_1.zodToTs)(schema, identifier).node;
|
|
7
|
+
var typeAlias = (0, zod_to_ts_1.createTypeAlias)(node, identifier);
|
|
8
|
+
console.log('export ' + (0, zod_to_ts_1.printNode)(typeAlias));
|
|
9
|
+
};
|
|
10
|
+
generate(_1.attatchmentSchema, 'Attachment');
|
|
11
|
+
generate(_1.requestSchema, 'QuoteRequest');
|
|
12
|
+
generate(_1.keySchema, 'Key');
|
|
13
|
+
generate(_1.shipmentSchema, 'Shipment');
|
|
14
|
+
generate(_1.emailRuleSchema, 'EmailRule');
|
|
15
|
+
generate(_1.emailSubscriptionSchema, 'EmailSubscription');
|
|
16
|
+
generate(_1.hostedSessionSchema, 'HostedSession');
|
|
17
|
+
generate(_1.invoicePaymentSchema, 'InvoicePayment');
|
|
18
|
+
generate(_1.invoiceSchema, 'Invoice');
|
|
19
|
+
generate(_1.logSchema, 'Log');
|
|
20
|
+
generate(_1.organizationSchema, 'Organization');
|
|
21
|
+
generate(_1.paymentSchema, 'Payment');
|
|
22
|
+
generate(_1.carrierSchema, 'Carrier');
|
|
23
|
+
generate(_1.trackingEventSchema, 'TrackingEvent');
|
|
24
|
+
generate(_1.trackingSchema, 'Tracking');
|
|
25
|
+
generate(_1.uploadSchema, 'Upload');
|
|
26
|
+
generate(_1.webhookDeliverySchema, 'WebhookDelivery');
|
|
27
|
+
generate(_1.webhookSchema, 'Webhook');
|
|
28
|
+
generate(_1.artaServiceSchema, 'ArtaService');
|
|
29
|
+
generate(_1.disqualificationSchema, 'Disqualification');
|
|
30
|
+
generate(_1.detailsSchema, 'Detail');
|
|
31
|
+
generate(_1.additionalServiceSchema, 'AdditionalService');
|
|
32
|
+
generate(_1.supportedCurrencySchema, 'SupportedCurrency');
|
|
33
|
+
generate(_1.artaLocationSchema, 'ArtaLocation');
|
|
34
|
+
generate(_1.insuranceSchema, 'Insurance');
|
|
35
|
+
generate(_1.artaObjectSchema, 'ArtaObject');
|
|
36
|
+
generate(_1.quoteTypeSchema, 'QuoteType');
|
|
37
|
+
generate(_1.contactSchema, 'Contact');
|
|
38
|
+
generate(_1.shipmentExceptionStatusSchema, 'ShipmentExceptionStatus');
|
|
39
|
+
generate(_1.packageStatusSechema, 'PackageStatus');
|
|
40
|
+
generate(_1.packageSchema, 'Package');
|
|
41
|
+
generate(_1.shipmentExceptionTypeIdSchema, 'ShipmentExceptionTypeId');
|
|
42
|
+
generate(_1.shipmentExceptionSchema, 'ShipmentException');
|
|
43
|
+
generate(_1.shipmentScheduleSchema, 'ShipmentSchedule');
|
|
44
|
+
generate(_1.shipmentTrackingSchema, 'ShipmentTracking');
|
|
45
|
+
generate(_1.insurancePolicySchema, 'InsurancePolicy');
|
|
46
|
+
generate(_1.quoteSchema, 'Quote');
|
|
47
|
+
generate(_1.requestListItemSchema, 'QuoteRequestListItem');
|
|
48
|
+
generate(_1.emailNotificationIdSchema, 'EmailNotificationId');
|
|
49
|
+
generate(_1.recipientSchema, 'Recipient');
|
|
50
|
+
generate(_1.mimeTypeSchema, 'ArtaMimeType');
|
|
51
|
+
generate(_1.documentTypeSchema, 'ArtaDocumentType');
|