@lumeo_hq/openbooks-statements 0.1.1 → 0.2.1

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/README.md CHANGED
@@ -5,5 +5,15 @@
5
5
  `restricted: true`. Detection and proof happen in the Python engine; nothing is re-implemented here.
6
6
 
7
7
  ```ts
8
- import { runFile, LAYOUTS } from "@lumeo_hq/openbooks-statements";
8
+ import { runJobs } from "@lumeo_hq/openbooks-statements";
9
+
10
+ for await (const result of runJobs([
11
+ { file: "bank.csv", options: { currency: "INR", opening: "1000.00" } },
12
+ { file: "bank.ofx", options: { opening: "531.27" } },
13
+ ])) {
14
+ console.log(result.kind === "released" ? result.document.data.batches : result.code);
15
+ }
9
16
  ```
17
+ Install Python 3.11+ and `python -m pip install openbooks` before running the Node.js package. Supply a verified opening balance when the export lacks one. Use `dateOrder` for ambiguous numeric dates. PDF and image runs use the model by default. Install `openbooks[scan]` for OCR and model capabilities. Set `model: false` to read a text-layer PDF with the base engine.
18
+
19
+ [Bank statement workflow](https://openbooks.lumeo.co.in/docs/bank-statements) · [PDF and OCR](https://openbooks.lumeo.co.in/docs/pdf-and-ocr)
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { type RunOptions, type RunResult } from "@lumeo_hq/openbooks-core";
2
- export type { RunOptions, RunResult, Released, Refused } from "@lumeo_hq/openbooks-core";
1
+ import { type RunJob, type RunOptions, type RunResult } from "@lumeo_hq/openbooks-core";
2
+ export type { DocumentOptions, RunJob, RunOptions, RunResult, Released, Refused } from "@lumeo_hq/openbooks-core";
3
3
  export { isReleased, EngineError } from "@lumeo_hq/openbooks-core";
4
4
  /** The layouts this package reads. A file that proves out under any other layout comes back refused (UNKNOWN_LAYOUT). */
5
5
  export declare const LAYOUTS: readonly ["bank_csv.v1", "ofx.v1", "mt940.v1", "bank_statement_pdf.v1"];
6
6
  /** Bank statements: bank CSV, OFX, MT940, and PDFs or scans (scans need the engine's [scan] extra: pip install 'openbooks[scan]'). */
7
7
  export declare const runFile: (file: string, opts?: RunOptions) => Promise<RunResult>;
8
8
  export declare const runFiles: (files: readonly string[], opts?: RunOptions) => Promise<RunResult[]>;
9
+ export declare const runJobs: (jobs: Iterable<RunJob> | AsyncIterable<RunJob>, opts?: RunOptions) => AsyncGenerator<RunResult>;
package/dist/index.js CHANGED
@@ -1,7 +1,8 @@
1
- import { runFile as coreRunFile, runFiles as coreRunFiles } from "@lumeo_hq/openbooks-core";
1
+ import { runFile as coreRunFile, runFiles as coreRunFiles, runJobs as coreRunJobs } from "@lumeo_hq/openbooks-core";
2
2
  export { isReleased, EngineError } from "@lumeo_hq/openbooks-core";
3
3
  /** The layouts this package reads. A file that proves out under any other layout comes back refused (UNKNOWN_LAYOUT). */
4
4
  export const LAYOUTS = ["bank_csv.v1", "ofx.v1", "mt940.v1", "bank_statement_pdf.v1"];
5
5
  /** Bank statements: bank CSV, OFX, MT940, and PDFs or scans (scans need the engine's [scan] extra: pip install 'openbooks[scan]'). */
6
6
  export const runFile = (file, opts = {}) => coreRunFile(file, { ...opts, accept: LAYOUTS });
7
7
  export const runFiles = (files, opts = {}) => coreRunFiles(files, { ...opts, accept: LAYOUTS });
8
+ export const runJobs = (jobs, opts = {}) => (coreRunJobs(jobs, { ...opts, accept: LAYOUTS }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumeo_hq/openbooks-statements",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "description": "Open Books statements wrapper: typed access to the Python engine, restricted to the statements layouts",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -20,6 +20,6 @@
20
20
  "node": ">=20"
21
21
  },
22
22
  "dependencies": {
23
- "@lumeo_hq/openbooks-core": "0.1.1"
23
+ "@lumeo_hq/openbooks-core": "0.2.1"
24
24
  }
25
25
  }
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,QAAQ,IAAI,YAAY,EAAmC,MAAM,iBAAiB,CAAC;AAGpH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE1D,yHAAyH;AACzH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,uBAAuB,CAAU,CAAC;AAE/F,iIAAiI;AACjI,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,OAAmB,EAAE,EAAsB,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;AACpI,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAwB,EAAE,OAAmB,EAAE,EAAwB,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC"}