@kasko/quote-calculator-js
Advanced tools
Comparing version 0.4.0 to 1.0.0
# Changelog | ||
## [v1.0.0](https://github.com/kasko/quote-calculator-js-lib/compare/v0.4.0...v1.0.0) (2020-10-27) | ||
## Breaking Change | ||
- `calculator` - Adds option to calculate already parsed data from xlsx; | ||
## [v0.4.0](https://github.com/kasko/quote-calculator-js-lib/compare/v0.3.0...v0.4.0) (2020-10-19) | ||
@@ -3,0 +7,0 @@ ## Feature |
@@ -0,1 +1,2 @@ | ||
import { parseXLSX } from '../../sheet-reader/src/parser.js'; | ||
export interface IConfig { | ||
@@ -5,2 +6,62 @@ tax_rate?: number; | ||
} | ||
/** | ||
* Enumeration Value | Description | ||
* ---------------------------+--------------------------------- | ||
* b (Boolean) | Cell containing a boolean. | ||
* d (Date) | Cell contains a date in the ISO 8601 format. | ||
* e (Error) | Cell containing an error. | ||
* n (Number) | Cell containing a number. | ||
* s (Shared String) | Cell containing a shared string. | ||
* str (String) | Cell containing a formula string. | ||
*/ | ||
interface Cell { | ||
v: string | number | boolean; | ||
t: 's' | 'n' | 'd' | 'b' | 'z' | 'str' | 'e'; | ||
f?: string; | ||
w?: string; | ||
} | ||
interface Worksheet { | ||
[key: string]: Cell; | ||
} | ||
interface PivotCell { | ||
r?: string; | ||
i?: string; | ||
t?: string; | ||
} | ||
interface PivotData { | ||
subtotal: string; | ||
name: string; | ||
fld: string; | ||
baseField: string; | ||
baseItem: string; | ||
items: { | ||
row: PivotCell[]; | ||
col: PivotCell[]; | ||
}; | ||
} | ||
interface PivotTable { | ||
source: { | ||
ref: string; | ||
sheet: string; | ||
}; | ||
ref: string; | ||
firstHeaderRow: string; | ||
firstDataRow: string; | ||
firstDataCol: string; | ||
data: PivotData[]; | ||
} | ||
interface PivotTables { | ||
[key: string]: PivotTable; | ||
} | ||
export interface Workbook { | ||
sheets: { | ||
name: string; | ||
sheetId: string; | ||
'r:id': string; | ||
}[]; | ||
definedNames: Record<string, string>; | ||
sharedStrings: string[]; | ||
sheet: Record<string, Worksheet>; | ||
pivotTables: PivotTables; | ||
} | ||
declare type Validation<T> = { | ||
@@ -32,3 +93,3 @@ [key in keyof T]: Validation<T[key]> extends T[key] ? boolean : Validation<T[key]>; | ||
constructor(debug?: boolean); | ||
init(spreadSheetPath: string, input?: I, config?: C): Promise<void>; | ||
init(workbook: Record<string, any>, input?: I, config?: C): Promise<void>; | ||
validateInput(): Validation<I>; | ||
@@ -68,2 +129,5 @@ getOutput(): O; | ||
} | ||
export {}; | ||
export declare class CalculatorAndParser<I = Record<string, any>, O = Record<string, any>, C = IConfig> extends Calculator<I, O, C> { | ||
init(spreadSheetPath: string, input?: I, config?: C): Promise<void>; | ||
} | ||
export { parseXLSX }; |
{ | ||
"name": "@kasko/quote-calculator-js", | ||
"version": "0.4.0", | ||
"version": "1.0.0", | ||
"description": "KASKO Spreadsheet Quote Calculator", | ||
@@ -8,5 +8,6 @@ "main": "dist/calculator.js", | ||
"scripts": { | ||
"build": "npm run generate && npm run build:calculator && npm run declarations", | ||
"build": "yarn generate && yarn build:calculator && yarn parse && yarn declarations", | ||
"generate": "cd packages/formula-parser/src/grammar-parser && jison grammar-parser.jison", | ||
"build:calculator": "esbuild --log-level=error --bundle packages/calculator/src/calculator.ts --outdir=dist --minify --format=cjs --target=es2015 --platform=node --sourcemap", | ||
"parse": "node bin/parse-xlsx.js ./test-files ./pricing ./lambda/visana-private-liability", | ||
"start": "node index.js", | ||
@@ -39,4 +40,5 @@ "test": "uvu test", | ||
"files": [ | ||
"bin", | ||
"dist" | ||
] | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1517198
11
1375
2
8