@secrecy/lib 1.6.0 → 1.6.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.
Files changed (197) hide show
  1. package/dist/BaseClient-ca94a07f.d.ts +405 -0
  2. package/dist/BaseClient.cjs +2 -0
  3. package/dist/BaseClient.cjs.map +1 -0
  4. package/dist/BaseClient.d.ts +16 -111
  5. package/dist/BaseClient.js +2 -506
  6. package/dist/BaseClient.js.map +1 -0
  7. package/dist/PopupTools.cjs +2 -0
  8. package/dist/PopupTools.cjs.map +1 -0
  9. package/dist/PopupTools.d.ts +5 -4
  10. package/dist/PopupTools.js +2 -195
  11. package/dist/PopupTools.js.map +1 -0
  12. package/dist/ZeusThunder.cjs +2 -0
  13. package/dist/ZeusThunder.cjs.map +1 -0
  14. package/dist/ZeusThunder.d.ts +6 -2
  15. package/dist/ZeusThunder.js +2 -65
  16. package/dist/ZeusThunder.js.map +1 -0
  17. package/dist/cache.cjs +2 -0
  18. package/dist/cache.cjs.map +1 -0
  19. package/dist/cache.d.ts +22 -4
  20. package/dist/cache.js +2 -4
  21. package/dist/cache.js.map +1 -0
  22. package/dist/client/SecrecyAppClient.cjs +2 -0
  23. package/dist/client/SecrecyAppClient.cjs.map +1 -0
  24. package/dist/client/SecrecyAppClient.d.ts +16 -17
  25. package/dist/client/SecrecyAppClient.js +2 -226
  26. package/dist/client/SecrecyAppClient.js.map +1 -0
  27. package/dist/client/SecrecyCloudClient.cjs +2 -0
  28. package/dist/client/SecrecyCloudClient.cjs.map +1 -0
  29. package/dist/client/SecrecyCloudClient.d.ts +16 -89
  30. package/dist/client/SecrecyCloudClient.js +2 -1405
  31. package/dist/client/SecrecyCloudClient.js.map +1 -0
  32. package/dist/client/SecrecyDbClient.cjs +2 -0
  33. package/dist/client/SecrecyDbClient.cjs.map +1 -0
  34. package/dist/client/SecrecyDbClient.d.ts +16 -48
  35. package/dist/client/SecrecyDbClient.js +2 -419
  36. package/dist/client/SecrecyDbClient.js.map +1 -0
  37. package/dist/client/SecrecyMailClient.cjs +2 -0
  38. package/dist/client/SecrecyMailClient.cjs.map +1 -0
  39. package/dist/client/SecrecyMailClient.d.ts +16 -42
  40. package/dist/client/SecrecyMailClient.js +2 -1022
  41. package/dist/client/SecrecyMailClient.js.map +1 -0
  42. package/dist/client/SecrecyPayClient.cjs +2 -0
  43. package/dist/client/SecrecyPayClient.cjs.map +1 -0
  44. package/dist/client/SecrecyPayClient.d.ts +16 -28
  45. package/dist/client/SecrecyPayClient.js +2 -68
  46. package/dist/client/SecrecyPayClient.js.map +1 -0
  47. package/dist/client/SecrecyWalletClient.cjs +2 -0
  48. package/dist/client/SecrecyWalletClient.cjs.map +1 -0
  49. package/dist/client/SecrecyWalletClient.d.ts +16 -30
  50. package/dist/client/SecrecyWalletClient.js +2 -73
  51. package/dist/client/SecrecyWalletClient.js.map +1 -0
  52. package/dist/client/convert/file.cjs +2 -0
  53. package/dist/client/convert/file.cjs.map +1 -0
  54. package/dist/client/convert/file.d.ts +11 -5
  55. package/dist/client/convert/file.js +2 -33
  56. package/dist/client/convert/file.js.map +1 -0
  57. package/dist/client/convert/mail.cjs +2 -0
  58. package/dist/client/convert/mail.cjs.map +1 -0
  59. package/dist/client/convert/mail.d.ts +13 -3
  60. package/dist/client/convert/mail.js +2 -42
  61. package/dist/client/convert/mail.js.map +1 -0
  62. package/dist/client/convert/node.cjs +2 -0
  63. package/dist/client/convert/node.cjs.map +1 -0
  64. package/dist/client/convert/node.d.ts +18 -9
  65. package/dist/client/convert/node.js +2 -87
  66. package/dist/client/convert/node.js.map +1 -0
  67. package/dist/client/helpers.cjs +2 -0
  68. package/dist/client/helpers.cjs.map +1 -0
  69. package/dist/client/helpers.d.ts +16 -28
  70. package/dist/client/helpers.js +2 -119
  71. package/dist/client/helpers.js.map +1 -0
  72. package/dist/client/index.cjs +2 -0
  73. package/dist/client/index.cjs.map +1 -0
  74. package/dist/client/index.d.ts +16 -34
  75. package/dist/client/index.js +2 -46
  76. package/dist/client/index.js.map +1 -0
  77. package/dist/client/storage.cjs +2 -0
  78. package/dist/client/storage.cjs.map +1 -0
  79. package/dist/client/storage.d.ts +6 -3
  80. package/dist/client/storage.js +2 -12
  81. package/dist/client/storage.js.map +1 -0
  82. package/dist/client/types/File.cjs +1 -0
  83. package/dist/client/types/File.cjs.map +1 -0
  84. package/dist/client/types/File.d.ts +9 -5
  85. package/dist/client/types/File.js +1 -3
  86. package/dist/client/types/File.js.map +1 -0
  87. package/dist/client/types/Inputs.cjs +1 -0
  88. package/dist/client/types/Inputs.cjs.map +1 -0
  89. package/dist/client/types/Inputs.d.ts +6 -4
  90. package/dist/client/types/Inputs.js +1 -3
  91. package/dist/client/types/Inputs.js.map +1 -0
  92. package/dist/client/types/Node.cjs +1 -0
  93. package/dist/client/types/Node.cjs.map +1 -0
  94. package/dist/client/types/Node.d.ts +9 -56
  95. package/dist/client/types/Node.js +1 -3
  96. package/dist/client/types/Node.js.map +1 -0
  97. package/dist/client/types/UserAppNotifications.cjs +1 -0
  98. package/dist/client/types/UserAppNotifications.cjs.map +1 -0
  99. package/dist/client/types/UserAppNotifications.d.ts +3 -1
  100. package/dist/client/types/UserAppNotifications.js +1 -3
  101. package/dist/client/types/UserAppNotifications.js.map +1 -0
  102. package/dist/client/types/UserAppSettings.cjs +1 -0
  103. package/dist/client/types/UserAppSettings.cjs.map +1 -0
  104. package/dist/client/types/UserAppSettings.d.ts +3 -1
  105. package/dist/client/types/UserAppSettings.js +1 -3
  106. package/dist/client/types/UserAppSettings.js.map +1 -0
  107. package/dist/client/types/index.cjs +2 -0
  108. package/dist/client/types/index.cjs.map +1 -0
  109. package/dist/client/types/index.d.ts +86 -30
  110. package/dist/client/types/index.js +2 -8
  111. package/dist/client/types/index.js.map +1 -0
  112. package/dist/client/types/selectors.cjs +2 -0
  113. package/dist/client/types/selectors.cjs.map +1 -0
  114. package/dist/client/types/selectors.d.ts +7 -5
  115. package/dist/client/types/selectors.js +2 -135
  116. package/dist/client/types/selectors.js.map +1 -0
  117. package/dist/crypto/file.cjs +2 -0
  118. package/dist/crypto/file.cjs.map +1 -0
  119. package/dist/crypto/file.d.ts +8 -6
  120. package/dist/crypto/file.js +2 -195
  121. package/dist/crypto/file.js.map +1 -0
  122. package/dist/crypto/index.cjs +2 -0
  123. package/dist/crypto/index.cjs.map +1 -0
  124. package/dist/crypto/index.d.ts +11 -9
  125. package/dist/crypto/index.js +2 -45
  126. package/dist/crypto/index.js.map +1 -0
  127. package/dist/error.cjs +1 -0
  128. package/dist/error.cjs.map +1 -0
  129. package/dist/error.d.ts +13 -11
  130. package/dist/error.js +1 -3
  131. package/dist/error.js.map +1 -0
  132. package/dist/index.cjs +2 -0
  133. package/dist/index.cjs.map +1 -0
  134. package/dist/index.d.ts +19 -14
  135. package/dist/index.js +2 -10
  136. package/dist/index.js.map +1 -0
  137. package/dist/minify/index.cjs +2 -0
  138. package/dist/minify/index.cjs.map +1 -0
  139. package/dist/minify/index.d.ts +4 -2
  140. package/dist/minify/index.js +2 -23
  141. package/dist/minify/index.js.map +1 -0
  142. package/dist/minify/lz4.cjs +3 -0
  143. package/dist/minify/lz4.cjs.map +1 -0
  144. package/dist/minify/lz4.d.ts +7 -5
  145. package/dist/minify/lz4.js +2 -538
  146. package/dist/minify/lz4.js.map +1 -0
  147. package/dist/sodium.cjs +2 -0
  148. package/dist/sodium.cjs.map +1 -0
  149. package/dist/sodium.d.ts +5 -3
  150. package/dist/sodium.js +2 -6
  151. package/dist/sodium.js.map +1 -0
  152. package/dist/utils/encoders.cjs +2 -0
  153. package/dist/utils/encoders.cjs.map +1 -0
  154. package/dist/utils/encoders.d.ts +6 -4
  155. package/dist/utils/encoders.js +2 -18
  156. package/dist/utils/encoders.js.map +1 -0
  157. package/dist/utils/store-buddy.cjs +2 -0
  158. package/dist/utils/store-buddy.cjs.map +1 -0
  159. package/dist/utils/store-buddy.d.ts +4 -3
  160. package/dist/utils/store-buddy.js +2 -58
  161. package/dist/utils/store-buddy.js.map +1 -0
  162. package/dist/utils/time.cjs +2 -0
  163. package/dist/utils/time.cjs.map +1 -0
  164. package/dist/utils/time.d.ts +4 -2
  165. package/dist/utils/time.js +2 -12
  166. package/dist/utils/time.js.map +1 -0
  167. package/dist/utils/utils.cjs +2 -0
  168. package/dist/utils/utils.cjs.map +1 -0
  169. package/dist/utils/utils.d.ts +6 -4
  170. package/dist/utils/utils.js +2 -47
  171. package/dist/utils/utils.js.map +1 -0
  172. package/dist/worker/md5.cjs +2 -0
  173. package/dist/worker/md5.cjs.map +1 -0
  174. package/dist/worker/md5.d.ts +3 -1
  175. package/dist/worker/md5.js +2 -24
  176. package/dist/worker/md5.js.map +1 -0
  177. package/dist/worker/sodium.cjs +2 -0
  178. package/dist/worker/sodium.cjs.map +1 -0
  179. package/dist/worker/sodium.d.ts +6 -3
  180. package/dist/worker/sodium.js +2 -118
  181. package/dist/worker/sodium.js.map +1 -0
  182. package/dist/worker/workerCodes.cjs +254 -0
  183. package/dist/worker/workerCodes.cjs.map +1 -0
  184. package/dist/worker/workerCodes.d.ts +4 -2
  185. package/dist/worker/workerCodes.js +4 -5
  186. package/dist/worker/workerCodes.js.map +1 -0
  187. package/dist/zeus/const.cjs +2 -0
  188. package/dist/zeus/const.cjs.map +1 -0
  189. package/dist/zeus/const.d.ts +5 -3
  190. package/dist/zeus/const.js +2 -1846
  191. package/dist/zeus/const.js.map +1 -0
  192. package/dist/zeus/index.cjs +5 -0
  193. package/dist/zeus/index.cjs.map +1 -0
  194. package/dist/zeus/index.d.ts +91 -89
  195. package/dist/zeus/index.js +5 -642
  196. package/dist/zeus/index.js.map +1 -0
  197. package/package.json +2 -2
@@ -1,46 +1,2 @@
1
- import _classPrivateFieldLooseBase from "@babel/runtime/helpers/classPrivateFieldLooseBase";
2
- import _classPrivateFieldLooseKey from "@babel/runtime/helpers/classPrivateFieldLooseKey";
3
- /* eslint-disable @typescript-eslint/naming-convention */
4
- import { BaseClient } from "../BaseClient.js";
5
- import { encryptSecretstream } from "../crypto/file.js";
6
- import { sodium } from "../sodium.js";
7
- import { SecrecyCloudClient } from "./SecrecyCloudClient.js";
8
- import { SecrecyMailClient } from "./SecrecyMailClient.js";
9
- import { SecrecyAppClient } from "./SecrecyAppClient.js";
10
- import { nodesCache, filesCache } from "../cache.js";
11
- import { SecrecyDbClient } from "./SecrecyDbClient.js";
12
- import { SecrecyWalletClient } from "./SecrecyWalletClient.js";
13
- import { SecrecyPayClient } from "./SecrecyPayClient.js";
14
- export const encryptName = async (name, nameKey) => {
15
- const {
16
- data
17
- } = await encryptSecretstream(sodium.from_hex(nameKey), sodium.from_string(name));
18
- const nameEncrypted = sodium.to_hex(data);
19
- return nameEncrypted;
20
- };
21
- var _keys = /*#__PURE__*/_classPrivateFieldLooseKey("keys");
22
- export class SecrecyClient extends BaseClient {
23
- constructor(uaSession, uaKeys, uaJwt, env) {
24
- super(uaSession, env);
25
- Object.defineProperty(this, _keys, {
26
- writable: true,
27
- value: void 0
28
- });
29
- _classPrivateFieldLooseBase(this, _keys)[_keys] = uaKeys;
30
- this.cloud = new SecrecyCloudClient(this, _classPrivateFieldLooseBase(this, _keys)[_keys], this.thunder);
31
- this.mail = new SecrecyMailClient(this, _classPrivateFieldLooseBase(this, _keys)[_keys], this.thunder);
32
- this.app = new SecrecyAppClient(uaJwt, this, _classPrivateFieldLooseBase(this, _keys)[_keys], this.thunder);
33
- this.db = new SecrecyDbClient(this, _classPrivateFieldLooseBase(this, _keys)[_keys], this.thunder);
34
- this.wallet = new SecrecyWalletClient(this);
35
- this.pay = new SecrecyPayClient(this, _classPrivateFieldLooseBase(this, _keys)[_keys], this.thunder);
36
- }
37
- get publicKey() {
38
- return _classPrivateFieldLooseBase(this, _keys)[_keys].publicKey;
39
- }
40
- async logout(sessionId) {
41
- nodesCache.clear();
42
- filesCache.clear();
43
- await super.logout(sessionId);
44
- }
45
- }
46
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJC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CLGVBQWUsQ0FBQyxJQUFJLDhCQUFFLElBQUksaUJBQVEsSUFBSSxDQUFDa0IsT0FBTyxDQUFDO0lBQzdELElBQUksQ0FBQ0ksTUFBTSxHQUFHLElBQUlyQixtQkFBbUIsQ0FBQyxJQUFJLENBQUM7SUFDM0MsSUFBSSxDQUFDc0IsR0FBRyxHQUFHLElBQUlyQixnQkFBZ0IsQ0FBQyxJQUFJLDhCQUFFLElBQUksaUJBQVEsSUFBSSxDQUFDZ0IsT0FBTyxDQUFDO0VBQ2pFO0VBRUEsSUFBSU0sU0FBUyxHQUFXO0lBQ3RCLE9BQU8sZ0NBQUksZ0JBQU9BLFNBQVM7RUFDN0I7RUFFQSxNQUFNQyxNQUFNLENBQUNDLFNBQXFDLEVBQWlCO0lBQ2pFNUIsVUFBVSxDQUFDNkIsS0FBSyxFQUFFO0lBQ2xCNUIsVUFBVSxDQUFDNEIsS0FBSyxFQUFFO0lBQ2xCLE1BQU0sS0FBSyxDQUFDRixNQUFNLENBQUNDLFNBQVMsQ0FBQztFQUMvQjtBQUNGIn0=
1
+ import{BaseClient as o}from"../BaseClient.js";import{encryptSecretstream as c}from"../crypto/file.js";import{sodium as r}from"../sodium.js";import{SecrecyCloudClient as l}from"./SecrecyCloudClient.js";import{SecrecyMailClient as p}from"./SecrecyMailClient.js";import{SecrecyAppClient as y}from"./SecrecyAppClient.js";import{nodesCache as a,filesCache as m}from"../cache.js";import{SecrecyDbClient as h}from"./SecrecyDbClient.js";import{SecrecyWalletClient as d}from"./SecrecyWalletClient.js";import{SecrecyPayClient as u}from"./SecrecyPayClient.js";const v=async(i,e)=>{const{data:t}=await c(r.from_hex(e),r.from_string(i));return r.to_hex(t)};class E extends o{#e;cloud;mail;app;db;wallet;pay;constructor(e,t,s,n){super(e,n),this.#e=t,this.cloud=new l(this,this.#e,this.thunder),this.mail=new p(this,this.#e,this.thunder),this.app=new y(s,this,this.#e,this.thunder),this.db=new h(this,this.#e,this.thunder),this.wallet=new d(this),this.pay=new u(this,this.#e,this.thunder)}get publicKey(){return this.#e.publicKey}async logout(e){a.clear(),m.clear(),await super.logout(e)}}export{E as SecrecyClient,v as encryptName};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/client/index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport { BaseClient } from \"../BaseClient.js\";\nimport type { Progress } from \"../crypto/file.js\";\nimport { encryptSecretstream } from \"../crypto/file.js\";\nimport { sodium } from \"../sodium.js\";\nimport type { KeyPair } from \"../crypto/index.js\";\nimport type { SecrecyEnv } from \"./helpers.js\";\nimport { SecrecyCloudClient } from \"./SecrecyCloudClient.js\";\nimport { SecrecyMailClient } from \"./SecrecyMailClient.js\";\nimport { SecrecyAppClient } from \"./SecrecyAppClient.js\";\nimport { nodesCache, filesCache } from \"../cache.js\";\nimport { SecrecyDbClient } from \"./SecrecyDbClient.js\";\nimport { SecrecyWalletClient } from \"./SecrecyWalletClient.js\";\nimport { SecrecyPayClient } from \"./SecrecyPayClient.js\";\n\nexport type NewMail = {\n body: string;\n subject: string;\n files: { id: string; name: string }[];\n recipientsIds: string[];\n replyTo?: string | null | undefined;\n};\nexport type ProgressCallback = (progress: Progress) => Promise<void>;\n\nexport const encryptName = async (\n name: string,\n nameKey: string\n): Promise<string> => {\n const { data } = await encryptSecretstream(\n sodium.from_hex(nameKey),\n sodium.from_string(name)\n );\n const nameEncrypted = sodium.to_hex(data);\n return nameEncrypted;\n};\n\nexport class SecrecyClient extends BaseClient {\n #keys: KeyPair;\n\n cloud: SecrecyCloudClient;\n\n mail: SecrecyMailClient;\n\n app: SecrecyAppClient;\n\n db: SecrecyDbClient;\n\n wallet: SecrecyWalletClient;\n\n pay: SecrecyPayClient;\n\n constructor(\n uaSession: string,\n uaKeys: KeyPair,\n uaJwt: string,\n env: SecrecyEnv\n ) {\n super(uaSession, env);\n this.#keys = uaKeys;\n this.cloud = new SecrecyCloudClient(this, this.#keys, this.thunder);\n this.mail = new SecrecyMailClient(this, this.#keys, this.thunder);\n this.app = new SecrecyAppClient(uaJwt, this, this.#keys, this.thunder);\n this.db = new SecrecyDbClient(this, this.#keys, this.thunder);\n this.wallet = new SecrecyWalletClient(this);\n this.pay = new SecrecyPayClient(this, this.#keys, this.thunder);\n }\n\n get publicKey(): string {\n return this.#keys.publicKey;\n }\n\n async logout(sessionId?: string | null | undefined): Promise<void> {\n nodesCache.clear();\n filesCache.clear();\n await super.logout(sessionId);\n }\n}\n"],"mappings":"AACA,OAAS,cAAAA,MAAkB,mBAE3B,OAAS,uBAAAC,MAA2B,oBACpC,OAAS,UAAAC,MAAc,eAGvB,OAAS,sBAAAC,MAA0B,0BACnC,OAAS,qBAAAC,MAAyB,yBAClC,OAAS,oBAAAC,MAAwB,wBACjC,OAAS,cAAAC,EAAY,cAAAC,MAAkB,cACvC,OAAS,mBAAAC,MAAuB,uBAChC,OAAS,uBAAAC,MAA2B,2BACpC,OAAS,oBAAAC,MAAwB,wBAW1B,MAAMC,EAAc,MACzBC,EACAC,IACoB,CACpB,KAAM,CAAE,KAAAC,CAAK,EAAI,MAAMb,EACrBC,EAAO,SAASW,CAAO,EACvBX,EAAO,YAAYU,CAAI,CACzB,EAEA,OADsBV,EAAO,OAAOY,CAAI,CAE1C,EAEO,MAAMC,UAAsBf,CAAW,CAC5CgB,GAEA,MAEA,KAEA,IAEA,GAEA,OAEA,IAEA,YACEC,EACAC,EACAC,EACAC,EACA,CACA,MAAMH,EAAWG,CAAG,EACpB,KAAKJ,GAAQE,EACb,KAAK,MAAQ,IAAIf,EAAmB,KAAM,KAAKa,GAAO,KAAK,OAAO,EAClE,KAAK,KAAO,IAAIZ,EAAkB,KAAM,KAAKY,GAAO,KAAK,OAAO,EAChE,KAAK,IAAM,IAAIX,EAAiBc,EAAO,KAAM,KAAKH,GAAO,KAAK,OAAO,EACrE,KAAK,GAAK,IAAIR,EAAgB,KAAM,KAAKQ,GAAO,KAAK,OAAO,EAC5D,KAAK,OAAS,IAAIP,EAAoB,IAAI,EAC1C,KAAK,IAAM,IAAIC,EAAiB,KAAM,KAAKM,GAAO,KAAK,OAAO,CAChE,CAEA,IAAI,WAAoB,CACtB,OAAO,KAAKA,GAAM,SACpB,CAEA,MAAM,OAAOK,EAAsD,CACjEf,EAAW,MAAM,EACjBC,EAAW,MAAM,EACjB,MAAM,MAAM,OAAOc,CAAS,CAC9B,CACF","names":["BaseClient","encryptSecretstream","sodium","SecrecyCloudClient","SecrecyMailClient","SecrecyAppClient","nodesCache","filesCache","SecrecyDbClient","SecrecyWalletClient","SecrecyPayClient","encryptName","name","nameKey","data","SecrecyClient","#keys","uaSession","uaKeys","uaJwt","env","sessionId"]}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _storebuddyjs = require('../utils/store-buddy.js');function i(e){const t=_storebuddyjs.storeBuddy.call(void 0, "secrecy.user_app_session",e).init(null),n=_storebuddyjs.storeBuddy.call(void 0, "secrecy.user_app_keys",e).init(null),s=_storebuddyjs.storeBuddy.call(void 0, "secrecy.jwt",e).init(null);return{userAppKeys:n,userAppSession:t,jwt:s}}exports.getStorage = i;
2
+ //# sourceMappingURL=storage.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/client/storage.ts"],"names":["storeBuddy","getStorage","session","userAppSession","userAppKeys","jwt"],"mappings":"AAEA,OAAS,cAAAA,MAAkB,0BAEpB,SAASC,EAAWC,EAIzB,CACA,MAAMC,EAAiBH,EACrB,2BACAE,CACF,EAAE,KAAK,IAAI,EACLE,EAAcJ,EAClB,wBACAE,CACF,EAAE,KAAK,IAAI,EACLG,EAAML,EAA0B,cAAeE,CAAO,EAAE,KAAK,IAAI,EACvE,MAAO,CAAE,YAAAE,EAAa,eAAAD,EAAgB,IAAAE,CAAI,CAC5C","sourcesContent":["import type { KeyPair } from \"../index.js\";\nimport type { StoreBuddy } from \"../utils/store-buddy.js\";\nimport { storeBuddy } from \"../utils/store-buddy.js\";\n\nexport function getStorage(session?: boolean | undefined): {\n userAppKeys: StoreBuddy<KeyPair | null>;\n userAppSession: StoreBuddy<string | null>;\n jwt: StoreBuddy<string | null>;\n} {\n const userAppSession = storeBuddy<string | null>(\n `secrecy.user_app_session`,\n session\n ).init(null);\n const userAppKeys = storeBuddy<KeyPair | null>(\n `secrecy.user_app_keys`,\n session\n ).init(null);\n const jwt = storeBuddy<string | null>(`secrecy.jwt`, session).init(null);\n return { userAppKeys, userAppSession, jwt };\n}\n"]}
@@ -1,7 +1,10 @@
1
- import type { KeyPair } from "../index.js";
2
- import type { StoreBuddy } from "../utils/store-buddy.js";
3
- export declare function getStorage(session?: boolean | undefined): {
1
+ import { KeyPair } from '../crypto/index.js';
2
+ import { StoreBuddy } from '../utils/store-buddy.js';
3
+
4
+ declare function getStorage(session?: boolean | undefined): {
4
5
  userAppKeys: StoreBuddy<KeyPair | null>;
5
6
  userAppSession: StoreBuddy<string | null>;
6
7
  jwt: StoreBuddy<string | null>;
7
8
  };
9
+
10
+ export { getStorage };
@@ -1,12 +1,2 @@
1
- import { storeBuddy } from "../utils/store-buddy.js";
2
- export function getStorage(session) {
3
- const userAppSession = storeBuddy(`secrecy.user_app_session`, session).init(null);
4
- const userAppKeys = storeBuddy(`secrecy.user_app_keys`, session).init(null);
5
- const jwt = storeBuddy(`secrecy.jwt`, session).init(null);
6
- return {
7
- userAppKeys,
8
- userAppSession,
9
- jwt
10
- };
11
- }
12
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJzdG9yZUJ1ZGR5IiwiZ2V0U3RvcmFnZSIsInNlc3Npb24iLCJ1c2VyQXBwU2Vzc2lvbiIsImluaXQiLCJ1c2VyQXBwS2V5cyIsImp3dCJdLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jbGllbnQvc3RvcmFnZS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IEtleVBhaXIgfSBmcm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sRUFDMUJFLE9BQU8sQ0FDUixDQUFDRSxJQUFJLENBQUMsSUFBSSxDQUFDO0VBQ1osTUFBTUMsV0FBVyxHQUFHTCxVQUFVLENBQzNCLHVCQUFzQixFQUN2QkUsT0FBTyxDQUNSLENBQUNFLElBQUksQ0FBQyxJQUFJLENBQUM7RUFDWixNQUFNRSxHQUFHLEdBQUdOLFVBQVUsQ0FBaUIsYUFBWSxFQUFFRSxPQUFPLENBQUMsQ0FBQ0UsSUFBSSxDQUFDLElBQUksQ0FBQztFQUN4RSxPQUFPO0lBQUVDLFdBQVc7SUFBRUYsY0FBYztJQUFFRztFQUFJLENBQUM7QUFDN0MifQ==
1
+ import{storeBuddy as r}from"../utils/store-buddy.js";function i(e){const t=r("secrecy.user_app_session",e).init(null),n=r("secrecy.user_app_keys",e).init(null),s=r("secrecy.jwt",e).init(null);return{userAppKeys:n,userAppSession:t,jwt:s}}export{i as getStorage};
2
+ //# sourceMappingURL=storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/client/storage.ts"],"sourcesContent":["import type { KeyPair } from \"../index.js\";\nimport type { StoreBuddy } from \"../utils/store-buddy.js\";\nimport { storeBuddy } from \"../utils/store-buddy.js\";\n\nexport function getStorage(session?: boolean | undefined): {\n userAppKeys: StoreBuddy<KeyPair | null>;\n userAppSession: StoreBuddy<string | null>;\n jwt: StoreBuddy<string | null>;\n} {\n const userAppSession = storeBuddy<string | null>(\n `secrecy.user_app_session`,\n session\n ).init(null);\n const userAppKeys = storeBuddy<KeyPair | null>(\n `secrecy.user_app_keys`,\n session\n ).init(null);\n const jwt = storeBuddy<string | null>(`secrecy.jwt`, session).init(null);\n return { userAppKeys, userAppSession, jwt };\n}\n"],"mappings":"AAEA,OAAS,cAAAA,MAAkB,0BAEpB,SAASC,EAAWC,EAIzB,CACA,MAAMC,EAAiBH,EACrB,2BACAE,CACF,EAAE,KAAK,IAAI,EACLE,EAAcJ,EAClB,wBACAE,CACF,EAAE,KAAK,IAAI,EACLG,EAAML,EAA0B,cAAeE,CAAO,EAAE,KAAK,IAAI,EACvE,MAAO,CAAE,YAAAE,EAAa,eAAAD,EAAgB,IAAAE,CAAI,CAC5C","names":["storeBuddy","getStorage","session","userAppSession","userAppKeys","jwt"]}
@@ -0,0 +1 @@
1
+ "use strict";//# sourceMappingURL=File.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,6 +1,8 @@
1
- import type { GraphQLTypes, InputType } from "../../zeus/index.js";
2
- import type { fileSelector } from "./selectors.js";
3
- export type FileMetadata = {
1
+ import { InputType, GraphQLTypes } from '../../zeus/index.js';
2
+ import { fileSelector } from './selectors.js';
3
+ import '../../zeus/const.js';
4
+
5
+ type FileMetadata = {
4
6
  id: string;
5
7
  size: bigint;
6
8
  sizeBefore: bigint;
@@ -8,7 +10,9 @@ export type FileMetadata = {
8
10
  md5Encrypted: string;
9
11
  createdAt: Date;
10
12
  };
11
- export type InternalFile = FileMetadata & {
13
+ type InternalFile = FileMetadata & {
12
14
  key: string;
13
15
  };
14
- export type GQLFile = InputType<GraphQLTypes["File"], typeof fileSelector>;
16
+ type GQLFile = InputType<GraphQLTypes["File"], typeof fileSelector>;
17
+
18
+ export { FileMetadata, GQLFile, InternalFile };
@@ -1,3 +1 @@
1
- export {};
2
- export {};
3
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NsaWVudC90eXBlcy9GaWxlLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgR3JhcGhRTFR5cGVzLCBJbnB1dFR5cGUgfSBmcm9tIFwiLi4vLi4vemV1cy9pbmRleC5qc1wiO1xuaW1wb3J0IHR5cGUgeyBmaWxlU2VsZWN0b3IgfSBmcm9tIFwiLi9zZWxlY3RvcnMuanNcIjtcblxuZXhwb3J0IHR5cGUgRmlsZU1ldGFkYXRhID0ge1xuICBpZDogc3RyaW5nO1xuICBzaXplOiBiaWdpbnQ7XG4gIHNpemVCZWZvcmU6IGJpZ2ludDtcbiAgbWQ1OiBzdHJpbmc7XG4gIG1kNUVuY3J5cHRlZDogc3RyaW5nO1xuICBjcmVhdGVkQXQ6IERhdGU7XG59O1xuXG5leHBvcnQgdHlwZSBJbnRlcm5hbEZpbGUgPSBGaWxlTWV0YWRhdGEgJiB7XG4gIGtleTogc3RyaW5nO1xufTtcblxuZXhwb3J0IHR5cGUgR1FMRmlsZSA9IElucHV0VHlwZTxHcmFwaFFMVHlwZXNbXCJGaWxlXCJdLCB0eXBlb2YgZmlsZVNlbGVjdG9yPjtcbiJdLCJtYXBwaW5ncyI6IiJ9
1
+ //# sourceMappingURL=File.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1 @@
1
+ "use strict";//# sourceMappingURL=Inputs.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,16 +1,18 @@
1
- export type ShareFileKeyInput = {
1
+ type ShareFileKeyInput = {
2
2
  id: string;
3
3
  key: string;
4
4
  };
5
- export type NameKeyInput = {
5
+ type NameKeyInput = {
6
6
  id: string;
7
7
  nameKey: string;
8
8
  files: ShareFileKeyInput[];
9
9
  };
10
- export type ShareNodesInput = {
10
+ type ShareNodesInput = {
11
11
  nodes: NameKeyInput[];
12
12
  };
13
- export type ShareFileInHistoryInput = {
13
+ type ShareFileInHistoryInput = {
14
14
  fileId: string;
15
15
  users: ShareFileKeyInput[];
16
16
  };
17
+
18
+ export { NameKeyInput, ShareFileInHistoryInput, ShareFileKeyInput, ShareNodesInput };
@@ -1,3 +1 @@
1
- export {};
2
- export {};
3
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NsaWVudC90eXBlcy9JbnB1dHMudHMiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHR5cGUgU2hhcmVGaWxlS2V5SW5wdXQgPSB7XG4gIGlkOiBzdHJpbmc7XG4gIGtleTogc3RyaW5nO1xufTtcblxuZXhwb3J0IHR5cGUgTmFtZUtleUlucHV0ID0ge1xuICBpZDogc3RyaW5nO1xuICBuYW1lS2V5OiBzdHJpbmc7XG4gIGZpbGVzOiBTaGFyZUZpbGVLZXlJbnB1dFtdO1xufTtcblxuZXhwb3J0IHR5cGUgU2hhcmVOb2Rlc0lucHV0ID0ge1xuICBub2RlczogTmFtZUtleUlucHV0W107XG59O1xuXG5leHBvcnQgdHlwZSBTaGFyZUZpbGVJbkhpc3RvcnlJbnB1dCA9IHtcbiAgZmlsZUlkOiBzdHJpbmc7XG4gIHVzZXJzOiBTaGFyZUZpbGVLZXlJbnB1dFtdO1xufTtcbiJdLCJtYXBwaW5ncyI6IiJ9
1
+ //# sourceMappingURL=Inputs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1 @@
1
+ "use strict";//# sourceMappingURL=Node.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,56 +1,9 @@
1
- import type { NodeType, Rights } from "../../zeus/index.js";
2
- import type { FileMetadata, InternalFile, PublicUser } from "./index.js";
3
- import type { nodeFullSelector, nodeSelector } from "./selectors.js";
4
- import type { GraphQLTypes, InputType } from "../../zeus/index.js";
5
- export type NodeAccess<T extends Record<string, unknown> = Record<string, unknown>> = T & {
6
- rights: Rights;
7
- isRoot: boolean;
8
- sharedBy: {
9
- keyPair?: {
10
- pub: string;
11
- };
12
- };
13
- userApp: {
14
- user: PublicUser;
15
- };
16
- };
17
- export type NodeBreadcrumbItem = {
18
- id: string;
19
- name: string;
20
- pubKey: string;
21
- };
22
- export type NodeSize = {
23
- size: bigint;
24
- sizeBefore: bigint;
25
- };
26
- type NameKey = {
27
- nameKey?: string;
28
- };
29
- export type InternalNodeBreadcrumbItem = NodeBreadcrumbItem & NameKey;
30
- export type Node<T extends NodeBreadcrumbItem = NodeBreadcrumbItem, U extends Record<string, unknown> = Record<string, unknown>> = {
31
- id: string;
32
- isFavorite: boolean;
33
- type: NodeType;
34
- createdAt: Date;
35
- deletedAt: Date | null;
36
- updatedAt: Date;
37
- sizes: NodeSize;
38
- name: string;
39
- breadcrumb: T[];
40
- createdBy: PublicUser;
41
- access?: NodeAccess<U>;
42
- users: [PublicUser, Rights][];
43
- parentId: string | null;
44
- currentFileId: string | null;
45
- };
46
- export type NodeFull<T extends NodeBreadcrumbItem = NodeBreadcrumbItem, U extends Record<string, unknown> = Record<string, unknown>, V extends FileMetadata = FileMetadata> = Node<T, U> & {
47
- parent: Node<T, U> | null;
48
- children: Node<T, U>[];
49
- current?: V;
50
- history: V[];
51
- };
52
- export type InternalNode = Node<InternalNodeBreadcrumbItem, NameKey>;
53
- export type InternalNodeFull = NodeFull<InternalNodeBreadcrumbItem, NameKey, InternalFile>;
54
- export type GQLNode = InputType<GraphQLTypes["Node"], typeof nodeSelector>;
55
- export type GQLNodeFull = InputType<GraphQLTypes["Node"], typeof nodeFullSelector>;
56
- export {};
1
+ import '../../zeus/index.js';
2
+ export { GQLNode, GQLNodeFull, InternalNode, InternalNodeBreadcrumbItem, InternalNodeFull, Node, NodeAccess, NodeBreadcrumbItem, NodeFull, NodeSize } from './index.js';
3
+ import './selectors.js';
4
+ import './File.js';
5
+ import '../../zeus/const.js';
6
+ import '../../crypto/index.js';
7
+ import './UserAppSettings.js';
8
+ import './UserAppNotifications.js';
9
+ import './Inputs.js';
@@ -1,3 +1 @@
1
- export {};
2
- export {};
3
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NsaWVudC90eXBlcy9Ob2RlLnRzIl0sInNvdXJj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5cGUgSW50ZXJuYWxOb2RlID0gTm9kZTxJbnRlcm5hbE5vZGVCcmVhZGNydW1iSXRlbSwgTmFtZUtleT47XG5cbmV4cG9ydCB0eXBlIEludGVybmFsTm9kZUZ1bGwgPSBOb2RlRnVsbDxcbiAgSW50ZXJuYWxOb2RlQnJlYWRjcnVtYkl0ZW0sXG4gIE5hbWVLZXksXG4gIEludGVybmFsRmlsZVxuPjtcblxuZXhwb3J0IHR5cGUgR1FMTm9kZSA9IElucHV0VHlwZTxHcmFwaFFMVHlwZXNbXCJOb2RlXCJdLCB0eXBlb2Ygbm9kZVNlbGVjdG9yPjtcbmV4cG9ydCB0eXBlIEdRTE5vZGVGdWxsID0gSW5wdXRUeXBlPFxuICBHcmFwaFFMVHlwZXNbXCJOb2RlXCJdLFxuICB0eXBlb2Ygbm9kZUZ1bGxTZWxlY3RvclxuPjtcbiJdLCJtYXBwaW5ncyI6IiJ9
1
+ //# sourceMappingURL=Node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1 @@
1
+ "use strict";//# sourceMappingURL=UserAppNotifications.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,6 +1,8 @@
1
- export type UserAppNotifications = {
1
+ type UserAppNotifications = {
2
2
  enableAll: boolean;
3
3
  mail: boolean;
4
4
  cloud: boolean;
5
5
  disableAllUntil?: Date;
6
6
  };
7
+
8
+ export { UserAppNotifications };
@@ -1,3 +1 @@
1
- export {};
2
- export {};
3
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NsaWVudC90eXBlcy9Vc2VyQXBwTm90aWZpY2F0aW9ucy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgdHlwZSBVc2VyQXBwTm90aWZpY2F0aW9ucyA9IHtcbiAgZW5hYmxlQWxsOiBib29sZWFuO1xuICBtYWlsOiBib29sZWFuO1xuICBjbG91ZDogYm9vbGVhbjtcbiAgZGlzYWJsZUFsbFVudGlsPzogRGF0ZTtcbn07XG4iXSwibWFwcGluZ3MiOiIifQ==
1
+ //# sourceMappingURL=UserAppNotifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1 @@
1
+ "use strict";//# sourceMappingURL=UserAppSettings.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,5 +1,7 @@
1
- export type UserAppSettings = {
1
+ type UserAppSettings = {
2
2
  cloudNodeDaysForDelete: number;
3
3
  historyFileDaysForDelete?: number;
4
4
  historyMaxFileCount: number;
5
5
  };
6
+
7
+ export { UserAppSettings };
@@ -1,3 +1 @@
1
- export {};
2
- export {};
3
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NsaWVudC90eXBlcy9Vc2VyQXBwU2V0dGluZ3MudHMiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHR5cGUgVXNlckFwcFNldHRpbmdzID0ge1xuICBjbG91ZE5vZGVEYXlzRm9yRGVsZXRlOiBudW1iZXI7XG4gIGhpc3RvcnlGaWxlRGF5c0ZvckRlbGV0ZT86IG51bWJlcjtcbiAgaGlzdG9yeU1heEZpbGVDb3VudDogbnVtYmVyO1xufTtcbiJdLCJtYXBwaW5ncyI6IiJ9
1
+ //# sourceMappingURL=UserAppSettings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }var _Filejs = require('./File.js'); _createStarExport(_Filejs);var _Nodejs = require('./Node.js'); _createStarExport(_Nodejs);var _UserAppSettingsjs = require('./UserAppSettings.js'); _createStarExport(_UserAppSettingsjs);var _UserAppNotificationsjs = require('./UserAppNotifications.js'); _createStarExport(_UserAppNotificationsjs);var _Inputsjs = require('./Inputs.js'); _createStarExport(_Inputsjs);
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/client/types/index.ts"],"names":[],"mappings":"AAGA,WAAc,YACd,WAAc,YACd,WAAc,uBACd,WAAc,4BACd,WAAc","sourcesContent":["import type { KeyPair } from \"../../index.js\";\nimport type { InputType, GraphQLTypes } from \"../../zeus/index.js\";\nimport type { mailSelector, userSelector } from \"./selectors.js\";\nexport * from \"./File.js\";\nexport * from \"./Node.js\";\nexport * from \"./UserAppSettings.js\";\nexport * from \"./UserAppNotifications.js\";\nexport * from \"./Inputs.js\";\n\nexport type SecrecyUserApp = {\n keys: KeyPair;\n jwt: string;\n uaSession: string;\n};\n\nexport interface FileContentPart {\n contentUrl: string;\n order: number;\n md5: string;\n}\n\nexport type FilePartResponse = {\n order: number;\n fields: Record<string, string>;\n url: string;\n};\n\nexport type MailFileInput = { id: string; name: string; fileKey: string };\n\nexport type MailIntegrity = {\n id: string;\n hash: string;\n hashKey: string;\n replyTo?: {\n id: string;\n };\n temporaryRecipients: TemporaryMailUser[];\n recipients: PublicUser[];\n};\n\nexport type MailIntegrityDraft = MailIntegrity & {\n recipients: PublicUser[];\n};\n\nexport type TemporaryMailUser = {\n email?: string;\n};\n\nexport type InternalWaitingReceivedMail = {\n sender: PublicUser;\n date: string;\n attachmentsCount: number;\n recipients: PublicUser[];\n temporaryRecipients: TemporaryMailUser[];\n};\n\nexport type WaitingReceivedMail = {\n id: string;\n sender: PublicUser;\n date: Date;\n attachmentsCount: number;\n recipients: PublicUser[];\n temporaryRecipients: TemporaryMailUser[];\n};\n\nexport type MailFile = {\n fileKey: string;\n filename: string;\n file: {\n id: string;\n };\n};\n\nexport type MailType = \"sent\" | \"received\" | \"draft\";\n\nexport type GQLMail = InputType<GraphQLTypes[\"Mail\"], typeof mailSelector>;\n\nexport type InternalReceivedMail = {\n user: {\n receivedMails: GQLMail[];\n };\n};\n\nexport type BaseMail = {\n type: MailType;\n id: string;\n mailIntegrityId: string;\n replyTo?: string;\n body: string;\n subject: string;\n createdAt: Date;\n deletedAt: Date | null;\n openedAt: Date | null;\n isAltered: boolean;\n recipients: Omit<PublicUser, \"publicKey\">[];\n temporaryRecipients: TemporaryMailUser[];\n files: { id: string; name: string; key: string }[];\n};\n\nexport type PublicUser = InputType<GraphQLTypes[\"User\"], typeof userSelector>;\n\nexport interface ReceivedMail extends BaseMail {\n type: \"received\";\n sender: PublicUser;\n}\n\nexport type InternalSentMail = {\n user: {\n sentMails: GQLMail[];\n };\n};\n\nexport type InternalDraftMails = {\n user: {\n draftMails: GQLMail[];\n };\n};\n\nexport interface SentMail extends BaseMail {\n type: \"sent\";\n}\n\nexport interface DraftMail extends BaseMail {\n type: \"draft\";\n}\n\nexport type Mail = DraftMail | SentMail | ReceivedMail;\n\nexport type MailRecipientInput = {\n body: string;\n subject: string;\n recipientId: string;\n files: MailFileInput[];\n};\n"]}
@@ -1,32 +1,86 @@
1
- import type { KeyPair } from "../../index.js";
2
- import type { InputType, GraphQLTypes } from "../../zeus/index.js";
3
- import type { mailSelector, userSelector } from "./selectors.js";
4
- export * from "./File.js";
5
- export * from "./Node.js";
6
- export * from "./UserAppSettings.js";
7
- export * from "./UserAppNotifications.js";
8
- export * from "./Inputs.js";
9
- export type SecrecyUserApp = {
1
+ import { Rights, NodeType, InputType, GraphQLTypes } from '../../zeus/index.js';
2
+ import { KeyPair } from '../../crypto/index.js';
3
+ import { nodeSelector, nodeFullSelector, mailSelector, userSelector } from './selectors.js';
4
+ import { FileMetadata, InternalFile } from './File.js';
5
+ export { GQLFile } from './File.js';
6
+ export { UserAppSettings } from './UserAppSettings.js';
7
+ export { UserAppNotifications } from './UserAppNotifications.js';
8
+ export { NameKeyInput, ShareFileInHistoryInput, ShareFileKeyInput, ShareNodesInput } from './Inputs.js';
9
+ import '../../zeus/const.js';
10
+
11
+ type NodeAccess<T extends Record<string, unknown> = Record<string, unknown>> = T & {
12
+ rights: Rights;
13
+ isRoot: boolean;
14
+ sharedBy: {
15
+ keyPair?: {
16
+ pub: string;
17
+ };
18
+ };
19
+ userApp: {
20
+ user: PublicUser;
21
+ };
22
+ };
23
+ type NodeBreadcrumbItem = {
24
+ id: string;
25
+ name: string;
26
+ pubKey: string;
27
+ };
28
+ type NodeSize = {
29
+ size: bigint;
30
+ sizeBefore: bigint;
31
+ };
32
+ type NameKey = {
33
+ nameKey?: string;
34
+ };
35
+ type InternalNodeBreadcrumbItem = NodeBreadcrumbItem & NameKey;
36
+ type Node<T extends NodeBreadcrumbItem = NodeBreadcrumbItem, U extends Record<string, unknown> = Record<string, unknown>> = {
37
+ id: string;
38
+ isFavorite: boolean;
39
+ type: NodeType;
40
+ createdAt: Date;
41
+ deletedAt: Date | null;
42
+ updatedAt: Date;
43
+ sizes: NodeSize;
44
+ name: string;
45
+ breadcrumb: T[];
46
+ createdBy: PublicUser;
47
+ access?: NodeAccess<U>;
48
+ users: [PublicUser, Rights][];
49
+ parentId: string | null;
50
+ currentFileId: string | null;
51
+ };
52
+ type NodeFull<T extends NodeBreadcrumbItem = NodeBreadcrumbItem, U extends Record<string, unknown> = Record<string, unknown>, V extends FileMetadata = FileMetadata> = Node<T, U> & {
53
+ parent: Node<T, U> | null;
54
+ children: Node<T, U>[];
55
+ current?: V;
56
+ history: V[];
57
+ };
58
+ type InternalNode = Node<InternalNodeBreadcrumbItem, NameKey>;
59
+ type InternalNodeFull = NodeFull<InternalNodeBreadcrumbItem, NameKey, InternalFile>;
60
+ type GQLNode = InputType<GraphQLTypes["Node"], typeof nodeSelector>;
61
+ type GQLNodeFull = InputType<GraphQLTypes["Node"], typeof nodeFullSelector>;
62
+
63
+ type SecrecyUserApp = {
10
64
  keys: KeyPair;
11
65
  jwt: string;
12
66
  uaSession: string;
13
67
  };
14
- export interface FileContentPart {
68
+ interface FileContentPart {
15
69
  contentUrl: string;
16
70
  order: number;
17
71
  md5: string;
18
72
  }
19
- export type FilePartResponse = {
73
+ type FilePartResponse = {
20
74
  order: number;
21
75
  fields: Record<string, string>;
22
76
  url: string;
23
77
  };
24
- export type MailFileInput = {
78
+ type MailFileInput = {
25
79
  id: string;
26
80
  name: string;
27
81
  fileKey: string;
28
82
  };
29
- export type MailIntegrity = {
83
+ type MailIntegrity = {
30
84
  id: string;
31
85
  hash: string;
32
86
  hashKey: string;
@@ -36,20 +90,20 @@ export type MailIntegrity = {
36
90
  temporaryRecipients: TemporaryMailUser[];
37
91
  recipients: PublicUser[];
38
92
  };
39
- export type MailIntegrityDraft = MailIntegrity & {
93
+ type MailIntegrityDraft = MailIntegrity & {
40
94
  recipients: PublicUser[];
41
95
  };
42
- export type TemporaryMailUser = {
96
+ type TemporaryMailUser = {
43
97
  email?: string;
44
98
  };
45
- export type InternalWaitingReceivedMail = {
99
+ type InternalWaitingReceivedMail = {
46
100
  sender: PublicUser;
47
101
  date: string;
48
102
  attachmentsCount: number;
49
103
  recipients: PublicUser[];
50
104
  temporaryRecipients: TemporaryMailUser[];
51
105
  };
52
- export type WaitingReceivedMail = {
106
+ type WaitingReceivedMail = {
53
107
  id: string;
54
108
  sender: PublicUser;
55
109
  date: Date;
@@ -57,21 +111,21 @@ export type WaitingReceivedMail = {
57
111
  recipients: PublicUser[];
58
112
  temporaryRecipients: TemporaryMailUser[];
59
113
  };
60
- export type MailFile = {
114
+ type MailFile = {
61
115
  fileKey: string;
62
116
  filename: string;
63
117
  file: {
64
118
  id: string;
65
119
  };
66
120
  };
67
- export type MailType = "sent" | "received" | "draft";
68
- export type GQLMail = InputType<GraphQLTypes["Mail"], typeof mailSelector>;
69
- export type InternalReceivedMail = {
121
+ type MailType = "sent" | "received" | "draft";
122
+ type GQLMail = InputType<GraphQLTypes["Mail"], typeof mailSelector>;
123
+ type InternalReceivedMail = {
70
124
  user: {
71
125
  receivedMails: GQLMail[];
72
126
  };
73
127
  };
74
- export type BaseMail = {
128
+ type BaseMail = {
75
129
  type: MailType;
76
130
  id: string;
77
131
  mailIntegrityId: string;
@@ -90,31 +144,33 @@ export type BaseMail = {
90
144
  key: string;
91
145
  }[];
92
146
  };
93
- export type PublicUser = InputType<GraphQLTypes["User"], typeof userSelector>;
94
- export interface ReceivedMail extends BaseMail {
147
+ type PublicUser = InputType<GraphQLTypes["User"], typeof userSelector>;
148
+ interface ReceivedMail extends BaseMail {
95
149
  type: "received";
96
150
  sender: PublicUser;
97
151
  }
98
- export type InternalSentMail = {
152
+ type InternalSentMail = {
99
153
  user: {
100
154
  sentMails: GQLMail[];
101
155
  };
102
156
  };
103
- export type InternalDraftMails = {
157
+ type InternalDraftMails = {
104
158
  user: {
105
159
  draftMails: GQLMail[];
106
160
  };
107
161
  };
108
- export interface SentMail extends BaseMail {
162
+ interface SentMail extends BaseMail {
109
163
  type: "sent";
110
164
  }
111
- export interface DraftMail extends BaseMail {
165
+ interface DraftMail extends BaseMail {
112
166
  type: "draft";
113
167
  }
114
- export type Mail = DraftMail | SentMail | ReceivedMail;
115
- export type MailRecipientInput = {
168
+ type Mail = DraftMail | SentMail | ReceivedMail;
169
+ type MailRecipientInput = {
116
170
  body: string;
117
171
  subject: string;
118
172
  recipientId: string;
119
173
  files: MailFileInput[];
120
174
  };
175
+
176
+ export { BaseMail, DraftMail, FileContentPart, FileMetadata, FilePartResponse, GQLMail, GQLNode, GQLNodeFull, InternalDraftMails, InternalFile, InternalNode, InternalNodeBreadcrumbItem, InternalNodeFull, InternalReceivedMail, InternalSentMail, InternalWaitingReceivedMail, Mail, MailFile, MailFileInput, MailIntegrity, MailIntegrityDraft, MailRecipientInput, MailType, Node, NodeAccess, NodeBreadcrumbItem, NodeFull, NodeSize, PublicUser, ReceivedMail, SecrecyUserApp, SentMail, TemporaryMailUser, WaitingReceivedMail };
@@ -1,8 +1,2 @@
1
- export * from "./File.js";
2
- export * from "./Node.js";
3
- export * from "./UserAppSettings.js";
4
- export * from "./UserAppNotifications.js";
5
- export * from "./Inputs.js";
6
- export {};
7
- export {};
8
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NsaWVudC90eXBlcy9pbmRleC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IEtleVBhaXIgfSBmcm9tIFwiLi4vLi4vaW5kZXguanNcIjtcbmltcG9ydCB0eXBlIHsgSW5wdXRUeXBlLCBHcmFwaFFMVHlwZXMgfSBmcm9tIFwiLi4vLi4vemV1cy9pbmRleC5qc1wiO1xuaW1wb3J0IHR5cGUgeyBtYWlsU2VsZWN0b3IsIHVzZXJTZWxlY3RvciB9IGZyb20gXCIuL3NlbGVjdG9ycy5qc1wiO1xuZXhwb3J0ICogZnJvbSBcIi4vRmlsZS5qc1wiO1xuZXhwb3J0ICogZnJvbSBcIi4vTm9kZS5qc1wiO1xuZXhwb3J0ICogZnJvbSBcIi4vVXNlckFwcFNldHRpbmdzLmpzXCI7XG5leHBvcnQgKiBmcm9tIFwiLi9Vc2VyQXBwTm90aWZpY2F0aW9ucy5qc1wiO1xuZXhwb3J0ICogZnJvbSBcIi4vSW5wdXRzLmpzXCI7XG5cbmV4cG9ydCB0eXBlIFNlY3JlY3lVc2VyQXBwID0ge1xuICBrZXlzOiBLZXlQYWlyO1xuICBqd3Q6IHN0cmluZztcbiAgdWFTZXNzaW9uOiBzdHJpbmc7XG59O1xuXG5leHBvcnQgaW50ZXJmYWNlIEZpbGVDb250ZW50UGFydCB7XG4gIGNvbnRlbnRVcmw6IHN0cmluZztcbiAgb3JkZXI6IG51bWJlcjtcbiA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BQWMsc0JBQXNCO0FBQ3BDLGNBQWMsMkJBQTJCO0FBQ3pDLGNBQWMsYUFBYTtBQUFDO0FBQUEifQ==
1
+ export*from"./File.js";export*from"./Node.js";export*from"./UserAppSettings.js";export*from"./UserAppNotifications.js";export*from"./Inputs.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/client/types/index.ts"],"sourcesContent":["import type { KeyPair } from \"../../index.js\";\nimport type { InputType, GraphQLTypes } from \"../../zeus/index.js\";\nimport type { mailSelector, userSelector } from \"./selectors.js\";\nexport * from \"./File.js\";\nexport * from \"./Node.js\";\nexport * from \"./UserAppSettings.js\";\nexport * from \"./UserAppNotifications.js\";\nexport * from \"./Inputs.js\";\n\nexport type SecrecyUserApp = {\n keys: KeyPair;\n jwt: string;\n uaSession: string;\n};\n\nexport interface FileContentPart {\n contentUrl: string;\n order: number;\n md5: string;\n}\n\nexport type FilePartResponse = {\n order: number;\n fields: Record<string, string>;\n url: string;\n};\n\nexport type MailFileInput = { id: string; name: string; fileKey: string };\n\nexport type MailIntegrity = {\n id: string;\n hash: string;\n hashKey: string;\n replyTo?: {\n id: string;\n };\n temporaryRecipients: TemporaryMailUser[];\n recipients: PublicUser[];\n};\n\nexport type MailIntegrityDraft = MailIntegrity & {\n recipients: PublicUser[];\n};\n\nexport type TemporaryMailUser = {\n email?: string;\n};\n\nexport type InternalWaitingReceivedMail = {\n sender: PublicUser;\n date: string;\n attachmentsCount: number;\n recipients: PublicUser[];\n temporaryRecipients: TemporaryMailUser[];\n};\n\nexport type WaitingReceivedMail = {\n id: string;\n sender: PublicUser;\n date: Date;\n attachmentsCount: number;\n recipients: PublicUser[];\n temporaryRecipients: TemporaryMailUser[];\n};\n\nexport type MailFile = {\n fileKey: string;\n filename: string;\n file: {\n id: string;\n };\n};\n\nexport type MailType = \"sent\" | \"received\" | \"draft\";\n\nexport type GQLMail = InputType<GraphQLTypes[\"Mail\"], typeof mailSelector>;\n\nexport type InternalReceivedMail = {\n user: {\n receivedMails: GQLMail[];\n };\n};\n\nexport type BaseMail = {\n type: MailType;\n id: string;\n mailIntegrityId: string;\n replyTo?: string;\n body: string;\n subject: string;\n createdAt: Date;\n deletedAt: Date | null;\n openedAt: Date | null;\n isAltered: boolean;\n recipients: Omit<PublicUser, \"publicKey\">[];\n temporaryRecipients: TemporaryMailUser[];\n files: { id: string; name: string; key: string }[];\n};\n\nexport type PublicUser = InputType<GraphQLTypes[\"User\"], typeof userSelector>;\n\nexport interface ReceivedMail extends BaseMail {\n type: \"received\";\n sender: PublicUser;\n}\n\nexport type InternalSentMail = {\n user: {\n sentMails: GQLMail[];\n };\n};\n\nexport type InternalDraftMails = {\n user: {\n draftMails: GQLMail[];\n };\n};\n\nexport interface SentMail extends BaseMail {\n type: \"sent\";\n}\n\nexport interface DraftMail extends BaseMail {\n type: \"draft\";\n}\n\nexport type Mail = DraftMail | SentMail | ReceivedMail;\n\nexport type MailRecipientInput = {\n body: string;\n subject: string;\n recipientId: string;\n files: MailFileInput[];\n};\n"],"mappings":"AAGA,WAAc,YACd,WAAc,YACd,WAAc,uBACd,WAAc,4BACd,WAAc","names":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _indexjs = require('../../zeus/index.js');const u=_indexjs.Selector.call(void 0, "File")({id:!0,size:!0,sizeBefore:!0,createdAt:!0,md5:!0,md5Encrypted:!0,access:{key:!0,sharedBy:{keyPair:{pub:!0}}}}),e= exports.userSelector =_indexjs.Selector.call(void 0, "User")({id:!0,firstname:!0,lastname:!0,email:!0,publicKey:!0}),t= exports.nodeSelector =_indexjs.Selector.call(void 0, "Node")({id:!0,isFavorite:!0,type:!0,createdAt:!0,deletedAt:!0,createdBy:{user:e},sizes:{size:!0,sizeBefore:!0},updatedAt:!0,name:!0,access:{rights:!0,isRoot:!0,nameKey:!0,sharedBy:{keyPair:{pub:!0}},userApp:{user:e}},accesses:{rights:!0,isRoot:!0,nameKey:!0,sharedBy:{keyPair:{pub:!0}},userApp:{user:e}},breadcrumb:{id:!0,name:!0,nameKey:!0,pubKey:!0},parentId:!0,currentFileId:!0}),s= exports.nodeFullSelector =_indexjs.Selector.call(void 0, "Node")({...t,parent:t,children:t,history:u,current:u}),a= exports.mailSelector =_indexjs.Selector.call(void 0, "Mail")({id:!0,type:!0,body:!0,subject:!0,openedAt:!0,createdAt:!0,deletedAt:!0,recipients:{...e,publicKey:!1},recipient:{...e,publicKey:!1},sender:e,mailIntegrity:{id:!0,hash:!0,hashKey:!0,replyTo:{id:!0},temporaryRecipients:{email:!0},recipients:{...e,publicKey:!1}},mailIntegrityDraft:{id:!0,hash:!0,hashKey:!0,replyTo:{id:!0},temporaryRecipients:{email:!0},recipients:{...e,publicKey:!1}},files:{fileKey:!0,filename:!0,file:{id:!0}}});exports.fileSelector = u; exports.mailSelector = a; exports.nodeFullSelector = s; exports.nodeSelector = t; exports.userSelector = e;
2
+ //# sourceMappingURL=selectors.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/client/types/selectors.ts"],"names":["Selector","fileSelector","userSelector","nodeSelector","nodeFullSelector","mailSelector"],"mappings":"AAAA,OAAS,YAAAA,MAAgB,sBAElB,MAAMC,EAAeD,EAAS,MAAM,EAAE,CAC3C,GAAI,GACJ,KAAM,GACN,WAAY,GACZ,UAAW,GACX,IAAK,GACL,aAAc,GACd,OAAQ,CACN,IAAK,GACL,SAAU,CACR,QAAS,CACP,IAAK,EACP,CACF,CACF,CACF,CAAC,EAEYE,EAAeF,EAAS,MAAM,EAAE,CAC3C,GAAI,GACJ,UAAW,GACX,SAAU,GACV,MAAO,GACP,UAAW,EACb,CAAC,EAEYG,EAAeH,EAAS,MAAM,EAAE,CAC3C,GAAI,GACJ,WAAY,GACZ,KAAM,GACN,UAAW,GACX,UAAW,GACX,UAAW,CACT,KAAME,CACR,EACA,MAAO,CACL,KAAM,GACN,WAAY,EACd,EACA,UAAW,GACX,KAAM,GACN,OAAQ,CACN,OAAQ,GACR,OAAQ,GACR,QAAS,GACT,SAAU,CACR,QAAS,CACP,IAAK,EACP,CACF,EACA,QAAS,CACP,KAAMA,CACR,CACF,EACA,SAAU,CACR,OAAQ,GACR,OAAQ,GACR,QAAS,GACT,SAAU,CACR,QAAS,CACP,IAAK,EACP,CACF,EACA,QAAS,CACP,KAAMA,CACR,CACF,EACA,WAAY,CACV,GAAI,GACJ,KAAM,GACN,QAAS,GACT,OAAQ,EACV,EACA,SAAU,GACV,cAAe,EACjB,CAAC,EAEYE,EAAmBJ,EAAS,MAAM,EAAE,CAC/C,GAAGG,EACH,OAAQA,EACR,SAAUA,EACV,QAASF,EACT,QAASA,CACX,CAAC,EAEYI,EAAeL,EAAS,MAAM,EAAE,CAC3C,GAAI,GACJ,KAAM,GACN,KAAM,GACN,QAAS,GACT,SAAU,GACV,UAAW,GACX,UAAW,GACX,WAAY,CACV,GAAGE,EACH,UAAW,EACb,EACA,UAAW,CACT,GAAGA,EACH,UAAW,EACb,EACA,OAAQA,EACR,cAAe,CACb,GAAI,GACJ,KAAM,GACN,QAAS,GACT,QAAS,CACP,GAAI,EACN,EACA,oBAAqB,CACnB,MAAO,EACT,EACA,WAAY,CACV,GAAGA,EACH,UAAW,EACb,CACF,EACA,mBAAoB,CAClB,GAAI,GACJ,KAAM,GACN,QAAS,GACT,QAAS,CACP,GAAI,EACN,EACA,oBAAqB,CACnB,MAAO,EACT,EACA,WAAY,CACV,GAAGA,EACH,UAAW,EACb,CACF,EACA,MAAO,CACL,QAAS,GACT,SAAU,GACV,KAAM,CACJ,GAAI,EACN,CACF,CACF,CAAC","sourcesContent":["import { Selector } from \"../../zeus/index.js\";\n\nexport const fileSelector = Selector(\"File\")({\n id: true,\n size: true,\n sizeBefore: true,\n createdAt: true,\n md5: true,\n md5Encrypted: true,\n access: {\n key: true,\n sharedBy: {\n keyPair: {\n pub: true\n }\n }\n }\n});\n\nexport const userSelector = Selector(\"User\")({\n id: true,\n firstname: true,\n lastname: true,\n email: true,\n publicKey: true\n});\n\nexport const nodeSelector = Selector(\"Node\")({\n id: true,\n isFavorite: true,\n type: true,\n createdAt: true,\n deletedAt: true,\n createdBy: {\n user: userSelector\n },\n sizes: {\n size: true,\n sizeBefore: true\n },\n updatedAt: true,\n name: true,\n access: {\n rights: true,\n isRoot: true,\n nameKey: true,\n sharedBy: {\n keyPair: {\n pub: true\n }\n },\n userApp: {\n user: userSelector\n }\n },\n accesses: {\n rights: true,\n isRoot: true,\n nameKey: true,\n sharedBy: {\n keyPair: {\n pub: true\n }\n },\n userApp: {\n user: userSelector\n }\n },\n breadcrumb: {\n id: true,\n name: true,\n nameKey: true,\n pubKey: true\n },\n parentId: true,\n currentFileId: true\n});\n\nexport const nodeFullSelector = Selector(\"Node\")({\n ...nodeSelector,\n parent: nodeSelector,\n children: nodeSelector,\n history: fileSelector,\n current: fileSelector\n});\n\nexport const mailSelector = Selector(\"Mail\")({\n id: true,\n type: true,\n body: true,\n subject: true,\n openedAt: true,\n createdAt: true,\n deletedAt: true,\n recipients: {\n ...userSelector,\n publicKey: false\n },\n recipient: {\n ...userSelector,\n publicKey: false\n },\n sender: userSelector,\n mailIntegrity: {\n id: true,\n hash: true,\n hashKey: true,\n replyTo: {\n id: true\n },\n temporaryRecipients: {\n email: true\n },\n recipients: {\n ...userSelector,\n publicKey: false\n }\n },\n mailIntegrityDraft: {\n id: true,\n hash: true,\n hashKey: true,\n replyTo: {\n id: true\n },\n temporaryRecipients: {\n email: true\n },\n recipients: {\n ...userSelector,\n publicKey: false\n }\n },\n files: {\n fileKey: true,\n filename: true,\n file: {\n id: true\n }\n }\n});\n"]}