@optimatech88/titomeet-shared-lib 1.1.2 → 1.1.4
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 +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- 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 +3 -1
- package/dist/prisma/prisma.service.d.ts.map +1 -1
- package/dist/prisma/prisma.service.js +4 -1
- package/dist/prisma/prisma.service.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +6 -9
- package/src/prisma/prisma.module.ts +12 -4
- package/src/prisma/prisma.service.ts +9 -3
- package/dist/src/auth/admin.middleware.d.ts +0 -11
- package/dist/src/auth/admin.middleware.d.ts.map +0 -1
- package/dist/src/auth/admin.middleware.js +0 -22
- package/dist/src/auth/admin.middleware.js.map +0 -1
- package/dist/src/auth/auth.guard.d.ts +0 -25
- package/dist/src/auth/auth.guard.d.ts.map +0 -1
- package/dist/src/auth/auth.guard.js +0 -137
- package/dist/src/auth/auth.guard.js.map +0 -1
- package/dist/src/auth/auth.module.d.ts +0 -9
- package/dist/src/auth/auth.module.d.ts.map +0 -1
- package/dist/src/auth/auth.module.js +0 -30
- package/dist/src/auth/auth.module.js.map +0 -1
- package/dist/src/cache/cache.module.d.ts +0 -5
- package/dist/src/cache/cache.module.d.ts.map +0 -1
- package/dist/src/cache/cache.module.js +0 -35
- package/dist/src/cache/cache.module.js.map +0 -1
- package/dist/src/cache/cache.service.d.ts +0 -9
- package/dist/src/cache/cache.service.d.ts.map +0 -1
- package/dist/src/cache/cache.service.js +0 -36
- package/dist/src/cache/cache.service.js.map +0 -1
- package/dist/src/index.d.ts +0 -16
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -16
- package/dist/src/index.js.map +0 -1
- package/dist/src/prisma/prisma.module.d.ts +0 -3
- package/dist/src/prisma/prisma.module.d.ts.map +0 -1
- package/dist/src/prisma/prisma.module.js +0 -19
- package/dist/src/prisma/prisma.module.js.map +0 -1
- package/dist/src/prisma/prisma.service.d.ts +0 -8
- package/dist/src/prisma/prisma.service.d.ts.map +0 -1
- package/dist/src/prisma/prisma.service.js +0 -32
- package/dist/src/prisma/prisma.service.js.map +0 -1
- package/dist/src/prisma/seed.d.ts +0 -2
- package/dist/src/prisma/seed.d.ts.map +0 -1
- package/dist/src/prisma/seed.js +0 -75
- package/dist/src/prisma/seed.js.map +0 -1
- package/dist/src/types/index.d.ts +0 -12
- package/dist/src/types/index.d.ts.map +0 -1
- package/dist/src/types/index.js +0 -2
- package/dist/src/types/index.js.map +0 -1
- package/dist/src/utils/api/endpoints.d.ts +0 -7
- package/dist/src/utils/api/endpoints.d.ts.map +0 -1
- package/dist/src/utils/api/endpoints.js +0 -7
- package/dist/src/utils/api/endpoints.js.map +0 -1
- package/dist/src/utils/constants.d.ts +0 -3
- package/dist/src/utils/constants.d.ts.map +0 -1
- package/dist/src/utils/constants.js +0 -12
- package/dist/src/utils/constants.js.map +0 -1
- package/dist/src/utils/events.d.ts +0 -7
- package/dist/src/utils/events.d.ts.map +0 -1
- package/dist/src/utils/events.js +0 -7
- package/dist/src/utils/events.js.map +0 -1
- package/dist/src/utils/index.d.ts +0 -8
- package/dist/src/utils/index.d.ts.map +0 -1
- package/dist/src/utils/index.js +0 -9
- package/dist/src/utils/index.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { PrismaClient, Prisma, } from '
|
|
2
|
-
export type
|
|
3
|
-
export
|
|
1
|
+
export { PrismaClient, Prisma, } from './generated/prisma/client';
|
|
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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,MAAM,GACP,MAAM,2BAA2B,CAAC;AAInC,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,2BAA2B,CAAC;AAGnC,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,0BAA0B,CAAC;AAKlC,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
|
-
export { PrismaClient, Prisma, } from
|
|
2
|
-
export
|
|
1
|
+
export { PrismaClient, Prisma, } from './generated/prisma/client';
|
|
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,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,MAAM,GACP,MAAM,2BAA2B,CAAC;AAgCnC,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,0BAA0B,CAAC;AAKlC,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
|
-
import { PrismaClient } from '
|
|
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,
|
|
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,4BAA4B,CAAC;AAG1D,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"}
|
|
@@ -8,9 +8,11 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { Injectable } from '@nestjs/common';
|
|
11
|
-
import { PrismaClient } from
|
|
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,
|
|
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,MAAM,4BAA4B,CAAC;AAC1D,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
|
@@ -3,16 +3,11 @@
|
|
|
3
3
|
export {
|
|
4
4
|
PrismaClient,
|
|
5
5
|
Prisma,
|
|
6
|
-
} from '
|
|
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,
|
|
@@ -37,7 +32,7 @@ export * from '@generated/prisma/enums';
|
|
|
37
32
|
Feedback,
|
|
38
33
|
Report,
|
|
39
34
|
Country,
|
|
40
|
-
} from '
|
|
35
|
+
} from './generated/prisma/client';
|
|
41
36
|
|
|
42
37
|
|
|
43
38
|
export {
|
|
@@ -59,7 +54,9 @@ export {
|
|
|
59
54
|
PricingDuration,
|
|
60
55
|
PaymentMethod,
|
|
61
56
|
TransactionStatus,
|
|
62
|
-
} from '
|
|
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],
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { Injectable, OnModuleDestroy, OnModuleInit } from '@nestjs/common';
|
|
2
|
-
import { PrismaClient } from '
|
|
2
|
+
import { PrismaClient } from '../generated/prisma/client';
|
|
3
3
|
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
|
+
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { NestMiddleware } from '@nestjs/common';
|
|
2
|
-
import { Request, Response, NextFunction } from 'express';
|
|
3
|
-
import { User } from '@generated/prisma/client';
|
|
4
|
-
interface RequestWithUser extends Request {
|
|
5
|
-
user?: User;
|
|
6
|
-
}
|
|
7
|
-
export declare class AdminMiddleware implements NestMiddleware {
|
|
8
|
-
use(req: RequestWithUser, res: Response, next: NextFunction): void;
|
|
9
|
-
}
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=admin.middleware.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"admin.middleware.d.ts","sourceRoot":"","sources":["../../../src/auth/admin.middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,cAAc,EAAyB,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAY,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAE1D,UAAU,eAAgB,SAAQ,OAAO;IACvC,IAAI,CAAC,EAAE,IAAI,CAAC;CACb;AAED,qBACa,eAAgB,YAAW,cAAc;IACpD,GAAG,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY;CAS5D"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { Injectable, UnauthorizedException } from '@nestjs/common';
|
|
8
|
-
import { UserRole } from "../../generated/prisma/client";
|
|
9
|
-
let AdminMiddleware = class AdminMiddleware {
|
|
10
|
-
use(req, res, next) {
|
|
11
|
-
const user = req.user;
|
|
12
|
-
if (!user || !user.role?.includes(UserRole.ADMIN)) {
|
|
13
|
-
throw new UnauthorizedException('Access denied. Admins only.');
|
|
14
|
-
}
|
|
15
|
-
next();
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
AdminMiddleware = __decorate([
|
|
19
|
-
Injectable()
|
|
20
|
-
], AdminMiddleware);
|
|
21
|
-
export { AdminMiddleware };
|
|
22
|
-
//# sourceMappingURL=admin.middleware.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"admin.middleware.js","sourceRoot":"","sources":["../../../src/auth/admin.middleware.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAkB,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEnF,OAAO,EAAE,QAAQ,EAAQ,sCAAiC;AAOnD,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,GAAG,CAAC,GAAoB,EAAE,GAAa,EAAE,IAAkB;QACzD,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;QAEtB,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAClD,MAAM,IAAI,qBAAqB,CAAC,6BAA6B,CAAC,CAAC;QACjE,CAAC;QAED,IAAI,EAAE,CAAC;IACT,CAAC;CACF,CAAA;AAVY,eAAe;IAD3B,UAAU,EAAE;GACA,eAAe,CAU3B"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { CanActivate, ExecutionContext } from '@nestjs/common';
|
|
2
|
-
import { JwtService } from '@nestjs/jwt';
|
|
3
|
-
export declare class AuthGuard implements CanActivate {
|
|
4
|
-
private jwtService;
|
|
5
|
-
private prisma;
|
|
6
|
-
private logger;
|
|
7
|
-
constructor(jwtService: JwtService);
|
|
8
|
-
canActivate(context: ExecutionContext): Promise<boolean>;
|
|
9
|
-
private extractTokenFromHeader;
|
|
10
|
-
}
|
|
11
|
-
export declare class OptionalAuthGuard implements CanActivate {
|
|
12
|
-
private jwtService;
|
|
13
|
-
private prisma;
|
|
14
|
-
constructor(jwtService: JwtService);
|
|
15
|
-
canActivate(context: ExecutionContext): Promise<boolean>;
|
|
16
|
-
private extractTokenFromHeader;
|
|
17
|
-
}
|
|
18
|
-
export declare class AdminAuthGuard implements CanActivate {
|
|
19
|
-
private jwtService;
|
|
20
|
-
private prisma;
|
|
21
|
-
constructor(jwtService: JwtService);
|
|
22
|
-
canActivate(context: ExecutionContext): Promise<boolean>;
|
|
23
|
-
private extractTokenFromHeader;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=auth.guard.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.guard.d.ts","sourceRoot":"","sources":["../../../src/auth/auth.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,gBAAgB,EAGjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAWzC,qBACa,SAAU,YAAW,WAAW;IAMzC,OAAO,CAAC,UAAU;IALpB,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,MAAM,CAA8B;gBAIlC,UAAU,EAAE,UAAU;IAK1B,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IA+B9D,OAAO,CAAC,sBAAsB;CAI/B;AAGD,qBACa,iBAAkB,YAAW,WAAW;IAIjD,OAAO,CAAC,UAAU;IAHnB,OAAO,CAAC,MAAM,CAAe;gBAGpB,UAAU,EAAE,UAAU;IAK1B,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IA4B9D,OAAO,CAAC,sBAAsB;CAI/B;AAGD,qBACa,cAAe,YAAW,WAAW;IAI9C,OAAO,CAAC,UAAU;IAHpB,OAAO,CAAC,MAAM,CAAe;gBAGnB,UAAU,EAAE,UAAU;IAK1B,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IA8B9D,OAAO,CAAC,sBAAsB;CAI/B"}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
var AuthGuard_1;
|
|
11
|
-
import { Injectable, UnauthorizedException, } from '@nestjs/common';
|
|
12
|
-
import { JwtService } from '@nestjs/jwt';
|
|
13
|
-
import { PrismaClient, UserRole } from "../../generated/prisma/client";
|
|
14
|
-
import { Logger } from '@nestjs/common';
|
|
15
|
-
import { PrismaPg } from '@prisma/adapter-pg';
|
|
16
|
-
const adapter = new PrismaPg({
|
|
17
|
-
connectionString: process.env.DATABASE_URL,
|
|
18
|
-
});
|
|
19
|
-
let AuthGuard = AuthGuard_1 = class AuthGuard {
|
|
20
|
-
jwtService;
|
|
21
|
-
prisma;
|
|
22
|
-
logger = new Logger(AuthGuard_1.name);
|
|
23
|
-
constructor(jwtService) {
|
|
24
|
-
this.jwtService = jwtService;
|
|
25
|
-
this.prisma = new PrismaClient({ adapter });
|
|
26
|
-
}
|
|
27
|
-
async canActivate(context) {
|
|
28
|
-
const request = context.switchToHttp().getRequest();
|
|
29
|
-
const token = this.extractTokenFromHeader(request);
|
|
30
|
-
if (!token) {
|
|
31
|
-
throw new UnauthorizedException();
|
|
32
|
-
}
|
|
33
|
-
try {
|
|
34
|
-
const payload = (await this.jwtService.verifyAsync(token));
|
|
35
|
-
const user = await this.prisma.user.findUnique({
|
|
36
|
-
where: { id: payload.userId }
|
|
37
|
-
});
|
|
38
|
-
if (!user) {
|
|
39
|
-
throw new UnauthorizedException();
|
|
40
|
-
}
|
|
41
|
-
request['user'] = user;
|
|
42
|
-
}
|
|
43
|
-
catch {
|
|
44
|
-
this.logger.log('UnauthorizedException');
|
|
45
|
-
throw new UnauthorizedException();
|
|
46
|
-
}
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
extractTokenFromHeader(request) {
|
|
50
|
-
const [type, token] = request.headers.authorization?.split(' ') ?? [];
|
|
51
|
-
return type === 'Bearer' ? token : undefined;
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
AuthGuard = AuthGuard_1 = __decorate([
|
|
55
|
-
Injectable(),
|
|
56
|
-
__metadata("design:paramtypes", [JwtService])
|
|
57
|
-
], AuthGuard);
|
|
58
|
-
export { AuthGuard };
|
|
59
|
-
let OptionalAuthGuard = class OptionalAuthGuard {
|
|
60
|
-
jwtService;
|
|
61
|
-
prisma;
|
|
62
|
-
constructor(jwtService) {
|
|
63
|
-
this.jwtService = jwtService;
|
|
64
|
-
this.prisma = new PrismaClient({ adapter });
|
|
65
|
-
}
|
|
66
|
-
async canActivate(context) {
|
|
67
|
-
const request = context.switchToHttp().getRequest();
|
|
68
|
-
const token = this.extractTokenFromHeader(request);
|
|
69
|
-
if (!token) {
|
|
70
|
-
return true;
|
|
71
|
-
}
|
|
72
|
-
try {
|
|
73
|
-
const payload = (await this.jwtService.verifyAsync(token));
|
|
74
|
-
const user = await this.prisma.user.findUnique({
|
|
75
|
-
where: { id: payload.userId }
|
|
76
|
-
});
|
|
77
|
-
if (!user) {
|
|
78
|
-
throw new UnauthorizedException();
|
|
79
|
-
}
|
|
80
|
-
request['user'] = user;
|
|
81
|
-
}
|
|
82
|
-
catch {
|
|
83
|
-
}
|
|
84
|
-
return true;
|
|
85
|
-
}
|
|
86
|
-
extractTokenFromHeader(request) {
|
|
87
|
-
const [type, token] = request.headers.authorization?.split(' ') ?? [];
|
|
88
|
-
return type === 'Bearer' ? token : undefined;
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
OptionalAuthGuard = __decorate([
|
|
92
|
-
Injectable(),
|
|
93
|
-
__metadata("design:paramtypes", [JwtService])
|
|
94
|
-
], OptionalAuthGuard);
|
|
95
|
-
export { OptionalAuthGuard };
|
|
96
|
-
let AdminAuthGuard = class AdminAuthGuard {
|
|
97
|
-
jwtService;
|
|
98
|
-
prisma;
|
|
99
|
-
constructor(jwtService) {
|
|
100
|
-
this.jwtService = jwtService;
|
|
101
|
-
this.prisma = new PrismaClient({ adapter });
|
|
102
|
-
}
|
|
103
|
-
async canActivate(context) {
|
|
104
|
-
const request = context.switchToHttp().getRequest();
|
|
105
|
-
const token = this.extractTokenFromHeader(request);
|
|
106
|
-
if (!token) {
|
|
107
|
-
throw new UnauthorizedException();
|
|
108
|
-
}
|
|
109
|
-
try {
|
|
110
|
-
const payload = (await this.jwtService.verifyAsync(token));
|
|
111
|
-
const user = await this.prisma.user.findUnique({
|
|
112
|
-
where: { id: payload.userId }
|
|
113
|
-
});
|
|
114
|
-
if (!user) {
|
|
115
|
-
throw new UnauthorizedException();
|
|
116
|
-
}
|
|
117
|
-
if (user.role !== UserRole.ADMIN && user.role !== UserRole.SUPER_ADMIN) {
|
|
118
|
-
throw new UnauthorizedException();
|
|
119
|
-
}
|
|
120
|
-
request['user'] = user;
|
|
121
|
-
}
|
|
122
|
-
catch {
|
|
123
|
-
throw new UnauthorizedException();
|
|
124
|
-
}
|
|
125
|
-
return true;
|
|
126
|
-
}
|
|
127
|
-
extractTokenFromHeader(request) {
|
|
128
|
-
const [type, token] = request.headers.authorization?.split(' ') ?? [];
|
|
129
|
-
return type === 'Bearer' ? token : undefined;
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
AdminAuthGuard = __decorate([
|
|
133
|
-
Injectable(),
|
|
134
|
-
__metadata("design:paramtypes", [JwtService])
|
|
135
|
-
], AdminAuthGuard);
|
|
136
|
-
export { AdminAuthGuard };
|
|
137
|
-
//# sourceMappingURL=auth.guard.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.guard.js","sourceRoot":"","sources":["../../../src/auth/auth.guard.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAGL,UAAU,EACV,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,sCAAiC;AAGlE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,OAAO,GAAG,IAAI,QAAQ,CAAC;IAC3B,gBAAgB,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY;CAC3C,CAAC,CAAC;AAGI,IAAM,SAAS,iBAAf,MAAM,SAAS;IAMV;IALF,MAAM,CAAe;IACrB,MAAM,GAAG,IAAI,MAAM,CAAC,WAAS,CAAC,IAAI,CAAC,CAAC;IAG5C,YACU,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;QAE9B,IAAI,CAAC,MAAM,GAAG,IAAI,YAAY,CAAC,EAAC,OAAO,EAAC,CAAC,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAAyB;QACzC,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,E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AC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/C,CAAC;CACF,CAAA;AA3CY,cAAc;IAD1B,UAAU,EAAE;qCAKW,UAAU;GAJrB,cAAc,CA2C1B"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { DynamicModule } from '@nestjs/common';
|
|
2
|
-
export interface AuthModuleOptions {
|
|
3
|
-
jwtSecret: string;
|
|
4
|
-
jwtExpiresIn?: number;
|
|
5
|
-
}
|
|
6
|
-
export declare class AuthModule {
|
|
7
|
-
static forRoot(options: AuthModuleOptions): DynamicModule;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=auth.module.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.module.d.ts","sourceRoot":"","sources":["../../../src/auth/auth.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,aAAa,EAAU,MAAM,gBAAgB,CAAC;AAG/D,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,qBAEa,UAAU;IACrB,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,iBAAiB,GAAG,aAAa;CAa1D"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var AuthModule_1;
|
|
8
|
-
import { Module, Global } from '@nestjs/common';
|
|
9
|
-
import { JwtModule } from '@nestjs/jwt';
|
|
10
|
-
let AuthModule = AuthModule_1 = class AuthModule {
|
|
11
|
-
static forRoot(options) {
|
|
12
|
-
console.log('AuthModule.forRoot', options);
|
|
13
|
-
return {
|
|
14
|
-
module: AuthModule_1,
|
|
15
|
-
imports: [
|
|
16
|
-
JwtModule.register({
|
|
17
|
-
secret: options.jwtSecret,
|
|
18
|
-
signOptions: { expiresIn: options.jwtExpiresIn || '7d' },
|
|
19
|
-
}),
|
|
20
|
-
],
|
|
21
|
-
exports: [JwtModule],
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
AuthModule = AuthModule_1 = __decorate([
|
|
26
|
-
Global(),
|
|
27
|
-
Module({})
|
|
28
|
-
], AuthModule);
|
|
29
|
-
export { AuthModule };
|
|
30
|
-
//# sourceMappingURL=auth.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../../../src/auth/auth.module.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,MAAM,EAAiB,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AASjC,IAAM,UAAU,kBAAhB,MAAM,UAAU;IACrB,MAAM,CAAC,OAAO,CAAC,OAA0B;QACvC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;QAC3C,OAAO;YACL,MAAM,EAAE,YAAU;YAClB,OAAO,EAAE;gBACP,SAAS,CAAC,QAAQ,CAAC;oBACjB,MAAM,EAAE,OAAO,CAAC,SAAS;oBACzB,WAAW,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,YAAY,IAAI,IAAI,EAAE;iBACzD,CAAC;aACH;YACD,OAAO,EAAE,CAAC,SAAS,CAAC;SACrB,CAAC;IACJ,CAAC;CACF,CAAA;AAdY,UAAU;IAFtB,MAAM,EAAE;IACR,MAAM,CAAC,EAAE,CAAC;GACE,UAAU,CActB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cache.module.d.ts","sourceRoot":"","sources":["../../../src/cache/cache.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,aAAa,EAAU,MAAM,gBAAgB,CAAC;AAK/D,qBAEa,WAAW;IACtB,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,aAAa;CAgBhD"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var CacheModule_1;
|
|
8
|
-
import { Module, Global } from '@nestjs/common';
|
|
9
|
-
import { Cacheable } from 'cacheable';
|
|
10
|
-
import { CacheService } from './cache.service';
|
|
11
|
-
import KeyvRedis from '@keyv/redis';
|
|
12
|
-
let CacheModule = CacheModule_1 = class CacheModule {
|
|
13
|
-
static forRoot(redisUrl) {
|
|
14
|
-
return {
|
|
15
|
-
module: CacheModule_1,
|
|
16
|
-
providers: [
|
|
17
|
-
{
|
|
18
|
-
provide: 'CACHE_INSTANCE',
|
|
19
|
-
useFactory: () => {
|
|
20
|
-
const secondary = new KeyvRedis(redisUrl);
|
|
21
|
-
return new Cacheable({ secondary, ttl: '1h' });
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
CacheService,
|
|
25
|
-
],
|
|
26
|
-
exports: ['CACHE_INSTANCE', CacheService],
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
CacheModule = CacheModule_1 = __decorate([
|
|
31
|
-
Global(),
|
|
32
|
-
Module({})
|
|
33
|
-
], CacheModule);
|
|
34
|
-
export { CacheModule };
|
|
35
|
-
//# sourceMappingURL=cache.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cache.module.js","sourceRoot":"","sources":["../../../src/cache/cache.module.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,MAAM,EAAiB,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,SAAS,MAAM,aAAa,CAAC;AAI7B,IAAM,WAAW,mBAAjB,MAAM,WAAW;IACtB,MAAM,CAAC,OAAO,CAAC,QAAgB;QAC7B,OAAO;YACL,MAAM,EAAE,aAAW;YACnB,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,gBAAgB;oBACzB,UAAU,EAAE,GAAG,EAAE;wBACf,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC;wBAC1C,OAAO,IAAI,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;oBACjD,CAAC;iBACF;gBACD,YAAY;aACb;YACD,OAAO,EAAE,CAAC,gBAAgB,EAAE,YAAY,CAAC;SAC1C,CAAC;IACJ,CAAC;CACF,CAAA;AAjBY,WAAW;IAFvB,MAAM,EAAE;IACR,MAAM,CAAC,EAAE,CAAC;GACE,WAAW,CAiBvB"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Cacheable } from 'cacheable';
|
|
2
|
-
export declare class CacheService<T> {
|
|
3
|
-
private readonly cache;
|
|
4
|
-
constructor(cache: Cacheable);
|
|
5
|
-
get<T>(key: string): Promise<T>;
|
|
6
|
-
set(key: string, value: T, ttl?: number | string): Promise<void>;
|
|
7
|
-
delete(key: string): Promise<void>;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=cache.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cache.service.d.ts","sourceRoot":"","sources":["../../../src/cache/cache.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,qBACa,YAAY,CAAC,CAAC;IACa,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,SAAS;IAEjE,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAI/B,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhE,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGzC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
-
};
|
|
13
|
-
import { Inject, Injectable } from '@nestjs/common';
|
|
14
|
-
import { Cacheable } from 'cacheable';
|
|
15
|
-
let CacheService = class CacheService {
|
|
16
|
-
cache;
|
|
17
|
-
constructor(cache) {
|
|
18
|
-
this.cache = cache;
|
|
19
|
-
}
|
|
20
|
-
async get(key) {
|
|
21
|
-
return await this.cache.get(key);
|
|
22
|
-
}
|
|
23
|
-
async set(key, value, ttl) {
|
|
24
|
-
await this.cache.set(key, value, ttl);
|
|
25
|
-
}
|
|
26
|
-
async delete(key) {
|
|
27
|
-
await this.cache.delete(key);
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
CacheService = __decorate([
|
|
31
|
-
Injectable(),
|
|
32
|
-
__param(0, Inject('CACHE_INSTANCE')),
|
|
33
|
-
__metadata("design:paramtypes", [Cacheable])
|
|
34
|
-
], CacheService);
|
|
35
|
-
export { CacheService };
|
|
36
|
-
//# sourceMappingURL=cache.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cache.service.js","sourceRoot":"","sources":["../../../src/cache/cache.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAG/B,IAAM,YAAY,GAAlB,MAAM,YAAY;IACgC;IAAvD,YAAuD,KAAgB;QAAhB,UAAK,GAAL,KAAK,CAAW;IAAG,CAAC;IAE3E,KAAK,CAAC,GAAG,CAAI,GAAW;QACtB,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,GAAW,EAAE,KAAQ,EAAE,GAAqB;QACpD,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAW;QACtB,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;CACF,CAAA;AAdY,YAAY;IADxB,UAAU,EAAE;IAEE,WAAA,MAAM,CAAC,gBAAgB,CAAC,CAAA;qCAAyB,SAAS;GAD5D,YAAY,CAcxB"}
|
package/dist/src/index.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export * from './auth/auth.guard';
|
|
2
|
-
export { PrismaClient, User, Account, AccountType, UserRole, Event, EventAccess, EventVisibility, EventStatus, EventPrice, Address, Provider, ProviderStatus, EventCategory, Review, ProviderCategory, Order, OrderStatus, OrderItem, PaymentStatus, Chat, ChatUser, Message, Notification, NotificationType, ProviderOnEvent, UserInterests, UserStatus, ProviderOnEventStatus, Pricing, PricingType, PricingDuration, Transaction, TransactionStatus, PaymentMethod, Prisma, TicketHandler, } from '@generated/prisma/client';
|
|
3
|
-
export * from './auth/auth.guard';
|
|
4
|
-
export * from './auth/auth.module';
|
|
5
|
-
export * from './auth/admin.middleware';
|
|
6
|
-
export * from './cache/cache.module';
|
|
7
|
-
export * from './cache/cache.service';
|
|
8
|
-
export * from './prisma/prisma.module';
|
|
9
|
-
export * from './prisma/prisma.service';
|
|
10
|
-
export * from './prisma/seed';
|
|
11
|
-
export * from './types';
|
|
12
|
-
export * from './utils';
|
|
13
|
-
export * from './utils/api/endpoints';
|
|
14
|
-
export * from './utils/events';
|
|
15
|
-
export { JwtService } from "@nestjs/jwt";
|
|
16
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,OAAO,EACH,YAAY,EACZ,IAAI,EACJ,OAAO,EACP,WAAW,EACX,QAAQ,EACR,KAAK,EACL,WAAW,EACX,eAAe,EACf,WAAW,EACX,UAAU,EAAE,OAAO,EACnB,QAAQ,EACR,cAAc,EACd,aAAa,EACb,MAAM,EACN,gBAAgB,EAChB,KAAK,EACL,WAAW,EACX,SAAS,EACT,aAAa,EACb,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,UAAU,EACV,qBAAqB,EACrB,OAAO,EACP,WAAW,EACX,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,MAAM,EACN,aAAa,GAChB,MAAM,0BAA0B,CAAC;AAGlC,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;AAC9B,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/src/index.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export * from './auth/auth.guard';
|
|
2
|
-
export { PrismaClient, AccountType, UserRole, EventAccess, EventVisibility, EventStatus, ProviderStatus, OrderStatus, PaymentStatus, NotificationType, UserStatus, ProviderOnEventStatus, PricingType, PricingDuration, TransactionStatus, PaymentMethod, Prisma, TicketHandler, } from "../generated/prisma/client";
|
|
3
|
-
export * from './auth/auth.guard';
|
|
4
|
-
export * from './auth/auth.module';
|
|
5
|
-
export * from './auth/admin.middleware';
|
|
6
|
-
export * from './cache/cache.module';
|
|
7
|
-
export * from './cache/cache.service';
|
|
8
|
-
export * from './prisma/prisma.module';
|
|
9
|
-
export * from './prisma/prisma.service';
|
|
10
|
-
export * from './prisma/seed';
|
|
11
|
-
export * from './types';
|
|
12
|
-
export * from './utils';
|
|
13
|
-
export * from './utils/api/endpoints';
|
|
14
|
-
export * from './utils/events';
|
|
15
|
-
export { JwtService } from "@nestjs/jwt";
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,OAAO,EACH,YAAY,EAGZ,WAAW,EACX,QAAQ,EAER,WAAW,EACX,eAAe,EACf,WAAW,EAGX,cAAc,EAKd,WAAW,EAEX,aAAa,EAKb,gBAAgB,EAGhB,UAAU,EACV,qBAAqB,EAErB,WAAW,EACX,eAAe,EAEf,iBAAiB,EACjB,aAAa,EACb,MAAM,EACN,aAAa,GAChB,mCAAiC;AAGlC,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;AAC9B,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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prisma.module.d.ts","sourceRoot":"","sources":["../../../src/prisma/prisma.module.ts"],"names":[],"mappings":"AAGA,qBAKa,YAAY;CAAG"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { Module, Global } from '@nestjs/common';
|
|
8
|
-
import { PrismaService } from './prisma.service';
|
|
9
|
-
let PrismaModule = class PrismaModule {
|
|
10
|
-
};
|
|
11
|
-
PrismaModule = __decorate([
|
|
12
|
-
Global(),
|
|
13
|
-
Module({
|
|
14
|
-
providers: [PrismaService],
|
|
15
|
-
exports: [PrismaService],
|
|
16
|
-
})
|
|
17
|
-
], PrismaModule);
|
|
18
|
-
export { PrismaModule };
|
|
19
|
-
//# sourceMappingURL=prisma.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prisma.module.js","sourceRoot":"","sources":["../../../src/prisma/prisma.module.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAO1C,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,YAAY;IALxB,MAAM,EAAE;IACR,MAAM,CAAC;QACN,SAAS,EAAE,CAAC,aAAa,CAAC;QAC1B,OAAO,EAAE,CAAC,aAAa,CAAC;KACzB,CAAC;GACW,YAAY,CAAG"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { OnModuleDestroy, OnModuleInit } from '@nestjs/common';
|
|
2
|
-
import { PrismaClient } from '@generated/prisma/client';
|
|
3
|
-
export declare class PrismaService extends PrismaClient implements OnModuleInit, OnModuleDestroy {
|
|
4
|
-
constructor();
|
|
5
|
-
onModuleInit(): Promise<void>;
|
|
6
|
-
onModuleDestroy(): Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=prisma.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AAOxD,qBACa,aAAc,SAAQ,YAAa,YAAW,YAAY,EAAE,eAAe;;IAKhF,YAAY;IAIZ,eAAe;CAGtB"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
import { Injectable } from '@nestjs/common';
|
|
11
|
-
import { PrismaClient } from "../../generated/prisma/client";
|
|
12
|
-
import { PrismaPg } from '@prisma/adapter-pg';
|
|
13
|
-
const adapter = new PrismaPg({
|
|
14
|
-
connectionString: process.env.DATABASE_URL,
|
|
15
|
-
});
|
|
16
|
-
let PrismaService = class PrismaService extends PrismaClient {
|
|
17
|
-
constructor() {
|
|
18
|
-
super({ adapter });
|
|
19
|
-
}
|
|
20
|
-
async onModuleInit() {
|
|
21
|
-
await this.$connect();
|
|
22
|
-
}
|
|
23
|
-
async onModuleDestroy() {
|
|
24
|
-
await this.$disconnect();
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
PrismaService = __decorate([
|
|
28
|
-
Injectable(),
|
|
29
|
-
__metadata("design:paramtypes", [])
|
|
30
|
-
], PrismaService);
|
|
31
|
-
export { PrismaService };
|
|
32
|
-
//# sourceMappingURL=prisma.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,sCAAiC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,OAAO,GAAG,IAAI,QAAQ,CAAC;IAC3B,gBAAgB,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY;CAC3C,CAAC,CAAC;AAGI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,YAAY;IAC7C;QACE,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IACrB,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;CACF,CAAA;AAZY,aAAa;IADzB,UAAU,EAAE;;GACA,aAAa,CAYzB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"seed.d.ts","sourceRoot":"","sources":["../../../src/prisma/seed.ts"],"names":[],"mappings":""}
|
package/dist/src/prisma/seed.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { PrismaClient } from "../../generated/prisma/client";
|
|
2
|
-
import { PrismaPg } from '@prisma/adapter-pg';
|
|
3
|
-
const adapter = new PrismaPg({
|
|
4
|
-
connectionString: process.env.DATABASE_URL,
|
|
5
|
-
});
|
|
6
|
-
const prisma = new PrismaClient({ adapter });
|
|
7
|
-
async function main() {
|
|
8
|
-
try {
|
|
9
|
-
const categories = [
|
|
10
|
-
{
|
|
11
|
-
name: 'Music',
|
|
12
|
-
description: 'Music events',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: 'Food',
|
|
16
|
-
description: 'Food events',
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
name: 'Art',
|
|
20
|
-
description: 'Art events',
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
name: 'Sports',
|
|
24
|
-
description: 'Sports events',
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: 'Games',
|
|
28
|
-
description: 'Games events',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
name: 'Dance',
|
|
32
|
-
description: 'Dance events',
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: 'Fashion',
|
|
36
|
-
description: 'Fashion events',
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
name: 'Tech',
|
|
40
|
-
description: 'Technology events',
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
name: 'Science',
|
|
44
|
-
description: 'Science events',
|
|
45
|
-
},
|
|
46
|
-
];
|
|
47
|
-
const categoriesCreated = await prisma.eventCategory.findMany({
|
|
48
|
-
where: {
|
|
49
|
-
name: {
|
|
50
|
-
in: categories.map((category) => category.name),
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
const categoriesNotCreated = categories.filter((category) => !categoriesCreated.some((c) => c.name === category.name));
|
|
55
|
-
if (categoriesNotCreated.length > 0) {
|
|
56
|
-
console.log(`Creating ${categoriesNotCreated.length} categories`);
|
|
57
|
-
await prisma.eventCategory.createMany({
|
|
58
|
-
data: categoriesNotCreated,
|
|
59
|
-
});
|
|
60
|
-
console.log(`Created ${categoriesNotCreated.length} categories`);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
catch (error) {
|
|
64
|
-
console.error(error);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
main()
|
|
68
|
-
.catch((error) => {
|
|
69
|
-
console.error(error);
|
|
70
|
-
process.exit(1);
|
|
71
|
-
})
|
|
72
|
-
.finally(async () => {
|
|
73
|
-
await prisma.$disconnect();
|
|
74
|
-
});
|
|
75
|
-
//# sourceMappingURL=seed.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"seed.js","sourceRoot":"","sources":["../../../src/prisma/seed.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,sCAAiC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,OAAO,GAAG,IAAI,QAAQ,CAAC;IAC3B,gBAAgB,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY;CAC3C,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,EAAC,OAAO,EAAC,CAAC,CAAC;AAE3C,KAAK,UAAU,IAAI;IACf,IAAI,CAAC;QACD,MAAM,UAAU,GAAG;YACnB;gBACI,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,cAAc;aAC9B;YACD;gBACI,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,aAAa;aAC7B;YACD;gBACI,IAAI,EAAE,KAAK;gBACX,WAAW,EAAE,YAAY;aAC5B;YACD;gBACI,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,eAAe;aAC/B;YACD;gBACI,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,cAAc;aAC9B;YACD;gBACI,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,cAAc;aAC9B;YACD;gBACI,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,gBAAgB;aAChC;YACD;gBACI,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,mB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|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
package/dist/src/types/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../../../src/utils/api/endpoints.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,EAAE,MAAoB,CAAA;AAC/C,eAAO,MAAM,kBAAkB,EAAE,MAAyB,CAAA;AAE1D,eAAO,MAAM,aAAa;;;CAGzB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../../../src/utils/api/endpoints.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAW,WAAW,CAAA;AAC/C,MAAM,CAAC,MAAM,kBAAkB,GAAW,gBAAgB,CAAA;AAE1D,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,WAAW;IACjB,kBAAkB,EAAE,gBAAgB;CACrC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,0EACwC,CAAC;AAE1E,eAAO,MAAM,uBAAuB,UASnC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export const DEFAULT_AVATAR_IMAGE = 'https://immob-bucket-2.s3.us-east-2.amazonaws.com/pictures/images.png';
|
|
2
|
-
export const TEMPORARY_EMAIL_DOMAINS = [
|
|
3
|
-
'10minutemail.com',
|
|
4
|
-
'guerrillamail.com',
|
|
5
|
-
'mailinator.com',
|
|
6
|
-
'dispostable.com',
|
|
7
|
-
'yopmail.com',
|
|
8
|
-
'trashmail.com',
|
|
9
|
-
'tempmail.com',
|
|
10
|
-
'temp-mail.org',
|
|
11
|
-
];
|
|
12
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAC/B,uEAAuE,CAAC;AAE1E,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;IAChB,iBAAiB;IACjB,aAAa;IACb,eAAe;IACf,cAAc;IACd,eAAe;CAChB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/utils/events.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;CAKzB,CAAA"}
|
package/dist/src/utils/events.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export const SOCKET_EVENTS = {
|
|
2
|
-
INBOX_OPENED: 'events.sockets.inboxOpened',
|
|
3
|
-
INBOX_CHANGED: 'events.sockets.inboxChanged',
|
|
4
|
-
NEW_MESSAGE: 'events.sockets.newMessage',
|
|
5
|
-
GET_UNREAD_MESSAGES_COUNT: 'events.sockets.getUnreadMessagesCount',
|
|
6
|
-
};
|
|
7
|
-
//# sourceMappingURL=events.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/utils/events.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;IACzB,YAAY,EAAE,4BAA4B;IAC1C,aAAa,EAAE,6BAA6B;IAC5C,WAAW,EAAE,2BAA2B;IACxC,yBAAyB,EAAE,uCAAuC;CACrE,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { PaginationQuery } from "@/types";
|
|
2
|
-
export declare const getPaginationData: (query: PaginationQuery) => {
|
|
3
|
-
page: number;
|
|
4
|
-
skip: number;
|
|
5
|
-
limit: number;
|
|
6
|
-
};
|
|
7
|
-
export declare const getUserChannel: (userId: string) => string;
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,iBAAiB,GAAI,OAAO,eAAe;;;;CAOvD,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM,WAA8B,CAAC"}
|
package/dist/src/utils/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export const getPaginationData = (query) => {
|
|
2
|
-
const page = query.page;
|
|
3
|
-
const PAGE = parseInt(page, 10) || 1;
|
|
4
|
-
const LIMIT = Number(query.limit) || 10;
|
|
5
|
-
const SKIP = (PAGE - 1) * LIMIT;
|
|
6
|
-
return { page: PAGE, skip: SKIP, limit: LIMIT };
|
|
7
|
-
};
|
|
8
|
-
export const getUserChannel = (userId) => `channels-user-${userId}`;
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAsB,EAAE,EAAE;IAC1D,MAAM,IAAI,GAAG,KAAK,CAAC,IAAc,CAAC;IAClC,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IACxC,MAAM,IAAI,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;IAEhC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAClD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,iBAAiB,MAAM,EAAE,CAAC"}
|