@artaio/node-api 1.6.0 → 1.7.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.
@@ -1,4 +1,5 @@
1
1
  import type { Logger, LoggerVerbosity } from './logging';
2
+ import { AddressVerificationsEndpoint } from './endpoint/addressVerifications';
2
3
  import { AttachmentsEndpoint } from './endpoint/attachment';
3
4
  import { EmailRulesEndpoint } from './endpoint/emailRules';
4
5
  import { EmailSubscriptionsEndpoint } from './endpoint/emailSubscriptions';
@@ -25,6 +26,7 @@ export interface ArtaConfig {
25
26
  export declare class Arta {
26
27
  private readonly artaClient;
27
28
  private readonly config;
29
+ address_verifications: AddressVerificationsEndpoint;
28
30
  attachments: AttachmentsEndpoint;
29
31
  email_rules: EmailRulesEndpoint;
30
32
  email_subscriptions: EmailSubscriptionsEndpoint;
package/dist/lib/arta.js CHANGED
@@ -4,6 +4,7 @@ exports.Arta = void 0;
4
4
  var ArtaClient_1 = require("./ArtaClient");
5
5
  var logging_1 = require("./logging");
6
6
  var FetchHttpClient_1 = require("./net/FetchHttpClient");
7
+ var addressVerifications_1 = require("./endpoint/addressVerifications");
7
8
  var attachment_1 = require("./endpoint/attachment");
8
9
  var emailRules_1 = require("./endpoint/emailRules");
9
10
  var emailSubscriptions_1 = require("./endpoint/emailSubscriptions");
@@ -35,6 +36,7 @@ var Arta = /** @class */ (function () {
35
36
  apiKey: apiKey,
36
37
  host: this.config.host,
37
38
  });
39
+ this.address_verifications = new addressVerifications_1.AddressVerificationsEndpoint(this.artaClient);
38
40
  this.attachments = new attachment_1.AttachmentsEndpoint(this.artaClient);
39
41
  this.email_rules = new emailRules_1.EmailRulesEndpoint(this.artaClient);
40
42
  this.email_subscriptions = new emailSubscriptions_1.EmailSubscriptionsEndpoint(this.artaClient);
@@ -0,0 +1,30 @@
1
+ import type { ArtaID } from '../ArtaClient';
2
+ import type { RestClient } from '../net/RestClient';
3
+ import type { Page } from '../pagination';
4
+ import type { AddressVerification } from '../types';
5
+ export interface AddressVerificationCreateBodyInput {
6
+ address_line_1: string;
7
+ address_line_2?: string | null;
8
+ address_line_3?: string | null;
9
+ city?: string | null;
10
+ region?: string | null;
11
+ postal_code?: string | null;
12
+ country: string;
13
+ }
14
+ export interface AddressVerificationCreateBody {
15
+ input: AddressVerificationCreateBodyInput;
16
+ reference?: string | null;
17
+ }
18
+ export interface AddressVerificationCreate {
19
+ address_verification: AddressVerificationCreateBody;
20
+ }
21
+ export declare class AddressVerificationsEndpoint {
22
+ private readonly artaClient;
23
+ private readonly defaultEndpoint;
24
+ private readonly path;
25
+ constructor(artaClient: RestClient);
26
+ getById(id: ArtaID, auth?: string): Promise<AddressVerification>;
27
+ list(page?: number, pageSize?: number, auth?: string): Promise<Page<AddressVerification>>;
28
+ listAll(auth?: string): AsyncGenerator<AddressVerification>;
29
+ create(payload: AddressVerificationCreateBody, auth?: string): Promise<AddressVerification>;
30
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddressVerificationsEndpoint = void 0;
4
+ var endpoint_1 = require("./endpoint");
5
+ var AddressVerificationsEndpoint = /** @class */ (function () {
6
+ function AddressVerificationsEndpoint(artaClient) {
7
+ this.artaClient = artaClient;
8
+ this.path = '/address_verifications';
9
+ this.defaultEndpoint = new endpoint_1.DefaultEndpoint(this.path, this.artaClient);
10
+ }
11
+ AddressVerificationsEndpoint.prototype.getById = function (id, auth) {
12
+ return this.defaultEndpoint.getById(id, auth);
13
+ };
14
+ AddressVerificationsEndpoint.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
+ AddressVerificationsEndpoint.prototype.listAll = function (auth) {
20
+ return this.defaultEndpoint.listAll(auth);
21
+ };
22
+ AddressVerificationsEndpoint.prototype.create = function (payload, auth) {
23
+ return this.defaultEndpoint.create({ address_verification: payload }, auth);
24
+ };
25
+ return AddressVerificationsEndpoint;
26
+ }());
27
+ exports.AddressVerificationsEndpoint = AddressVerificationsEndpoint;
@@ -1,5 +1,6 @@
1
1
  export { Arta } from './arta';
2
2
  export { Logger, LoggerVerbosity } from './logging';
3
+ export { AddressVerificationCreateBody } from './endpoint/addressVerifications';
3
4
  export { AttachmentCreateBodyRequest, AttachmentCreateBodyShipment, AttachmentCreateBody, } from './endpoint/attachment';
4
5
  export { EmailRuleCreateBody } from './endpoint/emailRules';
5
6
  export { EmailSubscriptionCreateBody } from './endpoint/emailSubscriptions';
@@ -1100,3 +1100,33 @@ export type ArtaInboundObject = {
1100
1100
  value_currency?: (("CAD" | "CHF" | "EUR" | "GBP" | "HKD" | "USD") | null) | undefined;
1101
1101
  }[] | null) | undefined;
1102
1102
  };
1103
+ export type AddressVerification = {
1104
+ updated_at: Date;
1105
+ created_at: Date;
1106
+ id: string;
1107
+ shortcode: string;
1108
+ status: "success" | "partial" | "failed";
1109
+ match_level: "delivery_point" | "premise" | "thoroughfare" | "locality" | "administrative_area" | "none";
1110
+ reference: string | null;
1111
+ input: {
1112
+ address_line_1: string;
1113
+ address_line_2: string | null;
1114
+ address_line_3: string | null;
1115
+ city: string | null;
1116
+ region: string | null;
1117
+ postal_code: string | null;
1118
+ country: string;
1119
+ };
1120
+ recommendation: {
1121
+ address_line_1: string | null;
1122
+ address_line_2: string | null;
1123
+ address_line_3: string | null;
1124
+ city: string | null;
1125
+ region: string | null;
1126
+ postal_code: string | null;
1127
+ country: string | null;
1128
+ latitude: number | null;
1129
+ longitude: number | null;
1130
+ is_residential: boolean | null;
1131
+ };
1132
+ };
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artaio/node-api",
3
- "version": "1.6.0",
3
+ "version": "1.7.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.6.0",
3
+ "version": "1.7.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",