@arrowsphere/api-client 2.7.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.
Files changed (28) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/build/abstractGraphQLClient.d.ts +27 -0
  3. package/build/abstractGraphQLClient.js +57 -0
  4. package/build/catalog/catalogGraphQLClient.d.ts +17 -0
  5. package/build/catalog/catalogGraphQLClient.js +28 -0
  6. package/build/catalog/index.d.ts +2 -0
  7. package/build/catalog/index.js +15 -0
  8. package/build/catalog/types/catalogGraphQLTypes.d.ts +224 -0
  9. package/build/catalog/types/catalogGraphQLTypes.js +3 -0
  10. package/build/customers/customersClient.d.ts +2 -0
  11. package/build/customers/customersClient.js +5 -0
  12. package/build/customers/entities/dataInvitation.d.ts +27 -0
  13. package/build/customers/entities/dataInvitation.js +70 -0
  14. package/build/customers/entities/invitations/company/company.d.ts +13 -0
  15. package/build/customers/entities/invitations/company/company.js +40 -0
  16. package/build/customers/entities/invitations/contact/invitationContact.d.ts +22 -0
  17. package/build/customers/entities/invitations/contact/invitationContact.js +61 -0
  18. package/build/customers/index.d.ts +3 -0
  19. package/build/customers/index.js +3 -0
  20. package/build/index.d.ts +3 -0
  21. package/build/index.js +3 -0
  22. package/build/licenses/entities/getLicense/licenseGetResult.d.ts +0 -3
  23. package/build/licenses/entities/getLicense/licenseGetResult.js +2 -9
  24. package/build/licenses/entities/getLicense/licensePriceGetResult.d.ts +3 -0
  25. package/build/licenses/entities/getLicense/licensePriceGetResult.js +9 -2
  26. package/build/publicGraphQLClient.d.ts +5 -0
  27. package/build/publicGraphQLClient.js +12 -0
  28. package/package.json +3 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,24 @@
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
+
12
+ ## [3.0.0] - 2022-03-08
13
+
14
+ ### Changed
15
+
16
+ - Moved the property `currency` of license from root to price object
17
+
18
+ ## [2.8.0] - 2022-03-03
19
+
20
+ ### Added
21
+
22
+ - Add endpoint graphQL
23
+
6
24
  ## [2.7.0] - 2022-03-03
7
25
 
8
26
  ### Added
@@ -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
@@ -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/build/index.d.ts CHANGED
@@ -1,6 +1,9 @@
1
1
  export * from './publicApiClient';
2
+ export * from './publicGraphQLClient';
2
3
  export * from './abstractEntity';
3
4
  export * from './abstractClient';
5
+ export * from './abstractGraphQLClient';
6
+ export * from './catalog/';
4
7
  export * from './licenses/';
5
8
  export * from './general/';
6
9
  export * from './subscriptions/';
package/build/index.js CHANGED
@@ -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("./publicApiClient"), exports);
14
+ __exportStar(require("./publicGraphQLClient"), exports);
14
15
  __exportStar(require("./abstractEntity"), exports);
15
16
  __exportStar(require("./abstractClient"), exports);
17
+ __exportStar(require("./abstractGraphQLClient"), exports);
18
+ __exportStar(require("./catalog/"), exports);
16
19
  __exportStar(require("./licenses/"), exports);
17
20
  __exportStar(require("./general/"), exports);
18
21
  __exportStar(require("./subscriptions/"), exports);
@@ -13,7 +13,6 @@ export declare enum LicenseGetFields {
13
13
  COLUMN_STATUS_CODE = "statusCode",
14
14
  COLUMN_IS_TRIAL = "isTrial",
15
15
  COLUMN_IS_ADDON = "isAddon",
16
- COLUMN_CURRENCY = "currency",
17
16
  COLUMN_SERVICE_REF = "service_ref",
18
17
  COLUMN_SKU = "sku",
19
18
  COLUMN_NAME = "name",
@@ -45,7 +44,6 @@ export declare type LicenseGetData = {
45
44
  [LicenseGetFields.COLUMN_STATUS_CODE]: number;
46
45
  [LicenseGetFields.COLUMN_IS_TRIAL]: boolean;
47
46
  [LicenseGetFields.COLUMN_IS_ADDON]: boolean;
48
- [LicenseGetFields.COLUMN_CURRENCY]: string;
49
47
  [LicenseGetFields.COLUMN_SERVICE_REF]: string;
50
48
  [LicenseGetFields.COLUMN_SKU]: string;
51
49
  [LicenseGetFields.COLUMN_NAME]: string;
@@ -79,7 +77,6 @@ export declare class LicenseGetResult extends AbstractEntity<LicenseGetData> {
79
77
  get statusCode(): number;
80
78
  get isTrial(): boolean;
81
79
  get isAddon(): boolean;
82
- get currency(): string;
83
80
  get serviceRef(): string;
84
81
  get sku(): string;
85
82
  get name(): string;
@@ -12,7 +12,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
12
12
  }
13
13
  return privateMap.get(receiver);
14
14
  };
15
- var _license_id, _parent_license_id, _friendlyName, _customer_ref, _state, _statusCode, _isTrial, _isAddon, _currency, _service_ref, _sku, _name, _seats, _activeSeats, _activation_datetime, _expiry_datetime, _autoRenew, _message, _actions, _actionMessages, _order_reference, _order, _vendor_license_id, _periodicity, _term, _category, _program, _associatedSubscriptionProgram, _price, _arrowSubCategories;
15
+ var _license_id, _parent_license_id, _friendlyName, _customer_ref, _state, _statusCode, _isTrial, _isAddon, _service_ref, _sku, _name, _seats, _activeSeats, _activation_datetime, _expiry_datetime, _autoRenew, _message, _actions, _actionMessages, _order_reference, _order, _vendor_license_id, _periodicity, _term, _category, _program, _associatedSubscriptionProgram, _price, _arrowSubCategories;
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.LicenseGetResult = exports.LicenseGetFields = void 0;
18
18
  const actionsGetResult_1 = require("./actionsGetResult");
@@ -31,7 +31,6 @@ var LicenseGetFields;
31
31
  LicenseGetFields["COLUMN_STATUS_CODE"] = "statusCode";
32
32
  LicenseGetFields["COLUMN_IS_TRIAL"] = "isTrial";
33
33
  LicenseGetFields["COLUMN_IS_ADDON"] = "isAddon";
34
- LicenseGetFields["COLUMN_CURRENCY"] = "currency";
35
34
  LicenseGetFields["COLUMN_SERVICE_REF"] = "service_ref";
36
35
  LicenseGetFields["COLUMN_SKU"] = "sku";
37
36
  LicenseGetFields["COLUMN_NAME"] = "name";
@@ -66,7 +65,6 @@ class LicenseGetResult extends abstractEntity_1.AbstractEntity {
66
65
  _statusCode.set(this, void 0);
67
66
  _isTrial.set(this, void 0);
68
67
  _isAddon.set(this, void 0);
69
- _currency.set(this, void 0);
70
68
  _service_ref.set(this, void 0);
71
69
  _sku.set(this, void 0);
72
70
  _name.set(this, void 0);
@@ -96,7 +94,6 @@ class LicenseGetResult extends abstractEntity_1.AbstractEntity {
96
94
  __classPrivateFieldSet(this, _statusCode, licenseGetDataInput[LicenseGetFields.COLUMN_STATUS_CODE]);
97
95
  __classPrivateFieldSet(this, _isTrial, licenseGetDataInput[LicenseGetFields.COLUMN_IS_TRIAL]);
98
96
  __classPrivateFieldSet(this, _isAddon, licenseGetDataInput[LicenseGetFields.COLUMN_IS_ADDON]);
99
- __classPrivateFieldSet(this, _currency, licenseGetDataInput[LicenseGetFields.COLUMN_CURRENCY]);
100
97
  __classPrivateFieldSet(this, _service_ref, licenseGetDataInput[LicenseGetFields.COLUMN_SERVICE_REF]);
101
98
  __classPrivateFieldSet(this, _sku, licenseGetDataInput[LicenseGetFields.COLUMN_SKU]);
102
99
  __classPrivateFieldSet(this, _name, licenseGetDataInput[LicenseGetFields.COLUMN_NAME]);
@@ -145,9 +142,6 @@ class LicenseGetResult extends abstractEntity_1.AbstractEntity {
145
142
  get isAddon() {
146
143
  return __classPrivateFieldGet(this, _isAddon);
147
144
  }
148
- get currency() {
149
- return __classPrivateFieldGet(this, _currency);
150
- }
151
145
  get serviceRef() {
152
146
  return __classPrivateFieldGet(this, _service_ref);
153
147
  }
@@ -222,7 +216,6 @@ class LicenseGetResult extends abstractEntity_1.AbstractEntity {
222
216
  [LicenseGetFields.COLUMN_STATUS_CODE]: this.statusCode,
223
217
  [LicenseGetFields.COLUMN_IS_TRIAL]: this.isTrial,
224
218
  [LicenseGetFields.COLUMN_IS_ADDON]: this.isAddon,
225
- [LicenseGetFields.COLUMN_CURRENCY]: this.currency,
226
219
  [LicenseGetFields.COLUMN_SERVICE_REF]: this.serviceRef,
227
220
  [LicenseGetFields.COLUMN_SKU]: this.sku,
228
221
  [LicenseGetFields.COLUMN_NAME]: this.name,
@@ -249,5 +242,5 @@ class LicenseGetResult extends abstractEntity_1.AbstractEntity {
249
242
  }
250
243
  }
251
244
  exports.LicenseGetResult = LicenseGetResult;
252
- _license_id = new WeakMap(), _parent_license_id = new WeakMap(), _friendlyName = new WeakMap(), _customer_ref = new WeakMap(), _state = new WeakMap(), _statusCode = new WeakMap(), _isTrial = new WeakMap(), _isAddon = new WeakMap(), _currency = new WeakMap(), _service_ref = new WeakMap(), _sku = new WeakMap(), _name = new WeakMap(), _seats = new WeakMap(), _activeSeats = new WeakMap(), _activation_datetime = new WeakMap(), _expiry_datetime = new WeakMap(), _autoRenew = new WeakMap(), _message = new WeakMap(), _actions = new WeakMap(), _actionMessages = new WeakMap(), _order_reference = new WeakMap(), _order = new WeakMap(), _vendor_license_id = new WeakMap(), _periodicity = new WeakMap(), _term = new WeakMap(), _category = new WeakMap(), _program = new WeakMap(), _associatedSubscriptionProgram = new WeakMap(), _price = new WeakMap(), _arrowSubCategories = new WeakMap();
245
+ _license_id = new WeakMap(), _parent_license_id = new WeakMap(), _friendlyName = new WeakMap(), _customer_ref = new WeakMap(), _state = new WeakMap(), _statusCode = new WeakMap(), _isTrial = new WeakMap(), _isAddon = new WeakMap(), _service_ref = new WeakMap(), _sku = new WeakMap(), _name = new WeakMap(), _seats = new WeakMap(), _activeSeats = new WeakMap(), _activation_datetime = new WeakMap(), _expiry_datetime = new WeakMap(), _autoRenew = new WeakMap(), _message = new WeakMap(), _actions = new WeakMap(), _actionMessages = new WeakMap(), _order_reference = new WeakMap(), _order = new WeakMap(), _vendor_license_id = new WeakMap(), _periodicity = new WeakMap(), _term = new WeakMap(), _category = new WeakMap(), _program = new WeakMap(), _associatedSubscriptionProgram = new WeakMap(), _price = new WeakMap(), _arrowSubCategories = new WeakMap();
253
246
  //# sourceMappingURL=licenseGetResult.js.map
@@ -1,16 +1,19 @@
1
1
  import { BuySellData, BuySellFindResult } from './buySellFindResult';
2
2
  import { AbstractEntity } from '../../../abstractEntity';
3
3
  export declare enum LicensePriceGetFields {
4
+ COLUMN_CURRENCY = "currency",
4
5
  COLUMN_UNIT = "unit",
5
6
  COLUMN_TOTAL = "total"
6
7
  }
7
8
  export declare type LicensePriceGetData = {
9
+ [LicensePriceGetFields.COLUMN_CURRENCY]: string;
8
10
  [LicensePriceGetFields.COLUMN_UNIT]: BuySellData;
9
11
  [LicensePriceGetFields.COLUMN_TOTAL]: BuySellData;
10
12
  };
11
13
  export declare class LicensePriceGetResult extends AbstractEntity<LicensePriceGetData> {
12
14
  #private;
13
15
  constructor(data: LicensePriceGetData);
16
+ get currency(): string;
14
17
  get unit(): BuySellFindResult;
15
18
  get total(): BuySellFindResult;
16
19
  toJSON(): LicensePriceGetData;
@@ -12,24 +12,30 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
12
12
  }
13
13
  return privateMap.get(receiver);
14
14
  };
15
- var _unit, _total;
15
+ var _currency, _unit, _total;
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.LicensePriceGetResult = exports.LicensePriceGetFields = void 0;
18
18
  const buySellFindResult_1 = require("./buySellFindResult");
19
19
  const abstractEntity_1 = require("../../../abstractEntity");
20
20
  var LicensePriceGetFields;
21
21
  (function (LicensePriceGetFields) {
22
+ LicensePriceGetFields["COLUMN_CURRENCY"] = "currency";
22
23
  LicensePriceGetFields["COLUMN_UNIT"] = "unit";
23
24
  LicensePriceGetFields["COLUMN_TOTAL"] = "total";
24
25
  })(LicensePriceGetFields = exports.LicensePriceGetFields || (exports.LicensePriceGetFields = {}));
25
26
  class LicensePriceGetResult extends abstractEntity_1.AbstractEntity {
26
27
  constructor(data) {
27
28
  super(data);
29
+ _currency.set(this, void 0);
28
30
  _unit.set(this, void 0);
29
31
  _total.set(this, void 0);
32
+ __classPrivateFieldSet(this, _currency, data[LicensePriceGetFields.COLUMN_CURRENCY]);
30
33
  __classPrivateFieldSet(this, _unit, new buySellFindResult_1.BuySellFindResult(data[LicensePriceGetFields.COLUMN_UNIT]));
31
34
  __classPrivateFieldSet(this, _total, new buySellFindResult_1.BuySellFindResult(data[LicensePriceGetFields.COLUMN_TOTAL]));
32
35
  }
36
+ get currency() {
37
+ return __classPrivateFieldGet(this, _currency);
38
+ }
33
39
  get unit() {
34
40
  return __classPrivateFieldGet(this, _unit);
35
41
  }
@@ -38,11 +44,12 @@ class LicensePriceGetResult extends abstractEntity_1.AbstractEntity {
38
44
  }
39
45
  toJSON() {
40
46
  return {
47
+ [LicensePriceGetFields.COLUMN_CURRENCY]: __classPrivateFieldGet(this, _currency),
41
48
  [LicensePriceGetFields.COLUMN_UNIT]: this.unit.toJSON(),
42
49
  [LicensePriceGetFields.COLUMN_TOTAL]: this.total.toJSON(),
43
50
  };
44
51
  }
45
52
  }
46
53
  exports.LicensePriceGetResult = LicensePriceGetResult;
47
- _unit = new WeakMap(), _total = new WeakMap();
54
+ _currency = new WeakMap(), _unit = new WeakMap(), _total = new WeakMap();
48
55
  //# sourceMappingURL=licensePriceGetResult.js.map
@@ -0,0 +1,5 @@
1
+ import { CatalogGraphQLClient } from './catalog/catalogGraphQLClient';
2
+ import { AbstractGraphQLClient } from './abstractGraphQLClient';
3
+ export declare class PublicGraphQLClient extends AbstractGraphQLClient {
4
+ getCatalogGraphQLClient(): CatalogGraphQLClient;
5
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PublicGraphQLClient = void 0;
4
+ const catalogGraphQLClient_1 = require("./catalog/catalogGraphQLClient");
5
+ const abstractGraphQLClient_1 = require("./abstractGraphQLClient");
6
+ class PublicGraphQLClient extends abstractGraphQLClient_1.AbstractGraphQLClient {
7
+ getCatalogGraphQLClient() {
8
+ return new catalogGraphQLClient_1.CatalogGraphQLClient().setUrl(this.url).setToken(this.token);
9
+ }
10
+ }
11
+ exports.PublicGraphQLClient = PublicGraphQLClient;
12
+ //# sourceMappingURL=publicGraphQLClient.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": "2.7.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",
@@ -80,6 +80,8 @@
80
80
  "dependencies": {
81
81
  "@types/validatorjs": "3.15.0",
82
82
  "axios": "0.21.1",
83
+ "graphql": "^16.3.0",
84
+ "graphql-request": "^4.0.0",
83
85
  "validatorjs": "3.22.1"
84
86
  }
85
87
  }