@semiont/backend 0.2.36

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 ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@semiont/backend",
3
+ "version": "0.2.36",
4
+ "type": "module",
5
+ "description": "Semiont backend server - pre-built for npm consumption",
6
+ "bin": {
7
+ "semiont-backend": "dist/index.js"
8
+ },
9
+ "files": [
10
+ "dist",
11
+ "prisma"
12
+ ],
13
+ "scripts": {
14
+ "postinstall": "prisma generate",
15
+ "start": "node dist/index.js"
16
+ },
17
+ "dependencies": {
18
+ "@anthropic-ai/sdk": "^0.63.0",
19
+ "@aws-sdk/client-neptune": "^3.600.0",
20
+ "@aws-sdk/client-secrets-manager": "^3.600.0",
21
+ "@hono/node-server": "^1.17.1",
22
+ "@hono/swagger-ui": "^0.5.2",
23
+ "@prisma/client": "^6.13.0",
24
+ "@semiont/core": "^0.2.36",
25
+ "@semiont/event-sourcing": "^0.2.36",
26
+ "@semiont/graph": "^0.2.36",
27
+ "@semiont/inference": "^0.2.36",
28
+ "@semiont/jobs": "^0.2.36",
29
+ "@semiont/make-meaning": "^0.2.36",
30
+ "ajv": "^8.17.1",
31
+ "ajv-formats": "^2.1.1",
32
+ "argon2": "^0.43.0",
33
+ "dotenv": "^16.3.1",
34
+ "google-auth-library": "^9.10.0",
35
+ "gremlin": "^3.7.4",
36
+ "hono": "^4.8.10",
37
+ "jsonwebtoken": "^9.0.2",
38
+ "neo4j-driver": "^5.28.2",
39
+ "prisma": "^6.14.0",
40
+ "uuid": "^9.0.1",
41
+ "winston": "^3.19.0",
42
+ "zod": "^4.0.0"
43
+ },
44
+ "publishConfig": {
45
+ "access": "public"
46
+ },
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "https://github.com/The-AI-Alliance/semiont.git",
50
+ "directory": "apps/backend"
51
+ },
52
+ "license": "Apache-2.0"
53
+ }
@@ -0,0 +1,24 @@
1
+ -- CreateTable
2
+ CREATE TABLE "public"."users" (
3
+ "id" TEXT NOT NULL,
4
+ "email" TEXT NOT NULL,
5
+ "name" TEXT,
6
+ "image" TEXT,
7
+ "provider" TEXT NOT NULL,
8
+ "providerId" TEXT NOT NULL,
9
+ "domain" TEXT NOT NULL,
10
+ "isActive" BOOLEAN NOT NULL DEFAULT true,
11
+ "isAdmin" BOOLEAN NOT NULL DEFAULT false,
12
+ "termsAcceptedAt" TIMESTAMP(3),
13
+ "lastLogin" TIMESTAMP(3),
14
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
15
+ "updatedAt" TIMESTAMP(3) NOT NULL,
16
+
17
+ CONSTRAINT "users_pkey" PRIMARY KEY ("id")
18
+ );
19
+
20
+ -- CreateIndex
21
+ CREATE UNIQUE INDEX "users_email_key" ON "public"."users"("email");
22
+
23
+ -- CreateIndex
24
+ CREATE UNIQUE INDEX "users_provider_providerId_key" ON "public"."users"("provider", "providerId");
@@ -0,0 +1,2 @@
1
+ -- AlterTable
2
+ ALTER TABLE "public"."users" ADD COLUMN "isModerator" BOOLEAN NOT NULL DEFAULT false;
@@ -0,0 +1,2 @@
1
+ -- AlterTable
2
+ ALTER TABLE "public"."users" ADD COLUMN "passwordHash" TEXT;
@@ -0,0 +1,3 @@
1
+ # Please do not edit this file manually
2
+ # It should be added in your version-control system (e.g., Git)
3
+ provider = "postgresql"
@@ -0,0 +1,41 @@
1
+ // This is your Prisma schema file,
2
+ // learn more about it in the docs: https://pris.ly/d/prisma-schema
3
+
4
+ generator client {
5
+ provider = "prisma-client-js"
6
+ }
7
+
8
+ datasource db {
9
+ provider = "postgresql"
10
+ url = env("DATABASE_URL")
11
+ }
12
+
13
+ // User model for OAuth and password authentication
14
+ model User {
15
+ id String @id @default(cuid())
16
+ email String @unique
17
+ name String?
18
+ image String? // Profile picture from OAuth provider
19
+ provider String // 'password', 'google', 'github', etc.
20
+ providerId String // OAuth provider's user ID (or email for password users)
21
+ passwordHash String? // bcrypt hash - NULL for OAuth users, required for password provider
22
+ domain String // Email domain for access control
23
+ isActive Boolean @default(true)
24
+ isAdmin Boolean @default(false) // Admin role for administrative access
25
+ isModerator Boolean @default(false) // Moderator role for content governance
26
+ termsAcceptedAt DateTime? // When user accepted terms of service
27
+ lastLogin DateTime?
28
+ createdAt DateTime @default(now())
29
+ updatedAt DateTime @updatedAt
30
+
31
+ @@unique([provider, providerId])
32
+ @@map("users")
33
+ }
34
+
35
+ // Documents, References, and their relationships are stored in the graph database
36
+ // PostgreSQL is used only for user management and authentication
37
+
38
+ // Future models will be added here as we implement features:
39
+ // - Permission (may be in graph or SQL depending on requirements)
40
+ // - Role (likely in SQL for user roles)
41
+ // - Asset metadata (graph for relationships, filesystem for content)