@arrowsphere/api-client 3.27.0 → 3.28.0-rc.bdj.2

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 (133) hide show
  1. package/README.md +1 -0
  2. package/build/AbstractHttpClient.d.ts +35 -0
  3. package/build/AbstractHttpClient.js +64 -0
  4. package/build/abstractClient.d.ts +2 -19
  5. package/build/abstractClient.js +3 -22
  6. package/build/abstractEntity.js +14 -16
  7. package/build/abstractGraphQLClient.d.ts +4 -16
  8. package/build/abstractGraphQLClient.js +32 -24
  9. package/build/axiosSingleton.js +2 -2
  10. package/build/campaign/entities/campaign/banners/banners.js +32 -34
  11. package/build/campaign/entities/campaign/campaign.js +51 -53
  12. package/build/campaign/entities/campaign/landingPage/landingPage.js +24 -26
  13. package/build/campaign/entities/campaign/landingPage/landingPageBody.js +35 -37
  14. package/build/campaign/entities/campaign/landingPage/landingPageFooter/landingPageFooter.js +29 -31
  15. package/build/campaign/entities/campaign/landingPage/landingPageFooter/landingPageFooterFeature.js +23 -25
  16. package/build/campaign/entities/campaign/landingPage/landingPageHeader.js +29 -31
  17. package/build/campaign/entities/campaign/rules/rules.js +29 -31
  18. package/build/campaign/entities/campaignAssets/assets/assets.js +17 -19
  19. package/build/campaign/entities/campaignAssets/campaignAssets.js +14 -16
  20. package/build/campaign/entities/v2/campaign/banner/banner.js +32 -34
  21. package/build/campaign/entities/v2/campaign/campaign.js +48 -50
  22. package/build/campaign/entities/v2/campaign/landingPage/landingPage.js +24 -26
  23. package/build/campaign/entities/v2/campaign/landingPage/landingPageFooter/landingPageFooter.js +34 -36
  24. package/build/campaign/entities/v2/campaign/landingPage/landingPageFooter/landingPageFooterFeature.js +20 -22
  25. package/build/campaign/entities/v2/campaign/landingPage/landingPageFooter/landingPageFooterFeatureItem.js +32 -34
  26. package/build/campaign/entities/v2/campaign/landingPage/landingPageHeader.js +32 -34
  27. package/build/campaign/entities/v2/campaignList.js +14 -16
  28. package/build/campaign/index.js +5 -1
  29. package/build/cart/entities/index.js +5 -1
  30. package/build/cart/entities/item.js +26 -28
  31. package/build/cart/entities/itemList.js +14 -16
  32. package/build/cart/index.js +5 -1
  33. package/build/catalog/index.js +5 -1
  34. package/build/consumption/entities/bi/consumptionBI.js +28 -30
  35. package/build/consumption/entities/bi/period/period.js +17 -19
  36. package/build/consumption/entities/bi/top/top.js +23 -25
  37. package/build/consumption/entities/consumption/consumption.js +17 -19
  38. package/build/consumption/index.js +5 -1
  39. package/build/contact/entities/contact.js +44 -46
  40. package/build/contact/entities/contactCreate.js +14 -16
  41. package/build/contact/entities/contactList.js +14 -16
  42. package/build/contact/index.js +5 -1
  43. package/build/customers/entities/customers/contact/contact.js +29 -31
  44. package/build/customers/entities/customers/customer.js +71 -73
  45. package/build/customers/entities/customers/customerContact/customerContact.js +38 -40
  46. package/build/customers/entities/customers/customerContact/customerContactList.js +14 -16
  47. package/build/customers/entities/customers/details/details.js +29 -31
  48. package/build/customers/entities/dataCustomers.js +14 -16
  49. package/build/customers/entities/dataInvitation.js +29 -31
  50. package/build/customers/entities/invitations/company/company.js +14 -16
  51. package/build/customers/entities/invitations/contact/invitationContact.js +26 -28
  52. package/build/customers/index.js +5 -1
  53. package/build/exception/exception-handlers/HandleHttpExceptionOutput.d.ts +3 -0
  54. package/build/exception/exception-handlers/HandleHttpExceptionOutput.js +3 -0
  55. package/build/exception/exception-handlers/Hooks.d.ts +3 -0
  56. package/build/exception/exception-handlers/Hooks.js +3 -0
  57. package/build/exception/exception-handlers/HttpExceptionHandler.d.ts +10 -0
  58. package/build/exception/exception-handlers/HttpExceptionHandler.js +3 -0
  59. package/build/exception/exception-handlers/index.d.ts +3 -0
  60. package/build/exception/exception-handlers/index.js +20 -0
  61. package/build/exception/index.js +5 -1
  62. package/build/general/entities/whoAmI.js +59 -61
  63. package/build/general/index.js +5 -1
  64. package/build/getResult.js +21 -23
  65. package/build/index.d.ts +1 -0
  66. package/build/index.js +6 -1
  67. package/build/licenses/entities/filterFindResult.js +17 -19
  68. package/build/licenses/entities/findResult.js +36 -38
  69. package/build/licenses/entities/getLicense/actionMessagesGetResult.js +26 -28
  70. package/build/licenses/entities/getLicense/actionsGetResult.js +41 -43
  71. package/build/licenses/entities/getLicense/buySellFindResult.js +17 -19
  72. package/build/licenses/entities/getLicense/licenseGetResult.js +105 -107
  73. package/build/licenses/entities/getLicense/licensePriceGetResult.js +20 -22
  74. package/build/licenses/entities/getLicense/orderGetResult.js +17 -19
  75. package/build/licenses/entities/getResult/getLicenseResult.js +14 -16
  76. package/build/licenses/entities/history/actionHistoryResult.js +23 -25
  77. package/build/licenses/entities/history/licenceHistoryResult.js +14 -16
  78. package/build/licenses/entities/license/activeSeatsFindResult.js +17 -19
  79. package/build/licenses/entities/license/configFindResult.js +20 -22
  80. package/build/licenses/entities/license/licenseFindResult.js +134 -136
  81. package/build/licenses/entities/license/priceFindResult.js +26 -28
  82. package/build/licenses/entities/license/warningFindResult.js +17 -19
  83. package/build/licenses/entities/offer/actionFlagsFindResult.js +20 -22
  84. package/build/licenses/entities/offer/offerFindResult.js +32 -34
  85. package/build/licenses/entities/offer/priceBandFindResult.js +35 -37
  86. package/build/licenses/entities/offer/priceband/billingFindResult.js +20 -22
  87. package/build/licenses/entities/offer/priceband/identifiers/arrowsphereFindResult.js +14 -16
  88. package/build/licenses/entities/offer/priceband/identifiersFindResult.js +14 -16
  89. package/build/licenses/entities/offer/priceband/priceBandActionFlagsFindResult.js +26 -28
  90. package/build/licenses/entities/offer/priceband/priceBandPriceFindResult.js +20 -22
  91. package/build/licenses/entities/offer/priceband/saleConstraintsFindResult.js +17 -19
  92. package/build/licenses/index.js +5 -1
  93. package/build/orders/entities/dataListOrders.js +14 -16
  94. package/build/orders/entities/orders/order.js +39 -41
  95. package/build/orders/entities/orders/partner/partner.js +17 -19
  96. package/build/orders/entities/orders/products/identifiers/productIdentifiers.js +14 -16
  97. package/build/orders/entities/orders/products/identifiers/vendor/identifiersVendor.js +14 -16
  98. package/build/orders/entities/orders/products/prices/productPrices.js +32 -34
  99. package/build/orders/entities/orders/products/products.js +56 -58
  100. package/build/orders/entities/orders/products/program/productProgram.js +14 -16
  101. package/build/orders/entities/referenceLink.js +17 -19
  102. package/build/orders/index.js +5 -1
  103. package/build/pagination.js +29 -31
  104. package/build/security/index.js +5 -1
  105. package/build/security/register/entity/registrationLink.js +14 -16
  106. package/build/security/register/index.js +5 -1
  107. package/build/security/standards/entities/checks/checks.js +17 -19
  108. package/build/security/standards/entities/checks/securityChecks.js +38 -40
  109. package/build/security/standards/entities/resources/resources.js +26 -28
  110. package/build/security/standards/entities/resources/securityResources.js +17 -19
  111. package/build/security/standards/entities/standards/securityStandards.js +29 -31
  112. package/build/security/standards/entities/standards/standards.js +17 -19
  113. package/build/security/standards/index.js +5 -1
  114. package/build/securityScore/index.d.ts +2 -0
  115. package/build/securityScore/index.js +19 -0
  116. package/build/securityScore/securityScoreGraphQLClient.d.ts +17 -0
  117. package/build/securityScore/securityScoreGraphQLClient.js +35 -0
  118. package/build/securityScore/types/queryArguments.d.ts +72 -0
  119. package/build/securityScore/types/queryArguments.js +57 -0
  120. package/build/securityScore/types/securityScoreGraphQLQueries.d.ts +43 -0
  121. package/build/securityScore/types/securityScoreGraphQLQueries.js +3 -0
  122. package/build/securityScore/types/securityScoreGraphQLTypes.d.ts +144 -0
  123. package/build/securityScore/types/securityScoreGraphQLTypes.js +3 -0
  124. package/build/shared/index.js +5 -1
  125. package/build/subscriptions/entities/subscription.js +56 -58
  126. package/build/subscriptions/entities/subscriptionsListResult.js +39 -41
  127. package/build/subscriptions/index.js +5 -1
  128. package/build/supportCenter/entities/issue/attachment.js +27 -29
  129. package/build/supportCenter/entities/issue/comment.js +29 -31
  130. package/build/supportCenter/entities/issue/issue.js +106 -108
  131. package/build/supportCenter/entities/topic.js +30 -32
  132. package/build/supportCenter/index.js +5 -1
  133. package/package.json +5 -3
package/README.md CHANGED
@@ -50,6 +50,7 @@ The output documentation should be located in the `docs/` folder, just open the
50
50
 
51
51
  - [CheckDomain](./src/general/CHECKDOMAIN.md)
52
52
  - [WhoAmI](./src/general/WHOAMI.md)
53
+ - [SecurityScore](./src/securityScore/README.md)
53
54
 
54
55
  ### Licenses
55
56
 
@@ -0,0 +1,35 @@
1
+ import { HttpExceptionHandler, HandleHttpExceptionOutput } from './exception/exception-handlers';
2
+ import { PublicApiClientException } from './exception';
3
+ export declare abstract class AbstractHttpClient {
4
+ /**
5
+ * Base path for HTTP calls
6
+ */
7
+ protected basePath: string;
8
+ /**
9
+ * Current path for HTTP calls
10
+ */
11
+ protected path: string;
12
+ /**
13
+ * Token to authenticate the user
14
+ */
15
+ protected token: string;
16
+ /**
17
+ * ArrowSphere API URL
18
+ */
19
+ protected url: string;
20
+ /**
21
+ * Http Exceptions Handlers
22
+ */
23
+ protected httpExceptionHandlers: HttpExceptionHandler[];
24
+ setToken(token: string): this;
25
+ setUrl(url: string): this;
26
+ /**
27
+ * Allow to register error/exception handler.
28
+ * Handlers can be developed in another projects as long as they respect the interface HttpExceptionHandler.
29
+ */
30
+ registerHttpExceptionHandler(handler: HttpExceptionHandler): this;
31
+ /**
32
+ * Will find appropriate ErrorHandlers and apply them to the error in order of registering.
33
+ */
34
+ protected handleError(error: PublicApiClientException): Promise<HandleHttpExceptionOutput>;
35
+ }
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AbstractHttpClient = void 0;
4
+ class AbstractHttpClient {
5
+ constructor() {
6
+ /**
7
+ * Base path for HTTP calls
8
+ */
9
+ this.basePath = '';
10
+ /**
11
+ * Current path for HTTP calls
12
+ */
13
+ this.path = '';
14
+ /**
15
+ * Token to authenticate the user
16
+ */
17
+ this.token = '';
18
+ /**
19
+ * ArrowSphere API URL
20
+ */
21
+ this.url = '';
22
+ /**
23
+ * Http Exceptions Handlers
24
+ */
25
+ this.httpExceptionHandlers = [];
26
+ }
27
+ setToken(token) {
28
+ this.token = token;
29
+ return this;
30
+ }
31
+ setUrl(url) {
32
+ this.url = url;
33
+ return this;
34
+ }
35
+ /**
36
+ * Allow to register error/exception handler.
37
+ * Handlers can be developed in another projects as long as they respect the interface HttpExceptionHandler.
38
+ */
39
+ registerHttpExceptionHandler(handler) {
40
+ this.httpExceptionHandlers.push(handler);
41
+ return this;
42
+ }
43
+ /**
44
+ * Will find appropriate ErrorHandlers and apply them to the error in order of registering.
45
+ */
46
+ async handleError(error) {
47
+ const appropriateHandlers = this.httpExceptionHandlers.filter((handler) => {
48
+ console.log('httpStatus', error.httpCode);
49
+ const res = handler.getHandledHttpStatuses().includes(error.httpCode);
50
+ return res;
51
+ });
52
+ // handle retry
53
+ const output = { mustRetry: false };
54
+ for (const handler of appropriateHandlers) {
55
+ const res = await handler.handle(error, {
56
+ setToken: this.setToken,
57
+ });
58
+ output.mustRetry = res.mustRetry;
59
+ }
60
+ return output;
61
+ }
62
+ }
63
+ exports.AbstractHttpClient = AbstractHttpClient;
64
+ //# sourceMappingURL=AbstractHttpClient.js.map
@@ -1,4 +1,5 @@
1
1
  import { AxiosInstance, AxiosResponse } from 'axios';
2
+ import { AbstractHttpClient } from './AbstractHttpClient';
2
3
  /**
3
4
  * Lists of available query parameters for the API call
4
5
  */
@@ -36,23 +37,11 @@ export declare type ConfigurationsClient = {
36
37
  export declare type ExtraInformationType = {
37
38
  [ExtraInformationFields.COLUMN_EXTRA_INFORMATION]?: Record<string, unknown>;
38
39
  };
39
- export declare abstract class AbstractClient {
40
- /**
41
- * Base path for HTTP calls
42
- */
43
- protected basePath: string;
44
- /**
45
- * Current path for HTTP calls
46
- */
47
- protected path: string;
40
+ export declare abstract class AbstractClient extends AbstractHttpClient {
48
41
  /**
49
42
  * Axios instance for client
50
43
  */
51
44
  protected client: AxiosInstance;
52
- /**
53
- * ArrowSphere API URL
54
- */
55
- protected url: string;
56
45
  /**
57
46
  * ArrowSphere API key
58
47
  */
@@ -84,12 +73,6 @@ export declare abstract class AbstractClient {
84
73
  * @returns this
85
74
  */
86
75
  setApiKey(key: string): this;
87
- /**
88
- * Sets the client ArrowSphere API url
89
- * @param url - API url
90
- * @returns this
91
- */
92
- setUrl(url: string): this;
93
76
  /**
94
77
  * Returns the API url.
95
78
  * @returns string
@@ -9,6 +9,7 @@ const querystring_1 = __importDefault(require("querystring"));
9
9
  const url_1 = require("url");
10
10
  const path_1 = __importDefault(require("path"));
11
11
  const axiosSingleton_1 = require("./axiosSingleton");
12
+ const AbstractHttpClient_1 = require("./AbstractHttpClient");
12
13
  /**
13
14
  * Lists of available query parameters for the API call
14
15
  */
@@ -27,25 +28,14 @@ var ExtraInformationFields;
27
28
  (function (ExtraInformationFields) {
28
29
  ExtraInformationFields["COLUMN_EXTRA_INFORMATION"] = "extraInformation";
29
30
  })(ExtraInformationFields = exports.ExtraInformationFields || (exports.ExtraInformationFields = {}));
30
- class AbstractClient {
31
+ class AbstractClient extends AbstractHttpClient_1.AbstractHttpClient {
31
32
  /**
32
33
  * AbstractClient constructor.
33
34
  * @returns AbstractClient
34
35
  */
35
36
  constructor(configuration) {
36
37
  var _a, _b, _c;
37
- /**
38
- * Base path for HTTP calls
39
- */
40
- this.basePath = '';
41
- /**
42
- * Current path for HTTP calls
43
- */
44
- this.path = '';
45
- /**
46
- * ArrowSphere API URL
47
- */
48
- this.url = '';
38
+ super();
49
39
  /**
50
40
  * ArrowSphere API key
51
41
  */
@@ -80,15 +70,6 @@ class AbstractClient {
80
70
  this.apiKey = key;
81
71
  return this;
82
72
  }
83
- /**
84
- * Sets the client ArrowSphere API url
85
- * @param url - API url
86
- * @returns this
87
- */
88
- setUrl(url) {
89
- this.url = url;
90
- return this;
91
- }
92
73
  /**
93
74
  * Returns the API url.
94
75
  * @returns string
@@ -1,21 +1,19 @@
1
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;
2
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
+ if (kind === "m") throw new TypeError("Private method is not writable");
4
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
8
7
  };
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);
8
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
14
12
  };
15
13
  var __importDefault = (this && this.__importDefault) || function (mod) {
16
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
17
15
  };
18
- var _entityDataInput;
16
+ var _AbstractEntity_entityDataInput;
19
17
  Object.defineProperty(exports, "__esModule", { value: true });
20
18
  exports.AbstractEntity = void 0;
21
19
  const validatorjs_1 = __importDefault(require("validatorjs"));
@@ -29,7 +27,7 @@ class AbstractEntity {
29
27
  * @param data - Data that will be used in the Entity
30
28
  */
31
29
  constructor(data) {
32
- _entityDataInput.set(this, void 0);
30
+ _AbstractEntity_entityDataInput.set(this, void 0);
33
31
  this.VALIDATION_RULES = {};
34
32
  this.VALIDATION_MESSAGES = {};
35
33
  /**
@@ -37,10 +35,10 @@ class AbstractEntity {
37
35
  */
38
36
  this.enableValidation = false;
39
37
  this.validate(data);
40
- __classPrivateFieldSet(this, _entityDataInput, data);
38
+ __classPrivateFieldSet(this, _AbstractEntity_entityDataInput, data, "f");
41
39
  }
42
40
  get entityDataInput() {
43
- return __classPrivateFieldGet(this, _entityDataInput);
41
+ return __classPrivateFieldGet(this, _AbstractEntity_entityDataInput, "f");
44
42
  }
45
43
  /**
46
44
  * Checks whether or not the entity data passes the validation rules
@@ -68,5 +66,5 @@ class AbstractEntity {
68
66
  }
69
67
  }
70
68
  exports.AbstractEntity = AbstractEntity;
71
- _entityDataInput = new WeakMap();
69
+ _AbstractEntity_entityDataInput = new WeakMap();
72
70
  //# sourceMappingURL=abstractEntity.js.map
@@ -1,27 +1,15 @@
1
1
  import { GraphQLClient } from 'graphql-request';
2
2
  import * as Dom from 'graphql-request/dist/types.dom';
3
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;
4
+ import { AbstractHttpClient } from './AbstractHttpClient';
5
+ export declare abstract class AbstractGraphQLClient extends AbstractHttpClient {
15
6
  protected client: GraphQLClient;
16
- protected url: string;
17
- protected token: string;
18
7
  protected optionsHeader?: Dom.RequestInit['headers'];
19
8
  protected options: Options;
20
9
  private getClient;
21
- setToken(apiKey: string): this;
22
- setUrl(url: string): this;
23
10
  setOptionsHeader(options: Dom.RequestInit['headers']): this;
24
11
  setOptions(options: Options): this;
25
- protected post(query: string): Promise<GraphQLResponseTypes>;
12
+ protected post<GraphQLResponseTypes>(query: string): Promise<GraphQLResponseTypes>;
26
13
  protected generateUrl(): string;
14
+ protected stringifyQuery(query: any): string;
27
15
  }
@@ -1,38 +1,42 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
4
24
  };
5
25
  Object.defineProperty(exports, "__esModule", { value: true });
6
26
  exports.AbstractGraphQLClient = void 0;
7
27
  const graphql_request_1 = require("graphql-request");
8
- const url_1 = require("url");
9
- const path_1 = __importDefault(require("path"));
10
- class AbstractGraphQLClient {
28
+ const path = __importStar(require("path"));
29
+ const json_to_graphql_query_1 = require("json-to-graphql-query");
30
+ const AbstractHttpClient_1 = require("./AbstractHttpClient");
31
+ class AbstractGraphQLClient extends AbstractHttpClient_1.AbstractHttpClient {
11
32
  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 = '';
33
+ super(...arguments);
22
34
  this.options = {};
23
35
  }
24
36
  getClient() {
25
37
  this.client = new graphql_request_1.GraphQLClient(this.generateUrl());
26
38
  return this;
27
39
  }
28
- setToken(apiKey) {
29
- this.token = apiKey;
30
- return this;
31
- }
32
- setUrl(url) {
33
- this.url = url;
34
- return this;
35
- }
36
40
  setOptionsHeader(options) {
37
41
  this.optionsHeader = options;
38
42
  return this;
@@ -49,9 +53,13 @@ class AbstractGraphQLClient {
49
53
  return await this.client.request(query);
50
54
  }
51
55
  generateUrl() {
52
- const url = new url_1.URL(`${this.options.isAdmin ? path_1.default.join('admin', this.basePath) : this.basePath}${this.path}`, this.url);
56
+ const url = new URL(`${this.options.isAdmin ? path.join('admin', this.basePath) : this.basePath}${this.path}`, this.url);
53
57
  return url.toString();
54
58
  }
59
+ stringifyQuery(query) {
60
+ const graphqlQuery = (0, json_to_graphql_query_1.jsonToGraphQLQuery)(query);
61
+ return `{${graphqlQuery}}`;
62
+ }
55
63
  }
56
64
  exports.AbstractGraphQLClient = AbstractGraphQLClient;
57
65
  //# sourceMappingURL=abstractGraphQLClient.js.map
@@ -41,7 +41,7 @@ class AxiosSingleton {
41
41
  */
42
42
  static cleanRequestLog(request) {
43
43
  var _a;
44
- const tempRequest = lodash_1.cloneDeep(request);
44
+ const tempRequest = (0, lodash_1.cloneDeep)(request);
45
45
  // coverage bug delete undefined element
46
46
  /* istanbul ignore next */
47
47
  (_a = tempRequest.headers) === null || _a === void 0 ? true : delete _a.apiKey;
@@ -52,7 +52,7 @@ class AxiosSingleton {
52
52
  */
53
53
  static cleanResponseLog(response) {
54
54
  var _a;
55
- const tempResponse = lodash_1.cloneDeep(response);
55
+ const tempResponse = (0, lodash_1.cloneDeep)(response);
56
56
  // coverage bug delete undefined element
57
57
  /* istanbul ignore next */
58
58
  (_a = tempResponse.config.headers) === null || _a === void 0 ? true : delete _a.apiKey;
@@ -1,18 +1,16 @@
1
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;
2
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
+ if (kind === "m") throw new TypeError("Private method is not writable");
4
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
8
7
  };
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);
8
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
14
12
  };
15
- var _backgroundImageUuid, _type, _buttonPlacement, _buttonText, _text, _textColor, _backgroundColor;
13
+ var _Banners_backgroundImageUuid, _Banners_type, _Banners_buttonPlacement, _Banners_buttonText, _Banners_text, _Banners_textColor, _Banners_backgroundColor;
16
14
  Object.defineProperty(exports, "__esModule", { value: true });
17
15
  exports.Banners = exports.BannersFields = void 0;
18
16
  const abstractEntity_1 = require("../../../../abstractEntity");
@@ -29,41 +27,41 @@ var BannersFields;
29
27
  class Banners extends abstractEntity_1.AbstractEntity {
30
28
  constructor(bannerInput) {
31
29
  super(bannerInput);
32
- _backgroundImageUuid.set(this, void 0);
33
- _type.set(this, void 0);
34
- _buttonPlacement.set(this, void 0);
35
- _buttonText.set(this, void 0);
36
- _text.set(this, void 0);
37
- _textColor.set(this, void 0);
38
- _backgroundColor.set(this, void 0);
39
- __classPrivateFieldSet(this, _backgroundImageUuid, bannerInput[BannersFields.COLUMN_BACKGROUND_IMAGE_UUID]);
40
- __classPrivateFieldSet(this, _type, bannerInput[BannersFields.COLUMN_TYPE]);
41
- __classPrivateFieldSet(this, _buttonPlacement, bannerInput[BannersFields.COLUMN_BUTTON_PLACEMENT]);
42
- __classPrivateFieldSet(this, _buttonText, bannerInput[BannersFields.COLUMN_BUTTON_TEXT]);
43
- __classPrivateFieldSet(this, _text, bannerInput[BannersFields.COLUMN_TEXT]);
44
- __classPrivateFieldSet(this, _textColor, bannerInput[BannersFields.COLUMN_TEXT_COLOR]);
45
- __classPrivateFieldSet(this, _backgroundColor, bannerInput[BannersFields.COLUMN_BACKGROUND_COLOR]);
30
+ _Banners_backgroundImageUuid.set(this, void 0);
31
+ _Banners_type.set(this, void 0);
32
+ _Banners_buttonPlacement.set(this, void 0);
33
+ _Banners_buttonText.set(this, void 0);
34
+ _Banners_text.set(this, void 0);
35
+ _Banners_textColor.set(this, void 0);
36
+ _Banners_backgroundColor.set(this, void 0);
37
+ __classPrivateFieldSet(this, _Banners_backgroundImageUuid, bannerInput[BannersFields.COLUMN_BACKGROUND_IMAGE_UUID], "f");
38
+ __classPrivateFieldSet(this, _Banners_type, bannerInput[BannersFields.COLUMN_TYPE], "f");
39
+ __classPrivateFieldSet(this, _Banners_buttonPlacement, bannerInput[BannersFields.COLUMN_BUTTON_PLACEMENT], "f");
40
+ __classPrivateFieldSet(this, _Banners_buttonText, bannerInput[BannersFields.COLUMN_BUTTON_TEXT], "f");
41
+ __classPrivateFieldSet(this, _Banners_text, bannerInput[BannersFields.COLUMN_TEXT], "f");
42
+ __classPrivateFieldSet(this, _Banners_textColor, bannerInput[BannersFields.COLUMN_TEXT_COLOR], "f");
43
+ __classPrivateFieldSet(this, _Banners_backgroundColor, bannerInput[BannersFields.COLUMN_BACKGROUND_COLOR], "f");
46
44
  }
47
45
  get backgroundImageUuid() {
48
- return __classPrivateFieldGet(this, _backgroundImageUuid);
46
+ return __classPrivateFieldGet(this, _Banners_backgroundImageUuid, "f");
49
47
  }
50
48
  get backgroundColor() {
51
- return __classPrivateFieldGet(this, _backgroundColor);
49
+ return __classPrivateFieldGet(this, _Banners_backgroundColor, "f");
52
50
  }
53
51
  get type() {
54
- return __classPrivateFieldGet(this, _type);
52
+ return __classPrivateFieldGet(this, _Banners_type, "f");
55
53
  }
56
54
  get buttonPlacement() {
57
- return __classPrivateFieldGet(this, _buttonPlacement);
55
+ return __classPrivateFieldGet(this, _Banners_buttonPlacement, "f");
58
56
  }
59
57
  get buttonText() {
60
- return __classPrivateFieldGet(this, _buttonText);
58
+ return __classPrivateFieldGet(this, _Banners_buttonText, "f");
61
59
  }
62
60
  get text() {
63
- return __classPrivateFieldGet(this, _text);
61
+ return __classPrivateFieldGet(this, _Banners_text, "f");
64
62
  }
65
63
  get textColor() {
66
- return __classPrivateFieldGet(this, _textColor);
64
+ return __classPrivateFieldGet(this, _Banners_textColor, "f");
67
65
  }
68
66
  toJSON() {
69
67
  return {
@@ -78,5 +76,5 @@ class Banners extends abstractEntity_1.AbstractEntity {
78
76
  }
79
77
  }
80
78
  exports.Banners = Banners;
81
- _backgroundImageUuid = new WeakMap(), _type = new WeakMap(), _buttonPlacement = new WeakMap(), _buttonText = new WeakMap(), _text = new WeakMap(), _textColor = new WeakMap(), _backgroundColor = new WeakMap();
79
+ _Banners_backgroundImageUuid = new WeakMap(), _Banners_type = new WeakMap(), _Banners_buttonPlacement = new WeakMap(), _Banners_buttonText = new WeakMap(), _Banners_text = new WeakMap(), _Banners_textColor = new WeakMap(), _Banners_backgroundColor = new WeakMap();
82
80
  //# sourceMappingURL=banners.js.map
@@ -1,18 +1,16 @@
1
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;
2
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
+ if (kind === "m") throw new TypeError("Private method is not writable");
4
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
8
7
  };
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);
8
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
14
12
  };
15
- var _reference, _name, _category, _isActivated, _createdAt, _updatedAt, _deletedAt, _rules, _weight, _startDate, _endDate, _banners, _landingPage;
13
+ var _Campaign_reference, _Campaign_name, _Campaign_category, _Campaign_isActivated, _Campaign_createdAt, _Campaign_updatedAt, _Campaign_deletedAt, _Campaign_rules, _Campaign_weight, _Campaign_startDate, _Campaign_endDate, _Campaign_banners, _Campaign_landingPage;
16
14
  Object.defineProperty(exports, "__esModule", { value: true });
17
15
  exports.Campaign = exports.CampaignFields = void 0;
18
16
  const abstractEntity_1 = require("../../../abstractEntity");
@@ -38,73 +36,73 @@ var CampaignFields;
38
36
  class Campaign extends abstractEntity_1.AbstractEntity {
39
37
  constructor(campaignInput) {
40
38
  super(campaignInput);
41
- _reference.set(this, void 0);
42
- _name.set(this, void 0);
43
- _category.set(this, void 0);
44
- _isActivated.set(this, void 0);
45
- _createdAt.set(this, void 0);
46
- _updatedAt.set(this, void 0);
47
- _deletedAt.set(this, void 0);
48
- _rules.set(this, void 0);
49
- _weight.set(this, void 0);
50
- _startDate.set(this, void 0);
51
- _endDate.set(this, void 0);
52
- _banners.set(this, void 0);
53
- _landingPage.set(this, void 0);
54
- __classPrivateFieldSet(this, _reference, campaignInput[CampaignFields.COLUMN_REFERENCE]);
55
- __classPrivateFieldSet(this, _name, campaignInput[CampaignFields.COLUMN_NAME]);
56
- __classPrivateFieldSet(this, _category, campaignInput[CampaignFields.COLUMN_CATEGORY]);
57
- __classPrivateFieldSet(this, _isActivated, campaignInput[CampaignFields.COLUMN_IS_ACTIVATED]);
58
- __classPrivateFieldSet(this, _createdAt, campaignInput[CampaignFields.COLUMN_CREATED_AT]);
59
- __classPrivateFieldSet(this, _updatedAt, campaignInput[CampaignFields.COLUMN_UPDATED_AT]);
60
- __classPrivateFieldSet(this, _deletedAt, campaignInput[CampaignFields.COLUMN_DELETED_AT]);
61
- __classPrivateFieldSet(this, _rules, campaignInput[CampaignFields.COLUMN_RULES]
39
+ _Campaign_reference.set(this, void 0);
40
+ _Campaign_name.set(this, void 0);
41
+ _Campaign_category.set(this, void 0);
42
+ _Campaign_isActivated.set(this, void 0);
43
+ _Campaign_createdAt.set(this, void 0);
44
+ _Campaign_updatedAt.set(this, void 0);
45
+ _Campaign_deletedAt.set(this, void 0);
46
+ _Campaign_rules.set(this, void 0);
47
+ _Campaign_weight.set(this, void 0);
48
+ _Campaign_startDate.set(this, void 0);
49
+ _Campaign_endDate.set(this, void 0);
50
+ _Campaign_banners.set(this, void 0);
51
+ _Campaign_landingPage.set(this, void 0);
52
+ __classPrivateFieldSet(this, _Campaign_reference, campaignInput[CampaignFields.COLUMN_REFERENCE], "f");
53
+ __classPrivateFieldSet(this, _Campaign_name, campaignInput[CampaignFields.COLUMN_NAME], "f");
54
+ __classPrivateFieldSet(this, _Campaign_category, campaignInput[CampaignFields.COLUMN_CATEGORY], "f");
55
+ __classPrivateFieldSet(this, _Campaign_isActivated, campaignInput[CampaignFields.COLUMN_IS_ACTIVATED], "f");
56
+ __classPrivateFieldSet(this, _Campaign_createdAt, campaignInput[CampaignFields.COLUMN_CREATED_AT], "f");
57
+ __classPrivateFieldSet(this, _Campaign_updatedAt, campaignInput[CampaignFields.COLUMN_UPDATED_AT], "f");
58
+ __classPrivateFieldSet(this, _Campaign_deletedAt, campaignInput[CampaignFields.COLUMN_DELETED_AT], "f");
59
+ __classPrivateFieldSet(this, _Campaign_rules, campaignInput[CampaignFields.COLUMN_RULES]
62
60
  ? new rules_1.Rules(campaignInput[CampaignFields.COLUMN_RULES])
63
- : undefined);
64
- __classPrivateFieldSet(this, _weight, campaignInput[CampaignFields.COLUMN_WEIGHT]);
65
- __classPrivateFieldSet(this, _startDate, campaignInput[CampaignFields.COLUMN_START_DATE]);
66
- __classPrivateFieldSet(this, _endDate, campaignInput[CampaignFields.COLUMN_END_DATE]);
67
- __classPrivateFieldSet(this, _banners, campaignInput[CampaignFields.COLUMN_BANNERS].map((banner) => new banners_1.Banners(banner)));
68
- __classPrivateFieldSet(this, _landingPage, new landingPage_1.LandingPage(campaignInput[CampaignFields.COLUMN_LANDING_PAGE]));
61
+ : undefined, "f");
62
+ __classPrivateFieldSet(this, _Campaign_weight, campaignInput[CampaignFields.COLUMN_WEIGHT], "f");
63
+ __classPrivateFieldSet(this, _Campaign_startDate, campaignInput[CampaignFields.COLUMN_START_DATE], "f");
64
+ __classPrivateFieldSet(this, _Campaign_endDate, campaignInput[CampaignFields.COLUMN_END_DATE], "f");
65
+ __classPrivateFieldSet(this, _Campaign_banners, campaignInput[CampaignFields.COLUMN_BANNERS].map((banner) => new banners_1.Banners(banner)), "f");
66
+ __classPrivateFieldSet(this, _Campaign_landingPage, new landingPage_1.LandingPage(campaignInput[CampaignFields.COLUMN_LANDING_PAGE]), "f");
69
67
  }
70
68
  get reference() {
71
- return __classPrivateFieldGet(this, _reference);
69
+ return __classPrivateFieldGet(this, _Campaign_reference, "f");
72
70
  }
73
71
  get name() {
74
- return __classPrivateFieldGet(this, _name);
72
+ return __classPrivateFieldGet(this, _Campaign_name, "f");
75
73
  }
76
74
  get category() {
77
- return __classPrivateFieldGet(this, _category);
75
+ return __classPrivateFieldGet(this, _Campaign_category, "f");
78
76
  }
79
77
  get isActivated() {
80
- return __classPrivateFieldGet(this, _isActivated);
78
+ return __classPrivateFieldGet(this, _Campaign_isActivated, "f");
81
79
  }
82
80
  get createdAt() {
83
- return __classPrivateFieldGet(this, _createdAt);
81
+ return __classPrivateFieldGet(this, _Campaign_createdAt, "f");
84
82
  }
85
83
  get updatedAt() {
86
- return __classPrivateFieldGet(this, _updatedAt);
84
+ return __classPrivateFieldGet(this, _Campaign_updatedAt, "f");
87
85
  }
88
86
  get deletedAt() {
89
- return __classPrivateFieldGet(this, _deletedAt);
87
+ return __classPrivateFieldGet(this, _Campaign_deletedAt, "f");
90
88
  }
91
89
  get rules() {
92
- return __classPrivateFieldGet(this, _rules);
90
+ return __classPrivateFieldGet(this, _Campaign_rules, "f");
93
91
  }
94
92
  get weight() {
95
- return __classPrivateFieldGet(this, _weight);
93
+ return __classPrivateFieldGet(this, _Campaign_weight, "f");
96
94
  }
97
95
  get startDate() {
98
- return __classPrivateFieldGet(this, _startDate);
96
+ return __classPrivateFieldGet(this, _Campaign_startDate, "f");
99
97
  }
100
98
  get endDate() {
101
- return __classPrivateFieldGet(this, _endDate);
99
+ return __classPrivateFieldGet(this, _Campaign_endDate, "f");
102
100
  }
103
101
  get banners() {
104
- return __classPrivateFieldGet(this, _banners);
102
+ return __classPrivateFieldGet(this, _Campaign_banners, "f");
105
103
  }
106
104
  get landingPage() {
107
- return __classPrivateFieldGet(this, _landingPage);
105
+ return __classPrivateFieldGet(this, _Campaign_landingPage, "f");
108
106
  }
109
107
  toJSON() {
110
108
  var _a;
@@ -126,5 +124,5 @@ class Campaign extends abstractEntity_1.AbstractEntity {
126
124
  }
127
125
  }
128
126
  exports.Campaign = Campaign;
129
- _reference = new WeakMap(), _name = new WeakMap(), _category = new WeakMap(), _isActivated = new WeakMap(), _createdAt = new WeakMap(), _updatedAt = new WeakMap(), _deletedAt = new WeakMap(), _rules = new WeakMap(), _weight = new WeakMap(), _startDate = new WeakMap(), _endDate = new WeakMap(), _banners = new WeakMap(), _landingPage = new WeakMap();
127
+ _Campaign_reference = new WeakMap(), _Campaign_name = new WeakMap(), _Campaign_category = new WeakMap(), _Campaign_isActivated = new WeakMap(), _Campaign_createdAt = new WeakMap(), _Campaign_updatedAt = new WeakMap(), _Campaign_deletedAt = new WeakMap(), _Campaign_rules = new WeakMap(), _Campaign_weight = new WeakMap(), _Campaign_startDate = new WeakMap(), _Campaign_endDate = new WeakMap(), _Campaign_banners = new WeakMap(), _Campaign_landingPage = new WeakMap();
130
128
  //# sourceMappingURL=campaign.js.map