@secrecy/lib 1.0.0-dev.3 → 1.0.0-dev.30
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/{lib → dist}/BaseClient.d.ts +32 -24
- package/dist/BaseClient.js +2227 -0
- package/{lib → dist}/PopupTools.d.ts +1 -1
- package/{lib → dist}/PopupTools.js +3 -3
- package/{lib → dist}/ZeusThunder.d.ts +0 -0
- package/dist/ZeusThunder.js +113 -0
- package/{lib → dist}/cache.d.ts +0 -0
- package/{lib → dist}/cache.js +0 -0
- package/dist/client/admin/index.d.ts +11 -0
- package/dist/client/admin/index.js +198 -0
- package/{lib → dist}/client/convert/file.d.ts +0 -0
- package/{lib → dist}/client/convert/file.js +2 -2
- package/{lib → dist}/client/convert/folder.d.ts +0 -1
- package/dist/client/convert/folder.js +264 -0
- package/{lib → dist}/client/convert/mail.d.ts +0 -0
- package/{lib → dist}/client/convert/mail.js +0 -0
- package/{lib → dist}/client/convert/vFile.d.ts +0 -0
- package/{lib → dist}/client/convert/vFile.js +2 -2
- package/{lib → dist}/client/helpers.d.ts +1 -1
- package/{lib → dist}/client/helpers.js +1 -3
- package/dist/client/index.d.ts +172 -0
- package/dist/client/index.js +6177 -0
- package/{lib → dist}/client/storage.d.ts +0 -0
- package/{lib → dist}/client/storage.js +0 -0
- package/{lib → dist}/client/types/File.d.ts +0 -0
- package/{lib → dist}/client/types/File.js +1 -0
- package/{lib → dist}/client/types/FilesOnUsersOnApplications.d.ts +0 -0
- package/{lib → dist}/client/types/FilesOnUsersOnApplications.js +1 -0
- package/{lib → dist}/client/types/Folder.d.ts +0 -0
- package/{lib → dist}/client/types/Folder.js +0 -0
- package/{lib → dist}/client/types/Inputs.d.ts +0 -0
- package/{lib → dist}/client/types/Inputs.js +1 -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 +0 -0
- package/{lib → dist}/client/types/UserAppSettings.js +1 -0
- package/{lib → dist}/client/types/VFile.d.ts +0 -0
- package/{lib → dist}/client/types/VFile.js +0 -0
- package/{lib → dist}/client/types/index.d.ts +1 -0
- package/dist/client/types/index.js +10 -0
- package/{lib → dist}/client/types/queries.d.ts +0 -0
- package/{lib → dist}/client/types/queries.js +2 -2
- package/{lib → dist}/crypto/file.d.ts +0 -0
- package/{lib → dist}/crypto/file.js +0 -0
- package/{lib → dist}/crypto/index.d.ts +0 -0
- package/dist/crypto/index.js +45 -0
- package/dist/error.d.ts +30 -0
- package/dist/error.js +3 -0
- package/{lib → dist}/index.d.ts +4 -2
- package/dist/index.js +42 -0
- package/{lib → dist}/minify/index.d.ts +0 -0
- package/{lib → dist}/minify/index.js +0 -0
- package/{lib → dist}/minify/lz4.d.ts +0 -0
- package/{lib → dist}/minify/lz4.js +0 -0
- package/{lib → dist}/sodium.d.ts +0 -0
- package/{lib → dist}/sodium.js +0 -0
- package/{lib → dist}/utils/store-buddy.d.ts +0 -0
- package/{lib → dist}/utils/store-buddy.js +0 -0
- package/{lib → dist}/utils/time.d.ts +0 -0
- package/{lib → dist}/utils/time.js +0 -0
- package/{lib → dist}/utils.d.ts +0 -0
- package/{lib → dist}/utils.js +0 -0
- package/{lib → dist}/worker/__mock__/sodium.worker.d.ts +0 -0
- package/dist/worker/__mock__/sodium.worker.js +46 -0
- package/{lib → dist}/worker/md5.d.ts +0 -0
- package/{lib → dist}/worker/md5.js +0 -0
- package/dist/worker/sodium.d.ts +3 -0
- package/dist/worker/sodium.js +155 -0
- package/{lib → dist}/worker/workerCodes.d.ts +0 -0
- package/{lib → dist}/worker/workerCodes.js +0 -0
- package/{lib → dist}/zeus/const.d.ts +0 -0
- package/dist/zeus/const.js +2267 -0
- package/dist/zeus/index.d.ts +4043 -0
- package/dist/zeus/index.js +549 -0
- package/package.json +45 -42
- package/lib/BaseClient.js +0 -1332
- package/lib/ZeusThunder.js +0 -112
- package/lib/client/convert/folder.js +0 -301
- package/lib/client/index.d.ts +0 -167
- package/lib/client/index.js +0 -3699
- package/lib/client/types/index.js +0 -8
- package/lib/crypto/index.js +0 -37
- package/lib/index.js +0 -40
- package/lib/worker/__mock__/sodium.worker.js +0 -57
- package/lib/worker/sodium.d.ts +0 -3
- package/lib/worker/sodium.js +0 -141
- package/lib/zeus/const.js +0 -1609
- package/lib/zeus/index.d.ts +0 -26109
- package/lib/zeus/index.js +0 -548
|
@@ -3,6 +3,11 @@ import type { Document } from "bson";
|
|
|
3
3
|
import type { UserSession } from "./client/types/index.js";
|
|
4
4
|
import type { SecrecyEnv } from "./client/helpers.js";
|
|
5
5
|
import type { Lang, PayInputType, PlanKind, Thunder, UserRole } from "./zeus/index.js";
|
|
6
|
+
import type { ErrorAccessDenied, ErrorLimit, ErrorNotFound, ErrorNotExist, ErrorLangNotExist, ErrorBasic } from "./error.js";
|
|
7
|
+
export declare type SuccessResponse<T> = {
|
|
8
|
+
__typename: "SuccessResponse";
|
|
9
|
+
data: T;
|
|
10
|
+
};
|
|
6
11
|
export declare type DownloadProgress = DLProgress;
|
|
7
12
|
export declare type PayInput = {
|
|
8
13
|
type: PayInputType;
|
|
@@ -197,70 +202,73 @@ export declare class BaseClient {
|
|
|
197
202
|
protected client: ReturnType<typeof Thunder>;
|
|
198
203
|
sessionId: string;
|
|
199
204
|
constructor(session: string, env: SecrecyEnv);
|
|
200
|
-
sessions(): Promise<UserSession[]>;
|
|
205
|
+
sessions(): Promise<SuccessResponse<UserSession[]> | ErrorNotFound | null>;
|
|
201
206
|
logout(sessionId?: string | null | undefined): Promise<void>;
|
|
202
|
-
me<T extends WithPublicKey = WithPublicKey>(params?: T): Promise<User<T
|
|
203
|
-
static user<T extends StaticGetUserParams>(params: T, sessionId?: string | null | undefined): Promise<User<T
|
|
204
|
-
user<T extends ClassGetUserParams>(params: T): Promise<User<T
|
|
207
|
+
me<T extends WithPublicKey = WithPublicKey>(params?: T): Promise<SuccessResponse<User<T>> | ErrorNotFound | null>;
|
|
208
|
+
static user<T extends StaticGetUserParams>(params: T, sessionId?: string | null | undefined): Promise<SuccessResponse<User<T>> | ErrorNotFound | null>;
|
|
209
|
+
user<T extends ClassGetUserParams>(params: T): Promise<SuccessResponse<User<T>> | ErrorNotFound | null>;
|
|
205
210
|
updateProfile({ firstname, lastname, lang }: {
|
|
206
211
|
firstname: string | null;
|
|
207
212
|
lastname: string | null;
|
|
208
213
|
lang: Lang | null;
|
|
209
|
-
}): Promise<User>;
|
|
210
|
-
static plans(env: SecrecyEnv, sessionId?: string | null | undefined): Promise<Plan[]>;
|
|
211
|
-
pay(planCode: SecrecyPlansCodes, input: PayInput, autoRenew?: boolean | null | undefined): Promise<boolean>;
|
|
212
|
-
cancelPayment(): Promise<boolean>;
|
|
213
|
-
paymentInfos(): Promise<PaymentInfos | null>;
|
|
214
|
-
limits(): Promise<QueryLimits | null>;
|
|
215
|
-
godFatherAndChildren(): Promise<GodFatherAndChildren | null>;
|
|
214
|
+
}): Promise<SuccessResponse<User> | ErrorNotFound | ErrorAccessDenied | null>;
|
|
215
|
+
static plans(env: SecrecyEnv, sessionId?: string | null | undefined): Promise<SuccessResponse<Plan[]> | null>;
|
|
216
|
+
pay(planCode: SecrecyPlansCodes, input: PayInput, autoRenew?: boolean | null | undefined): Promise<SuccessResponse<boolean> | ErrorAccessDenied | null>;
|
|
217
|
+
cancelPayment(): Promise<SuccessResponse<boolean> | ErrorAccessDenied | null>;
|
|
218
|
+
paymentInfos(): Promise<SuccessResponse<PaymentInfos> | ErrorAccessDenied | null>;
|
|
219
|
+
limits(): Promise<SuccessResponse<QueryLimits> | ErrorAccessDenied | ErrorNotExist | ErrorLimit | ErrorNotFound | null>;
|
|
220
|
+
godFatherAndChildren(): Promise<SuccessResponse<GodFatherAndChildren> | ErrorNotFound | null>;
|
|
216
221
|
static updateAppDBConfig({ appCode, config, env, sessionId }: {
|
|
217
222
|
appCode: string;
|
|
218
223
|
config: AppDBConfig;
|
|
219
224
|
env: SecrecyEnv;
|
|
220
225
|
sessionId?: string | null | undefined;
|
|
221
|
-
}): Promise<AppDBConfig>;
|
|
222
|
-
static getAppDBConfig(appCode: string, env: SecrecyEnv, sessionId?: string | null | undefined): Promise<AppDBConfig>;
|
|
226
|
+
}): Promise<SuccessResponse<AppDBConfig> | ErrorAccessDenied | null>;
|
|
227
|
+
static getAppDBConfig(appCode: string, env: SecrecyEnv, sessionId?: string | null | undefined): Promise<SuccessResponse<AppDBConfig> | ErrorAccessDenied | ErrorNotFound | ErrorNotExist | null>;
|
|
223
228
|
static getFAQ({ lang, env, sessionId }: {
|
|
224
229
|
lang?: Lang;
|
|
225
230
|
env: SecrecyEnv;
|
|
226
231
|
sessionId?: string | null | undefined;
|
|
227
|
-
}): Promise<FaqItem[]>;
|
|
232
|
+
}): Promise<SuccessResponse<FaqItem[]> | ErrorAccessDenied | null>;
|
|
228
233
|
static getBlog({ env, lang, sessionId }: {
|
|
229
234
|
env: SecrecyEnv;
|
|
230
235
|
lang?: Lang | null | undefined;
|
|
231
236
|
sessionId?: string | null | undefined;
|
|
232
|
-
}): Promise<BlogItem[]>;
|
|
233
|
-
reportUser(reportedUserId: string, customMessage?: string): Promise<SendReport |
|
|
237
|
+
}): Promise<SuccessResponse<BlogItem[]> | ErrorLangNotExist | null>;
|
|
238
|
+
reportUser(reportedUserId: string, customMessage?: string): Promise<SuccessResponse<SendReport> | ErrorAccessDenied | ErrorNotFound | null>;
|
|
234
239
|
static deleteUser({ sessionId, userId, env }: {
|
|
235
240
|
sessionId: string;
|
|
236
241
|
userId?: string;
|
|
237
242
|
env: SecrecyEnv;
|
|
238
|
-
}): Promise<boolean>;
|
|
243
|
+
}): Promise<SuccessResponse<boolean> | ErrorAccessDenied | null>;
|
|
239
244
|
dbGet<U>({ field, userId }: {
|
|
240
245
|
field: string;
|
|
241
246
|
userId?: string | null | undefined;
|
|
242
|
-
}): Promise<U>;
|
|
247
|
+
}): Promise<SuccessResponse<U> | ErrorAccessDenied | ErrorNotExist | ErrorNotFound | null>;
|
|
243
248
|
dbSet<T extends UserData, U extends Document>({ value, userId }: {
|
|
244
249
|
value: U;
|
|
245
250
|
userId?: string | null | undefined;
|
|
246
|
-
}): Promise<T>;
|
|
251
|
+
}): Promise<SuccessResponse<T> | ErrorAccessDenied | ErrorNotFound | null>;
|
|
247
252
|
dbSearch<T>({ search, field }: {
|
|
248
253
|
field: string;
|
|
249
254
|
search: string;
|
|
250
|
-
}): Promise<T[]>;
|
|
255
|
+
}): Promise<SuccessResponse<T[]> | ErrorAccessDenied | ErrorBasic | ErrorNotExist | null>;
|
|
251
256
|
deleteFolder({ id }: {
|
|
252
257
|
id: string;
|
|
253
|
-
}): Promise<boolean>;
|
|
258
|
+
}): Promise<SuccessResponse<boolean> | ErrorNotExist | ErrorAccessDenied | null>;
|
|
254
259
|
moveFolders({ foldersId, parentFolderId }: {
|
|
255
260
|
foldersId: string[];
|
|
256
261
|
parentFolderId?: string | null | undefined;
|
|
257
|
-
}): Promise<boolean>;
|
|
262
|
+
}): Promise<SuccessResponse<boolean> | ErrorAccessDenied | null>;
|
|
258
263
|
moveFiles({ filesId, parentFolderId }: {
|
|
259
264
|
filesId: string[];
|
|
260
265
|
parentFolderId?: string | null | undefined;
|
|
261
|
-
}): Promise<boolean>;
|
|
266
|
+
}): Promise<SuccessResponse<boolean> | ErrorAccessDenied | null>;
|
|
262
267
|
folderSize({ folderId }: {
|
|
263
268
|
folderId?: string | null | undefined;
|
|
264
|
-
}): Promise<FolderSize | null>;
|
|
269
|
+
}): Promise<SuccessResponse<FolderSize> | ErrorAccessDenied | null>;
|
|
270
|
+
getSponsorshipLink({ backUrl }: {
|
|
271
|
+
backUrl: string;
|
|
272
|
+
}): Promise<string | null>;
|
|
265
273
|
}
|
|
266
274
|
export {};
|