@semiont/gateway 0.5.28

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,45 @@
1
+ {
2
+ "name": "@semiont/gateway",
3
+ "version": "0.5.28",
4
+ "type": "module",
5
+ "description": "Semiont gateway server - pre-built for npm consumption",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "semiont-gateway": "dist/index.js",
9
+ "semiont-useradd": "dist/cli/useradd.js"
10
+ },
11
+ "files": [
12
+ "dist",
13
+ "prisma",
14
+ "prisma.config.ts"
15
+ ],
16
+ "scripts": {
17
+ "start": "node dist/index.js"
18
+ },
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/The-AI-Alliance/semiont.git",
25
+ "directory": "apps/gateway"
26
+ },
27
+ "license": "Apache-2.0",
28
+ "dependencies": {
29
+ "@hono/node-server": "^2.1.1",
30
+ "@hono/swagger-ui": "^0.6.1",
31
+ "@prisma/adapter-pg": "^7.10.0",
32
+ "@prisma/client": "^7.10.0",
33
+ "@semiont/core": "0.5.28",
34
+ "@semiont/make-meaning": "0.5.28",
35
+ "@semiont/observability": "0.5.28",
36
+ "ajv": "^8.20.0",
37
+ "ajv-formats": "^3.0.1",
38
+ "argon2": "^0.45.1",
39
+ "hono": "^4.13.5",
40
+ "jsonwebtoken": "^9.0.2",
41
+ "prisma": "^7.10.0",
42
+ "winston": "^3.19.0",
43
+ "zod": "^4.4.3"
44
+ }
45
+ }
@@ -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
+ -- AlterTable: per-user token revocation epoch (SDK-AUTH-CORS Phase 2).
2
+ -- Bumped on logout to invalidate every outstanding token for the user.
3
+ ALTER TABLE "users" ADD COLUMN "tokenVersion" INTEGER NOT NULL DEFAULT 0;
@@ -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
+ }
11
+
12
+ // User model for OAuth and password authentication
13
+ model User {
14
+ id String @id @default(cuid())
15
+ email String @unique
16
+ name String?
17
+ image String? // Profile picture from OAuth provider
18
+ provider String // 'password', 'google', 'github', etc.
19
+ providerId String // OAuth provider's user ID (or email for password users)
20
+ passwordHash String? // bcrypt hash - NULL for OAuth users, required for password provider
21
+ domain String // Email domain for access control
22
+ isActive Boolean @default(true)
23
+ isAdmin Boolean @default(false) // Admin role for administrative access
24
+ isModerator Boolean @default(false) // Moderator role for content governance
25
+ termsAcceptedAt DateTime? // When user accepted terms of service
26
+ lastLogin DateTime?
27
+ tokenVersion Int @default(0) // bumped on logout to revoke all of this user's tokens (SDK-AUTH-CORS Phase 2)
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)
@@ -0,0 +1,7 @@
1
+ import { defineConfig } from '@prisma/config';
2
+
3
+ export default defineConfig({
4
+ datasource: {
5
+ url: process.env.DATABASE_URL,
6
+ },
7
+ });