node-type-registry 0.18.0 → 0.18.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.
@@ -617,7 +617,7 @@ export interface BlueprintStorageConfig {
617
617
  /** CORS allowed origins for the storage module. */
618
618
  allowed_origins?: string[];
619
619
  }
620
- /** Override object for the entity table created by a BlueprintMembershipType. Shape mirrors BlueprintTable / secure_table_provision vocabulary. When supplied, policies[] replaces the default entity-table policies entirely. */
620
+ /** Override object for the entity table created by a BlueprintEntityType. Shape mirrors BlueprintTable / secure_table_provision vocabulary. When supplied, policies[] replaces the default entity-table policies entirely. */
621
621
  export interface BlueprintEntityTableProvision {
622
622
  /** Whether to enable RLS on the entity table. Forwarded to secure_table_provision. Defaults to true. */
623
623
  use_rls?: boolean;
@@ -633,8 +633,8 @@ export interface BlueprintEntityTableProvision {
633
633
  /** RLS policies for the entity table. When present, these policies fully replace the five default entity-table policies (is_visible becomes a no-op). */
634
634
  policies?: BlueprintPolicy[];
635
635
  }
636
- /** A membership type entry for Phase 0 of construct_blueprint(). Provisions a full entity type with its own entity table, membership modules, and security policies via entity_type_provision. */
637
- export interface BlueprintMembershipType {
636
+ /** An entity type entry for Phase 0 of construct_blueprint(). Provisions a full entity type with its own entity table, membership modules, and security policies via entity_type_provision. */
637
+ export interface BlueprintEntityType {
638
638
  /** Entity type name (e.g., "data_room", "channel", "department"). Must be unique per database. */
639
639
  name: string;
640
640
  /** Short prefix for generated objects (e.g., "dr", "ch", "dept"). Used in table/trigger naming. */
@@ -876,5 +876,7 @@ export interface BlueprintDefinition {
876
876
  /** Unique constraints on table columns. */
877
877
  unique_constraints?: BlueprintUniqueConstraint[];
878
878
  /** Entity types to provision in Phase 0 (before tables). Each entry creates an entity table with membership modules and security. */
879
- membership_types?: BlueprintMembershipType[];
879
+ entity_types?: BlueprintEntityType[];
880
+ /** App-level storage configuration. Creates a storage_module (membership_type = NULL) with the specified policies, seeds initial buckets, and overrides module-level settings (expiry times, file size limits, CORS). For entity-scoped storage, use entity_types[].has_storage + entity_types[].storage instead. */
881
+ storage?: BlueprintStorageConfig;
880
882
  }
@@ -449,10 +449,10 @@ function buildBlueprintEntityTableProvision() {
449
449
  requiredProp('privileges', t.tsArrayType(t.tsUnknownKeyword()))
450
450
  ]))), 'Unified grant objects for the entity table. Each entry is { roles: string[], privileges: unknown[] } where privileges are [verb, columns] tuples. Forwarded to secure_table_provision as-is. Defaults to [].'),
451
451
  addJSDoc(optionalProp('policies', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintPolicy')))), 'RLS policies for the entity table. When present, these policies fully replace the five default entity-table policies (is_visible becomes a no-op).')
452
- ]), 'Override object for the entity table created by a BlueprintMembershipType. Shape mirrors BlueprintTable / secure_table_provision vocabulary. When supplied, policies[] replaces the default entity-table policies entirely.');
452
+ ]), 'Override object for the entity table created by a BlueprintEntityType. Shape mirrors BlueprintTable / secure_table_provision vocabulary. When supplied, policies[] replaces the default entity-table policies entirely.');
453
453
  }
454
- function buildBlueprintMembershipType() {
455
- return addJSDoc(exportInterface('BlueprintMembershipType', [
454
+ function buildBlueprintEntityType() {
455
+ return addJSDoc(exportInterface('BlueprintEntityType', [
456
456
  addJSDoc(requiredProp('name', t.tsStringKeyword()), 'Entity type name (e.g., "data_room", "channel", "department"). Must be unique per database.'),
457
457
  addJSDoc(requiredProp('prefix', t.tsStringKeyword()), 'Short prefix for generated objects (e.g., "dr", "ch", "dept"). Used in table/trigger naming.'),
458
458
  addJSDoc(optionalProp('description', t.tsStringKeyword()), 'Human-readable description of this entity type.'),
@@ -466,7 +466,7 @@ function buildBlueprintMembershipType() {
466
466
  addJSDoc(optionalProp('skip_entity_policies', t.tsBooleanKeyword()), 'Escape hatch: when true AND table_provision is NULL, zero policies are provisioned on the entity table. Defaults to false.'),
467
467
  addJSDoc(optionalProp('table_provision', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision'))), 'Override for the entity table. Shape mirrors BlueprintTable / secure_table_provision vocabulary. When supplied, its policies[] replaces the five default entity-table policies; is_visible becomes a no-op. When NULL (default), the five default policies are applied (gated by is_visible).'),
468
468
  addJSDoc(optionalProp('storage', t.tsTypeReference(t.identifier('BlueprintStorageConfig'))), 'Storage configuration. Only used when has_storage is true. Controls RLS policies on storage tables, seeds initial buckets, and overrides module-level settings (expiry times, file size limits, CORS).')
469
- ]), 'A membership type entry for Phase 0 of construct_blueprint(). Provisions a full entity type with its own entity table, membership modules, and security policies via entity_type_provision.');
469
+ ]), 'An entity type entry for Phase 0 of construct_blueprint(). Provisions a full entity type with its own entity table, membership modules, and security policies via entity_type_provision.');
470
470
  }
471
471
  function buildBlueprintTable() {
472
472
  return addJSDoc(exportInterface('BlueprintTable', [
@@ -492,7 +492,8 @@ function buildBlueprintDefinition() {
492
492
  addJSDoc(optionalProp('indexes', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintIndex')))), 'Indexes on table columns.'),
493
493
  addJSDoc(optionalProp('full_text_searches', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintFullTextSearch')))), 'Full-text search configurations.'),
494
494
  addJSDoc(optionalProp('unique_constraints', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintUniqueConstraint')))), 'Unique constraints on table columns.'),
495
- addJSDoc(optionalProp('membership_types', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintMembershipType')))), 'Entity types to provision in Phase 0 (before tables). Each entry creates an entity table with membership modules and security.')
495
+ addJSDoc(optionalProp('entity_types', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintEntityType')))), 'Entity types to provision in Phase 0 (before tables). Each entry creates an entity table with membership modules and security.'),
496
+ addJSDoc(optionalProp('storage', t.tsTypeReference(t.identifier('BlueprintStorageConfig'))), 'App-level storage configuration. Creates a storage_module (membership_type = NULL) with the specified policies, seeds initial buckets, and overrides module-level settings (expiry times, file size limits, CORS). For entity-scoped storage, use entity_types[].has_storage + entity_types[].storage instead.')
496
497
  ]), 'The complete blueprint definition -- the JSONB shape accepted by construct_blueprint().');
497
498
  }
498
499
  // ---------------------------------------------------------------------------
@@ -550,7 +551,7 @@ function buildProgram(meta) {
550
551
  statements.push(buildBlueprintBucketSeed());
551
552
  statements.push(buildBlueprintStorageConfig());
552
553
  statements.push(buildBlueprintEntityTableProvision());
553
- statements.push(buildBlueprintMembershipType());
554
+ statements.push(buildBlueprintEntityType());
554
555
  // -- Node types discriminated union --
555
556
  statements.push(sectionComment('Node types -- discriminated union for nodes[] entries'));
556
557
  statements.push(...buildNodeTypes(dataNodes));
@@ -617,7 +617,7 @@ export interface BlueprintStorageConfig {
617
617
  /** CORS allowed origins for the storage module. */
618
618
  allowed_origins?: string[];
619
619
  }
620
- /** Override object for the entity table created by a BlueprintMembershipType. Shape mirrors BlueprintTable / secure_table_provision vocabulary. When supplied, policies[] replaces the default entity-table policies entirely. */
620
+ /** Override object for the entity table created by a BlueprintEntityType. Shape mirrors BlueprintTable / secure_table_provision vocabulary. When supplied, policies[] replaces the default entity-table policies entirely. */
621
621
  export interface BlueprintEntityTableProvision {
622
622
  /** Whether to enable RLS on the entity table. Forwarded to secure_table_provision. Defaults to true. */
623
623
  use_rls?: boolean;
@@ -633,8 +633,8 @@ export interface BlueprintEntityTableProvision {
633
633
  /** RLS policies for the entity table. When present, these policies fully replace the five default entity-table policies (is_visible becomes a no-op). */
634
634
  policies?: BlueprintPolicy[];
635
635
  }
636
- /** A membership type entry for Phase 0 of construct_blueprint(). Provisions a full entity type with its own entity table, membership modules, and security policies via entity_type_provision. */
637
- export interface BlueprintMembershipType {
636
+ /** An entity type entry for Phase 0 of construct_blueprint(). Provisions a full entity type with its own entity table, membership modules, and security policies via entity_type_provision. */
637
+ export interface BlueprintEntityType {
638
638
  /** Entity type name (e.g., "data_room", "channel", "department"). Must be unique per database. */
639
639
  name: string;
640
640
  /** Short prefix for generated objects (e.g., "dr", "ch", "dept"). Used in table/trigger naming. */
@@ -876,5 +876,7 @@ export interface BlueprintDefinition {
876
876
  /** Unique constraints on table columns. */
877
877
  unique_constraints?: BlueprintUniqueConstraint[];
878
878
  /** Entity types to provision in Phase 0 (before tables). Each entry creates an entity table with membership modules and security. */
879
- membership_types?: BlueprintMembershipType[];
879
+ entity_types?: BlueprintEntityType[];
880
+ /** App-level storage configuration. Creates a storage_module (membership_type = NULL) with the specified policies, seeds initial buckets, and overrides module-level settings (expiry times, file size limits, CORS). For entity-scoped storage, use entity_types[].has_storage + entity_types[].storage instead. */
881
+ storage?: BlueprintStorageConfig;
880
882
  }
@@ -414,10 +414,10 @@ function buildBlueprintEntityTableProvision() {
414
414
  requiredProp('privileges', t.tsArrayType(t.tsUnknownKeyword()))
415
415
  ]))), 'Unified grant objects for the entity table. Each entry is { roles: string[], privileges: unknown[] } where privileges are [verb, columns] tuples. Forwarded to secure_table_provision as-is. Defaults to [].'),
416
416
  addJSDoc(optionalProp('policies', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintPolicy')))), 'RLS policies for the entity table. When present, these policies fully replace the five default entity-table policies (is_visible becomes a no-op).')
417
- ]), 'Override object for the entity table created by a BlueprintMembershipType. Shape mirrors BlueprintTable / secure_table_provision vocabulary. When supplied, policies[] replaces the default entity-table policies entirely.');
417
+ ]), 'Override object for the entity table created by a BlueprintEntityType. Shape mirrors BlueprintTable / secure_table_provision vocabulary. When supplied, policies[] replaces the default entity-table policies entirely.');
418
418
  }
419
- function buildBlueprintMembershipType() {
420
- return addJSDoc(exportInterface('BlueprintMembershipType', [
419
+ function buildBlueprintEntityType() {
420
+ return addJSDoc(exportInterface('BlueprintEntityType', [
421
421
  addJSDoc(requiredProp('name', t.tsStringKeyword()), 'Entity type name (e.g., "data_room", "channel", "department"). Must be unique per database.'),
422
422
  addJSDoc(requiredProp('prefix', t.tsStringKeyword()), 'Short prefix for generated objects (e.g., "dr", "ch", "dept"). Used in table/trigger naming.'),
423
423
  addJSDoc(optionalProp('description', t.tsStringKeyword()), 'Human-readable description of this entity type.'),
@@ -431,7 +431,7 @@ function buildBlueprintMembershipType() {
431
431
  addJSDoc(optionalProp('skip_entity_policies', t.tsBooleanKeyword()), 'Escape hatch: when true AND table_provision is NULL, zero policies are provisioned on the entity table. Defaults to false.'),
432
432
  addJSDoc(optionalProp('table_provision', t.tsTypeReference(t.identifier('BlueprintEntityTableProvision'))), 'Override for the entity table. Shape mirrors BlueprintTable / secure_table_provision vocabulary. When supplied, its policies[] replaces the five default entity-table policies; is_visible becomes a no-op. When NULL (default), the five default policies are applied (gated by is_visible).'),
433
433
  addJSDoc(optionalProp('storage', t.tsTypeReference(t.identifier('BlueprintStorageConfig'))), 'Storage configuration. Only used when has_storage is true. Controls RLS policies on storage tables, seeds initial buckets, and overrides module-level settings (expiry times, file size limits, CORS).')
434
- ]), 'A membership type entry for Phase 0 of construct_blueprint(). Provisions a full entity type with its own entity table, membership modules, and security policies via entity_type_provision.');
434
+ ]), 'An entity type entry for Phase 0 of construct_blueprint(). Provisions a full entity type with its own entity table, membership modules, and security policies via entity_type_provision.');
435
435
  }
436
436
  function buildBlueprintTable() {
437
437
  return addJSDoc(exportInterface('BlueprintTable', [
@@ -457,7 +457,8 @@ function buildBlueprintDefinition() {
457
457
  addJSDoc(optionalProp('indexes', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintIndex')))), 'Indexes on table columns.'),
458
458
  addJSDoc(optionalProp('full_text_searches', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintFullTextSearch')))), 'Full-text search configurations.'),
459
459
  addJSDoc(optionalProp('unique_constraints', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintUniqueConstraint')))), 'Unique constraints on table columns.'),
460
- addJSDoc(optionalProp('membership_types', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintMembershipType')))), 'Entity types to provision in Phase 0 (before tables). Each entry creates an entity table with membership modules and security.')
460
+ addJSDoc(optionalProp('entity_types', t.tsArrayType(t.tsTypeReference(t.identifier('BlueprintEntityType')))), 'Entity types to provision in Phase 0 (before tables). Each entry creates an entity table with membership modules and security.'),
461
+ addJSDoc(optionalProp('storage', t.tsTypeReference(t.identifier('BlueprintStorageConfig'))), 'App-level storage configuration. Creates a storage_module (membership_type = NULL) with the specified policies, seeds initial buckets, and overrides module-level settings (expiry times, file size limits, CORS). For entity-scoped storage, use entity_types[].has_storage + entity_types[].storage instead.')
461
462
  ]), 'The complete blueprint definition -- the JSONB shape accepted by construct_blueprint().');
462
463
  }
463
464
  // ---------------------------------------------------------------------------
@@ -515,7 +516,7 @@ function buildProgram(meta) {
515
516
  statements.push(buildBlueprintBucketSeed());
516
517
  statements.push(buildBlueprintStorageConfig());
517
518
  statements.push(buildBlueprintEntityTableProvision());
518
- statements.push(buildBlueprintMembershipType());
519
+ statements.push(buildBlueprintEntityType());
519
520
  // -- Node types discriminated union --
520
521
  statements.push(sectionComment('Node types -- discriminated union for nodes[] entries'));
521
522
  statements.push(...buildNodeTypes(dataNodes));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-type-registry",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
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": "058b8200e99eb505477d1599ee0d5ab795aa0123"
50
+ "gitHead": "af20c62a061cf31c85e9929d1728767d7f69bdfc"
51
51
  }