@quazex/nestjs-postgres 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { InjectionToken, ModuleMetadata, OptionalFactoryDependency, Type } from '@nestjs/common';
|
|
2
|
-
import {
|
|
3
|
-
export interface
|
|
4
|
-
createPostgresOptions(): Promise<
|
|
2
|
+
import { PostgresOptions } from './postgres.types';
|
|
3
|
+
export interface PostgresOptionsFactory {
|
|
4
|
+
createPostgresOptions(): Promise<PostgresOptions> | PostgresOptions;
|
|
5
5
|
}
|
|
6
|
-
export interface
|
|
6
|
+
export interface PostgresAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
7
7
|
inject?: Array<InjectionToken | OptionalFactoryDependency>;
|
|
8
|
-
useExisting?: Type<
|
|
9
|
-
useFactory?: (...args: any[]) => Promise<
|
|
8
|
+
useExisting?: Type<PostgresOptionsFactory>;
|
|
9
|
+
useFactory?: (...args: any[]) => Promise<PostgresOptions> | PostgresOptions;
|
|
10
10
|
}
|
package/lib/postgres.module.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DynamicModule, OnApplicationShutdown } from '@nestjs/common';
|
|
2
2
|
import { Sql } from 'postgres';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { PostgresAsyncOptions } from './postgres.interfaces';
|
|
4
|
+
import { PostgresOptions } from './postgres.types';
|
|
5
5
|
export declare class PostgresModule implements OnApplicationShutdown {
|
|
6
6
|
private readonly client;
|
|
7
7
|
constructor(client: Sql);
|
|
8
8
|
onApplicationShutdown(): Promise<void>;
|
|
9
|
-
static forRoot(options:
|
|
10
|
-
static forRootAsync(asyncOptions:
|
|
9
|
+
static forRoot(options: PostgresOptions): DynamicModule;
|
|
10
|
+
static forRootAsync(asyncOptions: PostgresAsyncOptions): DynamicModule;
|
|
11
11
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FactoryProvider, Provider, ValueProvider } from '@nestjs/common';
|
|
2
2
|
import { Sql } from 'postgres';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { PostgresAsyncOptions } from './postgres.interfaces';
|
|
4
|
+
import { PostgresOptions } from './postgres.types';
|
|
5
5
|
export declare class PostgresProviders {
|
|
6
|
-
static getOptions(options:
|
|
7
|
-
static getAsyncOptions(options:
|
|
6
|
+
static getOptions(options: PostgresOptions): ValueProvider<PostgresOptions>;
|
|
7
|
+
static getAsyncOptions(options: PostgresAsyncOptions): Provider<PostgresOptions>;
|
|
8
8
|
static getClient(): FactoryProvider<Sql>;
|
|
9
9
|
}
|
package/lib/postgres.types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Options, PostgresType } from 'postgres';
|
|
2
|
-
export type
|
|
2
|
+
export type PostgresOptions = Options<Record<string, PostgresType>>;
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"url": "git://github.com/quazex/nestjs-postgres.git"
|
|
6
6
|
},
|
|
7
7
|
"description": "NestJS module for Postgres library",
|
|
8
|
-
"version": "1.0.
|
|
8
|
+
"version": "1.0.1",
|
|
9
9
|
"author": "Alexander Smirnov",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"engines": {
|
|
@@ -43,18 +43,18 @@
|
|
|
43
43
|
"postgres": ">=3.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@faker-js/faker": "9.
|
|
46
|
+
"@faker-js/faker": "9.9.0",
|
|
47
47
|
"@jest/globals": "29.7.0",
|
|
48
48
|
"@nestjs/common": "11.1.17",
|
|
49
49
|
"@nestjs/testing": "11.1.17",
|
|
50
|
-
"@quazex/eslint-config": "1.1.
|
|
50
|
+
"@quazex/eslint-config": "1.1.3",
|
|
51
51
|
"@testcontainers/postgresql": "11.13.0",
|
|
52
52
|
"husky": "9.1.7",
|
|
53
53
|
"jest": "29.7.0",
|
|
54
54
|
"postgres": "3.4.8",
|
|
55
|
-
"rimraf": "6.
|
|
55
|
+
"rimraf": "6.1.3",
|
|
56
56
|
"testcontainers": "11.13.0",
|
|
57
|
-
"ts-jest": "29.4.
|
|
57
|
+
"ts-jest": "29.4.6",
|
|
58
58
|
"ts-node": "10.9.2",
|
|
59
59
|
"typescript": "5.9.3"
|
|
60
60
|
}
|