@wabot-dev/framework 0.1.0-beta.54 → 0.1.0-beta.55
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.
|
@@ -71,14 +71,12 @@ class PgCrudRepository extends PgRepositoryBase {
|
|
|
71
71
|
`;
|
|
72
72
|
await this.exec(sql, [...this.values(item), item.id]);
|
|
73
73
|
}
|
|
74
|
-
async
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
item.
|
|
80
|
-
_item.discard();
|
|
81
|
-
await this.update(_item);
|
|
74
|
+
async delete(item) {
|
|
75
|
+
const sql = `
|
|
76
|
+
DELETE FROM ${this.table}
|
|
77
|
+
WHERE id = $1
|
|
78
|
+
`;
|
|
79
|
+
await this.exec(sql, [item.id]);
|
|
82
80
|
}
|
|
83
81
|
}
|
|
84
82
|
|
package/dist/src/index.d.ts
CHANGED
|
@@ -46,7 +46,6 @@ declare class Entity<D extends IEntityData> extends Storable<D> {
|
|
|
46
46
|
update(newData: Omit<D, 'id' | 'createdAt' | 'discardedAt'>): void;
|
|
47
47
|
wasCreated(): boolean;
|
|
48
48
|
validate(): void;
|
|
49
|
-
discard(): void;
|
|
50
49
|
}
|
|
51
50
|
/**
|
|
52
51
|
* @deprecated Should use IEntityData
|
|
@@ -165,7 +164,7 @@ interface ICrudRepository<T> {
|
|
|
165
164
|
findAll(id: string): Promise<T[]>;
|
|
166
165
|
create(item: T): Promise<void>;
|
|
167
166
|
update(item: T): Promise<void>;
|
|
168
|
-
|
|
167
|
+
delete(item: T): Promise<void>;
|
|
169
168
|
}
|
|
170
169
|
|
|
171
170
|
declare function isModel(model: IConstructor<any>): (target: object, propertyKey: string | symbol) => void;
|
|
@@ -352,7 +351,7 @@ declare class JobRepository implements IJobRepository {
|
|
|
352
351
|
findAll(id: string): Promise<Job[]>;
|
|
353
352
|
create(item: Job): Promise<void>;
|
|
354
353
|
update(item: Job): Promise<void>;
|
|
355
|
-
|
|
354
|
+
delete(item: Job): Promise<void>;
|
|
356
355
|
}
|
|
357
356
|
|
|
358
357
|
interface IJobEvent extends IStorableData {
|
|
@@ -820,7 +819,7 @@ declare class PgCrudRepository<P extends Entity<IEntityData>> extends PgReposito
|
|
|
820
819
|
findAll(): Promise<P[]>;
|
|
821
820
|
create(item: P): Promise<void>;
|
|
822
821
|
update(item: P): Promise<void>;
|
|
823
|
-
|
|
822
|
+
delete(item: P): Promise<void>;
|
|
824
823
|
}
|
|
825
824
|
|
|
826
825
|
interface IEndPointConfig {
|
|
@@ -1083,7 +1082,7 @@ declare class JwtRefreshTokenRepository<D extends IStorableData> implements IJwt
|
|
|
1083
1082
|
findAll(id: string): Promise<JwtRefreshToken<D>[]>;
|
|
1084
1083
|
create(item: JwtRefreshToken<D>): Promise<void>;
|
|
1085
1084
|
update(item: JwtRefreshToken<D>): Promise<void>;
|
|
1086
|
-
|
|
1085
|
+
delete(item: JwtRefreshToken<D>): Promise<void>;
|
|
1087
1086
|
}
|
|
1088
1087
|
|
|
1089
1088
|
declare class Jwt {
|