onecore 0.5.14 → 0.5.15
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/index.ts +11 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -221,3 +221,14 @@ export class GenericUseCase<T, ID> extends Writer<T> implements GenericService<T
|
|
|
221
221
|
export const CRUDUseCase = GenericUseCase
|
|
222
222
|
export const GenericManager = GenericUseCase
|
|
223
223
|
export const CRUDManager = GenericUseCase
|
|
224
|
+
|
|
225
|
+
export interface SavedRepository<UID, ID> {
|
|
226
|
+
isSaved(userId: UID, id: ID): Promise<boolean>
|
|
227
|
+
save(userId: UID, id: ID): Promise<number>
|
|
228
|
+
remove(userId: UID, id: ID): Promise<number>
|
|
229
|
+
count(userId: UID): Promise<number>
|
|
230
|
+
}
|
|
231
|
+
export interface FollowRepository<ID> {
|
|
232
|
+
follow(id: ID, target: ID): Promise<number>
|
|
233
|
+
unfollow(id: ID, target: ID): Promise<number>
|
|
234
|
+
}
|