@arrowsphere/api-client 3.48.3 → 3.49.0-rc.bdj.1

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.
@@ -23,6 +23,69 @@ export declare type PostCustomerContactPayload = {
23
23
  [CustomerContactPayloadFields.COLUMN_TYPE]: CustomerContactTypeType;
24
24
  [CustomerContactPayloadFields.COLUMN_ROLE]: CustomerContactRoleType;
25
25
  };
26
+ export declare enum CustomerPayloadFields {
27
+ COLUMN_COMPANY_NAME = "companyName",
28
+ COLUMN_PARTNER_COMPANY_ID = "partnerCompanyId",
29
+ COLUMN_ADDRESS_LINE1 = "addressLine1",
30
+ COLUMN_ADDRESS_LINE2 = "addressLine2",
31
+ COLUMN_ADDRESS_ZIP = "zip",
32
+ COLUMN_CITY = "city",
33
+ COLUMN_COUNTRY_CODE = "countryCode",
34
+ COLUMN_STATE = "state",
35
+ COLUMN_RECEPTION_PHONE = "receptionPhone",
36
+ COLUMN_WEBSITE_URL = "websiteUrl",
37
+ COLUMN_EMAIL_CONTACT = "emailContact",
38
+ COLUMN_HEAD_COUNT = "headcount",
39
+ COLUMN_TAX_NUMBER = "taxNumber",
40
+ COLUMN_REF = "ref",
41
+ COLUMN_BILLING_ID = "billingId",
42
+ COLUMN_INTERNAL_REFERENCE = "internalReference",
43
+ COLUMN_TSE_ACCOUNT_STATUS = "tseAccountStatus",
44
+ COLUMN_ACTIVE_WITH_ARROW = "activeWithArrow",
45
+ COLUMN_CONTACT = "contact"
46
+ }
47
+ export declare type PostCustomerPayload = {
48
+ [CustomerPayloadFields.COLUMN_COMPANY_NAME]: string;
49
+ [CustomerPayloadFields.COLUMN_PARTNER_COMPANY_ID]?: string;
50
+ [CustomerPayloadFields.COLUMN_ADDRESS_LINE1]: string;
51
+ [CustomerPayloadFields.COLUMN_ADDRESS_LINE2]?: string;
52
+ [CustomerPayloadFields.COLUMN_ADDRESS_ZIP]: string;
53
+ [CustomerPayloadFields.COLUMN_CITY]: string;
54
+ [CustomerPayloadFields.COLUMN_COUNTRY_CODE]: string;
55
+ [CustomerPayloadFields.COLUMN_STATE]?: string;
56
+ [CustomerPayloadFields.COLUMN_RECEPTION_PHONE]: string;
57
+ [CustomerPayloadFields.COLUMN_WEBSITE_URL]?: string;
58
+ [CustomerPayloadFields.COLUMN_EMAIL_CONTACT]?: string;
59
+ [CustomerPayloadFields.COLUMN_HEAD_COUNT]?: number;
60
+ [CustomerPayloadFields.COLUMN_TAX_NUMBER]?: string;
61
+ [CustomerPayloadFields.COLUMN_REF]?: string;
62
+ [CustomerPayloadFields.COLUMN_BILLING_ID]?: string;
63
+ [CustomerPayloadFields.COLUMN_INTERNAL_REFERENCE]?: string;
64
+ [CustomerPayloadFields.COLUMN_TSE_ACCOUNT_STATUS]?: string;
65
+ [CustomerPayloadFields.COLUMN_ACTIVE_WITH_ARROW]?: boolean;
66
+ [CustomerPayloadFields.COLUMN_CONTACT]?: PostCustomerContactPayload;
67
+ };
68
+ export declare type PatchCustomerPayload = {
69
+ [CustomerPayloadFields.COLUMN_COMPANY_NAME]?: string;
70
+ [CustomerPayloadFields.COLUMN_PARTNER_COMPANY_ID]?: string;
71
+ [CustomerPayloadFields.COLUMN_ADDRESS_LINE1]: string;
72
+ [CustomerPayloadFields.COLUMN_ADDRESS_LINE2]?: string;
73
+ [CustomerPayloadFields.COLUMN_ADDRESS_ZIP]?: string;
74
+ [CustomerPayloadFields.COLUMN_CITY]?: string;
75
+ [CustomerPayloadFields.COLUMN_COUNTRY_CODE]?: string;
76
+ [CustomerPayloadFields.COLUMN_STATE]?: string;
77
+ [CustomerPayloadFields.COLUMN_RECEPTION_PHONE]?: string;
78
+ [CustomerPayloadFields.COLUMN_WEBSITE_URL]?: string;
79
+ [CustomerPayloadFields.COLUMN_EMAIL_CONTACT]?: string;
80
+ [CustomerPayloadFields.COLUMN_HEAD_COUNT]?: number;
81
+ [CustomerPayloadFields.COLUMN_TAX_NUMBER]?: string;
82
+ [CustomerPayloadFields.COLUMN_REF]?: string;
83
+ [CustomerPayloadFields.COLUMN_BILLING_ID]?: string;
84
+ [CustomerPayloadFields.COLUMN_INTERNAL_REFERENCE]?: string;
85
+ [CustomerPayloadFields.COLUMN_TSE_ACCOUNT_STATUS]?: string;
86
+ [CustomerPayloadFields.COLUMN_ACTIVE_WITH_ARROW]?: boolean;
87
+ [CustomerPayloadFields.COLUMN_CONTACT]?: PostCustomerContactPayload;
88
+ };
26
89
  export declare type PatchCustomerContactPayload = {
27
90
  [Property in keyof PostCustomerContactPayload]?: PostCustomerContactPayload[Property];
28
91
  };
@@ -39,4 +102,6 @@ export declare class CustomersClient extends AbstractRestfulClient {
39
102
  getCustomerContact(customerReference: string, contactReference: string, parameters?: Parameters): Promise<GetResult<CustomerContact>>;
40
103
  deleteCustomerContact(customerReference: string, contactReference: string, parameters?: Parameters): Promise<void>;
41
104
  patchCustomerContact(customerReference: string, contactReference: string, payload: PatchCustomerContactPayload, parameters?: Parameters): Promise<GetResult<CustomerContact>>;
105
+ createCustomer(payload: PostCustomerPayload, parameters?: Parameters): Promise<any>;
106
+ updateCustomer(customerReference: string, payload: PatchCustomerPayload, parameters?: Parameters): Promise<any>;
42
107
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CustomersClient = exports.CustomerContactPayloadFields = void 0;
3
+ exports.CustomersClient = exports.CustomerPayloadFields = exports.CustomerContactPayloadFields = void 0;
4
4
  const abstractRestfulClient_1 = require("../abstractRestfulClient");
5
5
  const getResult_1 = require("../getResult");
6
6
  const dataCustomers_1 = require("./entities/dataCustomers");
@@ -8,6 +8,21 @@ const dataInvitation_1 = require("./entities/dataInvitation");
8
8
  const orders_1 = require("../orders");
9
9
  const customerContactList_1 = require("./entities/customers/customerContact/customerContactList");
10
10
  const customerContact_1 = require("./entities/customers/customerContact/customerContact");
11
+ // type APIGatewayProxyResult = {
12
+ // statusCode: number;
13
+ // headers?:
14
+ // | {
15
+ // [header: string]: boolean | number | string;
16
+ // }
17
+ // | undefined;
18
+ // multiValueHeaders?:
19
+ // | {
20
+ // [header: string]: Array<boolean | number | string>;
21
+ // }
22
+ // | undefined;
23
+ // body: string;
24
+ // isBase64Encoded?: boolean | undefined;
25
+ // };
11
26
  var CustomerContactPayloadFields;
12
27
  (function (CustomerContactPayloadFields) {
13
28
  CustomerContactPayloadFields["COLUMN_FIRST_NAME"] = "firstName";
@@ -18,6 +33,28 @@ var CustomerContactPayloadFields;
18
33
  CustomerContactPayloadFields["COLUMN_TYPE"] = "type";
19
34
  CustomerContactPayloadFields["COLUMN_ROLE"] = "role";
20
35
  })(CustomerContactPayloadFields = exports.CustomerContactPayloadFields || (exports.CustomerContactPayloadFields = {}));
36
+ var CustomerPayloadFields;
37
+ (function (CustomerPayloadFields) {
38
+ CustomerPayloadFields["COLUMN_COMPANY_NAME"] = "companyName";
39
+ CustomerPayloadFields["COLUMN_PARTNER_COMPANY_ID"] = "partnerCompanyId";
40
+ CustomerPayloadFields["COLUMN_ADDRESS_LINE1"] = "addressLine1";
41
+ CustomerPayloadFields["COLUMN_ADDRESS_LINE2"] = "addressLine2";
42
+ CustomerPayloadFields["COLUMN_ADDRESS_ZIP"] = "zip";
43
+ CustomerPayloadFields["COLUMN_CITY"] = "city";
44
+ CustomerPayloadFields["COLUMN_COUNTRY_CODE"] = "countryCode";
45
+ CustomerPayloadFields["COLUMN_STATE"] = "state";
46
+ CustomerPayloadFields["COLUMN_RECEPTION_PHONE"] = "receptionPhone";
47
+ CustomerPayloadFields["COLUMN_WEBSITE_URL"] = "websiteUrl";
48
+ CustomerPayloadFields["COLUMN_EMAIL_CONTACT"] = "emailContact";
49
+ CustomerPayloadFields["COLUMN_HEAD_COUNT"] = "headcount";
50
+ CustomerPayloadFields["COLUMN_TAX_NUMBER"] = "taxNumber";
51
+ CustomerPayloadFields["COLUMN_REF"] = "ref";
52
+ CustomerPayloadFields["COLUMN_BILLING_ID"] = "billingId";
53
+ CustomerPayloadFields["COLUMN_INTERNAL_REFERENCE"] = "internalReference";
54
+ CustomerPayloadFields["COLUMN_TSE_ACCOUNT_STATUS"] = "tseAccountStatus";
55
+ CustomerPayloadFields["COLUMN_ACTIVE_WITH_ARROW"] = "activeWithArrow";
56
+ CustomerPayloadFields["COLUMN_CONTACT"] = "contact";
57
+ })(CustomerPayloadFields = exports.CustomerPayloadFields || (exports.CustomerPayloadFields = {}));
21
58
  class CustomersClient extends abstractRestfulClient_1.AbstractRestfulClient {
22
59
  constructor() {
23
60
  super(...arguments);
@@ -59,6 +96,22 @@ class CustomersClient extends abstractRestfulClient_1.AbstractRestfulClient {
59
96
  this.path = `/${customerReference}/contacts/${contactReference}`;
60
97
  return new getResult_1.GetResult(customerContact_1.CustomerContact, await this.patch(payload, parameters));
61
98
  }
99
+ async createCustomer(payload, parameters = {}) {
100
+ this.path = '';
101
+ return await this.post(payload, parameters);
102
+ // try {
103
+ // const result = await this.post(payload, parameters);
104
+ // } catch (error) {
105
+ // }
106
+ }
107
+ async updateCustomer(customerReference, payload, parameters = {}) {
108
+ this.path = `/${customerReference}`;
109
+ return await this.patch(payload, parameters);
110
+ // try {
111
+ // const result = await this.post(payload, parameters);
112
+ // } catch (error) {
113
+ // }
114
+ }
62
115
  }
63
116
  exports.CustomersClient = CustomersClient;
64
117
  //# sourceMappingURL=customersClient.js.map
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/ArrowSphere/nodejs-api-client.git"
6
6
  },
7
- "version": "3.48.3",
7
+ "version": "3.49.0-rc.bdj.1",
8
8
  "description": "Node.js client for ArrowSphere's public API",
9
9
  "main": "build/index.js",
10
10
  "types": "build/index.d.ts",