@artaio/node-api 1.7.0 → 1.9.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.
@@ -16,6 +16,8 @@ import { WebhookDeliveriesEndpoint } from './endpoint/webhookDeliveries';
16
16
  import { WebhooksEndpoint } from './endpoint/webhooks';
17
17
  import { TrackingsEndpoint } from './endpoint/trackings';
18
18
  import { QuoteRequestsEndpoint } from './endpoint/requests';
19
+ import { SelfShipCollectionAvailabilityChecksEndpoint } from './endpoint/selfShipCollectionAvailabilityChecks';
20
+ import { SelfShipCollectionsEndpoint } from './endpoint/selfShipCollections';
19
21
  import { ShipmentsEndpoint } from './endpoint/shipments';
20
22
  import { TagsEndpoint } from './endpoint/tags';
21
23
  export interface ArtaConfig {
@@ -39,6 +41,8 @@ export declare class Arta {
39
41
  organizations: OrganizationsEndpoint;
40
42
  payments: PaymentsEndpoint;
41
43
  requests: QuoteRequestsEndpoint;
44
+ self_ship_collection_availability_checks: SelfShipCollectionAvailabilityChecksEndpoint;
45
+ self_ship_collections: SelfShipCollectionsEndpoint;
42
46
  shipments: ShipmentsEndpoint;
43
47
  tags: TagsEndpoint;
44
48
  trackings: TrackingsEndpoint;
package/dist/lib/arta.js CHANGED
@@ -21,6 +21,8 @@ var webhookDeliveries_1 = require("./endpoint/webhookDeliveries");
21
21
  var webhooks_1 = require("./endpoint/webhooks");
22
22
  var trackings_1 = require("./endpoint/trackings");
23
23
  var requests_1 = require("./endpoint/requests");
24
+ var selfShipCollectionAvailabilityChecks_1 = require("./endpoint/selfShipCollectionAvailabilityChecks");
25
+ var selfShipCollections_1 = require("./endpoint/selfShipCollections");
24
26
  var shipments_1 = require("./endpoint/shipments");
25
27
  var tags_1 = require("./endpoint/tags");
26
28
  var defaultConfig = {
@@ -49,6 +51,9 @@ var Arta = /** @class */ (function () {
49
51
  this.organizations = new organization_1.OrganizationsEndpoint(this.artaClient);
50
52
  this.payments = new payments_1.PaymentsEndpoint(this.artaClient);
51
53
  this.requests = new requests_1.QuoteRequestsEndpoint(this.artaClient);
54
+ this.self_ship_collection_availability_checks =
55
+ new selfShipCollectionAvailabilityChecks_1.SelfShipCollectionAvailabilityChecksEndpoint(this.artaClient);
56
+ this.self_ship_collections = new selfShipCollections_1.SelfShipCollectionsEndpoint(this.artaClient);
52
57
  this.shipments = new shipments_1.ShipmentsEndpoint(this.artaClient);
53
58
  this.tags = new tags_1.TagsEndpoint(this.artaClient);
54
59
  this.trackings = new trackings_1.TrackingsEndpoint(this.artaClient);
@@ -0,0 +1,28 @@
1
+ import type { RestClient } from '../net/RestClient';
2
+ import type { SelfShipCollectionAvailabilityCheck } from '../types';
3
+ export interface SelfShipCollectionAvailabilityCheckCreateBody {
4
+ location: {
5
+ address_line_1: string;
6
+ address_line_2?: string | null;
7
+ city: string;
8
+ region: string;
9
+ postal_code: string;
10
+ country: string;
11
+ close_time: string;
12
+ };
13
+ service: {
14
+ carrier: 'fedex';
15
+ code: 'express' | 'ground';
16
+ route: 'domestic' | 'international';
17
+ };
18
+ collection_date: string;
19
+ }
20
+ export interface SelfShipCollectionAvailabilityCheckCreate {
21
+ self_ship_collection_availability_check: SelfShipCollectionAvailabilityCheckCreateBody;
22
+ }
23
+ export declare class SelfShipCollectionAvailabilityChecksEndpoint {
24
+ private readonly artaClient;
25
+ private readonly path;
26
+ constructor(artaClient: RestClient);
27
+ create(payload: SelfShipCollectionAvailabilityCheckCreateBody, auth?: string): Promise<SelfShipCollectionAvailabilityCheck>;
28
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.SelfShipCollectionAvailabilityChecksEndpoint = void 0;
40
+ var SelfShipCollectionAvailabilityChecksEndpoint = /** @class */ (function () {
41
+ function SelfShipCollectionAvailabilityChecksEndpoint(artaClient) {
42
+ this.artaClient = artaClient;
43
+ this.path = '/self_ship_collection_availability_checks';
44
+ }
45
+ SelfShipCollectionAvailabilityChecksEndpoint.prototype.create = function (payload, auth) {
46
+ return __awaiter(this, void 0, void 0, function () {
47
+ return __generator(this, function (_a) {
48
+ return [2 /*return*/, this.artaClient.post(this.path, { self_ship_collection_availability_check: payload }, auth)];
49
+ });
50
+ });
51
+ };
52
+ return SelfShipCollectionAvailabilityChecksEndpoint;
53
+ }());
54
+ exports.SelfShipCollectionAvailabilityChecksEndpoint = SelfShipCollectionAvailabilityChecksEndpoint;
@@ -0,0 +1,41 @@
1
+ import type { ArtaID } from '../ArtaClient';
2
+ import type { RestClient } from '../net/RestClient';
3
+ import type { Page } from '../pagination';
4
+ import type { SelfShipCollection } from '../types';
5
+ export interface SelfShipCollectionCreateBody {
6
+ location: {
7
+ address_line_1: string;
8
+ address_line_2?: string | null;
9
+ city: string;
10
+ region: string;
11
+ postal_code: string;
12
+ country: string;
13
+ close_time: string;
14
+ package_location: 'front' | 'none' | 'rear' | 'side';
15
+ contact: {
16
+ name: string;
17
+ phone_number: string;
18
+ email_address: string;
19
+ };
20
+ };
21
+ service: {
22
+ carrier: 'fedex';
23
+ code: 'express' | 'ground';
24
+ route: 'domestic' | 'international';
25
+ };
26
+ collection_date: string;
27
+ collection_time: string;
28
+ }
29
+ export interface SelfShipCollectionCreate {
30
+ self_ship_collection: SelfShipCollectionCreateBody;
31
+ }
32
+ export declare class SelfShipCollectionsEndpoint {
33
+ private readonly artaClient;
34
+ private readonly defaultEndpoint;
35
+ private readonly path;
36
+ constructor(artaClient: RestClient);
37
+ getById(id: ArtaID, auth?: string): Promise<SelfShipCollection>;
38
+ list(page?: number, pageSize?: number, auth?: string): Promise<Page<SelfShipCollection>>;
39
+ listAll(auth?: string): AsyncGenerator<SelfShipCollection>;
40
+ create(payload: SelfShipCollectionCreateBody, auth?: string): Promise<SelfShipCollection>;
41
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SelfShipCollectionsEndpoint = void 0;
4
+ var endpoint_1 = require("./endpoint");
5
+ var SelfShipCollectionsEndpoint = /** @class */ (function () {
6
+ function SelfShipCollectionsEndpoint(artaClient) {
7
+ this.artaClient = artaClient;
8
+ this.path = '/self_ship_collections';
9
+ this.defaultEndpoint = new endpoint_1.DefaultEndpoint(this.path, this.artaClient);
10
+ }
11
+ SelfShipCollectionsEndpoint.prototype.getById = function (id, auth) {
12
+ return this.defaultEndpoint.getById(id, auth);
13
+ };
14
+ SelfShipCollectionsEndpoint.prototype.list = function (page, pageSize, auth) {
15
+ if (page === void 0) { page = 1; }
16
+ if (pageSize === void 0) { pageSize = 20; }
17
+ return this.defaultEndpoint.list({ page: page, page_size: pageSize }, auth);
18
+ };
19
+ SelfShipCollectionsEndpoint.prototype.listAll = function (auth) {
20
+ return this.defaultEndpoint.listAll(auth);
21
+ };
22
+ SelfShipCollectionsEndpoint.prototype.create = function (payload, auth) {
23
+ return this.defaultEndpoint.create({ self_ship_collection: payload }, auth);
24
+ };
25
+ return SelfShipCollectionsEndpoint;
26
+ }());
27
+ exports.SelfShipCollectionsEndpoint = SelfShipCollectionsEndpoint;
@@ -5,6 +5,9 @@ import type { ShipmentsSearch } from '../search';
5
5
  import type { NullableString } from '../utils';
6
6
  import type { Shipment } from '../types';
7
7
  export interface ShipmentCreateBody {
8
+ exceptions?: Array<{
9
+ type: 'label_hold';
10
+ }>;
8
11
  internal_reference?: NullableString;
9
12
  public_reference?: NullableString;
10
13
  quote_id: number;
@@ -10,4 +10,6 @@ export * from './MetadataTypes';
10
10
  export { UploadCreateBody } from './endpoint/uploads';
11
11
  export { ExtendedWebhook as Webhook, WebhookCreate } from './endpoint/webhooks';
12
12
  export { QuoteRequestCreateBody, UpdateRequestsContactsBody, CustomQuotePayload, } from './endpoint/requests';
13
+ export { SelfShipCollectionAvailabilityCheckCreateBody } from './endpoint/selfShipCollectionAvailabilityChecks';
14
+ export { SelfShipCollectionCreateBody } from './endpoint/selfShipCollections';
13
15
  export { ShipmentCreateBody } from './endpoint/shipments';
@@ -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;
@@ -1130,3 +1130,55 @@ export type AddressVerification = {
1130
1130
  is_residential: boolean | null;
1131
1131
  };
1132
1132
  };
1133
+ export type SelfShipCollection = {
1134
+ updated_at: Date;
1135
+ created_at: Date;
1136
+ id: string;
1137
+ status: "scheduled" | "closed" | "cancelled" | "incomplete";
1138
+ shortcode: string;
1139
+ closed_at: string | null;
1140
+ collection_date: string;
1141
+ collection_time: string;
1142
+ location: {
1143
+ address_line_1: string;
1144
+ address_line_2: string | null;
1145
+ city: string;
1146
+ region: string;
1147
+ postal_code: string;
1148
+ country: string;
1149
+ close_time: string;
1150
+ package_location: "front" | "none" | "rear" | "side";
1151
+ contact: {
1152
+ name: string;
1153
+ phone_number: string;
1154
+ email_address: string;
1155
+ };
1156
+ };
1157
+ service: {
1158
+ carrier: "fedex";
1159
+ code: "express" | "ground";
1160
+ route: "domestic" | "international";
1161
+ };
1162
+ };
1163
+ export type SelfShipCollectionAvailabilityCheck = {
1164
+ location: {
1165
+ address_line_1: string;
1166
+ address_line_2: string | null;
1167
+ city: string;
1168
+ region: string;
1169
+ postal_code: string;
1170
+ country: string;
1171
+ close_time: string;
1172
+ };
1173
+ service: {
1174
+ carrier: "fedex";
1175
+ code: "express" | "ground";
1176
+ route: "domestic" | "international";
1177
+ };
1178
+ collection_date: string;
1179
+ availabilities: {
1180
+ collection_date: string;
1181
+ collection_times: string[];
1182
+ residential_available: boolean;
1183
+ }[];
1184
+ };
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artaio/node-api",
3
- "version": "1.7.0",
3
+ "version": "1.9.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.7.0",
3
+ "version": "1.9.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",