@ooneex/typeorm 0.0.1

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.
Files changed (84) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/dist/ooneex-typeorm-0.0.1.tgz +0 -0
  4. package/dist/shared/chunk-2e7zbxcq.js +5 -0
  5. package/dist/shared/chunk-2e7zbxcq.js.map +10 -0
  6. package/dist/shared/chunk-764bzjhz.js +5 -0
  7. package/dist/shared/chunk-764bzjhz.js.map +12 -0
  8. package/dist/shared/chunk-eh420jqn.js +5 -0
  9. package/dist/shared/chunk-eh420jqn.js.map +15 -0
  10. package/dist/shared/chunk-gjsgnzaq.js +5 -0
  11. package/dist/shared/chunk-gjsgnzaq.js.map +10 -0
  12. package/dist/shared/chunk-hw4vdg6q.js +5 -0
  13. package/dist/shared/chunk-hw4vdg6q.js.map +10 -0
  14. package/dist/shared/chunk-j7nprmyh.js +5 -0
  15. package/dist/shared/chunk-j7nprmyh.js.map +10 -0
  16. package/dist/shared/chunk-kgxsdeye.js +5 -0
  17. package/dist/shared/chunk-kgxsdeye.js.map +13 -0
  18. package/dist/shared/chunk-ntrrrvwt.js +5 -0
  19. package/dist/shared/chunk-ntrrrvwt.js.map +12 -0
  20. package/dist/shared/chunk-pwhygf44.js +5 -0
  21. package/dist/shared/chunk-pwhygf44.js.map +10 -0
  22. package/dist/shared/chunk-sd6mmec6.js +5 -0
  23. package/dist/shared/chunk-sd6mmec6.js.map +12 -0
  24. package/dist/shared/chunk-wawk30n1.js +5 -0
  25. package/dist/shared/chunk-wawk30n1.js.map +14 -0
  26. package/dist/shared/chunk-wmftwzcs.js +5 -0
  27. package/dist/shared/chunk-wmftwzcs.js.map +16 -0
  28. package/dist/shared/chunk-zmzz7hqq.js +5 -0
  29. package/dist/shared/chunk-zmzz7hqq.js.map +10 -0
  30. package/dist/src/entities/book/index.d.ts +62 -0
  31. package/dist/src/entities/book/index.js +4 -0
  32. package/dist/src/entities/book/index.js.map +9 -0
  33. package/dist/src/entities/common/index.d.ts +81 -0
  34. package/dist/src/entities/common/index.js +4 -0
  35. package/dist/src/entities/common/index.js.map +9 -0
  36. package/dist/src/entities/gamification/flashcard/index.d.ts +179 -0
  37. package/dist/src/entities/gamification/flashcard/index.js +4 -0
  38. package/dist/src/entities/gamification/flashcard/index.js.map +9 -0
  39. package/dist/src/entities/gamification/index.d.ts +22 -0
  40. package/dist/src/entities/gamification/index.js +4 -0
  41. package/dist/src/entities/gamification/index.js.map +9 -0
  42. package/dist/src/entities/gamification/mcq/index.d.ts +74 -0
  43. package/dist/src/entities/gamification/mcq/index.js +4 -0
  44. package/dist/src/entities/gamification/mcq/index.js.map +9 -0
  45. package/dist/src/entities/image/index.d.ts +35 -0
  46. package/dist/src/entities/image/index.js +4 -0
  47. package/dist/src/entities/image/index.js.map +9 -0
  48. package/dist/src/entities/payment/index.d.ts +89 -0
  49. package/dist/src/entities/payment/index.js +4 -0
  50. package/dist/src/entities/payment/index.js.map +9 -0
  51. package/dist/src/entities/user/index.d.ts +122 -0
  52. package/dist/src/entities/user/index.js +4 -0
  53. package/dist/src/entities/user/index.js.map +9 -0
  54. package/dist/src/entities/video/index.d.ts +67 -0
  55. package/dist/src/entities/video/index.js +4 -0
  56. package/dist/src/entities/video/index.js.map +9 -0
  57. package/dist/src/repositories/book/index.d.ts +128 -0
  58. package/dist/src/repositories/book/index.js +4 -0
  59. package/dist/src/repositories/book/index.js.map +12 -0
  60. package/dist/src/repositories/common/index.d.ts +210 -0
  61. package/dist/src/repositories/common/index.js +4 -0
  62. package/dist/src/repositories/common/index.js.map +15 -0
  63. package/dist/src/repositories/gamification/flashcard/index.d.ts +330 -0
  64. package/dist/src/repositories/gamification/flashcard/index.js +4 -0
  65. package/dist/src/repositories/gamification/flashcard/index.js.map +16 -0
  66. package/dist/src/repositories/gamification/index.d.ts +506 -0
  67. package/dist/src/repositories/gamification/index.js +4 -0
  68. package/dist/src/repositories/gamification/index.js.map +10 -0
  69. package/dist/src/repositories/gamification/mcq/index.d.ts +163 -0
  70. package/dist/src/repositories/gamification/mcq/index.js +4 -0
  71. package/dist/src/repositories/gamification/mcq/index.js.map +13 -0
  72. package/dist/src/repositories/image/index.d.ts +57 -0
  73. package/dist/src/repositories/image/index.js +4 -0
  74. package/dist/src/repositories/image/index.js.map +10 -0
  75. package/dist/src/repositories/payment/index.d.ts +220 -0
  76. package/dist/src/repositories/payment/index.js +4 -0
  77. package/dist/src/repositories/payment/index.js.map +15 -0
  78. package/dist/src/repositories/user/index.d.ts +245 -0
  79. package/dist/src/repositories/user/index.js +4 -0
  80. package/dist/src/repositories/user/index.js.map +14 -0
  81. package/dist/src/repositories/video/index.d.ts +132 -0
  82. package/dist/src/repositories/video/index.js +4 -0
  83. package/dist/src/repositories/video/index.js.map +12 -0
  84. package/package.json +155 -0
@@ -0,0 +1,210 @@
1
+ import { ITypeormDatabaseAdapter } from "@ooneex/database";
2
+ import { FilterResultType } from "@ooneex/types";
3
+ import { FindManyOptions, FindOptionsWhere, Repository, SaveOptions, UpdateResult } from "typeorm";
4
+ import { ICategory } from "@ooneex/category";
5
+ import { IColor } from "@ooneex/color";
6
+ import { LocaleType } from "@ooneex/translation";
7
+ import { IBase } from "@ooneex/types";
8
+ declare abstract class BaseEntity implements IBase {
9
+ id: string;
10
+ isLocked?: boolean;
11
+ lockedAt?: Date;
12
+ isBlocked?: boolean;
13
+ blockedAt?: Date;
14
+ blockReason?: string;
15
+ isPublic?: boolean;
16
+ language?: LocaleType;
17
+ createdAt?: Date;
18
+ updatedAt?: Date;
19
+ deletedAt?: Date;
20
+ }
21
+ declare class CategoryEntity extends BaseEntity implements ICategory {
22
+ name: string;
23
+ color?: IColor;
24
+ description?: string;
25
+ parent?: ICategory;
26
+ children?: ICategory[];
27
+ }
28
+ declare class CategoryRepository {
29
+ private readonly database;
30
+ constructor(database: ITypeormDatabaseAdapter);
31
+ open(): Promise<Repository<CategoryEntity>>;
32
+ close(): Promise<void>;
33
+ find(criteria: FindManyOptions<CategoryEntity> & {
34
+ page?: number;
35
+ limit?: number;
36
+ q?: string;
37
+ }): Promise<FilterResultType<CategoryEntity>>;
38
+ findOne(id: string): Promise<CategoryEntity | null>;
39
+ findOneBy(criteria: FindOptionsWhere<CategoryEntity>): Promise<CategoryEntity | null>;
40
+ create(entity: CategoryEntity, options?: SaveOptions): Promise<CategoryEntity>;
41
+ createMany(entities: CategoryEntity[], options?: SaveOptions): Promise<CategoryEntity[]>;
42
+ update(entity: CategoryEntity, options?: SaveOptions): Promise<CategoryEntity>;
43
+ updateMany(entities: CategoryEntity[], options?: SaveOptions): Promise<CategoryEntity[]>;
44
+ delete(criteria: FindOptionsWhere<CategoryEntity> | FindOptionsWhere<CategoryEntity>[]): Promise<UpdateResult>;
45
+ count(criteria?: FindOptionsWhere<CategoryEntity> | FindOptionsWhere<CategoryEntity>[]): Promise<number>;
46
+ }
47
+ import { ITypeormDatabaseAdapter as ITypeormDatabaseAdapter2 } from "@ooneex/database";
48
+ import { FilterResultType as FilterResultType2 } from "@ooneex/types";
49
+ import { FindManyOptions as FindManyOptions2, FindOptionsWhere as FindOptionsWhere2, Repository as Repository2, SaveOptions as SaveOptions2, UpdateResult as UpdateResult2 } from "typeorm";
50
+ import { HexaType, HSLAType, HSLType, IColor as IColor2, RGBAType, RGBType } from "@ooneex/color";
51
+ declare class ColorEntity extends BaseEntity implements IColor2 {
52
+ hex?: HexaType;
53
+ rgb?: RGBType;
54
+ rgba?: RGBAType;
55
+ hsl?: HSLType;
56
+ hsla?: HSLAType;
57
+ alpha?: number;
58
+ red?: number;
59
+ green?: number;
60
+ blue?: number;
61
+ hue?: number;
62
+ saturation?: number;
63
+ lightness?: number;
64
+ }
65
+ declare class ColorRepository {
66
+ private readonly database;
67
+ constructor(database: ITypeormDatabaseAdapter2);
68
+ open(): Promise<Repository2<ColorEntity>>;
69
+ close(): Promise<void>;
70
+ find(criteria: FindManyOptions2<ColorEntity> & {
71
+ page?: number;
72
+ limit?: number;
73
+ }): Promise<FilterResultType2<ColorEntity>>;
74
+ findOne(id: string): Promise<ColorEntity | null>;
75
+ findOneBy(criteria: FindOptionsWhere2<ColorEntity>): Promise<ColorEntity | null>;
76
+ create(entity: ColorEntity, options?: SaveOptions2): Promise<ColorEntity>;
77
+ createMany(entities: ColorEntity[], options?: SaveOptions2): Promise<ColorEntity[]>;
78
+ update(entity: ColorEntity, options?: SaveOptions2): Promise<ColorEntity>;
79
+ updateMany(entities: ColorEntity[], options?: SaveOptions2): Promise<ColorEntity[]>;
80
+ delete(criteria: FindOptionsWhere2<ColorEntity> | FindOptionsWhere2<ColorEntity>[]): Promise<UpdateResult2>;
81
+ count(criteria?: FindOptionsWhere2<ColorEntity> | FindOptionsWhere2<ColorEntity>[]): Promise<number>;
82
+ }
83
+ import { ITypeormDatabaseAdapter as ITypeormDatabaseAdapter3 } from "@ooneex/database";
84
+ import { FilterResultType as FilterResultType3 } from "@ooneex/types";
85
+ import { FindManyOptions as FindManyOptions3, FindOptionsWhere as FindOptionsWhere3, Repository as Repository3, SaveOptions as SaveOptions3, UpdateResult as UpdateResult3 } from "typeorm";
86
+ import { IColor as IColor3 } from "@ooneex/color";
87
+ import { IFolder } from "@ooneex/folder";
88
+ declare class FolderEntity extends BaseEntity implements IFolder {
89
+ name: string;
90
+ color?: IColor3;
91
+ description?: string;
92
+ context?: string;
93
+ contextId?: string;
94
+ parent?: IFolder;
95
+ children?: IFolder[];
96
+ }
97
+ declare class FolderRepository {
98
+ private readonly database;
99
+ constructor(database: ITypeormDatabaseAdapter3);
100
+ open(): Promise<Repository3<FolderEntity>>;
101
+ close(): Promise<void>;
102
+ find(criteria: FindManyOptions3<FolderEntity> & {
103
+ page?: number;
104
+ limit?: number;
105
+ q?: string;
106
+ }): Promise<FilterResultType3<FolderEntity>>;
107
+ findOne(id: string): Promise<FolderEntity | null>;
108
+ findOneBy(criteria: FindOptionsWhere3<FolderEntity>): Promise<FolderEntity | null>;
109
+ create(entity: FolderEntity, options?: SaveOptions3): Promise<FolderEntity>;
110
+ createMany(entities: FolderEntity[], options?: SaveOptions3): Promise<FolderEntity[]>;
111
+ update(entity: FolderEntity, options?: SaveOptions3): Promise<FolderEntity>;
112
+ updateMany(entities: FolderEntity[], options?: SaveOptions3): Promise<FolderEntity[]>;
113
+ delete(criteria: FindOptionsWhere3<FolderEntity> | FindOptionsWhere3<FolderEntity>[]): Promise<UpdateResult3>;
114
+ count(criteria?: FindOptionsWhere3<FolderEntity> | FindOptionsWhere3<FolderEntity>[]): Promise<number>;
115
+ }
116
+ import { ITypeormDatabaseAdapter as ITypeormDatabaseAdapter4 } from "@ooneex/database";
117
+ import { FilterResultType as FilterResultType4 } from "@ooneex/types";
118
+ import { FindManyOptions as FindManyOptions4, FindOptionsWhere as FindOptionsWhere4, Repository as Repository4, SaveOptions as SaveOptions4, UpdateResult as UpdateResult4 } from "typeorm";
119
+ import { IStat } from "@ooneex/types";
120
+ declare class StatEntity extends BaseEntity implements IStat {
121
+ commentCount: number;
122
+ likeCount: number;
123
+ shareCount: number;
124
+ viewCount: number;
125
+ downloadCount: number;
126
+ bookmarkCount: number;
127
+ repostCount: number;
128
+ impressionCount: number;
129
+ clickCount: number;
130
+ engagementRate: number;
131
+ reach: number;
132
+ followerCount: number;
133
+ followingCount: number;
134
+ }
135
+ declare class StatRepository {
136
+ private readonly database;
137
+ constructor(database: ITypeormDatabaseAdapter4);
138
+ open(): Promise<Repository4<StatEntity>>;
139
+ close(): Promise<void>;
140
+ find(criteria: FindManyOptions4<StatEntity> & {
141
+ page?: number;
142
+ limit?: number;
143
+ }): Promise<FilterResultType4<StatEntity>>;
144
+ findOne(id: string): Promise<StatEntity | null>;
145
+ findOneBy(criteria: FindOptionsWhere4<StatEntity>): Promise<StatEntity | null>;
146
+ create(entity: StatEntity, options?: SaveOptions4): Promise<StatEntity>;
147
+ createMany(entities: StatEntity[], options?: SaveOptions4): Promise<StatEntity[]>;
148
+ update(entity: StatEntity, options?: SaveOptions4): Promise<StatEntity>;
149
+ updateMany(entities: StatEntity[], options?: SaveOptions4): Promise<StatEntity[]>;
150
+ delete(criteria: FindOptionsWhere4<StatEntity> | FindOptionsWhere4<StatEntity>[]): Promise<UpdateResult4>;
151
+ count(criteria?: FindOptionsWhere4<StatEntity> | FindOptionsWhere4<StatEntity>[]): Promise<number>;
152
+ }
153
+ import { ITypeormDatabaseAdapter as ITypeormDatabaseAdapter5 } from "@ooneex/database";
154
+ import { FilterResultType as FilterResultType5 } from "@ooneex/types";
155
+ import { FindManyOptions as FindManyOptions5, FindOptionsWhere as FindOptionsWhere5, Repository as Repository5, SaveOptions as SaveOptions5, UpdateResult as UpdateResult5 } from "typeorm";
156
+ import { IColor as IColor4 } from "@ooneex/color";
157
+ import { EStatus, IStatus } from "@ooneex/status";
158
+ declare class StatusEntity extends BaseEntity implements IStatus {
159
+ status: EStatus;
160
+ color?: IColor4;
161
+ description?: string;
162
+ reason?: string;
163
+ }
164
+ declare class StatusRepository {
165
+ private readonly database;
166
+ constructor(database: ITypeormDatabaseAdapter5);
167
+ open(): Promise<Repository5<StatusEntity>>;
168
+ close(): Promise<void>;
169
+ find(criteria: FindManyOptions5<StatusEntity> & {
170
+ page?: number;
171
+ limit?: number;
172
+ }): Promise<FilterResultType5<StatusEntity>>;
173
+ findOne(id: string): Promise<StatusEntity | null>;
174
+ findOneBy(criteria: FindOptionsWhere5<StatusEntity>): Promise<StatusEntity | null>;
175
+ create(entity: StatusEntity, options?: SaveOptions5): Promise<StatusEntity>;
176
+ createMany(entities: StatusEntity[], options?: SaveOptions5): Promise<StatusEntity[]>;
177
+ update(entity: StatusEntity, options?: SaveOptions5): Promise<StatusEntity>;
178
+ updateMany(entities: StatusEntity[], options?: SaveOptions5): Promise<StatusEntity[]>;
179
+ delete(criteria: FindOptionsWhere5<StatusEntity> | FindOptionsWhere5<StatusEntity>[]): Promise<UpdateResult5>;
180
+ count(criteria?: FindOptionsWhere5<StatusEntity> | FindOptionsWhere5<StatusEntity>[]): Promise<number>;
181
+ }
182
+ import { ITypeormDatabaseAdapter as ITypeormDatabaseAdapter6 } from "@ooneex/database";
183
+ import { FilterResultType as FilterResultType6 } from "@ooneex/types";
184
+ import { FindManyOptions as FindManyOptions6, FindOptionsWhere as FindOptionsWhere6, Repository as Repository6, SaveOptions as SaveOptions6, UpdateResult as UpdateResult6 } from "typeorm";
185
+ import { IColor as IColor5 } from "@ooneex/color";
186
+ import { ITag } from "@ooneex/tag";
187
+ declare class TagEntity extends BaseEntity implements ITag {
188
+ name: string;
189
+ color?: IColor5;
190
+ }
191
+ declare class TagRepository {
192
+ private readonly database;
193
+ constructor(database: ITypeormDatabaseAdapter6);
194
+ open(): Promise<Repository6<TagEntity>>;
195
+ close(): Promise<void>;
196
+ find(criteria: FindManyOptions6<TagEntity> & {
197
+ page?: number;
198
+ limit?: number;
199
+ q?: string;
200
+ }): Promise<FilterResultType6<TagEntity>>;
201
+ findOne(id: string): Promise<TagEntity | null>;
202
+ findOneBy(criteria: FindOptionsWhere6<TagEntity>): Promise<TagEntity | null>;
203
+ create(entity: TagEntity, options?: SaveOptions6): Promise<TagEntity>;
204
+ createMany(entities: TagEntity[], options?: SaveOptions6): Promise<TagEntity[]>;
205
+ update(entity: TagEntity, options?: SaveOptions6): Promise<TagEntity>;
206
+ updateMany(entities: TagEntity[], options?: SaveOptions6): Promise<TagEntity[]>;
207
+ delete(criteria: FindOptionsWhere6<TagEntity> | FindOptionsWhere6<TagEntity>[]): Promise<UpdateResult6>;
208
+ count(criteria?: FindOptionsWhere6<TagEntity> | FindOptionsWhere6<TagEntity>[]): Promise<number>;
209
+ }
210
+ export { TagRepository, StatusRepository, StatRepository, FolderRepository, ColorRepository, CategoryRepository };
@@ -0,0 +1,4 @@
1
+ // @bun
2
+ import{s as L}from"../../../shared/chunk-gjsgnzaq.js";import{C as b}from"../../../shared/chunk-zmzz7hqq.js";import{P}from"../../../shared/chunk-hw4vdg6q.js";import{R as j,S as W,T as h}from"../../../shared/chunk-764bzjhz.js";import{V as M,W as N,X as Q}from"../../../shared/chunk-j7nprmyh.js";import{inject as O}from"@ooneex/container";import{ILike as T}from"typeorm";class Z{database;constructor(x){this.database=x}async open(){return await this.database.open(b)}async close(){await this.database.close()}async find(x){let v=await this.open(),{page:z=1,limit:B=100,q:G,...D}=x,H,K=B===0?100:B;if(z&&z>0&&B&&B>0)H=(z-1)*K;let J={...D,take:K,...H!==void 0&&{skip:H}};if(G)J={...J,where:{...D.where,name:T(`%${G}%`)}};let U=await v.find(J),V=D.where;if(G)V={...D.where,name:T(`%${G}%`)};let X=await this.count(V),Y=Math.ceil(X/B);return{resources:U,total:X,totalPages:Y,page:z,limit:B}}async findOne(x){return await(await this.open()).findOne({where:{id:x}})}async findOneBy(x){return await(await this.open()).findOne({where:x})}async create(x,v){return await(await this.open()).save(x,v)}async createMany(x,v){return await(await this.open()).save(x,v)}async update(x,v){return await this.create(x,v)}async updateMany(x,v){return await this.createMany(x,v)}async delete(x){return await(await this.open()).softDelete(x)}async count(x){return await(await this.open()).count(x?{where:x}:{})}}Z=M([N(0,O("database")),Q("design:paramtypes",[typeof ITypeormDatabaseAdapter==="undefined"?Object:ITypeormDatabaseAdapter])],Z);import{inject as C}from"@ooneex/container";class _{database;constructor(x){this.database=x}async open(){return await this.database.open(j)}async close(){await this.database.close()}async find(x){let v=await this.open(),{page:z=1,limit:B=100,...G}=x,D,H=B===0?100:B;if(z&&z>0&&B&&B>0)D=(z-1)*H;let K=await v.find({...G,take:H,...D!==void 0&&{skip:D}}),J=await this.count(G.where),U=Math.ceil(J/B);return{resources:K,total:J,totalPages:U,page:z,limit:B}}async findOne(x){return await(await this.open()).findOne({where:{id:x}})}async findOneBy(x){return await(await this.open()).findOne({where:x})}async create(x,v){return await(await this.open()).save(x,v)}async createMany(x,v){return await(await this.open()).save(x,v)}async update(x,v){return await this.create(x,v)}async updateMany(x,v){return await this.createMany(x,v)}async delete(x){return await(await this.open()).softDelete(x)}async count(x){return await(await this.open()).count(x?{where:x}:{})}}_=M([N(0,C("database")),Q("design:paramtypes",[typeof ITypeormDatabaseAdapter==="undefined"?Object:ITypeormDatabaseAdapter])],_);import{inject as S}from"@ooneex/container";import{ILike as I}from"typeorm";class ${database;constructor(x){this.database=x}async open(){return await this.database.open(L)}async close(){await this.database.close()}async find(x){let v=await this.open(),{page:z=1,limit:B=100,q:G,...D}=x,H,K=B===0?100:B;if(z&&z>0&&B&&B>0)H=(z-1)*K;let J={...D,take:K,...H!==void 0&&{skip:H}};if(G)J={...J,where:{...D.where,name:I(`%${G}%`)}};let U=await v.find(J),V=D.where;if(G)V={...D.where,name:I(`%${G}%`)};let X=await this.count(V),Y=Math.ceil(X/B);return{resources:U,total:X,totalPages:Y,page:z,limit:B}}async findOne(x){return await(await this.open()).findOne({where:{id:x}})}async findOneBy(x){return await(await this.open()).findOne({where:x})}async create(x,v){return await(await this.open()).save(x,v)}async createMany(x,v){return await(await this.open()).save(x,v)}async update(x,v){return await this.create(x,v)}async updateMany(x,v){return await this.createMany(x,v)}async delete(x){return await(await this.open()).softDelete(x)}async count(x){return await(await this.open()).count(x?{where:x}:{})}}$=M([N(0,S("database")),Q("design:paramtypes",[typeof ITypeormDatabaseAdapter==="undefined"?Object:ITypeormDatabaseAdapter])],$);import{inject as q}from"@ooneex/container";class A{database;constructor(x){this.database=x}async open(){return await this.database.open(P)}async close(){await this.database.close()}async find(x){let v=await this.open(),{page:z=1,limit:B=100,...G}=x,D,H=B===0?100:B;if(z&&z>0&&B&&B>0)D=(z-1)*H;let K=await v.find({...G,take:H,...D!==void 0&&{skip:D}}),J=await this.count(G.where),U=Math.ceil(J/B);return{resources:K,total:J,totalPages:U,page:z,limit:B}}async findOne(x){return await(await this.open()).findOne({where:{id:x}})}async findOneBy(x){return await(await this.open()).findOne({where:x})}async create(x,v){return await(await this.open()).save(x,v)}async createMany(x,v){return await(await this.open()).save(x,v)}async update(x,v){return await this.create(x,v)}async updateMany(x,v){return await this.createMany(x,v)}async delete(x){return await(await this.open()).softDelete(x)}async count(x){return await(await this.open()).count(x?{where:x}:{})}}A=M([N(0,q("database")),Q("design:paramtypes",[typeof ITypeormDatabaseAdapter==="undefined"?Object:ITypeormDatabaseAdapter])],A);import{inject as E}from"@ooneex/container";class f{database;constructor(x){this.database=x}async open(){return await this.database.open(W)}async close(){await this.database.close()}async find(x){let v=await this.open(),{page:z=1,limit:B=100,...G}=x,D,H=B===0?100:B;if(z&&z>0&&B&&B>0)D=(z-1)*H;let K=await v.find({...G,take:H,...D!==void 0&&{skip:D}}),J=await this.count(G.where),U=Math.ceil(J/B);return{resources:K,total:J,totalPages:U,page:z,limit:B}}async findOne(x){return await(await this.open()).findOne({where:{id:x}})}async findOneBy(x){return await(await this.open()).findOne({where:x})}async create(x,v){return await(await this.open()).save(x,v)}async createMany(x,v){return await(await this.open()).save(x,v)}async update(x,v){return await this.create(x,v)}async updateMany(x,v){return await this.createMany(x,v)}async delete(x){return await(await this.open()).softDelete(x)}async count(x){return await(await this.open()).count(x?{where:x}:{})}}f=M([N(0,E("database")),Q("design:paramtypes",[typeof ITypeormDatabaseAdapter==="undefined"?Object:ITypeormDatabaseAdapter])],f);import{inject as R}from"@ooneex/container";import{ILike as w}from"typeorm";class F{database;constructor(x){this.database=x}async open(){return await this.database.open(h)}async close(){await this.database.close()}async find(x){let v=await this.open(),{page:z=1,limit:B=100,q:G,...D}=x,H,K=B===0?100:B;if(z&&z>0&&B&&B>0)H=(z-1)*K;let J={...D,take:K,...H!==void 0&&{skip:H}};if(G)J={...J,where:{...D.where,name:w(`%${G}%`)}};let U=await v.find(J),V=D.where;if(G)V={...D.where,name:w(`%${G}%`)};let X=await this.count(V),Y=Math.ceil(X/B);return{resources:U,total:X,totalPages:Y,page:z,limit:B}}async findOne(x){return await(await this.open()).findOne({where:{id:x}})}async findOneBy(x){return await(await this.open()).findOne({where:x})}async create(x,v){return await(await this.open()).save(x,v)}async createMany(x,v){return await(await this.open()).save(x,v)}async update(x,v){return await this.create(x,v)}async updateMany(x,v){return await this.createMany(x,v)}async delete(x){return await(await this.open()).softDelete(x)}async count(x){return await(await this.open()).count(x?{where:x}:{})}}F=M([N(0,R("database")),Q("design:paramtypes",[typeof ITypeormDatabaseAdapter==="undefined"?Object:ITypeormDatabaseAdapter])],F);export{F as TagRepository,f as StatusRepository,A as StatRepository,$ as FolderRepository,_ as ColorRepository,Z as CategoryRepository};
3
+
4
+ //# debugId=18E977410628159364756E2164756E21
@@ -0,0 +1,15 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["src/repositories/common/CategoryRepository.ts", "src/repositories/common/ColorRepository.ts", "src/repositories/common/FolderRepository.ts", "src/repositories/common/StatRepository.ts", "src/repositories/common/StatusRepository.ts", "src/repositories/common/TagRepository.ts"],
4
+ "sourcesContent": [
5
+ "import { inject } from \"@ooneex/container\";\nimport type { ITypeormDatabaseAdapter } from \"@ooneex/database\";\nimport type { FilterResultType } from \"@ooneex/types\";\nimport type { FindManyOptions, FindOptionsWhere, Repository, SaveOptions, UpdateResult } from \"typeorm\";\nimport { ILike } from \"typeorm\";\nimport { CategoryEntity } from \"../../entities/common/CategoryEntity\";\n\nexport class CategoryRepository {\n constructor(\n @inject(\"database\")\n private readonly database: ITypeormDatabaseAdapter,\n ) {}\n\n public async open(): Promise<Repository<CategoryEntity>> {\n return await this.database.open(CategoryEntity);\n }\n\n public async close(): Promise<void> {\n await this.database.close();\n }\n\n public async find(\n criteria: FindManyOptions<CategoryEntity> & { page?: number; limit?: number; q?: string },\n ): Promise<FilterResultType<CategoryEntity>> {\n const repository = await this.open();\n\n const { page = 1, limit = 100, q, ...rest } = criteria;\n\n let skip: number | undefined;\n const take = limit === 0 ? 100 : limit;\n\n if (page && page > 0 && limit && limit > 0) {\n skip = (page - 1) * take;\n }\n\n // Apply category name search if q parameter is provided\n let findOptions = { ...rest, take, ...(skip !== undefined && { skip }) };\n if (q) {\n findOptions = {\n ...findOptions,\n where: {\n ...rest.where,\n name: ILike(`%${q}%`),\n },\n };\n }\n\n const result = await repository.find(findOptions);\n\n // Apply the same where conditions for count including name search\n let countWhere = rest.where;\n if (q) {\n countWhere = {\n ...rest.where,\n name: ILike(`%${q}%`),\n };\n }\n\n const total = await this.count(countWhere);\n const totalPages = Math.ceil(total / limit);\n\n return {\n resources: result,\n total,\n totalPages,\n page,\n limit,\n };\n }\n\n public async findOne(id: string): Promise<CategoryEntity | null> {\n const repository = await this.open();\n\n return await repository.findOne({\n where: { id },\n });\n }\n\n public async findOneBy(criteria: FindOptionsWhere<CategoryEntity>): Promise<CategoryEntity | null> {\n const repository = await this.open();\n\n return await repository.findOne({\n where: criteria,\n });\n }\n\n public async create(entity: CategoryEntity, options?: SaveOptions): Promise<CategoryEntity> {\n const repository = await this.open();\n\n return await repository.save(entity, options);\n }\n\n public async createMany(entities: CategoryEntity[], options?: SaveOptions): Promise<CategoryEntity[]> {\n const repository = await this.open();\n\n return await repository.save(entities, options);\n }\n\n public async update(entity: CategoryEntity, options?: SaveOptions): Promise<CategoryEntity> {\n return await this.create(entity, options);\n }\n\n public async updateMany(entities: CategoryEntity[], options?: SaveOptions): Promise<CategoryEntity[]> {\n return await this.createMany(entities, options);\n }\n\n public async delete(\n criteria: FindOptionsWhere<CategoryEntity> | FindOptionsWhere<CategoryEntity>[],\n ): Promise<UpdateResult> {\n const repository = await this.open();\n\n return await repository.softDelete(criteria);\n }\n\n public async count(\n criteria?: FindOptionsWhere<CategoryEntity> | FindOptionsWhere<CategoryEntity>[],\n ): Promise<number> {\n const repository = await this.open();\n\n return await repository.count(criteria ? { where: criteria } : {});\n }\n}\n",
6
+ "import { inject } from \"@ooneex/container\";\nimport type { ITypeormDatabaseAdapter } from \"@ooneex/database\";\nimport type { FilterResultType } from \"@ooneex/types\";\nimport type { FindManyOptions, FindOptionsWhere, Repository, SaveOptions, UpdateResult } from \"typeorm\";\nimport { ColorEntity } from \"../../entities/common/ColorEntity\";\n\nexport class ColorRepository {\n constructor(\n @inject(\"database\")\n private readonly database: ITypeormDatabaseAdapter,\n ) {}\n\n public async open(): Promise<Repository<ColorEntity>> {\n return await this.database.open(ColorEntity);\n }\n\n public async close(): Promise<void> {\n await this.database.close();\n }\n\n public async find(\n criteria: FindManyOptions<ColorEntity> & { page?: number; limit?: number },\n ): Promise<FilterResultType<ColorEntity>> {\n const repository = await this.open();\n\n const { page = 1, limit = 100, ...rest } = criteria;\n\n let skip: number | undefined;\n const take = limit === 0 ? 100 : limit;\n\n if (page && page > 0 && limit && limit > 0) {\n skip = (page - 1) * take;\n }\n\n const result = await repository.find({ ...rest, take, ...(skip !== undefined && { skip }) });\n\n const total = await this.count(rest.where);\n const totalPages = Math.ceil(total / limit);\n\n return {\n resources: result,\n total,\n totalPages,\n page,\n limit,\n };\n }\n\n public async findOne(id: string): Promise<ColorEntity | null> {\n const repository = await this.open();\n\n return await repository.findOne({\n where: { id },\n });\n }\n\n public async findOneBy(criteria: FindOptionsWhere<ColorEntity>): Promise<ColorEntity | null> {\n const repository = await this.open();\n\n return await repository.findOne({\n where: criteria,\n });\n }\n\n public async create(entity: ColorEntity, options?: SaveOptions): Promise<ColorEntity> {\n const repository = await this.open();\n\n return await repository.save(entity, options);\n }\n\n public async createMany(entities: ColorEntity[], options?: SaveOptions): Promise<ColorEntity[]> {\n const repository = await this.open();\n\n return await repository.save(entities, options);\n }\n\n public async update(entity: ColorEntity, options?: SaveOptions): Promise<ColorEntity> {\n return await this.create(entity, options);\n }\n\n public async updateMany(entities: ColorEntity[], options?: SaveOptions): Promise<ColorEntity[]> {\n return await this.createMany(entities, options);\n }\n\n public async delete(\n criteria: FindOptionsWhere<ColorEntity> | FindOptionsWhere<ColorEntity>[],\n ): Promise<UpdateResult> {\n const repository = await this.open();\n\n return await repository.softDelete(criteria);\n }\n\n public async count(criteria?: FindOptionsWhere<ColorEntity> | FindOptionsWhere<ColorEntity>[]): Promise<number> {\n const repository = await this.open();\n\n return await repository.count(criteria ? { where: criteria } : {});\n }\n}\n",
7
+ "import { inject } from \"@ooneex/container\";\nimport type { ITypeormDatabaseAdapter } from \"@ooneex/database\";\nimport type { FilterResultType } from \"@ooneex/types\";\nimport type { FindManyOptions, FindOptionsWhere, Repository, SaveOptions, UpdateResult } from \"typeorm\";\nimport { ILike } from \"typeorm\";\nimport { FolderEntity } from \"../../entities/common/FolderEntity\";\n\nexport class FolderRepository {\n constructor(\n @inject(\"database\")\n private readonly database: ITypeormDatabaseAdapter,\n ) {}\n\n public async open(): Promise<Repository<FolderEntity>> {\n return await this.database.open(FolderEntity);\n }\n\n public async close(): Promise<void> {\n await this.database.close();\n }\n\n public async find(\n criteria: FindManyOptions<FolderEntity> & { page?: number; limit?: number; q?: string },\n ): Promise<FilterResultType<FolderEntity>> {\n const repository = await this.open();\n\n const { page = 1, limit = 100, q, ...rest } = criteria;\n\n let skip: number | undefined;\n const take = limit === 0 ? 100 : limit;\n\n if (page && page > 0 && limit && limit > 0) {\n skip = (page - 1) * take;\n }\n\n // Apply folder name search if q parameter is provided\n let findOptions = { ...rest, take, ...(skip !== undefined && { skip }) };\n if (q) {\n findOptions = {\n ...findOptions,\n where: {\n ...rest.where,\n name: ILike(`%${q}%`),\n },\n };\n }\n\n const result = await repository.find(findOptions);\n\n // Apply the same where conditions for count including name search\n let countWhere = rest.where;\n if (q) {\n countWhere = {\n ...rest.where,\n name: ILike(`%${q}%`),\n };\n }\n\n const total = await this.count(countWhere);\n const totalPages = Math.ceil(total / limit);\n\n return {\n resources: result,\n total,\n totalPages,\n page,\n limit,\n };\n }\n\n public async findOne(id: string): Promise<FolderEntity | null> {\n const repository = await this.open();\n\n return await repository.findOne({\n where: { id },\n });\n }\n\n public async findOneBy(criteria: FindOptionsWhere<FolderEntity>): Promise<FolderEntity | null> {\n const repository = await this.open();\n\n return await repository.findOne({\n where: criteria,\n });\n }\n\n public async create(entity: FolderEntity, options?: SaveOptions): Promise<FolderEntity> {\n const repository = await this.open();\n\n return await repository.save(entity, options);\n }\n\n public async createMany(entities: FolderEntity[], options?: SaveOptions): Promise<FolderEntity[]> {\n const repository = await this.open();\n\n return await repository.save(entities, options);\n }\n\n public async update(entity: FolderEntity, options?: SaveOptions): Promise<FolderEntity> {\n return await this.create(entity, options);\n }\n\n public async updateMany(entities: FolderEntity[], options?: SaveOptions): Promise<FolderEntity[]> {\n return await this.createMany(entities, options);\n }\n\n public async delete(\n criteria: FindOptionsWhere<FolderEntity> | FindOptionsWhere<FolderEntity>[],\n ): Promise<UpdateResult> {\n const repository = await this.open();\n\n return await repository.softDelete(criteria);\n }\n\n public async count(criteria?: FindOptionsWhere<FolderEntity> | FindOptionsWhere<FolderEntity>[]): Promise<number> {\n const repository = await this.open();\n\n return await repository.count(criteria ? { where: criteria } : {});\n }\n}\n",
8
+ "import { inject } from \"@ooneex/container\";\nimport type { ITypeormDatabaseAdapter } from \"@ooneex/database\";\nimport type { FilterResultType } from \"@ooneex/types\";\nimport type { FindManyOptions, FindOptionsWhere, Repository, SaveOptions, UpdateResult } from \"typeorm\";\nimport { StatEntity } from \"../../entities/common/StatEntity\";\n\nexport class StatRepository {\n constructor(\n @inject(\"database\")\n private readonly database: ITypeormDatabaseAdapter,\n ) {}\n\n public async open(): Promise<Repository<StatEntity>> {\n return await this.database.open(StatEntity);\n }\n\n public async close(): Promise<void> {\n await this.database.close();\n }\n\n public async find(\n criteria: FindManyOptions<StatEntity> & { page?: number; limit?: number },\n ): Promise<FilterResultType<StatEntity>> {\n const repository = await this.open();\n\n const { page = 1, limit = 100, ...rest } = criteria;\n\n let skip: number | undefined;\n const take = limit === 0 ? 100 : limit;\n\n if (page && page > 0 && limit && limit > 0) {\n skip = (page - 1) * take;\n }\n\n const result = await repository.find({ ...rest, take, ...(skip !== undefined && { skip }) });\n\n const total = await this.count(rest.where);\n const totalPages = Math.ceil(total / limit);\n\n return {\n resources: result,\n total,\n totalPages,\n page,\n limit,\n };\n }\n\n public async findOne(id: string): Promise<StatEntity | null> {\n const repository = await this.open();\n\n return await repository.findOne({\n where: { id },\n });\n }\n\n public async findOneBy(criteria: FindOptionsWhere<StatEntity>): Promise<StatEntity | null> {\n const repository = await this.open();\n\n return await repository.findOne({\n where: criteria,\n });\n }\n\n public async create(entity: StatEntity, options?: SaveOptions): Promise<StatEntity> {\n const repository = await this.open();\n\n return await repository.save(entity, options);\n }\n\n public async createMany(entities: StatEntity[], options?: SaveOptions): Promise<StatEntity[]> {\n const repository = await this.open();\n\n return await repository.save(entities, options);\n }\n\n public async update(entity: StatEntity, options?: SaveOptions): Promise<StatEntity> {\n return await this.create(entity, options);\n }\n\n public async updateMany(entities: StatEntity[], options?: SaveOptions): Promise<StatEntity[]> {\n return await this.createMany(entities, options);\n }\n\n public async delete(criteria: FindOptionsWhere<StatEntity> | FindOptionsWhere<StatEntity>[]): Promise<UpdateResult> {\n const repository = await this.open();\n\n return await repository.softDelete(criteria);\n }\n\n public async count(criteria?: FindOptionsWhere<StatEntity> | FindOptionsWhere<StatEntity>[]): Promise<number> {\n const repository = await this.open();\n\n return await repository.count(criteria ? { where: criteria } : {});\n }\n}\n",
9
+ "import { inject } from \"@ooneex/container\";\nimport type { ITypeormDatabaseAdapter } from \"@ooneex/database\";\nimport type { FilterResultType } from \"@ooneex/types\";\nimport type { FindManyOptions, FindOptionsWhere, Repository, SaveOptions, UpdateResult } from \"typeorm\";\nimport { StatusEntity } from \"../../entities/common/StatusEntity\";\n\nexport class StatusRepository {\n constructor(\n @inject(\"database\")\n private readonly database: ITypeormDatabaseAdapter,\n ) {}\n\n public async open(): Promise<Repository<StatusEntity>> {\n return await this.database.open(StatusEntity);\n }\n\n public async close(): Promise<void> {\n await this.database.close();\n }\n\n public async find(\n criteria: FindManyOptions<StatusEntity> & { page?: number; limit?: number },\n ): Promise<FilterResultType<StatusEntity>> {\n const repository = await this.open();\n\n const { page = 1, limit = 100, ...rest } = criteria;\n\n let skip: number | undefined;\n const take = limit === 0 ? 100 : limit;\n\n if (page && page > 0 && limit && limit > 0) {\n skip = (page - 1) * take;\n }\n\n const result = await repository.find({ ...rest, take, ...(skip !== undefined && { skip }) });\n\n const total = await this.count(rest.where);\n const totalPages = Math.ceil(total / limit);\n\n return {\n resources: result,\n total,\n totalPages,\n page,\n limit,\n };\n }\n\n public async findOne(id: string): Promise<StatusEntity | null> {\n const repository = await this.open();\n\n return await repository.findOne({\n where: { id },\n });\n }\n\n public async findOneBy(criteria: FindOptionsWhere<StatusEntity>): Promise<StatusEntity | null> {\n const repository = await this.open();\n\n return await repository.findOne({\n where: criteria,\n });\n }\n\n public async create(entity: StatusEntity, options?: SaveOptions): Promise<StatusEntity> {\n const repository = await this.open();\n\n return await repository.save(entity, options);\n }\n\n public async createMany(entities: StatusEntity[], options?: SaveOptions): Promise<StatusEntity[]> {\n const repository = await this.open();\n\n return await repository.save(entities, options);\n }\n\n public async update(entity: StatusEntity, options?: SaveOptions): Promise<StatusEntity> {\n return await this.create(entity, options);\n }\n\n public async updateMany(entities: StatusEntity[], options?: SaveOptions): Promise<StatusEntity[]> {\n return await this.createMany(entities, options);\n }\n\n public async delete(\n criteria: FindOptionsWhere<StatusEntity> | FindOptionsWhere<StatusEntity>[],\n ): Promise<UpdateResult> {\n const repository = await this.open();\n\n return await repository.softDelete(criteria);\n }\n\n public async count(criteria?: FindOptionsWhere<StatusEntity> | FindOptionsWhere<StatusEntity>[]): Promise<number> {\n const repository = await this.open();\n\n return await repository.count(criteria ? { where: criteria } : {});\n }\n}\n",
10
+ "import { inject } from \"@ooneex/container\";\nimport type { ITypeormDatabaseAdapter } from \"@ooneex/database\";\nimport type { FilterResultType } from \"@ooneex/types\";\nimport type { FindManyOptions, FindOptionsWhere, Repository, SaveOptions, UpdateResult } from \"typeorm\";\nimport { ILike } from \"typeorm\";\nimport { TagEntity } from \"../../entities/common/TagEntity\";\n\nexport class TagRepository {\n constructor(\n @inject(\"database\")\n private readonly database: ITypeormDatabaseAdapter,\n ) {}\n\n public async open(): Promise<Repository<TagEntity>> {\n return await this.database.open(TagEntity);\n }\n\n public async close(): Promise<void> {\n await this.database.close();\n }\n\n public async find(\n criteria: FindManyOptions<TagEntity> & { page?: number; limit?: number; q?: string },\n ): Promise<FilterResultType<TagEntity>> {\n const repository = await this.open();\n\n const { page = 1, limit = 100, q, ...rest } = criteria;\n\n let skip: number | undefined;\n const take = limit === 0 ? 100 : limit;\n\n if (page && page > 0 && limit && limit > 0) {\n skip = (page - 1) * take;\n }\n\n // Apply tag name search if q parameter is provided\n let findOptions = { ...rest, take, ...(skip !== undefined && { skip }) };\n if (q) {\n findOptions = {\n ...findOptions,\n where: {\n ...rest.where,\n name: ILike(`%${q}%`),\n },\n };\n }\n\n const result = await repository.find(findOptions);\n\n // Apply the same where conditions for count including name search\n let countWhere = rest.where;\n if (q) {\n countWhere = {\n ...rest.where,\n name: ILike(`%${q}%`),\n };\n }\n\n const total = await this.count(countWhere);\n const totalPages = Math.ceil(total / limit);\n\n return {\n resources: result,\n total,\n totalPages,\n page,\n limit,\n };\n }\n\n public async findOne(id: string): Promise<TagEntity | null> {\n const repository = await this.open();\n\n return await repository.findOne({\n where: { id },\n });\n }\n\n public async findOneBy(criteria: FindOptionsWhere<TagEntity>): Promise<TagEntity | null> {\n const repository = await this.open();\n\n return await repository.findOne({\n where: criteria,\n });\n }\n\n public async create(entity: TagEntity, options?: SaveOptions): Promise<TagEntity> {\n const repository = await this.open();\n\n return await repository.save(entity, options);\n }\n\n public async createMany(entities: TagEntity[], options?: SaveOptions): Promise<TagEntity[]> {\n const repository = await this.open();\n\n return await repository.save(entities, options);\n }\n\n public async update(entity: TagEntity, options?: SaveOptions): Promise<TagEntity> {\n return await this.create(entity, options);\n }\n\n public async updateMany(entities: TagEntity[], options?: SaveOptions): Promise<TagEntity[]> {\n return await this.createMany(entities, options);\n }\n\n public async delete(criteria: FindOptionsWhere<TagEntity> | FindOptionsWhere<TagEntity>[]): Promise<UpdateResult> {\n const repository = await this.open();\n\n return await repository.softDelete(criteria);\n }\n\n public async count(criteria?: FindOptionsWhere<TagEntity> | FindOptionsWhere<TagEntity>[]): Promise<number> {\n const repository = await this.open();\n\n return await repository.count(criteria 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A2C,CAGhF,OAAO,MAFY,MAAM,KAAK,KAAK,GAEX,KAAK,EAAQ,CAAO,OAGjC,WAAU,CAAC,EAAuB,EAA6C,CAG1F,OAAO,MAFY,MAAM,KAAK,KAAK,GAEX,KAAK,EAAU,CAAO,OAGnC,OAAM,CAAC,EAAmB,EAA2C,CAChF,OAAO,MAAM,KAAK,OAAO,EAAQ,CAAO,OAG7B,WAAU,CAAC,EAAuB,EAA6C,CAC1F,OAAO,MAAM,KAAK,WAAW,EAAU,CAAO,OAGnC,OAAM,CAAC,EAA8F,CAGhH,OAAO,MAFY,MAAM,KAAK,KAAK,GAEX,WAAW,CAAQ,OAGhC,MAAK,CAAC,EAAyF,CAG1G,OAAO,MAFY,MAAM,KAAK,KAAK,GAEX,MAAM,EAAW,CAAE,MAAO,CAAS,EAAI,CAAC,CAAC,EAErE,CA9Ga,EAAN,GAEF,MAAO,UAAU,GAFf,sGAAM",
13
+ "debugId": "18E977410628159364756E2164756E21",
14
+ "names": []
15
+ }
@@ -0,0 +1,330 @@
1
+ import { ITypeormDatabaseAdapter } from "@ooneex/database";
2
+ import { FilterResultType } from "@ooneex/types";
3
+ import { FindManyOptions, FindOptionsWhere, Repository, SaveOptions, UpdateResult } from "typeorm";
4
+ import { IFlashcard, IFlashcardDeck } from "@ooneex/gamification/flashcard";
5
+ import { EFlashcardAlgorithm } from "@ooneex/gamification/flashcard";
6
+ import { IStatus } from "@ooneex/status";
7
+ import { IStat } from "@ooneex/types";
8
+ import { LocaleType } from "@ooneex/translation";
9
+ import { IBase } from "@ooneex/types";
10
+ declare abstract class BaseEntity implements IBase {
11
+ id: string;
12
+ isLocked?: boolean;
13
+ lockedAt?: Date;
14
+ isBlocked?: boolean;
15
+ blockedAt?: Date;
16
+ blockReason?: string;
17
+ isPublic?: boolean;
18
+ language?: LocaleType;
19
+ createdAt?: Date;
20
+ updatedAt?: Date;
21
+ deletedAt?: Date;
22
+ }
23
+ declare class FlashcardDeckEntity extends BaseEntity implements IFlashcardDeck {
24
+ name: string;
25
+ description?: string;
26
+ totalCards: number;
27
+ newCards: number;
28
+ learningCards: number;
29
+ dueCards: number;
30
+ suspendedCards: number;
31
+ cards: IFlashcard[];
32
+ algorithm: EFlashcardAlgorithm;
33
+ maxNewCardsPerDay: number;
34
+ maxReviewCardsPerDay: number;
35
+ desiredRetention: number;
36
+ learningSteps: number[];
37
+ relearningSteps: number[];
38
+ graduatingInterval: number;
39
+ easyInterval: number;
40
+ maxInterval: number;
41
+ fsrsParameters?: number[];
42
+ leechThreshold: number;
43
+ burySiblings: boolean;
44
+ stat?: IStat;
45
+ status?: IStatus;
46
+ }
47
+ declare class FlashcardDeckRepository {
48
+ private readonly database;
49
+ constructor(database: ITypeormDatabaseAdapter);
50
+ open(): Promise<Repository<FlashcardDeckEntity>>;
51
+ close(): Promise<void>;
52
+ find(criteria: FindManyOptions<FlashcardDeckEntity> & {
53
+ page?: number;
54
+ limit?: number;
55
+ q?: string;
56
+ }): Promise<FilterResultType<FlashcardDeckEntity>>;
57
+ findOne(id: string): Promise<FlashcardDeckEntity | null>;
58
+ findOneBy(criteria: FindOptionsWhere<FlashcardDeckEntity>): Promise<FlashcardDeckEntity | null>;
59
+ create(entity: FlashcardDeckEntity, options?: SaveOptions): Promise<FlashcardDeckEntity>;
60
+ createMany(entities: FlashcardDeckEntity[], options?: SaveOptions): Promise<FlashcardDeckEntity[]>;
61
+ update(entity: FlashcardDeckEntity, options?: SaveOptions): Promise<FlashcardDeckEntity>;
62
+ updateMany(entities: FlashcardDeckEntity[], options?: SaveOptions): Promise<FlashcardDeckEntity[]>;
63
+ delete(criteria: FindOptionsWhere<FlashcardDeckEntity> | FindOptionsWhere<FlashcardDeckEntity>[]): Promise<UpdateResult>;
64
+ count(criteria?: FindOptionsWhere<FlashcardDeckEntity> | FindOptionsWhere<FlashcardDeckEntity>[]): Promise<number>;
65
+ }
66
+ import { ITypeormDatabaseAdapter as ITypeormDatabaseAdapter2 } from "@ooneex/database";
67
+ import { FilterResultType as FilterResultType2 } from "@ooneex/types";
68
+ import { FindManyOptions as FindManyOptions2, FindOptionsWhere as FindOptionsWhere2, Repository as Repository2, SaveOptions as SaveOptions2, UpdateResult as UpdateResult2 } from "typeorm";
69
+ import { IFlashcardPreset } from "@ooneex/gamification/flashcard";
70
+ import { EFlashcardAlgorithm as EFlashcardAlgorithm2 } from "@ooneex/gamification/flashcard";
71
+ declare class FlashcardPresetEntity extends BaseEntity implements IFlashcardPreset {
72
+ name: string;
73
+ description?: string;
74
+ algorithm: EFlashcardAlgorithm2;
75
+ learningSteps: number[];
76
+ relearningSteps: number[];
77
+ graduatingInterval: number;
78
+ easyInterval: number;
79
+ maxInterval: number;
80
+ maxNewCardsPerDay: number;
81
+ maxReviewCardsPerDay: number;
82
+ desiredRetention: number;
83
+ fsrsParameters?: number[];
84
+ startingEaseFactor: number;
85
+ easyBonus: number;
86
+ intervalModifier: number;
87
+ hardInterval: number;
88
+ newInterval: number;
89
+ minimumInterval: number;
90
+ leechThreshold: number;
91
+ burySiblings: boolean;
92
+ showTimer: boolean;
93
+ autoPlayAudio: boolean;
94
+ }
95
+ declare class FlashcardPresetRepository {
96
+ private readonly database;
97
+ constructor(database: ITypeormDatabaseAdapter2);
98
+ open(): Promise<Repository2<FlashcardPresetEntity>>;
99
+ close(): Promise<void>;
100
+ find(criteria: FindManyOptions2<FlashcardPresetEntity> & {
101
+ page?: number;
102
+ limit?: number;
103
+ q?: string;
104
+ }): Promise<FilterResultType2<FlashcardPresetEntity>>;
105
+ findOne(id: string): Promise<FlashcardPresetEntity | null>;
106
+ findOneBy(criteria: FindOptionsWhere2<FlashcardPresetEntity>): Promise<FlashcardPresetEntity | null>;
107
+ create(entity: FlashcardPresetEntity, options?: SaveOptions2): Promise<FlashcardPresetEntity>;
108
+ createMany(entities: FlashcardPresetEntity[], options?: SaveOptions2): Promise<FlashcardPresetEntity[]>;
109
+ update(entity: FlashcardPresetEntity, options?: SaveOptions2): Promise<FlashcardPresetEntity>;
110
+ updateMany(entities: FlashcardPresetEntity[], options?: SaveOptions2): Promise<FlashcardPresetEntity[]>;
111
+ delete(criteria: FindOptionsWhere2<FlashcardPresetEntity> | FindOptionsWhere2<FlashcardPresetEntity>[]): Promise<UpdateResult2>;
112
+ count(criteria?: FindOptionsWhere2<FlashcardPresetEntity> | FindOptionsWhere2<FlashcardPresetEntity>[]): Promise<number>;
113
+ }
114
+ import { ITypeormDatabaseAdapter as ITypeormDatabaseAdapter3 } from "@ooneex/database";
115
+ import { FilterResultType as FilterResultType3 } from "@ooneex/types";
116
+ import { FindManyOptions as FindManyOptions3, FindOptionsWhere as FindOptionsWhere3, Repository as Repository3, SaveOptions as SaveOptions3, UpdateResult as UpdateResult3 } from "typeorm";
117
+ import { IFlashcard as IFlashcard2, IFlashcardDeck as IFlashcardDeck2, IFlashcardSchedule } from "@ooneex/gamification/flashcard";
118
+ import { IImage } from "@ooneex/image";
119
+ import { IStatus as IStatus2 } from "@ooneex/status";
120
+ import { ITag } from "@ooneex/tag";
121
+ import { IStat as IStat2 } from "@ooneex/types";
122
+ declare class FlashcardEntity extends BaseEntity implements IFlashcard2 {
123
+ front: string;
124
+ back: string;
125
+ hint?: string;
126
+ context?: string;
127
+ contextId?: string;
128
+ schedule: IFlashcardSchedule;
129
+ deck?: IFlashcardDeck2;
130
+ stat?: IStat2;
131
+ status?: IStatus2;
132
+ image?: IImage;
133
+ tags?: ITag[];
134
+ }
135
+ declare class FlashcardRepository {
136
+ private readonly database;
137
+ constructor(database: ITypeormDatabaseAdapter3);
138
+ open(): Promise<Repository3<FlashcardEntity>>;
139
+ close(): Promise<void>;
140
+ find(criteria: FindManyOptions3<FlashcardEntity> & {
141
+ page?: number;
142
+ limit?: number;
143
+ q?: string;
144
+ }): Promise<FilterResultType3<FlashcardEntity>>;
145
+ findOne(id: string): Promise<FlashcardEntity | null>;
146
+ findOneBy(criteria: FindOptionsWhere3<FlashcardEntity>): Promise<FlashcardEntity | null>;
147
+ create(entity: FlashcardEntity, options?: SaveOptions3): Promise<FlashcardEntity>;
148
+ createMany(entities: FlashcardEntity[], options?: SaveOptions3): Promise<FlashcardEntity[]>;
149
+ update(entity: FlashcardEntity, options?: SaveOptions3): Promise<FlashcardEntity>;
150
+ updateMany(entities: FlashcardEntity[], options?: SaveOptions3): Promise<FlashcardEntity[]>;
151
+ delete(criteria: FindOptionsWhere3<FlashcardEntity> | FindOptionsWhere3<FlashcardEntity>[]): Promise<UpdateResult3>;
152
+ count(criteria?: FindOptionsWhere3<FlashcardEntity> | FindOptionsWhere3<FlashcardEntity>[]): Promise<number>;
153
+ }
154
+ import { ITypeormDatabaseAdapter as ITypeormDatabaseAdapter4 } from "@ooneex/database";
155
+ import { FilterResultType as FilterResultType4 } from "@ooneex/types";
156
+ import { FindManyOptions as FindManyOptions4, FindOptionsWhere as FindOptionsWhere4, Repository as Repository4, SaveOptions as SaveOptions4, UpdateResult as UpdateResult4 } from "typeorm";
157
+ import { IFlashcard as IFlashcard3, IFlashcardReview, IFlashcardSession } from "@ooneex/gamification/flashcard";
158
+ import { EFlashcardAlgorithm as EFlashcardAlgorithm3, EFlashcardRating, EFlashcardState } from "@ooneex/gamification/flashcard";
159
+ declare class FlashcardReviewEntity extends BaseEntity implements IFlashcardReview {
160
+ card: IFlashcard3;
161
+ session: IFlashcardSession;
162
+ rating: EFlashcardRating;
163
+ responseTime: number;
164
+ previousInterval: number;
165
+ newInterval: number;
166
+ previousEaseFactor: number;
167
+ newEaseFactor: number;
168
+ previousDueDate: Date;
169
+ newDueDate: Date;
170
+ previousState: EFlashcardState;
171
+ newState: EFlashcardState;
172
+ wasLapse: boolean;
173
+ algorithm: EFlashcardAlgorithm3;
174
+ reviewedAt: Date;
175
+ }
176
+ declare class FlashcardReviewRepository {
177
+ private readonly database;
178
+ constructor(database: ITypeormDatabaseAdapter4);
179
+ open(): Promise<Repository4<FlashcardReviewEntity>>;
180
+ close(): Promise<void>;
181
+ find(criteria: FindManyOptions4<FlashcardReviewEntity> & {
182
+ page?: number;
183
+ limit?: number;
184
+ }): Promise<FilterResultType4<FlashcardReviewEntity>>;
185
+ findOne(id: string): Promise<FlashcardReviewEntity | null>;
186
+ findOneBy(criteria: FindOptionsWhere4<FlashcardReviewEntity>): Promise<FlashcardReviewEntity | null>;
187
+ create(entity: FlashcardReviewEntity, options?: SaveOptions4): Promise<FlashcardReviewEntity>;
188
+ createMany(entities: FlashcardReviewEntity[], options?: SaveOptions4): Promise<FlashcardReviewEntity[]>;
189
+ update(entity: FlashcardReviewEntity, options?: SaveOptions4): Promise<FlashcardReviewEntity>;
190
+ updateMany(entities: FlashcardReviewEntity[], options?: SaveOptions4): Promise<FlashcardReviewEntity[]>;
191
+ delete(criteria: FindOptionsWhere4<FlashcardReviewEntity> | FindOptionsWhere4<FlashcardReviewEntity>[]): Promise<UpdateResult4>;
192
+ count(criteria?: FindOptionsWhere4<FlashcardReviewEntity> | FindOptionsWhere4<FlashcardReviewEntity>[]): Promise<number>;
193
+ }
194
+ import { ITypeormDatabaseAdapter as ITypeormDatabaseAdapter5 } from "@ooneex/database";
195
+ import { FilterResultType as FilterResultType5 } from "@ooneex/types";
196
+ import { FindManyOptions as FindManyOptions5, FindOptionsWhere as FindOptionsWhere5, Repository as Repository5, SaveOptions as SaveOptions5, UpdateResult as UpdateResult5 } from "typeorm";
197
+ import { IFlashcardSchedule as IFlashcardSchedule2 } from "@ooneex/gamification/flashcard";
198
+ import { EFlashcardState as EFlashcardState2 } from "@ooneex/gamification/flashcard";
199
+ declare class FlashcardScheduleEntity extends BaseEntity implements IFlashcardSchedule2 {
200
+ state: EFlashcardState2;
201
+ interval: number;
202
+ easeFactor: number;
203
+ reviewCount: number;
204
+ lapseCount: number;
205
+ currentStep: number;
206
+ dueDate: Date;
207
+ lastReviewedAt?: Date | null;
208
+ difficulty?: number;
209
+ stability?: number;
210
+ retrievability?: number;
211
+ learningSteps: number[];
212
+ relearningSteps: number[];
213
+ }
214
+ declare class FlashcardScheduleRepository {
215
+ private readonly database;
216
+ constructor(database: ITypeormDatabaseAdapter5);
217
+ open(): Promise<Repository5<FlashcardScheduleEntity>>;
218
+ close(): Promise<void>;
219
+ find(criteria: FindManyOptions5<FlashcardScheduleEntity> & {
220
+ page?: number;
221
+ limit?: number;
222
+ }): Promise<FilterResultType5<FlashcardScheduleEntity>>;
223
+ findOne(id: string): Promise<FlashcardScheduleEntity | null>;
224
+ findOneBy(criteria: FindOptionsWhere5<FlashcardScheduleEntity>): Promise<FlashcardScheduleEntity | null>;
225
+ create(entity: FlashcardScheduleEntity, options?: SaveOptions5): Promise<FlashcardScheduleEntity>;
226
+ createMany(entities: FlashcardScheduleEntity[], options?: SaveOptions5): Promise<FlashcardScheduleEntity[]>;
227
+ update(entity: FlashcardScheduleEntity, options?: SaveOptions5): Promise<FlashcardScheduleEntity>;
228
+ updateMany(entities: FlashcardScheduleEntity[], options?: SaveOptions5): Promise<FlashcardScheduleEntity[]>;
229
+ delete(criteria: FindOptionsWhere5<FlashcardScheduleEntity> | FindOptionsWhere5<FlashcardScheduleEntity>[]): Promise<UpdateResult5>;
230
+ count(criteria?: FindOptionsWhere5<FlashcardScheduleEntity> | FindOptionsWhere5<FlashcardScheduleEntity>[]): Promise<number>;
231
+ }
232
+ import { ITypeormDatabaseAdapter as ITypeormDatabaseAdapter6 } from "@ooneex/database";
233
+ import { FilterResultType as FilterResultType6 } from "@ooneex/types";
234
+ import { FindManyOptions as FindManyOptions6, FindOptionsWhere as FindOptionsWhere6, Repository as Repository6, SaveOptions as SaveOptions6, UpdateResult as UpdateResult6 } from "typeorm";
235
+ import { ILevel } from "@ooneex/gamification";
236
+ import { ESessionType } from "@ooneex/gamification";
237
+ import { IFlashcard as IFlashcard4, IFlashcardReview as IFlashcardReview2, IFlashcardSession as IFlashcardSession2 } from "@ooneex/gamification/flashcard";
238
+ import { EFlashcardAlgorithm as EFlashcardAlgorithm4, EFlashcardSessionStatus } from "@ooneex/gamification/flashcard";
239
+ declare class FlashcardSessionEntity extends BaseEntity implements IFlashcardSession2 {
240
+ name: string;
241
+ totalCards: number;
242
+ newCardsCount: number;
243
+ learningCardsCount: number;
244
+ reviewCardsCount: number;
245
+ studiedCount: number;
246
+ correctCount: number;
247
+ incorrectCount: number;
248
+ studyTime: number;
249
+ cards: IFlashcard4[];
250
+ reviews: IFlashcardReview2[];
251
+ status: EFlashcardSessionStatus;
252
+ score: number;
253
+ startedAt?: Date | null;
254
+ pausedAt?: Date | null;
255
+ resumedAt?: Date | null;
256
+ completedAt?: Date | null;
257
+ type: ESessionType;
258
+ level: ILevel;
259
+ algorithm: EFlashcardAlgorithm4;
260
+ maxNewCards: number;
261
+ maxReviewCards: number;
262
+ desiredRetention: number;
263
+ learningSteps: number[];
264
+ graduatingInterval: number;
265
+ easyInterval: number;
266
+ maxInterval: number;
267
+ }
268
+ declare class FlashcardSessionRepository {
269
+ private readonly database;
270
+ constructor(database: ITypeormDatabaseAdapter6);
271
+ open(): Promise<Repository6<FlashcardSessionEntity>>;
272
+ close(): Promise<void>;
273
+ find(criteria: FindManyOptions6<FlashcardSessionEntity> & {
274
+ page?: number;
275
+ limit?: number;
276
+ q?: string;
277
+ }): Promise<FilterResultType6<FlashcardSessionEntity>>;
278
+ findOne(id: string): Promise<FlashcardSessionEntity | null>;
279
+ findOneBy(criteria: FindOptionsWhere6<FlashcardSessionEntity>): Promise<FlashcardSessionEntity | null>;
280
+ create(entity: FlashcardSessionEntity, options?: SaveOptions6): Promise<FlashcardSessionEntity>;
281
+ createMany(entities: FlashcardSessionEntity[], options?: SaveOptions6): Promise<FlashcardSessionEntity[]>;
282
+ update(entity: FlashcardSessionEntity, options?: SaveOptions6): Promise<FlashcardSessionEntity>;
283
+ updateMany(entities: FlashcardSessionEntity[], options?: SaveOptions6): Promise<FlashcardSessionEntity[]>;
284
+ delete(criteria: FindOptionsWhere6<FlashcardSessionEntity> | FindOptionsWhere6<FlashcardSessionEntity>[]): Promise<UpdateResult6>;
285
+ count(criteria?: FindOptionsWhere6<FlashcardSessionEntity> | FindOptionsWhere6<FlashcardSessionEntity>[]): Promise<number>;
286
+ }
287
+ import { ITypeormDatabaseAdapter as ITypeormDatabaseAdapter7 } from "@ooneex/database";
288
+ import { FilterResultType as FilterResultType7 } from "@ooneex/types";
289
+ import { FindManyOptions as FindManyOptions7, FindOptionsWhere as FindOptionsWhere7, Repository as Repository7, SaveOptions as SaveOptions7, UpdateResult as UpdateResult7 } from "typeorm";
290
+ import { IFlashcardStats } from "@ooneex/gamification/flashcard";
291
+ declare class FlashcardStatsEntity extends BaseEntity implements IFlashcardStats {
292
+ cardsStudiedToday: number;
293
+ timeSpentToday: number;
294
+ currentStreak: number;
295
+ longestStreak: number;
296
+ totalReviews: number;
297
+ totalStudyTime: number;
298
+ retentionRate: number;
299
+ newCardsCount: number;
300
+ learningCardsCount: number;
301
+ reviewCardsCount: number;
302
+ suspendedCardsCount: number;
303
+ matureCardsCount: number;
304
+ youngCardsCount: number;
305
+ againCount: number;
306
+ hardCount: number;
307
+ goodCount: number;
308
+ easyCount: number;
309
+ startDate: Date;
310
+ endDate: Date;
311
+ }
312
+ declare class FlashcardStatsRepository {
313
+ private readonly database;
314
+ constructor(database: ITypeormDatabaseAdapter7);
315
+ open(): Promise<Repository7<FlashcardStatsEntity>>;
316
+ close(): Promise<void>;
317
+ find(criteria: FindManyOptions7<FlashcardStatsEntity> & {
318
+ page?: number;
319
+ limit?: number;
320
+ }): Promise<FilterResultType7<FlashcardStatsEntity>>;
321
+ findOne(id: string): Promise<FlashcardStatsEntity | null>;
322
+ findOneBy(criteria: FindOptionsWhere7<FlashcardStatsEntity>): Promise<FlashcardStatsEntity | null>;
323
+ create(entity: FlashcardStatsEntity, options?: SaveOptions7): Promise<FlashcardStatsEntity>;
324
+ createMany(entities: FlashcardStatsEntity[], options?: SaveOptions7): Promise<FlashcardStatsEntity[]>;
325
+ update(entity: FlashcardStatsEntity, options?: SaveOptions7): Promise<FlashcardStatsEntity>;
326
+ updateMany(entities: FlashcardStatsEntity[], options?: SaveOptions7): Promise<FlashcardStatsEntity[]>;
327
+ delete(criteria: FindOptionsWhere7<FlashcardStatsEntity> | FindOptionsWhere7<FlashcardStatsEntity>[]): Promise<UpdateResult7>;
328
+ count(criteria?: FindOptionsWhere7<FlashcardStatsEntity> | FindOptionsWhere7<FlashcardStatsEntity>[]): Promise<number>;
329
+ }
330
+ export { FlashcardStatsRepository, FlashcardSessionRepository, FlashcardScheduleRepository, FlashcardReviewRepository, FlashcardRepository, FlashcardPresetRepository, FlashcardDeckRepository };