@ooneex/typeorm 0.0.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/shared/chunk-19qhst35.js +5 -0
- package/dist/shared/chunk-19qhst35.js.map +12 -0
- package/dist/shared/chunk-31y260d6.js +101 -0
- package/dist/shared/chunk-31y260d6.js.map +11 -0
- package/dist/shared/chunk-59vwmfpm.js +5 -0
- package/dist/shared/chunk-59vwmfpm.js.map +9 -0
- package/dist/shared/chunk-5tnqjb3n.js +5 -0
- package/dist/shared/{chunk-eh420jqn.js.map → chunk-5tnqjb3n.js.map} +2 -2
- package/dist/shared/chunk-5ybg5hda.js +5 -0
- package/dist/shared/{chunk-pwhygf44.js.map → chunk-5ybg5hda.js.map} +2 -2
- package/dist/shared/chunk-6jnj2pfx.js +5 -0
- package/dist/shared/chunk-6jnj2pfx.js.map +10 -0
- package/dist/shared/chunk-6kdkyjbn.js +5 -0
- package/dist/shared/chunk-6kdkyjbn.js.map +10 -0
- package/dist/shared/chunk-aj0aak90.js +42 -0
- package/dist/shared/chunk-aj0aak90.js.map +10 -0
- package/dist/shared/chunk-e51ktjsq.js +5 -0
- package/dist/shared/chunk-e51ktjsq.js.map +18 -0
- package/dist/shared/chunk-jr0xys18.js +36 -0
- package/dist/shared/chunk-jr0xys18.js.map +10 -0
- package/dist/shared/chunk-kw4t1san.js +5 -0
- package/dist/shared/{chunk-wawk30n1.js.map → chunk-kw4t1san.js.map} +9 -4
- package/dist/shared/chunk-nfv9ce7v.js +5 -0
- package/dist/shared/{chunk-wmftwzcs.js.map → chunk-nfv9ce7v.js.map} +2 -2
- package/dist/shared/chunk-p22keb3y.js +5 -0
- package/dist/shared/{chunk-2e7zbxcq.js.map → chunk-p22keb3y.js.map} +2 -2
- package/dist/shared/chunk-pbns711f.js +5 -0
- package/dist/shared/chunk-pbns711f.js.map +10 -0
- package/dist/shared/chunk-qrs0g3m9.js +51 -0
- package/dist/shared/chunk-qrs0g3m9.js.map +10 -0
- package/dist/shared/chunk-qyf32qsz.js +82 -0
- package/dist/shared/chunk-qyf32qsz.js.map +10 -0
- package/dist/shared/chunk-t1jad451.js +5 -0
- package/dist/shared/chunk-t1jad451.js.map +21 -0
- package/dist/shared/chunk-t5cy307m.js +5 -0
- package/dist/shared/chunk-t5cy307m.js.map +10 -0
- package/dist/shared/chunk-x2d798hg.js +5 -0
- package/dist/shared/chunk-x2d798hg.js.map +11 -0
- package/dist/shared/chunk-x3pmm3na.js +5 -0
- package/dist/shared/chunk-x3pmm3na.js.map +21 -0
- package/dist/shared/chunk-xrqhqgen.js +5 -0
- package/dist/shared/{chunk-j7nprmyh.js.map → chunk-xrqhqgen.js.map} +2 -2
- package/dist/shared/chunk-xwe8m6av.js +5 -0
- package/dist/shared/{chunk-zmzz7hqq.js.map → chunk-xwe8m6av.js.map} +2 -2
- package/dist/shared/chunk-yrwsqc6r.js +5 -0
- package/dist/shared/chunk-yrwsqc6r.js.map +21 -0
- package/dist/src/entities/book/index.d.ts +80 -3
- package/dist/src/entities/book/index.js +2 -2
- package/dist/src/entities/book/index.js.map +1 -1
- package/dist/src/entities/common/index.d.ts +21 -28
- package/dist/src/entities/common/index.js +2 -2
- package/dist/src/entities/common/index.js.map +1 -1
- package/dist/src/entities/country/index.d.ts +21 -0
- package/dist/src/entities/country/index.js +4 -0
- package/dist/src/entities/country/index.js.map +9 -0
- package/dist/src/entities/currency/index.d.ts +23 -0
- package/dist/src/entities/currency/index.js +4 -0
- package/dist/src/entities/currency/index.js.map +9 -0
- package/dist/src/entities/folder/index.d.ts +104 -0
- package/dist/src/entities/folder/index.js +4 -0
- package/dist/src/entities/folder/index.js.map +19 -0
- package/dist/src/entities/gamification/flashcard/index.js +2 -2
- package/dist/src/entities/gamification/flashcard/index.js.map +1 -1
- package/dist/src/entities/gamification/index.js +2 -2
- package/dist/src/entities/gamification/index.js.map +1 -1
- package/dist/src/entities/gamification/mcq/index.d.ts +76 -7
- package/dist/src/entities/gamification/mcq/index.js +2 -2
- package/dist/src/entities/gamification/mcq/index.js.map +1 -1
- package/dist/src/entities/image/index.d.ts +83 -6
- package/dist/src/entities/image/index.js +2 -2
- package/dist/src/entities/image/index.js.map +1 -1
- package/dist/src/entities/medecine/index.d.ts +36 -0
- package/dist/src/entities/medecine/index.js +4 -0
- package/dist/src/entities/medecine/index.js.map +9 -0
- package/dist/src/entities/payment/index.js +2 -2
- package/dist/src/entities/payment/index.js.map +1 -1
- package/dist/src/entities/user/index.d.ts +48 -7
- package/dist/src/entities/user/index.js +2 -2
- package/dist/src/entities/user/index.js.map +1 -1
- package/dist/src/entities/video/index.d.ts +88 -10
- package/dist/src/entities/video/index.js +2 -2
- package/dist/src/entities/video/index.js.map +1 -1
- package/dist/src/migrations/book/index.d.ts +97 -0
- package/dist/src/migrations/book/index.js +516 -0
- package/dist/src/migrations/book/index.js.map +21 -0
- package/dist/src/migrations/common/index.d.ts +41 -0
- package/dist/src/migrations/common/index.js +57 -0
- package/dist/src/migrations/common/index.js.map +10 -0
- package/dist/src/migrations/country/index.d.ts +9 -0
- package/dist/src/migrations/country/index.js +40 -0
- package/dist/src/migrations/country/index.js.map +10 -0
- package/dist/src/migrations/currency/index.d.ts +9 -0
- package/dist/src/migrations/currency/index.js +44 -0
- package/dist/src/migrations/currency/index.js.map +10 -0
- package/dist/src/migrations/folder/index.d.ts +81 -0
- package/dist/src/migrations/folder/index.js +387 -0
- package/dist/src/migrations/folder/index.js.map +19 -0
- package/dist/src/migrations/gamification/flashcard/index.d.ts +57 -0
- package/dist/src/migrations/gamification/flashcard/index.js +420 -0
- package/dist/src/migrations/gamification/flashcard/index.js.map +16 -0
- package/dist/src/migrations/gamification/index.d.ts +9 -0
- package/dist/src/migrations/gamification/index.js +4 -0
- package/dist/src/migrations/gamification/index.js.map +9 -0
- package/dist/src/migrations/gamification/mcq/index.d.ts +97 -0
- package/dist/src/migrations/gamification/mcq/index.js +526 -0
- package/dist/src/migrations/gamification/mcq/index.js.map +21 -0
- package/dist/src/migrations/image/index.d.ts +81 -0
- package/dist/src/migrations/image/index.js +328 -0
- package/dist/src/migrations/image/index.js.map +18 -0
- package/dist/src/migrations/medecine/index.d.ts +25 -0
- package/dist/src/migrations/medecine/index.js +119 -0
- package/dist/src/migrations/medecine/index.js.map +12 -0
- package/dist/src/migrations/payment/index.d.ts +49 -0
- package/dist/src/migrations/payment/index.js +352 -0
- package/dist/src/migrations/payment/index.js.map +15 -0
- package/dist/src/migrations/user/index.d.ts +81 -0
- package/dist/src/migrations/user/index.js +309 -0
- package/dist/src/migrations/user/index.js.map +19 -0
- package/dist/src/migrations/video/index.d.ts +97 -0
- package/dist/src/migrations/video/index.js +289 -0
- package/dist/src/migrations/video/index.js.map +21 -0
- package/dist/src/repositories/book/index.d.ts +310 -35
- package/dist/src/repositories/book/index.js +2 -2
- package/dist/src/repositories/book/index.js.map +15 -6
- package/dist/src/repositories/common/index.d.ts +65 -94
- package/dist/src/repositories/common/index.js +2 -2
- package/dist/src/repositories/common/index.js.map +8 -9
- package/dist/src/repositories/country/index.d.ts +42 -0
- package/dist/src/repositories/country/index.js +4 -0
- package/dist/src/repositories/country/index.js.map +10 -0
- package/dist/src/repositories/currency/index.d.ts +44 -0
- package/dist/src/repositories/currency/index.js +4 -0
- package/dist/src/repositories/currency/index.js.map +10 -0
- package/dist/src/repositories/gamification/flashcard/index.d.ts +14 -14
- package/dist/src/repositories/gamification/flashcard/index.js +2 -2
- package/dist/src/repositories/gamification/flashcard/index.js.map +9 -9
- package/dist/src/repositories/gamification/index.d.ts +328 -83
- package/dist/src/repositories/gamification/index.js +2 -2
- package/dist/src/repositories/gamification/index.js.map +3 -3
- package/dist/src/repositories/gamification/mcq/index.d.ts +299 -54
- package/dist/src/repositories/gamification/mcq/index.js +2 -2
- package/dist/src/repositories/gamification/mcq/index.js.map +15 -7
- package/dist/src/repositories/image/index.d.ts +295 -20
- package/dist/src/repositories/image/index.js +2 -2
- package/dist/src/repositories/image/index.js.map +13 -4
- package/dist/src/repositories/medecine/index.d.ts +99 -0
- package/dist/src/repositories/medecine/index.js +4 -0
- package/dist/src/repositories/medecine/index.js.map +12 -0
- package/dist/src/repositories/payment/index.d.ts +12 -12
- package/dist/src/repositories/payment/index.js +2 -2
- package/dist/src/repositories/payment/index.js.map +8 -8
- package/dist/src/repositories/user/index.d.ts +210 -59
- package/dist/src/repositories/user/index.js +2 -2
- package/dist/src/repositories/user/index.js.map +13 -8
- package/dist/src/repositories/video/index.d.ts +330 -54
- package/dist/src/repositories/video/index.js +2 -2
- package/dist/src/repositories/video/index.js.map +15 -6
- package/package.json +188 -58
- package/dist/ooneex-typeorm-0.0.1.tgz +0 -0
- package/dist/shared/chunk-2e7zbxcq.js +0 -5
- package/dist/shared/chunk-764bzjhz.js +0 -5
- package/dist/shared/chunk-764bzjhz.js.map +0 -12
- package/dist/shared/chunk-eh420jqn.js +0 -5
- package/dist/shared/chunk-gjsgnzaq.js +0 -5
- package/dist/shared/chunk-gjsgnzaq.js.map +0 -10
- package/dist/shared/chunk-hw4vdg6q.js +0 -5
- package/dist/shared/chunk-hw4vdg6q.js.map +0 -10
- package/dist/shared/chunk-j7nprmyh.js +0 -5
- package/dist/shared/chunk-kgxsdeye.js +0 -5
- package/dist/shared/chunk-kgxsdeye.js.map +0 -13
- package/dist/shared/chunk-ntrrrvwt.js +0 -5
- package/dist/shared/chunk-ntrrrvwt.js.map +0 -12
- package/dist/shared/chunk-pwhygf44.js +0 -5
- package/dist/shared/chunk-sd6mmec6.js +0 -5
- package/dist/shared/chunk-sd6mmec6.js.map +0 -12
- package/dist/shared/chunk-wawk30n1.js +0 -5
- package/dist/shared/chunk-wmftwzcs.js +0 -5
- package/dist/shared/chunk-zmzz7hqq.js +0 -5
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["src/repositories/common/CategoryRepository.ts", "src/repositories/common/ColorRepository.ts", "src/repositories/common/
|
|
3
|
+
"sources": ["src/repositories/common/CategoryRepository.ts", "src/repositories/common/ColorRepository.ts", "src/repositories/common/StatRepository.ts", "src/repositories/common/StatusRepository.ts", "src/repositories/common/TagRepository.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import { inject } from \"@ooneex/container\";\nimport type {
|
|
6
|
-
"import { inject } from \"@ooneex/container\";\nimport type {
|
|
7
|
-
"import { inject } from \"@ooneex/container\";\nimport type {
|
|
8
|
-
"import { inject } from \"@ooneex/container\";\nimport type {
|
|
9
|
-
"import { inject } from \"@ooneex/container\";\nimport type {
|
|
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 ? { where: criteria } : {});\n }\n}\n"
|
|
5
|
+
"import { inject } from \"@ooneex/container\";\nimport type { ITypeormDatabase } from \"@ooneex/database\";\nimport { decorator } from \"@ooneex/repository\";\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\n@decorator.repository()\nexport class CategoryRepository {\n constructor(\n @inject(\"database\")\n private readonly database: ITypeormDatabase,\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 { ITypeormDatabase } from \"@ooneex/database\";\nimport { decorator } from \"@ooneex/repository\";\nimport type { FilterResultType } from \"@ooneex/types\";\nimport type { FindManyOptions, FindOptionsWhere, Repository, SaveOptions, UpdateResult } from \"typeorm\";\nimport { ColorEntity } from \"../../entities/common/ColorEntity\";\n\n@decorator.repository()\nexport class ColorRepository {\n constructor(\n @inject(\"database\")\n private readonly database: ITypeormDatabase,\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 { ITypeormDatabase } from \"@ooneex/database\";\nimport { decorator } from \"@ooneex/repository\";\nimport type { FilterResultType } from \"@ooneex/types\";\nimport type { FindManyOptions, FindOptionsWhere, Repository, SaveOptions, UpdateResult } from \"typeorm\";\nimport { StatEntity } from \"../../entities/common/StatEntity\";\n\n@decorator.repository()\nexport class StatRepository {\n constructor(\n @inject(\"database\")\n private readonly database: ITypeormDatabase,\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",
|
|
8
|
+
"import { inject } from \"@ooneex/container\";\nimport type { ITypeormDatabase } from \"@ooneex/database\";\nimport { decorator } from \"@ooneex/repository\";\nimport type { FilterResultType } from \"@ooneex/types\";\nimport type { FindManyOptions, FindOptionsWhere, Repository, SaveOptions, UpdateResult } from \"typeorm\";\nimport { StatusEntity } from \"../../entities/common/StatusEntity\";\n\n@decorator.repository()\nexport class StatusRepository {\n constructor(\n @inject(\"database\")\n private readonly database: ITypeormDatabase,\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",
|
|
9
|
+
"import { inject } from \"@ooneex/container\";\nimport type { ITypeormDatabase } from \"@ooneex/database\";\nimport { decorator } from \"@ooneex/repository\";\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\n@decorator.repository()\nexport class TagRepository {\n constructor(\n @inject(\"database\")\n private readonly database: ITypeormDatabase,\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 ? { where: criteria } : {});\n }\n}\n"
|
|
11
10
|
],
|
|
12
|
-
"mappings": ";
|
|
13
|
-
"debugId": "
|
|
11
|
+
"mappings": ";4SAAA,yBAAS,kCAET,4BAAS,mCAGT,wBAAS,gBAIF,MAAM,CAAmB,CAGX,SAFnB,WAAW,CAEQ,EACjB,CADiB,qBAGN,KAAI,EAAwC,CACvD,OAAO,MAAM,KAAK,SAAS,KAAK,CAAc,OAGnC,MAAK,EAAkB,CAClC,MAAM,KAAK,SAAS,MAAM,OAGf,KAAI,CACf,EAC2C,CAC3C,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,EAAM,UAAU,IAAS,QAAa,CAAE,MAAK,CAAG,EACvE,GAAI,EACF,EAAc,IACT,EACH,MAAO,IACF,EAAK,MACR,KAAM,EAAM,IAAI,IAAI,CACtB,CACF,EAGF,IAAM,EAAS,MAAM,EAAW,KAAK,CAAW,EAG5C,EAAa,EAAK,MACtB,GAAI,EACF,EAAa,IACR,EAAK,MACR,KAAM,EAAM,IAAI,IAAI,CACtB,EAGF,IAAM,EAAQ,MAAM,KAAK,MAAM,CAAU,EACnC,EAAa,KAAK,KAAK,EAAQ,CAAK,EAE1C,MAAO,CACL,UAAW,EACX,QACA,aACA,OACA,OACF,OAGW,QAAO,CAAC,EAA4C,CAG/D,OAAO,MAFY,MAAM,KAAK,KAAK,GAEX,QAAQ,CAC9B,MAAO,CAAE,IAAG,CACd,CAAC,OAGU,UAAS,CAAC,EAA4E,CAGjG,OAAO,MAFY,MAAM,KAAK,KAAK,GAEX,QAAQ,CAC9B,MAAO,CACT,CAAC,OAGU,OAAM,CAAC,EAAwB,EAAgD,CAG1F,OAAO,MAFY,M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C,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,GADN,EAAU,WAAW,EAGjB,MAAO,UAAU,GAFf,wFAAM",
|
|
12
|
+
"debugId": "8B0F101E2479505164756E2164756E21",
|
|
14
13
|
"names": []
|
|
15
14
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ITypeormDatabase } from "@ooneex/database";
|
|
2
|
+
import { FilterResultType } from "@ooneex/types";
|
|
3
|
+
import { FindManyOptions, FindOptionsWhere, Repository, SaveOptions, UpdateResult } from "typeorm";
|
|
4
|
+
import { ICountry } from "@ooneex/country";
|
|
5
|
+
import { LocaleType } from "@ooneex/translation";
|
|
6
|
+
import { IBase } from "@ooneex/types";
|
|
7
|
+
declare abstract class BaseEntity implements IBase {
|
|
8
|
+
id: string;
|
|
9
|
+
isLocked?: boolean;
|
|
10
|
+
lockedAt?: Date;
|
|
11
|
+
isBlocked?: boolean;
|
|
12
|
+
blockedAt?: Date;
|
|
13
|
+
blockReason?: string;
|
|
14
|
+
isPublic?: boolean;
|
|
15
|
+
language?: LocaleType;
|
|
16
|
+
createdAt?: Date;
|
|
17
|
+
updatedAt?: Date;
|
|
18
|
+
deletedAt?: Date;
|
|
19
|
+
}
|
|
20
|
+
declare class CountryEntity extends BaseEntity implements ICountry {
|
|
21
|
+
name: string;
|
|
22
|
+
code: string;
|
|
23
|
+
}
|
|
24
|
+
declare class CountryRepository {
|
|
25
|
+
private readonly database;
|
|
26
|
+
constructor(database: ITypeormDatabase);
|
|
27
|
+
open(): Promise<Repository<CountryEntity>>;
|
|
28
|
+
close(): Promise<void>;
|
|
29
|
+
find(criteria: FindManyOptions<CountryEntity> & {
|
|
30
|
+
page?: number;
|
|
31
|
+
limit?: number;
|
|
32
|
+
}): Promise<FilterResultType<CountryEntity>>;
|
|
33
|
+
findOne(id: string): Promise<CountryEntity | null>;
|
|
34
|
+
findOneBy(criteria: FindOptionsWhere<CountryEntity>): Promise<CountryEntity | null>;
|
|
35
|
+
create(entity: CountryEntity, options?: SaveOptions): Promise<CountryEntity>;
|
|
36
|
+
createMany(entities: CountryEntity[], options?: SaveOptions): Promise<CountryEntity[]>;
|
|
37
|
+
update(entity: CountryEntity, options?: SaveOptions): Promise<CountryEntity>;
|
|
38
|
+
updateMany(entities: CountryEntity[], options?: SaveOptions): Promise<CountryEntity[]>;
|
|
39
|
+
delete(criteria: FindOptionsWhere<CountryEntity> | FindOptionsWhere<CountryEntity>[]): Promise<UpdateResult>;
|
|
40
|
+
count(criteria?: FindOptionsWhere<CountryEntity> | FindOptionsWhere<CountryEntity>[]): Promise<number>;
|
|
41
|
+
}
|
|
42
|
+
export { CountryRepository };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{z as I}from"../../../shared/chunk-pbns711f.js";import"../../../shared/chunk-xrqhqgen.js";import{Ha as F,Ia as G,Ja as H}from"../../../shared/chunk-59vwmfpm.js";import{inject as L}from"@ooneex/container";import{decorator as M}from"@ooneex/repository";class v{database;constructor(f){this.database=f}async open(){return await this.database.open(I)}async close(){await this.database.close()}async find(f){let x=await this.open(),{page:h=1,limit:q=100,...A}=f,z,B=q===0?100:q;if(h&&h>0&&q&&q>0)z=(h-1)*B;let J=await x.find({...A,take:B,...z!==void 0&&{skip:z}}),D=await this.count(A.where),K=Math.ceil(D/q);return{resources:J,total:D,totalPages:K,page:h,limit:q}}async findOne(f){return await(await this.open()).findOne({where:{id:f}})}async findOneBy(f){return await(await this.open()).findOne({where:f})}async create(f,x){return await(await this.open()).save(f,x)}async createMany(f,x){return await(await this.open()).save(f,x)}async update(f,x){return await this.create(f,x)}async updateMany(f,x){return await this.createMany(f,x)}async delete(f){return await(await this.open()).softDelete(f)}async count(f){return await(await this.open()).count(f?{where:f}:{})}}v=F([M.repository(),G(0,L("database")),H("design:paramtypes",[typeof ITypeormDatabase==="undefined"?Object:ITypeormDatabase])],v);export{v as CountryRepository};
|
|
3
|
+
|
|
4
|
+
//# debugId=EEEBA56481A6F90464756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["src/repositories/country/CountryRepository.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { inject } from \"@ooneex/container\";\nimport type { ITypeormDatabase } from \"@ooneex/database\";\nimport { decorator } from \"@ooneex/repository\";\nimport type { FilterResultType } from \"@ooneex/types\";\nimport type { FindManyOptions, FindOptionsWhere, Repository, SaveOptions, UpdateResult } from \"typeorm\";\nimport { CountryEntity } from \"../../entities/country/CountryEntity\";\n\n@decorator.repository()\nexport class CountryRepository {\n constructor(\n @inject(\"database\")\n private readonly database: ITypeormDatabase,\n ) {}\n\n public async open(): Promise<Repository<CountryEntity>> {\n return await this.database.open(CountryEntity);\n }\n\n public async close(): Promise<void> {\n await this.database.close();\n }\n\n public async find(\n criteria: FindManyOptions<CountryEntity> & { page?: number; limit?: number },\n ): Promise<FilterResultType<CountryEntity>> {\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<CountryEntity | 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<CountryEntity>): Promise<CountryEntity | null> {\n const repository = await this.open();\n\n return await repository.findOne({\n where: criteria,\n });\n }\n\n public async create(entity: CountryEntity, options?: SaveOptions): Promise<CountryEntity> {\n const repository = await this.open();\n\n return await repository.save(entity, options);\n }\n\n public async createMany(entities: CountryEntity[], options?: SaveOptions): Promise<CountryEntity[]> {\n const repository = await this.open();\n\n return await repository.save(entities, options);\n }\n\n public async update(entity: CountryEntity, options?: SaveOptions): Promise<CountryEntity> {\n return await this.create(entity, options);\n }\n\n public async updateMany(entities: CountryEntity[], options?: SaveOptions): Promise<CountryEntity[]> {\n return await this.createMany(entities, options);\n }\n\n public async delete(\n criteria: FindOptionsWhere<CountryEntity> | FindOptionsWhere<CountryEntity>[],\n ): Promise<UpdateResult> {\n const repository = await this.open();\n\n return await repository.softDelete(criteria);\n }\n\n public async count(criteria?: FindOptionsWhere<CountryEntity> | FindOptionsWhere<CountryEntity>[]): Promise<number> {\n const repository = await this.open();\n\n return await repository.count(criteria ? { where: criteria } : {});\n }\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";uJAAA,yBAAS,kCAET,oBAAS,2BAMF,MAAM,CAAkB,CAGV,SAFnB,WAAW,CAEQ,EACjB,CADiB,qBAGN,KAAI,EAAuC,CACtD,OAAO,MAAM,KAAK,SAAS,KAAK,CAAa,OAGlC,MAAK,EAAkB,CAClC,MAAM,KAAK,SAAS,MAAM,OAGf,KAAI,CACf,EAC0C,CAC1C,IAAM,EAAa,MAAM,KAAK,KAAK,GAE3B,OAAO,EAAG,QAAQ,OAAQ,GAAS,EAEvC,EACE,EAAO,IAAU,EAAI,IAAM,EAEjC,GAAI,GAAQ,EAAO,GAAK,GAAS,EAAQ,EACvC,GAAQ,EAAO,GAAK,EAGtB,IAAM,EAAS,MAAM,EAAW,KAAK,IAAK,EAAM,UAAU,IAAS,QAAa,CAAE,MAAK,CAAG,CAAC,EAErF,EAAQ,MAAM,KAAK,MAAM,EAAK,KAAK,EACnC,EAAa,KAAK,KAAK,EAAQ,CAAK,EAE1C,MAAO,CACL,UAAW,EACX,QACA,aACA,OACA,OACF,OAGW,QAAO,CAAC,EAA2C,CAG9D,OAAO,MAFY,MAAM,KAAK,KAAK,GAEX,QAAQ,CAC9B,MAAO,CAAE,IAAG,CACd,CAAC,OAGU,UAAS,CAAC,EAA0E,CAG/F,OAAO,MAFY,MAAM,KAAK,KAAK,GAEX,QAAQ,CAC9B,MAAO,CACT,CAAC,OAGU,OAAM,CAAC,EAAuB,EAA+C,CAGxF,OAAO,MAFY,MAAM,KAAK,KAAK,GAEX,KAAK,EAAQ,CAAO,OAGjC,WAAU,CAAC,EAA2B,EAAiD,CAGlG,OAAO,MAFY,MAAM,KAAK,KAAK,GAEX,KAAK,EAAU,CAAO,OAGnC,OAAM,CAAC,EAAuB,EAA+C,CACxF,OAAO,MAAM,KAAK,OAAO,EAAQ,CAAO,OAG7B,WAAU,CAAC,EAA2B,EAAiD,CAClG,OAAO,MAAM,KAAK,WAAW,EAAU,CAAO,OAGnC,OAAM,CACjB,EACuB,CAGvB,OAAO,MAFY,MAAM,KAAK,KAAK,GAEX,WAAW,CAAQ,OAGhC,MAAK,CAAC,EAAiG,CAGlH,OAAO,MAFY,MAAM,KAAK,KAAK,GAEX,MAAM,EAAW,CAAE,MAAO,CAAS,EAAI,CAAC,CAAC,EAErE,CA3Fa,EAAN,GADN,EAAU,WAAW,EAGjB,MAAO,UAAU,GAFf,wFAAM",
|
|
8
|
+
"debugId": "EEEBA56481A6F90464756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ITypeormDatabase } from "@ooneex/database";
|
|
2
|
+
import { FilterResultType } from "@ooneex/types";
|
|
3
|
+
import { FindManyOptions, FindOptionsWhere, Repository, SaveOptions, UpdateResult } from "typeorm";
|
|
4
|
+
import { ICurrency } from "@ooneex/currencies";
|
|
5
|
+
import { LocaleType } from "@ooneex/translation";
|
|
6
|
+
import { IBase } from "@ooneex/types";
|
|
7
|
+
declare abstract class BaseEntity implements IBase {
|
|
8
|
+
id: string;
|
|
9
|
+
isLocked?: boolean;
|
|
10
|
+
lockedAt?: Date;
|
|
11
|
+
isBlocked?: boolean;
|
|
12
|
+
blockedAt?: Date;
|
|
13
|
+
blockReason?: string;
|
|
14
|
+
isPublic?: boolean;
|
|
15
|
+
language?: LocaleType;
|
|
16
|
+
createdAt?: Date;
|
|
17
|
+
updatedAt?: Date;
|
|
18
|
+
deletedAt?: Date;
|
|
19
|
+
}
|
|
20
|
+
declare class CurrencyEntity extends BaseEntity implements ICurrency {
|
|
21
|
+
code: string;
|
|
22
|
+
name: string;
|
|
23
|
+
icon?: string;
|
|
24
|
+
symbol: string;
|
|
25
|
+
}
|
|
26
|
+
declare class CurrencyRepository {
|
|
27
|
+
private readonly database;
|
|
28
|
+
constructor(database: ITypeormDatabase);
|
|
29
|
+
open(): Promise<Repository<CurrencyEntity>>;
|
|
30
|
+
close(): Promise<void>;
|
|
31
|
+
find(criteria: FindManyOptions<CurrencyEntity> & {
|
|
32
|
+
page?: number;
|
|
33
|
+
limit?: number;
|
|
34
|
+
}): Promise<FilterResultType<CurrencyEntity>>;
|
|
35
|
+
findOne(id: string): Promise<CurrencyEntity | null>;
|
|
36
|
+
findOneBy(criteria: FindOptionsWhere<CurrencyEntity>): Promise<CurrencyEntity | null>;
|
|
37
|
+
create(entity: CurrencyEntity, options?: SaveOptions): Promise<CurrencyEntity>;
|
|
38
|
+
createMany(entities: CurrencyEntity[], options?: SaveOptions): Promise<CurrencyEntity[]>;
|
|
39
|
+
update(entity: CurrencyEntity, options?: SaveOptions): Promise<CurrencyEntity>;
|
|
40
|
+
updateMany(entities: CurrencyEntity[], options?: SaveOptions): Promise<CurrencyEntity[]>;
|
|
41
|
+
delete(criteria: FindOptionsWhere<CurrencyEntity> | FindOptionsWhere<CurrencyEntity>[]): Promise<UpdateResult>;
|
|
42
|
+
count(criteria?: FindOptionsWhere<CurrencyEntity> | FindOptionsWhere<CurrencyEntity>[]): Promise<number>;
|
|
43
|
+
}
|
|
44
|
+
export { CurrencyRepository };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{A as I}from"../../../shared/chunk-t5cy307m.js";import"../../../shared/chunk-xrqhqgen.js";import{Ha as F,Ia as G,Ja as H}from"../../../shared/chunk-59vwmfpm.js";import{inject as L}from"@ooneex/container";import{decorator as M}from"@ooneex/repository";class v{database;constructor(f){this.database=f}async open(){return await this.database.open(I)}async close(){await this.database.close()}async find(f){let x=await this.open(),{page:h=1,limit:q=100,...A}=f,z,B=q===0?100:q;if(h&&h>0&&q&&q>0)z=(h-1)*B;let J=await x.find({...A,take:B,...z!==void 0&&{skip:z}}),D=await this.count(A.where),K=Math.ceil(D/q);return{resources:J,total:D,totalPages:K,page:h,limit:q}}async findOne(f){return await(await this.open()).findOne({where:{id:f}})}async findOneBy(f){return await(await this.open()).findOne({where:f})}async create(f,x){return await(await this.open()).save(f,x)}async createMany(f,x){return await(await this.open()).save(f,x)}async update(f,x){return await this.create(f,x)}async updateMany(f,x){return await this.createMany(f,x)}async delete(f){return await(await this.open()).softDelete(f)}async count(f){return await(await this.open()).count(f?{where:f}:{})}}v=F([M.repository(),G(0,L("database")),H("design:paramtypes",[typeof ITypeormDatabase==="undefined"?Object:ITypeormDatabase])],v);export{v as CurrencyRepository};
|
|
3
|
+
|
|
4
|
+
//# debugId=BB1262F2B0D0F6AC64756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["src/repositories/currency/CurrencyRepository.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { inject } from \"@ooneex/container\";\nimport type { ITypeormDatabase } from \"@ooneex/database\";\nimport { decorator } from \"@ooneex/repository\";\nimport type { FilterResultType } from \"@ooneex/types\";\nimport type { FindManyOptions, FindOptionsWhere, Repository, SaveOptions, UpdateResult } from \"typeorm\";\nimport { CurrencyEntity } from \"../../entities/currency/CurrencyEntity\";\n\n@decorator.repository()\nexport class CurrencyRepository {\n constructor(\n @inject(\"database\")\n private readonly database: ITypeormDatabase,\n ) {}\n\n public async open(): Promise<Repository<CurrencyEntity>> {\n return await this.database.open(CurrencyEntity);\n }\n\n public async close(): Promise<void> {\n await this.database.close();\n }\n\n public async find(\n criteria: FindManyOptions<CurrencyEntity> & { page?: number; limit?: number },\n ): Promise<FilterResultType<CurrencyEntity>> {\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<CurrencyEntity | 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<CurrencyEntity>): Promise<CurrencyEntity | null> {\n const repository = await this.open();\n\n return await repository.findOne({\n where: criteria,\n });\n }\n\n public async create(entity: CurrencyEntity, options?: SaveOptions): Promise<CurrencyEntity> {\n const repository = await this.open();\n\n return await repository.save(entity, options);\n }\n\n public async createMany(entities: CurrencyEntity[], options?: SaveOptions): Promise<CurrencyEntity[]> {\n const repository = await this.open();\n\n return await repository.save(entities, options);\n }\n\n public async update(entity: CurrencyEntity, options?: SaveOptions): Promise<CurrencyEntity> {\n return await this.create(entity, options);\n }\n\n public async updateMany(entities: CurrencyEntity[], options?: SaveOptions): Promise<CurrencyEntity[]> {\n return await this.createMany(entities, options);\n }\n\n public async delete(\n criteria: FindOptionsWhere<CurrencyEntity> | FindOptionsWhere<CurrencyEntity>[],\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<CurrencyEntity> | FindOptionsWhere<CurrencyEntity>[],\n ): Promise<number> {\n const repository = await this.open();\n\n return await repository.count(criteria ? { where: criteria } : {});\n }\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";uJAAA,yBAAS,kCAET,oBAAS,2BAMF,MAAM,CAAmB,CAGX,SAFnB,WAAW,CAEQ,EACjB,CADiB,qBAGN,KAAI,EAAwC,CACvD,OAAO,MAAM,KAAK,SAAS,KAAK,CAAc,OAGnC,MAAK,EAAkB,CAClC,MAAM,KAAK,SAAS,MAAM,OAGf,KAAI,CACf,EAC2C,CAC3C,IAAM,EAAa,MAAM,KAAK,KAAK,GAE3B,OAAO,EAAG,QAAQ,OAAQ,GAAS,EAEvC,EACE,EAAO,IAAU,EAAI,IAAM,EAEjC,GAAI,GAAQ,EAAO,GAAK,GAAS,EAAQ,EACvC,GAAQ,EAAO,GAAK,EAGtB,IAAM,EAAS,MAAM,EAAW,KAAK,IAAK,EAAM,UAAU,IAAS,QAAa,CAAE,MAAK,CAAG,CAAC,EAErF,EAAQ,MAAM,KAAK,MAAM,EAAK,KAAK,EACnC,EAAa,KAAK,KAAK,EAAQ,CAAK,EAE1C,MAAO,CACL,UAAW,EACX,QACA,aACA,OACA,OACF,OAGW,QAAO,CAAC,EAA4C,CAG/D,OAAO,MAFY,MAAM,KAAK,KAAK,GAEX,QAAQ,CAC9B,MAAO,CAAE,IAAG,CACd,CAAC,OAGU,UAAS,CAAC,EAA4E,CAGjG,OAAO,MAFY,MAAM,KAAK,KAAK,GAEX,QAAQ,CAC9B,MAAO,CACT,CAAC,OAGU,OAAM,CAAC,EAAwB,EAAgD,CAG1F,OAAO,MAFY,MAAM,KAAK,KAAK,GAEX,KAAK,EAAQ,CAAO,OAGjC,WAAU,CAAC,EAA4B,EAAkD,CAGpG,OAAO,MAFY,MAAM,KAAK,KAAK,GAEX,KAAK,EAAU,CAAO,OAGnC,OAAM,CAAC,EAAwB,EAAgD,CAC1F,OAAO,MAAM,KAAK,OAAO,EAAQ,CAAO,OAG7B,WAAU,CAAC,EAA4B,EAAkD,CACpG,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,CA7Fa,EAAN,GADN,EAAU,WAAW,EAGjB,MAAO,UAAU,GAFf,wFAAM",
|
|
8
|
+
"debugId": "BB1262F2B0D0F6AC64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ITypeormDatabase } from "@ooneex/database";
|
|
2
2
|
import { FilterResultType } from "@ooneex/types";
|
|
3
3
|
import { FindManyOptions, FindOptionsWhere, Repository, SaveOptions, UpdateResult } from "typeorm";
|
|
4
4
|
import { IFlashcard, IFlashcardDeck } from "@ooneex/gamification/flashcard";
|
|
@@ -46,7 +46,7 @@ declare class FlashcardDeckEntity extends BaseEntity implements IFlashcardDeck {
|
|
|
46
46
|
}
|
|
47
47
|
declare class FlashcardDeckRepository {
|
|
48
48
|
private readonly database;
|
|
49
|
-
constructor(database:
|
|
49
|
+
constructor(database: ITypeormDatabase);
|
|
50
50
|
open(): Promise<Repository<FlashcardDeckEntity>>;
|
|
51
51
|
close(): Promise<void>;
|
|
52
52
|
find(criteria: FindManyOptions<FlashcardDeckEntity> & {
|
|
@@ -63,7 +63,7 @@ declare class FlashcardDeckRepository {
|
|
|
63
63
|
delete(criteria: FindOptionsWhere<FlashcardDeckEntity> | FindOptionsWhere<FlashcardDeckEntity>[]): Promise<UpdateResult>;
|
|
64
64
|
count(criteria?: FindOptionsWhere<FlashcardDeckEntity> | FindOptionsWhere<FlashcardDeckEntity>[]): Promise<number>;
|
|
65
65
|
}
|
|
66
|
-
import {
|
|
66
|
+
import { ITypeormDatabase as ITypeormDatabase2 } from "@ooneex/database";
|
|
67
67
|
import { FilterResultType as FilterResultType2 } from "@ooneex/types";
|
|
68
68
|
import { FindManyOptions as FindManyOptions2, FindOptionsWhere as FindOptionsWhere2, Repository as Repository2, SaveOptions as SaveOptions2, UpdateResult as UpdateResult2 } from "typeorm";
|
|
69
69
|
import { IFlashcardPreset } from "@ooneex/gamification/flashcard";
|
|
@@ -94,7 +94,7 @@ declare class FlashcardPresetEntity extends BaseEntity implements IFlashcardPres
|
|
|
94
94
|
}
|
|
95
95
|
declare class FlashcardPresetRepository {
|
|
96
96
|
private readonly database;
|
|
97
|
-
constructor(database:
|
|
97
|
+
constructor(database: ITypeormDatabase2);
|
|
98
98
|
open(): Promise<Repository2<FlashcardPresetEntity>>;
|
|
99
99
|
close(): Promise<void>;
|
|
100
100
|
find(criteria: FindManyOptions2<FlashcardPresetEntity> & {
|
|
@@ -111,7 +111,7 @@ declare class FlashcardPresetRepository {
|
|
|
111
111
|
delete(criteria: FindOptionsWhere2<FlashcardPresetEntity> | FindOptionsWhere2<FlashcardPresetEntity>[]): Promise<UpdateResult2>;
|
|
112
112
|
count(criteria?: FindOptionsWhere2<FlashcardPresetEntity> | FindOptionsWhere2<FlashcardPresetEntity>[]): Promise<number>;
|
|
113
113
|
}
|
|
114
|
-
import {
|
|
114
|
+
import { ITypeormDatabase as ITypeormDatabase3 } from "@ooneex/database";
|
|
115
115
|
import { FilterResultType as FilterResultType3 } from "@ooneex/types";
|
|
116
116
|
import { FindManyOptions as FindManyOptions3, FindOptionsWhere as FindOptionsWhere3, Repository as Repository3, SaveOptions as SaveOptions3, UpdateResult as UpdateResult3 } from "typeorm";
|
|
117
117
|
import { IFlashcard as IFlashcard2, IFlashcardDeck as IFlashcardDeck2, IFlashcardSchedule } from "@ooneex/gamification/flashcard";
|
|
@@ -134,7 +134,7 @@ declare class FlashcardEntity extends BaseEntity implements IFlashcard2 {
|
|
|
134
134
|
}
|
|
135
135
|
declare class FlashcardRepository {
|
|
136
136
|
private readonly database;
|
|
137
|
-
constructor(database:
|
|
137
|
+
constructor(database: ITypeormDatabase3);
|
|
138
138
|
open(): Promise<Repository3<FlashcardEntity>>;
|
|
139
139
|
close(): Promise<void>;
|
|
140
140
|
find(criteria: FindManyOptions3<FlashcardEntity> & {
|
|
@@ -151,7 +151,7 @@ declare class FlashcardRepository {
|
|
|
151
151
|
delete(criteria: FindOptionsWhere3<FlashcardEntity> | FindOptionsWhere3<FlashcardEntity>[]): Promise<UpdateResult3>;
|
|
152
152
|
count(criteria?: FindOptionsWhere3<FlashcardEntity> | FindOptionsWhere3<FlashcardEntity>[]): Promise<number>;
|
|
153
153
|
}
|
|
154
|
-
import {
|
|
154
|
+
import { ITypeormDatabase as ITypeormDatabase4 } from "@ooneex/database";
|
|
155
155
|
import { FilterResultType as FilterResultType4 } from "@ooneex/types";
|
|
156
156
|
import { FindManyOptions as FindManyOptions4, FindOptionsWhere as FindOptionsWhere4, Repository as Repository4, SaveOptions as SaveOptions4, UpdateResult as UpdateResult4 } from "typeorm";
|
|
157
157
|
import { IFlashcard as IFlashcard3, IFlashcardReview, IFlashcardSession } from "@ooneex/gamification/flashcard";
|
|
@@ -175,7 +175,7 @@ declare class FlashcardReviewEntity extends BaseEntity implements IFlashcardRevi
|
|
|
175
175
|
}
|
|
176
176
|
declare class FlashcardReviewRepository {
|
|
177
177
|
private readonly database;
|
|
178
|
-
constructor(database:
|
|
178
|
+
constructor(database: ITypeormDatabase4);
|
|
179
179
|
open(): Promise<Repository4<FlashcardReviewEntity>>;
|
|
180
180
|
close(): Promise<void>;
|
|
181
181
|
find(criteria: FindManyOptions4<FlashcardReviewEntity> & {
|
|
@@ -191,7 +191,7 @@ declare class FlashcardReviewRepository {
|
|
|
191
191
|
delete(criteria: FindOptionsWhere4<FlashcardReviewEntity> | FindOptionsWhere4<FlashcardReviewEntity>[]): Promise<UpdateResult4>;
|
|
192
192
|
count(criteria?: FindOptionsWhere4<FlashcardReviewEntity> | FindOptionsWhere4<FlashcardReviewEntity>[]): Promise<number>;
|
|
193
193
|
}
|
|
194
|
-
import {
|
|
194
|
+
import { ITypeormDatabase as ITypeormDatabase5 } from "@ooneex/database";
|
|
195
195
|
import { FilterResultType as FilterResultType5 } from "@ooneex/types";
|
|
196
196
|
import { FindManyOptions as FindManyOptions5, FindOptionsWhere as FindOptionsWhere5, Repository as Repository5, SaveOptions as SaveOptions5, UpdateResult as UpdateResult5 } from "typeorm";
|
|
197
197
|
import { IFlashcardSchedule as IFlashcardSchedule2 } from "@ooneex/gamification/flashcard";
|
|
@@ -213,7 +213,7 @@ declare class FlashcardScheduleEntity extends BaseEntity implements IFlashcardSc
|
|
|
213
213
|
}
|
|
214
214
|
declare class FlashcardScheduleRepository {
|
|
215
215
|
private readonly database;
|
|
216
|
-
constructor(database:
|
|
216
|
+
constructor(database: ITypeormDatabase5);
|
|
217
217
|
open(): Promise<Repository5<FlashcardScheduleEntity>>;
|
|
218
218
|
close(): Promise<void>;
|
|
219
219
|
find(criteria: FindManyOptions5<FlashcardScheduleEntity> & {
|
|
@@ -229,7 +229,7 @@ declare class FlashcardScheduleRepository {
|
|
|
229
229
|
delete(criteria: FindOptionsWhere5<FlashcardScheduleEntity> | FindOptionsWhere5<FlashcardScheduleEntity>[]): Promise<UpdateResult5>;
|
|
230
230
|
count(criteria?: FindOptionsWhere5<FlashcardScheduleEntity> | FindOptionsWhere5<FlashcardScheduleEntity>[]): Promise<number>;
|
|
231
231
|
}
|
|
232
|
-
import {
|
|
232
|
+
import { ITypeormDatabase as ITypeormDatabase6 } from "@ooneex/database";
|
|
233
233
|
import { FilterResultType as FilterResultType6 } from "@ooneex/types";
|
|
234
234
|
import { FindManyOptions as FindManyOptions6, FindOptionsWhere as FindOptionsWhere6, Repository as Repository6, SaveOptions as SaveOptions6, UpdateResult as UpdateResult6 } from "typeorm";
|
|
235
235
|
import { ILevel } from "@ooneex/gamification";
|
|
@@ -267,7 +267,7 @@ declare class FlashcardSessionEntity extends BaseEntity implements IFlashcardSes
|
|
|
267
267
|
}
|
|
268
268
|
declare class FlashcardSessionRepository {
|
|
269
269
|
private readonly database;
|
|
270
|
-
constructor(database:
|
|
270
|
+
constructor(database: ITypeormDatabase6);
|
|
271
271
|
open(): Promise<Repository6<FlashcardSessionEntity>>;
|
|
272
272
|
close(): Promise<void>;
|
|
273
273
|
find(criteria: FindManyOptions6<FlashcardSessionEntity> & {
|
|
@@ -284,7 +284,7 @@ declare class FlashcardSessionRepository {
|
|
|
284
284
|
delete(criteria: FindOptionsWhere6<FlashcardSessionEntity> | FindOptionsWhere6<FlashcardSessionEntity>[]): Promise<UpdateResult6>;
|
|
285
285
|
count(criteria?: FindOptionsWhere6<FlashcardSessionEntity> | FindOptionsWhere6<FlashcardSessionEntity>[]): Promise<number>;
|
|
286
286
|
}
|
|
287
|
-
import {
|
|
287
|
+
import { ITypeormDatabase as ITypeormDatabase7 } from "@ooneex/database";
|
|
288
288
|
import { FilterResultType as FilterResultType7 } from "@ooneex/types";
|
|
289
289
|
import { FindManyOptions as FindManyOptions7, FindOptionsWhere as FindOptionsWhere7, Repository as Repository7, SaveOptions as SaveOptions7, UpdateResult as UpdateResult7 } from "typeorm";
|
|
290
290
|
import { IFlashcardStats } from "@ooneex/gamification/flashcard";
|
|
@@ -311,7 +311,7 @@ declare class FlashcardStatsEntity extends BaseEntity implements IFlashcardStats
|
|
|
311
311
|
}
|
|
312
312
|
declare class FlashcardStatsRepository {
|
|
313
313
|
private readonly database;
|
|
314
|
-
constructor(database:
|
|
314
|
+
constructor(database: ITypeormDatabase7);
|
|
315
315
|
open(): Promise<Repository7<FlashcardStatsEntity>>;
|
|
316
316
|
close(): Promise<void>;
|
|
317
317
|
find(criteria: FindManyOptions7<FlashcardStatsEntity> & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{g as O,h as P,i as I,j as W,k as q,l as E,m as f}from"../../../../shared/chunk-nfv9ce7v.js";import"../../../../shared/chunk-6kdkyjbn.js";import"../../../../shared/chunk-p22keb3y.js";import"../../../../shared/chunk-6jnj2pfx.js";import"../../../../shared/chunk-x2d798hg.js";import"../../../../shared/chunk-5ybg5hda.js";import"../../../../shared/chunk-xrqhqgen.js";import{Ha as Q,Ia as T,Ja as U}from"../../../../shared/chunk-59vwmfpm.js";import{inject as R}from"@ooneex/container";import{decorator as u}from"@ooneex/repository";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([u.repository(),T(0,R("database")),U("design:paramtypes",[typeof ITypeormDatabase==="undefined"?Object:ITypeormDatabase])],Y);import{inject as F}from"@ooneex/container";import{decorator as g}from"@ooneex/repository";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([g.repository(),T(0,F("database")),U("design:paramtypes",[typeof ITypeormDatabase==="undefined"?Object:ITypeormDatabase])],Z);import{inject as m}from"@ooneex/container";import{decorator as k}from"@ooneex/repository";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([k.repository(),T(0,m("database")),U("design:paramtypes",[typeof ITypeormDatabase==="undefined"?Object:ITypeormDatabase])],_);import{inject as h}from"@ooneex/container";import{decorator as y}from"@ooneex/repository";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([y.repository(),T(0,h("database")),U("design:paramtypes",[typeof ITypeormDatabase==="undefined"?Object:ITypeormDatabase])],$);import{inject as d}from"@ooneex/container";import{decorator as l}from"@ooneex/repository";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([l.repository(),T(0,d("database")),U("design:paramtypes",[typeof ITypeormDatabase==="undefined"?Object:ITypeormDatabase])],v);import{inject as p}from"@ooneex/container";import{decorator as c}from"@ooneex/repository";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([c.repository(),T(0,p("database")),U("design:paramtypes",[typeof ITypeormDatabase==="undefined"?Object:ITypeormDatabase])],D);import{inject as n}from"@ooneex/container";import{decorator as o}from"@ooneex/repository";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([o.repository(),T(0,n("database")),U("design:paramtypes",[typeof ITypeormDatabase==="undefined"?Object:ITypeormDatabase])],b);export{b as FlashcardStatsRepository,D as FlashcardSessionRepository,v as FlashcardScheduleRepository,$ as FlashcardReviewRepository,_ as FlashcardRepository,Z as FlashcardPresetRepository,Y as FlashcardDeckRepository};export{Y as Ka,Z as La,_ as Ma,$ as Na,v as Oa,D as Pa,b as Qa};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=436B4FD4FF4C2C5564756E2164756E21
|