@pax2pay/client 0.1.16 → 0.1.17

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,3 +1,4 @@
1
+ import * as model from "../../model"
1
2
  import { CategoryResponse } from "../../model/CategoryResponse"
2
3
  import { Connection } from "../Connection"
3
4
  export class Categories {
@@ -7,7 +8,10 @@ export class Categories {
7
8
  return new Categories(connection)
8
9
  }
9
10
  async getAllCategories() {
10
- const result = await this.connection.get<CategoryResponse[]>(`category?size=100`)
11
- return result
11
+ const result = await this.connection.get<{ list: CategoryResponse[]; totalCount: number }>(`category?size=100`)
12
+ if (!model.ErrorResponse.is(result))
13
+ return result.list
14
+ else
15
+ return result
12
16
  }
13
17
  }
@@ -1,11 +1,11 @@
1
- import { CategoryResponse } from "../../model/CategoryResponse";
1
+ import * as model from "../../model";
2
2
  import { Connection } from "../Connection";
3
3
  export declare class Categories {
4
4
  private readonly connection;
5
5
  protected folder: string;
6
6
  constructor(connection: Connection);
7
7
  static create(connection: Connection): Categories;
8
- getAllCategories(): Promise<(import("../..").ErrorResponse & {
8
+ getAllCategories(): Promise<(model.ErrorResponse & {
9
9
  status: 400 | 404 | 500 | 403 | 503;
10
- }) | CategoryResponse[]>;
10
+ }) | model.CategoryResponse[]>;
11
11
  }
@@ -1,3 +1,4 @@
1
+ import * as model from "../../model";
1
2
  export class Categories {
2
3
  constructor(connection) {
3
4
  this.connection = connection;
@@ -8,7 +9,10 @@ export class Categories {
8
9
  }
9
10
  async getAllCategories() {
10
11
  const result = await this.connection.get(`category?size=100`);
11
- return result;
12
+ if (!model.ErrorResponse.is(result))
13
+ return result.list;
14
+ else
15
+ return result;
12
16
  }
13
17
  }
14
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Categories/index.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,UAAU;IAEtB,YAA6B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;QADzC,WAAM,GAAG,UAAU,CAAA;IACyB,CAAC;IACvD,MAAM,CAAC,MAAM,CAAC,UAAsB;QACnC,OAAO,IAAI,UAAU,CAAC,UAAU,CAAC,CAAA;IAClC,CAAC;IACD,KAAK,CAAC,gBAAgB;QACrB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAqB,mBAAmB,CAAC,CAAA;QACjF,OAAO,MAAM,CAAA;IACd,CAAC;CACD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Categories/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AAGpC,MAAM,OAAO,UAAU;IAEtB,YAA6B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;QADzC,WAAM,GAAG,UAAU,CAAA;IACyB,CAAC;IACvD,MAAM,CAAC,MAAM,CAAC,UAAsB;QACnC,OAAO,IAAI,UAAU,CAAC,UAAU,CAAC,CAAA;IAClC,CAAC;IACD,KAAK,CAAC,gBAAgB;QACrB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAmD,mBAAmB,CAAC,CAAA;QAC/G,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,MAAM,CAAC;YAClC,OAAO,MAAM,CAAC,IAAI,CAAA;;YAElB,OAAO,MAAM,CAAA;IACf,CAAC;CACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/client",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "Client library for the Pax2Pay API",
5
5
  "author": "Pax2Pay Ltd.",
6
6
  "license": "MIT",