@optimatech88/titomeet-shared-lib 1.1.2 → 1.1.3
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/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/prisma/prisma.module.d.ts +6 -3
- package/dist/prisma/prisma.module.d.ts.map +1 -1
- package/dist/prisma/prisma.module.js +4 -2
- package/dist/prisma/prisma.module.js.map +1 -1
- package/dist/prisma/prisma.service.d.ts +2 -0
- package/dist/prisma/prisma.service.d.ts.map +1 -1
- package/dist/prisma/prisma.service.js +3 -0
- package/dist/prisma/prisma.service.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +4 -7
- package/src/prisma/prisma.module.ts +12 -4
- package/src/prisma/prisma.service.ts +8 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { PrismaClient, Prisma, } from '@generated/prisma/client';
|
|
2
|
-
export type
|
|
3
|
-
export
|
|
2
|
+
export type { User, Account, Address, EventCategory, Event, EventPrice, Chat, ChatUser, Message, Notification, ProviderCategory, Provider, ProviderOnEvent, Review, Favorite, Order, OrderItem, UserInterests, Newsletter, Pricing, Transaction, Feedback, Report, Country, } from '@generated/prisma/client';
|
|
3
|
+
export { AccountType, UserRole, UserStatus, EventType, EventAccess, EventVisibility, EventStatus, TicketHandler, MediaType, NotificationType, ProviderStatus, ProviderOnEventStatus, OrderStatus, PaymentStatus, PricingType, PricingDuration, PaymentMethod, TransactionStatus, } from '@generated/prisma/enums';
|
|
4
4
|
export * from './auth/auth.guard';
|
|
5
5
|
export * from './auth/auth.module';
|
|
6
6
|
export * from './auth/admin.middleware';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,MAAM,GACP,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,MAAM,GACP,MAAM,0BAA0B,CAAC;AAIlC,YAAY,EACV,IAAI,EACJ,OAAO,EACP,OAAO,EACP,aAAa,EACb,KAAK,EACL,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,gBAAgB,EAChB,QAAQ,EACR,eAAe,EACf,MAAM,EACN,QAAQ,EACR,KAAK,EACL,SAAS,EACT,aAAa,EACb,UAAU,EACV,OAAO,EACP,WAAW,EACX,QAAQ,EACR,MAAM,EACN,OAAO,GACR,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,WAAW,EACX,QAAQ,EACR,UAAU,EACV,SAAS,EACT,WAAW,EACX,eAAe,EACf,WAAW,EACX,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,WAAW,EACX,aAAa,EACb,WAAW,EACX,eAAe,EACf,aAAa,EACb,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AAKjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AAGxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAG9B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { PrismaClient, Prisma, } from "./generated/prisma/client";
|
|
2
|
-
export
|
|
2
|
+
export { AccountType, UserRole, UserStatus, EventType, EventAccess, EventVisibility, EventStatus, TicketHandler, MediaType, NotificationType, ProviderStatus, ProviderOnEventStatus, OrderStatus, PaymentStatus, PricingType, PricingDuration, PaymentMethod, TransactionStatus, } from "./generated/prisma/enums";
|
|
3
3
|
export * from './auth/auth.guard';
|
|
4
4
|
export * from './auth/auth.module';
|
|
5
5
|
export * from './auth/admin.middleware';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,MAAM,GACP,kCAAiC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,MAAM,GACP,kCAAiC;AAgClC,OAAO,EACL,WAAW,EACX,QAAQ,EACR,UAAU,EACV,SAAS,EACT,WAAW,EACX,eAAe,EACf,WAAW,EACX,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,WAAW,EACX,aAAa,EACb,WAAW,EACX,eAAe,EACf,aAAa,EACb,iBAAiB,GAClB,iCAAgC;AAKjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AAGxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAG9B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { DynamicModule } from '@nestjs/common';
|
|
2
|
+
export interface PrismaModuleAsyncOptions {
|
|
3
|
+
useFactory: (...args: any[]) => Promise<string> | string;
|
|
4
|
+
inject?: any[];
|
|
5
|
+
imports?: any[];
|
|
6
|
+
}
|
|
2
7
|
export declare class PrismaModule {
|
|
3
8
|
static forRoot(databaseUrl?: string): DynamicModule;
|
|
4
|
-
static forRootAsync(options:
|
|
5
|
-
useFactory: () => Promise<string> | string;
|
|
6
|
-
}): DynamicModule;
|
|
9
|
+
static forRootAsync(options: PrismaModuleAsyncOptions): DynamicModule;
|
|
7
10
|
}
|
|
8
11
|
//# sourceMappingURL=prisma.module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prisma.module.d.ts","sourceRoot":"","sources":["../../src/prisma/prisma.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,aAAa,
|
|
1
|
+
{"version":3,"file":"prisma.module.d.ts","sourceRoot":"","sources":["../../src/prisma/prisma.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,aAAa,EAAQ,MAAM,gBAAgB,CAAC;AAGrE,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IACzD,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;CACjB;AAED,qBAEa,YAAY;IACvB,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,aAAa;IAanD,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,wBAAwB,GAAG,aAAa;CAiBtE"}
|
|
@@ -23,13 +23,15 @@ let PrismaModule = PrismaModule_1 = class PrismaModule {
|
|
|
23
23
|
static forRootAsync(options) {
|
|
24
24
|
return {
|
|
25
25
|
module: PrismaModule_1,
|
|
26
|
+
imports: options.imports || [],
|
|
26
27
|
providers: [
|
|
27
28
|
{
|
|
28
29
|
provide: PrismaService,
|
|
29
|
-
useFactory: async () => {
|
|
30
|
-
const url = await options.useFactory();
|
|
30
|
+
useFactory: async (...args) => {
|
|
31
|
+
const url = await options.useFactory(...args);
|
|
31
32
|
return new PrismaService(url);
|
|
32
33
|
},
|
|
34
|
+
inject: options.inject || [],
|
|
33
35
|
},
|
|
34
36
|
],
|
|
35
37
|
exports: [PrismaService],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prisma.module.js","sourceRoot":"","sources":["../../src/prisma/prisma.module.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"prisma.module.js","sourceRoot":"","sources":["../../src/prisma/prisma.module.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAuB,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAU1C,IAAM,YAAY,oBAAlB,MAAM,YAAY;IACvB,MAAM,CAAC,OAAO,CAAC,WAAoB;QACjC,OAAO;YACL,MAAM,EAAE,cAAY;YACpB,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,aAAa;oBACtB,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,aAAa,CAAC,WAAW,CAAC;iBACjD;aACF;YACD,OAAO,EAAE,CAAC,aAAa,CAAC;SACzB,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,YAAY,CAAC,OAAiC;QACnD,OAAO;YACL,MAAM,EAAE,cAAY;YACpB,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,EAAE;YAC9B,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,aAAa;oBACtB,UAAU,EAAE,KAAK,EAAE,GAAG,IAAW,EAAE,EAAE;wBACnC,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,CAAC;wBAC9C,OAAO,IAAI,aAAa,CAAC,GAAG,CAAC,CAAC;oBAChC,CAAC;oBACD,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;iBAC7B;aACF;YACD,OAAO,EAAE,CAAC,aAAa,CAAC;SACzB,CAAC;IACJ,CAAC;CACF,CAAA;AA/BY,YAAY;IAFxB,MAAM,EAAE;IACR,MAAM,CAAC,EAAE,CAAC;GACE,YAAY,CA+BxB"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { OnModuleDestroy, OnModuleInit } from '@nestjs/common';
|
|
2
2
|
import { PrismaClient } from '@generated/prisma/client';
|
|
3
3
|
export declare class PrismaService extends PrismaClient implements OnModuleInit, OnModuleDestroy {
|
|
4
|
+
private static instance;
|
|
5
|
+
private databaseUrl;
|
|
4
6
|
constructor(databaseUrl?: string);
|
|
5
7
|
onModuleInit(): Promise<void>;
|
|
6
8
|
onModuleDestroy(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prisma.service.d.ts","sourceRoot":"","sources":["../../src/prisma/prisma.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,eAAe,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD,qBACa,aAAc,SAAQ,YAAa,YAAW,YAAY,EAAE,eAAe;
|
|
1
|
+
{"version":3,"file":"prisma.service.d.ts","sourceRoot":"","sources":["../../src/prisma/prisma.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,eAAe,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD,qBACa,aAAc,SAAQ,YAAa,YAAW,YAAY,EAAE,eAAe;IACtF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAgB;IACvC,OAAO,CAAC,WAAW,CAAS;gBAEhB,WAAW,CAAC,EAAE,MAAM;IAe1B,YAAY;IAIZ,eAAe;CAMtB"}
|
|
@@ -11,6 +11,8 @@ import { Injectable } from '@nestjs/common';
|
|
|
11
11
|
import { PrismaClient } from "../generated/prisma/client";
|
|
12
12
|
import { PrismaPg } from '@prisma/adapter-pg';
|
|
13
13
|
let PrismaService = class PrismaService extends PrismaClient {
|
|
14
|
+
static instance;
|
|
15
|
+
databaseUrl;
|
|
14
16
|
constructor(databaseUrl) {
|
|
15
17
|
const url = databaseUrl || process.env.DATABASE_URL;
|
|
16
18
|
if (!url) {
|
|
@@ -20,6 +22,7 @@ let PrismaService = class PrismaService extends PrismaClient {
|
|
|
20
22
|
connectionString: url,
|
|
21
23
|
});
|
|
22
24
|
super({ adapter });
|
|
25
|
+
this.databaseUrl = url;
|
|
23
26
|
}
|
|
24
27
|
async onModuleInit() {
|
|
25
28
|
await this.$connect();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prisma.service.js","sourceRoot":"","sources":["../../src/prisma/prisma.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAiC,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,mCAAiC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAGvC,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,YAAY;
|
|
1
|
+
{"version":3,"file":"prisma.service.js","sourceRoot":"","sources":["../../src/prisma/prisma.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAiC,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,mCAAiC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAGvC,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,YAAY;IACrC,MAAM,CAAC,QAAQ,CAAgB;IAC/B,WAAW,CAAS;IAE5B,YAAY,WAAoB;QAC9B,MAAM,GAAG,GAAG,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;QAEpD,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;QACjD,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,QAAQ,CAAC;YAC3B,gBAAgB,EAAE,GAAG;SACtB,CAAC,CAAC;QAEH,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;QACnB,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,eAAe;QACnB,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;IAC3B,CAAC;CAIF,CAAA;AA7BY,aAAa;IADzB,UAAU,EAAE;;GACA,aAAa,CA6BzB"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -5,14 +5,9 @@ export {
|
|
|
5
5
|
Prisma,
|
|
6
6
|
} from '@generated/prisma/client';
|
|
7
7
|
|
|
8
|
-
// Tous les modèles (types uniquement)
|
|
9
|
-
export type * from '@generated/prisma/client';
|
|
10
8
|
|
|
11
|
-
// Tous les enums (valeurs exportables)
|
|
12
|
-
export * from '@generated/prisma/enums';
|
|
13
9
|
|
|
14
|
-
|
|
15
|
-
/* export type {
|
|
10
|
+
export type {
|
|
16
11
|
User,
|
|
17
12
|
Account,
|
|
18
13
|
Address,
|
|
@@ -59,7 +54,9 @@ export {
|
|
|
59
54
|
PricingDuration,
|
|
60
55
|
PaymentMethod,
|
|
61
56
|
TransactionStatus,
|
|
62
|
-
} from '@generated/prisma/enums';
|
|
57
|
+
} from '@generated/prisma/enums';
|
|
58
|
+
|
|
59
|
+
// export * from '@generated/prisma/client';
|
|
63
60
|
|
|
64
61
|
//auth
|
|
65
62
|
export * from './auth/auth.guard';
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import { Module, Global, DynamicModule } from '@nestjs/common';
|
|
1
|
+
import { Module, Global, DynamicModule, Type } from '@nestjs/common';
|
|
2
2
|
import { PrismaService } from './prisma.service';
|
|
3
3
|
|
|
4
|
+
export interface PrismaModuleAsyncOptions {
|
|
5
|
+
useFactory: (...args: any[]) => Promise<string> | string;
|
|
6
|
+
inject?: any[];
|
|
7
|
+
imports?: any[];
|
|
8
|
+
}
|
|
9
|
+
|
|
4
10
|
@Global()
|
|
5
11
|
@Module({})
|
|
6
12
|
export class PrismaModule {
|
|
@@ -17,16 +23,18 @@ export class PrismaModule {
|
|
|
17
23
|
};
|
|
18
24
|
}
|
|
19
25
|
|
|
20
|
-
static forRootAsync(options:
|
|
26
|
+
static forRootAsync(options: PrismaModuleAsyncOptions): DynamicModule {
|
|
21
27
|
return {
|
|
22
28
|
module: PrismaModule,
|
|
29
|
+
imports: options.imports || [],
|
|
23
30
|
providers: [
|
|
24
31
|
{
|
|
25
32
|
provide: PrismaService,
|
|
26
|
-
useFactory: async () => {
|
|
27
|
-
const url = await options.useFactory();
|
|
33
|
+
useFactory: async (...args: any[]) => {
|
|
34
|
+
const url = await options.useFactory(...args);
|
|
28
35
|
return new PrismaService(url);
|
|
29
36
|
},
|
|
37
|
+
inject: options.inject || [],
|
|
30
38
|
},
|
|
31
39
|
],
|
|
32
40
|
exports: [PrismaService],
|
|
@@ -4,8 +4,10 @@ import { PrismaPg } from '@prisma/adapter-pg';
|
|
|
4
4
|
|
|
5
5
|
@Injectable()
|
|
6
6
|
export class PrismaService extends PrismaClient implements OnModuleInit, OnModuleDestroy {
|
|
7
|
+
private static instance: PrismaService;
|
|
8
|
+
private databaseUrl: string;
|
|
9
|
+
|
|
7
10
|
constructor(databaseUrl?: string) {
|
|
8
|
-
// Utilise l'URL passée en paramètre ou celle du .env
|
|
9
11
|
const url = databaseUrl || process.env.DATABASE_URL;
|
|
10
12
|
|
|
11
13
|
if (!url) {
|
|
@@ -17,6 +19,7 @@ export class PrismaService extends PrismaClient implements OnModuleInit, OnModul
|
|
|
17
19
|
});
|
|
18
20
|
|
|
19
21
|
super({ adapter });
|
|
22
|
+
this.databaseUrl = url;
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
async onModuleInit() {
|
|
@@ -26,4 +29,7 @@ export class PrismaService extends PrismaClient implements OnModuleInit, OnModul
|
|
|
26
29
|
async onModuleDestroy() {
|
|
27
30
|
await this.$disconnect();
|
|
28
31
|
}
|
|
29
|
-
|
|
32
|
+
|
|
33
|
+
// Exposez les modèles explicitement (optionnel, car ils sont déjà accessibles via this)
|
|
34
|
+
// En réalité, this.chatUser, this.report, etc. sont déjà disponibles car PrismaClient les expose
|
|
35
|
+
}
|