@constructive-io/react 0.14.0 → 0.14.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.
@@ -130,9 +130,9 @@ export type BlueprintOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC
130
130
  /** Methods to use when ordering `BlueprintConstruction`. */
131
131
  export type BlueprintConstructionOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'BLUEPRINT_ID_ASC' | 'BLUEPRINT_ID_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'SCHEMA_ID_ASC' | 'SCHEMA_ID_DESC' | 'STATUS_ASC' | 'STATUS_DESC' | 'ERROR_DETAILS_ASC' | 'ERROR_DETAILS_DESC' | 'TABLE_MAP_ASC' | 'TABLE_MAP_DESC' | 'CONSTRUCTED_DEFINITION_ASC' | 'CONSTRUCTED_DEFINITION_DESC' | 'CONSTRUCTED_AT_ASC' | 'CONSTRUCTED_AT_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_DESC';
132
132
  /** Methods to use when ordering `StorageModule`. */
133
- export type StorageModuleOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'SCHEMA_ID_ASC' | 'SCHEMA_ID_DESC' | 'PRIVATE_SCHEMA_ID_ASC' | 'PRIVATE_SCHEMA_ID_DESC' | 'BUCKETS_TABLE_ID_ASC' | 'BUCKETS_TABLE_ID_DESC' | 'FILES_TABLE_ID_ASC' | 'FILES_TABLE_ID_DESC' | 'UPLOAD_REQUESTS_TABLE_ID_ASC' | 'UPLOAD_REQUESTS_TABLE_ID_DESC' | 'BUCKETS_TABLE_NAME_ASC' | 'BUCKETS_TABLE_NAME_DESC' | 'FILES_TABLE_NAME_ASC' | 'FILES_TABLE_NAME_DESC' | 'UPLOAD_REQUESTS_TABLE_NAME_ASC' | 'UPLOAD_REQUESTS_TABLE_NAME_DESC' | 'MEMBERSHIP_TYPE_ASC' | 'MEMBERSHIP_TYPE_DESC' | 'POLICIES_ASC' | 'POLICIES_DESC' | 'ENTITY_TABLE_ID_ASC' | 'ENTITY_TABLE_ID_DESC' | 'ENDPOINT_ASC' | 'ENDPOINT_DESC' | 'PUBLIC_URL_PREFIX_ASC' | 'PUBLIC_URL_PREFIX_DESC' | 'PROVIDER_ASC' | 'PROVIDER_DESC' | 'ALLOWED_ORIGINS_ASC' | 'ALLOWED_ORIGINS_DESC' | 'UPLOAD_URL_EXPIRY_SECONDS_ASC' | 'UPLOAD_URL_EXPIRY_SECONDS_DESC' | 'DOWNLOAD_URL_EXPIRY_SECONDS_ASC' | 'DOWNLOAD_URL_EXPIRY_SECONDS_DESC' | 'DEFAULT_MAX_FILE_SIZE_ASC' | 'DEFAULT_MAX_FILE_SIZE_DESC' | 'MAX_FILENAME_LENGTH_ASC' | 'MAX_FILENAME_LENGTH_DESC' | 'CACHE_TTL_SECONDS_ASC' | 'CACHE_TTL_SECONDS_DESC';
133
+ export type StorageModuleOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'SCHEMA_ID_ASC' | 'SCHEMA_ID_DESC' | 'PRIVATE_SCHEMA_ID_ASC' | 'PRIVATE_SCHEMA_ID_DESC' | 'BUCKETS_TABLE_ID_ASC' | 'BUCKETS_TABLE_ID_DESC' | 'FILES_TABLE_ID_ASC' | 'FILES_TABLE_ID_DESC' | 'UPLOAD_REQUESTS_TABLE_ID_ASC' | 'UPLOAD_REQUESTS_TABLE_ID_DESC' | 'BUCKETS_TABLE_NAME_ASC' | 'BUCKETS_TABLE_NAME_DESC' | 'FILES_TABLE_NAME_ASC' | 'FILES_TABLE_NAME_DESC' | 'UPLOAD_REQUESTS_TABLE_NAME_ASC' | 'UPLOAD_REQUESTS_TABLE_NAME_DESC' | 'MEMBERSHIP_TYPE_ASC' | 'MEMBERSHIP_TYPE_DESC' | 'POLICIES_ASC' | 'POLICIES_DESC' | 'SKIP_DEFAULT_POLICY_TABLES_ASC' | 'SKIP_DEFAULT_POLICY_TABLES_DESC' | 'ENTITY_TABLE_ID_ASC' | 'ENTITY_TABLE_ID_DESC' | 'ENDPOINT_ASC' | 'ENDPOINT_DESC' | 'PUBLIC_URL_PREFIX_ASC' | 'PUBLIC_URL_PREFIX_DESC' | 'PROVIDER_ASC' | 'PROVIDER_DESC' | 'ALLOWED_ORIGINS_ASC' | 'ALLOWED_ORIGINS_DESC' | 'UPLOAD_URL_EXPIRY_SECONDS_ASC' | 'UPLOAD_URL_EXPIRY_SECONDS_DESC' | 'DOWNLOAD_URL_EXPIRY_SECONDS_ASC' | 'DOWNLOAD_URL_EXPIRY_SECONDS_DESC' | 'DEFAULT_MAX_FILE_SIZE_ASC' | 'DEFAULT_MAX_FILE_SIZE_DESC' | 'MAX_FILENAME_LENGTH_ASC' | 'MAX_FILENAME_LENGTH_DESC' | 'CACHE_TTL_SECONDS_ASC' | 'CACHE_TTL_SECONDS_DESC';
134
134
  /** Methods to use when ordering `EntityTypeProvision`. */
135
- export type EntityTypeProvisionOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'NAME_ASC' | 'NAME_DESC' | 'PREFIX_ASC' | 'PREFIX_DESC' | 'DESCRIPTION_ASC' | 'DESCRIPTION_DESC' | 'PARENT_ENTITY_ASC' | 'PARENT_ENTITY_DESC' | 'TABLE_NAME_ASC' | 'TABLE_NAME_DESC' | 'IS_VISIBLE_ASC' | 'IS_VISIBLE_DESC' | 'HAS_LIMITS_ASC' | 'HAS_LIMITS_DESC' | 'HAS_PROFILES_ASC' | 'HAS_PROFILES_DESC' | 'HAS_LEVELS_ASC' | 'HAS_LEVELS_DESC' | 'HAS_STORAGE_ASC' | 'HAS_STORAGE_DESC' | 'STORAGE_CONFIG_ASC' | 'STORAGE_CONFIG_DESC' | 'SKIP_ENTITY_POLICIES_ASC' | 'SKIP_ENTITY_POLICIES_DESC' | 'TABLE_PROVISION_ASC' | 'TABLE_PROVISION_DESC' | 'OUT_MEMBERSHIP_TYPE_ASC' | 'OUT_MEMBERSHIP_TYPE_DESC' | 'OUT_ENTITY_TABLE_ID_ASC' | 'OUT_ENTITY_TABLE_ID_DESC' | 'OUT_ENTITY_TABLE_NAME_ASC' | 'OUT_ENTITY_TABLE_NAME_DESC' | 'OUT_INSTALLED_MODULES_ASC' | 'OUT_INSTALLED_MODULES_DESC' | 'OUT_STORAGE_MODULE_ID_ASC' | 'OUT_STORAGE_MODULE_ID_DESC' | 'OUT_BUCKETS_TABLE_ID_ASC' | 'OUT_BUCKETS_TABLE_ID_DESC' | 'OUT_FILES_TABLE_ID_ASC' | 'OUT_FILES_TABLE_ID_DESC';
135
+ export type EntityTypeProvisionOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'NAME_ASC' | 'NAME_DESC' | 'PREFIX_ASC' | 'PREFIX_DESC' | 'DESCRIPTION_ASC' | 'DESCRIPTION_DESC' | 'PARENT_ENTITY_ASC' | 'PARENT_ENTITY_DESC' | 'TABLE_NAME_ASC' | 'TABLE_NAME_DESC' | 'IS_VISIBLE_ASC' | 'IS_VISIBLE_DESC' | 'HAS_LIMITS_ASC' | 'HAS_LIMITS_DESC' | 'HAS_PROFILES_ASC' | 'HAS_PROFILES_DESC' | 'HAS_LEVELS_ASC' | 'HAS_LEVELS_DESC' | 'HAS_STORAGE_ASC' | 'HAS_STORAGE_DESC' | 'HAS_INVITES_ASC' | 'HAS_INVITES_DESC' | 'STORAGE_CONFIG_ASC' | 'STORAGE_CONFIG_DESC' | 'SKIP_ENTITY_POLICIES_ASC' | 'SKIP_ENTITY_POLICIES_DESC' | 'TABLE_PROVISION_ASC' | 'TABLE_PROVISION_DESC' | 'OUT_MEMBERSHIP_TYPE_ASC' | 'OUT_MEMBERSHIP_TYPE_DESC' | 'OUT_ENTITY_TABLE_ID_ASC' | 'OUT_ENTITY_TABLE_ID_DESC' | 'OUT_ENTITY_TABLE_NAME_ASC' | 'OUT_ENTITY_TABLE_NAME_DESC' | 'OUT_INSTALLED_MODULES_ASC' | 'OUT_INSTALLED_MODULES_DESC' | 'OUT_STORAGE_MODULE_ID_ASC' | 'OUT_STORAGE_MODULE_ID_DESC' | 'OUT_BUCKETS_TABLE_ID_ASC' | 'OUT_BUCKETS_TABLE_ID_DESC' | 'OUT_FILES_TABLE_ID_ASC' | 'OUT_FILES_TABLE_ID_DESC' | 'OUT_INVITES_MODULE_ID_ASC' | 'OUT_INVITES_MODULE_ID_DESC';
136
136
  /** Methods to use when ordering `WebauthnCredentialsModule`. */
137
137
  export type WebauthnCredentialsModuleOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ID_ASC' | 'ID_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'SCHEMA_ID_ASC' | 'SCHEMA_ID_DESC' | 'PRIVATE_SCHEMA_ID_ASC' | 'PRIVATE_SCHEMA_ID_DESC' | 'TABLE_ID_ASC' | 'TABLE_ID_DESC' | 'OWNER_TABLE_ID_ASC' | 'OWNER_TABLE_ID_DESC' | 'TABLE_NAME_ASC' | 'TABLE_NAME_DESC';
138
138
  /** Methods to use when ordering `WebauthnAuthModule`. */
@@ -6070,7 +6070,9 @@ export interface StorageModuleFilter {
6070
6070
  /** Filter by the object’s `membershipType` field. */
6071
6071
  membershipType?: IntFilter;
6072
6072
  /** Filter by the object’s `policies` field. */
6073
- policies?: StringListFilter;
6073
+ policies?: JSONFilter;
6074
+ /** Filter by the object’s `skipDefaultPolicyTables` field. */
6075
+ skipDefaultPolicyTables?: StringListFilter;
6074
6076
  /** Filter by the object’s `entityTableId` field. */
6075
6077
  entityTableId?: UUIDFilter;
6076
6078
  /** Filter by the object’s `endpoint` field. */
@@ -6149,6 +6151,8 @@ export interface EntityTypeProvisionFilter {
6149
6151
  hasLevels?: BooleanFilter;
6150
6152
  /** Filter by the object’s `hasStorage` field. */
6151
6153
  hasStorage?: BooleanFilter;
6154
+ /** Filter by the object’s `hasInvites` field. */
6155
+ hasInvites?: BooleanFilter;
6152
6156
  /** Filter by the object’s `storageConfig` field. */
6153
6157
  storageConfig?: JSONFilter;
6154
6158
  /** Filter by the object’s `skipEntityPolicies` field. */
@@ -6169,6 +6173,8 @@ export interface EntityTypeProvisionFilter {
6169
6173
  outBucketsTableId?: UUIDFilter;
6170
6174
  /** Filter by the object’s `outFilesTableId` field. */
6171
6175
  outFilesTableId?: UUIDFilter;
6176
+ /** Filter by the object’s `outInvitesModuleId` field. */
6177
+ outInvitesModuleId?: UUIDFilter;
6172
6178
  /** Checks for all expressions in this list. */
6173
6179
  and?: EntityTypeProvisionFilter[];
6174
6180
  /** Checks for any expressions in this list. */
@@ -7201,6 +7207,7 @@ export interface ProvisionTableInput {
7201
7207
  indexes?: unknown;
7202
7208
  fullTextSearches?: unknown;
7203
7209
  uniqueConstraints?: unknown;
7210
+ description?: string;
7204
7211
  }
7205
7212
  export interface SendVerificationEmailInput {
7206
7213
  clientMutationId?: string;
@@ -9390,6 +9397,64 @@ export interface ForeignKeyConstraintInput {
9390
9397
  createdAt?: string;
9391
9398
  updatedAt?: string;
9392
9399
  }
9400
+ export interface CreateTableInput {
9401
+ clientMutationId?: string;
9402
+ /** The `Table` to be created by this mutation. */
9403
+ table: TableInput;
9404
+ }
9405
+ /** An input for mutations affecting `Table` */
9406
+ export interface TableInput {
9407
+ id?: string;
9408
+ databaseId?: string;
9409
+ schemaId: string;
9410
+ name: string;
9411
+ label?: string;
9412
+ description?: string;
9413
+ smartTags?: unknown;
9414
+ category?: ObjectCategory;
9415
+ module?: string;
9416
+ scope?: number;
9417
+ useRls?: boolean;
9418
+ timestamps?: boolean;
9419
+ peoplestamps?: boolean;
9420
+ pluralName?: string;
9421
+ singularName?: string;
9422
+ tags?: string[];
9423
+ inheritsId?: string;
9424
+ createdAt?: string;
9425
+ updatedAt?: string;
9426
+ }
9427
+ export interface CreateStorageModuleInput {
9428
+ clientMutationId?: string;
9429
+ /** The `StorageModule` to be created by this mutation. */
9430
+ storageModule: StorageModuleInput;
9431
+ }
9432
+ /** An input for mutations affecting `StorageModule` */
9433
+ export interface StorageModuleInput {
9434
+ id?: string;
9435
+ databaseId: string;
9436
+ schemaId?: string;
9437
+ privateSchemaId?: string;
9438
+ bucketsTableId?: string;
9439
+ filesTableId?: string;
9440
+ uploadRequestsTableId?: string;
9441
+ bucketsTableName?: string;
9442
+ filesTableName?: string;
9443
+ uploadRequestsTableName?: string;
9444
+ membershipType?: number;
9445
+ policies?: unknown;
9446
+ skipDefaultPolicyTables?: string[];
9447
+ entityTableId?: string;
9448
+ endpoint?: string;
9449
+ publicUrlPrefix?: string;
9450
+ provider?: string;
9451
+ allowedOrigins?: string[];
9452
+ uploadUrlExpirySeconds?: number;
9453
+ downloadUrlExpirySeconds?: number;
9454
+ defaultMaxFileSize?: string;
9455
+ maxFilenameLength?: number;
9456
+ cacheTtlSeconds?: number;
9457
+ }
9393
9458
  export interface CreateEntityTypeProvisionInput {
9394
9459
  clientMutationId?: string;
9395
9460
  /** The `EntityTypeProvision` to be created by this mutation. */
@@ -9402,8 +9467,8 @@ export interface EntityTypeProvisionInput {
9402
9467
  /** The database to provision this entity type in. Required. */
9403
9468
  databaseId: string;
9404
9469
  /**
9405
- * Human-readable name for this membership type, e.g. 'Data Room Member', 'Team Channel Member'. Required.
9406
- * Stored in the membership_types registry table.
9470
+ * Human-readable name for this entity type, e.g. 'Data Room', 'Team Channel'. Required.
9471
+ * Stored in the entity_types registry table.
9407
9472
  */
9408
9473
  name: string;
9409
9474
  /**
@@ -9413,7 +9478,7 @@ export interface EntityTypeProvisionInput {
9413
9478
  * Must be unique per database — the (database_id, prefix) constraint ensures graceful ON CONFLICT DO NOTHING.
9414
9479
  */
9415
9480
  prefix: string;
9416
- /** Description of this membership type. Stored in the membership_types registry table. Defaults to empty string. */
9481
+ /** Description of this entity type. Stored in the entity_types registry table. Defaults to empty string. */
9417
9482
  description?: string;
9418
9483
  /**
9419
9484
  * Prefix of the parent entity type. The trigger resolves this to a membership_type integer
@@ -9464,6 +9529,16 @@ export interface EntityTypeProvisionInput {
9464
9529
  * Storage tables get owner_id FK to the entity table, so files are owned by the entity.
9465
9530
  */
9466
9531
  hasStorage?: boolean;
9532
+ /**
9533
+ * Whether to provision invites_module for this type. Defaults to false.
9534
+ * When true, the trigger inserts a row into invites_module which in turn
9535
+ * (via insert_invites_module BEFORE INSERT) creates {prefix}_invites and
9536
+ * {prefix}_claimed_invites tables plus the submit_{prefix}_invite_code() function.
9537
+ * Symmetric counterpart of has_storage. Re-provisioning is idempotent: the
9538
+ * UNIQUE (database_id, membership_type) constraint on invites_module combined with
9539
+ * ON CONFLICT DO NOTHING in the fan-out makes repeated INSERTs safe.
9540
+ */
9541
+ hasInvites?: boolean;
9467
9542
  /**
9468
9543
  * Optional jsonb object for storage module configuration and initial bucket seeding.
9469
9544
  * Only used when has_storage = true; ignored otherwise. NULL = use defaults.
@@ -9480,8 +9555,21 @@ export interface EntityTypeProvisionInput {
9480
9555
  * - allowed_mime_types (text[]) whitelist of MIME types (null = any)
9481
9556
  * - max_file_size (bigint) max file size in bytes (null = use scope default)
9482
9557
  * - allowed_origins (text[]) per-bucket CORS override
9558
+ * - provisions (jsonb object) optional: customize storage tables
9559
+ * with additional nodes, fields, grants, and policies.
9560
+ * Keyed by table role: "files", "buckets", "upload_requests".
9561
+ * Each value uses the same shape as table_provision:
9562
+ * { nodes, fields, grants, use_rls, policies }. Fanned out
9563
+ * to secure_table_provision targeting the corresponding table.
9564
+ * When a key includes policies[], those REPLACE the default
9565
+ * storage policies for that table; tables without a key still
9566
+ * get defaults. Missing "data" on policy entries is auto-populated
9567
+ * with storage-specific defaults (same as table_provision).
9568
+ * Example: add SearchBm25 for full-text search on files:
9569
+ * {"provisions": {"files": {"nodes": [{"$type":
9570
+ * "SearchBm25", "data": {"source_fields": ["description"]}}]}}}
9483
9571
  * Example:
9484
- * storage_config := '{"buckets": [{"name": "documents", "is_public": false, "allowed_mime_types": ["application/pdf"]}]}'::jsonb
9572
+ * storage_config := '{"buckets": [{"name": "documents", "is_public": false, "allowed_mime_types": ["application/pdf"]}], "provisions": {"files": {"nodes": [{"$type": "SearchBm25", "data": {"source_fields": ["description"]}}]}}}'::jsonb
9485
9573
  */
9486
9574
  storageConfig?: unknown;
9487
9575
  /**
@@ -9532,7 +9620,7 @@ export interface EntityTypeProvisionInput {
9532
9620
  tableProvision?: unknown;
9533
9621
  /**
9534
9622
  * Output: the auto-assigned integer membership type ID. Populated by the trigger after successful provisioning.
9535
- * This is the ID used in membership_types, memberships_module, and all module tables.
9623
+ * This is the ID used in entity_types, memberships_module, and all module tables.
9536
9624
  */
9537
9625
  outMembershipType?: number;
9538
9626
  /**
@@ -9553,63 +9641,12 @@ export interface EntityTypeProvisionInput {
9553
9641
  outBucketsTableId?: string;
9554
9642
  /** Output: the UUID of the generated files table (e.g. data_room_files). Populated by the trigger when has_storage=true. */
9555
9643
  outFilesTableId?: string;
9556
- }
9557
- export interface CreateStorageModuleInput {
9558
- clientMutationId?: string;
9559
- /** The `StorageModule` to be created by this mutation. */
9560
- storageModule: StorageModuleInput;
9561
- }
9562
- /** An input for mutations affecting `StorageModule` */
9563
- export interface StorageModuleInput {
9564
- id?: string;
9565
- databaseId: string;
9566
- schemaId?: string;
9567
- privateSchemaId?: string;
9568
- bucketsTableId?: string;
9569
- filesTableId?: string;
9570
- uploadRequestsTableId?: string;
9571
- bucketsTableName?: string;
9572
- filesTableName?: string;
9573
- uploadRequestsTableName?: string;
9574
- membershipType?: number;
9575
- policies?: string[];
9576
- entityTableId?: string;
9577
- endpoint?: string;
9578
- publicUrlPrefix?: string;
9579
- provider?: string;
9580
- allowedOrigins?: string[];
9581
- uploadUrlExpirySeconds?: number;
9582
- downloadUrlExpirySeconds?: number;
9583
- defaultMaxFileSize?: string;
9584
- maxFilenameLength?: number;
9585
- cacheTtlSeconds?: number;
9586
- }
9587
- export interface CreateTableInput {
9588
- clientMutationId?: string;
9589
- /** The `Table` to be created by this mutation. */
9590
- table: TableInput;
9591
- }
9592
- /** An input for mutations affecting `Table` */
9593
- export interface TableInput {
9594
- id?: string;
9595
- databaseId?: string;
9596
- schemaId: string;
9597
- name: string;
9598
- label?: string;
9599
- description?: string;
9600
- smartTags?: unknown;
9601
- category?: ObjectCategory;
9602
- module?: string;
9603
- scope?: number;
9604
- useRls?: boolean;
9605
- timestamps?: boolean;
9606
- peoplestamps?: boolean;
9607
- pluralName?: string;
9608
- singularName?: string;
9609
- tags?: string[];
9610
- inheritsId?: string;
9611
- createdAt?: string;
9612
- updatedAt?: string;
9644
+ /**
9645
+ * Output: the UUID of the invites_module row created for this entity type. Populated by the trigger when has_invites=true.
9646
+ * NULL when has_invites=false, or when re-provisioning hits ON CONFLICT DO NOTHING
9647
+ * (i.e. the invites_module row was created in a previous run).
9648
+ */
9649
+ outInvitesModuleId?: string;
9613
9650
  }
9614
9651
  export interface CreateRelationProvisionInput {
9615
9652
  clientMutationId?: string;
@@ -12123,6 +12160,66 @@ export interface ForeignKeyConstraintPatch {
12123
12160
  createdAt?: string;
12124
12161
  updatedAt?: string;
12125
12162
  }
12163
+ export interface UpdateTableInput {
12164
+ clientMutationId?: string;
12165
+ id: string;
12166
+ /** An object where the defined keys will be set on the `Table` being updated. */
12167
+ tablePatch: TablePatch;
12168
+ }
12169
+ /** Represents an update to a `Table`. Fields that are set will be updated. */
12170
+ export interface TablePatch {
12171
+ id?: string;
12172
+ databaseId?: string;
12173
+ schemaId?: string;
12174
+ name?: string;
12175
+ label?: string;
12176
+ description?: string;
12177
+ smartTags?: unknown;
12178
+ category?: ObjectCategory;
12179
+ module?: string;
12180
+ scope?: number;
12181
+ useRls?: boolean;
12182
+ timestamps?: boolean;
12183
+ peoplestamps?: boolean;
12184
+ pluralName?: string;
12185
+ singularName?: string;
12186
+ tags?: string[];
12187
+ inheritsId?: string;
12188
+ createdAt?: string;
12189
+ updatedAt?: string;
12190
+ }
12191
+ export interface UpdateStorageModuleInput {
12192
+ clientMutationId?: string;
12193
+ id: string;
12194
+ /** An object where the defined keys will be set on the `StorageModule` being updated. */
12195
+ storageModulePatch: StorageModulePatch;
12196
+ }
12197
+ /** Represents an update to a `StorageModule`. Fields that are set will be updated. */
12198
+ export interface StorageModulePatch {
12199
+ id?: string;
12200
+ databaseId?: string;
12201
+ schemaId?: string;
12202
+ privateSchemaId?: string;
12203
+ bucketsTableId?: string;
12204
+ filesTableId?: string;
12205
+ uploadRequestsTableId?: string;
12206
+ bucketsTableName?: string;
12207
+ filesTableName?: string;
12208
+ uploadRequestsTableName?: string;
12209
+ membershipType?: number;
12210
+ policies?: unknown;
12211
+ skipDefaultPolicyTables?: string[];
12212
+ entityTableId?: string;
12213
+ endpoint?: string;
12214
+ publicUrlPrefix?: string;
12215
+ provider?: string;
12216
+ allowedOrigins?: string[];
12217
+ uploadUrlExpirySeconds?: number;
12218
+ downloadUrlExpirySeconds?: number;
12219
+ defaultMaxFileSize?: string;
12220
+ maxFilenameLength?: number;
12221
+ cacheTtlSeconds?: number;
12222
+ }
12126
12223
  export interface UpdateEntityTypeProvisionInput {
12127
12224
  clientMutationId?: string;
12128
12225
  /** Unique identifier for this provision row. */
@@ -12137,8 +12234,8 @@ export interface EntityTypeProvisionPatch {
12137
12234
  /** The database to provision this entity type in. Required. */
12138
12235
  databaseId?: string;
12139
12236
  /**
12140
- * Human-readable name for this membership type, e.g. 'Data Room Member', 'Team Channel Member'. Required.
12141
- * Stored in the membership_types registry table.
12237
+ * Human-readable name for this entity type, e.g. 'Data Room', 'Team Channel'. Required.
12238
+ * Stored in the entity_types registry table.
12142
12239
  */
12143
12240
  name?: string;
12144
12241
  /**
@@ -12148,7 +12245,7 @@ export interface EntityTypeProvisionPatch {
12148
12245
  * Must be unique per database — the (database_id, prefix) constraint ensures graceful ON CONFLICT DO NOTHING.
12149
12246
  */
12150
12247
  prefix?: string;
12151
- /** Description of this membership type. Stored in the membership_types registry table. Defaults to empty string. */
12248
+ /** Description of this entity type. Stored in the entity_types registry table. Defaults to empty string. */
12152
12249
  description?: string;
12153
12250
  /**
12154
12251
  * Prefix of the parent entity type. The trigger resolves this to a membership_type integer
@@ -12199,6 +12296,16 @@ export interface EntityTypeProvisionPatch {
12199
12296
  * Storage tables get owner_id FK to the entity table, so files are owned by the entity.
12200
12297
  */
12201
12298
  hasStorage?: boolean;
12299
+ /**
12300
+ * Whether to provision invites_module for this type. Defaults to false.
12301
+ * When true, the trigger inserts a row into invites_module which in turn
12302
+ * (via insert_invites_module BEFORE INSERT) creates {prefix}_invites and
12303
+ * {prefix}_claimed_invites tables plus the submit_{prefix}_invite_code() function.
12304
+ * Symmetric counterpart of has_storage. Re-provisioning is idempotent: the
12305
+ * UNIQUE (database_id, membership_type) constraint on invites_module combined with
12306
+ * ON CONFLICT DO NOTHING in the fan-out makes repeated INSERTs safe.
12307
+ */
12308
+ hasInvites?: boolean;
12202
12309
  /**
12203
12310
  * Optional jsonb object for storage module configuration and initial bucket seeding.
12204
12311
  * Only used when has_storage = true; ignored otherwise. NULL = use defaults.
@@ -12215,8 +12322,21 @@ export interface EntityTypeProvisionPatch {
12215
12322
  * - allowed_mime_types (text[]) whitelist of MIME types (null = any)
12216
12323
  * - max_file_size (bigint) max file size in bytes (null = use scope default)
12217
12324
  * - allowed_origins (text[]) per-bucket CORS override
12325
+ * - provisions (jsonb object) optional: customize storage tables
12326
+ * with additional nodes, fields, grants, and policies.
12327
+ * Keyed by table role: "files", "buckets", "upload_requests".
12328
+ * Each value uses the same shape as table_provision:
12329
+ * { nodes, fields, grants, use_rls, policies }. Fanned out
12330
+ * to secure_table_provision targeting the corresponding table.
12331
+ * When a key includes policies[], those REPLACE the default
12332
+ * storage policies for that table; tables without a key still
12333
+ * get defaults. Missing "data" on policy entries is auto-populated
12334
+ * with storage-specific defaults (same as table_provision).
12335
+ * Example: add SearchBm25 for full-text search on files:
12336
+ * {"provisions": {"files": {"nodes": [{"$type":
12337
+ * "SearchBm25", "data": {"source_fields": ["description"]}}]}}}
12218
12338
  * Example:
12219
- * storage_config := '{"buckets": [{"name": "documents", "is_public": false, "allowed_mime_types": ["application/pdf"]}]}'::jsonb
12339
+ * storage_config := '{"buckets": [{"name": "documents", "is_public": false, "allowed_mime_types": ["application/pdf"]}], "provisions": {"files": {"nodes": [{"$type": "SearchBm25", "data": {"source_fields": ["description"]}}]}}}'::jsonb
12220
12340
  */
12221
12341
  storageConfig?: unknown;
12222
12342
  /**
@@ -12267,7 +12387,7 @@ export interface EntityTypeProvisionPatch {
12267
12387
  tableProvision?: unknown;
12268
12388
  /**
12269
12389
  * Output: the auto-assigned integer membership type ID. Populated by the trigger after successful provisioning.
12270
- * This is the ID used in membership_types, memberships_module, and all module tables.
12390
+ * This is the ID used in entity_types, memberships_module, and all module tables.
12271
12391
  */
12272
12392
  outMembershipType?: number;
12273
12393
  /**
@@ -12288,65 +12408,12 @@ export interface EntityTypeProvisionPatch {
12288
12408
  outBucketsTableId?: string;
12289
12409
  /** Output: the UUID of the generated files table (e.g. data_room_files). Populated by the trigger when has_storage=true. */
12290
12410
  outFilesTableId?: string;
12291
- }
12292
- export interface UpdateStorageModuleInput {
12293
- clientMutationId?: string;
12294
- id: string;
12295
- /** An object where the defined keys will be set on the `StorageModule` being updated. */
12296
- storageModulePatch: StorageModulePatch;
12297
- }
12298
- /** Represents an update to a `StorageModule`. Fields that are set will be updated. */
12299
- export interface StorageModulePatch {
12300
- id?: string;
12301
- databaseId?: string;
12302
- schemaId?: string;
12303
- privateSchemaId?: string;
12304
- bucketsTableId?: string;
12305
- filesTableId?: string;
12306
- uploadRequestsTableId?: string;
12307
- bucketsTableName?: string;
12308
- filesTableName?: string;
12309
- uploadRequestsTableName?: string;
12310
- membershipType?: number;
12311
- policies?: string[];
12312
- entityTableId?: string;
12313
- endpoint?: string;
12314
- publicUrlPrefix?: string;
12315
- provider?: string;
12316
- allowedOrigins?: string[];
12317
- uploadUrlExpirySeconds?: number;
12318
- downloadUrlExpirySeconds?: number;
12319
- defaultMaxFileSize?: string;
12320
- maxFilenameLength?: number;
12321
- cacheTtlSeconds?: number;
12322
- }
12323
- export interface UpdateTableInput {
12324
- clientMutationId?: string;
12325
- id: string;
12326
- /** An object where the defined keys will be set on the `Table` being updated. */
12327
- tablePatch: TablePatch;
12328
- }
12329
- /** Represents an update to a `Table`. Fields that are set will be updated. */
12330
- export interface TablePatch {
12331
- id?: string;
12332
- databaseId?: string;
12333
- schemaId?: string;
12334
- name?: string;
12335
- label?: string;
12336
- description?: string;
12337
- smartTags?: unknown;
12338
- category?: ObjectCategory;
12339
- module?: string;
12340
- scope?: number;
12341
- useRls?: boolean;
12342
- timestamps?: boolean;
12343
- peoplestamps?: boolean;
12344
- pluralName?: string;
12345
- singularName?: string;
12346
- tags?: string[];
12347
- inheritsId?: string;
12348
- createdAt?: string;
12349
- updatedAt?: string;
12411
+ /**
12412
+ * Output: the UUID of the invites_module row created for this entity type. Populated by the trigger when has_invites=true.
12413
+ * NULL when has_invites=false, or when re-provisioning hits ON CONFLICT DO NOTHING
12414
+ * (i.e. the invites_module row was created in a previous run).
12415
+ */
12416
+ outInvitesModuleId?: string;
12350
12417
  }
12351
12418
  export interface UpdateRelationProvisionInput {
12352
12419
  clientMutationId?: string;
@@ -13062,17 +13129,17 @@ export interface DeleteForeignKeyConstraintInput {
13062
13129
  clientMutationId?: string;
13063
13130
  id: string;
13064
13131
  }
13065
- export interface DeleteEntityTypeProvisionInput {
13132
+ export interface DeleteTableInput {
13066
13133
  clientMutationId?: string;
13067
- /** Unique identifier for this provision row. */
13068
13134
  id: string;
13069
13135
  }
13070
13136
  export interface DeleteStorageModuleInput {
13071
13137
  clientMutationId?: string;
13072
13138
  id: string;
13073
13139
  }
13074
- export interface DeleteTableInput {
13140
+ export interface DeleteEntityTypeProvisionInput {
13075
13141
  clientMutationId?: string;
13142
+ /** Unique identifier for this provision row. */
13076
13143
  id: string;
13077
13144
  }
13078
13145
  export interface DeleteRelationProvisionInput {
@@ -13912,10 +13979,10 @@ export interface ForeignKeyConstraintConnection {
13912
13979
  pageInfo: PageInfo;
13913
13980
  totalCount: number;
13914
13981
  }
13915
- /** A connection to a list of `EntityTypeProvision` values. */
13916
- export interface EntityTypeProvisionConnection {
13917
- nodes: EntityTypeProvision[];
13918
- edges: EntityTypeProvisionEdge[];
13982
+ /** A connection to a list of `Table` values. */
13983
+ export interface TableConnection {
13984
+ nodes: Table[];
13985
+ edges: TableEdge[];
13919
13986
  pageInfo: PageInfo;
13920
13987
  totalCount: number;
13921
13988
  }
@@ -13926,10 +13993,10 @@ export interface StorageModuleConnection {
13926
13993
  pageInfo: PageInfo;
13927
13994
  totalCount: number;
13928
13995
  }
13929
- /** A connection to a list of `Table` values. */
13930
- export interface TableConnection {
13931
- nodes: Table[];
13932
- edges: TableEdge[];
13996
+ /** A connection to a list of `EntityTypeProvision` values. */
13997
+ export interface EntityTypeProvisionConnection {
13998
+ nodes: EntityTypeProvision[];
13999
+ edges: EntityTypeProvisionEdge[];
13933
14000
  pageInfo: PageInfo;
13934
14001
  totalCount: number;
13935
14002
  }
@@ -14801,11 +14868,11 @@ export interface CreateForeignKeyConstraintPayload {
14801
14868
  foreignKeyConstraint?: ForeignKeyConstraint | null;
14802
14869
  foreignKeyConstraintEdge?: ForeignKeyConstraintEdge | null;
14803
14870
  }
14804
- export interface CreateEntityTypeProvisionPayload {
14871
+ export interface CreateTablePayload {
14805
14872
  clientMutationId?: string | null;
14806
- /** The `EntityTypeProvision` that was created by this mutation. */
14807
- entityTypeProvision?: EntityTypeProvision | null;
14808
- entityTypeProvisionEdge?: EntityTypeProvisionEdge | null;
14873
+ /** The `Table` that was created by this mutation. */
14874
+ table?: Table | null;
14875
+ tableEdge?: TableEdge | null;
14809
14876
  }
14810
14877
  export interface CreateStorageModulePayload {
14811
14878
  clientMutationId?: string | null;
@@ -14813,11 +14880,11 @@ export interface CreateStorageModulePayload {
14813
14880
  storageModule?: StorageModule | null;
14814
14881
  storageModuleEdge?: StorageModuleEdge | null;
14815
14882
  }
14816
- export interface CreateTablePayload {
14883
+ export interface CreateEntityTypeProvisionPayload {
14817
14884
  clientMutationId?: string | null;
14818
- /** The `Table` that was created by this mutation. */
14819
- table?: Table | null;
14820
- tableEdge?: TableEdge | null;
14885
+ /** The `EntityTypeProvision` that was created by this mutation. */
14886
+ entityTypeProvision?: EntityTypeProvision | null;
14887
+ entityTypeProvisionEdge?: EntityTypeProvisionEdge | null;
14821
14888
  }
14822
14889
  export interface CreateRelationProvisionPayload {
14823
14890
  clientMutationId?: string | null;
@@ -15473,11 +15540,11 @@ export interface UpdateForeignKeyConstraintPayload {
15473
15540
  foreignKeyConstraint?: ForeignKeyConstraint | null;
15474
15541
  foreignKeyConstraintEdge?: ForeignKeyConstraintEdge | null;
15475
15542
  }
15476
- export interface UpdateEntityTypeProvisionPayload {
15543
+ export interface UpdateTablePayload {
15477
15544
  clientMutationId?: string | null;
15478
- /** The `EntityTypeProvision` that was updated by this mutation. */
15479
- entityTypeProvision?: EntityTypeProvision | null;
15480
- entityTypeProvisionEdge?: EntityTypeProvisionEdge | null;
15545
+ /** The `Table` that was updated by this mutation. */
15546
+ table?: Table | null;
15547
+ tableEdge?: TableEdge | null;
15481
15548
  }
15482
15549
  export interface UpdateStorageModulePayload {
15483
15550
  clientMutationId?: string | null;
@@ -15485,11 +15552,11 @@ export interface UpdateStorageModulePayload {
15485
15552
  storageModule?: StorageModule | null;
15486
15553
  storageModuleEdge?: StorageModuleEdge | null;
15487
15554
  }
15488
- export interface UpdateTablePayload {
15555
+ export interface UpdateEntityTypeProvisionPayload {
15489
15556
  clientMutationId?: string | null;
15490
- /** The `Table` that was updated by this mutation. */
15491
- table?: Table | null;
15492
- tableEdge?: TableEdge | null;
15557
+ /** The `EntityTypeProvision` that was updated by this mutation. */
15558
+ entityTypeProvision?: EntityTypeProvision | null;
15559
+ entityTypeProvisionEdge?: EntityTypeProvisionEdge | null;
15493
15560
  }
15494
15561
  export interface UpdateRelationProvisionPayload {
15495
15562
  clientMutationId?: string | null;
@@ -16145,11 +16212,11 @@ export interface DeleteForeignKeyConstraintPayload {
16145
16212
  foreignKeyConstraint?: ForeignKeyConstraint | null;
16146
16213
  foreignKeyConstraintEdge?: ForeignKeyConstraintEdge | null;
16147
16214
  }
16148
- export interface DeleteEntityTypeProvisionPayload {
16215
+ export interface DeleteTablePayload {
16149
16216
  clientMutationId?: string | null;
16150
- /** The `EntityTypeProvision` that was deleted by this mutation. */
16151
- entityTypeProvision?: EntityTypeProvision | null;
16152
- entityTypeProvisionEdge?: EntityTypeProvisionEdge | null;
16217
+ /** The `Table` that was deleted by this mutation. */
16218
+ table?: Table | null;
16219
+ tableEdge?: TableEdge | null;
16153
16220
  }
16154
16221
  export interface DeleteStorageModulePayload {
16155
16222
  clientMutationId?: string | null;
@@ -16157,11 +16224,11 @@ export interface DeleteStorageModulePayload {
16157
16224
  storageModule?: StorageModule | null;
16158
16225
  storageModuleEdge?: StorageModuleEdge | null;
16159
16226
  }
16160
- export interface DeleteTablePayload {
16227
+ export interface DeleteEntityTypeProvisionPayload {
16161
16228
  clientMutationId?: string | null;
16162
- /** The `Table` that was deleted by this mutation. */
16163
- table?: Table | null;
16164
- tableEdge?: TableEdge | null;
16229
+ /** The `EntityTypeProvision` that was deleted by this mutation. */
16230
+ entityTypeProvision?: EntityTypeProvision | null;
16231
+ entityTypeProvisionEdge?: EntityTypeProvisionEdge | null;
16165
16232
  }
16166
16233
  export interface DeleteRelationProvisionPayload {
16167
16234
  clientMutationId?: string | null;
@@ -16204,6 +16271,8 @@ export interface RequestUploadUrlPayload {
16204
16271
  deduplicated: boolean;
16205
16272
  /** Presigned URL expiry time (null if deduplicated) */
16206
16273
  expiresAt?: string | null;
16274
+ /** File status — 'pending' for fresh uploads, 'ready' or 'processed' for deduplicated files. Clients can use this to know immediately whether the file is usable. */
16275
+ status: string;
16207
16276
  }
16208
16277
  export interface ConfirmUploadPayload {
16209
16278
  /** The confirmed file ID */
@@ -16910,11 +16979,11 @@ export interface ForeignKeyConstraintEdge {
16910
16979
  /** The `ForeignKeyConstraint` at the end of the edge. */
16911
16980
  node?: ForeignKeyConstraint | null;
16912
16981
  }
16913
- /** A `EntityTypeProvision` edge in the connection. */
16914
- export interface EntityTypeProvisionEdge {
16982
+ /** A `Table` edge in the connection. */
16983
+ export interface TableEdge {
16915
16984
  cursor?: string | null;
16916
- /** The `EntityTypeProvision` at the end of the edge. */
16917
- node?: EntityTypeProvision | null;
16985
+ /** The `Table` at the end of the edge. */
16986
+ node?: Table | null;
16918
16987
  }
16919
16988
  /** A `StorageModule` edge in the connection. */
16920
16989
  export interface StorageModuleEdge {
@@ -16922,11 +16991,11 @@ export interface StorageModuleEdge {
16922
16991
  /** The `StorageModule` at the end of the edge. */
16923
16992
  node?: StorageModule | null;
16924
16993
  }
16925
- /** A `Table` edge in the connection. */
16926
- export interface TableEdge {
16994
+ /** A `EntityTypeProvision` edge in the connection. */
16995
+ export interface EntityTypeProvisionEdge {
16927
16996
  cursor?: string | null;
16928
- /** The `Table` at the end of the edge. */
16929
- node?: Table | null;
16997
+ /** The `EntityTypeProvision` at the end of the edge. */
16998
+ node?: EntityTypeProvision | null;
16930
16999
  }
16931
17000
  /** A `RelationProvision` edge in the connection. */
16932
17001
  export interface RelationProvisionEdge {