opensentinel 3.6.1 → 3.7.0
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/README.md +12 -0
- package/dist/{agent-manager-7N7REQZQ.js → agent-manager-JZ4IM7XI.js} +8 -8
- package/dist/{agent-processor-I23VWQY3.js → agent-processor-DDDHC2SO.js} +22 -21
- package/dist/{agent-processor-I23VWQY3.js.map → agent-processor-DDDHC2SO.js.map} +1 -1
- package/dist/{alerting-4I37GG4U.js → alerting-LK7VVYTX.js} +4 -4
- package/dist/alerting-LK7VVYTX.js.map +1 -0
- package/dist/analyzer-OTWE3ARE.js +22 -0
- package/dist/{archiver-XLRIIXPY.js → archiver-FPGKRP6P.js} +16 -85
- package/dist/archiver-FPGKRP6P.js.map +1 -0
- package/dist/{audit-logger-AU3TMWKI.js → audit-logger-CI4WZQPD.js} +5 -5
- package/dist/bot-VDHBGUVI.js +47 -0
- package/dist/{brain-SLA474EU.js → brain-6QTXN4QP.js} +18 -17
- package/dist/{chunk-AR34B6XR.js → chunk-2I5QHYG6.js} +3 -3
- package/dist/chunk-2I5QHYG6.js.map +1 -0
- package/dist/chunk-3AWAWRWB.js +143 -0
- package/dist/chunk-3AWAWRWB.js.map +1 -0
- package/dist/{chunk-PUNIMPMY.js → chunk-4KIHDIXZ.js} +13 -2
- package/dist/chunk-4KIHDIXZ.js.map +1 -0
- package/dist/{chunk-GUKKW7JI.js → chunk-4WH6MFEW.js} +2 -2
- package/dist/chunk-4WH6MFEW.js.map +1 -0
- package/dist/{chunk-M7YLQHFP.js → chunk-56UJS2LA.js} +6 -6
- package/dist/{chunk-S4NJJS5C.js → chunk-5BTVJR7R.js} +3 -3
- package/dist/{chunk-HKOPRRDJ.js → chunk-5JJTLWOR.js} +3 -3
- package/dist/chunk-5JJTLWOR.js.map +1 -0
- package/dist/chunk-66SAOZPU.js +236 -0
- package/dist/chunk-66SAOZPU.js.map +1 -0
- package/dist/chunk-6HGMRR4J.js +113 -0
- package/dist/chunk-6HGMRR4J.js.map +1 -0
- package/dist/{chunk-BMOUYXLX.js → chunk-6ZNCY2GI.js} +5 -5
- package/dist/chunk-7BNFELEK.js +31 -0
- package/dist/chunk-7BNFELEK.js.map +1 -0
- package/dist/{chunk-KABG5PG3.js → chunk-BBN4VCNK.js} +4 -4
- package/dist/chunk-BBN4VCNK.js.map +1 -0
- package/dist/{chunk-4YJRBMMA.js → chunk-BNZHWAZC.js} +2 -2
- package/dist/{chunk-TAAZB5KN.js → chunk-CWT6CAE5.js} +2 -2
- package/dist/{chunk-UWUIJTT4.js → chunk-CZTMGHUC.js} +1 -1
- package/dist/chunk-CZTMGHUC.js.map +1 -0
- package/dist/chunk-DTISLIMB.js +89 -0
- package/dist/chunk-DTISLIMB.js.map +1 -0
- package/dist/{chunk-VKMFUIVA.js → chunk-GBVJTRXS.js} +2 -2
- package/dist/{chunk-MFK34XSY.js → chunk-GJETKBOY.js} +15 -15
- package/dist/chunk-GJETKBOY.js.map +1 -0
- package/dist/{chunk-HTF2GIQC.js → chunk-GW6V4D43.js} +2 -2
- package/dist/chunk-GW6V4D43.js.map +1 -0
- package/dist/{chunk-2RGPWU77.js → chunk-HJSEEFO3.js} +2 -2
- package/dist/{chunk-JOA5A3G3.js → chunk-HQZQFEAX.js} +5 -5
- package/dist/{chunk-45YXODSB.js → chunk-J4JW73TT.js} +2 -2
- package/dist/{chunk-KT7NLIXP.js → chunk-JHYYFPKX.js} +2 -2
- package/dist/{chunk-XMCVRVTF.js → chunk-P64EV4YY.js} +1 -1
- package/dist/chunk-P64EV4YY.js.map +1 -0
- package/dist/chunk-PBOCSGNL.js +84 -0
- package/dist/chunk-PBOCSGNL.js.map +1 -0
- package/dist/{chunk-H3BOLSTS.js → chunk-PD3CTDO6.js} +2 -2
- package/dist/{chunk-6UZPE35A.js → chunk-QPY3WRVM.js} +10 -87
- package/dist/chunk-QPY3WRVM.js.map +1 -0
- package/dist/{chunk-AD6YEH6U.js → chunk-S2EOIVF4.js} +590 -91
- package/dist/chunk-S2EOIVF4.js.map +1 -0
- package/dist/chunk-SDLOMKCW.js +213 -0
- package/dist/chunk-SDLOMKCW.js.map +1 -0
- package/dist/{chunk-7MZN73J2.js → chunk-TKBVW7ZJ.js} +4 -4
- package/dist/{chunk-A24GPVLY.js → chunk-V3OKHQUX.js} +5 -5
- package/dist/{chunk-NMSHVO5O.js → chunk-WMDVOWN6.js} +4 -4
- package/dist/{chunk-643M3AP5.js → chunk-WMFYI7XC.js} +7 -7
- package/dist/{chunk-6LTLIYAQ.js → chunk-YEDEAX6Y.js} +3 -3
- package/dist/{chunk-NYVBXUGD.js → chunk-ZIBRVA3Y.js} +60 -1
- package/dist/chunk-ZIBRVA3Y.js.map +1 -0
- package/dist/{chunk-6JY4HNUH.js → chunk-ZMML6T63.js} +361 -24
- package/dist/chunk-ZMML6T63.js.map +1 -0
- package/dist/{chunk-FFV2SXFD.js → chunk-ZVHG4KF2.js} +4 -4
- package/dist/cli.js.map +1 -1
- package/dist/commands/setup.js +1 -1
- package/dist/commands/start.js +2 -2
- package/dist/commands/status.js +1 -1
- package/dist/commands/stop.js +1 -1
- package/dist/commands/utils.js +1 -1
- package/dist/{cost-tracker-EMOIOYH7.js → cost-tracker-KZQSTSE2.js} +2 -2
- package/dist/{db-LRIOKQBO.js → db-I7MNG6CL.js} +10 -4
- package/dist/{discord-NKR3X4AV.js → discord-6UQHCN27.js} +24 -23
- package/dist/{documents-EYIYLZK2.js → documents-PFHSK7SZ.js} +19 -19
- package/dist/{email-EAQNULVD.js → email-6OIN4SYL.js} +22 -21
- package/dist/email-6OIN4SYL.js.map +1 -0
- package/dist/{enhanced-retrieval-OGHT6TS5.js → enhanced-retrieval-JWX2HWU4.js} +7 -6
- package/dist/{enhanced-retrieval-OGHT6TS5.js.map → enhanced-retrieval-JWX2HWU4.js.map} +1 -1
- package/dist/enrichment-pipeline-7FE5R5ZI.js +14 -0
- package/dist/{entity-resolution-4X4JU43O.js → entity-resolution-7Z6STVXX.js} +5 -5
- package/dist/{env-CHOFICED.js → env-GN5VHI43.js} +2 -2
- package/dist/{error-tracker-SVQSDQDW.js → error-tracker-64DEH3D7.js} +6 -6
- package/dist/{github-KGNILDWJ.js → github-DUWSXCNP.js} +4 -4
- package/dist/graph-client-NB475AK5.js +17 -0
- package/dist/{imessage-V2XNDDHT.js → imessage-DSGSGUZS.js} +19 -18
- package/dist/{inbox-summarizer-DKKRYXDR.js → inbox-summarizer-F2KAU72V.js} +19 -18
- package/dist/{incident-response-ZTIKUWEO.js → incident-response-E3UGMX5G.js} +5 -5
- package/dist/incident-response-E3UGMX5G.js.map +1 -0
- package/dist/{knowledge-base-J7PJ7MZ3.js → knowledge-base-5SMMOGQJ.js} +5 -5
- package/dist/lib.d.ts +21 -0
- package/dist/lib.js +64 -57
- package/dist/lib.js.map +1 -1
- package/dist/{matrix-XHTR53VQ.js → matrix-WYGEOZL5.js} +18 -17
- package/dist/{matrix-XHTR53VQ.js.map → matrix-WYGEOZL5.js.map} +1 -1
- package/dist/{mcp-3C2TN67D.js → mcp-DJ2QDA6A.js} +2 -2
- package/dist/{metrics-VJDWQWU7.js → metrics-BH3ZLGEV.js} +5 -5
- package/dist/{multi-user-S56GUD6L.js → multi-user-XAEMB244.js} +4 -4
- package/dist/oauth-UPJYFOVU.js +34 -0
- package/dist/{ocr-LGUIPKVZ.js → ocr-UONKTQU7.js} +4 -4
- package/dist/{presentations-HXTAMGHT.js → presentations-UOET2FVZ.js} +2 -2
- package/dist/{providers-H6YIC3MG.js → providers-2YQ6E3IF.js} +3 -3
- package/dist/{scheduler-CA5UNHZV.js → scheduler-6PLLAQI7.js} +21 -20
- package/dist/{schema-ALJ67YVG.js → schema-ETY7L2VA.js} +8 -2
- package/dist/sharepoint-V5P4Q62L.js +30 -0
- package/dist/{signal-X7IQJGRQ.js → signal-7D5EPGVL.js} +19 -18
- package/dist/{slack-P2LFUJUQ.js → slack-KSS6YK5Z.js} +23 -22
- package/dist/slack-KSS6YK5Z.js.map +1 -0
- package/dist/{sms-4VME2HUL.js → sms-CSUCC7HL.js} +3 -3
- package/dist/sms-CSUCC7HL.js.map +1 -0
- package/dist/{src-S5KX4YEV.js → src-GO7GGW7O.js} +48 -41
- package/dist/{src-S5KX4YEV.js.map → src-GO7GGW7O.js.map} +1 -1
- package/dist/token-store-SEWRX6RE.js +20 -0
- package/dist/token-store-SEWRX6RE.js.map +1 -0
- package/dist/{tools-FGPN522P.js → tools-PJZ6RI4P.js} +18 -17
- package/dist/tools-PJZ6RI4P.js.map +1 -0
- package/dist/{whatsapp-KRPQ4YUX.js → whatsapp-DWXK25V2.js} +19 -18
- package/dist/whatsapp-DWXK25V2.js.map +1 -0
- package/dist/{word-document-D6N2C47N.js → word-document-AV3YB4L2.js} +2 -2
- package/dist/{workflow-store-ZYAYE5P6.js → workflow-store-5Y56GUP7.js} +4 -4
- package/drizzle/0002_mushy_master_mold.sql +139 -139
- package/drizzle/0003_overjoyed_rhodey.sql +46 -0
- package/drizzle/meta/0002_snapshot.json +3636 -3636
- package/drizzle/meta/0003_snapshot.json +3946 -0
- package/drizzle/meta/_journal.json +7 -0
- package/package.json +110 -110
- package/dist/alerting-4I37GG4U.js.map +0 -1
- package/dist/archiver-XLRIIXPY.js.map +0 -1
- package/dist/bot-MU2TJQ3Y.js +0 -46
- package/dist/chunk-6JY4HNUH.js.map +0 -1
- package/dist/chunk-6UZPE35A.js.map +0 -1
- package/dist/chunk-AD6YEH6U.js.map +0 -1
- package/dist/chunk-AR34B6XR.js.map +0 -1
- package/dist/chunk-GUKKW7JI.js.map +0 -1
- package/dist/chunk-HKOPRRDJ.js.map +0 -1
- package/dist/chunk-HTF2GIQC.js.map +0 -1
- package/dist/chunk-KABG5PG3.js.map +0 -1
- package/dist/chunk-MFK34XSY.js.map +0 -1
- package/dist/chunk-NYVBXUGD.js.map +0 -1
- package/dist/chunk-PUNIMPMY.js.map +0 -1
- package/dist/chunk-UWUIJTT4.js.map +0 -1
- package/dist/chunk-XMCVRVTF.js.map +0 -1
- package/dist/email-EAQNULVD.js.map +0 -1
- package/dist/enrichment-pipeline-CMUVBDC7.js +0 -14
- package/dist/incident-response-ZTIKUWEO.js.map +0 -1
- /package/dist/{agent-manager-7N7REQZQ.js.map → agent-manager-JZ4IM7XI.js.map} +0 -0
- /package/dist/{audit-logger-AU3TMWKI.js.map → analyzer-OTWE3ARE.js.map} +0 -0
- /package/dist/{bot-MU2TJQ3Y.js.map → audit-logger-CI4WZQPD.js.map} +0 -0
- /package/dist/{brain-SLA474EU.js.map → bot-VDHBGUVI.js.map} +0 -0
- /package/dist/{cost-tracker-EMOIOYH7.js.map → brain-6QTXN4QP.js.map} +0 -0
- /package/dist/{chunk-M7YLQHFP.js.map → chunk-56UJS2LA.js.map} +0 -0
- /package/dist/{chunk-S4NJJS5C.js.map → chunk-5BTVJR7R.js.map} +0 -0
- /package/dist/{chunk-BMOUYXLX.js.map → chunk-6ZNCY2GI.js.map} +0 -0
- /package/dist/{chunk-4YJRBMMA.js.map → chunk-BNZHWAZC.js.map} +0 -0
- /package/dist/{chunk-TAAZB5KN.js.map → chunk-CWT6CAE5.js.map} +0 -0
- /package/dist/{chunk-VKMFUIVA.js.map → chunk-GBVJTRXS.js.map} +0 -0
- /package/dist/{chunk-2RGPWU77.js.map → chunk-HJSEEFO3.js.map} +0 -0
- /package/dist/{chunk-JOA5A3G3.js.map → chunk-HQZQFEAX.js.map} +0 -0
- /package/dist/{chunk-45YXODSB.js.map → chunk-J4JW73TT.js.map} +0 -0
- /package/dist/{chunk-KT7NLIXP.js.map → chunk-JHYYFPKX.js.map} +0 -0
- /package/dist/{chunk-H3BOLSTS.js.map → chunk-PD3CTDO6.js.map} +0 -0
- /package/dist/{chunk-7MZN73J2.js.map → chunk-TKBVW7ZJ.js.map} +0 -0
- /package/dist/{chunk-A24GPVLY.js.map → chunk-V3OKHQUX.js.map} +0 -0
- /package/dist/{chunk-NMSHVO5O.js.map → chunk-WMDVOWN6.js.map} +0 -0
- /package/dist/{chunk-643M3AP5.js.map → chunk-WMFYI7XC.js.map} +0 -0
- /package/dist/{chunk-6LTLIYAQ.js.map → chunk-YEDEAX6Y.js.map} +0 -0
- /package/dist/{chunk-FFV2SXFD.js.map → chunk-ZVHG4KF2.js.map} +0 -0
- /package/dist/{db-LRIOKQBO.js.map → cost-tracker-KZQSTSE2.js.map} +0 -0
- /package/dist/{discord-NKR3X4AV.js.map → db-I7MNG6CL.js.map} +0 -0
- /package/dist/{enrichment-pipeline-CMUVBDC7.js.map → discord-6UQHCN27.js.map} +0 -0
- /package/dist/{documents-EYIYLZK2.js.map → documents-PFHSK7SZ.js.map} +0 -0
- /package/dist/{entity-resolution-4X4JU43O.js.map → enrichment-pipeline-7FE5R5ZI.js.map} +0 -0
- /package/dist/{env-CHOFICED.js.map → entity-resolution-7Z6STVXX.js.map} +0 -0
- /package/dist/{error-tracker-SVQSDQDW.js.map → env-GN5VHI43.js.map} +0 -0
- /package/dist/{imessage-V2XNDDHT.js.map → error-tracker-64DEH3D7.js.map} +0 -0
- /package/dist/{github-KGNILDWJ.js.map → github-DUWSXCNP.js.map} +0 -0
- /package/dist/{inbox-summarizer-DKKRYXDR.js.map → graph-client-NB475AK5.js.map} +0 -0
- /package/dist/{knowledge-base-J7PJ7MZ3.js.map → imessage-DSGSGUZS.js.map} +0 -0
- /package/dist/{mcp-3C2TN67D.js.map → inbox-summarizer-F2KAU72V.js.map} +0 -0
- /package/dist/{metrics-VJDWQWU7.js.map → knowledge-base-5SMMOGQJ.js.map} +0 -0
- /package/dist/{ocr-LGUIPKVZ.js.map → mcp-DJ2QDA6A.js.map} +0 -0
- /package/dist/{providers-H6YIC3MG.js.map → metrics-BH3ZLGEV.js.map} +0 -0
- /package/dist/{multi-user-S56GUD6L.js.map → multi-user-XAEMB244.js.map} +0 -0
- /package/dist/{scheduler-CA5UNHZV.js.map → oauth-UPJYFOVU.js.map} +0 -0
- /package/dist/{schema-ALJ67YVG.js.map → ocr-UONKTQU7.js.map} +0 -0
- /package/dist/{presentations-HXTAMGHT.js.map → presentations-UOET2FVZ.js.map} +0 -0
- /package/dist/{signal-X7IQJGRQ.js.map → providers-2YQ6E3IF.js.map} +0 -0
- /package/dist/{slack-P2LFUJUQ.js.map → scheduler-6PLLAQI7.js.map} +0 -0
- /package/dist/{sms-4VME2HUL.js.map → schema-ETY7L2VA.js.map} +0 -0
- /package/dist/{tools-FGPN522P.js.map → sharepoint-V5P4Q62L.js.map} +0 -0
- /package/dist/{whatsapp-KRPQ4YUX.js.map → signal-7D5EPGVL.js.map} +0 -0
- /package/dist/{word-document-D6N2C47N.js.map → word-document-AV3YB4L2.js.map} +0 -0
- /package/dist/{workflow-store-ZYAYE5P6.js.map → workflow-store-5Y56GUP7.js.map} +0 -0
|
@@ -1,140 +1,140 @@
|
|
|
1
|
-
CREATE TABLE "document_chunks" (
|
|
2
|
-
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
3
|
-
"document_id" uuid NOT NULL,
|
|
4
|
-
"chunk_index" integer NOT NULL,
|
|
5
|
-
"content" text NOT NULL,
|
|
6
|
-
"embedding" vector(1536),
|
|
7
|
-
"token_count" integer,
|
|
8
|
-
"metadata" jsonb,
|
|
9
|
-
"created_at" timestamp DEFAULT now() NOT NULL
|
|
10
|
-
);
|
|
11
|
-
--> statement-breakpoint
|
|
12
|
-
CREATE TABLE "documents" (
|
|
13
|
-
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
14
|
-
"name" text NOT NULL,
|
|
15
|
-
"filename" text,
|
|
16
|
-
"mime_type" text,
|
|
17
|
-
"file_size" integer,
|
|
18
|
-
"source" text,
|
|
19
|
-
"source_url" text,
|
|
20
|
-
"metadata" jsonb,
|
|
21
|
-
"status" text DEFAULT 'pending' NOT NULL,
|
|
22
|
-
"error_message" text,
|
|
23
|
-
"chunk_count" integer DEFAULT 0,
|
|
24
|
-
"total_tokens" integer DEFAULT 0,
|
|
25
|
-
"user_id" uuid,
|
|
26
|
-
"created_at" timestamp DEFAULT now() NOT NULL,
|
|
27
|
-
"updated_at" timestamp DEFAULT now() NOT NULL,
|
|
28
|
-
"processed_at" timestamp
|
|
29
|
-
);
|
|
30
|
-
--> statement-breakpoint
|
|
31
|
-
CREATE TABLE "graph_entities" (
|
|
32
|
-
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
33
|
-
"user_id" uuid,
|
|
34
|
-
"type" text NOT NULL,
|
|
35
|
-
"name" text NOT NULL,
|
|
36
|
-
"aliases" jsonb DEFAULT '[]'::jsonb,
|
|
37
|
-
"description" text,
|
|
38
|
-
"attributes" jsonb DEFAULT '{}'::jsonb,
|
|
39
|
-
"importance" integer DEFAULT 50,
|
|
40
|
-
"mention_count" integer DEFAULT 1,
|
|
41
|
-
"embedding" vector(1536),
|
|
42
|
-
"created_at" timestamp DEFAULT now() NOT NULL,
|
|
43
|
-
"updated_at" timestamp DEFAULT now() NOT NULL
|
|
44
|
-
);
|
|
45
|
-
--> statement-breakpoint
|
|
46
|
-
CREATE TABLE "graph_relationships" (
|
|
47
|
-
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
48
|
-
"source_entity_id" uuid NOT NULL,
|
|
49
|
-
"target_entity_id" uuid NOT NULL,
|
|
50
|
-
"type" text NOT NULL,
|
|
51
|
-
"strength" integer DEFAULT 50,
|
|
52
|
-
"bidirectional" boolean DEFAULT false,
|
|
53
|
-
"context" text,
|
|
54
|
-
"attributes" jsonb DEFAULT '{}'::jsonb,
|
|
55
|
-
"created_at" timestamp DEFAULT now() NOT NULL,
|
|
56
|
-
"updated_at" timestamp DEFAULT now() NOT NULL
|
|
57
|
-
);
|
|
58
|
-
--> statement-breakpoint
|
|
59
|
-
CREATE TABLE "incident_timeline" (
|
|
60
|
-
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
61
|
-
"incident_id" uuid NOT NULL,
|
|
62
|
-
"event_type" text NOT NULL,
|
|
63
|
-
"description" text NOT NULL,
|
|
64
|
-
"performed_by" uuid,
|
|
65
|
-
"metadata" jsonb,
|
|
66
|
-
"created_at" timestamp DEFAULT now() NOT NULL
|
|
67
|
-
);
|
|
68
|
-
--> statement-breakpoint
|
|
69
|
-
CREATE TABLE "security_incidents" (
|
|
70
|
-
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
71
|
-
"incident_number" text NOT NULL,
|
|
72
|
-
"title" text NOT NULL,
|
|
73
|
-
"description" text NOT NULL,
|
|
74
|
-
"type" text NOT NULL,
|
|
75
|
-
"severity" text NOT NULL,
|
|
76
|
-
"status" text DEFAULT 'open' NOT NULL,
|
|
77
|
-
"user_id" uuid,
|
|
78
|
-
"assigned_to" uuid,
|
|
79
|
-
"source" text NOT NULL,
|
|
80
|
-
"source_data" jsonb,
|
|
81
|
-
"impact_assessment" text,
|
|
82
|
-
"containment_actions" jsonb,
|
|
83
|
-
"resolution_notes" text,
|
|
84
|
-
"related_incidents" jsonb,
|
|
85
|
-
"metadata" jsonb,
|
|
86
|
-
"created_at" timestamp DEFAULT now() NOT NULL,
|
|
87
|
-
"updated_at" timestamp DEFAULT now() NOT NULL,
|
|
88
|
-
"investigated_at" timestamp,
|
|
89
|
-
"contained_at" timestamp,
|
|
90
|
-
"resolved_at" timestamp,
|
|
91
|
-
"closed_at" timestamp,
|
|
92
|
-
CONSTRAINT "security_incidents_incident_number_unique" UNIQUE("incident_number")
|
|
93
|
-
);
|
|
94
|
-
--> statement-breakpoint
|
|
95
|
-
CREATE TABLE "two_factor_auth" (
|
|
96
|
-
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
97
|
-
"user_id" uuid NOT NULL,
|
|
98
|
-
"secret_encrypted" text NOT NULL,
|
|
99
|
-
"recovery_codes" jsonb NOT NULL,
|
|
100
|
-
"enabled_at" timestamp NOT NULL,
|
|
101
|
-
"last_verified_at" timestamp,
|
|
102
|
-
"key_version" integer DEFAULT 1 NOT NULL,
|
|
103
|
-
"metadata" jsonb,
|
|
104
|
-
"created_at" timestamp DEFAULT now() NOT NULL,
|
|
105
|
-
"updated_at" timestamp DEFAULT now() NOT NULL,
|
|
106
|
-
CONSTRAINT "two_factor_auth_user_id_unique" UNIQUE("user_id")
|
|
107
|
-
);
|
|
108
|
-
--> statement-breakpoint
|
|
109
|
-
ALTER TABLE "audit_logs" ADD COLUMN "sequence_number" integer;--> statement-breakpoint
|
|
110
|
-
ALTER TABLE "audit_logs" ADD COLUMN "entry_hash" text;--> statement-breakpoint
|
|
111
|
-
ALTER TABLE "audit_logs" ADD COLUMN "previous_hash" text;--> statement-breakpoint
|
|
112
|
-
ALTER TABLE "memories" ADD COLUMN "search_vector" "tsvector";--> statement-breakpoint
|
|
113
|
-
ALTER TABLE "memories" ADD COLUMN "provenance" text;--> statement-breakpoint
|
|
114
|
-
ALTER TABLE "memories" ADD COLUMN "encrypted" boolean DEFAULT false NOT NULL;--> statement-breakpoint
|
|
115
|
-
ALTER TABLE "messages" ADD COLUMN "encrypted" boolean DEFAULT false NOT NULL;--> statement-breakpoint
|
|
116
|
-
ALTER TABLE "document_chunks" ADD CONSTRAINT "document_chunks_document_id_documents_id_fk" FOREIGN KEY ("document_id") REFERENCES "public"."documents"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
117
|
-
ALTER TABLE "documents" ADD CONSTRAINT "documents_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
118
|
-
ALTER TABLE "graph_entities" ADD CONSTRAINT "graph_entities_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
119
|
-
ALTER TABLE "graph_relationships" ADD CONSTRAINT "graph_relationships_source_entity_id_graph_entities_id_fk" FOREIGN KEY ("source_entity_id") REFERENCES "public"."graph_entities"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
120
|
-
ALTER TABLE "graph_relationships" ADD CONSTRAINT "graph_relationships_target_entity_id_graph_entities_id_fk" FOREIGN KEY ("target_entity_id") REFERENCES "public"."graph_entities"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
121
|
-
ALTER TABLE "incident_timeline" ADD CONSTRAINT "incident_timeline_incident_id_security_incidents_id_fk" FOREIGN KEY ("incident_id") REFERENCES "public"."security_incidents"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
122
|
-
ALTER TABLE "incident_timeline" ADD CONSTRAINT "incident_timeline_performed_by_users_id_fk" FOREIGN KEY ("performed_by") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
123
|
-
ALTER TABLE "security_incidents" ADD CONSTRAINT "security_incidents_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
124
|
-
ALTER TABLE "security_incidents" ADD CONSTRAINT "security_incidents_assigned_to_users_id_fk" FOREIGN KEY ("assigned_to") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
125
|
-
ALTER TABLE "two_factor_auth" ADD CONSTRAINT "two_factor_auth_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
126
|
-
CREATE INDEX "document_chunks_document_idx" ON "document_chunks" USING btree ("document_id");--> statement-breakpoint
|
|
127
|
-
CREATE INDEX "documents_user_idx" ON "documents" USING btree ("user_id");--> statement-breakpoint
|
|
128
|
-
CREATE INDEX "documents_status_idx" ON "documents" USING btree ("status");--> statement-breakpoint
|
|
129
|
-
CREATE INDEX "graph_entities_user_idx" ON "graph_entities" USING btree ("user_id");--> statement-breakpoint
|
|
130
|
-
CREATE INDEX "graph_entities_type_idx" ON "graph_entities" USING btree ("type");--> statement-breakpoint
|
|
131
|
-
CREATE INDEX "graph_entities_name_idx" ON "graph_entities" USING btree ("name");--> statement-breakpoint
|
|
132
|
-
CREATE INDEX "graph_rel_source_idx" ON "graph_relationships" USING btree ("source_entity_id");--> statement-breakpoint
|
|
133
|
-
CREATE INDEX "graph_rel_target_idx" ON "graph_relationships" USING btree ("target_entity_id");--> statement-breakpoint
|
|
134
|
-
CREATE INDEX "graph_rel_type_idx" ON "graph_relationships" USING btree ("type");--> statement-breakpoint
|
|
135
|
-
CREATE INDEX "incident_timeline_incident_idx" ON "incident_timeline" USING btree ("incident_id");--> statement-breakpoint
|
|
136
|
-
CREATE INDEX "security_incidents_status_idx" ON "security_incidents" USING btree ("status");--> statement-breakpoint
|
|
137
|
-
CREATE INDEX "security_incidents_severity_idx" ON "security_incidents" USING btree ("severity");--> statement-breakpoint
|
|
138
|
-
CREATE INDEX "security_incidents_created_idx" ON "security_incidents" USING btree ("created_at");--> statement-breakpoint
|
|
139
|
-
CREATE INDEX "two_factor_auth_user_idx" ON "two_factor_auth" USING btree ("user_id");--> statement-breakpoint
|
|
1
|
+
CREATE TABLE "document_chunks" (
|
|
2
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
3
|
+
"document_id" uuid NOT NULL,
|
|
4
|
+
"chunk_index" integer NOT NULL,
|
|
5
|
+
"content" text NOT NULL,
|
|
6
|
+
"embedding" vector(1536),
|
|
7
|
+
"token_count" integer,
|
|
8
|
+
"metadata" jsonb,
|
|
9
|
+
"created_at" timestamp DEFAULT now() NOT NULL
|
|
10
|
+
);
|
|
11
|
+
--> statement-breakpoint
|
|
12
|
+
CREATE TABLE "documents" (
|
|
13
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
14
|
+
"name" text NOT NULL,
|
|
15
|
+
"filename" text,
|
|
16
|
+
"mime_type" text,
|
|
17
|
+
"file_size" integer,
|
|
18
|
+
"source" text,
|
|
19
|
+
"source_url" text,
|
|
20
|
+
"metadata" jsonb,
|
|
21
|
+
"status" text DEFAULT 'pending' NOT NULL,
|
|
22
|
+
"error_message" text,
|
|
23
|
+
"chunk_count" integer DEFAULT 0,
|
|
24
|
+
"total_tokens" integer DEFAULT 0,
|
|
25
|
+
"user_id" uuid,
|
|
26
|
+
"created_at" timestamp DEFAULT now() NOT NULL,
|
|
27
|
+
"updated_at" timestamp DEFAULT now() NOT NULL,
|
|
28
|
+
"processed_at" timestamp
|
|
29
|
+
);
|
|
30
|
+
--> statement-breakpoint
|
|
31
|
+
CREATE TABLE "graph_entities" (
|
|
32
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
33
|
+
"user_id" uuid,
|
|
34
|
+
"type" text NOT NULL,
|
|
35
|
+
"name" text NOT NULL,
|
|
36
|
+
"aliases" jsonb DEFAULT '[]'::jsonb,
|
|
37
|
+
"description" text,
|
|
38
|
+
"attributes" jsonb DEFAULT '{}'::jsonb,
|
|
39
|
+
"importance" integer DEFAULT 50,
|
|
40
|
+
"mention_count" integer DEFAULT 1,
|
|
41
|
+
"embedding" vector(1536),
|
|
42
|
+
"created_at" timestamp DEFAULT now() NOT NULL,
|
|
43
|
+
"updated_at" timestamp DEFAULT now() NOT NULL
|
|
44
|
+
);
|
|
45
|
+
--> statement-breakpoint
|
|
46
|
+
CREATE TABLE "graph_relationships" (
|
|
47
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
48
|
+
"source_entity_id" uuid NOT NULL,
|
|
49
|
+
"target_entity_id" uuid NOT NULL,
|
|
50
|
+
"type" text NOT NULL,
|
|
51
|
+
"strength" integer DEFAULT 50,
|
|
52
|
+
"bidirectional" boolean DEFAULT false,
|
|
53
|
+
"context" text,
|
|
54
|
+
"attributes" jsonb DEFAULT '{}'::jsonb,
|
|
55
|
+
"created_at" timestamp DEFAULT now() NOT NULL,
|
|
56
|
+
"updated_at" timestamp DEFAULT now() NOT NULL
|
|
57
|
+
);
|
|
58
|
+
--> statement-breakpoint
|
|
59
|
+
CREATE TABLE "incident_timeline" (
|
|
60
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
61
|
+
"incident_id" uuid NOT NULL,
|
|
62
|
+
"event_type" text NOT NULL,
|
|
63
|
+
"description" text NOT NULL,
|
|
64
|
+
"performed_by" uuid,
|
|
65
|
+
"metadata" jsonb,
|
|
66
|
+
"created_at" timestamp DEFAULT now() NOT NULL
|
|
67
|
+
);
|
|
68
|
+
--> statement-breakpoint
|
|
69
|
+
CREATE TABLE "security_incidents" (
|
|
70
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
71
|
+
"incident_number" text NOT NULL,
|
|
72
|
+
"title" text NOT NULL,
|
|
73
|
+
"description" text NOT NULL,
|
|
74
|
+
"type" text NOT NULL,
|
|
75
|
+
"severity" text NOT NULL,
|
|
76
|
+
"status" text DEFAULT 'open' NOT NULL,
|
|
77
|
+
"user_id" uuid,
|
|
78
|
+
"assigned_to" uuid,
|
|
79
|
+
"source" text NOT NULL,
|
|
80
|
+
"source_data" jsonb,
|
|
81
|
+
"impact_assessment" text,
|
|
82
|
+
"containment_actions" jsonb,
|
|
83
|
+
"resolution_notes" text,
|
|
84
|
+
"related_incidents" jsonb,
|
|
85
|
+
"metadata" jsonb,
|
|
86
|
+
"created_at" timestamp DEFAULT now() NOT NULL,
|
|
87
|
+
"updated_at" timestamp DEFAULT now() NOT NULL,
|
|
88
|
+
"investigated_at" timestamp,
|
|
89
|
+
"contained_at" timestamp,
|
|
90
|
+
"resolved_at" timestamp,
|
|
91
|
+
"closed_at" timestamp,
|
|
92
|
+
CONSTRAINT "security_incidents_incident_number_unique" UNIQUE("incident_number")
|
|
93
|
+
);
|
|
94
|
+
--> statement-breakpoint
|
|
95
|
+
CREATE TABLE "two_factor_auth" (
|
|
96
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
97
|
+
"user_id" uuid NOT NULL,
|
|
98
|
+
"secret_encrypted" text NOT NULL,
|
|
99
|
+
"recovery_codes" jsonb NOT NULL,
|
|
100
|
+
"enabled_at" timestamp NOT NULL,
|
|
101
|
+
"last_verified_at" timestamp,
|
|
102
|
+
"key_version" integer DEFAULT 1 NOT NULL,
|
|
103
|
+
"metadata" jsonb,
|
|
104
|
+
"created_at" timestamp DEFAULT now() NOT NULL,
|
|
105
|
+
"updated_at" timestamp DEFAULT now() NOT NULL,
|
|
106
|
+
CONSTRAINT "two_factor_auth_user_id_unique" UNIQUE("user_id")
|
|
107
|
+
);
|
|
108
|
+
--> statement-breakpoint
|
|
109
|
+
ALTER TABLE "audit_logs" ADD COLUMN "sequence_number" integer;--> statement-breakpoint
|
|
110
|
+
ALTER TABLE "audit_logs" ADD COLUMN "entry_hash" text;--> statement-breakpoint
|
|
111
|
+
ALTER TABLE "audit_logs" ADD COLUMN "previous_hash" text;--> statement-breakpoint
|
|
112
|
+
ALTER TABLE "memories" ADD COLUMN "search_vector" "tsvector";--> statement-breakpoint
|
|
113
|
+
ALTER TABLE "memories" ADD COLUMN "provenance" text;--> statement-breakpoint
|
|
114
|
+
ALTER TABLE "memories" ADD COLUMN "encrypted" boolean DEFAULT false NOT NULL;--> statement-breakpoint
|
|
115
|
+
ALTER TABLE "messages" ADD COLUMN "encrypted" boolean DEFAULT false NOT NULL;--> statement-breakpoint
|
|
116
|
+
ALTER TABLE "document_chunks" ADD CONSTRAINT "document_chunks_document_id_documents_id_fk" FOREIGN KEY ("document_id") REFERENCES "public"."documents"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
117
|
+
ALTER TABLE "documents" ADD CONSTRAINT "documents_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
118
|
+
ALTER TABLE "graph_entities" ADD CONSTRAINT "graph_entities_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
119
|
+
ALTER TABLE "graph_relationships" ADD CONSTRAINT "graph_relationships_source_entity_id_graph_entities_id_fk" FOREIGN KEY ("source_entity_id") REFERENCES "public"."graph_entities"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
120
|
+
ALTER TABLE "graph_relationships" ADD CONSTRAINT "graph_relationships_target_entity_id_graph_entities_id_fk" FOREIGN KEY ("target_entity_id") REFERENCES "public"."graph_entities"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
121
|
+
ALTER TABLE "incident_timeline" ADD CONSTRAINT "incident_timeline_incident_id_security_incidents_id_fk" FOREIGN KEY ("incident_id") REFERENCES "public"."security_incidents"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
122
|
+
ALTER TABLE "incident_timeline" ADD CONSTRAINT "incident_timeline_performed_by_users_id_fk" FOREIGN KEY ("performed_by") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
123
|
+
ALTER TABLE "security_incidents" ADD CONSTRAINT "security_incidents_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
124
|
+
ALTER TABLE "security_incidents" ADD CONSTRAINT "security_incidents_assigned_to_users_id_fk" FOREIGN KEY ("assigned_to") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
125
|
+
ALTER TABLE "two_factor_auth" ADD CONSTRAINT "two_factor_auth_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
126
|
+
CREATE INDEX "document_chunks_document_idx" ON "document_chunks" USING btree ("document_id");--> statement-breakpoint
|
|
127
|
+
CREATE INDEX "documents_user_idx" ON "documents" USING btree ("user_id");--> statement-breakpoint
|
|
128
|
+
CREATE INDEX "documents_status_idx" ON "documents" USING btree ("status");--> statement-breakpoint
|
|
129
|
+
CREATE INDEX "graph_entities_user_idx" ON "graph_entities" USING btree ("user_id");--> statement-breakpoint
|
|
130
|
+
CREATE INDEX "graph_entities_type_idx" ON "graph_entities" USING btree ("type");--> statement-breakpoint
|
|
131
|
+
CREATE INDEX "graph_entities_name_idx" ON "graph_entities" USING btree ("name");--> statement-breakpoint
|
|
132
|
+
CREATE INDEX "graph_rel_source_idx" ON "graph_relationships" USING btree ("source_entity_id");--> statement-breakpoint
|
|
133
|
+
CREATE INDEX "graph_rel_target_idx" ON "graph_relationships" USING btree ("target_entity_id");--> statement-breakpoint
|
|
134
|
+
CREATE INDEX "graph_rel_type_idx" ON "graph_relationships" USING btree ("type");--> statement-breakpoint
|
|
135
|
+
CREATE INDEX "incident_timeline_incident_idx" ON "incident_timeline" USING btree ("incident_id");--> statement-breakpoint
|
|
136
|
+
CREATE INDEX "security_incidents_status_idx" ON "security_incidents" USING btree ("status");--> statement-breakpoint
|
|
137
|
+
CREATE INDEX "security_incidents_severity_idx" ON "security_incidents" USING btree ("severity");--> statement-breakpoint
|
|
138
|
+
CREATE INDEX "security_incidents_created_idx" ON "security_incidents" USING btree ("created_at");--> statement-breakpoint
|
|
139
|
+
CREATE INDEX "two_factor_auth_user_idx" ON "two_factor_auth" USING btree ("user_id");--> statement-breakpoint
|
|
140
140
|
CREATE INDEX "audit_logs_sequence_idx" ON "audit_logs" USING btree ("sequence_number");
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
CREATE TABLE "m365_analysis_results" (
|
|
2
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
3
|
+
"user_key" text NOT NULL,
|
|
4
|
+
"input_type" text NOT NULL,
|
|
5
|
+
"input_id" text,
|
|
6
|
+
"subject" text,
|
|
7
|
+
"sender" text,
|
|
8
|
+
"risk_score" integer NOT NULL,
|
|
9
|
+
"category" text NOT NULL,
|
|
10
|
+
"explanation" jsonb,
|
|
11
|
+
"recommended_actions" jsonb,
|
|
12
|
+
"engine" text NOT NULL,
|
|
13
|
+
"model" text,
|
|
14
|
+
"latency_ms" integer,
|
|
15
|
+
"created_at" timestamp DEFAULT now() NOT NULL
|
|
16
|
+
);
|
|
17
|
+
--> statement-breakpoint
|
|
18
|
+
CREATE TABLE "m365_connections" (
|
|
19
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
20
|
+
"user_key" text NOT NULL,
|
|
21
|
+
"microsoft_user_id" text,
|
|
22
|
+
"email" text,
|
|
23
|
+
"display_name" text,
|
|
24
|
+
"access_token_encrypted" text NOT NULL,
|
|
25
|
+
"refresh_token_encrypted" text,
|
|
26
|
+
"scope" text,
|
|
27
|
+
"token_type" text DEFAULT 'Bearer',
|
|
28
|
+
"expires_at" timestamp NOT NULL,
|
|
29
|
+
"created_at" timestamp DEFAULT now() NOT NULL,
|
|
30
|
+
"updated_at" timestamp DEFAULT now() NOT NULL,
|
|
31
|
+
CONSTRAINT "m365_connections_user_key_unique" UNIQUE("user_key")
|
|
32
|
+
);
|
|
33
|
+
--> statement-breakpoint
|
|
34
|
+
CREATE TABLE "m365_oauth_states" (
|
|
35
|
+
"state" text PRIMARY KEY NOT NULL,
|
|
36
|
+
"code_verifier" text NOT NULL,
|
|
37
|
+
"user_key" text,
|
|
38
|
+
"return_to" text,
|
|
39
|
+
"created_at" timestamp DEFAULT now() NOT NULL,
|
|
40
|
+
"expires_at" timestamp NOT NULL
|
|
41
|
+
);
|
|
42
|
+
--> statement-breakpoint
|
|
43
|
+
CREATE INDEX "m365_analysis_user_idx" ON "m365_analysis_results" USING btree ("user_key");--> statement-breakpoint
|
|
44
|
+
CREATE INDEX "m365_analysis_created_idx" ON "m365_analysis_results" USING btree ("created_at");--> statement-breakpoint
|
|
45
|
+
CREATE INDEX "m365_connections_user_idx" ON "m365_connections" USING btree ("user_key");--> statement-breakpoint
|
|
46
|
+
CREATE INDEX "m365_oauth_states_expires_idx" ON "m365_oauth_states" USING btree ("expires_at");
|