@allbluecn/database 0.9.3 → 0.9.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allbluecn/database",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "license": "AGPL-3.0-or-later",
5
5
  "type": "module",
6
6
  "main": "./index.ts",
@@ -19,29 +19,16 @@
19
19
  },
20
20
  "devDependencies": {
21
21
  "@types/better-sqlite3": "^7.6.13",
22
- "esbuild": "^0.25.0",
23
22
  "prisma": "^7.8.0",
24
23
  "tsx": "^4.22.0",
25
24
  "vitest": "^4.1.10"
26
25
  },
27
26
  "exports": {
28
27
  ".": "./index.ts",
29
- "./get-prisma": {
30
- "types": "./dist/get-prisma.d.ts",
31
- "default": "./dist/get-prisma.js"
32
- },
33
- "./cf-env": {
34
- "types": "./dist/cf-env.d.ts",
35
- "default": "./dist/cf-env.js"
36
- },
37
- "./cf-env-stub": {
38
- "types": "./dist/cf-env-stub.d.ts",
39
- "default": "./dist/cf-env-stub.js"
40
- },
41
- "./lib/share-utils": {
42
- "types": "./dist/lib/share-utils.d.ts",
43
- "default": "./dist/lib/share-utils.js"
44
- }
28
+ "./get-prisma": "./get-prisma.ts",
29
+ "./cf-env": "./cf-env.ts",
30
+ "./cf-env-stub": "./cf-env-stub.ts",
31
+ "./lib/share-utils": "./src/lib/share-utils.ts"
45
32
  },
46
33
  "repository": {
47
34
  "type": "git",
@@ -52,7 +39,6 @@
52
39
  "url": "https://github.com/urmynami/AllBlue/issues"
53
40
  },
54
41
  "files": [
55
- "dist",
56
42
  "src",
57
43
  "!src/**/*.test.*",
58
44
  "!src/**/__tests__/**",
@@ -74,7 +60,6 @@
74
60
  "access": "public"
75
61
  },
76
62
  "scripts": {
77
- "build": "node ./scripts/build-dist.mjs",
78
63
  "generate": "prisma generate && node ./scripts/patch-workerd-wasm.mjs",
79
64
  "migrate:dev": "prisma migrate dev",
80
65
  "migrate:deploy": "prisma migrate deploy",
@@ -1 +0,0 @@
1
- export declare const env: Record<string, unknown>;
@@ -1,4 +0,0 @@
1
- const env = {};
2
- export {
3
- env
4
- };
package/dist/cf-env.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare const cloudflareEnv: Record<string, unknown>;
package/dist/cf-env.js DELETED
@@ -1,8 +0,0 @@
1
- let cloudflareEnv = {};
2
- try {
3
- ({ env: cloudflareEnv } = await import("cloudflare:workers"));
4
- } catch {
5
- }
6
- export {
7
- cloudflareEnv
8
- };
@@ -1 +0,0 @@
1
- export declare function getPrisma(): Promise<import("./generated/client").PrismaClient>;
@@ -1,7 +0,0 @@
1
- async function getPrisma() {
2
- const { prisma } = await import("../index.ts");
3
- return prisma;
4
- }
5
- export {
6
- getPrisma
7
- };
@@ -1,2 +0,0 @@
1
- export declare function verifySharePassword(input: string, stored: string): Promise<boolean>;
2
- export declare function verifyPrdOwner(prdId: string, userId: string): Promise<boolean>;
@@ -1,17 +0,0 @@
1
- import bcrypt from "bcryptjs";
2
- async function verifySharePassword(input, stored) {
3
- if (input === stored) return true;
4
- if (stored.startsWith("$2")) {
5
- return bcrypt.compare(input, stored);
6
- }
7
- return false;
8
- }
9
- async function verifyDesignOwner(designId, userId) {
10
- const { prisma } = await import("@allbluecn/database");
11
- const prd = await prisma.design.findUnique({ where: { id: designId }, select: { userId: true } });
12
- return prd?.userId === userId;
13
- }
14
- export {
15
- verifyDesignOwner,
16
- verifySharePassword
17
- };