onecore 0.0.41 → 0.0.42

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onecore",
3
- "version": "0.0.41",
3
+ "version": "0.0.42",
4
4
  "description": "onecore",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./src/index.ts",
package/src/db.ts CHANGED
@@ -3,6 +3,9 @@ export interface Statement {
3
3
  query: string;
4
4
  params?: any[];
5
5
  }
6
+ export interface QueryBuilder {
7
+ build(cxt?: any): Promise<Statement>;
8
+ }
6
9
  export interface SimpleDB {
7
10
  driver: string;
8
11
  query<T>(sql: string): Promise<T[]>;
package/src/index.ts CHANGED
@@ -80,6 +80,18 @@ export interface ImportService {
80
80
  export interface Importer {
81
81
  import(): Promise<ImportResult>;
82
82
  }
83
+ export interface Parser<T> {
84
+ parse: (data: string) => Promise<T>;
85
+ }
86
+ export interface Transformer<T> {
87
+ transform: (data: string) => Promise<T>;
88
+ }
89
+ export interface ExportService {
90
+ export(ctx?: any): Promise<number>;
91
+ }
92
+ export interface Exporter {
93
+ export(ctx?: any): Promise<number>;
94
+ }
83
95
  export class ViewManager<T, ID> implements ViewService<T, ID> {
84
96
  constructor(private r: ViewRepository<T, ID>) {
85
97
  this.metadata = this.metadata.bind(this);
package/src/metadata.ts CHANGED
@@ -50,6 +50,7 @@ export interface Attribute {
50
50
  typeof?: Attributes;
51
51
  true?: string|number;
52
52
  false?: string|number;
53
+ getString?: (v: any) => string;
53
54
  }
54
55
  export interface Attributes {
55
56
  [key: string]: Attribute;