onecore 0.5.14 → 0.5.16

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onecore",
3
- "version": "0.5.14",
3
+ "version": "0.5.16",
4
4
  "description": "onecore",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./src/index.ts",
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
+ }
package/src/metadata.ts CHANGED
@@ -59,3 +59,9 @@ export interface Attribute {
59
59
  export interface Attributes {
60
60
  [key: string]: Attribute;
61
61
  }
62
+ export interface FixedLengthAttribute extends Attribute {
63
+ length: number
64
+ }
65
+ export interface FixedLengthAttributes {
66
+ [key: string]: FixedLengthAttribute
67
+ }