Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit 0ccfe4e

Browse files
authored
Merge pull request #24 from formancehq/release/v1.8.1
Upgrade to v1.8.1
2 parents 5d803b5 + c3172cd commit 0ccfe4e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+679
-349
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +0,0 @@
1-
dist
2-
node_modules

.openapi-generator/FILES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ index.ts
2626
middleware.ts
2727
models/Account.ts
2828
models/AccountWithVolumesAndBalances.ts
29+
models/AddMetadataToAccount409Response.ts
2930
models/Config.ts
3031
models/ConfigInfo.ts
3132
models/ConfigInfoResponse.ts
@@ -57,6 +58,7 @@ models/Mapping.ts
5758
models/MappingResponse.ts
5859
models/ObjectSerializer.ts
5960
models/Posting.ts
61+
models/RunScript400Response.ts
6062
models/Script.ts
6163
models/ScriptResult.ts
6264
models/Stats.ts

.openapi-generator/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.1.0-SNAPSHOT
1+
6.3.0-SNAPSHOT

AccountsApi.md

Lines changed: 64 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# AccountsApi
1+
# ledger.AccountsApi
22

33
All URIs are relative to *https://.o.numary.cloud/ledger*
44

@@ -18,15 +18,24 @@ Method | HTTP request | Description
1818

1919

2020
```typescript
21-
import { AccountsApi, createConfiguration } from '@numaryhq/ledger-nodejs';
21+
import { ledger } from '@numaryhq/ledger-nodejs';
2222
import * as fs from 'fs';
2323

24-
const configuration = createConfiguration();
25-
const apiInstance = new AccountsApi(configuration);
24+
const configuration = ledger.createConfiguration();
25+
const apiInstance = new ledger.AccountsApi(configuration);
2626

27-
apiInstance.addMetadataToAccount("ledger001", "users:001", {
27+
let body:ledger.AccountsApiAddMetadataToAccountRequest = {
28+
// string | Name of the ledger.
29+
ledger: "ledger001",
30+
// string | Exact address of the account. It must match the following regular expressions pattern: ``` ^\\w+(:\\w+)*$ ```
31+
address: "users:001",
32+
// { [key: string]: any; } | metadata
33+
requestBody: {
2834
"key": null,
29-
} ).then((data:any) => {
35+
},
36+
};
37+
38+
apiInstance.addMetadataToAccount(body).then((data:any) => {
3039
console.log('API called successfully. Returned data: ' + data);
3140
}).catch((error:any) => console.error(error));
3241
```
@@ -60,6 +69,7 @@ Name | Type | Description | Notes
6069
|-------------|-------------|------------------|
6170
**204** | No Content | - |
6271
**400** | Bad Request | - |
72+
**409** | Conflict | - |
6373

6474
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
6575

@@ -71,13 +81,22 @@ Name | Type | Description | Notes
7181

7282

7383
```typescript
74-
import { AccountsApi, createConfiguration } from '@numaryhq/ledger-nodejs';
84+
import { ledger } from '@numaryhq/ledger-nodejs';
7585
import * as fs from 'fs';
7686

77-
const configuration = createConfiguration();
78-
const apiInstance = new AccountsApi(configuration);
87+
const configuration = ledger.createConfiguration();
88+
const apiInstance = new ledger.AccountsApi(configuration);
89+
90+
let body:ledger.AccountsApiCountAccountsRequest = {
91+
// string | Name of the ledger.
92+
ledger: "ledger001",
93+
// string | Filter accounts by address pattern (regular expression placed between ^ and $). (optional)
94+
address: "users:.+",
95+
// any | Filter accounts by metadata key value pairs. Nested objects can be used as seen in the example below. (optional)
96+
metadata: {},
97+
};
7998

80-
apiInstance.countAccounts("ledger001", "users:.+", {} ).then((data:any) => {
99+
apiInstance.countAccounts(body).then((data:any) => {
81100
console.log('API called successfully. Returned data: ' + data);
82101
}).catch((error:any) => console.error(error));
83102
```
@@ -121,13 +140,20 @@ Name | Type | Description | Notes
121140

122141

123142
```typescript
124-
import { AccountsApi, createConfiguration } from '@numaryhq/ledger-nodejs';
143+
import { ledger } from '@numaryhq/ledger-nodejs';
125144
import * as fs from 'fs';
126145

127-
const configuration = createConfiguration();
128-
const apiInstance = new AccountsApi(configuration);
146+
const configuration = ledger.createConfiguration();
147+
const apiInstance = new ledger.AccountsApi(configuration);
129148

130-
apiInstance.getAccount("ledger001", "users:001" ).then((data:any) => {
149+
let body:ledger.AccountsApiGetAccountRequest = {
150+
// string | Name of the ledger.
151+
ledger: "ledger001",
152+
// string | Exact address of the account. It must match the following regular expressions pattern: ``` ^\\w+(:\\w+)*$ ```
153+
address: "users:001",
154+
};
155+
156+
apiInstance.getAccount(body).then((data:any) => {
131157
console.log('API called successfully. Returned data: ' + data);
132158
}).catch((error:any) => console.error(error));
133159
```
@@ -172,13 +198,32 @@ List accounts from a ledger, sorted by address in descending order.
172198

173199

174200
```typescript
175-
import { AccountsApi, createConfiguration } from '@numaryhq/ledger-nodejs';
201+
import { ledger } from '@numaryhq/ledger-nodejs';
176202
import * as fs from 'fs';
177203

178-
const configuration = createConfiguration();
179-
const apiInstance = new AccountsApi(configuration);
180-
181-
apiInstance.listAccounts("ledger001", 100, "users:003", "users:.+", {}, 2400, "gte", "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" ).then((data:any) => {
204+
const configuration = ledger.createConfiguration();
205+
const apiInstance = new ledger.AccountsApi(configuration);
206+
207+
let body:ledger.AccountsApiListAccountsRequest = {
208+
// string | Name of the ledger.
209+
ledger: "ledger001",
210+
// number | The maximum number of results to return per page (optional)
211+
pageSize: 100,
212+
// string | Pagination cursor, will return accounts after given address, in descending order. (optional)
213+
after: "users:003",
214+
// string | Filter accounts by address pattern (regular expression placed between ^ and $). (optional)
215+
address: "users:.+",
216+
// any | Filter accounts by metadata key value pairs. Nested objects can be used as seen in the example below. (optional)
217+
metadata: {},
218+
// number | Filter accounts by their balance (default operator is gte) (optional)
219+
balance: 2400,
220+
// 'gte' | 'lte' | 'gt' | 'lt' | 'e' | Operator used for the filtering of balances can be greater than/equal, less than/equal, greater than, less than, or equal (optional)
221+
balanceOperator: "gte",
222+
// string | Parameter used in pagination requests. Maximum page size is set to 15. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when the pagination token is set. (optional)
223+
paginationToken: "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
224+
};
225+
226+
apiInstance.listAccounts(body).then((data:any) => {
182227
console.log('API called successfully. Returned data: ' + data);
183228
}).catch((error:any) => console.error(error));
184229
```

BalancesApi.md

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# BalancesApi
1+
# ledger.BalancesApi
22

33
All URIs are relative to *https://.o.numary.cloud/ledger*
44

@@ -16,13 +16,24 @@ Method | HTTP request | Description
1616

1717

1818
```typescript
19-
import { BalancesApi, createConfiguration } from '@numaryhq/ledger-nodejs';
19+
import { ledger } from '@numaryhq/ledger-nodejs';
2020
import * as fs from 'fs';
2121

22-
const configuration = createConfiguration();
23-
const apiInstance = new BalancesApi(configuration);
24-
25-
apiInstance.getBalances("ledger001", "users:001", "users:003", "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" ).then((data:any) => {
22+
const configuration = ledger.createConfiguration();
23+
const apiInstance = new ledger.BalancesApi(configuration);
24+
25+
let body:ledger.BalancesApiGetBalancesRequest = {
26+
// string | Name of the ledger.
27+
ledger: "ledger001",
28+
// string | Filter balances involving given account, either as source or destination. (optional)
29+
address: "users:001",
30+
// string | Pagination cursor, will return accounts after given address, in descending order. (optional)
31+
after: "users:003",
32+
// string | Parameter used in pagination requests. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. (optional)
33+
paginationToken: "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
34+
};
35+
36+
apiInstance.getBalances(body).then((data:any) => {
2637
console.log('API called successfully. Returned data: ' + data);
2738
}).catch((error:any) => console.error(error));
2839
```
@@ -68,13 +79,20 @@ Name | Type | Description | Notes
6879

6980

7081
```typescript
71-
import { BalancesApi, createConfiguration } from '@numaryhq/ledger-nodejs';
82+
import { ledger } from '@numaryhq/ledger-nodejs';
7283
import * as fs from 'fs';
7384

74-
const configuration = createConfiguration();
75-
const apiInstance = new BalancesApi(configuration);
85+
const configuration = ledger.createConfiguration();
86+
const apiInstance = new ledger.BalancesApi(configuration);
87+
88+
let body:ledger.BalancesApiGetBalancesAggregatedRequest = {
89+
// string | Name of the ledger.
90+
ledger: "ledger001",
91+
// string | Filter balances involving given account, either as source or destination. (optional)
92+
address: "users:001",
93+
};
7694

77-
apiInstance.getBalancesAggregated("ledger001", "users:001" ).then((data:any) => {
95+
apiInstance.getBalancesAggregated(body).then((data:any) => {
7896
console.log('API called successfully. Returned data: ' + data);
7997
}).catch((error:any) => console.error(error));
8098
```

MappingApi.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# MappingApi
1+
# ledger.MappingApi
22

33
All URIs are relative to *https://.o.numary.cloud/ledger*
44

@@ -16,13 +16,18 @@ Method | HTTP request | Description
1616

1717

1818
```typescript
19-
import { MappingApi, createConfiguration } from '@numaryhq/ledger-nodejs';
19+
import { ledger } from '@numaryhq/ledger-nodejs';
2020
import * as fs from 'fs';
2121

22-
const configuration = createConfiguration();
23-
const apiInstance = new MappingApi(configuration);
22+
const configuration = ledger.createConfiguration();
23+
const apiInstance = new ledger.MappingApi(configuration);
2424

25-
apiInstance.getMapping("ledger001" ).then((data:any) => {
25+
let body:ledger.MappingApiGetMappingRequest = {
26+
// string | Name of the ledger.
27+
ledger: "ledger001",
28+
};
29+
30+
apiInstance.getMapping(body).then((data:any) => {
2631
console.log('API called successfully. Returned data: ' + data);
2732
}).catch((error:any) => console.error(error));
2833
```
@@ -64,20 +69,27 @@ Name | Type | Description | Notes
6469

6570

6671
```typescript
67-
import { MappingApi, createConfiguration } from '@numaryhq/ledger-nodejs';
72+
import { ledger } from '@numaryhq/ledger-nodejs';
6873
import * as fs from 'fs';
6974

70-
const configuration = createConfiguration();
71-
const apiInstance = new MappingApi(configuration);
75+
const configuration = ledger.createConfiguration();
76+
const apiInstance = new ledger.MappingApi(configuration);
7277

73-
apiInstance.updateMapping("ledger001", {
78+
let body:ledger.MappingApiUpdateMappingRequest = {
79+
// string | Name of the ledger.
80+
ledger: "ledger001",
81+
// Mapping
82+
mapping: {
7483
contracts: [
7584
{
7685
account: "users:001",
7786
expr: {},
7887
},
7988
],
80-
} ).then((data:any) => {
89+
},
90+
};
91+
92+
apiInstance.updateMapping(body).then((data:any) => {
8193
console.log('API called successfully. Returned data: ' + data);
8294
}).catch((error:any) => console.error(error));
8395
```

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## @numaryhq/ledger-nodejs@v1.7.0-beta.1
1+
## @numaryhq/ledger-nodejs@v1.8.1
22

33
This generator creates TypeScript/JavaScript client that utilizes fetch-api.
44

@@ -21,7 +21,7 @@ navigate to the folder of your consuming project and run one of the following co
2121
_published:_
2222

2323
```
24-
npm install @numaryhq/ledger-nodejs@v1.7.0-beta.1 --save
24+
npm install @numaryhq/ledger-nodejs@v1.8.1 --save
2525
```
2626

2727
_unPublished (not recommended):_

ScriptApi.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ScriptApi
1+
# ledger.ScriptApi
22

33
All URIs are relative to *https://.o.numary.cloud/ledger*
44

@@ -15,13 +15,17 @@ Method | HTTP request | Description
1515

1616

1717
```typescript
18-
import { ScriptApi, createConfiguration } from '@numaryhq/ledger-nodejs';
18+
import { ledger } from '@numaryhq/ledger-nodejs';
1919
import * as fs from 'fs';
2020

21-
const configuration = createConfiguration();
22-
const apiInstance = new ScriptApi(configuration);
21+
const configuration = ledger.createConfiguration();
22+
const apiInstance = new ledger.ScriptApi(configuration);
2323

24-
apiInstance.runScript("ledger001", {
24+
let body:ledger.ScriptApiRunScriptRequest = {
25+
// string | Name of the ledger.
26+
ledger: "ledger001",
27+
// Script
28+
script: {
2529
reference: "order_1234",
2630
metadata: {
2731
"key": null,
@@ -35,7 +39,12 @@ send [COIN 10] (
3539
)
3640
`,
3741
vars: {},
38-
}, true ).then((data:any) => {
42+
},
43+
// boolean | Set the preview mode. Preview mode doesn't add the logs to the database or publish a message to the message broker. (optional)
44+
preview: true,
45+
};
46+
47+
apiInstance.runScript(body).then((data:any) => {
3948
console.log('API called successfully. Returned data: ' + data);
4049
}).catch((error:any) => console.error(error));
4150
```
@@ -68,6 +77,8 @@ Name | Type | Description | Notes
6877
| Status code | Description | Response headers |
6978
|-------------|-------------|------------------|
7079
**200** | OK | - |
80+
**400** | Bad Request | - |
81+
**409** | Conflict | - |
7182

7283
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
7384

ServerApi.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ServerApi
1+
# ledger.ServerApi
22

33
All URIs are relative to *https://.o.numary.cloud/ledger*
44

@@ -15,13 +15,15 @@ Method | HTTP request | Description
1515

1616

1717
```typescript
18-
import { ServerApi, createConfiguration } from '@numaryhq/ledger-nodejs';
18+
import { ledger } from '@numaryhq/ledger-nodejs';
1919
import * as fs from 'fs';
2020

21-
const configuration = createConfiguration();
22-
const apiInstance = new ServerApi(configuration);
21+
const configuration = ledger.createConfiguration();
22+
const apiInstance = new ledger.ServerApi(configuration);
2323

24-
apiInstance.getInfo().then((data:any) => {
24+
let body:any = {};
25+
26+
apiInstance.getInfo(body).then((data:any) => {
2527
console.log('API called successfully. Returned data: ' + data);
2628
}).catch((error:any) => console.error(error));
2729
```

0 commit comments

Comments
 (0)