kfreelance-project-postgresql-prisma 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/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
- export { PrismaClient } from "../generated/prisma/index.js";
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
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC"}
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,8 @@
1
- export { PrismaClient } from "../generated/prisma/index.js";
2
- export type { User, PasswordResetToken, Prisma, } from "../generated/prisma/index.js";
3
- import { PrismaClient } from "../generated/prisma/index.js";
1
+ export { PrismaClient } from "../generated/prisma";
2
+ export type { User, PasswordResetToken, Prisma } from "../generated/prisma";
4
3
  export declare const createPrismaClient: (options?: {
5
4
  databaseUrl?: string;
6
5
  log?: Array<"query" | "info" | "warn" | "error">;
7
- }) => PrismaClient<import("../generated/prisma/index.js").Prisma.PrismaClientOptions, never, import("../generated/prisma/runtime/library.js").DefaultArgs>;
6
+ }) => any;
8
7
  export declare const getDefaultDatabaseUrl: () => string;
9
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAG5D,YAAY,EACV,IAAI,EACJ,kBAAkB,EAClB,MAAM,GACP,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAG5D,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,yJAgBA,CAAC;AAGF,eAAO,MAAM,qBAAqB,cAEjC,CAAC"}
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;AAW5E,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,QA0BA,CAAC;AAGF,eAAO,MAAM,qBAAqB,cAKjC,CAAC"}
package/dist/index.js CHANGED
@@ -1,23 +1,39 @@
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
- export { PrismaClient } from "../generated/prisma/index.js";
3
- import { PrismaClient } from "../generated/prisma/index.js";
5
+ var prisma_1 = require("../generated/prisma");
6
+ Object.defineProperty(exports, "PrismaClient", { enumerable: true, get: function () { return prisma_1.PrismaClient; } });
7
+ // import { PrismaClient } from "../generated/prisma/index.js";
4
8
  // Utility function to create a PrismaClient with custom options
5
- export const createPrismaClient = (options) => {
6
- const config = {};
7
- if (options?.databaseUrl) {
8
- config.datasources = {
9
+ const createPrismaClient = (options) => {
10
+ // const config: any = {};
11
+ // if (options?.databaseUrl) {
12
+ // config.datasources = {
13
+ // db: {
14
+ // url: options.databaseUrl,
15
+ // },
16
+ // };
17
+ // }
18
+ // if (options?.log) {
19
+ // config.log = options.log;
20
+ // }
21
+ // return new PrismaClient(config);
22
+ const { PrismaClient } = require("../generated/prisma");
23
+ return new PrismaClient({
24
+ datasources: {
9
25
  db: {
10
- url: options.databaseUrl,
26
+ url: options?.databaseUrl || (0, exports.getDefaultDatabaseUrl)(),
11
27
  },
12
- };
13
- }
14
- if (options?.log) {
15
- config.log = options.log;
16
- }
17
- return new PrismaClient(config);
28
+ },
29
+ log: options?.log || ["error", "warn"],
30
+ });
18
31
  };
32
+ exports.createPrismaClient = createPrismaClient;
19
33
  // Export database configuration helpers
20
- export const getDefaultDatabaseUrl = () => {
21
- return process.env.DATABASE_URL || "postgresql://postgres:your_secure_password@localhost:5432/freelance_db?schema=public";
34
+ const getDefaultDatabaseUrl = () => {
35
+ return (process.env.DATABASE_URL ||
36
+ "postgresql://postgres:your_secure_password@localhost:5432/freelance_db?schema=public");
22
37
  };
38
+ exports.getDefaultDatabaseUrl = getDefaultDatabaseUrl;
23
39
  //# 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,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAS5D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,gEAAgE;AAChE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAGlC,EAAE,EAAE;IACH,MAAM,MAAM,GAAQ,EAAE,CAAC;IAEvB,IAAI,OAAO,EAAE,WAAW,EAAE,CAAC;QACzB,MAAM,CAAC,WAAW,GAAG;YACnB,EAAE,EAAE;gBACF,GAA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QAAA,qBAAqB,yBAKhC"}
package/package.json CHANGED
@@ -1,24 +1,28 @@
1
1
  {
2
2
  "name": "kfreelance-project-postgresql-prisma",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Shared Prisma client library for microservices",
5
- "type": "module",
6
5
  "main": "./dist/index.js",
7
6
  "types": "./dist/index.d.ts",
8
7
  "exports": {
9
8
  ".": {
10
9
  "types": "./dist/index.d.ts",
11
- "import": "./dist/index.js"
10
+ "import": "./dist/index.js",
11
+ "require": "./dist/index.js"
12
12
  },
13
13
  "./client": {
14
14
  "types": "./dist/client.d.ts",
15
- "import": "./dist/client.js"
16
- }
15
+ "import": "./dist/client.js",
16
+ "require": "./dist/client.js"
17
+ },
18
+ "./generated/*": "./generated/*",
19
+ "./package.json": "./package.json"
17
20
  },
18
21
  "files": [
19
22
  "dist",
20
23
  "generated",
21
- "prisma"
24
+ "prisma",
25
+ "README.md"
22
26
  ],
23
27
  "scripts": {
24
28
  "build": "tsc && npm run generate",