@pax2pay/model-banking 0.1.140 → 0.1.142
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/Client/Flags.ts +16 -0
- package/Client/Transactions/index.ts +17 -19
- package/Client/index.ts +2 -0
- package/Flag.ts +5 -0
- package/Transaction/Status.ts +9 -0
- package/Transaction/index.ts +22 -20
- package/dist/Client/Flags.d.ts +10 -0
- package/dist/Client/Flags.js +15 -0
- package/dist/Client/Flags.js.map +1 -0
- package/dist/Client/Transactions/index.d.ts +14 -6
- package/dist/Client/Transactions/index.js +5 -11
- package/dist/Client/Transactions/index.js.map +1 -1
- package/dist/Client/index.d.ts +2 -0
- package/dist/Client/index.js +2 -0
- package/dist/Client/index.js.map +1 -1
- package/dist/Flag.d.ts +5 -0
- package/dist/Flag.js +2 -0
- package/dist/Flag.js.map +1 -0
- package/dist/Transaction/Status.d.ts +8 -0
- package/dist/Transaction/Status.js +9 -0
- package/dist/Transaction/Status.js.map +1 -0
- package/dist/Transaction/index.d.ts +18 -14
- package/dist/Transaction/index.js +10 -7
- package/dist/Transaction/index.js.map +1 -1
- package/dist/pax2pay.d.ts +1 -0
- package/package.json +1 -1
- package/pax2pay.ts +1 -0
package/Client/Flags.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { gracely } from "gracely"
|
|
2
|
+
import { http } from "cloudly-http"
|
|
3
|
+
import { Flag } from "../Flag"
|
|
4
|
+
|
|
5
|
+
export class Flags {
|
|
6
|
+
constructor(private readonly client: http.Client) {}
|
|
7
|
+
async replace(flag: Flag): Promise<Flag | gracely.Error> {
|
|
8
|
+
return this.client.put(`/flag/${flag.name}`, flag)
|
|
9
|
+
}
|
|
10
|
+
async list(): Promise<Flag[] | gracely.Error> {
|
|
11
|
+
return this.client.get("/flag")
|
|
12
|
+
}
|
|
13
|
+
async remove(name: string): Promise<Flag | gracely.Error> {
|
|
14
|
+
return this.client.delete(`/flag/${name}`)
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { gracely } from "gracely"
|
|
2
|
+
import { isoly } from "isoly"
|
|
2
3
|
import { http } from "cloudly-http"
|
|
3
4
|
import * as rest from "cloudly-rest"
|
|
4
5
|
import { Transaction } from "../../Transaction"
|
|
@@ -16,27 +17,24 @@ export class Transactions extends rest.Collection<gracely.Error> {
|
|
|
16
17
|
account?: string
|
|
17
18
|
limit?: number
|
|
18
19
|
cursor?: string
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
direction?: "inbound" | "outbound"
|
|
22
|
-
rail?: "internal"
|
|
23
|
-
start?: string
|
|
24
|
-
end?: string
|
|
20
|
+
index?: Transactions.Index
|
|
21
|
+
dateRange?: isoly.DateRange
|
|
25
22
|
}): Promise<(Transaction[] & { cursor?: string | undefined }) | gracely.Error> {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
.reduce((prev, curr, i) => `${prev}${i == 0 ? "?" : "&"}${curr}`, "")
|
|
31
|
-
: ""
|
|
32
|
-
const path = options && options.account ? `/account/${options.account}/transaction${query}` : `/transaction${query}`
|
|
23
|
+
const query = Object.entries({ ...(options?.index ?? {}), ...(options?.dateRange ?? {}) })
|
|
24
|
+
.map(([k, v]) => `${k}=${v}`)
|
|
25
|
+
.join("&")
|
|
26
|
+
const path = options?.account ? `/account/${options.account}/transaction` : `/transaction`
|
|
33
27
|
return this.client.get<Transaction[] & { cursor?: string | undefined }>(
|
|
34
|
-
path,
|
|
35
|
-
options
|
|
36
|
-
(({ limit, cursor }) =>
|
|
37
|
-
limit || cursor
|
|
38
|
-
? { ...(limit ? { limit: limit.toString() } : {}), ...(cursor ? { cursor: cursor } : {}) }
|
|
39
|
-
: undefined)(options)
|
|
28
|
+
path + (query && "?" + query),
|
|
29
|
+
options?.limit ? { limit: options?.limit.toString() } : {}
|
|
40
30
|
)
|
|
41
31
|
}
|
|
42
32
|
}
|
|
33
|
+
|
|
34
|
+
export namespace Transactions {
|
|
35
|
+
export type Index =
|
|
36
|
+
| { status: "review" | "created" | "approved" | "rejected" | "processing" | "finalized" }
|
|
37
|
+
| { currency: isoly.Currency }
|
|
38
|
+
| { direction: "inbound" | "outbound" }
|
|
39
|
+
| { rail: "internal" }
|
|
40
|
+
}
|
package/Client/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { http } from "cloudly-http"
|
|
|
4
4
|
import { rest } from "cloudly-rest"
|
|
5
5
|
import { Accounts } from "./Accounts"
|
|
6
6
|
import { Cards } from "./Cards"
|
|
7
|
+
import { Flags } from "./Flags"
|
|
7
8
|
import { Operations } from "./Operations"
|
|
8
9
|
import { Organizations } from "./Organizations"
|
|
9
10
|
import { Rules } from "./Rules"
|
|
@@ -23,6 +24,7 @@ export class Client extends rest.Client<gracely.Error> {
|
|
|
23
24
|
readonly settlements = new Settlements(this.client)
|
|
24
25
|
readonly transactions = new Transactions(this.client)
|
|
25
26
|
readonly treasury = new Treasury(this.client)
|
|
27
|
+
readonly flags = new Flags(this.client)
|
|
26
28
|
readonly userwidgets = new userwidgets.ClientCollection(this.client, { pathPrefix: "/widgets" })
|
|
27
29
|
readonly version = new Version(this.client)
|
|
28
30
|
|
package/Flag.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { isly } from "isly"
|
|
2
|
+
|
|
3
|
+
export type Status = typeof Status.values[number]
|
|
4
|
+
export namespace Status {
|
|
5
|
+
export const values = ["created", "approved", "rejected", "processing", "finalized"] as const
|
|
6
|
+
export const type = isly.string(values)
|
|
7
|
+
export const is = type.is
|
|
8
|
+
export const flaw = type.flaw
|
|
9
|
+
}
|
package/Transaction/index.ts
CHANGED
|
@@ -7,38 +7,52 @@ import { Creatable as TransactionCreatable } from "./Creatable"
|
|
|
7
7
|
import { Incoming as TransactionIncoming } from "./Incoming"
|
|
8
8
|
import { Note as TransactionNote } from "./Note"
|
|
9
9
|
import { Reference as TransactionReference } from "./Reference"
|
|
10
|
+
import { Status as TransactionStatus } from "./Status"
|
|
10
11
|
|
|
11
|
-
export interface Transaction extends
|
|
12
|
+
export interface Transaction extends Transaction.Creatable {
|
|
12
13
|
organization: string
|
|
13
14
|
accountId: string
|
|
14
15
|
account: Rail
|
|
15
16
|
readonly id: cryptly.Identifier
|
|
16
|
-
readonly reference?:
|
|
17
|
+
readonly reference?: Transaction.Reference
|
|
17
18
|
readonly posted: isoly.DateTime
|
|
18
19
|
transacted?: isoly.DateTime
|
|
19
20
|
balance: number
|
|
20
21
|
operations: Operation[]
|
|
21
|
-
status:
|
|
22
|
+
status: Transaction.Status
|
|
22
23
|
flags: ("review" | string)[]
|
|
23
24
|
oldFlags: string[]
|
|
24
|
-
notes:
|
|
25
|
+
notes: Transaction.Note[]
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
export namespace Transaction {
|
|
28
|
-
export
|
|
29
|
+
export type Creatable = TransactionCreatable
|
|
30
|
+
export const Creatable = TransactionCreatable
|
|
31
|
+
export type Incoming = TransactionIncoming
|
|
32
|
+
export const Incoming = TransactionIncoming
|
|
33
|
+
export type Reference = TransactionReference
|
|
34
|
+
export const Reference = TransactionReference
|
|
35
|
+
export type Note = TransactionNote
|
|
36
|
+
export const Note = TransactionNote
|
|
37
|
+
export type Status = TransactionStatus
|
|
38
|
+
export const Status = TransactionStatus
|
|
39
|
+
export namespace Note {
|
|
40
|
+
export type Creatable = TransactionNote.Creatable
|
|
41
|
+
}
|
|
42
|
+
export const type = Creatable.type.extend<Transaction>({
|
|
29
43
|
organization: isly.string(),
|
|
30
44
|
accountId: isly.string(),
|
|
31
45
|
account: isly.fromIs("Rail", Rail.is),
|
|
32
46
|
id: isly.fromIs("cryptly.Identifier", cryptly.Identifier.is).readonly(),
|
|
33
|
-
reference: isly.fromIs("TransactionReference",
|
|
47
|
+
reference: isly.fromIs("TransactionReference", Reference.is).readonly().optional(),
|
|
34
48
|
posted: isly.string(),
|
|
35
49
|
transacted: isly.string().optional(),
|
|
36
50
|
balance: isly.number(),
|
|
37
51
|
operations: isly.array(isly.fromIs("Operation", Operation.is)),
|
|
38
|
-
status:
|
|
52
|
+
status: Status.type,
|
|
39
53
|
flags: isly.array(isly.string() || "review"),
|
|
40
54
|
oldFlags: isly.string().array(),
|
|
41
|
-
notes: isly.array(isly.fromIs("TransactionNote",
|
|
55
|
+
notes: isly.array(isly.fromIs("TransactionNote", Note.is)),
|
|
42
56
|
})
|
|
43
57
|
export const is = type.is
|
|
44
58
|
export const flaw = type.flaw
|
|
@@ -71,7 +85,6 @@ export namespace Transaction {
|
|
|
71
85
|
notes: [],
|
|
72
86
|
}
|
|
73
87
|
}
|
|
74
|
-
|
|
75
88
|
export function fromIncoming(
|
|
76
89
|
organization: string,
|
|
77
90
|
accountId: string,
|
|
@@ -99,15 +112,4 @@ export namespace Transaction {
|
|
|
99
112
|
export function isIdentifier(value: cryptly.Identifier | any): value is cryptly.Identifier {
|
|
100
113
|
return cryptly.Identifier.is(value, 8)
|
|
101
114
|
}
|
|
102
|
-
|
|
103
|
-
export type Creatable = TransactionCreatable
|
|
104
|
-
export const Creatable = TransactionCreatable
|
|
105
|
-
export type Incoming = TransactionIncoming
|
|
106
|
-
export const Incoming = TransactionIncoming
|
|
107
|
-
export type Reference = TransactionReference
|
|
108
|
-
export type Note = TransactionNote
|
|
109
|
-
export const Note = TransactionNote
|
|
110
|
-
export namespace Note {
|
|
111
|
-
export type Creatable = TransactionNote.Creatable
|
|
112
|
-
}
|
|
113
115
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { gracely } from "gracely";
|
|
2
|
+
import { http } from "cloudly-http";
|
|
3
|
+
import { Flag } from "../Flag";
|
|
4
|
+
export declare class Flags {
|
|
5
|
+
private readonly client;
|
|
6
|
+
constructor(client: http.Client);
|
|
7
|
+
replace(flag: Flag): Promise<Flag | gracely.Error>;
|
|
8
|
+
list(): Promise<Flag[] | gracely.Error>;
|
|
9
|
+
remove(name: string): Promise<Flag | gracely.Error>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export class Flags {
|
|
2
|
+
constructor(client) {
|
|
3
|
+
this.client = client;
|
|
4
|
+
}
|
|
5
|
+
async replace(flag) {
|
|
6
|
+
return this.client.put(`/flag/${flag.name}`, flag);
|
|
7
|
+
}
|
|
8
|
+
async list() {
|
|
9
|
+
return this.client.get("/flag");
|
|
10
|
+
}
|
|
11
|
+
async remove(name) {
|
|
12
|
+
return this.client.delete(`/flag/${name}`);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=Flags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Flags.js","sourceRoot":"../","sources":["Client/Flags.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,KAAK;IACjB,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IACpD,KAAK,CAAC,OAAO,CAAC,IAAU;QACvB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,CAAA;IACnD,CAAC;IACD,KAAK,CAAC,IAAI;QACT,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IAChC,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,IAAY;QACxB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC,CAAA;IAC3C,CAAC;CACD"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { gracely } from "gracely";
|
|
2
|
+
import { isoly } from "isoly";
|
|
2
3
|
import { http } from "cloudly-http";
|
|
3
4
|
import * as rest from "cloudly-rest";
|
|
4
5
|
import { Transaction } from "../../Transaction";
|
|
@@ -11,13 +12,20 @@ export declare class Transactions extends rest.Collection<gracely.Error> {
|
|
|
11
12
|
account?: string;
|
|
12
13
|
limit?: number;
|
|
13
14
|
cursor?: string;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
direction?: "inbound" | "outbound";
|
|
17
|
-
rail?: "internal";
|
|
18
|
-
start?: string;
|
|
19
|
-
end?: string;
|
|
15
|
+
index?: Transactions.Index;
|
|
16
|
+
dateRange?: isoly.DateRange;
|
|
20
17
|
}): Promise<(Transaction[] & {
|
|
21
18
|
cursor?: string | undefined;
|
|
22
19
|
}) | gracely.Error>;
|
|
23
20
|
}
|
|
21
|
+
export declare namespace Transactions {
|
|
22
|
+
type Index = {
|
|
23
|
+
status: "review" | "created" | "approved" | "rejected" | "processing" | "finalized";
|
|
24
|
+
} | {
|
|
25
|
+
currency: isoly.Currency;
|
|
26
|
+
} | {
|
|
27
|
+
direction: "inbound" | "outbound";
|
|
28
|
+
} | {
|
|
29
|
+
rail: "internal";
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -9,17 +9,11 @@ export class Transactions extends rest.Collection {
|
|
|
9
9
|
return this.client.post(`/account/${account}/transaction`, transaction);
|
|
10
10
|
}
|
|
11
11
|
async list(options) {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
: "";
|
|
18
|
-
const path = options && options.account ? `/account/${options.account}/transaction${query}` : `/transaction${query}`;
|
|
19
|
-
return this.client.get(path, options &&
|
|
20
|
-
(({ limit, cursor }) => limit || cursor
|
|
21
|
-
? { ...(limit ? { limit: limit.toString() } : {}), ...(cursor ? { cursor: cursor } : {}) }
|
|
22
|
-
: undefined)(options));
|
|
12
|
+
const query = Object.entries({ ...(options?.index ?? {}), ...(options?.dateRange ?? {}) })
|
|
13
|
+
.map(([k, v]) => `${k}=${v}`)
|
|
14
|
+
.join("&");
|
|
15
|
+
const path = options?.account ? `/account/${options.account}/transaction` : `/transaction`;
|
|
16
|
+
return this.client.get(path + (query && "?" + query), options?.limit ? { limit: options?.limit.toString() } : {});
|
|
23
17
|
}
|
|
24
18
|
}
|
|
25
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Transactions/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Transactions/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAEpC,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,EAAE,GAAG,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,OAAO,EAAE,SAAS,IAAI,EAAE,CAAC,EAAE,CAAC;aACxF,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;aAC5B,IAAI,CAAC,GAAG,CAAC,CAAA;QACX,MAAM,IAAI,GAAG,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,YAAY,OAAO,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,cAAc,CAAA;QAC1F,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CACrB,IAAI,GAAG,CAAC,KAAK,IAAI,GAAG,GAAG,KAAK,CAAC,EAC7B,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAC1D,CAAA;IACF,CAAC;CACD"}
|
package/dist/Client/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { http } from "cloudly-http";
|
|
|
4
4
|
import { rest } from "cloudly-rest";
|
|
5
5
|
import { Accounts } from "./Accounts";
|
|
6
6
|
import { Cards } from "./Cards";
|
|
7
|
+
import { Flags } from "./Flags";
|
|
7
8
|
import { Operations } from "./Operations";
|
|
8
9
|
import { Organizations } from "./Organizations";
|
|
9
10
|
import { Rules } from "./Rules";
|
|
@@ -22,6 +23,7 @@ export declare class Client extends rest.Client<gracely.Error> {
|
|
|
22
23
|
readonly settlements: Settlements;
|
|
23
24
|
readonly transactions: Transactions;
|
|
24
25
|
readonly treasury: Treasury;
|
|
26
|
+
readonly flags: Flags;
|
|
25
27
|
readonly userwidgets: userwidgets.ClientCollection;
|
|
26
28
|
readonly version: Version;
|
|
27
29
|
static create<T = Record<string, any>>(server: string, key: string, load?: (client: http.Client) => T): Client & T;
|
package/dist/Client/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { http } from "cloudly-http";
|
|
|
3
3
|
import { rest } from "cloudly-rest";
|
|
4
4
|
import { Accounts } from "./Accounts";
|
|
5
5
|
import { Cards } from "./Cards";
|
|
6
|
+
import { Flags } from "./Flags";
|
|
6
7
|
import { Operations } from "./Operations";
|
|
7
8
|
import { Organizations } from "./Organizations";
|
|
8
9
|
import { Rules } from "./Rules";
|
|
@@ -21,6 +22,7 @@ export class Client extends rest.Client {
|
|
|
21
22
|
this.settlements = new Settlements(this.client);
|
|
22
23
|
this.transactions = new Transactions(this.client);
|
|
23
24
|
this.treasury = new Treasury(this.client);
|
|
25
|
+
this.flags = new Flags(this.client);
|
|
24
26
|
this.userwidgets = new userwidgets.ClientCollection(this.client, { pathPrefix: "/widgets" });
|
|
25
27
|
this.version = new Version(this.client);
|
|
26
28
|
}
|
package/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AsC,CAAA;QAC1C,MAAM,MAAM,GAAW,IAAI,MAAM,CAChC,CAAC,UAAU,GAAG,IAAI,IAAI,CAAC,MAAM,CAAgB,MAAM,EAAE,GAAG,EAAE;YACzD,YAAY,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC;SACxG,CAAC,CAAC,CACH,CAAA;QACD,IAAI,IAAI;YACP,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAA;QACxC,OAAO,MAAoB,CAAA;IAC5B,CAAC;CACD"}
|
package/dist/Flag.d.ts
ADDED
package/dist/Flag.js
ADDED
package/dist/Flag.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Flag.js","sourceRoot":"../","sources":["Flag.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { isly } from "isly";
|
|
2
|
+
export type Status = typeof Status.values[number];
|
|
3
|
+
export declare namespace Status {
|
|
4
|
+
const values: readonly ["created", "approved", "rejected", "processing", "finalized"];
|
|
5
|
+
const type: isly.Type<"rejected" | "created" | "approved" | "processing" | "finalized">;
|
|
6
|
+
const is: isly.Type.IsFunction<"rejected" | "created" | "approved" | "processing" | "finalized">;
|
|
7
|
+
const flaw: isly.Type.FlawFunction;
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { isly } from "isly";
|
|
2
|
+
export var Status;
|
|
3
|
+
(function (Status) {
|
|
4
|
+
Status.values = ["created", "approved", "rejected", "processing", "finalized"];
|
|
5
|
+
Status.type = isly.string(Status.values);
|
|
6
|
+
Status.is = Status.type.is;
|
|
7
|
+
Status.flaw = Status.type.flaw;
|
|
8
|
+
})(Status || (Status = {}));
|
|
9
|
+
//# sourceMappingURL=Status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Status.js","sourceRoot":"../","sources":["Transaction/Status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,MAAM,KAAW,MAAM,CAKtB;AALD,WAAiB,MAAM;IACT,aAAM,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,CAAU,CAAA;IAChF,WAAI,GAAG,IAAI,CAAC,MAAM,CAAC,OAAA,MAAM,CAAC,CAAA;IAC1B,SAAE,GAAG,OAAA,IAAI,CAAC,EAAE,CAAA;IACZ,WAAI,GAAG,OAAA,IAAI,CAAC,IAAI,CAAA;AAC9B,CAAC,EALgB,MAAM,KAAN,MAAM,QAKtB"}
|
|
@@ -7,22 +7,36 @@ import { Creatable as TransactionCreatable } from "./Creatable";
|
|
|
7
7
|
import { Incoming as TransactionIncoming } from "./Incoming";
|
|
8
8
|
import { Note as TransactionNote } from "./Note";
|
|
9
9
|
import { Reference as TransactionReference } from "./Reference";
|
|
10
|
-
|
|
10
|
+
import { Status as TransactionStatus } from "./Status";
|
|
11
|
+
export interface Transaction extends Transaction.Creatable {
|
|
11
12
|
organization: string;
|
|
12
13
|
accountId: string;
|
|
13
14
|
account: Rail;
|
|
14
15
|
readonly id: cryptly.Identifier;
|
|
15
|
-
readonly reference?:
|
|
16
|
+
readonly reference?: Transaction.Reference;
|
|
16
17
|
readonly posted: isoly.DateTime;
|
|
17
18
|
transacted?: isoly.DateTime;
|
|
18
19
|
balance: number;
|
|
19
20
|
operations: Operation[];
|
|
20
|
-
status:
|
|
21
|
+
status: Transaction.Status;
|
|
21
22
|
flags: ("review" | string)[];
|
|
22
23
|
oldFlags: string[];
|
|
23
|
-
notes:
|
|
24
|
+
notes: Transaction.Note[];
|
|
24
25
|
}
|
|
25
26
|
export declare namespace Transaction {
|
|
27
|
+
type Creatable = TransactionCreatable;
|
|
28
|
+
const Creatable: typeof TransactionCreatable;
|
|
29
|
+
type Incoming = TransactionIncoming;
|
|
30
|
+
const Incoming: typeof TransactionIncoming;
|
|
31
|
+
type Reference = TransactionReference;
|
|
32
|
+
const Reference: typeof TransactionReference;
|
|
33
|
+
type Note = TransactionNote;
|
|
34
|
+
const Note: typeof TransactionNote;
|
|
35
|
+
type Status = TransactionStatus;
|
|
36
|
+
const Status: typeof TransactionStatus;
|
|
37
|
+
namespace Note {
|
|
38
|
+
type Creatable = TransactionNote.Creatable;
|
|
39
|
+
}
|
|
26
40
|
const type: isly.object.ExtendableType<Transaction>;
|
|
27
41
|
const is: isly.Type.IsFunction<Transaction>;
|
|
28
42
|
const flaw: isly.Type.FlawFunction;
|
|
@@ -34,14 +48,4 @@ export declare namespace Transaction {
|
|
|
34
48
|
operations: Operation.Creatable[];
|
|
35
49
|
}, result: number): Transaction;
|
|
36
50
|
function isIdentifier(value: cryptly.Identifier | any): value is cryptly.Identifier;
|
|
37
|
-
type Creatable = TransactionCreatable;
|
|
38
|
-
const Creatable: typeof TransactionCreatable;
|
|
39
|
-
type Incoming = TransactionIncoming;
|
|
40
|
-
const Incoming: typeof TransactionIncoming;
|
|
41
|
-
type Reference = TransactionReference;
|
|
42
|
-
type Note = TransactionNote;
|
|
43
|
-
const Note: typeof TransactionNote;
|
|
44
|
-
namespace Note {
|
|
45
|
-
type Creatable = TransactionNote.Creatable;
|
|
46
|
-
}
|
|
47
51
|
}
|
|
@@ -7,22 +7,28 @@ import { Creatable as TransactionCreatable } from "./Creatable";
|
|
|
7
7
|
import { Incoming as TransactionIncoming } from "./Incoming";
|
|
8
8
|
import { Note as TransactionNote } from "./Note";
|
|
9
9
|
import { Reference as TransactionReference } from "./Reference";
|
|
10
|
+
import { Status as TransactionStatus } from "./Status";
|
|
10
11
|
export var Transaction;
|
|
11
12
|
(function (Transaction) {
|
|
12
|
-
Transaction.
|
|
13
|
+
Transaction.Creatable = TransactionCreatable;
|
|
14
|
+
Transaction.Incoming = TransactionIncoming;
|
|
15
|
+
Transaction.Reference = TransactionReference;
|
|
16
|
+
Transaction.Note = TransactionNote;
|
|
17
|
+
Transaction.Status = TransactionStatus;
|
|
18
|
+
Transaction.type = Transaction.Creatable.type.extend({
|
|
13
19
|
organization: isly.string(),
|
|
14
20
|
accountId: isly.string(),
|
|
15
21
|
account: isly.fromIs("Rail", Rail.is),
|
|
16
22
|
id: isly.fromIs("cryptly.Identifier", cryptly.Identifier.is).readonly(),
|
|
17
|
-
reference: isly.fromIs("TransactionReference",
|
|
23
|
+
reference: isly.fromIs("TransactionReference", Transaction.Reference.is).readonly().optional(),
|
|
18
24
|
posted: isly.string(),
|
|
19
25
|
transacted: isly.string().optional(),
|
|
20
26
|
balance: isly.number(),
|
|
21
27
|
operations: isly.array(isly.fromIs("Operation", Operation.is)),
|
|
22
|
-
status:
|
|
28
|
+
status: Transaction.Status.type,
|
|
23
29
|
flags: isly.array(isly.string() || "review"),
|
|
24
30
|
oldFlags: isly.string().array(),
|
|
25
|
-
notes: isly.array(isly.fromIs("TransactionNote",
|
|
31
|
+
notes: isly.array(isly.fromIs("TransactionNote", Transaction.Note.is)),
|
|
26
32
|
});
|
|
27
33
|
Transaction.is = Transaction.type.is;
|
|
28
34
|
Transaction.flaw = Transaction.type.flaw;
|
|
@@ -74,8 +80,5 @@ export var Transaction;
|
|
|
74
80
|
return cryptly.Identifier.is(value, 8);
|
|
75
81
|
}
|
|
76
82
|
Transaction.isIdentifier = isIdentifier;
|
|
77
|
-
Transaction.Creatable = TransactionCreatable;
|
|
78
|
-
Transaction.Incoming = TransactionIncoming;
|
|
79
|
-
Transaction.Note = TransactionNote;
|
|
80
83
|
})(Transaction || (Transaction = {}));
|
|
81
84
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Transaction/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,KAA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