@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,4 @@
1
+ // @bun
2
+ import{I as O,J as P,K as I,L as W,M as q,N as E,O as f}from"../../../../shared/chunk-wmftwzcs.js";import"../../../../shared/chunk-hw4vdg6q.js";import"../../../../shared/chunk-2e7zbxcq.js";import"../../../../shared/chunk-764bzjhz.js";import"../../../../shared/chunk-pwhygf44.js";import{V as Q,W as T,X as U}from"../../../../shared/chunk-j7nprmyh.js";import{inject as R}from"@ooneex/container";import{ILike as j}from"typeorm";class Y{database;constructor(x){this.database=x}async open(){return await this.database.open(I)}async close(){await this.database.close()}async find(x){let z=await this.open(),{page:A=1,limit:B=100,q:G,...C}=x,H,K=B===0?100:B;if(A&&A>0&&B&&B>0)H=(A-1)*K;let J={...C,take:K,...H!==void 0&&{skip:H}};if(G)J={...J,where:{...C.where,name:j(`%${G}%`)}};let N=await z.find(J),M=C.where;if(G)M={...C.where,name:j(`%${G}%`)};let V=await this.count(M),X=Math.ceil(V/B);return{resources:N,total:V,totalPages:X,page:A,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,z){return await(await this.open()).save(x,z)}async createMany(x,z){return await(await this.open()).save(x,z)}async update(x,z){return await this.create(x,z)}async updateMany(x,z){return await this.createMany(x,z)}async delete(x){return await(await this.open()).softDelete(x)}async count(x){return await(await this.open()).count(x?{where:x}:{})}}Y=Q([T(0,R("database")),U("design:paramtypes",[typeof ITypeormDatabaseAdapter==="undefined"?Object:ITypeormDatabaseAdapter])],Y);import{inject as u}from"@ooneex/container";import{ILike as L}from"typeorm";class Z{database;constructor(x){this.database=x}async open(){return await this.database.open(W)}async close(){await this.database.close()}async find(x){let z=await this.open(),{page:A=1,limit:B=100,q:G,...C}=x,H,K=B===0?100:B;if(A&&A>0&&B&&B>0)H=(A-1)*K;let J={...C,take:K,...H!==void 0&&{skip:H}};if(G)J={...J,where:{...C.where,name:L(`%${G}%`)}};let N=await z.find(J),M=C.where;if(G)M={...C.where,name:L(`%${G}%`)};let V=await this.count(M),X=Math.ceil(V/B);return{resources:N,total:V,totalPages:X,page:A,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,z){return await(await this.open()).save(x,z)}async createMany(x,z){return await(await this.open()).save(x,z)}async update(x,z){return await this.create(x,z)}async updateMany(x,z){return await this.createMany(x,z)}async delete(x){return await(await this.open()).softDelete(x)}async count(x){return await(await this.open()).count(x?{where:x}:{})}}Z=Q([T(0,u("database")),U("design:paramtypes",[typeof ITypeormDatabaseAdapter==="undefined"?Object:ITypeormDatabaseAdapter])],Z);import{inject as F}from"@ooneex/container";import{ILike as w}from"typeorm";class _{database;constructor(x){this.database=x}async open(){return await this.database.open(P)}async close(){await this.database.close()}async find(x){let z=await this.open(),{page:A=1,limit:B=100,q:G,...C}=x,H,K=B===0?100:B;if(A&&A>0&&B&&B>0)H=(A-1)*K;let J={...C,take:K,...H!==void 0&&{skip:H}};if(G)J={...J,where:{...C.where,front:w(`%${G}%`)}};let N=await z.find(J),M=C.where;if(G)M={...C.where,front:w(`%${G}%`)};let V=await this.count(M),X=Math.ceil(V/B);return{resources:N,total:V,totalPages:X,page:A,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,z){return await(await this.open()).save(x,z)}async createMany(x,z){return await(await this.open()).save(x,z)}async update(x,z){return await this.create(x,z)}async updateMany(x,z){return await this.createMany(x,z)}async delete(x){return await(await this.open()).softDelete(x)}async count(x){return await(await this.open()).count(x?{where:x}:{})}}_=Q([T(0,F("database")),U("design:paramtypes",[typeof ITypeormDatabaseAdapter==="undefined"?Object:ITypeormDatabaseAdapter])],_);import{inject as g}from"@ooneex/container";class ${database;constructor(x){this.database=x}async open(){return await this.database.open(E)}async close(){await this.database.close()}async find(x){let z=await this.open(),{page:A=1,limit:B=100,...G}=x,C,H=B===0?100:B;if(A&&A>0&&B&&B>0)C=(A-1)*H;let K={...G,take:H,...C!==void 0&&{skip:C}},J=await z.find(K),N=await this.count(G.where),M=Math.ceil(N/B);return{resources:J,total:N,totalPages:M,page:A,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,z){return await(await this.open()).save(x,z)}async createMany(x,z){return await(await this.open()).save(x,z)}async update(x,z){return await this.create(x,z)}async updateMany(x,z){return await this.createMany(x,z)}async delete(x){return await(await this.open()).softDelete(x)}async count(x){return await(await this.open()).count(x?{where:x}:{})}}$=Q([T(0,g("database")),U("design:paramtypes",[typeof ITypeormDatabaseAdapter==="undefined"?Object:ITypeormDatabaseAdapter])],$);import{inject as m}from"@ooneex/container";class v{database;constructor(x){this.database=x}async open(){return await this.database.open(O)}async close(){await this.database.close()}async find(x){let z=await this.open(),{page:A=1,limit:B=100,...G}=x,C,H=B===0?100:B;if(A&&A>0&&B&&B>0)C=(A-1)*H;let K={...G,take:H,...C!==void 0&&{skip:C}},J=await z.find(K),N=await this.count(G.where),M=Math.ceil(N/B);return{resources:J,total:N,totalPages:M,page:A,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,z){return await(await this.open()).save(x,z)}async createMany(x,z){return await(await this.open()).save(x,z)}async update(x,z){return await this.create(x,z)}async updateMany(x,z){return await this.createMany(x,z)}async delete(x){return await(await this.open()).softDelete(x)}async count(x){return await(await this.open()).count(x?{where:x}:{})}}v=Q([T(0,m("database")),U("design:paramtypes",[typeof ITypeormDatabaseAdapter==="undefined"?Object:ITypeormDatabaseAdapter])],v);import{inject as k}from"@ooneex/container";import{ILike as S}from"typeorm";class D{database;constructor(x){this.database=x}async open(){return await this.database.open(q)}async close(){await this.database.close()}async find(x){let z=await this.open(),{page:A=1,limit:B=100,q:G,...C}=x,H,K=B===0?100:B;if(A&&A>0&&B&&B>0)H=(A-1)*K;let J={...C,take:K,...H!==void 0&&{skip:H}};if(G)J={...J,where:{...C.where,name:S(`%${G}%`)}};let N=await z.find(J),M=C.where;if(G)M={...C.where,name:S(`%${G}%`)};let V=await this.count(M),X=Math.ceil(V/B);return{resources:N,total:V,totalPages:X,page:A,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,z){return await(await this.open()).save(x,z)}async createMany(x,z){return await(await this.open()).save(x,z)}async update(x,z){return await this.create(x,z)}async updateMany(x,z){return await this.createMany(x,z)}async delete(x){return await(await this.open()).softDelete(x)}async count(x){return await(await this.open()).count(x?{where:x}:{})}}D=Q([T(0,k("database")),U("design:paramtypes",[typeof ITypeormDatabaseAdapter==="undefined"?Object:ITypeormDatabaseAdapter])],D);import{inject as h}from"@ooneex/container";class b{database;constructor(x){this.database=x}async open(){return await this.database.open(f)}async close(){await this.database.close()}async find(x){let z=await this.open(),{page:A=1,limit:B=100,...G}=x,C,H=B===0?100:B;if(A&&A>0&&B&&B>0)C=(A-1)*H;let K={...G,take:H,...C!==void 0&&{skip:C}},J=await z.find(K),N=await this.count(G.where),M=Math.ceil(N/B);return{resources:J,total:N,totalPages:M,page:A,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,z){return await(await this.open()).save(x,z)}async createMany(x,z){return await(await this.open()).save(x,z)}async update(x,z){return await this.create(x,z)}async updateMany(x,z){return await this.createMany(x,z)}async delete(x){return await(await this.open()).softDelete(x)}async count(x){return await(await this.open()).count(x?{where:x}:{})}}b=Q([T(0,h("database")),U("design:paramtypes",[typeof ITypeormDatabaseAdapter==="undefined"?Object:ITypeormDatabaseAdapter])],b);export{b as FlashcardStatsRepository,D as FlashcardSessionRepository,v as FlashcardScheduleRepository,$ as FlashcardReviewRepository,_ as FlashcardRepository,Z as FlashcardPresetRepository,Y as FlashcardDeckRepository};export{Y as a,Z as b,_ as c,$ as d,v as e,D as f,b as g};
3
+
4
+ //# debugId=E5643508B201349564756E2164756E21
@@ -0,0 +1,16 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["src/repositories/gamification/flashcard/FlashcardDeckRepository.ts", "src/repositories/gamification/flashcard/FlashcardPresetRepository.ts", "src/repositories/gamification/flashcard/FlashcardRepository.ts", "src/repositories/gamification/flashcard/FlashcardReviewRepository.ts", "src/repositories/gamification/flashcard/FlashcardScheduleRepository.ts", "src/repositories/gamification/flashcard/FlashcardSessionRepository.ts", "src/repositories/gamification/flashcard/FlashcardStatsRepository.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 { FlashcardDeckEntity } from \"../../../entities/gamification/flashcard/FlashcardDeckEntity\";\n\nexport class FlashcardDeckRepository {\n constructor(\n @inject(\"database\")\n private readonly database: ITypeormDatabaseAdapter,\n ) {}\n\n public async open(): Promise<Repository<FlashcardDeckEntity>> {\n return await this.database.open(FlashcardDeckEntity);\n }\n\n public async close(): Promise<void> {\n await this.database.close();\n }\n\n public async find(\n criteria: FindManyOptions<FlashcardDeckEntity> & { page?: number; limit?: number; q?: string },\n ): Promise<FilterResultType<FlashcardDeckEntity>> {\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 deck 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<FlashcardDeckEntity | 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<FlashcardDeckEntity>): Promise<FlashcardDeckEntity | null> {\n const repository = await this.open();\n\n return await repository.findOne({\n where: criteria,\n });\n }\n\n public async create(entity: FlashcardDeckEntity, options?: SaveOptions): Promise<FlashcardDeckEntity> {\n const repository = await this.open();\n\n return await repository.save(entity, options);\n }\n\n public async createMany(entities: FlashcardDeckEntity[], options?: SaveOptions): Promise<FlashcardDeckEntity[]> {\n const repository = await this.open();\n\n return await repository.save(entities, options);\n }\n\n public async update(entity: FlashcardDeckEntity, options?: SaveOptions): Promise<FlashcardDeckEntity> {\n return await this.create(entity, options);\n }\n\n public async updateMany(entities: FlashcardDeckEntity[], options?: SaveOptions): Promise<FlashcardDeckEntity[]> {\n return await this.createMany(entities, options);\n }\n\n public async delete(\n criteria: FindOptionsWhere<FlashcardDeckEntity> | FindOptionsWhere<FlashcardDeckEntity>[],\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<FlashcardDeckEntity> | FindOptionsWhere<FlashcardDeckEntity>[],\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 { ILike } from \"typeorm\";\nimport { FlashcardPresetEntity } from \"../../../entities/gamification/flashcard/FlashcardPresetEntity\";\n\nexport class FlashcardPresetRepository {\n constructor(\n @inject(\"database\")\n private readonly database: ITypeormDatabaseAdapter,\n ) {}\n\n public async open(): Promise<Repository<FlashcardPresetEntity>> {\n return await this.database.open(FlashcardPresetEntity);\n }\n\n public async close(): Promise<void> {\n await this.database.close();\n }\n\n public async find(\n criteria: FindManyOptions<FlashcardPresetEntity> & { page?: number; limit?: number; q?: string },\n ): Promise<FilterResultType<FlashcardPresetEntity>> {\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 preset 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<FlashcardPresetEntity | 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<FlashcardPresetEntity>): Promise<FlashcardPresetEntity | null> {\n const repository = await this.open();\n\n return await repository.findOne({\n where: criteria,\n });\n }\n\n public async create(entity: FlashcardPresetEntity, options?: SaveOptions): Promise<FlashcardPresetEntity> {\n const repository = await this.open();\n\n return await repository.save(entity, options);\n }\n\n public async createMany(entities: FlashcardPresetEntity[], options?: SaveOptions): Promise<FlashcardPresetEntity[]> {\n const repository = await this.open();\n\n return await repository.save(entities, options);\n }\n\n public async update(entity: FlashcardPresetEntity, options?: SaveOptions): Promise<FlashcardPresetEntity> {\n return await this.create(entity, options);\n }\n\n public async updateMany(entities: FlashcardPresetEntity[], options?: SaveOptions): Promise<FlashcardPresetEntity[]> {\n return await this.createMany(entities, options);\n }\n\n public async delete(\n criteria: FindOptionsWhere<FlashcardPresetEntity> | FindOptionsWhere<FlashcardPresetEntity>[],\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<FlashcardPresetEntity> | FindOptionsWhere<FlashcardPresetEntity>[],\n ): 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 { FlashcardEntity } from \"../../../entities/gamification/flashcard/FlashcardEntity\";\n\nexport class FlashcardRepository {\n constructor(\n @inject(\"database\")\n private readonly database: ITypeormDatabaseAdapter,\n ) {}\n\n public async open(): Promise<Repository<FlashcardEntity>> {\n return await this.database.open(FlashcardEntity);\n }\n\n public async close(): Promise<void> {\n await this.database.close();\n }\n\n public async find(\n criteria: FindManyOptions<FlashcardEntity> & { page?: number; limit?: number; q?: string },\n ): Promise<FilterResultType<FlashcardEntity>> {\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 front text 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 front: ILike(`%${q}%`),\n },\n };\n }\n\n const result = await repository.find(findOptions);\n\n // Apply the same where conditions for count including front text search\n let countWhere = rest.where;\n if (q) {\n countWhere = {\n ...rest.where,\n front: 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<FlashcardEntity | 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<FlashcardEntity>): Promise<FlashcardEntity | null> {\n const repository = await this.open();\n\n return await repository.findOne({\n where: criteria,\n });\n }\n\n public async create(entity: FlashcardEntity, options?: SaveOptions): Promise<FlashcardEntity> {\n const repository = await this.open();\n\n return await repository.save(entity, options);\n }\n\n public async createMany(entities: FlashcardEntity[], options?: SaveOptions): Promise<FlashcardEntity[]> {\n const repository = await this.open();\n\n return await repository.save(entities, options);\n }\n\n public async update(entity: FlashcardEntity, options?: SaveOptions): Promise<FlashcardEntity> {\n return await this.create(entity, options);\n }\n\n public async updateMany(entities: FlashcardEntity[], options?: SaveOptions): Promise<FlashcardEntity[]> {\n return await this.createMany(entities, options);\n }\n\n public async delete(\n criteria: FindOptionsWhere<FlashcardEntity> | FindOptionsWhere<FlashcardEntity>[],\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<FlashcardEntity> | FindOptionsWhere<FlashcardEntity>[],\n ): 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 { FlashcardReviewEntity } from \"../../../entities/gamification/flashcard/FlashcardReviewEntity\";\n\nexport class FlashcardReviewRepository {\n constructor(\n @inject(\"database\")\n private readonly database: ITypeormDatabaseAdapter,\n ) {}\n\n public async open(): Promise<Repository<FlashcardReviewEntity>> {\n return await this.database.open(FlashcardReviewEntity);\n }\n\n public async close(): Promise<void> {\n await this.database.close();\n }\n\n public async find(\n criteria: FindManyOptions<FlashcardReviewEntity> & { page?: number; limit?: number },\n ): Promise<FilterResultType<FlashcardReviewEntity>> {\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 findOptions = { ...rest, take, ...(skip !== undefined && { skip }) };\n const result = await repository.find(findOptions);\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<FlashcardReviewEntity | 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<FlashcardReviewEntity>): Promise<FlashcardReviewEntity | null> {\n const repository = await this.open();\n\n return await repository.findOne({\n where: criteria,\n });\n }\n\n public async create(entity: FlashcardReviewEntity, options?: SaveOptions): Promise<FlashcardReviewEntity> {\n const repository = await this.open();\n\n return await repository.save(entity, options);\n }\n\n public async createMany(entities: FlashcardReviewEntity[], options?: SaveOptions): Promise<FlashcardReviewEntity[]> {\n const repository = await this.open();\n\n return await repository.save(entities, options);\n }\n\n public async update(entity: FlashcardReviewEntity, options?: SaveOptions): Promise<FlashcardReviewEntity> {\n return await this.create(entity, options);\n }\n\n public async updateMany(entities: FlashcardReviewEntity[], options?: SaveOptions): Promise<FlashcardReviewEntity[]> {\n return await this.createMany(entities, options);\n }\n\n public async delete(\n criteria: FindOptionsWhere<FlashcardReviewEntity> | FindOptionsWhere<FlashcardReviewEntity>[],\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<FlashcardReviewEntity> | FindOptionsWhere<FlashcardReviewEntity>[],\n ): 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 { FlashcardScheduleEntity } from \"../../../entities/gamification/flashcard/FlashcardScheduleEntity\";\n\nexport class FlashcardScheduleRepository {\n constructor(\n @inject(\"database\")\n private readonly database: ITypeormDatabaseAdapter,\n ) {}\n\n public async open(): Promise<Repository<FlashcardScheduleEntity>> {\n return await this.database.open(FlashcardScheduleEntity);\n }\n\n public async close(): Promise<void> {\n await this.database.close();\n }\n\n public async find(\n criteria: FindManyOptions<FlashcardScheduleEntity> & { page?: number; limit?: number },\n ): Promise<FilterResultType<FlashcardScheduleEntity>> {\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 findOptions = { ...rest, take, ...(skip !== undefined && { skip }) };\n const result = await repository.find(findOptions);\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<FlashcardScheduleEntity | 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<FlashcardScheduleEntity>): Promise<FlashcardScheduleEntity | null> {\n const repository = await this.open();\n\n return await repository.findOne({\n where: criteria,\n });\n }\n\n public async create(entity: FlashcardScheduleEntity, options?: SaveOptions): Promise<FlashcardScheduleEntity> {\n const repository = await this.open();\n\n return await repository.save(entity, options);\n }\n\n public async createMany(\n entities: FlashcardScheduleEntity[],\n options?: SaveOptions,\n ): Promise<FlashcardScheduleEntity[]> {\n const repository = await this.open();\n\n return await repository.save(entities, options);\n }\n\n public async update(entity: FlashcardScheduleEntity, options?: SaveOptions): Promise<FlashcardScheduleEntity> {\n return await this.create(entity, options);\n }\n\n public async updateMany(\n entities: FlashcardScheduleEntity[],\n options?: SaveOptions,\n ): Promise<FlashcardScheduleEntity[]> {\n return await this.createMany(entities, options);\n }\n\n public async delete(\n criteria: FindOptionsWhere<FlashcardScheduleEntity> | FindOptionsWhere<FlashcardScheduleEntity>[],\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<FlashcardScheduleEntity> | FindOptionsWhere<FlashcardScheduleEntity>[],\n ): 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 { FlashcardSessionEntity } from \"../../../entities/gamification/flashcard/FlashcardSessionEntity\";\n\nexport class FlashcardSessionRepository {\n constructor(\n @inject(\"database\")\n private readonly database: ITypeormDatabaseAdapter,\n ) {}\n\n public async open(): Promise<Repository<FlashcardSessionEntity>> {\n return await this.database.open(FlashcardSessionEntity);\n }\n\n public async close(): Promise<void> {\n await this.database.close();\n }\n\n public async find(\n criteria: FindManyOptions<FlashcardSessionEntity> & { page?: number; limit?: number; q?: string },\n ): Promise<FilterResultType<FlashcardSessionEntity>> {\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 session 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<FlashcardSessionEntity | 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<FlashcardSessionEntity>): Promise<FlashcardSessionEntity | null> {\n const repository = await this.open();\n\n return await repository.findOne({\n where: criteria,\n });\n }\n\n public async create(entity: FlashcardSessionEntity, options?: SaveOptions): Promise<FlashcardSessionEntity> {\n const repository = await this.open();\n\n return await repository.save(entity, options);\n }\n\n public async createMany(\n entities: FlashcardSessionEntity[],\n options?: SaveOptions,\n ): Promise<FlashcardSessionEntity[]> {\n const repository = await this.open();\n\n return await repository.save(entities, options);\n }\n\n public async update(entity: FlashcardSessionEntity, options?: SaveOptions): Promise<FlashcardSessionEntity> {\n return await this.create(entity, options);\n }\n\n public async updateMany(\n entities: FlashcardSessionEntity[],\n options?: SaveOptions,\n ): Promise<FlashcardSessionEntity[]> {\n return await this.createMany(entities, options);\n }\n\n public async delete(\n criteria: FindOptionsWhere<FlashcardSessionEntity> | FindOptionsWhere<FlashcardSessionEntity>[],\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<FlashcardSessionEntity> | FindOptionsWhere<FlashcardSessionEntity>[],\n ): Promise<number> {\n const repository = await this.open();\n\n return await repository.count(criteria ? { where: criteria } : {});\n }\n}\n",
11
+ "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 { FlashcardStatsEntity } from \"../../../entities/gamification/flashcard/FlashcardStatsEntity\";\n\nexport class FlashcardStatsRepository {\n constructor(\n @inject(\"database\")\n private readonly database: ITypeormDatabaseAdapter,\n ) {}\n\n public async open(): Promise<Repository<FlashcardStatsEntity>> {\n return await this.database.open(FlashcardStatsEntity);\n }\n\n public async close(): Promise<void> {\n await this.database.close();\n }\n\n public async find(\n criteria: FindManyOptions<FlashcardStatsEntity> & { page?: number; limit?: number },\n ): Promise<FilterResultType<FlashcardStatsEntity>> {\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 findOptions = { ...rest, take, ...(skip !== undefined && { skip }) };\n const result = await repository.find(findOptions);\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<FlashcardStatsEntity | 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<FlashcardStatsEntity>): Promise<FlashcardStatsEntity | null> {\n const repository = await this.open();\n\n return await repository.findOne({\n where: criteria,\n });\n }\n\n public async create(entity: FlashcardStatsEntity, options?: SaveOptions): Promise<FlashcardStatsEntity> {\n const repository = await this.open();\n\n return await repository.save(entity, options);\n }\n\n public async createMany(entities: FlashcardStatsEntity[], options?: SaveOptions): Promise<FlashcardStatsEntity[]> {\n const repository = await this.open();\n\n return await repository.save(entities, options);\n }\n\n public async update(entity: FlashcardStatsEntity, options?: SaveOptions): Promise<FlashcardStatsEntity> {\n return await this.create(entity, options);\n }\n\n public async updateMany(entities: FlashcardStatsEntity[], options?: SaveOptions): Promise<FlashcardStatsEntity[]> {\n return await this.createMany(entities, options);\n }\n\n public async delete(\n criteria: FindOptionsWhere<FlashcardStatsEntity> | FindOptionsWhere<FlashcardStatsEntity>[],\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<FlashcardStatsEntity> | FindOptionsWhere<FlashcardStatsEntity>[],\n ): Promise<number> {\n const repository = await this.open();\n\n return await repository.count(criteria ? { where: criteria } : {});\n }\n}\n"
12
+ ],
13
+ "mappings": ";uSAAA,4BAAS,qCAIT,2BAAS,2BAGF,iBAAM,CAAwB,CAGhB,SAFnB,WAAW,CAEQ,EACjB,CADiB,qBAGN,KAAI,EAA6C,CAC5D,OAAO,MAAM,KAAK,SAAS,KAAK,CAAmB,OAGxC,MAAK,EAAkB,CAClC,MAAM,KAAK,SAAS,MAAM,OAGf,KAAI,CACf,EACgD,CAChD,IAAM,EAAa,MAAM,KAAK,KAAK,GAE3B,OAAO,EAAG,QAAQ,IAAK,OAAM,GAAS,EAE1C,EACE,EAAO,IAAU,EAAI,IAAM,EAEjC,GAAI,GAAQ,EAAO,GAAK,GAAS,EAAQ,EACvC,GAAQ,EAAO,GAAK,EAItB,IAAI,EAAc,IAAK,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KAAK,EAAQ,CAAO,OAGjC,WAAU,CAAC,EAAkC,EAAwD,CAGhH,OAAO,MAFY,MAAM,KAAK,KAAK,GAEX,KAAK,EAAU,CAAO,OAGnC,OAAM,CAAC,EAA8B,EAAsD,CACtG,OAAO,MAAM,KAAK,OAAO,EAAQ,CAAO,OAG7B,WAAU,CAAC,EAAkC,EAAwD,CAChH,OAAO,MAAM,KAAK,WAAW,EAAU,CAAO,OAGnC,OAAM,CACjB,EACuB,CAGvB,OAAO,MAFY,MAAM,KAAK,KAAK,GAEX,WAAW,CAAQ,OAGhC,MAAK,CAChB,EACiB,CAGjB,OAAO,MAFY,MAAM,KAAK,KAAK,GAEX,MAAM,EAAW,CAAE,MAAO,CAAS,EAAI,CAAC,CAAC,EAErE,CA9Fa,EAAN,GAEF,MAAO,UAAU,GAFf,sGAAM",
14
+ "debugId": "E5643508B201349564756E2164756E21",
15
+ "names": []
16
+ }
@@ -0,0 +1,506 @@
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
+ import { ITypeormDatabaseAdapter as ITypeormDatabaseAdapter8 } from "@ooneex/database";
331
+ import { FilterResultType as FilterResultType8 } from "@ooneex/types";
332
+ import { FindManyOptions as FindManyOptions8, FindOptionsWhere as FindOptionsWhere8, Repository as Repository8, SaveOptions as SaveOptions8, UpdateResult as UpdateResult8 } from "typeorm";
333
+ import { IMcqQuestion, IMcqQuestionChoice } from "@ooneex/gamification/mcq";
334
+ import { EMcqQuestionChoiceLetter } from "@ooneex/gamification/mcq";
335
+ declare class McqQuestionChoiceEntity extends BaseEntity implements IMcqQuestionChoice {
336
+ letter: EMcqQuestionChoiceLetter;
337
+ text: string;
338
+ isCorrect: boolean;
339
+ explanation?: string;
340
+ question: IMcqQuestion;
341
+ }
342
+ declare class McqQuestionChoiceRepository {
343
+ private readonly database;
344
+ constructor(database: ITypeormDatabaseAdapter8);
345
+ open(): Promise<Repository8<McqQuestionChoiceEntity>>;
346
+ close(): Promise<void>;
347
+ find(criteria: FindManyOptions8<McqQuestionChoiceEntity> & {
348
+ page?: number;
349
+ limit?: number;
350
+ }): Promise<FilterResultType8<McqQuestionChoiceEntity>>;
351
+ findOne(id: string): Promise<McqQuestionChoiceEntity | null>;
352
+ findOneBy(criteria: FindOptionsWhere8<McqQuestionChoiceEntity>): Promise<McqQuestionChoiceEntity | null>;
353
+ findByQuestion(questionId: string): Promise<McqQuestionChoiceEntity[]>;
354
+ findCorrectChoicesByQuestion(questionId: string): Promise<McqQuestionChoiceEntity[]>;
355
+ create(entity: McqQuestionChoiceEntity, options?: SaveOptions8): Promise<McqQuestionChoiceEntity>;
356
+ createMany(entities: McqQuestionChoiceEntity[], options?: SaveOptions8): Promise<McqQuestionChoiceEntity[]>;
357
+ update(entity: McqQuestionChoiceEntity, options?: SaveOptions8): Promise<McqQuestionChoiceEntity>;
358
+ updateMany(entities: McqQuestionChoiceEntity[], options?: SaveOptions8): Promise<McqQuestionChoiceEntity[]>;
359
+ delete(criteria: FindOptionsWhere8<McqQuestionChoiceEntity> | FindOptionsWhere8<McqQuestionChoiceEntity>[]): Promise<UpdateResult8>;
360
+ count(criteria?: FindOptionsWhere8<McqQuestionChoiceEntity> | FindOptionsWhere8<McqQuestionChoiceEntity>[]): Promise<number>;
361
+ }
362
+ import { ITypeormDatabaseAdapter as ITypeormDatabaseAdapter9 } from "@ooneex/database";
363
+ import { FilterResultType as FilterResultType9 } from "@ooneex/types";
364
+ import { FindManyOptions as FindManyOptions9, FindOptionsWhere as FindOptionsWhere9, Repository as Repository9, SaveOptions as SaveOptions9, UpdateResult as UpdateResult9 } from "typeorm";
365
+ import { IMcqQuestion as IMcqQuestion2, IMcqQuestionChoice as IMcqQuestionChoice2 } from "@ooneex/gamification/mcq";
366
+ import { IImage as IImage2 } from "@ooneex/image";
367
+ import { IStatus as IStatus3 } from "@ooneex/status";
368
+ import { ITag as ITag2 } from "@ooneex/tag";
369
+ import { IStat as IStat3 } from "@ooneex/types";
370
+ declare class McqQuestionEntity extends BaseEntity implements IMcqQuestion2 {
371
+ questionNumber: number;
372
+ text: string;
373
+ choices: IMcqQuestionChoice2[];
374
+ context?: string;
375
+ contextId?: string;
376
+ stat?: IStat3;
377
+ status?: IStatus3;
378
+ image?: IImage2;
379
+ tags?: ITag2[];
380
+ }
381
+ declare class McqQuestionRepository {
382
+ private readonly database;
383
+ constructor(database: ITypeormDatabaseAdapter9);
384
+ open(): Promise<Repository9<McqQuestionEntity>>;
385
+ close(): Promise<void>;
386
+ find(criteria: FindManyOptions9<McqQuestionEntity> & {
387
+ page?: number;
388
+ limit?: number;
389
+ q?: string;
390
+ }): Promise<FilterResultType9<McqQuestionEntity>>;
391
+ findOne(id: string): Promise<McqQuestionEntity | null>;
392
+ findOneBy(criteria: FindOptionsWhere9<McqQuestionEntity>): Promise<McqQuestionEntity | null>;
393
+ create(entity: McqQuestionEntity, options?: SaveOptions9): Promise<McqQuestionEntity>;
394
+ createMany(entities: McqQuestionEntity[], options?: SaveOptions9): Promise<McqQuestionEntity[]>;
395
+ update(entity: McqQuestionEntity, options?: SaveOptions9): Promise<McqQuestionEntity>;
396
+ updateMany(entities: McqQuestionEntity[], options?: SaveOptions9): Promise<McqQuestionEntity[]>;
397
+ delete(criteria: FindOptionsWhere9<McqQuestionEntity> | FindOptionsWhere9<McqQuestionEntity>[]): Promise<UpdateResult9>;
398
+ count(criteria?: FindOptionsWhere9<McqQuestionEntity> | FindOptionsWhere9<McqQuestionEntity>[]): Promise<number>;
399
+ }
400
+ import { ITypeormDatabaseAdapter as ITypeormDatabaseAdapter10 } from "@ooneex/database";
401
+ import { FilterResultType as FilterResultType10 } from "@ooneex/types";
402
+ import { FindManyOptions as FindManyOptions10, FindOptionsWhere as FindOptionsWhere10, Repository as Repository10, SaveOptions as SaveOptions10, UpdateResult as UpdateResult10 } from "typeorm";
403
+ import { EAnswerState } from "@ooneex/gamification";
404
+ import { IMcqQuestion as IMcqQuestion3, IMcqQuestionChoice as IMcqQuestionChoice3, IMcqSession, IMcqSessionQuestion } from "@ooneex/gamification/mcq";
405
+ declare class McqSessionQuestionEntity extends BaseEntity implements IMcqSessionQuestion {
406
+ session: IMcqSession;
407
+ question: IMcqQuestion3;
408
+ questionNumber: number;
409
+ selectedChoices: IMcqQuestionChoice3[];
410
+ context?: string;
411
+ contextId?: string;
412
+ state: EAnswerState;
413
+ score: number;
414
+ }
415
+ declare class McqSessionQuestionRepository {
416
+ private readonly database;
417
+ constructor(database: ITypeormDatabaseAdapter10);
418
+ open(): Promise<Repository10<McqSessionQuestionEntity>>;
419
+ close(): Promise<void>;
420
+ find(criteria: FindManyOptions10<McqSessionQuestionEntity> & {
421
+ page?: number;
422
+ limit?: number;
423
+ q?: string;
424
+ }): Promise<FilterResultType10<McqSessionQuestionEntity>>;
425
+ findOne(id: string): Promise<McqSessionQuestionEntity | null>;
426
+ findOneBy(criteria: FindOptionsWhere10<McqSessionQuestionEntity>): Promise<McqSessionQuestionEntity | null>;
427
+ create(entity: McqSessionQuestionEntity, options?: SaveOptions10): Promise<McqSessionQuestionEntity>;
428
+ createMany(entities: McqSessionQuestionEntity[], options?: SaveOptions10): Promise<McqSessionQuestionEntity[]>;
429
+ update(entity: McqSessionQuestionEntity, options?: SaveOptions10): Promise<McqSessionQuestionEntity>;
430
+ updateMany(entities: McqSessionQuestionEntity[], options?: SaveOptions10): Promise<McqSessionQuestionEntity[]>;
431
+ delete(criteria: FindOptionsWhere10<McqSessionQuestionEntity> | FindOptionsWhere10<McqSessionQuestionEntity>[]): Promise<UpdateResult10>;
432
+ count(criteria?: FindOptionsWhere10<McqSessionQuestionEntity> | FindOptionsWhere10<McqSessionQuestionEntity>[]): Promise<number>;
433
+ }
434
+ import { ITypeormDatabaseAdapter as ITypeormDatabaseAdapter11 } from "@ooneex/database";
435
+ import { FilterResultType as FilterResultType11 } from "@ooneex/types";
436
+ import { FindManyOptions as FindManyOptions11, FindOptionsWhere as FindOptionsWhere11, Repository as Repository11, SaveOptions as SaveOptions11, UpdateResult as UpdateResult11 } from "typeorm";
437
+ import { ILevel as ILevel2 } from "@ooneex/gamification";
438
+ import { ESessionType as ESessionType2 } from "@ooneex/gamification";
439
+ import { IMcqQuestion as IMcqQuestion4, IMcqSession as IMcqSession2 } from "@ooneex/gamification/mcq";
440
+ import { EMcqSessionStatus } from "@ooneex/gamification/mcq";
441
+ declare class McqSessionEntity extends BaseEntity implements IMcqSession2 {
442
+ name: string;
443
+ totalQuestions: number;
444
+ answeredCount: number;
445
+ correctCount: number;
446
+ incorrectCount: number;
447
+ timing: number;
448
+ questions: IMcqQuestion4[];
449
+ status: EMcqSessionStatus;
450
+ score: number;
451
+ startedAt?: Date | null;
452
+ pausedAt?: Date | null;
453
+ resumedAt?: Date | null;
454
+ completedAt?: Date | null;
455
+ type: ESessionType2;
456
+ level: ILevel2;
457
+ }
458
+ declare class McqSessionRepository {
459
+ private readonly database;
460
+ constructor(database: ITypeormDatabaseAdapter11);
461
+ open(): Promise<Repository11<McqSessionEntity>>;
462
+ close(): Promise<void>;
463
+ find(criteria: FindManyOptions11<McqSessionEntity> & {
464
+ page?: number;
465
+ limit?: number;
466
+ q?: string;
467
+ }): Promise<FilterResultType11<McqSessionEntity>>;
468
+ findOne(id: string): Promise<McqSessionEntity | null>;
469
+ findOneBy(criteria: FindOptionsWhere11<McqSessionEntity>): Promise<McqSessionEntity | null>;
470
+ create(entity: McqSessionEntity, options?: SaveOptions11): Promise<McqSessionEntity>;
471
+ createMany(entities: McqSessionEntity[], options?: SaveOptions11): Promise<McqSessionEntity[]>;
472
+ update(entity: McqSessionEntity, options?: SaveOptions11): Promise<McqSessionEntity>;
473
+ updateMany(entities: McqSessionEntity[], options?: SaveOptions11): Promise<McqSessionEntity[]>;
474
+ delete(criteria: FindOptionsWhere11<McqSessionEntity> | FindOptionsWhere11<McqSessionEntity>[]): Promise<UpdateResult11>;
475
+ count(criteria?: FindOptionsWhere11<McqSessionEntity> | FindOptionsWhere11<McqSessionEntity>[]): Promise<number>;
476
+ }
477
+ import { ITypeormDatabaseAdapter as ITypeormDatabaseAdapter12 } from "@ooneex/database";
478
+ import { FilterResultType as FilterResultType12 } from "@ooneex/types";
479
+ import { FindManyOptions as FindManyOptions12, FindOptionsWhere as FindOptionsWhere12, Repository as Repository12, SaveOptions as SaveOptions12, UpdateResult as UpdateResult12 } from "typeorm";
480
+ import { ILevel as ILevel3 } from "@ooneex/gamification";
481
+ declare class LevelEntity extends BaseEntity implements ILevel3 {
482
+ name: string;
483
+ code: string;
484
+ color: string;
485
+ }
486
+ declare class LevelRepository {
487
+ private readonly database;
488
+ constructor(database: ITypeormDatabaseAdapter12);
489
+ open(): Promise<Repository12<LevelEntity>>;
490
+ close(): Promise<void>;
491
+ find(criteria: FindManyOptions12<LevelEntity> & {
492
+ page?: number;
493
+ limit?: number;
494
+ q?: string;
495
+ }): Promise<FilterResultType12<LevelEntity>>;
496
+ findOne(id: string): Promise<LevelEntity | null>;
497
+ findOneBy(criteria: FindOptionsWhere12<LevelEntity>): Promise<LevelEntity | null>;
498
+ findByCode(code: string): Promise<LevelEntity | null>;
499
+ create(entity: LevelEntity, options?: SaveOptions12): Promise<LevelEntity>;
500
+ createMany(entities: LevelEntity[], options?: SaveOptions12): Promise<LevelEntity[]>;
501
+ update(entity: LevelEntity, options?: SaveOptions12): Promise<LevelEntity>;
502
+ updateMany(entities: LevelEntity[], options?: SaveOptions12): Promise<LevelEntity[]>;
503
+ delete(criteria: FindOptionsWhere12<LevelEntity> | FindOptionsWhere12<LevelEntity>[]): Promise<UpdateResult12>;
504
+ count(criteria?: FindOptionsWhere12<LevelEntity> | FindOptionsWhere12<LevelEntity>[]): Promise<number>;
505
+ }
506
+ export { McqSessionRepository, McqSessionQuestionRepository, McqQuestionRepository, McqQuestionChoiceRepository, LevelRepository, FlashcardStatsRepository, FlashcardSessionRepository, FlashcardScheduleRepository, FlashcardReviewRepository, FlashcardRepository, FlashcardPresetRepository, FlashcardDeckRepository };
@@ -0,0 +1,4 @@
1
+ // @bun
2
+ import{a as E,b as I,c as W,d as O,e as R,f as m,g as q}from"./flashcard/index.js";import{h as u,i as v,j as g,k as d}from"./mcq/index.js";import"../../../shared/chunk-kgxsdeye.js";import"../../../shared/chunk-wmftwzcs.js";import"../../../shared/chunk-hw4vdg6q.js";import"../../../shared/chunk-2e7zbxcq.js";import"../../../shared/chunk-764bzjhz.js";import{U}from"../../../shared/chunk-pwhygf44.js";import{V as Q,W as S,X as T}from"../../../shared/chunk-j7nprmyh.js";import{inject as Y}from"@ooneex/container";import{ILike as N}from"typeorm";class F{database;constructor(x){this.database=x}async open(){return await this.database.open(U)}async close(){await this.database.close()}async find(x){let z=await this.open(),{page:A=1,limit:B=100,q:C,...D}=x,G,J=B===0?100:B;if(A&&A>0&&B&&B>0)G=(A-1)*J;let H={...D,take:J,...G!==void 0&&{skip:G}};if(C)H={...H,where:{...D.where,name:N(`%${C}%`)}};let V=await z.find(H),K=D.where;if(C)K={...D.where,name:N(`%${C}%`)};let M=await this.count(K),X=Math.ceil(M/B);return{resources:V,total:M,totalPages:X,page:A,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 findByCode(x){return await(await this.open()).findOne({where:{code:x}})}async create(x,z){return await(await this.open()).save(x,z)}async createMany(x,z){return await(await this.open()).save(x,z)}async update(x,z){return await this.create(x,z)}async updateMany(x,z){return await this.createMany(x,z)}async delete(x){return await(await this.open()).softDelete(x)}async count(x){return await(await this.open()).count(x?{where:x}:{})}}F=Q([S(0,Y("database")),T("design:paramtypes",[typeof ITypeormDatabaseAdapter==="undefined"?Object:ITypeormDatabaseAdapter])],F);export{d as McqSessionRepository,g as McqSessionQuestionRepository,v as McqQuestionRepository,u as McqQuestionChoiceRepository,F as LevelRepository,q as FlashcardStatsRepository,m as FlashcardSessionRepository,R as FlashcardScheduleRepository,O as FlashcardReviewRepository,W as FlashcardRepository,I as FlashcardPresetRepository,E as FlashcardDeckRepository};
3
+
4
+ //# debugId=22C9B241C8D4094864756E2164756E21