@stndrds/schema 0.1.0-alpha.52 → 0.1.0-alpha.53
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-2EIZ6QXN.mjs} +119 -12
- package/dist/{chunk-LPOSOME6.js → chunk-67XEOXQL.js} +120 -13
- 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-B5JYQdZx.d.mts} +98 -256
- package/dist/{runtime-C8IgSFtA.d.ts → runtime-B5JYQdZx.d.ts} +98 -256
- 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) */
|
|
@@ -2885,6 +2904,7 @@ function createMockObjectsRepository(stores) {
|
|
|
2885
2904
|
icon: data.icon,
|
|
2886
2905
|
labelExpression: data.labelExpression,
|
|
2887
2906
|
system: data.system ?? false,
|
|
2907
|
+
sharingMode: data.sharingMode ?? "private",
|
|
2888
2908
|
metadata: data.metadata,
|
|
2889
2909
|
createdAt: /* @__PURE__ */ new Date(),
|
|
2890
2910
|
updatedAt: /* @__PURE__ */ new Date()
|
|
@@ -2943,6 +2963,7 @@ function createMockObjectsRepository(stores) {
|
|
|
2943
2963
|
icon: data.icon,
|
|
2944
2964
|
labelExpression: data.labelExpression,
|
|
2945
2965
|
system: data.system,
|
|
2966
|
+
sharingMode: data.sharingMode,
|
|
2946
2967
|
metadata: data.metadata,
|
|
2947
2968
|
createdAt: /* @__PURE__ */ new Date(),
|
|
2948
2969
|
updatedAt: /* @__PURE__ */ new Date()
|
|
@@ -5692,6 +5713,7 @@ function rollup(config) {
|
|
|
5692
5713
|
import z2 from "zod";
|
|
5693
5714
|
var ObjectBuilder = class {
|
|
5694
5715
|
constructor(config) {
|
|
5716
|
+
this._sharingMode = "private";
|
|
5695
5717
|
this.validateName(config.name);
|
|
5696
5718
|
this.obj = {
|
|
5697
5719
|
name: config.name,
|
|
@@ -5730,6 +5752,29 @@ var ObjectBuilder = class {
|
|
|
5730
5752
|
this.obj.system = true;
|
|
5731
5753
|
return this;
|
|
5732
5754
|
}
|
|
5755
|
+
/**
|
|
5756
|
+
* Mark this object as shared across all tenants.
|
|
5757
|
+
*
|
|
5758
|
+
* Shared objects are:
|
|
5759
|
+
* - Readable by all tenants
|
|
5760
|
+
* - Only writable by the owner tenant (tenant_id)
|
|
5761
|
+
* - Only syncable by the master tenant (requires masterTenantId in config)
|
|
5762
|
+
*
|
|
5763
|
+
* Records belonging to a shared object inherit the sharing mode.
|
|
5764
|
+
*
|
|
5765
|
+
* @example
|
|
5766
|
+
* ```typescript
|
|
5767
|
+
* const PRODUCT_CATALOG = object({ name: "product-catalog", label: "Product Catalog" })
|
|
5768
|
+
* .shared() // All tenants can read, only master can write
|
|
5769
|
+
* .system()
|
|
5770
|
+
* .labelExpression("{{ name }}")
|
|
5771
|
+
* .attribute(text({ name: "name", label: "Name" }).required());
|
|
5772
|
+
* ```
|
|
5773
|
+
*/
|
|
5774
|
+
shared() {
|
|
5775
|
+
this._sharingMode = "shared";
|
|
5776
|
+
return this;
|
|
5777
|
+
}
|
|
5733
5778
|
/**
|
|
5734
5779
|
* Add an attribute to the object with type accumulation
|
|
5735
5780
|
*
|
|
@@ -5810,7 +5855,8 @@ The labelExpression defines how records are displayed in lists and relations.
|
|
|
5810
5855
|
return {
|
|
5811
5856
|
...this.obj,
|
|
5812
5857
|
pluralLabel: this._pluralLabel,
|
|
5813
|
-
labelExpression: this._labelExpression
|
|
5858
|
+
labelExpression: this._labelExpression,
|
|
5859
|
+
sharingMode: this._sharingMode
|
|
5814
5860
|
};
|
|
5815
5861
|
}
|
|
5816
5862
|
/**
|
|
@@ -7543,17 +7589,8 @@ function createRollupValidator(_attr, _messages = DEFAULT_VALIDATION_MESSAGES) {
|
|
|
7543
7589
|
function createTextAreaValidator(_attr, _messages = DEFAULT_VALIDATION_MESSAGES) {
|
|
7544
7590
|
return z5.string();
|
|
7545
7591
|
}
|
|
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
7592
|
function createRichtextValidator(attr, messages = DEFAULT_VALIDATION_MESSAGES) {
|
|
7556
|
-
return z5.
|
|
7593
|
+
return z5.string({
|
|
7557
7594
|
message: messages.invalidRichtext(attr)
|
|
7558
7595
|
});
|
|
7559
7596
|
}
|
|
@@ -8239,6 +8276,25 @@ Reserved names: ${RESERVED_ATTRIBUTE_NAMES.join(", ")}`
|
|
|
8239
8276
|
const dbObjects = await this.adapter.objects.list();
|
|
8240
8277
|
return Promise.all(dbObjects.map((dbObject) => this.buildObjectDefinition(dbObject)));
|
|
8241
8278
|
}
|
|
8279
|
+
/**
|
|
8280
|
+
* Get object ownership info for write access checks.
|
|
8281
|
+
*
|
|
8282
|
+
* Used by RecordService to verify if the current tenant can write
|
|
8283
|
+
* to a shared object's records.
|
|
8284
|
+
*
|
|
8285
|
+
* @param objectId - Object UUID
|
|
8286
|
+
* @returns Object ownership info with tenantId and sharingMode
|
|
8287
|
+
*/
|
|
8288
|
+
async getObjectOwnerInfo(objectId) {
|
|
8289
|
+
const dbObject = await this.adapter.objects.findById(objectId);
|
|
8290
|
+
if (!dbObject) {
|
|
8291
|
+
throw new Error(`Object with id "${objectId}" not found`);
|
|
8292
|
+
}
|
|
8293
|
+
return {
|
|
8294
|
+
tenantId: dbObject.tenantId,
|
|
8295
|
+
sharingMode: dbObject.sharingMode
|
|
8296
|
+
};
|
|
8297
|
+
}
|
|
8242
8298
|
/**
|
|
8243
8299
|
* Invalidate all schema-related cache for the current tenant.
|
|
8244
8300
|
* Called automatically after schema mutations.
|
|
@@ -9228,6 +9284,15 @@ function checkRecordDeleteOrThrow(policy, record, context) {
|
|
|
9228
9284
|
throw new PolicyViolationError(policy.objectName, "delete", record.id);
|
|
9229
9285
|
}
|
|
9230
9286
|
}
|
|
9287
|
+
function checkSharedObjectWriteAccess(objectName, sharingMode, objectOwnerTenantId, currentTenantId) {
|
|
9288
|
+
if (sharingMode === "shared" && objectOwnerTenantId !== currentTenantId) {
|
|
9289
|
+
throw new SchemaError(
|
|
9290
|
+
`Cannot modify shared object "${objectName}". Shared objects are read-only for non-owner tenants.`,
|
|
9291
|
+
SchemaErrorCode.FORBIDDEN,
|
|
9292
|
+
{ objectName, ownerTenantId: objectOwnerTenantId, currentTenantId }
|
|
9293
|
+
);
|
|
9294
|
+
}
|
|
9295
|
+
}
|
|
9231
9296
|
|
|
9232
9297
|
// src/runtime/services/record/helpers/label.ts
|
|
9233
9298
|
function extractRelationIds2(val) {
|
|
@@ -10520,6 +10585,13 @@ var RecordService = class extends BaseService {
|
|
|
10520
10585
|
*/
|
|
10521
10586
|
async createRecord(objectId, data, options) {
|
|
10522
10587
|
const schema = await this.schemaService.getObjectSchema(objectId);
|
|
10588
|
+
const ownerInfo = await this.schemaService.getObjectOwnerInfo(objectId);
|
|
10589
|
+
checkSharedObjectWriteAccess(
|
|
10590
|
+
schema.name,
|
|
10591
|
+
ownerInfo.sharingMode,
|
|
10592
|
+
ownerInfo.tenantId,
|
|
10593
|
+
this.tenantId
|
|
10594
|
+
);
|
|
10523
10595
|
const dataWithDefaults = applyDefaultValues(schema, data);
|
|
10524
10596
|
await checkPermission(this.permissionService, this.userId, schema.name, "create");
|
|
10525
10597
|
const hookCtx = createContextForCreate(
|
|
@@ -10637,6 +10709,13 @@ var RecordService = class extends BaseService {
|
|
|
10637
10709
|
throw new RecordNotFoundError(recordId);
|
|
10638
10710
|
}
|
|
10639
10711
|
const schema = await this.schemaService.getObjectSchema(existing.objectId);
|
|
10712
|
+
const ownerInfo = await this.schemaService.getObjectOwnerInfo(existing.objectId);
|
|
10713
|
+
checkSharedObjectWriteAccess(
|
|
10714
|
+
schema.name,
|
|
10715
|
+
ownerInfo.sharingMode,
|
|
10716
|
+
ownerInfo.tenantId,
|
|
10717
|
+
this.tenantId
|
|
10718
|
+
);
|
|
10640
10719
|
await checkPermission(this.permissionService, this.userId, schema.name, "update");
|
|
10641
10720
|
const policy = getPolicy(this.policyRegistry, this.userId, schema.name);
|
|
10642
10721
|
if (policy && this.userId) {
|
|
@@ -10746,6 +10825,13 @@ var RecordService = class extends BaseService {
|
|
|
10746
10825
|
throw new RecordNotFoundError(recordId);
|
|
10747
10826
|
}
|
|
10748
10827
|
const schema = await this.schemaService.getObjectSchema(record.objectId);
|
|
10828
|
+
const ownerInfo = await this.schemaService.getObjectOwnerInfo(record.objectId);
|
|
10829
|
+
checkSharedObjectWriteAccess(
|
|
10830
|
+
schema.name,
|
|
10831
|
+
ownerInfo.sharingMode,
|
|
10832
|
+
ownerInfo.tenantId,
|
|
10833
|
+
this.tenantId
|
|
10834
|
+
);
|
|
10749
10835
|
await checkPermission(this.permissionService, this.userId, schema.name, "delete");
|
|
10750
10836
|
const policy = getPolicy(this.policyRegistry, this.userId, schema.name);
|
|
10751
10837
|
if (policy && this.userId) {
|
|
@@ -10817,6 +10903,13 @@ var RecordService = class extends BaseService {
|
|
|
10817
10903
|
);
|
|
10818
10904
|
}
|
|
10819
10905
|
const schema = await this.schemaService.getObjectSchema(record.objectId);
|
|
10906
|
+
const ownerInfo = await this.schemaService.getObjectOwnerInfo(record.objectId);
|
|
10907
|
+
checkSharedObjectWriteAccess(
|
|
10908
|
+
schema.name,
|
|
10909
|
+
ownerInfo.sharingMode,
|
|
10910
|
+
ownerInfo.tenantId,
|
|
10911
|
+
this.tenantId
|
|
10912
|
+
);
|
|
10820
10913
|
await checkPermission(this.permissionService, this.userId, schema.name, "update");
|
|
10821
10914
|
const hookCtx = createContextForRestore(schema, this.tenantId, record, options?.hookMetadata);
|
|
10822
10915
|
if (!options?.skipHooks) {
|
|
@@ -14043,6 +14136,18 @@ async function syncSingleObject(adapter, nativeObject, result, options) {
|
|
|
14043
14136
|
if (!nativeObject.system) {
|
|
14044
14137
|
throw new Error(`Object ${nativeObject.name} is not marked as system`);
|
|
14045
14138
|
}
|
|
14139
|
+
if (nativeObject.sharingMode === "shared") {
|
|
14140
|
+
if (!options.masterTenantId) {
|
|
14141
|
+
throw new Error(
|
|
14142
|
+
`Cannot sync shared object "${nativeObject.name}": masterTenantId must be configured in tenant options`
|
|
14143
|
+
);
|
|
14144
|
+
}
|
|
14145
|
+
if (options.tenantId && options.tenantId !== options.masterTenantId) {
|
|
14146
|
+
throw new Error(
|
|
14147
|
+
`Cannot sync shared object "${nativeObject.name}": only master tenant "${options.masterTenantId}" can sync shared objects (current: "${options.tenantId}")`
|
|
14148
|
+
);
|
|
14149
|
+
}
|
|
14150
|
+
}
|
|
14046
14151
|
const existingObject = await adapter.objects.findSystemByName(nativeObject.name);
|
|
14047
14152
|
const isNew = !existingObject;
|
|
14048
14153
|
updateObjectStats(result, isNew);
|
|
@@ -14087,6 +14192,7 @@ async function upsertObject(adapter, nativeObject, _options) {
|
|
|
14087
14192
|
description: nativeObject.description,
|
|
14088
14193
|
labelExpression: nativeObject.labelExpression,
|
|
14089
14194
|
icon: nativeObject.icon,
|
|
14195
|
+
sharingMode: nativeObject.sharingMode ?? "private",
|
|
14090
14196
|
metadata: nativeObject.metadata
|
|
14091
14197
|
});
|
|
14092
14198
|
}
|
|
@@ -14478,6 +14584,7 @@ export {
|
|
|
14478
14584
|
checkRecordAccess,
|
|
14479
14585
|
checkRecordModifyOrThrow,
|
|
14480
14586
|
checkRecordDeleteOrThrow,
|
|
14587
|
+
checkSharedObjectWriteAccess,
|
|
14481
14588
|
computeLabel,
|
|
14482
14589
|
enrichWithFormulas,
|
|
14483
14590
|
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) */
|
|
@@ -2885,6 +2904,7 @@ function createMockObjectsRepository(stores) {
|
|
|
2885
2904
|
icon: data.icon,
|
|
2886
2905
|
labelExpression: data.labelExpression,
|
|
2887
2906
|
system: _nullishCoalesce(data.system, () => ( false)),
|
|
2907
|
+
sharingMode: _nullishCoalesce(data.sharingMode, () => ( "private")),
|
|
2888
2908
|
metadata: data.metadata,
|
|
2889
2909
|
createdAt: /* @__PURE__ */ new Date(),
|
|
2890
2910
|
updatedAt: /* @__PURE__ */ new Date()
|
|
@@ -2943,6 +2963,7 @@ function createMockObjectsRepository(stores) {
|
|
|
2943
2963
|
icon: data.icon,
|
|
2944
2964
|
labelExpression: data.labelExpression,
|
|
2945
2965
|
system: data.system,
|
|
2966
|
+
sharingMode: data.sharingMode,
|
|
2946
2967
|
metadata: data.metadata,
|
|
2947
2968
|
createdAt: /* @__PURE__ */ new Date(),
|
|
2948
2969
|
updatedAt: /* @__PURE__ */ new Date()
|
|
@@ -5692,6 +5713,7 @@ function rollup(config) {
|
|
|
5692
5713
|
|
|
5693
5714
|
var ObjectBuilder = class {
|
|
5694
5715
|
constructor(config) {
|
|
5716
|
+
this._sharingMode = "private";
|
|
5695
5717
|
this.validateName(config.name);
|
|
5696
5718
|
this.obj = {
|
|
5697
5719
|
name: config.name,
|
|
@@ -5730,6 +5752,29 @@ var ObjectBuilder = class {
|
|
|
5730
5752
|
this.obj.system = true;
|
|
5731
5753
|
return this;
|
|
5732
5754
|
}
|
|
5755
|
+
/**
|
|
5756
|
+
* Mark this object as shared across all tenants.
|
|
5757
|
+
*
|
|
5758
|
+
* Shared objects are:
|
|
5759
|
+
* - Readable by all tenants
|
|
5760
|
+
* - Only writable by the owner tenant (tenant_id)
|
|
5761
|
+
* - Only syncable by the master tenant (requires masterTenantId in config)
|
|
5762
|
+
*
|
|
5763
|
+
* Records belonging to a shared object inherit the sharing mode.
|
|
5764
|
+
*
|
|
5765
|
+
* @example
|
|
5766
|
+
* ```typescript
|
|
5767
|
+
* const PRODUCT_CATALOG = object({ name: "product-catalog", label: "Product Catalog" })
|
|
5768
|
+
* .shared() // All tenants can read, only master can write
|
|
5769
|
+
* .system()
|
|
5770
|
+
* .labelExpression("{{ name }}")
|
|
5771
|
+
* .attribute(text({ name: "name", label: "Name" }).required());
|
|
5772
|
+
* ```
|
|
5773
|
+
*/
|
|
5774
|
+
shared() {
|
|
5775
|
+
this._sharingMode = "shared";
|
|
5776
|
+
return this;
|
|
5777
|
+
}
|
|
5733
5778
|
/**
|
|
5734
5779
|
* Add an attribute to the object with type accumulation
|
|
5735
5780
|
*
|
|
@@ -5810,7 +5855,8 @@ The labelExpression defines how records are displayed in lists and relations.
|
|
|
5810
5855
|
return {
|
|
5811
5856
|
...this.obj,
|
|
5812
5857
|
pluralLabel: this._pluralLabel,
|
|
5813
|
-
labelExpression: this._labelExpression
|
|
5858
|
+
labelExpression: this._labelExpression,
|
|
5859
|
+
sharingMode: this._sharingMode
|
|
5814
5860
|
};
|
|
5815
5861
|
}
|
|
5816
5862
|
/**
|
|
@@ -7543,17 +7589,8 @@ function createRollupValidator(_attr, _messages = DEFAULT_VALIDATION_MESSAGES) {
|
|
|
7543
7589
|
function createTextAreaValidator(_attr, _messages = DEFAULT_VALIDATION_MESSAGES) {
|
|
7544
7590
|
return _zod.z.string();
|
|
7545
7591
|
}
|
|
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
7592
|
function createRichtextValidator(attr, messages = DEFAULT_VALIDATION_MESSAGES) {
|
|
7556
|
-
return _zod.z.
|
|
7593
|
+
return _zod.z.string({
|
|
7557
7594
|
message: messages.invalidRichtext(attr)
|
|
7558
7595
|
});
|
|
7559
7596
|
}
|
|
@@ -8239,6 +8276,25 @@ Reserved names: ${RESERVED_ATTRIBUTE_NAMES.join(", ")}`
|
|
|
8239
8276
|
const dbObjects = await this.adapter.objects.list();
|
|
8240
8277
|
return Promise.all(dbObjects.map((dbObject) => this.buildObjectDefinition(dbObject)));
|
|
8241
8278
|
}
|
|
8279
|
+
/**
|
|
8280
|
+
* Get object ownership info for write access checks.
|
|
8281
|
+
*
|
|
8282
|
+
* Used by RecordService to verify if the current tenant can write
|
|
8283
|
+
* to a shared object's records.
|
|
8284
|
+
*
|
|
8285
|
+
* @param objectId - Object UUID
|
|
8286
|
+
* @returns Object ownership info with tenantId and sharingMode
|
|
8287
|
+
*/
|
|
8288
|
+
async getObjectOwnerInfo(objectId) {
|
|
8289
|
+
const dbObject = await this.adapter.objects.findById(objectId);
|
|
8290
|
+
if (!dbObject) {
|
|
8291
|
+
throw new Error(`Object with id "${objectId}" not found`);
|
|
8292
|
+
}
|
|
8293
|
+
return {
|
|
8294
|
+
tenantId: dbObject.tenantId,
|
|
8295
|
+
sharingMode: dbObject.sharingMode
|
|
8296
|
+
};
|
|
8297
|
+
}
|
|
8242
8298
|
/**
|
|
8243
8299
|
* Invalidate all schema-related cache for the current tenant.
|
|
8244
8300
|
* Called automatically after schema mutations.
|
|
@@ -9228,6 +9284,15 @@ function checkRecordDeleteOrThrow(policy, record, context) {
|
|
|
9228
9284
|
throw new PolicyViolationError(policy.objectName, "delete", record.id);
|
|
9229
9285
|
}
|
|
9230
9286
|
}
|
|
9287
|
+
function checkSharedObjectWriteAccess(objectName, sharingMode, objectOwnerTenantId, currentTenantId) {
|
|
9288
|
+
if (sharingMode === "shared" && objectOwnerTenantId !== currentTenantId) {
|
|
9289
|
+
throw new SchemaError(
|
|
9290
|
+
`Cannot modify shared object "${objectName}". Shared objects are read-only for non-owner tenants.`,
|
|
9291
|
+
SchemaErrorCode.FORBIDDEN,
|
|
9292
|
+
{ objectName, ownerTenantId: objectOwnerTenantId, currentTenantId }
|
|
9293
|
+
);
|
|
9294
|
+
}
|
|
9295
|
+
}
|
|
9231
9296
|
|
|
9232
9297
|
// src/runtime/services/record/helpers/label.ts
|
|
9233
9298
|
function extractRelationIds2(val) {
|
|
@@ -10520,6 +10585,13 @@ var RecordService = class extends BaseService {
|
|
|
10520
10585
|
*/
|
|
10521
10586
|
async createRecord(objectId, data, options) {
|
|
10522
10587
|
const schema = await this.schemaService.getObjectSchema(objectId);
|
|
10588
|
+
const ownerInfo = await this.schemaService.getObjectOwnerInfo(objectId);
|
|
10589
|
+
checkSharedObjectWriteAccess(
|
|
10590
|
+
schema.name,
|
|
10591
|
+
ownerInfo.sharingMode,
|
|
10592
|
+
ownerInfo.tenantId,
|
|
10593
|
+
this.tenantId
|
|
10594
|
+
);
|
|
10523
10595
|
const dataWithDefaults = applyDefaultValues(schema, data);
|
|
10524
10596
|
await checkPermission(this.permissionService, this.userId, schema.name, "create");
|
|
10525
10597
|
const hookCtx = createContextForCreate(
|
|
@@ -10637,6 +10709,13 @@ var RecordService = class extends BaseService {
|
|
|
10637
10709
|
throw new RecordNotFoundError(recordId);
|
|
10638
10710
|
}
|
|
10639
10711
|
const schema = await this.schemaService.getObjectSchema(existing.objectId);
|
|
10712
|
+
const ownerInfo = await this.schemaService.getObjectOwnerInfo(existing.objectId);
|
|
10713
|
+
checkSharedObjectWriteAccess(
|
|
10714
|
+
schema.name,
|
|
10715
|
+
ownerInfo.sharingMode,
|
|
10716
|
+
ownerInfo.tenantId,
|
|
10717
|
+
this.tenantId
|
|
10718
|
+
);
|
|
10640
10719
|
await checkPermission(this.permissionService, this.userId, schema.name, "update");
|
|
10641
10720
|
const policy = getPolicy(this.policyRegistry, this.userId, schema.name);
|
|
10642
10721
|
if (policy && this.userId) {
|
|
@@ -10746,6 +10825,13 @@ var RecordService = class extends BaseService {
|
|
|
10746
10825
|
throw new RecordNotFoundError(recordId);
|
|
10747
10826
|
}
|
|
10748
10827
|
const schema = await this.schemaService.getObjectSchema(record.objectId);
|
|
10828
|
+
const ownerInfo = await this.schemaService.getObjectOwnerInfo(record.objectId);
|
|
10829
|
+
checkSharedObjectWriteAccess(
|
|
10830
|
+
schema.name,
|
|
10831
|
+
ownerInfo.sharingMode,
|
|
10832
|
+
ownerInfo.tenantId,
|
|
10833
|
+
this.tenantId
|
|
10834
|
+
);
|
|
10749
10835
|
await checkPermission(this.permissionService, this.userId, schema.name, "delete");
|
|
10750
10836
|
const policy = getPolicy(this.policyRegistry, this.userId, schema.name);
|
|
10751
10837
|
if (policy && this.userId) {
|
|
@@ -10817,6 +10903,13 @@ var RecordService = class extends BaseService {
|
|
|
10817
10903
|
);
|
|
10818
10904
|
}
|
|
10819
10905
|
const schema = await this.schemaService.getObjectSchema(record.objectId);
|
|
10906
|
+
const ownerInfo = await this.schemaService.getObjectOwnerInfo(record.objectId);
|
|
10907
|
+
checkSharedObjectWriteAccess(
|
|
10908
|
+
schema.name,
|
|
10909
|
+
ownerInfo.sharingMode,
|
|
10910
|
+
ownerInfo.tenantId,
|
|
10911
|
+
this.tenantId
|
|
10912
|
+
);
|
|
10820
10913
|
await checkPermission(this.permissionService, this.userId, schema.name, "update");
|
|
10821
10914
|
const hookCtx = createContextForRestore(schema, this.tenantId, record, _optionalChain([options, 'optionalAccess', _277 => _277.hookMetadata]));
|
|
10822
10915
|
if (!_optionalChain([options, 'optionalAccess', _278 => _278.skipHooks])) {
|
|
@@ -14043,6 +14136,18 @@ async function syncSingleObject(adapter, nativeObject, result, options) {
|
|
|
14043
14136
|
if (!nativeObject.system) {
|
|
14044
14137
|
throw new Error(`Object ${nativeObject.name} is not marked as system`);
|
|
14045
14138
|
}
|
|
14139
|
+
if (nativeObject.sharingMode === "shared") {
|
|
14140
|
+
if (!options.masterTenantId) {
|
|
14141
|
+
throw new Error(
|
|
14142
|
+
`Cannot sync shared object "${nativeObject.name}": masterTenantId must be configured in tenant options`
|
|
14143
|
+
);
|
|
14144
|
+
}
|
|
14145
|
+
if (options.tenantId && options.tenantId !== options.masterTenantId) {
|
|
14146
|
+
throw new Error(
|
|
14147
|
+
`Cannot sync shared object "${nativeObject.name}": only master tenant "${options.masterTenantId}" can sync shared objects (current: "${options.tenantId}")`
|
|
14148
|
+
);
|
|
14149
|
+
}
|
|
14150
|
+
}
|
|
14046
14151
|
const existingObject = await adapter.objects.findSystemByName(nativeObject.name);
|
|
14047
14152
|
const isNew = !existingObject;
|
|
14048
14153
|
updateObjectStats(result, isNew);
|
|
@@ -14087,6 +14192,7 @@ async function upsertObject(adapter, nativeObject, _options) {
|
|
|
14087
14192
|
description: nativeObject.description,
|
|
14088
14193
|
labelExpression: nativeObject.labelExpression,
|
|
14089
14194
|
icon: nativeObject.icon,
|
|
14195
|
+
sharingMode: _nullishCoalesce(nativeObject.sharingMode, () => ( "private")),
|
|
14090
14196
|
metadata: nativeObject.metadata
|
|
14091
14197
|
});
|
|
14092
14198
|
}
|
|
@@ -14510,4 +14616,5 @@ var NoopGeocodingAdapter = class {
|
|
|
14510
14616
|
|
|
14511
14617
|
|
|
14512
14618
|
|
|
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;
|
|
14619
|
+
|
|
14620
|
+
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;
|