node-type-registry 0.33.1 → 0.35.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.
Files changed (63) hide show
  1. package/blueprint-types.generated.d.ts +256 -59
  2. package/blueprint-types.generated.js +30 -0
  3. package/codegen/generate-types.js +3 -1
  4. package/data/data-aggregate-limit-counter.d.ts +1 -1
  5. package/data/data-aggregate-limit-counter.js +4 -4
  6. package/data/data-billing-meter.d.ts +1 -1
  7. package/data/data-billing-meter.js +4 -4
  8. package/data/data-bulk.d.ts +2 -0
  9. package/data/data-bulk.js +40 -0
  10. package/data/data-chunks.d.ts +2 -2
  11. package/data/data-chunks.js +6 -6
  12. package/data/data-feature-flag.d.ts +1 -1
  13. package/data/data-feature-flag.js +4 -4
  14. package/data/data-file-embedding.d.ts +1 -1
  15. package/data/data-file-embedding.js +8 -27
  16. package/data/data-image-embedding.d.ts +4 -4
  17. package/data/data-image-embedding.js +13 -31
  18. package/data/data-job-trigger.d.ts +1 -1
  19. package/data/data-job-trigger.js +4 -4
  20. package/data/data-limit-counter.d.ts +1 -1
  21. package/data/data-limit-counter.js +4 -4
  22. package/data/index.d.ts +11 -8
  23. package/data/index.js +15 -9
  24. package/data/process-extraction.d.ts +14 -0
  25. package/data/process-extraction.js +108 -0
  26. package/data/process-image-versions.d.ts +15 -0
  27. package/data/process-image-versions.js +139 -0
  28. package/data/search-vector.js +1 -16
  29. package/esm/blueprint-types.generated.d.ts +256 -59
  30. package/esm/blueprint-types.generated.js +30 -0
  31. package/esm/codegen/generate-types.js +3 -1
  32. package/esm/data/data-aggregate-limit-counter.d.ts +1 -1
  33. package/esm/data/data-aggregate-limit-counter.js +3 -3
  34. package/esm/data/data-billing-meter.d.ts +1 -1
  35. package/esm/data/data-billing-meter.js +3 -3
  36. package/esm/data/data-bulk.d.ts +2 -0
  37. package/esm/data/data-bulk.js +37 -0
  38. package/esm/data/data-chunks.d.ts +2 -2
  39. package/esm/data/data-chunks.js +5 -5
  40. package/esm/data/data-feature-flag.d.ts +1 -1
  41. package/esm/data/data-feature-flag.js +3 -3
  42. package/esm/data/data-file-embedding.d.ts +1 -1
  43. package/esm/data/data-file-embedding.js +7 -26
  44. package/esm/data/data-image-embedding.d.ts +4 -4
  45. package/esm/data/data-image-embedding.js +12 -30
  46. package/esm/data/data-job-trigger.d.ts +1 -1
  47. package/esm/data/data-job-trigger.js +3 -3
  48. package/esm/data/data-limit-counter.d.ts +1 -1
  49. package/esm/data/data-limit-counter.js +3 -3
  50. package/esm/data/index.d.ts +11 -8
  51. package/esm/data/index.js +11 -8
  52. package/esm/data/process-extraction.d.ts +14 -0
  53. package/esm/data/process-extraction.js +105 -0
  54. package/esm/data/process-image-versions.d.ts +15 -0
  55. package/esm/data/process-image-versions.js +136 -0
  56. package/esm/data/search-vector.js +1 -16
  57. package/esm/module-presets/auth-hardened.js +4 -2
  58. package/esm/module-presets/b2b-storage.js +4 -2
  59. package/esm/module-presets/b2b.js +4 -2
  60. package/module-presets/auth-hardened.js +4 -2
  61. package/module-presets/b2b-storage.js +4 -2
  62. package/module-presets/b2b.js +4 -2
  63. package/package.json +2 -2
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProcessImageVersions = void 0;
4
+ /**
5
+ * Image version processing node.
6
+ *
7
+ * Composes a JobTrigger that fires when an image file transitions to
8
+ * status = 'uploaded' (or on INSERT if confirm_upload is not enabled).
9
+ * The trigger enqueues an image-processing job that generates resized,
10
+ * cropped, or reformatted variants of the source image.
11
+ *
12
+ * The image processing worker is external (Knative function) — this node
13
+ * only creates the trigger infrastructure. The worker generates the variants
14
+ * and writes them back to the storage system as new file records linked to
15
+ * the source file.
16
+ */
17
+ exports.ProcessImageVersions = {
18
+ name: 'ProcessImageVersions',
19
+ slug: 'process_image_versions',
20
+ category: 'process',
21
+ display_name: 'Image Versions',
22
+ description: 'Creates a job trigger for image variant generation. ' +
23
+ 'Fires when an image file is uploaded (status = \'uploaded\') or on INSERT. ' +
24
+ 'The external worker generates resized, cropped, or reformatted versions ' +
25
+ '(thumbnails, previews, WebP conversions, etc.) and stores them as new ' +
26
+ 'file records linked to the source image.',
27
+ parameter_schema: {
28
+ type: 'object',
29
+ required: ['versions'],
30
+ properties: {
31
+ // ── Version definitions ───────────────────────────────────────
32
+ versions: {
33
+ type: 'array',
34
+ items: {
35
+ type: 'object',
36
+ properties: {
37
+ name: {
38
+ type: 'string',
39
+ description: 'Version identifier (e.g., "thumb", "preview", "hero")'
40
+ },
41
+ width: {
42
+ type: 'integer',
43
+ description: 'Target width in pixels'
44
+ },
45
+ height: {
46
+ type: 'integer',
47
+ description: 'Target height in pixels'
48
+ },
49
+ fit: {
50
+ type: 'string',
51
+ enum: ['cover', 'contain', 'fill', 'inside', 'outside'],
52
+ description: 'Resize fitting strategy',
53
+ default: 'cover'
54
+ },
55
+ format: {
56
+ type: 'string',
57
+ enum: ['jpeg', 'png', 'webp', 'avif'],
58
+ description: 'Output image format',
59
+ default: 'webp'
60
+ },
61
+ quality: {
62
+ type: 'integer',
63
+ description: 'Output quality (1-100)',
64
+ default: 80
65
+ }
66
+ },
67
+ required: ['name']
68
+ },
69
+ description: 'Array of version definitions. Each version specifies dimensions, ' +
70
+ 'format, and quality for a generated image variant. ' +
71
+ 'Required — the blueprint must explicitly define what variants to generate.',
72
+ minItems: 1
73
+ },
74
+ // ── MIME scoping ──────────────────────────────────────────────
75
+ mime_patterns: {
76
+ type: 'array',
77
+ items: { type: 'string' },
78
+ description: 'MIME type LIKE patterns to match. Defaults to all image types.',
79
+ default: ['image/%']
80
+ },
81
+ // ── Job routing ───────────────────────────────────────────────
82
+ task_identifier: {
83
+ type: 'string',
84
+ description: 'Job task identifier for the image processing worker',
85
+ default: 'process_image_versions'
86
+ },
87
+ events: {
88
+ type: 'array',
89
+ items: { type: 'string', enum: ['INSERT', 'UPDATE'] },
90
+ description: 'Trigger events that fire the job',
91
+ default: ['INSERT']
92
+ },
93
+ payload_custom: {
94
+ type: 'object',
95
+ additionalProperties: { type: 'string', format: 'column-ref' },
96
+ description: 'Custom payload key-to-column mapping for the job trigger',
97
+ default: {
98
+ file_id: 'id',
99
+ key: 'key',
100
+ mime_type: 'mime_type',
101
+ bucket_id: 'bucket_id'
102
+ }
103
+ },
104
+ trigger_conditions: {
105
+ description: 'Additional compound conditions beyond MIME filtering. ' +
106
+ 'Merged with the auto-generated MIME conditions via AND.',
107
+ 'x-codegen-type': 'TriggerCondition | TriggerCondition[]',
108
+ oneOf: [
109
+ { $ref: '#/$defs/triggerCondition' },
110
+ { type: 'array', items: { $ref: '#/$defs/triggerCondition' } }
111
+ ]
112
+ },
113
+ // ── Job options ───────────────────────────────────────────────
114
+ queue_name: {
115
+ type: 'string',
116
+ description: 'Job queue name for image processing tasks',
117
+ default: 'image_processing'
118
+ },
119
+ max_attempts: {
120
+ type: 'integer',
121
+ description: 'Maximum number of retry attempts',
122
+ default: 5
123
+ },
124
+ priority: {
125
+ type: 'integer',
126
+ description: 'Job priority (lower = higher priority)',
127
+ default: 0
128
+ }
129
+ }
130
+ },
131
+ tags: [
132
+ 'images',
133
+ 'processing',
134
+ 'jobs',
135
+ 'resize',
136
+ 'thumbnails',
137
+ 'files'
138
+ ]
139
+ };
@@ -6,7 +6,7 @@ exports.SearchVector = {
6
6
  slug: 'search_vector',
7
7
  category: 'search',
8
8
  display_name: 'Vector Search',
9
- description: 'Adds a vector embedding column with HNSW or IVFFlat index for similarity search. Supports configurable dimensions, distance metrics (cosine, l2, ip), stale tracking strategies (column, null, hash), and automatic job enqueue triggers for embedding generation.',
9
+ description: 'Adds a vector embedding column with HNSW or IVFFlat index for similarity search. Supports configurable dimensions, distance metrics (cosine, l2, ip), per-field {field_name}_updated_at timestamp tracking (read-only in GraphQL), and automatic job enqueue triggers for embedding generation.',
10
10
  parameter_schema: {
11
11
  type: 'object',
12
12
  properties: {
@@ -45,11 +45,6 @@ exports.SearchVector = {
45
45
  description: 'Index-specific options. HNSW: {m, ef_construction}. IVFFlat: {lists}.',
46
46
  default: {}
47
47
  },
48
- include_stale_field: {
49
- type: 'boolean',
50
- description: 'When stale_strategy is column, adds an embedding_stale boolean field',
51
- default: true
52
- },
53
48
  source_fields: {
54
49
  type: 'array',
55
50
  items: {
@@ -68,16 +63,6 @@ exports.SearchVector = {
68
63
  description: 'Task identifier for the job queue',
69
64
  default: 'generate_embedding'
70
65
  },
71
- stale_strategy: {
72
- type: 'string',
73
- enum: [
74
- 'column',
75
- 'null',
76
- 'hash'
77
- ],
78
- description: 'Strategy for tracking embedding staleness. column: embedding_stale boolean. null: set embedding to NULL. hash: md5 hash of source fields.',
79
- default: 'column'
80
- },
81
66
  chunks: {
82
67
  type: 'object',
83
68
  description: 'Chunking configuration for long-text embedding. Creates an embedding_chunks record that drives automatic text splitting and per-chunk embedding. Omit to skip chunking.',
@@ -20,6 +20,41 @@ export interface TriggerCondition {
20
20
  /** Negated condition. */
21
21
  NOT?: TriggerCondition;
22
22
  }
23
+ /** Declaratively attaches billing usage-recording triggers to a table. On INSERT the named meter is incremented via record_usage; on DELETE it is decremented (reversal). On UPDATE, if the entity_field changes, the old entity is decremented and the new entity is incremented. Requires a provisioned billing_module for the target database. */
24
+ export interface BillingMeterParams {
25
+ meter_slug: string;
26
+ entity_field?: string;
27
+ quantity?: number;
28
+ events?: ('INSERT' | 'DELETE' | 'UPDATE')[];
29
+ }
30
+ /** Adds a CHECK constraint that validates a column value is greater than a threshold (single-column: column > value) or that one column is greater than another (cross-column: columns[0] > columns[1]). Compiled via AST helpers. */
31
+ export interface CheckGreaterThanParams {
32
+ column?: string;
33
+ value?: number;
34
+ columns?: string[];
35
+ }
36
+ /** Adds a CHECK constraint that validates a column value is less than a threshold (single-column: column < value) or that one column is less than another (cross-column: columns[0] < columns[1]). Compiled via AST helpers. */
37
+ export interface CheckLessThanParams {
38
+ column?: string;
39
+ value?: number;
40
+ columns?: string[];
41
+ }
42
+ /** Adds a CHECK constraint that validates two columns are not equal (columns[0] != columns[1]). Useful for preventing self-referencing rows. Compiled via AST helpers. */
43
+ export interface CheckNotEqualParams {
44
+ columns: string[];
45
+ }
46
+ /** Adds a CHECK constraint that validates a column value is one of an allowed set (e.g. tier IN ('free', 'paid', 'custom')). Compiled to column = ANY(ARRAY[...]) via AST helpers. */
47
+ export interface CheckOneOfParams {
48
+ column: string;
49
+ values: string[];
50
+ }
51
+ /** Enables bulk mutation smart tags on a table. When provisioned, adds @behavior tags for the selected bulk operations (insert, upsert, update, delete). Requires the graphile-bulk-mutations plugin. */
52
+ export interface DataBulkParams {
53
+ insert?: boolean;
54
+ upsert?: boolean;
55
+ update?: boolean;
56
+ delete?: boolean;
57
+ }
23
58
  /** Creates a derived text field that automatically concatenates multiple source fields via BEFORE INSERT/UPDATE triggers. Used to produce a unified text representation (e.g., embedding_text) from multiple columns on a table. The trigger fires with '_000' prefix to run before Search* triggers alphabetically. */
24
59
  export interface DataCompositeFieldParams {
25
60
  target?: string;
@@ -38,12 +73,6 @@ export interface DataEntityMembershipParams {
38
73
  include_id?: boolean;
39
74
  include_user_fk?: boolean;
40
75
  }
41
- /** Gates a table behind a feature flag backed by the cap tables. Attaches a BEFORE INSERT trigger that checks whether the named feature cap value is > 0. Features are modeled as caps with max=0 (disabled) or max=1 (enabled) in limit_caps / limit_caps_defaults tables. Resolution: COALESCE(per-entity cap, scope default, 0). */
42
- export interface DataFeatureFlagParams {
43
- feature_name: string;
44
- scope?: 'app' | 'org';
45
- entity_field?: string;
46
- }
47
76
  /** BEFORE INSERT trigger that forces a field to the value of jwt_public.current_user_id(). Prevents clients from spoofing the actor/uploader identity. The field value is always overwritten regardless of what the client provides. */
48
77
  export interface DataForceCurrentUserParams {
49
78
  field_name?: string;
@@ -52,18 +81,6 @@ export interface DataForceCurrentUserParams {
52
81
  export interface DataIdParams {
53
82
  field_name?: string;
54
83
  }
55
- /** Composition wrapper that creates a vector embedding field with HNSW/IVFFlat index (via SearchVector) and a job trigger with compound conditions (via DataJobTrigger) that fires on INSERT for image files matching mime_type patterns. Designed for storage file tables. */
56
- export interface DataImageEmbeddingParams {
57
- field_name?: string;
58
- dimensions?: number;
59
- index_method?: 'hnsw' | 'ivfflat';
60
- metric?: 'cosine' | 'l2' | 'ip';
61
- task_identifier?: string;
62
- mime_patterns?: string[];
63
- payload_custom?: {
64
- [key: string]: unknown;
65
- };
66
- }
67
84
  /** BEFORE UPDATE trigger that prevents changes to a list of specified fields after INSERT. Raises an exception if any of the listed fields have changed. Unlike FieldImmutable (single-field), this handles multiple fields in a single trigger for efficiency. */
68
85
  export interface DataImmutableFieldsParams {
69
86
  fields: string[];
@@ -80,34 +97,6 @@ export interface DataInheritFromParentParams {
80
97
  parent_table?: string;
81
98
  parent_schema?: string;
82
99
  }
83
- /** Dynamically creates PostgreSQL triggers that enqueue jobs via app_jobs.add_job() when table rows are inserted, updated, or deleted. Supports configurable payload strategies (full row, row ID, selected fields, or custom mapping), conditional firing via WHEN clauses, watched field changes, and extended job options (queue, priority, delay, max attempts). */
84
- export interface DataJobTriggerParams {
85
- task_identifier: string;
86
- payload_strategy?: 'row' | 'row_id' | 'fields' | 'custom';
87
- payload_fields?: string[];
88
- payload_custom?: {
89
- [key: string]: unknown;
90
- };
91
- events?: ('INSERT' | 'UPDATE' | 'DELETE')[];
92
- include_old?: boolean;
93
- include_meta?: boolean;
94
- condition_field?: string;
95
- condition_value?: string;
96
- conditions?: TriggerCondition | TriggerCondition[];
97
- watch_fields?: string[];
98
- job_key?: string;
99
- queue_name?: string;
100
- priority?: number;
101
- run_at_delay?: string;
102
- max_attempts?: number;
103
- }
104
- /** Declaratively attaches limit-tracking triggers to a table. On INSERT the named limit is incremented; on DELETE it is decremented. Requires a provisioned limits_module for the target scope. */
105
- export interface DataLimitCounterParams {
106
- limit_name: string;
107
- scope?: 'app' | 'org';
108
- actor_field?: string;
109
- events?: ('INSERT' | 'DELETE' | 'UPDATE')[];
110
- }
111
100
  /** Adds a JSONB column with optional GIN index for containment queries (@>, ?, ?|, ?&). Standard pattern for semi-structured metadata. */
112
101
  export interface DataJsonbParams {
113
102
  field_name?: string;
@@ -140,6 +129,11 @@ export interface DataPublishableParams {
140
129
  published_at_field?: string;
141
130
  include_id?: boolean;
142
131
  }
132
+ /** Creates per-table subscriber tables in subscriptions_public with RLS policies derived from source table SELECT policies. Attaches statement-level triggers to emit changes to subscribers. */
133
+ export interface DataRealtimeParams {
134
+ operations?: ('INSERT' | 'UPDATE' | 'DELETE')[];
135
+ subscriber_table_name?: string;
136
+ }
143
137
  /** Auto-generates URL-friendly slugs from field values on insert/update. Attaches BEFORE INSERT and BEFORE UPDATE triggers that call inflection.slugify() on the target field. References fields by name in data jsonb. */
144
138
  export interface DataSlugParams {
145
139
  field_name: string;
@@ -177,6 +171,25 @@ export type TableOrganizationSettingsParams = {};
177
171
  export type TableUserProfilesParams = {};
178
172
  /** Creates a user settings table for user-specific configuration. Uses AuthzDirectOwner for access control. */
179
173
  export type TableUserSettingsParams = {};
174
+ /** Declaratively attaches aggregate limit-tracking triggers to a table. On INSERT the named limit is incremented per entity; on DELETE it is decremented. Uses org_limit_aggregates_inc/dec for per-entity (org-level) aggregate limits rather than per-user limits. Requires a provisioned limits_module for the target database. */
175
+ export interface LimitAggregateParams {
176
+ limit_name: string;
177
+ entity_field?: string;
178
+ events?: ('INSERT' | 'DELETE' | 'UPDATE')[];
179
+ }
180
+ /** Gates a table behind a feature flag backed by the cap tables. Attaches a BEFORE INSERT trigger that checks whether the named feature cap value is > 0. Features are modeled as caps with max=0 (disabled) or max=1 (enabled) in limit_caps / limit_caps_defaults tables. Resolution: COALESCE(per-entity cap, scope default, 0). */
181
+ export interface LimitFeatureFlagParams {
182
+ feature_name: string;
183
+ scope?: 'app' | 'org';
184
+ entity_field?: string;
185
+ }
186
+ /** Declaratively attaches limit-tracking triggers to a table. On INSERT the named limit is incremented; on DELETE it is decremented. Requires a provisioned limits_module for the target scope. */
187
+ export interface LimitCounterParams {
188
+ limit_name: string;
189
+ scope?: 'app' | 'org';
190
+ actor_field?: string;
191
+ events?: ('INSERT' | 'DELETE' | 'UPDATE')[];
192
+ }
180
193
  /** Creates a BM25 index on an existing text column using pg_textsearch. Enables statistical relevance ranking with configurable k1 and b parameters. The BM25 index is auto-detected by graphile-search. */
181
194
  export interface SearchBm25Params {
182
195
  field_name: string;
@@ -269,7 +282,7 @@ export interface SearchUnifiedParams {
269
282
  boost_recency_decay?: number;
270
283
  };
271
284
  }
272
- /** Adds a vector embedding column with HNSW or IVFFlat index for similarity search. Supports configurable dimensions, distance metrics (cosine, l2, ip), stale tracking strategies (column, null, hash), and automatic job enqueue triggers for embedding generation. */
285
+ /** Adds a vector embedding column with HNSW or IVFFlat index for similarity search. Supports configurable dimensions, distance metrics (cosine, l2, ip), per-field {field_name}_updated_at timestamp tracking (read-only in GraphQL), and automatic job enqueue triggers for embedding generation. */
273
286
  export interface SearchVectorParams {
274
287
  field_name?: string;
275
288
  dimensions?: number;
@@ -278,11 +291,9 @@ export interface SearchVectorParams {
278
291
  index_options?: {
279
292
  [key: string]: unknown;
280
293
  };
281
- include_stale_field?: boolean;
282
294
  source_fields?: string[];
283
295
  enqueue_job?: boolean;
284
296
  job_task_name?: string;
285
- stale_strategy?: 'column' | 'null' | 'hash';
286
297
  chunks?: {
287
298
  content_field_name?: string;
288
299
  chunk_size?: number;
@@ -295,6 +306,139 @@ export interface SearchVectorParams {
295
306
  chunking_task_name?: string;
296
307
  };
297
308
  }
309
+ /** Dynamically creates PostgreSQL triggers that enqueue jobs via app_jobs.add_job() when table rows are inserted, updated, or deleted. Supports configurable payload strategies (full row, row ID, selected fields, or custom mapping), conditional firing via WHEN clauses, watched field changes, and extended job options (queue, priority, delay, max attempts). */
310
+ export interface JobTriggerParams {
311
+ task_identifier: string;
312
+ payload_strategy?: 'row' | 'row_id' | 'fields' | 'custom';
313
+ payload_fields?: string[];
314
+ payload_custom?: {
315
+ [key: string]: unknown;
316
+ };
317
+ events?: ('INSERT' | 'UPDATE' | 'DELETE')[];
318
+ include_old?: boolean;
319
+ include_meta?: boolean;
320
+ condition_field?: string;
321
+ condition_value?: string;
322
+ conditions?: TriggerCondition | TriggerCondition[];
323
+ watch_fields?: string[];
324
+ job_key?: string;
325
+ queue_name?: string;
326
+ priority?: number;
327
+ run_at_delay?: string;
328
+ max_attempts?: number;
329
+ }
330
+ /** Creates a chunked-embedding child table for any parent table. Provisions the chunks table with content, chunk_index, embedding vector, metadata, HNSW index, inherited RLS, and optional job trigger for automatic text splitting. Composed internally by ProcessFileEmbedding (enabled by default in extract mode) but can also be used standalone. */
331
+ export interface ProcessChunksParams {
332
+ content_field_name?: string;
333
+ chunk_size?: number;
334
+ chunk_overlap?: number;
335
+ chunk_strategy?: 'fixed' | 'sentence' | 'paragraph' | 'semantic';
336
+ dimensions?: number;
337
+ metric?: 'cosine' | 'l2' | 'ip';
338
+ chunks_table_name?: string;
339
+ metadata_fields?: string[];
340
+ enqueue_chunking_job?: boolean;
341
+ chunking_task_name?: string;
342
+ }
343
+ /** Generic, MIME-scoped embedding node for file tables. Supports two modes: direct (whole-file to single vector, e.g. CLIP for images) when extraction is omitted, or extract (file to text to chunks to per-chunk vectors) when extraction config is provided. Composes SearchVector + JobTrigger + ProcessChunks (enabled by default in extract mode) internally. Multiple instances can coexist on the same table with different MIME scopes, field names, and embedding strategies. */
344
+ export interface ProcessFileEmbeddingParams {
345
+ field_name?: string;
346
+ dimensions?: number;
347
+ index_method?: 'hnsw' | 'ivfflat';
348
+ metric?: 'cosine' | 'l2' | 'ip';
349
+ index_options?: {
350
+ [key: string]: unknown;
351
+ };
352
+ mime_patterns?: string[];
353
+ task_identifier?: string;
354
+ events?: ('INSERT' | 'UPDATE')[];
355
+ payload_custom?: {
356
+ [key: string]: unknown;
357
+ };
358
+ trigger_conditions?: TriggerCondition | TriggerCondition[];
359
+ extraction?: {
360
+ text_field?: string;
361
+ metadata_field?: string;
362
+ };
363
+ include_chunks?: boolean;
364
+ chunks?: {
365
+ content_field_name?: string;
366
+ chunk_size?: number;
367
+ chunk_overlap?: number;
368
+ chunk_strategy?: 'fixed' | 'sentence' | 'paragraph' | 'semantic';
369
+ metadata_fields?: string[];
370
+ enqueue_chunking_job?: boolean;
371
+ chunking_task_name?: string;
372
+ };
373
+ }
374
+ /** Image-specific preset of ProcessFileEmbedding. Delegates to ProcessFileEmbedding with image-oriented defaults: dimensions=512 (CLIP), mime_patterns=['image/%'], task_identifier='process_image_embedding', direct mode (no extraction). Accepts all ProcessFileEmbedding parameters — any overrides are forwarded through. */
375
+ export interface ProcessImageEmbeddingParams {
376
+ field_name?: string;
377
+ dimensions?: number;
378
+ index_method?: 'hnsw' | 'ivfflat';
379
+ metric?: 'cosine' | 'l2' | 'ip';
380
+ index_options?: {
381
+ [key: string]: unknown;
382
+ };
383
+ mime_patterns?: string[];
384
+ task_identifier?: string;
385
+ events?: ('INSERT' | 'UPDATE')[];
386
+ payload_custom?: {
387
+ [key: string]: unknown;
388
+ };
389
+ trigger_conditions?: TriggerCondition | TriggerCondition[];
390
+ extraction?: {
391
+ text_field?: string;
392
+ metadata_field?: string;
393
+ };
394
+ chunks?: {
395
+ content_field_name?: string;
396
+ chunk_size?: number;
397
+ chunk_overlap?: number;
398
+ chunk_strategy?: 'fixed' | 'sentence' | 'paragraph' | 'semantic';
399
+ metadata_fields?: {
400
+ [key: string]: unknown;
401
+ };
402
+ enqueue_chunking_job?: boolean;
403
+ chunking_task_name?: string;
404
+ };
405
+ }
406
+ /** Creates extraction output fields and a job trigger for file text extraction. Fires when a file is uploaded (status = 'uploaded') or on INSERT. The external worker extracts text/metadata from the file (PDF, DOCX, HTML, etc.) and writes the result back to the configured output fields. Typically used upstream of ProcessFileEmbedding or ProcessChunks. */
407
+ export interface ProcessExtractionParams {
408
+ text_field?: string;
409
+ metadata_field?: string;
410
+ mime_patterns?: string[];
411
+ task_identifier?: string;
412
+ events?: ('INSERT' | 'UPDATE')[];
413
+ payload_custom?: {
414
+ [key: string]: unknown;
415
+ };
416
+ trigger_conditions?: TriggerCondition | TriggerCondition[];
417
+ queue_name?: string;
418
+ max_attempts?: number;
419
+ priority?: number;
420
+ }
421
+ /** Creates a job trigger for image variant generation. Fires when an image file is uploaded (status = 'uploaded') or on INSERT. The external worker generates resized, cropped, or reformatted versions (thumbnails, previews, WebP conversions, etc.) and stores them as new file records linked to the source image. */
422
+ export interface ProcessImageVersionsParams {
423
+ versions: {
424
+ name: string;
425
+ width?: number;
426
+ height?: number;
427
+ fit?: 'cover' | 'contain' | 'fill' | 'inside' | 'outside';
428
+ format?: 'jpeg' | 'png' | 'webp' | 'avif';
429
+ quality?: number;
430
+ }[];
431
+ mime_patterns?: string[];
432
+ task_identifier?: string;
433
+ events?: ('INSERT' | 'UPDATE')[];
434
+ payload_custom?: {
435
+ [key: string]: unknown;
436
+ };
437
+ trigger_conditions?: TriggerCondition | TriggerCondition[];
438
+ queue_name?: string;
439
+ max_attempts?: number;
440
+ priority?: number;
441
+ }
298
442
  /** Allows all access. Generates TRUE expression. */
299
443
  export type AuthzAllowAllParams = {};
300
444
  /** App-level membership check (hardcoded membership_type=1). Verifies the user has app membership (optionally with specific permission) without binding to any entity from the row. Uses EXISTS subquery against SPRT table. For entity-scoped checks (org, channel, etc.), use AuthzEntityMembership instead. */
@@ -315,6 +459,16 @@ export interface AuthzCompositeParams {
315
459
  }
316
460
  /** Denies all access. Generates FALSE expression. */
317
461
  export type AuthzDenyAllParams = {};
462
+ /** 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. */
463
+ export interface AuthzFilePathParams {
464
+ shares_schema: string;
465
+ shares_table: string;
466
+ files_schema?: string;
467
+ files_table: string;
468
+ permission_field: string;
469
+ bucket_field?: string;
470
+ path_field?: string;
471
+ }
318
472
  /** Direct equality comparison between a table column and the current user ID. Simplest authorization pattern with no subqueries. */
319
473
  export interface AuthzDirectOwnerParams {
320
474
  entity_field: string;
@@ -536,7 +690,7 @@ export interface BlueprintField {
536
690
  /** An RLS policy entry for a blueprint table. Uses $type to match the blueprint JSON convention. */
537
691
  export interface BlueprintPolicy {
538
692
  /** Authz* policy type name (e.g., "AuthzDirectOwner", "AuthzAllowAll"). */
539
- $type: 'AuthzAllowAll' | 'AuthzAppMembership' | 'AuthzComposite' | 'AuthzDenyAll' | 'AuthzDirectOwner' | 'AuthzDirectOwnerAny' | 'AuthzEntityMembership' | 'AuthzMemberList' | 'AuthzNotReadOnly' | 'AuthzOrgHierarchy' | 'AuthzPeerOwnership' | 'AuthzPublishable' | 'AuthzRelatedEntityMembership' | 'AuthzRelatedMemberList' | 'AuthzRelatedPeerOwnership' | 'AuthzTemporal';
693
+ $type: 'AuthzAllowAll' | 'AuthzAppMembership' | 'AuthzComposite' | 'AuthzDenyAll' | 'AuthzFilePath' | 'AuthzDirectOwner' | 'AuthzDirectOwnerAny' | 'AuthzEntityMembership' | 'AuthzMemberList' | 'AuthzNotReadOnly' | 'AuthzOrgHierarchy' | 'AuthzPeerOwnership' | 'AuthzPublishable' | 'AuthzRelatedEntityMembership' | 'AuthzRelatedMemberList' | 'AuthzRelatedPeerOwnership' | 'AuthzTemporal';
540
694
  /** Privileges this policy applies to (e.g., ["select"], ["insert", "update", "delete"]). */
541
695
  privileges?: string[];
542
696
  /** Whether this policy is permissive (true) or restrictive (false). Defaults to true. */
@@ -660,6 +814,10 @@ export interface BlueprintStorageConfig {
660
814
  default_max_file_size?: number;
661
815
  /** CORS allowed origins for the storage module. */
662
816
  allowed_origins?: string[];
817
+ /** Enable deferred upload confirmation via HeadObject. When true, creates SECURITY DEFINER status transition functions (confirm_uploaded, mark_processed) and an AFTER INSERT trigger that enqueues a storage:confirm_upload job. The job verifies the file exists in S3 before transitioning status from requested to uploaded. Defaults to false. */
818
+ has_confirm_upload?: boolean;
819
+ /** Delay before the first upload confirmation attempt (PostgreSQL interval string, e.g. "30 seconds"). Only used when has_confirm_upload is true. Defaults to "30 seconds". */
820
+ confirm_upload_delay?: string;
663
821
  /** Per-table overrides for storage tables. Each key targets a specific storage table (files, buckets) and uses the same shape as table_provision: { nodes, fields, grants, use_rls, policies }. Fanned out to secure_table_provision targeting the corresponding table. When a key includes policies[], those REPLACE the default storage policies for that table; tables without a key still get defaults. */
664
822
  provisions?: {
665
823
  files?: BlueprintEntityTableProvision;
@@ -714,7 +872,7 @@ export interface BlueprintEntityType {
714
872
  storage?: BlueprintStorageConfig;
715
873
  }
716
874
  /** String shorthand -- just the node type name. */
717
- export type BlueprintNodeShorthand = 'AuthzAllowAll' | 'AuthzAppMembership' | 'AuthzComposite' | 'AuthzDenyAll' | 'AuthzDirectOwner' | 'AuthzDirectOwnerAny' | 'AuthzEntityMembership' | 'AuthzMemberList' | 'AuthzNotReadOnly' | 'AuthzOrgHierarchy' | 'AuthzPeerOwnership' | 'AuthzPublishable' | 'AuthzRelatedEntityMembership' | 'AuthzRelatedMemberList' | 'AuthzRelatedPeerOwnership' | 'AuthzTemporal' | 'DataCompositeField' | 'DataDirectOwner' | 'DataEntityMembership' | 'DataFeatureFlag' | 'DataForceCurrentUser' | 'DataId' | 'DataImageEmbedding' | 'DataImmutableFields' | 'DataInflection' | 'DataInheritFromParent' | 'DataJobTrigger' | 'DataLimitCounter' | 'DataJsonb' | 'DataOwnedFields' | 'DataOwnershipInEntity' | 'DataPeoplestamps' | 'DataPublishable' | 'DataSlug' | 'DataSoftDelete' | 'DataStatusField' | 'DataTags' | 'DataTimestamps' | 'SearchBm25' | 'SearchFullText' | 'SearchSpatial' | 'SearchSpatialAggregate' | 'SearchTrgm' | 'SearchUnified' | 'SearchVector' | 'TableOrganizationSettings' | 'TableUserProfiles' | 'TableUserSettings';
875
+ export type BlueprintNodeShorthand = 'AuthzAllowAll' | 'AuthzAppMembership' | 'AuthzComposite' | 'AuthzDenyAll' | 'AuthzFilePath' | 'AuthzDirectOwner' | 'AuthzDirectOwnerAny' | 'AuthzEntityMembership' | 'AuthzMemberList' | 'AuthzNotReadOnly' | 'AuthzOrgHierarchy' | 'AuthzPeerOwnership' | 'AuthzPublishable' | 'AuthzRelatedEntityMembership' | 'AuthzRelatedMemberList' | 'AuthzRelatedPeerOwnership' | 'AuthzTemporal' | 'CheckGreaterThan' | 'CheckLessThan' | 'CheckNotEqual' | 'CheckOneOf' | 'LimitAggregate' | 'BillingMeter' | 'DataBulk' | 'ProcessChunks' | 'DataCompositeField' | 'DataDirectOwner' | 'DataEntityMembership' | 'ProcessFileEmbedding' | 'LimitFeatureFlag' | 'DataForceCurrentUser' | 'DataId' | 'ProcessImageEmbedding' | 'DataImmutableFields' | 'DataInflection' | 'DataInheritFromParent' | 'JobTrigger' | 'LimitCounter' | 'DataJsonb' | 'DataOwnedFields' | 'ProcessExtraction' | 'ProcessImageVersions' | 'DataOwnershipInEntity' | 'DataPeoplestamps' | 'DataPublishable' | 'DataRealtime' | 'DataSlug' | 'DataSoftDelete' | 'DataStatusField' | 'DataTags' | 'DataTimestamps' | 'SearchBm25' | 'SearchFullText' | 'SearchSpatial' | 'SearchSpatialAggregate' | 'SearchTrgm' | 'SearchUnified' | 'SearchVector' | 'TableOrganizationSettings' | 'TableUserProfiles' | 'TableUserSettings';
718
876
  /** Object form -- { $type, data } with typed parameters. */
719
877
  export type BlueprintNodeObject = {
720
878
  $type: 'AuthzAllowAll';
@@ -728,6 +886,9 @@ export type BlueprintNodeObject = {
728
886
  } | {
729
887
  $type: 'AuthzDenyAll';
730
888
  data?: Record<string, never>;
889
+ } | {
890
+ $type: 'AuthzFilePath';
891
+ data: AuthzFilePathParams;
731
892
  } | {
732
893
  $type: 'AuthzDirectOwner';
733
894
  data: AuthzDirectOwnerParams;
@@ -764,6 +925,30 @@ export type BlueprintNodeObject = {
764
925
  } | {
765
926
  $type: 'AuthzTemporal';
766
927
  data: AuthzTemporalParams;
928
+ } | {
929
+ $type: 'CheckGreaterThan';
930
+ data: CheckGreaterThanParams;
931
+ } | {
932
+ $type: 'CheckLessThan';
933
+ data: CheckLessThanParams;
934
+ } | {
935
+ $type: 'CheckNotEqual';
936
+ data: CheckNotEqualParams;
937
+ } | {
938
+ $type: 'CheckOneOf';
939
+ data: CheckOneOfParams;
940
+ } | {
941
+ $type: 'LimitAggregate';
942
+ data: LimitAggregateParams;
943
+ } | {
944
+ $type: 'BillingMeter';
945
+ data: BillingMeterParams;
946
+ } | {
947
+ $type: 'DataBulk';
948
+ data: DataBulkParams;
949
+ } | {
950
+ $type: 'ProcessChunks';
951
+ data: ProcessChunksParams;
767
952
  } | {
768
953
  $type: 'DataCompositeField';
769
954
  data: DataCompositeFieldParams;
@@ -774,8 +959,11 @@ export type BlueprintNodeObject = {
774
959
  $type: 'DataEntityMembership';
775
960
  data: DataEntityMembershipParams;
776
961
  } | {
777
- $type: 'DataFeatureFlag';
778
- data: DataFeatureFlagParams;
962
+ $type: 'ProcessFileEmbedding';
963
+ data: ProcessFileEmbeddingParams;
964
+ } | {
965
+ $type: 'LimitFeatureFlag';
966
+ data: LimitFeatureFlagParams;
779
967
  } | {
780
968
  $type: 'DataForceCurrentUser';
781
969
  data: DataForceCurrentUserParams;
@@ -783,8 +971,8 @@ export type BlueprintNodeObject = {
783
971
  $type: 'DataId';
784
972
  data: DataIdParams;
785
973
  } | {
786
- $type: 'DataImageEmbedding';
787
- data: DataImageEmbeddingParams;
974
+ $type: 'ProcessImageEmbedding';
975
+ data: ProcessImageEmbeddingParams;
788
976
  } | {
789
977
  $type: 'DataImmutableFields';
790
978
  data: DataImmutableFieldsParams;
@@ -795,17 +983,23 @@ export type BlueprintNodeObject = {
795
983
  $type: 'DataInheritFromParent';
796
984
  data: DataInheritFromParentParams;
797
985
  } | {
798
- $type: 'DataJobTrigger';
799
- data: DataJobTriggerParams;
986
+ $type: 'JobTrigger';
987
+ data: JobTriggerParams;
800
988
  } | {
801
- $type: 'DataLimitCounter';
802
- data: DataLimitCounterParams;
989
+ $type: 'LimitCounter';
990
+ data: LimitCounterParams;
803
991
  } | {
804
992
  $type: 'DataJsonb';
805
993
  data: DataJsonbParams;
806
994
  } | {
807
995
  $type: 'DataOwnedFields';
808
996
  data: DataOwnedFieldsParams;
997
+ } | {
998
+ $type: 'ProcessExtraction';
999
+ data: ProcessExtractionParams;
1000
+ } | {
1001
+ $type: 'ProcessImageVersions';
1002
+ data: ProcessImageVersionsParams;
809
1003
  } | {
810
1004
  $type: 'DataOwnershipInEntity';
811
1005
  data: DataOwnershipInEntityParams;
@@ -815,6 +1009,9 @@ export type BlueprintNodeObject = {
815
1009
  } | {
816
1010
  $type: 'DataPublishable';
817
1011
  data: DataPublishableParams;
1012
+ } | {
1013
+ $type: 'DataRealtime';
1014
+ data: DataRealtimeParams;
818
1015
  } | {
819
1016
  $type: 'DataSlug';
820
1017
  data: DataSlugParams;