ismx-nexo-node-app 0.4.111 → 0.4.113
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/dist/js/repository/Repository.js +3 -4
- package/dist/js/repository/RepositoryDatabasePostgres.js +1 -1
- package/dist/types/repository/Repository.d.ts +1 -2
- package/dist/types/repository/RepositoryDatabasePostgres.d.ts +1 -1
- package/package.json +1 -1
- package/src/main/node/repository/Repository.ts +4 -4
- package/src/main/node/repository/RepositoryDatabasePostgres.ts +1 -1
|
@@ -3,9 +3,11 @@ var _a;
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Hash = void 0;
|
|
5
5
|
class Hash extends Set {
|
|
6
|
+
get size() {
|
|
7
|
+
return Object.keys(this.dict).length;
|
|
8
|
+
}
|
|
6
9
|
constructor(dict) {
|
|
7
10
|
super();
|
|
8
|
-
this.size = 0;
|
|
9
11
|
this[_a] = "Hash";
|
|
10
12
|
this.dict = dict !== null && dict !== void 0 ? dict : {};
|
|
11
13
|
}
|
|
@@ -34,9 +36,6 @@ class Hash extends Set {
|
|
|
34
36
|
values() {
|
|
35
37
|
return Object.keys(this.dict).values();
|
|
36
38
|
}
|
|
37
|
-
length() {
|
|
38
|
-
return Object.keys(this.dict).length;
|
|
39
|
-
}
|
|
40
39
|
[Symbol.iterator]() {
|
|
41
40
|
return Object.keys(this.dict)[Symbol.iterator]();
|
|
42
41
|
}
|
|
@@ -221,7 +221,7 @@ class RepositoryDatabasePostgres extends RepositoryDatabase_1.default {
|
|
|
221
221
|
return this.query(query, values).then((result) => { var _a, _b; return (_b = (_a = result[0]) === null || _a === void 0 ? void 0 : _a.list) !== null && _b !== void 0 ? _b : []; });
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
|
-
|
|
224
|
+
selectHash(tableName, select, filters) {
|
|
225
225
|
return __awaiter(this, void 0, void 0, function* () {
|
|
226
226
|
if (!this.tables[tableName])
|
|
227
227
|
throw new Error(`table ${tableName} does not exist`);
|
|
@@ -5,7 +5,7 @@ export interface Pagination<T> {
|
|
|
5
5
|
export type Transient<T> = Omit<T, 'id'>;
|
|
6
6
|
export declare class Hash<T extends string | number | symbol> extends Set<T> {
|
|
7
7
|
dict: Record<T, any>;
|
|
8
|
-
size: number;
|
|
8
|
+
get size(): number;
|
|
9
9
|
constructor(dict?: Record<T, any>);
|
|
10
10
|
add(value: T): this;
|
|
11
11
|
clear(): void;
|
|
@@ -15,7 +15,6 @@ export declare class Hash<T extends string | number | symbol> extends Set<T> {
|
|
|
15
15
|
entries(): SetIterator<[T, T]>;
|
|
16
16
|
keys(): SetIterator<T>;
|
|
17
17
|
values(): SetIterator<T>;
|
|
18
|
-
length(): number;
|
|
19
18
|
[Symbol.iterator](): SetIterator<T>;
|
|
20
19
|
[Symbol.toStringTag]: string;
|
|
21
20
|
}
|
|
@@ -51,7 +51,7 @@ export default class RepositoryDatabasePostgres extends RepositoryDatabase {
|
|
|
51
51
|
select(tableName: string, select: string, filters?: {
|
|
52
52
|
[key: string]: Valuable | Array<Valuable>;
|
|
53
53
|
}): Promise<string[]>;
|
|
54
|
-
|
|
54
|
+
selectHash<T>(tableName: string, select: string, filters: Partial<T>): Promise<Hash<Primitive>>;
|
|
55
55
|
toWhere(tableName: string, filters?: {
|
|
56
56
|
[key: string]: Valuable | Array<Valuable>;
|
|
57
57
|
}, alias?: string, index?: number): {
|
package/package.json
CHANGED
|
@@ -8,7 +8,10 @@ export type Transient<T> = Omit<T, 'id'>
|
|
|
8
8
|
export class Hash<T extends string | number | symbol> extends Set<T>
|
|
9
9
|
{
|
|
10
10
|
dict: Record<T, any>
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
get size(): number {
|
|
13
|
+
return Object.keys(this.dict).length;
|
|
14
|
+
}
|
|
12
15
|
|
|
13
16
|
constructor(dict?: Record<T, any>) {
|
|
14
17
|
super()
|
|
@@ -40,9 +43,6 @@ export class Hash<T extends string | number | symbol> extends Set<T>
|
|
|
40
43
|
values(): SetIterator<T> {
|
|
41
44
|
return Object.keys(this.dict).values() as SetIterator<T>;
|
|
42
45
|
}
|
|
43
|
-
length(): number {
|
|
44
|
-
return Object.keys(this.dict).length;
|
|
45
|
-
}
|
|
46
46
|
[Symbol.iterator](): SetIterator<T> {
|
|
47
47
|
return (Object.keys(this.dict) as T[])[Symbol.iterator]()
|
|
48
48
|
}
|
|
@@ -193,7 +193,7 @@ export default class RepositoryDatabasePostgres extends RepositoryDatabase
|
|
|
193
193
|
return this.query<{list:string[]}>(query, values).then((result) => result[0]?.list ?? []);
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
async
|
|
196
|
+
async selectHash<T>(tableName: string, select: string, filters: Partial<T>): Promise<Hash<Primitive>>
|
|
197
197
|
{
|
|
198
198
|
if (!this.tables[tableName]) throw new Error(`table ${tableName} does not exist`);
|
|
199
199
|
let schema = this.tables[tableName][0].schema;
|