Skip to content

Commit b339bd4

Browse files
committed
fix lint error
1 parent 11f29ca commit b339bd4

File tree

1 file changed

+28
-27
lines changed

1 file changed

+28
-27
lines changed

packages/cubejs-client-core/src/types.ts

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import Meta from './Meta';
22
import { TimeDimensionGranularity } from './time';
3-
import { TransportOptions } from './HttpTransport';
43

54
export type QueryOrder = 'asc' | 'desc' | 'none';
65

@@ -82,6 +81,33 @@ export type BinaryOperator =
8281
| 'afterDate'
8382
| 'afterOrOnDate';
8483

84+
// NOTE: This type must be kept in sync with CacheMode in @cubejs-backend/shared (packages/cubejs-backend-shared/src/shared-types.ts)
85+
// This duplication is intentional as @cubejs-client/core does not depend on @cubejs-backend/shared
86+
/**
87+
* Cache mode options for query execution.
88+
*
89+
* - **stale-if-slow** (default): Equivalent to previously used `renewQuery: false`.
90+
* If refresh keys are up-to-date, returns the value from cache.
91+
* If refresh keys are expired, tries to return the value from the database.
92+
* Returns fresh value from the database if the query executed until the first "Continue wait" interval is reached.
93+
* Returns stale value from cache otherwise.
94+
*
95+
* - **stale-while-revalidate**: AKA "backgroundRefresh".
96+
* If refresh keys are up-to-date, returns the value from cache.
97+
* If refresh keys are expired, returns stale data from cache.
98+
* Updates the cache in background.
99+
*
100+
* - **must-revalidate**: Equivalent to previously used `renewQuery: true`.
101+
* If refresh keys are up-to-date, returns the value from cache.
102+
* If refresh keys are expired, tries to return the value from the database.
103+
* Returns fresh value from the database even if it takes minutes and many "Continue wait" intervals.
104+
*
105+
* - **no-cache**: AKA "forceRefresh".
106+
* Skips refresh key checks.
107+
* Returns fresh data from the database, even if it takes minutes and many "Continue wait" intervals.
108+
*/
109+
export type CacheMode = 'stale-if-slow' | 'stale-while-revalidate' | 'must-revalidate' | 'no-cache';
110+
85111
export interface BinaryFilter {
86112
/**
87113
* @deprecated Use `member` instead.
@@ -528,29 +554,4 @@ export type ProgressResponse = {
528554
timeElapsed: number;
529555
};
530556

531-
// NOTE: This type must be kept in sync with CacheMode in @cubejs-backend/shared (packages/cubejs-backend-shared/src/shared-types.ts)
532-
// This duplication is intentional as @cubejs-client/core does not depend on @cubejs-backend/shared
533-
/**
534-
* Cache mode options for query execution.
535-
*
536-
* - **stale-if-slow** (default): Equivalent to previously used `renewQuery: false`.
537-
* If refresh keys are up-to-date, returns the value from cache.
538-
* If refresh keys are expired, tries to return the value from the database.
539-
* Returns fresh value from the database if the query executed until the first "Continue wait" interval is reached.
540-
* Returns stale value from cache otherwise.
541-
*
542-
* - **stale-while-revalidate**: AKA "backgroundRefresh".
543-
* If refresh keys are up-to-date, returns the value from cache.
544-
* If refresh keys are expired, returns stale data from cache.
545-
* Updates the cache in background.
546-
*
547-
* - **must-revalidate**: Equivalent to previously used `renewQuery: true`.
548-
* If refresh keys are up-to-date, returns the value from cache.
549-
* If refresh keys are expired, tries to return the value from the database.
550-
* Returns fresh value from the database even if it takes minutes and many "Continue wait" intervals.
551-
*
552-
* - **no-cache**: AKA "forceRefresh".
553-
* Skips refresh key checks.
554-
* Returns fresh data from the database, even if it takes minutes and many "Continue wait" intervals.
555-
*/
556-
export type CacheMode = 'stale-if-slow' | 'stale-while-revalidate' | 'must-revalidate' | 'no-cache';
557+

0 commit comments

Comments
 (0)