@stndrds/schema 0.1.0-alpha.52 → 0.1.0-alpha.54
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-D4AFKFAX.mjs → chunk-FDM6XJIG.mjs} +148 -14
- package/dist/{chunk-LPOSOME6.js → chunk-HTZQDAMY.js} +149 -15
- package/dist/index.d.mts +29 -8
- package/dist/index.d.ts +29 -8
- package/dist/index.js +8 -6
- package/dist/index.mjs +3 -1
- package/dist/{runtime-C8IgSFtA.d.mts → runtime-C4KMp6W7.d.mts} +128 -257
- package/dist/{runtime-C8IgSFtA.d.ts → runtime-C4KMp6W7.d.ts} +128 -257
- package/dist/runtime.d.mts +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +4 -2
- package/dist/runtime.mjs +3 -1
- package/package.json +2 -2
|
@@ -473,7 +473,26 @@ var cacheKeys = {
|
|
|
473
473
|
// Invalidation Patterns (global)
|
|
474
474
|
// -------------------------------------------------------------------------
|
|
475
475
|
/** All cache for a tenant (nuclear option) */
|
|
476
|
-
allForTenant: (tenantId) => `*:${tenantId}
|
|
476
|
+
allForTenant: (tenantId) => `*:${tenantId}:*`,
|
|
477
|
+
// -------------------------------------------------------------------------
|
|
478
|
+
// Shared Resources - No tenant scoping
|
|
479
|
+
// -------------------------------------------------------------------------
|
|
480
|
+
/** Object schema for shared object (not tenant-scoped) */
|
|
481
|
+
sharedObjectSchema: (objectId) => `shared:schema:obj:${objectId}`,
|
|
482
|
+
/** Object schema for shared object by name */
|
|
483
|
+
sharedObjectSchemaByName: (name) => `shared:schema:name:${name}`,
|
|
484
|
+
/** Attributes for a shared object */
|
|
485
|
+
sharedObjectAttributes: (objectId) => `shared:attrs:${objectId}`,
|
|
486
|
+
/** Record from a shared object */
|
|
487
|
+
sharedRecord: (recordId) => `shared:record:${recordId}`,
|
|
488
|
+
/** Record list for a shared object */
|
|
489
|
+
sharedRecordList: (objectId, hash) => `shared:records:${objectId}:list:${hash}`,
|
|
490
|
+
/** All shared record lists for an object (for invalidation) */
|
|
491
|
+
allSharedRecordLists: (objectId) => `shared:records:${objectId}:list:*`,
|
|
492
|
+
/** All shared schemas (for invalidation) */
|
|
493
|
+
allSharedSchemas: () => "shared:schema:*",
|
|
494
|
+
/** All shared records (for invalidation) */
|
|
495
|
+
allSharedRecords: () => "shared:record:*"
|
|
477
496
|
};
|
|
478
497
|
var cacheTtl = {
|
|
479
498
|
/** Object schemas - rarely change (1 hour) */
|
|
@@ -966,6 +985,32 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
966
985
|
return this.clone({ includeDeleted: true });
|
|
967
986
|
}
|
|
968
987
|
// ============================================================================
|
|
988
|
+
// FULL-TEXT SEARCH
|
|
989
|
+
// ============================================================================
|
|
990
|
+
/**
|
|
991
|
+
* Full-text search across record fields.
|
|
992
|
+
* Can be combined with filters, sorts, and pagination.
|
|
993
|
+
*
|
|
994
|
+
* @example
|
|
995
|
+
* ```typescript
|
|
996
|
+
* // Search with pagination
|
|
997
|
+
* const products = await qb
|
|
998
|
+
* .search("nike air")
|
|
999
|
+
* .orderBy("createdAt", "desc")
|
|
1000
|
+
* .limit(20)
|
|
1001
|
+
* .fetch();
|
|
1002
|
+
*
|
|
1003
|
+
* // Search with filters
|
|
1004
|
+
* const activeNikeProducts = await qb
|
|
1005
|
+
* .search("nike")
|
|
1006
|
+
* .eq("status", "active")
|
|
1007
|
+
* .fetch();
|
|
1008
|
+
* ```
|
|
1009
|
+
*/
|
|
1010
|
+
search(query) {
|
|
1011
|
+
return this.clone({ search: query });
|
|
1012
|
+
}
|
|
1013
|
+
// ============================================================================
|
|
969
1014
|
// GROUP BY (KANBAN)
|
|
970
1015
|
// ============================================================================
|
|
971
1016
|
/**
|
|
@@ -1039,13 +1084,14 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
1039
1084
|
return await this.executeWithScope(async () => {
|
|
1040
1085
|
const objectId = await this.resolveObjectId();
|
|
1041
1086
|
const filters = this.state.filters.length > 0 ? { combinator: this.state.combinator, rules: this.state.filters } : void 0;
|
|
1042
|
-
const
|
|
1087
|
+
const queryOptions = {
|
|
1043
1088
|
filters,
|
|
1044
1089
|
sorts: this.state.sorts.length > 0 ? this.state.sorts : void 0,
|
|
1045
1090
|
limit: this.state.limit,
|
|
1046
1091
|
offset: this.state.offset,
|
|
1047
1092
|
includeDeleted: this.state.includeDeleted
|
|
1048
|
-
}
|
|
1093
|
+
};
|
|
1094
|
+
const result = this.state.search ? await this.recordService.searchRecords(objectId, this.state.search, queryOptions) : await this.recordService.listRecords(objectId, queryOptions);
|
|
1049
1095
|
if (this.state.raw) {
|
|
1050
1096
|
return result;
|
|
1051
1097
|
}
|
|
@@ -2885,6 +2931,7 @@ function createMockObjectsRepository(stores) {
|
|
|
2885
2931
|
icon: data.icon,
|
|
2886
2932
|
labelExpression: data.labelExpression,
|
|
2887
2933
|
system: data.system ?? false,
|
|
2934
|
+
sharingMode: data.sharingMode ?? "private",
|
|
2888
2935
|
metadata: data.metadata,
|
|
2889
2936
|
createdAt: /* @__PURE__ */ new Date(),
|
|
2890
2937
|
updatedAt: /* @__PURE__ */ new Date()
|
|
@@ -2943,6 +2990,7 @@ function createMockObjectsRepository(stores) {
|
|
|
2943
2990
|
icon: data.icon,
|
|
2944
2991
|
labelExpression: data.labelExpression,
|
|
2945
2992
|
system: data.system,
|
|
2993
|
+
sharingMode: data.sharingMode,
|
|
2946
2994
|
metadata: data.metadata,
|
|
2947
2995
|
createdAt: /* @__PURE__ */ new Date(),
|
|
2948
2996
|
updatedAt: /* @__PURE__ */ new Date()
|
|
@@ -5692,6 +5740,7 @@ function rollup(config) {
|
|
|
5692
5740
|
import z2 from "zod";
|
|
5693
5741
|
var ObjectBuilder = class {
|
|
5694
5742
|
constructor(config) {
|
|
5743
|
+
this._sharingMode = "private";
|
|
5695
5744
|
this.validateName(config.name);
|
|
5696
5745
|
this.obj = {
|
|
5697
5746
|
name: config.name,
|
|
@@ -5730,6 +5779,29 @@ var ObjectBuilder = class {
|
|
|
5730
5779
|
this.obj.system = true;
|
|
5731
5780
|
return this;
|
|
5732
5781
|
}
|
|
5782
|
+
/**
|
|
5783
|
+
* Mark this object as shared across all tenants.
|
|
5784
|
+
*
|
|
5785
|
+
* Shared objects are:
|
|
5786
|
+
* - Readable by all tenants
|
|
5787
|
+
* - Only writable by the owner tenant (tenant_id)
|
|
5788
|
+
* - Only syncable by the master tenant (requires masterTenantId in config)
|
|
5789
|
+
*
|
|
5790
|
+
* Records belonging to a shared object inherit the sharing mode.
|
|
5791
|
+
*
|
|
5792
|
+
* @example
|
|
5793
|
+
* ```typescript
|
|
5794
|
+
* const PRODUCT_CATALOG = object({ name: "product-catalog", label: "Product Catalog" })
|
|
5795
|
+
* .shared() // All tenants can read, only master can write
|
|
5796
|
+
* .system()
|
|
5797
|
+
* .labelExpression("{{ name }}")
|
|
5798
|
+
* .attribute(text({ name: "name", label: "Name" }).required());
|
|
5799
|
+
* ```
|
|
5800
|
+
*/
|
|
5801
|
+
shared() {
|
|
5802
|
+
this._sharingMode = "shared";
|
|
5803
|
+
return this;
|
|
5804
|
+
}
|
|
5733
5805
|
/**
|
|
5734
5806
|
* Add an attribute to the object with type accumulation
|
|
5735
5807
|
*
|
|
@@ -5810,7 +5882,8 @@ The labelExpression defines how records are displayed in lists and relations.
|
|
|
5810
5882
|
return {
|
|
5811
5883
|
...this.obj,
|
|
5812
5884
|
pluralLabel: this._pluralLabel,
|
|
5813
|
-
labelExpression: this._labelExpression
|
|
5885
|
+
labelExpression: this._labelExpression,
|
|
5886
|
+
sharingMode: this._sharingMode
|
|
5814
5887
|
};
|
|
5815
5888
|
}
|
|
5816
5889
|
/**
|
|
@@ -7543,17 +7616,8 @@ function createRollupValidator(_attr, _messages = DEFAULT_VALIDATION_MESSAGES) {
|
|
|
7543
7616
|
function createTextAreaValidator(_attr, _messages = DEFAULT_VALIDATION_MESSAGES) {
|
|
7544
7617
|
return z5.string();
|
|
7545
7618
|
}
|
|
7546
|
-
var blockNoteBlockSchema = z5.lazy(
|
|
7547
|
-
() => z5.object({
|
|
7548
|
-
id: z5.string().min(1, "Block must have an id"),
|
|
7549
|
-
type: z5.string().min(1, "Block must have a type"),
|
|
7550
|
-
props: z5.record(z5.string(), z5.union([z5.boolean(), z5.number(), z5.string()])),
|
|
7551
|
-
content: z5.any().optional(),
|
|
7552
|
-
children: z5.array(z5.any())
|
|
7553
|
-
})
|
|
7554
|
-
);
|
|
7555
7619
|
function createRichtextValidator(attr, messages = DEFAULT_VALIDATION_MESSAGES) {
|
|
7556
|
-
return z5.
|
|
7620
|
+
return z5.string({
|
|
7557
7621
|
message: messages.invalidRichtext(attr)
|
|
7558
7622
|
});
|
|
7559
7623
|
}
|
|
@@ -8239,6 +8303,25 @@ Reserved names: ${RESERVED_ATTRIBUTE_NAMES.join(", ")}`
|
|
|
8239
8303
|
const dbObjects = await this.adapter.objects.list();
|
|
8240
8304
|
return Promise.all(dbObjects.map((dbObject) => this.buildObjectDefinition(dbObject)));
|
|
8241
8305
|
}
|
|
8306
|
+
/**
|
|
8307
|
+
* Get object ownership info for write access checks.
|
|
8308
|
+
*
|
|
8309
|
+
* Used by RecordService to verify if the current tenant can write
|
|
8310
|
+
* to a shared object's records.
|
|
8311
|
+
*
|
|
8312
|
+
* @param objectId - Object UUID
|
|
8313
|
+
* @returns Object ownership info with tenantId and sharingMode
|
|
8314
|
+
*/
|
|
8315
|
+
async getObjectOwnerInfo(objectId) {
|
|
8316
|
+
const dbObject = await this.adapter.objects.findById(objectId);
|
|
8317
|
+
if (!dbObject) {
|
|
8318
|
+
throw new Error(`Object with id "${objectId}" not found`);
|
|
8319
|
+
}
|
|
8320
|
+
return {
|
|
8321
|
+
tenantId: dbObject.tenantId,
|
|
8322
|
+
sharingMode: dbObject.sharingMode
|
|
8323
|
+
};
|
|
8324
|
+
}
|
|
8242
8325
|
/**
|
|
8243
8326
|
* Invalidate all schema-related cache for the current tenant.
|
|
8244
8327
|
* Called automatically after schema mutations.
|
|
@@ -9228,6 +9311,15 @@ function checkRecordDeleteOrThrow(policy, record, context) {
|
|
|
9228
9311
|
throw new PolicyViolationError(policy.objectName, "delete", record.id);
|
|
9229
9312
|
}
|
|
9230
9313
|
}
|
|
9314
|
+
function checkSharedObjectWriteAccess(objectName, sharingMode, objectOwnerTenantId, currentTenantId) {
|
|
9315
|
+
if (sharingMode === "shared" && objectOwnerTenantId !== currentTenantId) {
|
|
9316
|
+
throw new SchemaError(
|
|
9317
|
+
`Cannot modify shared object "${objectName}". Shared objects are read-only for non-owner tenants.`,
|
|
9318
|
+
SchemaErrorCode.FORBIDDEN,
|
|
9319
|
+
{ objectName, ownerTenantId: objectOwnerTenantId, currentTenantId }
|
|
9320
|
+
);
|
|
9321
|
+
}
|
|
9322
|
+
}
|
|
9231
9323
|
|
|
9232
9324
|
// src/runtime/services/record/helpers/label.ts
|
|
9233
9325
|
function extractRelationIds2(val) {
|
|
@@ -10520,6 +10612,13 @@ var RecordService = class extends BaseService {
|
|
|
10520
10612
|
*/
|
|
10521
10613
|
async createRecord(objectId, data, options) {
|
|
10522
10614
|
const schema = await this.schemaService.getObjectSchema(objectId);
|
|
10615
|
+
const ownerInfo = await this.schemaService.getObjectOwnerInfo(objectId);
|
|
10616
|
+
checkSharedObjectWriteAccess(
|
|
10617
|
+
schema.name,
|
|
10618
|
+
ownerInfo.sharingMode,
|
|
10619
|
+
ownerInfo.tenantId,
|
|
10620
|
+
this.tenantId
|
|
10621
|
+
);
|
|
10523
10622
|
const dataWithDefaults = applyDefaultValues(schema, data);
|
|
10524
10623
|
await checkPermission(this.permissionService, this.userId, schema.name, "create");
|
|
10525
10624
|
const hookCtx = createContextForCreate(
|
|
@@ -10637,6 +10736,13 @@ var RecordService = class extends BaseService {
|
|
|
10637
10736
|
throw new RecordNotFoundError(recordId);
|
|
10638
10737
|
}
|
|
10639
10738
|
const schema = await this.schemaService.getObjectSchema(existing.objectId);
|
|
10739
|
+
const ownerInfo = await this.schemaService.getObjectOwnerInfo(existing.objectId);
|
|
10740
|
+
checkSharedObjectWriteAccess(
|
|
10741
|
+
schema.name,
|
|
10742
|
+
ownerInfo.sharingMode,
|
|
10743
|
+
ownerInfo.tenantId,
|
|
10744
|
+
this.tenantId
|
|
10745
|
+
);
|
|
10640
10746
|
await checkPermission(this.permissionService, this.userId, schema.name, "update");
|
|
10641
10747
|
const policy = getPolicy(this.policyRegistry, this.userId, schema.name);
|
|
10642
10748
|
if (policy && this.userId) {
|
|
@@ -10746,6 +10852,13 @@ var RecordService = class extends BaseService {
|
|
|
10746
10852
|
throw new RecordNotFoundError(recordId);
|
|
10747
10853
|
}
|
|
10748
10854
|
const schema = await this.schemaService.getObjectSchema(record.objectId);
|
|
10855
|
+
const ownerInfo = await this.schemaService.getObjectOwnerInfo(record.objectId);
|
|
10856
|
+
checkSharedObjectWriteAccess(
|
|
10857
|
+
schema.name,
|
|
10858
|
+
ownerInfo.sharingMode,
|
|
10859
|
+
ownerInfo.tenantId,
|
|
10860
|
+
this.tenantId
|
|
10861
|
+
);
|
|
10749
10862
|
await checkPermission(this.permissionService, this.userId, schema.name, "delete");
|
|
10750
10863
|
const policy = getPolicy(this.policyRegistry, this.userId, schema.name);
|
|
10751
10864
|
if (policy && this.userId) {
|
|
@@ -10817,6 +10930,13 @@ var RecordService = class extends BaseService {
|
|
|
10817
10930
|
);
|
|
10818
10931
|
}
|
|
10819
10932
|
const schema = await this.schemaService.getObjectSchema(record.objectId);
|
|
10933
|
+
const ownerInfo = await this.schemaService.getObjectOwnerInfo(record.objectId);
|
|
10934
|
+
checkSharedObjectWriteAccess(
|
|
10935
|
+
schema.name,
|
|
10936
|
+
ownerInfo.sharingMode,
|
|
10937
|
+
ownerInfo.tenantId,
|
|
10938
|
+
this.tenantId
|
|
10939
|
+
);
|
|
10820
10940
|
await checkPermission(this.permissionService, this.userId, schema.name, "update");
|
|
10821
10941
|
const hookCtx = createContextForRestore(schema, this.tenantId, record, options?.hookMetadata);
|
|
10822
10942
|
if (!options?.skipHooks) {
|
|
@@ -14043,6 +14163,18 @@ async function syncSingleObject(adapter, nativeObject, result, options) {
|
|
|
14043
14163
|
if (!nativeObject.system) {
|
|
14044
14164
|
throw new Error(`Object ${nativeObject.name} is not marked as system`);
|
|
14045
14165
|
}
|
|
14166
|
+
if (nativeObject.sharingMode === "shared") {
|
|
14167
|
+
if (!options.masterTenantId) {
|
|
14168
|
+
throw new Error(
|
|
14169
|
+
`Cannot sync shared object "${nativeObject.name}": masterTenantId must be configured in tenant options`
|
|
14170
|
+
);
|
|
14171
|
+
}
|
|
14172
|
+
if (options.tenantId && options.tenantId !== options.masterTenantId) {
|
|
14173
|
+
throw new Error(
|
|
14174
|
+
`Cannot sync shared object "${nativeObject.name}": only master tenant "${options.masterTenantId}" can sync shared objects (current: "${options.tenantId}")`
|
|
14175
|
+
);
|
|
14176
|
+
}
|
|
14177
|
+
}
|
|
14046
14178
|
const existingObject = await adapter.objects.findSystemByName(nativeObject.name);
|
|
14047
14179
|
const isNew = !existingObject;
|
|
14048
14180
|
updateObjectStats(result, isNew);
|
|
@@ -14087,6 +14219,7 @@ async function upsertObject(adapter, nativeObject, _options) {
|
|
|
14087
14219
|
description: nativeObject.description,
|
|
14088
14220
|
labelExpression: nativeObject.labelExpression,
|
|
14089
14221
|
icon: nativeObject.icon,
|
|
14222
|
+
sharingMode: nativeObject.sharingMode ?? "private",
|
|
14090
14223
|
metadata: nativeObject.metadata
|
|
14091
14224
|
});
|
|
14092
14225
|
}
|
|
@@ -14478,6 +14611,7 @@ export {
|
|
|
14478
14611
|
checkRecordAccess,
|
|
14479
14612
|
checkRecordModifyOrThrow,
|
|
14480
14613
|
checkRecordDeleteOrThrow,
|
|
14614
|
+
checkSharedObjectWriteAccess,
|
|
14481
14615
|
computeLabel,
|
|
14482
14616
|
enrichWithFormulas,
|
|
14483
14617
|
enrichRecordsWithFormulas,
|
|
@@ -473,7 +473,26 @@ var cacheKeys = {
|
|
|
473
473
|
// Invalidation Patterns (global)
|
|
474
474
|
// -------------------------------------------------------------------------
|
|
475
475
|
/** All cache for a tenant (nuclear option) */
|
|
476
|
-
allForTenant: (tenantId) => `*:${tenantId}
|
|
476
|
+
allForTenant: (tenantId) => `*:${tenantId}:*`,
|
|
477
|
+
// -------------------------------------------------------------------------
|
|
478
|
+
// Shared Resources - No tenant scoping
|
|
479
|
+
// -------------------------------------------------------------------------
|
|
480
|
+
/** Object schema for shared object (not tenant-scoped) */
|
|
481
|
+
sharedObjectSchema: (objectId) => `shared:schema:obj:${objectId}`,
|
|
482
|
+
/** Object schema for shared object by name */
|
|
483
|
+
sharedObjectSchemaByName: (name) => `shared:schema:name:${name}`,
|
|
484
|
+
/** Attributes for a shared object */
|
|
485
|
+
sharedObjectAttributes: (objectId) => `shared:attrs:${objectId}`,
|
|
486
|
+
/** Record from a shared object */
|
|
487
|
+
sharedRecord: (recordId) => `shared:record:${recordId}`,
|
|
488
|
+
/** Record list for a shared object */
|
|
489
|
+
sharedRecordList: (objectId, hash) => `shared:records:${objectId}:list:${hash}`,
|
|
490
|
+
/** All shared record lists for an object (for invalidation) */
|
|
491
|
+
allSharedRecordLists: (objectId) => `shared:records:${objectId}:list:*`,
|
|
492
|
+
/** All shared schemas (for invalidation) */
|
|
493
|
+
allSharedSchemas: () => "shared:schema:*",
|
|
494
|
+
/** All shared records (for invalidation) */
|
|
495
|
+
allSharedRecords: () => "shared:record:*"
|
|
477
496
|
};
|
|
478
497
|
var cacheTtl = {
|
|
479
498
|
/** Object schemas - rarely change (1 hour) */
|
|
@@ -966,6 +985,32 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
966
985
|
return this.clone({ includeDeleted: true });
|
|
967
986
|
}
|
|
968
987
|
// ============================================================================
|
|
988
|
+
// FULL-TEXT SEARCH
|
|
989
|
+
// ============================================================================
|
|
990
|
+
/**
|
|
991
|
+
* Full-text search across record fields.
|
|
992
|
+
* Can be combined with filters, sorts, and pagination.
|
|
993
|
+
*
|
|
994
|
+
* @example
|
|
995
|
+
* ```typescript
|
|
996
|
+
* // Search with pagination
|
|
997
|
+
* const products = await qb
|
|
998
|
+
* .search("nike air")
|
|
999
|
+
* .orderBy("createdAt", "desc")
|
|
1000
|
+
* .limit(20)
|
|
1001
|
+
* .fetch();
|
|
1002
|
+
*
|
|
1003
|
+
* // Search with filters
|
|
1004
|
+
* const activeNikeProducts = await qb
|
|
1005
|
+
* .search("nike")
|
|
1006
|
+
* .eq("status", "active")
|
|
1007
|
+
* .fetch();
|
|
1008
|
+
* ```
|
|
1009
|
+
*/
|
|
1010
|
+
search(query) {
|
|
1011
|
+
return this.clone({ search: query });
|
|
1012
|
+
}
|
|
1013
|
+
// ============================================================================
|
|
969
1014
|
// GROUP BY (KANBAN)
|
|
970
1015
|
// ============================================================================
|
|
971
1016
|
/**
|
|
@@ -1039,13 +1084,14 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
1039
1084
|
return await this.executeWithScope(async () => {
|
|
1040
1085
|
const objectId = await this.resolveObjectId();
|
|
1041
1086
|
const filters = this.state.filters.length > 0 ? { combinator: this.state.combinator, rules: this.state.filters } : void 0;
|
|
1042
|
-
const
|
|
1087
|
+
const queryOptions = {
|
|
1043
1088
|
filters,
|
|
1044
1089
|
sorts: this.state.sorts.length > 0 ? this.state.sorts : void 0,
|
|
1045
1090
|
limit: this.state.limit,
|
|
1046
1091
|
offset: this.state.offset,
|
|
1047
1092
|
includeDeleted: this.state.includeDeleted
|
|
1048
|
-
}
|
|
1093
|
+
};
|
|
1094
|
+
const result = this.state.search ? await this.recordService.searchRecords(objectId, this.state.search, queryOptions) : await this.recordService.listRecords(objectId, queryOptions);
|
|
1049
1095
|
if (this.state.raw) {
|
|
1050
1096
|
return result;
|
|
1051
1097
|
}
|
|
@@ -2885,6 +2931,7 @@ function createMockObjectsRepository(stores) {
|
|
|
2885
2931
|
icon: data.icon,
|
|
2886
2932
|
labelExpression: data.labelExpression,
|
|
2887
2933
|
system: _nullishCoalesce(data.system, () => ( false)),
|
|
2934
|
+
sharingMode: _nullishCoalesce(data.sharingMode, () => ( "private")),
|
|
2888
2935
|
metadata: data.metadata,
|
|
2889
2936
|
createdAt: /* @__PURE__ */ new Date(),
|
|
2890
2937
|
updatedAt: /* @__PURE__ */ new Date()
|
|
@@ -2943,6 +2990,7 @@ function createMockObjectsRepository(stores) {
|
|
|
2943
2990
|
icon: data.icon,
|
|
2944
2991
|
labelExpression: data.labelExpression,
|
|
2945
2992
|
system: data.system,
|
|
2993
|
+
sharingMode: data.sharingMode,
|
|
2946
2994
|
metadata: data.metadata,
|
|
2947
2995
|
createdAt: /* @__PURE__ */ new Date(),
|
|
2948
2996
|
updatedAt: /* @__PURE__ */ new Date()
|
|
@@ -5692,6 +5740,7 @@ function rollup(config) {
|
|
|
5692
5740
|
|
|
5693
5741
|
var ObjectBuilder = class {
|
|
5694
5742
|
constructor(config) {
|
|
5743
|
+
this._sharingMode = "private";
|
|
5695
5744
|
this.validateName(config.name);
|
|
5696
5745
|
this.obj = {
|
|
5697
5746
|
name: config.name,
|
|
@@ -5730,6 +5779,29 @@ var ObjectBuilder = class {
|
|
|
5730
5779
|
this.obj.system = true;
|
|
5731
5780
|
return this;
|
|
5732
5781
|
}
|
|
5782
|
+
/**
|
|
5783
|
+
* Mark this object as shared across all tenants.
|
|
5784
|
+
*
|
|
5785
|
+
* Shared objects are:
|
|
5786
|
+
* - Readable by all tenants
|
|
5787
|
+
* - Only writable by the owner tenant (tenant_id)
|
|
5788
|
+
* - Only syncable by the master tenant (requires masterTenantId in config)
|
|
5789
|
+
*
|
|
5790
|
+
* Records belonging to a shared object inherit the sharing mode.
|
|
5791
|
+
*
|
|
5792
|
+
* @example
|
|
5793
|
+
* ```typescript
|
|
5794
|
+
* const PRODUCT_CATALOG = object({ name: "product-catalog", label: "Product Catalog" })
|
|
5795
|
+
* .shared() // All tenants can read, only master can write
|
|
5796
|
+
* .system()
|
|
5797
|
+
* .labelExpression("{{ name }}")
|
|
5798
|
+
* .attribute(text({ name: "name", label: "Name" }).required());
|
|
5799
|
+
* ```
|
|
5800
|
+
*/
|
|
5801
|
+
shared() {
|
|
5802
|
+
this._sharingMode = "shared";
|
|
5803
|
+
return this;
|
|
5804
|
+
}
|
|
5733
5805
|
/**
|
|
5734
5806
|
* Add an attribute to the object with type accumulation
|
|
5735
5807
|
*
|
|
@@ -5810,7 +5882,8 @@ The labelExpression defines how records are displayed in lists and relations.
|
|
|
5810
5882
|
return {
|
|
5811
5883
|
...this.obj,
|
|
5812
5884
|
pluralLabel: this._pluralLabel,
|
|
5813
|
-
labelExpression: this._labelExpression
|
|
5885
|
+
labelExpression: this._labelExpression,
|
|
5886
|
+
sharingMode: this._sharingMode
|
|
5814
5887
|
};
|
|
5815
5888
|
}
|
|
5816
5889
|
/**
|
|
@@ -7543,17 +7616,8 @@ function createRollupValidator(_attr, _messages = DEFAULT_VALIDATION_MESSAGES) {
|
|
|
7543
7616
|
function createTextAreaValidator(_attr, _messages = DEFAULT_VALIDATION_MESSAGES) {
|
|
7544
7617
|
return _zod.z.string();
|
|
7545
7618
|
}
|
|
7546
|
-
var blockNoteBlockSchema = _zod.z.lazy(
|
|
7547
|
-
() => _zod.z.object({
|
|
7548
|
-
id: _zod.z.string().min(1, "Block must have an id"),
|
|
7549
|
-
type: _zod.z.string().min(1, "Block must have a type"),
|
|
7550
|
-
props: _zod.z.record(_zod.z.string(), _zod.z.union([_zod.z.boolean(), _zod.z.number(), _zod.z.string()])),
|
|
7551
|
-
content: _zod.z.any().optional(),
|
|
7552
|
-
children: _zod.z.array(_zod.z.any())
|
|
7553
|
-
})
|
|
7554
|
-
);
|
|
7555
7619
|
function createRichtextValidator(attr, messages = DEFAULT_VALIDATION_MESSAGES) {
|
|
7556
|
-
return _zod.z.
|
|
7620
|
+
return _zod.z.string({
|
|
7557
7621
|
message: messages.invalidRichtext(attr)
|
|
7558
7622
|
});
|
|
7559
7623
|
}
|
|
@@ -8239,6 +8303,25 @@ Reserved names: ${RESERVED_ATTRIBUTE_NAMES.join(", ")}`
|
|
|
8239
8303
|
const dbObjects = await this.adapter.objects.list();
|
|
8240
8304
|
return Promise.all(dbObjects.map((dbObject) => this.buildObjectDefinition(dbObject)));
|
|
8241
8305
|
}
|
|
8306
|
+
/**
|
|
8307
|
+
* Get object ownership info for write access checks.
|
|
8308
|
+
*
|
|
8309
|
+
* Used by RecordService to verify if the current tenant can write
|
|
8310
|
+
* to a shared object's records.
|
|
8311
|
+
*
|
|
8312
|
+
* @param objectId - Object UUID
|
|
8313
|
+
* @returns Object ownership info with tenantId and sharingMode
|
|
8314
|
+
*/
|
|
8315
|
+
async getObjectOwnerInfo(objectId) {
|
|
8316
|
+
const dbObject = await this.adapter.objects.findById(objectId);
|
|
8317
|
+
if (!dbObject) {
|
|
8318
|
+
throw new Error(`Object with id "${objectId}" not found`);
|
|
8319
|
+
}
|
|
8320
|
+
return {
|
|
8321
|
+
tenantId: dbObject.tenantId,
|
|
8322
|
+
sharingMode: dbObject.sharingMode
|
|
8323
|
+
};
|
|
8324
|
+
}
|
|
8242
8325
|
/**
|
|
8243
8326
|
* Invalidate all schema-related cache for the current tenant.
|
|
8244
8327
|
* Called automatically after schema mutations.
|
|
@@ -9228,6 +9311,15 @@ function checkRecordDeleteOrThrow(policy, record, context) {
|
|
|
9228
9311
|
throw new PolicyViolationError(policy.objectName, "delete", record.id);
|
|
9229
9312
|
}
|
|
9230
9313
|
}
|
|
9314
|
+
function checkSharedObjectWriteAccess(objectName, sharingMode, objectOwnerTenantId, currentTenantId) {
|
|
9315
|
+
if (sharingMode === "shared" && objectOwnerTenantId !== currentTenantId) {
|
|
9316
|
+
throw new SchemaError(
|
|
9317
|
+
`Cannot modify shared object "${objectName}". Shared objects are read-only for non-owner tenants.`,
|
|
9318
|
+
SchemaErrorCode.FORBIDDEN,
|
|
9319
|
+
{ objectName, ownerTenantId: objectOwnerTenantId, currentTenantId }
|
|
9320
|
+
);
|
|
9321
|
+
}
|
|
9322
|
+
}
|
|
9231
9323
|
|
|
9232
9324
|
// src/runtime/services/record/helpers/label.ts
|
|
9233
9325
|
function extractRelationIds2(val) {
|
|
@@ -10520,6 +10612,13 @@ var RecordService = class extends BaseService {
|
|
|
10520
10612
|
*/
|
|
10521
10613
|
async createRecord(objectId, data, options) {
|
|
10522
10614
|
const schema = await this.schemaService.getObjectSchema(objectId);
|
|
10615
|
+
const ownerInfo = await this.schemaService.getObjectOwnerInfo(objectId);
|
|
10616
|
+
checkSharedObjectWriteAccess(
|
|
10617
|
+
schema.name,
|
|
10618
|
+
ownerInfo.sharingMode,
|
|
10619
|
+
ownerInfo.tenantId,
|
|
10620
|
+
this.tenantId
|
|
10621
|
+
);
|
|
10523
10622
|
const dataWithDefaults = applyDefaultValues(schema, data);
|
|
10524
10623
|
await checkPermission(this.permissionService, this.userId, schema.name, "create");
|
|
10525
10624
|
const hookCtx = createContextForCreate(
|
|
@@ -10637,6 +10736,13 @@ var RecordService = class extends BaseService {
|
|
|
10637
10736
|
throw new RecordNotFoundError(recordId);
|
|
10638
10737
|
}
|
|
10639
10738
|
const schema = await this.schemaService.getObjectSchema(existing.objectId);
|
|
10739
|
+
const ownerInfo = await this.schemaService.getObjectOwnerInfo(existing.objectId);
|
|
10740
|
+
checkSharedObjectWriteAccess(
|
|
10741
|
+
schema.name,
|
|
10742
|
+
ownerInfo.sharingMode,
|
|
10743
|
+
ownerInfo.tenantId,
|
|
10744
|
+
this.tenantId
|
|
10745
|
+
);
|
|
10640
10746
|
await checkPermission(this.permissionService, this.userId, schema.name, "update");
|
|
10641
10747
|
const policy = getPolicy(this.policyRegistry, this.userId, schema.name);
|
|
10642
10748
|
if (policy && this.userId) {
|
|
@@ -10746,6 +10852,13 @@ var RecordService = class extends BaseService {
|
|
|
10746
10852
|
throw new RecordNotFoundError(recordId);
|
|
10747
10853
|
}
|
|
10748
10854
|
const schema = await this.schemaService.getObjectSchema(record.objectId);
|
|
10855
|
+
const ownerInfo = await this.schemaService.getObjectOwnerInfo(record.objectId);
|
|
10856
|
+
checkSharedObjectWriteAccess(
|
|
10857
|
+
schema.name,
|
|
10858
|
+
ownerInfo.sharingMode,
|
|
10859
|
+
ownerInfo.tenantId,
|
|
10860
|
+
this.tenantId
|
|
10861
|
+
);
|
|
10749
10862
|
await checkPermission(this.permissionService, this.userId, schema.name, "delete");
|
|
10750
10863
|
const policy = getPolicy(this.policyRegistry, this.userId, schema.name);
|
|
10751
10864
|
if (policy && this.userId) {
|
|
@@ -10817,6 +10930,13 @@ var RecordService = class extends BaseService {
|
|
|
10817
10930
|
);
|
|
10818
10931
|
}
|
|
10819
10932
|
const schema = await this.schemaService.getObjectSchema(record.objectId);
|
|
10933
|
+
const ownerInfo = await this.schemaService.getObjectOwnerInfo(record.objectId);
|
|
10934
|
+
checkSharedObjectWriteAccess(
|
|
10935
|
+
schema.name,
|
|
10936
|
+
ownerInfo.sharingMode,
|
|
10937
|
+
ownerInfo.tenantId,
|
|
10938
|
+
this.tenantId
|
|
10939
|
+
);
|
|
10820
10940
|
await checkPermission(this.permissionService, this.userId, schema.name, "update");
|
|
10821
10941
|
const hookCtx = createContextForRestore(schema, this.tenantId, record, _optionalChain([options, 'optionalAccess', _277 => _277.hookMetadata]));
|
|
10822
10942
|
if (!_optionalChain([options, 'optionalAccess', _278 => _278.skipHooks])) {
|
|
@@ -14043,6 +14163,18 @@ async function syncSingleObject(adapter, nativeObject, result, options) {
|
|
|
14043
14163
|
if (!nativeObject.system) {
|
|
14044
14164
|
throw new Error(`Object ${nativeObject.name} is not marked as system`);
|
|
14045
14165
|
}
|
|
14166
|
+
if (nativeObject.sharingMode === "shared") {
|
|
14167
|
+
if (!options.masterTenantId) {
|
|
14168
|
+
throw new Error(
|
|
14169
|
+
`Cannot sync shared object "${nativeObject.name}": masterTenantId must be configured in tenant options`
|
|
14170
|
+
);
|
|
14171
|
+
}
|
|
14172
|
+
if (options.tenantId && options.tenantId !== options.masterTenantId) {
|
|
14173
|
+
throw new Error(
|
|
14174
|
+
`Cannot sync shared object "${nativeObject.name}": only master tenant "${options.masterTenantId}" can sync shared objects (current: "${options.tenantId}")`
|
|
14175
|
+
);
|
|
14176
|
+
}
|
|
14177
|
+
}
|
|
14046
14178
|
const existingObject = await adapter.objects.findSystemByName(nativeObject.name);
|
|
14047
14179
|
const isNew = !existingObject;
|
|
14048
14180
|
updateObjectStats(result, isNew);
|
|
@@ -14087,6 +14219,7 @@ async function upsertObject(adapter, nativeObject, _options) {
|
|
|
14087
14219
|
description: nativeObject.description,
|
|
14088
14220
|
labelExpression: nativeObject.labelExpression,
|
|
14089
14221
|
icon: nativeObject.icon,
|
|
14222
|
+
sharingMode: _nullishCoalesce(nativeObject.sharingMode, () => ( "private")),
|
|
14090
14223
|
metadata: nativeObject.metadata
|
|
14091
14224
|
});
|
|
14092
14225
|
}
|
|
@@ -14510,4 +14643,5 @@ var NoopGeocodingAdapter = class {
|
|
|
14510
14643
|
|
|
14511
14644
|
|
|
14512
14645
|
|
|
14513
|
-
exports.RELATION_TARGET_ANY = RELATION_TARGET_ANY; exports.isUniversalRelation = isUniversalRelation; exports.RecordReferencedError = RecordReferencedError; exports.AttributeInUseError = AttributeInUseError; exports.ObjectReferencedError = ObjectReferencedError; exports.NoopGeocodingAdapter = NoopGeocodingAdapter; exports.SYSTEM_FIELD_NAMES = SYSTEM_FIELD_NAMES; exports.RESERVED_ATTRIBUTE_NAMES = RESERVED_ATTRIBUTE_NAMES; exports.PolicyViolationError = PolicyViolationError; exports.SYSTEM_ATTRIBUTES = SYSTEM_ATTRIBUTES; exports.getSystemAttributeList = getSystemAttributeList; exports.isSystemAttribute = isSystemAttribute; exports.isSystemAttributeObject = isSystemAttributeObject; exports.isSimpleFormNode = isSimpleFormNode; exports.isAdvancedFormNode = isAdvancedFormNode; exports.isStartNode = isStartNode; exports.isFormNode = isFormNode; exports.isConditionNode = isConditionNode; exports.isEndNode = isEndNode; exports.getNodeOutputs = getNodeOutputs; exports.isConditionRule = isConditionRule; exports.isConditionGroup = isConditionGroup; exports.eq = eq; exports.neq = neq; exports.and = and; exports.or = or; exports.inValues = inValues; exports.isEmpty = isEmpty; exports.isNotEmpty = isNotEmpty; exports.isWorkflowDefinition = isWorkflowDefinition; exports.isWorkflowPublished = isWorkflowPublished; exports.isSystemWorkflow = isSystemWorkflow; exports.isInstanceTerminal = isInstanceTerminal; exports.isInstanceWaiting = isInstanceWaiting; exports.canResumeInstance = canResumeInstance; exports.createStartTransition = createStartTransition; exports.isSignedLinkAuth = isSignedLinkAuth; exports.isPinCodeAuth = isPinCodeAuth; exports.canParticipate = canParticipate; exports.canAuthenticate = canAuthenticate; exports.canExecuteNode = canExecuteNode; exports.createEmptyContext = createEmptyContext; exports.getContextValue = getContextValue; exports.setContextValue = setContextValue; exports.mergeFormToSlot = mergeFormToSlot; exports.DEFAULT_THEME = DEFAULT_THEME; exports.mergeWithDefaults = mergeWithDefaults; exports.generateCssVariables = generateCssVariables; exports.isInstanceEvent = isInstanceEvent; exports.isNodeEvent = isNodeEvent; exports.isParticipationEvent = isParticipationEvent; exports.ConditionOperatorSchema = ConditionOperatorSchema; exports.ConditionRuleSchema = ConditionRuleSchema; exports.ConditionGroupSchema = ConditionGroupSchema; exports.StartNodeSchema = StartNodeSchema; exports.FormFieldRefSchema = FormFieldRefSchema; exports.FlowRowFieldSchema = FlowRowFieldSchema; exports.FlowRowSchema = FlowRowSchema; exports.FormNodeSchema = FormNodeSchema; exports.ConditionNodeSchema = ConditionNodeSchema; exports.EndNodeSchema = EndNodeSchema; exports.WorkflowNodeSchema = WorkflowNodeSchema; exports.SlotModeSchema = SlotModeSchema; exports.WorkflowSlotSchema = WorkflowSlotSchema; exports.ParticipantAuthConfigSchema = ParticipantAuthConfigSchema; exports.ParticipantTemplateSchema = ParticipantTemplateSchema; exports.NodePositionSchema = NodePositionSchema; exports.ViewportSchema = ViewportSchema; exports.WorkflowLayoutSchema = WorkflowLayoutSchema; exports.ThemeColorsSchema = ThemeColorsSchema; exports.ThemeLogoSchema = ThemeLogoSchema; exports.WorkflowThemeSchema = WorkflowThemeSchema; exports.WorkflowConfigSchema = WorkflowConfigSchema; exports.WorkflowStatusSchema = WorkflowStatusSchema; exports.WorkflowDefinitionSchema = WorkflowDefinitionSchema; exports.asTenantId = asTenantId; exports.asUserId = asUserId; exports.generateId = generateId; exports.generatePrefixedId = generatePrefixedId; exports.EMPTY_VALUE_PLACEHOLDER = EMPTY_VALUE_PLACEHOLDER; exports.formatAttributeValue = formatAttributeValue; exports.SchemaErrorCode = SchemaErrorCode; exports.SchemaError = SchemaError; exports.NotFoundError = NotFoundError; exports.ObjectNotFoundError = ObjectNotFoundError; exports.AttributeNotFoundError = AttributeNotFoundError; exports.RecordNotFoundError = RecordNotFoundError; exports.UserProfileNotFoundError = UserProfileNotFoundError; exports.FileNotFoundError = FileNotFoundError; exports.ValidationError = ValidationError; exports.ProtectedResourceError = ProtectedResourceError; exports.SyncError = SyncError; exports.NotSystemObjectError = NotSystemObjectError; exports.DuplicateError = DuplicateError; exports.isSchemaError = isSchemaError; exports.isNotFoundError = isNotFoundError; exports.isValidationError = isValidationError; exports.isProtectedResourceError = isProtectedResourceError; exports.ForbiddenError = ForbiddenError; exports.ProtectedRoleError = ProtectedRoleError; exports.RoleNotFoundError = RoleNotFoundError; exports.isForbiddenError = isForbiddenError; exports.text = text; exports.textarea = textarea; exports.richtext = richtext; exports.number = number; exports.checkbox = checkbox; exports.date = date; exports.phone = phone; exports.currency = currency; exports.status = status; exports.select = select; exports.multiselect = multiselect; exports.location = location; exports.file = file; exports.user = user; exports.relation = relation; exports.rating = rating; exports.formula = formula; exports.rollup = rollup; exports.ObjectBuilder = ObjectBuilder; exports.object = object; exports.GroupBuilder = GroupBuilder; exports.DirectTableTabConfig = DirectTableTabConfig; exports.InverseTableTabConfig = InverseTableTabConfig; exports.CustomTabConfig = CustomTabConfig; exports.NotesTabConfig = NotesTabConfig; exports.ActivityTabConfig = ActivityTabConfig; exports.FlowsTabConfig = FlowsTabConfig; exports.TabBuilder = TabBuilder; exports.ViewBuilder = ViewBuilder; exports.view = view; exports.group = group; exports.WorkflowFormRowBuilder = WorkflowFormRowBuilder; exports.WorkflowFormBuilder = WorkflowFormBuilder; exports.WorkflowSimpleFormBuilder = WorkflowSimpleFormBuilder; exports.WorkflowConditionBuilder = WorkflowConditionBuilder; exports.WorkflowEndBuilder = WorkflowEndBuilder; exports.WorkflowStartBuilder = WorkflowStartBuilder; exports.WorkflowParticipantBuilder = WorkflowParticipantBuilder; exports.WorkflowBuilder = WorkflowBuilder; exports.workflow = workflow; exports.registry = registry; exports.DEFAULT_VALIDATION_MESSAGES = DEFAULT_VALIDATION_MESSAGES; exports.textConfigSchema = textConfigSchema; exports.textareaConfigSchema = textareaConfigSchema; exports.richtextConfigSchema = richtextConfigSchema; exports.numberConfigSchema = numberConfigSchema; exports.checkboxConfigSchema = checkboxConfigSchema; exports.dateConfigSchema = dateConfigSchema; exports.phoneConfigSchema = phoneConfigSchema; exports.currencyConfigSchema = currencyConfigSchema; exports.statusConfigSchema = statusConfigSchema; exports.locationConfigSchema = locationConfigSchema; exports.selectConfigSchema = selectConfigSchema; exports.multiselectConfigSchema = multiselectConfigSchema; exports.fileConfigSchema = fileConfigSchema; exports.userConfigSchema = userConfigSchema; exports.relationConfigSchema = relationConfigSchema; exports.ratingConfigSchema = ratingConfigSchema; exports.formulaConfigSchema = formulaConfigSchema; exports.rollupConfigSchema = rollupConfigSchema; exports.attributeConfigSchemas = attributeConfigSchemas; exports.getAttributeConfigSchema = getAttributeConfigSchema; exports.validateAttributeConfig = validateAttributeConfig; exports.parseAttributeConfig = parseAttributeConfig; exports.safeParseAttributeConfig = safeParseAttributeConfig; exports.createTextValidator = createTextValidator; exports.createNumberValidator = createNumberValidator; exports.createCheckboxValidator = createCheckboxValidator; exports.createDateValidator = createDateValidator; exports.createPhoneValidator = createPhoneValidator; exports.createCurrencyValidator = createCurrencyValidator; exports.createStatusValidator = createStatusValidator; exports.createSelectValidator = createSelectValidator; exports.createMultiselectValidator = createMultiselectValidator; exports.createLocationValidator = createLocationValidator; exports.createFileValidator = createFileValidator; exports.createUserValidator = createUserValidator; exports.createSingleRelationValidator = createSingleRelationValidator; exports.createMultiRelationValidator = createMultiRelationValidator; exports.createRelationValidator = createRelationValidator; exports.createRatingValidator = createRatingValidator; exports.createFormulaValidator = createFormulaValidator; exports.createRollupValidator = createRollupValidator; exports.createTextAreaValidator = createTextAreaValidator; exports.createRichtextValidator = createRichtextValidator; exports.createAttributeValidator = createAttributeValidator; exports.createFormAttributeValidator = createFormAttributeValidator; exports.createObjectValidator = createObjectValidator; exports.validateAttribute = validateAttribute; exports.validateObject = validateObject; exports.validateObjectOrThrow = validateObjectOrThrow; exports.createDraftValidator = createDraftValidator; exports.validateDraft = validateDraft; exports.validateDraftOrThrow = validateDraftOrThrow; exports.getMissingRequiredAttributes = getMissingRequiredAttributes; exports.isRecordComplete = isRecordComplete; exports.computeRecordStatus = computeRecordStatus; exports.ParticipationTokenService = ParticipationTokenService; exports.getDefaultTokenService = getDefaultTokenService; exports.initializeTokenService = initializeTokenService; exports.PinCodeService = PinCodeService; exports.getDefaultPinCodeService = getDefaultPinCodeService; exports.initializePinCodeService = initializePinCodeService; exports.hashOptions = hashOptions; exports.cacheKeys = cacheKeys; exports.cacheTtl = cacheTtl; exports.defaultTtl = defaultTtl; exports.NoopCacheAdapter = NoopCacheAdapter; exports.formatRecord = formatRecord; exports.formatRecords = formatRecords; exports.createDefaultState = createDefaultState; exports.SHORTCUT_TO_FILTER_OPERATOR = SHORTCUT_TO_FILTER_OPERATOR; exports.QueryNoResultError = QueryNoResultError; exports.QueryMultipleResultsError = QueryMultipleResultsError; exports.TenantContextError = TenantContextError; exports.getSchemaFromContext = getSchemaFromContext; exports.getSchemaByNameFromContext = getSchemaByNameFromContext; exports.hasSchemaContext = hasSchemaContext; exports.getSchemaContext = getSchemaContext; exports.addSchemaToContext = addSchemaToContext; exports.runWithSchemaContext = runWithSchemaContext; exports.runWithMergedSchemaContext = runWithMergedSchemaContext; exports.getContext = getContext; exports.getTenantId = getTenantId; exports.getUserId = getUserId; exports.hasContext = hasContext; exports.runWithContext = runWithContext; exports.withTenantContext = withTenantContext; exports.QueryBuilder = QueryBuilder; exports.createQueryBuilder = createQueryBuilder; exports.evaluateCondition = evaluateCondition; exports.evaluate = evaluate; exports.evaluateWithTrace = evaluateWithTrace; exports.ExecutorRegistry = ExecutorRegistry; exports.success = success; exports.wait = wait; exports.complete = complete; exports.error = error; exports.ConditionExecutor = ConditionExecutor; exports.EndExecutor = EndExecutor; exports.FormExecutor = FormExecutor; exports.StartExecutor = StartExecutor; exports.createDefaultExecutorRegistry = createDefaultExecutorRegistry; exports.getDefaultExecutorRegistry = getDefaultExecutorRegistry; exports.evaluateFormula = evaluateFormula; exports.evaluateFormulaWithResult = evaluateFormulaWithResult; exports.formatFormulaResult = formatFormulaResult; exports.evaluateFormulaAttribute = evaluateFormulaAttribute; exports.validateFormulaExpression = validateFormulaExpression; exports.extractFormulaVariables = extractFormulaVariables; exports.extractRelationReferences = extractRelationReferences; exports.extractRelationNames = extractRelationNames; exports.hasRelationReferences = hasRelationReferences; exports.flattenRelationsForEval = flattenRelationsForEval; exports.evaluateFormulaWithRelations = evaluateFormulaWithRelations; exports.evaluateFormulaAttributeWithRelations = evaluateFormulaAttributeWithRelations; exports.InvalidPathError = InvalidPathError; exports.MaxDepthExceededError = MaxDepthExceededError; exports.parsePath = parsePath; exports.validatePath = validatePath; exports.pathHasManyCardinality = pathHasManyCardinality; exports.getPathDepth = getPathDepth; exports.getTargetAttributeName = getTargetAttributeName; exports.getRelationPath = getRelationPath; exports.traversePath = traversePath; exports.resolveSingleValue = resolveSingleValue; exports.resolveMultiplePaths = resolveMultiplePaths; exports.NoopHookRegistry = NoopHookRegistry; exports.DEFAULT_LABEL_FALLBACK = DEFAULT_LABEL_FALLBACK; exports.renderLabelExpression = renderLabelExpression; exports.isLabelExpression = isLabelExpression; exports.extractAttributeNames = extractAttributeNames; exports.enrichValuesForDisplay = enrichValuesForDisplay; exports.enrichValuesWithSelectLabels = enrichValuesWithSelectLabels; exports.extractRelationIds = extractRelationIds; exports.computeLabelWithRelations = computeLabelWithRelations; exports.createMockAdapter = createMockAdapter; exports.PolicyRegistry = PolicyRegistry; exports.defaultPolicyRegistry = defaultPolicyRegistry; exports.notesPolicy = notesPolicy; exports.BaseService = BaseService; exports.BaseRepository = BaseRepository; exports.SchemaContextAwareRepository = SchemaContextAwareRepository; exports.TenantAwareRepository = TenantAwareRepository; exports.TenantAwareService = TenantAwareService; exports.buildAuditChanges = buildAuditChanges; exports.ObjectSchemaService = ObjectSchemaService; exports.AuditService = AuditService; exports.UserService = UserService; exports.applyDefaultValues = applyDefaultValues; exports.checkPermission = checkPermission; exports.getPolicy = getPolicy; exports.buildPolicyContext = buildPolicyContext; exports.checkRecordAccess = checkRecordAccess; exports.checkRecordModifyOrThrow = checkRecordModifyOrThrow; exports.checkRecordDeleteOrThrow = checkRecordDeleteOrThrow; exports.computeLabel = computeLabel; exports.enrichWithFormulas = enrichWithFormulas; exports.enrichRecordsWithFormulas = enrichRecordsWithFormulas; exports.createContextForCreate = createContextForCreate; exports.createContextForUpdate = createContextForUpdate; exports.createContextForDelete = createContextForDelete; exports.createContextForRestore = createContextForRestore; exports.recalculateParentRollups = recalculateParentRollups; exports.RecordQueryService = RecordQueryService; exports.RecordResolverService = RecordResolverService; exports.RelationService = RelationService; exports.RollupService = RollupService; exports.RecordService = RecordService; exports.FormulaResolverService = FormulaResolverService; exports.RollupScheduler = RollupScheduler; exports.WorkflowService = WorkflowService; exports.WorkflowInstanceService = WorkflowInstanceService; exports.WorkflowParticipationService = WorkflowParticipationService; exports.WorkflowRelationService = WorkflowRelationService; exports.UserProfileService = UserProfileService; exports.FileService = FileService; exports.GeocodingService = GeocodingService; exports.GlobalSearchService = GlobalSearchService; exports.PermissionService = PermissionService; exports.ViewService = ViewService; exports.syncNativeViews = syncNativeViews; exports.verifyNativeViewsSync = verifyNativeViewsSync; exports.getViewSyncPreview = getViewSyncPreview; exports.syncNativeObjects = syncNativeObjects; exports.verifyNativeObjectsSync = verifyNativeObjectsSync; exports.getSyncPreview = getSyncPreview; exports.syncAll = syncAll;
|
|
14646
|
+
|
|
14647
|
+
exports.RELATION_TARGET_ANY = RELATION_TARGET_ANY; exports.isUniversalRelation = isUniversalRelation; exports.RecordReferencedError = RecordReferencedError; exports.AttributeInUseError = AttributeInUseError; exports.ObjectReferencedError = ObjectReferencedError; exports.NoopGeocodingAdapter = NoopGeocodingAdapter; exports.SYSTEM_FIELD_NAMES = SYSTEM_FIELD_NAMES; exports.RESERVED_ATTRIBUTE_NAMES = RESERVED_ATTRIBUTE_NAMES; exports.PolicyViolationError = PolicyViolationError; exports.SYSTEM_ATTRIBUTES = SYSTEM_ATTRIBUTES; exports.getSystemAttributeList = getSystemAttributeList; exports.isSystemAttribute = isSystemAttribute; exports.isSystemAttributeObject = isSystemAttributeObject; exports.isSimpleFormNode = isSimpleFormNode; exports.isAdvancedFormNode = isAdvancedFormNode; exports.isStartNode = isStartNode; exports.isFormNode = isFormNode; exports.isConditionNode = isConditionNode; exports.isEndNode = isEndNode; exports.getNodeOutputs = getNodeOutputs; exports.isConditionRule = isConditionRule; exports.isConditionGroup = isConditionGroup; exports.eq = eq; exports.neq = neq; exports.and = and; exports.or = or; exports.inValues = inValues; exports.isEmpty = isEmpty; exports.isNotEmpty = isNotEmpty; exports.isWorkflowDefinition = isWorkflowDefinition; exports.isWorkflowPublished = isWorkflowPublished; exports.isSystemWorkflow = isSystemWorkflow; exports.isInstanceTerminal = isInstanceTerminal; exports.isInstanceWaiting = isInstanceWaiting; exports.canResumeInstance = canResumeInstance; exports.createStartTransition = createStartTransition; exports.isSignedLinkAuth = isSignedLinkAuth; exports.isPinCodeAuth = isPinCodeAuth; exports.canParticipate = canParticipate; exports.canAuthenticate = canAuthenticate; exports.canExecuteNode = canExecuteNode; exports.createEmptyContext = createEmptyContext; exports.getContextValue = getContextValue; exports.setContextValue = setContextValue; exports.mergeFormToSlot = mergeFormToSlot; exports.DEFAULT_THEME = DEFAULT_THEME; exports.mergeWithDefaults = mergeWithDefaults; exports.generateCssVariables = generateCssVariables; exports.isInstanceEvent = isInstanceEvent; exports.isNodeEvent = isNodeEvent; exports.isParticipationEvent = isParticipationEvent; exports.ConditionOperatorSchema = ConditionOperatorSchema; exports.ConditionRuleSchema = ConditionRuleSchema; exports.ConditionGroupSchema = ConditionGroupSchema; exports.StartNodeSchema = StartNodeSchema; exports.FormFieldRefSchema = FormFieldRefSchema; exports.FlowRowFieldSchema = FlowRowFieldSchema; exports.FlowRowSchema = FlowRowSchema; exports.FormNodeSchema = FormNodeSchema; exports.ConditionNodeSchema = ConditionNodeSchema; exports.EndNodeSchema = EndNodeSchema; exports.WorkflowNodeSchema = WorkflowNodeSchema; exports.SlotModeSchema = SlotModeSchema; exports.WorkflowSlotSchema = WorkflowSlotSchema; exports.ParticipantAuthConfigSchema = ParticipantAuthConfigSchema; exports.ParticipantTemplateSchema = ParticipantTemplateSchema; exports.NodePositionSchema = NodePositionSchema; exports.ViewportSchema = ViewportSchema; exports.WorkflowLayoutSchema = WorkflowLayoutSchema; exports.ThemeColorsSchema = ThemeColorsSchema; exports.ThemeLogoSchema = ThemeLogoSchema; exports.WorkflowThemeSchema = WorkflowThemeSchema; exports.WorkflowConfigSchema = WorkflowConfigSchema; exports.WorkflowStatusSchema = WorkflowStatusSchema; exports.WorkflowDefinitionSchema = WorkflowDefinitionSchema; exports.asTenantId = asTenantId; exports.asUserId = asUserId; exports.generateId = generateId; exports.generatePrefixedId = generatePrefixedId; exports.EMPTY_VALUE_PLACEHOLDER = EMPTY_VALUE_PLACEHOLDER; exports.formatAttributeValue = formatAttributeValue; exports.SchemaErrorCode = SchemaErrorCode; exports.SchemaError = SchemaError; exports.NotFoundError = NotFoundError; exports.ObjectNotFoundError = ObjectNotFoundError; exports.AttributeNotFoundError = AttributeNotFoundError; exports.RecordNotFoundError = RecordNotFoundError; exports.UserProfileNotFoundError = UserProfileNotFoundError; exports.FileNotFoundError = FileNotFoundError; exports.ValidationError = ValidationError; exports.ProtectedResourceError = ProtectedResourceError; exports.SyncError = SyncError; exports.NotSystemObjectError = NotSystemObjectError; exports.DuplicateError = DuplicateError; exports.isSchemaError = isSchemaError; exports.isNotFoundError = isNotFoundError; exports.isValidationError = isValidationError; exports.isProtectedResourceError = isProtectedResourceError; exports.ForbiddenError = ForbiddenError; exports.ProtectedRoleError = ProtectedRoleError; exports.RoleNotFoundError = RoleNotFoundError; exports.isForbiddenError = isForbiddenError; exports.text = text; exports.textarea = textarea; exports.richtext = richtext; exports.number = number; exports.checkbox = checkbox; exports.date = date; exports.phone = phone; exports.currency = currency; exports.status = status; exports.select = select; exports.multiselect = multiselect; exports.location = location; exports.file = file; exports.user = user; exports.relation = relation; exports.rating = rating; exports.formula = formula; exports.rollup = rollup; exports.ObjectBuilder = ObjectBuilder; exports.object = object; exports.GroupBuilder = GroupBuilder; exports.DirectTableTabConfig = DirectTableTabConfig; exports.InverseTableTabConfig = InverseTableTabConfig; exports.CustomTabConfig = CustomTabConfig; exports.NotesTabConfig = NotesTabConfig; exports.ActivityTabConfig = ActivityTabConfig; exports.FlowsTabConfig = FlowsTabConfig; exports.TabBuilder = TabBuilder; exports.ViewBuilder = ViewBuilder; exports.view = view; exports.group = group; exports.WorkflowFormRowBuilder = WorkflowFormRowBuilder; exports.WorkflowFormBuilder = WorkflowFormBuilder; exports.WorkflowSimpleFormBuilder = WorkflowSimpleFormBuilder; exports.WorkflowConditionBuilder = WorkflowConditionBuilder; exports.WorkflowEndBuilder = WorkflowEndBuilder; exports.WorkflowStartBuilder = WorkflowStartBuilder; exports.WorkflowParticipantBuilder = WorkflowParticipantBuilder; exports.WorkflowBuilder = WorkflowBuilder; exports.workflow = workflow; exports.registry = registry; exports.DEFAULT_VALIDATION_MESSAGES = DEFAULT_VALIDATION_MESSAGES; exports.textConfigSchema = textConfigSchema; exports.textareaConfigSchema = textareaConfigSchema; exports.richtextConfigSchema = richtextConfigSchema; exports.numberConfigSchema = numberConfigSchema; exports.checkboxConfigSchema = checkboxConfigSchema; exports.dateConfigSchema = dateConfigSchema; exports.phoneConfigSchema = phoneConfigSchema; exports.currencyConfigSchema = currencyConfigSchema; exports.statusConfigSchema = statusConfigSchema; exports.locationConfigSchema = locationConfigSchema; exports.selectConfigSchema = selectConfigSchema; exports.multiselectConfigSchema = multiselectConfigSchema; exports.fileConfigSchema = fileConfigSchema; exports.userConfigSchema = userConfigSchema; exports.relationConfigSchema = relationConfigSchema; exports.ratingConfigSchema = ratingConfigSchema; exports.formulaConfigSchema = formulaConfigSchema; exports.rollupConfigSchema = rollupConfigSchema; exports.attributeConfigSchemas = attributeConfigSchemas; exports.getAttributeConfigSchema = getAttributeConfigSchema; exports.validateAttributeConfig = validateAttributeConfig; exports.parseAttributeConfig = parseAttributeConfig; exports.safeParseAttributeConfig = safeParseAttributeConfig; exports.createTextValidator = createTextValidator; exports.createNumberValidator = createNumberValidator; exports.createCheckboxValidator = createCheckboxValidator; exports.createDateValidator = createDateValidator; exports.createPhoneValidator = createPhoneValidator; exports.createCurrencyValidator = createCurrencyValidator; exports.createStatusValidator = createStatusValidator; exports.createSelectValidator = createSelectValidator; exports.createMultiselectValidator = createMultiselectValidator; exports.createLocationValidator = createLocationValidator; exports.createFileValidator = createFileValidator; exports.createUserValidator = createUserValidator; exports.createSingleRelationValidator = createSingleRelationValidator; exports.createMultiRelationValidator = createMultiRelationValidator; exports.createRelationValidator = createRelationValidator; exports.createRatingValidator = createRatingValidator; exports.createFormulaValidator = createFormulaValidator; exports.createRollupValidator = createRollupValidator; exports.createTextAreaValidator = createTextAreaValidator; exports.createRichtextValidator = createRichtextValidator; exports.createAttributeValidator = createAttributeValidator; exports.createFormAttributeValidator = createFormAttributeValidator; exports.createObjectValidator = createObjectValidator; exports.validateAttribute = validateAttribute; exports.validateObject = validateObject; exports.validateObjectOrThrow = validateObjectOrThrow; exports.createDraftValidator = createDraftValidator; exports.validateDraft = validateDraft; exports.validateDraftOrThrow = validateDraftOrThrow; exports.getMissingRequiredAttributes = getMissingRequiredAttributes; exports.isRecordComplete = isRecordComplete; exports.computeRecordStatus = computeRecordStatus; exports.ParticipationTokenService = ParticipationTokenService; exports.getDefaultTokenService = getDefaultTokenService; exports.initializeTokenService = initializeTokenService; exports.PinCodeService = PinCodeService; exports.getDefaultPinCodeService = getDefaultPinCodeService; exports.initializePinCodeService = initializePinCodeService; exports.hashOptions = hashOptions; exports.cacheKeys = cacheKeys; exports.cacheTtl = cacheTtl; exports.defaultTtl = defaultTtl; exports.NoopCacheAdapter = NoopCacheAdapter; exports.formatRecord = formatRecord; exports.formatRecords = formatRecords; exports.createDefaultState = createDefaultState; exports.SHORTCUT_TO_FILTER_OPERATOR = SHORTCUT_TO_FILTER_OPERATOR; exports.QueryNoResultError = QueryNoResultError; exports.QueryMultipleResultsError = QueryMultipleResultsError; exports.TenantContextError = TenantContextError; exports.getSchemaFromContext = getSchemaFromContext; exports.getSchemaByNameFromContext = getSchemaByNameFromContext; exports.hasSchemaContext = hasSchemaContext; exports.getSchemaContext = getSchemaContext; exports.addSchemaToContext = addSchemaToContext; exports.runWithSchemaContext = runWithSchemaContext; exports.runWithMergedSchemaContext = runWithMergedSchemaContext; exports.getContext = getContext; exports.getTenantId = getTenantId; exports.getUserId = getUserId; exports.hasContext = hasContext; exports.runWithContext = runWithContext; exports.withTenantContext = withTenantContext; exports.QueryBuilder = QueryBuilder; exports.createQueryBuilder = createQueryBuilder; exports.evaluateCondition = evaluateCondition; exports.evaluate = evaluate; exports.evaluateWithTrace = evaluateWithTrace; exports.ExecutorRegistry = ExecutorRegistry; exports.success = success; exports.wait = wait; exports.complete = complete; exports.error = error; exports.ConditionExecutor = ConditionExecutor; exports.EndExecutor = EndExecutor; exports.FormExecutor = FormExecutor; exports.StartExecutor = StartExecutor; exports.createDefaultExecutorRegistry = createDefaultExecutorRegistry; exports.getDefaultExecutorRegistry = getDefaultExecutorRegistry; exports.evaluateFormula = evaluateFormula; exports.evaluateFormulaWithResult = evaluateFormulaWithResult; exports.formatFormulaResult = formatFormulaResult; exports.evaluateFormulaAttribute = evaluateFormulaAttribute; exports.validateFormulaExpression = validateFormulaExpression; exports.extractFormulaVariables = extractFormulaVariables; exports.extractRelationReferences = extractRelationReferences; exports.extractRelationNames = extractRelationNames; exports.hasRelationReferences = hasRelationReferences; exports.flattenRelationsForEval = flattenRelationsForEval; exports.evaluateFormulaWithRelations = evaluateFormulaWithRelations; exports.evaluateFormulaAttributeWithRelations = evaluateFormulaAttributeWithRelations; exports.InvalidPathError = InvalidPathError; exports.MaxDepthExceededError = MaxDepthExceededError; exports.parsePath = parsePath; exports.validatePath = validatePath; exports.pathHasManyCardinality = pathHasManyCardinality; exports.getPathDepth = getPathDepth; exports.getTargetAttributeName = getTargetAttributeName; exports.getRelationPath = getRelationPath; exports.traversePath = traversePath; exports.resolveSingleValue = resolveSingleValue; exports.resolveMultiplePaths = resolveMultiplePaths; exports.NoopHookRegistry = NoopHookRegistry; exports.DEFAULT_LABEL_FALLBACK = DEFAULT_LABEL_FALLBACK; exports.renderLabelExpression = renderLabelExpression; exports.isLabelExpression = isLabelExpression; exports.extractAttributeNames = extractAttributeNames; exports.enrichValuesForDisplay = enrichValuesForDisplay; exports.enrichValuesWithSelectLabels = enrichValuesWithSelectLabels; exports.extractRelationIds = extractRelationIds; exports.computeLabelWithRelations = computeLabelWithRelations; exports.createMockAdapter = createMockAdapter; exports.PolicyRegistry = PolicyRegistry; exports.defaultPolicyRegistry = defaultPolicyRegistry; exports.notesPolicy = notesPolicy; exports.BaseService = BaseService; exports.BaseRepository = BaseRepository; exports.SchemaContextAwareRepository = SchemaContextAwareRepository; exports.TenantAwareRepository = TenantAwareRepository; exports.TenantAwareService = TenantAwareService; exports.buildAuditChanges = buildAuditChanges; exports.ObjectSchemaService = ObjectSchemaService; exports.AuditService = AuditService; exports.UserService = UserService; exports.applyDefaultValues = applyDefaultValues; exports.checkPermission = checkPermission; exports.getPolicy = getPolicy; exports.buildPolicyContext = buildPolicyContext; exports.checkRecordAccess = checkRecordAccess; exports.checkRecordModifyOrThrow = checkRecordModifyOrThrow; exports.checkRecordDeleteOrThrow = checkRecordDeleteOrThrow; exports.checkSharedObjectWriteAccess = checkSharedObjectWriteAccess; exports.computeLabel = computeLabel; exports.enrichWithFormulas = enrichWithFormulas; exports.enrichRecordsWithFormulas = enrichRecordsWithFormulas; exports.createContextForCreate = createContextForCreate; exports.createContextForUpdate = createContextForUpdate; exports.createContextForDelete = createContextForDelete; exports.createContextForRestore = createContextForRestore; exports.recalculateParentRollups = recalculateParentRollups; exports.RecordQueryService = RecordQueryService; exports.RecordResolverService = RecordResolverService; exports.RelationService = RelationService; exports.RollupService = RollupService; exports.RecordService = RecordService; exports.FormulaResolverService = FormulaResolverService; exports.RollupScheduler = RollupScheduler; exports.WorkflowService = WorkflowService; exports.WorkflowInstanceService = WorkflowInstanceService; exports.WorkflowParticipationService = WorkflowParticipationService; exports.WorkflowRelationService = WorkflowRelationService; exports.UserProfileService = UserProfileService; exports.FileService = FileService; exports.GeocodingService = GeocodingService; exports.GlobalSearchService = GlobalSearchService; exports.PermissionService = PermissionService; exports.ViewService = ViewService; exports.syncNativeViews = syncNativeViews; exports.verifyNativeViewsSync = verifyNativeViewsSync; exports.getViewSyncPreview = getViewSyncPreview; exports.syncNativeObjects = syncNativeObjects; exports.verifyNativeObjectsSync = verifyNativeObjectsSync; exports.getSyncPreview = getSyncPreview; exports.syncAll = syncAll;
|