@pax2pay/model-banking 0.0.21 → 0.0.23

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/Balances/type.ts CHANGED
@@ -1,7 +1,9 @@
1
- export type BalanceEntry = "actual" | "reserved"
1
+ export type BalanceEntry = "actual" | "incoming reserved" | "outgoing reserved"
2
2
 
3
3
  export namespace BalanceEntry {
4
4
  export function is(value: any | BalanceEntry): value is BalanceEntry {
5
- return typeof value == "string" && (value == "actual" || value == "reserved")
5
+ return (
6
+ typeof value == "string" && (value == "actual" || value == "incoming reserved" || value == "outgoing reserved")
7
+ )
6
8
  }
7
9
  }
@@ -0,0 +1,21 @@
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
+
6
+ export class Notes extends rest.Collection<gracely.Error> {
7
+ constructor(client: http.Client) {
8
+ super(client)
9
+ }
10
+ async create(
11
+ organization: string,
12
+ account: string,
13
+ transaction: string,
14
+ note: Transaction.Note
15
+ ): Promise<Transaction | gracely.Error> {
16
+ return this.client.post<Transaction>(`/transaction/${transaction}/note`, note, {
17
+ organization: organization,
18
+ account: account,
19
+ })
20
+ }
21
+ }
@@ -1,11 +1,11 @@
1
1
  import * as gracely from "gracely"
2
2
  import * as http from "cloudly-http"
3
3
  import * as rest from "cloudly-rest"
4
- import { Transaction } from "../Transaction"
5
- import { Comments } from "./Comments"
4
+ import { Transaction } from "../../Transaction"
5
+ import { Notes } from "./Notes"
6
6
 
7
7
  export class Transactions extends rest.Collection<gracely.Error> {
8
- readonly comments = new Comments(this.client)
8
+ readonly Notes = new Notes(this.client)
9
9
  constructor(client: http.Client) {
10
10
  super(client)
11
11
  }
@@ -0,0 +1,20 @@
1
+ import * as isoly from "isoly"
2
+ export interface Note extends Note.Creatable {
3
+ author: string
4
+ created: isoly.DateTime
5
+ }
6
+
7
+ export namespace Note {
8
+ export function fromCreatable(note: Creatable, author: string): Note {
9
+ return { ...note, created: isoly.DateTime.now(), author: author }
10
+ }
11
+ export namespace Creatable {
12
+ export function is(value: Creatable | any): value is Note {
13
+ return true
14
+ }
15
+ }
16
+ export interface Creatable {
17
+ text?: string
18
+ action?: "approve" | "reject"
19
+ }
20
+ }
@@ -2,20 +2,22 @@ import * as cryptly from "cryptly"
2
2
  import * as isoly from "isoly"
3
3
  import { Operation } from "../Operation"
4
4
  import { Rail } from "../Rail"
5
- import { Comment as TransactionComment } from "./Comment"
6
5
  import { Creatable as TransactionCreatable } from "./Creatable"
7
6
  import { Incoming as TransactionIncoming } from "./Incoming"
7
+ import { Note as TransactionNote } from "./Note"
8
8
 
9
9
  export interface Transaction extends TransactionCreatable {
10
+ organization: string
11
+ accountId: string
10
12
  account: Rail
11
13
  readonly id: cryptly.Identifier
12
14
  readonly reference?: string
13
15
  readonly posted: isoly.DateTime
14
16
  readonly transacted?: isoly.DateTime
15
- type: "actual" | "available"
16
17
  balance: number
17
18
  operations: Operation[]
18
- comments?: TransactionComment[]
19
+ status: "created" | "approved" | "rejected" | "processing"
20
+ notes?: TransactionNote[]
19
21
  }
20
22
 
21
23
  export namespace Transaction {
@@ -32,9 +34,10 @@ export namespace Transaction {
32
34
  )
33
35
  }
34
36
  export function fromCreatable(
37
+ organization: string,
38
+ accountId: string,
35
39
  account: Rail,
36
40
  transaction: Creatable & { operations: Operation.Creatable[] },
37
- type: "actual" | "available",
38
41
  result: number
39
42
  ): Transaction {
40
43
  const id = cryptly.Identifier.generate(8)
@@ -44,19 +47,22 @@ export namespace Transaction {
44
47
  if ("posted" in transaction)
45
48
  delete transaction.posted
46
49
  return {
50
+ organization: organization,
51
+ accountId: accountId,
47
52
  account: account,
48
53
  id: id,
49
54
  posted: timestamp,
50
- type: type,
51
55
  balance: result,
52
56
  ...transaction,
53
57
  operations: transaction.operations.map(o => Operation.fromCreatable(id, o)),
58
+ status: "created",
54
59
  }
55
60
  }
56
61
 
57
62
  export function fromIncoming(
63
+ organization: string,
64
+ accountId: string,
58
65
  transaction: Incoming & { operations: Operation.Creatable[] },
59
- type: "actual" | "available",
60
66
  result: number
61
67
  ): Transaction {
62
68
  const id = cryptly.Identifier.generate(8)
@@ -65,11 +71,13 @@ export namespace Transaction {
65
71
  if ("transacted" in transaction)
66
72
  delete transaction.transacted
67
73
  return {
74
+ organization: organization,
75
+ accountId: accountId,
68
76
  id: id,
69
- type: type,
70
77
  balance: result,
71
78
  ...transaction,
72
79
  operations: transaction.operations.map(o => Operation.fromCreatable(id, o)),
80
+ status: "created",
73
81
  }
74
82
  }
75
83
  export function isIdentifier(value: cryptly.Identifier | any): value is cryptly.Identifier {
@@ -80,6 +88,9 @@ export namespace Transaction {
80
88
  export const Creatable = TransactionCreatable
81
89
  export type Incoming = TransactionIncoming
82
90
  export const Incoming = TransactionIncoming
83
- export type Comment = TransactionComment
84
- export const Comment = TransactionComment
91
+ export type Note = TransactionNote
92
+ export const Note = TransactionNote
93
+ export namespace Note {
94
+ export type Creatable = TransactionNote.Creatable
95
+ }
85
96
  }
@@ -1,4 +1,4 @@
1
- export type BalanceEntry = "actual" | "reserved";
1
+ export type BalanceEntry = "actual" | "incoming reserved" | "outgoing reserved";
2
2
  export declare namespace BalanceEntry {
3
3
  function is(value: any | BalanceEntry): value is BalanceEntry;
4
4
  }
@@ -1,7 +1,7 @@
1
1
  export var BalanceEntry;
2
2
  (function (BalanceEntry) {
3
3
  function is(value) {
4
- return typeof value == "string" && (value == "actual" || value == "reserved");
4
+ return (typeof value == "string" && (value == "actual" || value == "incoming reserved" || value == "outgoing reserved"));
5
5
  }
6
6
  BalanceEntry.is = is;
7
7
  })(BalanceEntry || (BalanceEntry = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"type.js","sourceRoot":"../","sources":["Balances/type.ts"],"names":[],"mappings":"AAEA,MAAM,KAAW,YAAY,CAI5B;AAJD,WAAiB,YAAY;IAC5B,SAAgB,EAAE,CAAC,KAAyB;QAC3C,OAAO,OAAO,KAAK,IAAI,QAAQ,IAAI,CAAC,KAAK,IAAI,QAAQ,IAAI,KAAK,IAAI,UAAU,CAAC,CAAA;IAC9E,CAAC;IAFe,eAAE,KAEjB,CAAA;AACF,CAAC,EAJgB,YAAY,KAAZ,YAAY,QAI5B"}
1
+ {"version":3,"file":"type.js","sourceRoot":"../","sources":["Balances/type.ts"],"names":[],"mappings":"AAEA,MAAM,KAAW,YAAY,CAM5B;AAND,WAAiB,YAAY;IAC5B,SAAgB,EAAE,CAAC,KAAyB;QAC3C,OAAO,CACN,OAAO,KAAK,IAAI,QAAQ,IAAI,CAAC,KAAK,IAAI,QAAQ,IAAI,KAAK,IAAI,mBAAmB,IAAI,KAAK,IAAI,mBAAmB,CAAC,CAC/G,CAAA;IACF,CAAC;IAJe,eAAE,KAIjB,CAAA;AACF,CAAC,EANgB,YAAY,KAAZ,YAAY,QAM5B"}
@@ -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 { Transaction } from "../../Transaction";
5
+ export declare class Notes extends rest.Collection<gracely.Error> {
6
+ constructor(client: http.Client);
7
+ create(organization: string, account: string, transaction: string, note: Transaction.Note): Promise<Transaction | gracely.Error>;
8
+ }
@@ -0,0 +1,13 @@
1
+ import * as rest from "cloudly-rest";
2
+ export class Notes extends rest.Collection {
3
+ constructor(client) {
4
+ super(client);
5
+ }
6
+ async create(organization, account, transaction, note) {
7
+ return this.client.post(`/transaction/${transaction}/note`, note, {
8
+ organization: organization,
9
+ account: account,
10
+ });
11
+ }
12
+ }
13
+ //# sourceMappingURL=Notes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Notes.js","sourceRoot":"../","sources":["Client/Transactions/Notes.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,CACX,YAAoB,EACpB,OAAe,EACf,WAAmB,EACnB,IAAsB;QAEtB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAc,gBAAgB,WAAW,OAAO,EAAE,IAAI,EAAE;YAC9E,YAAY,EAAE,YAAY;YAC1B,OAAO,EAAE,OAAO;SAChB,CAAC,CAAA;IACH,CAAC;CACD"}
@@ -1,10 +1,10 @@
1
1
  import * as gracely from "gracely";
2
2
  import * as http from "cloudly-http";
3
3
  import * as rest from "cloudly-rest";
4
- import { Transaction } from "../Transaction";
5
- import { Comments } from "./Comments";
4
+ import { Transaction } from "../../Transaction";
5
+ import { Notes } from "./Notes";
6
6
  export declare class Transactions extends rest.Collection<gracely.Error> {
7
- readonly comments: Comments;
7
+ readonly Notes: Notes;
8
8
  constructor(client: http.Client);
9
9
  create(account: string, transaction: Transaction.Creatable): Promise<Transaction | gracely.Error>;
10
10
  list(account?: string): Promise<Transaction[] | gracely.Error>;
@@ -1,9 +1,9 @@
1
1
  import * as rest from "cloudly-rest";
2
- import { Comments } from "./Comments";
2
+ import { Notes } from "./Notes";
3
3
  export class Transactions extends rest.Collection {
4
4
  constructor(client) {
5
5
  super(client);
6
- this.comments = new Comments(this.client);
6
+ this.Notes = new Notes(this.client);
7
7
  }
8
8
  async create(account, transaction) {
9
9
  return this.client.post(`/account/${account}/transaction`, transaction);
@@ -13,4 +13,4 @@ export class Transactions extends rest.Collection {
13
13
  return this.client.get(path);
14
14
  }
15
15
  }
16
- //# sourceMappingURL=Transactions.js.map
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Transactions/index.ts"],"names":[],"mappings":"AAEA,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,OAAgB;QAC1B,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,YAAY,OAAO,cAAc,CAAC,CAAC,CAAC,cAAc,CAAA;QACzE,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAgB,IAAI,CAAC,CAAA;IAC5C,CAAC;CACD"}
@@ -0,0 +1,15 @@
1
+ import * as isoly from "isoly";
2
+ export interface Note extends Note.Creatable {
3
+ author: string;
4
+ created: isoly.DateTime;
5
+ }
6
+ export declare namespace Note {
7
+ function fromCreatable(note: Creatable, author: string): Note;
8
+ namespace Creatable {
9
+ function is(value: Creatable | any): value is Note;
10
+ }
11
+ interface Creatable {
12
+ text?: string;
13
+ action?: "approve" | "reject";
14
+ }
15
+ }
@@ -0,0 +1,16 @@
1
+ import * as isoly from "isoly";
2
+ export var Note;
3
+ (function (Note) {
4
+ function fromCreatable(note, author) {
5
+ return { ...note, created: isoly.DateTime.now(), author: author };
6
+ }
7
+ Note.fromCreatable = fromCreatable;
8
+ let Creatable;
9
+ (function (Creatable) {
10
+ function is(value) {
11
+ return true;
12
+ }
13
+ Creatable.is = is;
14
+ })(Creatable = Note.Creatable || (Note.Creatable = {}));
15
+ })(Note || (Note = {}));
16
+ //# sourceMappingURL=Note.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Note.js","sourceRoot":"../","sources":["Transaction/Note.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAM,KAAW,IAAI,CAapB;AAbD,WAAiB,IAAI;IACpB,SAAgB,aAAa,CAAC,IAAe,EAAE,MAAc;QAC5D,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;IAClE,CAAC;IAFe,kBAAa,gBAE5B,CAAA;IACD,IAAiB,SAAS,CAIzB;IAJD,WAAiB,SAAS;QACzB,SAAgB,EAAE,CAAC,KAAsB;YACxC,OAAO,IAAI,CAAA;QACZ,CAAC;QAFe,YAAE,KAEjB,CAAA;IACF,CAAC,EAJgB,SAAS,GAAT,cAAS,KAAT,cAAS,QAIzB;AAKF,CAAC,EAbgB,IAAI,KAAJ,IAAI,QAapB"}
@@ -2,33 +2,38 @@ import * as cryptly from "cryptly";
2
2
  import * as isoly from "isoly";
3
3
  import { Operation } from "../Operation";
4
4
  import { Rail } from "../Rail";
5
- import { Comment as TransactionComment } from "./Comment";
6
5
  import { Creatable as TransactionCreatable } from "./Creatable";
7
6
  import { Incoming as TransactionIncoming } from "./Incoming";
7
+ import { Note as TransactionNote } from "./Note";
8
8
  export interface Transaction extends TransactionCreatable {
9
+ organization: string;
10
+ accountId: string;
9
11
  account: Rail;
10
12
  readonly id: cryptly.Identifier;
11
13
  readonly reference?: string;
12
14
  readonly posted: isoly.DateTime;
13
15
  readonly transacted?: isoly.DateTime;
14
- type: "actual" | "available";
15
16
  balance: number;
16
17
  operations: Operation[];
17
- comments?: TransactionComment[];
18
+ status: "created" | "approved" | "rejected" | "processing";
19
+ notes?: TransactionNote[];
18
20
  }
19
21
  export declare namespace Transaction {
20
22
  function is(value: any | Transaction): value is Transaction;
21
- function fromCreatable(account: Rail, transaction: Creatable & {
23
+ function fromCreatable(organization: string, accountId: string, account: Rail, transaction: Creatable & {
22
24
  operations: Operation.Creatable[];
23
- }, type: "actual" | "available", result: number): Transaction;
24
- function fromIncoming(transaction: Incoming & {
25
+ }, result: number): Transaction;
26
+ function fromIncoming(organization: string, accountId: string, transaction: Incoming & {
25
27
  operations: Operation.Creatable[];
26
- }, type: "actual" | "available", result: number): Transaction;
28
+ }, result: number): Transaction;
27
29
  function isIdentifier(value: cryptly.Identifier | any): value is cryptly.Identifier;
28
30
  type Creatable = TransactionCreatable;
29
31
  const Creatable: typeof TransactionCreatable;
30
32
  type Incoming = TransactionIncoming;
31
33
  const Incoming: typeof TransactionIncoming;
32
- type Comment = TransactionComment;
33
- const Comment: typeof TransactionComment;
34
+ type Note = TransactionNote;
35
+ const Note: typeof TransactionNote;
36
+ namespace Note {
37
+ type Creatable = TransactionNote.Creatable;
38
+ }
34
39
  }
@@ -1,9 +1,9 @@
1
1
  import * as cryptly from "cryptly";
2
2
  import * as isoly from "isoly";
3
3
  import { Operation } from "../Operation";
4
- import { Comment as TransactionComment } from "./Comment";
5
4
  import { Creatable as TransactionCreatable } from "./Creatable";
6
5
  import { Incoming as TransactionIncoming } from "./Incoming";
6
+ import { Note as TransactionNote } from "./Note";
7
7
  export var Transaction;
8
8
  (function (Transaction) {
9
9
  function is(value) {
@@ -17,7 +17,7 @@ export var Transaction;
17
17
  value.operations.every(Operation.is));
18
18
  }
19
19
  Transaction.is = is;
20
- function fromCreatable(account, transaction, type, result) {
20
+ function fromCreatable(organization, accountId, account, transaction, result) {
21
21
  const id = cryptly.Identifier.generate(8);
22
22
  const timestamp = isoly.DateTime.now();
23
23
  if ("id" in transaction)
@@ -25,28 +25,32 @@ export var Transaction;
25
25
  if ("posted" in transaction)
26
26
  delete transaction.posted;
27
27
  return {
28
+ organization: organization,
29
+ accountId: accountId,
28
30
  account: account,
29
31
  id: id,
30
32
  posted: timestamp,
31
- type: type,
32
33
  balance: result,
33
34
  ...transaction,
34
35
  operations: transaction.operations.map(o => Operation.fromCreatable(id, o)),
36
+ status: "created",
35
37
  };
36
38
  }
37
39
  Transaction.fromCreatable = fromCreatable;
38
- function fromIncoming(transaction, type, result) {
40
+ function fromIncoming(organization, accountId, transaction, result) {
39
41
  const id = cryptly.Identifier.generate(8);
40
42
  if ("id" in transaction)
41
43
  delete transaction.id;
42
44
  if ("transacted" in transaction)
43
45
  delete transaction.transacted;
44
46
  return {
47
+ organization: organization,
48
+ accountId: accountId,
45
49
  id: id,
46
- type: type,
47
50
  balance: result,
48
51
  ...transaction,
49
52
  operations: transaction.operations.map(o => Operation.fromCreatable(id, o)),
53
+ status: "created",
50
54
  };
51
55
  }
52
56
  Transaction.fromIncoming = fromIncoming;
@@ -56,6 +60,6 @@ export var Transaction;
56
60
  Transaction.isIdentifier = isIdentifier;
57
61
  Transaction.Creatable = TransactionCreatable;
58
62
  Transaction.Incoming = TransactionIncoming;
59
- Transaction.Comment = TransactionComment;
63
+ Transaction.Note = TransactionNote;
60
64
  })(Transaction || (Transaction = {}));
61
65
  //# 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,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,WAAW,CAAA;AACzD,OAAO,EAAE,SAAS,IAAI,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAC/D,OAAO,EAAE,QAAQ,IAAI,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAc5D,MAAM,KAAW,WAAW,CAgE3B;AAhED,WAAiB,WAAW;IAC3B,SAAgB,EAAE,CAAC,KAAwB;QAC1C,OAAO,CACN,OAAO,KAAK,IAAI,QAAQ;YACxB,oBAAoB,CAAC,EAAE,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC;YACrC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;YAClC,KAAK,CAAC,QAAQ,CAA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AAiB,EACjB,WAA6D,EAC7D,MAAc;QAEd,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;QACzC,IAAI,IAAI,IAAI,WAAW;YACtB,OAAO,WAAW,CAAC,EAAE,CAAA;QACtB,IAAI,YAAY,IAAI,WAAW;YAC9B,OAAO,WAAW,CAAC,UAAU,CAAA;QAC9B,OAAO;YACN,YAAY,EAAE,YAAY;YAC1B,SAAS,EAAE,SAAS;YACpB,EAAE,EAAE,EAAE;YACN,OAAO,EAAE,MAAM;YACf,GAAG,WAAW;YACd,UAAU,EAAE,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;YAC3E,MAAM,EAAE,SAAS;SACjB,CAAA;IACF,CAAC;IApBe,wBAAY,eAoB3B,CAAA;IACD,SAAgB,YAAY,CAAC,KAA+B;QAC3D,OAAO,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;IACvC,CAAC;IAFe,wBAAY,eAE3B,CAAA;IAGY,qBAAS,GAAG,oBAAoB,CAAA;IAEhC,oBAAQ,GAAG,mBAAmB,CAAA;IAE9B,gBAAI,GAAG,eAAe,CAAA;AAIpC,CAAC,EAzEgB,WAAW,KAAX,WAAW,QAyE3B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/model-banking",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "description": "Library containing data model types and functions for the Pax2Pay Banking API.",
5
5
  "author": "Pax2Pay Ltd",
6
6
  "license": "MIT",
@@ -1,13 +0,0 @@
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
-
6
- export class Comments extends rest.Collection<gracely.Error> {
7
- constructor(client: http.Client) {
8
- super(client)
9
- }
10
- async create(transaction: string, comment: Transaction.Comment): Promise<Transaction | gracely.Error> {
11
- return this.client.post<Transaction>(`/transaction/${transaction}/comment`, comment)
12
- }
13
- }
@@ -1,11 +0,0 @@
1
- export interface Comment {
2
- body: string
3
- author: string
4
- approve?: boolean
5
- }
6
-
7
- export namespace Comment {
8
- export function is(value: Comment | any): value is Comment {
9
- return true
10
- }
11
- }
@@ -1,8 +0,0 @@
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 Comments extends rest.Collection<gracely.Error> {
6
- constructor(client: http.Client);
7
- create(transaction: string, comment: Transaction.Comment): Promise<Transaction | gracely.Error>;
8
- }
@@ -1,10 +0,0 @@
1
- import * as rest from "cloudly-rest";
2
- export class Comments extends rest.Collection {
3
- constructor(client) {
4
- super(client);
5
- }
6
- async create(transaction, comment) {
7
- return this.client.post(`/transaction/${transaction}/comment`, comment);
8
- }
9
- }
10
- //# sourceMappingURL=Comments.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Comments.js","sourceRoot":"../","sources":["Client/Comments.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,WAAmB,EAAE,OAA4B;QAC7D,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAc,gBAAgB,WAAW,UAAU,EAAE,OAAO,CAAC,CAAA;IACrF,CAAC;CACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Transactions.js","sourceRoot":"../","sources":["Client/Transactions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAEpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,MAAM,OAAO,YAAa,SAAQ,IAAI,CAAC,UAAyB;IAE/D,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;QAFL,aAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAG7C,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,OAAgB;QAC1B,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,YAAY,OAAO,cAAc,CAAC,CAAC,CAAC,cAAc,CAAA;QACzE,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAgB,IAAI,CAAC,CAAA;IAC5C,CAAC;CACD"}
@@ -1,8 +0,0 @@
1
- export interface Comment {
2
- body: string;
3
- author: string;
4
- approve?: boolean;
5
- }
6
- export declare namespace Comment {
7
- function is(value: Comment | any): value is Comment;
8
- }
@@ -1,8 +0,0 @@
1
- export var Comment;
2
- (function (Comment) {
3
- function is(value) {
4
- return true;
5
- }
6
- Comment.is = is;
7
- })(Comment || (Comment = {}));
8
- //# sourceMappingURL=Comment.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Comment.js","sourceRoot":"../","sources":["Transaction/Comment.ts"],"names":[],"mappings":"AAMA,MAAM,KAAW,OAAO,CAIvB;AAJD,WAAiB,OAAO;IACvB,SAAgB,EAAE,CAAC,KAAoB;QACtC,OAAO,IAAI,CAAA;IACZ,CAAC;IAFe,UAAE,KAEjB,CAAA;AACF,CAAC,EAJgB,OAAO,KAAP,OAAO,QAIvB"}