@secrecy/lib 1.61.3 → 1.61.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.
|
@@ -666,7 +666,7 @@ export class SecrecyCloudClient {
|
|
|
666
666
|
const key = dataContent.key
|
|
667
667
|
? decryptCryptoBox(sodium.from_hex(dataContent.key), dataContent.type === 'received_mail'
|
|
668
668
|
? dataContent.senderPublicKey
|
|
669
|
-
: dataContent.type === 'cloud'
|
|
669
|
+
: dataContent.type === 'cloud' || dataContent.type === 'lite'
|
|
670
670
|
? dataContent.publicKey
|
|
671
671
|
: this.#keys.publicKey, this.#keys.privateKey)
|
|
672
672
|
: null;
|
|
@@ -3,7 +3,7 @@ import { decryptCryptoBox } from '../../crypto/index.js';
|
|
|
3
3
|
import { nodesCache } from '../../cache.js';
|
|
4
4
|
import { decryptSecretStream } from '../../crypto/data.js';
|
|
5
5
|
import { apiDataToInternal, internalDataToExternalData } from './data.js';
|
|
6
|
-
|
|
6
|
+
async function apiNodeToInternal(apiNode, keyPair) {
|
|
7
7
|
const internal = {
|
|
8
8
|
id: apiNode.id,
|
|
9
9
|
type: apiNode.type,
|
|
@@ -58,7 +58,7 @@ export async function apiNodeFullToInternalFull(apiNodeFull, keyPair) {
|
|
|
58
58
|
nodesCache.set(f.id, nodeFull);
|
|
59
59
|
return nodeFull;
|
|
60
60
|
}
|
|
61
|
-
|
|
61
|
+
function internalNodeToNode(internal) {
|
|
62
62
|
const node = {
|
|
63
63
|
...internal,
|
|
64
64
|
breadcrumb: internal.breadcrumb.map((b) => ({
|
package/dist/lib/client.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { httpBatchLink, loggerLink, createTRPCProxyClient, TRPCClientError, } from '@trpc/client';
|
|
2
2
|
import superjson from 'superjson';
|
|
3
|
-
import { SECRECY_LIB_VERSION } from './versioning';
|
|
3
|
+
import { SECRECY_LIB_VERSION } from './versioning.js';
|
|
4
4
|
export function isTRPCClientError(cause) {
|
|
5
5
|
return cause instanceof TRPCClientError;
|
|
6
6
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import type { Node, ApiNode,
|
|
2
|
-
export declare function apiNodeToInternal(apiNode: ApiNode | ApiNodeParent | ApiNodeFull, keyPair: KeyPair): Promise<InternalNode | InternalNodeFull>;
|
|
1
|
+
import type { Node, ApiNode, ApiNodeFull, InternalNodeFull, NodeFull, KeyPair, ApiNodeParent } from '../types/index.js';
|
|
3
2
|
export declare function apiNodeFullToInternalFull(apiNodeFull: ApiNodeFull, keyPair: KeyPair): Promise<InternalNodeFull>;
|
|
4
|
-
export declare function internalNodeToNode(internal: InternalNode): Node;
|
|
5
3
|
export declare function internalNodeFullToNodeFull(internal: InternalNodeFull): NodeFull;
|
|
6
4
|
export declare function apiNodeToExternalNodeFull(apiNodeFull: ApiNodeFull, keyPair: KeyPair): Promise<NodeFull>;
|
|
7
5
|
export declare function apiNodeToExternal(apiNode: ApiNode | ApiNodeParent, keyPair: KeyPair): Promise<Node>;
|
package/package.json
CHANGED