Skip to content
This repository has been archived by the owner on Jan 1, 2025. It is now read-only.

Commit

Permalink
feat: upgrading to rxDB 15.24.0
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
Upgrading to RXDB 15.X, migrations from older version has not been tested.
Potentially old databases created in 14.X need to be recreated, but may not!!
  • Loading branch information
elribonazo committed Jun 14, 2024
1 parent 9a9cb69 commit c57053a
Show file tree
Hide file tree
Showing 33 changed files with 3,619 additions and 6,293 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
},
{
"command": "npm run test",
"cwd": "${workspaceFolder}/packages/iagon",
"cwd": "${workspaceFolder}/packages/indexdb",
"name": "TEST",
"request": "launch",
"type": "node-terminal",
Expand Down
6,958 changes: 2,841 additions & 4,117 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"husky": "^7.0.4",
"istanbul-badges-readme": "^1.8.5",
"jasmine": "^5.1.0",
"lerna": "^8.0.2",
"lerna": "^8.1.3",
"mock-aws-s3": "^4.0.2",
"nx": "16.8.1",
"postcss": "^8.4.31",
Expand Down Expand Up @@ -88,4 +88,4 @@
"dependencies": {
"typedoc-plugin-external-module-map": "^2.0.1"
}
}
}
4 changes: 2 additions & 2 deletions packages/encryption/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
"@noble/curves": "^1.3.0",
"@noble/hashes": "^1.3.3",
"buffer": "^6.0.3",
"rxdb": "^14.17.0",
"rxdb": "^15.24.0",
"rxjs": "7.8.1",
"uuid": "^9.0.1"
},
"files": [
"build/*"
],
"gitHead": "6aa4ce8bbb9938fc4c4e790efffa5b902631362c"
}
}
30 changes: 16 additions & 14 deletions packages/encryption/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,19 @@
*
*/
import "./globals";

import type {
InternalStoreDocType,
RxAttachmentWriteData,
RxDocumentData,
RxDocumentWriteData,
RxError,
RxJsonSchema,
RxStorage,
RxStorageInstanceCreationParams,
} from 'rxdb'

import {
type InternalStoreDocType,
type RxAttachmentWriteData,
type RxDocumentData,
type RxDocumentWriteData,
type RxError,
type RxJsonSchema,
type RxStorage,
type RxStorageInstanceCreationParams,
b64DecodeUnicode,
b64EncodeUnicode,
clone,
Expand Down Expand Up @@ -107,17 +111,16 @@ export type InternalStorePasswordDocType = InternalStoreDocType<{
hash: string
}>

export interface EncryptableStorageType<Internals, InstanceCreationOptions> {
storage: RxStorage<Internals, InstanceCreationOptions>
}

/**
* Create encrypted storage for pluto-encrypted
* @param args { storage: RxStorage<Internals, InstanceCreationOptions>; }
* @returns RxStorage<Internals, InstanceCreationOptions>
*/
export function wrappedKeyEncryptionStorage<Internals, InstanceCreationOptions>(
args: EncryptableStorageType<Internals, InstanceCreationOptions>
args: {
storage: RxStorage<Internals, InstanceCreationOptions>
}
): RxStorage<Internals, InstanceCreationOptions> {
return Object.assign(
{},
Expand Down Expand Up @@ -255,6 +258,7 @@ export function wrappedKeyEncryptionStorage<Internals, InstanceCreationOptions>(
}

return wrapRxStorageInstance(
params.schema,
instance,
modifyToStorage,
modifyFromStorage,
Expand Down Expand Up @@ -296,5 +300,3 @@ function validatePassword(password: string) {
})
}
}

export * from './migration'
Loading

0 comments on commit c57053a

Please sign in to comment.