@pax2pay/client 0.6.15 → 0.6.16

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.
@@ -38,15 +38,18 @@ export class Merchants extends List<model.MerchantResponse> {
38
38
  previous?: Paginated<model.MerchantResponse>,
39
39
  page?: number,
40
40
  size?: number,
41
- sort = "name"
41
+ sort = "name",
42
+ organisationCode?: string
42
43
  ): Promise<model.ErrorResponse | Paginated<model.MerchantResponse>> {
44
+ const header = organisationCode ? { "x-assume": organisationCode } : undefined
43
45
  return await this.getNextPaginated(
44
46
  previous,
45
47
  (page, size, sort, request) =>
46
48
  this.connection.post<{ list: model.MerchantResponse[]; totalCount: number }>(
47
49
  `${this.folder}/searches`,
48
50
  request,
49
- { page, size, sort }
51
+ { page, size, sort },
52
+ header
50
53
  ),
51
54
  request,
52
55
  page,
@@ -54,11 +57,16 @@ export class Merchants extends List<model.MerchantResponse> {
54
57
  sort
55
58
  )
56
59
  }
57
- async getAll() {
58
- const response = await this.connection.get<model.ErrorResponse | model.MerchantResponse[]>(this.folder, {
59
- page: 0,
60
- size: 5000,
61
- })
60
+ async getAll(organisationCode?: string) {
61
+ const header = organisationCode ? { "x-assume": organisationCode } : undefined
62
+ const response = await this.connection.get<model.ErrorResponse | model.MerchantResponse[]>(
63
+ this.folder,
64
+ {
65
+ page: 0,
66
+ size: 5000,
67
+ },
68
+ header
69
+ )
62
70
  return this.extractResponse(response)
63
71
  }
64
72
  }
@@ -19,6 +19,6 @@ export declare class Merchants extends List<model.MerchantResponse> {
19
19
  getMerchant(value: string): Promise<model.MerchantResponse | model.ErrorResponse | (model.ErrorResponse & {
20
20
  status: 400 | 404 | 500 | 403 | 503;
21
21
  })>;
22
- searchPaginated(request: model.MerchantSearchRequest, previous?: Paginated<model.MerchantResponse>, page?: number, size?: number, sort?: string): Promise<model.ErrorResponse | Paginated<model.MerchantResponse>>;
23
- getAll(): Promise<model.ErrorResponse | model.MerchantResponse[]>;
22
+ searchPaginated(request: model.MerchantSearchRequest, previous?: Paginated<model.MerchantResponse>, page?: number, size?: number, sort?: string, organisationCode?: string): Promise<model.ErrorResponse | Paginated<model.MerchantResponse>>;
23
+ getAll(organisationCode?: string): Promise<model.ErrorResponse | model.MerchantResponse[]>;
24
24
  }
@@ -26,14 +26,16 @@ export class Merchants extends List {
26
26
  async getMerchant(value) {
27
27
  return await this.connection.get(`${this.folder}/${value}`);
28
28
  }
29
- async searchPaginated(request, previous, page, size, sort = "name") {
30
- return await this.getNextPaginated(previous, (page, size, sort, request) => this.connection.post(`${this.folder}/searches`, request, { page, size, sort }), request, page, size, sort);
29
+ async searchPaginated(request, previous, page, size, sort = "name", organisationCode) {
30
+ const header = organisationCode ? { "x-assume": organisationCode } : undefined;
31
+ return await this.getNextPaginated(previous, (page, size, sort, request) => this.connection.post(`${this.folder}/searches`, request, { page, size, sort }, header), request, page, size, sort);
31
32
  }
32
- async getAll() {
33
+ async getAll(organisationCode) {
34
+ const header = organisationCode ? { "x-assume": organisationCode } : undefined;
33
35
  const response = await this.connection.get(this.folder, {
34
36
  page: 0,
35
37
  size: 5000,
36
- });
38
+ }, header);
37
39
  return this.extractResponse(response);
38
40
  }
39
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Merchants/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAG9B,MAAM,OAAO,SAAU,SAAQ,IAA4B;IAE1D,YAAY,UAAsB;QACjC,KAAK,CAAC,UAAU,CAAC,CAAA;QAFC,WAAM,GAAG,WAAW,CAAA;IAGvC,CAAC;IACD,MAAM,CAAC,MAAM,CAAC,UAAsB;QACnC,OAAO,IAAI,SAAS,CAAC,UAAU,CAAC,CAAA;IACjC,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAA8B;QAC1C,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAyB,IAAI,CAAC,MAAM,EAAE,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CAAC;CACD"}
@@ -10,6 +10,7 @@ export interface MerchantResponse {
10
10
  isSuitableForCardMerchantRestriction?: true;
11
11
  beneficiaries?: Partial<Record<Currency, BeneficiaryResponse>>;
12
12
  status: MerchantResponseStatus;
13
+ organisations?: string[];
13
14
  }
14
15
  export declare namespace MerchantResponse {
15
16
  const type: import("isly/dist/cjs/object").IslyObject<MerchantResponse, object>;
@@ -15,6 +15,7 @@ export var MerchantResponse;
15
15
  beneficiaries: isly
16
16
  .record(isly.fromIs("Currency", Currency.is), isly.fromIs("BeneficiaryResponse", BeneficiaryResponse.is))
17
17
  .optional(),
18
+ organisations: isly.string().array().optional(),
18
19
  });
19
20
  MerchantResponse.is = MerchantResponse.type.is;
20
21
  })(MerchantResponse || (MerchantResponse = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"MerchantResponse.js","sourceRoot":"../","sources":["model/MerchantResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAY7C,MAAM,KAAW,gBAAgB,CAahC;AAbD,WAAiB,gBAAgB;IACnB,qBAAI,GAAG,IAAI,CAAC,MAAM,CAAmB;QACjD,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC5B,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC9B,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC7B,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE;QAClC,oCAAoC,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAA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AE,QAAQ,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,qBAAqB,EAAE,mBAAmB,CAAC,EAAE,CAAC,CAAC;aACxG,QAAQ,EAAE;QACZ,aAAa,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;KAC/C,CAAC,CAAA;IACW,mBAAE,GAAG,iBAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EAdgB,gBAAgB,KAAhB,gBAAgB,QAchC"}
@@ -2,6 +2,7 @@ import { Currency } from "isoly";
2
2
  import { AbstractBeneficiaryRequest } from "./AbstractBeneficiaryRequest";
3
3
  export interface UpdateMerchantRequest {
4
4
  beneficiaries?: Partial<Record<Currency, AbstractBeneficiaryRequest>>;
5
+ organisations?: string[];
5
6
  }
6
7
  export declare namespace UpdateMerchantRequest {
7
8
  const type: import("isly/dist/cjs/object").IslyObject<UpdateMerchantRequest, object>;
@@ -7,6 +7,7 @@ export var UpdateMerchantRequest;
7
7
  beneficiaries: isly
8
8
  .record(isly.fromIs("Currency", Currency.is), isly.fromIs("AbstractBeneficiaryRequest", AbstractBeneficiaryRequest.is))
9
9
  .optional(),
10
+ organisations: isly.string().array().optional(),
10
11
  });
11
12
  UpdateMerchantRequest.is = UpdateMerchantRequest.type.is;
12
13
  })(UpdateMerchantRequest || (UpdateMerchantRequest = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateMerchantRequest.js","sourceRoot":"../","sources":["model/UpdateMerchantRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AAMzE,MAAM,KAAW,qBAAqB,CAUrC;AAVD,WAAiB,qBAAqB;IACxB,0BAAI,GAAG,IAAI,CAAC,MAAM,CAAwB;QACtD,aAAa,EAAE,IAAI;aACjB,MAAM,CACN,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC,EACpC,IAAI,CAAC,MAAM,CAAC,4BAA4B,EAAE,0BAA0B,CAAC,EAAE,CAAC,CACxE;aACA,QAAQ,EAAE;KACZ,CAAC,CAAA;IACW,wBAAE,GAAG,sBAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EAVgB,qBAAqB,KAArB,qBAAqB,QAUrC"}
1
+ {"version":3,"file":"UpdateMerchantRequest.js","sourceRoot":"../","sources":["model/UpdateMerchantRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AAOzE,MAAM,KAAW,qBAAqB,CAWrC;AAXD,WAAiB,qBAAqB;IACxB,0BAAI,GAAG,IAAI,CAAC,MAAM,CAAwB;QACtD,aAAa,EAAE,IAAI;aACjB,MAAM,CACN,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC,EACpC,IAAI,CAAC,MAAM,CAAC,4BAA4B,EAAE,0BAA0B,CAAC,EAAE,CAAC,CACxE;aACA,QAAQ,EAAE;QACZ,aAAa,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;KAC/C,CAAC,CAAA;IACW,wBAAE,GAAG,sBAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EAXgB,qBAAqB,KAArB,qBAAqB,QAWrC"}
@@ -12,6 +12,7 @@ export interface MerchantResponse {
12
12
  isSuitableForCardMerchantRestriction?: true
13
13
  beneficiaries?: Partial<Record<Currency, BeneficiaryResponse>>
14
14
  status: MerchantResponseStatus
15
+ organisations?: string[]
15
16
  }
16
17
 
17
18
  export namespace MerchantResponse {
@@ -25,6 +26,7 @@ export namespace MerchantResponse {
25
26
  beneficiaries: isly
26
27
  .record(isly.fromIs("Currency", Currency.is), isly.fromIs("BeneficiaryResponse", BeneficiaryResponse.is))
27
28
  .optional(),
29
+ organisations: isly.string().array().optional(),
28
30
  })
29
31
  export const is = type.is
30
32
  }
@@ -4,6 +4,7 @@ import { AbstractBeneficiaryRequest } from "./AbstractBeneficiaryRequest"
4
4
 
5
5
  export interface UpdateMerchantRequest {
6
6
  beneficiaries?: Partial<Record<Currency, AbstractBeneficiaryRequest>>
7
+ organisations?: string[]
7
8
  }
8
9
 
9
10
  export namespace UpdateMerchantRequest {
@@ -14,6 +15,7 @@ export namespace UpdateMerchantRequest {
14
15
  isly.fromIs("AbstractBeneficiaryRequest", AbstractBeneficiaryRequest.is)
15
16
  )
16
17
  .optional(),
18
+ organisations: isly.string().array().optional(),
17
19
  })
18
20
  export const is = type.is
19
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/client",
3
- "version": "0.6.15",
3
+ "version": "0.6.16",
4
4
  "description": "Client library for the Pax2Pay API",
5
5
  "author": "Pax2Pay Ltd.",
6
6
  "license": "MIT",