@dismissible/nestjs-postgres-storage 0.0.2-canary.738340d.0 → 0.1.0-canary.4b708a5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/dismissible-prisma.js +0 -0
- package/package.json +7 -6
- package/prisma/generated/prisma/client.d.ts +26 -0
- package/prisma/generated/prisma/client.js +34 -0
- package/prisma/generated/prisma/client.js.map +1 -0
- package/prisma/generated/prisma/commonInputTypes.d.ts +232 -0
- package/prisma/generated/prisma/commonInputTypes.js +12 -0
- package/prisma/generated/prisma/commonInputTypes.js.map +1 -0
- package/prisma/generated/prisma/enums.d.ts +1 -0
- package/prisma/generated/prisma/{enums.ts → enums.js} +3 -6
- package/prisma/generated/prisma/enums.js.map +1 -0
- package/prisma/generated/prisma/internal/class.d.ts +126 -0
- package/prisma/generated/prisma/internal/class.js +45 -0
- package/prisma/generated/prisma/internal/class.js.map +1 -0
- package/prisma/generated/prisma/internal/prismaNamespace.d.ts +548 -0
- package/prisma/generated/prisma/internal/prismaNamespace.js +114 -0
- package/prisma/generated/prisma/internal/prismaNamespace.js.map +1 -0
- package/prisma/generated/prisma/models/DismissibleItem.d.ts +1001 -0
- package/prisma/generated/prisma/models/DismissibleItem.js +3 -0
- package/prisma/generated/prisma/models/DismissibleItem.js.map +1 -0
- package/prisma/generated/prisma/models.d.ts +2 -0
- package/prisma/generated/prisma/models.js +3 -0
- package/prisma/generated/prisma/models.js.map +1 -0
- package/src/index.js +9 -0
- package/src/index.js.map +1 -0
- package/src/postgres-storage.adapter.d.ts +21 -0
- package/src/postgres-storage.adapter.js +85 -0
- package/src/postgres-storage.adapter.js.map +1 -0
- package/src/postgres-storage.config.d.ts +7 -0
- package/src/postgres-storage.config.js +17 -0
- package/src/postgres-storage.config.js.map +1 -0
- package/src/postgres-storage.module.d.ts +12 -0
- package/src/postgres-storage.module.js +72 -0
- package/src/postgres-storage.module.js.map +1 -0
- package/src/prisma.service.d.ts +15 -0
- package/src/prisma.service.js +40 -0
- package/src/prisma.service.js.map +1 -0
- package/src/{schema-path.ts → schema-path.d.ts} +1 -5
- package/src/schema-path.js +20 -0
- package/src/schema-path.js.map +1 -0
- package/README.md +0 -211
- package/jest.config.ts +0 -10
- package/prisma/generated/prisma/browser.ts +0 -24
- package/prisma/generated/prisma/client.ts +0 -44
- package/prisma/generated/prisma/commonInputTypes.ts +0 -283
- package/prisma/generated/prisma/internal/class.ts +0 -190
- package/prisma/generated/prisma/internal/prismaNamespace.ts +0 -791
- package/prisma/generated/prisma/internal/prismaNamespaceBrowser.ts +0 -123
- package/prisma/generated/prisma/models/DismissibleItem.ts +0 -1156
- package/prisma/generated/prisma/models.ts +0 -12
- package/project.json +0 -73
- package/src/postgres-storage.adapter.spec.ts +0 -248
- package/src/postgres-storage.adapter.ts +0 -101
- package/src/postgres-storage.config.ts +0 -11
- package/src/postgres-storage.module.ts +0 -79
- package/src/prisma.service.ts +0 -34
- package/tsconfig.json +0 -13
- package/tsconfig.lib.json +0 -14
- /package/src/{index.ts → index.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DismissibleItem.js","sourceRoot":"","sources":["../../../../../../../libs/postgres-storage/prisma/generated/prisma/models/DismissibleItem.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../../../libs/postgres-storage/prisma/generated/prisma/models.ts"],"names":[],"mappings":""}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./postgres-storage.adapter"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./postgres-storage.config"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./postgres-storage.module"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./prisma.service"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./schema-path"), exports);
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/postgres-storage/src/index.ts"],"names":[],"mappings":";;;AAAA,qEAA2C;AAC3C,oEAA0C;AAC1C,oEAA0C;AAC1C,2DAAiC;AACjC,wDAA8B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IDismissibleLogger } from '@dismissible/nestjs-logger';
|
|
2
|
+
import { IDismissibleStorage } from '@dismissible/nestjs-storage';
|
|
3
|
+
import { BaseMetadata, DismissibleItemDto, DismissibleItemFactory } from '@dismissible/nestjs-dismissible-item';
|
|
4
|
+
import { PrismaService } from './prisma.service';
|
|
5
|
+
/**
|
|
6
|
+
* PostgreSQL storage adapter for dismissible items using Prisma.
|
|
7
|
+
* Implements IDismissibleStorage for persistent database storage.
|
|
8
|
+
*/
|
|
9
|
+
export declare class PostgresStorageAdapter<TMetadata extends BaseMetadata = BaseMetadata> implements IDismissibleStorage<TMetadata> {
|
|
10
|
+
private readonly prisma;
|
|
11
|
+
private readonly logger;
|
|
12
|
+
private readonly itemFactory;
|
|
13
|
+
constructor(prisma: PrismaService, logger: IDismissibleLogger, itemFactory: DismissibleItemFactory);
|
|
14
|
+
get(userId: string, itemId: string): Promise<DismissibleItemDto<TMetadata> | null>;
|
|
15
|
+
create(item: DismissibleItemDto<TMetadata>): Promise<DismissibleItemDto<TMetadata>>;
|
|
16
|
+
update(item: DismissibleItemDto<TMetadata>): Promise<DismissibleItemDto<TMetadata>>;
|
|
17
|
+
/**
|
|
18
|
+
* Map a Prisma model to a DismissibleItemDto.
|
|
19
|
+
*/
|
|
20
|
+
private mapToDto;
|
|
21
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PostgresStorageAdapter = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const nestjs_logger_1 = require("@dismissible/nestjs-logger");
|
|
7
|
+
const nestjs_dismissible_item_1 = require("@dismissible/nestjs-dismissible-item");
|
|
8
|
+
const client_1 = require("../prisma/generated/prisma/client");
|
|
9
|
+
const prisma_service_1 = require("./prisma.service");
|
|
10
|
+
/**
|
|
11
|
+
* PostgreSQL storage adapter for dismissible items using Prisma.
|
|
12
|
+
* Implements IDismissibleStorage for persistent database storage.
|
|
13
|
+
*/
|
|
14
|
+
let PostgresStorageAdapter = class PostgresStorageAdapter {
|
|
15
|
+
constructor(prisma, logger, itemFactory) {
|
|
16
|
+
this.prisma = prisma;
|
|
17
|
+
this.logger = logger;
|
|
18
|
+
this.itemFactory = itemFactory;
|
|
19
|
+
}
|
|
20
|
+
async get(userId, itemId) {
|
|
21
|
+
this.logger.debug('PostgreSQL storage get', { userId, itemId });
|
|
22
|
+
const item = await this.prisma.dismissibleItem.findUnique({
|
|
23
|
+
where: {
|
|
24
|
+
userId_id: {
|
|
25
|
+
userId,
|
|
26
|
+
id: itemId,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
if (!item) {
|
|
31
|
+
this.logger.debug('PostgreSQL storage miss', { userId, itemId });
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
this.logger.debug('PostgreSQL storage hit', { userId, itemId });
|
|
35
|
+
return this.mapToDto(item);
|
|
36
|
+
}
|
|
37
|
+
async create(item) {
|
|
38
|
+
this.logger.debug('PostgreSQL storage create', { userId: item.userId, itemId: item.id });
|
|
39
|
+
const created = await this.prisma.dismissibleItem.create({
|
|
40
|
+
data: {
|
|
41
|
+
id: item.id,
|
|
42
|
+
userId: item.userId,
|
|
43
|
+
createdAt: item.createdAt,
|
|
44
|
+
dismissedAt: item.dismissedAt ?? null,
|
|
45
|
+
metadata: item.metadata ?? client_1.Prisma.JsonNull,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
return this.mapToDto(created);
|
|
49
|
+
}
|
|
50
|
+
async update(item) {
|
|
51
|
+
this.logger.debug('PostgreSQL storage update', { userId: item.userId, itemId: item.id });
|
|
52
|
+
const updated = await this.prisma.dismissibleItem.update({
|
|
53
|
+
where: {
|
|
54
|
+
userId_id: {
|
|
55
|
+
userId: item.userId,
|
|
56
|
+
id: item.id,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
data: {
|
|
60
|
+
dismissedAt: item.dismissedAt ?? null,
|
|
61
|
+
metadata: item.metadata ?? client_1.Prisma.JsonNull,
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
return this.mapToDto(updated);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Map a Prisma model to a DismissibleItemDto.
|
|
68
|
+
*/
|
|
69
|
+
mapToDto(item) {
|
|
70
|
+
return this.itemFactory.create({
|
|
71
|
+
id: item.id,
|
|
72
|
+
userId: item.userId,
|
|
73
|
+
createdAt: item.createdAt,
|
|
74
|
+
dismissedAt: item.dismissedAt ?? undefined,
|
|
75
|
+
metadata: item.metadata ?? undefined,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
exports.PostgresStorageAdapter = PostgresStorageAdapter;
|
|
80
|
+
exports.PostgresStorageAdapter = PostgresStorageAdapter = tslib_1.__decorate([
|
|
81
|
+
(0, common_1.Injectable)(),
|
|
82
|
+
tslib_1.__param(1, (0, common_1.Inject)(nestjs_logger_1.DISMISSIBLE_LOGGER)),
|
|
83
|
+
tslib_1.__metadata("design:paramtypes", [prisma_service_1.PrismaService, Object, nestjs_dismissible_item_1.DismissibleItemFactory])
|
|
84
|
+
], PostgresStorageAdapter);
|
|
85
|
+
//# sourceMappingURL=postgres-storage.adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postgres-storage.adapter.js","sourceRoot":"","sources":["../../../../libs/postgres-storage/src/postgres-storage.adapter.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PostgresStorageConfig = exports.DISMISSIBLE_POSTGRES_STORAGE_CONFIG = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const class_validator_1 = require("class-validator");
|
|
6
|
+
/**
|
|
7
|
+
* Injection token for the PostgresStorage configuration.
|
|
8
|
+
*/
|
|
9
|
+
exports.DISMISSIBLE_POSTGRES_STORAGE_CONFIG = Symbol('DISMISSIBLE_POSTGRES_STORAGE_CONFIG');
|
|
10
|
+
class PostgresStorageConfig {
|
|
11
|
+
}
|
|
12
|
+
exports.PostgresStorageConfig = PostgresStorageConfig;
|
|
13
|
+
tslib_1.__decorate([
|
|
14
|
+
(0, class_validator_1.IsString)(),
|
|
15
|
+
tslib_1.__metadata("design:type", String)
|
|
16
|
+
], PostgresStorageConfig.prototype, "connectionString", void 0);
|
|
17
|
+
//# sourceMappingURL=postgres-storage.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postgres-storage.config.js","sourceRoot":"","sources":["../../../../libs/postgres-storage/src/postgres-storage.config.ts"],"names":[],"mappings":";;;;AAAA,qDAA2C;AAE3C;;GAEG;AACU,QAAA,mCAAmC,GAAG,MAAM,CAAC,qCAAqC,CAAC,CAAC;AAEjG,MAAa,qBAAqB;CAGjC;AAHD,sDAGC;AADiB;IADf,IAAA,0BAAQ,GAAE;;+DAC+B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DynamicModule, ModuleMetadata } from '@nestjs/common';
|
|
2
|
+
export interface PostgresStorageModuleOptions {
|
|
3
|
+
connectionString: string;
|
|
4
|
+
}
|
|
5
|
+
export interface PostgresStorageModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
6
|
+
inject?: any[];
|
|
7
|
+
useFactory: (...args: any[]) => PostgresStorageModuleOptions | Promise<PostgresStorageModuleOptions>;
|
|
8
|
+
}
|
|
9
|
+
export declare class PostgresStorageModule {
|
|
10
|
+
static forRoot(options: PostgresStorageModuleOptions): DynamicModule;
|
|
11
|
+
static forRootAsync(options: PostgresStorageModuleAsyncOptions): DynamicModule;
|
|
12
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var PostgresStorageModule_1;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.PostgresStorageModule = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const common_1 = require("@nestjs/common");
|
|
7
|
+
const nestjs_storage_1 = require("@dismissible/nestjs-storage");
|
|
8
|
+
const postgres_storage_adapter_1 = require("./postgres-storage.adapter");
|
|
9
|
+
const prisma_service_1 = require("./prisma.service");
|
|
10
|
+
const nestjs_dismissible_item_1 = require("@dismissible/nestjs-dismissible-item");
|
|
11
|
+
const nestjs_logger_1 = require("@dismissible/nestjs-logger");
|
|
12
|
+
const postgres_storage_config_1 = require("./postgres-storage.config");
|
|
13
|
+
let PostgresStorageModule = PostgresStorageModule_1 = class PostgresStorageModule {
|
|
14
|
+
static forRoot(options) {
|
|
15
|
+
return {
|
|
16
|
+
module: PostgresStorageModule_1,
|
|
17
|
+
imports: [nestjs_dismissible_item_1.DismissibleItemModule],
|
|
18
|
+
providers: [
|
|
19
|
+
{
|
|
20
|
+
provide: postgres_storage_config_1.DISMISSIBLE_POSTGRES_STORAGE_CONFIG,
|
|
21
|
+
useValue: {
|
|
22
|
+
connectionString: options.connectionString,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
provide: prisma_service_1.PrismaService,
|
|
27
|
+
useFactory(config, logger) {
|
|
28
|
+
return new prisma_service_1.PrismaService(config, logger);
|
|
29
|
+
},
|
|
30
|
+
inject: [postgres_storage_config_1.DISMISSIBLE_POSTGRES_STORAGE_CONFIG, nestjs_logger_1.DISMISSIBLE_LOGGER],
|
|
31
|
+
},
|
|
32
|
+
postgres_storage_adapter_1.PostgresStorageAdapter,
|
|
33
|
+
{
|
|
34
|
+
provide: nestjs_storage_1.DISMISSIBLE_STORAGE_ADAPTER,
|
|
35
|
+
useExisting: postgres_storage_adapter_1.PostgresStorageAdapter,
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
exports: [nestjs_storage_1.DISMISSIBLE_STORAGE_ADAPTER],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
static forRootAsync(options) {
|
|
42
|
+
return {
|
|
43
|
+
module: PostgresStorageModule_1,
|
|
44
|
+
imports: [...(options.imports || []), nestjs_dismissible_item_1.DismissibleItemModule],
|
|
45
|
+
providers: [
|
|
46
|
+
{
|
|
47
|
+
provide: postgres_storage_config_1.DISMISSIBLE_POSTGRES_STORAGE_CONFIG,
|
|
48
|
+
useFactory: options.useFactory,
|
|
49
|
+
inject: options.inject || [],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
provide: prisma_service_1.PrismaService,
|
|
53
|
+
useFactory(config, logger) {
|
|
54
|
+
return new prisma_service_1.PrismaService(config, logger);
|
|
55
|
+
},
|
|
56
|
+
inject: [postgres_storage_config_1.DISMISSIBLE_POSTGRES_STORAGE_CONFIG, nestjs_logger_1.DISMISSIBLE_LOGGER],
|
|
57
|
+
},
|
|
58
|
+
postgres_storage_adapter_1.PostgresStorageAdapter,
|
|
59
|
+
{
|
|
60
|
+
provide: nestjs_storage_1.DISMISSIBLE_STORAGE_ADAPTER,
|
|
61
|
+
useExisting: postgres_storage_adapter_1.PostgresStorageAdapter,
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
exports: [nestjs_storage_1.DISMISSIBLE_STORAGE_ADAPTER],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
exports.PostgresStorageModule = PostgresStorageModule;
|
|
69
|
+
exports.PostgresStorageModule = PostgresStorageModule = PostgresStorageModule_1 = tslib_1.__decorate([
|
|
70
|
+
(0, common_1.Module)({})
|
|
71
|
+
], PostgresStorageModule);
|
|
72
|
+
//# sourceMappingURL=postgres-storage.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postgres-storage.module.js","sourceRoot":"","sources":["../../../../libs/postgres-storage/src/postgres-storage.module.ts"],"names":[],"mappings":";;;;;AAAA,2CAAuE;AACvE,gEAA0E;AAC1E,yEAAoE;AACpE,qDAAiD;AACjD,kFAA6E;AAC7E,8DAAoF;AACpF,uEAGmC;AAc5B,IAAM,qBAAqB,6BAA3B,MAAM,qBAAqB;IAChC,MAAM,CAAC,OAAO,CAAC,OAAqC;QAClD,OAAO;YACL,MAAM,EAAE,uBAAqB;YAC7B,OAAO,EAAE,CAAC,+CAAqB,CAAC;YAChC,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,6DAAmC;oBAC5C,QAAQ,EAAE;wBACR,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;qBAC3C;iBACF;gBACD;oBACE,OAAO,EAAE,8BAAa;oBACtB,UAAU,CAAC,MAA6B,EAAE,MAA0B;wBAClE,OAAO,IAAI,8BAAa,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;oBAC3C,CAAC;oBACD,MAAM,EAAE,CAAC,6DAAmC,EAAE,kCAAkB,CAAC;iBAClE;gBACD,iDAAsB;gBACtB;oBACE,OAAO,EAAE,4CAA2B;oBACpC,WAAW,EAAE,iDAAsB;iBACpC;aACF;YACD,OAAO,EAAE,CAAC,4CAA2B,CAAC;SACvC,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,YAAY,CAAC,OAA0C;QAC5D,OAAO;YACL,MAAM,EAAE,uBAAqB;YAC7B,OAAO,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,+CAAqB,CAAC;YAC5D,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,6DAAmC;oBAC5C,UAAU,EAAE,OAAO,CAAC,UAAU;oBAC9B,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;iBAC7B;gBACD;oBACE,OAAO,EAAE,8BAAa;oBACtB,UAAU,CAAC,MAA6B,EAAE,MAA0B;wBAClE,OAAO,IAAI,8BAAa,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;oBAC3C,CAAC;oBACD,MAAM,EAAE,CAAC,6DAAmC,EAAE,kCAAkB,CAAC;iBAClE;gBACD,iDAAsB;gBACtB;oBACE,OAAO,EAAE,4CAA2B;oBACpC,WAAW,EAAE,iDAAsB;iBACpC;aACF;YACD,OAAO,EAAE,CAAC,4CAA2B,CAAC;SACvC,CAAC;IACJ,CAAC;CACF,CAAA;AAvDY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,qBAAqB,CAuDjC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OnModuleInit, OnModuleDestroy } from '@nestjs/common';
|
|
2
|
+
import { PrismaClient } from '../prisma/generated/prisma/client';
|
|
3
|
+
import { IDismissibleLogger } from '@dismissible/nestjs-logger';
|
|
4
|
+
import { PostgresStorageConfig } from './postgres-storage.config';
|
|
5
|
+
/**
|
|
6
|
+
* PrismaService wraps the PrismaClient and handles connection lifecycle.
|
|
7
|
+
* It connects to the database on module initialization and disconnects on shutdown.
|
|
8
|
+
*/
|
|
9
|
+
export declare class PrismaService extends PrismaClient implements OnModuleInit, OnModuleDestroy {
|
|
10
|
+
private readonly config;
|
|
11
|
+
private readonly logger;
|
|
12
|
+
constructor(config: PostgresStorageConfig, logger: IDismissibleLogger);
|
|
13
|
+
onModuleInit(): Promise<void>;
|
|
14
|
+
onModuleDestroy(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PrismaService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const client_1 = require("../prisma/generated/prisma/client");
|
|
7
|
+
const adapter_pg_1 = require("@prisma/adapter-pg");
|
|
8
|
+
const pg_1 = require("pg");
|
|
9
|
+
const nestjs_logger_1 = require("@dismissible/nestjs-logger");
|
|
10
|
+
const postgres_storage_config_1 = require("./postgres-storage.config");
|
|
11
|
+
/**
|
|
12
|
+
* PrismaService wraps the PrismaClient and handles connection lifecycle.
|
|
13
|
+
* It connects to the database on module initialization and disconnects on shutdown.
|
|
14
|
+
*/
|
|
15
|
+
let PrismaService = class PrismaService extends client_1.PrismaClient {
|
|
16
|
+
constructor(config, logger) {
|
|
17
|
+
const pool = new pg_1.Pool({ connectionString: config.connectionString });
|
|
18
|
+
const adapter = new adapter_pg_1.PrismaPg(pool);
|
|
19
|
+
super({ adapter });
|
|
20
|
+
this.config = config;
|
|
21
|
+
this.logger = logger;
|
|
22
|
+
}
|
|
23
|
+
async onModuleInit() {
|
|
24
|
+
this.logger.debug('Connecting to PostgreSQL database');
|
|
25
|
+
await this.$connect();
|
|
26
|
+
this.logger.debug('Connected to PostgreSQL database');
|
|
27
|
+
}
|
|
28
|
+
async onModuleDestroy() {
|
|
29
|
+
this.logger.debug('Disconnecting from PostgreSQL database');
|
|
30
|
+
await this.$disconnect();
|
|
31
|
+
this.logger.debug('Disconnected from PostgreSQL database');
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
exports.PrismaService = PrismaService;
|
|
35
|
+
exports.PrismaService = PrismaService = tslib_1.__decorate([
|
|
36
|
+
(0, common_1.Injectable)(),
|
|
37
|
+
tslib_1.__param(1, (0, common_1.Inject)(nestjs_logger_1.DISMISSIBLE_LOGGER)),
|
|
38
|
+
tslib_1.__metadata("design:paramtypes", [postgres_storage_config_1.PostgresStorageConfig, Object])
|
|
39
|
+
], PrismaService);
|
|
40
|
+
//# sourceMappingURL=prisma.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prisma.service.js","sourceRoot":"","sources":["../../../../libs/postgres-storage/src/prisma.service.ts"],"names":[],"mappings":";;;;AAAA,2CAAmF;AACnF,8DAAiE;AACjE,mDAA8C;AAC9C,2BAA0B;AAC1B,8DAAoF;AACpF,uEAAkE;AAElE;;;GAGG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,qBAAY;IAC7C,YACmB,MAA6B,EACD,MAA0B;QAEvE,MAAM,IAAI,GAAG,IAAI,SAAI,CAAC,EAAE,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;QACrE,MAAM,OAAO,GAAG,IAAI,qBAAQ,CAAC,IAAI,CAAC,CAAC;QACnC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;QALF,WAAM,GAAN,MAAM,CAAuB;QACD,WAAM,GAAN,MAAM,CAAoB;IAKzE,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACvD,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;QACtB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACxD,CAAC;IAED,KAAK,CAAC,eAAe;QACnB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAC5D,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QACzB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC7D,CAAC;CACF,CAAA;AArBY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;IAIR,mBAAA,IAAA,eAAM,EAAC,kCAAkB,CAAC,CAAA;6CADF,+CAAqB;GAFrC,aAAa,CAqBzB"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { join } from 'path';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* Returns the absolute path to the Prisma schema file.
|
|
5
3
|
* Useful for consumers who need to run prisma commands programmatically.
|
|
@@ -12,6 +10,4 @@ import { join } from 'path';
|
|
|
12
10
|
* execSync(`npx prisma generate --schema=${getSchemaPath()}`);
|
|
13
11
|
* ```
|
|
14
12
|
*/
|
|
15
|
-
export function getSchemaPath(): string
|
|
16
|
-
return join(__dirname, '..', 'prisma', 'schema.prisma');
|
|
17
|
-
}
|
|
13
|
+
export declare function getSchemaPath(): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSchemaPath = getSchemaPath;
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
/**
|
|
6
|
+
* Returns the absolute path to the Prisma schema file.
|
|
7
|
+
* Useful for consumers who need to run prisma commands programmatically.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import { getSchemaPath } from '@dismissible/nestjs-postgres-storage';
|
|
12
|
+
* import { execSync } from 'child_process';
|
|
13
|
+
*
|
|
14
|
+
* execSync(`npx prisma generate --schema=${getSchemaPath()}`);
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
function getSchemaPath() {
|
|
18
|
+
return (0, path_1.join)(__dirname, '..', 'prisma', 'schema.prisma');
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=schema-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-path.js","sourceRoot":"","sources":["../../../../libs/postgres-storage/src/schema-path.ts"],"names":[],"mappings":";;AAcA,sCAEC;AAhBD,+BAA4B;AAE5B;;;;;;;;;;;GAWG;AACH,SAAgB,aAAa;IAC3B,OAAO,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,eAAe,CAAC,CAAC;AAC1D,CAAC"}
|
package/README.md
DELETED
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
# @dismissible/nestjs-postgres-storage
|
|
2
|
-
|
|
3
|
-
PostgreSQL storage adapter for the Dismissible system using Prisma.
|
|
4
|
-
|
|
5
|
-
> **Part of the Dismissible API** - This library is part of the [Dismissible API](https://dismissible.io) ecosystem. Visit [dismissible.io](https://dismissible.io) for more information and documentation.
|
|
6
|
-
|
|
7
|
-
## Overview
|
|
8
|
-
|
|
9
|
-
This library provides a production-ready PostgreSQL storage adapter for the Dismissible system. It uses Prisma for database access and includes:
|
|
10
|
-
|
|
11
|
-
- Persistent storage of dismissible items
|
|
12
|
-
- Automatic database migrations via Prisma
|
|
13
|
-
- Connection pooling and lifecycle management
|
|
14
|
-
- Full TypeScript support
|
|
15
|
-
|
|
16
|
-
## Installation
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
npm install @dismissible/nestjs-postgres-storage
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
You'll also need to install the peer dependencies:
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
npm install @dismissible/nestjs-storage @dismissible/nestjs-dismissible-item @dismissible/nestjs-logger prisma
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Prerequisites
|
|
29
|
-
|
|
30
|
-
- PostgreSQL database (version 12 or higher)
|
|
31
|
-
- Node.js 18 or higher
|
|
32
|
-
|
|
33
|
-
## Getting Started
|
|
34
|
-
|
|
35
|
-
### 1. Database Setup
|
|
36
|
-
|
|
37
|
-
First, set up your PostgreSQL database connection string:
|
|
38
|
-
|
|
39
|
-
```env
|
|
40
|
-
DISMISSIBLE_POSTGRES_STORAGE_CONNECTION_STRING=postgresql://user:password@localhost:5432/dismissible
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### 2. Database Migration
|
|
44
|
-
|
|
45
|
-
Run Prisma migrations to set up the database schema:
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
# Generate Prisma client
|
|
49
|
-
npx prisma generate --schema=node_modules/@dismissible/nestjs-postgres-storage/prisma/schema.prisma
|
|
50
|
-
|
|
51
|
-
# Push schema to database (for development)
|
|
52
|
-
npx prisma db push --schema=node_modules/@dismissible/nestjs-postgres-storage/prisma/schema.prisma
|
|
53
|
-
|
|
54
|
-
# Or run migrations (for production)
|
|
55
|
-
npx prisma migrate dev --schema=node_modules/@dismissible/nestjs-postgres-storage/prisma/schema.prisma
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Alternatively, you can use the provided CLI tool:
|
|
59
|
-
|
|
60
|
-
```bash
|
|
61
|
-
npx dismissible-prisma generate
|
|
62
|
-
npx dismissible-prisma migrate dev
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### 3. Module Configuration
|
|
66
|
-
|
|
67
|
-
Import and configure the module in your NestJS application:
|
|
68
|
-
|
|
69
|
-
```typescript
|
|
70
|
-
import { Module } from '@nestjs/common';
|
|
71
|
-
import { DismissibleModule } from '@dismissible/nestjs-dismissible';
|
|
72
|
-
import { PostgresStorageModule } from '@dismissible/nestjs-postgres-storage';
|
|
73
|
-
import { LoggerModule } from '@dismissible/nestjs-logger';
|
|
74
|
-
|
|
75
|
-
@Module({
|
|
76
|
-
imports: [
|
|
77
|
-
LoggerModule.forRoot({}),
|
|
78
|
-
PostgresStorageModule.forRoot({
|
|
79
|
-
connectionString: process.env.DISMISSIBLE_POSTGRES_STORAGE_CONNECTION_STRING!,
|
|
80
|
-
}),
|
|
81
|
-
DismissibleModule.forRoot({
|
|
82
|
-
storage: PostgresStorageModule,
|
|
83
|
-
}),
|
|
84
|
-
],
|
|
85
|
-
})
|
|
86
|
-
export class AppModule {}
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### 4. Async Configuration
|
|
90
|
-
|
|
91
|
-
You can also configure the module asynchronously:
|
|
92
|
-
|
|
93
|
-
```typescript
|
|
94
|
-
import { Module } from '@nestjs/common';
|
|
95
|
-
import { ConfigModule, ConfigService } from '@nestjs/config';
|
|
96
|
-
import { PostgresStorageModule } from '@dismissible/nestjs-postgres-storage';
|
|
97
|
-
|
|
98
|
-
@Module({
|
|
99
|
-
imports: [
|
|
100
|
-
ConfigModule.forRoot(),
|
|
101
|
-
PostgresStorageModule.forRootAsync({
|
|
102
|
-
imports: [ConfigModule],
|
|
103
|
-
useFactory: (config: ConfigService) => ({
|
|
104
|
-
connectionString: config.get<string>('DISMISSIBLE_POSTGRES_STORAGE_CONNECTION_STRING')!,
|
|
105
|
-
}),
|
|
106
|
-
inject: [ConfigService],
|
|
107
|
-
}),
|
|
108
|
-
],
|
|
109
|
-
})
|
|
110
|
-
export class AppModule {}
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
## Database Schema
|
|
114
|
-
|
|
115
|
-
The library uses Prisma to manage the database schema. The schema includes:
|
|
116
|
-
|
|
117
|
-
- `DismissibleItem` table with fields:
|
|
118
|
-
- `id` (String, primary key)
|
|
119
|
-
- `userId` (String, indexed)
|
|
120
|
-
- `createdAt` (DateTime)
|
|
121
|
-
- `dismissedAt` (DateTime, nullable)
|
|
122
|
-
- `metadata` (Json, nullable)
|
|
123
|
-
|
|
124
|
-
## API Reference
|
|
125
|
-
|
|
126
|
-
### PostgresStorageModule
|
|
127
|
-
|
|
128
|
-
#### `PostgresStorageModule.forRoot(options)`
|
|
129
|
-
|
|
130
|
-
Configures the PostgreSQL storage module synchronously.
|
|
131
|
-
|
|
132
|
-
**Options:**
|
|
133
|
-
|
|
134
|
-
- `connectionString: string` - PostgreSQL connection string
|
|
135
|
-
|
|
136
|
-
**Returns:** `DynamicModule`
|
|
137
|
-
|
|
138
|
-
#### `PostgresStorageModule.forRootAsync(options)`
|
|
139
|
-
|
|
140
|
-
Configures the PostgreSQL storage module asynchronously.
|
|
141
|
-
|
|
142
|
-
**Options:**
|
|
143
|
-
|
|
144
|
-
- `imports?: any[]` - Modules to import
|
|
145
|
-
- `useFactory: (deps) => PostgresStorageModuleOptions` - Factory function
|
|
146
|
-
- `inject?: any[]` - Dependencies to inject into the factory
|
|
147
|
-
|
|
148
|
-
**Returns:** `DynamicModule`
|
|
149
|
-
|
|
150
|
-
### PostgresStorageAdapter
|
|
151
|
-
|
|
152
|
-
The adapter implements `IDismissibleStorage` and provides:
|
|
153
|
-
|
|
154
|
-
- `get(userId, itemId)` - Retrieve an item
|
|
155
|
-
- `create(item)` - Create a new item
|
|
156
|
-
- `update(item)` - Update an existing item
|
|
157
|
-
|
|
158
|
-
### PrismaService
|
|
159
|
-
|
|
160
|
-
The service manages the Prisma client lifecycle:
|
|
161
|
-
|
|
162
|
-
- Automatically connects on module initialization
|
|
163
|
-
- Automatically disconnects on module destruction
|
|
164
|
-
- Uses connection pooling via `pg` adapter
|
|
165
|
-
|
|
166
|
-
## CLI Tool
|
|
167
|
-
|
|
168
|
-
The package includes a CLI tool for Prisma operations:
|
|
169
|
-
|
|
170
|
-
```bash
|
|
171
|
-
# Generate Prisma client
|
|
172
|
-
npx dismissible-prisma generate
|
|
173
|
-
|
|
174
|
-
# Run migrations
|
|
175
|
-
npx dismissible-prisma migrate dev
|
|
176
|
-
|
|
177
|
-
# Push schema (development)
|
|
178
|
-
npx dismissible-prisma db push
|
|
179
|
-
|
|
180
|
-
# View database
|
|
181
|
-
npx dismissible-prisma studio
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
## Environment Variables
|
|
185
|
-
|
|
186
|
-
- `DISMISSIBLE_POSTGRES_STORAGE_CONNECTION_STRING` - PostgreSQL connection string (required)
|
|
187
|
-
|
|
188
|
-
## Production Considerations
|
|
189
|
-
|
|
190
|
-
1. **Connection Pooling**: The adapter uses `pg` connection pooling. Configure your pool size based on your application's needs.
|
|
191
|
-
|
|
192
|
-
2. **Migrations**: Always use Prisma migrations in production:
|
|
193
|
-
|
|
194
|
-
```bash
|
|
195
|
-
npx prisma migrate deploy --schema=node_modules/@dismissible/nestjs-postgres-storage/prisma/schema.prisma
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
3. **Monitoring**: Monitor database connections and query performance.
|
|
199
|
-
|
|
200
|
-
4. **Backups**: Ensure regular database backups are in place.
|
|
201
|
-
|
|
202
|
-
## Related Packages
|
|
203
|
-
|
|
204
|
-
- `@dismissible/nestjs-dismissible` - Main dismissible service
|
|
205
|
-
- `@dismissible/nestjs-storage` - Storage interface
|
|
206
|
-
- `@dismissible/nestjs-dismissible-item` - Data models
|
|
207
|
-
- `@dismissible/nestjs-logger` - Logging
|
|
208
|
-
|
|
209
|
-
## License
|
|
210
|
-
|
|
211
|
-
MIT
|
package/jest.config.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
displayName: 'postgres-storage',
|
|
3
|
-
preset: '../../jest.preset.js',
|
|
4
|
-
testEnvironment: 'node',
|
|
5
|
-
transform: {
|
|
6
|
-
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.json' }],
|
|
7
|
-
},
|
|
8
|
-
moduleFileExtensions: ['ts', 'js', 'html'],
|
|
9
|
-
coverageDirectory: '../../coverage/libs/postgres-storage',
|
|
10
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
|
|
3
|
-
/* eslint-disable */
|
|
4
|
-
// biome-ignore-all lint: generated file
|
|
5
|
-
// @ts-nocheck
|
|
6
|
-
/*
|
|
7
|
-
* This file should be your main import to use Prisma-related types and utilities in a browser.
|
|
8
|
-
* Use it to get access to models, enums, and input types.
|
|
9
|
-
*
|
|
10
|
-
* This file does not contain a `PrismaClient` class, nor several other helpers that are intended as server-side only.
|
|
11
|
-
* See `client.ts` for the standard, server-side entry point.
|
|
12
|
-
*
|
|
13
|
-
* 🟢 You can import this file directly.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
import * as Prisma from './internal/prismaNamespaceBrowser'
|
|
17
|
-
export { Prisma }
|
|
18
|
-
export * as $Enums from './enums'
|
|
19
|
-
export * from './enums';
|
|
20
|
-
/**
|
|
21
|
-
* Model DismissibleItem
|
|
22
|
-
*
|
|
23
|
-
*/
|
|
24
|
-
export type DismissibleItem = Prisma.DismissibleItemModel
|