@specprism/db 0.0.0-stage → 1.0.1
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/LICENSE +21 -0
- package/README.md +49 -2
- package/dist/bootstrap.d.ts +5 -0
- package/dist/bootstrap.d.ts.map +1 -0
- package/dist/bootstrap.js +177 -0
- package/dist/bootstrap.js.map +1 -0
- package/dist/client.d.ts +10 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +53 -0
- package/dist/client.js.map +1 -0
- package/dist/crypto.d.ts +3 -0
- package/dist/crypto.d.ts.map +1 -0
- package/dist/crypto.js +45 -0
- package/dist/crypto.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/migrate.d.ts +2 -0
- package/dist/migrate.d.ts.map +1 -0
- package/dist/migrate.js +11 -0
- package/dist/migrate.js.map +1 -0
- package/dist/schema/index.d.ts +4 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +4 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/platform.d.ts +1070 -0
- package/dist/schema/platform.d.ts.map +1 -0
- package/dist/schema/platform.js +85 -0
- package/dist/schema/platform.js.map +1 -0
- package/dist/schema/registries.d.ts +621 -0
- package/dist/schema/registries.d.ts.map +1 -0
- package/dist/schema/registries.js +43 -0
- package/dist/schema/registries.js.map +1 -0
- package/dist/schema/specs.d.ts +664 -0
- package/dist/schema/specs.d.ts.map +1 -0
- package/dist/schema/specs.js +39 -0
- package/dist/schema/specs.js.map +1 -0
- package/package.json +54 -4
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { integer, jsonb, pgTable, text, timestamp, uniqueIndex, uuid, } from "drizzle-orm/pg-core";
|
|
2
|
+
import { users } from "./platform.js";
|
|
3
|
+
export const specProjects = pgTable("spec_projects", {
|
|
4
|
+
id: uuid("id").defaultRandom().primaryKey(),
|
|
5
|
+
ownerId: text("owner_id").references(() => users.id, { onDelete: "cascade" }),
|
|
6
|
+
slug: text("slug").notNull(),
|
|
7
|
+
title: text("title").notNull(),
|
|
8
|
+
visibility: text("visibility").notNull().default("private"), // "private" | "unlisted" | "public"
|
|
9
|
+
latestIterationNumber: integer("latest_iteration_number").notNull().default(1),
|
|
10
|
+
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow().notNull(),
|
|
11
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).defaultNow().notNull(),
|
|
12
|
+
});
|
|
13
|
+
export const specIterations = pgTable("spec_iterations", {
|
|
14
|
+
id: uuid("id").defaultRandom().primaryKey(),
|
|
15
|
+
projectId: uuid("project_id")
|
|
16
|
+
.notNull()
|
|
17
|
+
.references(() => specProjects.id, { onDelete: "cascade" }),
|
|
18
|
+
iterationNumber: integer("iteration_number").notNull(),
|
|
19
|
+
stage: text("stage").notNull(),
|
|
20
|
+
rawPrompt: text("raw_prompt").notNull(),
|
|
21
|
+
targetDialectId: text("target_dialect_id").notNull().default("anthropic-claude"),
|
|
22
|
+
document: jsonb("document").$type().notNull(),
|
|
23
|
+
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow().notNull(),
|
|
24
|
+
}, (table) => [
|
|
25
|
+
uniqueIndex("spec_iterations_project_iter_idx").on(table.projectId, table.iterationNumber),
|
|
26
|
+
]);
|
|
27
|
+
export const traceabilityLinks = pgTable("traceability_links", {
|
|
28
|
+
id: uuid("id").defaultRandom().primaryKey(),
|
|
29
|
+
iterationId: uuid("iteration_id")
|
|
30
|
+
.notNull()
|
|
31
|
+
.references(() => specIterations.id, { onDelete: "cascade" }),
|
|
32
|
+
storyId: text("story_id").notNull(),
|
|
33
|
+
reqId: text("req_id").notNull(),
|
|
34
|
+
testCaseId: text("test_case_id").notNull(),
|
|
35
|
+
verificationTier: text("verification_tier").notNull(),
|
|
36
|
+
impactStatus: text("impact_status").notNull().default("regression_shield"),
|
|
37
|
+
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow().notNull(),
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=specs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specs.js","sourceRoot":"","sources":["../../src/schema/specs.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,KAAK,EACL,OAAO,EACP,IAAI,EACJ,SAAS,EACT,WAAW,EACX,IAAI,GACL,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,eAAe,EAAE;IACnD,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC,UAAU,EAAE;IAC3C,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAC7E,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE;IAC5B,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE;IAC9B,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,oCAAoC;IACjG,qBAAqB,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9E,SAAS,EAAE,SAAS,CAAC,YAAY,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE;IACjF,SAAS,EAAE,SAAS,CAAC,YAAY,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE;CAClF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CACn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AAC,OAAO,EAAE;IACnC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE;IAC/B,UAAU,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE;IAC1C,gBAAgB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC,OAAO,EAAE;IACrD,YAAY,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,mBAAmB,CAAC;IAC1E,SAAS,EAAE,SAAS,CAAC,YAAY,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE;CAClF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,56 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@specprism/db",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "SpecPrism Unified Database — Drizzle ORM PostgreSQL + pgvector + local embedded PGlite & AES-256-GCM BYOK vault.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://spec-prism.app",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/orphik/specprism.git",
|
|
10
|
+
"directory": "packages/db"
|
|
11
|
+
},
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"type": "module",
|
|
21
|
+
"main": "./dist/index.js",
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"import": "./dist/index.js",
|
|
27
|
+
"default": "./dist/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./schema": {
|
|
30
|
+
"types": "./dist/schema/index.d.ts",
|
|
31
|
+
"import": "./dist/schema/index.js",
|
|
32
|
+
"default": "./dist/schema/index.js"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsc -p tsconfig.json",
|
|
37
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
38
|
+
"lint": "tsc -p tsconfig.json --noEmit",
|
|
39
|
+
"test": "vitest run",
|
|
40
|
+
"db:generate": "drizzle-kit generate",
|
|
41
|
+
"db:migrate": "tsx src/migrate.ts"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@electric-sql/pglite": "^0.2.17",
|
|
45
|
+
"@specprism/core": "^1.0.1",
|
|
46
|
+
"drizzle-orm": "^0.45.2",
|
|
47
|
+
"postgres": "^3.4.5"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@types/node": "^22.15.0",
|
|
51
|
+
"drizzle-kit": "^0.30.6",
|
|
52
|
+
"tsx": "^4.19.4",
|
|
53
|
+
"typescript": "^5.8.3",
|
|
54
|
+
"vitest": "^3.1.4"
|
|
55
|
+
}
|
|
56
|
+
}
|