onecore 0.5.5 → 0.5.7

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.5.5",
3
+ "version": "0.5.7",
4
4
  "description": "onecore",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./src/index.ts",
package/src/db.ts CHANGED
@@ -17,9 +17,9 @@ interface StringMap {
17
17
  export interface Executor {
18
18
  driver: string;
19
19
  param(i: number): string;
20
- exec(sql: string, args?: any[], tx?: Transaction): Promise<number>;
21
- execBatch(statements: Statement[], firstSuccess?: boolean, tx?: Transaction): Promise<number>;
22
- query<T>(sql: string, args?: any[], m?: StringMap, bools?: Attribute[], tx?: Transaction): Promise<T[]>;
20
+ execute(sql: string, args?: any[], ctx?: any): Promise<number>
21
+ executeBatch(statements: Statement[], firstSuccess?: boolean, ctx?: any): Promise<number>
22
+ query<T>(sql: string, args?: any[], m?: StringMap, bools?: Attribute[], ctx?: any): Promise<T[]>
23
23
  }
24
24
  export interface Transaction extends Executor {
25
25
  commit(): Promise<void>
@@ -33,7 +33,7 @@ export interface DB extends Executor {
33
33
  export interface ViewRepository<T, ID> {
34
34
  metadata?(): Attributes|undefined;
35
35
  keys?(): string[];
36
- load(id: ID, tx?: Transaction): Promise<T|null>;
36
+ load(id: ID, tx?: Transaction): Promise<T | null>;
37
37
  }
38
38
  export interface SearchRepository<T, F extends Filter> {
39
39
  search(s: F, limit: number, offset?: number|string, fields?: string[], tx?: Transaction): Promise<SearchResult<T>>;
@@ -68,9 +68,9 @@ export interface HistoryRepository<T> {
68
68
 
69
69
 
70
70
  export interface ViewPort<T, ID> {
71
- metadata?(): Attributes|undefined;
71
+ metadata?(): Attributes | undefined;
72
72
  keys?(): string[];
73
- load(id: ID, tx?: Transaction): Promise<T|null>;
73
+ load(id: ID, tx?: Transaction): Promise<T | null>;
74
74
  }
75
75
  export interface SearchPort<T, F extends Filter> {
76
76
  search(s: F, limit: number, offset?: number|string, fields?: string[], tx?: Transaction): Promise<SearchResult<T>>;
package/src/metadata.ts CHANGED
@@ -34,6 +34,8 @@ export interface Attribute {
34
34
  noupdate?: boolean;
35
35
  nopatch?: boolean;
36
36
  version?: boolean;
37
+ createdAt?: boolean;
38
+ updatedAt?: boolean;
37
39
  length?: number;
38
40
  min?: number | Date | string;
39
41
  max?: number | Date | string;
package/src/model.ts CHANGED
@@ -20,10 +20,17 @@ export interface ModuleLoader {
20
20
  load(): Promise<Module[]>;
21
21
  }
22
22
  export interface Tracking {
23
- createdAt: Date;
24
- createdBy?: string;
25
- updatedAt?: Date;
26
- updatedBy: string;
23
+ createdBy: string
24
+ createdAt?: Date
25
+ updatedBy: string
26
+ updatedAt?: Date
27
+ }
28
+ export interface Approving {
29
+ submittedBy: string
30
+ submittedAt?: Date
31
+ approvedBy?: string
32
+ approvedAt?: Date
33
+
27
34
  }
28
35
  export interface Version {
29
36
  version?: number;