Skip to content
Source
Sign inSign up
samwillis/neon-realtime-electric
Open History to see the last commit

constants.ts

54 lines2.3 KB

1export const LIVE_CACHE_BUSTER_HEADER = `electric-cursor`
2export const SHAPE_HANDLE_HEADER = `electric-handle`
3export const CHUNK_LAST_OFFSET_HEADER = `electric-offset`
4export const SHAPE_SCHEMA_HEADER = `electric-schema`
5export const CHUNK_UP_TO_DATE_HEADER = `electric-up-to-date`
6export const SNAPSHOT_HEADER = `electric-snapshot`
7export const COLUMNS_QUERY_PARAM = `columns`
8export const LIVE_CACHE_BUSTER_QUERY_PARAM = `cursor`
9export const EXPIRED_HANDLE_QUERY_PARAM = `expired_handle`
10export const SHAPE_HANDLE_QUERY_PARAM = `handle`
11export const LIVE_QUERY_PARAM = `live`
12export const OFFSET_QUERY_PARAM = `offset`
13export const TABLE_QUERY_PARAM = `table`
14export const WHERE_QUERY_PARAM = `where`
15export const REPLICA_PARAM = `replica`
16export const WHERE_PARAMS_PARAM = `params`
17/**
18 * @deprecated Use {@link LIVE_SSE_QUERY_PARAM} instead.
19 */
20export const EXPERIMENTAL_LIVE_SSE_QUERY_PARAM = `experimental_live_sse`
21export const LIVE_SSE_QUERY_PARAM = `live_sse`
22export const FORCE_DISCONNECT_AND_REFRESH = `force-disconnect-and-refresh`
23export const PAUSE_STREAM = `pause-stream`
24export const SYSTEM_WAKE = `system-wake`
25export const LIVE_REQUEST_TIMEOUT = `live-request-timeout`
26export const LOG_MODE_QUERY_PARAM = `log`
27export const SUBSET_PARAM_WHERE = `subset__where`
28export const SUBSET_PARAM_LIMIT = `subset__limit`
29export const SUBSET_PARAM_OFFSET = `subset__offset`
30export const SUBSET_PARAM_ORDER_BY = `subset__order_by`
31export const SUBSET_PARAM_WHERE_PARAMS = `subset__params`
32export const SUBSET_PARAM_WHERE_EXPR = `subset__where_expr`
33export const SUBSET_PARAM_ORDER_BY_EXPR = `subset__order_by_expr`
34export const CACHE_BUSTER_QUERY_PARAM = `cache-buster` // Random cache buster to bypass stale CDN responses
35​
36// Query parameters that should be passed through when proxying Electric requests
37export const ELECTRIC_PROTOCOL_QUERY_PARAMS: Array<string> = [
38 LIVE_QUERY_PARAM,
39 LIVE_SSE_QUERY_PARAM,
40 EXPERIMENTAL_LIVE_SSE_QUERY_PARAM,
41 SHAPE_HANDLE_QUERY_PARAM,
42 OFFSET_QUERY_PARAM,
43 LIVE_CACHE_BUSTER_QUERY_PARAM,
44 EXPIRED_HANDLE_QUERY_PARAM,
45 LOG_MODE_QUERY_PARAM,
46 SUBSET_PARAM_WHERE,
47 SUBSET_PARAM_LIMIT,
48 SUBSET_PARAM_OFFSET,
49 SUBSET_PARAM_ORDER_BY,
50 SUBSET_PARAM_WHERE_PARAMS,
51 SUBSET_PARAM_WHERE_EXPR,
52 SUBSET_PARAM_ORDER_BY_EXPR,
53 CACHE_BUSTER_QUERY_PARAM,