@secrecy/lib 1.0.0-dev.6 → 1.0.0-dev.61
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/README.md +1 -1
- package/dist/BaseClient.d.ts +123 -0
- package/dist/BaseClient.js +569 -0
- package/{lib → dist}/PopupTools.d.ts +1 -1
- package/dist/PopupTools.js +221 -0
- package/{lib → dist}/ZeusThunder.d.ts +0 -0
- package/dist/ZeusThunder.js +79 -0
- package/dist/cache.d.ts +6 -0
- package/dist/cache.js +4 -0
- package/dist/client/SecrecyAppClient.d.ts +17 -0
- package/dist/client/SecrecyAppClient.js +256 -0
- package/dist/client/SecrecyCloudClient.d.ts +89 -0
- package/dist/client/SecrecyCloudClient.js +1627 -0
- package/dist/client/SecrecyDbClient.d.ts +21 -0
- package/dist/client/SecrecyDbClient.js +198 -0
- package/dist/client/SecrecyMailClient.d.ts +42 -0
- package/dist/client/SecrecyMailClient.js +1187 -0
- package/dist/client/SecrecyPayClient.d.ts +7 -0
- package/dist/client/SecrecyPayClient.js +37 -0
- package/dist/client/SecrecyWalletClient.d.ts +30 -0
- package/dist/client/SecrecyWalletClient.js +76 -0
- package/{lib → dist}/client/convert/file.d.ts +3 -3
- package/dist/client/convert/file.js +34 -0
- package/dist/client/convert/mail.d.ts +3 -0
- package/dist/client/convert/mail.js +48 -0
- package/dist/client/convert/node.d.ts +9 -0
- package/dist/client/convert/node.js +100 -0
- package/{lib → dist}/client/helpers.d.ts +6 -1
- package/dist/client/helpers.js +126 -0
- package/dist/client/index.d.ts +34 -0
- package/dist/client/index.js +52 -0
- package/{lib → dist}/client/storage.d.ts +0 -0
- package/dist/client/storage.js +12 -0
- package/dist/client/types/File.d.ts +14 -0
- package/dist/client/types/File.js +3 -0
- package/{lib → dist}/client/types/Inputs.d.ts +2 -7
- package/dist/client/types/Inputs.js +3 -0
- package/dist/client/types/Node.d.ts +56 -0
- package/dist/client/types/Node.js +3 -0
- package/dist/client/types/UserAppNotifications.d.ts +6 -0
- package/dist/client/types/UserAppNotifications.js +3 -0
- package/{lib → dist}/client/types/UserAppSettings.d.ts +1 -3
- package/dist/client/types/UserAppSettings.js +3 -0
- package/{lib → dist}/client/types/index.d.ts +10 -43
- package/dist/client/types/index.js +8 -0
- package/dist/client/types/selectors.d.ts +400 -0
- package/dist/client/types/selectors.js +138 -0
- package/{lib → dist}/crypto/file.d.ts +0 -0
- package/dist/crypto/file.js +210 -0
- package/{lib → dist}/crypto/index.d.ts +0 -0
- package/dist/crypto/index.js +47 -0
- package/dist/error.d.ts +30 -0
- package/dist/error.js +3 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +9 -0
- package/{lib → dist}/minify/index.d.ts +0 -0
- package/dist/minify/index.js +28 -0
- package/{lib → dist}/minify/lz4.d.ts +0 -0
- package/dist/minify/lz4.js +627 -0
- package/{lib → dist}/sodium.d.ts +0 -0
- package/dist/sodium.js +6 -0
- package/{lib → dist}/utils/store-buddy.d.ts +0 -0
- package/dist/utils/store-buddy.js +65 -0
- package/{lib → dist}/utils/time.d.ts +0 -0
- package/dist/utils/time.js +14 -0
- package/{lib → dist/utils}/utils.d.ts +0 -0
- package/dist/utils/utils.js +57 -0
- package/{lib → dist}/worker/md5.d.ts +0 -0
- package/dist/worker/md5.js +25 -0
- package/{lib → dist}/worker/sodium.d.ts +0 -0
- package/dist/worker/sodium.js +120 -0
- package/{lib → dist}/worker/workerCodes.d.ts +0 -0
- package/dist/worker/workerCodes.js +255 -0
- package/{lib → dist}/zeus/const.d.ts +5 -0
- package/dist/zeus/const.js +1286 -0
- package/dist/zeus/index.d.ts +6119 -0
- package/dist/zeus/index.js +687 -0
- package/package.json +60 -52
- package/lib/BaseClient.d.ts +0 -266
- package/lib/BaseClient.js +0 -1332
- package/lib/PopupTools.js +0 -213
- package/lib/ZeusThunder.js +0 -112
- package/lib/cache.d.ts +0 -7
- package/lib/cache.js +0 -5
- package/lib/client/convert/file.js +0 -39
- package/lib/client/convert/folder.d.ts +0 -8
- package/lib/client/convert/folder.js +0 -264
- package/lib/client/convert/mail.d.ts +0 -3
- package/lib/client/convert/mail.js +0 -46
- package/lib/client/convert/vFile.d.ts +0 -5
- package/lib/client/convert/vFile.js +0 -164
- package/lib/client/helpers.js +0 -116
- package/lib/client/index.d.ts +0 -166
- package/lib/client/index.js +0 -3697
- package/lib/client/storage.js +0 -12
- package/lib/client/types/File.d.ts +0 -21
- package/lib/client/types/File.js +0 -2
- package/lib/client/types/FilesOnUsersOnApplications.d.ts +0 -9
- package/lib/client/types/FilesOnUsersOnApplications.js +0 -2
- package/lib/client/types/Folder.d.ts +0 -68
- package/lib/client/types/Folder.js +0 -7
- package/lib/client/types/Inputs.js +0 -2
- package/lib/client/types/UserAppSettings.js +0 -2
- package/lib/client/types/VFile.d.ts +0 -62
- package/lib/client/types/VFile.js +0 -4
- package/lib/client/types/index.js +0 -8
- package/lib/client/types/queries.d.ts +0 -535
- package/lib/client/types/queries.js +0 -192
- package/lib/crypto/file.js +0 -291
- package/lib/crypto/index.js +0 -37
- package/lib/index.d.ts +0 -11
- package/lib/index.js +0 -40
- package/lib/minify/index.js +0 -28
- package/lib/minify/lz4.js +0 -633
- package/lib/sodium.js +0 -28
- package/lib/utils/store-buddy.js +0 -69
- package/lib/utils/time.js +0 -22
- package/lib/utils.js +0 -188
- package/lib/worker/__mock__/sodium.worker.d.ts +0 -19
- package/lib/worker/__mock__/sodium.worker.js +0 -57
- package/lib/worker/md5.js +0 -43
- package/lib/worker/sodium.js +0 -155
- package/lib/worker/workerCodes.js +0 -3
- package/lib/zeus/const.js +0 -1609
- package/lib/zeus/index.d.ts +0 -26113
- package/lib/zeus/index.js +0 -552
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
# Anonymize Secrecy Library
|
|
1
|
+
# Anonymize Secrecy Library 📚🔐
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { DownloadProgress as DLProgress } from "ky";
|
|
2
|
+
import type { SecrecyEnv } from "./client/helpers.js";
|
|
3
|
+
import type { Lang, Thunder, UserRole } from "./zeus/index.js";
|
|
4
|
+
import { InfuraNetwork } from "./zeus/index.js";
|
|
5
|
+
import type { ErrorAccessDenied, ErrorLimit, ErrorNotFound, ErrorNotExist } from "./error.js";
|
|
6
|
+
export declare type SuccessResponse<T> = {
|
|
7
|
+
__typename: "SuccessResponse";
|
|
8
|
+
data: T;
|
|
9
|
+
};
|
|
10
|
+
export declare type DownloadProgress = DLProgress;
|
|
11
|
+
export declare type SendReport = {
|
|
12
|
+
id: string;
|
|
13
|
+
user: {
|
|
14
|
+
id: string;
|
|
15
|
+
firstname: string;
|
|
16
|
+
lastname: string;
|
|
17
|
+
email: string;
|
|
18
|
+
};
|
|
19
|
+
reportedUser: {
|
|
20
|
+
id: string;
|
|
21
|
+
firstname: string;
|
|
22
|
+
lastname: string;
|
|
23
|
+
email: string;
|
|
24
|
+
};
|
|
25
|
+
customMessage?: string | undefined;
|
|
26
|
+
};
|
|
27
|
+
export declare type UserData<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
28
|
+
isSuperuser: boolean;
|
|
29
|
+
isSearchable: boolean;
|
|
30
|
+
} & T;
|
|
31
|
+
export declare type AppDBConfigField = {
|
|
32
|
+
name: string;
|
|
33
|
+
type: "string" | "number" | "boolean" | "object";
|
|
34
|
+
isArray?: boolean | undefined;
|
|
35
|
+
isNullable?: boolean | undefined;
|
|
36
|
+
isEditable?: boolean | undefined;
|
|
37
|
+
isKey?: boolean | undefined;
|
|
38
|
+
default?: unknown;
|
|
39
|
+
};
|
|
40
|
+
export declare type AppDBConfig = {
|
|
41
|
+
fields: AppDBConfigField[];
|
|
42
|
+
};
|
|
43
|
+
export declare type UserBase = {
|
|
44
|
+
email: string;
|
|
45
|
+
phone: string;
|
|
46
|
+
lastname: string;
|
|
47
|
+
role: UserRole;
|
|
48
|
+
firstname: string;
|
|
49
|
+
id: string;
|
|
50
|
+
deletedAt?: Date;
|
|
51
|
+
lastLogin: Date;
|
|
52
|
+
lang: Lang;
|
|
53
|
+
};
|
|
54
|
+
declare type WithPublicKey = {
|
|
55
|
+
withPublicKey?: boolean;
|
|
56
|
+
};
|
|
57
|
+
export declare type User<T extends WithPublicKey = WithPublicKey> = T extends {
|
|
58
|
+
withPublicKey: true;
|
|
59
|
+
} ? UserBase & {
|
|
60
|
+
publicKey: string;
|
|
61
|
+
} : UserBase;
|
|
62
|
+
declare type ClassGetUserParams = WithPublicKey & {
|
|
63
|
+
userId?: string;
|
|
64
|
+
userEmail?: string;
|
|
65
|
+
};
|
|
66
|
+
declare type StaticGetUserParams = ClassGetUserParams & {
|
|
67
|
+
env: SecrecyEnv;
|
|
68
|
+
};
|
|
69
|
+
export declare type CloudLimits = {
|
|
70
|
+
count: bigint;
|
|
71
|
+
maxCount?: bigint | undefined;
|
|
72
|
+
size: bigint;
|
|
73
|
+
maxSize?: bigint | undefined;
|
|
74
|
+
};
|
|
75
|
+
export declare type MailLimitsValues = {
|
|
76
|
+
count: bigint;
|
|
77
|
+
maxCount?: bigint | undefined;
|
|
78
|
+
fileSize: bigint;
|
|
79
|
+
maxFileSize?: bigint | undefined;
|
|
80
|
+
fileCount: bigint;
|
|
81
|
+
maxFileCount?: bigint | undefined;
|
|
82
|
+
};
|
|
83
|
+
export declare type QueryLimits = {
|
|
84
|
+
cloud: CloudLimits;
|
|
85
|
+
mail: {
|
|
86
|
+
sent: MailLimitsValues;
|
|
87
|
+
received: MailLimitsValues;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
export declare class BaseClient {
|
|
91
|
+
static readonly getBaseUrl: (env?: SecrecyEnv, graphcdn?: boolean) => string;
|
|
92
|
+
static readonly getBaseClient: (env: SecrecyEnv, session?: string | null | undefined) => ReturnType<typeof Thunder>;
|
|
93
|
+
protected thunder: ReturnType<typeof Thunder>;
|
|
94
|
+
sessionId: string;
|
|
95
|
+
constructor(session: string, env: SecrecyEnv);
|
|
96
|
+
logout(sessionId?: string | null | undefined): Promise<void>;
|
|
97
|
+
me<T extends WithPublicKey = WithPublicKey>(params?: T): Promise<SuccessResponse<User<T>> | ErrorNotFound | null>;
|
|
98
|
+
static user<T extends StaticGetUserParams>(params: T, sessionId?: string | null | undefined): Promise<SuccessResponse<User<T>> | ErrorNotFound | null>;
|
|
99
|
+
user<T extends ClassGetUserParams>(params: T): Promise<SuccessResponse<User<T>> | ErrorNotFound | null>;
|
|
100
|
+
updateProfile({ firstname, lastname, lang }: {
|
|
101
|
+
firstname: string | null;
|
|
102
|
+
lastname: string | null;
|
|
103
|
+
lang: Lang | null;
|
|
104
|
+
}): Promise<SuccessResponse<User> | ErrorNotFound | ErrorAccessDenied | null>;
|
|
105
|
+
static isCryptoTransactionDone({ env, idOrHash, network }: {
|
|
106
|
+
env: SecrecyEnv;
|
|
107
|
+
idOrHash: string;
|
|
108
|
+
network?: InfuraNetwork;
|
|
109
|
+
}): Promise<boolean>;
|
|
110
|
+
limits(): Promise<SuccessResponse<QueryLimits> | ErrorAccessDenied | ErrorNotExist | ErrorLimit | ErrorNotFound | null>;
|
|
111
|
+
static updateAppDBConfig({ appCode, config, env, sessionId }: {
|
|
112
|
+
appCode: string;
|
|
113
|
+
config: AppDBConfig;
|
|
114
|
+
env: SecrecyEnv;
|
|
115
|
+
sessionId?: string | null | undefined;
|
|
116
|
+
}): Promise<SuccessResponse<AppDBConfig> | ErrorAccessDenied | null>;
|
|
117
|
+
static getAppDBConfig(appCode: string, env: SecrecyEnv, sessionId?: string | null | undefined): Promise<SuccessResponse<AppDBConfig> | ErrorAccessDenied | ErrorNotFound | ErrorNotExist | null>;
|
|
118
|
+
reportUser(reportedUserId: string, customMessage?: string): Promise<SuccessResponse<SendReport> | ErrorAccessDenied | ErrorNotFound | null>;
|
|
119
|
+
getSponsorshipLink({ backUrl }: {
|
|
120
|
+
backUrl: string;
|
|
121
|
+
}): Promise<string | null>;
|
|
122
|
+
}
|
|
123
|
+
export {};
|