@pax2pay/model-banking 0.1.449 → 0.1.451
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.
- package/Analytics/Event/Ledger/Card.ts +21 -0
- package/Analytics/Event/Ledger/index.ts +2 -0
- package/Analytics/Event/index.ts +1 -0
- package/Client/Transactions/index.ts +1 -4
- package/dist/Analytics/Event/Ledger/Card.d.ts +12 -0
- package/dist/Analytics/Event/Ledger/Card.js +17 -0
- package/dist/Analytics/Event/Ledger/Card.js.map +1 -0
- package/dist/Analytics/Event/Ledger/index.d.ts +2 -0
- package/dist/Analytics/Event/Ledger/index.js +2 -0
- package/dist/Analytics/Event/Ledger/index.js.map +1 -1
- package/dist/Analytics/Event/index.d.ts +1 -1
- package/dist/Analytics/Event/index.js.map +1 -1
- package/dist/Client/Transactions/index.js +1 -4
- package/dist/Client/Transactions/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { isoly } from "isoly"
|
|
2
|
+
import { Card as modelCard } from "../../../Card"
|
|
3
|
+
import { Base } from "./Base"
|
|
4
|
+
|
|
5
|
+
export interface Card extends Base<modelCard> {
|
|
6
|
+
entity: { type: "card"; id: string }
|
|
7
|
+
action: "created" | "updated" | "cancelled"
|
|
8
|
+
}
|
|
9
|
+
export namespace Card {
|
|
10
|
+
export function create(value: modelCard, action: Card["action"]): Card {
|
|
11
|
+
return {
|
|
12
|
+
realm: value.realm,
|
|
13
|
+
entity: { type: "card", id: value.id },
|
|
14
|
+
organization: value.organization,
|
|
15
|
+
account: value.account,
|
|
16
|
+
action,
|
|
17
|
+
created: isoly.DateTime.now(),
|
|
18
|
+
value,
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Account as AccountEvent } from "./Account"
|
|
2
2
|
import { Base as EventBase } from "./Base"
|
|
3
|
+
import { Card as CardEvent } from "./Card"
|
|
3
4
|
import { Operation as OperationEvent } from "./Operation"
|
|
4
5
|
import { Organization as OrganizationEvent } from "./Organization"
|
|
5
6
|
import { Rule as RuleEvent } from "./Rule"
|
|
@@ -14,4 +15,5 @@ export namespace Ledger {
|
|
|
14
15
|
export import Rule = RuleEvent
|
|
15
16
|
export import Operation = OperationEvent
|
|
16
17
|
export import User = UserEvent
|
|
18
|
+
export import Card = CardEvent
|
|
17
19
|
}
|
package/Analytics/Event/index.ts
CHANGED
|
@@ -26,7 +26,6 @@ export class Transactions extends rest.Collection<gracely.Error> {
|
|
|
26
26
|
...(options?.cursor ? { cursor: options.cursor } : {}),
|
|
27
27
|
...(!options?.query ? {} : options?.query == "review" ? { status: "review" } : { order: options?.query }),
|
|
28
28
|
...(options?.dateRange ?? {}),
|
|
29
|
-
detailed: "true",
|
|
30
29
|
})
|
|
31
30
|
.map(([k, v]) => `${k}=${v}`)
|
|
32
31
|
.join("&")
|
|
@@ -38,9 +37,7 @@ export class Transactions extends rest.Collection<gracely.Error> {
|
|
|
38
37
|
}
|
|
39
38
|
async fetch(transaction: string, account?: string): Promise<Transaction | gracely.Error> {
|
|
40
39
|
return this.client.get<Transaction>(
|
|
41
|
-
account
|
|
42
|
-
? `/account/${account}/transaction/${transaction}?detailed=true`
|
|
43
|
-
: `/transaction/${transaction}?detailed=true`
|
|
40
|
+
account ? `/account/${account}/transaction/${transaction}` : `/transaction/${transaction}`
|
|
44
41
|
)
|
|
45
42
|
}
|
|
46
43
|
async statistics(
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Card as modelCard } from "../../../Card";
|
|
2
|
+
import { Base } from "./Base";
|
|
3
|
+
export interface Card extends Base<modelCard> {
|
|
4
|
+
entity: {
|
|
5
|
+
type: "card";
|
|
6
|
+
id: string;
|
|
7
|
+
};
|
|
8
|
+
action: "created" | "updated" | "cancelled";
|
|
9
|
+
}
|
|
10
|
+
export declare namespace Card {
|
|
11
|
+
function create(value: modelCard, action: Card["action"]): Card;
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { isoly } from "isoly";
|
|
2
|
+
export var Card;
|
|
3
|
+
(function (Card) {
|
|
4
|
+
function create(value, action) {
|
|
5
|
+
return {
|
|
6
|
+
realm: value.realm,
|
|
7
|
+
entity: { type: "card", id: value.id },
|
|
8
|
+
organization: value.organization,
|
|
9
|
+
account: value.account,
|
|
10
|
+
action,
|
|
11
|
+
created: isoly.DateTime.now(),
|
|
12
|
+
value,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
Card.create = create;
|
|
16
|
+
})(Card || (Card = {}));
|
|
17
|
+
//# sourceMappingURL=Card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.js","sourceRoot":"../","sources":["Analytics/Event/Ledger/Card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAQ7B,MAAM,KAAW,IAAI,CAYpB;AAZD,WAAiB,IAAI;IACpB,SAAgB,MAAM,CAAC,KAAgB,EAAE,MAAsB;QAC9D,OAAO;YACN,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE;YACtC,YAAY,EAAE,KAAK,CAAC,YAAY;YAChC,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,MAAM;YACN,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE;YAC7B,KAAK;SACL,CAAA;IACF,CAAC;IAVe,WAAM,SAUrB,CAAA;AACF,CAAC,EAZgB,IAAI,KAAJ,IAAI,QAYpB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Account as AccountEvent } from "./Account";
|
|
2
2
|
import { Base as EventBase } from "./Base";
|
|
3
|
+
import { Card as CardEvent } from "./Card";
|
|
3
4
|
import { Operation as OperationEvent } from "./Operation";
|
|
4
5
|
import { Organization as OrganizationEvent } from "./Organization";
|
|
5
6
|
import { Rule as RuleEvent } from "./Rule";
|
|
@@ -13,4 +14,5 @@ export declare namespace Ledger {
|
|
|
13
14
|
export import Rule = RuleEvent;
|
|
14
15
|
export import Operation = OperationEvent;
|
|
15
16
|
export import User = UserEvent;
|
|
17
|
+
export import Card = CardEvent;
|
|
16
18
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Account as AccountEvent } from "./Account";
|
|
2
|
+
import { Card as CardEvent } from "./Card";
|
|
2
3
|
import { Operation as OperationEvent } from "./Operation";
|
|
3
4
|
import { Organization as OrganizationEvent } from "./Organization";
|
|
4
5
|
import { Rule as RuleEvent } from "./Rule";
|
|
@@ -12,5 +13,6 @@ export var Ledger;
|
|
|
12
13
|
Ledger.Rule = RuleEvent;
|
|
13
14
|
Ledger.Operation = OperationEvent;
|
|
14
15
|
Ledger.User = UserEvent;
|
|
16
|
+
Ledger.Card = CardEvent;
|
|
15
17
|
})(Ledger || (Ledger = {}));
|
|
16
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Analytics/Event/Ledger/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA;AAEnD,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,aAAa,CAAA;AACzD,OAAO,EAAE,YAAY,IAAI,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClE,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,QAAQ,CAAA;AAC1C,OAAO,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAC/D,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,QAAQ,CAAA;AAE1C,MAAM,KAAW,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Analytics/Event/Ledger/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA;AAEnD,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,QAAQ,CAAA;AAC1C,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,aAAa,CAAA;AACzD,OAAO,EAAE,YAAY,IAAI,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClE,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,QAAQ,CAAA;AAC1C,OAAO,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAC/D,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,QAAQ,CAAA;AAE1C,MAAM,KAAW,MAAM,CAStB;AATD,WAAiB,MAAM;IAER,kBAAW,GAAG,gBAAgB,CAAA;IAC9B,cAAO,GAAG,YAAY,CAAA;IACtB,mBAAY,GAAG,iBAAiB,CAAA;IAChC,WAAI,GAAG,SAAS,CAAA;IAChB,gBAAS,GAAG,cAAc,CAAA;IAC1B,WAAI,GAAG,SAAS,CAAA;IAChB,WAAI,GAAG,SAAS,CAAA;AAC/B,CAAC,EATgB,MAAM,KAAN,MAAM,QAStB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AuditLog as AuditLogEvent } from "./AuditLog";
|
|
2
2
|
import { Base as EventBase } from "./Base";
|
|
3
3
|
import { Ledger as EventLedger } from "./Ledger";
|
|
4
|
-
export type Event = (Event.Ledger.Transaction | Event.Ledger.Operation | Event.Ledger.Organization | Event.Ledger.Rule | Event.Ledger.Account | Event.Ledger.User | Event.AuditLog) & {
|
|
4
|
+
export type Event = (Event.Ledger.Transaction | Event.Ledger.Operation | Event.Ledger.Organization | Event.Ledger.Rule | Event.Ledger.Account | Event.Ledger.Card | Event.Ledger.User | Event.AuditLog) & {
|
|
5
5
|
version: string;
|
|
6
6
|
};
|
|
7
7
|
export declare namespace Event {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Analytics/Event/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,aAAa,EAAE,MAAM,YAAY,CAAA;AAEtD,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Analytics/Event/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,aAAa,EAAE,MAAM,YAAY,CAAA;AAEtD,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,UAAU,CAAA;AAYhD,MAAM,KAAW,KAAK,CAIrB;AAJD,WAAiB,KAAK;IAEP,YAAM,GAAG,WAAW,CAAA;IACpB,cAAQ,GAAG,aAAa,CAAA;AACvC,CAAC,EAJgB,KAAK,KAAL,KAAK,QAIrB"}
|
|
@@ -14,7 +14,6 @@ export class Transactions extends rest.Collection {
|
|
|
14
14
|
...(options?.cursor ? { cursor: options.cursor } : {}),
|
|
15
15
|
...(!options?.query ? {} : options?.query == "review" ? { status: "review" } : { order: options?.query }),
|
|
16
16
|
...(options?.dateRange ?? {}),
|
|
17
|
-
detailed: "true",
|
|
18
17
|
})
|
|
19
18
|
.map(([k, v]) => `${k}=${v}`)
|
|
20
19
|
.join("&");
|
|
@@ -22,9 +21,7 @@ export class Transactions extends rest.Collection {
|
|
|
22
21
|
return await this.client.get(path + (query && "?" + query), options?.limit ? { limit: options?.limit.toString() } : {});
|
|
23
22
|
}
|
|
24
23
|
async fetch(transaction, account) {
|
|
25
|
-
return this.client.get(account
|
|
26
|
-
? `/account/${account}/transaction/${transaction}?detailed=true`
|
|
27
|
-
: `/transaction/${transaction}?detailed=true`);
|
|
24
|
+
return this.client.get(account ? `/account/${account}/transaction/${transaction}` : `/transaction/${transaction}`);
|
|
28
25
|
}
|
|
29
26
|
async statistics(range, queries) {
|
|
30
27
|
const query = "?" + http.Search.stringify({ ...queries, ...range });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Transactions/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAIpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,MAAM,OAAO,YAAa,SAAQ,IAAI,CAAC,UAAyB;IAE/D,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;QAFL,UAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAGvC,CAAC;IACD,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;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Transactions/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,IAAI,MAAM,cAAc,C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