@secrecy/lib 1.74.0-feat-transfer-adaptations.2 → 1.74.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/base-client.js
CHANGED
|
@@ -58,7 +58,7 @@ export class BaseClient {
|
|
|
58
58
|
this.sessionId !== this.#me.sessionId ||
|
|
59
59
|
Date.now() - this.#me.fetchedAt > 5 * 60 * 1000) {
|
|
60
60
|
const data = await this.client.user.self.query({
|
|
61
|
-
|
|
61
|
+
t: Date.now(),
|
|
62
62
|
});
|
|
63
63
|
this.#me = {
|
|
64
64
|
data,
|
|
@@ -35,9 +35,6 @@ export function getSecrecyClient(opts = {}) {
|
|
|
35
35
|
const uaKeys = storage.userAppKeys.load();
|
|
36
36
|
const uaJwt = storage.jwt.load();
|
|
37
37
|
if (uaSession && uaKeys && uaJwt) {
|
|
38
|
-
storage.userAppKeys.save(uaKeys);
|
|
39
|
-
storage.userAppSession.save(uaSession);
|
|
40
|
-
storage.jwt.save(uaJwt);
|
|
41
38
|
return new SecrecyClient({
|
|
42
39
|
uaSession,
|
|
43
40
|
uaKeys,
|
|
@@ -50,7 +47,7 @@ export function getSecrecyClient(opts = {}) {
|
|
|
50
47
|
export async function login({ appId, context, path, redirect, scopes, backPath, session, secrecyUrls, }) {
|
|
51
48
|
return await new Promise(async (resolve, reject) => {
|
|
52
49
|
const appUrl = window.location.origin;
|
|
53
|
-
const client = getSecrecyClient({ secrecyUrls });
|
|
50
|
+
const client = getSecrecyClient({ session, secrecyUrls });
|
|
54
51
|
const innerLogin = () => {
|
|
55
52
|
const infos = {
|
|
56
53
|
appUrl,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { ProgressCallback, SecrecyClient } from '../index.js';
|
|
1
|
+
import type { ProgressCallback, SecrecyClient, UploadDataOptions } 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
4
|
import { type Progress } from '../types.js';
|
|
5
|
-
import { FileTypeResult } from 'file-type';
|
|
6
5
|
import { DownloadDataFromLinkOptions } from './data-link.js';
|
|
7
6
|
export declare class SecrecyCloudClient {
|
|
8
7
|
#private;
|
|
@@ -11,16 +10,7 @@ export declare class SecrecyCloudClient {
|
|
|
11
10
|
dataId: string;
|
|
12
11
|
nodeId: string;
|
|
13
12
|
}): Promise<NodeFull>;
|
|
14
|
-
uploadData(opts: {
|
|
15
|
-
storageType: DataStorageType;
|
|
16
|
-
data: globalThis.File | Uint8Array<ArrayBuffer>;
|
|
17
|
-
password?: string;
|
|
18
|
-
encrypted?: boolean;
|
|
19
|
-
encryptProgress?: ProgressCallback;
|
|
20
|
-
uploadProgress?: ProgressCallback;
|
|
21
|
-
signal?: AbortSignal;
|
|
22
|
-
meta?: FileTypeResult | true;
|
|
23
|
-
}): Promise<LocalData & {
|
|
13
|
+
uploadData(opts: UploadDataOptions): Promise<LocalData & {
|
|
24
14
|
sharing: {
|
|
25
15
|
password: string;
|
|
26
16
|
encryptedDataKey: string;
|
|
@@ -12,11 +12,11 @@ export type UploadDataOptions = {
|
|
|
12
12
|
uploadProgress?: ProgressCallback;
|
|
13
13
|
signal?: AbortSignal;
|
|
14
14
|
meta?: FileTypeResult | true;
|
|
15
|
+
forcePassword?: boolean;
|
|
15
16
|
};
|
|
16
17
|
export declare function uploadData({ storageType, data, password, forcePassword, encrypted, encryptProgress, uploadProgress, signal, meta, keyPair, apiClient, }: UploadDataOptions & {
|
|
17
18
|
keyPair?: KeyPair;
|
|
18
19
|
apiClient?: ApiClient;
|
|
19
|
-
forcePassword?: boolean;
|
|
20
20
|
}): Promise<LocalData & {
|
|
21
21
|
sharing: {
|
|
22
22
|
password: string;
|
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.74.
|
|
5
|
+
"version": "1.74.1",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/anonymize-org/lib.git"
|