nodecommons-esm-database-postgres-pg 0.0.2
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.mts +4 -0
- package/dist/index.mjs +5 -0
- package/dist/index.mjs.map +1 -0
- package/dist/interfaces/icommons-postgres-pg-credentials.d.mts +6 -0
- package/dist/interfaces/icommons-postgres-pg-credentials.mjs +12 -0
- package/dist/interfaces/icommons-postgres-pg-credentials.mjs.map +1 -0
- package/dist/services/commons-postgres-pg-pooled.service.d.mts +15 -0
- package/dist/services/commons-postgres-pg-pooled.service.mjs +80 -0
- package/dist/services/commons-postgres-pg-pooled.service.mjs.map +1 -0
- package/dist/services/commons-postgres-pg-unpooled.service.d.mts +15 -0
- package/dist/services/commons-postgres-pg-unpooled.service.mjs +82 -0
- package/dist/services/commons-postgres-pg-unpooled.service.mjs.map +1 -0
- package/package.json +34 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CommonsPostgresPgPooledService } from './services/commons-postgres-pg-pooled.service.mjs';
|
|
2
|
+
import { CommonsPostgresPgUnpooledService } from './services/commons-postgres-pg-unpooled.service.mjs';
|
|
3
|
+
import { ICommonsPostgresPgCredentials, isICommonsPostgresPgCredentials } from './interfaces/icommons-postgres-pg-credentials.mjs';
|
|
4
|
+
export { CommonsPostgresPgPooledService, CommonsPostgresPgUnpooledService, ICommonsPostgresPgCredentials, isICommonsPostgresPgCredentials };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CommonsPostgresPgPooledService } from './services/commons-postgres-pg-pooled.service.mjs';
|
|
2
|
+
import { CommonsPostgresPgUnpooledService } from './services/commons-postgres-pg-unpooled.service.mjs';
|
|
3
|
+
import { isICommonsPostgresPgCredentials } from './interfaces/icommons-postgres-pg-credentials.mjs';
|
|
4
|
+
export { CommonsPostgresPgPooledService, CommonsPostgresPgUnpooledService, isICommonsPostgresPgCredentials };
|
|
5
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,mDAAmD,CAAC;AACnG,OAAO,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AACvG,OAAO,EAAiC,+BAA+B,EAAE,MAAM,mDAAmD,CAAC;AACnI,OAAO,EACN,8BAA8B,EAC9B,gCAAgC,EAEhC,+BAA+B,EAC/B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ICommonsCredentials } from 'nodecommons-esm-database';
|
|
2
|
+
export interface ICommonsPostgresPgCredentials extends ICommonsCredentials {
|
|
3
|
+
user: string;
|
|
4
|
+
password: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function isICommonsPostgresPgCredentials(test: any): test is ICommonsPostgresPgCredentials;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { commonsTypeHasPropertyString } from 'tscommons-esm-core';
|
|
2
|
+
import { isICommonsCredentials } from 'nodecommons-esm-database';
|
|
3
|
+
export function isICommonsPostgresPgCredentials(test) {
|
|
4
|
+
if (!isICommonsCredentials(test))
|
|
5
|
+
return false;
|
|
6
|
+
if (!commonsTypeHasPropertyString(test, 'user'))
|
|
7
|
+
return false;
|
|
8
|
+
if (!commonsTypeHasPropertyString(test, 'password'))
|
|
9
|
+
return false;
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=icommons-postgres-pg-credentials.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icommons-postgres-pg-credentials.mjs","sourceRoot":"","sources":["../../src/interfaces/icommons-postgres-pg-credentials.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAElE,OAAO,EAAuB,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAOtF,MAAM,UAAU,+BAA+B,CAAC,IAAS;IACxD,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IAE/C,IAAI,CAAC,4BAA4B,CAAC,IAAI,EAAE,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9D,IAAI,CAAC,4BAA4B,CAAC,IAAI,EAAE,UAAU,CAAC;QAAE,OAAO,KAAK,CAAC;IAElE,OAAO,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TCommonsDatabaseDbValues } from 'nodecommons-esm-database';
|
|
2
|
+
import { CommonsSqlDatabaseService } from 'nodecommons-esm-database';
|
|
3
|
+
import { ICommonsPostgresPgCredentials } from '../interfaces/icommons-postgres-pg-credentials.mjs';
|
|
4
|
+
export declare class CommonsPostgresPgPooledService extends CommonsSqlDatabaseService<ICommonsPostgresPgCredentials> {
|
|
5
|
+
private maxPoolSize;
|
|
6
|
+
private pool;
|
|
7
|
+
constructor(credentials: ICommonsPostgresPgCredentials, maxPoolSize: number);
|
|
8
|
+
connect(): Promise<void>;
|
|
9
|
+
doesTableExist(name: string): Promise<boolean>;
|
|
10
|
+
internalSelect<ParamDbValuesT extends TCommonsDatabaseDbValues, ResultDbValuesT extends TCommonsDatabaseDbValues>(sql: string, params?: ParamDbValuesT): Promise<ResultDbValuesT[]>;
|
|
11
|
+
internalNone<ParamDbValuesT extends TCommonsDatabaseDbValues>(sql: string, params?: ParamDbValuesT): Promise<void>;
|
|
12
|
+
protected internalTransactionBegin(): Promise<void>;
|
|
13
|
+
protected internalTransactionCommit(): Promise<void>;
|
|
14
|
+
protected internalTransactionRollback(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as pg from 'pg';
|
|
2
|
+
import { ECommonsDatabaseEngine } from 'nodecommons-esm-database';
|
|
3
|
+
import { CommonsSqlDatabaseService } from 'nodecommons-esm-database';
|
|
4
|
+
function rewriteSqlAndParams(sql, params) {
|
|
5
|
+
let i = 0;
|
|
6
|
+
const linearParams = [];
|
|
7
|
+
for (const field of Object.keys(params)) {
|
|
8
|
+
i++;
|
|
9
|
+
const regex = new RegExp(`:${field}(\\W|$)`, 'g');
|
|
10
|
+
sql = sql.replace(regex, '$' + i.toString(10) + '$1');
|
|
11
|
+
linearParams.push(params[field]);
|
|
12
|
+
}
|
|
13
|
+
return [sql, linearParams];
|
|
14
|
+
}
|
|
15
|
+
export class CommonsPostgresPgPooledService extends CommonsSqlDatabaseService {
|
|
16
|
+
maxPoolSize;
|
|
17
|
+
pool;
|
|
18
|
+
constructor(credentials, maxPoolSize) {
|
|
19
|
+
super(ECommonsDatabaseEngine.POSTGRES, credentials);
|
|
20
|
+
this.maxPoolSize = maxPoolSize;
|
|
21
|
+
}
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
23
|
+
async connect() {
|
|
24
|
+
this.pool = new pg.Pool({
|
|
25
|
+
...this.credentials,
|
|
26
|
+
max: this.maxPoolSize
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
async doesTableExist(name) {
|
|
30
|
+
return (await this.internalSelect(`
|
|
31
|
+
SELECT 1
|
|
32
|
+
FROM information_schema.tables
|
|
33
|
+
WHERE table_schema = 'public'
|
|
34
|
+
AND table_name = ${this.quote(name)}
|
|
35
|
+
`)).length > 0;
|
|
36
|
+
}
|
|
37
|
+
async internalSelect(sql, params) {
|
|
38
|
+
if (!this.pool)
|
|
39
|
+
throw new Error('Database not connected');
|
|
40
|
+
const client = await this.pool.connect();
|
|
41
|
+
try {
|
|
42
|
+
let result;
|
|
43
|
+
if (params) {
|
|
44
|
+
const [parameterisedSql, linearParams] = rewriteSqlAndParams(sql, params);
|
|
45
|
+
result = await client.query({
|
|
46
|
+
text: parameterisedSql,
|
|
47
|
+
values: linearParams
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
result = await client.query({
|
|
52
|
+
text: sql
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return result.rows;
|
|
56
|
+
}
|
|
57
|
+
catch (e) {
|
|
58
|
+
console.error(e);
|
|
59
|
+
throw e;
|
|
60
|
+
}
|
|
61
|
+
finally {
|
|
62
|
+
client.release();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
async internalNone(sql, params) {
|
|
66
|
+
const rows = await this.internalSelect(sql, params);
|
|
67
|
+
if (rows.length !== 0)
|
|
68
|
+
throw new Error('internalNone received rows');
|
|
69
|
+
}
|
|
70
|
+
internalTransactionBegin() {
|
|
71
|
+
throw new Error('Transactions are not supported for pooled pg connections');
|
|
72
|
+
}
|
|
73
|
+
internalTransactionCommit() {
|
|
74
|
+
throw new Error('Transactions are not supported for pooled pg connections');
|
|
75
|
+
}
|
|
76
|
+
internalTransactionRollback() {
|
|
77
|
+
throw new Error('Transactions are not supported for pooled pg connections');
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=commons-postgres-pg-pooled.service.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commons-postgres-pg-pooled.service.mjs","sourceRoot":"","sources":["../../src/services/commons-postgres-pg-pooled.service.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAIzB,OAAO,EAAE,sBAAsB,EAA4B,MAAM,0BAA0B,CAAC;AAC5F,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAIrE,SAAS,mBAAmB,CAC1B,GAAW,EACX,MAAuB;IAExB,IAAI,CAAC,GAAW,CAAC,CAAC;IAClB,MAAM,YAAY,GAAc,EAAE,CAAC;IACnC,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACzC,CAAC,EAAE,CAAC;QACJ,MAAM,KAAK,GAAW,IAAI,MAAM,CAAC,IAAI,KAAK,S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mB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;gBAE5E,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;oBAC1B,IAAI,EAAE,gBAAgB;oBACtB,MAAM,EAAE,YAAY;iBACrB,CAAC,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACP,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;oBAC1B,IAAI,EAAE,GAAG;iBACV,CAAC,CAAC;YACJ,CAAC;YAED,OAAO,MAAM,CAAC,IAAoC,CAAC;QACpD,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACZ,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACjB,MAAM,CAAC,CAAC;QACT,CAAC;gBAAS,CAAC;YACV,MAAM,CAAC,OAAO,EAAE,CAAC;QAClB,CAAC;IACF,CAAC;IAEM,KAAK,CAAC,YAAY,CAGvB,GAAW,EACX,MAAuB;QAExB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QACpD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IACtE,CAAC;IAES,wBAAwB;QACjC,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAC7E,CAAC;IAES,yBAAyB;QAClC,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAC7E,CAAC;IAES,2BAA2B;QACpC,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAC7E,CAAC;CACD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TCommonsDatabaseDbValues } from 'nodecommons-esm-database';
|
|
2
|
+
import { CommonsSqlDatabaseService } from 'nodecommons-esm-database';
|
|
3
|
+
import { ICommonsPostgresPgCredentials } from '../interfaces/icommons-postgres-pg-credentials.mjs';
|
|
4
|
+
export declare class CommonsPostgresPgUnpooledService extends CommonsSqlDatabaseService<ICommonsPostgresPgCredentials> {
|
|
5
|
+
private client;
|
|
6
|
+
constructor(credentials: ICommonsPostgresPgCredentials);
|
|
7
|
+
connect(): Promise<void>;
|
|
8
|
+
end(): Promise<void>;
|
|
9
|
+
doesTableExist(name: string): Promise<boolean>;
|
|
10
|
+
internalSelect<ParamDbValuesT extends TCommonsDatabaseDbValues, ResultDbValuesT extends TCommonsDatabaseDbValues>(sql: string, params?: ParamDbValuesT): Promise<ResultDbValuesT[]>;
|
|
11
|
+
internalNone<ParamDbValuesT extends TCommonsDatabaseDbValues>(sql: string, params?: ParamDbValuesT): Promise<void>;
|
|
12
|
+
protected internalTransactionBegin(): Promise<void>;
|
|
13
|
+
protected internalTransactionCommit(): Promise<void>;
|
|
14
|
+
protected internalTransactionRollback(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as pg from 'pg';
|
|
2
|
+
import { ECommonsDatabaseEngine } from 'nodecommons-esm-database';
|
|
3
|
+
import { CommonsSqlDatabaseService } from 'nodecommons-esm-database';
|
|
4
|
+
function rewriteSqlAndParams(sql, params) {
|
|
5
|
+
let i = 0;
|
|
6
|
+
const linearParams = [];
|
|
7
|
+
for (const field of Object.keys(params)) {
|
|
8
|
+
i++;
|
|
9
|
+
const regex = new RegExp(`:${field}(\\W|$)`, 'g');
|
|
10
|
+
sql = sql.replace(regex, '$' + i.toString(10) + '$1');
|
|
11
|
+
linearParams.push(params[field]);
|
|
12
|
+
}
|
|
13
|
+
return [sql, linearParams];
|
|
14
|
+
}
|
|
15
|
+
export class CommonsPostgresPgUnpooledService extends CommonsSqlDatabaseService {
|
|
16
|
+
client;
|
|
17
|
+
constructor(credentials) {
|
|
18
|
+
super(ECommonsDatabaseEngine.POSTGRES, credentials);
|
|
19
|
+
}
|
|
20
|
+
async connect() {
|
|
21
|
+
this.client = new pg.Client(this.credentials);
|
|
22
|
+
await this.client.connect();
|
|
23
|
+
}
|
|
24
|
+
async end() {
|
|
25
|
+
if (!this.client)
|
|
26
|
+
throw new Error('Database is not connected');
|
|
27
|
+
await this.client.end();
|
|
28
|
+
}
|
|
29
|
+
async doesTableExist(name) {
|
|
30
|
+
return (await this.internalSelect(`
|
|
31
|
+
SELECT 1
|
|
32
|
+
FROM information_schema.tables
|
|
33
|
+
WHERE table_schema = 'public'
|
|
34
|
+
AND table_name = ${this.quote(name)}
|
|
35
|
+
`)).length > 0;
|
|
36
|
+
}
|
|
37
|
+
async internalSelect(sql, params) {
|
|
38
|
+
if (!this.client)
|
|
39
|
+
throw new Error('Database is not connected');
|
|
40
|
+
try {
|
|
41
|
+
let result;
|
|
42
|
+
if (params) {
|
|
43
|
+
const [parameterisedSql, linearParams] = rewriteSqlAndParams(sql, params);
|
|
44
|
+
result = await this.client.query({
|
|
45
|
+
text: parameterisedSql,
|
|
46
|
+
values: linearParams
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
result = await this.client.query({
|
|
51
|
+
text: sql
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return result.rows;
|
|
55
|
+
}
|
|
56
|
+
catch (e) {
|
|
57
|
+
console.error(e);
|
|
58
|
+
throw e;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
async internalNone(sql, params) {
|
|
62
|
+
const rows = await this.internalSelect(sql, params);
|
|
63
|
+
if (rows.length !== 0)
|
|
64
|
+
throw new Error('internalNone received rows');
|
|
65
|
+
}
|
|
66
|
+
async internalTransactionBegin() {
|
|
67
|
+
if (!this.client)
|
|
68
|
+
throw new Error('Database is not connected');
|
|
69
|
+
await this.client.query('BEGIN');
|
|
70
|
+
}
|
|
71
|
+
async internalTransactionCommit() {
|
|
72
|
+
if (!this.client)
|
|
73
|
+
throw new Error('Database is not connected');
|
|
74
|
+
await this.client.query('COMMIT');
|
|
75
|
+
}
|
|
76
|
+
async internalTransactionRollback() {
|
|
77
|
+
if (!this.client)
|
|
78
|
+
throw new Error('Database is not connected');
|
|
79
|
+
await this.client.query('ROLLBACK');
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=commons-postgres-pg-unpooled.service.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commons-postgres-pg-unpooled.service.mjs","sourceRoot":"","sources":["../../src/services/commons-postgres-pg-unpooled.service.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAIzB,OAAO,EAAE,sBAAsB,EAA4B,MAAM,0BAA0B,CAAC;AAC5F,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAIrE,SAAS,mBAAmB,CAC1B,GAAW,EACX,MAAuB;IAExB,IAAI,CAAC,GAAW,CAAC,CAAC;IAClB,MAAM,YAAY,GAAc,EAAE,CAAC;IACnC,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACzC,CAAC,EAAE,CAAC;QACJ,MAAM,KAAK,GAAW,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,GAAG,CAAC,CAAC;QAC1D,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QACtD,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,CAAE,GAAG,EAAE,YAAY,CAAE,CAAC;AAC9B,CAAC;AAED,MAAM,OAAO,gCAAiC,SAAQ,yBAAwD;IACrG,MAAM,CAAsB;IAEpC,YACE,WAA0C;QAE3C,KAAK,CACH,sBAAsB,CAAC,QAAQ,EAC/B,WAAW,CACZ,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,OAAO;QACnB,IAAI,CAAC,MAAM,GAAG,IAAI,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,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AAY,CAGvB,GAAW,EACX,MAAuB;QAExB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QACpD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IACtE,CAAC;IAES,KAAK,CAAC,wBAAwB;QACvC,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAE/D,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAES,KAAK,CAAC,yBAAyB;QACxC,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAE/D,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACnC,CAAC;IAES,KAAK,CAAC,2BAA2B;QAC1C,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAE/D,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACrC,CAAC;CACD"}
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nodecommons-esm-database-postgres-pg",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"tsc": "./node_modules/typescript/bin/tsc",
|
|
7
|
+
"preprepare": "rm -rf ./dist; php ~/Dev/etim.php src/ && npm run tsc",
|
|
8
|
+
"publish-major": "rm -rf dist; npm run tsc && npx eslint . && npm run preprepare && npm version major && npm install && npm publish && git add . && git commit -m 'publish'",
|
|
9
|
+
"publish-minor": "rm -rf dist; npm run tsc && npx eslint . && npm run preprepare && npm version minor && npm install && npm publish && git add . && git commit -m 'publish'",
|
|
10
|
+
"publish-patch": "rm -rf dist; npm run tsc && npx eslint . && npm run preprepare && npm version patch && npm install && npm publish && git add . && git commit -m 'publish'"
|
|
11
|
+
},
|
|
12
|
+
"main": "dist/index.mjs",
|
|
13
|
+
"types": "dist/index.d.mjs",
|
|
14
|
+
"type": "module",
|
|
15
|
+
"author": "Pete Morris",
|
|
16
|
+
"license": "ISC",
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@stylistic/eslint-plugin-ts": "^2.11.0",
|
|
19
|
+
"@types/node": "^22.10.0",
|
|
20
|
+
"eslint-plugin-import": "^2.31.0",
|
|
21
|
+
"eslint-plugin-prefer-arrow-functions": "^3.4.1",
|
|
22
|
+
"typescript": "^5.7.2",
|
|
23
|
+
"typescript-eslint": "^8.16.0"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist/**/*"
|
|
27
|
+
],
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@types/pg": "^8.16.0",
|
|
30
|
+
"nodecommons-esm-database": "^0.3.7",
|
|
31
|
+
"pg": "^8.19.0",
|
|
32
|
+
"tscommons-esm-core": "^0.5.2"
|
|
33
|
+
}
|
|
34
|
+
}
|