ismx-nexo-node-app 0.3.31 → 0.3.32
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.
|
@@ -42,12 +42,12 @@ export default abstract class RepositoryDatabase extends Repository {
|
|
|
42
42
|
abstract add<E>(tableName: string, object: {
|
|
43
43
|
[key: string]: Primitive;
|
|
44
44
|
} | any, id?: string): Promise<E>;
|
|
45
|
-
abstract addAll<T>(tableName: string, objects: {
|
|
45
|
+
abstract addAll<T>(tableName: string, objects: ({
|
|
46
46
|
[key: string]: Primitive;
|
|
47
|
-
}[]): Promise<T[]>;
|
|
47
|
+
} | any)[]): Promise<T[]>;
|
|
48
48
|
abstract update<T>(tableName: string, id: string, object: {
|
|
49
49
|
[key: string]: Primitive;
|
|
50
|
-
}): Promise<T>;
|
|
50
|
+
} | any): Promise<T>;
|
|
51
51
|
abstract page<T>(tableName: string, sortKey: string, maxResults: number, pageNumber: number, filters?: {
|
|
52
52
|
[key: string]: Primitive | Array<Primitive>;
|
|
53
53
|
}): Promise<Pagination<T>>;
|
|
@@ -29,12 +29,12 @@ export default class RepositoryDatabasePostgres extends RepositoryDatabase {
|
|
|
29
29
|
add<E>(tableName: string, object: {
|
|
30
30
|
[key: string]: Primitive;
|
|
31
31
|
} | any, id?: string): Promise<E>;
|
|
32
|
-
addAll<T>(tableName: string, objects: {
|
|
32
|
+
addAll<T>(tableName: string, objects: ({
|
|
33
33
|
[key: string]: Primitive;
|
|
34
|
-
}[]): Promise<T[]>;
|
|
34
|
+
} | any)[]): Promise<T[]>;
|
|
35
35
|
update<T>(tableName: string, id: string, object: {
|
|
36
36
|
[key: string]: Primitive;
|
|
37
|
-
}): Promise<T>;
|
|
37
|
+
} | any): Promise<T>;
|
|
38
38
|
page<T>(tableName: string, sortKey: string, maxResults?: number, pageNumber?: number, filters?: {
|
|
39
39
|
[key: string]: Primitive | Array<Primitive>;
|
|
40
40
|
}): Promise<Pagination<T>>;
|
package/package.json
CHANGED
|
@@ -65,11 +65,11 @@ export default abstract class RepositoryDatabase extends Repository
|
|
|
65
65
|
|
|
66
66
|
abstract all_depr<E>(tableName: string, options: QueryOptions): Promise<E[]>;
|
|
67
67
|
|
|
68
|
-
abstract add<E>(tableName: string, object: {[key:string]:Primitive}
|
|
68
|
+
abstract add<E>(tableName: string, object: {[key:string]:Primitive}|any, id?: string): Promise<E>;
|
|
69
69
|
|
|
70
|
-
abstract addAll<T>(tableName: string, objects: {[key:string]:Primitive }[]): Promise<T[]>;
|
|
70
|
+
abstract addAll<T>(tableName: string, objects: ({[key:string]:Primitive }|any)[]): Promise<T[]>;
|
|
71
71
|
|
|
72
|
-
abstract update<T>(tableName: string, id: string, object: {[key:string]:Primitive}): Promise<T>;
|
|
72
|
+
abstract update<T>(tableName: string, id: string, object: {[key:string]:Primitive}|any): Promise<T>;
|
|
73
73
|
|
|
74
74
|
abstract page<T>(tableName: string, sortKey: string, maxResults: number, pageNumber: number, filters?: {[key:string]:Primitive|Array<Primitive>}): Promise<Pagination<T>>;
|
|
75
75
|
|
|
@@ -89,12 +89,12 @@ export default class RepositoryDatabasePostgres extends RepositoryDatabase
|
|
|
89
89
|
`);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
async add<E>(tableName: string, object: {[key:string]:Primitive}
|
|
92
|
+
async add<E>(tableName: string, object: {[key:string]:Primitive}|any, id?: string): Promise<E>
|
|
93
93
|
{
|
|
94
94
|
return this.addAll<E>(tableName, [ { id: id, ...object } ]).then((rows) => rows[0]);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
async addAll<T>(tableName: string, objects: {[key:string]:Primitive }[]): Promise<T[]>
|
|
97
|
+
async addAll<T>(tableName: string, objects: ({[key:string]:Primitive }|any)[]): Promise<T[]>
|
|
98
98
|
{
|
|
99
99
|
if (!this.tables[tableName]) throw new Error(`table ${tableName} does not exist`);
|
|
100
100
|
let table = this.tables[tableName];
|
|
@@ -114,7 +114,7 @@ export default class RepositoryDatabasePostgres extends RepositoryDatabase
|
|
|
114
114
|
return this.query(query, values);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
async update<T>(tableName: string, id: string, object: {[key:string]:Primitive}): Promise<T>
|
|
117
|
+
async update<T>(tableName: string, id: string, object: {[key:string]:Primitive}|any): Promise<T>
|
|
118
118
|
{
|
|
119
119
|
if (!id) throw new Error(`field 'id' is mandatory when updating ${tableName}`);
|
|
120
120
|
if (!this.tables[tableName]) throw new Error(`table ${tableName} does not exist`);
|