attlaz-client 1.9.0 → 1.9.1

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.
@@ -1,6 +1,7 @@
1
1
  export declare class CollectionResult<T> {
2
2
  private data;
3
+ private hasMore;
3
4
  constructor();
4
- setData(data: T[]): void;
5
+ setData(data: T[], hasMore: boolean): void;
5
6
  getData(): T[];
6
7
  }
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CollectionResult = void 0;
4
4
  class CollectionResult {
5
5
  constructor() {
6
+ this.hasMore = false;
6
7
  this.data = [];
7
8
  }
8
9
  // public static parse<T>(raw: any): DataResult<T> {
@@ -17,8 +18,9 @@ class CollectionResult {
17
18
  //
18
19
  // return result;
19
20
  // }
20
- setData(data) {
21
+ setData(data, hasMore) {
21
22
  this.data = data;
23
+ this.hasMore = hasMore;
22
24
  }
23
25
  getData() {
24
26
  return this.data;
@@ -5,6 +5,7 @@ const DataResult_1 = require("../Model/Result/DataResult");
5
5
  const CollectionResult_1 = require("../Model/Result/CollectionResult");
6
6
  const ObjectResult_1 = require("../Model/Result/ObjectResult");
7
7
  const HttpClient_1 = require("../Http/HttpClient");
8
+ const Utils_1 = require("../Utils");
8
9
  class Endpoint {
9
10
  constructor(httpClient) {
10
11
  this.httpClient = httpClient;
@@ -22,7 +23,11 @@ class Endpoint {
22
23
  if (!requestResponse.hasOwnProperty('data') || requestResponse.data === undefined) {
23
24
  throw new Error('Unable to parse collection: data is not defined');
24
25
  }
25
- result.setData(this.parseCollection(requestResponse.data, parser));
26
+ if (!requestResponse.hasOwnProperty('has_more') || requestResponse.has_more === undefined) {
27
+ throw new Error('Unable to parse collection: hasMore is not defined');
28
+ }
29
+ const hasMore = Utils_1.Utils.isTrue(requestResponse.has_more);
30
+ result.setData(this.parseCollection(requestResponse.data, parser), hasMore);
26
31
  return result;
27
32
  }
28
33
  async requestObject(action, parameters = null, parser, method = 'GET', signWithOauthToken = true) {
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.9.0";
1
+ export declare const VERSION = "1.9.1";
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = "1.9.0";
4
+ exports.VERSION = "1.9.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",