• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

teableio / teable / 17757448414

16 Sep 2025 06:59AM UTC coverage: 79.911%. First build
17757448414

Pull #1859

github

web-flow
Merge 3dcef0d2b into d8d7cf621
Pull Request #1859: feat: add user info, collaborator and access token cache

8613 of 9168 branches covered (93.95%)

189 of 226 new or added lines in 19 files covered. (83.63%)

40710 of 50944 relevant lines covered (79.91%)

1882.3 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/apps/nestjs-backend/src/performance-cache/types.ts
NEW
1
/* eslint-disable @typescript-eslint/naming-convention */
×
2
import type { IPickUserMe } from '../features/auth/utils';
3

4
/**
5
 * Performance cache key-value store interface
6
 * Used to define data types that can be stored in performance cache
7
 */
8
export interface IPerformanceCacheStore {
9
  // record cache, format: record:path:table_id:version:query_hash
10
  [key: `record:${string}:${string}:${string}:${string}`]: unknown;
11

12
  // Aggregation result cache, format: agg:path:table_id:version:query_hash
13
  [key: `agg:${string}:${string}:${string}:${string}`]: unknown;
14

15
  // Service method cache, format: service:class_name:method:params_hash
16
  [key: `service:${string}:${string}:${string}`]: unknown;
17

18
  // user cache, format: user:user_id
19
  [key: `user:${string}`]: IPickUserMe & { deactivatedTime: string | null };
20

21
  // collaborator cache, format: collaborator:resource_id
22
  [key: `collaborator:${string}`]: unknown;
23

24
  // access token cache, format: access-token:id
25
  [key: `access-token:${string}`]: unknown;
26
}
27

28
/**
29
 * Cache options interface
30
 */
31
export interface ICacheOptions {
32
  /** Cache expiration time (seconds) */
33
  ttl?: number;
34
  /** Whether to skip cache reading (write only) */
35
  skipGet?: boolean;
36
  /** Whether to skip cache writing (read only) */
37
  skipSet?: boolean;
38
  /** Whether to prevent concurrent cache generation for same key (default: true) */
39
  preventConcurrent?: boolean;
40
  /** Performance prefix */
41
  statsType?: string;
42
}
43

44
/**
45
 * Cache decorator options
46
 */
47
export interface ICacheDecoratorOptions extends ICacheOptions {
48
  /** Cache key generation function, uses default parameter hash if not provided */
49
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
50
  keyGenerator?: (...args: any[]) => string;
51
  /** Condition function, skip cache when returns false */
52
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
53
  condition?: (...args: any[]) => boolean;
54
  /** Cache service name, if not provided, use the default name: performanceCacheService */
55
  cacheServiceName?: string;
56
}
57

58
/**
×
59
 * Cache statistics
60
 */
×
61
export interface ICacheStats {
62
  /** Hit count */
63
  hits: number;
64
  /** Miss count */
65
  misses: number;
66
  /** Set count */
67
  sets: number;
68
  /** Delete count */
69
  deletes: number;
70
  /** Error count */
71
  errors: number;
72
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc