@rocicorp/zero 0.23.2025082900 → 0.23.2025083000
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/out/{chunk-A2FIESI3.js → chunk-G442PJSB.js} +463 -469
- package/out/chunk-G442PJSB.js.map +7 -0
- package/out/{chunk-S6YBPIPL.js → chunk-GW2SIBPI.js} +4059 -4060
- package/out/chunk-GW2SIBPI.js.map +7 -0
- package/out/{chunk-Y44KA7XV.js → chunk-KSJKRBQT.js} +3 -3
- package/out/{inspector-GW44RI34.js → inspector-4ALIZXAU.js} +6 -36
- package/out/inspector-4ALIZXAU.js.map +7 -0
- package/out/react-native.js +21 -19
- package/out/react-native.js.map +3 -3
- package/out/react.js +2 -2
- package/out/replicache/src/expo/store.d.ts +5 -0
- package/out/replicache/src/expo/store.d.ts.map +1 -0
- package/out/replicache/src/get-kv-store-provider.d.ts +4 -0
- package/out/replicache/src/get-kv-store-provider.d.ts.map +1 -0
- package/out/replicache/src/http-status-unauthorized.d.ts +2 -0
- package/out/replicache/src/http-status-unauthorized.d.ts.map +1 -0
- package/out/replicache/src/make-idb-name.d.ts +10 -0
- package/out/replicache/src/make-idb-name.d.ts.map +1 -0
- package/out/replicache/src/persist/collect-idb-databases.d.ts.map +1 -1
- package/out/replicache/src/replicache-impl.d.ts.map +1 -1
- package/out/replicache/src/replicache-options.d.ts +3 -3
- package/out/replicache/src/replicache-options.d.ts.map +1 -1
- package/out/replicache/src/report-error.d.ts +6 -0
- package/out/replicache/src/report-error.d.ts.map +1 -0
- package/out/solid.js +3 -3
- package/out/zero/package.json +1 -1
- package/out/zero-cache/src/server/inspector-delegate.d.ts +0 -9
- package/out/zero-cache/src/server/inspector-delegate.d.ts.map +1 -1
- package/out/zero-cache/src/server/inspector-delegate.js +0 -18
- package/out/zero-cache/src/server/inspector-delegate.js.map +1 -1
- package/out/zero-cache/src/server/syncer.js +2 -2
- package/out/zero-cache/src/server/syncer.js.map +1 -1
- package/out/zero-cache/src/services/mutagen/pusher.d.ts +0 -8
- package/out/zero-cache/src/services/mutagen/pusher.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts +1 -1
- package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/view-syncer.js +0 -28
- package/out/zero-cache/src/services/view-syncer/view-syncer.js.map +1 -1
- package/out/zero-client/src/client/inspector/inspector.d.ts.map +1 -1
- package/out/zero-client/src/mod.d.ts +2 -2
- package/out/zero-client/src/mod.d.ts.map +1 -1
- package/out/zero-protocol/src/down.d.ts +0 -5
- package/out/zero-protocol/src/down.d.ts.map +1 -1
- package/out/zero-protocol/src/inspect-down.d.ts +0 -17
- package/out/zero-protocol/src/inspect-down.d.ts.map +1 -1
- package/out/zero-protocol/src/inspect-down.js +1 -5
- package/out/zero-protocol/src/inspect-down.js.map +1 -1
- package/out/zero-protocol/src/inspect-up.d.ts +10 -39
- package/out/zero-protocol/src/inspect-up.d.ts.map +1 -1
- package/out/zero-protocol/src/inspect-up.js +3 -10
- package/out/zero-protocol/src/inspect-up.js.map +1 -1
- package/out/zero-protocol/src/protocol-version.d.ts +1 -1
- package/out/zero-protocol/src/protocol-version.d.ts.map +1 -1
- package/out/zero-protocol/src/protocol-version.js +1 -2
- package/out/zero-protocol/src/protocol-version.js.map +1 -1
- package/out/zero-protocol/src/up.d.ts +1 -10
- package/out/zero-protocol/src/up.d.ts.map +1 -1
- package/out/zero-react-native/src/mod.d.ts +2 -1
- package/out/zero-react-native/src/mod.d.ts.map +1 -1
- package/out/zero.js +3 -3
- package/package.json +1 -1
- package/out/chunk-A2FIESI3.js.map +0 -7
- package/out/chunk-S6YBPIPL.js.map +0 -7
- package/out/inspector-GW44RI34.js.map +0 -7
- package/out/replicache/src/replicache.d.ts +0 -298
- package/out/replicache/src/replicache.d.ts.map +0 -1
- package/out/zero-react-native/src/store.d.ts +0 -4
- package/out/zero-react-native/src/store.d.ts.map +0 -1
- /package/out/{chunk-Y44KA7XV.js.map → chunk-KSJKRBQT.js.map} +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../ast-to-zql/src/ast-to-zql.ts", "../../zero-client/src/client/inspector/inspector.ts"],
|
|
4
|
-
"sourcesContent": ["import {unreachable} from '../../shared/src/asserts.ts';\nimport {must} from '../../shared/src/must.ts';\nimport type {\n AST,\n Condition,\n Conjunction,\n CorrelatedSubquery,\n CorrelatedSubqueryCondition,\n Disjunction,\n LiteralReference,\n Ordering,\n Parameter,\n SimpleCondition,\n ValuePosition,\n} from '../../zero-protocol/src/ast.ts';\nimport {SUBQ_PREFIX} from '../../zql/src/query/query-impl.ts';\n\n/**\n * Converts an AST to the equivalent query builder code.\n * This is useful for debugging and understanding queries.\n *\n * @example\n * ```\n * const ast = query.issue.where('id', '=', 123)[astSymbol];\n * console.log(astToZQL(ast)); // outputs: .where('id', '=', 123)\n * ```\n */\nexport function astToZQL(ast: AST): string {\n let code = '';\n\n // Handle where conditions\n if (ast.where) {\n code += transformCondition(ast.where, '.where', new Set());\n }\n\n // Handle related subqueries\n if (ast.related && ast.related.length > 0) {\n for (const related of ast.related) {\n if (related.hidden) {\n const nestedRelated = related.subquery.related?.[0];\n if (nestedRelated) {\n code += transformRelated(nestedRelated);\n }\n } else {\n code += transformRelated(related);\n }\n }\n }\n\n // Handle orderBy\n if (ast.orderBy && ast.orderBy.length > 0) {\n code += transformOrder(ast.orderBy);\n }\n\n // Handle limit\n if (ast.limit !== undefined) {\n code += `.limit(${ast.limit})`;\n }\n\n // Handle start\n if (ast.start) {\n const {row, exclusive} = ast.start;\n code += `.start(${JSON.stringify(row)}${\n exclusive ? '' : ', { inclusive: true }'\n })`;\n }\n\n return code;\n}\n\ntype Args = Set<string>;\n\ntype Prefix = '.where' | 'cmp';\n\nfunction transformCondition(\n condition: Condition,\n prefix: Prefix,\n args: Args,\n): string {\n switch (condition.type) {\n case 'simple':\n return transformSimpleCondition(condition, prefix);\n case 'and':\n case 'or':\n return transformLogicalCondition(condition, prefix, args);\n case 'correlatedSubquery':\n return transformExistsCondition(condition, prefix, args);\n default:\n unreachable(condition);\n }\n}\n\nfunction transformSimpleCondition(\n condition: SimpleCondition,\n prefix: Prefix,\n): string {\n const {left, op, right} = condition;\n\n const leftCode = transformValuePosition(left);\n const rightCode = transformValuePosition(right);\n\n // Handle the shorthand form for equals\n if (op === '=') {\n return `${prefix}(${leftCode}, ${rightCode})`;\n }\n\n return `${prefix}(${leftCode}, '${op}', ${rightCode})`;\n}\n\nfunction transformLogicalCondition(\n condition: Conjunction | Disjunction,\n prefix: Prefix,\n args: Args,\n): string {\n const {type, conditions} = condition;\n\n // For single condition, no need for logical operator\n if (conditions.length === 1) {\n return transformCondition(conditions[0], prefix, args);\n }\n\n // Generate multiple where calls for top-level AND conditions\n if (type === 'and') {\n const parts = conditions.map(c => transformCondition(c, prefix, args));\n // Simply concatenate the where conditions\n if (prefix === '.where') {\n return parts.join('');\n }\n args.add('and');\n return 'and(' + parts.join(', ') + ')';\n }\n\n args = new Set<string>();\n\n // Handle nested conditions with a callback for OR conditions and nested ANDs/ORs\n const conditionsCode = conditions\n .map(c => transformCondition(c, 'cmp', args))\n .join(', ');\n\n args.add('cmp');\n args.add(type);\n const argsCode = [...args].sort().join(', ');\n\n return `.where(({${argsCode}}) => ${type}(${conditionsCode}))`;\n}\n\nfunction transformExistsCondition(\n condition: CorrelatedSubqueryCondition,\n prefix: '.where' | 'cmp',\n args: Set<string>,\n): string {\n const {related, op} = condition;\n const relationship = extractRelationshipName(related);\n\n const nextSubquery = getNextExistsSubquery(related);\n\n // Check if subquery has additional properties\n const hasSubQueryProps =\n nextSubquery.where ||\n (nextSubquery.related && nextSubquery.related.length > 0) ||\n nextSubquery.orderBy ||\n nextSubquery.limit;\n\n if (op === 'EXISTS') {\n if (!hasSubQueryProps) {\n if (prefix === '.where') {\n return `.whereExists('${relationship}')`;\n }\n args.add('exists');\n return `exists('${relationship}')`;\n }\n\n if (prefix === '.where') {\n return `.whereExists('${relationship}', q => q${astToZQL(nextSubquery)})`;\n }\n prefix satisfies 'cmp';\n args.add('exists');\n return `exists('${relationship}', q => q${astToZQL(nextSubquery)})`;\n }\n\n op satisfies 'NOT EXISTS';\n\n if (hasSubQueryProps) {\n if (prefix === '.where') {\n return `.where(({exists, not}) => not(exists('${relationship}', q => q${astToZQL(\n nextSubquery,\n )})))`;\n }\n prefix satisfies 'cmp';\n args.add('not');\n args.add('exists');\n return `not(exists('${relationship}', q => q${astToZQL(nextSubquery)}))`;\n }\n\n if (prefix === '.where') {\n return `.where(({exists, not}) => not(exists('${relationship}')))`;\n }\n args.add('not');\n args.add('exists');\n\n return `not(exists('${relationship}')))`;\n}\n\n// If the `exists` is applied against a junction edge, both hops will have the same alias and both hops will be exists conditions.\nfunction getNextExistsSubquery(related: CorrelatedSubquery): AST {\n if (\n related.subquery.where?.type === 'correlatedSubquery' &&\n related.subquery.where.related.subquery.alias?.includes(\n SUBQ_PREFIX + 'zhidden_',\n )\n ) {\n return getNextExistsSubquery(related.subquery.where.related);\n }\n\n return related.subquery;\n}\n\nfunction extractRelationshipName(related: CorrelatedSubquery): string {\n const alias = must(related.subquery.alias);\n return alias.startsWith(SUBQ_PREFIX)\n ? alias.substring(SUBQ_PREFIX.length)\n : alias;\n}\n\nfunction transformRelated(related: CorrelatedSubquery): string {\n const {alias} = related.subquery;\n if (!alias) return '';\n\n const relationship = alias;\n let code = `.related('${relationship}'`;\n\n // If the subquery has additional filters or configurations\n if (\n related.subquery.where ||\n (related.subquery.related && related.subquery.related.length > 0) ||\n related.subquery.orderBy ||\n related.subquery.limit\n ) {\n code += ', q => q' + astToZQL(related.subquery);\n }\n\n code += ')';\n return code;\n}\n\nfunction transformOrder(orderBy: Ordering): string {\n let code = '';\n for (const [field, direction] of orderBy) {\n code += `.orderBy('${field}', '${direction}')`;\n }\n return code;\n}\n\nfunction transformValuePosition(value: ValuePosition): string {\n switch (value.type) {\n case 'literal':\n return transformLiteral(value);\n case 'column':\n return `'${value.name}'`;\n case 'static':\n return transformParameter(value);\n default:\n unreachable(value);\n }\n}\n\nfunction transformLiteral(literal: LiteralReference): string {\n if (literal.value === null) {\n return 'null';\n }\n if (Array.isArray(literal.value)) {\n return JSON.stringify(literal.value);\n }\n if (typeof literal.value === 'string') {\n return `'${literal.value.replace(/'/g, \"\\\\'\")}'`;\n }\n return String(literal.value);\n}\n\nfunction transformParameter(param: Parameter): string {\n const fieldStr = Array.isArray(param.field)\n ? `[${param.field.map(f => `'${f}'`).join(', ')}]`\n : `'${param.field}'`;\n\n return `authParam(${fieldStr})`;\n}\n", "import {astToZQL} from '../../../../ast-to-zql/src/ast-to-zql.ts';\nimport type {BTreeRead} from '../../../../replicache/src/btree/read.ts';\nimport {type Read} from '../../../../replicache/src/dag/store.ts';\nimport {readFromHash} from '../../../../replicache/src/db/read.ts';\nimport * as FormatVersion from '../../../../replicache/src/format-version-enum.ts';\nimport {getClientGroup} from '../../../../replicache/src/persist/client-groups.ts';\nimport {\n getClient,\n getClients,\n type ClientMap,\n} from '../../../../replicache/src/persist/clients.ts';\nimport type {ReplicacheImpl} from '../../../../replicache/src/replicache-impl.ts';\nimport {withRead} from '../../../../replicache/src/with-transactions.ts';\nimport {assert} from '../../../../shared/src/asserts.ts';\nimport type {ReadonlyJSONValue} from '../../../../shared/src/json.ts';\nimport {mapValues} from '../../../../shared/src/objects.ts';\nimport {TDigest, type ReadonlyTDigest} from '../../../../shared/src/tdigest.ts';\nimport * as valita from '../../../../shared/src/valita.ts';\nimport type {AST} from '../../../../zero-protocol/src/ast.ts';\nimport type {Row} from '../../../../zero-protocol/src/data.ts';\nimport {\n inspectAuthenticatedDownSchema,\n inspectMetricsDownSchema,\n inspectQueriesDownSchema,\n inspectVersionDownSchema,\n type InspectDownBody,\n type InspectQueryRow,\n type ServerMetrics as ServerMetricsJSON,\n} from '../../../../zero-protocol/src/inspect-down.ts';\nimport type {InspectUpBody} from '../../../../zero-protocol/src/inspect-up.ts';\nimport type {Schema} from '../../../../zero-schema/src/builder/schema-builder.ts';\nimport type {\n ClientMetricMap,\n ServerMetricMap,\n} from '../../../../zql/src/query/metrics-delegate.ts';\nimport {normalizeTTL, type TTL} from '../../../../zql/src/query/ttl.ts';\nimport {nanoid} from '../../util/nanoid.ts';\nimport {ENTITIES_KEY_PREFIX} from '../keys.ts';\nimport type {MutatorDefs} from '../replicache-types.ts';\nimport type {\n ClientGroup as ClientGroupInterface,\n Client as ClientInterface,\n Inspector as InspectorInterface,\n Query as QueryInterface,\n} from './types.ts';\n\ntype Rep = ReplicacheImpl<MutatorDefs>;\n\ntype GetWebSocket = () => Promise<WebSocket>;\n\ntype Metrics = {\n readonly [K in keyof (ClientMetricMap & ServerMetricMap)]: ReadonlyTDigest;\n};\n\ntype ClientMetrics = {\n readonly [K in keyof ClientMetricMap]: ReadonlyTDigest;\n};\n\ntype ServerMetrics = {\n readonly [K in keyof ServerMetricMap]: ReadonlyTDigest;\n};\n\nexport interface InspectorDelegate {\n getQueryMetrics(hash: string): ClientMetrics | undefined;\n getAST(queryID: string): AST | undefined;\n readonly metrics: ClientMetrics;\n}\n\nexport async function newInspector(\n rep: Rep,\n delegate: InspectorDelegate,\n schema: Schema,\n socket: GetWebSocket,\n): Promise<InspectorInterface> {\n const clientGroupID = await rep.clientGroupID;\n return new Inspector(\n rep,\n delegate,\n schema,\n rep.clientID,\n clientGroupID,\n socket,\n );\n}\n\n// T extends forces T to be resolved\ntype DistributiveOmit<T, K extends string> = T extends object\n ? Omit<T, K>\n : never;\n\nclass Inspector implements InspectorInterface {\n readonly #rep: Rep;\n readonly client: Client;\n readonly clientGroup: ClientGroup;\n readonly #schema: Schema;\n readonly socket: GetWebSocket;\n readonly #delegate: InspectorDelegate;\n\n constructor(\n rep: ReplicacheImpl,\n delegate: InspectorDelegate,\n schema: Schema,\n clientID: string,\n clientGroupID: string,\n socket: GetWebSocket,\n ) {\n this.#rep = rep;\n this.#schema = schema;\n this.client = new Client(\n rep,\n delegate,\n schema,\n socket,\n clientID,\n clientGroupID,\n );\n this.clientGroup = this.client.clientGroup;\n this.socket = socket;\n this.#delegate = delegate;\n }\n\n async metrics(): Promise<Metrics> {\n const clientMetrics = this.#delegate.metrics;\n const serverMetricsJSON = await rpc(\n await this.socket(),\n {op: 'metrics'},\n inspectMetricsDownSchema,\n );\n return mergeMetrics(clientMetrics, serverMetricsJSON);\n }\n\n clients(): Promise<ClientInterface[]> {\n return withDagRead(this.#rep, dagRead =>\n clients(this.#rep, this.#delegate, this.socket, this.#schema, dagRead),\n );\n }\n\n clientsWithQueries(): Promise<ClientInterface[]> {\n return withDagRead(this.#rep, dagRead =>\n clientsWithQueries(\n this.#rep,\n this.#delegate,\n this.socket,\n this.#schema,\n dagRead,\n ),\n );\n }\n\n async serverVersion(): Promise<string> {\n return rpc(await this.socket(), {op: 'version'}, inspectVersionDownSchema);\n }\n}\n\nclass UnauthenticatedError extends Error {}\n\nfunction rpcNoAuthTry<T extends InspectDownBody>(\n socket: WebSocket,\n arg: DistributiveOmit<InspectUpBody, 'id'>,\n downSchema: valita.Type<T>,\n): Promise<T['value']> {\n return new Promise((resolve, reject) => {\n const id = nanoid();\n const f = (ev: MessageEvent) => {\n const msg = JSON.parse(ev.data);\n if (msg[0] === 'inspect') {\n const body = msg[1];\n if (body.id !== id) {\n return;\n }\n const res = valita.test(body, downSchema);\n if (res.ok) {\n resolve(res.value.value);\n } else {\n // Check if we got un authenticated/false response\n const authRes = valita.test(body, inspectAuthenticatedDownSchema);\n if (authRes.ok) {\n // Handle authenticated response\n assert(\n authRes.value.value === false,\n 'Expected unauthenticated response',\n );\n reject(new UnauthenticatedError());\n }\n\n reject(res.error);\n }\n socket.removeEventListener('message', f);\n }\n };\n socket.addEventListener('message', f);\n socket.send(JSON.stringify(['inspect', {...arg, id}]));\n });\n}\n\nasync function rpc<T extends InspectDownBody>(\n socket: WebSocket,\n arg: DistributiveOmit<InspectUpBody, 'id'>,\n downSchema: valita.Type<T>,\n): Promise<T['value']> {\n try {\n return await rpcNoAuthTry(socket, arg, downSchema);\n } catch (e) {\n if (e instanceof UnauthenticatedError) {\n const password = prompt('Enter password:');\n if (password) {\n // Do authenticate rpc\n const authRes = await rpcNoAuthTry(\n socket,\n {op: 'authenticate', value: password},\n inspectAuthenticatedDownSchema,\n );\n if (authRes) {\n // If authentication is successful, retry the original RPC\n return rpcNoAuthTry(socket, arg, downSchema);\n }\n }\n throw new Error('Authentication failed');\n }\n throw e;\n }\n}\n\nclass Client implements ClientInterface {\n readonly #rep: Rep;\n readonly id: string;\n readonly clientGroup: ClientGroup;\n readonly #socket: GetWebSocket;\n readonly #delegate: InspectorDelegate;\n\n constructor(\n rep: Rep,\n delegate: InspectorDelegate,\n schema: Schema,\n socket: GetWebSocket,\n id: string,\n clientGroupID: string,\n ) {\n this.#rep = rep;\n this.#socket = socket;\n this.id = id;\n this.clientGroup = new ClientGroup(\n rep,\n delegate,\n socket,\n schema,\n clientGroupID,\n );\n this.#delegate = delegate;\n }\n\n async queries(): Promise<QueryInterface[]> {\n const rows: InspectQueryRow[] = await rpc(\n await this.#socket(),\n {op: 'queries', clientID: this.id},\n inspectQueriesDownSchema,\n );\n return rows.map(row => new Query(row, this.#delegate));\n }\n\n map(): Promise<Map<string, ReadonlyJSONValue>> {\n return withDagRead(this.#rep, async dagRead => {\n const tree = await getBTree(dagRead, this.id);\n const map = new Map<string, ReadonlyJSONValue>();\n for await (const [key, value] of tree.scan('')) {\n map.set(key, value);\n }\n return map;\n });\n }\n\n rows(tableName: string): Promise<Row[]> {\n return withDagRead(this.#rep, async dagRead => {\n const prefix = ENTITIES_KEY_PREFIX + tableName;\n const tree = await getBTree(dagRead, this.id);\n const rows: Row[] = [];\n for await (const [key, value] of tree.scan(prefix)) {\n if (!key.startsWith(prefix)) {\n break;\n }\n rows.push(value as Row);\n }\n return rows;\n });\n }\n}\n\nclass ClientGroup implements ClientGroupInterface {\n readonly #rep: Rep;\n readonly id: string;\n readonly #schema: Schema;\n readonly #socket: GetWebSocket;\n readonly #delegate: InspectorDelegate;\n\n constructor(\n rep: Rep,\n delegate: InspectorDelegate,\n socket: GetWebSocket,\n schema: Schema,\n id: string,\n ) {\n this.#rep = rep;\n this.#delegate = delegate;\n this.#socket = socket;\n this.#schema = schema;\n this.id = id;\n }\n\n clients(): Promise<ClientInterface[]> {\n return withDagRead(this.#rep, dagRead =>\n clients(\n this.#rep,\n this.#delegate,\n this.#socket,\n this.#schema,\n dagRead,\n ([_, v]) => v.clientGroupID === this.id,\n ),\n );\n }\n\n clientsWithQueries(): Promise<ClientInterface[]> {\n return withDagRead(this.#rep, dagRead =>\n clientsWithQueries(\n this.#rep,\n this.#delegate,\n this.#socket,\n this.#schema,\n dagRead,\n ([_, v]) => v.clientGroupID === this.id,\n ),\n );\n }\n\n async queries(): Promise<QueryInterface[]> {\n const rows: InspectQueryRow[] = await rpc(\n await this.#socket(),\n {op: 'queries'},\n inspectQueriesDownSchema,\n );\n return rows.map(row => new Query(row, this.#delegate));\n }\n}\n\nasync function withDagRead<T>(\n rep: Rep,\n f: (dagRead: Read) => Promise<T>,\n): Promise<T> {\n await rep.refresh();\n await rep.persist();\n return withRead(rep.perdag, f);\n}\n\nasync function getBTree(dagRead: Read, clientID: string): Promise<BTreeRead> {\n const client = await getClient(clientID, dagRead);\n assert(client, `Client not found: ${clientID}`);\n const {clientGroupID} = client;\n const clientGroup = await getClientGroup(clientGroupID, dagRead);\n assert(clientGroup, `Client group not found: ${clientGroupID}`);\n const dbRead = await readFromHash(\n clientGroup.headHash,\n dagRead,\n FormatVersion.Latest,\n );\n return dbRead.map;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype MapEntry<T extends ReadonlyMap<any, any>> =\n T extends ReadonlyMap<infer K, infer V> ? readonly [K, V] : never;\n\nasync function clients(\n rep: Rep,\n delegate: InspectorDelegate,\n socket: GetWebSocket,\n schema: Schema,\n dagRead: Read,\n predicate: (entry: MapEntry<ClientMap>) => boolean = () => true,\n): Promise<ClientInterface[]> {\n const clients = await getClients(dagRead);\n return [...clients.entries()]\n .filter(predicate)\n .map(\n ([clientID, {clientGroupID}]) =>\n new Client(rep, delegate, schema, socket, clientID, clientGroupID),\n );\n}\n\nasync function clientsWithQueries(\n rep: Rep,\n delegate: InspectorDelegate,\n socket: GetWebSocket,\n schema: Schema,\n dagRead: Read,\n predicate: (entry: MapEntry<ClientMap>) => boolean = () => true,\n): Promise<ClientInterface[]> {\n const allClients = await clients(\n rep,\n delegate,\n socket,\n schema,\n dagRead,\n predicate,\n );\n const clientsWithQueries: ClientInterface[] = [];\n await Promise.all(\n allClients.map(async client => {\n const queries = await client.queries();\n if (queries.length > 0) {\n clientsWithQueries.push(client);\n }\n }),\n );\n return clientsWithQueries;\n}\n\nclass Query implements QueryInterface {\n readonly name: string | null;\n readonly args: ReadonlyArray<ReadonlyJSONValue> | null;\n readonly got: boolean;\n readonly ttl: TTL;\n readonly inactivatedAt: Date | null;\n readonly rowCount: number;\n readonly deleted: boolean;\n readonly id: string;\n readonly clientID: string;\n readonly metrics: Metrics | null;\n readonly clientZQL: string | null;\n readonly serverZQL: string | null;\n\n constructor(row: InspectQueryRow, delegate: InspectorDelegate) {\n const {ast, queryID, inactivatedAt} = row;\n // Use own properties to make this more useful in dev tools. For example, in\n // Chrome dev tools, if you do console.table(queries) you'll see the\n // properties in the table, if these were getters you would not see them in the table.\n this.clientID = row.clientID;\n this.id = queryID;\n this.inactivatedAt =\n inactivatedAt === null ? null : new Date(inactivatedAt);\n this.ttl = normalizeTTL(row.ttl);\n this.name = row.name;\n this.args = row.args;\n this.got = row.got;\n this.rowCount = row.rowCount;\n this.deleted = row.deleted;\n this.serverZQL = ast ? ast.table + astToZQL(ast) : null;\n const clientAST = delegate.getAST(queryID);\n this.clientZQL = clientAST ? clientAST.table + astToZQL(clientAST) : null;\n\n // Merge client and server metrics\n const clientMetrics = delegate.getQueryMetrics(queryID);\n const serverMetrics = row.metrics;\n\n this.metrics = mergeMetrics(clientMetrics, serverMetrics);\n }\n}\n\nfunction mergeMetrics(\n clientMetrics: ClientMetrics | undefined,\n serverMetrics: ServerMetricsJSON | null | undefined,\n): ClientMetrics & ServerMetrics {\n return {\n ...(clientMetrics ?? newClientMetrics()),\n ...(serverMetrics\n ? convertServerMetrics(serverMetrics)\n : newServerMetrics()),\n };\n}\n\nfunction newClientMetrics(): ClientMetrics {\n return {\n 'query-materialization-client': new TDigest(),\n 'query-materialization-end-to-end': new TDigest(),\n 'query-update-client': new TDigest(),\n };\n}\n\nfunction newServerMetrics(): ServerMetrics {\n return {\n 'query-materialization-server': new TDigest(),\n 'query-update-server': new TDigest(),\n };\n}\n\nfunction convertServerMetrics(metrics: ServerMetricsJSON): ServerMetrics {\n return mapValues(metrics, v => TDigest.fromJSON(v));\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BO,SAAS,SAAS,KAAkB;AACzC,MAAI,OAAO;AAGX,MAAI,IAAI,OAAO;AACb,YAAQ,mBAAmB,IAAI,OAAO,UAAU,oBAAI,IAAI,CAAC;AAAA,EAC3D;AAGA,MAAI,IAAI,WAAW,IAAI,QAAQ,SAAS,GAAG;AACzC,eAAW,WAAW,IAAI,SAAS;AACjC,UAAI,QAAQ,QAAQ;AAClB,cAAM,gBAAgB,QAAQ,SAAS,UAAU,CAAC;AAClD,YAAI,eAAe;AACjB,kBAAQ,iBAAiB,aAAa;AAAA,QACxC;AAAA,MACF,OAAO;AACL,gBAAQ,iBAAiB,OAAO;AAAA,MAClC;AAAA,IACF;AAAA,EACF;AAGA,MAAI,IAAI,WAAW,IAAI,QAAQ,SAAS,GAAG;AACzC,YAAQ,eAAe,IAAI,OAAO;AAAA,EACpC;AAGA,MAAI,IAAI,UAAU,QAAW;AAC3B,YAAQ,UAAU,IAAI,KAAK;AAAA,EAC7B;AAGA,MAAI,IAAI,OAAO;AACb,UAAM,EAAC,KAAK,UAAS,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from '../../shared/src/types.ts';
|
|
3
|
-
import type { StoreProvider } from './kv/store.ts';
|
|
4
|
-
import type { PendingMutation } from './pending-mutations.ts';
|
|
5
|
-
import type { Puller } from './puller.ts';
|
|
6
|
-
import type { Pusher } from './pusher.ts';
|
|
7
|
-
import { ReplicacheImpl } from './replicache-impl.ts';
|
|
8
|
-
import type { ReplicacheOptions } from './replicache-options.ts';
|
|
9
|
-
import type { SubscribeOptions, WatchCallbackForOptions, WatchNoIndexCallback, WatchOptions } from './subscriptions.ts';
|
|
10
|
-
import type { ReadTransaction } from './transactions.ts';
|
|
11
|
-
import type { MakeMutators, MutatorDefs, Poke, RequestOptions, UpdateNeededReason } from './types.ts';
|
|
12
|
-
type MakeImpl = <MD extends MutatorDefs>(options: ReplicacheOptions<MD>) => ReplicacheImpl<MD>;
|
|
13
|
-
export declare function setMakeImplForTest(testMakeImpl: MakeImpl): void;
|
|
14
|
-
export declare function restoreMakeImplForTest(): void;
|
|
15
|
-
export declare const httpStatusUnauthorized = 401;
|
|
16
|
-
/**
|
|
17
|
-
* Returns the name of the IDB database that will be used for a particular Replicache instance.
|
|
18
|
-
* @param name The name of the Replicache instance (i.e., the `name` field of `ReplicacheOptions`).
|
|
19
|
-
* @param schemaVersion The schema version of the database (i.e., the `schemaVersion` field of `ReplicacheOptions`).
|
|
20
|
-
* @returns
|
|
21
|
-
*/
|
|
22
|
-
export declare function makeIDBName(name: string, schemaVersion?: string): string;
|
|
23
|
-
declare function makeIDBNameInternal(name: string, schemaVersion: string | undefined, formatVersion: number): string;
|
|
24
|
-
export { makeIDBNameInternal as makeIDBNameForTesting };
|
|
25
|
-
export declare class Replicache<MD extends MutatorDefs = {}> {
|
|
26
|
-
#private;
|
|
27
|
-
constructor(options: ReplicacheOptions<MD>);
|
|
28
|
-
/** The URL to use when doing a pull request. */
|
|
29
|
-
get pullURL(): string;
|
|
30
|
-
set pullURL(value: string);
|
|
31
|
-
/** The URL to use when doing a push request. */
|
|
32
|
-
get pushURL(): string;
|
|
33
|
-
set pushURL(value: string);
|
|
34
|
-
/** The authorization token used when doing a push request. */
|
|
35
|
-
get auth(): string;
|
|
36
|
-
set auth(value: string);
|
|
37
|
-
/** The name of the Replicache database. Populated by {@link ReplicacheOptions#name}. */
|
|
38
|
-
get name(): string;
|
|
39
|
-
/**
|
|
40
|
-
* This is the name Replicache uses for the IndexedDB database where data is
|
|
41
|
-
* stored.
|
|
42
|
-
*/
|
|
43
|
-
get idbName(): string;
|
|
44
|
-
/** The schema version of the data understood by this application. */
|
|
45
|
-
get schemaVersion(): string;
|
|
46
|
-
/**
|
|
47
|
-
* The mutators that was registered in the constructor.
|
|
48
|
-
*/
|
|
49
|
-
get mutate(): MakeMutators<MD>;
|
|
50
|
-
/**
|
|
51
|
-
* The duration between each periodic {@link pull}. Setting this to `null`
|
|
52
|
-
* disables periodic pull completely. Pull will still happen if you call
|
|
53
|
-
* {@link pull} manually.
|
|
54
|
-
*/
|
|
55
|
-
get pullInterval(): number | null;
|
|
56
|
-
set pullInterval(value: number | null);
|
|
57
|
-
/**
|
|
58
|
-
* The delay between when a change is made to Replicache and when Replicache
|
|
59
|
-
* attempts to push that change.
|
|
60
|
-
*/
|
|
61
|
-
get pushDelay(): number;
|
|
62
|
-
set pushDelay(value: number);
|
|
63
|
-
/**
|
|
64
|
-
* The function to use to pull data from the server.
|
|
65
|
-
*/
|
|
66
|
-
get puller(): Puller;
|
|
67
|
-
set puller(value: Puller);
|
|
68
|
-
/**
|
|
69
|
-
* The function to use to push data to the server.
|
|
70
|
-
*/
|
|
71
|
-
get pusher(): Pusher;
|
|
72
|
-
set pusher(value: Pusher);
|
|
73
|
-
/**
|
|
74
|
-
* The options used to control the {@link pull} and push request behavior. This
|
|
75
|
-
* object is live so changes to it will affect the next pull or push call.
|
|
76
|
-
*/
|
|
77
|
-
get requestOptions(): Required<RequestOptions>;
|
|
78
|
-
/**
|
|
79
|
-
* `onSync(true)` is called when Replicache transitions from no push or pull
|
|
80
|
-
* happening to at least one happening. `onSync(false)` is called in the
|
|
81
|
-
* opposite case: when Replicache transitions from at least one push or pull
|
|
82
|
-
* happening to none happening.
|
|
83
|
-
*
|
|
84
|
-
* This can be used in a React like app by doing something like the following:
|
|
85
|
-
*
|
|
86
|
-
* ```js
|
|
87
|
-
* const [syncing, setSyncing] = useState(false);
|
|
88
|
-
* useEffect(() => {
|
|
89
|
-
* rep.onSync = setSyncing;
|
|
90
|
-
* }, [rep]);
|
|
91
|
-
* ```
|
|
92
|
-
*/
|
|
93
|
-
get onSync(): ((syncing: boolean) => void) | null;
|
|
94
|
-
set onSync(value: ((syncing: boolean) => void) | null);
|
|
95
|
-
/**
|
|
96
|
-
* `onClientStateNotFound` is called when the persistent client has been
|
|
97
|
-
* garbage collected. This can happen if the client has no pending mutations
|
|
98
|
-
* and has not been used for a while.
|
|
99
|
-
*
|
|
100
|
-
* The default behavior is to reload the page (using `location.reload()`). Set
|
|
101
|
-
* this to `null` or provide your own function to prevent the page from
|
|
102
|
-
* reloading automatically.
|
|
103
|
-
*/
|
|
104
|
-
get onClientStateNotFound(): (() => void) | null;
|
|
105
|
-
set onClientStateNotFound(value: (() => void) | null);
|
|
106
|
-
/**
|
|
107
|
-
* `onUpdateNeeded` is called when a code update is needed.
|
|
108
|
-
*
|
|
109
|
-
* A code update can be needed because:
|
|
110
|
-
* - the server no longer supports the {@link pushVersion},
|
|
111
|
-
* {@link pullVersion} or {@link schemaVersion} of the current code.
|
|
112
|
-
* - a new Replicache client has created a new client group, because its code
|
|
113
|
-
* has different mutators, indexes, schema version and/or format version
|
|
114
|
-
* from this Replicache client. This is likely due to the new client having
|
|
115
|
-
* newer code. A code update is needed to be able to locally sync with this
|
|
116
|
-
* new Replicache client (i.e. to sync while offline, the clients can can
|
|
117
|
-
* still sync with each other via the server).
|
|
118
|
-
*
|
|
119
|
-
* The default behavior is to reload the page (using `location.reload()`). Set
|
|
120
|
-
* this to `null` or provide your own function to prevent the page from
|
|
121
|
-
* reloading automatically. You may want to provide your own function to
|
|
122
|
-
* display a toast to inform the end user there is a new version of your app
|
|
123
|
-
* available and prompting them to refresh.
|
|
124
|
-
*/
|
|
125
|
-
get onUpdateNeeded(): ((reason: UpdateNeededReason) => void) | null;
|
|
126
|
-
set onUpdateNeeded(value: ((reason: UpdateNeededReason) => void) | null);
|
|
127
|
-
/**
|
|
128
|
-
* This gets called when we get an HTTP unauthorized (401) response from the
|
|
129
|
-
* push or pull endpoint. Set this to a function that will ask your user to
|
|
130
|
-
* reauthenticate.
|
|
131
|
-
*/
|
|
132
|
-
get getAuth(): (() => MaybePromise<string | null | undefined>) | null | undefined;
|
|
133
|
-
set getAuth(value: (() => MaybePromise<string | null | undefined>) | null | undefined);
|
|
134
|
-
/**
|
|
135
|
-
* The browser profile ID for this browser profile. Every instance of Replicache
|
|
136
|
-
* browser-profile-wide shares the same profile ID.
|
|
137
|
-
*/
|
|
138
|
-
get profileID(): Promise<string>;
|
|
139
|
-
/**
|
|
140
|
-
* The client ID for this instance of Replicache. Each instance of Replicache
|
|
141
|
-
* gets a unique client ID.
|
|
142
|
-
*/
|
|
143
|
-
get clientID(): string;
|
|
144
|
-
/**
|
|
145
|
-
* The client group ID for this instance of Replicache. Instances of
|
|
146
|
-
* Replicache will have the same client group ID if and only if they have
|
|
147
|
-
* the same name, mutators, indexes, schema version, format version, and
|
|
148
|
-
* browser profile.
|
|
149
|
-
*/
|
|
150
|
-
get clientGroupID(): Promise<string>;
|
|
151
|
-
/**
|
|
152
|
-
* `onOnlineChange` is called when the {@link online} property changes. See
|
|
153
|
-
* {@link online} for more details.
|
|
154
|
-
*/
|
|
155
|
-
get onOnlineChange(): ((online: boolean) => void) | null;
|
|
156
|
-
set onOnlineChange(value: ((online: boolean) => void) | null);
|
|
157
|
-
/**
|
|
158
|
-
* A rough heuristic for whether the client is currently online. Note that
|
|
159
|
-
* there is no way to know for certain whether a client is online - the next
|
|
160
|
-
* request can always fail. This property returns true if the last sync attempt succeeded,
|
|
161
|
-
* and false otherwise.
|
|
162
|
-
*/
|
|
163
|
-
get online(): boolean;
|
|
164
|
-
/**
|
|
165
|
-
* Whether the Replicache database has been closed. Once Replicache has been
|
|
166
|
-
* closed it no longer syncs and you can no longer read or write data out of
|
|
167
|
-
* it. After it has been closed it is pretty much useless and should not be
|
|
168
|
-
* used any more.
|
|
169
|
-
*/
|
|
170
|
-
get closed(): boolean;
|
|
171
|
-
/**
|
|
172
|
-
* Closes this Replicache instance.
|
|
173
|
-
*
|
|
174
|
-
* When closed all subscriptions end and no more read or writes are allowed.
|
|
175
|
-
*/
|
|
176
|
-
close(): Promise<void>;
|
|
177
|
-
/**
|
|
178
|
-
* Push pushes pending changes to the {@link pushURL}.
|
|
179
|
-
*
|
|
180
|
-
* You do not usually need to manually call push. If {@link pushDelay} is
|
|
181
|
-
* non-zero (which it is by default) pushes happen automatically shortly after
|
|
182
|
-
* mutations.
|
|
183
|
-
*
|
|
184
|
-
* If the server endpoint fails push will be continuously retried with an
|
|
185
|
-
* exponential backoff.
|
|
186
|
-
*
|
|
187
|
-
* @param [now=false] If true, push will happen immediately and ignore
|
|
188
|
-
* {@link pushDelay}, {@link RequestOptions.minDelayMs} as well as the
|
|
189
|
-
* exponential backoff in case of errors.
|
|
190
|
-
* @returns A promise that resolves when the next push completes. In case of
|
|
191
|
-
* errors the first error will reject the returned promise. Subsequent errors
|
|
192
|
-
* will not be reflected in the promise.
|
|
193
|
-
*/
|
|
194
|
-
push({ now }?: {
|
|
195
|
-
now?: boolean | undefined;
|
|
196
|
-
}): Promise<void>;
|
|
197
|
-
/**
|
|
198
|
-
* Pull pulls changes from the {@link pullURL}. If there are any changes local
|
|
199
|
-
* changes will get replayed on top of the new server state.
|
|
200
|
-
*
|
|
201
|
-
* If the server endpoint fails pull will be continuously retried with an
|
|
202
|
-
* exponential backoff.
|
|
203
|
-
*
|
|
204
|
-
* @param [now=false] If true, pull will happen immediately and ignore
|
|
205
|
-
* {@link RequestOptions.minDelayMs} as well as the exponential backoff in
|
|
206
|
-
* case of errors.
|
|
207
|
-
* @returns A promise that resolves when the next pull completes. In case of
|
|
208
|
-
* errors the first error will reject the returned promise. Subsequent errors
|
|
209
|
-
* will not be reflected in the promise.
|
|
210
|
-
*/
|
|
211
|
-
pull({ now }?: {
|
|
212
|
-
now?: boolean | undefined;
|
|
213
|
-
}): Promise<void>;
|
|
214
|
-
/**
|
|
215
|
-
* Applies an update from the server to Replicache.
|
|
216
|
-
* Throws an error if cookie does not match. In that case the server thinks
|
|
217
|
-
* this client has a different cookie than it does; the caller should disconnect
|
|
218
|
-
* from the server and re-register, which transmits the cookie the client actually
|
|
219
|
-
* has.
|
|
220
|
-
*
|
|
221
|
-
* @experimental This method is under development and its semantics will change.
|
|
222
|
-
*/
|
|
223
|
-
poke(poke: Poke): Promise<void>;
|
|
224
|
-
/**
|
|
225
|
-
* Subscribe to the result of a {@link query}. The `body` function is
|
|
226
|
-
* evaluated once and its results are returned via `onData`.
|
|
227
|
-
*
|
|
228
|
-
* Thereafter, each time the the result of `body` changes, `onData` is fired
|
|
229
|
-
* again with the new result.
|
|
230
|
-
*
|
|
231
|
-
* `subscribe()` goes to significant effort to avoid extraneous work
|
|
232
|
-
* re-evaluating subscriptions:
|
|
233
|
-
*
|
|
234
|
-
* 1. subscribe tracks the keys that `body` accesses each time it runs. `body`
|
|
235
|
-
* is only re-evaluated when those keys change.
|
|
236
|
-
* 2. subscribe only re-fires `onData` in the case that a result changes by
|
|
237
|
-
* way of the `isEqual` option which defaults to doing a deep JSON value
|
|
238
|
-
* equality check.
|
|
239
|
-
*
|
|
240
|
-
* Because of (1), `body` must be a pure function of the data in Replicache.
|
|
241
|
-
* `body` must not access anything other than the `tx` parameter passed to it.
|
|
242
|
-
*
|
|
243
|
-
* Although subscribe is as efficient as it can be, it is somewhat constrained
|
|
244
|
-
* by the goal of returning an arbitrary computation of the cache. For even
|
|
245
|
-
* better performance (but worse dx), see {@link experimentalWatch}.
|
|
246
|
-
*
|
|
247
|
-
* If an error occurs in the `body` the `onError` function is called if
|
|
248
|
-
* present. Otherwise, the error is logged at log level 'error'.
|
|
249
|
-
*
|
|
250
|
-
* To cancel the subscription, call the returned function.
|
|
251
|
-
*
|
|
252
|
-
* @param body The function to evaluate to get the value to pass into
|
|
253
|
-
* `onData`.
|
|
254
|
-
* @param options Options is either a function or an object. If it is a
|
|
255
|
-
* function it is equivalent to passing it as the `onData` property of an
|
|
256
|
-
* object.
|
|
257
|
-
*/
|
|
258
|
-
subscribe<R>(body: (tx: ReadTransaction) => Promise<R>, options: SubscribeOptions<R> | ((result: R) => void)): () => void;
|
|
259
|
-
/**
|
|
260
|
-
* Watches Replicache for changes.
|
|
261
|
-
*
|
|
262
|
-
* The `callback` gets called whenever the underlying data changes and the
|
|
263
|
-
* `key` changes matches the `prefix` of {@link ExperimentalWatchIndexOptions} or
|
|
264
|
-
* {@link ExperimentalWatchNoIndexOptions} if present. If a change
|
|
265
|
-
* occurs to the data but the change does not impact the key space the
|
|
266
|
-
* callback is not called. In other words, the callback is never called with
|
|
267
|
-
* an empty diff.
|
|
268
|
-
*
|
|
269
|
-
* This gets called after commit (a mutation or a rebase).
|
|
270
|
-
*
|
|
271
|
-
* @experimental This method is under development and its semantics will
|
|
272
|
-
* change.
|
|
273
|
-
*/
|
|
274
|
-
experimentalWatch(callback: WatchNoIndexCallback): () => void;
|
|
275
|
-
experimentalWatch<Options extends WatchOptions>(callback: WatchCallbackForOptions<Options>, options?: Options): () => void;
|
|
276
|
-
/**
|
|
277
|
-
* Query is used for read transactions. It is recommended to use transactions
|
|
278
|
-
* to ensure you get a consistent view across multiple calls to `get`, `has`
|
|
279
|
-
* and `scan`.
|
|
280
|
-
*/
|
|
281
|
-
query<R>(body: (tx: ReadTransaction) => Promise<R> | R): Promise<R>;
|
|
282
|
-
/**
|
|
283
|
-
* List of pending mutations. The order of this is from oldest to newest.
|
|
284
|
-
*
|
|
285
|
-
* Gives a list of local mutations that have `mutationID` >
|
|
286
|
-
* `syncHead.mutationID` that exists on the main client group.
|
|
287
|
-
*
|
|
288
|
-
* @experimental This method is experimental and may change in the future.
|
|
289
|
-
*/
|
|
290
|
-
experimentalPendingMutations(): Promise<readonly PendingMutation[]>;
|
|
291
|
-
}
|
|
292
|
-
/**
|
|
293
|
-
* Wrapper error class that should be reported as error (logger.error)
|
|
294
|
-
*/
|
|
295
|
-
export declare class ReportError extends Error {
|
|
296
|
-
}
|
|
297
|
-
export declare function getKVStoreProvider(lc: LogContext, kvStore: 'mem' | 'idb' | StoreProvider | undefined): StoreProvider;
|
|
298
|
-
//# sourceMappingURL=replicache.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"replicache.d.ts","sourceRoot":"","sources":["../../../../replicache/src/replicache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,2BAA2B,CAAC;AAO5D,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACxC,OAAO,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,YAAY,EACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,IAAI,EACJ,cAAc,EACd,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAEpB,KAAK,QAAQ,GAAG,CAAC,EAAE,SAAS,WAAW,EACrC,OAAO,EAAE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EAAE,uBAAuB,CAAC,OAAO,CAAC,EAC1C,OAAO,CAAC,EAAE,OAAO,GAChB,MAAM,IAAI;IAQb;;;;OAIG;IACH,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,eAAe,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAInE;;;;;;;OAOG;IACH,4BAA4B,IAAI,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC;CAGpE;AAED;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;CAAG;AAMzC,wBAAgB,kBAAkB,CAChC,EAAE,EAAE,UAAU,EACd,OAAO,EAAE,KAAK,GAAG,KAAK,GAAG,aAAa,GAAG,SAAS,GACjD,aAAa,CAgBf"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type SQLiteDatabaseManagerOptions } from '../../replicache/src/kv/sqlite-store.ts';
|
|
2
|
-
import type { StoreProvider } from '../../replicache/src/kv/store.ts';
|
|
3
|
-
export declare const expoSQLiteStoreProvider: (opts?: Partial<Omit<SQLiteDatabaseManagerOptions, "journalMode">>) => StoreProvider;
|
|
4
|
-
//# sourceMappingURL=store.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../zero-react-native/src/store.ts"],"names":[],"mappings":"AAKA,OAAO,EAIL,KAAK,4BAA4B,EAClC,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,kCAAkC,CAAC;AAgCpE,eAAO,MAAM,uBAAuB,GAClC,OAAO,OAAO,CAAC,IAAI,CAAC,4BAA4B,EAAE,aAAa,CAAC,CAAC,KAChE,aAkBD,CAAC"}
|
|
File without changes
|