@stndrds/schema 0.1.0-alpha.45 → 0.1.0-alpha.47

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.
@@ -323,6 +323,25 @@ function initializePinCodeService(salt) {
323
323
  }
324
324
 
325
325
  // src/runtime/cache.ts
326
+ import { createHash } from "crypto";
327
+ function hashOptions(options) {
328
+ if (options === null || options === void 0 || typeof options === "object" && Object.keys(options).length === 0) {
329
+ return "default";
330
+ }
331
+ const sortedJson = JSON.stringify(options, (_, value) => {
332
+ if (value && typeof value === "object" && !Array.isArray(value)) {
333
+ return Object.keys(value).sort().reduce(
334
+ (sorted, key) => {
335
+ sorted[key] = value[key];
336
+ return sorted;
337
+ },
338
+ {}
339
+ );
340
+ }
341
+ return value;
342
+ });
343
+ return createHash("md5").update(sortedJson).digest("hex").slice(0, 8);
344
+ }
326
345
  var cacheKeys = {
327
346
  // -------------------------------------------------------------------------
328
347
  // Schemas - TTL: 1 hour (rarely change)
@@ -361,6 +380,24 @@ var cacheKeys = {
361
380
  /** Individual record by ID */
362
381
  record: (tenantId, recordId) => `record:${tenantId}:${recordId}`,
363
382
  // -------------------------------------------------------------------------
383
+ // Record Lists - TTL: 1 minute (high volatility)
384
+ // -------------------------------------------------------------------------
385
+ /** Record list for an object with options hash */
386
+ recordList: (tenantId, objectId, hash) => `records:${tenantId}:${objectId}:list:${hash}`,
387
+ /** All record lists for an object (for invalidation) */
388
+ allRecordLists: (tenantId, objectId) => `records:${tenantId}:${objectId}:list:*`,
389
+ // -------------------------------------------------------------------------
390
+ // Search Results - TTL: 30 seconds (very high volatility)
391
+ // -------------------------------------------------------------------------
392
+ /** Search results for an object */
393
+ searchResults: (tenantId, objectId, hash) => `search:${tenantId}:${objectId}:${hash}`,
394
+ /** All search results for an object (for invalidation) */
395
+ allSearchResults: (tenantId, objectId) => `search:${tenantId}:${objectId}:*`,
396
+ /** Global search results */
397
+ globalSearch: (tenantId, hash) => `gsearch:${tenantId}:${hash}`,
398
+ /** All global search results for tenant (for invalidation) */
399
+ allGlobalSearch: (tenantId) => `gsearch:${tenantId}:*`,
400
+ // -------------------------------------------------------------------------
364
401
  // Invalidation Patterns
365
402
  // -------------------------------------------------------------------------
366
403
  /** All schema cache for a tenant */
@@ -432,7 +469,34 @@ var cacheTtl = {
432
469
  /** User profiles - medium volatility (5 minutes) */
433
470
  userProfiles: 5 * 60 * 1e3,
434
471
  /** Workflows - rarely change (5 minutes) */
435
- workflows: 5 * 60 * 1e3
472
+ workflows: 5 * 60 * 1e3,
473
+ /** Record lists - high volatility (1 minute) */
474
+ recordList: 60 * 1e3,
475
+ /** Search results - very high volatility (30 seconds) */
476
+ searchResults: 30 * 1e3,
477
+ /** Global search - very high volatility (30 seconds) */
478
+ globalSearch: 30 * 1e3
479
+ };
480
+ var defaultTtl = {
481
+ record: cacheTtl.records,
482
+ objectSchema: cacheTtl.schema,
483
+ objectSchemaByName: cacheTtl.schema,
484
+ objectSchemaList: cacheTtl.schemaList,
485
+ objectAttributes: cacheTtl.attributes,
486
+ attributeById: cacheTtl.attributes,
487
+ userProfileById: cacheTtl.userProfiles,
488
+ userProfileByAuthId: cacheTtl.userProfiles,
489
+ userProfileByEmail: cacheTtl.userProfiles,
490
+ viewsByObject: cacheTtl.views,
491
+ workflowByName: cacheTtl.workflows,
492
+ workflowById: cacheTtl.workflows,
493
+ workflowList: cacheTtl.workflows,
494
+ relationOptions: cacheTtl.relations,
495
+ rollupValue: cacheTtl.rollup,
496
+ userPermissions: cacheTtl.permissions,
497
+ recordList: cacheTtl.recordList,
498
+ searchResults: cacheTtl.searchResults,
499
+ globalSearch: cacheTtl.globalSearch
436
500
  };
437
501
  var NoopCacheAdapter = class {
438
502
  get() {
@@ -4258,20 +4322,55 @@ var BaseService = class {
4258
4322
  return getUserId();
4259
4323
  }
4260
4324
  // ============================================================================
4261
- // CACHE UTILITIES
4325
+ // CACHE HELPERS
4262
4326
  // ============================================================================
4263
4327
  /**
4264
- * Execute a query with caching support.
4265
- * If cache is not configured, executes the fetcher directly.
4328
+ * Cache a value by key type and ID.
4329
+ * Automatically builds the cache key with tenantId and applies default TTL.
4330
+ *
4331
+ * @param keyType - Type of cache key (e.g., "record", "objectSchema")
4332
+ * @param id - Resource identifier
4333
+ * @param fetcher - Function to fetch data if not cached
4334
+ * @param ttlMs - Optional TTL override (uses default for keyType if not provided)
4335
+ *
4336
+ * @example
4337
+ * ```typescript
4338
+ * return this.cachedBy("record", recordId, () =>
4339
+ * this.adapter.objectRecords.findById(recordId)
4340
+ * );
4341
+ * ```
4342
+ */
4343
+ cachedBy(keyType, id, fetcher, ttlMs) {
4344
+ if (!this.cache) return fetcher();
4345
+ const keyFn = cacheKeys[keyType];
4346
+ const key = keyFn(this.tenantId, id);
4347
+ const ttl = ttlMs ?? defaultTtl[keyType] ?? 6e4;
4348
+ return this.cache.getOrSet(key, fetcher, ttl);
4349
+ }
4350
+ /**
4351
+ * Cache a list query with automatic options hashing.
4352
+ * Useful for list/search operations with filters, sorts, pagination.
4266
4353
  *
4267
- * @param key - Cache key
4354
+ * @param keyType - Type of cache key (e.g., "recordList", "searchResults")
4355
+ * @param id - Resource identifier (e.g., objectId)
4356
+ * @param options - Query options to hash (filters, sorts, etc.)
4268
4357
  * @param fetcher - Function to fetch data if not cached
4269
- * @param ttlMs - Time-to-live in milliseconds
4270
- * @returns Cached or freshly fetched data
4358
+ * @param ttlMs - Optional TTL override
4359
+ *
4360
+ * @example
4361
+ * ```typescript
4362
+ * return this.cachedList("recordList", objectId, options, () =>
4363
+ * this.executeListQuery(objectId, options)
4364
+ * );
4365
+ * ```
4271
4366
  */
4272
- cached(key, fetcher, ttlMs) {
4367
+ cachedList(keyType, id, options, fetcher, ttlMs) {
4273
4368
  if (!this.cache) return fetcher();
4274
- return this.cache.getOrSet(key, fetcher, ttlMs);
4369
+ const hash = hashOptions(options);
4370
+ const keyFn = cacheKeys[keyType];
4371
+ const key = keyFn(this.tenantId, id, hash);
4372
+ const ttl = ttlMs ?? defaultTtl[keyType] ?? 6e4;
4373
+ return this.cache.getOrSet(key, fetcher, ttl);
4275
4374
  }
4276
4375
  /**
4277
4376
  * Invalidate a specific cache key.
@@ -4289,6 +4388,26 @@ var BaseService = class {
4289
4388
  async invalidateCachePattern(pattern) {
4290
4389
  await this.cache?.deletePattern(pattern);
4291
4390
  }
4391
+ /**
4392
+ * Invalidate all cached lists for a resource.
4393
+ * Call this after create/update/delete operations.
4394
+ *
4395
+ * @param keyType - Invalidation pattern key (e.g., "allRecordLists", "allSearchResults")
4396
+ * @param id - Resource identifier
4397
+ *
4398
+ * @example
4399
+ * ```typescript
4400
+ * // After creating/updating/deleting a record
4401
+ * await this.invalidateLists("allRecordLists", objectId);
4402
+ * await this.invalidateLists("allSearchResults", objectId);
4403
+ * ```
4404
+ */
4405
+ async invalidateLists(keyType, id) {
4406
+ if (!this.cache) return;
4407
+ const patternFn = cacheKeys[keyType];
4408
+ const pattern = patternFn(this.tenantId, id);
4409
+ await this.cache.deletePattern(pattern);
4410
+ }
4292
4411
  };
4293
4412
  var BaseRepository = class {
4294
4413
  /**
@@ -4320,8 +4439,8 @@ var SchemaContextAwareRepository = class extends BaseRepository {
4320
4439
  return getSchemaByNameFromContext(objectName);
4321
4440
  }
4322
4441
  };
4323
- var TenantAwareService = BaseService;
4324
4442
  var TenantAwareRepository = BaseRepository;
4443
+ var TenantAwareService = BaseService;
4325
4444
 
4326
4445
  // src/types/attributes.ts
4327
4446
  var RELATION_TARGET_ANY = "*";
@@ -7679,11 +7798,7 @@ Reserved names: ${RESERVED_ATTRIBUTE_NAMES.join(", ")}`
7679
7798
  * @returns Complete ObjectDefinition with all attributes including system attributes
7680
7799
  */
7681
7800
  async getObjectSchema(objectId) {
7682
- return this.cached(
7683
- cacheKeys.objectSchema(this.tenantId, objectId),
7684
- () => this.fetchObjectSchemaById(objectId),
7685
- cacheTtl.schema
7686
- );
7801
+ return this.cachedBy("objectSchema", objectId, () => this.fetchObjectSchemaById(objectId));
7687
7802
  }
7688
7803
  /**
7689
7804
  * Internal method to fetch object schema by ID (no caching)
@@ -7702,11 +7817,7 @@ Reserved names: ${RESERVED_ATTRIBUTE_NAMES.join(", ")}`
7702
7817
  * Results are cached if a CacheAdapter is configured.
7703
7818
  */
7704
7819
  async getObjectSchemaByName(name) {
7705
- return this.cached(
7706
- cacheKeys.objectSchemaByName(this.tenantId, name),
7707
- () => this.fetchObjectSchemaByName(name),
7708
- cacheTtl.schema
7709
- );
7820
+ return this.cachedBy("objectSchemaByName", name, () => this.fetchObjectSchemaByName(name));
7710
7821
  }
7711
7822
  /**
7712
7823
  * Internal method to fetch object schema by name (no caching)
@@ -7728,11 +7839,7 @@ Reserved names: ${RESERVED_ATTRIBUTE_NAMES.join(", ")}`
7728
7839
  * Results are cached if a CacheAdapter is configured.
7729
7840
  */
7730
7841
  async listObjectSchemas() {
7731
- return this.cached(
7732
- cacheKeys.objectSchemaList(this.tenantId),
7733
- () => this.fetchObjectSchemaList(),
7734
- cacheTtl.schemaList
7735
- );
7842
+ return this.cachedBy("objectSchemaList", "all", () => this.fetchObjectSchemaList());
7736
7843
  }
7737
7844
  /**
7738
7845
  * Internal method to fetch all object schemas (no caching)
@@ -8974,7 +9081,12 @@ var RecordQueryService = class extends BaseService {
8974
9081
  */
8975
9082
  async listRecords(objectId, options) {
8976
9083
  const schema = await this.schemaService.getObjectSchema(objectId);
8977
- return this.executeListQuery(schema, objectId, options);
9084
+ return this.cachedList(
9085
+ "recordList",
9086
+ objectId,
9087
+ { ...options, _userId: this.userId },
9088
+ () => this.executeListQuery(schema, objectId, options)
9089
+ );
8978
9090
  }
8979
9091
  /**
8980
9092
  * List records using a pre-fetched schema.
@@ -8984,7 +9096,13 @@ var RecordQueryService = class extends BaseService {
8984
9096
  if (!schema.id) {
8985
9097
  throw new Error("Schema must have an ID to list records");
8986
9098
  }
8987
- return await this.executeListQuery(schema, schema.id, options);
9099
+ const objectId = schema.id;
9100
+ return this.cachedList(
9101
+ "recordList",
9102
+ objectId,
9103
+ { ...options, _userId: this.userId },
9104
+ () => this.executeListQuery(schema, objectId, options)
9105
+ );
8988
9106
  }
8989
9107
  /**
8990
9108
  * Internal list query execution
@@ -9043,7 +9161,12 @@ var RecordQueryService = class extends BaseService {
9043
9161
  */
9044
9162
  async searchRecords(objectId, query, options) {
9045
9163
  const schema = await this.schemaService.getObjectSchema(objectId);
9046
- return this.executeSearchQuery(schema, objectId, query, options);
9164
+ return this.cachedList(
9165
+ "searchResults",
9166
+ objectId,
9167
+ { query, ...options, _userId: this.userId },
9168
+ () => this.executeSearchQuery(schema, objectId, query, options)
9169
+ );
9047
9170
  }
9048
9171
  /**
9049
9172
  * Search records using a pre-fetched schema.
@@ -9053,7 +9176,13 @@ var RecordQueryService = class extends BaseService {
9053
9176
  if (!schema.id) {
9054
9177
  throw new Error("Schema must have an ID to search records");
9055
9178
  }
9056
- return await this.executeSearchQuery(schema, schema.id, query, options);
9179
+ const objectId = schema.id;
9180
+ return this.cachedList(
9181
+ "searchResults",
9182
+ objectId,
9183
+ { query, ...options, _userId: this.userId },
9184
+ () => this.executeSearchQuery(schema, objectId, query, options)
9185
+ );
9057
9186
  }
9058
9187
  /**
9059
9188
  * Internal search query execution
@@ -9247,6 +9376,18 @@ var RelationService = class extends BaseService {
9247
9376
  * ```
9248
9377
  */
9249
9378
  async getOptions(attribute, params = {}) {
9379
+ const attrKey = attribute.id ?? attribute.name;
9380
+ return this.cachedList(
9381
+ "relationOptions",
9382
+ attrKey,
9383
+ params,
9384
+ () => this.fetchOptions(attribute, params)
9385
+ );
9386
+ }
9387
+ /**
9388
+ * Internal method to fetch relation options (extracted for caching)
9389
+ */
9390
+ async fetchOptions(attribute, params) {
9250
9391
  const { query = "", page = 1, pageSize = 20, targetObject, filter } = params;
9251
9392
  const targets = attribute.targets;
9252
9393
  const filteredTargets = targetObject ? targets.filter((t) => t.object === targetObject) : targets;
@@ -9372,11 +9513,7 @@ var RelationService = class extends BaseService {
9372
9513
  * Cache is invalidated by ObjectSchemaService.invalidateSchemaCache() via allAttributes pattern.
9373
9514
  */
9374
9515
  async findAttributeById(attributeId) {
9375
- return this.cached(
9376
- cacheKeys.attributeById(this.tenantId, attributeId),
9377
- () => this.fetchAttributeById(attributeId),
9378
- cacheTtl.attributes
9379
- );
9516
+ return this.cachedBy("attributeById", attributeId, () => this.fetchAttributeById(attributeId));
9380
9517
  }
9381
9518
  /**
9382
9519
  * Internal method to fetch attribute by ID (no caching)
@@ -9430,10 +9567,11 @@ var RollupService = class extends BaseService {
9430
9567
  * ```
9431
9568
  */
9432
9569
  async calculate(recordId, rollupAttr, schema) {
9433
- return this.cached(
9434
- cacheKeys.rollupValue(this.tenantId, recordId, rollupAttr.name),
9435
- () => this.computeRollup(recordId, rollupAttr, schema),
9436
- cacheTtl.rollup
9570
+ const cacheId = `${recordId}:${rollupAttr.name}`;
9571
+ return this.cachedBy(
9572
+ "rollupValue",
9573
+ cacheId,
9574
+ () => this.computeRollup(recordId, rollupAttr, schema)
9437
9575
  );
9438
9576
  }
9439
9577
  /**
@@ -9863,6 +10001,9 @@ var RecordService = class extends BaseService {
9863
10001
  await this.hookRegistry.execute("afterCreate", schema.name, afterCtx);
9864
10002
  }
9865
10003
  await recalculateParentRollups(record, schema, this.rollupContext);
10004
+ await this.invalidateLists("allRecordLists", objectId);
10005
+ await this.invalidateLists("allSearchResults", objectId);
10006
+ await this.invalidateCachePattern(cacheKeys.allGlobalSearch(this.tenantId));
9866
10007
  if (this.auditService && this.userId) {
9867
10008
  await this.auditService.logRecordAction({
9868
10009
  action: "record.created",
@@ -9883,10 +10024,10 @@ var RecordService = class extends BaseService {
9883
10024
  * Get a record by ID
9884
10025
  */
9885
10026
  async getRecord(recordId, options) {
9886
- const record = await this.cached(
9887
- cacheKeys.record(this.tenantId, recordId),
9888
- () => this.adapter.objectRecords.findById(recordId),
9889
- cacheTtl.records
10027
+ const record = await this.cachedBy(
10028
+ "record",
10029
+ recordId,
10030
+ () => this.adapter.objectRecords.findById(recordId)
9890
10031
  );
9891
10032
  if (!record) {
9892
10033
  return null;
@@ -9997,6 +10138,8 @@ var RecordService = class extends BaseService {
9997
10138
  }
9998
10139
  const updated = await this.adapter.objectRecords.update(recordId, updatePayload);
9999
10140
  await this.invalidateCache(cacheKeys.record(this.tenantId, recordId));
10141
+ await this.invalidateLists("allRecordLists", existing.objectId);
10142
+ await this.invalidateLists("allSearchResults", existing.objectId);
10000
10143
  if (!options?.skipHooks) {
10001
10144
  const afterCtx = {
10002
10145
  ...hookCtx,
@@ -10061,6 +10204,9 @@ var RecordService = class extends BaseService {
10061
10204
  }
10062
10205
  await this.adapter.objectRecords.delete(recordId);
10063
10206
  await this.invalidateCache(cacheKeys.record(this.tenantId, recordId));
10207
+ await this.invalidateLists("allRecordLists", record.objectId);
10208
+ await this.invalidateLists("allSearchResults", record.objectId);
10209
+ await this.invalidateCachePattern(cacheKeys.allGlobalSearch(this.tenantId));
10064
10210
  if (!options?.skipHooks) {
10065
10211
  await this.hookRegistry.execute("afterDelete", schema.name, hookCtx);
10066
10212
  }
@@ -10086,6 +10232,9 @@ var RecordService = class extends BaseService {
10086
10232
  await checkPermission(this.permissionService, this.userId, schema.name, "delete");
10087
10233
  await this.adapter.objectRecords.hardDelete(recordId);
10088
10234
  await this.invalidateCache(cacheKeys.record(this.tenantId, recordId));
10235
+ await this.invalidateLists("allRecordLists", record.objectId);
10236
+ await this.invalidateLists("allSearchResults", record.objectId);
10237
+ await this.invalidateCachePattern(cacheKeys.allGlobalSearch(this.tenantId));
10089
10238
  }
10090
10239
  // ============================================================================
10091
10240
  // RESTORE
@@ -10110,6 +10259,9 @@ var RecordService = class extends BaseService {
10110
10259
  }
10111
10260
  const restored = await this.adapter.objectRecords.restore(recordId);
10112
10261
  await this.invalidateCache(cacheKeys.record(this.tenantId, recordId));
10262
+ await this.invalidateLists("allRecordLists", record.objectId);
10263
+ await this.invalidateLists("allSearchResults", record.objectId);
10264
+ await this.invalidateCachePattern(cacheKeys.allGlobalSearch(this.tenantId));
10113
10265
  if (!options?.skipHooks) {
10114
10266
  const afterCtx = {
10115
10267
  ...hookCtx,
@@ -10425,11 +10577,7 @@ var WorkflowService = class extends BaseService {
10425
10577
  * Results are cached if a CacheAdapter is configured.
10426
10578
  */
10427
10579
  async getAllWorkflows() {
10428
- return this.cached(
10429
- cacheKeys.workflowList(this.tenantId),
10430
- () => this.fetchAllWorkflows(),
10431
- cacheTtl.workflows
10432
- );
10580
+ return this.cachedBy("workflowList", "all", () => this.fetchAllWorkflows());
10433
10581
  }
10434
10582
  /**
10435
10583
  * Internal method to fetch all workflows (no caching)
@@ -10459,11 +10607,7 @@ var WorkflowService = class extends BaseService {
10459
10607
  if (systemWorkflow) {
10460
10608
  return systemWorkflow;
10461
10609
  }
10462
- return this.cached(
10463
- cacheKeys.workflowByName(this.tenantId, name),
10464
- () => this.fetchWorkflowByName(name),
10465
- cacheTtl.workflows
10466
- );
10610
+ return this.cachedBy("workflowByName", name, () => this.fetchWorkflowByName(name));
10467
10611
  }
10468
10612
  /**
10469
10613
  * Internal method to fetch workflow by name (no caching)
@@ -10488,11 +10632,7 @@ var WorkflowService = class extends BaseService {
10488
10632
  return workflow2;
10489
10633
  }
10490
10634
  }
10491
- return this.cached(
10492
- cacheKeys.workflowById(this.tenantId, id),
10493
- () => this.fetchWorkflowById(id),
10494
- cacheTtl.workflows
10495
- );
10635
+ return this.cachedBy("workflowById", id, () => this.fetchWorkflowById(id));
10496
10636
  }
10497
10637
  /**
10498
10638
  * Internal method to fetch workflow by ID (no caching)
@@ -11699,10 +11839,10 @@ var UserProfileService = class extends BaseService {
11699
11839
  * Results are cached if a CacheAdapter is configured.
11700
11840
  */
11701
11841
  async getProfile(profileId) {
11702
- return this.cached(
11703
- cacheKeys.userProfileById(this.tenantId, profileId),
11704
- () => this.adapter.userProfiles.findById(profileId),
11705
- cacheTtl.userProfiles
11842
+ return this.cachedBy(
11843
+ "userProfileById",
11844
+ profileId,
11845
+ () => this.adapter.userProfiles.findById(profileId)
11706
11846
  );
11707
11847
  }
11708
11848
  /**
@@ -11725,10 +11865,10 @@ var UserProfileService = class extends BaseService {
11725
11865
  * @returns User profile or null
11726
11866
  */
11727
11867
  async getProfileByAuthId(authId) {
11728
- return this.cached(
11729
- cacheKeys.userProfileByAuthId(this.tenantId, authId),
11730
- () => this.adapter.userProfiles.findByAuthId(authId),
11731
- cacheTtl.userProfiles
11868
+ return this.cachedBy(
11869
+ "userProfileByAuthId",
11870
+ authId,
11871
+ () => this.adapter.userProfiles.findByAuthId(authId)
11732
11872
  );
11733
11873
  }
11734
11874
  /**
@@ -11860,10 +12000,10 @@ var UserProfileService = class extends BaseService {
11860
12000
  * Automatically uses tenant context from AsyncLocalStorage.
11861
12001
  */
11862
12002
  async getProfileByEmail(email) {
11863
- return this.cached(
11864
- cacheKeys.userProfileByEmail(this.tenantId, email),
11865
- () => this.adapter.userProfiles.findByEmail(email),
11866
- cacheTtl.userProfiles
12003
+ return this.cachedBy(
12004
+ "userProfileByEmail",
12005
+ email,
12006
+ () => this.adapter.userProfiles.findByEmail(email)
11867
12007
  );
11868
12008
  }
11869
12009
  /**
@@ -12436,7 +12576,18 @@ var GlobalSearchService = class extends BaseService {
12436
12576
  if (!query || query.trim().length === 0) {
12437
12577
  return { results: [], total: 0 };
12438
12578
  }
12439
- return await this.adapter.objectRecords.globalSearch(query.trim(), {
12579
+ return this.cachedList(
12580
+ "globalSearch",
12581
+ "global",
12582
+ { query: query.trim(), ...options },
12583
+ () => this.executeSearch(query.trim(), options)
12584
+ );
12585
+ }
12586
+ /**
12587
+ * Internal search execution (extracted for caching)
12588
+ */
12589
+ async executeSearch(query, options) {
12590
+ return await this.adapter.objectRecords.globalSearch(query, {
12440
12591
  limit: options?.limit ?? 20,
12441
12592
  offset: options?.offset ?? 0,
12442
12593
  objectNames: options?.objectNames,
@@ -12885,11 +13036,7 @@ var ViewService = class extends BaseService {
12885
13036
  * @returns All views for the object
12886
13037
  */
12887
13038
  async getViewsForObject(objectName) {
12888
- return this.cached(
12889
- cacheKeys.viewsByObject(this.tenantId, objectName),
12890
- () => this.fetchViewsForObject(objectName),
12891
- cacheTtl.views
12892
- );
13039
+ return this.cachedBy("viewsByObject", objectName, () => this.fetchViewsForObject(objectName));
12893
13040
  }
12894
13041
  /**
12895
13042
  * Internal method to fetch views for an object (no caching)
@@ -13667,8 +13814,10 @@ export {
13667
13814
  PinCodeService,
13668
13815
  getDefaultPinCodeService,
13669
13816
  initializePinCodeService,
13817
+ hashOptions,
13670
13818
  cacheKeys,
13671
13819
  cacheTtl,
13820
+ defaultTtl,
13672
13821
  NoopCacheAdapter,
13673
13822
  formatRecord,
13674
13823
  formatRecords,
@@ -13745,8 +13894,8 @@ export {
13745
13894
  BaseService,
13746
13895
  BaseRepository,
13747
13896
  SchemaContextAwareRepository,
13748
- TenantAwareService,
13749
13897
  TenantAwareRepository,
13898
+ TenantAwareService,
13750
13899
  buildAuditChanges,
13751
13900
  ObjectSchemaService,
13752
13901
  AuditService,