@secrecy/lib 1.74.7 → 1.74.8
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/package.json +1 -1
- package/dist/lib/test.js +0 -47
- package/dist/types/test.d.ts +0 -1
package/package.json
CHANGED
package/dist/lib/test.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { getTrpcGuestClient } from './client';
|
|
2
|
-
import { downloadDataFromLink } from './client/data-link';
|
|
3
|
-
import { createPublicDataLink, uploadData } from './client/upload';
|
|
4
|
-
import { setup } from './sodium';
|
|
5
|
-
await setup();
|
|
6
|
-
// const keyPair = {
|
|
7
|
-
// publicKey: '71469f1d931849dab91e8a62bee6c1f442a3f5f64323d14ee0d6ce5200a0640a',
|
|
8
|
-
// privateKey:
|
|
9
|
-
// '427b28fe3835956af5bb457db59884251f19f1228101f336934aff99375dfedc',
|
|
10
|
-
// }
|
|
11
|
-
// const client = createTRPCClient({
|
|
12
|
-
// apiUrl: 'http://localhost:3000/api',
|
|
13
|
-
// session: 'e34db69c7057d2143dab8b0b5054806796818c7da976d8e8275dd017920c3377',
|
|
14
|
-
// })
|
|
15
|
-
const keyPair = undefined;
|
|
16
|
-
const client = getTrpcGuestClient({ url: 'http://localhost:3000/api' });
|
|
17
|
-
const buffer = Buffer.from('10000randomflkhsdjkfhsdfjh');
|
|
18
|
-
console.log({ buffer, strbuff: buffer.toString() });
|
|
19
|
-
const uploaded = await uploadData({
|
|
20
|
-
data: buffer,
|
|
21
|
-
storageType: 's3',
|
|
22
|
-
encrypted: true,
|
|
23
|
-
apiClient: client,
|
|
24
|
-
keyPair,
|
|
25
|
-
password: 'mot-de-passe',
|
|
26
|
-
// forcePassword: true,
|
|
27
|
-
});
|
|
28
|
-
console.dir({ uploaded });
|
|
29
|
-
const link = await createPublicDataLink({
|
|
30
|
-
dataId: uploaded.id,
|
|
31
|
-
expireAt: new Date(Date.now() + 1000 * 60 * 60 * 1),
|
|
32
|
-
name: 'Public test',
|
|
33
|
-
apiClient: client,
|
|
34
|
-
});
|
|
35
|
-
console.dir({ link });
|
|
36
|
-
// - downloadDataFromLink ajouter client auth
|
|
37
|
-
const data = await downloadDataFromLink({
|
|
38
|
-
dataUrl: 'http://localhost:3000/data',
|
|
39
|
-
dataLinkSlug: link.slug,
|
|
40
|
-
crypto: uploaded.sharing
|
|
41
|
-
? {
|
|
42
|
-
key: uploaded.sharing.encryptedDataKey,
|
|
43
|
-
password: uploaded.sharing.password,
|
|
44
|
-
}
|
|
45
|
-
: undefined,
|
|
46
|
-
});
|
|
47
|
-
console.dir({ data, txt: Buffer.from(data).toString() });
|
package/dist/types/test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|