core-3nweb-client-lib 0.27.3 → 0.27.5

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 (102) hide show
  1. package/build/api-defs/files.d.ts +92 -29
  2. package/build/core/asmail/config/index.d.ts +2 -2
  3. package/build/core/asmail/config/index.js +2 -2
  4. package/build/core/asmail/config/invitations-anon.d.ts +10 -24
  5. package/build/core/asmail/config/invitations-anon.js +43 -31
  6. package/build/core/asmail/config/published-intro-key.d.ts +11 -22
  7. package/build/core/asmail/config/published-intro-key.js +47 -38
  8. package/build/core/asmail/delivery/per-recipient-wip.js +2 -2
  9. package/build/core/asmail/inbox/inbox-events.js +10 -5
  10. package/build/core/asmail/inbox/index.d.ts +3 -2
  11. package/build/core/asmail/inbox/index.js +15 -11
  12. package/build/core/asmail/inbox/msg-indexing.d.ts +17 -64
  13. package/build/core/asmail/inbox/msg-indexing.js +440 -311
  14. package/build/core/asmail/inbox/msg-on-disk.js +2 -1
  15. package/build/core/asmail/index.d.ts +1 -1
  16. package/build/core/asmail/index.js +5 -4
  17. package/build/core/asmail/keyring/correspondent-keys.d.ts +2 -2
  18. package/build/core/asmail/keyring/correspondent-keys.js +4 -2
  19. package/build/core/asmail/keyring/index.d.ts +10 -33
  20. package/build/core/asmail/keyring/index.js +88 -75
  21. package/build/core/asmail/msg/opener.js +4 -3
  22. package/build/core/asmail/msg/packer.d.ts +1 -0
  23. package/build/core/asmail/msg/packer.js +8 -4
  24. package/build/core/index.js +3 -5
  25. package/build/core/sign-in.js +1 -1
  26. package/build/core/storage/local/obj-files.js +2 -1
  27. package/build/core/storage/synced/obj-files.d.ts +2 -0
  28. package/build/core/storage/synced/obj-files.js +18 -1
  29. package/build/core/storage/synced/obj-status.d.ts +1 -0
  30. package/build/core/storage/synced/obj-status.js +10 -0
  31. package/build/core/storage/synced/storage.js +7 -23
  32. package/build/core/storage/synced/upload-header-file.js +4 -2
  33. package/build/core/storage/synced/upsyncer.js +3 -5
  34. package/build/ipc-via-protobuf/asmail-cap.js +14 -15
  35. package/build/ipc-via-protobuf/bytes.js +42 -18
  36. package/build/ipc-via-protobuf/file.d.ts +7 -0
  37. package/build/ipc-via-protobuf/file.js +103 -66
  38. package/build/ipc-via-protobuf/fs.js +127 -105
  39. package/build/ipc-via-protobuf/mailerid.js +2 -2
  40. package/build/ipc-via-protobuf/protobuf-msg.d.ts +1 -0
  41. package/build/ipc-via-protobuf/protobuf-msg.js +5 -1
  42. package/build/ipc-via-protobuf/startup-cap.js +8 -8
  43. package/build/ipc-via-protobuf/storage-cap.js +4 -4
  44. package/build/lib-client/3nstorage/xsp-fs/common.js +2 -0
  45. package/build/lib-client/3nstorage/xsp-fs/file-node.d.ts +5 -10
  46. package/build/lib-client/3nstorage/xsp-fs/file-node.js +26 -45
  47. package/build/lib-client/3nstorage/xsp-fs/file.d.ts +8 -7
  48. package/build/lib-client/3nstorage/xsp-fs/file.js +12 -18
  49. package/build/lib-client/3nstorage/xsp-fs/folder-node.d.ts +6 -1
  50. package/build/lib-client/3nstorage/xsp-fs/folder-node.js +20 -8
  51. package/build/lib-client/3nstorage/xsp-fs/fs.d.ts +19 -18
  52. package/build/lib-client/3nstorage/xsp-fs/fs.js +18 -19
  53. package/build/lib-client/3nstorage/xsp-fs/node-in-fs.d.ts +13 -4
  54. package/build/lib-client/3nstorage/xsp-fs/node-in-fs.js +63 -8
  55. package/build/lib-client/3nstorage/xsp-fs/node-persistence.d.ts +1 -0
  56. package/build/lib-client/3nstorage/xsp-fs/node-persistence.js +7 -5
  57. package/build/lib-client/3nstorage/xsp-fs/xsp-payload-v1.js +3 -4
  58. package/build/lib-client/3nstorage/xsp-fs/xsp-payload-v2.js +20 -15
  59. package/build/lib-client/cryptor/cryptor-in-worker.js +37 -47
  60. package/build/lib-client/cryptor/cryptor-wasm.js +1 -1
  61. package/build/lib-client/cryptor/cryptor.wasm +0 -0
  62. package/build/lib-client/cryptor/in-proc-js.js +15 -12
  63. package/build/lib-client/cryptor/in-proc-wasm.js +11 -8
  64. package/build/lib-client/cryptor/serialization-for-wasm.d.ts +36 -0
  65. package/build/lib-client/cryptor/serialization-for-wasm.js +58 -0
  66. package/build/lib-client/cryptor-work-labels.d.ts +26 -0
  67. package/build/lib-client/cryptor-work-labels.js +152 -0
  68. package/build/lib-client/fs-sync-utils.d.ts +7 -1
  69. package/build/lib-client/fs-sync-utils.js +18 -7
  70. package/build/lib-client/local-files/dev-file-src.d.ts +2 -1
  71. package/build/lib-client/local-files/dev-file-src.js +5 -1
  72. package/build/lib-client/local-files/device-fs.js +2 -1
  73. package/build/lib-client/objs-on-disk/obj-on-disk.d.ts +5 -2
  74. package/build/lib-client/objs-on-disk/obj-on-disk.js +21 -2
  75. package/build/lib-client/request-utils.js +14 -14
  76. package/build/lib-common/async-cryptor-wrap.d.ts +9 -9
  77. package/build/lib-common/async-cryptor-wrap.js +13 -13
  78. package/build/lib-common/byte-streaming/pipe.d.ts +1 -1
  79. package/build/lib-common/byte-streaming/pipe.js +3 -3
  80. package/build/lib-common/byte-streaming/wrapping.js +4 -2
  81. package/build/lib-common/json-utils.js +0 -3
  82. package/build/lib-common/objs-on-disk/file-layout.js +1 -1
  83. package/build/lib-common/processes/synced.js +0 -184
  84. package/build/lib-sqlite-on-3nstorage/index.d.ts +32 -0
  85. package/build/lib-sqlite-on-3nstorage/index.js +117 -0
  86. package/build/lib-sqlite-on-3nstorage/sqljs.d.ts +279 -0
  87. package/build/lib-sqlite-on-3nstorage/sqljs.js +223 -0
  88. package/build/protos/asmail.proto.js +10145 -5923
  89. package/build/protos/bytes.proto.js +731 -204
  90. package/build/protos/common.proto.js +192 -44
  91. package/build/protos/cryptor.proto.js +184 -61
  92. package/build/protos/file.proto.js +2388 -502
  93. package/build/protos/fs.proto.js +9894 -6046
  94. package/build/protos/ipc.proto.js +244 -61
  95. package/build/protos/logger.proto.js +219 -53
  96. package/build/protos/mailerid.proto.js +230 -50
  97. package/build/protos/startup.proto.js +341 -77
  98. package/build/protos/storage.proto.js +276 -62
  99. package/package.json +8 -7
  100. package/protos/bytes.proto +13 -4
  101. package/protos/file.proto +27 -8
  102. package/protos/fs.proto +31 -14
@@ -0,0 +1,279 @@
1
+ // Type definitions for sql.js 1.4
2
+ // Project: https://github.com/sql-js/sql.js
3
+ // Definitions by: Florian Imdahl <https://github.com/ffflorian>
4
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
+ // TypeScript Version: 2.3
6
+
7
+ // This file has been simplified to not need node or emscrypten
8
+
9
+ export type SqlValue = number | string | Uint8Array | null;
10
+ export type ParamsObject = Record<string, SqlValue>;
11
+ export type ParamsCallback = (obj: ParamsObject) => void;
12
+ export type BindParams = SqlValue[] | ParamsObject | null;
13
+
14
+ export interface QueryExecResult {
15
+ columns: string[];
16
+ values: SqlValue[][];
17
+ }
18
+
19
+ export interface StatementIteratorResult {
20
+ /** `true` if there are no more available statements */
21
+ done: boolean;
22
+ /** the next available Statement (as returned by `Database.prepare`) */
23
+ value: Statement;
24
+ }
25
+
26
+ export interface SqlJsStatic {
27
+ Database: typeof Database;
28
+ Statement: typeof Statement;
29
+ }
30
+
31
+ export declare class Database {
32
+ /**
33
+ * Represents an SQLite database
34
+ * @see [https://sql.js.org/documentation/Database.html#Database](https://sql.js.org/documentation/Database.html#Database)
35
+ *
36
+ * @param data An array of bytes representing an SQLite database file
37
+ */
38
+ constructor(data?: ArrayLike<number> | null);
39
+
40
+ /**
41
+ * Close the database, and all associated prepared statements. The
42
+ * memory associated to the database and all associated statements will
43
+ * be freed.
44
+ *
45
+ * **Warning**: A statement belonging to a database that has been closed
46
+ * cannot be used anymore.
47
+ *
48
+ * Databases must be closed when you're finished with them, or the
49
+ * memory consumption will grow forever
50
+ * @see [https://sql.js.org/documentation/Database.html#["close"]](https://sql.js.org/documentation/Database.html#%5B%22close%22%5D)
51
+ */
52
+ close(): void;
53
+
54
+ /**
55
+ * Register a custom function with SQLite
56
+ * @see [https://sql.js.org/documentation/Database.html#["create_function"]](https://sql.js.org/documentation/Database.html#%5B%22create_function%22%5D)
57
+ *
58
+ * @param name the name of the function as referenced in SQL statements.
59
+ * @param func the actual function to be executed.
60
+ */
61
+ create_function(name: string, func: (...args: any[]) => any): Database;
62
+
63
+ /**
64
+ * Execute an sql statement, and call a callback for each row of result.
65
+ *
66
+ * Currently this method is synchronous, it will not return until the
67
+ * callback has been called on every row of the result. But this might
68
+ * change.
69
+ * @see [https://sql.js.org/documentation/Database.html#["each"]](https://sql.js.org/documentation/Database.html#%5B%22each%22%5D)
70
+ *
71
+ * @param sql A string of SQL text. Can contain placeholders that will
72
+ * be bound to the parameters given as the second argument
73
+ * @param params Parameters to bind to the query
74
+ * @param callback Function to call on each row of result
75
+ * @param done A function that will be called when all rows have been
76
+ * retrieved
77
+ */
78
+ each(sql: string, params: BindParams, callback: ParamsCallback, done: () => void): Database;
79
+ each(sql: string, callback: ParamsCallback, done: () => void): Database;
80
+
81
+ /**
82
+ * Execute an SQL query, and returns the result.
83
+ *
84
+ * This is a wrapper against `Database.prepare`, `Statement.bind`, `Statement.step`, `Statement.get`, and `Statement.free`.
85
+ *
86
+ * The result is an array of result elements. There are as many result elements as the number of statements in your sql string (statements are separated by a semicolon)
87
+ * @see [https://sql.js.org/documentation/Database.html#["exec"]](https://sql.js.org/documentation/Database.html#%5B%22exec%22%5D)
88
+ *
89
+ * @param sql a string containing some SQL text to execute
90
+ * @param params When the SQL statement contains placeholders, you can
91
+ * pass them in here. They will be bound to the statement before it is
92
+ * executed. If you use the params argument as an array, you **cannot**
93
+ * provide an sql string that contains several statements (separated by
94
+ * `;`). This limitation does not apply to params as an object.
95
+ */
96
+ exec(sql: string, params?: BindParams): QueryExecResult[];
97
+
98
+ /**
99
+ * Exports the contents of the database to a binary array
100
+ * @see [https://sql.js.org/documentation/Database.html#["export"]](https://sql.js.org/documentation/Database.html#%5B%22export%22%5D)
101
+ */
102
+ export(): Uint8Array;
103
+
104
+ /**
105
+ * Returns the number of changed rows (modified, inserted or deleted) by
106
+ * the latest completed `INSERT`, `UPDATE` or `DELETE` statement on the
107
+ * database. Executing any other type of SQL statement does not modify
108
+ * the value returned by this function.
109
+ * @see [https://sql.js.org/documentation/Database.html#["getRowsModified"]](https://sql.js.org/documentation/Database.html#%5B%22getRowsModified%22%5D)
110
+ */
111
+ getRowsModified(): number;
112
+
113
+ /**
114
+ * Analyze a result code, return null if no error occured, and throw an
115
+ * error with a descriptive message otherwise
116
+ * @see [https://sql.js.org/documentation/Database.html#["handleError"]](https://sql.js.org/documentation/Database.html#%5B%22handleError%22%5D)
117
+ */
118
+ handleError(): null | never;
119
+
120
+ /**
121
+ * Iterate over multiple SQL statements in a SQL string. This function
122
+ * returns an iterator over Statement objects. You can use a `for..of`
123
+ * loop to execute the returned statements one by one.
124
+ * @see [https://sql.js.org/documentation/Database.html#["iterateStatements"]](https://sql.js.org/documentation/Database.html#%5B%22iterateStatements%22%5D)
125
+ *
126
+ * @param sql a string of SQL that can contain multiple statements
127
+ */
128
+ iterateStatements(sql: string): StatementIterator;
129
+
130
+ /**
131
+ * Prepare an SQL statement
132
+ * @see [https://sql.js.org/documentation/Database.html#["prepare"]](https://sql.js.org/documentation/Database.html#%5B%22prepare%22%5D)
133
+ *
134
+ * @param sql a string of SQL, that can contain placeholders (`?`, `:VVV`, `:AAA`, `@AAA`)
135
+ * @param params values to bind to placeholders
136
+ */
137
+ prepare(sql: string, params?: BindParams): Statement;
138
+
139
+ /**
140
+ * Execute an SQL query, ignoring the rows it returns.
141
+ * @see [https://sql.js.org/documentation/Database.html#["run"]](https://sql.js.org/documentation/Database.html#%5B%22run%22%5D)
142
+ *
143
+ * @param sql a string containing some SQL text to execute
144
+ * @param params When the SQL statement contains placeholders, you can
145
+ * pass them in here. They will be bound to the statement before it is
146
+ * executed. If you use the params argument as an array, you **cannot**
147
+ * provide an sql string that contains several statements (separated by
148
+ * `;`). This limitation does not apply to params as an object.
149
+ */
150
+ run(sql: string, params?: BindParams): Database;
151
+ }
152
+
153
+ export declare class Statement {
154
+ /**
155
+ * Bind values to the parameters, after having reseted the statement. If
156
+ * values is null, do nothing and return true.
157
+ *
158
+ * SQL statements can have parameters, named '?', '?NNN', ':VVV',
159
+ * '@VVV', '$VVV', where NNN is a number and VVV a string. This function
160
+ * binds these parameters to the given values.
161
+ *
162
+ * Warning: ':', '@', and '$' are included in the parameters names
163
+ *
164
+ * ### Value types
165
+ *
166
+ * |Javascript type|SQLite type|
167
+ * |-|-|
168
+ * |number|REAL, INTEGER|
169
+ * |boolean|INTEGER|
170
+ * |string|TEXT|
171
+ * |Array, Uint8Array|BLOB|
172
+ * |null|NULL|
173
+ * @see [https://sql.js.org/documentation/Statement.html#["bind"]](https://sql.js.org/documentation/Statement.html#%5B%22bind%22%5D)
174
+ *
175
+ * @param values The values to bind
176
+ */
177
+ bind(values?: BindParams): boolean;
178
+
179
+ /**
180
+ * Free the memory used by the statement
181
+ * @see [https://sql.js.org/documentation/Statement.html#["free"]](https://sql.js.org/documentation/Statement.html#%5B%22free%22%5D)
182
+ */
183
+ free(): boolean;
184
+
185
+ /**
186
+ * Free the memory allocated during parameter binding
187
+ * @see [https://sql.js.org/documentation/Statement.html#["freemem"]](https://sql.js.org/documentation/Statement.html#%5B%22freemem%22%5D)
188
+ */
189
+ freemem(): void;
190
+
191
+ /**
192
+ * Get one row of results of a statement. If the first parameter is not
193
+ * provided, step must have been called before.
194
+ * @see [https://sql.js.org/documentation/Statement.html#["get"]](https://sql.js.org/documentation/Statement.html#%5B%22get%22%5D)
195
+ *
196
+ * @param params If set, the values will be bound to the statement
197
+ * before it is executed
198
+ */
199
+ get(params?: BindParams): SqlValue[];
200
+
201
+ /**
202
+ * Get one row of result as a javascript object, associating column
203
+ * names with their value in the current row
204
+ * @see [https://sql.js.org/documentation/Statement.html#["getAsObject"]](https://sql.js.org/documentation/Statement.html#%5B%22getAsObject%22%5D)
205
+ *
206
+ * @param params If set, the values will be bound to the statement, and
207
+ * it will be executed
208
+ */
209
+ getAsObject(params?: BindParams): ParamsObject;
210
+
211
+ /**
212
+ * Get the list of column names of a row of result of a statement.
213
+ * @see [https://sql.js.org/documentation/Statement.html#["getColumnNames"]](https://sql.js.org/documentation/Statement.html#%5B%22getColumnNames%22%5D)
214
+ */
215
+ getColumnNames(): string[];
216
+
217
+ /**
218
+ * Get the SQLite's normalized version of the SQL string used in
219
+ * preparing this statement. The meaning of "normalized" is not
220
+ * well-defined: see
221
+ * [the SQLite documentation](https://sqlite.org/c3ref/expanded_sql.html).
222
+ * @see [https://sql.js.org/documentation/Statement.html#["getNormalizedSQL"]](https://sql.js.org/documentation/Statement.html#%5B%22getNormalizedSQL%22%5D)
223
+ */
224
+ getNormalizedSQL(): string;
225
+
226
+ /**
227
+ * Get the SQL string used in preparing this statement.
228
+ * @see [https://sql.js.org/documentation/Statement.html#["getSQL"]](https://sql.js.org/documentation/Statement.html#%5B%22getSQL%22%5D)
229
+ */
230
+ getSQL(): string;
231
+
232
+ /**
233
+ * Reset a statement, so that it's parameters can be bound to new
234
+ * values. It also clears all previous bindings, freeing the memory used
235
+ * by bound parameters.
236
+ * @see [https://sql.js.org/documentation/Statement.html#["reset"]](https://sql.js.org/documentation/Statement.html#%5B%22reset%22%5D)
237
+ */
238
+ reset(): void;
239
+
240
+ /**
241
+ * Shorthand for bind + step + reset Bind the values, execute the
242
+ * statement, ignoring the rows it returns, and resets it
243
+ * @param values Value to bind to the statement
244
+ */
245
+ run(values?: BindParams): void;
246
+
247
+ /**
248
+ * Execute the statement, fetching the the next line of result, that can
249
+ * be retrieved with `Statement.get`.
250
+ * @see [https://sql.js.org/documentation/Statement.html#["step"]](https://sql.js.org/documentation/Statement.html#%5B%22step%22%5D)
251
+ */
252
+ step(): boolean;
253
+ }
254
+
255
+ /**
256
+ * An iterator over multiple SQL statements in a string, preparing and
257
+ * returning a Statement object for the next SQL statement on each
258
+ * iteration.
259
+ *
260
+ * You can't instantiate this class directly, you have to use a Database
261
+ * object in order to create a statement iterator
262
+ * @see [https://sql.js.org/documentation/StatementIterator.html#StatementIterator](https://sql.js.org/documentation/StatementIterator.html#StatementIterator)
263
+ */
264
+ export declare class StatementIterator implements Iterator<Statement>, Iterable<Statement> {
265
+ [Symbol.iterator](): Iterator<Statement>;
266
+ /**
267
+ * Get any un-executed portions remaining of the original SQL string
268
+ * @see [https://sql.js.org/documentation/StatementIterator.html#["getRemainingSQL"]](https://sql.js.org/documentation/StatementIterator.html#%5B%22getRemainingSQL%22%5D)
269
+ */
270
+ getRemainingSql(): string;
271
+
272
+ /**
273
+ * Prepare the next available SQL statement
274
+ * @see [https://sql.js.org/documentation/StatementIterator.html#["next"]](https://sql.js.org/documentation/StatementIterator.html#%5B%22next%22%5D)
275
+ */
276
+ next(): StatementIteratorResult;
277
+ }
278
+
279
+ export default function(keepWasm?: boolean): Promise<SqlJsStatic>;