@secrecy/lib 1.0.0-dev.8 → 1.0.0-dev.80
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 +104 -0
- package/dist/BaseClient.js +430 -0
- package/{lib → dist}/PopupTools.d.ts +1 -1
- package/dist/PopupTools.js +196 -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 +227 -0
- package/dist/client/SecrecyCloudClient.d.ts +89 -0
- package/dist/client/SecrecyCloudClient.js +1411 -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 +43 -0
- package/dist/client/convert/node.d.ts +9 -0
- package/dist/client/convert/node.js +88 -0
- package/{lib → dist}/client/helpers.d.ts +6 -1
- 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/{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/{lib → dist}/client/types/UserAppNotifications.d.ts +1 -1
- 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 +9 -43
- 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 +0 -0
- 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 +0 -0
- 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 +1664 -0
- package/dist/zeus/index.d.ts +7873 -0
- package/dist/zeus/index.js +602 -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 -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 -168
- package/lib/client/index.js +0 -3795
- 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/UserAppNotifications.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 -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 -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 -1644
- package/lib/zeus/index.d.ts +0 -26279
- package/lib/zeus/index.js +0 -552
package/package.json
CHANGED
|
@@ -2,92 +2,102 @@
|
|
|
2
2
|
"name": "@secrecy/lib",
|
|
3
3
|
"author": "Anonymize <anonymize@gmail.com>",
|
|
4
4
|
"description": "Anonymize Secrecy Library",
|
|
5
|
-
"version": "1.0.0-dev.
|
|
5
|
+
"version": "1.0.0-dev.80",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "
|
|
8
|
+
"url": "https://github.com/anonymize-org/lib.git"
|
|
9
9
|
},
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"bugs": {
|
|
12
|
-
"url": "https://github.com/
|
|
12
|
+
"url": "https://github.com/anonymize-org/lib/issues"
|
|
13
13
|
},
|
|
14
|
-
"homepage": "https://github.com/
|
|
14
|
+
"homepage": "https://github.com/anonymize-org/lib#readme",
|
|
15
15
|
"keywords": [
|
|
16
16
|
"anonymize",
|
|
17
17
|
"lib",
|
|
18
|
-
"secrecy"
|
|
18
|
+
"secrecy",
|
|
19
|
+
"wallet",
|
|
20
|
+
"stripe"
|
|
19
21
|
],
|
|
20
22
|
"type": "module",
|
|
21
|
-
"exports": "./
|
|
22
|
-
"types": "
|
|
23
|
+
"exports": "./dist/index.js",
|
|
24
|
+
"types": "dist/index.d.ts",
|
|
23
25
|
"files": [
|
|
24
|
-
"
|
|
26
|
+
"dist"
|
|
25
27
|
],
|
|
26
28
|
"engines": {
|
|
27
|
-
"node": "
|
|
29
|
+
"node": ">=16.13.0"
|
|
28
30
|
},
|
|
29
31
|
"scripts": {
|
|
30
|
-
"
|
|
32
|
+
"clean": "rimraf dist",
|
|
33
|
+
"test": "cross-env NEXT_PUBLIC_SECRECY_API_URL=http://localhost:4000/graphql NODE_OPTIONS=--experimental-vm-modules jest --detectOpenHandles --forceExit",
|
|
31
34
|
"lint": "eslint \"./**/*.{ts,tsx}\"",
|
|
32
|
-
"
|
|
33
|
-
"format": "prettier --write \"./**/*.{ts,tsx}\"",
|
|
34
|
-
"editor": "yarn dlx @yarnpkg/sdks",
|
|
35
|
+
"format": "prettier --cache --write \"./**/*.{ts,tsx}\"",
|
|
35
36
|
"doc": "typedoc --out docs src",
|
|
36
|
-
"prepublish": "
|
|
37
|
+
"prepublish": "pnpm build",
|
|
37
38
|
"type-check": "tsc --noEmit",
|
|
38
|
-
"type-check:watch": "
|
|
39
|
+
"type-check:watch": "pnpm type-check --watch",
|
|
39
40
|
"build:types": "tsc --emitDeclarationOnly",
|
|
40
|
-
"clean": "rimraf lib tsconfig.tsbuildinfo",
|
|
41
41
|
"build": "run-p -l clean build:types babel",
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"zeus": "zeus
|
|
45
|
-
"prepare": "husky install"
|
|
42
|
+
"babel": "babel src --out-dir dist --extensions \".ts,.tsx\" --source-maps inline",
|
|
43
|
+
"watch": "pnpm build --watch",
|
|
44
|
+
"zeus": "zeus http://localhost:4000/graphql ./src --ts --es",
|
|
45
|
+
"prepare": "husky install",
|
|
46
|
+
"semantic-release": "semantic-release"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
|
-
"@babel/cli": "^7.
|
|
49
|
-
"@babel/core": "^7.
|
|
50
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
51
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.
|
|
49
|
+
"@babel/cli": "^7.19.3",
|
|
50
|
+
"@babel/core": "^7.19.3",
|
|
51
|
+
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
52
|
+
"@babel/plugin-proposal-object-rest-spread": "^7.19.4",
|
|
53
|
+
"@babel/plugin-proposal-private-methods": "^7.18.6",
|
|
52
54
|
"@babel/plugin-syntax-import-meta": "^7.10.4",
|
|
53
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
54
|
-
"@babel/
|
|
55
|
-
"@babel/preset-
|
|
56
|
-
"@
|
|
57
|
-
"@commitlint/
|
|
58
|
-
"@
|
|
59
|
-
"@
|
|
60
|
-
"@types/
|
|
61
|
-
"@types/node
|
|
55
|
+
"@babel/plugin-transform-runtime": "^7.19.1",
|
|
56
|
+
"@babel/plugin-transform-typescript": "^7.19.3",
|
|
57
|
+
"@babel/preset-env": "^7.19.4",
|
|
58
|
+
"@babel/preset-typescript": "^7.18.6",
|
|
59
|
+
"@commitlint/cli": "^17.1.2",
|
|
60
|
+
"@commitlint/config-conventional": "^17.1.0",
|
|
61
|
+
"@types/jest": "28",
|
|
62
|
+
"@types/jsonwebtoken": "^8.5.9",
|
|
63
|
+
"@types/node": "^18.11.4",
|
|
62
64
|
"@types/shortid": "^0.0.29",
|
|
63
65
|
"@types/spark-md5": "^3.0.2",
|
|
64
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
65
|
-
"@typescript-eslint/parser": "^
|
|
66
|
-
"babel-loader": "^8.2.
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"eslint
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
66
|
+
"@typescript-eslint/eslint-plugin": "^5.40.1",
|
|
67
|
+
"@typescript-eslint/parser": "^5.40.1",
|
|
68
|
+
"babel-loader": "^8.2.5",
|
|
69
|
+
"babel-plugin-const-enum": "^1.2.0",
|
|
70
|
+
"cross-env": "^7.0.3",
|
|
71
|
+
"eslint": "^8.26.0",
|
|
72
|
+
"eslint-config-prettier": "^8.5.0",
|
|
73
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
74
|
+
"graphql-zeus": "^5.1.9",
|
|
75
|
+
"husky": "^8.0.1",
|
|
76
|
+
"jest": "28",
|
|
77
|
+
"jest-environment-jsdom": "28",
|
|
73
78
|
"jest-fetch-mock": "^3.0.3",
|
|
74
79
|
"npm-run-all": "^4.1.5",
|
|
75
|
-
"prettier": "^2.
|
|
80
|
+
"prettier": "^2.7.0",
|
|
76
81
|
"rimraf": "^3.0.2",
|
|
77
|
-
"
|
|
78
|
-
"ts-
|
|
79
|
-
"
|
|
80
|
-
"
|
|
82
|
+
"semantic-release": "^19.0.5",
|
|
83
|
+
"ts-jest": "28",
|
|
84
|
+
"ts-node": "^10.9.1",
|
|
85
|
+
"tsup": "^6.3.0",
|
|
86
|
+
"typedoc": "^0.23.18",
|
|
87
|
+
"typedoc-plugin-missing-exports": "^1.0.0",
|
|
88
|
+
"typescript": "^4.8.4"
|
|
81
89
|
},
|
|
82
90
|
"dependencies": {
|
|
83
|
-
"@
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
91
|
+
"@secrecy/lib-utils": "^1.0.18",
|
|
92
|
+
"@types/libsodium-wrappers": "^0.7.10",
|
|
93
|
+
"axios": "^1.1.3",
|
|
94
|
+
"bson": "^4.7.0",
|
|
95
|
+
"ethers": "^5.7.2",
|
|
96
|
+
"jsonwebtoken": "^8.5.1",
|
|
97
|
+
"ky": "^0.31.4",
|
|
98
|
+
"libsodium-wrappers": "^0.7.10",
|
|
89
99
|
"shortid": "^2.2.16",
|
|
90
100
|
"spark-md5": "^3.0.2"
|
|
91
101
|
},
|
|
92
|
-
"packageManager": "
|
|
102
|
+
"packageManager": "pnpm@7.9.4"
|
|
93
103
|
}
|
package/lib/BaseClient.d.ts
DELETED
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
import type { DownloadProgress as DLProgress } from "ky";
|
|
2
|
-
import type { Document } from "bson";
|
|
3
|
-
import type { UserSession } from "./client/types/index.js";
|
|
4
|
-
import type { SecrecyEnv } from "./client/helpers.js";
|
|
5
|
-
import type { Lang, PayInputType, PlanKind, Thunder, UserRole } from "./zeus/index.js";
|
|
6
|
-
export declare type DownloadProgress = DLProgress;
|
|
7
|
-
export declare type PayInput = {
|
|
8
|
-
type: PayInputType;
|
|
9
|
-
token: string;
|
|
10
|
-
firstName: string;
|
|
11
|
-
lastName: string;
|
|
12
|
-
street: string;
|
|
13
|
-
postalCode: string;
|
|
14
|
-
city: string;
|
|
15
|
-
country: string;
|
|
16
|
-
month: string;
|
|
17
|
-
year: string;
|
|
18
|
-
cvv: string;
|
|
19
|
-
number: string;
|
|
20
|
-
};
|
|
21
|
-
export declare type MailLimits = {
|
|
22
|
-
count?: string | undefined;
|
|
23
|
-
fileCount?: string | undefined;
|
|
24
|
-
fileSize?: string | undefined;
|
|
25
|
-
hardCount?: string | undefined;
|
|
26
|
-
hardFileCount?: string | undefined;
|
|
27
|
-
hardFileSize?: string | undefined;
|
|
28
|
-
perFileSize?: string | undefined;
|
|
29
|
-
};
|
|
30
|
-
export declare type Limits = {
|
|
31
|
-
downloadBandwidth?: string | undefined;
|
|
32
|
-
downloadCount?: string | undefined;
|
|
33
|
-
hardFileCount?: string | undefined;
|
|
34
|
-
hardFileSize?: string | undefined;
|
|
35
|
-
perFileSize?: string | undefined;
|
|
36
|
-
receivedMails: MailLimits;
|
|
37
|
-
sentMails: MailLimits;
|
|
38
|
-
uploadBandwidth?: string | undefined;
|
|
39
|
-
uploadCount?: string | undefined;
|
|
40
|
-
};
|
|
41
|
-
export declare type GodUser = {
|
|
42
|
-
id: string;
|
|
43
|
-
firstname: string;
|
|
44
|
-
lastname: string;
|
|
45
|
-
email: string;
|
|
46
|
-
phone: string;
|
|
47
|
-
};
|
|
48
|
-
export declare type GodFatherAndChildren = {
|
|
49
|
-
godFather: GodUser | null;
|
|
50
|
-
godChildren: GodUser[];
|
|
51
|
-
};
|
|
52
|
-
export declare type Plan = {
|
|
53
|
-
codes: string[];
|
|
54
|
-
kind: PlanKind;
|
|
55
|
-
limits: Limits;
|
|
56
|
-
};
|
|
57
|
-
export declare type SubscriptionState = "active" | "canceled" | "paused" | "expired" | "future" | "in_trial" | "live" | "past_due";
|
|
58
|
-
export declare type SubscriptionCollectionMethod = "automatic" | "manual";
|
|
59
|
-
declare type RecurlyInvoiceStatus = "pending" | "paid" | "failed" | "past_due" | "open" | "closed" | "voided" | "processing";
|
|
60
|
-
export declare type Subscription = {
|
|
61
|
-
autorenew: boolean;
|
|
62
|
-
activatedAt?: Date | null | undefined;
|
|
63
|
-
currentPeriodEndsAt?: Date | null | undefined;
|
|
64
|
-
currentPeriodStartedAt?: Date | null | undefined;
|
|
65
|
-
canceledAt?: Date | null | undefined;
|
|
66
|
-
createdAt?: Date | null | undefined;
|
|
67
|
-
expiresAt?: Date | null | undefined;
|
|
68
|
-
pausedAt?: Date | null | undefined;
|
|
69
|
-
trialEndsAt?: Date | null | undefined;
|
|
70
|
-
trialStartedAt?: Date | null | undefined;
|
|
71
|
-
updatedAt?: Date | null | undefined;
|
|
72
|
-
collectionMethod: SubscriptionCollectionMethod;
|
|
73
|
-
state: SubscriptionState;
|
|
74
|
-
plan?: string | null | undefined;
|
|
75
|
-
planCode?: string | null | undefined;
|
|
76
|
-
total?: number | null | undefined;
|
|
77
|
-
};
|
|
78
|
-
export declare type RecurlyInvoices = {
|
|
79
|
-
pdf: string;
|
|
80
|
-
date: Date;
|
|
81
|
-
due: Date;
|
|
82
|
-
status: RecurlyInvoiceStatus;
|
|
83
|
-
total: number;
|
|
84
|
-
name: string;
|
|
85
|
-
currency: string;
|
|
86
|
-
};
|
|
87
|
-
export declare type PaymentInfos = {
|
|
88
|
-
hostedUrl: string;
|
|
89
|
-
currentSubscription: Subscription;
|
|
90
|
-
invoices: RecurlyInvoices[];
|
|
91
|
-
};
|
|
92
|
-
export declare type SendReport = {
|
|
93
|
-
id: string;
|
|
94
|
-
user: {
|
|
95
|
-
id: string;
|
|
96
|
-
firstname: string;
|
|
97
|
-
lastname: string;
|
|
98
|
-
email: string;
|
|
99
|
-
};
|
|
100
|
-
reportedUser: {
|
|
101
|
-
id: string;
|
|
102
|
-
firstname: string;
|
|
103
|
-
lastname: string;
|
|
104
|
-
email: string;
|
|
105
|
-
};
|
|
106
|
-
customMessage?: string | undefined;
|
|
107
|
-
};
|
|
108
|
-
declare const plansCodes: readonly ["basic_month", "advanced_month", "pro_month", "basic_year", "advanced_year", "pro_year"];
|
|
109
|
-
export declare type SecrecyPlansCodes = typeof plansCodes[number];
|
|
110
|
-
export declare function isValidPlan(planCode: string): planCode is SecrecyPlansCodes;
|
|
111
|
-
export declare type UserData<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
112
|
-
isSuperuser: boolean;
|
|
113
|
-
isSearchable: boolean;
|
|
114
|
-
} & T;
|
|
115
|
-
export declare type FolderSize = {
|
|
116
|
-
size: bigint;
|
|
117
|
-
sizeBefore: bigint;
|
|
118
|
-
};
|
|
119
|
-
export declare type AppDBConfigField = {
|
|
120
|
-
name: string;
|
|
121
|
-
type: "string" | "number" | "boolean" | "object";
|
|
122
|
-
isArray?: boolean | undefined;
|
|
123
|
-
isNullable?: boolean | undefined;
|
|
124
|
-
isEditable?: boolean | undefined;
|
|
125
|
-
isKey?: boolean | undefined;
|
|
126
|
-
default?: unknown;
|
|
127
|
-
};
|
|
128
|
-
export declare type AppDBConfig = {
|
|
129
|
-
fields: AppDBConfigField[];
|
|
130
|
-
};
|
|
131
|
-
export declare type FaqItem = {
|
|
132
|
-
order: number;
|
|
133
|
-
question: string;
|
|
134
|
-
answer: string;
|
|
135
|
-
};
|
|
136
|
-
export declare type BlogItem = {
|
|
137
|
-
id: string;
|
|
138
|
-
blogId: string;
|
|
139
|
-
order: number;
|
|
140
|
-
author: string;
|
|
141
|
-
body: string;
|
|
142
|
-
date: Date;
|
|
143
|
-
image: string;
|
|
144
|
-
imageAlt: string;
|
|
145
|
-
summary: string;
|
|
146
|
-
title: string;
|
|
147
|
-
};
|
|
148
|
-
export declare type UserBase = {
|
|
149
|
-
email: string;
|
|
150
|
-
phone: string;
|
|
151
|
-
lastname: string;
|
|
152
|
-
role: UserRole;
|
|
153
|
-
firstname: string;
|
|
154
|
-
id: string;
|
|
155
|
-
deletedAt: Date | null;
|
|
156
|
-
lastLogin: Date;
|
|
157
|
-
lang: Lang;
|
|
158
|
-
};
|
|
159
|
-
declare type WithPublicKey = {
|
|
160
|
-
withPublicKey?: boolean;
|
|
161
|
-
};
|
|
162
|
-
export declare type User<T extends WithPublicKey = WithPublicKey> = T extends {
|
|
163
|
-
withPublicKey: true;
|
|
164
|
-
} ? UserBase & {
|
|
165
|
-
publicKey: string;
|
|
166
|
-
} : UserBase;
|
|
167
|
-
declare type ClassGetUserParams = WithPublicKey & {
|
|
168
|
-
userId?: string;
|
|
169
|
-
};
|
|
170
|
-
declare type StaticGetUserParams = ClassGetUserParams & {
|
|
171
|
-
env: SecrecyEnv;
|
|
172
|
-
};
|
|
173
|
-
export declare type CloudLimits = {
|
|
174
|
-
count: bigint;
|
|
175
|
-
maxCount: bigint | null;
|
|
176
|
-
size: bigint;
|
|
177
|
-
maxSize: bigint | null;
|
|
178
|
-
};
|
|
179
|
-
export declare type MailLimitsValues = {
|
|
180
|
-
count: bigint;
|
|
181
|
-
maxCount: bigint | null;
|
|
182
|
-
fileSize: bigint;
|
|
183
|
-
maxFileSize: bigint | null;
|
|
184
|
-
fileCount: bigint;
|
|
185
|
-
maxFileCount: bigint | null;
|
|
186
|
-
};
|
|
187
|
-
export declare type QueryLimits = {
|
|
188
|
-
cloud: CloudLimits;
|
|
189
|
-
mail: {
|
|
190
|
-
sent: MailLimitsValues;
|
|
191
|
-
received: MailLimitsValues;
|
|
192
|
-
};
|
|
193
|
-
};
|
|
194
|
-
export declare class BaseClient {
|
|
195
|
-
static readonly getBaseUrl: (env?: SecrecyEnv, graphcdn?: boolean) => string;
|
|
196
|
-
private static readonly _getBaseClient;
|
|
197
|
-
protected client: ReturnType<typeof Thunder>;
|
|
198
|
-
sessionId: string;
|
|
199
|
-
constructor(session: string, env: SecrecyEnv);
|
|
200
|
-
sessions(): Promise<UserSession[]>;
|
|
201
|
-
logout(sessionId?: string | null | undefined): Promise<void>;
|
|
202
|
-
me<T extends WithPublicKey = WithPublicKey>(params?: T): Promise<User<T> | null>;
|
|
203
|
-
static user<T extends StaticGetUserParams>(params: T, sessionId?: string | null | undefined): Promise<User<T> | null>;
|
|
204
|
-
user<T extends ClassGetUserParams>(params: T): Promise<User<T> | null>;
|
|
205
|
-
updateProfile({ firstname, lastname, lang }: {
|
|
206
|
-
firstname: string | null;
|
|
207
|
-
lastname: string | null;
|
|
208
|
-
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>;
|
|
216
|
-
static updateAppDBConfig({ appCode, config, env, sessionId }: {
|
|
217
|
-
appCode: string;
|
|
218
|
-
config: AppDBConfig;
|
|
219
|
-
env: SecrecyEnv;
|
|
220
|
-
sessionId?: string | null | undefined;
|
|
221
|
-
}): Promise<AppDBConfig>;
|
|
222
|
-
static getAppDBConfig(appCode: string, env: SecrecyEnv, sessionId?: string | null | undefined): Promise<AppDBConfig>;
|
|
223
|
-
static getFAQ({ lang, env, sessionId }: {
|
|
224
|
-
lang?: Lang;
|
|
225
|
-
env: SecrecyEnv;
|
|
226
|
-
sessionId?: string | null | undefined;
|
|
227
|
-
}): Promise<FaqItem[]>;
|
|
228
|
-
static getBlog({ env, lang, sessionId }: {
|
|
229
|
-
env: SecrecyEnv;
|
|
230
|
-
lang?: Lang | null | undefined;
|
|
231
|
-
sessionId?: string | null | undefined;
|
|
232
|
-
}): Promise<BlogItem[]>;
|
|
233
|
-
reportUser(reportedUserId: string, customMessage?: string): Promise<SendReport | undefined>;
|
|
234
|
-
static deleteUser({ sessionId, userId, env }: {
|
|
235
|
-
sessionId: string;
|
|
236
|
-
userId?: string;
|
|
237
|
-
env: SecrecyEnv;
|
|
238
|
-
}): Promise<boolean>;
|
|
239
|
-
dbGet<U>({ field, userId }: {
|
|
240
|
-
field: string;
|
|
241
|
-
userId?: string | null | undefined;
|
|
242
|
-
}): Promise<U>;
|
|
243
|
-
dbSet<T extends UserData, U extends Document>({ value, userId }: {
|
|
244
|
-
value: U;
|
|
245
|
-
userId?: string | null | undefined;
|
|
246
|
-
}): Promise<T>;
|
|
247
|
-
dbSearch<T>({ search, field }: {
|
|
248
|
-
field: string;
|
|
249
|
-
search: string;
|
|
250
|
-
}): Promise<T[]>;
|
|
251
|
-
deleteFolder({ id }: {
|
|
252
|
-
id: string;
|
|
253
|
-
}): Promise<boolean>;
|
|
254
|
-
moveFolders({ foldersId, parentFolderId }: {
|
|
255
|
-
foldersId: string[];
|
|
256
|
-
parentFolderId?: string | null | undefined;
|
|
257
|
-
}): Promise<boolean>;
|
|
258
|
-
moveFiles({ filesId, parentFolderId }: {
|
|
259
|
-
filesId: string[];
|
|
260
|
-
parentFolderId?: string | null | undefined;
|
|
261
|
-
}): Promise<boolean>;
|
|
262
|
-
folderSize({ folderId }: {
|
|
263
|
-
folderId?: string | null | undefined;
|
|
264
|
-
}): Promise<FolderSize | null>;
|
|
265
|
-
}
|
|
266
|
-
export {};
|