@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.
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/ooneex-typeorm-0.0.1.tgz +0 -0
- package/dist/shared/chunk-2e7zbxcq.js +5 -0
- package/dist/shared/chunk-2e7zbxcq.js.map +10 -0
- package/dist/shared/chunk-764bzjhz.js +5 -0
- package/dist/shared/chunk-764bzjhz.js.map +12 -0
- package/dist/shared/chunk-eh420jqn.js +5 -0
- package/dist/shared/chunk-eh420jqn.js.map +15 -0
- package/dist/shared/chunk-gjsgnzaq.js +5 -0
- package/dist/shared/chunk-gjsgnzaq.js.map +10 -0
- package/dist/shared/chunk-hw4vdg6q.js +5 -0
- package/dist/shared/chunk-hw4vdg6q.js.map +10 -0
- package/dist/shared/chunk-j7nprmyh.js +5 -0
- package/dist/shared/chunk-j7nprmyh.js.map +10 -0
- package/dist/shared/chunk-kgxsdeye.js +5 -0
- package/dist/shared/chunk-kgxsdeye.js.map +13 -0
- package/dist/shared/chunk-ntrrrvwt.js +5 -0
- package/dist/shared/chunk-ntrrrvwt.js.map +12 -0
- package/dist/shared/chunk-pwhygf44.js +5 -0
- package/dist/shared/chunk-pwhygf44.js.map +10 -0
- package/dist/shared/chunk-sd6mmec6.js +5 -0
- package/dist/shared/chunk-sd6mmec6.js.map +12 -0
- package/dist/shared/chunk-wawk30n1.js +5 -0
- package/dist/shared/chunk-wawk30n1.js.map +14 -0
- package/dist/shared/chunk-wmftwzcs.js +5 -0
- package/dist/shared/chunk-wmftwzcs.js.map +16 -0
- package/dist/shared/chunk-zmzz7hqq.js +5 -0
- package/dist/shared/chunk-zmzz7hqq.js.map +10 -0
- package/dist/src/entities/book/index.d.ts +62 -0
- package/dist/src/entities/book/index.js +4 -0
- package/dist/src/entities/book/index.js.map +9 -0
- package/dist/src/entities/common/index.d.ts +81 -0
- package/dist/src/entities/common/index.js +4 -0
- package/dist/src/entities/common/index.js.map +9 -0
- package/dist/src/entities/gamification/flashcard/index.d.ts +179 -0
- package/dist/src/entities/gamification/flashcard/index.js +4 -0
- package/dist/src/entities/gamification/flashcard/index.js.map +9 -0
- package/dist/src/entities/gamification/index.d.ts +22 -0
- package/dist/src/entities/gamification/index.js +4 -0
- package/dist/src/entities/gamification/index.js.map +9 -0
- package/dist/src/entities/gamification/mcq/index.d.ts +74 -0
- package/dist/src/entities/gamification/mcq/index.js +4 -0
- package/dist/src/entities/gamification/mcq/index.js.map +9 -0
- package/dist/src/entities/image/index.d.ts +35 -0
- package/dist/src/entities/image/index.js +4 -0
- package/dist/src/entities/image/index.js.map +9 -0
- package/dist/src/entities/payment/index.d.ts +89 -0
- package/dist/src/entities/payment/index.js +4 -0
- package/dist/src/entities/payment/index.js.map +9 -0
- package/dist/src/entities/user/index.d.ts +122 -0
- package/dist/src/entities/user/index.js +4 -0
- package/dist/src/entities/user/index.js.map +9 -0
- package/dist/src/entities/video/index.d.ts +67 -0
- package/dist/src/entities/video/index.js +4 -0
- package/dist/src/entities/video/index.js.map +9 -0
- package/dist/src/repositories/book/index.d.ts +128 -0
- package/dist/src/repositories/book/index.js +4 -0
- package/dist/src/repositories/book/index.js.map +12 -0
- package/dist/src/repositories/common/index.d.ts +210 -0
- package/dist/src/repositories/common/index.js +4 -0
- package/dist/src/repositories/common/index.js.map +15 -0
- package/dist/src/repositories/gamification/flashcard/index.d.ts +330 -0
- package/dist/src/repositories/gamification/flashcard/index.js +4 -0
- package/dist/src/repositories/gamification/flashcard/index.js.map +16 -0
- package/dist/src/repositories/gamification/index.d.ts +506 -0
- package/dist/src/repositories/gamification/index.js +4 -0
- package/dist/src/repositories/gamification/index.js.map +10 -0
- package/dist/src/repositories/gamification/mcq/index.d.ts +163 -0
- package/dist/src/repositories/gamification/mcq/index.js +4 -0
- package/dist/src/repositories/gamification/mcq/index.js.map +13 -0
- package/dist/src/repositories/image/index.d.ts +57 -0
- package/dist/src/repositories/image/index.js +4 -0
- package/dist/src/repositories/image/index.js.map +10 -0
- package/dist/src/repositories/payment/index.d.ts +220 -0
- package/dist/src/repositories/payment/index.js +4 -0
- package/dist/src/repositories/payment/index.js.map +15 -0
- package/dist/src/repositories/user/index.d.ts +245 -0
- package/dist/src/repositories/user/index.js +4 -0
- package/dist/src/repositories/user/index.js.map +14 -0
- package/dist/src/repositories/video/index.d.ts +132 -0
- package/dist/src/repositories/video/index.js +4 -0
- package/dist/src/repositories/video/index.js.map +12 -0
- package/package.json +155 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { IMcqQuestion, IMcqQuestionChoice } from "@ooneex/gamification/mcq";
|
|
2
|
+
import { EMcqQuestionChoiceLetter } from "@ooneex/gamification/mcq";
|
|
3
|
+
import { LocaleType } from "@ooneex/translation";
|
|
4
|
+
import { IBase } from "@ooneex/types";
|
|
5
|
+
declare abstract class BaseEntity implements IBase {
|
|
6
|
+
id: string;
|
|
7
|
+
isLocked?: boolean;
|
|
8
|
+
lockedAt?: Date;
|
|
9
|
+
isBlocked?: boolean;
|
|
10
|
+
blockedAt?: Date;
|
|
11
|
+
blockReason?: string;
|
|
12
|
+
isPublic?: boolean;
|
|
13
|
+
language?: LocaleType;
|
|
14
|
+
createdAt?: Date;
|
|
15
|
+
updatedAt?: Date;
|
|
16
|
+
deletedAt?: Date;
|
|
17
|
+
}
|
|
18
|
+
declare class McqQuestionChoiceEntity extends BaseEntity implements IMcqQuestionChoice {
|
|
19
|
+
letter: EMcqQuestionChoiceLetter;
|
|
20
|
+
text: string;
|
|
21
|
+
isCorrect: boolean;
|
|
22
|
+
explanation?: string;
|
|
23
|
+
question: IMcqQuestion;
|
|
24
|
+
}
|
|
25
|
+
import { IMcqQuestion as IMcqQuestion2, IMcqQuestionChoice as IMcqQuestionChoice2 } from "@ooneex/gamification/mcq";
|
|
26
|
+
import { IImage } from "@ooneex/image";
|
|
27
|
+
import { IStatus } from "@ooneex/status";
|
|
28
|
+
import { ITag } from "@ooneex/tag";
|
|
29
|
+
import { IStat } from "@ooneex/types";
|
|
30
|
+
declare class McqQuestionEntity extends BaseEntity implements IMcqQuestion2 {
|
|
31
|
+
questionNumber: number;
|
|
32
|
+
text: string;
|
|
33
|
+
choices: IMcqQuestionChoice2[];
|
|
34
|
+
context?: string;
|
|
35
|
+
contextId?: string;
|
|
36
|
+
stat?: IStat;
|
|
37
|
+
status?: IStatus;
|
|
38
|
+
image?: IImage;
|
|
39
|
+
tags?: ITag[];
|
|
40
|
+
}
|
|
41
|
+
import { ILevel } from "@ooneex/gamification";
|
|
42
|
+
import { ESessionType } from "@ooneex/gamification";
|
|
43
|
+
import { IMcqQuestion as IMcqQuestion3, IMcqSession } from "@ooneex/gamification/mcq";
|
|
44
|
+
import { EMcqSessionStatus } from "@ooneex/gamification/mcq";
|
|
45
|
+
declare class McqSessionEntity extends BaseEntity implements IMcqSession {
|
|
46
|
+
name: string;
|
|
47
|
+
totalQuestions: number;
|
|
48
|
+
answeredCount: number;
|
|
49
|
+
correctCount: number;
|
|
50
|
+
incorrectCount: number;
|
|
51
|
+
timing: number;
|
|
52
|
+
questions: IMcqQuestion3[];
|
|
53
|
+
status: EMcqSessionStatus;
|
|
54
|
+
score: number;
|
|
55
|
+
startedAt?: Date | null;
|
|
56
|
+
pausedAt?: Date | null;
|
|
57
|
+
resumedAt?: Date | null;
|
|
58
|
+
completedAt?: Date | null;
|
|
59
|
+
type: ESessionType;
|
|
60
|
+
level: ILevel;
|
|
61
|
+
}
|
|
62
|
+
import { EAnswerState } from "@ooneex/gamification";
|
|
63
|
+
import { IMcqQuestion as IMcqQuestion4, IMcqQuestionChoice as IMcqQuestionChoice3, IMcqSession as IMcqSession2, IMcqSessionQuestion } from "@ooneex/gamification/mcq";
|
|
64
|
+
declare class McqSessionQuestionEntity extends BaseEntity implements IMcqSessionQuestion {
|
|
65
|
+
session: IMcqSession2;
|
|
66
|
+
question: IMcqQuestion4;
|
|
67
|
+
questionNumber: number;
|
|
68
|
+
selectedChoices: IMcqQuestionChoice3[];
|
|
69
|
+
context?: string;
|
|
70
|
+
contextId?: string;
|
|
71
|
+
state: EAnswerState;
|
|
72
|
+
score: number;
|
|
73
|
+
}
|
|
74
|
+
export { McqSessionQuestionEntity, McqSessionEntity, McqQuestionEntity, McqQuestionChoiceEntity };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{l as t,m as o,n as e,o as i}from"../../../../shared/chunk-kgxsdeye.js";import"../../../../shared/chunk-hw4vdg6q.js";import"../../../../shared/chunk-2e7zbxcq.js";import"../../../../shared/chunk-764bzjhz.js";import"../../../../shared/chunk-pwhygf44.js";import"../../../../shared/chunk-j7nprmyh.js";export{i as McqSessionQuestionEntity,e as McqSessionEntity,t as McqQuestionEntity,o as McqQuestionChoiceEntity};
|
|
3
|
+
|
|
4
|
+
//# debugId=0CC3DE8D424629BA64756E2164756E21
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IImage, ImageFormatType, ImageMimeType } from "@ooneex/image";
|
|
2
|
+
import { IStatus } from "@ooneex/status";
|
|
3
|
+
import { ITag } from "@ooneex/tag";
|
|
4
|
+
import { ScalarType } from "@ooneex/types";
|
|
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 ImageEntity extends BaseEntity implements IImage {
|
|
21
|
+
url: string;
|
|
22
|
+
width?: number;
|
|
23
|
+
height?: number;
|
|
24
|
+
alt?: string;
|
|
25
|
+
title?: string;
|
|
26
|
+
format?: ImageFormatType;
|
|
27
|
+
mimeType?: ImageMimeType;
|
|
28
|
+
size?: number;
|
|
29
|
+
metadata?: Record<string, ScalarType>;
|
|
30
|
+
context?: string;
|
|
31
|
+
contextId?: string;
|
|
32
|
+
status?: IStatus;
|
|
33
|
+
tags?: ITag[];
|
|
34
|
+
}
|
|
35
|
+
export { ImageEntity };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { CurrencyCodeType } from "@ooneex/currencies";
|
|
2
|
+
import { EDiscountType, ICoupon, IPlan, IProduct } from "@ooneex/payment";
|
|
3
|
+
import { LocaleType } from "@ooneex/translation";
|
|
4
|
+
import { IBase } from "@ooneex/types";
|
|
5
|
+
declare abstract class BaseEntity implements IBase {
|
|
6
|
+
id: string;
|
|
7
|
+
isLocked?: boolean;
|
|
8
|
+
lockedAt?: Date;
|
|
9
|
+
isBlocked?: boolean;
|
|
10
|
+
blockedAt?: Date;
|
|
11
|
+
blockReason?: string;
|
|
12
|
+
isPublic?: boolean;
|
|
13
|
+
language?: LocaleType;
|
|
14
|
+
createdAt?: Date;
|
|
15
|
+
updatedAt?: Date;
|
|
16
|
+
deletedAt?: Date;
|
|
17
|
+
}
|
|
18
|
+
declare class PaymentCouponEntity extends BaseEntity implements ICoupon {
|
|
19
|
+
code: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
discountType: EDiscountType;
|
|
23
|
+
discountValue: number;
|
|
24
|
+
currency?: CurrencyCodeType;
|
|
25
|
+
maxUses?: number;
|
|
26
|
+
usedCount?: number;
|
|
27
|
+
startAt?: Date;
|
|
28
|
+
endAt?: Date;
|
|
29
|
+
isActive?: boolean;
|
|
30
|
+
minimumAmount?: number;
|
|
31
|
+
applicableProducts?: IProduct[];
|
|
32
|
+
applicablePlans?: IPlan[];
|
|
33
|
+
}
|
|
34
|
+
import { CurrencyCodeType as CurrencyCodeType2 } from "@ooneex/currencies";
|
|
35
|
+
import { ICredit } from "@ooneex/payment";
|
|
36
|
+
declare class PaymentCreditEntity extends BaseEntity implements ICredit {
|
|
37
|
+
balance: number;
|
|
38
|
+
currency?: CurrencyCodeType2;
|
|
39
|
+
expiresAt?: Date;
|
|
40
|
+
description?: string;
|
|
41
|
+
}
|
|
42
|
+
import { IFeature } from "@ooneex/payment";
|
|
43
|
+
declare class PaymentFeatureEntity extends BaseEntity implements IFeature {
|
|
44
|
+
name: string;
|
|
45
|
+
description?: string;
|
|
46
|
+
isEnabled?: boolean;
|
|
47
|
+
limit?: number;
|
|
48
|
+
}
|
|
49
|
+
import { CurrencyCodeType as CurrencyCodeType3 } from "@ooneex/currencies";
|
|
50
|
+
import { ESubscriptionPeriod, IFeature as IFeature2, IPlan as IPlan2 } from "@ooneex/payment";
|
|
51
|
+
declare class PaymentPlanEntity extends BaseEntity implements IPlan2 {
|
|
52
|
+
name: string;
|
|
53
|
+
description?: string;
|
|
54
|
+
currency: CurrencyCodeType3;
|
|
55
|
+
price: number;
|
|
56
|
+
period: ESubscriptionPeriod;
|
|
57
|
+
periodCount?: number;
|
|
58
|
+
features?: IFeature2[];
|
|
59
|
+
isActive?: boolean;
|
|
60
|
+
trialDays?: number;
|
|
61
|
+
}
|
|
62
|
+
import { ICategory } from "@ooneex/category";
|
|
63
|
+
import { CurrencyCodeType as CurrencyCodeType4 } from "@ooneex/currencies";
|
|
64
|
+
import { IImage } from "@ooneex/image";
|
|
65
|
+
import { IProduct as IProduct2 } from "@ooneex/payment";
|
|
66
|
+
import { ITag } from "@ooneex/tag";
|
|
67
|
+
import { ScalarType } from "@ooneex/types";
|
|
68
|
+
declare class PaymentProductEntity extends BaseEntity implements IProduct2 {
|
|
69
|
+
name: string;
|
|
70
|
+
description?: string;
|
|
71
|
+
categories?: ICategory[];
|
|
72
|
+
currency: CurrencyCodeType4;
|
|
73
|
+
price: number;
|
|
74
|
+
barcode?: string;
|
|
75
|
+
images?: IImage[];
|
|
76
|
+
attributes?: Record<string, ScalarType>;
|
|
77
|
+
tags?: ITag[];
|
|
78
|
+
}
|
|
79
|
+
import { ICoupon as ICoupon2, ICredit as ICredit2, IPlan as IPlan3, ISubscription } from "@ooneex/payment";
|
|
80
|
+
declare class PaymentSubscriptionEntity extends BaseEntity implements Omit<ISubscription, "isActive"> {
|
|
81
|
+
coupons?: ICoupon2[];
|
|
82
|
+
plans?: IPlan3[];
|
|
83
|
+
credits?: ICredit2[];
|
|
84
|
+
startAt: Date;
|
|
85
|
+
endAt?: Date;
|
|
86
|
+
isTrial?: boolean;
|
|
87
|
+
isActive?: boolean;
|
|
88
|
+
}
|
|
89
|
+
export { PaymentSubscriptionEntity, PaymentProductEntity, PaymentPlanEntity, PaymentFeatureEntity, PaymentCreditEntity, PaymentCouponEntity };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{t,u as o,v as r,w as e,x as n,y as m}from"../../../shared/chunk-eh420jqn.js";import"../../../shared/chunk-zmzz7hqq.js";import"../../../shared/chunk-2e7zbxcq.js";import"../../../shared/chunk-764bzjhz.js";import"../../../shared/chunk-j7nprmyh.js";export{m as PaymentSubscriptionEntity,r as PaymentProductEntity,o as PaymentPlanEntity,t as PaymentFeatureEntity,n as PaymentCreditEntity,e as PaymentCouponEntity};
|
|
3
|
+
|
|
4
|
+
//# debugId=05887E0B4A354B5A64756E2164756E21
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { IAccount, IUser } from "@ooneex/user";
|
|
2
|
+
import { EAccountType } from "@ooneex/user";
|
|
3
|
+
import { LocaleType } from "@ooneex/translation";
|
|
4
|
+
import { IBase } from "@ooneex/types";
|
|
5
|
+
declare abstract class BaseEntity implements IBase {
|
|
6
|
+
id: string;
|
|
7
|
+
isLocked?: boolean;
|
|
8
|
+
lockedAt?: Date;
|
|
9
|
+
isBlocked?: boolean;
|
|
10
|
+
blockedAt?: Date;
|
|
11
|
+
blockReason?: string;
|
|
12
|
+
isPublic?: boolean;
|
|
13
|
+
language?: LocaleType;
|
|
14
|
+
createdAt?: Date;
|
|
15
|
+
updatedAt?: Date;
|
|
16
|
+
deletedAt?: Date;
|
|
17
|
+
}
|
|
18
|
+
declare class AccountEntity extends BaseEntity implements IAccount {
|
|
19
|
+
provider?: string;
|
|
20
|
+
providerAccountId?: string;
|
|
21
|
+
type: EAccountType;
|
|
22
|
+
password?: string;
|
|
23
|
+
accessToken?: string;
|
|
24
|
+
accessTokenExpiresAt?: Date;
|
|
25
|
+
refreshToken?: string;
|
|
26
|
+
refreshTokenExpiresAt?: Date;
|
|
27
|
+
expiresAt?: Date;
|
|
28
|
+
tokenType?: string;
|
|
29
|
+
scope?: string;
|
|
30
|
+
idToken?: string;
|
|
31
|
+
sessionState?: string;
|
|
32
|
+
email?: string;
|
|
33
|
+
emailVerified?: boolean;
|
|
34
|
+
name?: string;
|
|
35
|
+
picture?: string;
|
|
36
|
+
profile?: Record<string, unknown>;
|
|
37
|
+
user?: IUser;
|
|
38
|
+
}
|
|
39
|
+
import { ISession, IUser as IUser2 } from "@ooneex/user";
|
|
40
|
+
declare class SessionEntity extends BaseEntity implements ISession {
|
|
41
|
+
token: string;
|
|
42
|
+
refreshToken?: string;
|
|
43
|
+
userAgent?: string;
|
|
44
|
+
ipAddress?: string;
|
|
45
|
+
deviceType?: string;
|
|
46
|
+
deviceName?: string;
|
|
47
|
+
browser?: string;
|
|
48
|
+
operatingSystem?: string;
|
|
49
|
+
location?: string;
|
|
50
|
+
isActive: boolean;
|
|
51
|
+
expiresAt: Date;
|
|
52
|
+
lastAccessAt?: Date;
|
|
53
|
+
revokedAt?: Date;
|
|
54
|
+
revokedReason?: string;
|
|
55
|
+
user?: IUser2;
|
|
56
|
+
}
|
|
57
|
+
import { IImage } from "@ooneex/image";
|
|
58
|
+
import { ERole } from "@ooneex/role";
|
|
59
|
+
import { IAccount as IAccount2, ISession as ISession2, IUser as IUser3, IVerification } from "@ooneex/user";
|
|
60
|
+
declare class UserEntity extends BaseEntity implements IUser3 {
|
|
61
|
+
email: string;
|
|
62
|
+
roles: ERole[];
|
|
63
|
+
name?: string;
|
|
64
|
+
lastName?: string;
|
|
65
|
+
firstName?: string;
|
|
66
|
+
username?: string;
|
|
67
|
+
avatar?: IImage;
|
|
68
|
+
bio?: string;
|
|
69
|
+
phone?: string;
|
|
70
|
+
birthDate?: Date;
|
|
71
|
+
timezone?: string;
|
|
72
|
+
isEmailVerified?: boolean;
|
|
73
|
+
isPhoneVerified?: boolean;
|
|
74
|
+
lastActiveAt?: Date;
|
|
75
|
+
emailVerifiedAt?: Date;
|
|
76
|
+
phoneVerifiedAt?: Date;
|
|
77
|
+
lastLoginAt?: Date;
|
|
78
|
+
passwordChangedAt?: Date;
|
|
79
|
+
twoFactorEnabled?: boolean;
|
|
80
|
+
twoFactorSecret?: string;
|
|
81
|
+
recoveryTokens?: string[];
|
|
82
|
+
sessions?: ISession2[];
|
|
83
|
+
accounts?: IAccount2[];
|
|
84
|
+
verifications?: IVerification[];
|
|
85
|
+
}
|
|
86
|
+
import { IUser as IUser4, IUserProfileUpdate, IVerification as IVerification2 } from "@ooneex/user";
|
|
87
|
+
import { EProfileUpdateStatus } from "@ooneex/user";
|
|
88
|
+
declare class UserProfileUpdateEntity extends BaseEntity implements IUserProfileUpdate {
|
|
89
|
+
changedFields: string[];
|
|
90
|
+
previousValues?: Record<string, unknown>;
|
|
91
|
+
newValues?: Record<string, unknown>;
|
|
92
|
+
updateReason?: string;
|
|
93
|
+
ipAddress?: string;
|
|
94
|
+
userAgent?: string;
|
|
95
|
+
requiresVerification?: boolean;
|
|
96
|
+
status: EProfileUpdateStatus;
|
|
97
|
+
appliedAt?: Date;
|
|
98
|
+
metadata?: Record<string, unknown>;
|
|
99
|
+
description?: string;
|
|
100
|
+
user?: IUser4;
|
|
101
|
+
verification?: IVerification2;
|
|
102
|
+
}
|
|
103
|
+
import { IUser as IUser5, IVerification as IVerification3 } from "@ooneex/user";
|
|
104
|
+
import { EVerificationType } from "@ooneex/user";
|
|
105
|
+
declare class VerificationEntity extends BaseEntity implements IVerification3 {
|
|
106
|
+
email?: string;
|
|
107
|
+
phone?: string;
|
|
108
|
+
token: string;
|
|
109
|
+
type: EVerificationType;
|
|
110
|
+
code?: string;
|
|
111
|
+
isUsed: boolean;
|
|
112
|
+
usedAt?: Date;
|
|
113
|
+
expiresAt: Date;
|
|
114
|
+
attemptsCount: number;
|
|
115
|
+
maxAttempts: number;
|
|
116
|
+
ipAddress?: string;
|
|
117
|
+
userAgent?: string;
|
|
118
|
+
metadata?: Record<string, unknown>;
|
|
119
|
+
description?: string;
|
|
120
|
+
user?: IUser5;
|
|
121
|
+
}
|
|
122
|
+
export { VerificationEntity, UserProfileUpdateEntity, UserEntity, SessionEntity, AccountEntity };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{D as t,E as o,F as r,G as e,H as i}from"../../../shared/chunk-wawk30n1.js";import"../../../shared/chunk-2e7zbxcq.js";import"../../../shared/chunk-764bzjhz.js";import"../../../shared/chunk-j7nprmyh.js";export{e as VerificationEntity,i as UserProfileUpdateEntity,t as UserEntity,r as SessionEntity,o as AccountEntity};
|
|
3
|
+
|
|
4
|
+
//# debugId=DD4C0370040D943E64756E2164756E21
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ICategory } from "@ooneex/category";
|
|
2
|
+
import { IStatus } from "@ooneex/status";
|
|
3
|
+
import { ITag } from "@ooneex/tag";
|
|
4
|
+
import { AudioChannelsType, AudioCodecType, EVideoCodec, EVideoFormat, EVideoQuality, EVideoResolution, IVideo } from "@ooneex/video";
|
|
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 VideoEntity extends BaseEntity implements IVideo {
|
|
21
|
+
title: string;
|
|
22
|
+
subtitle?: string;
|
|
23
|
+
releaseDate?: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
duration?: number;
|
|
26
|
+
category?: ICategory;
|
|
27
|
+
genres?: string[];
|
|
28
|
+
size?: number;
|
|
29
|
+
url?: string;
|
|
30
|
+
posterImage?: string;
|
|
31
|
+
thumbnailImage?: string;
|
|
32
|
+
resolution?: EVideoResolution;
|
|
33
|
+
quality?: EVideoQuality;
|
|
34
|
+
format?: EVideoFormat;
|
|
35
|
+
codec?: EVideoCodec;
|
|
36
|
+
bitrate?: number;
|
|
37
|
+
frameRate?: number;
|
|
38
|
+
audioCodec?: AudioCodecType;
|
|
39
|
+
audioChannels?: AudioChannelsType;
|
|
40
|
+
averageRating?: number;
|
|
41
|
+
ratingsCount?: number;
|
|
42
|
+
contentRating?: string;
|
|
43
|
+
context?: string;
|
|
44
|
+
contextId?: string;
|
|
45
|
+
tags?: ITag[];
|
|
46
|
+
status?: IStatus;
|
|
47
|
+
}
|
|
48
|
+
import { IStatus as IStatus2 } from "@ooneex/status";
|
|
49
|
+
import { ITag as ITag2 } from "@ooneex/tag";
|
|
50
|
+
import { IPlaylist, IVideo as IVideo2 } from "@ooneex/video";
|
|
51
|
+
declare class VideoPlaylistEntity extends BaseEntity implements IPlaylist {
|
|
52
|
+
name: string;
|
|
53
|
+
description?: string;
|
|
54
|
+
videos?: IVideo2[];
|
|
55
|
+
tags?: ITag2[];
|
|
56
|
+
status?: IStatus2;
|
|
57
|
+
}
|
|
58
|
+
import { IVideo as IVideo3, IVideoProgress } from "@ooneex/video";
|
|
59
|
+
declare class VideoProgressEntity extends BaseEntity implements IVideoProgress {
|
|
60
|
+
video?: IVideo3;
|
|
61
|
+
userId: string;
|
|
62
|
+
currentTime: number;
|
|
63
|
+
duration?: number;
|
|
64
|
+
completed?: boolean;
|
|
65
|
+
lastWatched?: string;
|
|
66
|
+
}
|
|
67
|
+
export { VideoProgressEntity, VideoPlaylistEntity, VideoEntity };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{A as t,B as r,z as o}from"../../../shared/chunk-sd6mmec6.js";import"../../../shared/chunk-zmzz7hqq.js";import"../../../shared/chunk-764bzjhz.js";import"../../../shared/chunk-j7nprmyh.js";export{r as VideoProgressEntity,t as VideoPlaylistEntity,o as VideoEntity};
|
|
3
|
+
|
|
4
|
+
//# debugId=761CBA5C379576F764756E2164756E21
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { ITypeormDatabaseAdapter } from "@ooneex/database";
|
|
2
|
+
import { FilterResultType } from "@ooneex/types";
|
|
3
|
+
import { FindManyOptions, FindOptionsWhere, Repository, SaveOptions, UpdateResult } from "typeorm";
|
|
4
|
+
import { IAuthor } from "@ooneex/book";
|
|
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 BookAuthorEntity extends BaseEntity implements IAuthor {
|
|
21
|
+
firstName: string;
|
|
22
|
+
lastName: string;
|
|
23
|
+
fullName?: string;
|
|
24
|
+
bio?: string;
|
|
25
|
+
birthDate?: string;
|
|
26
|
+
deathDate?: string;
|
|
27
|
+
nationality?: string;
|
|
28
|
+
}
|
|
29
|
+
declare class BookAuthorRepository {
|
|
30
|
+
private readonly database;
|
|
31
|
+
constructor(database: ITypeormDatabaseAdapter);
|
|
32
|
+
open(): Promise<Repository<BookAuthorEntity>>;
|
|
33
|
+
close(): Promise<void>;
|
|
34
|
+
find(criteria: FindManyOptions<BookAuthorEntity> & {
|
|
35
|
+
page?: number;
|
|
36
|
+
limit?: number;
|
|
37
|
+
q?: string;
|
|
38
|
+
}): Promise<FilterResultType<BookAuthorEntity>>;
|
|
39
|
+
findOne(id: string): Promise<BookAuthorEntity | null>;
|
|
40
|
+
findOneBy(criteria: FindOptionsWhere<BookAuthorEntity>): Promise<BookAuthorEntity | null>;
|
|
41
|
+
create(entity: BookAuthorEntity, options?: SaveOptions): Promise<BookAuthorEntity>;
|
|
42
|
+
createMany(entities: BookAuthorEntity[], options?: SaveOptions): Promise<BookAuthorEntity[]>;
|
|
43
|
+
update(entity: BookAuthorEntity, options?: SaveOptions): Promise<BookAuthorEntity>;
|
|
44
|
+
updateMany(entities: BookAuthorEntity[], options?: SaveOptions): Promise<BookAuthorEntity[]>;
|
|
45
|
+
delete(criteria: FindOptionsWhere<BookAuthorEntity> | FindOptionsWhere<BookAuthorEntity>[]): Promise<UpdateResult>;
|
|
46
|
+
count(criteria?: FindOptionsWhere<BookAuthorEntity> | FindOptionsWhere<BookAuthorEntity>[]): Promise<number>;
|
|
47
|
+
}
|
|
48
|
+
import { ITypeormDatabaseAdapter as ITypeormDatabaseAdapter2 } from "@ooneex/database";
|
|
49
|
+
import { FilterResultType as FilterResultType2 } from "@ooneex/types";
|
|
50
|
+
import { FindManyOptions as FindManyOptions2, FindOptionsWhere as FindOptionsWhere2, Repository as Repository2, SaveOptions as SaveOptions2, UpdateResult as UpdateResult2 } from "typeorm";
|
|
51
|
+
import { IPublisher } from "@ooneex/book";
|
|
52
|
+
declare class BookPublisherEntity extends BaseEntity implements IPublisher {
|
|
53
|
+
name: string;
|
|
54
|
+
address?: string;
|
|
55
|
+
website?: string;
|
|
56
|
+
foundedYear?: number;
|
|
57
|
+
}
|
|
58
|
+
declare class BookPublisherRepository {
|
|
59
|
+
private readonly database;
|
|
60
|
+
constructor(database: ITypeormDatabaseAdapter2);
|
|
61
|
+
open(): Promise<Repository2<BookPublisherEntity>>;
|
|
62
|
+
close(): Promise<void>;
|
|
63
|
+
find(criteria: FindManyOptions2<BookPublisherEntity> & {
|
|
64
|
+
page?: number;
|
|
65
|
+
limit?: number;
|
|
66
|
+
q?: string;
|
|
67
|
+
}): Promise<FilterResultType2<BookPublisherEntity>>;
|
|
68
|
+
findOne(id: string): Promise<BookPublisherEntity | null>;
|
|
69
|
+
findOneBy(criteria: FindOptionsWhere2<BookPublisherEntity>): Promise<BookPublisherEntity | null>;
|
|
70
|
+
create(entity: BookPublisherEntity, options?: SaveOptions2): Promise<BookPublisherEntity>;
|
|
71
|
+
createMany(entities: BookPublisherEntity[], options?: SaveOptions2): Promise<BookPublisherEntity[]>;
|
|
72
|
+
update(entity: BookPublisherEntity, options?: SaveOptions2): Promise<BookPublisherEntity>;
|
|
73
|
+
updateMany(entities: BookPublisherEntity[], options?: SaveOptions2): Promise<BookPublisherEntity[]>;
|
|
74
|
+
delete(criteria: FindOptionsWhere2<BookPublisherEntity> | FindOptionsWhere2<BookPublisherEntity>[]): Promise<UpdateResult2>;
|
|
75
|
+
count(criteria?: FindOptionsWhere2<BookPublisherEntity> | FindOptionsWhere2<BookPublisherEntity>[]): Promise<number>;
|
|
76
|
+
}
|
|
77
|
+
import { ITypeormDatabaseAdapter as ITypeormDatabaseAdapter3 } from "@ooneex/database";
|
|
78
|
+
import { FilterResultType as FilterResultType3 } from "@ooneex/types";
|
|
79
|
+
import { FindManyOptions as FindManyOptions3, FindOptionsWhere as FindOptionsWhere3, Repository as Repository3, SaveOptions as SaveOptions3, UpdateResult as UpdateResult3 } from "typeorm";
|
|
80
|
+
import { IAuthor as IAuthor2, IBook, IPublisher as IPublisher2 } from "@ooneex/book";
|
|
81
|
+
import { ICategory } from "@ooneex/category";
|
|
82
|
+
import { IStatus } from "@ooneex/status";
|
|
83
|
+
import { ITag } from "@ooneex/tag";
|
|
84
|
+
declare class BookEntity extends BaseEntity implements IBook {
|
|
85
|
+
title: string;
|
|
86
|
+
subtitle?: string;
|
|
87
|
+
authors?: IAuthor2[];
|
|
88
|
+
isbn?: string;
|
|
89
|
+
isbn13?: string;
|
|
90
|
+
publisher?: IPublisher2;
|
|
91
|
+
publishedDate?: string;
|
|
92
|
+
description?: string;
|
|
93
|
+
pageCount?: number;
|
|
94
|
+
category?: ICategory;
|
|
95
|
+
genres?: string[];
|
|
96
|
+
size?: number;
|
|
97
|
+
url?: string;
|
|
98
|
+
coverImage?: string;
|
|
99
|
+
context?: string;
|
|
100
|
+
contextId?: string;
|
|
101
|
+
averageRating?: number;
|
|
102
|
+
ratingsCount?: number;
|
|
103
|
+
edition?: string;
|
|
104
|
+
series?: string;
|
|
105
|
+
seriesVolume?: number;
|
|
106
|
+
tags?: ITag[];
|
|
107
|
+
status?: IStatus;
|
|
108
|
+
}
|
|
109
|
+
declare class BookRepository {
|
|
110
|
+
private readonly database;
|
|
111
|
+
constructor(database: ITypeormDatabaseAdapter3);
|
|
112
|
+
open(): Promise<Repository3<BookEntity>>;
|
|
113
|
+
close(): Promise<void>;
|
|
114
|
+
find(criteria: FindManyOptions3<BookEntity> & {
|
|
115
|
+
page?: number;
|
|
116
|
+
limit?: number;
|
|
117
|
+
q?: string;
|
|
118
|
+
}): Promise<FilterResultType3<BookEntity>>;
|
|
119
|
+
findOne(id: string): Promise<BookEntity | null>;
|
|
120
|
+
findOneBy(criteria: FindOptionsWhere3<BookEntity>): Promise<BookEntity | null>;
|
|
121
|
+
create(entity: BookEntity, options?: SaveOptions3): Promise<BookEntity>;
|
|
122
|
+
createMany(entities: BookEntity[], options?: SaveOptions3): Promise<BookEntity[]>;
|
|
123
|
+
update(entity: BookEntity, options?: SaveOptions3): Promise<BookEntity>;
|
|
124
|
+
updateMany(entities: BookEntity[], options?: SaveOptions3): Promise<BookEntity[]>;
|
|
125
|
+
delete(criteria: FindOptionsWhere3<BookEntity> | FindOptionsWhere3<BookEntity>[]): Promise<UpdateResult3>;
|
|
126
|
+
count(criteria?: FindOptionsWhere3<BookEntity> | FindOptionsWhere3<BookEntity>[]): Promise<number>;
|
|
127
|
+
}
|
|
128
|
+
export { BookRepository, BookPublisherRepository, BookAuthorRepository };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{p as w,q as A,r as W}from"../../../shared/chunk-ntrrrvwt.js";import"../../../shared/chunk-zmzz7hqq.js";import"../../../shared/chunk-764bzjhz.js";import{V as S,W as T,X as U}from"../../../shared/chunk-j7nprmyh.js";import{inject as f}from"@ooneex/container";import{ILike as Q}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 v=await this.open(),{page:z=1,limit:D=100,q:F,...G}=x,H,K=D===0?100:D;if(z&&z>0&&D&&D>0)H=(z-1)*K;let J={...G,take:K,...H!==void 0&&{skip:H}};if(F){let Y=[{firstName:Q(`%${F}%`)},{lastName:Q(`%${F}%`)},{fullName:Q(`%${F}%`)}];J={...J,where:G.where?[...Y.map((j)=>({...G.where,...j}))]:Y}}let V=await v.find(J),M=G.where;if(F){let Y=[{firstName:Q(`%${F}%`)},{lastName:Q(`%${F}%`)},{fullName:Q(`%${F}%`)}];M=G.where?[...Y.map((j)=>({...G.where,...j}))]:Y}let N=await this.count(M),X=Math.ceil(N/D);return{resources:V,total:N,totalPages:X,page:z,limit:D}}async findOne(x){return await(await this.open()).findOne({where:{id:x}})}async findOneBy(x){return await(await this.open()).findOne({where:x})}async create(x,v){return await(await this.open()).save(x,v)}async createMany(x,v){return await(await this.open()).save(x,v)}async update(x,v){return await this.create(x,v)}async updateMany(x,v){return await this.createMany(x,v)}async delete(x){return await(await this.open()).softDelete(x)}async count(x){return await(await this.open()).count(x?{where:x}:{})}}Z=S([T(0,f("database")),U("design:paramtypes",[typeof ITypeormDatabaseAdapter==="undefined"?Object:ITypeormDatabaseAdapter])],Z);import{inject as P}from"@ooneex/container";import{ILike as C}from"typeorm";class _{database;constructor(x){this.database=x}async open(){return await this.database.open(A)}async close(){await this.database.close()}async find(x){let v=await this.open(),{page:z=1,limit:D=100,q:F,...G}=x,H,K=D===0?100:D;if(z&&z>0&&D&&D>0)H=(z-1)*K;let J={...G,take:K,...H!==void 0&&{skip:H}};if(F)J={...J,where:{...G.where,name:C(`%${F}%`)}};let V=await v.find(J),M=G.where;if(F)M={...G.where,name:C(`%${F}%`)};let N=await this.count(M),X=Math.ceil(N/D);return{resources:V,total:N,totalPages:X,page:z,limit:D}}async findOne(x){return await(await this.open()).findOne({where:{id:x}})}async findOneBy(x){return await(await this.open()).findOne({where:x})}async create(x,v){return await(await this.open()).save(x,v)}async createMany(x,v){return await(await this.open()).save(x,v)}async update(x,v){return await this.create(x,v)}async updateMany(x,v){return await this.createMany(x,v)}async delete(x){return await(await this.open()).softDelete(x)}async count(x){return await(await this.open()).count(x?{where:x}:{})}}_=S([T(0,P("database")),U("design:paramtypes",[typeof ITypeormDatabaseAdapter==="undefined"?Object:ITypeormDatabaseAdapter])],_);import{inject as O}from"@ooneex/container";import{ILike as E}from"typeorm";class ${database;constructor(x){this.database=x}async open(){return await this.database.open(W)}async close(){await this.database.close()}async find(x){let v=await this.open(),{page:z=1,limit:D=100,q:F,...G}=x,H,K=D===0?100:D;if(z&&z>0&&D&&D>0)H=(z-1)*K;let J={...G,take:K,...H!==void 0&&{skip:H}};if(F)J={...J,where:{...G.where,title:E(`%${F}%`)}};let V=await v.find(J),M=G.where;if(F)M={...G.where,title:E(`%${F}%`)};let N=await this.count(M),X=Math.ceil(N/D);return{resources:V,total:N,totalPages:X,page:z,limit:D}}async findOne(x){return await(await this.open()).findOne({where:{id:x}})}async findOneBy(x){return await(await this.open()).findOne({where:x})}async create(x,v){return await(await this.open()).save(x,v)}async createMany(x,v){return await(await this.open()).save(x,v)}async update(x,v){return await this.create(x,v)}async updateMany(x,v){return await this.createMany(x,v)}async delete(x){return await(await this.open()).softDelete(x)}async count(x){return await(await this.open()).count(x?{where:x}:{})}}$=S([T(0,O("database")),U("design:paramtypes",[typeof ITypeormDatabaseAdapter==="undefined"?Object:ITypeormDatabaseAdapter])],$);export{$ as BookRepository,_ as BookPublisherRepository,Z as BookAuthorRepository};
|
|
3
|
+
|
|
4
|
+
//# debugId=A064E4DA98E6E23864756E2164756E21
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["src/repositories/book/BookAuthorRepository.ts", "src/repositories/book/BookPublisherRepository.ts", "src/repositories/book/BookRepository.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 { BookAuthorEntity } from \"../../entities/book/BookAuthorEntity\";\n\nexport class BookAuthorRepository {\n constructor(\n @inject(\"database\")\n private readonly database: ITypeormDatabaseAdapter,\n ) {}\n\n public async open(): Promise<Repository<BookAuthorEntity>> {\n return await this.database.open(BookAuthorEntity);\n }\n\n public async close(): Promise<void> {\n await this.database.close();\n }\n\n public async find(\n criteria: FindManyOptions<BookAuthorEntity> & { page?: number; limit?: number; q?: string },\n ): Promise<FilterResultType<BookAuthorEntity>> {\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 author name search if q parameter is provided\n let findOptions = { ...rest, take, ...(skip !== undefined && { skip }) };\n if (q) {\n const searchConditions = [\n { firstName: ILike(`%${q}%`) },\n { lastName: ILike(`%${q}%`) },\n { fullName: ILike(`%${q}%`) },\n ];\n\n findOptions = {\n ...findOptions,\n where: rest.where\n ? [...searchConditions.map((condition) => ({ ...rest.where, ...condition }))]\n : searchConditions,\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 const searchConditions = [\n { firstName: ILike(`%${q}%`) },\n { lastName: ILike(`%${q}%`) },\n { fullName: ILike(`%${q}%`) },\n ];\n\n countWhere = rest.where\n ? [...searchConditions.map((condition) => ({ ...rest.where, ...condition }))]\n : searchConditions;\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<BookAuthorEntity | 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<BookAuthorEntity>): Promise<BookAuthorEntity | null> {\n const repository = await this.open();\n\n return await repository.findOne({\n where: criteria,\n });\n }\n\n public async create(entity: BookAuthorEntity, options?: SaveOptions): Promise<BookAuthorEntity> {\n const repository = await this.open();\n\n return await repository.save(entity, options);\n }\n\n public async createMany(entities: BookAuthorEntity[], options?: SaveOptions): Promise<BookAuthorEntity[]> {\n const repository = await this.open();\n\n return await repository.save(entities, options);\n }\n\n public async update(entity: BookAuthorEntity, options?: SaveOptions): Promise<BookAuthorEntity> {\n return await this.create(entity, options);\n }\n\n public async updateMany(entities: BookAuthorEntity[], options?: SaveOptions): Promise<BookAuthorEntity[]> {\n return await this.createMany(entities, options);\n }\n\n public async delete(\n criteria: FindOptionsWhere<BookAuthorEntity> | FindOptionsWhere<BookAuthorEntity>[],\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<BookAuthorEntity> | FindOptionsWhere<BookAuthorEntity>[],\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 { BookPublisherEntity } from \"../../entities/book/BookPublisherEntity\";\n\nexport class BookPublisherRepository {\n constructor(\n @inject(\"database\")\n private readonly database: ITypeormDatabaseAdapter,\n ) {}\n\n public async open(): Promise<Repository<BookPublisherEntity>> {\n return await this.database.open(BookPublisherEntity);\n }\n\n public async close(): Promise<void> {\n await this.database.close();\n }\n\n public async find(\n criteria: FindManyOptions<BookPublisherEntity> & { page?: number; limit?: number; q?: string },\n ): Promise<FilterResultType<BookPublisherEntity>> {\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 publisher 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<BookPublisherEntity | 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<BookPublisherEntity>): Promise<BookPublisherEntity | null> {\n const repository = await this.open();\n\n return await repository.findOne({\n where: criteria,\n });\n }\n\n public async create(entity: BookPublisherEntity, options?: SaveOptions): Promise<BookPublisherEntity> {\n const repository = await this.open();\n\n return await repository.save(entity, options);\n }\n\n public async createMany(entities: BookPublisherEntity[], options?: SaveOptions): Promise<BookPublisherEntity[]> {\n const repository = await this.open();\n\n return await repository.save(entities, options);\n }\n\n public async update(entity: BookPublisherEntity, options?: SaveOptions): Promise<BookPublisherEntity> {\n return await this.create(entity, options);\n }\n\n public async updateMany(entities: BookPublisherEntity[], options?: SaveOptions): Promise<BookPublisherEntity[]> {\n return await this.createMany(entities, options);\n }\n\n public async delete(\n criteria: FindOptionsWhere<BookPublisherEntity> | FindOptionsWhere<BookPublisherEntity>[],\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<BookPublisherEntity> | FindOptionsWhere<BookPublisherEntity>[],\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 { BookEntity } from \"../../entities/book/BookEntity\";\n\nexport class BookRepository {\n constructor(\n @inject(\"database\")\n private readonly database: ITypeormDatabaseAdapter,\n ) {}\n\n public async open(): Promise<Repository<BookEntity>> {\n return await this.database.open(BookEntity);\n }\n\n public async close(): Promise<void> {\n await this.database.close();\n }\n\n public async find(\n criteria: FindManyOptions<BookEntity> & { page?: number; limit?: number; q?: string },\n ): Promise<FilterResultType<BookEntity>> {\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 title 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 title: ILike(`%${q}%`),\n },\n };\n }\n\n const result = await repository.find(findOptions);\n\n // Apply the same where conditions for count including title search\n let countWhere = rest.where;\n if (q) {\n countWhere = {\n ...rest.where,\n title: 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<BookEntity | 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<BookEntity>): Promise<BookEntity | null> {\n const repository = await this.open();\n\n return await repository.findOne({\n where: criteria,\n });\n }\n\n public async create(entity: BookEntity, options?: SaveOptions): Promise<BookEntity> {\n const repository = await this.open();\n\n return await repository.save(entity, options);\n }\n\n public async createMany(entities: BookEntity[], options?: SaveOptions): Promise<BookEntity[]> {\n const repository = await this.open();\n\n return await repository.save(entities, options);\n }\n\n public async update(entity: BookEntity, options?: SaveOptions): Promise<BookEntity> {\n return await this.create(entity, options);\n }\n\n public async updateMany(entities: BookEntity[], options?: SaveOptions): Promise<BookEntity[]> {\n return await this.createMany(entities, options);\n }\n\n public async delete(criteria: FindOptionsWhere<BookEntity> | FindOptionsWhere<BookEntity>[]): Promise<UpdateResult> {\n const repository = await this.open();\n\n return await repository.softDelete(criteria);\n }\n\n public async count(criteria?: FindOptionsWhere<BookEntity> | FindOptionsWhere<BookEntity>[]): Promise<number> {\n const repository = await this.open();\n\n return await repository.count(criteria ? { where: criteria } : {});\n }\n}\n"
|
|
8
|
+
],
|
|
9
|
+
"mappings": ";oMAAA,yBAAS,kCAIT,wBAAS,gBAGF,MAAM,CAAqB,CAGb,SAFnB,WAAW,CAEQ,EACjB,CADiB,qBAGN,KAAI,EAA0C,CACzD,OAAO,MAAM,KAAK,SAAS,K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