@monimesl/dot-dash 0.1.0-alpha.8 → 0.1.0-alpha.9
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/dist/index.d.ts +277 -178
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +147 -75
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,56 @@
|
|
|
1
1
|
import { HostCallOptions, HostError, HostErrorCode, HostRequest } from "@monimesl/dot-core";
|
|
2
|
+
declare namespace cache_d_exports {
|
|
3
|
+
export { CacheMethods, CacheSetOptions, CacheValue, clear$1 as clear, exists, get$1 as get, keys, remove$2 as remove, set$1 as set };
|
|
4
|
+
}
|
|
5
|
+
type CacheValue = string | number | boolean | CacheValue[] | {
|
|
6
|
+
[key: string]: CacheValue;
|
|
7
|
+
};
|
|
8
|
+
interface CacheMethods {
|
|
9
|
+
'dash.storage.cache.get': {
|
|
10
|
+
params: {
|
|
11
|
+
key: string;
|
|
12
|
+
};
|
|
13
|
+
result: CacheValue | null;
|
|
14
|
+
};
|
|
15
|
+
'dash.storage.cache.set': {
|
|
16
|
+
params: {
|
|
17
|
+
key: string;
|
|
18
|
+
value: CacheValue;
|
|
19
|
+
ttl?: number | undefined;
|
|
20
|
+
};
|
|
21
|
+
result: void;
|
|
22
|
+
};
|
|
23
|
+
'dash.storage.cache.remove': {
|
|
24
|
+
params: {
|
|
25
|
+
key: string;
|
|
26
|
+
};
|
|
27
|
+
result: void;
|
|
28
|
+
};
|
|
29
|
+
'dash.storage.cache.exists': {
|
|
30
|
+
params: {
|
|
31
|
+
key: string;
|
|
32
|
+
};
|
|
33
|
+
result: boolean;
|
|
34
|
+
};
|
|
35
|
+
'dash.storage.cache.keys': {
|
|
36
|
+
params: Record<string, never>;
|
|
37
|
+
result: string[];
|
|
38
|
+
};
|
|
39
|
+
'dash.storage.cache.clear': {
|
|
40
|
+
params: Record<string, never>;
|
|
41
|
+
result: void;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
interface CacheSetOptions {
|
|
45
|
+
ttl?: number | undefined;
|
|
46
|
+
}
|
|
47
|
+
declare function get$1<Value extends CacheValue = CacheValue>(key: string, callOptions?: CallOptions): DashRequest<Value | null>;
|
|
48
|
+
declare function set$1(key: string, value: CacheValue, options?: CacheSetOptions, callOptions?: CallOptions): DashRequest<void>;
|
|
49
|
+
declare function remove$2(key: string, callOptions?: CallOptions): DashRequest<void>;
|
|
50
|
+
declare function exists(key: string, callOptions?: CallOptions): DashRequest<boolean>;
|
|
51
|
+
declare function keys(callOptions?: CallOptions): DashRequest<string[]>;
|
|
52
|
+
declare function clear$1(callOptions?: CallOptions): DashRequest<void>;
|
|
53
|
+
//#endregion
|
|
2
54
|
//#region src/files.d.ts
|
|
3
55
|
interface DotFile {
|
|
4
56
|
id: string;
|
|
@@ -7,81 +59,161 @@ interface DotFile {
|
|
|
7
59
|
contentType: string;
|
|
8
60
|
url: string;
|
|
9
61
|
}
|
|
10
|
-
declare namespace
|
|
11
|
-
export {
|
|
62
|
+
declare namespace file_d_exports {
|
|
63
|
+
export { FileEncoding, FileEntry, FileMethods, ReadOptions, ReplaceOptions, StorageUsage, WriteOptions, copy, createFolder, list, move, open, read, remove$1 as remove, save, stat, usage, write };
|
|
12
64
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
65
|
+
interface FileEntry {
|
|
66
|
+
name: string;
|
|
67
|
+
path: string;
|
|
68
|
+
size: number;
|
|
69
|
+
kind: 'file' | 'folder';
|
|
70
|
+
modifiedAt: number;
|
|
71
|
+
contentType?: string;
|
|
20
72
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
headers: Record<string, string>;
|
|
26
|
-
body: Body;
|
|
73
|
+
type FileEncoding = 'text' | 'base64';
|
|
74
|
+
interface StorageUsage {
|
|
75
|
+
used: number;
|
|
76
|
+
quota: number;
|
|
27
77
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
78
|
+
interface FileMethods {
|
|
79
|
+
'dash.storage.file.read': {
|
|
80
|
+
params: {
|
|
81
|
+
path: string;
|
|
82
|
+
as?: FileEncoding;
|
|
83
|
+
};
|
|
84
|
+
result: string;
|
|
85
|
+
};
|
|
86
|
+
'dash.storage.file.write': {
|
|
87
|
+
params: {
|
|
88
|
+
path: string;
|
|
89
|
+
data: string;
|
|
90
|
+
as?: FileEncoding;
|
|
91
|
+
append?: boolean;
|
|
92
|
+
};
|
|
93
|
+
result: FileEntry;
|
|
94
|
+
};
|
|
95
|
+
'dash.storage.file.stat': {
|
|
96
|
+
params: {
|
|
97
|
+
path: string;
|
|
98
|
+
};
|
|
99
|
+
result: FileEntry | null;
|
|
100
|
+
};
|
|
101
|
+
'dash.storage.file.list': {
|
|
102
|
+
params: {
|
|
103
|
+
path: string;
|
|
104
|
+
recursive?: boolean;
|
|
105
|
+
};
|
|
106
|
+
result: FileEntry[];
|
|
107
|
+
};
|
|
108
|
+
'dash.storage.file.createFolder': {
|
|
109
|
+
params: {
|
|
110
|
+
path: string;
|
|
111
|
+
};
|
|
112
|
+
result: FileEntry;
|
|
113
|
+
};
|
|
114
|
+
'dash.storage.file.move': {
|
|
115
|
+
params: {
|
|
116
|
+
from: string;
|
|
117
|
+
to: string;
|
|
118
|
+
overwrite?: boolean;
|
|
119
|
+
};
|
|
120
|
+
result: FileEntry;
|
|
121
|
+
};
|
|
122
|
+
'dash.storage.file.copy': {
|
|
123
|
+
params: {
|
|
124
|
+
from: string;
|
|
125
|
+
to: string;
|
|
126
|
+
overwrite?: boolean;
|
|
127
|
+
};
|
|
128
|
+
result: FileEntry;
|
|
129
|
+
};
|
|
130
|
+
'dash.storage.file.remove': {
|
|
131
|
+
params: {
|
|
132
|
+
path: string;
|
|
133
|
+
recursive?: boolean;
|
|
134
|
+
};
|
|
135
|
+
result: void;
|
|
136
|
+
};
|
|
137
|
+
'dash.storage.file.save': {
|
|
138
|
+
params: {
|
|
139
|
+
file: string;
|
|
140
|
+
path: string;
|
|
141
|
+
overwrite?: boolean;
|
|
142
|
+
};
|
|
143
|
+
result: FileEntry;
|
|
144
|
+
};
|
|
145
|
+
'dash.storage.file.open': {
|
|
146
|
+
params: {
|
|
147
|
+
path: string;
|
|
148
|
+
};
|
|
149
|
+
result: DotFile;
|
|
150
|
+
};
|
|
151
|
+
'dash.storage.file.usage': {
|
|
152
|
+
params: Record<string, never>;
|
|
153
|
+
result: StorageUsage;
|
|
154
|
+
};
|
|
35
155
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
file: DotFile;
|
|
39
|
-
}) | (Omit<HttpResponse, 'ok'> & {
|
|
40
|
-
ok: false;
|
|
41
|
-
});
|
|
42
|
-
interface HttpUploadFile {
|
|
43
|
-
field: string;
|
|
44
|
-
file: DotFile | string;
|
|
45
|
-
name?: string;
|
|
156
|
+
interface ReadOptions {
|
|
157
|
+
as?: FileEncoding;
|
|
46
158
|
}
|
|
47
|
-
interface
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
headers?: Record<string, string>;
|
|
51
|
-
fields?: Record<string, string>;
|
|
52
|
-
files: HttpUploadFile[];
|
|
159
|
+
interface WriteOptions {
|
|
160
|
+
as?: FileEncoding;
|
|
161
|
+
append?: boolean;
|
|
53
162
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
163
|
+
interface ReplaceOptions {
|
|
164
|
+
overwrite?: boolean;
|
|
165
|
+
}
|
|
166
|
+
declare function read(path: string, options?: ReadOptions, callOptions?: CallOptions): DashRequest<string>;
|
|
167
|
+
declare function write(path: string, data: string, options?: WriteOptions, callOptions?: CallOptions): DashRequest<FileEntry>;
|
|
168
|
+
declare function stat(path: string, callOptions?: CallOptions): DashRequest<FileEntry | null>;
|
|
169
|
+
declare function list(path?: string, options?: {
|
|
170
|
+
recursive?: boolean;
|
|
171
|
+
}, callOptions?: CallOptions): DashRequest<FileEntry[]>;
|
|
172
|
+
declare function createFolder(path: string, callOptions?: CallOptions): DashRequest<FileEntry>;
|
|
173
|
+
declare function move(from: string, to: string, options?: ReplaceOptions, callOptions?: CallOptions): DashRequest<FileEntry>;
|
|
174
|
+
declare function copy(from: string, to: string, options?: ReplaceOptions, callOptions?: CallOptions): DashRequest<FileEntry>;
|
|
175
|
+
declare function remove$1(path: string, options?: {
|
|
176
|
+
recursive?: boolean;
|
|
177
|
+
}, callOptions?: CallOptions): DashRequest<void>;
|
|
178
|
+
declare function save(file: DotFile | string, path: string, options?: ReplaceOptions, callOptions?: CallOptions): DashRequest<FileEntry>;
|
|
179
|
+
declare function open(path: string, callOptions?: CallOptions): DashRequest<DotFile>;
|
|
180
|
+
declare function usage(callOptions?: CallOptions): DashRequest<StorageUsage>;
|
|
181
|
+
declare namespace secret_d_exports {
|
|
182
|
+
export { SecretMethods, clear, get, remove, set };
|
|
183
|
+
}
|
|
184
|
+
interface SecretMethods {
|
|
185
|
+
'dash.storage.secret.get': {
|
|
186
|
+
params: {
|
|
187
|
+
key: string;
|
|
188
|
+
};
|
|
189
|
+
result: string | null;
|
|
62
190
|
};
|
|
63
|
-
'dash.
|
|
64
|
-
params:
|
|
65
|
-
|
|
191
|
+
'dash.storage.secret.set': {
|
|
192
|
+
params: {
|
|
193
|
+
key: string;
|
|
194
|
+
value: string;
|
|
195
|
+
};
|
|
196
|
+
result: void;
|
|
66
197
|
};
|
|
67
|
-
'dash.
|
|
68
|
-
params:
|
|
69
|
-
|
|
70
|
-
field: string;
|
|
71
|
-
file: string;
|
|
72
|
-
name?: string;
|
|
73
|
-
}[];
|
|
198
|
+
'dash.storage.secret.remove': {
|
|
199
|
+
params: {
|
|
200
|
+
key: string;
|
|
74
201
|
};
|
|
75
|
-
result:
|
|
202
|
+
result: void;
|
|
203
|
+
};
|
|
204
|
+
'dash.storage.secret.clear': {
|
|
205
|
+
params: Record<string, never>;
|
|
206
|
+
result: void;
|
|
76
207
|
};
|
|
77
208
|
}
|
|
78
|
-
declare function
|
|
79
|
-
declare function
|
|
80
|
-
declare function
|
|
209
|
+
declare function get(key: string, callOptions?: CallOptions): DashRequest<string | null>;
|
|
210
|
+
declare function set(key: string, value: string, callOptions?: CallOptions): DashRequest<void>;
|
|
211
|
+
declare function remove(key: string, callOptions?: CallOptions): DashRequest<void>;
|
|
212
|
+
declare function clear(callOptions?: CallOptions): DashRequest<void>;
|
|
81
213
|
declare namespace index_d_exports$3 {
|
|
82
|
-
export {
|
|
214
|
+
export { CacheSetOptions, CacheValue, FileEncoding, FileEntry, ReadOptions, ReplaceOptions, StorageMethods, StorageUsage, WriteOptions, cache_d_exports as cache, file_d_exports as file, secret_d_exports as secret };
|
|
83
215
|
}
|
|
84
|
-
type
|
|
216
|
+
type StorageMethods = FileMethods & CacheMethods & SecretMethods;
|
|
85
217
|
//#endregion
|
|
86
218
|
//#region src/system/clipboard.d.ts
|
|
87
219
|
interface ClipboardMethods {
|
|
@@ -118,6 +250,17 @@ interface HapticsMethods {
|
|
|
118
250
|
}
|
|
119
251
|
declare function vibrate(options?: VibrateOptions, callOptions?: CallOptions): DashRequest<void>;
|
|
120
252
|
//#endregion
|
|
253
|
+
//#region src/system/open-url.d.ts
|
|
254
|
+
interface OpenUrlMethods {
|
|
255
|
+
'dash.system.openUrl': {
|
|
256
|
+
params: {
|
|
257
|
+
url: string;
|
|
258
|
+
};
|
|
259
|
+
result: void;
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
declare function openUrl(url: string, callOptions?: CallOptions): DashRequest<void>;
|
|
263
|
+
//#endregion
|
|
121
264
|
//#region src/system/share.d.ts
|
|
122
265
|
interface ShareOptions {
|
|
123
266
|
title?: string;
|
|
@@ -150,9 +293,9 @@ interface TorchMethods {
|
|
|
150
293
|
}
|
|
151
294
|
declare function torch(state: TorchState, callOptions?: CallOptions): DashRequest<void>;
|
|
152
295
|
declare namespace index_d_exports$2 {
|
|
153
|
-
export { ShareOptions, SystemMethods, TorchState, VibrateOptions, VibrationStyle, copyText, delay, share, torch, vibrate };
|
|
296
|
+
export { ShareOptions, SystemMethods, TorchState, VibrateOptions, VibrationStyle, copyText, delay, openUrl, share, torch, vibrate };
|
|
154
297
|
}
|
|
155
|
-
type SystemMethods = ClipboardMethods & DelayMethods & HapticsMethods & ShareMethods & TorchMethods;
|
|
298
|
+
type SystemMethods = ClipboardMethods & DelayMethods & HapticsMethods & OpenUrlMethods & ShareMethods & TorchMethods;
|
|
156
299
|
//#endregion
|
|
157
300
|
//#region src/ui/dialogs.d.ts
|
|
158
301
|
interface AlertAction {
|
|
@@ -181,131 +324,87 @@ declare namespace index_d_exports$1 {
|
|
|
181
324
|
type UIMethods = DialogMethods;
|
|
182
325
|
//#endregion
|
|
183
326
|
//#region src/methods.d.ts
|
|
184
|
-
type DashMethods = UIMethods & SystemMethods & NetworkMethods &
|
|
327
|
+
type DashMethods = UIMethods & SystemMethods & NetworkMethods & StorageMethods;
|
|
185
328
|
type DashMethod = keyof DashMethods;
|
|
186
329
|
//#endregion
|
|
187
330
|
//#region src/call.d.ts
|
|
188
331
|
type CallOptions = HostCallOptions;
|
|
189
332
|
type DashRequest<Result> = HostRequest<Result>;
|
|
190
|
-
declare namespace
|
|
191
|
-
export {
|
|
333
|
+
declare namespace http_d_exports {
|
|
334
|
+
export { HttpDownloadRequest, HttpDownloadResponse, HttpMethod, HttpMethods, HttpReadOptions, HttpRequest, HttpRequestBody, HttpResponse, HttpUploadFile, HttpUploadRequest, download, request, upload };
|
|
192
335
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
336
|
+
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
|
|
337
|
+
type HttpRequestBody = string | object;
|
|
338
|
+
interface HttpRequest<Body extends HttpRequestBody = HttpRequestBody> {
|
|
339
|
+
url: string;
|
|
340
|
+
method?: HttpMethod;
|
|
341
|
+
headers?: Record<string, string>;
|
|
342
|
+
body?: Body;
|
|
200
343
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
344
|
+
interface HttpResponse<Body = string> {
|
|
345
|
+
ok: boolean;
|
|
346
|
+
status: number;
|
|
347
|
+
statusText: string;
|
|
348
|
+
headers: Record<string, string>;
|
|
349
|
+
body: Body;
|
|
205
350
|
}
|
|
206
|
-
|
|
207
|
-
'
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
result: FileEntry;
|
|
241
|
-
};
|
|
242
|
-
'dash.file.move': {
|
|
243
|
-
params: {
|
|
244
|
-
from: string;
|
|
245
|
-
to: string;
|
|
246
|
-
overwrite?: boolean;
|
|
247
|
-
};
|
|
248
|
-
result: FileEntry;
|
|
249
|
-
};
|
|
250
|
-
'dash.file.copy': {
|
|
251
|
-
params: {
|
|
252
|
-
from: string;
|
|
253
|
-
to: string;
|
|
254
|
-
overwrite?: boolean;
|
|
255
|
-
};
|
|
256
|
-
result: FileEntry;
|
|
257
|
-
};
|
|
258
|
-
'dash.file.remove': {
|
|
259
|
-
params: {
|
|
260
|
-
path: string;
|
|
261
|
-
recursive?: boolean;
|
|
262
|
-
};
|
|
263
|
-
result: void;
|
|
351
|
+
type HttpReadOptions<Body> = [Body] extends [string] ? {
|
|
352
|
+
as?: 'text';
|
|
353
|
+
} : {
|
|
354
|
+
as: 'json';
|
|
355
|
+
};
|
|
356
|
+
interface HttpDownloadRequest extends HttpRequest {
|
|
357
|
+
name?: string;
|
|
358
|
+
}
|
|
359
|
+
type HttpDownloadResponse = (Omit<HttpResponse, 'ok' | 'body'> & {
|
|
360
|
+
ok: true;
|
|
361
|
+
file: DotFile;
|
|
362
|
+
}) | (Omit<HttpResponse, 'ok'> & {
|
|
363
|
+
ok: false;
|
|
364
|
+
});
|
|
365
|
+
interface HttpUploadFile {
|
|
366
|
+
field: string;
|
|
367
|
+
file: DotFile | string;
|
|
368
|
+
name?: string;
|
|
369
|
+
}
|
|
370
|
+
interface HttpUploadRequest {
|
|
371
|
+
url: string;
|
|
372
|
+
method?: 'POST' | 'PUT' | 'PATCH';
|
|
373
|
+
headers?: Record<string, string>;
|
|
374
|
+
fields?: Record<string, string>;
|
|
375
|
+
files: HttpUploadFile[];
|
|
376
|
+
}
|
|
377
|
+
type WireRequest<Request extends HttpRequest> = Omit<Request, 'headers' | 'body'> & {
|
|
378
|
+
headers?: Record<string, string> | undefined;
|
|
379
|
+
body?: string | undefined;
|
|
380
|
+
};
|
|
381
|
+
interface HttpMethods {
|
|
382
|
+
'dash.network.http.request': {
|
|
383
|
+
params: WireRequest<HttpRequest>;
|
|
384
|
+
result: HttpResponse;
|
|
264
385
|
};
|
|
265
|
-
'dash.
|
|
266
|
-
params:
|
|
267
|
-
|
|
268
|
-
path: string;
|
|
269
|
-
overwrite?: boolean;
|
|
270
|
-
};
|
|
271
|
-
result: FileEntry;
|
|
386
|
+
'dash.network.http.download': {
|
|
387
|
+
params: WireRequest<HttpDownloadRequest>;
|
|
388
|
+
result: HttpDownloadResponse;
|
|
272
389
|
};
|
|
273
|
-
'dash.
|
|
274
|
-
params: {
|
|
275
|
-
|
|
390
|
+
'dash.network.http.upload': {
|
|
391
|
+
params: Omit<HttpUploadRequest, 'files'> & {
|
|
392
|
+
files: {
|
|
393
|
+
field: string;
|
|
394
|
+
file: string;
|
|
395
|
+
name?: string;
|
|
396
|
+
}[];
|
|
276
397
|
};
|
|
277
|
-
result:
|
|
278
|
-
};
|
|
279
|
-
'dash.file.usage': {
|
|
280
|
-
params: Record<string, never>;
|
|
281
|
-
result: StorageUsage;
|
|
398
|
+
result: HttpResponse;
|
|
282
399
|
};
|
|
283
400
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
as
|
|
289
|
-
append?: boolean;
|
|
290
|
-
}
|
|
291
|
-
interface ReplaceOptions {
|
|
292
|
-
overwrite?: boolean;
|
|
401
|
+
declare function request<ResponseBody = string, RequestBody extends HttpRequestBody = HttpRequestBody>(options: HttpRequest<RequestBody> & HttpReadOptions<ResponseBody>, callOptions?: CallOptions): DashRequest<HttpResponse<ResponseBody>>;
|
|
402
|
+
declare function download(options: HttpDownloadRequest, callOptions?: CallOptions): DashRequest<HttpDownloadResponse>;
|
|
403
|
+
declare function upload<ResponseBody = string>(options: HttpUploadRequest & HttpReadOptions<ResponseBody>, callOptions?: CallOptions): DashRequest<HttpResponse<ResponseBody>>;
|
|
404
|
+
declare namespace index_d_exports {
|
|
405
|
+
export { HttpDownloadRequest, HttpDownloadResponse, HttpMethod, HttpReadOptions, HttpRequest, HttpRequestBody, HttpResponse, HttpUploadFile, HttpUploadRequest, NetworkMethods, http_d_exports as http };
|
|
293
406
|
}
|
|
294
|
-
|
|
295
|
-
declare function write(path: string, data: string, options?: WriteOptions, callOptions?: CallOptions): DashRequest<FileEntry>;
|
|
296
|
-
declare function stat(path: string, callOptions?: CallOptions): DashRequest<FileEntry | null>;
|
|
297
|
-
declare function list(path?: string, options?: {
|
|
298
|
-
recursive?: boolean;
|
|
299
|
-
}, callOptions?: CallOptions): DashRequest<FileEntry[]>;
|
|
300
|
-
declare function createFolder(path: string, callOptions?: CallOptions): DashRequest<FileEntry>;
|
|
301
|
-
declare function move(from: string, to: string, options?: ReplaceOptions, callOptions?: CallOptions): DashRequest<FileEntry>;
|
|
302
|
-
declare function copy(from: string, to: string, options?: ReplaceOptions, callOptions?: CallOptions): DashRequest<FileEntry>;
|
|
303
|
-
declare function remove(path: string, options?: {
|
|
304
|
-
recursive?: boolean;
|
|
305
|
-
}, callOptions?: CallOptions): DashRequest<void>;
|
|
306
|
-
declare function save(file: DotFile | string, path: string, options?: ReplaceOptions, callOptions?: CallOptions): DashRequest<FileEntry>;
|
|
307
|
-
declare function open(path: string, callOptions?: CallOptions): DashRequest<DotFile>;
|
|
308
|
-
declare function usage(callOptions?: CallOptions): DashRequest<StorageUsage>;
|
|
407
|
+
type NetworkMethods = HttpMethods;
|
|
309
408
|
//#endregion
|
|
310
409
|
//#region src/tracked.d.ts
|
|
311
410
|
export declare function tracked<Group extends object>(group: Group, track: (request: DashRequest<unknown>) => void): Group;
|
|
@@ -314,10 +413,10 @@ export declare function tracked<Group extends object>(group: Group, track: (requ
|
|
|
314
413
|
export declare const dash: {
|
|
315
414
|
ui: typeof index_d_exports$1;
|
|
316
415
|
system: typeof index_d_exports$2;
|
|
317
|
-
network: typeof index_d_exports
|
|
318
|
-
|
|
416
|
+
network: typeof index_d_exports;
|
|
417
|
+
storage: typeof index_d_exports$3;
|
|
319
418
|
};
|
|
320
419
|
export type Dash = typeof dash;
|
|
321
420
|
//#endregion
|
|
322
|
-
export { type AlertAction, type AlertOptions, type AlertResult, type CallOptions, type DashMethod, type DashMethods, type DashRequest, type DotFile, type FileEncoding, type FileEntry,
|
|
421
|
+
export { type AlertAction, type AlertOptions, type AlertResult, type CacheSetOptions, type CacheValue, type CallOptions, type DashMethod, type DashMethods, type DashRequest, type DotFile, type FileEncoding, type FileEntry, HostError, type HostErrorCode, type HttpDownloadRequest, type HttpDownloadResponse, type HttpMethod, type HttpReadOptions, type HttpRequest, type HttpRequestBody, type HttpResponse, type HttpUploadFile, type HttpUploadRequest, type NetworkMethods, type ReadOptions, type ReplaceOptions, type ShareOptions, type StorageMethods, type StorageUsage, type SystemMethods, type TorchState, type UIMethods, type VibrateOptions, type VibrationStyle, type WriteOptions };
|
|
323
422
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/files.ts","../src/
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/storage/cache.ts","../src/files.ts","../src/storage/file.ts","../src/storage/secret.ts","../src/storage/index.ts","../src/system/clipboard.ts","../src/system/delay.ts","../src/system/haptics.ts","../src/system/open-url.ts","../src/system/share.ts","../src/system/torch.ts","../src/system/index.ts","../src/ui/dialogs.ts","../src/ui/index.ts","../src/methods.ts","../src/call.ts","../src/network/http.ts","../src/network/index.ts","../src/tracked.ts","../src/index.ts"],"mappings":";;;;KAMY,yCAAyC;GAAkB,cAAc;;UAEpE;EACf;IAA4B;MAAU;;IAAe,QAAQ;;EAC7D;IACE;MAAU;MAAa,OAAO;MAAY;;IAC1C;;EAEF;IAA+B;MAAU;;IAAe;;EACxD;IAA+B;MAAU;;IAAe;;EACxD;IAA6B,QAAQ;IAAuB;;EAC5D;IAA8B,QAAQ;IAAuB;;;UAG9C;EAEf;;iBAIc,MAAI,cAAc,aAAa,YAC7C,aACA,cAAc,cACb,YAAY;iBAIC,MACd,aACA,OAAO,YACP,UAAS,iBACT,cAAc,cACb;iBAIa,SAAO,aAAa,cAAc,cAAc;iBAIhD,OAAO,aAAa,cAAc,cAAc;iBAKhD,KAAK,cAAc,cAAc;iBAIjC,QAAM,cAAc,cAAc;;;UCtDjC;EACf;EACA;EACA;EACA;EACA;;;;;UCEe;EACf;EACA;EACA;EACA;EACA;EACA;;KAGU;UAEK;EACf;EACA;;UAGe;EACf;IAA4B;MAAU;MAAc,KAAK;;IAAgB;;EACzE;IACE;MAAU;MAAc;MAAc,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,YAAY;IAAc,QAAQ;;EACzE;IACE,QAAQ,YAAY;IACpB,QAAQ;;EAEV;IACE,QAAQ,KAAK;MACX;QAAS;QAAe;QAAc;;;IAExC,QAAQ;;;iBAKI,QACd,uBACA,oBAAoB,kBAAkB,iBAEtC,SAAS,YAAY,eAAe,gBAAgB,eACpD,cAAc,cACb,YAAY,aAAa;iBAOZ,SACd,SAAS,qBACT,cAAc,cACb,YAAY;iBAKC,OAAO,uBACrB,SAAS,oBAAoB,gBAAgB,eAC7C,cAAc,cACb,YAAY,aAAa;;;;KClFhB,iBAAiB;;;wBCZb,QAAQ,sBACtB,OAAO,OACP,QAAQ,SAAS,gCAChB;;;qBCAU;;;;;;YAED,cAAc"}
|
package/dist/index.js
CHANGED
|
@@ -5,77 +5,9 @@ function call(method, params, options = {}) {
|
|
|
5
5
|
return callHost(method, params, options);
|
|
6
6
|
}
|
|
7
7
|
//#endregion
|
|
8
|
-
//#region src/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
createFolder: () => createFolder,
|
|
12
|
-
list: () => list,
|
|
13
|
-
move: () => move,
|
|
14
|
-
open: () => open,
|
|
15
|
-
read: () => read,
|
|
16
|
-
remove: () => remove,
|
|
17
|
-
save: () => save,
|
|
18
|
-
stat: () => stat,
|
|
19
|
-
usage: () => usage,
|
|
20
|
-
write: () => write
|
|
21
|
-
});
|
|
22
|
-
function read(path, options = {}, callOptions) {
|
|
23
|
-
return call("dash.file.read", {
|
|
24
|
-
path,
|
|
25
|
-
...options
|
|
26
|
-
}, callOptions);
|
|
27
|
-
}
|
|
28
|
-
function write(path, data, options = {}, callOptions) {
|
|
29
|
-
return call("dash.file.write", {
|
|
30
|
-
path,
|
|
31
|
-
data,
|
|
32
|
-
...options
|
|
33
|
-
}, callOptions);
|
|
34
|
-
}
|
|
35
|
-
function stat(path, callOptions) {
|
|
36
|
-
return call("dash.file.stat", { path }, callOptions);
|
|
37
|
-
}
|
|
38
|
-
function list(path = "", options = {}, callOptions) {
|
|
39
|
-
return call("dash.file.list", {
|
|
40
|
-
path,
|
|
41
|
-
...options
|
|
42
|
-
}, callOptions);
|
|
43
|
-
}
|
|
44
|
-
function createFolder(path, callOptions) {
|
|
45
|
-
return call("dash.file.createFolder", { path }, callOptions);
|
|
46
|
-
}
|
|
47
|
-
function move(from, to, options = {}, callOptions) {
|
|
48
|
-
return call("dash.file.move", {
|
|
49
|
-
from,
|
|
50
|
-
to,
|
|
51
|
-
...options
|
|
52
|
-
}, callOptions);
|
|
53
|
-
}
|
|
54
|
-
function copy(from, to, options = {}, callOptions) {
|
|
55
|
-
return call("dash.file.copy", {
|
|
56
|
-
from,
|
|
57
|
-
to,
|
|
58
|
-
...options
|
|
59
|
-
}, callOptions);
|
|
60
|
-
}
|
|
61
|
-
function remove(path, options = {}, callOptions) {
|
|
62
|
-
return call("dash.file.remove", {
|
|
63
|
-
path,
|
|
64
|
-
...options
|
|
65
|
-
}, callOptions);
|
|
66
|
-
}
|
|
67
|
-
function save(file, path, options = {}, callOptions) {
|
|
68
|
-
return call("dash.file.save", {
|
|
69
|
-
file: typeof file === "string" ? file : file.id,
|
|
70
|
-
path,
|
|
71
|
-
...options
|
|
72
|
-
}, callOptions);
|
|
73
|
-
}
|
|
74
|
-
function open(path, callOptions) {
|
|
75
|
-
return call("dash.file.open", { path }, callOptions);
|
|
76
|
-
}
|
|
77
|
-
function usage(callOptions) {
|
|
78
|
-
return call("dash.file.usage", {}, callOptions);
|
|
8
|
+
//#region src/files.ts
|
|
9
|
+
function fileId(file) {
|
|
10
|
+
return typeof file === "string" ? file : file.id;
|
|
79
11
|
}
|
|
80
12
|
//#endregion
|
|
81
13
|
//#region src/network/http.ts
|
|
@@ -95,7 +27,7 @@ function upload(options, callOptions) {
|
|
|
95
27
|
const { as, ...request } = options;
|
|
96
28
|
const files = request.files.map(({ file, ...rest }) => ({
|
|
97
29
|
...rest,
|
|
98
|
-
file:
|
|
30
|
+
file: fileId(file)
|
|
99
31
|
}));
|
|
100
32
|
const params = {
|
|
101
33
|
...request,
|
|
@@ -147,6 +79,141 @@ function parseJson({ status, statusText, body }) {
|
|
|
147
79
|
//#region src/network/index.ts
|
|
148
80
|
var network_exports = /* @__PURE__ */ __exportAll({ http: () => http_exports });
|
|
149
81
|
//#endregion
|
|
82
|
+
//#region src/storage/cache.ts
|
|
83
|
+
var cache_exports = /* @__PURE__ */ __exportAll({
|
|
84
|
+
clear: () => clear$1,
|
|
85
|
+
exists: () => exists,
|
|
86
|
+
get: () => get$1,
|
|
87
|
+
keys: () => keys,
|
|
88
|
+
remove: () => remove$2,
|
|
89
|
+
set: () => set$1
|
|
90
|
+
});
|
|
91
|
+
function get$1(key, callOptions) {
|
|
92
|
+
return call("dash.storage.cache.get", { key }, callOptions);
|
|
93
|
+
}
|
|
94
|
+
function set$1(key, value, options = {}, callOptions) {
|
|
95
|
+
return call("dash.storage.cache.set", {
|
|
96
|
+
key,
|
|
97
|
+
value,
|
|
98
|
+
...options
|
|
99
|
+
}, callOptions);
|
|
100
|
+
}
|
|
101
|
+
function remove$2(key, callOptions) {
|
|
102
|
+
return call("dash.storage.cache.remove", { key }, callOptions);
|
|
103
|
+
}
|
|
104
|
+
function exists(key, callOptions) {
|
|
105
|
+
return call("dash.storage.cache.exists", { key }, callOptions);
|
|
106
|
+
}
|
|
107
|
+
function keys(callOptions) {
|
|
108
|
+
return call("dash.storage.cache.keys", {}, callOptions);
|
|
109
|
+
}
|
|
110
|
+
function clear$1(callOptions) {
|
|
111
|
+
return call("dash.storage.cache.clear", {}, callOptions);
|
|
112
|
+
}
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region src/storage/file.ts
|
|
115
|
+
var file_exports = /* @__PURE__ */ __exportAll({
|
|
116
|
+
copy: () => copy,
|
|
117
|
+
createFolder: () => createFolder,
|
|
118
|
+
list: () => list,
|
|
119
|
+
move: () => move,
|
|
120
|
+
open: () => open,
|
|
121
|
+
read: () => read,
|
|
122
|
+
remove: () => remove$1,
|
|
123
|
+
save: () => save,
|
|
124
|
+
stat: () => stat,
|
|
125
|
+
usage: () => usage,
|
|
126
|
+
write: () => write
|
|
127
|
+
});
|
|
128
|
+
function read(path, options = {}, callOptions) {
|
|
129
|
+
return call("dash.storage.file.read", {
|
|
130
|
+
path,
|
|
131
|
+
...options
|
|
132
|
+
}, callOptions);
|
|
133
|
+
}
|
|
134
|
+
function write(path, data, options = {}, callOptions) {
|
|
135
|
+
return call("dash.storage.file.write", {
|
|
136
|
+
path,
|
|
137
|
+
data,
|
|
138
|
+
...options
|
|
139
|
+
}, callOptions);
|
|
140
|
+
}
|
|
141
|
+
function stat(path, callOptions) {
|
|
142
|
+
return call("dash.storage.file.stat", { path }, callOptions);
|
|
143
|
+
}
|
|
144
|
+
function list(path = "", options = {}, callOptions) {
|
|
145
|
+
return call("dash.storage.file.list", {
|
|
146
|
+
path,
|
|
147
|
+
...options
|
|
148
|
+
}, callOptions);
|
|
149
|
+
}
|
|
150
|
+
function createFolder(path, callOptions) {
|
|
151
|
+
return call("dash.storage.file.createFolder", { path }, callOptions);
|
|
152
|
+
}
|
|
153
|
+
function move(from, to, options = {}, callOptions) {
|
|
154
|
+
return call("dash.storage.file.move", {
|
|
155
|
+
from,
|
|
156
|
+
to,
|
|
157
|
+
...options
|
|
158
|
+
}, callOptions);
|
|
159
|
+
}
|
|
160
|
+
function copy(from, to, options = {}, callOptions) {
|
|
161
|
+
return call("dash.storage.file.copy", {
|
|
162
|
+
from,
|
|
163
|
+
to,
|
|
164
|
+
...options
|
|
165
|
+
}, callOptions);
|
|
166
|
+
}
|
|
167
|
+
function remove$1(path, options = {}, callOptions) {
|
|
168
|
+
return call("dash.storage.file.remove", {
|
|
169
|
+
path,
|
|
170
|
+
...options
|
|
171
|
+
}, callOptions);
|
|
172
|
+
}
|
|
173
|
+
function save(file, path, options = {}, callOptions) {
|
|
174
|
+
return call("dash.storage.file.save", {
|
|
175
|
+
file: fileId(file),
|
|
176
|
+
path,
|
|
177
|
+
...options
|
|
178
|
+
}, callOptions);
|
|
179
|
+
}
|
|
180
|
+
function open(path, callOptions) {
|
|
181
|
+
return call("dash.storage.file.open", { path }, callOptions);
|
|
182
|
+
}
|
|
183
|
+
function usage(callOptions) {
|
|
184
|
+
return call("dash.storage.file.usage", {}, callOptions);
|
|
185
|
+
}
|
|
186
|
+
//#endregion
|
|
187
|
+
//#region src/storage/secret.ts
|
|
188
|
+
var secret_exports = /* @__PURE__ */ __exportAll({
|
|
189
|
+
clear: () => clear,
|
|
190
|
+
get: () => get,
|
|
191
|
+
remove: () => remove,
|
|
192
|
+
set: () => set
|
|
193
|
+
});
|
|
194
|
+
function get(key, callOptions) {
|
|
195
|
+
return call("dash.storage.secret.get", { key }, callOptions);
|
|
196
|
+
}
|
|
197
|
+
function set(key, value, callOptions) {
|
|
198
|
+
return call("dash.storage.secret.set", {
|
|
199
|
+
key,
|
|
200
|
+
value
|
|
201
|
+
}, callOptions);
|
|
202
|
+
}
|
|
203
|
+
function remove(key, callOptions) {
|
|
204
|
+
return call("dash.storage.secret.remove", { key }, callOptions);
|
|
205
|
+
}
|
|
206
|
+
function clear(callOptions) {
|
|
207
|
+
return call("dash.storage.secret.clear", {}, callOptions);
|
|
208
|
+
}
|
|
209
|
+
//#endregion
|
|
210
|
+
//#region src/storage/index.ts
|
|
211
|
+
var storage_exports = /* @__PURE__ */ __exportAll({
|
|
212
|
+
cache: () => cache_exports,
|
|
213
|
+
file: () => file_exports,
|
|
214
|
+
secret: () => secret_exports
|
|
215
|
+
});
|
|
216
|
+
//#endregion
|
|
150
217
|
//#region src/system/clipboard.ts
|
|
151
218
|
function copyText(text, callOptions) {
|
|
152
219
|
return call("dash.system.copyText", { text }, callOptions);
|
|
@@ -162,14 +229,18 @@ function vibrate(options = {}, callOptions) {
|
|
|
162
229
|
return call("dash.system.vibrate", { style: options.style ?? "medium" }, callOptions);
|
|
163
230
|
}
|
|
164
231
|
//#endregion
|
|
232
|
+
//#region src/system/open-url.ts
|
|
233
|
+
function openUrl(url, callOptions) {
|
|
234
|
+
return call("dash.system.openUrl", { url }, callOptions);
|
|
235
|
+
}
|
|
236
|
+
//#endregion
|
|
165
237
|
//#region src/system/share.ts
|
|
166
238
|
function share(options, callOptions) {
|
|
167
239
|
const { file, ...rest } = options;
|
|
168
240
|
if (file === void 0) return call("dash.system.share", rest, callOptions);
|
|
169
|
-
const id = typeof file === "string" ? file : file.id;
|
|
170
241
|
return call("dash.system.share", {
|
|
171
242
|
...rest,
|
|
172
|
-
file:
|
|
243
|
+
file: fileId(file)
|
|
173
244
|
}, callOptions);
|
|
174
245
|
}
|
|
175
246
|
//#endregion
|
|
@@ -182,6 +253,7 @@ function torch(state, callOptions) {
|
|
|
182
253
|
var system_exports = /* @__PURE__ */ __exportAll({
|
|
183
254
|
copyText: () => copyText,
|
|
184
255
|
delay: () => delay,
|
|
256
|
+
openUrl: () => openUrl,
|
|
185
257
|
share: () => share,
|
|
186
258
|
torch: () => torch,
|
|
187
259
|
vibrate: () => vibrate
|
|
@@ -221,7 +293,7 @@ const dash = {
|
|
|
221
293
|
ui: ui_exports,
|
|
222
294
|
system: system_exports,
|
|
223
295
|
network: network_exports,
|
|
224
|
-
|
|
296
|
+
storage: storage_exports
|
|
225
297
|
};
|
|
226
298
|
//#endregion
|
|
227
299
|
export { HostError, dash, tracked };
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["HostError"],"sources":["../src/call.ts","../src/file/index.ts","../src/network/http.ts","../src/network/index.ts","../src/system/clipboard.ts","../src/system/delay.ts","../src/system/haptics.ts","../src/system/share.ts","../src/system/torch.ts","../src/system/index.ts","../src/ui/dialogs.ts","../src/ui/index.ts","../src/tracked.ts","../src/index.ts"],"sourcesContent":["import type { HostCallOptions, HostRequest } from '@monimesl/dot-core';\nimport { callHost } from '@monimesl/dot-core';\n\nimport type { DashMethod, DashMethods } from './methods';\n\nexport type CallOptions = HostCallOptions;\n\n// A Dash call in flight: await it for the result, or cancel it.\nexport type DashRequest<Result> = HostRequest<Result>;\n\nexport function call<Method extends DashMethod>(\n method: Method,\n params: DashMethods[Method]['params'],\n options: CallOptions = {},\n): DashRequest<DashMethods[Method]['result']> {\n return callHost(method, params, options);\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\nimport type { DotFile } from '../files';\n\n// A dot's own files, in a folder no other dot sees. Paths are relative to it, such as\n// \"receipts/42.pdf\"; '' is the folder itself.\n\nexport interface FileEntry {\n name: string;\n path: string;\n size: number;\n kind: 'file' | 'folder';\n modifiedAt: number;\n contentType?: string;\n}\n\nexport type FileEncoding = 'text' | 'base64';\n\nexport interface StorageUsage {\n used: number;\n quota: number;\n}\n\nexport interface FileMethods {\n 'dash.file.read': { params: { path: string; as?: FileEncoding }; result: string };\n 'dash.file.write': {\n params: { path: string; data: string; as?: FileEncoding; append?: boolean };\n result: FileEntry;\n };\n 'dash.file.stat': { params: { path: string }; result: FileEntry | null };\n 'dash.file.list': { params: { path: string; recursive?: boolean }; result: FileEntry[] };\n 'dash.file.createFolder': { params: { path: string }; result: FileEntry };\n 'dash.file.move': {\n params: { from: string; to: string; overwrite?: boolean };\n result: FileEntry;\n };\n 'dash.file.copy': {\n params: { from: string; to: string; overwrite?: boolean };\n result: FileEntry;\n };\n 'dash.file.remove': { params: { path: string; recursive?: boolean }; result: void };\n 'dash.file.save': {\n params: { file: string; path: string; overwrite?: boolean };\n result: FileEntry;\n };\n 'dash.file.open': { params: { path: string }; result: DotFile };\n 'dash.file.usage': { params: Record<string, never>; result: StorageUsage };\n}\n\nexport interface ReadOptions {\n as?: FileEncoding;\n}\n\nexport interface WriteOptions {\n as?: FileEncoding;\n append?: boolean;\n}\n\nexport interface ReplaceOptions {\n overwrite?: boolean;\n}\n\n// Up to 5 MB.\nexport function read(\n path: string,\n options: ReadOptions = {},\n callOptions?: CallOptions,\n): DashRequest<string> {\n return call('dash.file.read', { path, ...options }, callOptions);\n}\n\n// Creates any missing folders above the file.\nexport function write(\n path: string,\n data: string,\n options: WriteOptions = {},\n callOptions?: CallOptions,\n): DashRequest<FileEntry> {\n return call('dash.file.write', { path, data, ...options }, callOptions);\n}\n\nexport function stat(path: string, callOptions?: CallOptions): DashRequest<FileEntry | null> {\n return call('dash.file.stat', { path }, callOptions);\n}\n\n// Sorted by path.\nexport function list(\n path = '',\n options: { recursive?: boolean } = {},\n callOptions?: CallOptions,\n): DashRequest<FileEntry[]> {\n return call('dash.file.list', { path, ...options }, callOptions);\n}\n\nexport function createFolder(path: string, callOptions?: CallOptions): DashRequest<FileEntry> {\n return call('dash.file.createFolder', { path }, callOptions);\n}\n\nexport function move(\n from: string,\n to: string,\n options: ReplaceOptions = {},\n callOptions?: CallOptions,\n): DashRequest<FileEntry> {\n return call('dash.file.move', { from, to, ...options }, callOptions);\n}\n\nexport function copy(\n from: string,\n to: string,\n options: ReplaceOptions = {},\n callOptions?: CallOptions,\n): DashRequest<FileEntry> {\n return call('dash.file.copy', { from, to, ...options }, callOptions);\n}\n\n// A folder with anything in it needs `recursive`.\nexport function remove(\n path: string,\n options: { recursive?: boolean } = {},\n callOptions?: CallOptions,\n): DashRequest<void> {\n return call('dash.file.remove', { path, ...options }, callOptions);\n}\n\n// Keeps a temporary file, such as a download.\nexport function save(\n file: DotFile | string,\n path: string,\n options: ReplaceOptions = {},\n callOptions?: CallOptions,\n): DashRequest<FileEntry> {\n const id = typeof file === 'string' ? file : file.id;\n return call('dash.file.save', { file: id, path, ...options }, callOptions);\n}\n\n// A stored file as a DotFile, to show with its `url` or send with `http.upload`.\nexport function open(path: string, callOptions?: CallOptions): DashRequest<DotFile> {\n return call('dash.file.open', { path }, callOptions);\n}\n\nexport function usage(callOptions?: CallOptions): DashRequest<StorageUsage> {\n return call('dash.file.usage', {}, callOptions);\n}\n","import { HostError, createHostRequest } from '@monimesl/dot-core';\n\nimport type { CallOptions, DashRequest } from '../call';\nimport type { DotFile } from '../files';\nimport { call } from '../call';\n\nexport type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';\n\nexport type HttpRequestBody = string | object;\n\nexport interface HttpRequest<Body extends HttpRequestBody = HttpRequestBody> {\n url: string;\n method?: HttpMethod;\n headers?: Record<string, string>;\n body?: Body;\n}\n\nexport interface HttpResponse<Body = string> {\n ok: boolean;\n status: number;\n statusText: string;\n headers: Record<string, string>;\n body: Body;\n}\n\n// A body of any type but string needs `as: 'json'`.\nexport type HttpReadOptions<Body> = [Body] extends [string] ? { as?: 'text' } : { as: 'json' };\n\nexport interface HttpDownloadRequest extends HttpRequest {\n name?: string;\n}\n\nexport type HttpDownloadResponse =\n | (Omit<HttpResponse, 'ok' | 'body'> & { ok: true; file: DotFile })\n | (Omit<HttpResponse, 'ok'> & { ok: false });\n\nexport interface HttpUploadFile {\n field: string;\n file: DotFile | string;\n name?: string;\n}\n\nexport interface HttpUploadRequest {\n url: string;\n // POST by default.\n method?: 'POST' | 'PUT' | 'PATCH';\n headers?: Record<string, string>;\n fields?: Record<string, string>;\n files: HttpUploadFile[];\n}\n\ntype WireRequest<Request extends HttpRequest> = Omit<Request, 'headers' | 'body'> & {\n headers?: Record<string, string> | undefined;\n body?: string | undefined;\n};\n\ntype ReadAs = 'text' | 'json';\n\nexport interface HttpMethods {\n 'dash.network.http.request': { params: WireRequest<HttpRequest>; result: HttpResponse };\n 'dash.network.http.download': {\n params: WireRequest<HttpDownloadRequest>;\n result: HttpDownloadResponse;\n };\n 'dash.network.http.upload': {\n params: Omit<HttpUploadRequest, 'files'> & {\n files: { field: string; file: string; name?: string }[];\n };\n result: HttpResponse;\n };\n}\n\n// Like fetch: resolves with any response, even a 404. An object body goes as JSON.\nexport function request<\n ResponseBody = string,\n RequestBody extends HttpRequestBody = HttpRequestBody,\n>(\n options: HttpRequest<RequestBody> & HttpReadOptions<ResponseBody>,\n callOptions?: CallOptions,\n): DashRequest<HttpResponse<ResponseBody>> {\n const { as, ...request } = options as HttpRequest & { as?: ReadAs };\n const response = call('dash.network.http.request', wireRequest(request, as), callOptions);\n return readBody(response, as);\n}\n\n// Saves a 2xx response's body, up to 100 MB, to a temporary file.\nexport function download(\n options: HttpDownloadRequest,\n callOptions?: CallOptions,\n): DashRequest<HttpDownloadResponse> {\n return call('dash.network.http.download', wireRequest(options), callOptions);\n}\n\n// Sends files the dot has as a multipart form.\nexport function upload<ResponseBody = string>(\n options: HttpUploadRequest & HttpReadOptions<ResponseBody>,\n callOptions?: CallOptions,\n): DashRequest<HttpResponse<ResponseBody>> {\n const { as, ...request } = options as HttpUploadRequest & { as?: ReadAs };\n const files = request.files.map(({ file, ...rest }) => ({\n ...rest,\n file: typeof file === 'string' ? file : file.id,\n }));\n const params = { ...request, files };\n if (as === 'json') {\n params.headers = withDefaultHeader(request.headers, 'Accept', 'application/json');\n }\n const response = call('dash.network.http.upload', params, callOptions);\n return readBody(response, as);\n}\n\nfunction wireRequest<Request extends HttpRequest>(\n request: Request,\n as?: ReadAs,\n): WireRequest<Request> {\n let headers = request.headers;\n let body: string | undefined;\n if (as === 'json') {\n headers = withDefaultHeader(headers, 'Accept', 'application/json');\n }\n if (typeof request.body === 'string') {\n body = request.body;\n } else if (request.body !== undefined) {\n headers = withDefaultHeader(headers, 'Content-Type', 'application/json');\n body = JSON.stringify(request.body);\n }\n return { ...request, headers, body };\n}\n\nfunction withDefaultHeader(\n headers: Record<string, string> | undefined,\n name: string,\n value: string,\n): Record<string, string> {\n const lowerName = name.toLowerCase();\n if (headers && Object.keys(headers).some((existing) => existing.toLowerCase() === lowerName)) {\n return headers;\n }\n return { ...headers, [name]: value };\n}\n\nfunction readBody<Body>(\n response: DashRequest<HttpResponse>,\n as: ReadAs | undefined,\n): DashRequest<HttpResponse<Body>> {\n if (as !== 'json') {\n return response as DashRequest<HttpResponse<Body>>;\n }\n const parsed = response.then((result) => ({ ...result, body: parseJson<Body>(result) }));\n return createHostRequest(parsed, () => response.cancel());\n}\n\nfunction parseJson<Body>({ status, statusText, body }: HttpResponse): Body {\n try {\n return JSON.parse(body) as Body;\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new HostError('failed', `The response (${status} ${statusText}) isn't JSON: ${message}`);\n }\n}\n","import type { HttpMethods } from './http';\nimport * as http from './http';\n\nexport { http };\nexport type {\n HttpDownloadRequest,\n HttpDownloadResponse,\n HttpMethod,\n HttpReadOptions,\n HttpRequest,\n HttpRequestBody,\n HttpResponse,\n HttpUploadFile,\n HttpUploadRequest,\n} from './http';\n\nexport type NetworkMethods = HttpMethods;\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\nexport interface ClipboardMethods {\n 'dash.system.copyText': { params: { text: string }; result: void };\n}\n\nexport function copyText(text: string, callOptions?: CallOptions): DashRequest<void> {\n return call('dash.system.copyText', { text }, callOptions);\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\nexport interface DelayMethods {\n 'dash.system.delay': { params: { milliseconds: number }; result: void };\n}\n\n// Resolves after `milliseconds`, which the host counts, since the service has no timers.\nexport function delay(milliseconds: number, callOptions?: CallOptions): DashRequest<void> {\n return call('dash.system.delay', { milliseconds }, callOptions);\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\nexport type VibrationStyle = 'light' | 'medium' | 'heavy' | 'success' | 'warning' | 'error';\n\nexport interface VibrateOptions {\n // Defaults to `medium`.\n style?: VibrationStyle | undefined;\n}\n\nexport interface HapticsMethods {\n 'dash.system.vibrate': { params: VibrateOptions; result: void };\n}\n\n// Plays a short vibration, and resolves once it has.\nexport function vibrate(\n options: VibrateOptions = {},\n callOptions?: CallOptions,\n): DashRequest<void> {\n return call('dash.system.vibrate', { style: options.style ?? 'medium' }, callOptions);\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\nimport type { DotFile } from '../files';\n\n// Give at least one of `text`, `url` and `file`.\nexport interface ShareOptions {\n // A subject, where the app shared to has one, such as an email.\n title?: string;\n text?: string;\n url?: string;\n file?: DotFile | string;\n}\n\nexport interface ShareMethods {\n 'dash.system.share': {\n params: { title?: string; text?: string; url?: string; file?: string };\n result: void;\n };\n}\n\n// Opens the device's share sheet, and resolves once it shows.\nexport function share(options: ShareOptions, callOptions?: CallOptions): DashRequest<void> {\n const { file, ...rest } = options;\n if (file === undefined) {\n return call('dash.system.share', rest, callOptions);\n }\n const id = typeof file === 'string' ? file : file.id;\n return call('dash.system.share', { ...rest, file: id }, callOptions);\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\nexport type TorchState = 'on' | 'off';\n\nexport interface TorchMethods {\n 'dash.system.torch': { params: { state: TorchState }; result: void };\n}\n\n// Turns the torch on or off. Rejects with `unsupported` on a device without one.\nexport function torch(state: TorchState, callOptions?: CallOptions): DashRequest<void> {\n return call('dash.system.torch', { state }, callOptions);\n}\n","import type { ClipboardMethods } from './clipboard';\nimport type { DelayMethods } from './delay';\nimport type { HapticsMethods } from './haptics';\nimport type { ShareMethods } from './share';\nimport type { TorchMethods } from './torch';\n\nexport { copyText } from './clipboard';\nexport { delay } from './delay';\nexport { vibrate } from './haptics';\nexport { share } from './share';\nexport { torch } from './torch';\nexport type { VibrateOptions, VibrationStyle } from './haptics';\nexport type { ShareOptions } from './share';\nexport type { TorchState } from './torch';\n\nexport type SystemMethods = ClipboardMethods &\n DelayMethods &\n HapticsMethods &\n ShareMethods &\n TorchMethods;\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\nexport interface AlertAction {\n id: string;\n label: string;\n // `cancel` dismisses the alert; `destructive` marks something that cannot be undone.\n role?: 'default' | 'cancel' | 'destructive' | undefined;\n}\n\nexport interface AlertOptions {\n title: string;\n message?: string | undefined;\n // Defaults to a single OK.\n actions?: AlertAction[] | undefined;\n}\n\nexport interface AlertResult {\n // The `id` of the action the user chose.\n action: string;\n}\n\nexport interface DialogMethods {\n 'dash.ui.alert': { params: AlertOptions; result: AlertResult };\n}\n\n// Shows a native alert, and resolves with the action the user chose.\nexport function alert(options: AlertOptions, callOptions?: CallOptions): DashRequest<AlertResult> {\n const actions = options.actions ?? [{ id: 'ok', label: 'OK' }];\n return call('dash.ui.alert', { ...options, actions }, callOptions);\n}\n","import type { DialogMethods } from './dialogs';\n\nexport { alert } from './dialogs';\nexport type { AlertAction, AlertOptions, AlertResult } from './dialogs';\n\nexport type UIMethods = DialogMethods;\n","import type { DashRequest } from './call';\n\n// A copy of `group`, such as `dash` itself, whose functions pass each request they start to\n// `track`.\nexport function tracked<Group extends object>(\n group: Group,\n track: (request: DashRequest<unknown>) => void,\n): Group {\n const copy: Record<string, unknown> = {};\n for (const [name, member] of Object.entries(group)) {\n if (typeof member === 'function') {\n const start = member as (...args: unknown[]) => DashRequest<unknown>;\n copy[name] = (...args: unknown[]) => {\n const request = start(...args);\n track(request);\n return request;\n };\n } else {\n copy[name] = tracked(member as object, track);\n }\n }\n return copy as Group;\n}\n","import * as file from './file';\nimport * as network from './network';\nimport * as system from './system';\nimport * as ui from './ui';\n\n// Dash's features for a dot's service, grouped by use: `dash.ui.alert(...)`, `dash.system.torch(...)`,\n// `dash.network.http.request(...)`.\nexport const dash = { ui, system, network, file };\n\nexport type Dash = typeof dash;\n\nexport { tracked } from './tracked';\n\nexport { HostError } from '@monimesl/dot-core';\nexport type { HostErrorCode } from '@monimesl/dot-core';\nexport type { CallOptions, DashRequest } from './call';\nexport type { DashMethod, DashMethods } from './methods';\nexport type {\n FileEncoding,\n FileEntry,\n FileMethods,\n ReadOptions,\n ReplaceOptions,\n StorageUsage,\n WriteOptions,\n} from './file';\nexport type { DotFile } from './files';\nexport type {\n HttpDownloadRequest,\n HttpDownloadResponse,\n HttpMethod,\n HttpReadOptions,\n HttpRequest,\n HttpRequestBody,\n HttpResponse,\n HttpUploadFile,\n HttpUploadRequest,\n NetworkMethods,\n} from './network';\nexport type {\n ShareOptions,\n SystemMethods,\n TorchState,\n VibrateOptions,\n VibrationStyle,\n} from './system';\nexport type { AlertAction, AlertOptions, AlertResult, UIMethods } from './ui';\n"],"mappings":";;;AAUA,SAA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UAAU,QAAQ,WAAW,CAAC;EAAE,IAAI;EAAM,OAAO;CAAK,CAAC;CAC7D,OAAO,KAAK,iBAAiB;EAAE,GAAG;EAAS;CAAQ,GAAG,WAAW;AACnE;;;;;;AE1BA,SAAgB,QACd,OACA,OACO;CACP,MAAM,OAAgC,CAAC;CACvC,KAAK,MAAM,CAAC,MAAM,WAAW,OAAO,QAAQ,KAAK,GAC/C,IAAI,OAAO,WAAW,YAAY;EAChC,MAAM,QAAQ;EACd,KAAK,SAAS,GAAG,SAAoB;GACnC,MAAM,UAAU,MAAM,GAAG,IAAI;GAC7B,MAAM,OAAO;GACb,OAAO;EACT;CACF,OACE,KAAK,QAAQ,QAAQ,QAAkB,KAAK;CAGhD,OAAO;AACT;;;ACfA,MAAa,OAAO;CAAE,IAAA;CAAI,QAAA;CAAQ,SAAA;CAAS,MAAA;AAAK"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["HostError","get","set","remove","clear","remove"],"sources":["../src/call.ts","../src/files.ts","../src/network/http.ts","../src/network/index.ts","../src/storage/cache.ts","../src/storage/file.ts","../src/storage/secret.ts","../src/storage/index.ts","../src/system/clipboard.ts","../src/system/delay.ts","../src/system/haptics.ts","../src/system/open-url.ts","../src/system/share.ts","../src/system/torch.ts","../src/system/index.ts","../src/ui/dialogs.ts","../src/ui/index.ts","../src/tracked.ts","../src/index.ts"],"sourcesContent":["import type { HostCallOptions, HostRequest } from '@monimesl/dot-core';\nimport { callHost } from '@monimesl/dot-core';\n\nimport type { DashMethod, DashMethods } from './methods';\n\nexport type CallOptions = HostCallOptions;\n\n// A Dash call in flight: await it for the result, or cancel it.\nexport type DashRequest<Result> = HostRequest<Result>;\n\nexport function call<Method extends DashMethod>(\n method: Method,\n params: DashMethods[Method]['params'],\n options: CallOptions = {},\n): DashRequest<DashMethods[Method]['result']> {\n return callHost(method, params, options);\n}\n","// A file the host keeps for the dot until it closes, such as a download. Show it with its `url`.\nexport interface DotFile {\n id: string;\n name: string;\n size: number;\n contentType: string;\n url: string;\n}\n\nexport function fileId(file: DotFile | string): string {\n return typeof file === 'string' ? file : file.id;\n}\n","import { HostError, createHostRequest } from '@monimesl/dot-core';\n\nimport type { CallOptions, DashRequest } from '../call';\nimport type { DotFile } from '../files';\nimport { call } from '../call';\nimport { fileId } from '../files';\n\nexport type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';\n\nexport type HttpRequestBody = string | object;\n\nexport interface HttpRequest<Body extends HttpRequestBody = HttpRequestBody> {\n url: string;\n method?: HttpMethod;\n headers?: Record<string, string>;\n body?: Body;\n}\n\nexport interface HttpResponse<Body = string> {\n ok: boolean;\n status: number;\n statusText: string;\n headers: Record<string, string>;\n body: Body;\n}\n\n// A body of any type but string needs `as: 'json'`.\nexport type HttpReadOptions<Body> = [Body] extends [string] ? { as?: 'text' } : { as: 'json' };\n\nexport interface HttpDownloadRequest extends HttpRequest {\n name?: string;\n}\n\nexport type HttpDownloadResponse =\n | (Omit<HttpResponse, 'ok' | 'body'> & { ok: true; file: DotFile })\n | (Omit<HttpResponse, 'ok'> & { ok: false });\n\nexport interface HttpUploadFile {\n field: string;\n file: DotFile | string;\n name?: string;\n}\n\nexport interface HttpUploadRequest {\n url: string;\n // POST by default.\n method?: 'POST' | 'PUT' | 'PATCH';\n headers?: Record<string, string>;\n fields?: Record<string, string>;\n files: HttpUploadFile[];\n}\n\ntype WireRequest<Request extends HttpRequest> = Omit<Request, 'headers' | 'body'> & {\n headers?: Record<string, string> | undefined;\n body?: string | undefined;\n};\n\ntype ReadAs = 'text' | 'json';\n\nexport interface HttpMethods {\n 'dash.network.http.request': { params: WireRequest<HttpRequest>; result: HttpResponse };\n 'dash.network.http.download': {\n params: WireRequest<HttpDownloadRequest>;\n result: HttpDownloadResponse;\n };\n 'dash.network.http.upload': {\n params: Omit<HttpUploadRequest, 'files'> & {\n files: { field: string; file: string; name?: string }[];\n };\n result: HttpResponse;\n };\n}\n\n// Like fetch: resolves with any response, even a 404. An object body goes as JSON.\nexport function request<\n ResponseBody = string,\n RequestBody extends HttpRequestBody = HttpRequestBody,\n>(\n options: HttpRequest<RequestBody> & HttpReadOptions<ResponseBody>,\n callOptions?: CallOptions,\n): DashRequest<HttpResponse<ResponseBody>> {\n const { as, ...request } = options as HttpRequest & { as?: ReadAs };\n const response = call('dash.network.http.request', wireRequest(request, as), callOptions);\n return readBody(response, as);\n}\n\n// Saves a 2xx response's body, up to 100 MB, to a temporary file.\nexport function download(\n options: HttpDownloadRequest,\n callOptions?: CallOptions,\n): DashRequest<HttpDownloadResponse> {\n return call('dash.network.http.download', wireRequest(options), callOptions);\n}\n\n// Sends files the dot has as a multipart form.\nexport function upload<ResponseBody = string>(\n options: HttpUploadRequest & HttpReadOptions<ResponseBody>,\n callOptions?: CallOptions,\n): DashRequest<HttpResponse<ResponseBody>> {\n const { as, ...request } = options as HttpUploadRequest & { as?: ReadAs };\n const files = request.files.map(({ file, ...rest }) => ({ ...rest, file: fileId(file) }));\n const params = { ...request, files };\n if (as === 'json') {\n params.headers = withDefaultHeader(request.headers, 'Accept', 'application/json');\n }\n const response = call('dash.network.http.upload', params, callOptions);\n return readBody(response, as);\n}\n\nfunction wireRequest<Request extends HttpRequest>(\n request: Request,\n as?: ReadAs,\n): WireRequest<Request> {\n let headers = request.headers;\n let body: string | undefined;\n if (as === 'json') {\n headers = withDefaultHeader(headers, 'Accept', 'application/json');\n }\n if (typeof request.body === 'string') {\n body = request.body;\n } else if (request.body !== undefined) {\n headers = withDefaultHeader(headers, 'Content-Type', 'application/json');\n body = JSON.stringify(request.body);\n }\n return { ...request, headers, body };\n}\n\nfunction withDefaultHeader(\n headers: Record<string, string> | undefined,\n name: string,\n value: string,\n): Record<string, string> {\n const lowerName = name.toLowerCase();\n if (headers && Object.keys(headers).some((existing) => existing.toLowerCase() === lowerName)) {\n return headers;\n }\n return { ...headers, [name]: value };\n}\n\nfunction readBody<Body>(\n response: DashRequest<HttpResponse>,\n as: ReadAs | undefined,\n): DashRequest<HttpResponse<Body>> {\n if (as !== 'json') {\n return response as DashRequest<HttpResponse<Body>>;\n }\n const parsed = response.then((result) => ({ ...result, body: parseJson<Body>(result) }));\n return createHostRequest(parsed, () => response.cancel());\n}\n\nfunction parseJson<Body>({ status, statusText, body }: HttpResponse): Body {\n try {\n return JSON.parse(body) as Body;\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new HostError('failed', `The response (${status} ${statusText}) isn't JSON: ${message}`);\n }\n}\n","import type { HttpMethods } from './http';\nimport * as http from './http';\n\nexport { http };\nexport type {\n HttpDownloadRequest,\n HttpDownloadResponse,\n HttpMethod,\n HttpReadOptions,\n HttpRequest,\n HttpRequestBody,\n HttpResponse,\n HttpUploadFile,\n HttpUploadRequest,\n} from './http';\n\nexport type NetworkMethods = HttpMethods;\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\n// A dot's own key-value cache, apart from its files: up to 64 MB of JSON values, each kept until it\n// is removed or its `ttl` runs out.\n\nexport type CacheValue = string | number | boolean | CacheValue[] | { [key: string]: CacheValue };\n\nexport interface CacheMethods {\n 'dash.storage.cache.get': { params: { key: string }; result: CacheValue | null };\n 'dash.storage.cache.set': {\n params: { key: string; value: CacheValue; ttl?: number | undefined };\n result: void;\n };\n 'dash.storage.cache.remove': { params: { key: string }; result: void };\n 'dash.storage.cache.exists': { params: { key: string }; result: boolean };\n 'dash.storage.cache.keys': { params: Record<string, never>; result: string[] };\n 'dash.storage.cache.clear': { params: Record<string, never>; result: void };\n}\n\nexport interface CacheSetOptions {\n // Seconds the entry lasts; without one, or with 0 or less, it lasts until removed.\n ttl?: number | undefined;\n}\n\n// null for a key that isn't there, or has expired.\nexport function get<Value extends CacheValue = CacheValue>(\n key: string,\n callOptions?: CallOptions,\n): DashRequest<Value | null> {\n return call('dash.storage.cache.get', { key }, callOptions) as DashRequest<Value | null>;\n}\n\nexport function set(\n key: string,\n value: CacheValue,\n options: CacheSetOptions = {},\n callOptions?: CallOptions,\n): DashRequest<void> {\n return call('dash.storage.cache.set', { key, value, ...options }, callOptions);\n}\n\nexport function remove(key: string, callOptions?: CallOptions): DashRequest<void> {\n return call('dash.storage.cache.remove', { key }, callOptions);\n}\n\nexport function exists(key: string, callOptions?: CallOptions): DashRequest<boolean> {\n return call('dash.storage.cache.exists', { key }, callOptions);\n}\n\n// Sorted.\nexport function keys(callOptions?: CallOptions): DashRequest<string[]> {\n return call('dash.storage.cache.keys', {}, callOptions);\n}\n\nexport function clear(callOptions?: CallOptions): DashRequest<void> {\n return call('dash.storage.cache.clear', {}, callOptions);\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\nimport type { DotFile } from '../files';\nimport { fileId } from '../files';\n\n// A dot's own files, in a folder no other dot sees. Paths are relative to it, such as\n// \"receipts/42.pdf\"; '' is the folder itself.\n\nexport interface FileEntry {\n name: string;\n path: string;\n size: number;\n kind: 'file' | 'folder';\n modifiedAt: number;\n contentType?: string;\n}\n\nexport type FileEncoding = 'text' | 'base64';\n\nexport interface StorageUsage {\n used: number;\n quota: number;\n}\n\nexport interface FileMethods {\n 'dash.storage.file.read': { params: { path: string; as?: FileEncoding }; result: string };\n 'dash.storage.file.write': {\n params: { path: string; data: string; as?: FileEncoding; append?: boolean };\n result: FileEntry;\n };\n 'dash.storage.file.stat': { params: { path: string }; result: FileEntry | null };\n 'dash.storage.file.list': { params: { path: string; recursive?: boolean }; result: FileEntry[] };\n 'dash.storage.file.createFolder': { params: { path: string }; result: FileEntry };\n 'dash.storage.file.move': {\n params: { from: string; to: string; overwrite?: boolean };\n result: FileEntry;\n };\n 'dash.storage.file.copy': {\n params: { from: string; to: string; overwrite?: boolean };\n result: FileEntry;\n };\n 'dash.storage.file.remove': { params: { path: string; recursive?: boolean }; result: void };\n 'dash.storage.file.save': {\n params: { file: string; path: string; overwrite?: boolean };\n result: FileEntry;\n };\n 'dash.storage.file.open': { params: { path: string }; result: DotFile };\n 'dash.storage.file.usage': { params: Record<string, never>; result: StorageUsage };\n}\n\nexport interface ReadOptions {\n as?: FileEncoding;\n}\n\nexport interface WriteOptions {\n as?: FileEncoding;\n append?: boolean;\n}\n\nexport interface ReplaceOptions {\n overwrite?: boolean;\n}\n\n// Up to 5 MB.\nexport function read(\n path: string,\n options: ReadOptions = {},\n callOptions?: CallOptions,\n): DashRequest<string> {\n return call('dash.storage.file.read', { path, ...options }, callOptions);\n}\n\n// Creates any missing folders above the file.\nexport function write(\n path: string,\n data: string,\n options: WriteOptions = {},\n callOptions?: CallOptions,\n): DashRequest<FileEntry> {\n return call('dash.storage.file.write', { path, data, ...options }, callOptions);\n}\n\nexport function stat(path: string, callOptions?: CallOptions): DashRequest<FileEntry | null> {\n return call('dash.storage.file.stat', { path }, callOptions);\n}\n\n// Sorted by path.\nexport function list(\n path = '',\n options: { recursive?: boolean } = {},\n callOptions?: CallOptions,\n): DashRequest<FileEntry[]> {\n return call('dash.storage.file.list', { path, ...options }, callOptions);\n}\n\nexport function createFolder(path: string, callOptions?: CallOptions): DashRequest<FileEntry> {\n return call('dash.storage.file.createFolder', { path }, callOptions);\n}\n\nexport function move(\n from: string,\n to: string,\n options: ReplaceOptions = {},\n callOptions?: CallOptions,\n): DashRequest<FileEntry> {\n return call('dash.storage.file.move', { from, to, ...options }, callOptions);\n}\n\nexport function copy(\n from: string,\n to: string,\n options: ReplaceOptions = {},\n callOptions?: CallOptions,\n): DashRequest<FileEntry> {\n return call('dash.storage.file.copy', { from, to, ...options }, callOptions);\n}\n\n// A folder with anything in it needs `recursive`.\nexport function remove(\n path: string,\n options: { recursive?: boolean } = {},\n callOptions?: CallOptions,\n): DashRequest<void> {\n return call('dash.storage.file.remove', { path, ...options }, callOptions);\n}\n\n// Keeps a temporary file, such as a download.\nexport function save(\n file: DotFile | string,\n path: string,\n options: ReplaceOptions = {},\n callOptions?: CallOptions,\n): DashRequest<FileEntry> {\n return call('dash.storage.file.save', { file: fileId(file), path, ...options }, callOptions);\n}\n\n// A stored file as a DotFile, to show with its `url` or send with `http.upload`.\nexport function open(path: string, callOptions?: CallOptions): DashRequest<DotFile> {\n return call('dash.storage.file.open', { path }, callOptions);\n}\n\nexport function usage(callOptions?: CallOptions): DashRequest<StorageUsage> {\n return call('dash.storage.file.usage', {}, callOptions);\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\n// A dot's secrets, such as the tokens its own API gives the person: up to 8 strings of up to 4 KB,\n// which Dash keeps encrypted with a key that never leaves the device. The dot's own API keys never\n// belong here: they ship in its bundle, which anyone can read.\n\nexport interface SecretMethods {\n 'dash.storage.secret.get': { params: { key: string }; result: string | null };\n 'dash.storage.secret.set': { params: { key: string; value: string }; result: void };\n 'dash.storage.secret.remove': { params: { key: string }; result: void };\n 'dash.storage.secret.clear': { params: Record<string, never>; result: void };\n}\n\nexport function get(key: string, callOptions?: CallOptions): DashRequest<string | null> {\n return call('dash.storage.secret.get', { key }, callOptions);\n}\n\nexport function set(key: string, value: string, callOptions?: CallOptions): DashRequest<void> {\n return call('dash.storage.secret.set', { key, value }, callOptions);\n}\n\nexport function remove(key: string, callOptions?: CallOptions): DashRequest<void> {\n return call('dash.storage.secret.remove', { key }, callOptions);\n}\n\nexport function clear(callOptions?: CallOptions): DashRequest<void> {\n return call('dash.storage.secret.clear', {}, callOptions);\n}\n","// A dot's own data, on this device and for the signed-in Dash user only: it's never backed up, never\n// follows the person to a new phone, and another user who signs in sees none of it. Keep what\n// matters on the dot's server, and treat this as a copy it can fetch again.\n\nimport type { CacheMethods } from './cache';\nimport * as cache from './cache';\nimport type { FileMethods } from './file';\nimport * as file from './file';\nimport type { SecretMethods } from './secret';\nimport * as secret from './secret';\n\nexport { cache, file, secret };\nexport type { CacheSetOptions, CacheValue } from './cache';\nexport type {\n FileEncoding,\n FileEntry,\n ReadOptions,\n ReplaceOptions,\n StorageUsage,\n WriteOptions,\n} from './file';\n\nexport type StorageMethods = FileMethods & CacheMethods & SecretMethods;\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\nexport interface ClipboardMethods {\n 'dash.system.copyText': { params: { text: string }; result: void };\n}\n\nexport function copyText(text: string, callOptions?: CallOptions): DashRequest<void> {\n return call('dash.system.copyText', { text }, callOptions);\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\nexport interface DelayMethods {\n 'dash.system.delay': { params: { milliseconds: number }; result: void };\n}\n\n// Resolves after `milliseconds`, which the host counts, since the service has no timers.\nexport function delay(milliseconds: number, callOptions?: CallOptions): DashRequest<void> {\n return call('dash.system.delay', { milliseconds }, callOptions);\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\nexport type VibrationStyle = 'light' | 'medium' | 'heavy' | 'success' | 'warning' | 'error';\n\nexport interface VibrateOptions {\n // Defaults to `medium`.\n style?: VibrationStyle | undefined;\n}\n\nexport interface HapticsMethods {\n 'dash.system.vibrate': { params: VibrateOptions; result: void };\n}\n\n// Plays a short vibration, and resolves once it has.\nexport function vibrate(\n options: VibrateOptions = {},\n callOptions?: CallOptions,\n): DashRequest<void> {\n return call('dash.system.vibrate', { style: options.style ?? 'medium' }, callOptions);\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\nexport interface OpenUrlMethods {\n 'dash.system.openUrl': { params: { url: string }; result: void };\n}\n\n// Opens an https address in the device's browser. Any other address rejects with `invalid`.\nexport function openUrl(url: string, callOptions?: CallOptions): DashRequest<void> {\n return call('dash.system.openUrl', { url }, callOptions);\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\nimport type { DotFile } from '../files';\nimport { fileId } from '../files';\n\n// Give at least one of `text`, `url` and `file`.\nexport interface ShareOptions {\n // A subject, where the app shared to has one, such as an email.\n title?: string;\n text?: string;\n url?: string;\n file?: DotFile | string;\n}\n\nexport interface ShareMethods {\n 'dash.system.share': {\n params: { title?: string; text?: string; url?: string; file?: string };\n result: void;\n };\n}\n\n// Opens the device's share sheet, and resolves once it shows.\nexport function share(options: ShareOptions, callOptions?: CallOptions): DashRequest<void> {\n const { file, ...rest } = options;\n if (file === undefined) {\n return call('dash.system.share', rest, callOptions);\n }\n return call('dash.system.share', { ...rest, file: fileId(file) }, callOptions);\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\nexport type TorchState = 'on' | 'off';\n\nexport interface TorchMethods {\n 'dash.system.torch': { params: { state: TorchState }; result: void };\n}\n\n// Turns the torch on or off. Rejects with `unsupported` on a device without one.\nexport function torch(state: TorchState, callOptions?: CallOptions): DashRequest<void> {\n return call('dash.system.torch', { state }, callOptions);\n}\n","import type { ClipboardMethods } from './clipboard';\nimport type { DelayMethods } from './delay';\nimport type { HapticsMethods } from './haptics';\nimport type { OpenUrlMethods } from './open-url';\nimport type { ShareMethods } from './share';\nimport type { TorchMethods } from './torch';\n\nexport { copyText } from './clipboard';\nexport { delay } from './delay';\nexport { vibrate } from './haptics';\nexport { openUrl } from './open-url';\nexport { share } from './share';\nexport { torch } from './torch';\nexport type { VibrateOptions, VibrationStyle } from './haptics';\nexport type { ShareOptions } from './share';\nexport type { TorchState } from './torch';\n\nexport type SystemMethods = ClipboardMethods &\n DelayMethods &\n HapticsMethods &\n OpenUrlMethods &\n ShareMethods &\n TorchMethods;\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\nexport interface AlertAction {\n id: string;\n label: string;\n // `cancel` dismisses the alert; `destructive` marks something that cannot be undone.\n role?: 'default' | 'cancel' | 'destructive' | undefined;\n}\n\nexport interface AlertOptions {\n title: string;\n message?: string | undefined;\n // Defaults to a single OK.\n actions?: AlertAction[] | undefined;\n}\n\nexport interface AlertResult {\n // The `id` of the action the user chose.\n action: string;\n}\n\nexport interface DialogMethods {\n 'dash.ui.alert': { params: AlertOptions; result: AlertResult };\n}\n\n// Shows a native alert, and resolves with the action the user chose.\nexport function alert(options: AlertOptions, callOptions?: CallOptions): DashRequest<AlertResult> {\n const actions = options.actions ?? [{ id: 'ok', label: 'OK' }];\n return call('dash.ui.alert', { ...options, actions }, callOptions);\n}\n","import type { DialogMethods } from './dialogs';\n\nexport { alert } from './dialogs';\nexport type { AlertAction, AlertOptions, AlertResult } from './dialogs';\n\nexport type UIMethods = DialogMethods;\n","import type { DashRequest } from './call';\n\n// A copy of `group`, such as `dash` itself, whose functions pass each request they start to\n// `track`.\nexport function tracked<Group extends object>(\n group: Group,\n track: (request: DashRequest<unknown>) => void,\n): Group {\n const copy: Record<string, unknown> = {};\n for (const [name, member] of Object.entries(group)) {\n if (typeof member === 'function') {\n const start = member as (...args: unknown[]) => DashRequest<unknown>;\n copy[name] = (...args: unknown[]) => {\n const request = start(...args);\n track(request);\n return request;\n };\n } else {\n copy[name] = tracked(member as object, track);\n }\n }\n return copy as Group;\n}\n","import * as network from './network';\nimport * as storage from './storage';\nimport * as system from './system';\nimport * as ui from './ui';\n\n// Dash's features for a dot's service, grouped by use: `dash.ui.alert(...)`, `dash.system.torch(...)`,\n// `dash.network.http.request(...)`.\nexport const dash = { ui, system, network, storage };\n\nexport type Dash = typeof dash;\n\nexport { tracked } from './tracked';\n\nexport { HostError } from '@monimesl/dot-core';\nexport type { HostErrorCode } from '@monimesl/dot-core';\nexport type { CallOptions, DashRequest } from './call';\nexport type { DashMethod, DashMethods } from './methods';\nexport type {\n CacheSetOptions,\n CacheValue,\n FileEncoding,\n FileEntry,\n ReadOptions,\n ReplaceOptions,\n StorageMethods,\n StorageUsage,\n WriteOptions,\n} from './storage';\nexport type { DotFile } from './files';\nexport type {\n HttpDownloadRequest,\n HttpDownloadResponse,\n HttpMethod,\n HttpReadOptions,\n HttpRequest,\n HttpRequestBody,\n HttpResponse,\n HttpUploadFile,\n HttpUploadRequest,\n NetworkMethods,\n} from './network';\nexport type {\n ShareOptions,\n SystemMethods,\n TorchState,\n VibrateOptions,\n VibrationStyle,\n} from './system';\nexport type { AlertAction, AlertOptions, AlertResult, UIMethods } from './ui';\n"],"mappings":";;;AAUA,SAAgB,KACd,QACA,QACA,UAAuB,CAAC,GACo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,CAAC,MAAM,WAAW,OAAO,QAAQ,KAAK,GAC/C,IAAI,OAAO,WAAW,YAAY;EAChC,MAAM,QAAQ;EACd,KAAK,SAAS,GAAG,SAAoB;GACnC,MAAM,UAAU,MAAM,GAAG,IAAI;GAC7B,MAAM,OAAO;GACb,OAAO;EACT;CACF,OACE,KAAK,QAAQ,QAAQ,QAAkB,KAAK;CAGhD,OAAO;AACT;;;ACfA,MAAa,OAAO;CAAE,IAAA;CAAI,QAAA;CAAQ,SAAA;CAAS,SAAA;AAAQ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monimesl/dot-dash",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.9",
|
|
4
4
|
"description": "Dash features for dots: native UI, system and more, called from the service",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"main": "./dist/index.js",
|
|
25
25
|
"types": "./dist/index.d.ts",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@monimesl/dot-core": "0.1.0-alpha.
|
|
27
|
+
"@monimesl/dot-core": "0.1.0-alpha.9"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"publint": "^0.3.24",
|