@aiquants/enrichment-drizzle 0.1.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/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ import{bigint as B,bit as re,datetime2 as C,float as F,int as m,nvarchar as l,primaryKey as le}from"drizzle-orm/mssql-core";import{mssqlSchema as ne}from"drizzle-orm/mssql-core";var t=ne("dbo");import{customType as k}from"drizzle-orm/mssql-core";var h=k({dataType(){return"uniqueidentifier"}}),ie=k({dataType(){return"nvarchar(max)"},toDriver(e){return e==null?null:typeof e=="string"?e:JSON.stringify(e)},fromDriver(e){return e==null||e===""?null:typeof e!="string"?e:JSON.parse(e)}}),n=e=>ie(e).$type();var We=t.table("td_file_chunk",{id:B("id",{mode:"number"}).identity().notNull(),tenantId:l("tenant_id",{length:64}).$type().notNull(),chunkUid:h("chunk_uid").notNull(),parentChunkUid:h("parent_chunk_uid").notNull(),metadataId:B("metadata_id",{mode:"number"}).notNull(),fileUri:l("file_uri",{length:2048}).$type().notNull(),revision:m("revision").notNull(),chunkIndex:m("chunk_index").notNull(),breadcrumbs:l("breadcrumbs",{length:2048}).notNull(),clauseIdentifier:l("clause_identifier",{length:128}),searchText:l("search_text",{length:"max"}).notNull(),citationText:l("citation_text",{length:"max"}).notNull(),chunkHash:l("chunk_hash",{length:64}).notNull(),tokenCount:m("token_count").notNull(),charStart:m("char_start").notNull(),charEnd:m("char_end").notNull(),pageNumber:m("page_number"),sheetName:l("sheet_name",{length:256}),slideIndex:m("slide_index"),startSec:F("start_sec"),endSec:F("end_sec"),isDeleted:re("is_deleted").notNull(),createdAt:C("created_at",{precision:7}).notNull(),createdBy:l("created_by",{length:100}).notNull(),updatedAt:C("updated_at",{precision:7}).notNull(),updatedBy:l("updated_by",{length:100}).notNull()},e=>[le({name:"PK_td_file_chunk",columns:[e.id]})]);import{bigint as A,datetime2 as K,int as D,nvarchar as p,primaryKey as oe}from"drizzle-orm/mssql-core";var nt=t.table("td_file_chunk_parent",{id:A("id",{mode:"number"}).identity().notNull(),tenantId:p("tenant_id",{length:64}).$type().notNull(),parentChunkUid:h("parent_chunk_uid").notNull(),metadataId:A("metadata_id",{mode:"number"}).notNull(),fileUri:p("file_uri",{length:2048}).$type().notNull(),revision:D("revision").notNull(),sectionTitle:p("section_title",{length:512}).notNull(),breadcrumbs:p("breadcrumbs",{length:2048}).notNull(),fullContent:p("full_content",{length:"max"}).notNull(),charLength:D("char_length").notNull(),createdAt:K("created_at",{precision:7}).notNull(),createdBy:p("created_by",{length:100}).notNull(),updatedAt:K("updated_at",{precision:7}).notNull(),updatedBy:p("updated_by",{length:100}).notNull()},e=>[oe({name:"PK_td_file_chunk_parent",columns:[e.id]})]);import{bigint as E,bit as ae,datetime2 as N,int as de,nvarchar as o,primaryKey as me}from"drizzle-orm/mssql-core";var at=t.table("td_file_enrichment",{id:E("id",{mode:"number"}).identity().notNull(),tenantId:o("tenant_id",{length:64}).$type().notNull(),metadataId:E("metadata_id",{mode:"number"}).notNull(),extractedText:o("extracted_text",{length:"max"}),extractedTextMime:o("extracted_text_mime",{length:255}),extractedPageOffsets:n("extracted_page_offsets"),isTruncated:ae("is_truncated").notNull(),aiSummary:o("ai_summary",{length:"max"}),structuredData:n("structured_data"),tags:n("tags"),syncStatus:o("sync_status",{length:20}).$type().notNull(),chunkCount:de("chunk_count"),lastError:o("last_error",{length:2e3}),vectorIndexedAt:N("vector_indexed_at",{precision:7}),graphIndexedAt:N("graph_indexed_at",{precision:7}),createdAt:N("created_at",{precision:7}).notNull(),createdBy:o("created_by",{length:100}).notNull(),updatedAt:N("updated_at",{precision:7}).notNull(),updatedBy:o("updated_by",{length:100}).notNull()},e=>[me({name:"PK_td_file_enrichment",columns:[e.id]})]);import{bigint as R,datetime2 as M,decimal as pe,nvarchar as T,primaryKey as ue}from"drizzle-orm/mssql-core";var ut=t.table("td_file_label_map",{tenantId:T("tenant_id",{length:64}).$type().notNull(),metadataId:R("metadata_id",{mode:"number"}).notNull(),labelId:R("label_id",{mode:"number"}).notNull(),assignedBy:T("assigned_by",{length:32}).notNull(),confidenceScore:pe("confidence_score",{precision:3,scale:2,mode:"number"}).notNull(),createdAt:M("created_at",{precision:7}).notNull(),createdBy:T("created_by",{length:100}).notNull(),updatedAt:M("updated_at",{precision:7}).notNull(),updatedBy:T("updated_by",{length:100}).notNull()},e=>[ue({name:"PK_td_file_label_map",columns:[e.tenantId,e.metadataId,e.labelId]})]);import{sql as ce}from"drizzle-orm";import{bigint as S,binary as se,bit as v,datetime2 as x,int as $,nvarchar as i,primaryKey as ye}from"drizzle-orm/mssql-core";var ht=t.table("td_file_metadata",{id:S("id",{mode:"number"}).identity().notNull(),tenantId:i("tenant_id",{length:64}).$type().notNull(),parentMetadataId:S("parent_metadata_id",{mode:"number"}),fileUri:i("file_uri",{length:2048}).$type().notNull(),fileUriHash:se("file_uri_hash",{length:32}).generatedAlwaysAs(ce`CONVERT(binary(32), HASHBYTES('SHA2_256', file_uri))`,{mode:"persisted"}),fileId:i("file_id",{length:255}),revision:$("revision").notNull(),revisionId:i("revision_id",{length:255}),isCurrent:v("is_current").notNull(),isDeleted:v("is_deleted").notNull(),isDerived:v("is_derived").notNull(),deletedAt:x("deleted_at",{precision:7}),deletedBy:i("deleted_by",{length:100}),fileName:i("file_name",{length:255}).notNull(),filePath:i("file_path",{length:4e3}).notNull(),folderPath:i("folder_path",{length:4e3}),confidentialityLevel:i("confidentiality_level",{length:20}).$type().notNull(),departmentId:$("department_id"),fileSize:S("file_size",{mode:"number"}).notNull(),mimeType:i("mime_type",{length:255}).notNull(),assetType:i("asset_type",{length:50}),assetIndex:$("asset_index"),boundingBox:n("bounding_box"),fileHash:i("file_hash",{length:64}),mtime:x("mtime",{precision:7}).notNull(),createdAt:x("created_at",{precision:7}).notNull(),createdBy:i("created_by",{length:100}).notNull(),updatedAt:x("updated_at",{precision:7}).notNull(),updatedBy:i("updated_by",{length:100}).notNull()},e=>[ye({name:"PK_td_file_metadata",columns:[e.id]})]);import{bigint as L,datetime2 as q,float as _e,int as P,nvarchar as f,primaryKey as ge}from"drizzle-orm/mssql-core";var xt=t.table("td_file_ocr_results",{id:L("id",{mode:"number"}).identity().notNull(),tenantId:f("tenant_id",{length:64}).$type().notNull(),metadataId:L("metadata_id",{mode:"number"}).notNull(),engineName:f("engine_name",{length:50}).notNull(),extractedText:f("extracted_text",{length:"max"}),boundingBoxes:n("bounding_boxes"),confidence:_e("confidence"),executionTimeMs:P("execution_time_ms").notNull(),pagesRead:P("pages_read"),pagesTotal:P("pages_total"),createdAt:q("created_at",{precision:7}).notNull(),createdBy:f("created_by",{length:100}).notNull(),updatedAt:q("updated_at",{precision:7}).notNull(),updatedBy:f("updated_by",{length:100}).notNull()},e=>[ge({name:"PK_td_file_ocr_results",columns:[e.id]})]);import{bigint as he,bit as J,datetime2 as U,nvarchar as u,primaryKey as fe}from"drizzle-orm/mssql-core";var $t=t.table("tm_confidentiality_capability_policy",{id:he("id",{mode:"number"}).identity().notNull(),tenantId:u("tenant_id",{length:64}).$type().notNull(),confidentialityLevel:u("confidentiality_level",{length:20}).notNull(),capability:u("capability",{length:32}).notNull(),isEnabled:J("is_enabled").notNull(),allowCloudProvider:J("allow_cloud_provider").notNull(),promptKey:u("prompt_key",{length:64}),description:u("description",{length:256}),updatedBy:u("updated_by",{length:100}).notNull(),updatedAt:U("updated_at",{precision:7}).notNull(),createdAt:U("created_at",{precision:7}).notNull(),createdBy:u("created_by",{length:100}).notNull()},e=>[fe({name:"PK_tm_confidentiality_capability_policy",columns:[e.id]})]);import{bigint as w,bit as be,datetime2 as V,int as O,nvarchar as I,primaryKey as Ne}from"drizzle-orm/mssql-core";var Ft=t.table("tm_enrichment_classification_rule",{id:w("id",{mode:"number"}).identity().notNull(),tenantId:I("tenant_id",{length:64}).$type().notNull(),strategyId:w("strategy_id",{mode:"number"}).notNull(),priority:O("priority").notNull(),ruleName:I("rule_name",{length:128}).notNull(),matchConditionsJson:n("match_conditions_json").notNull(),assignedDepartmentId:O("assigned_department_id"),isActive:be("is_active").notNull(),createdAt:V("created_at",{precision:7}).notNull(),updatedAt:V("updated_at",{precision:7}).notNull(),createdBy:I("created_by",{length:100}).notNull(),updatedBy:I("updated_by",{length:100}).notNull()},e=>[Ne({name:"PK_tm_enrichment_classification_rule",columns:[e.id]})]);import{bigint as Te,bit as xe,datetime2 as j,nvarchar as y,primaryKey as Ie}from"drizzle-orm/mssql-core";var Et=t.table("tm_enrichment_domain",{id:Te("id",{mode:"number"}).identity().notNull(),tenantId:y("tenant_id",{length:64}).$type().notNull(),domainKey:y("domain_key",{length:64}).$type().notNull(),displayName:y("display_name",{length:128}).notNull(),description:y("description",{length:512}),isActive:xe("is_active").notNull(),createdAt:j("created_at",{precision:7}).notNull(),updatedAt:j("updated_at",{precision:7}).notNull(),createdBy:y("created_by",{length:100}).notNull(),updatedBy:y("updated_by",{length:100}).notNull()},e=>[Ie({name:"PK_tm_enrichment_domain",columns:[e.id]})]);import{bigint as H,bit as _,datetime2 as G,int as Se,nvarchar as r,primaryKey as ve}from"drizzle-orm/mssql-core";var Jt=t.table("tm_enrichment_strategy",{id:H("id",{mode:"number"}).identity().notNull(),tenantId:r("tenant_id",{length:64}).$type().notNull(),domainId:H("domain_id",{mode:"number"}).notNull(),strategyName:r("strategy_name",{length:128}).notNull(),systemPrompt:r("system_prompt",{length:"max"}).notNull(),chunkingStrategy:r("chunking_strategy",{length:32}).$type().notNull(),modelProvider:r("model_provider",{length:32}).$type().notNull(),modelRoutingPolicy:r("model_routing_policy",{length:32}).notNull(),mcpToolsJson:n("mcp_tools_json"),modelName:r("model_name",{length:64}).notNull(),modelParametersJson:n("model_parameters_json").notNull(),enableSummaryGeneration:_("enable_summary_generation").notNull(),enableStructuredExtraction:_("enable_structured_extraction").notNull(),enableVectorIndexing:_("enable_vector_indexing").notNull(),enableGraphIndexing:_("enable_graph_indexing").notNull(),enableAssetExtraction:_("enable_asset_extraction").notNull(),targetVectorCollection:r("target_vector_collection",{length:128}).notNull(),vectorDimension:Se("vector_dimension").notNull(),vectorDistanceMetric:r("vector_distance_metric",{length:16}).$type().notNull(),vectorIndexingLogic:r("vector_indexing_logic",{length:50}).notNull(),targetGraphDatabase:r("target_graph_database",{length:64}).notNull(),targetGraphDomainLabel:r("target_graph_domain_label",{length:64}),searchFederationDomainsJson:n("search_federation_domains_json"),isActive:_("is_active").notNull(),createdAt:G("created_at",{precision:7}).notNull(),updatedAt:G("updated_at",{precision:7}).notNull(),createdBy:r("created_by",{length:100}).notNull(),updatedBy:r("updated_by",{length:100}).notNull()},e=>[ve({name:"PK_tm_enrichment_strategy",columns:[e.id]})]);import{bigint as $e,bit as z,datetime2 as Y,nvarchar as c,primaryKey as Pe}from"drizzle-orm/mssql-core";var Ot=t.table("tm_label_definition",{id:$e("id",{mode:"number"}).identity().notNull(),tenantId:c("tenant_id",{length:64}).$type().notNull(),labelKey:c("label_key",{length:64}).notNull(),labelCategory:c("label_category",{length:32}).notNull(),displayName:c("display_name",{length:128}).notNull(),colorCode:c("color_code",{length:16}),isInheritable:z("is_inheritable").notNull(),isActive:z("is_active").notNull(),createdAt:Y("created_at",{precision:7}).notNull(),updatedAt:Y("updated_at",{precision:7}).notNull(),createdBy:c("created_by",{length:100}).notNull(),updatedBy:c("updated_by",{length:100}).notNull()},e=>[Pe({name:"PK_tm_label_definition",columns:[e.id]})]);import{bigint as ke,bit as Be,datetime2 as Q,int as Ce,nvarchar as a,primaryKey as Fe}from"drizzle-orm/mssql-core";var Yt=t.table("tm_prompt_template",{id:ke("id",{mode:"number"}).identity().notNull(),tenantId:a("tenant_id",{length:64}).$type().notNull(),promptKey:a("prompt_key",{length:64}).notNull(),promptVersion:Ce("prompt_version").notNull(),systemPrompt:a("system_prompt",{length:"max"}).notNull(),userPromptTemplate:a("user_prompt_template",{length:"max"}),inputVariablesJson:n("input_variables_json"),modelProvider:a("model_provider",{length:32}).$type().notNull(),modelName:a("model_name",{length:64}).notNull(),modelParametersJson:n("model_parameters_json").notNull(),isActive:Be("is_active").notNull(),updatedBy:a("updated_by",{length:100}).notNull(),updatedAt:Q("updated_at",{precision:7}).notNull(),createdAt:Q("created_at",{precision:7}).notNull(),createdBy:a("created_by",{length:100}).notNull()},e=>[Fe({name:"PK_tm_prompt_template",columns:[e.id]})]);import{bigint as Ae,bit as W,datetime2 as X,nvarchar as b,primaryKey as Ke}from"drizzle-orm/mssql-core";var Zt=t.table("tm_system_feature_flag",{id:Ae("id",{mode:"number"}).identity().notNull(),tenantId:b("tenant_id",{length:64}).$type().notNull(),featureKey:b("feature_key",{length:64}).notNull(),isEnabled:W("is_enabled").notNull(),description:b("description",{length:256}),circuitBreakerEnabled:W("circuit_breaker_enabled").notNull(),updatedBy:b("updated_by",{length:100}).notNull(),updatedAt:X("updated_at",{precision:7}).notNull(),createdAt:X("created_at",{precision:7}).notNull(),createdBy:b("created_by",{length:100}).notNull()},e=>[Ke({name:"PK_tm_system_feature_flag",columns:[e.id]})]);import{bigint as De,bit as Ee,datetime2 as Z,nvarchar as d,primaryKey as Re}from"drizzle-orm/mssql-core";var rn=t.table("tm_system_parameter",{id:De("id",{mode:"number"}).identity().notNull(),tenantId:d("tenant_id",{length:64}).$type().notNull(),paramCategory:d("param_category",{length:32}).notNull(),paramKey:d("param_key",{length:64}).notNull(),paramValue:d("param_value",{length:"max"}).notNull(),dataType:d("data_type",{length:16}).notNull(),description:d("description",{length:256}),isEncrypted:Ee("is_encrypted").notNull(),updatedBy:d("updated_by",{length:100}).notNull(),updatedAt:Z("updated_at",{precision:7}).notNull(),createdAt:Z("created_at",{precision:7}).notNull(),createdBy:d("created_by",{length:100}).notNull()},e=>[Re({name:"PK_tm_system_parameter",columns:[e.id]})]);import{bigint as Me,bit as Le,datetime2 as ee,nvarchar as g,primaryKey as qe}from"drizzle-orm/mssql-core";var dn=t.table("tm_transcription_reference",{id:Me("id",{mode:"number"}).identity().notNull(),tenantId:g("tenant_id",{length:64}).$type().notNull(),domainKey:g("domain_key",{length:64}),fileUri:g("file_uri",{length:2048}).notNull(),isActive:Le("is_active").notNull(),description:g("description",{length:400}),updatedBy:g("updated_by",{length:100}).notNull(),updatedAt:ee("updated_at",{precision:7}).notNull(),createdAt:ee("created_at",{precision:7}).notNull(),createdBy:g("created_by",{length:100}).notNull()},e=>[qe({name:"PK_tm_transcription_reference",columns:[e.id]})]);import{bigint as Je,bit as Ue,datetime2 as te,float as we,nvarchar as s,primaryKey as Ve}from"drizzle-orm/mssql-core";var cn=t.table("tm_transcription_vocabulary",{id:Je("id",{mode:"number"}).identity().notNull(),tenantId:s("tenant_id",{length:64}).$type().notNull(),domainKey:s("domain_key",{length:64}),term:s("term",{length:200}).notNull(),reading:s("reading",{length:200}),boost:we("boost"),isActive:Ue("is_active").notNull(),description:s("description",{length:400}),updatedBy:s("updated_by",{length:100}).notNull(),updatedAt:te("updated_at",{precision:7}).notNull(),createdAt:te("created_at",{precision:7}).notNull(),createdBy:s("created_by",{length:100}).notNull()},e=>[Ve({name:"PK_tm_transcription_vocabulary",columns:[e.id]})]);export{We as TdFileChunk,nt as TdFileChunkParent,at as TdFileEnrichment,ut as TdFileLabelMap,ht as TdFileMetadata,xt as TdFileOcrResults,$t as TmConfidentialityCapabilityPolicy,Ft as TmEnrichmentClassificationRule,Et as TmEnrichmentDomain,Jt as TmEnrichmentStrategy,Ot as TmLabelDefinition,Yt as TmPromptTemplate,Zt as TmSystemFeatureFlag,rn as TmSystemParameter,dn as TmTranscriptionReference,cn as TmTranscriptionVocabulary,t as dbo,n as mssqlJson,h as uniqueidentifier};
package/package.json ADDED
@@ -0,0 +1,82 @@
1
+ {
2
+ "name": "@aiquants/enrichment-drizzle",
3
+ "version": "0.1.1",
4
+ "description": "Drizzle ORM (mssql) models and types for storage metadata AI enrichment, chunks, and system configurations.",
5
+ "keywords": [
6
+ "drizzle",
7
+ "mssql",
8
+ "enrichment",
9
+ "metadata",
10
+ "rag",
11
+ "chunk",
12
+ "typescript"
13
+ ],
14
+ "license": "MIT",
15
+ "author": "AI Quants",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/fehde-k/aiquants.git",
19
+ "directory": "packages/enrichment-drizzle"
20
+ },
21
+ "homepage": "https://github.com/fehde-k/aiquants/tree/main/packages/enrichment-drizzle#readme",
22
+ "bugs": {
23
+ "url": "https://github.com/fehde-k/aiquants/issues"
24
+ },
25
+ "sideEffects": false,
26
+ "type": "module",
27
+ "main": "./dist/index.cjs",
28
+ "module": "./dist/index.js",
29
+ "types": "./dist/index.d.ts",
30
+ "exports": {
31
+ ".": {
32
+ "import": {
33
+ "types": "./dist/index.d.ts",
34
+ "default": "./dist/index.js"
35
+ },
36
+ "require": {
37
+ "types": "./dist/index.d.cts",
38
+ "default": "./dist/index.cjs"
39
+ }
40
+ }
41
+ },
42
+ "files": [
43
+ "dist",
44
+ "README.md",
45
+ "LICENSE"
46
+ ],
47
+ "devDependencies": {
48
+ "@aiquants/enrichment-core": "0.1.1",
49
+ "@vitest/coverage-v8": "^4.1.8",
50
+ "drizzle-orm": "1.0.0-rc.4",
51
+ "rimraf": "^6.1.2",
52
+ "tsup": "^8.5.1",
53
+ "typescript": "^5.9.3",
54
+ "vitest": "^4.1.8"
55
+ },
56
+ "peerDependencies": {
57
+ "@aiquants/enrichment-core": "^0.1.1",
58
+ "drizzle-orm": ">=1.0.0-beta.4 <2.0.0"
59
+ },
60
+ "engines": {
61
+ "node": ">=18.0.0",
62
+ "pnpm": ">=8.0.0"
63
+ },
64
+ "publishConfig": {
65
+ "access": "public"
66
+ },
67
+ "scripts": {
68
+ "build": "tsup && node ../../.config/scripts/strip-dts-comments.mjs dist",
69
+ "build:watch": "tsup --watch",
70
+ "dev": "tsup --watch",
71
+ "publish:patch": "pnpm run typecheck && pnpm run --if-present test && pnpm version patch --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks",
72
+ "publish:minor": "pnpm run typecheck && pnpm run --if-present test && pnpm version minor --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks",
73
+ "publish:major": "pnpm run typecheck && pnpm run --if-present test && pnpm version major --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks",
74
+ "typecheck": "tsc --noEmit",
75
+ "clean": "rimraf dist",
76
+ "lint": "biome lint src/",
77
+ "check": "biome check src/ tests/",
78
+ "check:fix": "biome check --write src/ tests/",
79
+ "test": "vitest run",
80
+ "test:coverage": "vitest run --coverage"
81
+ }
82
+ }