@rebasepro/client 0.29.1 → 0.29.2
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/dist/auth.d.ts +1 -1
- package/dist/collection.d.ts +9 -2
- package/dist/index.es.js +6 -4
- package/dist/index.es.js.map +1 -1
- package/dist/{offline-Cy6woFyt.js → offline-B6J1YUWF.js} +69 -9
- package/dist/offline-B6J1YUWF.js.map +1 -0
- package/dist/offline-connectivity.d.ts +8 -2
- package/dist/{offline-store-C2Sy3Kwl.js → offline-store-B7F5mimt.js} +51 -6
- package/dist/offline-store-B7F5mimt.js.map +1 -0
- package/dist/offline.d.ts +9 -0
- package/dist/transport.d.ts +15 -1
- package/dist/websocket.d.ts +34 -1
- package/package.json +4 -4
- package/dist/offline-Cy6woFyt.js.map +0 -1
- package/dist/offline-store-C2Sy3Kwl.js.map +0 -1
package/dist/auth.d.ts
CHANGED
|
@@ -275,7 +275,7 @@ export declare function createAuth(transport: Transport, options?: CreateAuthOpt
|
|
|
275
275
|
*
|
|
276
276
|
* This is where an MFA-enrolled account's real session is minted, at
|
|
277
277
|
* `aal2` — so this client adopts the returned tokens and announces
|
|
278
|
-
* `SIGNED_IN`, exactly
|
|
278
|
+
* `SIGNED_IN`, exactly like any other sign-in. Pass the same
|
|
279
279
|
* `mfaToken` the challenge was opened with when finishing a sign-in.
|
|
280
280
|
*/
|
|
281
281
|
verifyChallenge(challengeId: string, code: string, options?: MfaPendingOptions): Promise<{
|
package/dist/collection.d.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { FindParams, Transport } from "./transport.js";
|
|
2
|
-
import { RebaseWebSocketClient } from "./websocket.js";
|
|
2
|
+
import type { RebaseWebSocketClient } from "./websocket.js";
|
|
3
3
|
import { FindResult, SDKCollectionClient, type ByIdReadOptions, type IncludeSpec, type RestoreOptions, type TrashClient, RebaseClientError } from "@rebasepro/types";
|
|
4
4
|
import { etagOf } from "@rebasepro/common";
|
|
5
|
+
/**
|
|
6
|
+
* The part of a {@link Transport} a collection client uses: its requests, and
|
|
7
|
+
* the address they go to (to tell when a query is too long for a URL).
|
|
8
|
+
*/
|
|
9
|
+
export type CollectionTransport = Pick<Transport, "request" | "baseUrl" | "apiPath">;
|
|
10
|
+
/** The part of the realtime client a collection client listens through. */
|
|
11
|
+
export type CollectionRealtime = Pick<RebaseWebSocketClient, "listenCollection" | "listenOne">;
|
|
5
12
|
/**
|
|
6
13
|
* A bulk call given something other than an array. A `RebaseClientError` with
|
|
7
14
|
* the code the server uses for the same mistake in a request body, so one
|
|
@@ -103,4 +110,4 @@ export interface CollectionClient<M extends Record<string, unknown> = Record<str
|
|
|
103
110
|
* nothing else, so `realtime` never travels as a query parameter.
|
|
104
111
|
*/
|
|
105
112
|
export declare function byIdRead<Inc>(options: ObserveByIdOptions<Inc> | undefined): ByIdReadOptions<Inc> | undefined;
|
|
106
|
-
export declare function createCollectionClient<M extends Record<string, unknown> = Record<string, unknown>>(transport:
|
|
113
|
+
export declare function createCollectionClient<M extends Record<string, unknown> = Record<string, unknown>>(transport: CollectionTransport, slug: string, ws?: CollectionRealtime): CollectionClient<M>;
|
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as invalidBulkBody, d as RebaseApiError, h as parseRebaseJson, i as isOfflineError, l as SDKQueryBuilder, m as defaultCodeForStatus, n as MemoryOfflineStore, o as createCollectionClient, p as createTransport, s as etagOf, u as RebaseClientError } from "./offline-store-
|
|
1
|
+
import { c as invalidBulkBody, d as RebaseApiError, h as parseRebaseJson, i as isOfflineError, l as SDKQueryBuilder, m as defaultCodeForStatus, n as MemoryOfflineStore, o as createCollectionClient, p as createTransport, s as etagOf, u as RebaseClientError } from "./offline-store-B7F5mimt.js";
|
|
2
2
|
import { AUTH_FLOW_HEADER, DEFAULT_STORAGE_SOURCE_KEY, PUBLIC_STORAGE_PREFIX, RebaseApiError as RebaseApiError$1, RebaseClientError as RebaseClientError$1, STORAGE_REFERENCE_SCHEME, isPublicStoragePath, isStorageReference, isUnsupported, parseStorageReference, resolveStorageReferences, simulationHeaders, storageObjectPath, storageReference, storageReferencesForDownloadUrls, storageTargetOfDownloadUrl, storageTargetsInText } from "@rebasepro/types";
|
|
3
3
|
import { COMPOSITE_ID_SEPARATOR, DOWNLOAD_URL_CONCURRENCY, RESUMABLE_UPLOAD_THRESHOLD, RebasePaginationError, and, buildCompositeId, cond, createBatchLoader, createConcurrencyLimit, createDownloadUrlCache, not, or, warnDeprecated, withETag } from "@rebasepro/common";
|
|
4
4
|
import { toSnakeCase, unref } from "@rebasepro/utils";
|
|
@@ -1392,7 +1392,7 @@ function createAuth(transport, options) {
|
|
|
1392
1392
|
*
|
|
1393
1393
|
* This is where an MFA-enrolled account's real session is minted, at
|
|
1394
1394
|
* `aal2` — so this client adopts the returned tokens and announces
|
|
1395
|
-
* `SIGNED_IN`, exactly
|
|
1395
|
+
* `SIGNED_IN`, exactly like any other sign-in. Pass the same
|
|
1396
1396
|
* `mfaToken` the challenge was opened with when finishing a sign-in.
|
|
1397
1397
|
*/
|
|
1398
1398
|
async verifyChallenge(challengeId, code, options) {
|
|
@@ -3185,7 +3185,7 @@ var RebaseWebSocketClient = class {
|
|
|
3185
3185
|
this.ws.onmessage = (event) => {
|
|
3186
3186
|
this.lastFrameAt = Date.now();
|
|
3187
3187
|
try {
|
|
3188
|
-
const message = parseRebaseJson(event.data);
|
|
3188
|
+
const message = parseRebaseJson(String(event.data));
|
|
3189
3189
|
this.handleWebSocketMessage(message);
|
|
3190
3190
|
} catch (error) {
|
|
3191
3191
|
console.error("Error parsing WebSocket message:", error);
|
|
@@ -5006,7 +5006,7 @@ var LazyOfflineManager = class {
|
|
|
5006
5006
|
keepsLastUser;
|
|
5007
5007
|
constructor(config, createInner) {
|
|
5008
5008
|
this.keepsLastUser = config.keepLastUser === true;
|
|
5009
|
-
import("./offline-
|
|
5009
|
+
import("./offline-B6J1YUWF.js").then(({ OfflineManager: Engine }) => {
|
|
5010
5010
|
const engine = new Engine(config, createInner);
|
|
5011
5011
|
this.engine = engine;
|
|
5012
5012
|
const queued = this.queued;
|
|
@@ -5118,6 +5118,8 @@ var LazyOfflineManager = class {
|
|
|
5118
5118
|
upsert: async (data, options) => (await client()).upsert(data, options),
|
|
5119
5119
|
updateMany: async (updates, options) => (await client()).updateMany(updates, options),
|
|
5120
5120
|
deleteMany: async (ids, options) => (await client()).deleteMany(ids, options),
|
|
5121
|
+
updateWhere: async (query, data, options) => (await client()).updateWhere(query, data, options),
|
|
5122
|
+
deleteWhere: async (query, options) => (await client()).deleteWhere(query, options),
|
|
5121
5123
|
update: async (id, data, options) => (await client()).update(id, data, options),
|
|
5122
5124
|
delete: async (id, options) => (await client()).delete(id, options),
|
|
5123
5125
|
count: async (params) => (await client()).count(params),
|