@artaio/node-api 1.9.1 → 1.10.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/dist/lib/arta.d.ts +2 -0
- package/dist/lib/arta.js +2 -0
- package/dist/lib/endpoint/importCostEstimates.d.ts +17 -0
- package/dist/lib/endpoint/importCostEstimates.js +21 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/types.d.ts +47 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/lib/arta.d.ts
CHANGED
|
@@ -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);
|
|
@@ -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;
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -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';
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -494,6 +494,53 @@ export type HostedSession = {
|
|
|
494
494
|
public_instructions_confirmation?: (string | null) | undefined;
|
|
495
495
|
quoting_strategy: "all_rates" | "best_rate" | "compare_carriers";
|
|
496
496
|
};
|
|
497
|
+
export type ImportCostEstimate = {
|
|
498
|
+
updated_at: Date;
|
|
499
|
+
created_at: Date;
|
|
500
|
+
id: string;
|
|
501
|
+
currency: "CAD" | "CHF" | "EUR" | "GBP" | "HKD" | "USD";
|
|
502
|
+
destination: {
|
|
503
|
+
city?: (string | null) | undefined;
|
|
504
|
+
country: string;
|
|
505
|
+
postal_code?: (string | null) | undefined;
|
|
506
|
+
region?: (string | null) | undefined;
|
|
507
|
+
};
|
|
508
|
+
end_use?: (string | null) | undefined;
|
|
509
|
+
origin: {
|
|
510
|
+
country: string;
|
|
511
|
+
};
|
|
512
|
+
quote_id?: (string | null) | undefined;
|
|
513
|
+
reference?: (string | null) | undefined;
|
|
514
|
+
shortcode: string;
|
|
515
|
+
status: "failed" | "success";
|
|
516
|
+
transport: {
|
|
517
|
+
service_level: string;
|
|
518
|
+
amount: string | number;
|
|
519
|
+
amount_currency?: (string | null) | undefined;
|
|
520
|
+
};
|
|
521
|
+
objects: {
|
|
522
|
+
value: string | number;
|
|
523
|
+
quantity?: (number | null) | undefined;
|
|
524
|
+
value_currency?: (("CAD" | "CHF" | "EUR" | "GBP" | "HKD" | "USD") | null) | undefined;
|
|
525
|
+
hs_code: string;
|
|
526
|
+
reference?: (string | null) | undefined;
|
|
527
|
+
country_of_origin?: (string | null) | undefined;
|
|
528
|
+
}[];
|
|
529
|
+
estimate: {
|
|
530
|
+
line_items: {
|
|
531
|
+
description: string;
|
|
532
|
+
subtype: string;
|
|
533
|
+
type: string;
|
|
534
|
+
amount: string | number;
|
|
535
|
+
}[];
|
|
536
|
+
summary: {
|
|
537
|
+
ddp_service_fees: string | number;
|
|
538
|
+
fees: string | number;
|
|
539
|
+
duties: string | number;
|
|
540
|
+
taxes: string | number;
|
|
541
|
+
};
|
|
542
|
+
};
|
|
543
|
+
};
|
|
497
544
|
export type InvoicePayment = {
|
|
498
545
|
updated_at: Date;
|
|
499
546
|
created_at: Date;
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artaio/node-api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.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.
|
|
3
|
+
"version": "1.10.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",
|