@pax2pay/model-banking 0.0.8 → 0.0.9

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.
@@ -0,0 +1,9 @@
1
+ import * as gracely from "gracely";
2
+ import * as http from "cloudly-http";
3
+ import * as rest from "cloudly-rest";
4
+ import { Account } from "../Account";
5
+ export declare class Accounts extends rest.Collection<gracely.Error> {
6
+ constructor(client: http.Client);
7
+ create(account: Account.Creatable): Promise<Account | gracely.Error>;
8
+ list(organization: string, realm: string): Promise<Account.Info[] | gracely.Error>;
9
+ }
@@ -0,0 +1,13 @@
1
+ import * as rest from "cloudly-rest";
2
+ export class Accounts extends rest.Collection {
3
+ constructor(client) {
4
+ super(client);
5
+ }
6
+ async create(account) {
7
+ return this.client.post("/account", account);
8
+ }
9
+ async list(organization, realm) {
10
+ return this.client.get("/account", { organization: organization, realm: realm });
11
+ }
12
+ }
13
+ //# sourceMappingURL=Accounts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Accounts.js","sourceRoot":"../","sources":["Client/Accounts.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAGpC,MAAM,OAAO,QAAS,SAAQ,IAAI,CAAC,UAAyB;IAC3D,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;IACd,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAA0B;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAU,UAAU,EAAE,OAAO,CAAC,CAAA;IACtD,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,YAAoB,EAAE,KAAa;QAC7C,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAiB,UAAU,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;IACjG,CAAC;CACD"}
@@ -0,0 +1,9 @@
1
+ import * as gracely from "gracely";
2
+ import * as http from "cloudly-http";
3
+ import * as rest from "cloudly-rest";
4
+ import { Decision } from "../monitoring/Decision";
5
+ export declare class Decisions extends rest.Collection<gracely.Error> {
6
+ constructor(client: http.Client);
7
+ create(realm: string, transaction: string, decision: Decision.Creatable): Promise<Decision | gracely.Error>;
8
+ list(realm: string): Promise<Decision[] | gracely.Error>;
9
+ }
@@ -0,0 +1,13 @@
1
+ import * as rest from "cloudly-rest";
2
+ export class Decisions extends rest.Collection {
3
+ constructor(client) {
4
+ super(client);
5
+ }
6
+ async create(realm, transaction, decision) {
7
+ return this.client.post(`/monitor/decision/${transaction}`, decision, { realm: realm });
8
+ }
9
+ async list(realm) {
10
+ return this.client.get(`/monitor/decision`, { realm: realm });
11
+ }
12
+ }
13
+ //# sourceMappingURL=Decisions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Decisions.js","sourceRoot":"../","sources":["Client/Decisions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAGpC,MAAM,OAAO,SAAU,SAAQ,IAAI,CAAC,UAAyB;IAC5D,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;IACd,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,KAAa,EAAE,WAAmB,EAAE,QAA4B;QAC5E,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAW,qBAAqB,WAAW,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;IAClG,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,KAAa;QACvB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAa,mBAAmB,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;IAC1E,CAAC;CACD"}
@@ -0,0 +1,8 @@
1
+ import * as gracely from "gracely";
2
+ import * as http from "cloudly-http";
3
+ import * as rest from "cloudly-rest";
4
+ import { Operation } from "../Operation";
5
+ export declare class Operations extends rest.Collection<gracely.Error> {
6
+ constructor(client: http.Client);
7
+ list(realm: string): Promise<Operation[] | gracely.Error>;
8
+ }
@@ -0,0 +1,10 @@
1
+ import * as rest from "cloudly-rest";
2
+ export class Operations extends rest.Collection {
3
+ constructor(client) {
4
+ super(client);
5
+ }
6
+ async list(realm) {
7
+ return this.client.get(`/operation/${realm}`);
8
+ }
9
+ }
10
+ //# sourceMappingURL=Operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Operations.js","sourceRoot":"../","sources":["Client/Operations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAGpC,MAAM,OAAO,UAAW,SAAQ,IAAI,CAAC,UAAyB;IAC7D,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;IACd,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,KAAa;QACvB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAc,cAAc,KAAK,EAAE,CAAC,CAAA;IAC3D,CAAC;CACD"}
@@ -0,0 +1,9 @@
1
+ import * as gracely from "gracely";
2
+ import * as http from "cloudly-http";
3
+ import * as rest from "cloudly-rest";
4
+ import { Organization } from "../Organization";
5
+ export declare class Organizations extends rest.Collection<gracely.Error> {
6
+ constructor(client: http.Client);
7
+ list(): Promise<Organization[] | gracely.Error>;
8
+ create(organization: Organization.Creatable): Promise<Organization | gracely.Error>;
9
+ }
@@ -0,0 +1,13 @@
1
+ import * as rest from "cloudly-rest";
2
+ export class Organizations extends rest.Collection {
3
+ constructor(client) {
4
+ super(client);
5
+ }
6
+ async list() {
7
+ return this.client.get(`/organization/`);
8
+ }
9
+ async create(organization) {
10
+ return this.client.post(`/organization`, organization);
11
+ }
12
+ }
13
+ //# sourceMappingURL=Organizations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Organizations.js","sourceRoot":"../","sources":["Client/Organizations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAGpC,MAAM,OAAO,aAAc,SAAQ,IAAI,CAAC,UAAyB;IAChE,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;IACd,CAAC;IACD,KAAK,CAAC,IAAI;QACT,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAiB,gBAAgB,CAAC,CAAA;IACzD,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,YAAoC;QAChD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAe,eAAe,EAAE,YAAY,CAAC,CAAA;IACrE,CAAC;CACD"}
@@ -0,0 +1,9 @@
1
+ import * as gracely from "gracely";
2
+ import * as http from "cloudly-http";
3
+ import * as rest from "cloudly-rest";
4
+ import { Reviewable } from "../monitoring/Reviewable";
5
+ export declare class Queue extends rest.Collection<gracely.Error> {
6
+ constructor(client: http.Client);
7
+ change(realm: string, transaction: string, comment: string): Promise<Reviewable | gracely.Error>;
8
+ list(realm: string): Promise<Reviewable[] | gracely.Error>;
9
+ }
@@ -0,0 +1,13 @@
1
+ import * as rest from "cloudly-rest";
2
+ export class Queue extends rest.Collection {
3
+ constructor(client) {
4
+ super(client);
5
+ }
6
+ async change(realm, transaction, comment) {
7
+ return this.client.patch(`/monitor/queue/${transaction}`, comment, { realm: realm });
8
+ }
9
+ async list(realm) {
10
+ return this.client.get(`/monitor/queue`, { realm: realm });
11
+ }
12
+ }
13
+ //# sourceMappingURL=Queue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Queue.js","sourceRoot":"../","sources":["Client/Queue.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAGpC,MAAM,OAAO,KAAM,SAAQ,IAAI,CAAC,UAAyB;IACxD,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;IACd,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,KAAa,EAAE,WAAmB,EAAE,OAAe;QAC/D,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAa,kBAAkB,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;IACjG,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,KAAa;QACvB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAe,gBAAgB,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;IACzE,CAAC;CACD"}
@@ -0,0 +1,9 @@
1
+ import * as gracely from "gracely";
2
+ import * as http from "cloudly-http";
3
+ import * as rest from "cloudly-rest";
4
+ import { Transaction } from "../Transaction";
5
+ export declare class Transactions extends rest.Collection<gracely.Error> {
6
+ constructor(client: http.Client);
7
+ create(organization: string, account: string, transaction: Transaction.Creatable): Promise<Transaction | gracely.Error>;
8
+ list(organization: string, account: string): Promise<Transaction[] | gracely.Error>;
9
+ }
@@ -0,0 +1,13 @@
1
+ import * as rest from "cloudly-rest";
2
+ export class Transactions extends rest.Collection {
3
+ constructor(client) {
4
+ super(client);
5
+ }
6
+ async create(organization, account, transaction) {
7
+ return this.client.post(`/account/${account}/transaction`, transaction, { organization: organization });
8
+ }
9
+ async list(organization, account) {
10
+ return this.client.get(`/account/${account}/transaction`, { organization: organization });
11
+ }
12
+ }
13
+ //# sourceMappingURL=Transactions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Transactions.js","sourceRoot":"../","sources":["Client/Transactions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAGpC,MAAM,OAAO,YAAa,SAAQ,IAAI,CAAC,UAAyB;IAC/D,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;IACd,CAAC;IACD,KAAK,CAAC,MAAM,CACX,YAAoB,EACpB,OAAe,EACf,WAAkC;QAElC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAc,YAAY,OAAO,cAAc,EAAE,WAAW,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CAAA;IACrH,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,YAAoB,EAAE,OAAe;QAC/C,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAgB,YAAY,OAAO,cAAc,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CAAA;IACzG,CAAC;CACD"}
@@ -0,0 +1,7 @@
1
+ import * as gracely from "gracely";
2
+ import * as http from "cloudly-http";
3
+ import * as rest from "cloudly-rest";
4
+ export declare class Version extends rest.Collection<gracely.Error> {
5
+ constructor(client: http.Client);
6
+ fetch(): Promise<any>;
7
+ }
@@ -0,0 +1,10 @@
1
+ import * as rest from "cloudly-rest";
2
+ export class Version extends rest.Collection {
3
+ constructor(client) {
4
+ super(client);
5
+ }
6
+ async fetch() {
7
+ return this.client.get("/version");
8
+ }
9
+ }
10
+ //# sourceMappingURL=Version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Version.js","sourceRoot":"../","sources":["Client/Version.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAEpC,MAAM,OAAO,OAAQ,SAAQ,IAAI,CAAC,UAAyB;IAC1D,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;IACd,CAAC;IACD,KAAK,CAAC,KAAK;QACV,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAM,UAAU,CAAC,CAAA;IACxC,CAAC;CACD"}
@@ -0,0 +1,20 @@
1
+ import * as gracely from "gracely";
2
+ import * as http from "cloudly-http";
3
+ import * as rest from "cloudly-rest";
4
+ import { Accounts } from "./Accounts";
5
+ import { Decisions } from "./Decisions";
6
+ import { Operations } from "./Operations";
7
+ import { Organizations } from "./Organizations";
8
+ import { Queue } from "./Queue";
9
+ import { Transactions } from "./Transactions";
10
+ import { Version } from "./Version";
11
+ export declare class Client extends rest.Client<gracely.Error> {
12
+ readonly account: Accounts;
13
+ readonly decision: Decisions;
14
+ readonly operation: Operations;
15
+ readonly organization: Organizations;
16
+ readonly queue: Queue;
17
+ readonly transaction: Transactions;
18
+ readonly version: Version;
19
+ static create<T = Record<string, any>>(server: string, key: string, load?: (client: http.Client) => T): Client & T;
20
+ }
@@ -0,0 +1,29 @@
1
+ import * as http from "cloudly-http";
2
+ import * as rest from "cloudly-rest";
3
+ import { Accounts } from "./Accounts";
4
+ import { Decisions } from "./Decisions";
5
+ import { Operations } from "./Operations";
6
+ import { Organizations } from "./Organizations";
7
+ import { Queue } from "./Queue";
8
+ import { Transactions } from "./Transactions";
9
+ import { Version } from "./Version";
10
+ export class Client extends rest.Client {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.account = new Accounts(this.client);
14
+ this.decision = new Decisions(this.client);
15
+ this.operation = new Operations(this.client);
16
+ this.organization = new Organizations(this.client);
17
+ this.queue = new Queue(this.client);
18
+ this.transaction = new Transactions(this.client);
19
+ this.version = new Version(this.client);
20
+ }
21
+ static create(server, key, load) {
22
+ let httpClient;
23
+ const result = new Client((httpClient = new http.Client(server, key)));
24
+ if (load)
25
+ Object.assign(result, load(httpClient));
26
+ return result;
27
+ }
28
+ }
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AACpC,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,MAAM,OAAO,MAAO,SAAQ,IAAI,CAAC,MAAqB;IAAtD;;QACU,YAAO,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACnC,aAAQ,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACrC,cAAS,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACvC,iBAAY,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC7C,UAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC9B,gBAAW,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC3C,YAAO,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAS5C,CAAC;IAPA,MAAM,CAAC,MAAM,CAA0B,MAAc,EAAE,GAAW,EAAE,IAAiC;QACpG,IAAI,UAAsC,CAAA;QAC1C,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,CAAC,UAAU,GAAG,IAAI,IAAI,CAAC,MAAM,CAAgB,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAA;QACrF,IAAI,IAAI;YACP,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAA;QACxC,OAAO,MAAoB,CAAA;IAC5B,CAAC;CACD"}
package/dist/index.d.ts CHANGED
@@ -6,3 +6,4 @@ export { Organization } from "./Organization";
6
6
  export { Rail } from "./Rail";
7
7
  export { Transaction } from "./Transaction";
8
8
  export { Decision, Reviewable } from "./monitoring";
9
+ export { Client } from "./Client";
package/dist/index.js CHANGED
@@ -6,4 +6,5 @@ export { Organization } from "./Organization";
6
6
  export { Rail } from "./Rail";
7
7
  export { Transaction } from "./Transaction";
8
8
  export { Decision, Reviewable } from "./monitoring";
9
+ export { Client } from "./Client";
9
10
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"../","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA"}
package/index.ts CHANGED
@@ -6,3 +6,4 @@ export { Organization } from "./Organization"
6
6
  export { Rail } from "./Rail"
7
7
  export { Transaction } from "./Transaction"
8
8
  export { Decision, Reviewable } from "./monitoring"
9
+ export { Client } from "./Client"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/model-banking",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "Library containing data model types and functions for the Pax2Pay Banking API.",
5
5
  "author": "Pax2Pay Ltd",
6
6
  "license": "MIT",