@cored3v/web-core 1.0.0 → 1.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/README.md +9 -1
- package/dist/{app → cjs/app}/createApp.d.ts +1 -1
- package/dist/{app → cjs/app}/createApp.js +10 -10
- package/dist/{auth → cjs/auth}/jwt.d.ts +1 -1
- package/dist/{config → cjs/config}/index.d.ts +1 -1
- package/dist/{config → cjs/config}/index.js +1 -1
- package/dist/{db → cjs/db}/index.js +2 -2
- package/dist/cjs/index.d.mts +2 -0
- package/dist/cjs/index.mjs +3 -0
- package/dist/{license → cjs/license}/crypto.js +7 -1
- package/dist/{license → cjs/license}/verify.js +2 -2
- package/dist/cjs/package.json +1 -0
- package/dist/esm/app/createApp.d.ts +6 -0
- package/dist/esm/app/createApp.js +52 -0
- package/dist/esm/app/security.d.ts +2 -0
- package/dist/esm/app/security.js +6 -0
- package/dist/esm/auth/jwt.d.ts +4 -0
- package/dist/esm/auth/jwt.js +21 -0
- package/dist/esm/config/index.d.ts +2 -0
- package/dist/esm/config/index.js +10 -0
- package/dist/esm/db/index.d.ts +15 -0
- package/dist/esm/db/index.js +11 -0
- package/dist/esm/db/postgres.d.ts +12 -0
- package/dist/esm/db/postgres.js +9 -0
- package/dist/esm/index.cjs +20 -0
- package/dist/esm/index.d.cts +2 -0
- package/dist/esm/index.d.mts +2 -0
- package/dist/esm/index.mjs +2 -0
- package/dist/esm/license/crypto.d.ts +1 -0
- package/dist/esm/license/crypto.js +18 -0
- package/dist/esm/license/types.d.ts +7 -0
- package/dist/esm/license/types.js +1 -0
- package/dist/esm/license/verify.d.ts +4 -0
- package/dist/esm/license/verify.js +18 -0
- package/dist/esm/types.d.ts +28 -0
- package/dist/esm/types.js +1 -0
- package/package.json +19 -6
- /package/dist/{app → cjs/app}/security.d.ts +0 -0
- /package/dist/{app → cjs/app}/security.js +0 -0
- /package/dist/{auth → cjs/auth}/jwt.js +0 -0
- /package/dist/{db → cjs/db}/index.d.ts +0 -0
- /package/dist/{db → cjs/db}/postgres.d.ts +0 -0
- /package/dist/{db → cjs/db}/postgres.js +0 -0
- /package/dist/{index.js → cjs/index.cjs} +0 -0
- /package/dist/{index.d.ts → cjs/index.d.cts} +0 -0
- /package/dist/{license → cjs/license}/crypto.d.ts +0 -0
- /package/dist/{license → cjs/license}/types.d.ts +0 -0
- /package/dist/{license → cjs/license}/types.js +0 -0
- /package/dist/{license → cjs/license}/verify.d.ts +0 -0
- /package/dist/{types.d.ts → cjs/types.d.ts} +0 -0
- /package/dist/{types.js → cjs/types.js} +0 -0
package/README.md
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
# @cored3v/web-core
|
|
2
|
+
|
|
3
|
+
A reusable, production-ready **Express.js application core** that provides
|
|
4
|
+
bootstrapping, configuration, authentication, database lifecycle management,
|
|
5
|
+
and **license-based execution enforcement**.
|
|
6
|
+
|
|
7
|
+
This package is designed to protect source code by teams and consultants against unauthorised use.
|
|
8
|
+
|
|
9
|
+
The package supports both ESModule and CommonJS imports.
|
|
@@ -39,16 +39,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.createApp = createApp;
|
|
40
40
|
const express_1 = __importStar(require("express"));
|
|
41
41
|
const http_1 = __importDefault(require("http"));
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
const
|
|
42
|
+
const index_js_1 = require("../config/index.js");
|
|
43
|
+
const verify_js_1 = require("../license/verify.js");
|
|
44
|
+
const security_js_1 = require("./security.js");
|
|
45
|
+
const index_js_2 = require("../db/index.js");
|
|
46
|
+
const jwt_js_1 = require("../auth/jwt.js");
|
|
47
47
|
async function createApp(opts) {
|
|
48
48
|
// 1) CONFIG
|
|
49
|
-
const config = (0,
|
|
49
|
+
const config = (0, index_js_1.loadConfig)();
|
|
50
50
|
// 2) LICENSE GATE
|
|
51
|
-
await (0,
|
|
51
|
+
await (0, verify_js_1.verifyLicense)({
|
|
52
52
|
appId: opts.appId,
|
|
53
53
|
licensePath: config.get("LICENSE_PATH", "./license.json"),
|
|
54
54
|
});
|
|
@@ -59,13 +59,13 @@ async function createApp(opts) {
|
|
|
59
59
|
if (opts.http?.trustProxy)
|
|
60
60
|
app.set("trust proxy", true);
|
|
61
61
|
// 4) CORE MIDDLEWARE
|
|
62
|
-
(0,
|
|
62
|
+
(0, security_js_1.applySecurity)(app);
|
|
63
63
|
app.use(express_1.default.json());
|
|
64
64
|
app.use(express_1.default.urlencoded({ extended: false }));
|
|
65
65
|
// 5) DB (non-optional if declared)
|
|
66
|
-
const db = await (0,
|
|
66
|
+
const db = await (0, index_js_2.initDb)(opts.db);
|
|
67
67
|
// 6) AUTH
|
|
68
|
-
const auth = (0,
|
|
68
|
+
const auth = (0, jwt_js_1.initJwtAuth)(config);
|
|
69
69
|
// 7) ROUTES
|
|
70
70
|
if (opts.routes) {
|
|
71
71
|
opts.routes({ app, router, db, auth, config });
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Config } from "../types";
|
|
1
|
+
import { Config } from "../types.js";
|
|
2
2
|
export declare function loadConfig(): Config;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.initDb = initDb;
|
|
4
|
-
const
|
|
4
|
+
const postgres_js_1 = require("./postgres.js");
|
|
5
5
|
async function initDb(opts) {
|
|
6
6
|
if (!opts)
|
|
7
7
|
return null;
|
|
8
8
|
if (opts.type === "postgres") {
|
|
9
9
|
if (!opts.uri)
|
|
10
10
|
throw new Error("Postgres URI required");
|
|
11
|
-
return (0,
|
|
11
|
+
return (0, postgres_js_1.initPostgres)(opts.uri);
|
|
12
12
|
}
|
|
13
13
|
throw new Error("Unsupported DB");
|
|
14
14
|
}
|
|
@@ -7,7 +7,13 @@ exports.verifySignature = verifySignature;
|
|
|
7
7
|
const crypto_1 = __importDefault(require("crypto"));
|
|
8
8
|
const PUBLIC_KEY = `
|
|
9
9
|
-----BEGIN PUBLIC KEY-----
|
|
10
|
-
|
|
10
|
+
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsU0BSgfcYaHOuWuNRQEw
|
|
11
|
+
t3HyMf+UY+RAVGf0bDmdXIyp5fPol5K86jol45lIaxdbkMpPqODmr/lU0dDBOIwy
|
|
12
|
+
wlhbAQb0nLsIMQf3M6lNw6OtI0EnlZd2xhfisfu1XH9UBbn7Q6W2+i22rZhKC3yY
|
|
13
|
+
8E7Dntgl7IkItjEFFpnbA4tCY6yTGhGfAx/4O977Vw2ET6m5SVcFVlKs0OxekRc0
|
|
14
|
+
7rcgCTwSjHPkMumVc7zv+rfZPkhULN76ju26gcuR19xd+gNq3qLGgJ9hcDITmuwP
|
|
15
|
+
FE212I94elpNRNbrX7MUqVX3o7trE5CqxH42NuGP20edSWcKqpvqLFPSnlsSvhUp
|
|
16
|
+
MQIDAQAB
|
|
11
17
|
-----END PUBLIC KEY-----
|
|
12
18
|
`;
|
|
13
19
|
function verifySignature(payload, signature) {
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.verifyLicense = verifyLicense;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const
|
|
8
|
+
const crypto_js_1 = require("./crypto.js");
|
|
9
9
|
async function verifyLicense(opts) {
|
|
10
10
|
if (!fs_1.default.existsSync(opts.licensePath)) {
|
|
11
11
|
throw new Error("License file not found");
|
|
@@ -18,7 +18,7 @@ async function verifyLicense(opts) {
|
|
|
18
18
|
if (new Date(raw.expiresAt) < new Date()) {
|
|
19
19
|
throw new Error("License expired");
|
|
20
20
|
}
|
|
21
|
-
if (!(0,
|
|
21
|
+
if (!(0, crypto_js_1.verifySignature)(payload, signature)) {
|
|
22
22
|
throw new Error("Invalid license signature");
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type": "commonjs"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import express, { Router } from "express";
|
|
2
|
+
import http from "http";
|
|
3
|
+
import { loadConfig } from "../config/index.js";
|
|
4
|
+
import { verifyLicense } from "../license/verify.js";
|
|
5
|
+
import { applySecurity } from "./security.js";
|
|
6
|
+
import { initDb } from "../db/index.js";
|
|
7
|
+
import { initJwtAuth } from "../auth/jwt.js";
|
|
8
|
+
export async function createApp(opts) {
|
|
9
|
+
// 1) CONFIG
|
|
10
|
+
const config = loadConfig();
|
|
11
|
+
// 2) LICENSE GATE
|
|
12
|
+
await verifyLicense({
|
|
13
|
+
appId: opts.appId,
|
|
14
|
+
licensePath: config.get("LICENSE_PATH", "./license.json"),
|
|
15
|
+
});
|
|
16
|
+
// 3) EXPRESS INIT
|
|
17
|
+
const app = express();
|
|
18
|
+
const server = http.createServer(app);
|
|
19
|
+
const router = Router();
|
|
20
|
+
if (opts.http?.trustProxy)
|
|
21
|
+
app.set("trust proxy", true);
|
|
22
|
+
// 4) CORE MIDDLEWARE
|
|
23
|
+
applySecurity(app);
|
|
24
|
+
app.use(express.json());
|
|
25
|
+
app.use(express.urlencoded({ extended: false }));
|
|
26
|
+
// 5) DB (non-optional if declared)
|
|
27
|
+
const db = await initDb(opts.db);
|
|
28
|
+
// 6) AUTH
|
|
29
|
+
const auth = initJwtAuth(config);
|
|
30
|
+
// 7) ROUTES
|
|
31
|
+
if (opts.routes) {
|
|
32
|
+
opts.routes({ app, router, db, auth, config });
|
|
33
|
+
}
|
|
34
|
+
app.use(router);
|
|
35
|
+
// 8) ERROR HANDLER
|
|
36
|
+
app.use((err, _req, res, _next) => {
|
|
37
|
+
console.error(err);
|
|
38
|
+
res.status(500).json({ error: "Internal Server Error from web-core" });
|
|
39
|
+
});
|
|
40
|
+
// 9) LIFE CYCLE
|
|
41
|
+
async function start() {
|
|
42
|
+
const port = opts.http?.port ?? config.get("PORT", 3000);
|
|
43
|
+
await new Promise((resolve) => server.listen(port, resolve));
|
|
44
|
+
console.log(`[web-core] listening on ${port}`);
|
|
45
|
+
}
|
|
46
|
+
async function shutdown() {
|
|
47
|
+
if (db?.close)
|
|
48
|
+
await db.close();
|
|
49
|
+
server.close();
|
|
50
|
+
}
|
|
51
|
+
return { app, start, shutdown };
|
|
52
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import jwt from "jsonwebtoken";
|
|
2
|
+
export function initJwtAuth(config) {
|
|
3
|
+
const secret = config.get("JWT_SECRET");
|
|
4
|
+
if (!secret)
|
|
5
|
+
throw new Error("JWT_SECRET missing");
|
|
6
|
+
return {
|
|
7
|
+
middleware() {
|
|
8
|
+
return (req, _res, next) => {
|
|
9
|
+
const h = req.headers.authorization;
|
|
10
|
+
if (!h)
|
|
11
|
+
return next();
|
|
12
|
+
try {
|
|
13
|
+
const token = h.replace("Bearer ", "");
|
|
14
|
+
req.user = jwt.verify(token, secret);
|
|
15
|
+
}
|
|
16
|
+
catch { }
|
|
17
|
+
next();
|
|
18
|
+
};
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare function initDb(opts?: {
|
|
2
|
+
type: "postgres";
|
|
3
|
+
uri?: string;
|
|
4
|
+
}): Promise<{
|
|
5
|
+
query: {
|
|
6
|
+
<T extends import("pg").Submittable>(queryStream: T): T;
|
|
7
|
+
<R extends any[] = any[], I = any[]>(queryConfig: import("pg").QueryArrayConfig<I>, values?: import("pg").QueryConfigValues<I>): Promise<import("pg").QueryArrayResult<R>>;
|
|
8
|
+
<R extends import("pg").QueryResultRow = any, I = any>(queryConfig: import("pg").QueryConfig<I>): Promise<import("pg").QueryResult<R>>;
|
|
9
|
+
<R extends import("pg").QueryResultRow = any, I = any[]>(queryTextOrConfig: string | import("pg").QueryConfig<I>, values?: import("pg").QueryConfigValues<I>): Promise<import("pg").QueryResult<R>>;
|
|
10
|
+
<R extends any[] = any[], I = any[]>(queryConfig: import("pg").QueryArrayConfig<I>, callback: (err: Error, result: import("pg").QueryArrayResult<R>) => void): void;
|
|
11
|
+
<R extends import("pg").QueryResultRow = any, I = any[]>(queryTextOrConfig: string | import("pg").QueryConfig<I>, callback: (err: Error, result: import("pg").QueryResult<R>) => void): void;
|
|
12
|
+
<R extends import("pg").QueryResultRow = any, I = any[]>(queryText: string, values: import("pg").QueryConfigValues<I>, callback: (err: Error, result: import("pg").QueryResult<R>) => void): void;
|
|
13
|
+
};
|
|
14
|
+
close: () => Promise<void>;
|
|
15
|
+
} | null>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { initPostgres } from "./postgres.js";
|
|
2
|
+
export async function initDb(opts) {
|
|
3
|
+
if (!opts)
|
|
4
|
+
return null;
|
|
5
|
+
if (opts.type === "postgres") {
|
|
6
|
+
if (!opts.uri)
|
|
7
|
+
throw new Error("Postgres URI required");
|
|
8
|
+
return initPostgres(opts.uri);
|
|
9
|
+
}
|
|
10
|
+
throw new Error("Unsupported DB");
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function initPostgres(uri: string): Promise<{
|
|
2
|
+
query: {
|
|
3
|
+
<T extends import("pg").Submittable>(queryStream: T): T;
|
|
4
|
+
<R extends any[] = any[], I = any[]>(queryConfig: import("pg").QueryArrayConfig<I>, values?: import("pg").QueryConfigValues<I>): Promise<import("pg").QueryArrayResult<R>>;
|
|
5
|
+
<R extends import("pg").QueryResultRow = any, I = any>(queryConfig: import("pg").QueryConfig<I>): Promise<import("pg").QueryResult<R>>;
|
|
6
|
+
<R extends import("pg").QueryResultRow = any, I = any[]>(queryTextOrConfig: string | import("pg").QueryConfig<I>, values?: import("pg").QueryConfigValues<I>): Promise<import("pg").QueryResult<R>>;
|
|
7
|
+
<R extends any[] = any[], I = any[]>(queryConfig: import("pg").QueryArrayConfig<I>, callback: (err: Error, result: import("pg").QueryArrayResult<R>) => void): void;
|
|
8
|
+
<R extends import("pg").QueryResultRow = any, I = any[]>(queryTextOrConfig: string | import("pg").QueryConfig<I>, callback: (err: Error, result: import("pg").QueryResult<R>) => void): void;
|
|
9
|
+
<R extends import("pg").QueryResultRow = any, I = any[]>(queryText: string, values: import("pg").QueryConfigValues<I>, callback: (err: Error, result: import("pg").QueryResult<R>) => void): void;
|
|
10
|
+
};
|
|
11
|
+
close: () => Promise<void>;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.createApp = void 0;
|
|
18
|
+
var createApp_1 = require("./app/createApp");
|
|
19
|
+
Object.defineProperty(exports, "createApp", { enumerable: true, get: function () { return createApp_1.createApp; } });
|
|
20
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function verifySignature(payload: object, signature: string): boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import crypto from "crypto";
|
|
2
|
+
const PUBLIC_KEY = `
|
|
3
|
+
-----BEGIN PUBLIC KEY-----
|
|
4
|
+
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsU0BSgfcYaHOuWuNRQEw
|
|
5
|
+
t3HyMf+UY+RAVGf0bDmdXIyp5fPol5K86jol45lIaxdbkMpPqODmr/lU0dDBOIwy
|
|
6
|
+
wlhbAQb0nLsIMQf3M6lNw6OtI0EnlZd2xhfisfu1XH9UBbn7Q6W2+i22rZhKC3yY
|
|
7
|
+
8E7Dntgl7IkItjEFFpnbA4tCY6yTGhGfAx/4O977Vw2ET6m5SVcFVlKs0OxekRc0
|
|
8
|
+
7rcgCTwSjHPkMumVc7zv+rfZPkhULN76ju26gcuR19xd+gNq3qLGgJ9hcDITmuwP
|
|
9
|
+
FE212I94elpNRNbrX7MUqVX3o7trE5CqxH42NuGP20edSWcKqpvqLFPSnlsSvhUp
|
|
10
|
+
MQIDAQAB
|
|
11
|
+
-----END PUBLIC KEY-----
|
|
12
|
+
`;
|
|
13
|
+
export function verifySignature(payload, signature) {
|
|
14
|
+
const verify = crypto.createVerify("RSA-SHA256");
|
|
15
|
+
verify.update(JSON.stringify(payload));
|
|
16
|
+
verify.end();
|
|
17
|
+
return verify.verify(PUBLIC_KEY, Buffer.from(signature, "base64"));
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import { verifySignature } from "./crypto.js";
|
|
3
|
+
export async function verifyLicense(opts) {
|
|
4
|
+
if (!fs.existsSync(opts.licensePath)) {
|
|
5
|
+
throw new Error("License file not found");
|
|
6
|
+
}
|
|
7
|
+
const raw = JSON.parse(fs.readFileSync(opts.licensePath, "utf8"));
|
|
8
|
+
const { signature, ...payload } = raw;
|
|
9
|
+
if (raw.appId !== opts.appId) {
|
|
10
|
+
throw new Error("License appId mismatch");
|
|
11
|
+
}
|
|
12
|
+
if (new Date(raw.expiresAt) < new Date()) {
|
|
13
|
+
throw new Error("License expired");
|
|
14
|
+
}
|
|
15
|
+
if (!verifySignature(payload, signature)) {
|
|
16
|
+
throw new Error("Invalid license signature");
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Express, Router } from "express";
|
|
2
|
+
export interface CreateAppOptions {
|
|
3
|
+
appId: string;
|
|
4
|
+
http?: {
|
|
5
|
+
port?: number;
|
|
6
|
+
trustProxy?: boolean;
|
|
7
|
+
};
|
|
8
|
+
db?: {
|
|
9
|
+
type: "postgres";
|
|
10
|
+
uri?: string;
|
|
11
|
+
};
|
|
12
|
+
auth?: {
|
|
13
|
+
provider: "jwt";
|
|
14
|
+
};
|
|
15
|
+
routes?: (ctx: AppContext) => void;
|
|
16
|
+
}
|
|
17
|
+
export interface AppContext {
|
|
18
|
+
app: Express;
|
|
19
|
+
router: Router;
|
|
20
|
+
db: any;
|
|
21
|
+
auth: {
|
|
22
|
+
middleware(): any;
|
|
23
|
+
};
|
|
24
|
+
config: Config;
|
|
25
|
+
}
|
|
26
|
+
export interface Config {
|
|
27
|
+
get<T = any>(key: string, fallback?: T): T;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cored3v/web-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Reusable licensed Express core for web applications",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/cjs/index.cjs",
|
|
7
|
+
"module": "./dist/esm/index.mjs",
|
|
8
|
+
"types": "./dist/esm/index.esm.d.ts",
|
|
7
9
|
"files": [
|
|
8
10
|
"dist"
|
|
9
11
|
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./dist/esm/index.mjs",
|
|
15
|
+
"require": "./dist/cjs/index.cjs"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
10
18
|
"scripts": {
|
|
11
|
-
"build": "tsc",
|
|
19
|
+
"build:esm": "tsc -p tsconfig.esm.json",
|
|
20
|
+
"build:cjs": "tsc -p tsconfig.cjs.json && echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json",
|
|
21
|
+
"build": "npm run build:esm && npm run build:cjs",
|
|
12
22
|
"prepublishOnly": "npm run build"
|
|
13
23
|
},
|
|
14
24
|
"dependencies": {
|
|
@@ -24,6 +34,9 @@
|
|
|
24
34
|
"@types/jsonwebtoken": "^9.0.6",
|
|
25
35
|
"@types/node": "^20.11.0",
|
|
26
36
|
"@types/pg": "^8.16.0",
|
|
27
|
-
"
|
|
37
|
+
"pg-protocol": "^1.10.3",
|
|
38
|
+
"pg-types": "^4.1.0",
|
|
39
|
+
"typescript": "^5.4.0",
|
|
40
|
+
"undici-types": "^7.18.2"
|
|
28
41
|
}
|
|
29
|
-
}
|
|
42
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|