kfreelance-project-postgresql-prisma 1.0.1 → 1.0.3
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/client.js +5 -1
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +11 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +37 -15
- package/dist/index.js.map +1 -1
- package/generated/prisma/edge.js +1 -2
- package/generated/prisma/index.js +1 -2
- package/generated/prisma/wasm.js +1 -2
- package/package.json +2 -2
package/dist/client.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PrismaClient = void 0;
|
|
1
4
|
// Direct client export for simple usage
|
|
2
|
-
|
|
5
|
+
var index_js_1 = require("../generated/prisma/index.js");
|
|
6
|
+
Object.defineProperty(exports, "PrismaClient", { enumerable: true, get: function () { return index_js_1.PrismaClient; } });
|
|
3
7
|
//# sourceMappingURL=client.js.map
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAAA,wCAAwC;AACxC,yDAA4D;AAAnD,wGAAA,YAAY,OAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
export { PrismaClient } from "../generated/prisma
|
|
2
|
-
export type { User, PasswordResetToken, Prisma
|
|
3
|
-
import { PrismaClient } from "../generated/prisma
|
|
1
|
+
export { PrismaClient } from "../generated/prisma";
|
|
2
|
+
export type { User, PasswordResetToken, Prisma } from "../generated/prisma";
|
|
3
|
+
import { PrismaClient } from "../generated/prisma";
|
|
4
4
|
export declare const createPrismaClient: (options?: {
|
|
5
5
|
databaseUrl?: string;
|
|
6
6
|
log?: Array<"query" | "info" | "warn" | "error">;
|
|
7
|
-
}) => PrismaClient<
|
|
7
|
+
}) => PrismaClient<{
|
|
8
|
+
datasources: {
|
|
9
|
+
db: {
|
|
10
|
+
url: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
log: ("query" | "info" | "warn" | "error")[];
|
|
14
|
+
}, "query" | "info" | "warn" | "error", import("../generated/prisma/runtime/library").DefaultArgs>;
|
|
8
15
|
export declare const getDefaultDatabaseUrl: () => string;
|
|
9
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAInD,YAAY,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAO5E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAInD,eAAO,MAAM,kBAAkB,GAAI,UAAU;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,KAAK,CAAC,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CAClD;;;;;;;kGA0BA,CAAC;AAGF,eAAO,MAAM,qBAAqB,cAKjC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDefaultDatabaseUrl = exports.createPrismaClient = exports.PrismaClient = void 0;
|
|
1
4
|
// Library entry point - exports PrismaClient and types for consuming microservices
|
|
2
|
-
|
|
3
|
-
|
|
5
|
+
var prisma_1 = require("../generated/prisma");
|
|
6
|
+
Object.defineProperty(exports, "PrismaClient", { enumerable: true, get: function () { return prisma_1.PrismaClient; } });
|
|
7
|
+
// export type {
|
|
8
|
+
// User,
|
|
9
|
+
// PasswordResetToken,
|
|
10
|
+
// Prisma,
|
|
11
|
+
// } from "../generated/prisma/index.js";
|
|
12
|
+
const prisma_2 = require("../generated/prisma");
|
|
13
|
+
// import { PrismaClient } from "../generated/prisma/index.js";
|
|
4
14
|
// Utility function to create a PrismaClient with custom options
|
|
5
|
-
|
|
6
|
-
const config = {};
|
|
7
|
-
if (options?.databaseUrl) {
|
|
8
|
-
|
|
15
|
+
const createPrismaClient = (options) => {
|
|
16
|
+
// const config: any = {};
|
|
17
|
+
// if (options?.databaseUrl) {
|
|
18
|
+
// config.datasources = {
|
|
19
|
+
// db: {
|
|
20
|
+
// url: options.databaseUrl,
|
|
21
|
+
// },
|
|
22
|
+
// };
|
|
23
|
+
// }
|
|
24
|
+
// if (options?.log) {
|
|
25
|
+
// config.log = options.log;
|
|
26
|
+
// }
|
|
27
|
+
// return new PrismaClient(config);
|
|
28
|
+
// const { PrismaClient } = require("../generated/prisma");
|
|
29
|
+
return new prisma_2.PrismaClient({
|
|
30
|
+
datasources: {
|
|
9
31
|
db: {
|
|
10
|
-
url: options
|
|
32
|
+
url: options?.databaseUrl || (0, exports.getDefaultDatabaseUrl)(),
|
|
11
33
|
},
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
config.log = options.log;
|
|
16
|
-
}
|
|
17
|
-
return new PrismaClient(config);
|
|
34
|
+
},
|
|
35
|
+
log: options?.log || ["error", "warn"],
|
|
36
|
+
});
|
|
18
37
|
};
|
|
38
|
+
exports.createPrismaClient = createPrismaClient;
|
|
19
39
|
// Export database configuration helpers
|
|
20
|
-
|
|
21
|
-
return process.env.DATABASE_URL ||
|
|
40
|
+
const getDefaultDatabaseUrl = () => {
|
|
41
|
+
return (process.env.DATABASE_URL ||
|
|
42
|
+
"postgresql://postgres:your_secure_password@localhost:5432/freelance_db?schema=public");
|
|
22
43
|
};
|
|
44
|
+
exports.getDefaultDatabaseUrl = getDefaultDatabaseUrl;
|
|
23
45
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mFAAmF;AACnF,8CAAmD;AAA1C,sGAAA,YAAY,OAAA;AAKrB,gBAAgB;AAChB,UAAU;AACV,wBAAwB;AACxB,YAAY;AACZ,yCAAyC;AAEzC,gDAAmD;AACnD,+DAA+D;AAE/D,gEAAgE;AACzD,MAAM,kBAAkB,GAAG,CAAC,OAGlC,EAAE,EAAE;IACH,4BAA4B;IAE5B,gCAAgC;IAChC,6BAA6B;IAC7B,cAAc;IACd,oCAAoC;IACpC,WAAW;IACX,SAAS;IACT,MAAM;IAEN,wBAAwB;IACxB,gCAAgC;IAChC,MAAM;IAEN,qCAAqC;IACvC,6DAA6D;IAE3D,OAAO,IAAI,qBAAY,CAAC;QACtB,WAAW,EAAE;YACX,EAAE,EAAE;gBACF,GAAG,EAAE,OAAO,EAAE,WAAW,IAAI,IAAA,6BAAqB,GAAE;aACrD;SACF;QACD,GAAG,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC;KACvC,CAAC,CAAC;AACL,CAAC,CAAC;AA7BW,QAAA,kBAAkB,sBA6B7B;AAEF,wCAAwC;AACjC,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACxC,OAAO,CACL,OAAO,CAAC,GAAG,CAAC,YAAY;QACxB,sFAAsF,CACvF,CAAC;AACJ,CAAC,CAAC;AALW,QAAA,qBAAqB,yBAKhC"}
|
package/generated/prisma/edge.js
CHANGED
package/generated/prisma/wasm.js
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kfreelance-project-postgresql-prisma",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Shared Prisma client library for microservices",
|
|
3
|
+
"version": "1.0.3",
|
|
5
4
|
"type": "module",
|
|
5
|
+
"description": "Shared Prisma client library for microservices",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"exports": {
|