@artaio/node-api 1.0.0 → 1.1.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 CHANGED
@@ -20,24 +20,28 @@ $ npm install @artaio/node-api
20
20
 
21
21
  ### 2. Use it to interact with our API in pure JS
22
22
  ```js
23
+ // With top level async/await
23
24
  const { Arta } = require('@artaio/node-api');
24
25
  const arta = new Arta('<YOUR_API_TOKEN>');
25
26
 
26
- const { items } = arta.webhooks.list();
27
+ const { items } = await arta.webhooks.list();
27
28
  const myHook = items[0];
28
29
 
29
- myHook.ping().then(console.log);
30
+ const pingResult = await myHook.ping();
31
+ console.log(pingResult);
30
32
  ```
31
33
 
32
34
  ### 3. Use it to interact with our API in TS
33
35
  ```ts
34
- import { Arta, Webhook } from '@artaio/node-api';
36
+ // With top level async/await
37
+ import { Arta, type Webhook } from '@artaio/node-api';
35
38
  const arta: Arta = new Arta('<YOUR_API_TOKEN>');
36
39
 
37
- const { items } = arta.webhooks.list();
40
+ const { items } = await arta.webhooks.list();
38
41
  const myHook: Webhook = items[0];
39
42
 
40
- myHook.ping().then(console.log);
43
+ const pingResult = await myHook.ping();
44
+ console.log(pingResult);
41
45
  ```
42
46
 
43
47
  ## Environment
@@ -165,6 +165,7 @@ export type Shipment = {
165
165
  estimated_city?: string | undefined;
166
166
  };
167
167
  eei_form_status?: (("pending" | "cleared" | "approved" | "rejected" | "submitted") | null) | undefined;
168
+ eei_form_url?: (string | null) | undefined;
168
169
  emissions?: (number | null) | undefined;
169
170
  emissions_unit?: (string | null) | undefined;
170
171
  exceptions?: ({
package/dist/lib/utils.js CHANGED
@@ -11,13 +11,14 @@ var __assign = (this && this.__assign) || function () {
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.parseService = exports.convertDatesToUtc = exports.createDateAsUTC = void 0;
14
+ exports.parseService = void 0;
15
+ exports.createDateAsUTC = createDateAsUTC;
16
+ exports.convertDatesToUtc = convertDatesToUtc;
15
17
  function createDateAsUTC(dateStr) {
16
18
  var date = new Date(dateStr);
17
19
  var timestamp = Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
18
20
  return new Date(timestamp);
19
21
  }
20
- exports.createDateAsUTC = createDateAsUTC;
21
22
  function convertDatesToUtc(artaResponse) {
22
23
  return __assign(__assign({}, artaResponse), { created_at: artaResponse.created_at
23
24
  ? createDateAsUTC(artaResponse.created_at)
@@ -25,7 +26,6 @@ function convertDatesToUtc(artaResponse) {
25
26
  ? createDateAsUTC(artaResponse.updated_at)
26
27
  : undefined });
27
28
  }
28
- exports.convertDatesToUtc = convertDatesToUtc;
29
29
  var parseService = function (s) {
30
30
  s.amount = Number(s.amount);
31
31
  if (s.included_services) {
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artaio/node-api",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
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",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artaio/node-api",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
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",
@@ -1 +0,0 @@
1
- export {};
@@ -1,51 +0,0 @@
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');