@stndrds/schema 0.1.0-alpha.36 → 0.1.0-alpha.38
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-JHLPK3RO.js → chunk-5NXIMZNY.js} +279 -129
- package/dist/{chunk-QZZ4SSHD.mjs → chunk-6NQPARLS.mjs} +212 -62
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -6
- package/dist/index.mjs +7 -1
- package/dist/{runtime-BWBRGKY1.d.mts → runtime-Hwgvv9Bn.d.mts} +243 -32
- package/dist/{runtime-BWBRGKY1.d.ts → runtime-Hwgvv9Bn.d.ts} +243 -32
- package/dist/runtime.d.mts +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +8 -2
- package/dist/runtime.mjs +7 -1
- package/package.json +4 -3
|
@@ -2,6 +2,93 @@ import {
|
|
|
2
2
|
__require
|
|
3
3
|
} from "./chunk-Y6FXYEAI.mjs";
|
|
4
4
|
|
|
5
|
+
// src/runtime/cache.ts
|
|
6
|
+
var cacheKeys = {
|
|
7
|
+
// -------------------------------------------------------------------------
|
|
8
|
+
// Schemas - TTL: 1 hour (rarely change)
|
|
9
|
+
// -------------------------------------------------------------------------
|
|
10
|
+
/** Object schema by ID */
|
|
11
|
+
objectSchema: (tenantId, objectId) => `schema:${tenantId}:obj:${objectId}`,
|
|
12
|
+
/** Object schema by name */
|
|
13
|
+
objectSchemaByName: (tenantId, name) => `schema:${tenantId}:name:${name}`,
|
|
14
|
+
/** List of all object schemas */
|
|
15
|
+
objectSchemaList: (tenantId) => `schema:${tenantId}:list`,
|
|
16
|
+
// -------------------------------------------------------------------------
|
|
17
|
+
// Attributes - TTL: 1 hour (rarely change)
|
|
18
|
+
// -------------------------------------------------------------------------
|
|
19
|
+
/** Attributes for an object */
|
|
20
|
+
objectAttributes: (tenantId, objectId) => `attrs:${tenantId}:${objectId}`,
|
|
21
|
+
// -------------------------------------------------------------------------
|
|
22
|
+
// Permissions - TTL: 15 minutes (medium volatility)
|
|
23
|
+
// -------------------------------------------------------------------------
|
|
24
|
+
/** Effective permissions for a user */
|
|
25
|
+
userPermissions: (tenantId, userId) => `perms:${tenantId}:user:${userId}`,
|
|
26
|
+
// -------------------------------------------------------------------------
|
|
27
|
+
// Relations - TTL: 5 minutes (medium volatility)
|
|
28
|
+
// -------------------------------------------------------------------------
|
|
29
|
+
/** Relation options for an attribute */
|
|
30
|
+
relationOptions: (tenantId, attrId, hash) => `rel:${tenantId}:${attrId}:${hash}`,
|
|
31
|
+
// -------------------------------------------------------------------------
|
|
32
|
+
// Rollups - TTL: 2 minutes (high volatility)
|
|
33
|
+
// -------------------------------------------------------------------------
|
|
34
|
+
/** Computed rollup value for a record */
|
|
35
|
+
rollupValue: (tenantId, recordId, attrName) => `rollup:${tenantId}:${recordId}:${attrName}`,
|
|
36
|
+
// -------------------------------------------------------------------------
|
|
37
|
+
// Invalidation Patterns
|
|
38
|
+
// -------------------------------------------------------------------------
|
|
39
|
+
/** All schema cache for a tenant */
|
|
40
|
+
allSchemas: (tenantId) => `schema:${tenantId}:*`,
|
|
41
|
+
/** All attribute cache for a tenant */
|
|
42
|
+
allAttributes: (tenantId) => `attrs:${tenantId}:*`,
|
|
43
|
+
/** All permission cache for a tenant */
|
|
44
|
+
allPermissions: (tenantId) => `perms:${tenantId}:*`,
|
|
45
|
+
/** All relation cache for a tenant */
|
|
46
|
+
allRelations: (tenantId) => `rel:${tenantId}:*`,
|
|
47
|
+
/** All rollup cache for a tenant */
|
|
48
|
+
allRollups: (tenantId) => `rollup:${tenantId}:*`,
|
|
49
|
+
/** All rollups for a specific record */
|
|
50
|
+
rollupsByRecord: (tenantId, recordId) => `rollup:${tenantId}:${recordId}:*`,
|
|
51
|
+
/** All cache for a tenant (nuclear option) */
|
|
52
|
+
allForTenant: (tenantId) => `*:${tenantId}:*`
|
|
53
|
+
};
|
|
54
|
+
var cacheTtl = {
|
|
55
|
+
/** Object schemas - rarely change (1 hour) */
|
|
56
|
+
schema: 60 * 60 * 1e3,
|
|
57
|
+
/** Schema list - new objects more frequent (5 minutes) */
|
|
58
|
+
schemaList: 5 * 60 * 1e3,
|
|
59
|
+
/** Object attributes - rarely change (1 hour) */
|
|
60
|
+
attributes: 60 * 60 * 1e3,
|
|
61
|
+
/** User permissions - medium volatility (15 minutes) */
|
|
62
|
+
permissions: 15 * 60 * 1e3,
|
|
63
|
+
/** Relation options - medium volatility (5 minutes) */
|
|
64
|
+
relations: 5 * 60 * 1e3,
|
|
65
|
+
/** Rollup values - high volatility (2 minutes) */
|
|
66
|
+
rollup: 2 * 60 * 1e3
|
|
67
|
+
};
|
|
68
|
+
var NoopCacheAdapter = class {
|
|
69
|
+
get() {
|
|
70
|
+
return Promise.resolve(null);
|
|
71
|
+
}
|
|
72
|
+
set() {
|
|
73
|
+
return Promise.resolve();
|
|
74
|
+
}
|
|
75
|
+
delete() {
|
|
76
|
+
return Promise.resolve();
|
|
77
|
+
}
|
|
78
|
+
deletePattern() {
|
|
79
|
+
return Promise.resolve();
|
|
80
|
+
}
|
|
81
|
+
has() {
|
|
82
|
+
return Promise.resolve(false);
|
|
83
|
+
}
|
|
84
|
+
clear() {
|
|
85
|
+
return Promise.resolve();
|
|
86
|
+
}
|
|
87
|
+
getOrSet(_key, fetcher) {
|
|
88
|
+
return fetcher();
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
5
92
|
// src/runtime/client/types.ts
|
|
6
93
|
function formatRecord(record) {
|
|
7
94
|
return {
|
|
@@ -1720,7 +1807,6 @@ function createMockObjectRecordsRepository(stores) {
|
|
|
1720
1807
|
const records = results.map(({ tenantId: _t, ...r }) => r);
|
|
1721
1808
|
return Promise.resolve({ records, total });
|
|
1722
1809
|
},
|
|
1723
|
-
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: This is a mock adapter, we don't need to worry about complexity
|
|
1724
1810
|
globalSearch(query, options) {
|
|
1725
1811
|
const tenantId = getTenantId();
|
|
1726
1812
|
const lowerQuery = query.toLowerCase();
|
|
@@ -1793,7 +1879,6 @@ function createMockObjectRecordsRepository(stores) {
|
|
|
1793
1879
|
// -------------------------------------------------------------------------
|
|
1794
1880
|
// Schema Integrity Methods
|
|
1795
1881
|
// -------------------------------------------------------------------------
|
|
1796
|
-
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: This is a mock adapter, we don't need to worry about complexity
|
|
1797
1882
|
countRecordsReferencingId(targetId) {
|
|
1798
1883
|
const relationAttrs = [];
|
|
1799
1884
|
for (const attr of stores.attributes.values()) {
|
|
@@ -1870,7 +1955,6 @@ function createMockObjectRecordsRepository(stores) {
|
|
|
1870
1955
|
}
|
|
1871
1956
|
return Promise.resolve(updated);
|
|
1872
1957
|
},
|
|
1873
|
-
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: This is a mock adapter, we don't need to worry about complexity
|
|
1874
1958
|
findByRelation(objectName, relationAttributeName, targetRecordId) {
|
|
1875
1959
|
const obj = Array.from(stores.objects.values()).find((o) => o.name === objectName);
|
|
1876
1960
|
if (!obj) return Promise.resolve([]);
|
|
@@ -2119,7 +2203,6 @@ function createMockPermissionsRepository(stores) {
|
|
|
2119
2203
|
}
|
|
2120
2204
|
return Promise.resolve();
|
|
2121
2205
|
},
|
|
2122
|
-
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: This is a mock adapter, we don't need to worry about complexity
|
|
2123
2206
|
getEffectivePermissions(userProfileId) {
|
|
2124
2207
|
const tenantId = getTenantId();
|
|
2125
2208
|
const userRoleIds = Array.from(stores.userRoles.values()).filter((ur) => ur.userProfileId === userProfileId && ur.tenantId === tenantId).map((ur) => ur.roleId);
|
|
@@ -6284,6 +6367,7 @@ var ObjectSchemaService = class extends TenantAwareService {
|
|
|
6284
6367
|
this.adapter = adapter;
|
|
6285
6368
|
this.nativeRegistry = nativeRegistry;
|
|
6286
6369
|
this.auditService = options?.auditService;
|
|
6370
|
+
this.cache = options?.cache ?? adapter.cache;
|
|
6287
6371
|
}
|
|
6288
6372
|
/**
|
|
6289
6373
|
* Create a new custom object.
|
|
@@ -6359,6 +6443,7 @@ var ObjectSchemaService = class extends TenantAwareService {
|
|
|
6359
6443
|
attributes: createdAttributes,
|
|
6360
6444
|
system: false
|
|
6361
6445
|
};
|
|
6446
|
+
await this.invalidateSchemaCache();
|
|
6362
6447
|
if (this.auditService && this.userId) {
|
|
6363
6448
|
await this.auditService.logSchemaAction({
|
|
6364
6449
|
action: "object.created",
|
|
@@ -6406,6 +6491,7 @@ var ObjectSchemaService = class extends TenantAwareService {
|
|
|
6406
6491
|
// Always false for attributes added via API
|
|
6407
6492
|
config
|
|
6408
6493
|
});
|
|
6494
|
+
await this.invalidateSchemaCache();
|
|
6409
6495
|
if (this.auditService && this.userId) {
|
|
6410
6496
|
await this.auditService.logSchemaAction({
|
|
6411
6497
|
action: "attribute.created",
|
|
@@ -6485,6 +6571,7 @@ var ObjectSchemaService = class extends TenantAwareService {
|
|
|
6485
6571
|
});
|
|
6486
6572
|
}
|
|
6487
6573
|
}
|
|
6574
|
+
await this.invalidateSchemaCache();
|
|
6488
6575
|
if (updates.required !== void 0 && updates.required !== oldValues.required) {
|
|
6489
6576
|
const schema = await this.getObjectSchema(dbAttr.objectId);
|
|
6490
6577
|
await this.adapter.objectRecords.batchRefreshStatus(
|
|
@@ -6519,6 +6606,7 @@ var ObjectSchemaService = class extends TenantAwareService {
|
|
|
6519
6606
|
}
|
|
6520
6607
|
await this.adapter.attributes.delete(attributeId);
|
|
6521
6608
|
await this.adapter.objectRecords.removeAttributeData(dbAttr.objectId, dbAttr.name);
|
|
6609
|
+
await this.invalidateSchemaCache();
|
|
6522
6610
|
if (this.auditService && this.userId) {
|
|
6523
6611
|
await this.auditService.logSchemaAction({
|
|
6524
6612
|
action: "attribute.deleted",
|
|
@@ -6619,6 +6707,7 @@ var ObjectSchemaService = class extends TenantAwareService {
|
|
|
6619
6707
|
}
|
|
6620
6708
|
const dbAttributes = await this.adapter.attributes.findByObjectId(objectId);
|
|
6621
6709
|
const attributes = dbAttributes.map((attr) => this.convertDBAttributeToAttribute(attr));
|
|
6710
|
+
await this.invalidateSchemaCache();
|
|
6622
6711
|
if (updates.labelExpression !== void 0 && updates.labelExpression !== oldValues.labelExpression) {
|
|
6623
6712
|
const newExpression = updates.labelExpression;
|
|
6624
6713
|
await this.adapter.objectRecords.batchRefreshLabels(objectId, (values) => {
|
|
@@ -6656,6 +6745,7 @@ var ObjectSchemaService = class extends TenantAwareService {
|
|
|
6656
6745
|
throw new ObjectReferencedError(dbObject.name, referencingObjects);
|
|
6657
6746
|
}
|
|
6658
6747
|
await this.adapter.objects.delete(objectId);
|
|
6748
|
+
await this.invalidateSchemaCache();
|
|
6659
6749
|
if (this.auditService && this.userId) {
|
|
6660
6750
|
await this.auditService.logSchemaAction({
|
|
6661
6751
|
action: "object.deleted",
|
|
@@ -6699,10 +6789,26 @@ Reserved names: ${RESERVED_ATTRIBUTE_NAMES.join(", ")}`
|
|
|
6699
6789
|
* Get complete object schema (object attributes + system attributes)
|
|
6700
6790
|
* Includes system attributes (createdAt, updatedAt, createdBy, lastUpdatedBy)
|
|
6701
6791
|
*
|
|
6792
|
+
* Results are cached if a CacheAdapter is configured.
|
|
6793
|
+
*
|
|
6702
6794
|
* @param objectId - Object UUID from database
|
|
6703
6795
|
* @returns Complete ObjectDefinition with all attributes including system attributes
|
|
6704
6796
|
*/
|
|
6705
6797
|
async getObjectSchema(objectId) {
|
|
6798
|
+
if (this.cache) {
|
|
6799
|
+
const cacheKey = cacheKeys.objectSchema(this.tenantId, objectId);
|
|
6800
|
+
return this.cache.getOrSet(
|
|
6801
|
+
cacheKey,
|
|
6802
|
+
() => this.fetchObjectSchemaById(objectId),
|
|
6803
|
+
cacheTtl.schema
|
|
6804
|
+
);
|
|
6805
|
+
}
|
|
6806
|
+
return this.fetchObjectSchemaById(objectId);
|
|
6807
|
+
}
|
|
6808
|
+
/**
|
|
6809
|
+
* Internal method to fetch object schema by ID (no caching)
|
|
6810
|
+
*/
|
|
6811
|
+
async fetchObjectSchemaById(objectId) {
|
|
6706
6812
|
const dbObject = await this.adapter.objects.findById(objectId);
|
|
6707
6813
|
if (!dbObject) {
|
|
6708
6814
|
throw new Error(`Object with id "${objectId}" not found`);
|
|
@@ -6723,8 +6829,24 @@ Reserved names: ${RESERVED_ATTRIBUTE_NAMES.join(", ")}`
|
|
|
6723
6829
|
/**
|
|
6724
6830
|
* Get object schema by name (supports both native and custom objects).
|
|
6725
6831
|
* Automatically uses tenant context from AsyncLocalStorage.
|
|
6832
|
+
*
|
|
6833
|
+
* Results are cached if a CacheAdapter is configured.
|
|
6726
6834
|
*/
|
|
6727
6835
|
async getObjectSchemaByNameForTenant(name) {
|
|
6836
|
+
if (this.cache) {
|
|
6837
|
+
const cacheKey = cacheKeys.objectSchemaByName(this.tenantId, name);
|
|
6838
|
+
return this.cache.getOrSet(
|
|
6839
|
+
cacheKey,
|
|
6840
|
+
() => this.fetchObjectSchemaByName(name),
|
|
6841
|
+
cacheTtl.schema
|
|
6842
|
+
);
|
|
6843
|
+
}
|
|
6844
|
+
return this.fetchObjectSchemaByName(name);
|
|
6845
|
+
}
|
|
6846
|
+
/**
|
|
6847
|
+
* Internal method to fetch object schema by name (no caching)
|
|
6848
|
+
*/
|
|
6849
|
+
async fetchObjectSchemaByName(name) {
|
|
6728
6850
|
let dbObject = await this.adapter.objects.findByName(name);
|
|
6729
6851
|
if (!dbObject) {
|
|
6730
6852
|
dbObject = await this.adapter.objects.findSystemByName(name);
|
|
@@ -6737,11 +6859,32 @@ Reserved names: ${RESERVED_ATTRIBUTE_NAMES.join(", ")}`
|
|
|
6737
6859
|
/**
|
|
6738
6860
|
* List all object schemas.
|
|
6739
6861
|
* Automatically uses tenant context from AsyncLocalStorage.
|
|
6862
|
+
*
|
|
6863
|
+
* Results are cached if a CacheAdapter is configured.
|
|
6740
6864
|
*/
|
|
6741
6865
|
async listObjectSchemas() {
|
|
6866
|
+
if (this.cache) {
|
|
6867
|
+
const cacheKey = cacheKeys.objectSchemaList(this.tenantId);
|
|
6868
|
+
return this.cache.getOrSet(cacheKey, () => this.fetchObjectSchemaList(), cacheTtl.schemaList);
|
|
6869
|
+
}
|
|
6870
|
+
return this.fetchObjectSchemaList();
|
|
6871
|
+
}
|
|
6872
|
+
/**
|
|
6873
|
+
* Internal method to fetch all object schemas (no caching)
|
|
6874
|
+
*/
|
|
6875
|
+
async fetchObjectSchemaList() {
|
|
6742
6876
|
const dbObjects = await this.adapter.objects.list();
|
|
6743
6877
|
return Promise.all(dbObjects.map((dbObject) => this.buildObjectDefinition(dbObject)));
|
|
6744
6878
|
}
|
|
6879
|
+
/**
|
|
6880
|
+
* Invalidate all schema-related cache for the current tenant.
|
|
6881
|
+
* Called automatically after schema mutations.
|
|
6882
|
+
*/
|
|
6883
|
+
async invalidateSchemaCache() {
|
|
6884
|
+
if (!this.cache) return;
|
|
6885
|
+
await this.cache.deletePattern(cacheKeys.allSchemas(this.tenantId));
|
|
6886
|
+
await this.cache.deletePattern(cacheKeys.allAttributes(this.tenantId));
|
|
6887
|
+
}
|
|
6745
6888
|
// ============================================================================
|
|
6746
6889
|
// PRIVATE HELPERS - SCHEMA BUILDING
|
|
6747
6890
|
// ============================================================================
|
|
@@ -6951,17 +7094,13 @@ var PermissionService = class extends TenantAwareService {
|
|
|
6951
7094
|
constructor(adapter, options) {
|
|
6952
7095
|
super();
|
|
6953
7096
|
this.adapter = adapter;
|
|
6954
|
-
this.cache = /* @__PURE__ */ new Map();
|
|
6955
|
-
/** Track pending permission fetches to prevent duplicate concurrent requests */
|
|
6956
|
-
this.pendingFetches = /* @__PURE__ */ new Map();
|
|
6957
7097
|
if (!adapter.permissions) {
|
|
6958
7098
|
throw new Error(
|
|
6959
7099
|
"PermissionService requires a DatabaseAdapter with permissions repository. Make sure your adapter implements the permissions property."
|
|
6960
7100
|
);
|
|
6961
7101
|
}
|
|
6962
7102
|
this.permissionsRepo = adapter.permissions;
|
|
6963
|
-
this.
|
|
6964
|
-
this.maxCacheSize = options?.maxCacheSize ?? 1e4;
|
|
7103
|
+
this.cache = options?.cache ?? adapter.cache ?? new NoopCacheAdapter();
|
|
6965
7104
|
this.auditService = options?.auditService;
|
|
6966
7105
|
}
|
|
6967
7106
|
// ============================================================================
|
|
@@ -7089,46 +7228,18 @@ var PermissionService = class extends TenantAwareService {
|
|
|
7089
7228
|
// ============================================================================
|
|
7090
7229
|
/**
|
|
7091
7230
|
* Get effective permissions for a user.
|
|
7092
|
-
* Results are cached with TTL
|
|
7231
|
+
* Results are cached using CacheAdapter with TTL.
|
|
7093
7232
|
*
|
|
7094
7233
|
* @param userProfileId - User profile ID
|
|
7095
7234
|
* @returns Merged permissions from all user's roles
|
|
7096
7235
|
*/
|
|
7097
7236
|
async getEffectivePermissions(userProfileId) {
|
|
7098
|
-
const cacheKey = this.
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
|
|
7104
|
-
if (pendingFetch) {
|
|
7105
|
-
return pendingFetch;
|
|
7106
|
-
}
|
|
7107
|
-
const fetchPromise = this.fetchAndCachePermissions(userProfileId, cacheKey);
|
|
7108
|
-
this.pendingFetches.set(cacheKey, fetchPromise);
|
|
7109
|
-
try {
|
|
7110
|
-
return await fetchPromise;
|
|
7111
|
-
} finally {
|
|
7112
|
-
this.pendingFetches.delete(cacheKey);
|
|
7113
|
-
}
|
|
7114
|
-
}
|
|
7115
|
-
/**
|
|
7116
|
-
* Fetch permissions from database and cache the result
|
|
7117
|
-
* @internal
|
|
7118
|
-
*/
|
|
7119
|
-
async fetchAndCachePermissions(userProfileId, cacheKey) {
|
|
7120
|
-
const permissions = await this.permissionsRepo.getEffectivePermissions(userProfileId);
|
|
7121
|
-
if (this.cache.size >= this.maxCacheSize) {
|
|
7122
|
-
const firstKey = this.cache.keys().next().value;
|
|
7123
|
-
if (firstKey) {
|
|
7124
|
-
this.cache.delete(firstKey);
|
|
7125
|
-
}
|
|
7126
|
-
}
|
|
7127
|
-
this.cache.set(cacheKey, {
|
|
7128
|
-
permissions,
|
|
7129
|
-
expiresAt: Date.now() + this.cacheTtlMs
|
|
7130
|
-
});
|
|
7131
|
-
return permissions;
|
|
7237
|
+
const cacheKey = cacheKeys.userPermissions(this.tenantId, userProfileId);
|
|
7238
|
+
return this.cache.getOrSet(
|
|
7239
|
+
cacheKey,
|
|
7240
|
+
() => this.permissionsRepo.getEffectivePermissions(userProfileId),
|
|
7241
|
+
cacheTtl.permissions
|
|
7242
|
+
);
|
|
7132
7243
|
}
|
|
7133
7244
|
// ============================================================================
|
|
7134
7245
|
// CACHE MANAGEMENT
|
|
@@ -7137,24 +7248,15 @@ var PermissionService = class extends TenantAwareService {
|
|
|
7137
7248
|
* Invalidate cached permissions for a specific user.
|
|
7138
7249
|
* Call this after role/permission changes.
|
|
7139
7250
|
*/
|
|
7140
|
-
invalidateCache(userProfileId) {
|
|
7141
|
-
this.cache.delete(this.
|
|
7251
|
+
async invalidateCache(userProfileId) {
|
|
7252
|
+
await this.cache.delete(cacheKeys.userPermissions(this.tenantId, userProfileId));
|
|
7142
7253
|
}
|
|
7143
7254
|
/**
|
|
7144
|
-
* Invalidate all cached permissions.
|
|
7255
|
+
* Invalidate all cached permissions for the current tenant.
|
|
7145
7256
|
* Call this after bulk role/permission changes.
|
|
7146
7257
|
*/
|
|
7147
|
-
invalidateAllCache() {
|
|
7148
|
-
this.cache.
|
|
7149
|
-
}
|
|
7150
|
-
/**
|
|
7151
|
-
* Get current cache size (for monitoring).
|
|
7152
|
-
*/
|
|
7153
|
-
getCacheSize() {
|
|
7154
|
-
return this.cache.size;
|
|
7155
|
-
}
|
|
7156
|
-
getCacheKey(userProfileId) {
|
|
7157
|
-
return `${this.tenantId}:${userProfileId}`;
|
|
7258
|
+
async invalidateAllCache() {
|
|
7259
|
+
await this.cache.deletePattern(cacheKeys.allPermissions(this.tenantId));
|
|
7158
7260
|
}
|
|
7159
7261
|
// ============================================================================
|
|
7160
7262
|
// ROLE MANAGEMENT
|
|
@@ -7516,10 +7618,11 @@ var registry = new NativeObjectRegistryClass();
|
|
|
7516
7618
|
|
|
7517
7619
|
// src/runtime/services/relation.service.ts
|
|
7518
7620
|
var RelationService = class extends TenantAwareService {
|
|
7519
|
-
constructor(adapter, nativeRegistry) {
|
|
7621
|
+
constructor(adapter, nativeRegistry, options) {
|
|
7520
7622
|
super();
|
|
7521
7623
|
this.adapter = adapter;
|
|
7522
|
-
this.
|
|
7624
|
+
this.cache = options?.cache ?? adapter.cache;
|
|
7625
|
+
this.schemaService = new ObjectSchemaService(adapter, nativeRegistry, { cache: this.cache });
|
|
7523
7626
|
}
|
|
7524
7627
|
/**
|
|
7525
7628
|
* Validate all relation attributes in the data
|
|
@@ -7786,12 +7889,15 @@ var RelationService = class extends TenantAwareService {
|
|
|
7786
7889
|
|
|
7787
7890
|
// src/runtime/services/rollup.service.ts
|
|
7788
7891
|
var RollupService = class {
|
|
7789
|
-
constructor(adapter) {
|
|
7892
|
+
constructor(adapter, options) {
|
|
7790
7893
|
this.adapter = adapter;
|
|
7894
|
+
this.cache = options?.cache ?? adapter.cache;
|
|
7791
7895
|
}
|
|
7792
7896
|
/**
|
|
7793
7897
|
* Calculate a rollup value for a record
|
|
7794
7898
|
*
|
|
7899
|
+
* Results are cached if a CacheAdapter is configured.
|
|
7900
|
+
*
|
|
7795
7901
|
* @param recordId - ID of the parent record
|
|
7796
7902
|
* @param rollupAttr - Rollup attribute definition
|
|
7797
7903
|
* @param schema - Schema of the parent object
|
|
@@ -7815,6 +7921,21 @@ var RollupService = class {
|
|
|
7815
7921
|
* ```
|
|
7816
7922
|
*/
|
|
7817
7923
|
async calculate(recordId, rollupAttr, schema) {
|
|
7924
|
+
if (this.cache) {
|
|
7925
|
+
const tenantId = getTenantId();
|
|
7926
|
+
const cacheKey = cacheKeys.rollupValue(tenantId, recordId, rollupAttr.name);
|
|
7927
|
+
return this.cache.getOrSet(
|
|
7928
|
+
cacheKey,
|
|
7929
|
+
() => this.computeRollup(recordId, rollupAttr, schema),
|
|
7930
|
+
cacheTtl.rollup
|
|
7931
|
+
);
|
|
7932
|
+
}
|
|
7933
|
+
return this.computeRollup(recordId, rollupAttr, schema);
|
|
7934
|
+
}
|
|
7935
|
+
/**
|
|
7936
|
+
* Internal method to compute rollup value (no caching)
|
|
7937
|
+
*/
|
|
7938
|
+
async computeRollup(recordId, rollupAttr, schema) {
|
|
7818
7939
|
const relationAttr = schema.attributes.find(
|
|
7819
7940
|
(a) => a.type === "relation" && a.name === rollupAttr.relationAttribute
|
|
7820
7941
|
);
|
|
@@ -8053,6 +8174,31 @@ var RollupService = class {
|
|
|
8053
8174
|
}
|
|
8054
8175
|
return [...new Set(affectedIds)];
|
|
8055
8176
|
}
|
|
8177
|
+
/**
|
|
8178
|
+
* Invalidate cached rollups for affected parent records.
|
|
8179
|
+
* Call this after a child record is created, updated, or deleted.
|
|
8180
|
+
*
|
|
8181
|
+
* @param affectedParentIds - Array of parent record IDs whose rollups need invalidation
|
|
8182
|
+
*/
|
|
8183
|
+
async invalidateAffectedRollups(affectedParentIds) {
|
|
8184
|
+
if (!this.cache || affectedParentIds.length === 0) return;
|
|
8185
|
+
const tenantId = getTenantId();
|
|
8186
|
+
const cache = this.cache;
|
|
8187
|
+
await Promise.all(
|
|
8188
|
+
affectedParentIds.map(
|
|
8189
|
+
(parentId) => cache.deletePattern(cacheKeys.rollupsByRecord(tenantId, parentId))
|
|
8190
|
+
)
|
|
8191
|
+
);
|
|
8192
|
+
}
|
|
8193
|
+
/**
|
|
8194
|
+
* Invalidate all cached rollups for the current tenant.
|
|
8195
|
+
* Use sparingly - prefer targeted invalidation.
|
|
8196
|
+
*/
|
|
8197
|
+
async invalidateAllRollups() {
|
|
8198
|
+
if (!this.cache) return;
|
|
8199
|
+
const tenantId = getTenantId();
|
|
8200
|
+
await this.cache.deletePattern(cacheKeys.allRollups(tenantId));
|
|
8201
|
+
}
|
|
8056
8202
|
/**
|
|
8057
8203
|
* Find records that have forward rollups pointing to the modified record.
|
|
8058
8204
|
*
|
|
@@ -9156,6 +9302,7 @@ var RelationResolverService = class {
|
|
|
9156
9302
|
for (const record of records) {
|
|
9157
9303
|
const result = resultMap.get(record.id);
|
|
9158
9304
|
const idToAttr = recordRelationMap.get(record.id);
|
|
9305
|
+
if (!(result && idToAttr)) continue;
|
|
9159
9306
|
for (const [relatedId, attrName] of idToAttr) {
|
|
9160
9307
|
const relatedRecord = relatedRecordMap.get(relatedId);
|
|
9161
9308
|
if (relatedRecord) {
|
|
@@ -9750,7 +9897,7 @@ var ViewService = class extends TenantAwareService {
|
|
|
9750
9897
|
}
|
|
9751
9898
|
if (tabs[0].type !== "form") {
|
|
9752
9899
|
throw new ValidationError("Modal views must have a form tab", [
|
|
9753
|
-
{ path: ["tabs"], message:
|
|
9900
|
+
{ path: ["tabs"], message: `Modal views must have a form tab, not a ${tabs[0].type}` }
|
|
9754
9901
|
]);
|
|
9755
9902
|
}
|
|
9756
9903
|
}
|
|
@@ -10246,6 +10393,9 @@ export {
|
|
|
10246
10393
|
getMissingRequiredAttributes,
|
|
10247
10394
|
isRecordComplete,
|
|
10248
10395
|
computeRecordStatus,
|
|
10396
|
+
cacheKeys,
|
|
10397
|
+
cacheTtl,
|
|
10398
|
+
NoopCacheAdapter,
|
|
10249
10399
|
formatRecord,
|
|
10250
10400
|
formatRecords,
|
|
10251
10401
|
createDefaultState,
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as DateAttribute, U as UserAttribute, A as Attribute, S as SystemResource, a as SystemAction, O as ObjectAction, T as TextAttribute, b as TextAreaAttribute, R as RichtextAttribute, c as RichtextFeature, N as NumberAttribute, C as CheckboxAttribute, P as PhoneAttribute, d as CurrencyAttribute, e as Option, f as StatusAttribute, g as SelectAttribute, M as MultiselectAttribute, L as LocationAttribute, F as FileAttribute, h as SingleRelationAttribute, i as MultiRelationAttribute, j as RelationTarget, k as RatingAttribute, l as FormulaAttribute, m as FormulaReturnType, n as RollupAttribute, o as RollupFunction, p as AttributeType, q as FlowDefinition, r as FlowPage, s as FlowRow, I as InferAttributeValue, t as ObjectDefinition, u as Field, v as AttributeGroupField, G as Group, w as TableTab, V as ViewLayout, x as InverseTableTab, y as ViewDefinition, z as Tab, B as FilterState, E as SortRule, H as DirectTableTab, J as BlockNoteContent } from './runtime-
|
|
2
|
-
export { bZ as ActivityTab, bf as AddAttribute,
|
|
1
|
+
import { D as DateAttribute, U as UserAttribute, A as Attribute, S as SystemResource, a as SystemAction, O as ObjectAction, T as TextAttribute, b as TextAreaAttribute, R as RichtextAttribute, c as RichtextFeature, N as NumberAttribute, C as CheckboxAttribute, P as PhoneAttribute, d as CurrencyAttribute, e as Option, f as StatusAttribute, g as SelectAttribute, M as MultiselectAttribute, L as LocationAttribute, F as FileAttribute, h as SingleRelationAttribute, i as MultiRelationAttribute, j as RelationTarget, k as RatingAttribute, l as FormulaAttribute, m as FormulaReturnType, n as RollupAttribute, o as RollupFunction, p as AttributeType, q as FlowDefinition, r as FlowPage, s as FlowRow, I as InferAttributeValue, t as ObjectDefinition, u as Field, v as AttributeGroupField, G as Group, w as TableTab, V as ViewLayout, x as InverseTableTab, y as ViewDefinition, z as Tab, B as FilterState, E as SortRule, H as DirectTableTab, J as BlockNoteContent } from './runtime-Hwgvv9Bn.mjs';
|
|
2
|
+
export { bZ as ActivityTab, bf as AddAttribute, eD as AddAttributeInput, aP as AdvancedFilterState, bM as AssignRoleInput, e7 as AttributeChange, Q as AttributeGroup, be as AttributeMap, ba as AttributeSchema, ej as AttributesRepository, an as AuditAction, ao as AuditActorType, ap as AuditChange, as as AuditListOptions, aq as AuditLogEntry, ep as AuditRepository, am as AuditResourceType, es as AuditService, at as AuditServiceOptions, W as BaseAttribute, a5 as BlockNoteBlock, a6 as BlockNoteCustomInlineContent, a7 as BlockNoteDefaultProps, a8 as BlockNoteInlineContent, a9 as BlockNoteLink, aa as BlockNoteStyledText, ab as BlockNoteStyles, ac as BlockNoteTableCell, ad as BlockNoteTableCellProps, ae as BlockNoteTableContent, da as CacheAdapter, db as CacheOptions, aB as CheckboxFilterOperator, bA as CompletionStatus, ar as CreateAuditLogInput, eC as CreateCustomObjectInput, ft as CreateDBAttribute, fH as CreateDBFlow, fp as CreateDBObject, fD as CreateDBView, ax as CreateFile, ex as CreateFlowInput, fw as CreateObjectRecord, bL as CreatePermissionInput, bJ as CreateRoleInput, bT as CreateUserProfile, f2 as CreateViewInput, $ as Currency, aI as CurrencyFilterValue, bj as CustomAttributeValue, bY as CustomTab, fs as DBAttribute, fG as DBFlow, fo as DBObject, fC as DBView, fj as DEFAULT_LABEL_FALLBACK, cg as DEFAULT_VALIDATION_MESSAGES, d9 as DatabaseAdapter, aC as DateFilterOperator, Y as DateFormat, Z as DateValue, bG as EffectivePermissions, aM as ExtendedFilterRule, bt as ExtractAttributes, bn as ExtractRecord, bp as ExtractRecordInput, bq as ExtractRecordInputStrict, bo as ExtractRecordStrict, br as ExtractRecordUpdate, bs as ExtractRecordUpdateStrict, df as FetchResult, aw as File, f5 as FileContent, fB as FileListOptions, ew as FileService, ev as FileServiceOptions, av as FileVisibility, el as FilesRepository, aN as FilterCombinator, aO as FilterGroup, aG as FilterOperator, aL as FilterRule, aK as FilterValue, a$ as FlowRelation, a_ as FlowRowField, ez as FlowService, aZ as FlowSlot, b0 as FlowStatus, eo as FlowsRepository, bX as FormTab, dg as FormattedRecord, dR as FormulaResult, fh as FullSyncOptions, fg as FullSyncResult, b8 as GeocodingAdapter, b5 as GeocodingAutocompleteParams, b7 as GeocodingParams, eA as GeocodingService, b4 as GeocodingSuggestion, eP as GetRelationOptionsParams, fz as GlobalSearchOptions, fA as GlobalSearchResultItem, eB as GlobalSearchService, dh as GroupedFetchResult, e8 as HookContext, e9 as HookDefinition, ea as HookHandler, ed as HookRegistry, eb as HookType, bg as InferRecord, bb as InferRecordFromSchema, bh as InferRecordInput, bi as InferRecordUpdate, bc as InferRecordWithRequirements, di as InsertOptions, dV as InvalidPathError, bV as InviteUserInput, fx as ListOptions, a0 as Location, a1 as LocationGranularity, dW as MaxDepthExceededError, aE as MultiselectFilterOperator, aX as NO_VALUE_OPERATORS, aW as NoValueOperator, de as NoopCacheAdapter, b9 as NoopGeocodingAdapter, ec as NoopHookRegistry, b_ as NotesTab, aA as NumberFilterOperator, X as NumberUnit, aV as OPERATORS_BY_TYPE, bz as ObjectAttribute, bH as ObjectPermissions, bB as ObjectRecord, em as ObjectRecordsRepository, eG as ObjectSchemaService, eF as ObjectSchemaServiceOptions, ei as ObjectsRepository, fJ as OperationResult, af as PartialBlockNoteBlock, ag as PartialBlockNoteContent, ah as PartialBlockNoteInlineContent, ai as PartialBlockNoteLink, aj as PartialBlockNoteStyledText, ak as PartialBlockNoteTableCell, al as PartialBlockNoteTableContent, d_ as PathCardinality, d$ as PathSegment, e0 as PathSegmentType, bE as Permission, bC as PermissionScope, eI as PermissionService, eH as PermissionServiceOptions, eq as PermissionsRepository, _ as Phone, aJ as PhoneFilterValue, bN as PolicyContext, eg as PolicyRegistry, bP as PolicyViolationError, dv as QueryBuilder, dw as QueryBuilderOptions, dj as QueryBuilderState, dr as QueryMultipleResultsError, ds as QueryNoResultError, aU as QueryState, a2 as RELATION_TARGET_ANY, bu as RESERVED_ATTRIBUTE_NAMES, bl as RecordMetadata, bO as RecordPolicy, eK as RecordService, eJ as RecordServiceOptions, dk as RegistryMap, dl as RegistryObjectNames, a3 as RelationAttribute, aF as RelationFilterOperator, eN as RelationOption, eO as RelationOptionsResponse, eT as RelationResolverService, eR as RelationService, eQ as RelationServiceOptions, eM as RelationValidationError, eL as RelationValidationResult, aH as RelativeDateValue, bw as ReservedAttributeName, eS as ResolvedRelations, b6 as ReverseGeocodingParams, bD as Role, eU as RollupResult, eY as RollupScheduler, eX as RollupSchedulerOptions, eW as RollupService, eV as RollupServiceOptions, dt as SHORTCUT_TO_FILTER_OPERATOR, bv as SYSTEM_FIELD_NAMES, e1 as SchemaResolver, fy as SearchOptions, aD as SelectFilterOperator, dm as ShortcutOperator, f8 as SignedUrlOptions, aT as SortDirection, K as StatusGroup, f9 as StorageAdapter, au as StorageProvider, f6 as StorageUploadInput, f7 as StorageUploadResult, fc as SyncOptions, fb as SyncResult, bx as SystemFieldName, bm as SystemFields, bI as SystemPermissions, bW as TabType, eu as TenantAwareRepository, et as TenantAwareService, dE as TenantContext, dx as TenantContextError, c7 as TenantId, az as TextFilterOperator, by as Timestamps, e5 as TraversalOptions, e6 as TraversalResult, bd as TypedAttribute, fu as UpdateDBAttribute, fI as UpdateDBFlow, fq as UpdateDBObject, fE as UpdateDBView, ay as UpdateFile, ey as UpdateFlowInput, eE as UpdateObjectInput, bK as UpdateRoleInput, bU as UpdateUserProfile, f3 as UpdateViewInput, fa as UploadFileInput, fv as UpsertDBAttribute, fr as UpsertDBObject, fF as UpsertDBView, c8 as UserId, bS as UserProfile, e_ as UserProfileService, eZ as UserProfileServiceOptions, ek as UserProfilesRepository, bQ as UserRole, bF as UserRoleAssignment, f1 as UserService, bR as UserStatus, f0 as UserValidationError, e$ as UserValidationResult, c6 as Uuid, cf as ValidationMessages, c$ as ValidationResult, f4 as ViewService, fL as ViewSyncOptions, fK as ViewSyncResult, en as ViewsRepository, bk as WithCustomAttributes, c9 as asTenantId, ca as asUserId, cz as attributeConfigSchemas, er as buildAuditChanges, dc as cacheKeys, dd as cacheTtl, cl as checkboxConfigSchema, d8 as computeRecordStatus, cY as createAttributeValidator, cG as createCheckboxValidator, cJ as createCurrencyValidator, cH as createDateValidator, dn as createDefaultState, d3 as createDraftValidator, cO as createFileValidator, cZ as createFormAttributeValidator, cU as createFormulaValidator, cN as createLocationValidator, ee as createMockAdapter, cR as createMultiRelationValidator, cM as createMultiselectValidator, cF as createNumberValidator, c_ as createObjectValidator, cI as createPhoneValidator, du as createQueryBuilder, cT as createRatingValidator, cS as createRelationValidator, cX as createRichtextValidator, cV as createRollupValidator, cL as createSelectValidator, cQ as createSingleRelationValidator, cK as createStatusValidator, cW as createTextAreaValidator, cE as createTextValidator, cP as createUserValidator, co as currencyConfigSchema, cm as dateConfigSchema, ef as defaultPolicyRegistry, fn as enrichValuesWithSelectLabels, dF as evaluateFormula, dG as evaluateFormulaAttribute, dH as evaluateFormulaAttributeWithRelations, dI as evaluateFormulaWithRelations, dJ as evaluateFormulaWithResult, fm as extractAttributeNames, dK as extractFormulaVariables, dL as extractRelationNames, dM as extractRelationReferences, ct as fileConfigSchema, dN as flattenRelationsForEval, dO as formatFormulaResult, dp as formatRecord, dq as formatRecords, cx as formulaConfigSchema, cb as generateId, cc as generatePrefixedId, cA as getAttributeConfigSchema, dy as getContext, d6 as getMissingRequiredAttributes, dS as getPathDepth, dT as getRelationPath, ff as getSyncPreview, dU as getTargetAttributeName, dz as getTenantId, dA as getUserId, fO as getViewSyncPreview, dB as hasContext, dP as hasRelationReferences, c4 as isActivityTab, aQ as isAdvancedFilterState, c3 as isCustomTab, c1 as isDirectTableTab, b1 as isFlowDefinition, b2 as isFlowPublished, b$ as isFormTab, c2 as isInverseTableTab, fl as isLabelExpression, aY as isNoValueOperator, c5 as isNotesTab, d7 as isRecordComplete, b3 as isSystemFlow, c0 as isTableTab, a4 as isUniversalRelation, cq as locationConfigSchema, cs as multiselectConfigSchema, eh as notesPolicy, ck as numberConfigSchema, cC as parseAttributeConfig, dX as parsePath, dY as pathHasManyCardinality, cn as phoneConfigSchema, cw as ratingConfigSchema, cd as registry, cv as relationConfigSchema, fk as renderLabelExpression, e2 as resolveMultiplePaths, e3 as resolveSingleValue, cj as richtextConfigSchema, cy as rollupConfigSchema, dC as runWithContext, cD as safeParseAttributeConfig, cr as selectConfigSchema, cp as statusConfigSchema, fi as syncAll, fd as syncNativeObjects, fM as syncNativeViews, ch as textConfigSchema, ci as textareaConfigSchema, aR as toAdvancedFilterState, aS as toSimpleFilterState, e4 as traversePath, cu as userConfigSchema, d0 as validateAttribute, cB as validateAttributeConfig, d4 as validateDraft, d5 as validateDraftOrThrow, dQ as validateFormulaExpression, d1 as validateObject, d2 as validateObjectOrThrow, dZ as validatePath, fe as verifyNativeObjectsSync, fN as verifyNativeViewsSync, ce as viewRegistry, dD as withTenantContext } from './runtime-Hwgvv9Bn.mjs';
|
|
3
3
|
import { IconName, CountryIso3, CurrencyCode, MimeType, ColorId } from '@stndrds/constants';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as DateAttribute, U as UserAttribute, A as Attribute, S as SystemResource, a as SystemAction, O as ObjectAction, T as TextAttribute, b as TextAreaAttribute, R as RichtextAttribute, c as RichtextFeature, N as NumberAttribute, C as CheckboxAttribute, P as PhoneAttribute, d as CurrencyAttribute, e as Option, f as StatusAttribute, g as SelectAttribute, M as MultiselectAttribute, L as LocationAttribute, F as FileAttribute, h as SingleRelationAttribute, i as MultiRelationAttribute, j as RelationTarget, k as RatingAttribute, l as FormulaAttribute, m as FormulaReturnType, n as RollupAttribute, o as RollupFunction, p as AttributeType, q as FlowDefinition, r as FlowPage, s as FlowRow, I as InferAttributeValue, t as ObjectDefinition, u as Field, v as AttributeGroupField, G as Group, w as TableTab, V as ViewLayout, x as InverseTableTab, y as ViewDefinition, z as Tab, B as FilterState, E as SortRule, H as DirectTableTab, J as BlockNoteContent } from './runtime-
|
|
2
|
-
export { bZ as ActivityTab, bf as AddAttribute,
|
|
1
|
+
import { D as DateAttribute, U as UserAttribute, A as Attribute, S as SystemResource, a as SystemAction, O as ObjectAction, T as TextAttribute, b as TextAreaAttribute, R as RichtextAttribute, c as RichtextFeature, N as NumberAttribute, C as CheckboxAttribute, P as PhoneAttribute, d as CurrencyAttribute, e as Option, f as StatusAttribute, g as SelectAttribute, M as MultiselectAttribute, L as LocationAttribute, F as FileAttribute, h as SingleRelationAttribute, i as MultiRelationAttribute, j as RelationTarget, k as RatingAttribute, l as FormulaAttribute, m as FormulaReturnType, n as RollupAttribute, o as RollupFunction, p as AttributeType, q as FlowDefinition, r as FlowPage, s as FlowRow, I as InferAttributeValue, t as ObjectDefinition, u as Field, v as AttributeGroupField, G as Group, w as TableTab, V as ViewLayout, x as InverseTableTab, y as ViewDefinition, z as Tab, B as FilterState, E as SortRule, H as DirectTableTab, J as BlockNoteContent } from './runtime-Hwgvv9Bn.js';
|
|
2
|
+
export { bZ as ActivityTab, bf as AddAttribute, eD as AddAttributeInput, aP as AdvancedFilterState, bM as AssignRoleInput, e7 as AttributeChange, Q as AttributeGroup, be as AttributeMap, ba as AttributeSchema, ej as AttributesRepository, an as AuditAction, ao as AuditActorType, ap as AuditChange, as as AuditListOptions, aq as AuditLogEntry, ep as AuditRepository, am as AuditResourceType, es as AuditService, at as AuditServiceOptions, W as BaseAttribute, a5 as BlockNoteBlock, a6 as BlockNoteCustomInlineContent, a7 as BlockNoteDefaultProps, a8 as BlockNoteInlineContent, a9 as BlockNoteLink, aa as BlockNoteStyledText, ab as BlockNoteStyles, ac as BlockNoteTableCell, ad as BlockNoteTableCellProps, ae as BlockNoteTableContent, da as CacheAdapter, db as CacheOptions, aB as CheckboxFilterOperator, bA as CompletionStatus, ar as CreateAuditLogInput, eC as CreateCustomObjectInput, ft as CreateDBAttribute, fH as CreateDBFlow, fp as CreateDBObject, fD as CreateDBView, ax as CreateFile, ex as CreateFlowInput, fw as CreateObjectRecord, bL as CreatePermissionInput, bJ as CreateRoleInput, bT as CreateUserProfile, f2 as CreateViewInput, $ as Currency, aI as CurrencyFilterValue, bj as CustomAttributeValue, bY as CustomTab, fs as DBAttribute, fG as DBFlow, fo as DBObject, fC as DBView, fj as DEFAULT_LABEL_FALLBACK, cg as DEFAULT_VALIDATION_MESSAGES, d9 as DatabaseAdapter, aC as DateFilterOperator, Y as DateFormat, Z as DateValue, bG as EffectivePermissions, aM as ExtendedFilterRule, bt as ExtractAttributes, bn as ExtractRecord, bp as ExtractRecordInput, bq as ExtractRecordInputStrict, bo as ExtractRecordStrict, br as ExtractRecordUpdate, bs as ExtractRecordUpdateStrict, df as FetchResult, aw as File, f5 as FileContent, fB as FileListOptions, ew as FileService, ev as FileServiceOptions, av as FileVisibility, el as FilesRepository, aN as FilterCombinator, aO as FilterGroup, aG as FilterOperator, aL as FilterRule, aK as FilterValue, a$ as FlowRelation, a_ as FlowRowField, ez as FlowService, aZ as FlowSlot, b0 as FlowStatus, eo as FlowsRepository, bX as FormTab, dg as FormattedRecord, dR as FormulaResult, fh as FullSyncOptions, fg as FullSyncResult, b8 as GeocodingAdapter, b5 as GeocodingAutocompleteParams, b7 as GeocodingParams, eA as GeocodingService, b4 as GeocodingSuggestion, eP as GetRelationOptionsParams, fz as GlobalSearchOptions, fA as GlobalSearchResultItem, eB as GlobalSearchService, dh as GroupedFetchResult, e8 as HookContext, e9 as HookDefinition, ea as HookHandler, ed as HookRegistry, eb as HookType, bg as InferRecord, bb as InferRecordFromSchema, bh as InferRecordInput, bi as InferRecordUpdate, bc as InferRecordWithRequirements, di as InsertOptions, dV as InvalidPathError, bV as InviteUserInput, fx as ListOptions, a0 as Location, a1 as LocationGranularity, dW as MaxDepthExceededError, aE as MultiselectFilterOperator, aX as NO_VALUE_OPERATORS, aW as NoValueOperator, de as NoopCacheAdapter, b9 as NoopGeocodingAdapter, ec as NoopHookRegistry, b_ as NotesTab, aA as NumberFilterOperator, X as NumberUnit, aV as OPERATORS_BY_TYPE, bz as ObjectAttribute, bH as ObjectPermissions, bB as ObjectRecord, em as ObjectRecordsRepository, eG as ObjectSchemaService, eF as ObjectSchemaServiceOptions, ei as ObjectsRepository, fJ as OperationResult, af as PartialBlockNoteBlock, ag as PartialBlockNoteContent, ah as PartialBlockNoteInlineContent, ai as PartialBlockNoteLink, aj as PartialBlockNoteStyledText, ak as PartialBlockNoteTableCell, al as PartialBlockNoteTableContent, d_ as PathCardinality, d$ as PathSegment, e0 as PathSegmentType, bE as Permission, bC as PermissionScope, eI as PermissionService, eH as PermissionServiceOptions, eq as PermissionsRepository, _ as Phone, aJ as PhoneFilterValue, bN as PolicyContext, eg as PolicyRegistry, bP as PolicyViolationError, dv as QueryBuilder, dw as QueryBuilderOptions, dj as QueryBuilderState, dr as QueryMultipleResultsError, ds as QueryNoResultError, aU as QueryState, a2 as RELATION_TARGET_ANY, bu as RESERVED_ATTRIBUTE_NAMES, bl as RecordMetadata, bO as RecordPolicy, eK as RecordService, eJ as RecordServiceOptions, dk as RegistryMap, dl as RegistryObjectNames, a3 as RelationAttribute, aF as RelationFilterOperator, eN as RelationOption, eO as RelationOptionsResponse, eT as RelationResolverService, eR as RelationService, eQ as RelationServiceOptions, eM as RelationValidationError, eL as RelationValidationResult, aH as RelativeDateValue, bw as ReservedAttributeName, eS as ResolvedRelations, b6 as ReverseGeocodingParams, bD as Role, eU as RollupResult, eY as RollupScheduler, eX as RollupSchedulerOptions, eW as RollupService, eV as RollupServiceOptions, dt as SHORTCUT_TO_FILTER_OPERATOR, bv as SYSTEM_FIELD_NAMES, e1 as SchemaResolver, fy as SearchOptions, aD as SelectFilterOperator, dm as ShortcutOperator, f8 as SignedUrlOptions, aT as SortDirection, K as StatusGroup, f9 as StorageAdapter, au as StorageProvider, f6 as StorageUploadInput, f7 as StorageUploadResult, fc as SyncOptions, fb as SyncResult, bx as SystemFieldName, bm as SystemFields, bI as SystemPermissions, bW as TabType, eu as TenantAwareRepository, et as TenantAwareService, dE as TenantContext, dx as TenantContextError, c7 as TenantId, az as TextFilterOperator, by as Timestamps, e5 as TraversalOptions, e6 as TraversalResult, bd as TypedAttribute, fu as UpdateDBAttribute, fI as UpdateDBFlow, fq as UpdateDBObject, fE as UpdateDBView, ay as UpdateFile, ey as UpdateFlowInput, eE as UpdateObjectInput, bK as UpdateRoleInput, bU as UpdateUserProfile, f3 as UpdateViewInput, fa as UploadFileInput, fv as UpsertDBAttribute, fr as UpsertDBObject, fF as UpsertDBView, c8 as UserId, bS as UserProfile, e_ as UserProfileService, eZ as UserProfileServiceOptions, ek as UserProfilesRepository, bQ as UserRole, bF as UserRoleAssignment, f1 as UserService, bR as UserStatus, f0 as UserValidationError, e$ as UserValidationResult, c6 as Uuid, cf as ValidationMessages, c$ as ValidationResult, f4 as ViewService, fL as ViewSyncOptions, fK as ViewSyncResult, en as ViewsRepository, bk as WithCustomAttributes, c9 as asTenantId, ca as asUserId, cz as attributeConfigSchemas, er as buildAuditChanges, dc as cacheKeys, dd as cacheTtl, cl as checkboxConfigSchema, d8 as computeRecordStatus, cY as createAttributeValidator, cG as createCheckboxValidator, cJ as createCurrencyValidator, cH as createDateValidator, dn as createDefaultState, d3 as createDraftValidator, cO as createFileValidator, cZ as createFormAttributeValidator, cU as createFormulaValidator, cN as createLocationValidator, ee as createMockAdapter, cR as createMultiRelationValidator, cM as createMultiselectValidator, cF as createNumberValidator, c_ as createObjectValidator, cI as createPhoneValidator, du as createQueryBuilder, cT as createRatingValidator, cS as createRelationValidator, cX as createRichtextValidator, cV as createRollupValidator, cL as createSelectValidator, cQ as createSingleRelationValidator, cK as createStatusValidator, cW as createTextAreaValidator, cE as createTextValidator, cP as createUserValidator, co as currencyConfigSchema, cm as dateConfigSchema, ef as defaultPolicyRegistry, fn as enrichValuesWithSelectLabels, dF as evaluateFormula, dG as evaluateFormulaAttribute, dH as evaluateFormulaAttributeWithRelations, dI as evaluateFormulaWithRelations, dJ as evaluateFormulaWithResult, fm as extractAttributeNames, dK as extractFormulaVariables, dL as extractRelationNames, dM as extractRelationReferences, ct as fileConfigSchema, dN as flattenRelationsForEval, dO as formatFormulaResult, dp as formatRecord, dq as formatRecords, cx as formulaConfigSchema, cb as generateId, cc as generatePrefixedId, cA as getAttributeConfigSchema, dy as getContext, d6 as getMissingRequiredAttributes, dS as getPathDepth, dT as getRelationPath, ff as getSyncPreview, dU as getTargetAttributeName, dz as getTenantId, dA as getUserId, fO as getViewSyncPreview, dB as hasContext, dP as hasRelationReferences, c4 as isActivityTab, aQ as isAdvancedFilterState, c3 as isCustomTab, c1 as isDirectTableTab, b1 as isFlowDefinition, b2 as isFlowPublished, b$ as isFormTab, c2 as isInverseTableTab, fl as isLabelExpression, aY as isNoValueOperator, c5 as isNotesTab, d7 as isRecordComplete, b3 as isSystemFlow, c0 as isTableTab, a4 as isUniversalRelation, cq as locationConfigSchema, cs as multiselectConfigSchema, eh as notesPolicy, ck as numberConfigSchema, cC as parseAttributeConfig, dX as parsePath, dY as pathHasManyCardinality, cn as phoneConfigSchema, cw as ratingConfigSchema, cd as registry, cv as relationConfigSchema, fk as renderLabelExpression, e2 as resolveMultiplePaths, e3 as resolveSingleValue, cj as richtextConfigSchema, cy as rollupConfigSchema, dC as runWithContext, cD as safeParseAttributeConfig, cr as selectConfigSchema, cp as statusConfigSchema, fi as syncAll, fd as syncNativeObjects, fM as syncNativeViews, ch as textConfigSchema, ci as textareaConfigSchema, aR as toAdvancedFilterState, aS as toSimpleFilterState, e4 as traversePath, cu as userConfigSchema, d0 as validateAttribute, cB as validateAttributeConfig, d4 as validateDraft, d5 as validateDraftOrThrow, dQ as validateFormulaExpression, d1 as validateObject, d2 as validateObjectOrThrow, dZ as validatePath, fe as verifyNativeObjectsSync, fN as verifyNativeViewsSync, ce as viewRegistry, dD as withTenantContext } from './runtime-Hwgvv9Bn.js';
|
|
3
3
|
import { IconName, CountryIso3, CurrencyCode, MimeType, ColorId } from '@stndrds/constants';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|