@arrowsphere/api-client 2.5.0 → 2.8.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.
Files changed (45) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/build/abstractClient.js +2 -2
  3. package/build/abstractGraphQLClient.d.ts +27 -0
  4. package/build/abstractGraphQLClient.js +57 -0
  5. package/build/catalog/catalogGraphQLClient.d.ts +17 -0
  6. package/build/catalog/catalogGraphQLClient.js +28 -0
  7. package/build/catalog/index.d.ts +2 -0
  8. package/build/catalog/index.js +15 -0
  9. package/build/catalog/types/catalogGraphQLTypes.d.ts +224 -0
  10. package/build/catalog/types/catalogGraphQLTypes.js +3 -0
  11. package/build/customers/customersClient.d.ts +10 -0
  12. package/build/customers/customersClient.js +21 -0
  13. package/build/customers/entities/customers/contact/contact.d.ts +28 -0
  14. package/build/customers/entities/customers/contact/contact.js +77 -0
  15. package/build/customers/entities/customers/customer.d.ts +72 -0
  16. package/build/customers/entities/customers/customer.js +175 -0
  17. package/build/customers/entities/customers/details/details.d.ts +28 -0
  18. package/build/customers/entities/customers/details/details.js +75 -0
  19. package/build/customers/entities/dataCustomers.d.ts +14 -0
  20. package/build/customers/entities/dataCustomers.js +41 -0
  21. package/build/customers/index.d.ts +5 -0
  22. package/build/customers/index.js +18 -0
  23. package/build/exception/entityValidationException.d.ts +3 -1
  24. package/build/exception/entityValidationException.js +3 -1
  25. package/build/exception/notFoundException.d.ts +3 -1
  26. package/build/exception/notFoundException.js +3 -1
  27. package/build/exception/publicApiClientException.d.ts +3 -1
  28. package/build/exception/publicApiClientException.js +3 -1
  29. package/build/{licenses/entities/getResult.d.ts → getResult.d.ts} +7 -3
  30. package/build/{licenses/entities/getResult.js → getResult.js} +16 -5
  31. package/build/index.d.ts +5 -0
  32. package/build/index.js +5 -0
  33. package/build/licenses/entities/getLicense/licenseGetResult.d.ts +12 -0
  34. package/build/licenses/entities/getLicense/licenseGetResult.js +30 -2
  35. package/build/licenses/index.d.ts +0 -1
  36. package/build/licenses/index.js +0 -1
  37. package/build/licenses/licensesClient.d.ts +9 -1
  38. package/build/licenses/licensesClient.js +9 -1
  39. package/build/pagination.d.ts +28 -0
  40. package/build/pagination.js +75 -0
  41. package/build/publicApiClient.d.ts +6 -0
  42. package/build/publicApiClient.js +10 -0
  43. package/build/publicGraphQLClient.d.ts +5 -0
  44. package/build/publicGraphQLClient.js +12 -0
  45. package/package.json +3 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,27 @@
3
3
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4
4
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
5
 
6
+ ## [2.8.0] - 2022-03-03
7
+
8
+ ### Added
9
+
10
+ - Add endpoint graphQL
11
+
12
+ ## [2.7.0] - 2022-03-03
13
+
14
+ ### Added
15
+
16
+ - Update object license for getLicense endpoint
17
+ - Add endpoint update license friendlyName
18
+
19
+ ## [2.6.0] - 2022-02-22
20
+
21
+ ### Added
22
+
23
+ - Add endpoint get customers
24
+ - Move file GetResult to use it with all endpoint
25
+ - Update GetResult class to add pagination field
26
+
6
27
  ## [2.5.0] - 2022-02-14
7
28
 
8
29
  ### Added
@@ -121,10 +121,10 @@ class AbstractClient {
121
121
  getResponse(response) {
122
122
  const statusCode = response.status;
123
123
  if (statusCode === 404) {
124
- throw new exception_1.NotFoundException(`Resource not found on URL ${this.getUrl()}`);
124
+ throw new exception_1.NotFoundException(`Resource not found on URL ${this.getUrl()}`, response.data.error, statusCode);
125
125
  }
126
126
  if (statusCode >= 400 && statusCode <= 599) {
127
- throw new exception_1.PublicApiClientException(`Error: status code: ${statusCode}. URL: ${this.getUrl()}`);
127
+ throw new exception_1.PublicApiClientException(`Error: status code: ${statusCode}. URL: ${this.getUrl()}`, response.data.error, statusCode);
128
128
  }
129
129
  return response.data;
130
130
  }
@@ -0,0 +1,27 @@
1
+ import { GraphQLClient } from 'graphql-request';
2
+ import * as Dom from 'graphql-request/dist/types.dom';
3
+ import { Options } from './abstractClient';
4
+ import { GetProductsType } from './catalog';
5
+ export declare type GraphQLResponseTypes = GetProductsType;
6
+ export declare abstract class AbstractGraphQLClient {
7
+ /**
8
+ * Base path for HTTP calls
9
+ */
10
+ protected basePath: string;
11
+ /**
12
+ * Current path for HTTP calls
13
+ */
14
+ protected path: string;
15
+ protected client: GraphQLClient;
16
+ protected url: string;
17
+ protected token: string;
18
+ protected optionsHeader?: Dom.RequestInit['headers'];
19
+ protected options: Options;
20
+ private getClient;
21
+ setToken(apiKey: string): this;
22
+ setUrl(url: string): this;
23
+ setOptionsHeader(options: Dom.RequestInit['headers']): this;
24
+ setOptions(options: Options): this;
25
+ protected post(query: string): Promise<GraphQLResponseTypes>;
26
+ protected generateUrl(): string;
27
+ }
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AbstractGraphQLClient = void 0;
7
+ const graphql_request_1 = require("graphql-request");
8
+ const url_1 = require("url");
9
+ const path_1 = __importDefault(require("path"));
10
+ class AbstractGraphQLClient {
11
+ constructor() {
12
+ /**
13
+ * Base path for HTTP calls
14
+ */
15
+ this.basePath = '';
16
+ /**
17
+ * Current path for HTTP calls
18
+ */
19
+ this.path = '';
20
+ this.url = '';
21
+ this.token = '';
22
+ this.options = {};
23
+ }
24
+ getClient() {
25
+ this.client = new graphql_request_1.GraphQLClient(this.generateUrl());
26
+ return this;
27
+ }
28
+ setToken(apiKey) {
29
+ this.token = apiKey;
30
+ return this;
31
+ }
32
+ setUrl(url) {
33
+ this.url = url;
34
+ return this;
35
+ }
36
+ setOptionsHeader(options) {
37
+ this.optionsHeader = options;
38
+ return this;
39
+ }
40
+ setOptions(options) {
41
+ this.options = options;
42
+ return this;
43
+ }
44
+ async post(query) {
45
+ this.getClient().client.setHeaders({
46
+ authorization: this.token,
47
+ ...this.optionsHeader,
48
+ });
49
+ return await this.client.request(query);
50
+ }
51
+ generateUrl() {
52
+ const url = new url_1.URL(`${this.options.isAdmin ? path_1.default.join('admin', this.basePath) : this.basePath}${this.path}`, this.url);
53
+ return url.toString();
54
+ }
55
+ }
56
+ exports.AbstractGraphQLClient = AbstractGraphQLClient;
57
+ //# sourceMappingURL=abstractGraphQLClient.js.map
@@ -0,0 +1,17 @@
1
+ import { AbstractGraphQLClient } from '../abstractGraphQLClient';
2
+ import { GetProductsType } from './types/catalogGraphQLTypes';
3
+ export declare class CatalogGraphQLClient extends AbstractGraphQLClient {
4
+ /**
5
+ * The base path of the Catalog API
6
+ */
7
+ private ROOT_PATH;
8
+ /**
9
+ * The base path of the API
10
+ */
11
+ protected basePath: string;
12
+ /**
13
+ * The Path of graphql catalog API
14
+ */
15
+ private GRAPHQL;
16
+ find(request: string): Promise<GetProductsType>;
17
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CatalogGraphQLClient = void 0;
4
+ const abstractGraphQLClient_1 = require("../abstractGraphQLClient");
5
+ // import { inspect } from 'util';
6
+ class CatalogGraphQLClient extends abstractGraphQLClient_1.AbstractGraphQLClient {
7
+ constructor() {
8
+ super(...arguments);
9
+ /**
10
+ * The base path of the Catalog API
11
+ */
12
+ this.ROOT_PATH = 'catalog/';
13
+ /**
14
+ * The base path of the API
15
+ */
16
+ this.basePath = this.ROOT_PATH;
17
+ /**
18
+ * The Path of graphql catalog API
19
+ */
20
+ this.GRAPHQL = 'graphql';
21
+ }
22
+ async find(request) {
23
+ this.path = this.GRAPHQL;
24
+ return await this.post(request);
25
+ }
26
+ }
27
+ exports.CatalogGraphQLClient = CatalogGraphQLClient;
28
+ //# sourceMappingURL=catalogGraphQLClient.js.map
@@ -0,0 +1,2 @@
1
+ export * from './types/catalogGraphQLTypes';
2
+ export * from './catalogGraphQLClient';
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./types/catalogGraphQLTypes"), exports);
14
+ __exportStar(require("./catalogGraphQLClient"), exports);
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,224 @@
1
+ export declare type GetProductsType = {
2
+ getProducts?: PaginatedProductsType;
3
+ };
4
+ export declare type PaginatedProductsType = {
5
+ filters?: Array<FiltersType>;
6
+ pagination?: PaginationType;
7
+ products?: Array<ProductType>;
8
+ topOffers?: Array<ProductType>;
9
+ };
10
+ export declare type FiltersType = {
11
+ name?: string;
12
+ values?: FiltersValuesType;
13
+ };
14
+ export declare type FiltersValuesType = {
15
+ value?: string;
16
+ count?: number;
17
+ };
18
+ export declare type PaginationType = {
19
+ perPage?: number;
20
+ currentPage?: number;
21
+ totalPage?: number;
22
+ total?: number;
23
+ next?: string;
24
+ previous?: string;
25
+ };
26
+ export declare type ProductType = {
27
+ id?: string;
28
+ identifiers?: IdentifiersType;
29
+ name?: string;
30
+ classification?: string;
31
+ arrowCategories?: Array<string>;
32
+ arrowSubCategories?: Array<string>;
33
+ licenseAgreementType?: string;
34
+ family?: FamilyType;
35
+ isAddon?: boolean;
36
+ hasAddons?: boolean;
37
+ actionFlags?: ActionFlagsType;
38
+ addonPrimaries?: Array<IdentifiersType>;
39
+ conversionOfferPrimaries?: Array<IdentifiersType>;
40
+ baseOfferPrimaries?: Array<IdentifiersType>;
41
+ assets?: AssetsType;
42
+ environmentAvailability?: string;
43
+ marketplace?: string;
44
+ isEnabled?: boolean;
45
+ isTrial?: boolean;
46
+ isIndirectBusiness?: boolean;
47
+ lastUpdate?: string;
48
+ marketingText?: MarketingTextType;
49
+ vendorOfferUrl?: string;
50
+ serviceDescription?: string;
51
+ eula?: string;
52
+ endCustomerEula?: string;
53
+ endCustomerRequirements?: string;
54
+ endCustomerFeatures?: string;
55
+ xspUrl?: string;
56
+ saleConstraints?: SaleConstraintsType;
57
+ vendor?: VendorType;
58
+ program?: ProgramType;
59
+ weightTopSales?: number;
60
+ weightForced?: number;
61
+ priceBand?: Array<PriceBandType>;
62
+ defaultPriceBand?: PriceBandType;
63
+ relatedOffers?: Array<RelatedOfferType>;
64
+ resellers?: OfferResellersType;
65
+ scope?: string;
66
+ };
67
+ export declare type IdentifiersType = {
68
+ arrowsphere?: ArrowsphereIdentifierType;
69
+ vendor?: VendorIdentifierType;
70
+ };
71
+ export declare type ArrowsphereIdentifierType = {
72
+ sku?: string;
73
+ skuXsp?: string;
74
+ skuXac?: string;
75
+ orderableSku?: string;
76
+ };
77
+ export declare type VendorIdentifierType = {
78
+ name?: string;
79
+ family?: string;
80
+ offerName?: string;
81
+ sku?: string;
82
+ attributes?: AttributesType;
83
+ };
84
+ export declare type AttributesType = {
85
+ cancelSubscription?: boolean;
86
+ canSwitchAutoRenew?: boolean;
87
+ decreaseSeats?: boolean;
88
+ increaseSeats?: boolean;
89
+ partIdentifier?: string;
90
+ periodicity?: number;
91
+ planId?: string;
92
+ productId?: string;
93
+ productSku?: string;
94
+ reactivateSubscription?: boolean;
95
+ suspendSubscription?: boolean;
96
+ term?: number;
97
+ unitType?: string;
98
+ };
99
+ export declare type FamilyType = {
100
+ id?: string;
101
+ name?: string;
102
+ };
103
+ export declare type ActionFlagsType = {
104
+ isAutoRenew?: boolean;
105
+ isManualProvisioning?: boolean;
106
+ renewalSku?: string;
107
+ };
108
+ export declare type AssetsType = {
109
+ featurePictureUrl?: string;
110
+ mainLogoUrl?: string;
111
+ pictureUrl?: string;
112
+ squareLogoUrl?: string;
113
+ };
114
+ export declare type MarketingTextType = {
115
+ overviewDescription?: string;
116
+ featuresShort?: string;
117
+ featuresFull?: string;
118
+ features?: string;
119
+ };
120
+ export declare type SaleConstraintsType = {
121
+ customerQualifications?: Array<string>;
122
+ resellerQualifications?: Array<string>;
123
+ minQuantity?: number;
124
+ maxQuantity?: number;
125
+ maxSubscriptionConstraint?: string;
126
+ maxSubscriptionPerCustomer?: number;
127
+ saleGroup?: string;
128
+ requiredAttributes?: Array<string>;
129
+ };
130
+ export declare type VendorType = {
131
+ name?: string;
132
+ };
133
+ export declare type ProgramType = {
134
+ isEnabled?: boolean;
135
+ legacyCode?: string;
136
+ names?: ProgramNameType;
137
+ };
138
+ export declare type ProgramNameType = {
139
+ full?: string;
140
+ };
141
+ export declare type PriceBandType = {
142
+ actionFlags?: PriceBandActionFlagsType;
143
+ attributes?: Array<AttributeType>;
144
+ billing?: BillingType;
145
+ currency?: string;
146
+ dynamicAttributes?: DynamicAttributesType;
147
+ family?: FamilyType;
148
+ identifiers?: PriceBandIdentifiersType;
149
+ isEnabled?: boolean;
150
+ marketplace?: string;
151
+ name?: string;
152
+ orderingType?: string;
153
+ prices?: PricesType;
154
+ saleConstraints?: PriceBandSaleConstraintsType;
155
+ uom?: UomType;
156
+ };
157
+ export declare type PriceBandActionFlagsType = {
158
+ canBeCancelled?: boolean;
159
+ canBeReactivated?: boolean;
160
+ canBeSuspended?: boolean;
161
+ canDecreaseSeats?: boolean;
162
+ canIncreaseSeats?: boolean;
163
+ };
164
+ export declare type AttributeType = {
165
+ name?: string;
166
+ value?: string;
167
+ };
168
+ export declare type BillingType = {
169
+ cycle?: number;
170
+ term?: number;
171
+ type?: string;
172
+ };
173
+ export declare type DynamicAttributesType = {
174
+ diskSize?: string;
175
+ ram?: string;
176
+ region?: string;
177
+ vCpu?: string;
178
+ reservationsAutofitGroup?: string;
179
+ acu?: string;
180
+ marketSegment?: string;
181
+ version?: string;
182
+ metric?: string;
183
+ };
184
+ export declare type PriceBandIdentifiersType = {
185
+ arrowsphere?: PriceBandArrowsphereIdentifierType;
186
+ erp?: ErpIdentifierType;
187
+ vendor?: PriceBandVendorIdentifierType;
188
+ };
189
+ export declare type PriceBandArrowsphereIdentifierType = {
190
+ sku?: string;
191
+ };
192
+ export declare type ErpIdentifierType = {
193
+ sku?: string;
194
+ };
195
+ export declare type PriceBandVendorIdentifierType = {
196
+ purchasePlan?: string;
197
+ sku?: string;
198
+ };
199
+ export declare type PricesType = {
200
+ buy?: string;
201
+ sell?: string;
202
+ public?: string;
203
+ };
204
+ export declare type PriceBandSaleConstraintsType = {
205
+ availableDate?: string;
206
+ expiryDate?: string;
207
+ minQuantity?: number;
208
+ maxQuantity?: number;
209
+ };
210
+ export declare type UomType = {
211
+ quantity?: number;
212
+ type?: string;
213
+ };
214
+ export declare type RelatedOfferType = {
215
+ vendor?: string;
216
+ sku?: string;
217
+ };
218
+ export declare type OfferResellersType = {
219
+ owner?: ResellerType;
220
+ viewers?: Array<ResellerType>;
221
+ };
222
+ export declare type ResellerType = {
223
+ xspRef?: string;
224
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=catalogGraphQLTypes.js.map
@@ -0,0 +1,10 @@
1
+ import { AbstractClient, Parameters } from '../abstractClient';
2
+ import { GetResult } from '../getResult';
3
+ import { DataCustomers } from './entities/dataCustomers';
4
+ export declare class CustomersClient extends AbstractClient {
5
+ /**
6
+ * The base path of the Customers API
7
+ */
8
+ private ROOT_PATH;
9
+ getCustomers(parameters?: Parameters): Promise<GetResult<DataCustomers>>;
10
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustomersClient = void 0;
4
+ const abstractClient_1 = require("../abstractClient");
5
+ const getResult_1 = require("../getResult");
6
+ const dataCustomers_1 = require("./entities/dataCustomers");
7
+ class CustomersClient extends abstractClient_1.AbstractClient {
8
+ constructor() {
9
+ super(...arguments);
10
+ /**
11
+ * The base path of the Customers API
12
+ */
13
+ this.ROOT_PATH = '/customers';
14
+ }
15
+ async getCustomers(parameters = {}) {
16
+ this.path = this.ROOT_PATH;
17
+ return new getResult_1.GetResult(dataCustomers_1.DataCustomers, await this.get(parameters));
18
+ }
19
+ }
20
+ exports.CustomersClient = CustomersClient;
21
+ //# sourceMappingURL=customersClient.js.map
@@ -0,0 +1,28 @@
1
+ import { AbstractEntity } from '../../../../abstractEntity';
2
+ export declare enum ContactFields {
3
+ COLUMN_FIRSTNAME = "FirstName",
4
+ COLUMN_LASTNAME = "LastName",
5
+ COLUMN_EMAIL = "Email",
6
+ COLUMN_PHONE = "Phone",
7
+ COLUMN_SYNC_PARTNER_CONTACT_REF_ID = "SyncPartnerContactRefId",
8
+ COLUMN_CONTACT_PERSON_ID = "ContactPersonID"
9
+ }
10
+ export declare type ContactType = {
11
+ [ContactFields.COLUMN_FIRSTNAME]: string;
12
+ [ContactFields.COLUMN_LASTNAME]: string;
13
+ [ContactFields.COLUMN_EMAIL]: string;
14
+ [ContactFields.COLUMN_PHONE]: string;
15
+ [ContactFields.COLUMN_SYNC_PARTNER_CONTACT_REF_ID]?: number;
16
+ [ContactFields.COLUMN_CONTACT_PERSON_ID]: string;
17
+ };
18
+ export declare class Contact extends AbstractEntity<ContactType> {
19
+ #private;
20
+ constructor(getCustomersContactDataInput: ContactType);
21
+ get FirstName(): string;
22
+ get LastName(): string;
23
+ get Email(): string;
24
+ get Phone(): string;
25
+ get SyncPartnerContactRefId(): number | undefined;
26
+ get ContactPersonID(): string;
27
+ toJSON(): ContactType;
28
+ }
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
3
+ if (!privateMap.has(receiver)) {
4
+ throw new TypeError("attempted to set private field on non-instance");
5
+ }
6
+ privateMap.set(receiver, value);
7
+ return value;
8
+ };
9
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
10
+ if (!privateMap.has(receiver)) {
11
+ throw new TypeError("attempted to get private field on non-instance");
12
+ }
13
+ return privateMap.get(receiver);
14
+ };
15
+ var _firstname, _lastname, _email, _phone, _syncPartnerContactRefId, _contactPersonId;
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Contact = exports.ContactFields = void 0;
18
+ const abstractEntity_1 = require("../../../../abstractEntity");
19
+ var ContactFields;
20
+ (function (ContactFields) {
21
+ ContactFields["COLUMN_FIRSTNAME"] = "FirstName";
22
+ ContactFields["COLUMN_LASTNAME"] = "LastName";
23
+ ContactFields["COLUMN_EMAIL"] = "Email";
24
+ ContactFields["COLUMN_PHONE"] = "Phone";
25
+ ContactFields["COLUMN_SYNC_PARTNER_CONTACT_REF_ID"] = "SyncPartnerContactRefId";
26
+ ContactFields["COLUMN_CONTACT_PERSON_ID"] = "ContactPersonID";
27
+ })(ContactFields = exports.ContactFields || (exports.ContactFields = {}));
28
+ class Contact extends abstractEntity_1.AbstractEntity {
29
+ constructor(getCustomersContactDataInput) {
30
+ var _a;
31
+ super(getCustomersContactDataInput);
32
+ _firstname.set(this, void 0);
33
+ _lastname.set(this, void 0);
34
+ _email.set(this, void 0);
35
+ _phone.set(this, void 0);
36
+ _syncPartnerContactRefId.set(this, void 0);
37
+ _contactPersonId.set(this, void 0);
38
+ __classPrivateFieldSet(this, _firstname, getCustomersContactDataInput[ContactFields.COLUMN_FIRSTNAME]);
39
+ __classPrivateFieldSet(this, _lastname, getCustomersContactDataInput[ContactFields.COLUMN_LASTNAME]);
40
+ __classPrivateFieldSet(this, _email, getCustomersContactDataInput[ContactFields.COLUMN_EMAIL]);
41
+ __classPrivateFieldSet(this, _phone, getCustomersContactDataInput[ContactFields.COLUMN_PHONE]);
42
+ __classPrivateFieldSet(this, _syncPartnerContactRefId, (_a = getCustomersContactDataInput[ContactFields.COLUMN_SYNC_PARTNER_CONTACT_REF_ID]) !== null && _a !== void 0 ? _a : undefined);
43
+ __classPrivateFieldSet(this, _contactPersonId, getCustomersContactDataInput[ContactFields.COLUMN_CONTACT_PERSON_ID]);
44
+ }
45
+ get FirstName() {
46
+ return __classPrivateFieldGet(this, _firstname);
47
+ }
48
+ get LastName() {
49
+ return __classPrivateFieldGet(this, _lastname);
50
+ }
51
+ get Email() {
52
+ return __classPrivateFieldGet(this, _email);
53
+ }
54
+ get Phone() {
55
+ return __classPrivateFieldGet(this, _phone);
56
+ }
57
+ get SyncPartnerContactRefId() {
58
+ return __classPrivateFieldGet(this, _syncPartnerContactRefId);
59
+ }
60
+ get ContactPersonID() {
61
+ return __classPrivateFieldGet(this, _contactPersonId);
62
+ }
63
+ toJSON() {
64
+ return {
65
+ [ContactFields.COLUMN_FIRSTNAME]: this.FirstName,
66
+ [ContactFields.COLUMN_LASTNAME]: this.LastName,
67
+ [ContactFields.COLUMN_EMAIL]: this.Email,
68
+ [ContactFields.COLUMN_PHONE]: this.Phone,
69
+ [ContactFields.COLUMN_SYNC_PARTNER_CONTACT_REF_ID]: this
70
+ .SyncPartnerContactRefId,
71
+ [ContactFields.COLUMN_CONTACT_PERSON_ID]: this.ContactPersonID,
72
+ };
73
+ }
74
+ }
75
+ exports.Contact = Contact;
76
+ _firstname = new WeakMap(), _lastname = new WeakMap(), _email = new WeakMap(), _phone = new WeakMap(), _syncPartnerContactRefId = new WeakMap(), _contactPersonId = new WeakMap();
77
+ //# sourceMappingURL=contact.js.map
@@ -0,0 +1,72 @@
1
+ import { AbstractEntity } from '../../../abstractEntity';
2
+ import { Contact, ContactType } from './contact/contact';
3
+ import { Details, DetailsType } from './details/details';
4
+ export declare enum CustomerFields {
5
+ COLUMN_REFERENCE = "Reference",
6
+ COLUMN_COMPANY_NAME = "CompanyName",
7
+ COLUMN_PARTNER_COMPANY_ID = "PartnerCompanyId",
8
+ COLUMN_ADDRESS_LINE_1 = "AddressLine1",
9
+ COLUMN_ADDRESS_LINE_2 = "AddressLine2",
10
+ COLUMN_ZIP = "Zip",
11
+ COLUMN_CITY = "City",
12
+ COLUMN_COUNTRY_CODE = "CountryCode",
13
+ COLUMN_STATE = "State",
14
+ COLUMN_RECEPTION_PHONE = "ReceptionPhone",
15
+ COLUMN_WEBSITE_URL = "WebsiteUrl",
16
+ COLUMN_EMAIL_CONTACT = "EmailContact",
17
+ COLUMN_HEADCOUNT = "Headcount",
18
+ COLUMN_TAX_NUMBER = "TaxNumber",
19
+ COLUMN_REF = "Ref",
20
+ COLUMN_BILLING_ID = "BillingId",
21
+ COLUMN_INTERNAL_REFERENCE = "InternalReference",
22
+ COLUMN_CONTACT = "Contact",
23
+ COLUMN_DETAILS = "Details",
24
+ COLUMN_DELETED_AT = "DeletedAt"
25
+ }
26
+ export declare type CustomerType = {
27
+ [CustomerFields.COLUMN_REFERENCE]: string;
28
+ [CustomerFields.COLUMN_COMPANY_NAME]: string;
29
+ [CustomerFields.COLUMN_PARTNER_COMPANY_ID]: string;
30
+ [CustomerFields.COLUMN_ADDRESS_LINE_1]?: string;
31
+ [CustomerFields.COLUMN_ADDRESS_LINE_2]?: string;
32
+ [CustomerFields.COLUMN_ZIP]: string;
33
+ [CustomerFields.COLUMN_CITY]: string;
34
+ [CustomerFields.COLUMN_COUNTRY_CODE]: string;
35
+ [CustomerFields.COLUMN_STATE]: string;
36
+ [CustomerFields.COLUMN_RECEPTION_PHONE]: string;
37
+ [CustomerFields.COLUMN_WEBSITE_URL]: string;
38
+ [CustomerFields.COLUMN_EMAIL_CONTACT]: string;
39
+ [CustomerFields.COLUMN_HEADCOUNT]: number;
40
+ [CustomerFields.COLUMN_TAX_NUMBER]: string;
41
+ [CustomerFields.COLUMN_REF]: string;
42
+ [CustomerFields.COLUMN_BILLING_ID]: string;
43
+ [CustomerFields.COLUMN_INTERNAL_REFERENCE]: string;
44
+ [CustomerFields.COLUMN_CONTACT]: ContactType;
45
+ [CustomerFields.COLUMN_DETAILS]: DetailsType;
46
+ [CustomerFields.COLUMN_DELETED_AT]?: string | null;
47
+ };
48
+ export declare class Customer extends AbstractEntity<CustomerType> {
49
+ #private;
50
+ constructor(getCustomersDataInput: CustomerType);
51
+ get Reference(): string;
52
+ get CompanyName(): string;
53
+ get PartnerCompanyId(): string;
54
+ get AddressLine1(): string | undefined;
55
+ get AddressLine2(): string | undefined;
56
+ get Zip(): string;
57
+ get City(): string;
58
+ get CountryCode(): string;
59
+ get State(): string;
60
+ get ReceptionPhone(): string;
61
+ get WebsiteUrl(): string;
62
+ get EmailContact(): string;
63
+ get Headcount(): number;
64
+ get TaxNumber(): string;
65
+ get Ref(): string;
66
+ get BillingId(): string;
67
+ get InternalReference(): string;
68
+ get Contact(): Contact;
69
+ get Details(): Details;
70
+ get DeletedAt(): string | null | undefined;
71
+ toJSON(): CustomerType;
72
+ }