@secrecy/lib 1.78.0 → 1.79.1

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.
@@ -80,11 +80,11 @@ export async function uploadData({ storageType, data, password, forcePassword =
80
80
  if (!data.key) {
81
81
  throw new Error('Unable to encrypt data without key!');
82
82
  }
83
- const priv = keyPairs?.[data.keyPair.pub];
83
+ const priv = keyPairs?.[data.keyIdentityPubKey];
84
84
  if (typeof priv !== 'string') {
85
85
  throw new Error('Unable to encrypt data without keyPair!');
86
86
  }
87
- key = decryptCryptoBox(sodium.from_hex(data.key), data.keyPair.pub, priv);
87
+ key = decryptCryptoBox(sodium.from_hex(data.key), data.keySharedByPubKey, priv);
88
88
  }
89
89
  // NOTE: Process to create a sharing for a auth client (todo: endpoint)
90
90
  return {
@@ -104,6 +104,7 @@ export async function uploadData({ storageType, data, password, forcePassword =
104
104
  key: encryptedDataKey ? sodium.to_hex(encryptedDataKey) : undefined,
105
105
  md5Encrypted,
106
106
  md5: md5Data,
107
+ fromIdentityPubKey: currentIdentity?.identityPubKey,
107
108
  ...filetype,
108
109
  }
109
110
  : {
@@ -111,6 +112,7 @@ export async function uploadData({ storageType, data, password, forcePassword =
111
112
  content: Buffer.from(encryptedData),
112
113
  md5: md5Data,
113
114
  size: BigInt(dataBuffer.byteLength),
115
+ fromIdentityPubKey: currentIdentity?.identityPubKey,
114
116
  ...filetype,
115
117
  };
116
118
  const uploadData = await apiClient.cloud.uploadLiteData.mutate(uploadDataArgs, { signal });
@@ -146,12 +148,14 @@ export async function uploadData({ storageType, data, password, forcePassword =
146
148
  key: encryptedDataKey ? sodium.to_hex(encryptedDataKey) : undefined,
147
149
  md5Encrypted,
148
150
  md5: md5Data,
151
+ fromIdentityPubKey: currentIdentity?.identityPubKey,
149
152
  ...filetype,
150
153
  }
151
154
  : {
152
155
  type: 'unencrypted',
153
156
  md5: md5Data,
154
157
  size: BigInt(dataBuffer.byteLength),
158
+ fromIdentityPubKey: currentIdentity?.identityPubKey,
155
159
  ...filetype,
156
160
  };
157
161
  const uploadDataCaller = storageType === 's3'
@@ -1539,6 +1539,7 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
1539
1539
  type: "encrypted";
1540
1540
  mime?: string | undefined;
1541
1541
  ext?: string | undefined;
1542
+ fromIdentityPubKey?: string | null | undefined;
1542
1543
  key?: string | undefined;
1543
1544
  } | {
1544
1545
  size: bigint;
@@ -1546,6 +1547,7 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
1546
1547
  type: "unencrypted";
1547
1548
  mime?: string | undefined;
1548
1549
  ext?: string | undefined;
1550
+ fromIdentityPubKey?: string | null | undefined;
1549
1551
  };
1550
1552
  output: {
1551
1553
  type: "authed";
@@ -1558,10 +1560,8 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
1558
1560
  }[];
1559
1561
  partSize: bigint;
1560
1562
  key: string | null;
1561
- keyPair: {
1562
- pub: string;
1563
- encPriv: string;
1564
- };
1563
+ keySharedByPubKey: string;
1564
+ keyIdentityPubKey: string;
1565
1565
  } | {
1566
1566
  type: "guest";
1567
1567
  id: string;
@@ -1607,10 +1607,8 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
1607
1607
  }[];
1608
1608
  partSize: bigint;
1609
1609
  key: string | null;
1610
- keyPair: {
1611
- pub: string;
1612
- encPriv: string;
1613
- };
1610
+ keySharedByPubKey: string;
1611
+ keyIdentityPubKey: string;
1614
1612
  } | {
1615
1613
  type: "guest";
1616
1614
  id: string;
@@ -1634,6 +1632,7 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
1634
1632
  content: Uint8Array<ArrayBuffer>;
1635
1633
  mime?: string | undefined;
1636
1634
  ext?: string | undefined;
1635
+ fromIdentityPubKey?: string | null | undefined;
1637
1636
  key?: string | undefined;
1638
1637
  } | {
1639
1638
  size: bigint;
@@ -1642,16 +1641,15 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
1642
1641
  content: Uint8Array<ArrayBuffer>;
1643
1642
  mime?: string | undefined;
1644
1643
  ext?: string | undefined;
1644
+ fromIdentityPubKey?: string | null | undefined;
1645
1645
  };
1646
1646
  output: {
1647
1647
  type: "authed";
1648
1648
  id: string;
1649
1649
  storageType: "s3" | "cold" | "lite";
1650
1650
  key: string | null;
1651
- keyPair: {
1652
- pub: string;
1653
- encPriv: string;
1654
- };
1651
+ keySharedByPubKey: string;
1652
+ keyIdentityPubKey: string;
1655
1653
  } | {
1656
1654
  type: "guest";
1657
1655
  id: string;
@@ -6227,6 +6225,7 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
6227
6225
  applicationId: string | null;
6228
6226
  initiatorAppId: string;
6229
6227
  initiatorUserId: string;
6228
+ rootNodeId: string;
6230
6229
  };
6231
6230
  };
6232
6231
  meta: any;
@@ -6266,6 +6265,7 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
6266
6265
  applicationId: string | null;
6267
6266
  initiatorAppId: string;
6268
6267
  initiatorUserId: string;
6268
+ rootNodeId: string;
6269
6269
  };
6270
6270
  };
6271
6271
  meta: any;
@@ -6313,6 +6313,7 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
6313
6313
  applicationId: string | null;
6314
6314
  initiatorAppId: string;
6315
6315
  initiatorUserId: string;
6316
+ rootNodeId: string;
6316
6317
  };
6317
6318
  };
6318
6319
  meta: any;
@@ -6354,6 +6355,7 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
6354
6355
  applicationId: string | null;
6355
6356
  initiatorAppId: string;
6356
6357
  initiatorUserId: string;
6358
+ rootNodeId: string;
6357
6359
  };
6358
6360
  };
6359
6361
  meta: any;
@@ -7892,6 +7894,7 @@ export declare const getTrpcGuestClient: ({ url }?: {
7892
7894
  type: "encrypted";
7893
7895
  mime?: string | undefined;
7894
7896
  ext?: string | undefined;
7897
+ fromIdentityPubKey?: string | null | undefined;
7895
7898
  key?: string | undefined;
7896
7899
  } | {
7897
7900
  size: bigint;
@@ -7899,6 +7902,7 @@ export declare const getTrpcGuestClient: ({ url }?: {
7899
7902
  type: "unencrypted";
7900
7903
  mime?: string | undefined;
7901
7904
  ext?: string | undefined;
7905
+ fromIdentityPubKey?: string | null | undefined;
7902
7906
  };
7903
7907
  output: {
7904
7908
  type: "authed";
@@ -7911,10 +7915,8 @@ export declare const getTrpcGuestClient: ({ url }?: {
7911
7915
  }[];
7912
7916
  partSize: bigint;
7913
7917
  key: string | null;
7914
- keyPair: {
7915
- pub: string;
7916
- encPriv: string;
7917
- };
7918
+ keySharedByPubKey: string;
7919
+ keyIdentityPubKey: string;
7918
7920
  } | {
7919
7921
  type: "guest";
7920
7922
  id: string;
@@ -7960,10 +7962,8 @@ export declare const getTrpcGuestClient: ({ url }?: {
7960
7962
  }[];
7961
7963
  partSize: bigint;
7962
7964
  key: string | null;
7963
- keyPair: {
7964
- pub: string;
7965
- encPriv: string;
7966
- };
7965
+ keySharedByPubKey: string;
7966
+ keyIdentityPubKey: string;
7967
7967
  } | {
7968
7968
  type: "guest";
7969
7969
  id: string;
@@ -7987,6 +7987,7 @@ export declare const getTrpcGuestClient: ({ url }?: {
7987
7987
  content: Uint8Array<ArrayBuffer>;
7988
7988
  mime?: string | undefined;
7989
7989
  ext?: string | undefined;
7990
+ fromIdentityPubKey?: string | null | undefined;
7990
7991
  key?: string | undefined;
7991
7992
  } | {
7992
7993
  size: bigint;
@@ -7995,16 +7996,15 @@ export declare const getTrpcGuestClient: ({ url }?: {
7995
7996
  content: Uint8Array<ArrayBuffer>;
7996
7997
  mime?: string | undefined;
7997
7998
  ext?: string | undefined;
7999
+ fromIdentityPubKey?: string | null | undefined;
7998
8000
  };
7999
8001
  output: {
8000
8002
  type: "authed";
8001
8003
  id: string;
8002
8004
  storageType: "s3" | "cold" | "lite";
8003
8005
  key: string | null;
8004
- keyPair: {
8005
- pub: string;
8006
- encPriv: string;
8007
- };
8006
+ keySharedByPubKey: string;
8007
+ keyIdentityPubKey: string;
8008
8008
  } | {
8009
8009
  type: "guest";
8010
8010
  id: string;
@@ -12580,6 +12580,7 @@ export declare const getTrpcGuestClient: ({ url }?: {
12580
12580
  applicationId: string | null;
12581
12581
  initiatorAppId: string;
12582
12582
  initiatorUserId: string;
12583
+ rootNodeId: string;
12583
12584
  };
12584
12585
  };
12585
12586
  meta: any;
@@ -12619,6 +12620,7 @@ export declare const getTrpcGuestClient: ({ url }?: {
12619
12620
  applicationId: string | null;
12620
12621
  initiatorAppId: string;
12621
12622
  initiatorUserId: string;
12623
+ rootNodeId: string;
12622
12624
  };
12623
12625
  };
12624
12626
  meta: any;
@@ -12666,6 +12668,7 @@ export declare const getTrpcGuestClient: ({ url }?: {
12666
12668
  applicationId: string | null;
12667
12669
  initiatorAppId: string;
12668
12670
  initiatorUserId: string;
12671
+ rootNodeId: string;
12669
12672
  };
12670
12673
  };
12671
12674
  meta: any;
@@ -12707,6 +12710,7 @@ export declare const getTrpcGuestClient: ({ url }?: {
12707
12710
  applicationId: string | null;
12708
12711
  initiatorAppId: string;
12709
12712
  initiatorUserId: string;
12713
+ rootNodeId: string;
12710
12714
  };
12711
12715
  };
12712
12716
  meta: any;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@secrecy/lib",
3
3
  "author": "Anonymize <anonymize@gmail.com>",
4
4
  "description": "Anonymize Secrecy Library",
5
- "version": "1.78.0",
5
+ "version": "1.79.1",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/anonymize-org/lib.git"
@@ -76,7 +76,7 @@
76
76
  },
77
77
  "dependencies": {
78
78
  "@js-temporal/polyfill": "^0.5.1",
79
- "@secrecy/trpc-api-types": "1.33.9-dev.1",
79
+ "@secrecy/trpc-api-types": "1.35.2",
80
80
  "@trpc/client": "11.6.0",
81
81
  "@trpc/server": "^11.6.0",
82
82
  "@types/libsodium-wrappers-sumo": "^0.7.8",