@pax2pay/model-banking 0.1.505 → 0.1.506

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.
@@ -3,6 +3,7 @@ import { isoly } from "isoly"
3
3
  import { http } from "cloudly-http"
4
4
  import { Card } from "../../Card"
5
5
  import { Operation } from "../../Operation"
6
+ import { Rail } from "../../Rail"
6
7
  import { Rule } from "../../Rule"
7
8
  import { Supplier } from "../../Supplier"
8
9
  import { Transaction } from "../../Transaction"
@@ -17,25 +18,24 @@ export class Transactions {
17
18
  async create(account: string, transaction: Transaction.Creatable): Promise<Transaction | gracely.Error> {
18
19
  return this.client.post<Transaction>(`/account/${account}/transaction`, transaction)
19
20
  }
20
- async list(options?: {
21
- account?: string
22
- limit?: number
23
- cursor?: string
24
- query?: "created" | "changed" | "review"
25
- dateRange?: isoly.DateRange
26
- }): Promise<(Transaction[] & { cursor?: string | undefined }) | gracely.Error> {
27
- const query = Object.entries({
28
- ...(options?.cursor ? { cursor: options.cursor } : {}),
29
- ...(!options?.query ? {} : options?.query == "review" ? { status: "review" } : { order: options?.query }),
30
- ...(options?.dateRange ?? {}),
31
- })
32
- .map(([k, v]) => `${k}=${v}`)
33
- .join("&")
34
- const path = options?.account ? `/account/${options.account}/transaction` : `/transaction`
35
- return await this.client.get<Transaction[] & { cursor?: string | undefined }>(
36
- path + (query && "?" + query),
37
- options?.limit ? { limit: options?.limit.toString() } : {}
38
- )
21
+ async list(
22
+ options?:
23
+ | {
24
+ account?: string
25
+ limit?: number
26
+ cursor?: string
27
+ start?: isoly.DateTime
28
+ end?: isoly.DateTime
29
+ currency?: string
30
+ organization?: string
31
+ rail?: Rail
32
+ type?: Transaction.Types
33
+ }
34
+ | string
35
+ ): Promise<(Transaction[] & { cursor?: string | undefined }) | gracely.Error> {
36
+ const path = `/transaction`
37
+ const query = !options ? undefined : typeof options == "string" ? options : http.Search.stringify({ ...options })
38
+ return await this.client.get<Transaction[] & { cursor?: string | undefined }>(path + (query && "?" + query))
39
39
  }
40
40
  async fetch(transaction: string, account?: string): Promise<Transaction | gracely.Error> {
41
41
  return this.client.get<Transaction>(
@@ -3,6 +3,7 @@ import { isoly } from "isoly";
3
3
  import { http } from "cloudly-http";
4
4
  import { Card } from "../../Card";
5
5
  import { Operation } from "../../Operation";
6
+ import { Rail } from "../../Rail";
6
7
  import { Rule } from "../../Rule";
7
8
  import { Supplier } from "../../Supplier";
8
9
  import { Transaction } from "../../Transaction";
@@ -16,9 +17,13 @@ export declare class Transactions {
16
17
  account?: string;
17
18
  limit?: number;
18
19
  cursor?: string;
19
- query?: "created" | "changed" | "review";
20
- dateRange?: isoly.DateRange;
21
- }): Promise<(Transaction[] & {
20
+ start?: isoly.DateTime;
21
+ end?: isoly.DateTime;
22
+ currency?: string;
23
+ organization?: string;
24
+ rail?: Rail;
25
+ type?: Transaction.Types;
26
+ } | string): Promise<(Transaction[] & {
22
27
  cursor?: string | undefined;
23
28
  }) | gracely.Error>;
24
29
  fetch(transaction: string, account?: string): Promise<Transaction | gracely.Error>;
@@ -14,15 +14,9 @@ class Transactions {
14
14
  return this.client.post(`/account/${account}/transaction`, transaction);
15
15
  }
16
16
  async list(options) {
17
- const query = Object.entries({
18
- ...(options?.cursor ? { cursor: options.cursor } : {}),
19
- ...(!options?.query ? {} : options?.query == "review" ? { status: "review" } : { order: options?.query }),
20
- ...(options?.dateRange ?? {}),
21
- })
22
- .map(([k, v]) => `${k}=${v}`)
23
- .join("&");
24
- const path = options?.account ? `/account/${options.account}/transaction` : `/transaction`;
25
- return await this.client.get(path + (query && "?" + query), options?.limit ? { limit: options?.limit.toString() } : {});
17
+ const path = `/transaction`;
18
+ const query = !options ? undefined : typeof options == "string" ? options : cloudly_http_1.http.Search.stringify({ ...options });
19
+ return await this.client.get(path + (query && "?" + query));
26
20
  }
27
21
  async fetch(transaction, account) {
28
22
  return this.client.get(account ? `/account/${account}/transaction/${transaction}` : `/transaction/${transaction}`);
@@ -1 +1 @@
1
- {"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SAAS,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK,EAAE,CAAC,CAAA;QACnE,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAyB,0BAA0B,KAAK,EAAE,CAAC,CAAA;IAClF,CAAC;CACD;AA9CD,oCA8CC"}
@@ -3,6 +3,7 @@ import { isoly } from "isoly";
3
3
  import { http } from "cloudly-http";
4
4
  import { Card } from "../../Card";
5
5
  import { Operation } from "../../Operation";
6
+ import { Rail } from "../../Rail";
6
7
  import { Rule } from "../../Rule";
7
8
  import { Supplier } from "../../Supplier";
8
9
  import { Transaction } from "../../Transaction";
@@ -16,9 +17,13 @@ export declare class Transactions {
16
17
  account?: string;
17
18
  limit?: number;
18
19
  cursor?: string;
19
- query?: "created" | "changed" | "review";
20
- dateRange?: isoly.DateRange;
21
- }): Promise<(Transaction[] & {
20
+ start?: isoly.DateTime;
21
+ end?: isoly.DateTime;
22
+ currency?: string;
23
+ organization?: string;
24
+ rail?: Rail;
25
+ type?: Transaction.Types;
26
+ } | string): Promise<(Transaction[] & {
22
27
  cursor?: string | undefined;
23
28
  }) | gracely.Error>;
24
29
  fetch(transaction: string, account?: string): Promise<Transaction | gracely.Error>;
@@ -11,15 +11,9 @@ export class Transactions {
11
11
  return this.client.post(`/account/${account}/transaction`, transaction);
12
12
  }
13
13
  async list(options) {
14
- const query = Object.entries({
15
- ...(options?.cursor ? { cursor: options.cursor } : {}),
16
- ...(!options?.query ? {} : options?.query == "review" ? { status: "review" } : { order: options?.query }),
17
- ...(options?.dateRange ?? {}),
18
- })
19
- .map(([k, v]) => `${k}=${v}`)
20
- .join("&");
21
- const path = options?.account ? `/account/${options.account}/transaction` : `/transaction`;
22
- return await this.client.get(path + (query && "?" + query), options?.limit ? { limit: options?.limit.toString() } : {});
14
+ const path = `/transaction`;
15
+ const query = !options ? undefined : typeof options == "string" ? options : http.Search.stringify({ ...options });
16
+ return await this.client.get(path + (query && "?" + query));
23
17
  }
24
18
  async fetch(transaction, account) {
25
19
  return this.client.get(account ? `/account/${account}/transaction/${transaction}` : `/transaction/${transaction}`);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Client/Transactions/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAMnC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,MAAM,OAAO,YAAY;IAEK;IADpB,KAAK,CAAO;IACrB,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;QAC/C,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACpC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAe,EAAE,WAAkC;QAC/D,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAc,YAAY,OAAO,cAAc,EAAE,WAAW,CAAC,CAAA;IACrF,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,OAMV;QACA,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC;YAC5B,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACtD,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;YACzG,GAAG,CAAC,OAAO,EAAE,SAAS,IAAI,EAAE,CAAC;SAC7B,CAAC;aACA,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;aAC5B,IAAI,CAAC,GAAG,CAAC,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ACnC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAa,gBAAgB,aAAa,QAAQ,CAAC,CAAA;IAC1E,CAAC;IACD,KAAK,CAAC,UAAU,CACf,KAAsB,EACtB,OAAwF;QAExF,MAAM,KAAK,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK,EAAE,CAAC,CAAA;QACnE,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAyB,0BAA0B,KAAK,EAAE,CAAC,CAAA;IAClF,CAAC;CACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/model-banking",
3
- "version": "0.1.505",
3
+ "version": "0.1.506",
4
4
  "description": "Library containing data model types and functions for the Pax2Pay Banking API.",
5
5
  "author": "Pax2Pay Ltd",
6
6
  "license": "MIT",