onecore 0.5.5 → 0.5.6
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 +1 -1
- package/src/db.ts +6 -6
- package/src/model.ts +11 -4
package/package.json
CHANGED
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
|
-
|
|
21
|
-
|
|
22
|
-
query<T>(sql: string, args?: any[], m?: StringMap, bools?: Attribute[],
|
|
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/model.ts
CHANGED
|
@@ -20,10 +20,17 @@ export interface ModuleLoader {
|
|
|
20
20
|
load(): Promise<Module[]>;
|
|
21
21
|
}
|
|
22
22
|
export interface Tracking {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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;
|