@arrowsphere/api-client 3.0.0 → 3.1.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/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
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
+ ## [3.1.0] - 2022-03-21
7
+
8
+ ### Changed
9
+
10
+ - Add endpoint get customer invitation
11
+
6
12
  ## [3.0.0] - 2022-03-08
7
13
 
8
14
  ### Changed
@@ -1,10 +1,12 @@
1
1
  import { AbstractClient, Parameters } from '../abstractClient';
2
2
  import { GetResult } from '../getResult';
3
3
  import { DataCustomers } from './entities/dataCustomers';
4
+ import { DataInvitation } from './entities/dataInvitation';
4
5
  export declare class CustomersClient extends AbstractClient {
5
6
  /**
6
7
  * The base path of the Customers API
7
8
  */
8
9
  private ROOT_PATH;
9
10
  getCustomers(parameters?: Parameters): Promise<GetResult<DataCustomers>>;
11
+ getCustomerInvitation(codeInvitation: string, parameters?: Parameters): Promise<GetResult<DataInvitation>>;
10
12
  }
@@ -4,6 +4,7 @@ exports.CustomersClient = void 0;
4
4
  const abstractClient_1 = require("../abstractClient");
5
5
  const getResult_1 = require("../getResult");
6
6
  const dataCustomers_1 = require("./entities/dataCustomers");
7
+ const dataInvitation_1 = require("./entities/dataInvitation");
7
8
  class CustomersClient extends abstractClient_1.AbstractClient {
8
9
  constructor() {
9
10
  super(...arguments);
@@ -16,6 +17,10 @@ class CustomersClient extends abstractClient_1.AbstractClient {
16
17
  this.path = this.ROOT_PATH;
17
18
  return new getResult_1.GetResult(dataCustomers_1.DataCustomers, await this.get(parameters));
18
19
  }
20
+ async getCustomerInvitation(codeInvitation, parameters = {}) {
21
+ this.path = `${this.ROOT_PATH}/invitations/${codeInvitation}`;
22
+ return new getResult_1.GetResult(dataInvitation_1.DataInvitation, await this.get(parameters));
23
+ }
19
24
  }
20
25
  exports.CustomersClient = CustomersClient;
21
26
  //# sourceMappingURL=customersClient.js.map
@@ -0,0 +1,27 @@
1
+ import { AbstractEntity } from '../../abstractEntity';
2
+ import { Company, CompanyType } from './invitations/company/company';
3
+ import { InvitationContact, InvitationContactType } from './invitations/contact/invitationContact';
4
+ export declare enum DataInvitationFields {
5
+ COLUMN_CODE = "code",
6
+ COLUMN_CREATED_AT = "createdAt",
7
+ COLUMN_UPDATED_AT = "updatedAt",
8
+ COLUMN_COMPANY = "company",
9
+ COLUMN_CONTACT = "contact"
10
+ }
11
+ export declare type DataInvitationType = {
12
+ [DataInvitationFields.COLUMN_CODE]: string;
13
+ [DataInvitationFields.COLUMN_CREATED_AT]: string;
14
+ [DataInvitationFields.COLUMN_UPDATED_AT]: string;
15
+ [DataInvitationFields.COLUMN_COMPANY]: CompanyType;
16
+ [DataInvitationFields.COLUMN_CONTACT]: InvitationContactType;
17
+ };
18
+ export declare class DataInvitation extends AbstractEntity<DataInvitationType> {
19
+ #private;
20
+ constructor(getCustomerInvitationDataInput: DataInvitationType);
21
+ get code(): string;
22
+ get createdAt(): string;
23
+ get updatedAt(): string;
24
+ get company(): Company;
25
+ get contact(): InvitationContact;
26
+ toJSON(): DataInvitationType;
27
+ }
@@ -0,0 +1,70 @@
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 _code, _createdAt, _updatedAt, _company, _contact;
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.DataInvitation = exports.DataInvitationFields = void 0;
18
+ const abstractEntity_1 = require("../../abstractEntity");
19
+ const company_1 = require("./invitations/company/company");
20
+ const invitationContact_1 = require("./invitations/contact/invitationContact");
21
+ var DataInvitationFields;
22
+ (function (DataInvitationFields) {
23
+ DataInvitationFields["COLUMN_CODE"] = "code";
24
+ DataInvitationFields["COLUMN_CREATED_AT"] = "createdAt";
25
+ DataInvitationFields["COLUMN_UPDATED_AT"] = "updatedAt";
26
+ DataInvitationFields["COLUMN_COMPANY"] = "company";
27
+ DataInvitationFields["COLUMN_CONTACT"] = "contact";
28
+ })(DataInvitationFields = exports.DataInvitationFields || (exports.DataInvitationFields = {}));
29
+ class DataInvitation extends abstractEntity_1.AbstractEntity {
30
+ constructor(getCustomerInvitationDataInput) {
31
+ super(getCustomerInvitationDataInput);
32
+ _code.set(this, void 0);
33
+ _createdAt.set(this, void 0);
34
+ _updatedAt.set(this, void 0);
35
+ _company.set(this, void 0);
36
+ _contact.set(this, void 0);
37
+ __classPrivateFieldSet(this, _code, getCustomerInvitationDataInput[DataInvitationFields.COLUMN_CODE]);
38
+ __classPrivateFieldSet(this, _createdAt, getCustomerInvitationDataInput[DataInvitationFields.COLUMN_CREATED_AT]);
39
+ __classPrivateFieldSet(this, _updatedAt, getCustomerInvitationDataInput[DataInvitationFields.COLUMN_UPDATED_AT]);
40
+ __classPrivateFieldSet(this, _company, new company_1.Company(getCustomerInvitationDataInput[DataInvitationFields.COLUMN_COMPANY]));
41
+ __classPrivateFieldSet(this, _contact, new invitationContact_1.InvitationContact(getCustomerInvitationDataInput[DataInvitationFields.COLUMN_CONTACT]));
42
+ }
43
+ get code() {
44
+ return __classPrivateFieldGet(this, _code);
45
+ }
46
+ get createdAt() {
47
+ return __classPrivateFieldGet(this, _createdAt);
48
+ }
49
+ get updatedAt() {
50
+ return __classPrivateFieldGet(this, _updatedAt);
51
+ }
52
+ get company() {
53
+ return __classPrivateFieldGet(this, _company);
54
+ }
55
+ get contact() {
56
+ return __classPrivateFieldGet(this, _contact);
57
+ }
58
+ toJSON() {
59
+ return {
60
+ [DataInvitationFields.COLUMN_CODE]: this.code,
61
+ [DataInvitationFields.COLUMN_CREATED_AT]: this.createdAt,
62
+ [DataInvitationFields.COLUMN_UPDATED_AT]: this.updatedAt,
63
+ [DataInvitationFields.COLUMN_COMPANY]: this.company.toJSON(),
64
+ [DataInvitationFields.COLUMN_CONTACT]: this.contact.toJSON(),
65
+ };
66
+ }
67
+ }
68
+ exports.DataInvitation = DataInvitation;
69
+ _code = new WeakMap(), _createdAt = new WeakMap(), _updatedAt = new WeakMap(), _company = new WeakMap(), _contact = new WeakMap();
70
+ //# sourceMappingURL=dataInvitation.js.map
@@ -0,0 +1,13 @@
1
+ import { AbstractEntity } from '../../../../abstractEntity';
2
+ export declare enum CompanyFields {
3
+ COLUMN_REFERENCE = "reference"
4
+ }
5
+ export declare type CompanyType = {
6
+ [CompanyFields.COLUMN_REFERENCE]: string;
7
+ };
8
+ export declare class Company extends AbstractEntity<CompanyType> {
9
+ #private;
10
+ constructor(getCustomersCompanyDataInput: CompanyType);
11
+ get reference(): string;
12
+ toJSON(): CompanyType;
13
+ }
@@ -0,0 +1,40 @@
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 _reference;
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Company = exports.CompanyFields = void 0;
18
+ const abstractEntity_1 = require("../../../../abstractEntity");
19
+ var CompanyFields;
20
+ (function (CompanyFields) {
21
+ CompanyFields["COLUMN_REFERENCE"] = "reference";
22
+ })(CompanyFields = exports.CompanyFields || (exports.CompanyFields = {}));
23
+ class Company extends abstractEntity_1.AbstractEntity {
24
+ constructor(getCustomersCompanyDataInput) {
25
+ super(getCustomersCompanyDataInput);
26
+ _reference.set(this, void 0);
27
+ __classPrivateFieldSet(this, _reference, getCustomersCompanyDataInput[CompanyFields.COLUMN_REFERENCE]);
28
+ }
29
+ get reference() {
30
+ return __classPrivateFieldGet(this, _reference);
31
+ }
32
+ toJSON() {
33
+ return {
34
+ [CompanyFields.COLUMN_REFERENCE]: this.reference,
35
+ };
36
+ }
37
+ }
38
+ exports.Company = Company;
39
+ _reference = new WeakMap();
40
+ //# sourceMappingURL=company.js.map
@@ -0,0 +1,22 @@
1
+ import { AbstractEntity } from '../../../../abstractEntity';
2
+ export declare enum InvitationContactFields {
3
+ COLUMN_FIRSTNAME = "firstName",
4
+ COLUMN_LASTNAME = "lastName",
5
+ COLUMN_EMAIL = "email",
6
+ COLUMN_USERNAME = "username"
7
+ }
8
+ export declare type InvitationContactType = {
9
+ [InvitationContactFields.COLUMN_USERNAME]: string;
10
+ [InvitationContactFields.COLUMN_FIRSTNAME]: string;
11
+ [InvitationContactFields.COLUMN_LASTNAME]: string;
12
+ [InvitationContactFields.COLUMN_EMAIL]: string;
13
+ };
14
+ export declare class InvitationContact extends AbstractEntity<InvitationContactType> {
15
+ #private;
16
+ constructor(getCustomersContactDataInput: InvitationContactType);
17
+ get username(): string;
18
+ get firstName(): string;
19
+ get lastName(): string;
20
+ get email(): string;
21
+ toJSON(): InvitationContactType;
22
+ }
@@ -0,0 +1,61 @@
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 _username, _firstname, _lastname, _email;
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.InvitationContact = exports.InvitationContactFields = void 0;
18
+ const abstractEntity_1 = require("../../../../abstractEntity");
19
+ var InvitationContactFields;
20
+ (function (InvitationContactFields) {
21
+ InvitationContactFields["COLUMN_FIRSTNAME"] = "firstName";
22
+ InvitationContactFields["COLUMN_LASTNAME"] = "lastName";
23
+ InvitationContactFields["COLUMN_EMAIL"] = "email";
24
+ InvitationContactFields["COLUMN_USERNAME"] = "username";
25
+ })(InvitationContactFields = exports.InvitationContactFields || (exports.InvitationContactFields = {}));
26
+ class InvitationContact extends abstractEntity_1.AbstractEntity {
27
+ constructor(getCustomersContactDataInput) {
28
+ super(getCustomersContactDataInput);
29
+ _username.set(this, void 0);
30
+ _firstname.set(this, void 0);
31
+ _lastname.set(this, void 0);
32
+ _email.set(this, void 0);
33
+ __classPrivateFieldSet(this, _firstname, getCustomersContactDataInput[InvitationContactFields.COLUMN_FIRSTNAME]);
34
+ __classPrivateFieldSet(this, _username, getCustomersContactDataInput[InvitationContactFields.COLUMN_USERNAME]);
35
+ __classPrivateFieldSet(this, _lastname, getCustomersContactDataInput[InvitationContactFields.COLUMN_LASTNAME]);
36
+ __classPrivateFieldSet(this, _email, getCustomersContactDataInput[InvitationContactFields.COLUMN_EMAIL]);
37
+ }
38
+ get username() {
39
+ return __classPrivateFieldGet(this, _username);
40
+ }
41
+ get firstName() {
42
+ return __classPrivateFieldGet(this, _firstname);
43
+ }
44
+ get lastName() {
45
+ return __classPrivateFieldGet(this, _lastname);
46
+ }
47
+ get email() {
48
+ return __classPrivateFieldGet(this, _email);
49
+ }
50
+ toJSON() {
51
+ return {
52
+ [InvitationContactFields.COLUMN_USERNAME]: this.username,
53
+ [InvitationContactFields.COLUMN_FIRSTNAME]: this.firstName,
54
+ [InvitationContactFields.COLUMN_LASTNAME]: this.lastName,
55
+ [InvitationContactFields.COLUMN_EMAIL]: this.email,
56
+ };
57
+ }
58
+ }
59
+ exports.InvitationContact = InvitationContact;
60
+ _username = new WeakMap(), _firstname = new WeakMap(), _lastname = new WeakMap(), _email = new WeakMap();
61
+ //# sourceMappingURL=invitationContact.js.map
@@ -1,5 +1,8 @@
1
1
  export * from './entities/customers/contact/contact';
2
+ export * from './entities/invitations/contact/invitationContact';
2
3
  export * from './entities/customers/details/details';
4
+ export * from './entities/invitations/company/company';
3
5
  export * from './entities/customers/customer';
4
6
  export * from './entities/dataCustomers';
7
+ export * from './entities/dataInvitation';
5
8
  export * from './customersClient';
@@ -11,8 +11,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./entities/customers/contact/contact"), exports);
14
+ __exportStar(require("./entities/invitations/contact/invitationContact"), exports);
14
15
  __exportStar(require("./entities/customers/details/details"), exports);
16
+ __exportStar(require("./entities/invitations/company/company"), exports);
15
17
  __exportStar(require("./entities/customers/customer"), exports);
16
18
  __exportStar(require("./entities/dataCustomers"), exports);
19
+ __exportStar(require("./entities/dataInvitation"), exports);
17
20
  __exportStar(require("./customersClient"), exports);
18
21
  //# sourceMappingURL=index.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.0.0",
7
+ "version": "3.1.0",
8
8
  "description": "Node.js client for ArrowSphere's public API",
9
9
  "main": "build/index.js",
10
10
  "types": "build/index.d.ts",