node-type-registry 0.24.0 → 0.26.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/authz/authz-file-path.d.ts +2 -0
- package/authz/authz-file-path.js +58 -0
- package/authz/index.d.ts +1 -0
- package/authz/index.js +3 -1
- package/data/data-file-embedding.d.ts +2 -0
- package/data/data-file-embedding.js +186 -0
- package/data/data-image-embedding.d.ts +12 -0
- package/data/data-image-embedding.js +109 -22
- package/data/index.d.ts +1 -0
- package/data/index.js +3 -1
- package/esm/authz/authz-file-path.d.ts +2 -0
- package/esm/authz/authz-file-path.js +55 -0
- package/esm/authz/index.d.ts +1 -0
- package/esm/authz/index.js +1 -0
- package/esm/data/data-file-embedding.d.ts +2 -0
- package/esm/data/data-file-embedding.js +183 -0
- package/esm/data/data-image-embedding.d.ts +12 -0
- package/esm/data/data-image-embedding.js +109 -22
- package/esm/data/index.d.ts +1 -0
- package/esm/data/index.js +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthzFilePath = void 0;
|
|
4
|
+
exports.AuthzFilePath = {
|
|
5
|
+
name: 'AuthzFilePath',
|
|
6
|
+
slug: 'authz_file_path',
|
|
7
|
+
category: 'authz',
|
|
8
|
+
display_name: 'File Path Share',
|
|
9
|
+
description: 'Path-scoped file sharing via ltree containment. Grants access when a path_shares row matches the current user, bucket, and an ancestor path with the required permission.',
|
|
10
|
+
parameter_schema: {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
shares_schema: {
|
|
14
|
+
type: 'string',
|
|
15
|
+
description: 'Schema of the path_shares table'
|
|
16
|
+
},
|
|
17
|
+
shares_table: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
description: 'Name of the path_shares table'
|
|
20
|
+
},
|
|
21
|
+
files_schema: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
description: 'Schema of the files table (used to qualify column references inside the EXISTS subquery)'
|
|
24
|
+
},
|
|
25
|
+
files_table: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
description: 'Name of the files table (used to qualify column references inside the EXISTS subquery)'
|
|
28
|
+
},
|
|
29
|
+
permission_field: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
format: 'column-ref',
|
|
32
|
+
description: 'Boolean column on the path_shares table that grants the required permission (e.g. can_read, can_write)'
|
|
33
|
+
},
|
|
34
|
+
bucket_field: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
format: 'column-ref',
|
|
37
|
+
description: 'Column on the files table referencing the bucket',
|
|
38
|
+
default: 'bucket_id'
|
|
39
|
+
},
|
|
40
|
+
path_field: {
|
|
41
|
+
type: 'string',
|
|
42
|
+
format: 'column-ref',
|
|
43
|
+
description: 'Ltree column on the files table representing the file path',
|
|
44
|
+
default: 'path'
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
required: [
|
|
48
|
+
'shares_schema',
|
|
49
|
+
'shares_table',
|
|
50
|
+
'files_table',
|
|
51
|
+
'permission_field'
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
tags: [
|
|
55
|
+
'storage',
|
|
56
|
+
'authz'
|
|
57
|
+
]
|
|
58
|
+
};
|
package/authz/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { AuthzAllowAll } from './authz-allow-all';
|
|
|
2
2
|
export { AuthzAppMembership } from './authz-app-membership';
|
|
3
3
|
export { AuthzComposite } from './authz-composite';
|
|
4
4
|
export { AuthzDenyAll } from './authz-deny-all';
|
|
5
|
+
export { AuthzFilePath } from './authz-file-path';
|
|
5
6
|
export { AuthzDirectOwner } from './authz-direct-owner';
|
|
6
7
|
export { AuthzDirectOwnerAny } from './authz-direct-owner-any';
|
|
7
8
|
export { AuthzEntityMembership } from './authz-entity-membership';
|
package/authz/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AuthzTemporal = exports.AuthzRelatedPeerOwnership = exports.AuthzRelatedMemberList = exports.AuthzRelatedEntityMembership = exports.AuthzPublishable = exports.AuthzPeerOwnership = exports.AuthzOrgHierarchy = exports.AuthzNotReadOnly = exports.AuthzMemberList = exports.AuthzEntityMembership = exports.AuthzDirectOwnerAny = exports.AuthzDirectOwner = exports.AuthzDenyAll = exports.AuthzComposite = exports.AuthzAppMembership = exports.AuthzAllowAll = void 0;
|
|
3
|
+
exports.AuthzTemporal = exports.AuthzRelatedPeerOwnership = exports.AuthzRelatedMemberList = exports.AuthzRelatedEntityMembership = exports.AuthzPublishable = exports.AuthzPeerOwnership = exports.AuthzOrgHierarchy = exports.AuthzNotReadOnly = exports.AuthzMemberList = exports.AuthzEntityMembership = exports.AuthzDirectOwnerAny = exports.AuthzDirectOwner = exports.AuthzFilePath = exports.AuthzDenyAll = exports.AuthzComposite = exports.AuthzAppMembership = exports.AuthzAllowAll = void 0;
|
|
4
4
|
var authz_allow_all_1 = require("./authz-allow-all");
|
|
5
5
|
Object.defineProperty(exports, "AuthzAllowAll", { enumerable: true, get: function () { return authz_allow_all_1.AuthzAllowAll; } });
|
|
6
6
|
var authz_app_membership_1 = require("./authz-app-membership");
|
|
@@ -9,6 +9,8 @@ var authz_composite_1 = require("./authz-composite");
|
|
|
9
9
|
Object.defineProperty(exports, "AuthzComposite", { enumerable: true, get: function () { return authz_composite_1.AuthzComposite; } });
|
|
10
10
|
var authz_deny_all_1 = require("./authz-deny-all");
|
|
11
11
|
Object.defineProperty(exports, "AuthzDenyAll", { enumerable: true, get: function () { return authz_deny_all_1.AuthzDenyAll; } });
|
|
12
|
+
var authz_file_path_1 = require("./authz-file-path");
|
|
13
|
+
Object.defineProperty(exports, "AuthzFilePath", { enumerable: true, get: function () { return authz_file_path_1.AuthzFilePath; } });
|
|
12
14
|
var authz_direct_owner_1 = require("./authz-direct-owner");
|
|
13
15
|
Object.defineProperty(exports, "AuthzDirectOwner", { enumerable: true, get: function () { return authz_direct_owner_1.AuthzDirectOwner; } });
|
|
14
16
|
var authz_direct_owner_any_1 = require("./authz-direct-owner-any");
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataFileEmbedding = void 0;
|
|
4
|
+
exports.DataFileEmbedding = {
|
|
5
|
+
name: 'DataFileEmbedding',
|
|
6
|
+
slug: 'data_file_embedding',
|
|
7
|
+
category: 'data',
|
|
8
|
+
display_name: 'File Embedding',
|
|
9
|
+
description: 'Generic, MIME-scoped embedding node for file tables. Supports two modes: ' +
|
|
10
|
+
'direct (whole-file to single vector, e.g. CLIP for images) when extraction ' +
|
|
11
|
+
'is omitted, or extract (file to text to chunks to per-chunk vectors) when ' +
|
|
12
|
+
'extraction config is provided. Composes SearchVector + DataJobTrigger ' +
|
|
13
|
+
'internally. Multiple instances can coexist on the same table with different ' +
|
|
14
|
+
'MIME scopes, field names, and embedding strategies.',
|
|
15
|
+
parameter_schema: {
|
|
16
|
+
type: 'object',
|
|
17
|
+
properties: {
|
|
18
|
+
// ── Vector config (passed through to SearchVector) ─────────────
|
|
19
|
+
field_name: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
format: 'column-ref',
|
|
22
|
+
description: 'Name of the vector embedding column',
|
|
23
|
+
default: 'embedding'
|
|
24
|
+
},
|
|
25
|
+
dimensions: {
|
|
26
|
+
type: 'integer',
|
|
27
|
+
description: 'Vector dimensions (e.g. 512 for CLIP, 768 for nomic, 1536 for ada-002)',
|
|
28
|
+
default: 768
|
|
29
|
+
},
|
|
30
|
+
index_method: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
enum: ['hnsw', 'ivfflat'],
|
|
33
|
+
description: 'Index type for similarity search',
|
|
34
|
+
default: 'hnsw'
|
|
35
|
+
},
|
|
36
|
+
metric: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
enum: ['cosine', 'l2', 'ip'],
|
|
39
|
+
description: 'Distance metric',
|
|
40
|
+
default: 'cosine'
|
|
41
|
+
},
|
|
42
|
+
index_options: {
|
|
43
|
+
type: 'object',
|
|
44
|
+
description: 'Index-specific options. HNSW: {m, ef_construction}. IVFFlat: {lists}.',
|
|
45
|
+
default: {}
|
|
46
|
+
},
|
|
47
|
+
// ── MIME scoping ───────────────────────────────────────────────
|
|
48
|
+
mime_patterns: {
|
|
49
|
+
type: 'array',
|
|
50
|
+
items: { type: 'string' },
|
|
51
|
+
description: 'MIME type LIKE patterns to match. Multiple patterns are OR\'d together. ' +
|
|
52
|
+
'Examples: [\'image/%\'], [\'application/pdf\', \'text/%\'], [\'audio/%\'].',
|
|
53
|
+
default: ['image/%']
|
|
54
|
+
},
|
|
55
|
+
// ── Job routing ────────────────────────────────────────────────
|
|
56
|
+
task_identifier: {
|
|
57
|
+
type: 'string',
|
|
58
|
+
description: 'Job task identifier for the worker. In direct mode this is the ' +
|
|
59
|
+
'embedding worker; in extract mode this is the extraction worker.',
|
|
60
|
+
default: 'process_file_embedding'
|
|
61
|
+
},
|
|
62
|
+
events: {
|
|
63
|
+
type: 'array',
|
|
64
|
+
items: { type: 'string', enum: ['INSERT', 'UPDATE'] },
|
|
65
|
+
description: 'Trigger events that fire the job',
|
|
66
|
+
default: ['INSERT']
|
|
67
|
+
},
|
|
68
|
+
payload_custom: {
|
|
69
|
+
type: 'object',
|
|
70
|
+
additionalProperties: { type: 'string', format: 'column-ref' },
|
|
71
|
+
description: 'Custom payload key-to-column mapping for the job trigger',
|
|
72
|
+
default: {
|
|
73
|
+
file_id: 'id',
|
|
74
|
+
key: 'key',
|
|
75
|
+
mime_type: 'mime_type',
|
|
76
|
+
bucket_id: 'bucket_id'
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
trigger_conditions: {
|
|
80
|
+
description: 'Additional compound conditions beyond MIME filtering. ' +
|
|
81
|
+
'Merged with the auto-generated MIME conditions via AND. ' +
|
|
82
|
+
'Use this to add status checks, field guards, etc.',
|
|
83
|
+
'x-codegen-type': 'TriggerCondition | TriggerCondition[]',
|
|
84
|
+
oneOf: [
|
|
85
|
+
{ $ref: '#/$defs/triggerCondition' },
|
|
86
|
+
{ type: 'array', items: { $ref: '#/$defs/triggerCondition' } }
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
// ── Extraction config (optional — enables extract mode) ────────
|
|
90
|
+
extraction: {
|
|
91
|
+
type: 'object',
|
|
92
|
+
description: 'Text extraction configuration. When present, the generator creates ' +
|
|
93
|
+
'extraction output fields on the table and configures SearchVector with ' +
|
|
94
|
+
'source_fields + stale tracking. When absent, the node operates in direct ' +
|
|
95
|
+
'mode (single vector per file, no text extraction).',
|
|
96
|
+
properties: {
|
|
97
|
+
text_field: {
|
|
98
|
+
type: 'string',
|
|
99
|
+
format: 'column-ref',
|
|
100
|
+
description: 'Field to store extracted text/markdown',
|
|
101
|
+
default: 'extracted_text'
|
|
102
|
+
},
|
|
103
|
+
metadata_field: {
|
|
104
|
+
type: 'string',
|
|
105
|
+
format: 'column-ref',
|
|
106
|
+
description: 'JSONB field for extraction metadata (page count, language, etc.)',
|
|
107
|
+
default: 'extracted_metadata'
|
|
108
|
+
},
|
|
109
|
+
status_field: {
|
|
110
|
+
type: 'string',
|
|
111
|
+
format: 'column-ref',
|
|
112
|
+
description: 'Extraction lifecycle status field',
|
|
113
|
+
default: 'extraction_status'
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
// ── Chunking config (optional — creates embedding_chunks) ──────
|
|
118
|
+
chunks: {
|
|
119
|
+
type: 'object',
|
|
120
|
+
description: 'Chunking configuration. Creates an embedding_chunks record that drives ' +
|
|
121
|
+
'automatic text splitting and per-chunk embedding. Only meaningful when ' +
|
|
122
|
+
'extraction is also provided.',
|
|
123
|
+
properties: {
|
|
124
|
+
content_field_name: {
|
|
125
|
+
type: 'string',
|
|
126
|
+
format: 'column-ref',
|
|
127
|
+
description: 'Name of the text content column in the chunks table',
|
|
128
|
+
default: 'content'
|
|
129
|
+
},
|
|
130
|
+
chunk_size: {
|
|
131
|
+
type: 'integer',
|
|
132
|
+
description: 'Maximum number of characters per chunk',
|
|
133
|
+
default: 1000
|
|
134
|
+
},
|
|
135
|
+
chunk_overlap: {
|
|
136
|
+
type: 'integer',
|
|
137
|
+
description: 'Number of overlapping characters between consecutive chunks',
|
|
138
|
+
default: 200
|
|
139
|
+
},
|
|
140
|
+
chunk_strategy: {
|
|
141
|
+
type: 'string',
|
|
142
|
+
enum: ['fixed', 'sentence', 'paragraph', 'semantic'],
|
|
143
|
+
description: 'Strategy for splitting text into chunks',
|
|
144
|
+
default: 'paragraph'
|
|
145
|
+
},
|
|
146
|
+
metadata_fields: {
|
|
147
|
+
type: 'object',
|
|
148
|
+
description: 'Metadata fields from parent to copy into chunks'
|
|
149
|
+
},
|
|
150
|
+
enqueue_chunking_job: {
|
|
151
|
+
type: 'boolean',
|
|
152
|
+
description: 'Whether to auto-enqueue a chunking job on insert/update',
|
|
153
|
+
default: true
|
|
154
|
+
},
|
|
155
|
+
chunking_task_name: {
|
|
156
|
+
type: 'string',
|
|
157
|
+
description: 'Task identifier for the chunking job queue',
|
|
158
|
+
default: 'generate_chunks'
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
// ── Stale tracking (meaningful in extract mode) ────────────────
|
|
163
|
+
stale_strategy: {
|
|
164
|
+
type: 'string',
|
|
165
|
+
enum: ['column', 'null', 'hash'],
|
|
166
|
+
description: 'Strategy for tracking embedding staleness when extraction is enabled. ' +
|
|
167
|
+
'column: embedding_stale boolean. null: set embedding to NULL. hash: md5 hash.',
|
|
168
|
+
default: 'column'
|
|
169
|
+
},
|
|
170
|
+
include_stale_field: {
|
|
171
|
+
type: 'boolean',
|
|
172
|
+
description: 'Whether to include the embedding_stale boolean field (extract mode)',
|
|
173
|
+
default: true
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
tags: [
|
|
178
|
+
'embedding',
|
|
179
|
+
'vector',
|
|
180
|
+
'ai',
|
|
181
|
+
'composition',
|
|
182
|
+
'jobs',
|
|
183
|
+
'multimodal',
|
|
184
|
+
'files'
|
|
185
|
+
]
|
|
186
|
+
};
|
|
@@ -1,2 +1,14 @@
|
|
|
1
1
|
import type { NodeTypeDefinition } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Image-specific preset of DataFileEmbedding.
|
|
4
|
+
*
|
|
5
|
+
* At the SQL layer, data_image_embedding delegates entirely to
|
|
6
|
+
* data_file_embedding, merging image-specific defaults before forwarding.
|
|
7
|
+
* The parameter schema here is intentionally identical to DataFileEmbedding;
|
|
8
|
+
* only the defaults differ (dimensions: 512, task: process_image_embedding,
|
|
9
|
+
* mime_patterns: ['image/%']).
|
|
10
|
+
*
|
|
11
|
+
* Kept as a separate node type for backward compatibility — existing
|
|
12
|
+
* blueprints that reference DataImageEmbedding continue to work unchanged.
|
|
13
|
+
*/
|
|
2
14
|
export declare const DataImageEmbedding: NodeTypeDefinition;
|
|
@@ -1,15 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DataImageEmbedding = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Image-specific preset of DataFileEmbedding.
|
|
6
|
+
*
|
|
7
|
+
* At the SQL layer, data_image_embedding delegates entirely to
|
|
8
|
+
* data_file_embedding, merging image-specific defaults before forwarding.
|
|
9
|
+
* The parameter schema here is intentionally identical to DataFileEmbedding;
|
|
10
|
+
* only the defaults differ (dimensions: 512, task: process_image_embedding,
|
|
11
|
+
* mime_patterns: ['image/%']).
|
|
12
|
+
*
|
|
13
|
+
* Kept as a separate node type for backward compatibility — existing
|
|
14
|
+
* blueprints that reference DataImageEmbedding continue to work unchanged.
|
|
15
|
+
*/
|
|
4
16
|
exports.DataImageEmbedding = {
|
|
5
17
|
name: 'DataImageEmbedding',
|
|
6
18
|
slug: 'data_image_embedding',
|
|
7
19
|
category: 'data',
|
|
8
20
|
display_name: 'Image Embedding',
|
|
9
|
-
description: '
|
|
21
|
+
description: 'Image-specific preset of DataFileEmbedding. Delegates to DataFileEmbedding ' +
|
|
22
|
+
'with image-oriented defaults: dimensions=512 (CLIP), mime_patterns=[\'image/%\'], ' +
|
|
23
|
+
'task_identifier=\'process_image_embedding\', direct mode (no extraction). ' +
|
|
24
|
+
'Accepts all DataFileEmbedding parameters — any overrides are forwarded through.',
|
|
10
25
|
parameter_schema: {
|
|
11
26
|
type: 'object',
|
|
12
27
|
properties: {
|
|
28
|
+
// ── Vector config (passed through to DataFileEmbedding) ──────────
|
|
13
29
|
field_name: {
|
|
14
30
|
type: 'string',
|
|
15
31
|
format: 'column-ref',
|
|
@@ -18,47 +34,48 @@ exports.DataImageEmbedding = {
|
|
|
18
34
|
},
|
|
19
35
|
dimensions: {
|
|
20
36
|
type: 'integer',
|
|
21
|
-
description: 'Vector dimensions',
|
|
37
|
+
description: 'Vector dimensions (default 512 for CLIP-style image embeddings)',
|
|
22
38
|
default: 512
|
|
23
39
|
},
|
|
24
40
|
index_method: {
|
|
25
41
|
type: 'string',
|
|
26
|
-
enum: [
|
|
27
|
-
'hnsw',
|
|
28
|
-
'ivfflat'
|
|
29
|
-
],
|
|
42
|
+
enum: ['hnsw', 'ivfflat'],
|
|
30
43
|
description: 'Index type for similarity search',
|
|
31
44
|
default: 'hnsw'
|
|
32
45
|
},
|
|
33
46
|
metric: {
|
|
34
47
|
type: 'string',
|
|
35
|
-
enum: [
|
|
36
|
-
'cosine',
|
|
37
|
-
'l2',
|
|
38
|
-
'ip'
|
|
39
|
-
],
|
|
48
|
+
enum: ['cosine', 'l2', 'ip'],
|
|
40
49
|
description: 'Distance metric',
|
|
41
50
|
default: 'cosine'
|
|
42
51
|
},
|
|
52
|
+
index_options: {
|
|
53
|
+
type: 'object',
|
|
54
|
+
description: 'Index-specific options. HNSW: {m, ef_construction}. IVFFlat: {lists}.',
|
|
55
|
+
default: {}
|
|
56
|
+
},
|
|
57
|
+
// ── MIME scoping ───────────────────────────────────────────────
|
|
58
|
+
mime_patterns: {
|
|
59
|
+
type: 'array',
|
|
60
|
+
items: { type: 'string' },
|
|
61
|
+
description: 'MIME type LIKE patterns to match. Multiple patterns are OR\'d together.',
|
|
62
|
+
default: ['image/%']
|
|
63
|
+
},
|
|
64
|
+
// ── Job routing ────────────────────────────────────────────────
|
|
43
65
|
task_identifier: {
|
|
44
66
|
type: 'string',
|
|
45
|
-
description: 'Job task identifier for the embedding worker',
|
|
67
|
+
description: 'Job task identifier for the image embedding worker',
|
|
46
68
|
default: 'process_image_embedding'
|
|
47
69
|
},
|
|
48
|
-
|
|
70
|
+
events: {
|
|
49
71
|
type: 'array',
|
|
50
|
-
items: {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
description: 'MIME type LIKE patterns to match (e.g., image/%, video/%). Multiple patterns are OR\'d together.',
|
|
54
|
-
default: ['image/%']
|
|
72
|
+
items: { type: 'string', enum: ['INSERT', 'UPDATE'] },
|
|
73
|
+
description: 'Trigger events that fire the job',
|
|
74
|
+
default: ['INSERT']
|
|
55
75
|
},
|
|
56
76
|
payload_custom: {
|
|
57
77
|
type: 'object',
|
|
58
|
-
additionalProperties: {
|
|
59
|
-
type: 'string',
|
|
60
|
-
format: 'column-ref'
|
|
61
|
-
},
|
|
78
|
+
additionalProperties: { type: 'string', format: 'column-ref' },
|
|
62
79
|
description: 'Custom payload key-to-column mapping for the job trigger',
|
|
63
80
|
default: {
|
|
64
81
|
file_id: 'id',
|
|
@@ -66,6 +83,76 @@ exports.DataImageEmbedding = {
|
|
|
66
83
|
mime_type: 'mime_type',
|
|
67
84
|
bucket_id: 'bucket_id'
|
|
68
85
|
}
|
|
86
|
+
},
|
|
87
|
+
trigger_conditions: {
|
|
88
|
+
description: 'Additional compound conditions beyond MIME filtering. ' +
|
|
89
|
+
'Merged with the auto-generated MIME conditions via AND.',
|
|
90
|
+
'x-codegen-type': 'TriggerCondition | TriggerCondition[]',
|
|
91
|
+
oneOf: [
|
|
92
|
+
{ $ref: '#/$defs/triggerCondition' },
|
|
93
|
+
{ type: 'array', items: { $ref: '#/$defs/triggerCondition' } }
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
// ── Extraction config (optional — enables extract mode) ────────
|
|
97
|
+
extraction: {
|
|
98
|
+
type: 'object',
|
|
99
|
+
description: 'Text extraction configuration. Forwarded to DataFileEmbedding. ' +
|
|
100
|
+
'When present, enables extract mode (e.g., OCR for images).',
|
|
101
|
+
properties: {
|
|
102
|
+
text_field: {
|
|
103
|
+
type: 'string',
|
|
104
|
+
format: 'column-ref',
|
|
105
|
+
description: 'Field to store extracted text',
|
|
106
|
+
default: 'extracted_text'
|
|
107
|
+
},
|
|
108
|
+
metadata_field: {
|
|
109
|
+
type: 'string',
|
|
110
|
+
format: 'column-ref',
|
|
111
|
+
description: 'JSONB field for extraction metadata',
|
|
112
|
+
default: 'extracted_metadata'
|
|
113
|
+
},
|
|
114
|
+
status_field: {
|
|
115
|
+
type: 'string',
|
|
116
|
+
format: 'column-ref',
|
|
117
|
+
description: 'Extraction lifecycle status field',
|
|
118
|
+
default: 'extraction_status'
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
// ── Chunking config (optional — forwarded to DataFileEmbedding) ─
|
|
123
|
+
chunks: {
|
|
124
|
+
type: 'object',
|
|
125
|
+
description: 'Chunking configuration. Forwarded to DataFileEmbedding. ' +
|
|
126
|
+
'Only meaningful when extraction is also provided.',
|
|
127
|
+
properties: {
|
|
128
|
+
content_field_name: {
|
|
129
|
+
type: 'string',
|
|
130
|
+
format: 'column-ref',
|
|
131
|
+
default: 'content'
|
|
132
|
+
},
|
|
133
|
+
chunk_size: { type: 'integer', default: 1000 },
|
|
134
|
+
chunk_overlap: { type: 'integer', default: 200 },
|
|
135
|
+
chunk_strategy: {
|
|
136
|
+
type: 'string',
|
|
137
|
+
enum: ['fixed', 'sentence', 'paragraph', 'semantic'],
|
|
138
|
+
default: 'paragraph'
|
|
139
|
+
},
|
|
140
|
+
metadata_fields: { type: 'object' },
|
|
141
|
+
enqueue_chunking_job: { type: 'boolean', default: true },
|
|
142
|
+
chunking_task_name: { type: 'string', default: 'generate_chunks' }
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
// ── Stale tracking (forwarded to DataFileEmbedding) ────────────
|
|
146
|
+
stale_strategy: {
|
|
147
|
+
type: 'string',
|
|
148
|
+
enum: ['column', 'null', 'hash'],
|
|
149
|
+
description: 'Strategy for tracking embedding staleness in extract mode',
|
|
150
|
+
default: 'column'
|
|
151
|
+
},
|
|
152
|
+
include_stale_field: {
|
|
153
|
+
type: 'boolean',
|
|
154
|
+
description: 'Whether to include the embedding_stale boolean field',
|
|
155
|
+
default: true
|
|
69
156
|
}
|
|
70
157
|
}
|
|
71
158
|
},
|
package/data/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { DataCompositeField } from './data-composite-field';
|
|
2
2
|
export { DataDirectOwner } from './data-direct-owner';
|
|
3
3
|
export { DataEntityMembership } from './data-entity-membership';
|
|
4
|
+
export { DataFileEmbedding } from './data-file-embedding';
|
|
4
5
|
export { DataFeatureFlag } from './data-feature-flag';
|
|
5
6
|
export { DataForceCurrentUser } from './data-force-current-user';
|
|
6
7
|
export { DataId } from './data-id';
|
package/data/index.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TableUserSettings = exports.TableUserProfiles = exports.TableOrganizationSettings = exports.SearchVector = exports.SearchUnified = exports.SearchTrgm = exports.SearchSpatialAggregate = exports.SearchSpatial = exports.SearchFullText = exports.SearchBm25 = exports.DataTimestamps = exports.DataTags = exports.DataStatusField = exports.DataSoftDelete = exports.DataSlug = exports.DataPublishable = exports.DataPeoplestamps = exports.DataOwnershipInEntity = exports.DataOwnedFields = exports.DataJsonb = exports.DataLimitCounter = exports.DataJobTrigger = exports.DataInheritFromParent = exports.DataInflection = exports.DataImmutableFields = exports.DataImageEmbedding = exports.DataId = exports.DataForceCurrentUser = exports.DataFeatureFlag = exports.DataEntityMembership = exports.DataDirectOwner = exports.DataCompositeField = void 0;
|
|
3
|
+
exports.TableUserSettings = exports.TableUserProfiles = exports.TableOrganizationSettings = exports.SearchVector = exports.SearchUnified = exports.SearchTrgm = exports.SearchSpatialAggregate = exports.SearchSpatial = exports.SearchFullText = exports.SearchBm25 = exports.DataTimestamps = exports.DataTags = exports.DataStatusField = exports.DataSoftDelete = exports.DataSlug = exports.DataPublishable = exports.DataPeoplestamps = exports.DataOwnershipInEntity = exports.DataOwnedFields = exports.DataJsonb = exports.DataLimitCounter = exports.DataJobTrigger = exports.DataInheritFromParent = exports.DataInflection = exports.DataImmutableFields = exports.DataImageEmbedding = exports.DataId = exports.DataForceCurrentUser = exports.DataFeatureFlag = exports.DataFileEmbedding = exports.DataEntityMembership = exports.DataDirectOwner = exports.DataCompositeField = void 0;
|
|
4
4
|
var data_composite_field_1 = require("./data-composite-field");
|
|
5
5
|
Object.defineProperty(exports, "DataCompositeField", { enumerable: true, get: function () { return data_composite_field_1.DataCompositeField; } });
|
|
6
6
|
var data_direct_owner_1 = require("./data-direct-owner");
|
|
7
7
|
Object.defineProperty(exports, "DataDirectOwner", { enumerable: true, get: function () { return data_direct_owner_1.DataDirectOwner; } });
|
|
8
8
|
var data_entity_membership_1 = require("./data-entity-membership");
|
|
9
9
|
Object.defineProperty(exports, "DataEntityMembership", { enumerable: true, get: function () { return data_entity_membership_1.DataEntityMembership; } });
|
|
10
|
+
var data_file_embedding_1 = require("./data-file-embedding");
|
|
11
|
+
Object.defineProperty(exports, "DataFileEmbedding", { enumerable: true, get: function () { return data_file_embedding_1.DataFileEmbedding; } });
|
|
10
12
|
var data_feature_flag_1 = require("./data-feature-flag");
|
|
11
13
|
Object.defineProperty(exports, "DataFeatureFlag", { enumerable: true, get: function () { return data_feature_flag_1.DataFeatureFlag; } });
|
|
12
14
|
var data_force_current_user_1 = require("./data-force-current-user");
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export const AuthzFilePath = {
|
|
2
|
+
name: 'AuthzFilePath',
|
|
3
|
+
slug: 'authz_file_path',
|
|
4
|
+
category: 'authz',
|
|
5
|
+
display_name: 'File Path Share',
|
|
6
|
+
description: 'Path-scoped file sharing via ltree containment. Grants access when a path_shares row matches the current user, bucket, and an ancestor path with the required permission.',
|
|
7
|
+
parameter_schema: {
|
|
8
|
+
type: 'object',
|
|
9
|
+
properties: {
|
|
10
|
+
shares_schema: {
|
|
11
|
+
type: 'string',
|
|
12
|
+
description: 'Schema of the path_shares table'
|
|
13
|
+
},
|
|
14
|
+
shares_table: {
|
|
15
|
+
type: 'string',
|
|
16
|
+
description: 'Name of the path_shares table'
|
|
17
|
+
},
|
|
18
|
+
files_schema: {
|
|
19
|
+
type: 'string',
|
|
20
|
+
description: 'Schema of the files table (used to qualify column references inside the EXISTS subquery)'
|
|
21
|
+
},
|
|
22
|
+
files_table: {
|
|
23
|
+
type: 'string',
|
|
24
|
+
description: 'Name of the files table (used to qualify column references inside the EXISTS subquery)'
|
|
25
|
+
},
|
|
26
|
+
permission_field: {
|
|
27
|
+
type: 'string',
|
|
28
|
+
format: 'column-ref',
|
|
29
|
+
description: 'Boolean column on the path_shares table that grants the required permission (e.g. can_read, can_write)'
|
|
30
|
+
},
|
|
31
|
+
bucket_field: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
format: 'column-ref',
|
|
34
|
+
description: 'Column on the files table referencing the bucket',
|
|
35
|
+
default: 'bucket_id'
|
|
36
|
+
},
|
|
37
|
+
path_field: {
|
|
38
|
+
type: 'string',
|
|
39
|
+
format: 'column-ref',
|
|
40
|
+
description: 'Ltree column on the files table representing the file path',
|
|
41
|
+
default: 'path'
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
required: [
|
|
45
|
+
'shares_schema',
|
|
46
|
+
'shares_table',
|
|
47
|
+
'files_table',
|
|
48
|
+
'permission_field'
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
tags: [
|
|
52
|
+
'storage',
|
|
53
|
+
'authz'
|
|
54
|
+
]
|
|
55
|
+
};
|
package/esm/authz/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { AuthzAllowAll } from './authz-allow-all';
|
|
|
2
2
|
export { AuthzAppMembership } from './authz-app-membership';
|
|
3
3
|
export { AuthzComposite } from './authz-composite';
|
|
4
4
|
export { AuthzDenyAll } from './authz-deny-all';
|
|
5
|
+
export { AuthzFilePath } from './authz-file-path';
|
|
5
6
|
export { AuthzDirectOwner } from './authz-direct-owner';
|
|
6
7
|
export { AuthzDirectOwnerAny } from './authz-direct-owner-any';
|
|
7
8
|
export { AuthzEntityMembership } from './authz-entity-membership';
|
package/esm/authz/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export { AuthzAllowAll } from './authz-allow-all';
|
|
|
2
2
|
export { AuthzAppMembership } from './authz-app-membership';
|
|
3
3
|
export { AuthzComposite } from './authz-composite';
|
|
4
4
|
export { AuthzDenyAll } from './authz-deny-all';
|
|
5
|
+
export { AuthzFilePath } from './authz-file-path';
|
|
5
6
|
export { AuthzDirectOwner } from './authz-direct-owner';
|
|
6
7
|
export { AuthzDirectOwnerAny } from './authz-direct-owner-any';
|
|
7
8
|
export { AuthzEntityMembership } from './authz-entity-membership';
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
export const DataFileEmbedding = {
|
|
2
|
+
name: 'DataFileEmbedding',
|
|
3
|
+
slug: 'data_file_embedding',
|
|
4
|
+
category: 'data',
|
|
5
|
+
display_name: 'File Embedding',
|
|
6
|
+
description: 'Generic, MIME-scoped embedding node for file tables. Supports two modes: ' +
|
|
7
|
+
'direct (whole-file to single vector, e.g. CLIP for images) when extraction ' +
|
|
8
|
+
'is omitted, or extract (file to text to chunks to per-chunk vectors) when ' +
|
|
9
|
+
'extraction config is provided. Composes SearchVector + DataJobTrigger ' +
|
|
10
|
+
'internally. Multiple instances can coexist on the same table with different ' +
|
|
11
|
+
'MIME scopes, field names, and embedding strategies.',
|
|
12
|
+
parameter_schema: {
|
|
13
|
+
type: 'object',
|
|
14
|
+
properties: {
|
|
15
|
+
// ── Vector config (passed through to SearchVector) ─────────────
|
|
16
|
+
field_name: {
|
|
17
|
+
type: 'string',
|
|
18
|
+
format: 'column-ref',
|
|
19
|
+
description: 'Name of the vector embedding column',
|
|
20
|
+
default: 'embedding'
|
|
21
|
+
},
|
|
22
|
+
dimensions: {
|
|
23
|
+
type: 'integer',
|
|
24
|
+
description: 'Vector dimensions (e.g. 512 for CLIP, 768 for nomic, 1536 for ada-002)',
|
|
25
|
+
default: 768
|
|
26
|
+
},
|
|
27
|
+
index_method: {
|
|
28
|
+
type: 'string',
|
|
29
|
+
enum: ['hnsw', 'ivfflat'],
|
|
30
|
+
description: 'Index type for similarity search',
|
|
31
|
+
default: 'hnsw'
|
|
32
|
+
},
|
|
33
|
+
metric: {
|
|
34
|
+
type: 'string',
|
|
35
|
+
enum: ['cosine', 'l2', 'ip'],
|
|
36
|
+
description: 'Distance metric',
|
|
37
|
+
default: 'cosine'
|
|
38
|
+
},
|
|
39
|
+
index_options: {
|
|
40
|
+
type: 'object',
|
|
41
|
+
description: 'Index-specific options. HNSW: {m, ef_construction}. IVFFlat: {lists}.',
|
|
42
|
+
default: {}
|
|
43
|
+
},
|
|
44
|
+
// ── MIME scoping ───────────────────────────────────────────────
|
|
45
|
+
mime_patterns: {
|
|
46
|
+
type: 'array',
|
|
47
|
+
items: { type: 'string' },
|
|
48
|
+
description: 'MIME type LIKE patterns to match. Multiple patterns are OR\'d together. ' +
|
|
49
|
+
'Examples: [\'image/%\'], [\'application/pdf\', \'text/%\'], [\'audio/%\'].',
|
|
50
|
+
default: ['image/%']
|
|
51
|
+
},
|
|
52
|
+
// ── Job routing ────────────────────────────────────────────────
|
|
53
|
+
task_identifier: {
|
|
54
|
+
type: 'string',
|
|
55
|
+
description: 'Job task identifier for the worker. In direct mode this is the ' +
|
|
56
|
+
'embedding worker; in extract mode this is the extraction worker.',
|
|
57
|
+
default: 'process_file_embedding'
|
|
58
|
+
},
|
|
59
|
+
events: {
|
|
60
|
+
type: 'array',
|
|
61
|
+
items: { type: 'string', enum: ['INSERT', 'UPDATE'] },
|
|
62
|
+
description: 'Trigger events that fire the job',
|
|
63
|
+
default: ['INSERT']
|
|
64
|
+
},
|
|
65
|
+
payload_custom: {
|
|
66
|
+
type: 'object',
|
|
67
|
+
additionalProperties: { type: 'string', format: 'column-ref' },
|
|
68
|
+
description: 'Custom payload key-to-column mapping for the job trigger',
|
|
69
|
+
default: {
|
|
70
|
+
file_id: 'id',
|
|
71
|
+
key: 'key',
|
|
72
|
+
mime_type: 'mime_type',
|
|
73
|
+
bucket_id: 'bucket_id'
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
trigger_conditions: {
|
|
77
|
+
description: 'Additional compound conditions beyond MIME filtering. ' +
|
|
78
|
+
'Merged with the auto-generated MIME conditions via AND. ' +
|
|
79
|
+
'Use this to add status checks, field guards, etc.',
|
|
80
|
+
'x-codegen-type': 'TriggerCondition | TriggerCondition[]',
|
|
81
|
+
oneOf: [
|
|
82
|
+
{ $ref: '#/$defs/triggerCondition' },
|
|
83
|
+
{ type: 'array', items: { $ref: '#/$defs/triggerCondition' } }
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
// ── Extraction config (optional — enables extract mode) ────────
|
|
87
|
+
extraction: {
|
|
88
|
+
type: 'object',
|
|
89
|
+
description: 'Text extraction configuration. When present, the generator creates ' +
|
|
90
|
+
'extraction output fields on the table and configures SearchVector with ' +
|
|
91
|
+
'source_fields + stale tracking. When absent, the node operates in direct ' +
|
|
92
|
+
'mode (single vector per file, no text extraction).',
|
|
93
|
+
properties: {
|
|
94
|
+
text_field: {
|
|
95
|
+
type: 'string',
|
|
96
|
+
format: 'column-ref',
|
|
97
|
+
description: 'Field to store extracted text/markdown',
|
|
98
|
+
default: 'extracted_text'
|
|
99
|
+
},
|
|
100
|
+
metadata_field: {
|
|
101
|
+
type: 'string',
|
|
102
|
+
format: 'column-ref',
|
|
103
|
+
description: 'JSONB field for extraction metadata (page count, language, etc.)',
|
|
104
|
+
default: 'extracted_metadata'
|
|
105
|
+
},
|
|
106
|
+
status_field: {
|
|
107
|
+
type: 'string',
|
|
108
|
+
format: 'column-ref',
|
|
109
|
+
description: 'Extraction lifecycle status field',
|
|
110
|
+
default: 'extraction_status'
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
// ── Chunking config (optional — creates embedding_chunks) ──────
|
|
115
|
+
chunks: {
|
|
116
|
+
type: 'object',
|
|
117
|
+
description: 'Chunking configuration. Creates an embedding_chunks record that drives ' +
|
|
118
|
+
'automatic text splitting and per-chunk embedding. Only meaningful when ' +
|
|
119
|
+
'extraction is also provided.',
|
|
120
|
+
properties: {
|
|
121
|
+
content_field_name: {
|
|
122
|
+
type: 'string',
|
|
123
|
+
format: 'column-ref',
|
|
124
|
+
description: 'Name of the text content column in the chunks table',
|
|
125
|
+
default: 'content'
|
|
126
|
+
},
|
|
127
|
+
chunk_size: {
|
|
128
|
+
type: 'integer',
|
|
129
|
+
description: 'Maximum number of characters per chunk',
|
|
130
|
+
default: 1000
|
|
131
|
+
},
|
|
132
|
+
chunk_overlap: {
|
|
133
|
+
type: 'integer',
|
|
134
|
+
description: 'Number of overlapping characters between consecutive chunks',
|
|
135
|
+
default: 200
|
|
136
|
+
},
|
|
137
|
+
chunk_strategy: {
|
|
138
|
+
type: 'string',
|
|
139
|
+
enum: ['fixed', 'sentence', 'paragraph', 'semantic'],
|
|
140
|
+
description: 'Strategy for splitting text into chunks',
|
|
141
|
+
default: 'paragraph'
|
|
142
|
+
},
|
|
143
|
+
metadata_fields: {
|
|
144
|
+
type: 'object',
|
|
145
|
+
description: 'Metadata fields from parent to copy into chunks'
|
|
146
|
+
},
|
|
147
|
+
enqueue_chunking_job: {
|
|
148
|
+
type: 'boolean',
|
|
149
|
+
description: 'Whether to auto-enqueue a chunking job on insert/update',
|
|
150
|
+
default: true
|
|
151
|
+
},
|
|
152
|
+
chunking_task_name: {
|
|
153
|
+
type: 'string',
|
|
154
|
+
description: 'Task identifier for the chunking job queue',
|
|
155
|
+
default: 'generate_chunks'
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
// ── Stale tracking (meaningful in extract mode) ────────────────
|
|
160
|
+
stale_strategy: {
|
|
161
|
+
type: 'string',
|
|
162
|
+
enum: ['column', 'null', 'hash'],
|
|
163
|
+
description: 'Strategy for tracking embedding staleness when extraction is enabled. ' +
|
|
164
|
+
'column: embedding_stale boolean. null: set embedding to NULL. hash: md5 hash.',
|
|
165
|
+
default: 'column'
|
|
166
|
+
},
|
|
167
|
+
include_stale_field: {
|
|
168
|
+
type: 'boolean',
|
|
169
|
+
description: 'Whether to include the embedding_stale boolean field (extract mode)',
|
|
170
|
+
default: true
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
tags: [
|
|
175
|
+
'embedding',
|
|
176
|
+
'vector',
|
|
177
|
+
'ai',
|
|
178
|
+
'composition',
|
|
179
|
+
'jobs',
|
|
180
|
+
'multimodal',
|
|
181
|
+
'files'
|
|
182
|
+
]
|
|
183
|
+
};
|
|
@@ -1,2 +1,14 @@
|
|
|
1
1
|
import type { NodeTypeDefinition } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Image-specific preset of DataFileEmbedding.
|
|
4
|
+
*
|
|
5
|
+
* At the SQL layer, data_image_embedding delegates entirely to
|
|
6
|
+
* data_file_embedding, merging image-specific defaults before forwarding.
|
|
7
|
+
* The parameter schema here is intentionally identical to DataFileEmbedding;
|
|
8
|
+
* only the defaults differ (dimensions: 512, task: process_image_embedding,
|
|
9
|
+
* mime_patterns: ['image/%']).
|
|
10
|
+
*
|
|
11
|
+
* Kept as a separate node type for backward compatibility — existing
|
|
12
|
+
* blueprints that reference DataImageEmbedding continue to work unchanged.
|
|
13
|
+
*/
|
|
2
14
|
export declare const DataImageEmbedding: NodeTypeDefinition;
|
|
@@ -1,12 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Image-specific preset of DataFileEmbedding.
|
|
3
|
+
*
|
|
4
|
+
* At the SQL layer, data_image_embedding delegates entirely to
|
|
5
|
+
* data_file_embedding, merging image-specific defaults before forwarding.
|
|
6
|
+
* The parameter schema here is intentionally identical to DataFileEmbedding;
|
|
7
|
+
* only the defaults differ (dimensions: 512, task: process_image_embedding,
|
|
8
|
+
* mime_patterns: ['image/%']).
|
|
9
|
+
*
|
|
10
|
+
* Kept as a separate node type for backward compatibility — existing
|
|
11
|
+
* blueprints that reference DataImageEmbedding continue to work unchanged.
|
|
12
|
+
*/
|
|
1
13
|
export const DataImageEmbedding = {
|
|
2
14
|
name: 'DataImageEmbedding',
|
|
3
15
|
slug: 'data_image_embedding',
|
|
4
16
|
category: 'data',
|
|
5
17
|
display_name: 'Image Embedding',
|
|
6
|
-
description: '
|
|
18
|
+
description: 'Image-specific preset of DataFileEmbedding. Delegates to DataFileEmbedding ' +
|
|
19
|
+
'with image-oriented defaults: dimensions=512 (CLIP), mime_patterns=[\'image/%\'], ' +
|
|
20
|
+
'task_identifier=\'process_image_embedding\', direct mode (no extraction). ' +
|
|
21
|
+
'Accepts all DataFileEmbedding parameters — any overrides are forwarded through.',
|
|
7
22
|
parameter_schema: {
|
|
8
23
|
type: 'object',
|
|
9
24
|
properties: {
|
|
25
|
+
// ── Vector config (passed through to DataFileEmbedding) ──────────
|
|
10
26
|
field_name: {
|
|
11
27
|
type: 'string',
|
|
12
28
|
format: 'column-ref',
|
|
@@ -15,47 +31,48 @@ export const DataImageEmbedding = {
|
|
|
15
31
|
},
|
|
16
32
|
dimensions: {
|
|
17
33
|
type: 'integer',
|
|
18
|
-
description: 'Vector dimensions',
|
|
34
|
+
description: 'Vector dimensions (default 512 for CLIP-style image embeddings)',
|
|
19
35
|
default: 512
|
|
20
36
|
},
|
|
21
37
|
index_method: {
|
|
22
38
|
type: 'string',
|
|
23
|
-
enum: [
|
|
24
|
-
'hnsw',
|
|
25
|
-
'ivfflat'
|
|
26
|
-
],
|
|
39
|
+
enum: ['hnsw', 'ivfflat'],
|
|
27
40
|
description: 'Index type for similarity search',
|
|
28
41
|
default: 'hnsw'
|
|
29
42
|
},
|
|
30
43
|
metric: {
|
|
31
44
|
type: 'string',
|
|
32
|
-
enum: [
|
|
33
|
-
'cosine',
|
|
34
|
-
'l2',
|
|
35
|
-
'ip'
|
|
36
|
-
],
|
|
45
|
+
enum: ['cosine', 'l2', 'ip'],
|
|
37
46
|
description: 'Distance metric',
|
|
38
47
|
default: 'cosine'
|
|
39
48
|
},
|
|
49
|
+
index_options: {
|
|
50
|
+
type: 'object',
|
|
51
|
+
description: 'Index-specific options. HNSW: {m, ef_construction}. IVFFlat: {lists}.',
|
|
52
|
+
default: {}
|
|
53
|
+
},
|
|
54
|
+
// ── MIME scoping ───────────────────────────────────────────────
|
|
55
|
+
mime_patterns: {
|
|
56
|
+
type: 'array',
|
|
57
|
+
items: { type: 'string' },
|
|
58
|
+
description: 'MIME type LIKE patterns to match. Multiple patterns are OR\'d together.',
|
|
59
|
+
default: ['image/%']
|
|
60
|
+
},
|
|
61
|
+
// ── Job routing ────────────────────────────────────────────────
|
|
40
62
|
task_identifier: {
|
|
41
63
|
type: 'string',
|
|
42
|
-
description: 'Job task identifier for the embedding worker',
|
|
64
|
+
description: 'Job task identifier for the image embedding worker',
|
|
43
65
|
default: 'process_image_embedding'
|
|
44
66
|
},
|
|
45
|
-
|
|
67
|
+
events: {
|
|
46
68
|
type: 'array',
|
|
47
|
-
items: {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
description: 'MIME type LIKE patterns to match (e.g., image/%, video/%). Multiple patterns are OR\'d together.',
|
|
51
|
-
default: ['image/%']
|
|
69
|
+
items: { type: 'string', enum: ['INSERT', 'UPDATE'] },
|
|
70
|
+
description: 'Trigger events that fire the job',
|
|
71
|
+
default: ['INSERT']
|
|
52
72
|
},
|
|
53
73
|
payload_custom: {
|
|
54
74
|
type: 'object',
|
|
55
|
-
additionalProperties: {
|
|
56
|
-
type: 'string',
|
|
57
|
-
format: 'column-ref'
|
|
58
|
-
},
|
|
75
|
+
additionalProperties: { type: 'string', format: 'column-ref' },
|
|
59
76
|
description: 'Custom payload key-to-column mapping for the job trigger',
|
|
60
77
|
default: {
|
|
61
78
|
file_id: 'id',
|
|
@@ -63,6 +80,76 @@ export const DataImageEmbedding = {
|
|
|
63
80
|
mime_type: 'mime_type',
|
|
64
81
|
bucket_id: 'bucket_id'
|
|
65
82
|
}
|
|
83
|
+
},
|
|
84
|
+
trigger_conditions: {
|
|
85
|
+
description: 'Additional compound conditions beyond MIME filtering. ' +
|
|
86
|
+
'Merged with the auto-generated MIME conditions via AND.',
|
|
87
|
+
'x-codegen-type': 'TriggerCondition | TriggerCondition[]',
|
|
88
|
+
oneOf: [
|
|
89
|
+
{ $ref: '#/$defs/triggerCondition' },
|
|
90
|
+
{ type: 'array', items: { $ref: '#/$defs/triggerCondition' } }
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
// ── Extraction config (optional — enables extract mode) ────────
|
|
94
|
+
extraction: {
|
|
95
|
+
type: 'object',
|
|
96
|
+
description: 'Text extraction configuration. Forwarded to DataFileEmbedding. ' +
|
|
97
|
+
'When present, enables extract mode (e.g., OCR for images).',
|
|
98
|
+
properties: {
|
|
99
|
+
text_field: {
|
|
100
|
+
type: 'string',
|
|
101
|
+
format: 'column-ref',
|
|
102
|
+
description: 'Field to store extracted text',
|
|
103
|
+
default: 'extracted_text'
|
|
104
|
+
},
|
|
105
|
+
metadata_field: {
|
|
106
|
+
type: 'string',
|
|
107
|
+
format: 'column-ref',
|
|
108
|
+
description: 'JSONB field for extraction metadata',
|
|
109
|
+
default: 'extracted_metadata'
|
|
110
|
+
},
|
|
111
|
+
status_field: {
|
|
112
|
+
type: 'string',
|
|
113
|
+
format: 'column-ref',
|
|
114
|
+
description: 'Extraction lifecycle status field',
|
|
115
|
+
default: 'extraction_status'
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
// ── Chunking config (optional — forwarded to DataFileEmbedding) ─
|
|
120
|
+
chunks: {
|
|
121
|
+
type: 'object',
|
|
122
|
+
description: 'Chunking configuration. Forwarded to DataFileEmbedding. ' +
|
|
123
|
+
'Only meaningful when extraction is also provided.',
|
|
124
|
+
properties: {
|
|
125
|
+
content_field_name: {
|
|
126
|
+
type: 'string',
|
|
127
|
+
format: 'column-ref',
|
|
128
|
+
default: 'content'
|
|
129
|
+
},
|
|
130
|
+
chunk_size: { type: 'integer', default: 1000 },
|
|
131
|
+
chunk_overlap: { type: 'integer', default: 200 },
|
|
132
|
+
chunk_strategy: {
|
|
133
|
+
type: 'string',
|
|
134
|
+
enum: ['fixed', 'sentence', 'paragraph', 'semantic'],
|
|
135
|
+
default: 'paragraph'
|
|
136
|
+
},
|
|
137
|
+
metadata_fields: { type: 'object' },
|
|
138
|
+
enqueue_chunking_job: { type: 'boolean', default: true },
|
|
139
|
+
chunking_task_name: { type: 'string', default: 'generate_chunks' }
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
// ── Stale tracking (forwarded to DataFileEmbedding) ────────────
|
|
143
|
+
stale_strategy: {
|
|
144
|
+
type: 'string',
|
|
145
|
+
enum: ['column', 'null', 'hash'],
|
|
146
|
+
description: 'Strategy for tracking embedding staleness in extract mode',
|
|
147
|
+
default: 'column'
|
|
148
|
+
},
|
|
149
|
+
include_stale_field: {
|
|
150
|
+
type: 'boolean',
|
|
151
|
+
description: 'Whether to include the embedding_stale boolean field',
|
|
152
|
+
default: true
|
|
66
153
|
}
|
|
67
154
|
}
|
|
68
155
|
},
|
package/esm/data/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { DataCompositeField } from './data-composite-field';
|
|
2
2
|
export { DataDirectOwner } from './data-direct-owner';
|
|
3
3
|
export { DataEntityMembership } from './data-entity-membership';
|
|
4
|
+
export { DataFileEmbedding } from './data-file-embedding';
|
|
4
5
|
export { DataFeatureFlag } from './data-feature-flag';
|
|
5
6
|
export { DataForceCurrentUser } from './data-force-current-user';
|
|
6
7
|
export { DataId } from './data-id';
|
package/esm/data/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { DataCompositeField } from './data-composite-field';
|
|
2
2
|
export { DataDirectOwner } from './data-direct-owner';
|
|
3
3
|
export { DataEntityMembership } from './data-entity-membership';
|
|
4
|
+
export { DataFileEmbedding } from './data-file-embedding';
|
|
4
5
|
export { DataFeatureFlag } from './data-feature-flag';
|
|
5
6
|
export { DataForceCurrentUser } from './data-force-current-user';
|
|
6
7
|
export { DataId } from './data-id';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-type-registry",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"description": "Node type definitions for the Constructive blueprint system. Single source of truth for all Authz*, Data*, Relation*, and View* node types.",
|
|
5
5
|
"author": "Constructive <developers@constructive.io>",
|
|
6
6
|
"main": "index.js",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"registry",
|
|
48
48
|
"graphile"
|
|
49
49
|
],
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "52d3f163860f219b34e7e918b2ddbf2bded7c31a"
|
|
51
51
|
}
|