@secrecy/lib 1.0.0-dev.9 → 1.0.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/LICENSE +1 -1
- package/README.md +1 -1
- package/dist/BaseClient.d.ts +111 -0
- package/dist/BaseClient.js +506 -0
- package/{lib → dist}/PopupTools.d.ts +4 -4
- package/dist/PopupTools.js +195 -0
- package/{lib → dist}/ZeusThunder.d.ts +0 -0
- package/dist/ZeusThunder.js +65 -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 +226 -0
- package/dist/client/SecrecyCloudClient.d.ts +89 -0
- package/dist/client/SecrecyCloudClient.js +1405 -0
- package/dist/client/SecrecyDbClient.d.ts +21 -0
- package/dist/client/SecrecyDbClient.js +177 -0
- package/dist/client/SecrecyMailClient.d.ts +42 -0
- package/dist/client/SecrecyMailClient.js +1022 -0
- package/dist/client/SecrecyPayClient.d.ts +28 -0
- package/dist/client/SecrecyPayClient.js +68 -0
- package/dist/client/SecrecyWalletClient.d.ts +30 -0
- package/dist/client/SecrecyWalletClient.js +73 -0
- package/{lib → dist}/client/convert/file.d.ts +3 -3
- package/dist/client/convert/file.js +33 -0
- package/dist/client/convert/mail.d.ts +3 -0
- package/dist/client/convert/mail.js +42 -0
- package/dist/client/convert/node.d.ts +9 -0
- package/dist/client/convert/node.js +87 -0
- package/{lib → dist}/client/helpers.d.ts +9 -4
- package/dist/client/helpers.js +119 -0
- package/dist/client/index.d.ts +34 -0
- package/dist/client/index.js +46 -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/dist/client/types/Inputs.d.ts +16 -0
- 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/dist/client/types/UserAppSettings.d.ts +5 -0
- package/dist/client/types/UserAppSettings.js +3 -0
- package/{lib → dist}/client/types/index.d.ts +25 -59
- package/dist/client/types/index.js +8 -0
- package/dist/client/types/selectors.d.ts +400 -0
- package/dist/client/types/selectors.js +135 -0
- package/{lib → dist}/crypto/file.d.ts +2 -2
- package/dist/crypto/file.js +195 -0
- package/{lib → dist}/crypto/index.d.ts +0 -0
- package/dist/crypto/index.js +45 -0
- package/dist/error.d.ts +33 -0
- package/dist/error.js +3 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +10 -0
- package/{lib → dist}/minify/index.d.ts +0 -0
- package/dist/minify/index.js +23 -0
- package/{lib → dist}/minify/lz4.d.ts +0 -0
- package/dist/minify/lz4.js +539 -0
- package/{lib → dist}/sodium.d.ts +0 -0
- package/dist/sodium.js +6 -0
- package/{lib → dist}/utils/store-buddy.d.ts +1 -1
- package/dist/utils/store-buddy.js +58 -0
- package/{lib → dist}/utils/time.d.ts +0 -0
- package/dist/utils/time.js +12 -0
- package/{lib → dist/utils}/utils.d.ts +0 -0
- package/dist/utils/utils.js +47 -0
- package/{lib → dist}/worker/md5.d.ts +0 -0
- package/dist/worker/md5.js +24 -0
- package/{lib → dist}/worker/sodium.d.ts +0 -0
- package/dist/worker/sodium.js +118 -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 +1679 -0
- package/dist/zeus/index.d.ts +7941 -0
- package/dist/zeus/index.js +599 -0
- package/package.json +64 -54
- package/lib/BaseClient.d.ts +0 -266
- package/lib/BaseClient.js +0 -1332
- package/lib/PopupTools.js +0 -213
- package/lib/ZeusThunder.js +0 -115
- package/lib/cache.d.ts +0 -7
- package/lib/cache.js +0 -5
- package/lib/client/admin/index.d.ts +0 -10
- package/lib/client/admin/index.js +0 -145
- 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 -169
- package/lib/client/index.js +0 -3803
- 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.d.ts +0 -21
- package/lib/client/types/Inputs.js +0 -2
- package/lib/client/types/UserAppNotifications.d.ts +0 -6
- package/lib/client/types/UserAppNotifications.js +0 -2
- package/lib/client/types/UserAppSettings.d.ts +0 -7
- 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 -9
- 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 -12
- package/lib/index.js +0 -41
- 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 -1671
- package/lib/zeus/index.d.ts +0 -33302
- package/lib/zeus/index.js +0 -558
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
# Anonymize Secrecy Library
|
|
1
|
+
# Anonymize Secrecy Library 📚🔐
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { DownloadProgress as DLProgress } from "ky";
|
|
2
|
+
import type { SecrecyEnv } from "./client/helpers.js";
|
|
3
|
+
import type { GraphQLTypes, 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 type SuccessResponse<T> = {
|
|
7
|
+
__typename: "SuccessResponse";
|
|
8
|
+
data: T;
|
|
9
|
+
};
|
|
10
|
+
export type DownloadProgress = DLProgress;
|
|
11
|
+
export 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 type UserData<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
28
|
+
isSuperuser: boolean;
|
|
29
|
+
isSearchable: boolean;
|
|
30
|
+
} & T;
|
|
31
|
+
export type UserBase = {
|
|
32
|
+
email: string;
|
|
33
|
+
phone: string;
|
|
34
|
+
lastname: string;
|
|
35
|
+
role: UserRole;
|
|
36
|
+
firstname: string;
|
|
37
|
+
id: string;
|
|
38
|
+
deletedAt?: Date;
|
|
39
|
+
lastLogin: Date;
|
|
40
|
+
lang: Lang;
|
|
41
|
+
};
|
|
42
|
+
type WithPublicKey = {
|
|
43
|
+
withPublicKey?: boolean;
|
|
44
|
+
};
|
|
45
|
+
export type User<T extends WithPublicKey = WithPublicKey> = T extends {
|
|
46
|
+
withPublicKey: true;
|
|
47
|
+
} ? UserBase & {
|
|
48
|
+
publicKey: string;
|
|
49
|
+
} : UserBase;
|
|
50
|
+
type ClassGetUserParams = WithPublicKey & {
|
|
51
|
+
userId?: string;
|
|
52
|
+
userEmail?: string;
|
|
53
|
+
};
|
|
54
|
+
type StaticGetUserParams = ClassGetUserParams & {
|
|
55
|
+
env: SecrecyEnv;
|
|
56
|
+
};
|
|
57
|
+
export type CloudLimits = {
|
|
58
|
+
count: bigint;
|
|
59
|
+
maxCount?: bigint | undefined;
|
|
60
|
+
size: bigint;
|
|
61
|
+
maxSize?: bigint | undefined;
|
|
62
|
+
};
|
|
63
|
+
export type MailLimitsValues = {
|
|
64
|
+
count: bigint;
|
|
65
|
+
maxCount?: bigint | undefined;
|
|
66
|
+
fileSize: bigint;
|
|
67
|
+
maxFileSize?: bigint | undefined;
|
|
68
|
+
fileCount: bigint;
|
|
69
|
+
maxFileCount?: bigint | undefined;
|
|
70
|
+
};
|
|
71
|
+
export type QueryLimits = {
|
|
72
|
+
cloud: CloudLimits;
|
|
73
|
+
mail: {
|
|
74
|
+
sent: MailLimitsValues;
|
|
75
|
+
received: MailLimitsValues;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
export declare class BaseClient {
|
|
79
|
+
static readonly getBaseUrl: (env?: SecrecyEnv, graphcdn?: boolean) => string;
|
|
80
|
+
static readonly getBaseClient: (env: SecrecyEnv, session?: string | null | undefined) => ReturnType<typeof Thunder>;
|
|
81
|
+
protected thunder: ReturnType<typeof Thunder>;
|
|
82
|
+
sessionId: string;
|
|
83
|
+
constructor(session: string, env: SecrecyEnv);
|
|
84
|
+
logout(sessionId?: string | null | undefined): Promise<void>;
|
|
85
|
+
me<T extends WithPublicKey = WithPublicKey>(params?: T): Promise<SuccessResponse<User<T>> | ErrorNotFound | null>;
|
|
86
|
+
static user<T extends StaticGetUserParams>(params: T, sessionId?: string | null | undefined): Promise<SuccessResponse<User<T>> | ErrorNotFound | null>;
|
|
87
|
+
user<T extends ClassGetUserParams>(params: T): Promise<SuccessResponse<User<T>> | ErrorNotFound | null>;
|
|
88
|
+
updateProfile({ firstname, lastname, lang }: {
|
|
89
|
+
firstname: string | null;
|
|
90
|
+
lastname: string | null;
|
|
91
|
+
lang: Lang | null;
|
|
92
|
+
}): Promise<SuccessResponse<User> | ErrorNotFound | ErrorAccessDenied | null>;
|
|
93
|
+
static isCryptoTransactionDone({ env, idOrHash, network }: {
|
|
94
|
+
env: SecrecyEnv;
|
|
95
|
+
idOrHash: string;
|
|
96
|
+
network?: InfuraNetwork;
|
|
97
|
+
}): Promise<boolean>;
|
|
98
|
+
limits(): Promise<SuccessResponse<QueryLimits> | ErrorAccessDenied | ErrorNotExist | ErrorLimit | ErrorNotFound | null>;
|
|
99
|
+
reportUser(reportedUserId: string, customMessage?: string): Promise<SuccessResponse<SendReport> | ErrorAccessDenied | ErrorNotFound | null>;
|
|
100
|
+
getSponsorshipLink({ backUrl }: {
|
|
101
|
+
backUrl: string;
|
|
102
|
+
}): Promise<string | null>;
|
|
103
|
+
static getPaymentRequest: ({ env, paymentRequestId, secrecyIdSeller, secrecyId, appCode }: {
|
|
104
|
+
env: SecrecyEnv;
|
|
105
|
+
paymentRequestId: string;
|
|
106
|
+
secrecyIdSeller: string;
|
|
107
|
+
secrecyId?: string | undefined;
|
|
108
|
+
appCode?: string | undefined;
|
|
109
|
+
}) => Promise<SuccessResponse<GraphQLTypes["GetPaymentRequestToPay"]> | ErrorAccessDenied | ErrorNotFound>;
|
|
110
|
+
}
|
|
111
|
+
export {};
|