@stndrds/schema 0.1.0-alpha.55 → 0.1.0-alpha.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-4NLKDJWD.mjs → chunk-LOOGQL6M.mjs} +1909 -1471
- package/dist/{chunk-QBDGRMSC.js → chunk-XBF4EUC4.js} +2215 -1777
- package/dist/index.d.mts +13 -3
- package/dist/index.d.ts +13 -3
- package/dist/index.js +6 -6
- package/dist/index.mjs +5 -5
- package/dist/{runtime-ka1bmD0F.d.mts → runtime-D5MuaVQs.d.mts} +275 -697
- package/dist/{runtime-ka1bmD0F.d.ts → runtime-D5MuaVQs.d.ts} +275 -697
- package/dist/runtime.d.mts +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +2 -6
- package/dist/runtime.mjs +1 -5
- package/package.json +2 -2
|
@@ -5906,7 +5906,8 @@ declare function createFormAttributeValidator(attr: Attribute, messages?: Valida
|
|
|
5906
5906
|
/**
|
|
5907
5907
|
* Create a Zod schema for an entire object
|
|
5908
5908
|
*
|
|
5909
|
-
* Uses
|
|
5909
|
+
* Uses passthrough mode to allow computed fields (formula, rollup) that may be
|
|
5910
|
+
* present in record data but are not part of the mutable schema.
|
|
5910
5911
|
*/
|
|
5911
5912
|
declare function createObjectValidator(objectDef: ObjectDefinition): z.ZodType<Record<string, unknown>>;
|
|
5912
5913
|
/**
|
|
@@ -5936,7 +5937,8 @@ declare function validateObjectOrThrow(objectDef: ObjectDefinition, data: Record
|
|
|
5936
5937
|
* Create a Zod schema for draft validation.
|
|
5937
5938
|
* All attributes become optional, but provided values are still validated.
|
|
5938
5939
|
*
|
|
5939
|
-
* Uses
|
|
5940
|
+
* Uses passthrough mode to allow computed fields (formula, rollup) that may be
|
|
5941
|
+
* present in record data but are not part of the mutable schema.
|
|
5940
5942
|
*/
|
|
5941
5943
|
declare function createDraftValidator(objectDef: ObjectDefinition): z.ZodType<Record<string, unknown>>;
|
|
5942
5944
|
/**
|
|
@@ -6026,7 +6028,7 @@ declare function computeRecordStatus(objectDef: ObjectDefinition, data: Record<s
|
|
|
6026
6028
|
* Supported cache key types for type-safe cache operations.
|
|
6027
6029
|
* Used by `cachedBy()` and `cachedList()` helpers in BaseService.
|
|
6028
6030
|
*/
|
|
6029
|
-
type CacheKeyType = "record" | "objectSchema" | "objectSchemaByName" | "objectSchemaList" | "objectAttributes" | "attributeById" | "userProfileById" | "userProfileByAuthId" | "userProfileByEmail" | "viewsByObject" | "workflowByName" | "workflowById" | "workflowList" | "relationOptions" | "resolvedRelation" | "rollupValue" | "userPermissions" | "recordList" | "searchResults" | "globalSearch" | "allRecordLists" | "allSearchResults" | "allGlobalSearch" | "allSchemas" | "allAttributes" | "allPermissions" | "allRelations" | "allResolvedRelations" | "resolvedRelationsByRecord" | "resolvedRelationsByAttr" | "allRollups" | "rollupsByRecord" | "allRecords" | "allViews" | "allUserProfiles" | "allWorkflows" | "allForTenant";
|
|
6031
|
+
type CacheKeyType = "record" | "objectSchema" | "objectSchemaByName" | "objectSchemaList" | "objectOwnerInfo" | "objectAttributes" | "attributeById" | "userProfileById" | "userProfileByAuthId" | "userProfileByEmail" | "viewsByObject" | "workflowByName" | "workflowById" | "workflowList" | "relationOptions" | "resolvedRelation" | "rollupValue" | "userPermissions" | "recordList" | "searchResults" | "globalSearch" | "allRecordLists" | "allSearchResults" | "allGlobalSearch" | "allSchemas" | "allAttributes" | "allPermissions" | "allRelations" | "allResolvedRelations" | "resolvedRelationsByRecord" | "resolvedRelationsByAttr" | "allRollups" | "rollupsByRecord" | "allRecords" | "allViews" | "allUserProfiles" | "allWorkflows" | "allForTenant";
|
|
6030
6032
|
/**
|
|
6031
6033
|
* Generate a deterministic hash from query options.
|
|
6032
6034
|
* Keys are sorted recursively to ensure same hash regardless of property order.
|
|
@@ -6114,6 +6116,7 @@ declare const cacheKeys: {
|
|
|
6114
6116
|
readonly objectSchemaByName: (tenantId: string, name: string) => string;
|
|
6115
6117
|
/** List of all object schemas */
|
|
6116
6118
|
readonly objectSchemaList: (tenantId: string) => string;
|
|
6119
|
+
readonly objectOwnerInfo: (tenantId: string, objectId: string) => string;
|
|
6117
6120
|
/** Attributes for an object */
|
|
6118
6121
|
readonly objectAttributes: (tenantId: string, objectId: string) => string;
|
|
6119
6122
|
/** Single attribute by ID (covered by allAttributes pattern) */
|
|
@@ -6128,7 +6131,15 @@ declare const cacheKeys: {
|
|
|
6128
6131
|
* Used by cachedByMany in RelationService.resolveIds()
|
|
6129
6132
|
*/
|
|
6130
6133
|
readonly resolvedRelation: (tenantId: string, compositeId: string) => string;
|
|
6131
|
-
/**
|
|
6134
|
+
/**
|
|
6135
|
+
* Computed rollup value for a record.
|
|
6136
|
+
*
|
|
6137
|
+
* NOTE: When used via `cachedBy("rollupValue", compositeId, ...)`, the compositeId
|
|
6138
|
+
* is `${recordId}:${attrName}`. Since `cachedBy` calls `keyFn(tenantId, compositeId)`,
|
|
6139
|
+
* the third parameter receives the composite string, producing the same key as
|
|
6140
|
+
* calling `rollupValue(tenantId, recordId, attrName)` directly. This works because
|
|
6141
|
+
* the colon separator in the composite matches the key format, but is intentional.
|
|
6142
|
+
*/
|
|
6132
6143
|
readonly rollupValue: (tenantId: string, recordId: string, attrName: string) => string;
|
|
6133
6144
|
/** Individual record by ID */
|
|
6134
6145
|
readonly record: (tenantId: string, recordId: string) => string;
|
|
@@ -6346,127 +6357,7 @@ interface AttributesRepository {
|
|
|
6346
6357
|
*/
|
|
6347
6358
|
upsert(data: UpsertDBAttribute): Promise<DBAttribute>;
|
|
6348
6359
|
}
|
|
6349
|
-
|
|
6350
|
-
* Repository for user_profiles table.
|
|
6351
|
-
*
|
|
6352
|
-
* All operations are automatically scoped to the current tenant
|
|
6353
|
-
* from the execution context (via AsyncLocalStorage).
|
|
6354
|
-
*/
|
|
6355
|
-
interface UserProfilesRepository {
|
|
6356
|
-
/**
|
|
6357
|
-
* Find user profile by ID.
|
|
6358
|
-
* Automatically filtered by current tenant context.
|
|
6359
|
-
*/
|
|
6360
|
-
findById(id: Uuid): Promise<UserProfile | null>;
|
|
6361
|
-
/**
|
|
6362
|
-
* Find multiple user profiles by IDs.
|
|
6363
|
-
* Automatically filtered by current tenant context.
|
|
6364
|
-
* Returns only profiles that exist and belong to the current tenant.
|
|
6365
|
-
*/
|
|
6366
|
-
findByIds(ids: Uuid[]): Promise<UserProfile[]>;
|
|
6367
|
-
/**
|
|
6368
|
-
* Find user profile by auth ID (external auth provider).
|
|
6369
|
-
* Automatically filtered by current tenant context.
|
|
6370
|
-
*/
|
|
6371
|
-
findByAuthId(authId: string): Promise<UserProfile | null>;
|
|
6372
|
-
/**
|
|
6373
|
-
* Find user profile by email.
|
|
6374
|
-
* Automatically filtered by current tenant context.
|
|
6375
|
-
*/
|
|
6376
|
-
findByEmail(email: string): Promise<UserProfile | null>;
|
|
6377
|
-
/**
|
|
6378
|
-
* Create user profile.
|
|
6379
|
-
* Tenant ID is automatically set from context.
|
|
6380
|
-
*/
|
|
6381
|
-
create(data: CreateUserProfile): Promise<UserProfile>;
|
|
6382
|
-
/**
|
|
6383
|
-
* Update user profile.
|
|
6384
|
-
* Automatically filtered by current tenant context.
|
|
6385
|
-
*/
|
|
6386
|
-
update(id: Uuid, data: UpdateUserProfile): Promise<UserProfile>;
|
|
6387
|
-
/**
|
|
6388
|
-
* Delete user profile.
|
|
6389
|
-
* Automatically filtered by current tenant context.
|
|
6390
|
-
*/
|
|
6391
|
-
delete(id: Uuid): Promise<void>;
|
|
6392
|
-
/**
|
|
6393
|
-
* List all user profiles for current tenant.
|
|
6394
|
-
* Automatically filtered by current tenant context.
|
|
6395
|
-
*/
|
|
6396
|
-
list(options?: ListOptions): Promise<UserProfile[]>;
|
|
6397
|
-
/**
|
|
6398
|
-
* Count user profiles by role within current tenant.
|
|
6399
|
-
* Useful for checking if last admin before deletion.
|
|
6400
|
-
*/
|
|
6401
|
-
countByRole(role: string): Promise<number>;
|
|
6402
|
-
/**
|
|
6403
|
-
* Update last login timestamp.
|
|
6404
|
-
* Automatically filtered by current tenant context.
|
|
6405
|
-
*/
|
|
6406
|
-
updateLastLogin(id: Uuid): Promise<void>;
|
|
6407
|
-
/**
|
|
6408
|
-
* Invite a user by email.
|
|
6409
|
-
* Creates a pending user profile with a temporary authId.
|
|
6410
|
-
* Tenant ID is automatically set from context.
|
|
6411
|
-
*
|
|
6412
|
-
* @param data - Invitation data (email, firstName, lastName, role)
|
|
6413
|
-
* @returns Created pending user profile
|
|
6414
|
-
*/
|
|
6415
|
-
invite(data: InviteUserInput): Promise<UserProfile>;
|
|
6416
|
-
}
|
|
6417
|
-
/**
|
|
6418
|
-
* Repository for files table.
|
|
6419
|
-
*
|
|
6420
|
-
* All operations are automatically scoped to the current tenant
|
|
6421
|
-
* from the execution context (via AsyncLocalStorage).
|
|
6422
|
-
*/
|
|
6423
|
-
interface FilesRepository {
|
|
6424
|
-
/**
|
|
6425
|
-
* Find file by ID.
|
|
6426
|
-
* Returns file with signed URL. Automatically filtered by current tenant context.
|
|
6427
|
-
*/
|
|
6428
|
-
findById(id: Uuid): Promise<File | null>;
|
|
6429
|
-
/**
|
|
6430
|
-
* Find multiple files by IDs.
|
|
6431
|
-
* Returns files with signed URLs. Automatically filtered by current tenant context.
|
|
6432
|
-
*/
|
|
6433
|
-
findByIds(ids: Uuid[]): Promise<File[]>;
|
|
6434
|
-
/**
|
|
6435
|
-
* Create file.
|
|
6436
|
-
* Returns file with signed URL. Tenant ID is automatically set from context.
|
|
6437
|
-
*/
|
|
6438
|
-
create(data: CreateFile): Promise<File>;
|
|
6439
|
-
/**
|
|
6440
|
-
* Update file.
|
|
6441
|
-
* Automatically filtered by current tenant context.
|
|
6442
|
-
*/
|
|
6443
|
-
update(id: Uuid, data: UpdateFile): Promise<File>;
|
|
6444
|
-
/**
|
|
6445
|
-
* Delete file (soft delete).
|
|
6446
|
-
* Automatically filtered by current tenant context.
|
|
6447
|
-
*/
|
|
6448
|
-
delete(id: Uuid): Promise<void>;
|
|
6449
|
-
/**
|
|
6450
|
-
* Hard delete file (permanent).
|
|
6451
|
-
* Automatically filtered by current tenant context.
|
|
6452
|
-
*/
|
|
6453
|
-
hardDelete(id: Uuid): Promise<void>;
|
|
6454
|
-
/**
|
|
6455
|
-
* List files for current tenant.
|
|
6456
|
-
* Automatically filtered by current tenant context.
|
|
6457
|
-
*/
|
|
6458
|
-
list(options?: FileListOptions): Promise<File[]>;
|
|
6459
|
-
/**
|
|
6460
|
-
* Find files by folder path.
|
|
6461
|
-
* Automatically filtered by current tenant context.
|
|
6462
|
-
*/
|
|
6463
|
-
findByFolder(folderPath: string): Promise<File[]>;
|
|
6464
|
-
/**
|
|
6465
|
-
* Find files by uploader.
|
|
6466
|
-
* Automatically filtered by current tenant context.
|
|
6467
|
-
*/
|
|
6468
|
-
findByUploader(uploadedBy: Uuid): Promise<File[]>;
|
|
6469
|
-
}
|
|
6360
|
+
|
|
6470
6361
|
/**
|
|
6471
6362
|
* Repository for object_records table (unified JSONB).
|
|
6472
6363
|
*
|
|
@@ -6542,19 +6433,10 @@ interface ObjectRecordsRepository {
|
|
|
6542
6433
|
* Count records that reference a given record ID in any relation attribute.
|
|
6543
6434
|
* Used to implement the "Restrict" delete behavior.
|
|
6544
6435
|
*
|
|
6545
|
-
* This method scans all relation attributes across all objects to find
|
|
6546
|
-
* records that contain the target ID in their relation values.
|
|
6547
|
-
*
|
|
6548
6436
|
* **Important:** This method should exclude soft-deleted records from the count.
|
|
6549
6437
|
*
|
|
6550
6438
|
* @param targetId - The record ID being checked for references
|
|
6551
6439
|
* @returns Array of objects with reference counts, grouped by object
|
|
6552
|
-
*
|
|
6553
|
-
* @example
|
|
6554
|
-
* ```typescript
|
|
6555
|
-
* const refs = await repo.countRecordsReferencingId("rec-123");
|
|
6556
|
-
* // [{ objectName: "contacts", objectLabel: "Contacts", count: 3 }]
|
|
6557
|
-
* ```
|
|
6558
6440
|
*/
|
|
6559
6441
|
countRecordsReferencingId(targetId: Uuid): Promise<Array<{
|
|
6560
6442
|
objectName: string;
|
|
@@ -6565,43 +6447,18 @@ interface ObjectRecordsRepository {
|
|
|
6565
6447
|
* Remove an attribute's data from all records of an object.
|
|
6566
6448
|
* Used after attribute deletion to clean up orphaned data.
|
|
6567
6449
|
*
|
|
6568
|
-
* This efficiently removes the key from the JSONB values column
|
|
6569
|
-
* for all records belonging to the specified object.
|
|
6570
|
-
*
|
|
6571
6450
|
* @param objectId - Object UUID
|
|
6572
6451
|
* @param attributeName - Name of the attribute to remove
|
|
6573
6452
|
* @returns Number of records that were updated
|
|
6574
|
-
*
|
|
6575
|
-
* @example
|
|
6576
|
-
* ```typescript
|
|
6577
|
-
* const updated = await repo.removeAttributeData("obj-123", "oldField");
|
|
6578
|
-
* console.log(`Cleaned up ${updated} records`);
|
|
6579
|
-
* ```
|
|
6580
6453
|
*/
|
|
6581
6454
|
removeAttributeData(objectId: Uuid, attributeName: string): Promise<number>;
|
|
6582
6455
|
/**
|
|
6583
6456
|
* Batch update labels for all records of an object.
|
|
6584
6457
|
* Used after labelExpression changes to refresh all record labels.
|
|
6585
6458
|
*
|
|
6586
|
-
* Supports both sync and async compute functions to allow for
|
|
6587
|
-
* relation resolution when the label expression references relations.
|
|
6588
|
-
*
|
|
6589
6459
|
* @param objectId - Object UUID
|
|
6590
6460
|
* @param computeLabel - Function to compute label from record values (sync or async)
|
|
6591
6461
|
* @returns Number of records that were updated
|
|
6592
|
-
*
|
|
6593
|
-
* @example
|
|
6594
|
-
* ```typescript
|
|
6595
|
-
* // Sync compute (simple labels)
|
|
6596
|
-
* const updated = await repo.batchRefreshLabels("obj-123", (values) => {
|
|
6597
|
-
* return `${values.sku} - ${values.name}`;
|
|
6598
|
-
* });
|
|
6599
|
-
*
|
|
6600
|
-
* // Async compute (with relation resolution)
|
|
6601
|
-
* const updated = await repo.batchRefreshLabels("obj-123", async (values) => {
|
|
6602
|
-
* return await computeLabelWithRelations(template, values, attributes, resolver);
|
|
6603
|
-
* });
|
|
6604
|
-
* ```
|
|
6605
6462
|
*/
|
|
6606
6463
|
batchRefreshLabels(objectId: Uuid, computeLabel: (values: Record<string, unknown>) => Promise<string> | string): Promise<number>;
|
|
6607
6464
|
/**
|
|
@@ -6618,22 +6475,10 @@ interface ObjectRecordsRepository {
|
|
|
6618
6475
|
* Used by rollup calculations to find related records.
|
|
6619
6476
|
* Automatically filtered by current tenant context.
|
|
6620
6477
|
*
|
|
6621
|
-
*
|
|
6622
|
-
*
|
|
6623
|
-
* @param objectId - Object ID of the records to search (e.g., Orders object)
|
|
6624
|
-
* @param relationAttribute - Name of the relation attribute (e.g., "companyId")
|
|
6478
|
+
* @param objectId - Object ID of the records to search
|
|
6479
|
+
* @param relationAttribute - Name of the relation attribute
|
|
6625
6480
|
* @param targetId - The ID to search for in the relation attribute
|
|
6626
6481
|
* @returns Records that reference the target ID
|
|
6627
|
-
*
|
|
6628
|
-
* @example
|
|
6629
|
-
* ```typescript
|
|
6630
|
-
* // Find all orders for a specific company
|
|
6631
|
-
* const orders = await repo.findByRelation(
|
|
6632
|
-
* "orders-object-id",
|
|
6633
|
-
* "companyId",
|
|
6634
|
-
* "company-123"
|
|
6635
|
-
* );
|
|
6636
|
-
* ```
|
|
6637
6482
|
*/
|
|
6638
6483
|
findByRelation(objectId: Uuid, relationAttribute: string, targetId: Uuid): Promise<ObjectRecord[]>;
|
|
6639
6484
|
}
|
|
@@ -6701,242 +6546,135 @@ interface ViewsRepository {
|
|
|
6701
6546
|
*/
|
|
6702
6547
|
upsert(data: UpsertDBView): Promise<DBView>;
|
|
6703
6548
|
}
|
|
6549
|
+
|
|
6704
6550
|
/**
|
|
6705
|
-
* Repository for
|
|
6706
|
-
*
|
|
6707
|
-
* This repository is optional - if not provided in the DatabaseAdapter,
|
|
6708
|
-
* workflow features are disabled.
|
|
6551
|
+
* Repository for user_profiles table.
|
|
6709
6552
|
*
|
|
6710
6553
|
* All operations are automatically scoped to the current tenant
|
|
6711
6554
|
* from the execution context (via AsyncLocalStorage).
|
|
6712
6555
|
*/
|
|
6713
|
-
interface
|
|
6556
|
+
interface UserProfilesRepository {
|
|
6714
6557
|
/**
|
|
6715
|
-
* Find
|
|
6558
|
+
* Find user profile by ID.
|
|
6716
6559
|
* Automatically filtered by current tenant context.
|
|
6717
6560
|
*/
|
|
6718
|
-
findById(id: Uuid): Promise<
|
|
6561
|
+
findById(id: Uuid): Promise<UserProfile | null>;
|
|
6719
6562
|
/**
|
|
6720
|
-
* Find
|
|
6563
|
+
* Find multiple user profiles by IDs.
|
|
6721
6564
|
* Automatically filtered by current tenant context.
|
|
6722
6565
|
*/
|
|
6723
|
-
|
|
6724
|
-
/**
|
|
6725
|
-
* Find system workflow by name (for sync).
|
|
6726
|
-
* System workflows are shared across tenants.
|
|
6727
|
-
*/
|
|
6728
|
-
findSystemByName(name: string): Promise<DBWorkflow | null>;
|
|
6566
|
+
findByIds(ids: Uuid[]): Promise<UserProfile[]>;
|
|
6729
6567
|
/**
|
|
6730
|
-
*
|
|
6568
|
+
* Find user profile by auth ID (external auth provider).
|
|
6731
6569
|
* Automatically filtered by current tenant context.
|
|
6732
6570
|
*/
|
|
6733
|
-
|
|
6571
|
+
findByAuthId(authId: string): Promise<UserProfile | null>;
|
|
6734
6572
|
/**
|
|
6735
|
-
*
|
|
6573
|
+
* Find user profile by email.
|
|
6736
6574
|
* Automatically filtered by current tenant context.
|
|
6737
6575
|
*/
|
|
6738
|
-
|
|
6576
|
+
findByEmail(email: string): Promise<UserProfile | null>;
|
|
6739
6577
|
/**
|
|
6740
|
-
* Create
|
|
6578
|
+
* Create user profile.
|
|
6741
6579
|
* Tenant ID is automatically set from context.
|
|
6742
6580
|
*/
|
|
6743
|
-
create(data:
|
|
6581
|
+
create(data: CreateUserProfile): Promise<UserProfile>;
|
|
6744
6582
|
/**
|
|
6745
|
-
* Update
|
|
6583
|
+
* Update user profile.
|
|
6746
6584
|
* Automatically filtered by current tenant context.
|
|
6747
6585
|
*/
|
|
6748
|
-
update(id: Uuid, data:
|
|
6586
|
+
update(id: Uuid, data: UpdateUserProfile): Promise<UserProfile>;
|
|
6749
6587
|
/**
|
|
6750
|
-
* Delete
|
|
6588
|
+
* Delete user profile.
|
|
6751
6589
|
* Automatically filtered by current tenant context.
|
|
6752
6590
|
*/
|
|
6753
6591
|
delete(id: Uuid): Promise<void>;
|
|
6754
6592
|
/**
|
|
6755
|
-
*
|
|
6756
|
-
* Tenant ID is automatically set from context.
|
|
6757
|
-
*/
|
|
6758
|
-
upsert(data: CreateDBWorkflow): Promise<DBWorkflow>;
|
|
6759
|
-
}
|
|
6760
|
-
/**
|
|
6761
|
-
* Repository for workflow instances (running/completed workflows).
|
|
6762
|
-
*
|
|
6763
|
-
* This repository is optional - if not provided in the DatabaseAdapter,
|
|
6764
|
-
* workflow execution features are disabled.
|
|
6765
|
-
*
|
|
6766
|
-
* All operations are automatically scoped to the current tenant
|
|
6767
|
-
* from the execution context (via AsyncLocalStorage).
|
|
6768
|
-
*/
|
|
6769
|
-
interface WorkflowInstancesRepository {
|
|
6770
|
-
/**
|
|
6771
|
-
* Find instance by ID.
|
|
6772
|
-
* Automatically filtered by current tenant context.
|
|
6773
|
-
*/
|
|
6774
|
-
findById(id: Uuid): Promise<DBWorkflowInstance | null>;
|
|
6775
|
-
/**
|
|
6776
|
-
* Find instances by workflow ID.
|
|
6777
|
-
* Automatically filtered by current tenant context.
|
|
6778
|
-
*/
|
|
6779
|
-
findByWorkflowId(workflowId: Uuid): Promise<DBWorkflowInstance[]>;
|
|
6780
|
-
/**
|
|
6781
|
-
* Find instances by workflow name.
|
|
6782
|
-
* Automatically filtered by current tenant context.
|
|
6783
|
-
*/
|
|
6784
|
-
findByWorkflowName(workflowName: string): Promise<DBWorkflowInstance[]>;
|
|
6785
|
-
/**
|
|
6786
|
-
* List all instances for current tenant.
|
|
6787
|
-
* Automatically filtered by current tenant context.
|
|
6788
|
-
*/
|
|
6789
|
-
list(options?: ListOptions): Promise<{
|
|
6790
|
-
instances: DBWorkflowInstance[];
|
|
6791
|
-
total: number;
|
|
6792
|
-
}>;
|
|
6793
|
-
/**
|
|
6794
|
-
* List instances by status.
|
|
6593
|
+
* List all user profiles for current tenant.
|
|
6795
6594
|
* Automatically filtered by current tenant context.
|
|
6796
6595
|
*/
|
|
6797
|
-
|
|
6596
|
+
list(options?: ListOptions): Promise<UserProfile[]>;
|
|
6798
6597
|
/**
|
|
6799
|
-
*
|
|
6800
|
-
* Tenant ID is automatically set from context.
|
|
6598
|
+
* Count user profiles by role within current tenant.
|
|
6801
6599
|
*/
|
|
6802
|
-
|
|
6600
|
+
countByRole(role: string): Promise<number>;
|
|
6803
6601
|
/**
|
|
6804
|
-
* Update
|
|
6602
|
+
* Update last login timestamp.
|
|
6805
6603
|
* Automatically filtered by current tenant context.
|
|
6806
6604
|
*/
|
|
6807
|
-
|
|
6605
|
+
updateLastLogin(id: Uuid): Promise<void>;
|
|
6808
6606
|
/**
|
|
6809
|
-
*
|
|
6607
|
+
* Invite a user by email.
|
|
6608
|
+
* Creates a pending user profile with a temporary authId.
|
|
6810
6609
|
* Tenant ID is automatically set from context.
|
|
6811
6610
|
*/
|
|
6812
|
-
|
|
6813
|
-
id: string;
|
|
6814
|
-
}): Promise<DBWorkflowInstance>;
|
|
6815
|
-
/**
|
|
6816
|
-
* Find instances that reference a specific record in their slot context.
|
|
6817
|
-
* Searches in context.slots for slots where objectName and id match.
|
|
6818
|
-
* Automatically filtered by current tenant context.
|
|
6819
|
-
*
|
|
6820
|
-
* This method is required and must be implemented by all adapters.
|
|
6821
|
-
* No fallback is provided for performance reasons - all implementations
|
|
6822
|
-
* must use database-level optimizations (e.g., JSONB queries in PostgreSQL).
|
|
6823
|
-
*
|
|
6824
|
-
* @param objectName - Object name to match in slot data
|
|
6825
|
-
* @param recordId - Record ID to match in slot data
|
|
6826
|
-
* @param options - Optional filtering options
|
|
6827
|
-
*/
|
|
6828
|
-
findByRecordInSlots(objectName: string, recordId: string, options?: {
|
|
6829
|
-
status?: InstanceStatus;
|
|
6830
|
-
limit?: number;
|
|
6831
|
-
offset?: number;
|
|
6832
|
-
}): Promise<{
|
|
6833
|
-
instances: DBWorkflowInstance[];
|
|
6834
|
-
total: number;
|
|
6835
|
-
}>;
|
|
6611
|
+
invite(data: InviteUserInput): Promise<UserProfile>;
|
|
6836
6612
|
}
|
|
6837
6613
|
/**
|
|
6838
|
-
* Repository for
|
|
6839
|
-
*
|
|
6840
|
-
* This repository is optional - if not provided in the DatabaseAdapter,
|
|
6841
|
-
* external participation features are disabled.
|
|
6842
|
-
*
|
|
6843
|
-
* All operations are automatically scoped to the current tenant
|
|
6844
|
-
* from the execution context (via AsyncLocalStorage).
|
|
6845
|
-
*/
|
|
6846
|
-
/**
|
|
6847
|
-
* Repository for workflow invitations.
|
|
6614
|
+
* Repository for files table.
|
|
6848
6615
|
*
|
|
6849
6616
|
* All operations are automatically scoped to the current tenant
|
|
6850
6617
|
* from the execution context (via AsyncLocalStorage).
|
|
6851
6618
|
*/
|
|
6852
|
-
interface
|
|
6853
|
-
/**
|
|
6854
|
-
* Find invitation by ID.
|
|
6855
|
-
* Automatically filtered by current tenant context.
|
|
6856
|
-
*/
|
|
6857
|
-
findById(id: Uuid): Promise<DBWorkflowInvitation | null>;
|
|
6858
|
-
/**
|
|
6859
|
-
* Find invitations by instance ID.
|
|
6860
|
-
* Automatically filtered by current tenant context.
|
|
6861
|
-
*/
|
|
6862
|
-
findByInstanceId(instanceId: Uuid): Promise<DBWorkflowInvitation[]>;
|
|
6619
|
+
interface FilesRepository {
|
|
6863
6620
|
/**
|
|
6864
|
-
* Find
|
|
6865
|
-
*
|
|
6621
|
+
* Find file by ID.
|
|
6622
|
+
* Returns file with signed URL.
|
|
6866
6623
|
*/
|
|
6867
|
-
|
|
6624
|
+
findById(id: Uuid): Promise<File | null>;
|
|
6868
6625
|
/**
|
|
6869
|
-
*
|
|
6870
|
-
*
|
|
6626
|
+
* Find multiple files by IDs.
|
|
6627
|
+
* Returns files with signed URLs.
|
|
6871
6628
|
*/
|
|
6872
|
-
|
|
6629
|
+
findByIds(ids: Uuid[]): Promise<File[]>;
|
|
6873
6630
|
/**
|
|
6874
|
-
*
|
|
6875
|
-
*
|
|
6631
|
+
* Create file.
|
|
6632
|
+
* Returns file with signed URL.
|
|
6876
6633
|
*/
|
|
6877
|
-
|
|
6878
|
-
}
|
|
6879
|
-
/**
|
|
6880
|
-
* Repository for workflow access grants.
|
|
6881
|
-
*
|
|
6882
|
-
* All operations are automatically scoped to the current tenant
|
|
6883
|
-
* from the execution context (via AsyncLocalStorage).
|
|
6884
|
-
*/
|
|
6885
|
-
interface WorkflowAccessGrantsRepository {
|
|
6634
|
+
create(data: CreateFile): Promise<File>;
|
|
6886
6635
|
/**
|
|
6887
|
-
*
|
|
6888
|
-
* Automatically filtered by current tenant context.
|
|
6636
|
+
* Update file.
|
|
6889
6637
|
*/
|
|
6890
|
-
|
|
6638
|
+
update(id: Uuid, data: UpdateFile): Promise<File>;
|
|
6891
6639
|
/**
|
|
6892
|
-
*
|
|
6893
|
-
* Automatically filtered by current tenant context.
|
|
6640
|
+
* Delete file (soft delete).
|
|
6894
6641
|
*/
|
|
6895
|
-
|
|
6642
|
+
delete(id: Uuid): Promise<void>;
|
|
6896
6643
|
/**
|
|
6897
|
-
*
|
|
6898
|
-
* Automatically filtered by current tenant context.
|
|
6644
|
+
* Hard delete file (permanent).
|
|
6899
6645
|
*/
|
|
6900
|
-
|
|
6646
|
+
hardDelete(id: Uuid): Promise<void>;
|
|
6901
6647
|
/**
|
|
6902
|
-
*
|
|
6903
|
-
* Automatically filtered by current tenant context.
|
|
6648
|
+
* List files for current tenant.
|
|
6904
6649
|
*/
|
|
6905
|
-
|
|
6650
|
+
list(options?: FileListOptions): Promise<File[]>;
|
|
6906
6651
|
/**
|
|
6907
|
-
*
|
|
6908
|
-
* Tenant ID is automatically set from context.
|
|
6652
|
+
* Find files by folder path.
|
|
6909
6653
|
*/
|
|
6910
|
-
|
|
6654
|
+
findByFolder(folderPath: string): Promise<File[]>;
|
|
6911
6655
|
/**
|
|
6912
|
-
*
|
|
6913
|
-
* Automatically filtered by current tenant context.
|
|
6656
|
+
* Find files by uploader.
|
|
6914
6657
|
*/
|
|
6915
|
-
|
|
6658
|
+
findByUploader(uploadedBy: Uuid): Promise<File[]>;
|
|
6916
6659
|
}
|
|
6660
|
+
|
|
6917
6661
|
/**
|
|
6918
6662
|
* Repository for audit logs.
|
|
6919
6663
|
*
|
|
6920
6664
|
* This repository is optional - if not provided in the DatabaseAdapter,
|
|
6921
|
-
* audit logging is disabled
|
|
6922
|
-
*
|
|
6923
|
-
* All operations are automatically scoped to the current tenant
|
|
6924
|
-
* from the execution context (via AsyncLocalStorage).
|
|
6665
|
+
* audit logging is disabled.
|
|
6925
6666
|
*/
|
|
6926
6667
|
interface AuditRepository {
|
|
6927
6668
|
/**
|
|
6928
6669
|
* Create a new audit log entry.
|
|
6929
|
-
* Tenant ID is automatically set from context.
|
|
6930
6670
|
*/
|
|
6931
6671
|
create(entry: CreateAuditLogInput): Promise<AuditLogEntry>;
|
|
6932
6672
|
/**
|
|
6933
|
-
* Create multiple audit log entries (batch insert
|
|
6934
|
-
* Tenant ID is automatically set from context.
|
|
6673
|
+
* Create multiple audit log entries (batch insert).
|
|
6935
6674
|
*/
|
|
6936
6675
|
createMany(entries: CreateAuditLogInput[]): Promise<void>;
|
|
6937
6676
|
/**
|
|
6938
6677
|
* List audit logs with filtering and pagination.
|
|
6939
|
-
* Automatically filtered by current tenant context.
|
|
6940
6678
|
*/
|
|
6941
6679
|
list(options?: AuditListOptions): Promise<{
|
|
6942
6680
|
entries: AuditLogEntry[];
|
|
@@ -6944,17 +6682,14 @@ interface AuditRepository {
|
|
|
6944
6682
|
}>;
|
|
6945
6683
|
/**
|
|
6946
6684
|
* Get audit logs for a specific resource.
|
|
6947
|
-
* Automatically filtered by current tenant context.
|
|
6948
6685
|
*/
|
|
6949
6686
|
getByResource(resourceType: AuditResourceType, resourceId: Uuid, options?: AuditListOptions): Promise<AuditLogEntry[]>;
|
|
6950
6687
|
/**
|
|
6951
6688
|
* Get audit logs by actor.
|
|
6952
|
-
* Automatically filtered by current tenant context.
|
|
6953
6689
|
*/
|
|
6954
6690
|
getByActor(actorId: Uuid, options?: AuditListOptions): Promise<AuditLogEntry[]>;
|
|
6955
6691
|
/**
|
|
6956
6692
|
* Delete old audit logs (for retention policy).
|
|
6957
|
-
* Automatically filtered by current tenant context.
|
|
6958
6693
|
* @returns Number of deleted entries
|
|
6959
6694
|
*/
|
|
6960
6695
|
deleteOlderThan(date: Date): Promise<number>;
|
|
@@ -6963,418 +6698,168 @@ interface AuditRepository {
|
|
|
6963
6698
|
* Repository for roles, permissions, and user role assignments.
|
|
6964
6699
|
*
|
|
6965
6700
|
* This repository is optional - if not provided in the DatabaseAdapter,
|
|
6966
|
-
* permission checks are disabled
|
|
6967
|
-
*
|
|
6968
|
-
* All operations are automatically scoped to the current tenant
|
|
6969
|
-
* from the execution context (via AsyncLocalStorage).
|
|
6701
|
+
* permission checks are disabled.
|
|
6970
6702
|
*/
|
|
6971
6703
|
interface PermissionsRepository {
|
|
6972
|
-
/**
|
|
6973
|
-
* Get all roles for current tenant.
|
|
6974
|
-
* Automatically filtered by current tenant context.
|
|
6975
|
-
*/
|
|
6976
6704
|
getRoles(): Promise<Role[]>;
|
|
6977
|
-
/**
|
|
6978
|
-
* Get a role by ID.
|
|
6979
|
-
* Automatically filtered by current tenant context.
|
|
6980
|
-
*/
|
|
6981
6705
|
getRoleById(roleId: Uuid): Promise<Role | null>;
|
|
6982
|
-
/**
|
|
6983
|
-
* Get a role by name.
|
|
6984
|
-
* Automatically filtered by current tenant context.
|
|
6985
|
-
*/
|
|
6986
6706
|
getRoleByName(name: string): Promise<Role | null>;
|
|
6987
|
-
/**
|
|
6988
|
-
* Create a new role.
|
|
6989
|
-
* Tenant ID is automatically set from context.
|
|
6990
|
-
*/
|
|
6991
6707
|
createRole(input: CreateRoleInput): Promise<Role>;
|
|
6992
|
-
/**
|
|
6993
|
-
* Update an existing role.
|
|
6994
|
-
* Automatically filtered by current tenant context.
|
|
6995
|
-
*/
|
|
6996
6708
|
updateRole(roleId: Uuid, updates: UpdateRoleInput): Promise<Role>;
|
|
6997
|
-
/**
|
|
6998
|
-
* Delete a role (fails if role is system role).
|
|
6999
|
-
* Automatically filtered by current tenant context.
|
|
7000
|
-
*/
|
|
7001
6709
|
deleteRole(roleId: Uuid): Promise<void>;
|
|
7002
|
-
/**
|
|
7003
|
-
* Get all permissions for a role.
|
|
7004
|
-
* Automatically filtered by current tenant context.
|
|
7005
|
-
*/
|
|
7006
6710
|
getPermissionsByRole(roleId: Uuid): Promise<Permission[]>;
|
|
7007
|
-
/**
|
|
7008
|
-
* Set permissions for a role (replaces existing permissions).
|
|
7009
|
-
* Automatically filtered by current tenant context.
|
|
7010
|
-
*/
|
|
7011
6711
|
setPermissions(roleId: Uuid, permissions: CreatePermissionInput[]): Promise<void>;
|
|
7012
|
-
/**
|
|
7013
|
-
* Get all roles assigned to a user profile.
|
|
7014
|
-
* Automatically filtered by current tenant context.
|
|
7015
|
-
*/
|
|
7016
6712
|
getUserRoles(userProfileId: Uuid): Promise<Role[]>;
|
|
7017
|
-
/**
|
|
7018
|
-
* Assign a role to a user profile.
|
|
7019
|
-
* Tenant ID is automatically set from context.
|
|
7020
|
-
*/
|
|
7021
6713
|
assignRole(input: AssignRoleInput): Promise<UserRoleAssignment>;
|
|
7022
|
-
/**
|
|
7023
|
-
* Revoke a role from a user profile.
|
|
7024
|
-
* Automatically filtered by current tenant context.
|
|
7025
|
-
*/
|
|
7026
6714
|
revokeRole(userProfileId: Uuid, roleId: Uuid): Promise<void>;
|
|
7027
|
-
/**
|
|
7028
|
-
* Get effective permissions for a user profile (merged from all assigned roles).
|
|
7029
|
-
* Automatically filtered by current tenant context.
|
|
7030
|
-
*
|
|
7031
|
-
* This method should:
|
|
7032
|
-
* 1. Get all roles assigned to the user profile
|
|
7033
|
-
* 2. Get all permissions for those roles
|
|
7034
|
-
* 3. Merge permissions (union of actions per object)
|
|
7035
|
-
* 4. Determine if user has admin privileges
|
|
7036
|
-
*/
|
|
7037
6715
|
getEffectivePermissions(userProfileId: Uuid): Promise<EffectivePermissions>;
|
|
7038
6716
|
}
|
|
7039
6717
|
|
|
7040
6718
|
/**
|
|
7041
|
-
* Repository for
|
|
6719
|
+
* Repository for workflow definitions.
|
|
7042
6720
|
*
|
|
7043
6721
|
* This repository is optional - if not provided in the DatabaseAdapter,
|
|
7044
|
-
*
|
|
6722
|
+
* workflow features are disabled.
|
|
6723
|
+
*/
|
|
6724
|
+
interface WorkflowsRepository {
|
|
6725
|
+
findById(id: Uuid): Promise<DBWorkflow | null>;
|
|
6726
|
+
findByName(name: string): Promise<DBWorkflow | null>;
|
|
6727
|
+
findSystemByName(name: string): Promise<DBWorkflow | null>;
|
|
6728
|
+
list(): Promise<DBWorkflow[]>;
|
|
6729
|
+
listByStatus(status: WorkflowStatus): Promise<DBWorkflow[]>;
|
|
6730
|
+
create(data: CreateDBWorkflow): Promise<DBWorkflow>;
|
|
6731
|
+
update(id: Uuid, data: Partial<UpdateDBWorkflow>): Promise<DBWorkflow>;
|
|
6732
|
+
delete(id: Uuid): Promise<void>;
|
|
6733
|
+
upsert(data: CreateDBWorkflow): Promise<DBWorkflow>;
|
|
6734
|
+
}
|
|
6735
|
+
/**
|
|
6736
|
+
* Repository for workflow instances (running/completed workflows).
|
|
7045
6737
|
*
|
|
7046
|
-
*
|
|
7047
|
-
*
|
|
6738
|
+
* This repository is optional - if not provided in the DatabaseAdapter,
|
|
6739
|
+
* workflow execution features are disabled.
|
|
7048
6740
|
*/
|
|
7049
|
-
interface
|
|
7050
|
-
|
|
7051
|
-
|
|
7052
|
-
* Automatically filtered by current tenant context.
|
|
7053
|
-
*/
|
|
7054
|
-
findById(id: Uuid): Promise<AIConversation | null>;
|
|
7055
|
-
/**
|
|
7056
|
-
* List conversations for current user.
|
|
7057
|
-
* Automatically filtered by current tenant and user context.
|
|
7058
|
-
*/
|
|
7059
|
-
list(options?: {
|
|
6741
|
+
interface WorkflowInstancesRepository {
|
|
6742
|
+
findById(id: Uuid): Promise<DBWorkflowInstance | null>;
|
|
6743
|
+
findByWorkflowId(workflowId: Uuid, options?: {
|
|
7060
6744
|
limit?: number;
|
|
7061
6745
|
offset?: number;
|
|
7062
|
-
|
|
7063
|
-
}): Promise<
|
|
7064
|
-
|
|
7065
|
-
total: number;
|
|
7066
|
-
}>;
|
|
7067
|
-
/**
|
|
7068
|
-
* Create conversation.
|
|
7069
|
-
* Tenant ID and User ID are automatically set from context.
|
|
7070
|
-
*/
|
|
7071
|
-
create(data: {
|
|
7072
|
-
title?: string;
|
|
7073
|
-
}): Promise<AIConversation>;
|
|
7074
|
-
/**
|
|
7075
|
-
* Update conversation title.
|
|
7076
|
-
* Automatically filtered by current tenant context.
|
|
7077
|
-
*/
|
|
7078
|
-
updateTitle(id: Uuid, title: string): Promise<AIConversation | null>;
|
|
7079
|
-
/**
|
|
7080
|
-
* Soft delete conversation.
|
|
7081
|
-
* Automatically filtered by current tenant context.
|
|
7082
|
-
*/
|
|
7083
|
-
delete(id: Uuid): Promise<boolean>;
|
|
7084
|
-
/**
|
|
7085
|
-
* Add message to conversation.
|
|
7086
|
-
* Automatically updates conversation stats.
|
|
7087
|
-
*/
|
|
7088
|
-
addMessage(input: CreateAIMessageInput): Promise<AIMessage>;
|
|
7089
|
-
/**
|
|
7090
|
-
* List messages in a conversation.
|
|
7091
|
-
* Automatically filtered by current tenant context (via conversation ownership).
|
|
7092
|
-
*/
|
|
7093
|
-
listMessages(conversationId: Uuid, options?: {
|
|
6746
|
+
status?: InstanceStatus;
|
|
6747
|
+
}): Promise<DBWorkflowInstance[]>;
|
|
6748
|
+
findByWorkflowName(workflowName: string, options?: {
|
|
7094
6749
|
limit?: number;
|
|
7095
6750
|
offset?: number;
|
|
7096
|
-
|
|
7097
|
-
|
|
6751
|
+
status?: InstanceStatus;
|
|
6752
|
+
}): Promise<DBWorkflowInstance[]>;
|
|
6753
|
+
list(options?: ListOptions): Promise<{
|
|
6754
|
+
instances: DBWorkflowInstance[];
|
|
7098
6755
|
total: number;
|
|
7099
6756
|
}>;
|
|
6757
|
+
listByStatus(status: InstanceStatus): Promise<DBWorkflowInstance[]>;
|
|
6758
|
+
create(data: CreateDBWorkflowInstance): Promise<DBWorkflowInstance>;
|
|
6759
|
+
update(id: Uuid, data: Partial<UpdateDBWorkflowInstance>): Promise<DBWorkflowInstance>;
|
|
6760
|
+
upsert(data: CreateDBWorkflowInstance & {
|
|
6761
|
+
id: string;
|
|
6762
|
+
}): Promise<DBWorkflowInstance>;
|
|
7100
6763
|
/**
|
|
7101
|
-
*
|
|
7102
|
-
*
|
|
7103
|
-
|
|
7104
|
-
|
|
7105
|
-
|
|
7106
|
-
|
|
7107
|
-
* Repository for AI user memory (preferences and learned facts).
|
|
7108
|
-
*
|
|
7109
|
-
* This repository is optional - if not provided in the DatabaseAdapter,
|
|
7110
|
-
* AI personalization features are disabled.
|
|
7111
|
-
*
|
|
7112
|
-
* All operations are automatically scoped to the current tenant and user
|
|
7113
|
-
* from the execution context (via AsyncLocalStorage).
|
|
7114
|
-
*/
|
|
7115
|
-
interface AIUserMemoryRepository {
|
|
7116
|
-
/**
|
|
7117
|
-
* Get memory for current user.
|
|
7118
|
-
* Automatically filtered by current tenant and user context.
|
|
7119
|
-
* Returns null if no memory exists yet.
|
|
7120
|
-
*/
|
|
7121
|
-
get(): Promise<AIUserMemory | null>;
|
|
7122
|
-
/**
|
|
7123
|
-
* Create or update memory for current user.
|
|
7124
|
-
* Tenant ID and User ID are automatically set from context.
|
|
7125
|
-
*/
|
|
7126
|
-
upsert(data: {
|
|
7127
|
-
preferences?: Record<string, unknown>;
|
|
7128
|
-
facts?: string[];
|
|
7129
|
-
}): Promise<AIUserMemory>;
|
|
7130
|
-
/**
|
|
7131
|
-
* Add a fact to user memory.
|
|
7132
|
-
* Automatically appends to existing facts.
|
|
7133
|
-
*/
|
|
7134
|
-
addFact(fact: string): Promise<AIUserMemory>;
|
|
7135
|
-
/**
|
|
7136
|
-
* Remove a fact from user memory.
|
|
7137
|
-
*/
|
|
7138
|
-
removeFact(fact: string): Promise<AIUserMemory>;
|
|
7139
|
-
/**
|
|
7140
|
-
* Update a specific preference.
|
|
7141
|
-
*/
|
|
7142
|
-
setPreference(key: string, value: unknown): Promise<AIUserMemory>;
|
|
7143
|
-
/**
|
|
7144
|
-
* Clear all memory for current user.
|
|
7145
|
-
*/
|
|
7146
|
-
clear(): Promise<void>;
|
|
7147
|
-
}
|
|
7148
|
-
/**
|
|
7149
|
-
* Repository for AI usage metrics.
|
|
7150
|
-
*
|
|
7151
|
-
* This repository is optional - if not provided in the DatabaseAdapter,
|
|
7152
|
-
* AI usage tracking is disabled.
|
|
7153
|
-
*
|
|
7154
|
-
* All operations are automatically scoped to the current tenant
|
|
7155
|
-
* from the execution context (via AsyncLocalStorage).
|
|
7156
|
-
*/
|
|
7157
|
-
interface AIUsageMetricsRepository {
|
|
7158
|
-
/**
|
|
7159
|
-
* Record a usage event (increments counters for the current date).
|
|
7160
|
-
* Automatically handles upsert for the current date.
|
|
7161
|
-
*/
|
|
7162
|
-
recordUsage(data: {
|
|
7163
|
-
provider: string;
|
|
7164
|
-
tokens: number;
|
|
7165
|
-
cost: number;
|
|
7166
|
-
toolName?: string;
|
|
7167
|
-
}): Promise<void>;
|
|
7168
|
-
/**
|
|
7169
|
-
* Get usage metrics for a date range.
|
|
7170
|
-
* Automatically filtered by current tenant context.
|
|
7171
|
-
*/
|
|
7172
|
-
getByDateRange(startDate: Date, endDate: Date): Promise<AIUsageMetrics[]>;
|
|
7173
|
-
/**
|
|
7174
|
-
* Get aggregated usage for current month.
|
|
7175
|
-
* Automatically filtered by current tenant context.
|
|
6764
|
+
* Find instances that reference a specific record in their slot context.
|
|
6765
|
+
* Searches in context.slots for slots where objectName and id match.
|
|
6766
|
+
*
|
|
6767
|
+
* @param objectName - Object name to match in slot data
|
|
6768
|
+
* @param recordId - Record ID to match in slot data
|
|
6769
|
+
* @param options - Optional filtering options
|
|
7176
6770
|
*/
|
|
7177
|
-
|
|
7178
|
-
|
|
7179
|
-
|
|
7180
|
-
|
|
6771
|
+
findByRecordInSlots(objectName: string, recordId: string, options?: {
|
|
6772
|
+
status?: InstanceStatus;
|
|
6773
|
+
limit?: number;
|
|
6774
|
+
offset?: number;
|
|
6775
|
+
}): Promise<{
|
|
6776
|
+
instances: DBWorkflowInstance[];
|
|
6777
|
+
total: number;
|
|
7181
6778
|
}>;
|
|
7182
6779
|
}
|
|
6780
|
+
/**
|
|
6781
|
+
* Repository for workflow invitations.
|
|
6782
|
+
*/
|
|
6783
|
+
interface WorkflowInvitationsRepository {
|
|
6784
|
+
findById(id: Uuid): Promise<DBWorkflowInvitation | null>;
|
|
6785
|
+
findByInstanceId(instanceId: Uuid): Promise<DBWorkflowInvitation[]>;
|
|
6786
|
+
findByEmail(email: string): Promise<DBWorkflowInvitation[]>;
|
|
6787
|
+
create(data: CreateDBWorkflowInvitation): Promise<DBWorkflowInvitation>;
|
|
6788
|
+
update(id: Uuid, data: UpdateDBWorkflowInvitation): Promise<DBWorkflowInvitation>;
|
|
6789
|
+
}
|
|
6790
|
+
/**
|
|
6791
|
+
* Repository for workflow access grants.
|
|
6792
|
+
*/
|
|
6793
|
+
interface WorkflowAccessGrantsRepository {
|
|
6794
|
+
findById(id: Uuid): Promise<DBWorkflowAccessGrant | null>;
|
|
6795
|
+
findByInvitationId(invitationId: Uuid): Promise<DBWorkflowAccessGrant[]>;
|
|
6796
|
+
findByInstanceId(instanceId: Uuid): Promise<DBWorkflowAccessGrant[]>;
|
|
6797
|
+
findByEmail(email: string): Promise<DBWorkflowAccessGrant[]>;
|
|
6798
|
+
create(data: CreateDBWorkflowAccessGrant): Promise<DBWorkflowAccessGrant>;
|
|
6799
|
+
update(id: Uuid, data: UpdateDBWorkflowAccessGrant): Promise<DBWorkflowAccessGrant>;
|
|
6800
|
+
}
|
|
7183
6801
|
|
|
7184
6802
|
/**
|
|
7185
6803
|
* Repository for document templates.
|
|
7186
6804
|
*
|
|
7187
6805
|
* Templates define the structure of documents (slots, processing, etc.).
|
|
7188
|
-
* System templates are available to all tenants.
|
|
7189
|
-
* Custom templates are tenant-specific.
|
|
7190
|
-
*
|
|
7191
|
-
* All operations are automatically scoped to the current tenant
|
|
7192
|
-
* from the execution context (via AsyncLocalStorage).
|
|
7193
6806
|
*/
|
|
7194
6807
|
interface DocumentTemplatesRepository {
|
|
7195
|
-
/**
|
|
7196
|
-
* Find template by ID.
|
|
7197
|
-
* Returns system templates or tenant-specific templates.
|
|
7198
|
-
*/
|
|
7199
6808
|
findById(id: Uuid): Promise<DocumentTemplate | null>;
|
|
7200
|
-
/**
|
|
7201
|
-
* Find template by name.
|
|
7202
|
-
* First checks tenant-specific templates, then falls back to system templates.
|
|
7203
|
-
*/
|
|
7204
6809
|
findByName(name: string): Promise<DocumentTemplate | null>;
|
|
7205
|
-
/**
|
|
7206
|
-
* Find multiple templates by names.
|
|
7207
|
-
*/
|
|
7208
6810
|
findByNames(names: string[]): Promise<DocumentTemplate[]>;
|
|
7209
|
-
/**
|
|
7210
|
-
* List all available templates.
|
|
7211
|
-
* Includes both system templates and tenant-specific templates.
|
|
7212
|
-
*/
|
|
7213
6811
|
list(options?: DocumentTemplateListOptions): Promise<DocumentTemplate[]>;
|
|
7214
|
-
/**
|
|
7215
|
-
* Create a custom template.
|
|
7216
|
-
* Tenant ID is automatically set from context.
|
|
7217
|
-
*/
|
|
7218
6812
|
create(data: CreateDocumentTemplate): Promise<DocumentTemplate>;
|
|
7219
|
-
/**
|
|
7220
|
-
* Update a template.
|
|
7221
|
-
* Only tenant-specific templates can be updated.
|
|
7222
|
-
*/
|
|
7223
6813
|
update(id: Uuid, data: UpdateDocumentTemplate): Promise<DocumentTemplate>;
|
|
7224
|
-
/**
|
|
7225
|
-
* Delete a template.
|
|
7226
|
-
* Only tenant-specific templates can be deleted.
|
|
7227
|
-
*/
|
|
7228
6814
|
delete(id: Uuid): Promise<void>;
|
|
7229
6815
|
}
|
|
7230
6816
|
/**
|
|
7231
6817
|
* Repository for documents.
|
|
7232
6818
|
*
|
|
7233
6819
|
* Documents are wrappers around files with templates, slots, and processing.
|
|
7234
|
-
* They are linked to records via record.values (document attribute).
|
|
7235
|
-
*
|
|
7236
|
-
* All operations are automatically scoped to the current tenant
|
|
7237
|
-
* from the execution context (via AsyncLocalStorage).
|
|
7238
6820
|
*/
|
|
7239
6821
|
interface DocumentsRepository {
|
|
7240
|
-
/**
|
|
7241
|
-
* Create a new document.
|
|
7242
|
-
* Tenant ID is automatically set from context.
|
|
7243
|
-
*/
|
|
7244
6822
|
create(data: CreateDocument): Promise<Document>;
|
|
7245
|
-
/**
|
|
7246
|
-
* Find document by ID.
|
|
7247
|
-
* Automatically filtered by current tenant context.
|
|
7248
|
-
*/
|
|
7249
6823
|
findById(id: Uuid): Promise<Document | null>;
|
|
7250
|
-
/**
|
|
7251
|
-
* Find multiple documents by IDs.
|
|
7252
|
-
* Automatically filtered by current tenant context.
|
|
7253
|
-
*/
|
|
7254
6824
|
findByIds(ids: Uuid[]): Promise<Document[]>;
|
|
7255
|
-
/**
|
|
7256
|
-
* Update a document.
|
|
7257
|
-
* Automatically filtered by current tenant context.
|
|
7258
|
-
*/
|
|
7259
6825
|
update(id: Uuid, data: UpdateDocument): Promise<Document>;
|
|
7260
|
-
/**
|
|
7261
|
-
* Update document status.
|
|
7262
|
-
* Convenience method for status transitions.
|
|
7263
|
-
*/
|
|
7264
6826
|
updateStatus(id: Uuid, status: DocumentStatus): Promise<Document>;
|
|
7265
|
-
/**
|
|
7266
|
-
* Soft delete a document.
|
|
7267
|
-
* Automatically filtered by current tenant context.
|
|
7268
|
-
*/
|
|
7269
6827
|
delete(id: Uuid): Promise<void>;
|
|
7270
|
-
/**
|
|
7271
|
-
* Hard delete a document.
|
|
7272
|
-
* Automatically filtered by current tenant context.
|
|
7273
|
-
*/
|
|
7274
6828
|
hardDelete(id: Uuid): Promise<void>;
|
|
7275
|
-
/**
|
|
7276
|
-
* List documents with optional filters.
|
|
7277
|
-
* Automatically filtered by current tenant context.
|
|
7278
|
-
*/
|
|
7279
6829
|
list(options?: DocumentListOptions): Promise<Document[]>;
|
|
7280
|
-
/**
|
|
7281
|
-
* Search documents by text.
|
|
7282
|
-
* Uses full-text search on title, description, and OCR content.
|
|
7283
|
-
*/
|
|
7284
6830
|
search(query: string, options?: DocumentListOptions): Promise<Document[]>;
|
|
7285
6831
|
}
|
|
7286
6832
|
/**
|
|
7287
6833
|
* Repository for document slots.
|
|
7288
6834
|
*
|
|
7289
6835
|
* Slots are individual file entries within a document.
|
|
7290
|
-
* Each slot corresponds to a slot definition in the template.
|
|
7291
6836
|
*/
|
|
7292
6837
|
interface DocumentSlotsRepository {
|
|
7293
|
-
/**
|
|
7294
|
-
* Create a slot (upload a file to a document).
|
|
7295
|
-
*/
|
|
7296
6838
|
create(data: CreateDocumentSlot): Promise<DocumentSlot>;
|
|
7297
|
-
/**
|
|
7298
|
-
* Find slot by ID.
|
|
7299
|
-
*/
|
|
7300
6839
|
findById(id: Uuid): Promise<DocumentSlot | null>;
|
|
7301
|
-
/**
|
|
7302
|
-
* Find all slots for a document.
|
|
7303
|
-
*/
|
|
7304
6840
|
findByDocumentId(documentId: Uuid): Promise<DocumentSlot[]>;
|
|
7305
|
-
/**
|
|
7306
|
-
* Find a specific slot by document and slot name.
|
|
7307
|
-
*/
|
|
7308
6841
|
findByDocumentAndSlot(documentId: Uuid, slotName: string): Promise<DocumentSlot | null>;
|
|
7309
|
-
/**
|
|
7310
|
-
* Update a slot (status, OCR results, etc.).
|
|
7311
|
-
*/
|
|
7312
6842
|
update(id: Uuid, data: UpdateDocumentSlot): Promise<DocumentSlot>;
|
|
7313
|
-
/**
|
|
7314
|
-
* Update slot status.
|
|
7315
|
-
*/
|
|
7316
6843
|
updateStatus(id: Uuid, status: SlotStatus): Promise<DocumentSlot>;
|
|
7317
|
-
/**
|
|
7318
|
-
* Delete a slot.
|
|
7319
|
-
*/
|
|
7320
6844
|
delete(id: Uuid): Promise<void>;
|
|
7321
|
-
/**
|
|
7322
|
-
* Delete all slots for a document.
|
|
7323
|
-
*/
|
|
7324
6845
|
deleteByDocumentId(documentId: Uuid): Promise<void>;
|
|
7325
6846
|
}
|
|
7326
6847
|
/**
|
|
7327
6848
|
* Repository for document processing jobs.
|
|
7328
6849
|
*
|
|
7329
6850
|
* Jobs track async processing tasks (OCR, signature, verification).
|
|
7330
|
-
* They are linked to documents and optionally to specific slots.
|
|
7331
6851
|
*/
|
|
7332
6852
|
interface DocumentJobsRepository {
|
|
7333
|
-
/**
|
|
7334
|
-
* Create a processing job.
|
|
7335
|
-
* Tenant ID is automatically set from context.
|
|
7336
|
-
*/
|
|
7337
6853
|
create(data: CreateProcessingJob): Promise<ProcessingJob>;
|
|
7338
|
-
/**
|
|
7339
|
-
* Find job by ID.
|
|
7340
|
-
*/
|
|
7341
6854
|
findById(id: Uuid): Promise<ProcessingJob | null>;
|
|
7342
|
-
/**
|
|
7343
|
-
* Find all jobs for a document.
|
|
7344
|
-
*/
|
|
7345
6855
|
findByDocumentId(documentId: Uuid): Promise<ProcessingJob[]>;
|
|
7346
|
-
/**
|
|
7347
|
-
* Find jobs by status (for processing queue).
|
|
7348
|
-
*/
|
|
7349
6856
|
findByStatus(status: ProcessingJobStatus, limit?: number): Promise<ProcessingJob[]>;
|
|
7350
|
-
/**
|
|
7351
|
-
* Find pending jobs (for processing queue).
|
|
7352
|
-
*/
|
|
7353
6857
|
findPending(limit?: number): Promise<ProcessingJob[]>;
|
|
7354
|
-
/**
|
|
7355
|
-
* Update a job.
|
|
7356
|
-
*/
|
|
7357
6858
|
update(id: Uuid, data: UpdateProcessingJob): Promise<ProcessingJob>;
|
|
7358
|
-
/**
|
|
7359
|
-
* Mark job as started.
|
|
7360
|
-
*/
|
|
7361
6859
|
markStarted(id: Uuid): Promise<ProcessingJob>;
|
|
7362
|
-
/**
|
|
7363
|
-
* Mark job as completed with result.
|
|
7364
|
-
*/
|
|
7365
6860
|
markCompleted(id: Uuid, result: Record<string, unknown>): Promise<ProcessingJob>;
|
|
7366
|
-
/**
|
|
7367
|
-
* Mark job as failed with error.
|
|
7368
|
-
*/
|
|
7369
6861
|
markFailed(id: Uuid, error: string): Promise<ProcessingJob>;
|
|
7370
|
-
/**
|
|
7371
|
-
* Cancel a job.
|
|
7372
|
-
*/
|
|
7373
6862
|
cancel(id: Uuid): Promise<ProcessingJob>;
|
|
7374
|
-
/**
|
|
7375
|
-
* Find job by external ID (e.g., signature provider ID).
|
|
7376
|
-
* Used for webhook callbacks.
|
|
7377
|
-
*/
|
|
7378
6863
|
findByExternalId?(externalId: string): Promise<ProcessingJob | null>;
|
|
7379
6864
|
}
|
|
7380
6865
|
/**
|
|
@@ -7390,46 +6875,85 @@ interface DocumentGenerationTemplateListOptions {
|
|
|
7390
6875
|
}
|
|
7391
6876
|
/**
|
|
7392
6877
|
* Repository for document generation templates.
|
|
7393
|
-
*
|
|
7394
|
-
* Document generation templates define how to generate documents by injecting
|
|
7395
|
-
* workflow context data into PDF or DOCX template files.
|
|
7396
|
-
*
|
|
7397
|
-
* All operations are automatically scoped to the current tenant
|
|
7398
|
-
* from the execution context (via AsyncLocalStorage).
|
|
7399
6878
|
*/
|
|
7400
6879
|
interface DocumentGenerationTemplatesRepository {
|
|
7401
|
-
/**
|
|
7402
|
-
* Find template by ID.
|
|
7403
|
-
* Automatically filtered by current tenant context.
|
|
7404
|
-
*/
|
|
7405
6880
|
findById(id: Uuid): Promise<DocumentGenerationTemplate | null>;
|
|
7406
|
-
/**
|
|
7407
|
-
* Find template by name.
|
|
7408
|
-
* Automatically filtered by current tenant context.
|
|
7409
|
-
*/
|
|
7410
6881
|
findByName(name: string): Promise<DocumentGenerationTemplate | null>;
|
|
7411
|
-
/**
|
|
7412
|
-
* List all templates for current tenant.
|
|
7413
|
-
* Automatically filtered by current tenant context.
|
|
7414
|
-
*/
|
|
7415
6882
|
list(options?: DocumentGenerationTemplateListOptions): Promise<DocumentGenerationTemplate[]>;
|
|
7416
|
-
/**
|
|
7417
|
-
* Create template.
|
|
7418
|
-
* Tenant ID is automatically set from context.
|
|
7419
|
-
*/
|
|
7420
6883
|
create(data: CreateDocumentGenerationTemplate): Promise<DocumentGenerationTemplate>;
|
|
7421
|
-
/**
|
|
7422
|
-
* Update template.
|
|
7423
|
-
* Automatically filtered by current tenant context.
|
|
7424
|
-
*/
|
|
7425
6884
|
update(id: Uuid, data: UpdateDocumentGenerationTemplate): Promise<DocumentGenerationTemplate>;
|
|
7426
|
-
/**
|
|
7427
|
-
* Delete template.
|
|
7428
|
-
* Automatically filtered by current tenant context.
|
|
7429
|
-
*/
|
|
7430
6885
|
delete(id: Uuid): Promise<void>;
|
|
7431
6886
|
}
|
|
7432
6887
|
|
|
6888
|
+
/**
|
|
6889
|
+
* Repository for AI conversations and messages.
|
|
6890
|
+
*
|
|
6891
|
+
* This repository is optional - if not provided in the DatabaseAdapter,
|
|
6892
|
+
* AI conversation history features are disabled.
|
|
6893
|
+
*/
|
|
6894
|
+
interface AIConversationsRepository {
|
|
6895
|
+
findById(id: Uuid): Promise<AIConversation | null>;
|
|
6896
|
+
list(options?: {
|
|
6897
|
+
limit?: number;
|
|
6898
|
+
offset?: number;
|
|
6899
|
+
includeDeleted?: boolean;
|
|
6900
|
+
}): Promise<{
|
|
6901
|
+
conversations: AIConversation[];
|
|
6902
|
+
total: number;
|
|
6903
|
+
}>;
|
|
6904
|
+
create(data: {
|
|
6905
|
+
title?: string;
|
|
6906
|
+
}): Promise<AIConversation>;
|
|
6907
|
+
updateTitle(id: Uuid, title: string): Promise<AIConversation | null>;
|
|
6908
|
+
delete(id: Uuid): Promise<boolean>;
|
|
6909
|
+
addMessage(input: CreateAIMessageInput): Promise<AIMessage>;
|
|
6910
|
+
listMessages(conversationId: Uuid, options?: {
|
|
6911
|
+
limit?: number;
|
|
6912
|
+
offset?: number;
|
|
6913
|
+
}): Promise<{
|
|
6914
|
+
messages: AIMessage[];
|
|
6915
|
+
total: number;
|
|
6916
|
+
}>;
|
|
6917
|
+
getRecentMessages(conversationId: Uuid, count?: number): Promise<AIMessage[]>;
|
|
6918
|
+
}
|
|
6919
|
+
/**
|
|
6920
|
+
* Repository for AI user memory (preferences and learned facts).
|
|
6921
|
+
*
|
|
6922
|
+
* This repository is optional - if not provided in the DatabaseAdapter,
|
|
6923
|
+
* AI personalization features are disabled.
|
|
6924
|
+
*/
|
|
6925
|
+
interface AIUserMemoryRepository {
|
|
6926
|
+
get(): Promise<AIUserMemory | null>;
|
|
6927
|
+
upsert(data: {
|
|
6928
|
+
preferences?: Record<string, unknown>;
|
|
6929
|
+
facts?: string[];
|
|
6930
|
+
}): Promise<AIUserMemory>;
|
|
6931
|
+
addFact(fact: string): Promise<AIUserMemory>;
|
|
6932
|
+
removeFact(fact: string): Promise<AIUserMemory>;
|
|
6933
|
+
setPreference(key: string, value: unknown): Promise<AIUserMemory>;
|
|
6934
|
+
clear(): Promise<void>;
|
|
6935
|
+
}
|
|
6936
|
+
/**
|
|
6937
|
+
* Repository for AI usage metrics.
|
|
6938
|
+
*
|
|
6939
|
+
* This repository is optional - if not provided in the DatabaseAdapter,
|
|
6940
|
+
* AI usage tracking is disabled.
|
|
6941
|
+
*/
|
|
6942
|
+
interface AIUsageMetricsRepository {
|
|
6943
|
+
recordUsage(data: {
|
|
6944
|
+
provider: string;
|
|
6945
|
+
tokens: number;
|
|
6946
|
+
cost: number;
|
|
6947
|
+
toolName?: string;
|
|
6948
|
+
}): Promise<void>;
|
|
6949
|
+
getByDateRange(startDate: Date, endDate: Date): Promise<AIUsageMetrics[]>;
|
|
6950
|
+
getCurrentMonthUsage(): Promise<{
|
|
6951
|
+
requestCount: number;
|
|
6952
|
+
totalTokens: number;
|
|
6953
|
+
totalCost: number;
|
|
6954
|
+
}>;
|
|
6955
|
+
}
|
|
6956
|
+
|
|
7433
6957
|
/**
|
|
7434
6958
|
* File content type - supports various formats
|
|
7435
6959
|
* Use Uint8Array for cross-platform compatibility
|
|
@@ -8415,14 +7939,6 @@ declare abstract class SchemaContextAwareRepository extends BaseRepository {
|
|
|
8415
7939
|
*/
|
|
8416
7940
|
protected getSchemaByNameFromContext(objectName: string): ObjectDefinition | undefined;
|
|
8417
7941
|
}
|
|
8418
|
-
/**
|
|
8419
|
-
* @deprecated Use `BaseRepository` instead. Will be removed in a future version.
|
|
8420
|
-
*/
|
|
8421
|
-
declare const TenantAwareRepository: typeof BaseRepository;
|
|
8422
|
-
/**
|
|
8423
|
-
* @deprecated Use `BaseService` instead. Will be removed in a future version.
|
|
8424
|
-
*/
|
|
8425
|
-
declare const TenantAwareService: typeof BaseService;
|
|
8426
7942
|
|
|
8427
7943
|
/**
|
|
8428
7944
|
* Service for audit logging.
|
|
@@ -9256,6 +8772,11 @@ declare class RecordService extends BaseService {
|
|
|
9256
8772
|
skipHooks?: boolean;
|
|
9257
8773
|
hookMetadata?: Record<string, unknown>;
|
|
9258
8774
|
}): Promise<ObjectRecord>;
|
|
8775
|
+
/**
|
|
8776
|
+
* Invalidate all caches related to a record (record cache + lists + global search)
|
|
8777
|
+
* @private
|
|
8778
|
+
*/
|
|
8779
|
+
private invalidateRecordCaches;
|
|
9259
8780
|
/**
|
|
9260
8781
|
* List records for an object with pagination.
|
|
9261
8782
|
* Delegates to RecordQueryService for permissions and policy handling.
|
|
@@ -10908,6 +10429,12 @@ interface ExecutorContext {
|
|
|
10908
10429
|
input?: Record<string, unknown>;
|
|
10909
10430
|
/** ID of the user/participant executing */
|
|
10910
10431
|
executorId?: string;
|
|
10432
|
+
/**
|
|
10433
|
+
* Object definitions for field validation (optional).
|
|
10434
|
+
* When provided, executors like FormExecutor can validate required fields
|
|
10435
|
+
* against attribute metadata.
|
|
10436
|
+
*/
|
|
10437
|
+
objectDefinitions?: ObjectDefinition[];
|
|
10911
10438
|
}
|
|
10912
10439
|
/**
|
|
10913
10440
|
* Interface for node executors.
|
|
@@ -11029,6 +10556,17 @@ declare class DocumentExecutor implements NodeExecutor<DocumentNode> {
|
|
|
11029
10556
|
execute(node: DocumentNode, _context: ExecutorContext): ExecutorResult;
|
|
11030
10557
|
canExecute(_node: DocumentNode, _context: ExecutorContext): boolean;
|
|
11031
10558
|
validate(node: DocumentNode): string[];
|
|
10559
|
+
/**
|
|
10560
|
+
* Validate that targetSlotIds reference existing slots in the workflow definition.
|
|
10561
|
+
* This is a context-aware validation that requires the workflow's slot definitions.
|
|
10562
|
+
*
|
|
10563
|
+
* @param node - The document node to validate
|
|
10564
|
+
* @param workflowSlots - All slots defined in the workflow
|
|
10565
|
+
* @returns Array of validation error messages
|
|
10566
|
+
*/
|
|
10567
|
+
validateSlotReferences(node: DocumentNode, workflowSlots: {
|
|
10568
|
+
id: string;
|
|
10569
|
+
}[]): string[];
|
|
11032
10570
|
}
|
|
11033
10571
|
|
|
11034
10572
|
/**
|
|
@@ -11446,6 +10984,7 @@ interface MockStores {
|
|
|
11446
10984
|
aiUserMemory: Map<string, AIUserMemory>;
|
|
11447
10985
|
aiUsageMetrics: Map<string, AIUsageMetrics>;
|
|
11448
10986
|
}
|
|
10987
|
+
|
|
11449
10988
|
/**
|
|
11450
10989
|
* Create an in-memory mock adapter for testing and development
|
|
11451
10990
|
*
|
|
@@ -11798,7 +11337,9 @@ declare class FileService extends BaseService {
|
|
|
11798
11337
|
* @param userId - User ID to check
|
|
11799
11338
|
* @returns true if user can access the file
|
|
11800
11339
|
*/
|
|
11801
|
-
checkAccess(fileId: string, userId: string
|
|
11340
|
+
checkAccess(fileId: string, userId: string, options?: {
|
|
11341
|
+
isAdmin?: boolean;
|
|
11342
|
+
}): Promise<boolean>;
|
|
11802
11343
|
/**
|
|
11803
11344
|
* @deprecated Use checkAccess() instead
|
|
11804
11345
|
*/
|
|
@@ -12507,7 +12048,8 @@ declare class WorkflowInstanceService extends BaseService {
|
|
|
12507
12048
|
*/
|
|
12508
12049
|
cancelWorkflow(instanceId: string, reason?: string): Promise<WorkflowInstance>;
|
|
12509
12050
|
/**
|
|
12510
|
-
* Get an instance by ID
|
|
12051
|
+
* Get an instance by ID.
|
|
12052
|
+
* Automatically marks expired instances as "failed" if their expiresAt has passed.
|
|
12511
12053
|
*/
|
|
12512
12054
|
getInstance(id: string): Promise<WorkflowInstance | null>;
|
|
12513
12055
|
/**
|
|
@@ -12555,17 +12097,41 @@ declare class WorkflowInstanceService extends BaseService {
|
|
|
12555
12097
|
* Execute the current node and continue until wait/complete/error
|
|
12556
12098
|
*/
|
|
12557
12099
|
private executeCurrentNode;
|
|
12100
|
+
/**
|
|
12101
|
+
* Check a list of instances for expiration and mark any expired non-terminal
|
|
12102
|
+
* instances as "failed". Saves updated instances to the database.
|
|
12103
|
+
*/
|
|
12104
|
+
private markExpiredInstances;
|
|
12558
12105
|
private mergeContext;
|
|
12559
12106
|
private getNodeLabel;
|
|
12560
12107
|
/**
|
|
12561
|
-
* Persist all slots as records in the database.
|
|
12108
|
+
* Persist all slots as records in the database using a saga pattern.
|
|
12562
12109
|
* - Slots with mode "create" create new records
|
|
12563
12110
|
* - Slots with mode "select" or "optional" with existing ID update the record
|
|
12564
12111
|
* - Slots with mode "optional" without ID create new records
|
|
12565
12112
|
*
|
|
12113
|
+
* If any slot fails to persist, all previously persisted slots in this batch
|
|
12114
|
+
* are rolled back (best-effort): created records are deleted, updated records
|
|
12115
|
+
* are restored to their previous state.
|
|
12116
|
+
*
|
|
12566
12117
|
* Returns updated context with createdRecordIds populated.
|
|
12567
12118
|
*/
|
|
12568
12119
|
private persistSlots;
|
|
12120
|
+
/**
|
|
12121
|
+
* Snapshot a record's current data for potential rollback.
|
|
12122
|
+
* Returns the record data or undefined if the record cannot be read.
|
|
12123
|
+
*/
|
|
12124
|
+
private snapshotRecord;
|
|
12125
|
+
/**
|
|
12126
|
+
* Rollback completed slot persistence operations in reverse order (saga compensation).
|
|
12127
|
+
*
|
|
12128
|
+
* This is BEST EFFORT: errors during rollback are logged but never re-thrown.
|
|
12129
|
+
* - For "create" operations: deletes the created record
|
|
12130
|
+
* - For "update" operations: restores the previous data snapshot
|
|
12131
|
+
*
|
|
12132
|
+
* @returns Array of slot IDs that were successfully rolled back
|
|
12133
|
+
*/
|
|
12134
|
+
private rollbackSlotOperations;
|
|
12569
12135
|
/**
|
|
12570
12136
|
* Clean slot data by removing undefined and null values.
|
|
12571
12137
|
* This prevents form submissions from overwriting existing record values
|
|
@@ -13340,7 +12906,10 @@ declare class DocumentRendererService {
|
|
|
13340
12906
|
*/
|
|
13341
12907
|
declare class GeocodingService {
|
|
13342
12908
|
private readonly adapter;
|
|
13343
|
-
|
|
12909
|
+
private readonly timeoutMs;
|
|
12910
|
+
constructor(adapter: GeocodingAdapter, options?: {
|
|
12911
|
+
timeoutMs?: number;
|
|
12912
|
+
});
|
|
13344
12913
|
/**
|
|
13345
12914
|
* Search for address suggestions as the user types
|
|
13346
12915
|
*/
|
|
@@ -13415,7 +12984,9 @@ declare class GlobalSearchService extends BaseService {
|
|
|
13415
12984
|
* @param options - Search options
|
|
13416
12985
|
* @returns Results grouped by object name
|
|
13417
12986
|
*/
|
|
13418
|
-
searchGrouped(query: string, options?: Omit<GlobalSearchOptions, "limit" | "offset">
|
|
12987
|
+
searchGrouped(query: string, options?: Omit<GlobalSearchOptions, "limit" | "offset"> & {
|
|
12988
|
+
limitPerGroup?: number;
|
|
12989
|
+
}): Promise<{
|
|
13419
12990
|
groups: Array<{
|
|
13420
12991
|
objectName: string;
|
|
13421
12992
|
objectLabel: string;
|
|
@@ -13567,12 +13138,19 @@ interface ViewSyncResult {
|
|
|
13567
13138
|
error: string;
|
|
13568
13139
|
}>;
|
|
13569
13140
|
}
|
|
13141
|
+
/**
|
|
13142
|
+
* Logger interface for view sync operations
|
|
13143
|
+
*/
|
|
13144
|
+
interface ViewSyncLogger {
|
|
13145
|
+
info(message: string): void;
|
|
13146
|
+
}
|
|
13570
13147
|
/**
|
|
13571
13148
|
* Options for view sync
|
|
13572
13149
|
*/
|
|
13573
13150
|
interface ViewSyncOptions {
|
|
13574
13151
|
dryRun?: boolean;
|
|
13575
13152
|
verbose?: boolean;
|
|
13153
|
+
logger?: ViewSyncLogger;
|
|
13576
13154
|
}
|
|
13577
13155
|
/**
|
|
13578
13156
|
* Sync native views from registry to database
|
|
@@ -13766,4 +13344,4 @@ interface FullSyncOptions extends SyncOptions, ViewSyncOptions {
|
|
|
13766
13344
|
*/
|
|
13767
13345
|
declare function syncAll(adapter: DatabaseAdapter, objectRegistry: typeof registry, nativeViewRegistry: typeof viewRegistry, options?: FullSyncOptions): Promise<FullSyncResult>;
|
|
13768
13346
|
|
|
13769
|
-
export { type OcrAdapter as $, type Attribute as A, type SortRule as B, type CheckboxAttribute as C, type DateAttribute as D, type DirectTableTab as E, type FileAttribute as F, type Group as G, type WorkflowConfig as H, type InferAttributeValue as I, type SlotMode as J, type ConditionGroup as K, type LocationAttribute as L, type MultiselectAttribute as M, type NumberAttribute as N, type ObjectAction as O, type PhoneAttribute as P, type ConditionRule as Q, type RichtextAttribute as R, type SystemResource as S, type TextAttribute as T, type UserAttribute as U, type ViewLayout as V, type WorkflowTheme as W, type WorkflowNode as X, type WorkflowDefinition as Y, type FlowRow as Z, type DocumentTemplate as _, type DocumentAttribute as a, type AuditActorType as a$, type OcrInput as a0, type OcrOptions as a1, type OcrResult as a2, type OcrPage as a3, type OcrTextBlock as a4, type BoundingBox as a5, type SignatureAdapter as a6, type CreateSignatureInput as a7, type SignerRequest as a8, type SignaturePosition as a9, type AIBatchQuestionAnswer as aA, type AITodoStatus as aB, type AITodoItem as aC, type AITodoList as aD, type AIMessageAttachment as aE, type AIConversation as aF, type AIMessage as aG, type AIToolCallRecord as aH, type AIUserMemory as aI, type AIUsageMetrics as aJ, type AIProviderMetrics as aK, type CreateAIMessageInput as aL, type StatusGroup as aM, type AttributeGroup as aN, type BaseAttribute as aO, type NumberUnit as aP, type DateFormat as aQ, type DateValue as aR, type Phone as aS, type Currency as aT, type Location as aU, type LocationGranularity as aV, RELATION_TARGET_ANY as aW, type RelationAttribute as aX, isUniversalRelation as aY, type AuditResourceType as aZ, type AuditAction as a_, type SignatureRequestResult as aa, type SignatureStatusResult as ab, type SignerStatus as ac, type SignatureStatus as ad, type IdentityVerificationAdapter as ae, type VerifyInput as af, type VerificationResult as ag, type DocumentData as ah, type VerificationCheck as ai, type AIMessageRole as aj, type AIThinkingLevel as ak, type AIToolCallStatus as al, type AIToolCall as am, type AIChatMessagePartType as an, type TextPartData as ao, type ToolPartData as ap, type ThinkingPartData as aq, type ReasoningPartData as ar, type AIChatMessagePart as as, type AIChatMessage as at, type AIQuestionType as au, type AIQuestionOption as av, type AIQuestion as aw, type AIQuestionAnswer as ax, type AIBatchQuestionOption as ay, type AIBatchQuestion as az, type SystemAction as b, type NoValueOperator as b$, type AuditChange as b0, type AuditLogEntry as b1, type CreateAuditLogInput as b2, type AuditListOptions as b3, type AuditServiceOptions as b4, type VariableMapping as b5, type PdfTemplateField as b6, type TemplateSource as b7, type DocumentGenerationTemplate as b8, type CreateDocumentGenerationTemplate as b9, type FileVisibility as bA, type File as bB, type CreateFile as bC, type UpdateFile as bD, type TextFilterOperator as bE, type NumberFilterOperator as bF, type CheckboxFilterOperator as bG, type DateFilterOperator as bH, type SelectFilterOperator as bI, type MultiselectFilterOperator as bJ, type RelationFilterOperator as bK, type FilterOperator as bL, type RelativeDateValue as bM, type CurrencyFilterValue as bN, type PhoneFilterValue as bO, type FilterValue as bP, type FilterRule as bQ, type ExtendedFilterRule as bR, type FilterCombinator as bS, type FilterGroup as bT, type AdvancedFilterState as bU, isAdvancedFilterState as bV, toAdvancedFilterState as bW, toSimpleFilterState as bX, type SortDirection as bY, type QueryState as bZ, OPERATORS_BY_TYPE as b_, type UpdateDocumentGenerationTemplate as ba, type PendingDocumentRequest as bb, isPdfTemplateSource as bc, isDocxTemplateSource as bd, type DocumentSlotDefinition as be, type DocumentAutoProcessing as bf, type ExtractionMapping as bg, type ExtractionField as bh, type Document as bi, type DocumentStatus as bj, type DocumentSlot as bk, type SlotStatus as bl, type ProcessingJob as bm, type ProcessingJobType as bn, type ProcessingJobStatus as bo, type CreateDocument as bp, type UpdateDocument as bq, type CreateDocumentTemplate as br, type UpdateDocumentTemplate as bs, type CreateDocumentSlot as bt, type UpdateDocumentSlot as bu, type CreateProcessingJob as bv, type UpdateProcessingJob as bw, type DocumentListOptions as bx, type DocumentTemplateListOptions as by, type StorageProvider as bz, type TextAreaAttribute as c, type UserRole as c$, NO_VALUE_OPERATORS as c0, isNoValueOperator as c1, type FlowSlot as c2, type FlowRowField as c3, type FlowPage as c4, type FlowRelation as c5, type FlowStatus as c6, type FlowDefinition as c7, isFlowDefinition as c8, isFlowPublished as c9, type ExtractAttributes as cA, type TypedObjectRecord as cB, type ExtractObjectRecord as cC, type ExtractObjectRecordWithCustom as cD, RESERVED_ATTRIBUTE_NAMES as cE, SYSTEM_FIELD_NAMES as cF, type ReservedAttributeName as cG, type SystemFieldName as cH, type Timestamps as cI, type SharingMode as cJ, type ObjectAttribute as cK, type CompletionStatus as cL, type ObjectRecord as cM, type PermissionScope as cN, type Role as cO, type Permission as cP, type UserRoleAssignment as cQ, type EffectivePermissions as cR, type ObjectPermissions as cS, type SystemPermissions as cT, type CreateRoleInput as cU, type UpdateRoleInput as cV, type CreatePermissionInput as cW, type AssignRoleInput as cX, type PolicyContext as cY, type RecordPolicy as cZ, PolicyViolationError as c_, isSystemFlow as ca, type GeocodingSuggestion as cb, type GeocodingAutocompleteParams as cc, type ReverseGeocodingParams as cd, type GeocodingParams as ce, type GeocodingAdapter as cf, NoopGeocodingAdapter as cg, type AttributeSchema as ch, type InferRecordFromSchema as ci, type InferRecordWithRequirements as cj, type TypedAttribute as ck, type AttributeMap as cl, type AddAttribute as cm, type InferRecord as cn, type InferRecordInput as co, type InferRecordUpdate as cp, type CustomAttributeValue as cq, type WithCustomAttributes as cr, type RecordMetadata as cs, type SystemFields as ct, type ExtractRecord as cu, type ExtractRecordStrict as cv, type ExtractRecordInput as cw, type ExtractRecordInputStrict as cx, type ExtractRecordUpdate as cy, type ExtractRecordUpdateStrict as cz, type RichtextFeature as d, type CreateInvitationInput as d$, type UserStatus as d0, type UserProfile as d1, type CreateUserProfile as d2, type UpdateUserProfile as d3, type InviteUserInput as d4, type TabType as d5, type FormTab as d6, type CustomTab as d7, type ActivityTab as d8, type NotesTab as d9, isStartNode as dA, type ConditionOperator as dB, and as dC, eq as dD, inValues as dE, isConditionGroup as dF, isConditionRule as dG, isEmpty as dH, isNotEmpty as dI, neq as dJ, or as dK, type CanvasViewport as dL, type NodePosition as dM, type WorkflowLayout as dN, type WorkflowSlot as dO, type WorkflowStatus as dP, isSystemWorkflow as dQ, isWorkflowDefinition as dR, isWorkflowPublished as dS, type PendingAction as dT, type WorkflowError as dU, type WorkflowInstance as dV, type WorkflowTransition as dW, canResumeInstance as dX, createStartTransition as dY, isInstanceTerminal as dZ, isInstanceWaiting as d_, type FlowsTab as da, type DocumentsTab as db, isFormTab as dc, isTableTab as dd, isDirectTableTab as de, isInverseTableTab as df, isCustomTab as dg, isActivityTab as dh, isNotesTab as di, isFlowsTab as dj, isDocumentsTab as dk, type ConditionNode as dl, type DocumentNode as dm, type EndNode as dn, type FormFieldRef as dp, type FormNode as dq, type StartNode as dr, type WorkflowNodeType as ds, getNodeOutputs as dt, isAdvancedFormNode as du, isConditionNode as dv, isDocumentNode as dw, isEndNode as dx, isFormNode as dy, isSimpleFormNode as dz, type CurrencyAttribute as e, attributeConfigSchemas as e$, type CreateInvitationResult as e0, type InvitationStatus as e1, type WorkflowInvitation as e2, isInvitationAccepted as e3, isInvitationExpired as e4, isInvitationValid as e5, type CreateGrantInput as e6, type WorkflowAccessGrant as e7, canAccessNode as e8, isGrantExpired as e9, generateId as eA, generatePrefixedId as eB, slugify as eC, generateTemplateName as eD, registry as eE, viewRegistry as eF, type ValidationMessages as eG, DEFAULT_VALIDATION_MESSAGES as eH, textConfigSchema as eI, textareaConfigSchema as eJ, richtextConfigSchema as eK, numberConfigSchema as eL, checkboxConfigSchema as eM, dateConfigSchema as eN, phoneConfigSchema as eO, currencyConfigSchema as eP, statusConfigSchema as eQ, locationConfigSchema as eR, selectConfigSchema as eS, multiselectConfigSchema as eT, fileConfigSchema as eU, userConfigSchema as eV, relationConfigSchema as eW, ratingConfigSchema as eX, formulaConfigSchema as eY, rollupConfigSchema as eZ, documentConfigSchema as e_, isGrantRevoked as ea, isGrantValid as eb, isTokenRevoked as ec, type GeneratedDocument as ed, type WorkflowExecutionContext as ee, createEmptyContext as ef, getContextValue as eg, mergeFormToSlot as eh, setContextValue as ei, type FormContextResponse as ej, type FormFieldContext as ek, type FormFieldRow as el, type FormNodeInfo as em, type ReadOnlyReason as en, type WorkflowAccessMode as eo, type ThemeColors as ep, type ThemeLogo as eq, type ThemeTypography as er, DEFAULT_THEME as es, generateCssVariables as et, mergeWithDefaults as eu, type Uuid as ev, type TenantId as ew, type UserId as ex, asTenantId as ey, asUserId as ez, type Option as f, QueryMultipleResultsError as f$, getAttributeConfigSchema as f0, validateAttributeConfig as f1, parseAttributeConfig as f2, safeParseAttributeConfig as f3, createTextValidator as f4, createNumberValidator as f5, createCheckboxValidator as f6, createDateValidator as f7, createPhoneValidator as f8, createCurrencyValidator as f9, computeRecordStatus as fA, type DatabaseAdapter as fB, WorkflowJwtService as fC, type JwtVerificationResult as fD, type MagicLinkPayload as fE, type WorkflowAccessPayload as fF, type WorkflowJwtConfig as fG, type WorkflowJwtPayload as fH, type CacheKeyType as fI, hashOptions as fJ, type CacheAdapter as fK, type CacheOptions as fL, cacheKeys as fM, cacheTtl as fN, defaultTtl as fO, NoopCacheAdapter as fP, type FetchResult as fQ, type FormattedRecord as fR, type GroupedFetchResult as fS, type InsertOptions as fT, type QueryBuilderState as fU, type RegistryMap as fV, type RegistryObjectNames as fW, type ShortcutOperator as fX, createDefaultState as fY, formatRecord as fZ, formatRecords as f_, createStatusValidator as fa, createSelectValidator as fb, createMultiselectValidator as fc, createLocationValidator as fd, createFileValidator as fe, createUserValidator as ff, createSingleRelationValidator as fg, createMultiRelationValidator as fh, createRelationValidator as fi, createRatingValidator as fj, createFormulaValidator as fk, createRollupValidator as fl, createTextAreaValidator as fm, createRichtextValidator as fn, createAttributeValidator as fo, createFormAttributeValidator as fp, createObjectValidator as fq, type ValidationResult as fr, validateAttribute as fs, validateObject as ft, validateObjectOrThrow as fu, createDraftValidator as fv, validateDraft as fw, validateDraftOrThrow as fx, getMissingRequiredAttributes as fy, isRecordComplete as fz, type StatusAttribute as g, parsePath as g$, QueryNoResultError as g0, SHORTCUT_TO_FILTER_OPERATOR as g1, createQueryBuilder as g2, QueryBuilder as g3, type QueryBuilderOptions as g4, type EvaluationResult as g5, type EvaluationTrace as g6, evaluateCondition as g7, evaluate as g8, evaluateWithTrace as g9, error as gA, ExecutorRegistry as gB, success as gC, wait as gD, ConditionExecutor as gE, DocumentExecutor as gF, EndExecutor as gG, FormExecutor as gH, StartExecutor as gI, evaluateFormula as gJ, evaluateFormulaAttribute as gK, evaluateFormulaAttributeWithRelations as gL, evaluateFormulaWithRelations as gM, evaluateFormulaWithResult as gN, extractFormulaVariables as gO, extractRelationNames as gP, extractRelationReferences as gQ, flattenRelationsForEval as gR, formatFormulaResult as gS, hasRelationReferences as gT, validateFormulaExpression as gU, type FormulaResult as gV, getPathDepth as gW, getRelationPath as gX, getTargetAttributeName as gY, InvalidPathError as gZ, MaxDepthExceededError as g_, TenantContextError as ga, addSchemaToContext as gb, getSchemaByNameFromContext as gc, getSchemaContext as gd, getSchemaFromContext as ge, hasSchemaContext as gf, runWithMergedSchemaContext as gg, runWithSchemaContext as gh, type SchemaContext as gi, getContext as gj, getTenantId as gk, getUserId as gl, hasContext as gm, runWithContext as gn, withTenantContext as go, type TenantContext as gp, createDefaultExecutorRegistry as gq, getDefaultExecutorRegistry as gr, type ExecutorCompleteResult as gs, type ExecutorContext as gt, type ExecutorErrorResult as gu, type ExecutorResult as gv, type ExecutorSuccessResult as gw, type ExecutorWaitResult as gx, type NodeExecutor as gy, complete as gz, type SelectAttribute as h, type RelationOption as h$, pathHasManyCardinality as h0, validatePath as h1, type PathCardinality as h2, type PathSegment as h3, type PathSegmentType as h4, type SchemaResolver as h5, resolveMultiplePaths as h6, resolveSingleValue as h7, traversePath as h8, type TraversalOptions as h9, type AIUsageMetricsRepository as hA, type DocumentTemplatesRepository as hB, type DocumentsRepository as hC, type DocumentSlotsRepository as hD, type DocumentJobsRepository as hE, type DocumentGenerationTemplateListOptions as hF, type DocumentGenerationTemplatesRepository as hG, BaseService as hH, BaseRepository as hI, type SchemaContextAware as hJ, SchemaContextAwareRepository as hK, TenantAwareRepository as hL, TenantAwareService as hM, type CreateCustomObjectInput as hN, type AddAttributeInput as hO, type UpdateObjectInput as hP, type ObjectSchemaServiceOptions as hQ, ObjectSchemaService as hR, type RecordServiceOptions as hS, RecordService as hT, type RecordQueryServiceOptions as hU, type QueryOptions as hV, type SearchQueryOptions as hW, type QueryResult as hX, RecordQueryService as hY, type RelationValidationResult as hZ, type RelationValidationError as h_, type TraversalResult as ha, type AttributeChange as hb, type HookContext as hc, type HookDefinition as hd, type HookHandler as he, type HookType as hf, NoopHookRegistry as hg, type HookRegistry as hh, createMockAdapter as hi, defaultPolicyRegistry as hj, PolicyRegistry as hk, notesPolicy as hl, type ObjectsRepository as hm, type AttributesRepository as hn, type UserProfilesRepository as ho, type FilesRepository as hp, type ObjectRecordsRepository as hq, type ViewsRepository as hr, type WorkflowsRepository as hs, type WorkflowInstancesRepository as ht, type WorkflowInvitationsRepository as hu, type WorkflowAccessGrantsRepository as hv, type AuditRepository as hw, type PermissionsRepository as hx, type AIConversationsRepository as hy, type AIUserMemoryRepository as hz, type SingleRelationAttribute as i, type UserProfileServiceOptions as i$, type RelationOptionsResponse as i0, type GetRelationOptionsParams as i1, type RelationServiceOptions as i2, type ResolveIdsBatchRequest as i3, type ResolveIdsBatchResponse as i4, RelationService as i5, RecordResolverService as i6, type ResolvedRelations as i7, type FormulaResolverServiceOptions as i8, FormulaResolverService as i9, DocumentProcessingHook as iA, GrantNotFoundError as iB, GrantExpiredError as iC, GrantRevokedError as iD, TokenRevokedError as iE, type GrantServiceConfig as iF, type CreateGrantResult as iG, WorkflowAccessGrantService as iH, type StartWorkflowInput as iI, type ResumeWorkflowInput as iJ, type WorkflowInstanceServiceOptions as iK, WorkflowInstanceService as iL, type InvitationServiceConfig as iM, InvitationNotFoundError as iN, InvitationExpiredError as iO, InvitationAlreadyAcceptedError as iP, InvitationRevokedError as iQ, WorkflowInvitationService as iR, type FieldReadOnlyResult as iS, WorkflowRelationService as iT, type CreateWorkflowInput as iU, type UpdateWorkflowInput as iV, type WorkflowServiceOptions as iW, WorkflowService as iX, type UserValidationResult as iY, type UserValidationError as iZ, UserService as i_, type RollupResult as ia, type RollupServiceOptions as ib, RollupService as ic, type RollupSchedulerOptions as id, RollupScheduler as ie, applyDefaultValues as ig, checkPermission as ih, getPolicy as ii, buildPolicyContext as ij, checkRecordAccess as ik, checkRecordModifyOrThrow as il, checkRecordDeleteOrThrow as im, checkSharedObjectWriteAccess as io, computeLabel as ip, type LabelResolver as iq, enrichWithFormulas as ir, enrichRecordsWithFormulas as is, createContextForCreate as it, createContextForUpdate as iu, createContextForDelete as iv, createContextForRestore as iw, recalculateParentRollups as ix, type RollupCascadeContext as iy, type DocumentProcessingHookOptions as iz, type MultiRelationAttribute as j, type GlobalSearchOptions as j$, UserProfileService as j0, AuditService as j1, buildAuditChanges as j2, DocumentGenerationTemplateNotFoundError as j3, DocumentGenerationNotConfiguredError as j4, DocumentGenerationService as j5, type DocumentProcessingConfig as j6, DocumentProcessingService as j7, type RenderDocumentInput as j8, type DocumentRendererOptions as j9, type SyncOptions as jA, syncNativeObjects as jB, verifyNativeObjectsSync as jC, getSyncPreview as jD, type FullSyncResult as jE, type FullSyncOptions as jF, syncAll as jG, DEFAULT_LABEL_FALLBACK as jH, renderLabelExpression as jI, isLabelExpression as jJ, extractAttributeNames as jK, enrichValuesForDisplay as jL, enrichValuesWithSelectLabels as jM, extractRelationIds as jN, type RelationLabelResolver as jO, computeLabelWithRelations as jP, type DBObject as jQ, type CreateDBObject as jR, type UpdateDBObject as jS, type UpsertDBObject as jT, type DBAttribute as jU, type CreateDBAttribute as jV, type UpdateDBAttribute as jW, type UpsertDBAttribute as jX, type CreateObjectRecord as jY, type ListOptions as jZ, type SearchOptions as j_, type RenderDocumentResult as ja, DocumentRenderError as jb, StorageDownloadNotSupportedError as jc, DocumentRendererService as jd, DocumentTemplateService as je, type RecordDocumentsResult as jf, type CreateRecordDocumentInput as jg, type CreateRecordDocumentResult as jh, type DocumentServiceOptions as ji, DocumentService as jj, type FileServiceOptions as jk, FileService as jl, GeocodingService as jm, GlobalSearchService as jn, type PermissionServiceOptions as jo, PermissionService as jp, type CreateViewInput as jq, type UpdateViewInput as jr, ViewService as js, type FileContent as jt, type StorageUploadInput as ju, type StorageUploadResult as jv, type SignedUrlOptions as jw, type StorageAdapter as jx, type UploadFileInput as jy, type SyncResult as jz, type RelationTarget as k, type GlobalSearchResultItem as k0, type FileListOptions as k1, type DBView as k2, type CreateDBView as k3, type UpdateDBView as k4, type UpsertDBView as k5, type DBWorkflow as k6, type CreateDBWorkflow as k7, type UpdateDBWorkflow as k8, type DBWorkflowInstance as k9, type CreateDBWorkflowInstance as ka, type UpdateDBWorkflowInstance as kb, type DBWorkflowInvitation as kc, type CreateDBWorkflowInvitation as kd, type UpdateDBWorkflowInvitation as ke, type DBWorkflowAccessGrant as kf, type CreateDBWorkflowAccessGrant as kg, type UpdateDBWorkflowAccessGrant as kh, type OperationResult as ki, type ViewSyncResult as kj, type ViewSyncOptions as kk, syncNativeViews as kl, verifyNativeViewsSync as km, getViewSyncPreview as kn, type RatingAttribute as l, type FormulaAttribute as m, type FormulaReturnType as n, type RollupAttribute as o, type RollupFunction as p, type AttributeType as q, type ObjectDefinition as r, type Field as s, type AttributeGroupField as t, type TableTab as u, type InverseTableTab as v, type ViewDefinition as w, type InstanceStatus as x, type Tab as y, type FilterState as z };
|
|
13347
|
+
export { type OcrAdapter as $, type Attribute as A, type SortRule as B, type CheckboxAttribute as C, type DateAttribute as D, type DirectTableTab as E, type FileAttribute as F, type Group as G, type WorkflowConfig as H, type InferAttributeValue as I, type SlotMode as J, type ConditionGroup as K, type LocationAttribute as L, type MultiselectAttribute as M, type NumberAttribute as N, type ObjectAction as O, type PhoneAttribute as P, type ConditionRule as Q, type RichtextAttribute as R, type SystemResource as S, type TextAttribute as T, type UserAttribute as U, type ViewLayout as V, type WorkflowTheme as W, type WorkflowNode as X, type WorkflowDefinition as Y, type FlowRow as Z, type DocumentTemplate as _, type DocumentAttribute as a, type AuditActorType as a$, type OcrInput as a0, type OcrOptions as a1, type OcrResult as a2, type OcrPage as a3, type OcrTextBlock as a4, type BoundingBox as a5, type SignatureAdapter as a6, type CreateSignatureInput as a7, type SignerRequest as a8, type SignaturePosition as a9, type AIBatchQuestionAnswer as aA, type AITodoStatus as aB, type AITodoItem as aC, type AITodoList as aD, type AIMessageAttachment as aE, type AIConversation as aF, type AIMessage as aG, type AIToolCallRecord as aH, type AIUserMemory as aI, type AIUsageMetrics as aJ, type AIProviderMetrics as aK, type CreateAIMessageInput as aL, type StatusGroup as aM, type AttributeGroup as aN, type BaseAttribute as aO, type NumberUnit as aP, type DateFormat as aQ, type DateValue as aR, type Phone as aS, type Currency as aT, type Location as aU, type LocationGranularity as aV, RELATION_TARGET_ANY as aW, type RelationAttribute as aX, isUniversalRelation as aY, type AuditResourceType as aZ, type AuditAction as a_, type SignatureRequestResult as aa, type SignatureStatusResult as ab, type SignerStatus as ac, type SignatureStatus as ad, type IdentityVerificationAdapter as ae, type VerifyInput as af, type VerificationResult as ag, type DocumentData as ah, type VerificationCheck as ai, type AIMessageRole as aj, type AIThinkingLevel as ak, type AIToolCallStatus as al, type AIToolCall as am, type AIChatMessagePartType as an, type TextPartData as ao, type ToolPartData as ap, type ThinkingPartData as aq, type ReasoningPartData as ar, type AIChatMessagePart as as, type AIChatMessage as at, type AIQuestionType as au, type AIQuestionOption as av, type AIQuestion as aw, type AIQuestionAnswer as ax, type AIBatchQuestionOption as ay, type AIBatchQuestion as az, type SystemAction as b, type NoValueOperator as b$, type AuditChange as b0, type AuditLogEntry as b1, type CreateAuditLogInput as b2, type AuditListOptions as b3, type AuditServiceOptions as b4, type VariableMapping as b5, type PdfTemplateField as b6, type TemplateSource as b7, type DocumentGenerationTemplate as b8, type CreateDocumentGenerationTemplate as b9, type FileVisibility as bA, type File as bB, type CreateFile as bC, type UpdateFile as bD, type TextFilterOperator as bE, type NumberFilterOperator as bF, type CheckboxFilterOperator as bG, type DateFilterOperator as bH, type SelectFilterOperator as bI, type MultiselectFilterOperator as bJ, type RelationFilterOperator as bK, type FilterOperator as bL, type RelativeDateValue as bM, type CurrencyFilterValue as bN, type PhoneFilterValue as bO, type FilterValue as bP, type FilterRule as bQ, type ExtendedFilterRule as bR, type FilterCombinator as bS, type FilterGroup as bT, type AdvancedFilterState as bU, isAdvancedFilterState as bV, toAdvancedFilterState as bW, toSimpleFilterState as bX, type SortDirection as bY, type QueryState as bZ, OPERATORS_BY_TYPE as b_, type UpdateDocumentGenerationTemplate as ba, type PendingDocumentRequest as bb, isPdfTemplateSource as bc, isDocxTemplateSource as bd, type DocumentSlotDefinition as be, type DocumentAutoProcessing as bf, type ExtractionMapping as bg, type ExtractionField as bh, type Document as bi, type DocumentStatus as bj, type DocumentSlot as bk, type SlotStatus as bl, type ProcessingJob as bm, type ProcessingJobType as bn, type ProcessingJobStatus as bo, type CreateDocument as bp, type UpdateDocument as bq, type CreateDocumentTemplate as br, type UpdateDocumentTemplate as bs, type CreateDocumentSlot as bt, type UpdateDocumentSlot as bu, type CreateProcessingJob as bv, type UpdateProcessingJob as bw, type DocumentListOptions as bx, type DocumentTemplateListOptions as by, type StorageProvider as bz, type TextAreaAttribute as c, type UserRole as c$, NO_VALUE_OPERATORS as c0, isNoValueOperator as c1, type FlowSlot as c2, type FlowRowField as c3, type FlowPage as c4, type FlowRelation as c5, type FlowStatus as c6, type FlowDefinition as c7, isFlowDefinition as c8, isFlowPublished as c9, type ExtractAttributes as cA, type TypedObjectRecord as cB, type ExtractObjectRecord as cC, type ExtractObjectRecordWithCustom as cD, RESERVED_ATTRIBUTE_NAMES as cE, SYSTEM_FIELD_NAMES as cF, type ReservedAttributeName as cG, type SystemFieldName as cH, type Timestamps as cI, type SharingMode as cJ, type ObjectAttribute as cK, type CompletionStatus as cL, type ObjectRecord as cM, type PermissionScope as cN, type Role as cO, type Permission as cP, type UserRoleAssignment as cQ, type EffectivePermissions as cR, type ObjectPermissions as cS, type SystemPermissions as cT, type CreateRoleInput as cU, type UpdateRoleInput as cV, type CreatePermissionInput as cW, type AssignRoleInput as cX, type PolicyContext as cY, type RecordPolicy as cZ, PolicyViolationError as c_, isSystemFlow as ca, type GeocodingSuggestion as cb, type GeocodingAutocompleteParams as cc, type ReverseGeocodingParams as cd, type GeocodingParams as ce, type GeocodingAdapter as cf, NoopGeocodingAdapter as cg, type AttributeSchema as ch, type InferRecordFromSchema as ci, type InferRecordWithRequirements as cj, type TypedAttribute as ck, type AttributeMap as cl, type AddAttribute as cm, type InferRecord as cn, type InferRecordInput as co, type InferRecordUpdate as cp, type CustomAttributeValue as cq, type WithCustomAttributes as cr, type RecordMetadata as cs, type SystemFields as ct, type ExtractRecord as cu, type ExtractRecordStrict as cv, type ExtractRecordInput as cw, type ExtractRecordInputStrict as cx, type ExtractRecordUpdate as cy, type ExtractRecordUpdateStrict as cz, type RichtextFeature as d, type CreateInvitationInput as d$, type UserStatus as d0, type UserProfile as d1, type CreateUserProfile as d2, type UpdateUserProfile as d3, type InviteUserInput as d4, type TabType as d5, type FormTab as d6, type CustomTab as d7, type ActivityTab as d8, type NotesTab as d9, isStartNode as dA, type ConditionOperator as dB, and as dC, eq as dD, inValues as dE, isConditionGroup as dF, isConditionRule as dG, isEmpty as dH, isNotEmpty as dI, neq as dJ, or as dK, type CanvasViewport as dL, type NodePosition as dM, type WorkflowLayout as dN, type WorkflowSlot as dO, type WorkflowStatus as dP, isSystemWorkflow as dQ, isWorkflowDefinition as dR, isWorkflowPublished as dS, type PendingAction as dT, type WorkflowError as dU, type WorkflowInstance as dV, type WorkflowTransition as dW, canResumeInstance as dX, createStartTransition as dY, isInstanceTerminal as dZ, isInstanceWaiting as d_, type FlowsTab as da, type DocumentsTab as db, isFormTab as dc, isTableTab as dd, isDirectTableTab as de, isInverseTableTab as df, isCustomTab as dg, isActivityTab as dh, isNotesTab as di, isFlowsTab as dj, isDocumentsTab as dk, type ConditionNode as dl, type DocumentNode as dm, type EndNode as dn, type FormFieldRef as dp, type FormNode as dq, type StartNode as dr, type WorkflowNodeType as ds, getNodeOutputs as dt, isAdvancedFormNode as du, isConditionNode as dv, isDocumentNode as dw, isEndNode as dx, isFormNode as dy, isSimpleFormNode as dz, type CurrencyAttribute as e, attributeConfigSchemas as e$, type CreateInvitationResult as e0, type InvitationStatus as e1, type WorkflowInvitation as e2, isInvitationAccepted as e3, isInvitationExpired as e4, isInvitationValid as e5, type CreateGrantInput as e6, type WorkflowAccessGrant as e7, canAccessNode as e8, isGrantExpired as e9, generateId as eA, generatePrefixedId as eB, slugify as eC, generateTemplateName as eD, registry as eE, viewRegistry as eF, type ValidationMessages as eG, DEFAULT_VALIDATION_MESSAGES as eH, textConfigSchema as eI, textareaConfigSchema as eJ, richtextConfigSchema as eK, numberConfigSchema as eL, checkboxConfigSchema as eM, dateConfigSchema as eN, phoneConfigSchema as eO, currencyConfigSchema as eP, statusConfigSchema as eQ, locationConfigSchema as eR, selectConfigSchema as eS, multiselectConfigSchema as eT, fileConfigSchema as eU, userConfigSchema as eV, relationConfigSchema as eW, ratingConfigSchema as eX, formulaConfigSchema as eY, rollupConfigSchema as eZ, documentConfigSchema as e_, isGrantRevoked as ea, isGrantValid as eb, isTokenRevoked as ec, type GeneratedDocument as ed, type WorkflowExecutionContext as ee, createEmptyContext as ef, getContextValue as eg, mergeFormToSlot as eh, setContextValue as ei, type FormContextResponse as ej, type FormFieldContext as ek, type FormFieldRow as el, type FormNodeInfo as em, type ReadOnlyReason as en, type WorkflowAccessMode as eo, type ThemeColors as ep, type ThemeLogo as eq, type ThemeTypography as er, DEFAULT_THEME as es, generateCssVariables as et, mergeWithDefaults as eu, type Uuid as ev, type TenantId as ew, type UserId as ex, asTenantId as ey, asUserId as ez, type Option as f, QueryMultipleResultsError as f$, getAttributeConfigSchema as f0, validateAttributeConfig as f1, parseAttributeConfig as f2, safeParseAttributeConfig as f3, createTextValidator as f4, createNumberValidator as f5, createCheckboxValidator as f6, createDateValidator as f7, createPhoneValidator as f8, createCurrencyValidator as f9, computeRecordStatus as fA, type DatabaseAdapter as fB, WorkflowJwtService as fC, type JwtVerificationResult as fD, type MagicLinkPayload as fE, type WorkflowAccessPayload as fF, type WorkflowJwtConfig as fG, type WorkflowJwtPayload as fH, type CacheKeyType as fI, hashOptions as fJ, type CacheAdapter as fK, type CacheOptions as fL, cacheKeys as fM, cacheTtl as fN, defaultTtl as fO, NoopCacheAdapter as fP, type FetchResult as fQ, type FormattedRecord as fR, type GroupedFetchResult as fS, type InsertOptions as fT, type QueryBuilderState as fU, type RegistryMap as fV, type RegistryObjectNames as fW, type ShortcutOperator as fX, createDefaultState as fY, formatRecord as fZ, formatRecords as f_, createStatusValidator as fa, createSelectValidator as fb, createMultiselectValidator as fc, createLocationValidator as fd, createFileValidator as fe, createUserValidator as ff, createSingleRelationValidator as fg, createMultiRelationValidator as fh, createRelationValidator as fi, createRatingValidator as fj, createFormulaValidator as fk, createRollupValidator as fl, createTextAreaValidator as fm, createRichtextValidator as fn, createAttributeValidator as fo, createFormAttributeValidator as fp, createObjectValidator as fq, type ValidationResult as fr, validateAttribute as fs, validateObject as ft, validateObjectOrThrow as fu, createDraftValidator as fv, validateDraft as fw, validateDraftOrThrow as fx, getMissingRequiredAttributes as fy, isRecordComplete as fz, type StatusAttribute as g, parsePath as g$, QueryNoResultError as g0, SHORTCUT_TO_FILTER_OPERATOR as g1, createQueryBuilder as g2, QueryBuilder as g3, type QueryBuilderOptions as g4, type EvaluationResult as g5, type EvaluationTrace as g6, evaluateCondition as g7, evaluate as g8, evaluateWithTrace as g9, error as gA, ExecutorRegistry as gB, success as gC, wait as gD, ConditionExecutor as gE, DocumentExecutor as gF, EndExecutor as gG, FormExecutor as gH, StartExecutor as gI, evaluateFormula as gJ, evaluateFormulaAttribute as gK, evaluateFormulaAttributeWithRelations as gL, evaluateFormulaWithRelations as gM, evaluateFormulaWithResult as gN, extractFormulaVariables as gO, extractRelationNames as gP, extractRelationReferences as gQ, flattenRelationsForEval as gR, formatFormulaResult as gS, hasRelationReferences as gT, validateFormulaExpression as gU, type FormulaResult as gV, getPathDepth as gW, getRelationPath as gX, getTargetAttributeName as gY, InvalidPathError as gZ, MaxDepthExceededError as g_, TenantContextError as ga, addSchemaToContext as gb, getSchemaByNameFromContext as gc, getSchemaContext as gd, getSchemaFromContext as ge, hasSchemaContext as gf, runWithMergedSchemaContext as gg, runWithSchemaContext as gh, type SchemaContext as gi, getContext as gj, getTenantId as gk, getUserId as gl, hasContext as gm, runWithContext as gn, withTenantContext as go, type TenantContext as gp, createDefaultExecutorRegistry as gq, getDefaultExecutorRegistry as gr, type ExecutorCompleteResult as gs, type ExecutorContext as gt, type ExecutorErrorResult as gu, type ExecutorResult as gv, type ExecutorSuccessResult as gw, type ExecutorWaitResult as gx, type NodeExecutor as gy, complete as gz, type SelectAttribute as h, type RelationOptionsResponse as h$, pathHasManyCardinality as h0, validatePath as h1, type PathCardinality as h2, type PathSegment as h3, type PathSegmentType as h4, type SchemaResolver as h5, resolveMultiplePaths as h6, resolveSingleValue as h7, traversePath as h8, type TraversalOptions as h9, type DocumentsRepository as hA, type DocumentSlotsRepository as hB, type DocumentJobsRepository as hC, type DocumentGenerationTemplateListOptions as hD, type DocumentGenerationTemplatesRepository as hE, type AIConversationsRepository as hF, type AIUserMemoryRepository as hG, type AIUsageMetricsRepository as hH, BaseService as hI, BaseRepository as hJ, type SchemaContextAware as hK, SchemaContextAwareRepository as hL, type CreateCustomObjectInput as hM, type AddAttributeInput as hN, type UpdateObjectInput as hO, type ObjectSchemaServiceOptions as hP, ObjectSchemaService as hQ, type RecordServiceOptions as hR, RecordService as hS, type RecordQueryServiceOptions as hT, type QueryOptions as hU, type SearchQueryOptions as hV, type QueryResult as hW, RecordQueryService as hX, type RelationValidationResult as hY, type RelationValidationError as hZ, type RelationOption as h_, type TraversalResult as ha, type AttributeChange as hb, type HookContext as hc, type HookDefinition as hd, type HookHandler as he, type HookType as hf, NoopHookRegistry as hg, type HookRegistry as hh, createMockAdapter as hi, type MockStores as hj, defaultPolicyRegistry as hk, PolicyRegistry as hl, notesPolicy as hm, type ObjectsRepository as hn, type AttributesRepository as ho, type ObjectRecordsRepository as hp, type ViewsRepository as hq, type UserProfilesRepository as hr, type FilesRepository as hs, type AuditRepository as ht, type PermissionsRepository as hu, type WorkflowsRepository as hv, type WorkflowInstancesRepository as hw, type WorkflowInvitationsRepository as hx, type WorkflowAccessGrantsRepository as hy, type DocumentTemplatesRepository as hz, type SingleRelationAttribute as i, UserProfileService as i$, type GetRelationOptionsParams as i0, type RelationServiceOptions as i1, type ResolveIdsBatchRequest as i2, type ResolveIdsBatchResponse as i3, RelationService as i4, RecordResolverService as i5, type ResolvedRelations as i6, type FormulaResolverServiceOptions as i7, FormulaResolverService as i8, type RollupResult as i9, GrantNotFoundError as iA, GrantExpiredError as iB, GrantRevokedError as iC, TokenRevokedError as iD, type GrantServiceConfig as iE, type CreateGrantResult as iF, WorkflowAccessGrantService as iG, type StartWorkflowInput as iH, type ResumeWorkflowInput as iI, type WorkflowInstanceServiceOptions as iJ, WorkflowInstanceService as iK, type InvitationServiceConfig as iL, InvitationNotFoundError as iM, InvitationExpiredError as iN, InvitationAlreadyAcceptedError as iO, InvitationRevokedError as iP, WorkflowInvitationService as iQ, type FieldReadOnlyResult as iR, WorkflowRelationService as iS, type CreateWorkflowInput as iT, type UpdateWorkflowInput as iU, type WorkflowServiceOptions as iV, WorkflowService as iW, type UserValidationResult as iX, type UserValidationError as iY, UserService as iZ, type UserProfileServiceOptions as i_, type RollupServiceOptions as ia, RollupService as ib, type RollupSchedulerOptions as ic, RollupScheduler as id, applyDefaultValues as ie, checkPermission as ig, getPolicy as ih, buildPolicyContext as ii, checkRecordAccess as ij, checkRecordModifyOrThrow as ik, checkRecordDeleteOrThrow as il, checkSharedObjectWriteAccess as im, computeLabel as io, type LabelResolver as ip, enrichWithFormulas as iq, enrichRecordsWithFormulas as ir, createContextForCreate as is, createContextForUpdate as it, createContextForDelete as iu, createContextForRestore as iv, recalculateParentRollups as iw, type RollupCascadeContext as ix, type DocumentProcessingHookOptions as iy, DocumentProcessingHook as iz, type MultiRelationAttribute as j, type GlobalSearchResultItem as j$, AuditService as j0, buildAuditChanges as j1, DocumentGenerationTemplateNotFoundError as j2, DocumentGenerationNotConfiguredError as j3, DocumentGenerationService as j4, type DocumentProcessingConfig as j5, DocumentProcessingService as j6, type RenderDocumentInput as j7, type DocumentRendererOptions as j8, type RenderDocumentResult as j9, syncNativeObjects as jA, verifyNativeObjectsSync as jB, getSyncPreview as jC, type FullSyncResult as jD, type FullSyncOptions as jE, syncAll as jF, DEFAULT_LABEL_FALLBACK as jG, renderLabelExpression as jH, isLabelExpression as jI, extractAttributeNames as jJ, enrichValuesForDisplay as jK, enrichValuesWithSelectLabels as jL, extractRelationIds as jM, type RelationLabelResolver as jN, computeLabelWithRelations as jO, type DBObject as jP, type CreateDBObject as jQ, type UpdateDBObject as jR, type UpsertDBObject as jS, type DBAttribute as jT, type CreateDBAttribute as jU, type UpdateDBAttribute as jV, type UpsertDBAttribute as jW, type CreateObjectRecord as jX, type ListOptions as jY, type SearchOptions as jZ, type GlobalSearchOptions as j_, DocumentRenderError as ja, StorageDownloadNotSupportedError as jb, DocumentRendererService as jc, DocumentTemplateService as jd, type RecordDocumentsResult as je, type CreateRecordDocumentInput as jf, type CreateRecordDocumentResult as jg, type DocumentServiceOptions as jh, DocumentService as ji, type FileServiceOptions as jj, FileService as jk, GeocodingService as jl, GlobalSearchService as jm, type PermissionServiceOptions as jn, PermissionService as jo, type CreateViewInput as jp, type UpdateViewInput as jq, ViewService as jr, type FileContent as js, type StorageUploadInput as jt, type StorageUploadResult as ju, type SignedUrlOptions as jv, type StorageAdapter as jw, type UploadFileInput as jx, type SyncResult as jy, type SyncOptions as jz, type RelationTarget as k, type FileListOptions as k0, type DBView as k1, type CreateDBView as k2, type UpdateDBView as k3, type UpsertDBView as k4, type DBWorkflow as k5, type CreateDBWorkflow as k6, type UpdateDBWorkflow as k7, type DBWorkflowInstance as k8, type CreateDBWorkflowInstance as k9, type UpdateDBWorkflowInstance as ka, type DBWorkflowInvitation as kb, type CreateDBWorkflowInvitation as kc, type UpdateDBWorkflowInvitation as kd, type DBWorkflowAccessGrant as ke, type CreateDBWorkflowAccessGrant as kf, type UpdateDBWorkflowAccessGrant as kg, type OperationResult as kh, type ViewSyncResult as ki, type ViewSyncLogger as kj, type ViewSyncOptions as kk, syncNativeViews as kl, verifyNativeViewsSync as km, getViewSyncPreview as kn, type RatingAttribute as l, type FormulaAttribute as m, type FormulaReturnType as n, type RollupAttribute as o, type RollupFunction as p, type AttributeType as q, type ObjectDefinition as r, type Field as s, type AttributeGroupField as t, type TableTab as u, type InverseTableTab as v, type ViewDefinition as w, type InstanceStatus as x, type Tab as y, type FilterState as z };
|