@allbluecn/database 0.4.16 → 0.4.18

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.
Files changed (33) hide show
  1. package/dist/lib/share-utils.d.ts +2 -0
  2. package/dist/lib/share-utils.js +17 -0
  3. package/generated/browser.ts +10 -0
  4. package/generated/client.ts +10 -0
  5. package/generated/internal/class.ts +24 -4
  6. package/generated/internal/prismaNamespace.ts +188 -3
  7. package/generated/internal/prismaNamespaceBrowser.ts +37 -2
  8. package/generated/models/Iteration.ts +1878 -0
  9. package/generated/models/IterationAutoSchedule.ts +1485 -0
  10. package/generated/models/Project.ts +326 -0
  11. package/generated/models/Story.ts +393 -3
  12. package/generated/models/User.ts +618 -0
  13. package/generated/models.ts +2 -0
  14. package/generated-sqlite/browser.ts +15 -0
  15. package/generated-sqlite/client.ts +15 -0
  16. package/generated-sqlite/internal/class.ts +34 -4
  17. package/generated-sqlite/internal/prismaNamespace.ts +288 -2
  18. package/generated-sqlite/internal/prismaNamespaceBrowser.ts +62 -1
  19. package/generated-sqlite/models/Iteration.ts +1874 -0
  20. package/generated-sqlite/models/IterationAutoSchedule.ts +1483 -0
  21. package/generated-sqlite/models/Project.ts +484 -0
  22. package/generated-sqlite/models/Story.ts +3263 -0
  23. package/generated-sqlite/models/User.ts +2103 -107
  24. package/generated-sqlite/models.ts +3 -0
  25. package/index.ts +2 -2
  26. package/migrations/20260831203925_story_attachment_file_hash/migration.sql +2 -0
  27. package/migrations/20260901020000_story_attachment_file_hash/migration.sql +2 -0
  28. package/migrations/20260901134601_iterations/migration.sql +52 -0
  29. package/migrations/20260902000000_story_identifier_per_project/migration.sql +37 -0
  30. package/migrations/20260902000100_story_identifier_counter_init/migration.sql +11 -0
  31. package/package.json +14 -5
  32. package/schema.prisma +47 -4
  33. package/schema.sqlite.prisma +89 -4
@@ -0,0 +1,2 @@
1
+ export declare function verifySharePassword(input: string, stored: string): Promise<boolean>;
2
+ export declare function verifyPrdOwner(prdId: string, userId: string): Promise<boolean>;
@@ -0,0 +1,17 @@
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 verifyPrdOwner(prdId, userId) {
10
+ const { prisma } = await import("@allbluecn/database");
11
+ const prd = await prisma.pRD.findUnique({ where: { id: prdId }, select: { userId: true } });
12
+ return prd?.userId === userId;
13
+ }
14
+ export {
15
+ verifyPrdOwner,
16
+ verifySharePassword
17
+ };
@@ -522,3 +522,13 @@ export type Notification = Prisma.NotificationModel
522
522
  *
523
523
  */
524
524
  export type NotificationPreference = Prisma.NotificationPreferenceModel
525
+ /**
526
+ * Model Iteration
527
+ *
528
+ */
529
+ export type Iteration = Prisma.IterationModel
530
+ /**
531
+ * Model IterationAutoSchedule
532
+ *
533
+ */
534
+ export type IterationAutoSchedule = Prisma.IterationAutoScheduleModel
@@ -546,3 +546,13 @@ export type Notification = Prisma.NotificationModel
546
546
  *
547
547
  */
548
548
  export type NotificationPreference = Prisma.NotificationPreferenceModel
549
+ /**
550
+ * Model Iteration
551
+ *
552
+ */
553
+ export type Iteration = Prisma.IterationModel
554
+ /**
555
+ * Model IterationAutoSchedule
556
+ *
557
+ */
558
+ export type IterationAutoSchedule = Prisma.IterationAutoScheduleModel