@secrecy/lib 1.65.0 → 1.66.0-feat-next15.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.
- package/dist/lib/client/SecrecyCloudClient.js +21 -55
- package/dist/lib/client.js +4 -9
- package/dist/lib/transformer.js +18 -0
- package/dist/types/cache.d.ts +2 -2
- package/dist/types/client/SecrecyCloudClient.d.ts +33 -33
- package/dist/types/client/index.d.ts +2 -2
- package/dist/types/client/types/index.d.ts +3 -29
- package/dist/types/client.d.ts +5116 -17903
- package/dist/types/crypto/data.d.ts +3 -3
- package/dist/types/error/client.d.ts +7 -11
- package/dist/types/error/index.d.ts +23 -23
- package/dist/types/error/server.d.ts +35 -13
- package/dist/types/index.d.ts +2 -2
- package/dist/types/transformer.d.ts +2 -0
- package/dist/types/types.d.ts +1 -2
- package/dist/types/worker/sodium.d.ts +3 -3
- package/package.json +31 -30
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
1
|
import ky from 'ky';
|
|
3
2
|
import { nodesCache, dataCache, dataContentCache, nodesEncryptionCache, } from '../cache.js';
|
|
4
3
|
import { secretStreamKeygen } from '../crypto/data.js';
|
|
@@ -15,6 +14,7 @@ import { kiloToBytes } from '../utils.js';
|
|
|
15
14
|
import { fileTypeFromBuffer } from 'file-type';
|
|
16
15
|
import { encryptName, generateAndEncryptNameAndKey } from '../crypto/domain.js';
|
|
17
16
|
import { chunkByTotalItems } from '../utils/object.js';
|
|
17
|
+
import axios from 'axios';
|
|
18
18
|
export class SecrecyCloudClient {
|
|
19
19
|
#client;
|
|
20
20
|
#keys;
|
|
@@ -25,10 +25,7 @@ export class SecrecyCloudClient {
|
|
|
25
25
|
this.#apiClient = apiClient;
|
|
26
26
|
}
|
|
27
27
|
async addDataToHistory({ dataId, nodeId, }) {
|
|
28
|
-
const addDataToHistory = await this.#apiClient.cloud.addDataToHistory.mutate({
|
|
29
|
-
dataId,
|
|
30
|
-
nodeId,
|
|
31
|
-
});
|
|
28
|
+
const addDataToHistory = await this.#apiClient.cloud.addDataToHistory.mutate({ dataId, nodeId });
|
|
32
29
|
const node = await apiNodeFullToInternalFull(addDataToHistory, this.#keys);
|
|
33
30
|
const data = node.history.find((d) => d.id === dataId);
|
|
34
31
|
if (data !== undefined) {
|
|
@@ -74,10 +71,7 @@ export class SecrecyCloudClient {
|
|
|
74
71
|
const dataKey = encrypted ? secretStreamKeygen() : null;
|
|
75
72
|
const { data: encryptedData, md5: md5Data, md5Encrypted, } = dataKey
|
|
76
73
|
? await encrypt(dataKey, compressed, encryptProgress, signal)
|
|
77
|
-
: {
|
|
78
|
-
data: compressed,
|
|
79
|
-
md5: await md5(compressed),
|
|
80
|
-
};
|
|
74
|
+
: { data: compressed, md5: await md5(compressed) };
|
|
81
75
|
const encryptedDataKey = dataKey
|
|
82
76
|
? encryptCryptoBox(dataKey, this.#keys.publicKey, this.#keys.privateKey)
|
|
83
77
|
: null;
|
|
@@ -168,11 +162,7 @@ export class SecrecyCloudClient {
|
|
|
168
162
|
return localData;
|
|
169
163
|
}
|
|
170
164
|
const uploadDataPartEnd = async (md5, order) => {
|
|
171
|
-
return this.#apiClient.cloud.uploadDataPartEnd.mutate({
|
|
172
|
-
dataId: uploadData.id,
|
|
173
|
-
md5,
|
|
174
|
-
order,
|
|
175
|
-
}, { signal });
|
|
165
|
+
return this.#apiClient.cloud.uploadDataPartEnd.mutate({ dataId: uploadData.id, md5, order }, { signal });
|
|
176
166
|
};
|
|
177
167
|
const chunkParts = new Array();
|
|
178
168
|
for (const [index, chunk] of enumerate(chunks(encryptedData, Number(uploadData.partSize)))) {
|
|
@@ -185,7 +175,7 @@ export class SecrecyCloudClient {
|
|
|
185
175
|
const progressParts = {};
|
|
186
176
|
const onProgress = (part, progressEvent) => {
|
|
187
177
|
progressParts[part] = progressEvent;
|
|
188
|
-
const current = Object.values(progressParts).reduce((prv, cur) => prv + cur.
|
|
178
|
+
const current = Object.values(progressParts).reduce((prv, cur) => prv + cur.transferredBytes, 0);
|
|
189
179
|
void uploadProgress?.({
|
|
190
180
|
percent: current / encryptedData.byteLength,
|
|
191
181
|
total: encryptedData.byteLength,
|
|
@@ -201,12 +191,16 @@ export class SecrecyCloudClient {
|
|
|
201
191
|
for (const [key, value] of Object.entries(part.fields)) {
|
|
202
192
|
formData.append(key, value);
|
|
203
193
|
}
|
|
204
|
-
formData.append('file', new Blob([chunk.data], { type: filetype?.mime }), `${uploadData.id}-${chunk.order}`);
|
|
194
|
+
formData.append('file', new Blob([chunk.data.slice(0)], { type: filetype?.mime }), `${uploadData.id}-${chunk.order}`);
|
|
205
195
|
await axios.post(part.url, formData, {
|
|
196
|
+
signal,
|
|
206
197
|
onUploadProgress: (progressEvent) => {
|
|
207
|
-
onProgress(part.order,
|
|
198
|
+
onProgress(part.order, {
|
|
199
|
+
percent: progressEvent.progress ?? 0,
|
|
200
|
+
totalBytes: progressEvent.total ?? 0,
|
|
201
|
+
transferredBytes: progressEvent.loaded ?? 0,
|
|
202
|
+
});
|
|
208
203
|
},
|
|
209
|
-
signal,
|
|
210
204
|
});
|
|
211
205
|
return uploadDataPartEnd(chunk.md5, chunk.order);
|
|
212
206
|
};
|
|
@@ -234,11 +228,7 @@ export class SecrecyCloudClient {
|
|
|
234
228
|
uploadProgress,
|
|
235
229
|
signal,
|
|
236
230
|
});
|
|
237
|
-
return await this.saveInCloud({
|
|
238
|
-
dataId: uploadedData.id,
|
|
239
|
-
name,
|
|
240
|
-
nodeId,
|
|
241
|
-
});
|
|
231
|
+
return await this.saveInCloud({ dataId: uploadedData.id, name, nodeId });
|
|
242
232
|
}
|
|
243
233
|
async deletedNodes() {
|
|
244
234
|
const deletedNodes = await this.#apiClient.cloud.nodesDeleted.query({});
|
|
@@ -249,9 +239,7 @@ export class SecrecyCloudClient {
|
|
|
249
239
|
return await Promise.all(nodesShared.map(async (node) => await apiNodeToExternal(node, this.#keys)));
|
|
250
240
|
}
|
|
251
241
|
async nodesSharedWithMe(type = 'FOLDER') {
|
|
252
|
-
const nodesSharedWithMe = await this.#apiClient.cloud.nodesSharedWithMe.query({
|
|
253
|
-
type,
|
|
254
|
-
});
|
|
242
|
+
const nodesSharedWithMe = await this.#apiClient.cloud.nodesSharedWithMe.query({ type });
|
|
255
243
|
return await Promise.all(nodesSharedWithMe.map(async (node) => await apiNodeToExternal(node, this.#keys)));
|
|
256
244
|
}
|
|
257
245
|
async deleteNodeSharing({ nodeId, userId, }) {
|
|
@@ -285,9 +273,7 @@ export class SecrecyCloudClient {
|
|
|
285
273
|
return isDuplicated;
|
|
286
274
|
}
|
|
287
275
|
async deleteNodeCloudTrash({ ids }) {
|
|
288
|
-
const { isDeleted } = await this.#apiClient.cloud.deleteNodeCloudTrash.mutate({
|
|
289
|
-
ids,
|
|
290
|
-
});
|
|
276
|
+
const { isDeleted } = await this.#apiClient.cloud.deleteNodeCloudTrash.mutate({ ids });
|
|
291
277
|
return isDeleted;
|
|
292
278
|
}
|
|
293
279
|
async createFolder({ name, parentFolderId, }) {
|
|
@@ -318,16 +304,11 @@ export class SecrecyCloudClient {
|
|
|
318
304
|
return folder;
|
|
319
305
|
}
|
|
320
306
|
async node({ id, deleted, } = {}) {
|
|
321
|
-
const node = await this.#apiClient.cloud.nodeFullById.query({
|
|
322
|
-
id,
|
|
323
|
-
deleted,
|
|
324
|
-
});
|
|
307
|
+
const node = await this.#apiClient.cloud.nodeFullById.query({ id, deleted });
|
|
325
308
|
return await apiNodeToExternalNodeFull(node, this.#keys);
|
|
326
309
|
}
|
|
327
310
|
async dataMetadata({ id }) {
|
|
328
|
-
const data = await this.#apiClient.cloud.dataById.query({
|
|
329
|
-
id,
|
|
330
|
-
});
|
|
311
|
+
const data = await this.#apiClient.cloud.dataById.query({ id });
|
|
331
312
|
return apiDataToExternal(data, this.#keys);
|
|
332
313
|
}
|
|
333
314
|
async shareNode(input, progress) {
|
|
@@ -339,11 +320,7 @@ export class SecrecyCloudClient {
|
|
|
339
320
|
const publicKeysMap = await this.#client.app.userPublicKey(neededUserKey);
|
|
340
321
|
const maxNodesBatchSize = 1000;
|
|
341
322
|
const totalNodesToShare = Object.values(nodesMap).reduce((size, ids) => size + ids.length, 0);
|
|
342
|
-
progress?.({
|
|
343
|
-
total: totalNodesToShare,
|
|
344
|
-
current: 0,
|
|
345
|
-
percent: 0,
|
|
346
|
-
});
|
|
323
|
+
progress?.({ total: totalNodesToShare, current: 0, percent: 0 });
|
|
347
324
|
const chunks = totalNodesToShare > maxNodesBatchSize
|
|
348
325
|
? chunkByTotalItems(nodesMap, maxNodesBatchSize)
|
|
349
326
|
: [nodesMap];
|
|
@@ -464,13 +441,7 @@ export class SecrecyCloudClient {
|
|
|
464
441
|
for (const [userId, nodes] of Object.entries(nodesToUpdateRights)) {
|
|
465
442
|
finishInput.push(...nodes.map((node) => ({
|
|
466
443
|
userId,
|
|
467
|
-
nodes: [
|
|
468
|
-
{
|
|
469
|
-
id: node.nodeId,
|
|
470
|
-
data: [],
|
|
471
|
-
...node.permissions,
|
|
472
|
-
},
|
|
473
|
-
],
|
|
444
|
+
nodes: [{ id: node.nodeId, data: [], ...node.permissions }],
|
|
474
445
|
})));
|
|
475
446
|
}
|
|
476
447
|
const subState = await this.#apiClient.cloud.shareNodeFinish.mutate(finishInput);
|
|
@@ -508,10 +479,7 @@ export class SecrecyCloudClient {
|
|
|
508
479
|
const errorDetailsLength = details.invalidRightsAccesses.length +
|
|
509
480
|
details.missingDataAccesses.length +
|
|
510
481
|
details.missingNodeAccesses.length;
|
|
511
|
-
return {
|
|
512
|
-
isFinished: errorDetailsLength === 0,
|
|
513
|
-
details: details,
|
|
514
|
-
};
|
|
482
|
+
return { isFinished: errorDetailsLength === 0, details: details };
|
|
515
483
|
}
|
|
516
484
|
async updateNode({ nodeId, name, isFavorite, deletedAt, }) {
|
|
517
485
|
let node = nodesCache.get(nodeId);
|
|
@@ -594,9 +562,7 @@ export class SecrecyCloudClient {
|
|
|
594
562
|
}));
|
|
595
563
|
}
|
|
596
564
|
async deleteNodes({ nodeIds, }) {
|
|
597
|
-
return this.#apiClient.cloud.deleteNodes.mutate({
|
|
598
|
-
ids: nodeIds,
|
|
599
|
-
});
|
|
565
|
+
return this.#apiClient.cloud.deleteNodes.mutate({ ids: nodeIds });
|
|
600
566
|
}
|
|
601
567
|
async deleteData({ dataId, nodeId, }) {
|
|
602
568
|
const { isDeleted } = await this.#apiClient.cloud.deleteData.mutate({
|
package/dist/lib/client.js
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
import { httpBatchLink, loggerLink,
|
|
2
|
-
import superjson from 'superjson';
|
|
1
|
+
import { httpBatchLink, loggerLink, createTRPCClient as innerCreateTRPCClient, TRPCClientError, } from '@trpc/client';
|
|
3
2
|
import { SECRECY_LIB_VERSION } from './versioning.js';
|
|
3
|
+
import { transformer } from './transformer.js';
|
|
4
4
|
export function isTRPCClientError(cause) {
|
|
5
5
|
return cause instanceof TRPCClientError;
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
isApplicable: (v) => v instanceof Buffer,
|
|
9
|
-
serialize: (v) => [...v],
|
|
10
|
-
deserialize: (v) => Buffer.from(v),
|
|
11
|
-
}, 'buffer');
|
|
12
|
-
export const createTRPCClient = (opts) => createTRPCProxyClient({
|
|
13
|
-
transformer: superjson,
|
|
7
|
+
export const createTRPCClient = (opts) => innerCreateTRPCClient({
|
|
14
8
|
links: [
|
|
15
9
|
loggerLink({
|
|
16
10
|
enabled: (op) => {
|
|
@@ -24,6 +18,7 @@ export const createTRPCClient = (opts) => createTRPCProxyClient({
|
|
|
24
18
|
},
|
|
25
19
|
}),
|
|
26
20
|
httpBatchLink({
|
|
21
|
+
transformer,
|
|
27
22
|
url: opts.apiUrl
|
|
28
23
|
? `${opts.apiUrl}/trpc`
|
|
29
24
|
: 'https://api.secrecy.tech/trpc',
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Temporal } from '@js-temporal/polyfill';
|
|
2
|
+
import superjson from 'superjson';
|
|
3
|
+
superjson.registerCustom({
|
|
4
|
+
isApplicable: (v) => v instanceof Temporal.PlainDate,
|
|
5
|
+
serialize: (v) => v.toJSON(),
|
|
6
|
+
deserialize: (v) => Temporal.PlainDate.from(v),
|
|
7
|
+
}, 'Temporal.PlainDate');
|
|
8
|
+
superjson.registerCustom({
|
|
9
|
+
isApplicable: (v) => v instanceof Temporal.PlainDateTime,
|
|
10
|
+
serialize: (v) => v.toJSON(),
|
|
11
|
+
deserialize: (v) => Temporal.PlainDateTime.from(v),
|
|
12
|
+
}, 'Temporal.PlainDateTime');
|
|
13
|
+
superjson.registerCustom({
|
|
14
|
+
isApplicable: (v) => v instanceof Buffer,
|
|
15
|
+
serialize: (v) => [...v],
|
|
16
|
+
deserialize: (v) => Buffer.from(v),
|
|
17
|
+
}, 'buffer');
|
|
18
|
+
export const transformer = superjson;
|
package/dist/types/cache.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ export declare const dataCache: Map<string, InternalData>;
|
|
|
4
4
|
export declare const nodesCache: Map<string, InternalNode | InternalNodeFull>;
|
|
5
5
|
export declare const nodesEncryptionCache: Map<string, InternalMinimalNodeForEncryption>;
|
|
6
6
|
export declare const usersCache: Map<string, {
|
|
7
|
-
id: string;
|
|
8
|
-
lastname: string;
|
|
9
7
|
firstname: string;
|
|
8
|
+
lastname: string;
|
|
9
|
+
id: string;
|
|
10
10
|
avatar: string | null;
|
|
11
11
|
isSearchable: boolean;
|
|
12
12
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ProgressCallback, SecrecyClient } from '../index.js';
|
|
2
2
|
import type { DataMetadata, DataStorageType, KeyPair, LocalData, Node, NodeFull, NodeType } from './types/index.js';
|
|
3
3
|
import { type RouterInputs, type ApiClient, type RouterOutputs } from '../client.js';
|
|
4
|
-
import { type
|
|
4
|
+
import { type Progress } from '../types.js';
|
|
5
5
|
import { FileTypeResult } from 'file-type';
|
|
6
6
|
export declare class SecrecyCloudClient {
|
|
7
7
|
#private;
|
|
@@ -63,13 +63,13 @@ export declare class SecrecyCloudClient {
|
|
|
63
63
|
}): Promise<NodeFull>;
|
|
64
64
|
dataContent({ dataId, onDownloadProgress, progressDecrypt, signal, }: {
|
|
65
65
|
dataId: string;
|
|
66
|
-
onDownloadProgress?: (progress:
|
|
66
|
+
onDownloadProgress?: (progress: Progress) => void;
|
|
67
67
|
progressDecrypt?: ProgressCallback;
|
|
68
68
|
signal?: AbortSignal;
|
|
69
69
|
}): Promise<LocalData>;
|
|
70
70
|
dataContents({ dataIds, onDownloadProgress, progressDecrypt, signal, }: {
|
|
71
71
|
dataIds: string[];
|
|
72
|
-
onDownloadProgress?: (progress:
|
|
72
|
+
onDownloadProgress?: (progress: Progress) => void;
|
|
73
73
|
progressDecrypt?: ProgressCallback;
|
|
74
74
|
signal?: AbortSignal;
|
|
75
75
|
}): Promise<LocalData[]>;
|
|
@@ -104,22 +104,23 @@ export declare class SecrecyCloudClient {
|
|
|
104
104
|
toType: "s3" | "cold" | "lite";
|
|
105
105
|
}>;
|
|
106
106
|
getPublicDataLink(input: RouterInputs['cloud']['dataLink']): Promise<{
|
|
107
|
-
name: string;
|
|
108
107
|
id: string;
|
|
109
|
-
|
|
110
|
-
expireAt: Date | null;
|
|
108
|
+
name: string;
|
|
111
109
|
slug: string;
|
|
110
|
+
expireAt: Date | null;
|
|
111
|
+
dataId: string;
|
|
112
112
|
}>;
|
|
113
113
|
getPublicDataLinks(input: RouterInputs['cloud']['dataLinks']): Promise<{
|
|
114
|
-
name: string;
|
|
115
114
|
id: string;
|
|
116
|
-
|
|
117
|
-
expireAt: Date | null;
|
|
115
|
+
name: string;
|
|
118
116
|
slug: string;
|
|
117
|
+
expireAt: Date | null;
|
|
118
|
+
dataId: string;
|
|
119
119
|
}[]>;
|
|
120
120
|
checkAccesses(input: RouterInputs['cloud']['checkAccesses']): Promise<{
|
|
121
121
|
isMatching: true;
|
|
122
122
|
} | {
|
|
123
|
+
isMatching: false;
|
|
123
124
|
details: {
|
|
124
125
|
missingNodeAccesses: {
|
|
125
126
|
userId: string;
|
|
@@ -127,52 +128,51 @@ export declare class SecrecyCloudClient {
|
|
|
127
128
|
}[];
|
|
128
129
|
missingDataAccesses: {
|
|
129
130
|
userId: string;
|
|
130
|
-
dataId: string;
|
|
131
131
|
nodeId: string;
|
|
132
|
+
dataId: string;
|
|
132
133
|
}[];
|
|
133
134
|
invalidRightsAccesses: {
|
|
134
135
|
userId: string;
|
|
135
|
-
current: {
|
|
136
|
-
rights: "delete" | "write" | "read";
|
|
137
|
-
} & {
|
|
138
|
-
addAccess?: "delete" | "write" | "read" | null | undefined;
|
|
139
|
-
sharingAddAccess?: "delete" | "write" | "read" | null | undefined;
|
|
140
|
-
delAccess?: "delete" | "write" | "read" | null | undefined;
|
|
141
|
-
sharingDelAccess?: "delete" | "write" | "read" | null | undefined;
|
|
142
|
-
};
|
|
143
136
|
nodeId: string;
|
|
144
137
|
expect: {
|
|
145
|
-
rights: "delete" | "
|
|
138
|
+
rights: "delete" | "read" | "write";
|
|
139
|
+
} & {
|
|
140
|
+
addAccess?: "delete" | "read" | "write" | null | undefined;
|
|
141
|
+
sharingAddAccess?: "delete" | "read" | "write" | null | undefined;
|
|
142
|
+
delAccess?: "delete" | "read" | "write" | null | undefined;
|
|
143
|
+
sharingDelAccess?: "delete" | "read" | "write" | null | undefined;
|
|
144
|
+
};
|
|
145
|
+
current: {
|
|
146
|
+
rights: "delete" | "read" | "write";
|
|
146
147
|
} & {
|
|
147
|
-
addAccess?: "delete" | "
|
|
148
|
-
sharingAddAccess?: "delete" | "
|
|
149
|
-
delAccess?: "delete" | "
|
|
150
|
-
sharingDelAccess?: "delete" | "
|
|
148
|
+
addAccess?: "delete" | "read" | "write" | null | undefined;
|
|
149
|
+
sharingAddAccess?: "delete" | "read" | "write" | null | undefined;
|
|
150
|
+
delAccess?: "delete" | "read" | "write" | null | undefined;
|
|
151
|
+
sharingDelAccess?: "delete" | "read" | "write" | null | undefined;
|
|
151
152
|
};
|
|
152
153
|
}[];
|
|
153
154
|
};
|
|
154
|
-
isMatching: false;
|
|
155
155
|
}>;
|
|
156
156
|
createPublicDataLink(input: RouterInputs['cloud']['createDataLink']): Promise<{
|
|
157
|
-
name: string;
|
|
158
157
|
id: string;
|
|
159
|
-
|
|
160
|
-
expireAt: Date | null;
|
|
158
|
+
name: string;
|
|
161
159
|
slug: string;
|
|
160
|
+
expireAt: Date | null;
|
|
161
|
+
dataId: string;
|
|
162
162
|
}>;
|
|
163
163
|
updatePublicDataLink(input: RouterInputs['cloud']['updateDataLink']): Promise<{
|
|
164
|
-
name: string;
|
|
165
164
|
id: string;
|
|
166
|
-
|
|
167
|
-
expireAt: Date | null;
|
|
165
|
+
name: string;
|
|
168
166
|
slug: string;
|
|
167
|
+
expireAt: Date | null;
|
|
168
|
+
dataId: string;
|
|
169
169
|
}>;
|
|
170
170
|
deletePublicDataLink(input: RouterInputs['cloud']['deleteDataLink']): Promise<{
|
|
171
|
-
name: string;
|
|
172
171
|
id: string;
|
|
173
|
-
|
|
174
|
-
expireAt: Date | null;
|
|
172
|
+
name: string;
|
|
175
173
|
slug: string;
|
|
174
|
+
expireAt: Date | null;
|
|
175
|
+
dataId: string;
|
|
176
176
|
}>;
|
|
177
177
|
private _handleDataContent;
|
|
178
178
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseClient, type SecrecyUrls } from '../base-client.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SecretStreamProgress } from '../crypto/data.js';
|
|
3
3
|
import { SecrecyCloudClient } from './SecrecyCloudClient.js';
|
|
4
4
|
import { SecrecyMailClient } from './SecrecyMailClient.js';
|
|
5
5
|
import { SecrecyAppClient } from './SecrecyAppClient.js';
|
|
@@ -11,7 +11,7 @@ import { type KeyPair } from './types/index.js';
|
|
|
11
11
|
import { SecrecyUserClient } from './SecrecyUserClient.js';
|
|
12
12
|
import { SecrecyPseudonymClient } from './SecrecyPseudonymClient.js';
|
|
13
13
|
export type NewMail = Pick<RouterInputs['mail']['createDraft'], 'body' | 'subject' | 'senderFiles' | 'recipients' | 'replyToId'>;
|
|
14
|
-
export type ProgressCallback = (progress:
|
|
14
|
+
export type ProgressCallback = (progress: SecretStreamProgress) => Promise<void>;
|
|
15
15
|
export interface SecrecyClientOptions {
|
|
16
16
|
uaSession: string;
|
|
17
17
|
uaKeys: KeyPair;
|
|
@@ -7,40 +7,14 @@ export type * from './user.js';
|
|
|
7
7
|
declare const keyPair: z.ZodObject<{
|
|
8
8
|
publicKey: z.ZodString;
|
|
9
9
|
privateKey: z.ZodString;
|
|
10
|
-
},
|
|
11
|
-
publicKey: string;
|
|
12
|
-
privateKey: string;
|
|
13
|
-
}, {
|
|
14
|
-
publicKey: string;
|
|
15
|
-
privateKey: string;
|
|
16
|
-
}>;
|
|
10
|
+
}, z.core.$strict>;
|
|
17
11
|
export type KeyPair = z.infer<typeof keyPair>;
|
|
18
12
|
export declare const secrecyUserApp: z.ZodReadonly<z.ZodObject<{
|
|
19
13
|
keys: z.ZodObject<{
|
|
20
14
|
publicKey: z.ZodString;
|
|
21
15
|
privateKey: z.ZodString;
|
|
22
|
-
},
|
|
23
|
-
publicKey: string;
|
|
24
|
-
privateKey: string;
|
|
25
|
-
}, {
|
|
26
|
-
publicKey: string;
|
|
27
|
-
privateKey: string;
|
|
28
|
-
}>;
|
|
16
|
+
}, z.core.$strict>;
|
|
29
17
|
jwt: z.ZodString;
|
|
30
18
|
uaSession: z.ZodString;
|
|
31
|
-
},
|
|
32
|
-
keys: {
|
|
33
|
-
publicKey: string;
|
|
34
|
-
privateKey: string;
|
|
35
|
-
};
|
|
36
|
-
jwt: string;
|
|
37
|
-
uaSession: string;
|
|
38
|
-
}, {
|
|
39
|
-
keys: {
|
|
40
|
-
publicKey: string;
|
|
41
|
-
privateKey: string;
|
|
42
|
-
};
|
|
43
|
-
jwt: string;
|
|
44
|
-
uaSession: string;
|
|
45
|
-
}>>;
|
|
19
|
+
}, z.core.$strict>>;
|
|
46
20
|
export type SecrecyUserApp = z.infer<typeof secrecyUserApp>;
|