@arrowsphere/api-client 2.1.2 → 2.2.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
+ ## [2.2.0] - 2022-01-04
7
+
8
+ ### Added
9
+
10
+ - Add endpoint update seats
11
+
6
12
  ## [2.1.2] - 2022-02-01
7
13
 
8
14
  ### Changed
@@ -109,6 +109,7 @@ export declare abstract class AbstractClient {
109
109
  * @param headers - Headers to be sent in the request
110
110
  */
111
111
  protected post(payload?: Payload, parameters?: Parameters, headers?: Headers, options?: Options): Promise<AxiosResponse['data']>;
112
+ protected put(payload?: Payload, parameters?: Parameters, headers?: Headers, options?: Options): Promise<void>;
112
113
  /**
113
114
  * Generates the full url for request
114
115
  * @param parameters - Parameters to serialize
@@ -149,6 +149,12 @@ class AbstractClient {
149
149
  });
150
150
  return this.getResponse(response);
151
151
  }
152
+ async put(payload = {}, parameters = {}, headers = {}, options = {}) {
153
+ const response = await this.client.put(this.generateUrl(parameters, options), payload, {
154
+ headers: this.prepareHeaders(headers),
155
+ });
156
+ return this.getResponse(response);
157
+ }
152
158
  /**
153
159
  * Generates the full url for request
154
160
  * @param parameters - Parameters to serialize
@@ -12,6 +12,7 @@ import { OfferFindResultDataFiltersParameters, OfferFindResultDataKeywords, Offe
12
12
  import { ActionFlagsFindResultDataKeywords, ActionFlagsFindResultDataSortParameters } from './entities/offer/actionFlagsFindResult';
13
13
  import { PriceBandFindResultDataKeywords, PriceBandFindResultDataSortParameters } from './entities/offer/priceBandFindResult';
14
14
  import { GetData, LicenseGet } from './entities/getResult';
15
+ import { LicenseGetFields } from './entities/getLicense/licenseGetResult';
15
16
  /**
16
17
  * Parameters passable to the request for refining search.
17
18
  */
@@ -179,6 +180,9 @@ export declare type LicenseFindRawPayload = {
179
180
  };
180
181
  [LicenseFindParameters.DATA_HIGHLIGHT]?: boolean;
181
182
  };
183
+ export declare type UpdateSeatsData = {
184
+ [LicenseGetFields.COLUMN_SEATS]: number;
185
+ };
182
186
  export declare class LicensesClient extends AbstractClient {
183
187
  /**
184
188
  * The base path of the Licenses API
@@ -196,6 +200,10 @@ export declare class LicensesClient extends AbstractClient {
196
200
  * The path of the Configs endpoint
197
201
  */
198
202
  private CONFIGS_PATH;
203
+ /**
204
+ * The path of the Seats endpoint
205
+ */
206
+ private SEATS_PATH;
199
207
  /**
200
208
  * Returns the raw result from the find endpoint call
201
209
  *
@@ -222,4 +230,5 @@ export declare class LicensesClient extends AbstractClient {
222
230
  updateConfigRaw(reference: string, config: ConfigFindResult): Promise<ConfigFindResultData>;
223
231
  updateConfig(reference: string, config: ConfigFindResult): Promise<ConfigFindResult>;
224
232
  getLicense(licenseReference: string, parameters?: Parameters): Promise<GetData<LicenseGet>>;
233
+ updateSeats(licenseReference: string, putData: UpdateSeatsData, parameters?: Parameters): Promise<void>;
225
234
  }
@@ -8,6 +8,7 @@ const abstractClient_1 = require("../abstractClient");
8
8
  const findResult_1 = require("./entities/findResult");
9
9
  const configFindResult_1 = require("./entities/license/configFindResult");
10
10
  const getResult_1 = require("./entities/getResult");
11
+ const licenseGetResult_1 = require("./entities/getLicense/licenseGetResult");
11
12
  /**
12
13
  * Parameters passable to the request for refining search.
13
14
  */
@@ -121,6 +122,10 @@ class LicensesClient extends abstractClient_1.AbstractClient {
121
122
  * The path of the Configs endpoint
122
123
  */
123
124
  this.CONFIGS_PATH = '/configs';
125
+ /**
126
+ * The path of the Seats endpoint
127
+ */
128
+ this.SEATS_PATH = '/seats';
124
129
  }
125
130
  /**
126
131
  * Returns the raw result from the find endpoint call
@@ -222,6 +227,10 @@ class LicensesClient extends abstractClient_1.AbstractClient {
222
227
  this.path = licenseReference;
223
228
  return new getResult_1.GetResult(await this.get(parameters)).toJSON();
224
229
  }
230
+ updateSeats(licenseReference, putData, parameters = {}) {
231
+ this.path = licenseReference + this.SEATS_PATH;
232
+ return this.put(putData, parameters);
233
+ }
225
234
  }
226
235
  exports.LicensesClient = LicensesClient;
227
236
  //# sourceMappingURL=licensesClient.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.1.2",
7
+ "version": "2.2.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",