@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.
Files changed (126) hide show
  1. package/README.md +1 -1
  2. package/dist/BaseClient.d.ts +123 -0
  3. package/dist/BaseClient.js +569 -0
  4. package/{lib → dist}/PopupTools.d.ts +1 -1
  5. package/dist/PopupTools.js +221 -0
  6. package/{lib → dist}/ZeusThunder.d.ts +0 -0
  7. package/dist/ZeusThunder.js +79 -0
  8. package/dist/cache.d.ts +6 -0
  9. package/dist/cache.js +4 -0
  10. package/dist/client/SecrecyAppClient.d.ts +17 -0
  11. package/dist/client/SecrecyAppClient.js +256 -0
  12. package/dist/client/SecrecyCloudClient.d.ts +89 -0
  13. package/dist/client/SecrecyCloudClient.js +1627 -0
  14. package/dist/client/SecrecyDbClient.d.ts +21 -0
  15. package/dist/client/SecrecyDbClient.js +198 -0
  16. package/dist/client/SecrecyMailClient.d.ts +42 -0
  17. package/dist/client/SecrecyMailClient.js +1187 -0
  18. package/dist/client/SecrecyPayClient.d.ts +7 -0
  19. package/dist/client/SecrecyPayClient.js +37 -0
  20. package/dist/client/SecrecyWalletClient.d.ts +30 -0
  21. package/dist/client/SecrecyWalletClient.js +76 -0
  22. package/{lib → dist}/client/convert/file.d.ts +3 -3
  23. package/dist/client/convert/file.js +34 -0
  24. package/dist/client/convert/mail.d.ts +3 -0
  25. package/dist/client/convert/mail.js +48 -0
  26. package/dist/client/convert/node.d.ts +9 -0
  27. package/dist/client/convert/node.js +100 -0
  28. package/{lib → dist}/client/helpers.d.ts +6 -1
  29. package/dist/client/helpers.js +126 -0
  30. package/dist/client/index.d.ts +34 -0
  31. package/dist/client/index.js +52 -0
  32. package/{lib → dist}/client/storage.d.ts +0 -0
  33. package/dist/client/storage.js +12 -0
  34. package/dist/client/types/File.d.ts +14 -0
  35. package/dist/client/types/File.js +3 -0
  36. package/{lib → dist}/client/types/Inputs.d.ts +2 -7
  37. package/dist/client/types/Inputs.js +3 -0
  38. package/dist/client/types/Node.d.ts +56 -0
  39. package/dist/client/types/Node.js +3 -0
  40. package/dist/client/types/UserAppNotifications.d.ts +6 -0
  41. package/dist/client/types/UserAppNotifications.js +3 -0
  42. package/{lib → dist}/client/types/UserAppSettings.d.ts +1 -3
  43. package/dist/client/types/UserAppSettings.js +3 -0
  44. package/{lib → dist}/client/types/index.d.ts +10 -43
  45. package/dist/client/types/index.js +8 -0
  46. package/dist/client/types/selectors.d.ts +400 -0
  47. package/dist/client/types/selectors.js +138 -0
  48. package/{lib → dist}/crypto/file.d.ts +0 -0
  49. package/dist/crypto/file.js +210 -0
  50. package/{lib → dist}/crypto/index.d.ts +0 -0
  51. package/dist/crypto/index.js +47 -0
  52. package/dist/error.d.ts +30 -0
  53. package/dist/error.js +3 -0
  54. package/dist/index.d.ts +11 -0
  55. package/dist/index.js +9 -0
  56. package/{lib → dist}/minify/index.d.ts +0 -0
  57. package/dist/minify/index.js +28 -0
  58. package/{lib → dist}/minify/lz4.d.ts +0 -0
  59. package/dist/minify/lz4.js +627 -0
  60. package/{lib → dist}/sodium.d.ts +0 -0
  61. package/dist/sodium.js +6 -0
  62. package/{lib → dist}/utils/store-buddy.d.ts +0 -0
  63. package/dist/utils/store-buddy.js +65 -0
  64. package/{lib → dist}/utils/time.d.ts +0 -0
  65. package/dist/utils/time.js +14 -0
  66. package/{lib → dist/utils}/utils.d.ts +0 -0
  67. package/dist/utils/utils.js +57 -0
  68. package/{lib → dist}/worker/md5.d.ts +0 -0
  69. package/dist/worker/md5.js +25 -0
  70. package/{lib → dist}/worker/sodium.d.ts +0 -0
  71. package/dist/worker/sodium.js +120 -0
  72. package/{lib → dist}/worker/workerCodes.d.ts +0 -0
  73. package/dist/worker/workerCodes.js +255 -0
  74. package/{lib → dist}/zeus/const.d.ts +5 -0
  75. package/dist/zeus/const.js +1286 -0
  76. package/dist/zeus/index.d.ts +6119 -0
  77. package/dist/zeus/index.js +687 -0
  78. package/package.json +60 -52
  79. package/lib/BaseClient.d.ts +0 -266
  80. package/lib/BaseClient.js +0 -1332
  81. package/lib/PopupTools.js +0 -213
  82. package/lib/ZeusThunder.js +0 -112
  83. package/lib/cache.d.ts +0 -7
  84. package/lib/cache.js +0 -5
  85. package/lib/client/convert/file.js +0 -39
  86. package/lib/client/convert/folder.d.ts +0 -8
  87. package/lib/client/convert/folder.js +0 -264
  88. package/lib/client/convert/mail.d.ts +0 -3
  89. package/lib/client/convert/mail.js +0 -46
  90. package/lib/client/convert/vFile.d.ts +0 -5
  91. package/lib/client/convert/vFile.js +0 -164
  92. package/lib/client/helpers.js +0 -116
  93. package/lib/client/index.d.ts +0 -166
  94. package/lib/client/index.js +0 -3697
  95. package/lib/client/storage.js +0 -12
  96. package/lib/client/types/File.d.ts +0 -21
  97. package/lib/client/types/File.js +0 -2
  98. package/lib/client/types/FilesOnUsersOnApplications.d.ts +0 -9
  99. package/lib/client/types/FilesOnUsersOnApplications.js +0 -2
  100. package/lib/client/types/Folder.d.ts +0 -68
  101. package/lib/client/types/Folder.js +0 -7
  102. package/lib/client/types/Inputs.js +0 -2
  103. package/lib/client/types/UserAppSettings.js +0 -2
  104. package/lib/client/types/VFile.d.ts +0 -62
  105. package/lib/client/types/VFile.js +0 -4
  106. package/lib/client/types/index.js +0 -8
  107. package/lib/client/types/queries.d.ts +0 -535
  108. package/lib/client/types/queries.js +0 -192
  109. package/lib/crypto/file.js +0 -291
  110. package/lib/crypto/index.js +0 -37
  111. package/lib/index.d.ts +0 -11
  112. package/lib/index.js +0 -40
  113. package/lib/minify/index.js +0 -28
  114. package/lib/minify/lz4.js +0 -633
  115. package/lib/sodium.js +0 -28
  116. package/lib/utils/store-buddy.js +0 -69
  117. package/lib/utils/time.js +0 -22
  118. package/lib/utils.js +0 -188
  119. package/lib/worker/__mock__/sodium.worker.d.ts +0 -19
  120. package/lib/worker/__mock__/sodium.worker.js +0 -57
  121. package/lib/worker/md5.js +0 -43
  122. package/lib/worker/sodium.js +0 -155
  123. package/lib/worker/workerCodes.js +0 -3
  124. package/lib/zeus/const.js +0 -1609
  125. package/lib/zeus/index.d.ts +0 -26113
  126. 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 {};