@artaio/node-api 1.9.1 → 1.11.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.
@@ -20,6 +20,7 @@ import { SelfShipCollectionAvailabilityChecksEndpoint } from './endpoint/selfShi
20
20
  import { SelfShipCollectionsEndpoint } from './endpoint/selfShipCollections';
21
21
  import { ShipmentsEndpoint } from './endpoint/shipments';
22
22
  import { TagsEndpoint } from './endpoint/tags';
23
+ import { ImportCostEstimatesEndpoint } from './endpoint/importCostEstimates';
23
24
  export interface ArtaConfig {
24
25
  host: string;
25
26
  verbosity: LoggerVerbosity;
@@ -33,6 +34,7 @@ export declare class Arta {
33
34
  email_rules: EmailRulesEndpoint;
34
35
  email_subscriptions: EmailSubscriptionsEndpoint;
35
36
  hosted_sessions: HostedSessionsEndpoint;
37
+ import_cost_estimates: ImportCostEstimatesEndpoint;
36
38
  invoice_payments: InvoicePaymentsEndpoint;
37
39
  invoices: InvoicesEndpoint;
38
40
  keys: KeysEndpoint;
package/dist/lib/arta.js CHANGED
@@ -25,6 +25,7 @@ const selfShipCollectionAvailabilityChecks_1 = require("./endpoint/selfShipColle
25
25
  const selfShipCollections_1 = require("./endpoint/selfShipCollections");
26
26
  const shipments_1 = require("./endpoint/shipments");
27
27
  const tags_1 = require("./endpoint/tags");
28
+ const importCostEstimates_1 = require("./endpoint/importCostEstimates");
28
29
  const defaultConfig = {
29
30
  host: 'api.arta.io',
30
31
  verbosity: 'ERROR',
@@ -43,6 +44,7 @@ class Arta {
43
44
  this.email_rules = new emailRules_1.EmailRulesEndpoint(this.artaClient);
44
45
  this.email_subscriptions = new emailSubscriptions_1.EmailSubscriptionsEndpoint(this.artaClient);
45
46
  this.hosted_sessions = new hostedSessions_1.HostedSessionsEndpoint(this.artaClient);
47
+ this.import_cost_estimates = new importCostEstimates_1.ImportCostEstimatesEndpoint(this.artaClient);
46
48
  this.invoice_payments = new invoicePayments_1.InvoicePaymentsEndpoint(this.artaClient);
47
49
  this.invoices = new invoices_1.InvoicesEndpoint(this.artaClient);
48
50
  this.keys = new keys_1.KeysEndpoint(this.artaClient);
@@ -10,6 +10,8 @@ export type EnrichedHostedSession = HostedSession & {
10
10
  export type HostedSessionCreateBody = {
11
11
  additional_services?: Nullable<AdditionalService[]>;
12
12
  cancel_url?: NullableString;
13
+ customs_end_use?: HostedSession['customs_end_use'];
14
+ customs_process?: HostedSession['customs_process'];
13
15
  destination?: Nullable<ArtaLocation>;
14
16
  insurance?: Nullable<Insurance>;
15
17
  internal_reference?: NullableString;
@@ -31,6 +33,8 @@ export type HostedSessionCreateBody = {
31
33
  } | {
32
34
  additional_services?: Nullable<AdditionalService[]>;
33
35
  cancel_url?: NullableString;
36
+ customs_end_use?: HostedSession['customs_end_use'];
37
+ customs_process?: HostedSession['customs_process'];
34
38
  destination: ArtaLocation;
35
39
  insurance?: Nullable<Insurance>;
36
40
  internal_reference?: NullableString;
@@ -0,0 +1,17 @@
1
+ import type { RestClient } from '../net/RestClient';
2
+ import type { Page } from '../pagination';
3
+ import type { ImportCostEstimate } from '../types';
4
+ export type ImportCostEstimateCreateBodyFromQuote = Pick<ImportCostEstimate, 'currency' | 'end_use' | 'reference'> & {
5
+ quote_id: string;
6
+ };
7
+ export type ImportCostEstimateCreateBodyDirect = Pick<ImportCostEstimate, 'currency' | 'destination' | 'end_use' | 'objects' | 'origin' | 'reference' | 'transport'>;
8
+ export type ImportCostEstimateCreateBody = ImportCostEstimateCreateBodyFromQuote | ImportCostEstimateCreateBodyDirect;
9
+ export declare class ImportCostEstimatesEndpoint {
10
+ private readonly artaClient;
11
+ private readonly defaultEndpoint;
12
+ private readonly path;
13
+ constructor(artaClient: RestClient);
14
+ getById(id: ImportCostEstimate['id'], auth?: string): Promise<ImportCostEstimate>;
15
+ list(page?: number, pageSize?: number, auth?: string): Promise<Page<ImportCostEstimate>>;
16
+ create(payload: ImportCostEstimateCreateBody, auth?: string): Promise<ImportCostEstimate>;
17
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ImportCostEstimatesEndpoint = void 0;
4
+ const endpoint_1 = require("./endpoint");
5
+ class ImportCostEstimatesEndpoint {
6
+ constructor(artaClient) {
7
+ this.artaClient = artaClient;
8
+ this.path = '/import_cost_estimates';
9
+ this.defaultEndpoint = new endpoint_1.DefaultEndpoint(this.path, this.artaClient);
10
+ }
11
+ getById(id, auth) {
12
+ return this.defaultEndpoint.getById(id, auth);
13
+ }
14
+ list(page = 1, pageSize = 20, auth) {
15
+ return this.defaultEndpoint.list({ page, page_size: pageSize }, auth);
16
+ }
17
+ create(payload, auth) {
18
+ return this.defaultEndpoint.create({ import_cost_estimate: payload }, auth);
19
+ }
20
+ }
21
+ exports.ImportCostEstimatesEndpoint = ImportCostEstimatesEndpoint;
@@ -11,6 +11,8 @@ export type EnrichRequest<T> = T & {
11
11
  export interface QuoteRequestCreateBody {
12
12
  additional_services?: Nullable<AdditionalService[]>;
13
13
  currency?: Nullable<SupportedCurrency>;
14
+ customs_end_use?: QuoteRequest['customs_end_use'];
15
+ customs_process?: QuoteRequest['customs_process'];
14
16
  destination: ArtaLocation;
15
17
  insurance?: Nullable<Insurance>;
16
18
  internal_reference?: NullableString;
@@ -5,6 +5,7 @@ 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
+ customs_process?: Shipment['customs_process'];
8
9
  exceptions?: Array<{
9
10
  type: 'label_hold';
10
11
  }>;
@@ -5,6 +5,7 @@ export { AttachmentCreateBodyRequest, AttachmentCreateBodyShipment, AttachmentCr
5
5
  export { EmailRuleCreateBody } from './endpoint/emailRules';
6
6
  export { EmailSubscriptionCreateBody } from './endpoint/emailSubscriptions';
7
7
  export { HostedSessionCreateBody } from './endpoint/hostedSessions';
8
+ export { ImportCostEstimateCreateBody, ImportCostEstimateCreateBodyDirect, ImportCostEstimateCreateBodyFromQuote, } from './endpoint/importCostEstimates';
8
9
  export { KeyCreateBody } from './endpoint/keys';
9
10
  export * from './MetadataTypes';
10
11
  export { UploadCreateBody } from './endpoint/uploads';
@@ -25,6 +25,8 @@ export type QuoteRequest = {
25
25
  missing: string[];
26
26
  ready: boolean;
27
27
  };
28
+ customs_end_use: "for_resale" | "not_for_resale";
29
+ customs_process: "ddu" | "ddp" | "ddp_optional";
28
30
  destination: {
29
31
  access_restrictions?: (("elevator_only" | "freight_elevator" | "loading_dock" | "loading_dock_low" | "low_clearance" | "non_paved" | "stairs_only" | "steep_gradient")[] | null) | undefined;
30
32
  address_line_1?: (string | null) | undefined;
@@ -190,6 +192,8 @@ export type Shipment = {
190
192
  updated_at: Date;
191
193
  created_at: Date;
192
194
  id: string;
195
+ customs_end_use?: (("for_resale" | "not_for_resale") | null) | undefined;
196
+ customs_process?: (("ddu" | "ddp" | "ddp_optional") | null) | undefined;
193
197
  destination: {
194
198
  access_restrictions?: (("elevator_only" | "freight_elevator" | "loading_dock" | "loading_dock_low" | "low_clearance" | "non_paved" | "stairs_only" | "steep_gradient")[] | null) | undefined;
195
199
  address_line_1?: (string | null) | undefined;
@@ -392,6 +396,8 @@ export type HostedSession = {
392
396
  id: number;
393
397
  additional_services?: (("assembly" | "debris_disposal" | "deinstallation" | "destination_additional_labor" | "destination_building_coi" | "destination_condition_check" | "destination_full_condition_report" | "destination_unpacking" | "double_blind_bols" | "installation" | "origin_building_coi" | "origin_condition_check" | "origin_full_condition_report" | "placement" | "signature_delivery" | "tarmac_supervision")[] | null) | undefined;
394
398
  cancel_url?: (string | null) | undefined;
399
+ customs_end_use: "for_resale" | "not_for_resale";
400
+ customs_process: "ddu" | "ddp" | "ddp_optional";
395
401
  destination?: ({
396
402
  access_restrictions?: (("elevator_only" | "freight_elevator" | "loading_dock" | "loading_dock_low" | "low_clearance" | "non_paved" | "stairs_only" | "steep_gradient")[] | null) | undefined;
397
403
  address_line_1?: (string | null) | undefined;
@@ -494,6 +500,53 @@ export type HostedSession = {
494
500
  public_instructions_confirmation?: (string | null) | undefined;
495
501
  quoting_strategy: "all_rates" | "best_rate" | "compare_carriers";
496
502
  };
503
+ export type ImportCostEstimate = {
504
+ updated_at: Date;
505
+ created_at: Date;
506
+ id: string;
507
+ currency: "CAD" | "CHF" | "EUR" | "GBP" | "HKD" | "USD";
508
+ destination: {
509
+ city?: (string | null) | undefined;
510
+ country: string;
511
+ postal_code?: (string | null) | undefined;
512
+ region?: (string | null) | undefined;
513
+ };
514
+ end_use?: (string | null) | undefined;
515
+ origin: {
516
+ country: string;
517
+ };
518
+ quote_id?: (string | null) | undefined;
519
+ reference?: (string | null) | undefined;
520
+ shortcode: string;
521
+ status: "failed" | "success";
522
+ transport: {
523
+ service_level: string;
524
+ amount: string | number;
525
+ amount_currency?: (string | null) | undefined;
526
+ };
527
+ objects: {
528
+ value: string | number;
529
+ quantity?: (number | null) | undefined;
530
+ value_currency?: (("CAD" | "CHF" | "EUR" | "GBP" | "HKD" | "USD") | null) | undefined;
531
+ hs_code: string;
532
+ reference?: (string | null) | undefined;
533
+ country_of_origin?: (string | null) | undefined;
534
+ }[];
535
+ estimate: {
536
+ line_items: {
537
+ description: string;
538
+ subtype: string;
539
+ type: string;
540
+ amount: string | number;
541
+ }[];
542
+ summary: {
543
+ ddp_service_fees: string | number;
544
+ fees: string | number;
545
+ duties: string | number;
546
+ taxes: string | number;
547
+ };
548
+ };
549
+ };
497
550
  export type InvoicePayment = {
498
551
  updated_at: Date;
499
552
  created_at: Date;
@@ -864,6 +917,8 @@ export type QuoteRequestListItem = {
864
917
  missing: string[];
865
918
  ready: boolean;
866
919
  };
920
+ customs_end_use: "for_resale" | "not_for_resale";
921
+ customs_process: "ddu" | "ddp" | "ddp_optional";
867
922
  destination: {
868
923
  access_restrictions?: (("elevator_only" | "freight_elevator" | "loading_dock" | "loading_dock_low" | "low_clearance" | "non_paved" | "stairs_only" | "steep_gradient")[] | null) | undefined;
869
924
  address_line_1?: (string | null) | undefined;
@@ -955,6 +1010,8 @@ export type InboundHostedSession = {
955
1010
  id: number;
956
1011
  additional_services?: (("assembly" | "debris_disposal" | "deinstallation" | "destination_additional_labor" | "destination_building_coi" | "destination_condition_check" | "destination_full_condition_report" | "destination_unpacking" | "double_blind_bols" | "installation" | "origin_building_coi" | "origin_condition_check" | "origin_full_condition_report" | "placement" | "signature_delivery" | "tarmac_supervision")[] | null) | undefined;
957
1012
  cancel_url?: (string | null) | undefined;
1013
+ customs_end_use: "for_resale" | "not_for_resale";
1014
+ customs_process: "ddu" | "ddp" | "ddp_optional";
958
1015
  destination: {
959
1016
  access_restrictions?: (("elevator_only" | "freight_elevator" | "loading_dock" | "loading_dock_low" | "low_clearance" | "non_paved" | "stairs_only" | "steep_gradient")[] | null) | undefined;
960
1017
  address_line_1?: (string | null) | undefined;
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artaio/node-api",
3
- "version": "1.9.1",
3
+ "version": "1.11.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.9.1",
3
+ "version": "1.11.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",