dexie-cloud-addon 4.4.4 → 4.4.5
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/modern/default-ui/AuthProviderButton.d.ts +21 -0
- package/dist/modern/default-ui/ProviderSelectionDialog.d.ts +7 -0
- package/dist/modern/default-ui/SelectDialog.d.ts +10 -0
- package/dist/modern/dexie-cloud-addon.js +18 -14
- package/dist/modern/dexie-cloud-addon.js.map +1 -1
- package/dist/modern/dexie-cloud-addon.min.js +1 -1
- package/dist/modern/dexie-cloud-addon.min.js.gz +0 -0
- package/dist/modern/dexie-cloud-addon.min.js.map +1 -1
- package/dist/modern/service-worker.js +18 -14
- package/dist/modern/service-worker.js.map +1 -1
- package/dist/modern/service-worker.min.js +1 -1
- package/dist/modern/service-worker.min.js.map +1 -1
- package/dist/umd/DISABLE_SERVICEWORKER_STRATEGY.d.ts +1 -0
- package/dist/umd/DXCWebSocketStatus.d.ts +1 -0
- package/dist/umd/DexieCloudAPI.d.ts +75 -0
- package/dist/umd/DexieCloudOptions.d.ts +27 -0
- package/dist/umd/DexieCloudSyncOptions.d.ts +4 -0
- package/dist/umd/DexieCloudTable.d.ts +18 -0
- package/dist/umd/InvalidLicenseError.d.ts +5 -0
- package/dist/umd/Invite.d.ts +8 -0
- package/dist/umd/PermissionChecker.d.ts +15 -0
- package/dist/umd/TSON.d.ts +17 -0
- package/dist/umd/WSObservable.d.ts +72 -0
- package/dist/umd/associate.d.ts +1 -0
- package/dist/umd/authentication/AuthPersistedContext.d.ts +9 -0
- package/dist/umd/authentication/TokenErrorResponseError.d.ts +10 -0
- package/dist/umd/authentication/TokenExpiredError.d.ts +3 -0
- package/dist/umd/authentication/UNAUTHORIZED_USER.d.ts +2 -0
- package/dist/umd/authentication/authenticate.d.ts +13 -0
- package/dist/umd/authentication/currentUserObservable.d.ts +1 -0
- package/dist/umd/authentication/interactWithUser.d.ts +21 -0
- package/dist/umd/authentication/login.d.ts +3 -0
- package/dist/umd/authentication/logout.d.ts +5 -0
- package/dist/umd/authentication/otpFetchTokenCallback.d.ts +3 -0
- package/dist/umd/authentication/setCurrentUser.d.ts +14 -0
- package/dist/umd/authentication/waitUntil.d.ts +3 -0
- package/dist/umd/computeSyncState.d.ts +4 -0
- package/dist/umd/createSharedValueObservable.d.ts +3 -0
- package/dist/umd/currentUserEmitter.d.ts +3 -0
- package/dist/umd/db/DexieCloudDB.d.ts +61 -0
- package/dist/umd/db/entities/BaseRevisionMapEntry.d.ts +5 -0
- package/dist/umd/db/entities/EntityCommon.d.ts +5 -0
- package/dist/umd/db/entities/GuardedJob.d.ts +5 -0
- package/dist/umd/db/entities/Member.d.ts +19 -0
- package/dist/umd/db/entities/PersistedSyncState.d.ts +22 -0
- package/dist/umd/db/entities/Realm.d.ts +14 -0
- package/dist/umd/db/entities/Role.d.ts +11 -0
- package/dist/umd/db/entities/UserLogin.d.ts +23 -0
- package/dist/umd/default-ui/Dialog.d.ts +5 -0
- package/dist/umd/default-ui/LoginDialog.d.ts +3 -0
- package/dist/umd/default-ui/Styles.d.ts +3 -0
- package/dist/umd/default-ui/index.d.ts +24 -0
- package/dist/umd/define-ydoc-trigger.d.ts +3 -0
- package/dist/umd/dexie-cloud-addon.d.ts +3 -0
- package/dist/umd/dexie-cloud-addon.js +18 -14
- package/dist/umd/dexie-cloud-addon.js.gz +0 -0
- package/dist/umd/dexie-cloud-addon.js.map +1 -1
- package/dist/umd/dexie-cloud-addon.min.js +1 -1
- package/dist/umd/dexie-cloud-addon.min.js.gz +0 -0
- package/dist/umd/dexie-cloud-addon.min.js.map +1 -1
- package/dist/umd/dexie-cloud-client.d.ts +23 -0
- package/dist/umd/errors/HttpError.d.ts +5 -0
- package/dist/umd/extend-dexie-interface.d.ts +23 -0
- package/dist/umd/getGlobalRolesObservable.d.ts +5 -0
- package/dist/umd/getInternalAccessControlObservable.d.ts +12 -0
- package/dist/umd/getInvitesObservable.d.ts +23 -0
- package/dist/umd/getPermissionsLookupObservable.d.ts +16 -0
- package/dist/umd/getTiedRealmId.d.ts +2 -0
- package/dist/umd/helpers/BroadcastedAndLocalEvent.d.ts +8 -0
- package/dist/umd/helpers/CancelToken.d.ts +4 -0
- package/dist/umd/helpers/IS_SERVICE_WORKER.d.ts +1 -0
- package/dist/umd/helpers/SWBroadcastChannel.d.ts +12 -0
- package/dist/umd/helpers/allSettled.d.ts +1 -0
- package/dist/umd/helpers/bulkUpdate.d.ts +4 -0
- package/dist/umd/helpers/computeRealmSetHash.d.ts +2 -0
- package/dist/umd/helpers/date-constants.d.ts +5 -0
- package/dist/umd/helpers/flatten.d.ts +1 -0
- package/dist/umd/helpers/getMutationTable.d.ts +1 -0
- package/dist/umd/helpers/getSyncableTables.d.ts +4 -0
- package/dist/umd/helpers/getTableFromMutationTable.d.ts +1 -0
- package/dist/umd/helpers/makeArray.d.ts +1 -0
- package/dist/umd/helpers/randomString.d.ts +1 -0
- package/dist/umd/helpers/resolveText.d.ts +16 -0
- package/dist/umd/helpers/throwVersionIncrementNeeded.d.ts +1 -0
- package/dist/umd/helpers/visibilityState.d.ts +1 -0
- package/dist/umd/isEagerSyncDisabled.d.ts +2 -0
- package/dist/umd/isFirefox.d.ts +1 -0
- package/dist/umd/isSafari.d.ts +2 -0
- package/dist/umd/mapValueObservable.d.ts +5 -0
- package/dist/umd/mergePermissions.d.ts +2 -0
- package/dist/umd/middleware-helpers/guardedTable.d.ts +11 -0
- package/dist/umd/middleware-helpers/idGenerationHelpers.d.ts +18 -0
- package/dist/umd/middlewares/createIdGenerationMiddleware.d.ts +3 -0
- package/dist/umd/middlewares/createImplicitPropSetterMiddleware.d.ts +3 -0
- package/dist/umd/middlewares/createMutationTrackingMiddleware.d.ts +17 -0
- package/dist/umd/middlewares/outstandingTransaction.d.ts +4 -0
- package/dist/umd/overrideParseStoresSpec.d.ts +4 -0
- package/dist/umd/performInitialSync.d.ts +4 -0
- package/dist/umd/permissions.d.ts +9 -0
- package/dist/umd/prodLog.d.ts +9 -0
- package/dist/umd/service-worker.d.ts +1 -0
- package/dist/umd/service-worker.js +18 -14
- package/dist/umd/service-worker.js.map +1 -1
- package/dist/umd/service-worker.min.js +1 -1
- package/dist/umd/service-worker.min.js.map +1 -1
- package/dist/umd/sync/DEXIE_CLOUD_SYNCER_ID.d.ts +1 -0
- package/dist/umd/sync/LocalSyncWorker.d.ts +7 -0
- package/dist/umd/sync/SyncRequiredError.d.ts +3 -0
- package/dist/umd/sync/applyServerChanges.d.ts +3 -0
- package/dist/umd/sync/connectWebSocket.d.ts +2 -0
- package/dist/umd/sync/encodeIdsForServer.d.ts +4 -0
- package/dist/umd/sync/extractRealm.d.ts +2 -0
- package/dist/umd/sync/getLatestRevisionsPerTable.d.ts +6 -0
- package/dist/umd/sync/getTablesToSyncify.d.ts +3 -0
- package/dist/umd/sync/isOnline.d.ts +1 -0
- package/dist/umd/sync/isSyncNeeded.d.ts +2 -0
- package/dist/umd/sync/listClientChanges.d.ts +9 -0
- package/dist/umd/sync/listSyncifiedChanges.d.ts +5 -0
- package/dist/umd/sync/messageConsumerIsReady.d.ts +2 -0
- package/dist/umd/sync/messagesFromServerQueue.d.ts +8 -0
- package/dist/umd/sync/modifyLocalObjectsWithNewUserId.d.ts +4 -0
- package/dist/umd/sync/myId.d.ts +1 -0
- package/dist/umd/sync/numUnsyncedMutations.d.ts +2 -0
- package/dist/umd/sync/old_startSyncingClientChanges.d.ts +39 -0
- package/dist/umd/sync/performGuardedJob.d.ts +2 -0
- package/dist/umd/sync/ratelimit.d.ts +3 -0
- package/dist/umd/sync/registerSyncEvent.d.ts +3 -0
- package/dist/umd/sync/sync.d.ts +15 -0
- package/dist/umd/sync/syncIfPossible.d.ts +5 -0
- package/dist/umd/sync/syncWithServer.d.ts +6 -0
- package/dist/umd/sync/triggerSync.d.ts +2 -0
- package/dist/umd/sync/updateBaseRevs.d.ts +5 -0
- package/dist/umd/types/DXCAlert.d.ts +25 -0
- package/dist/umd/types/DXCInputField.d.ts +11 -0
- package/dist/umd/types/DXCUserInteraction.d.ts +93 -0
- package/dist/umd/types/NewIdOptions.d.ts +3 -0
- package/dist/umd/types/SWMessageEvent.d.ts +3 -0
- package/dist/umd/types/SWSyncEvent.d.ts +4 -0
- package/dist/umd/types/SyncState.d.ts +9 -0
- package/dist/umd/types/TXExpandos.d.ts +11 -0
- package/dist/umd/updateSchemaFromOptions.d.ts +3 -0
- package/dist/umd/userIsActive.d.ts +7 -0
- package/dist/umd/verifyConfig.d.ts +2 -0
- package/dist/umd/verifySchema.d.ts +2 -0
- package/dist/umd/yjs/YDexieCloudSyncState.d.ts +3 -0
- package/dist/umd/yjs/YTable.d.ts +3 -0
- package/dist/umd/yjs/applyYMessages.d.ts +9 -0
- package/dist/umd/yjs/awareness.d.ts +3 -0
- package/dist/umd/yjs/createYClientUpdateObservable.d.ts +4 -0
- package/dist/umd/yjs/createYHandler.d.ts +2 -0
- package/dist/umd/yjs/downloadYDocsFromServer.d.ts +3 -0
- package/dist/umd/yjs/getUpdatesTable.d.ts +3 -0
- package/dist/umd/yjs/listUpdatesSince.d.ts +3 -0
- package/dist/umd/yjs/listYClientMessagesAndStateVector.d.ts +26 -0
- package/dist/umd/yjs/reopenDocSignal.d.ts +10 -0
- package/dist/umd/yjs/updateYSyncStates.d.ts +6 -0
- package/package.json +3 -3
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
import type { OAuthProviderInfo } from 'dexie-cloud-common';
|
|
3
|
+
export interface AuthProviderButtonProps {
|
|
4
|
+
provider: OAuthProviderInfo;
|
|
5
|
+
onClick: () => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Button component for OAuth provider login.
|
|
9
|
+
* Displays the provider's icon and name following provider branding guidelines.
|
|
10
|
+
*/
|
|
11
|
+
export declare function AuthProviderButton({ provider, onClick }: AuthProviderButtonProps): h.JSX.Element;
|
|
12
|
+
/**
|
|
13
|
+
* Button for email/OTP authentication option.
|
|
14
|
+
*/
|
|
15
|
+
export declare function OtpButton({ onClick }: {
|
|
16
|
+
onClick: () => void;
|
|
17
|
+
}): h.JSX.Element;
|
|
18
|
+
/**
|
|
19
|
+
* Visual divider with "or" text.
|
|
20
|
+
*/
|
|
21
|
+
export declare function Divider(): h.JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
import { DXCProviderSelection } from '../types/DXCUserInteraction';
|
|
3
|
+
/**
|
|
4
|
+
* Dialog component for OAuth provider selection.
|
|
5
|
+
* Displays available OAuth providers as buttons and optionally an email/OTP option.
|
|
6
|
+
*/
|
|
7
|
+
export declare function ProviderSelectionDialog({ title, alerts, providers, otpEnabled, cancelLabel, onSelectProvider, onSelectOtp, onCancel, }: DXCProviderSelection): h.JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { h } from 'preact';
|
|
2
|
+
import { DXCSelect } from '../types/DXCUserInteraction';
|
|
3
|
+
/**
|
|
4
|
+
* Dialog component for generic option selection.
|
|
5
|
+
* Displays available options as buttons.
|
|
6
|
+
*
|
|
7
|
+
* This component is UI-agnostic and works with any DXCSelect interaction,
|
|
8
|
+
* whether for authentication, settings, or other selection purposes.
|
|
9
|
+
*/
|
|
10
|
+
export declare function SelectDialog({ title, alerts, options, cancelLabel, onSelect, onCancel, }: DXCSelect): h.JSX.Element;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* ==========================================================================
|
|
10
10
|
*
|
|
11
|
-
* Version 4.4.
|
|
11
|
+
* Version 4.4.5, Wed Mar 25 2026
|
|
12
12
|
*
|
|
13
13
|
* https://dexie.org
|
|
14
14
|
*
|
|
@@ -6773,14 +6773,13 @@ function connectWebSocket(db) {
|
|
|
6773
6773
|
throw new Error(`No database URL to connect WebSocket to`);
|
|
6774
6774
|
}
|
|
6775
6775
|
const readyForChangesMessage = db.messageConsumer.readyToServe.pipe(filter$1((isReady) => isReady), // When consumer is ready for new messages, produce such a message to inform server about it
|
|
6776
|
-
switchMap(() => db.
|
|
6777
|
-
filter$1((syncState) => syncState && syncState.serverRevision), // We wont send anything to server before inital sync has taken place
|
|
6776
|
+
switchMap(() => db.cloud.persistedSyncState.pipe(filter$1((syncState) => !!(syncState && syncState.serverRevision)), take(1))), // Wait reactively for syncState with serverRevision (avoids race with logout/re-sync)
|
|
6778
6777
|
switchMap((syncState) => __awaiter(this, void 0, void 0, function* () {
|
|
6779
6778
|
return ({
|
|
6780
6779
|
// Produce the message to trigger server to send us new messages to consume:
|
|
6781
6780
|
type: 'ready',
|
|
6782
6781
|
rev: syncState.serverRevision,
|
|
6783
|
-
realmSetHash: yield computeRealmSetHash(syncState)
|
|
6782
|
+
realmSetHash: yield computeRealmSetHash(syncState),
|
|
6784
6783
|
});
|
|
6785
6784
|
})));
|
|
6786
6785
|
const messageProducer = merge(readyForChangesMessage, db.messageProducer);
|
|
@@ -6793,7 +6792,8 @@ function connectWebSocket(db) {
|
|
|
6793
6792
|
}*/
|
|
6794
6793
|
return userIsReallyActive.pipe(map((isActive) => [isActive ? userLogin : null, syncState]));
|
|
6795
6794
|
}), switchMap(([userLogin, syncState]) => {
|
|
6796
|
-
if ((userLogin === null || userLogin === void 0 ? void 0 : userLogin.isLoggedIn) &&
|
|
6795
|
+
if ((userLogin === null || userLogin === void 0 ? void 0 : userLogin.isLoggedIn) &&
|
|
6796
|
+
!(syncState === null || syncState === void 0 ? void 0 : syncState.realms.includes(userLogin.userId))) {
|
|
6797
6797
|
// We're in an in-between state when user is logged in but the user's realms are not yet synced.
|
|
6798
6798
|
// Don't make this change reconnect the websocket just yet. Wait till syncState is updated
|
|
6799
6799
|
// to iclude the user's realm.
|
|
@@ -6828,7 +6828,7 @@ function connectWebSocket(db) {
|
|
|
6828
6828
|
accessTokenExpiration: refreshedLogin.accessTokenExpiration,
|
|
6829
6829
|
claims: refreshedLogin.claims,
|
|
6830
6830
|
license: refreshedLogin.license,
|
|
6831
|
-
data: refreshedLogin.data
|
|
6831
|
+
data: refreshedLogin.data,
|
|
6832
6832
|
});
|
|
6833
6833
|
})), switchMap(() => createObservable()));
|
|
6834
6834
|
}
|
|
@@ -6836,7 +6836,7 @@ function connectWebSocket(db) {
|
|
|
6836
6836
|
return throwError(() => error);
|
|
6837
6837
|
}
|
|
6838
6838
|
}), catchError((error) => {
|
|
6839
|
-
db.cloud.webSocketStatus.next(
|
|
6839
|
+
db.cloud.webSocketStatus.next('error');
|
|
6840
6840
|
if (error instanceof InvalidLicenseError) {
|
|
6841
6841
|
// Don't retry. Just throw and don't try connect again.
|
|
6842
6842
|
return throwError(() => error);
|
|
@@ -6948,27 +6948,30 @@ function LocalSyncWorker(db, cloudOptions, cloudSchema) {
|
|
|
6948
6948
|
// break free from possible active transaction:
|
|
6949
6949
|
setTimeout(() => {
|
|
6950
6950
|
const purpose = pullSignalled ? 'pull' : 'push';
|
|
6951
|
+
pullSignalled = false;
|
|
6952
|
+
pushSignalled = false;
|
|
6951
6953
|
syncStartTime = Date.now();
|
|
6952
6954
|
syncIfPossible(db, cloudOptions, cloudSchema, {
|
|
6953
6955
|
cancelToken,
|
|
6954
6956
|
retryImmediatelyOnFetchError: true, // workaround for "net::ERR_NETWORK_CHANGED" in chrome.
|
|
6955
6957
|
purpose,
|
|
6956
|
-
})
|
|
6958
|
+
})
|
|
6959
|
+
.then(() => {
|
|
6957
6960
|
if (cancelToken.cancelled) {
|
|
6958
6961
|
stop();
|
|
6959
6962
|
}
|
|
6960
6963
|
else {
|
|
6961
6964
|
if (pullSignalled || pushSignalled) {
|
|
6962
6965
|
// If we have signalled for more sync, do it now.
|
|
6963
|
-
|
|
6964
|
-
pushSignalled = false;
|
|
6966
|
+
// Note: don't reset flags here - syncAndRetry reads them in setTimeout
|
|
6965
6967
|
return syncAndRetry();
|
|
6966
6968
|
}
|
|
6967
6969
|
}
|
|
6968
6970
|
ongoingSync = false;
|
|
6969
6971
|
nextRetryTime = 0;
|
|
6970
6972
|
syncStartTime = 0;
|
|
6971
|
-
})
|
|
6973
|
+
})
|
|
6974
|
+
.catch((error) => {
|
|
6972
6975
|
console.error('error in syncIfPossible()', error);
|
|
6973
6976
|
if (cancelToken.cancelled) {
|
|
6974
6977
|
stop();
|
|
@@ -7011,7 +7014,8 @@ function LocalSyncWorker(db, cloudOptions, cloudSchema) {
|
|
|
7011
7014
|
if (nextRetryTime) {
|
|
7012
7015
|
console.debug(`Sync is paused until ${new Date(nextRetryTime).toISOString()} due to error in last sync attempt`);
|
|
7013
7016
|
}
|
|
7014
|
-
else if (syncStartTime > 0 &&
|
|
7017
|
+
else if (syncStartTime > 0 &&
|
|
7018
|
+
Date.now() - syncStartTime > 20 * SECONDS) {
|
|
7015
7019
|
console.debug(`An existing sync operation is taking more than 20 seconds. Will resync when done.`);
|
|
7016
7020
|
}
|
|
7017
7021
|
return;
|
|
@@ -8373,7 +8377,7 @@ function dexieCloud(dexie) {
|
|
|
8373
8377
|
const downloading$ = createDownloadingState();
|
|
8374
8378
|
dexie.cloud = {
|
|
8375
8379
|
// @ts-ignore
|
|
8376
|
-
version: "4.4.
|
|
8380
|
+
version: "4.4.5",
|
|
8377
8381
|
options: Object.assign({}, DEFAULT_OPTIONS),
|
|
8378
8382
|
schema: null,
|
|
8379
8383
|
get currentUserId() {
|
|
@@ -8800,7 +8804,7 @@ function dexieCloud(dexie) {
|
|
|
8800
8804
|
}
|
|
8801
8805
|
}
|
|
8802
8806
|
// @ts-ignore
|
|
8803
|
-
dexieCloud.version = "4.4.
|
|
8807
|
+
dexieCloud.version = "4.4.5";
|
|
8804
8808
|
Dexie.Cloud = dexieCloud;
|
|
8805
8809
|
|
|
8806
8810
|
export { dexieCloud as default, defineYDocTrigger, dexieCloud, getTiedObjectId, getTiedRealmId, resolveText };
|