@monimesl/dot-dash 0.1.0-alpha.23 → 0.1.0-alpha.24

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 CHANGED
@@ -1,4 +1,4 @@
1
- import { HostCallOptions, HostError, HostError as DashError, HostError as HostError$1, HostErrorCode, HostErrorCode as DashErrorCode, HostErrorCode as HostErrorCode$1, HostRequest } from "@monimesl/dot-core";
1
+ import { HostCallOptions, HostError, HostError as DashError, HostErrorCode, HostErrorCode as DashErrorCode, HostRequest } from "@monimesl/dot-core";
2
2
  //#region src/contacts/pick-phone.d.ts
3
3
  interface PickedContact {
4
4
  name: string;
@@ -22,7 +22,7 @@ declare namespace index_d_exports$9 {
22
22
  }
23
23
  type ContactsMethods = PickPhoneMethods;
24
24
  declare namespace index_d_exports$8 {
25
- export { CryptoInput, CryptoMethods, CryptoOutputOptions, HmacAlgorithm, hmac, randomBytes, randomUUID, sha256, sha512 };
25
+ export { CryptoInput, CryptoMethods, CryptoOutputOptions, HmacAlgorithm, HmacOptions, hmac, randomBytes, randomUUID, sha256, sha512 };
26
26
  }
27
27
  type CryptoInput = string | {
28
28
  base64: string;
@@ -31,6 +31,11 @@ interface CryptoOutputOptions {
31
31
  as?: 'hex' | 'base64';
32
32
  }
33
33
  type HmacAlgorithm = 'sha256' | 'sha512';
34
+ interface HmacOptions extends CryptoOutputOptions {
35
+ algorithm: HmacAlgorithm;
36
+ key: CryptoInput;
37
+ data: CryptoInput;
38
+ }
34
39
  type InputEncoding = 'text' | 'base64';
35
40
  type OutputEncoding = 'hex' | 'base64';
36
41
  interface WireInput {
@@ -72,10 +77,11 @@ declare function sha256(data: CryptoInput, options?: CryptoOutputOptions, callOp
72
77
  /** @since 1.0 */
73
78
  declare function sha512(data: CryptoInput, options?: CryptoOutputOptions, callOptions?: CallOptions): DashRequest<string>;
74
79
  /**
75
- * Signs `data` with `key`, as HMAC-SHA256 or HMAC-SHA512.
80
+ * Signs `data` with `key`, as HMAC-SHA256 or HMAC-SHA512, such as
81
+ * `hmac({ algorithm: 'sha256', key, data })`.
76
82
  * @since 1.0
77
83
  */
78
- declare function hmac(algorithm: HmacAlgorithm, key: CryptoInput, data: CryptoInput, options?: CryptoOutputOptions, callOptions?: CallOptions): DashRequest<string>;
84
+ declare function hmac(options: HmacOptions, callOptions?: CallOptions): DashRequest<string>;
79
85
  /**
80
86
  * `count` secure random bytes, from 1 to 1024, such as for a nonce.
81
87
  * @since 1.0
@@ -601,7 +607,6 @@ interface SystemInfo {
601
607
  region: string | null;
602
608
  timeZone: string;
603
609
  dashVersion: string;
604
- hostVersion: string;
605
610
  apiVersions: string[];
606
611
  }
607
612
  interface InfoMethods {
@@ -880,16 +885,10 @@ declare namespace index_d_exports {
880
885
  export declare function tracked<Group extends object>(group: Group, track: (request: DashRequest<unknown>) => void): Group;
881
886
  //#endregion
882
887
  //#region src/errors.d.ts
883
- type DashErrorWith<Code extends HostErrorCode$1> = HostError$1 & {
888
+ type DashErrorWith<Code extends HostErrorCode> = HostError & {
884
889
  readonly code: Code;
885
890
  };
886
- export declare function isDashError<Code extends HostErrorCode$1>(error: unknown, ...codes: Code[]): error is DashErrorWith<Code>;
887
- export declare function isDashCancelled(error: unknown): error is DashErrorWith<'cancelled'>;
888
- export declare function isDashTimeout(error: unknown): error is DashErrorWith<'timeout'>;
889
- export declare function isDashDenied(error: unknown): error is DashErrorWith<'denied'>;
890
- export declare function isDashInvalid(error: unknown): error is DashErrorWith<'invalid'>;
891
- export declare function isDashUnsupported(error: unknown): error is DashErrorWith<'unsupported'>;
892
- export declare function isDashFailed(error: unknown): error is DashErrorWith<'failed'>;
891
+ export declare function isDashError<Code extends HostErrorCode>(error: unknown, ...codes: Code[]): error is DashErrorWith<Code>;
893
892
  export declare function errorMessage(error: unknown): string;
894
893
  export declare function unlessCancelled<Result>(call: PromiseLike<Result>): Promise<Result | undefined>;
895
894
  //#endregion
@@ -913,5 +912,5 @@ export declare const dash: {
913
912
  };
914
913
  export type Dash = typeof dash;
915
914
  //#endregion
916
- export { type AccountProfile, type AlertAction, type AlertOptions, type AlertResult, type BrightnessLevel, type CacheSetOptions, type CacheValue, type CallOptions, type CodeFormat, type ConnectionType, type ContactsMethods, type CryptoInput, type CryptoOutputOptions, DashError, type DashErrorCode, type DashFeature, type DashMethod, type DashMethods, type DashRequest, type DotFile, type FileEncoding, type FileEntry, type HmacAlgorithm, HostError, type HostErrorCode, type HttpDownloadRequest, type HttpDownloadResponse, type HttpMethod, type HttpReadOptions, type HttpRequest, type HttpRequestBody, type HttpResponse, type HttpUploadFile, type HttpUploadRequest, type MediaMethods, type NetworkMethods, type NetworkStatus, type PhotoSource, type PickDateOptions, type PickFileOptions, type PickPhotoOptions, type PickTimeOptions, type PickedContact, type Platform, type ReadOptions, type ReadProfileOptions, type ReplaceOptions, type ScannedCode, type ShareOptions, type StorageMethods, type StorageUsage, type SystemInfo, type SystemMethods, type UIMethods, type VibrateOptions, type VibrationStyle, type WriteOptions };
915
+ export { type AccountProfile, type AlertAction, type AlertOptions, type AlertResult, type BrightnessLevel, type CacheSetOptions, type CacheValue, type CallOptions, type CodeFormat, type ConnectionType, type ContactsMethods, type CryptoInput, type CryptoOutputOptions, DashError, type DashErrorCode, type DashFeature, type DashMethod, type DashMethods, type DashRequest, type DotFile, type FileEncoding, type FileEntry, type HmacAlgorithm, type HmacOptions, type HttpDownloadRequest, type HttpDownloadResponse, type HttpMethod, type HttpReadOptions, type HttpRequest, type HttpRequestBody, type HttpResponse, type HttpUploadFile, type HttpUploadRequest, type MediaMethods, type NetworkMethods, type NetworkStatus, type PhotoSource, type PickDateOptions, type PickFileOptions, type PickPhotoOptions, type PickTimeOptions, type PickedContact, type Platform, type ReadOptions, type ReadProfileOptions, type ReplaceOptions, type ScannedCode, type ShareOptions, type StorageMethods, type StorageUsage, type SystemInfo, type SystemMethods, type UIMethods, type VibrateOptions, type VibrationStyle, type WriteOptions };
917
916
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/contacts/pick-phone.ts","../src/contacts/index.ts","../src/crypto/index.ts","../src/dot/index.ts","../src/files.ts","../src/media/pick-file.ts","../src/media/pick-photo.ts","../src/media/scan-code.ts","../src/media/index.ts","../src/network/http.ts","../src/network/status.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/dial.ts","../src/system/haptics.ts","../src/system/info.ts","../src/system/open-url.ts","../src/system/screen.ts","../src/system/share.ts","../src/system/torch.ts","../src/system/index.ts","../src/ui/dialogs.ts","../src/ui/pickers.ts","../src/ui/index.ts","../src/methods.ts","../src/call.ts","../src/account/index.ts","../src/api-versions.ts","../src/utils/encoding.ts","../src/utils/index.ts","../src/tracked.ts","../src/errors.ts","../src/latest.ts","../src/index.ts"],"mappings":";;UAGiB;EACf;EAEA;;UAGe;EACf;IAA6B,QAAQ;IAAuB,QAAQ;;;;;;;;;iBAStD,UAAU,cAAc,cAAc,YAAY;;;;KCdtD,kBAAkB;;;;KCDlB;EAAyB;;UAGpB;EACf;;KAGU;KAEP;KACA;UAEK;EACR;EACA,cAAc;EACd,IAAI;;UAGW;EACf;IAAwB,QAAQ;IAAW;;EAC3C;IAAwB,QAAQ;IAAW;;EAC3C;IACE,QAAQ;MAAc,WAAW;MAAe;MAAa,aAAa;;IAC1E;;EAEF;IAA6B;MAAU;MAAe,IAAI;;IAAkB;;EAC5E;IAA4B,QAAQ;IAAuB;;;;iBAI7C,OACd,MAAM,aACN,UAAS,qBACT,cAAc,cACb;;iBAKa,OACd,MAAM,aACN,UAAS,qBACT,cAAc,cACb;;;;;iBAQa,KACd,WAAW,eACX,KAAK,aACL,MAAM,aACN,UAAS,qBACT,cAAc,cACb;;;;;iBAea,YACd,eACA,UAAS,qBACT,cAAc,cACb;;;;;iBAQa,WAAW,cAAc,cAAc;;;;UCrFtC;EACf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;;;;;;;;;;;;;KAqDD,2BAA2B;wBAQvB,uBAAuB;wBAKvB,wBAAwB;;;;;;iBASxB,SAAS,SAAS;;;cC5ErB;EAEE,OAAA;EAIG,OAAA;;cAKL;EAEE,OAAA;EAMG,OAAA;;;;;;;wBEvBF,QAAQ,sBACtB,OAAO,OACP,QAAQ,SAAS,gCAChB;;;KCHE,cAAc,aAAa,mBAAiB;WAAuB,MAAM;;wBAE9D,YAAY,aAAa,iBACvC,mBACG,OAAO,SACT,SAAS,cAAc;wBAOV,gBAAgB,iBAAiB,SAAS;wBAI1C,cAAc,iBAAiB,SAAS;wBAIxC,aAAa,iBAAiB,SAAS;wBAIvC,cAAc,iBAAiB,SAAS;wBAIxC,kBAAkB,iBAAiB,SAAS;wBAI5C,aAAa,iBAAiB,SAAS;wBAKvC,aAAa;wBAYP,gBAAgB,QACpC,MAAM,YAAY,UACjB,QAAQ;;;wBChDK,WAAW,QAAQ,MAAM,YAAY,YAAY,YAAY;wBAW7D,SAAS,wBAAwB,MAAM,SAAS;;;qBCFnD;;;;;;;;;;;;;YAcD,cAAc"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/contacts/pick-phone.ts","../src/contacts/index.ts","../src/crypto/index.ts","../src/dot/index.ts","../src/files.ts","../src/media/pick-file.ts","../src/media/pick-photo.ts","../src/media/scan-code.ts","../src/media/index.ts","../src/network/http.ts","../src/network/status.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/dial.ts","../src/system/haptics.ts","../src/system/info.ts","../src/system/open-url.ts","../src/system/screen.ts","../src/system/share.ts","../src/system/torch.ts","../src/system/index.ts","../src/ui/dialogs.ts","../src/ui/pickers.ts","../src/ui/index.ts","../src/methods.ts","../src/call.ts","../src/account/index.ts","../src/api-versions.ts","../src/utils/encoding.ts","../src/utils/index.ts","../src/tracked.ts","../src/errors.ts","../src/latest.ts","../src/index.ts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"./rolldown-runtime-D7D4PA-g.js";
2
- import { DEFAULT_DASH_API_VERSION, HostError, HostError as DashError, HostError as HostError$1, callHost, createHostRequest, offersDashApiVersion } from "@monimesl/dot-core";
2
+ import { DEFAULT_DASH_API_VERSION, HostError, HostError as DashError, callHost, createHostRequest, offersDashApiVersion } from "@monimesl/dot-core";
3
3
  //#region src/api-versions.ts
4
4
  const DASH_API_VERSION = "1.0";
5
5
  const DASH_API_SINCE = {
@@ -143,14 +143,15 @@ function sha512(data, options = {}, callOptions) {
143
143
  return call("dash.crypto.sha512", wireInput(data, options), callOptions);
144
144
  }
145
145
  /**
146
- * Signs `data` with `key`, as HMAC-SHA256 or HMAC-SHA512.
146
+ * Signs `data` with `key`, as HMAC-SHA256 or HMAC-SHA512, such as
147
+ * `hmac({ algorithm: 'sha256', key, data })`.
147
148
  * @since 1.0
148
149
  */
149
- function hmac(algorithm, key, data, options = {}, callOptions) {
150
- const wireKey = valueAndEncoding(key);
150
+ function hmac(options, callOptions) {
151
+ const wireKey = valueAndEncoding(options.key);
151
152
  return call("dash.crypto.hmac", {
152
- ...wireInput(data, options),
153
- algorithm,
153
+ ...wireInput(options.data, options),
154
+ algorithm: options.algorithm,
154
155
  key: wireKey.value,
155
156
  keyEncoding: wireKey.encoding
156
157
  }, callOptions);
@@ -321,7 +322,7 @@ function parseJson({ status, statusText, body }) {
321
322
  return JSON.parse(body);
322
323
  } catch (error) {
323
324
  const message = error instanceof Error ? error.message : String(error);
324
- throw new HostError$1("failed", `The response (${status} ${statusText}) isn't JSON: ${message}`);
325
+ throw new HostError("failed", `The response (${status} ${statusText}) isn't JSON: ${message}`);
325
326
  }
326
327
  }
327
328
  //#endregion
@@ -801,27 +802,9 @@ function tracked(group, track) {
801
802
  //#endregion
802
803
  //#region src/errors.ts
803
804
  function isDashError(error, ...codes) {
804
- if (error instanceof HostError$1) return codes.length === 0 || codes.includes(error.code);
805
+ if (error instanceof HostError) return codes.length === 0 || codes.includes(error.code);
805
806
  return false;
806
807
  }
807
- function isDashCancelled(error) {
808
- return isDashError(error, "cancelled");
809
- }
810
- function isDashTimeout(error) {
811
- return isDashError(error, "timeout");
812
- }
813
- function isDashDenied(error) {
814
- return isDashError(error, "denied");
815
- }
816
- function isDashInvalid(error) {
817
- return isDashError(error, "invalid");
818
- }
819
- function isDashUnsupported(error) {
820
- return isDashError(error, "unsupported");
821
- }
822
- function isDashFailed(error) {
823
- return isDashError(error, "failed");
824
- }
825
808
  function errorMessage(error) {
826
809
  if (error instanceof Error) return error.message;
827
810
  if (typeof error === "string" && error) return error;
@@ -831,7 +814,7 @@ async function unlessCancelled(call) {
831
814
  try {
832
815
  return await call;
833
816
  } catch (error) {
834
- if (isDashCancelled(error)) return;
817
+ if (isDashError(error, "cancelled")) return;
835
818
  throw error;
836
819
  }
837
820
  }
@@ -852,7 +835,7 @@ function debounce(milliseconds) {
852
835
  await wait(dash.system.delay(milliseconds));
853
836
  return true;
854
837
  } catch (error) {
855
- if (isDashCancelled(error)) return false;
838
+ if (isDashError(error, "cancelled")) return false;
856
839
  throw error;
857
840
  }
858
841
  };
@@ -873,6 +856,6 @@ const dash = {
873
856
  supports
874
857
  };
875
858
  //#endregion
876
- export { DASH_API_SINCE, DASH_API_VERSION, DashError, HostError, dash, debounce, errorMessage, isDashCancelled, isDashDenied, isDashError, isDashFailed, isDashInvalid, isDashTimeout, isDashUnsupported, latest, tracked, unlessCancelled, useHostDashApiVersions, warnAboveDashApiVersion };
859
+ export { DASH_API_SINCE, DASH_API_VERSION, DashError, dash, debounce, errorMessage, isDashError, latest, tracked, unlessCancelled, useHostDashApiVersions, warnAboveDashApiVersion };
877
860
 
878
861
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["HostError","get","set","remove","clear","remove","HostError"],"sources":["../src/api-versions.ts","../src/call.ts","../src/account/index.ts","../src/contacts/pick-phone.ts","../src/contacts/index.ts","../src/crypto/index.ts","../src/dot/index.ts","../src/media/pick-file.ts","../src/media/pick-photo.ts","../src/media/scan-code.ts","../src/media/index.ts","../src/network/http.ts","../src/network/status.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/dial.ts","../src/system/haptics.ts","../src/system/info.ts","../src/system/open-url.ts","../src/system/screen.ts","../src/system/share.ts","../src/system/torch.ts","../src/system/index.ts","../src/ui/dialogs.ts","../src/ui/pickers.ts","../src/ui/index.ts","../src/utils/encoding.ts","../src/utils/index.ts","../src/tracked.ts","../src/errors.ts","../src/latest.ts","../src/index.ts"],"sourcesContent":["import { DEFAULT_DASH_API_VERSION, offersDashApiVersion } from '@monimesl/dot-core';\n\n// The newest Dash API version this library knows.\nexport const DASH_API_VERSION = '1.0';\n\n// The Dash API version each call came in, by its name in `dash`, such as \"system.dial\". A field\n// added to a call later gets its own row, such as \"ui.pickDate.title\". The `@since` tag on each call\n// says the same, and a test keeps the two in step.\nexport const DASH_API_SINCE = {\n 'account.readProfile': '1.0',\n 'contacts.pickPhone': '1.0',\n 'crypto.hmac': '1.0',\n 'crypto.randomBytes': '1.0',\n 'crypto.randomUUID': '1.0',\n 'crypto.sha256': '1.0',\n 'crypto.sha512': '1.0',\n 'dot.close': '1.0',\n 'media.pickFile': '1.0',\n 'media.pickPhoto': '1.0',\n 'media.scanCode': '1.0',\n 'network.http.download': '1.0',\n 'network.http.request': '1.0',\n 'network.http.upload': '1.0',\n 'network.status': '1.0',\n 'storage.cache.clear': '1.0',\n 'storage.cache.exists': '1.0',\n 'storage.cache.get': '1.0',\n 'storage.cache.keys': '1.0',\n 'storage.cache.remove': '1.0',\n 'storage.cache.set': '1.0',\n 'storage.file.copy': '1.0',\n 'storage.file.createFolder': '1.0',\n 'storage.file.list': '1.0',\n 'storage.file.move': '1.0',\n 'storage.file.open': '1.0',\n 'storage.file.read': '1.0',\n 'storage.file.remove': '1.0',\n 'storage.file.save': '1.0',\n 'storage.file.stat': '1.0',\n 'storage.file.usage': '1.0',\n 'storage.file.write': '1.0',\n 'storage.secret.clear': '1.0',\n 'storage.secret.get': '1.0',\n 'storage.secret.remove': '1.0',\n 'storage.secret.set': '1.0',\n 'system.brightness': '1.0',\n 'system.copyText': '1.0',\n 'system.delay': '1.0',\n 'system.dial': '1.0',\n 'system.info': '1.0',\n 'system.keepAwake': '1.0',\n 'system.openUrl': '1.0',\n 'system.share': '1.0',\n 'system.torch': '1.0',\n 'system.vibrate': '1.0',\n 'ui.alert': '1.0',\n 'ui.pickDate': '1.0',\n 'ui.pickTime': '1.0',\n} as const satisfies Record<string, string>;\n\n// A call or field `dash.supports` can check, such as \"contacts.pickPhone\".\nexport type DashFeature = keyof typeof DASH_API_SINCE;\n\nlet hostApiVersions: readonly string[] = [DEFAULT_DASH_API_VERSION];\nlet dotMinApiVersion: string | undefined;\nconst checkedFeatures = new Set<string>();\nconst warnedFeatures = new Set<string>();\n\n// The service passes on the Dash API versions the host says it offers.\nexport function useHostDashApiVersions(versions: readonly string[]): void {\n hostApiVersions = versions;\n}\n\n// While developing, the service names the dot's minApiVersion, so calls newer than it are pointed out.\nexport function warnAboveDashApiVersion(minApiVersion: string | undefined): void {\n dotMinApiVersion = minApiVersion;\n}\n\n/**\n * Whether the Dash the dot runs in has `feature`: a call, such as \"contacts.pickPhone\", or a field\n * added to a call later. Check it before using one that's newer than the dot's minApiVersion.\n * @since 1.0\n */\nexport function supports(feature: DashFeature): boolean {\n checkedFeatures.add(feature);\n const since = sinceOf(feature);\n return since !== undefined && offersDashApiVersion(hostApiVersions, since);\n}\n\n// Warns once for each call, or field it sends, that's newer than the dot's minApiVersion, unless the\n// dot checked it with dash.supports first. Older Dash would answer `unsupported`.\nexport function warnIfNewerThanDot(method: string, params: unknown): void {\n if (dotMinApiVersion === undefined) {\n return;\n }\n const callName = method.replace(/^dash\\./, '');\n for (const feature of [callName, ...fieldsSent(callName, params)]) {\n const since = sinceOf(feature);\n if (since === undefined) {\n continue;\n }\n if (checkedFeatures.has(feature) || warnedFeatures.has(feature)) {\n continue;\n }\n if (offersDashApiVersion([dotMinApiVersion], since)) {\n continue;\n }\n warnedFeatures.add(feature);\n console.warn(\n `dash.${feature} came in Dash API ${since}, but this dot's minApiVersion is ${dotMinApiVersion}, ` +\n `so older Dash doesn't have it. Raise \"minApiVersion\" in dot.json, or check ` +\n `dash.supports('${feature}') first.`,\n );\n }\n}\n\nfunction sinceOf(feature: string): string | undefined {\n const table: Record<string, string> = DASH_API_SINCE;\n return Object.hasOwn(table, feature) ? table[feature] : undefined;\n}\n\n// \"ui.pickDate.title\" for a `title` sent to `dash.ui.pickDate`, when that field has its own row.\nfunction fieldsSent(callName: string, params: unknown): string[] {\n if (typeof params !== 'object' || params === null) {\n return [];\n }\n return Object.keys(params)\n .map((field) => `${callName}.${field}`)\n .filter((feature) => sinceOf(feature) !== undefined);\n}\n","import type { HostCallOptions, HostRequest } from '@monimesl/dot-core';\nimport { callHost } from '@monimesl/dot-core';\n\nimport { warnIfNewerThanDot } from './api-versions';\nimport type { DashMethod, DashMethods } from './methods';\n\nexport type CallOptions = HostCallOptions;\n\n// A running Dash call. 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 warnIfNewerThanDot(method, params);\n return callHost(method, params, options);\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\nexport interface ReadProfileOptions {\n // Mixed into the token. The same nonce gives the same token, so a fixed one names the person in\n // this dot, and a fresh one gives a token only for this call.\n nonce: string;\n}\n\nexport interface AccountProfile {\n // A SHA-256 hash, in hex, of the person's Monimeer id, the dot's id and the nonce. Dash makes it on\n // the phone, so it names the person but proves nothing to the dot's server.\n accountIdToken: string;\n fullName: string;\n}\n\nexport interface AccountMethods {\n 'dash.account.readProfile': { params: { nonce: string }; result: AccountProfile };\n}\n\n/**\n * The person signed in to Dash: their full name, and a token that names them in this dot. Needs the\n * `account` permission. Rejects with `invalid` for a nonce that's empty or longer than 128\n * characters, and with `failed` when no one is signed in.\n * @since 1.0\n */\nexport function readProfile(\n options: ReadProfileOptions,\n callOptions?: CallOptions,\n): DashRequest<AccountProfile> {\n return call('dash.account.readProfile', { nonce: options.nonce }, callOptions);\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\nexport interface PickedContact {\n name: string;\n // As the contact has it, such as \"+232 76 123456\" or \"076 123456\".\n phone: string;\n}\n\nexport interface PickPhoneMethods {\n 'dash.contacts.pickPhone': { params: Record<string, never>; result: PickedContact };\n}\n\n/**\n * Shows the phone's contacts so the person chooses one phone number, such as who to send money to.\n * Needs the `contacts` permission. The dot sees only the chosen contact. Rejects with `cancelled` if\n * the person closes it.\n * @since 1.0\n */\nexport function pickPhone(callOptions?: CallOptions): DashRequest<PickedContact> {\n return call('dash.contacts.pickPhone', {}, callOptions);\n}\n","import type { PickPhoneMethods } from './pick-phone';\n\nexport { pickPhone } from './pick-phone';\nexport type { PickedContact } from './pick-phone';\n\nexport type ContactsMethods = PickPhoneMethods;\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\n// Text is read as UTF-8. Binary data, such as a file's contents, comes as base64.\nexport type CryptoInput = string | { base64: string };\n\n// Hex by default.\nexport interface CryptoOutputOptions {\n as?: 'hex' | 'base64';\n}\n\nexport type HmacAlgorithm = 'sha256' | 'sha512';\n\ntype InputEncoding = 'text' | 'base64';\ntype OutputEncoding = 'hex' | 'base64';\n\ninterface WireInput {\n data: string;\n dataEncoding: InputEncoding;\n as: OutputEncoding;\n}\n\nexport interface CryptoMethods {\n 'dash.crypto.sha256': { params: WireInput; result: string };\n 'dash.crypto.sha512': { params: WireInput; result: string };\n 'dash.crypto.hmac': {\n params: WireInput & { algorithm: HmacAlgorithm; key: string; keyEncoding: InputEncoding };\n result: string;\n };\n 'dash.crypto.randomBytes': { params: { count: number; as: OutputEncoding }; result: string };\n 'dash.crypto.randomUUID': { params: Record<string, never>; result: string };\n}\n\n/** @since 1.0 */\nexport function sha256(\n data: CryptoInput,\n options: CryptoOutputOptions = {},\n callOptions?: CallOptions,\n): DashRequest<string> {\n return call('dash.crypto.sha256', wireInput(data, options), callOptions);\n}\n\n/** @since 1.0 */\nexport function sha512(\n data: CryptoInput,\n options: CryptoOutputOptions = {},\n callOptions?: CallOptions,\n): DashRequest<string> {\n return call('dash.crypto.sha512', wireInput(data, options), callOptions);\n}\n\n/**\n * Signs `data` with `key`, as HMAC-SHA256 or HMAC-SHA512.\n * @since 1.0\n */\nexport function hmac(\n algorithm: HmacAlgorithm,\n key: CryptoInput,\n data: CryptoInput,\n options: CryptoOutputOptions = {},\n callOptions?: CallOptions,\n): DashRequest<string> {\n const wireKey = valueAndEncoding(key);\n const params = {\n ...wireInput(data, options),\n algorithm,\n key: wireKey.value,\n keyEncoding: wireKey.encoding,\n };\n return call('dash.crypto.hmac', params, callOptions);\n}\n\n/**\n * `count` secure random bytes, from 1 to 1024, such as for a nonce.\n * @since 1.0\n */\nexport function randomBytes(\n count: number,\n options: CryptoOutputOptions = {},\n callOptions?: CallOptions,\n): DashRequest<string> {\n return call('dash.crypto.randomBytes', { count, as: outputEncoding(options) }, callOptions);\n}\n\n/**\n * A random version 4 UUID, such as \"3f0e5c3a-6d1b-4c8e-9a2f-1b7d4e6a9c05\".\n * @since 1.0\n */\nexport function randomUUID(callOptions?: CallOptions): DashRequest<string> {\n return call('dash.crypto.randomUUID', {}, callOptions);\n}\n\nfunction wireInput(data: CryptoInput, options: CryptoOutputOptions): WireInput {\n const { value, encoding } = valueAndEncoding(data);\n return { data: value, dataEncoding: encoding, as: outputEncoding(options) };\n}\n\nfunction outputEncoding(options: CryptoOutputOptions): OutputEncoding {\n return options.as ?? 'hex';\n}\n\nfunction valueAndEncoding(input: CryptoInput): { value: string; encoding: InputEncoding } {\n if (typeof input === 'string') {\n return { value: input, encoding: 'text' };\n }\n return { value: input.base64, encoding: 'base64' };\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\nexport interface DotMethods {\n 'dash.dot.close': { params: Record<string, never>; result: void };\n}\n\n/**\n * Closes the dot, as going back from its first page does. Calls still running are cancelled.\n * @since 1.0\n */\nexport function close(callOptions?: CallOptions): DashRequest<void> {\n return call('dash.dot.close', {}, callOptions);\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\nimport type { DotFile } from '../files';\n\nexport interface PickFileOptions {\n // Content types the person may choose, such as 'application/pdf' or 'image/*'. Any file without them.\n types?: string[];\n}\n\nexport interface PickFileMethods {\n 'dash.media.pickFile': { params: { types?: string[] }; result: DotFile };\n}\n\n/**\n * Lets the person choose a file from their phone, of at most 25 MB. Needs the `files` permission.\n * Rejects with `cancelled` if they close the picker, and with `invalid` for a larger file. Like a\n * download, it lasts until the dot closes, so `dash.storage.file.save` it to keep it.\n * @since 1.0\n */\nexport function pickFile(\n options: PickFileOptions = {},\n callOptions?: CallOptions,\n): DashRequest<DotFile> {\n const params: { types?: string[] } = {};\n if (options.types) {\n params.types = options.types;\n }\n return call('dash.media.pickFile', params, callOptions);\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\nimport type { DotFile } from '../files';\n\nexport type PhotoSource = 'library' | 'camera';\n\nexport interface PickPhotoOptions {\n // `library` needs the `photoLibrary` permission, and `camera` the `camera` permission.\n source: PhotoSource;\n}\n\nexport interface PickPhotoMethods {\n 'dash.media.pickPhoto': { params: { source: PhotoSource }; result: DotFile };\n}\n\n/**\n * Lets the person choose a photo or take one. Resolves with it as a JPEG of at most 2048 pixels on its\n * longest side, without its location or other details. Rejects with `cancelled` if they close the\n * picker, and with `unsupported` on a device without a camera. Save it with `dash.storage.file.save`\n * to keep it after the dot closes.\n * @since 1.0\n */\nexport function pickPhoto(\n options: PickPhotoOptions,\n callOptions?: CallOptions,\n): DashRequest<DotFile> {\n return call('dash.media.pickPhoto', { source: options.source }, callOptions);\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\n// Only QR codes for now. More formats can come later without changing what a dot gets.\nexport type CodeFormat = 'qr';\n\nexport interface ScannedCode {\n text: string;\n format: CodeFormat;\n}\n\nexport interface ScanCodeMethods {\n 'dash.media.scanCode': { params: Record<string, never>; result: ScannedCode };\n}\n\n/**\n * Opens Dash's scanner until it reads a QR code. Needs the `camera` permission. Rejects with\n * `cancelled` if the person closes it, and with `unsupported` where Dash has no scanner.\n * @since 1.0\n */\nexport function scanCode(callOptions?: CallOptions): DashRequest<ScannedCode> {\n return call('dash.media.scanCode', {}, callOptions);\n}\n","import type { PickFileMethods } from './pick-file';\nimport type { PickPhotoMethods } from './pick-photo';\nimport type { ScanCodeMethods } from './scan-code';\n\nexport { pickFile } from './pick-file';\nexport { pickPhoto } from './pick-photo';\nexport { scanCode } from './scan-code';\nexport type { PickFileOptions } from './pick-file';\nexport type { PhotoSource, PickPhotoOptions } from './pick-photo';\nexport type { CodeFormat, ScannedCode } from './scan-code';\n\nexport type MediaMethods = PickFileMethods & PickPhotoMethods & ScanCodeMethods;\n","import { createHostRequest, HostError } from '@monimesl/dot-core';\n\nimport type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\nimport type { DotFile } 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// Any body type other than 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;\n name?: string;\n}\n\nexport interface HttpUploadRequest {\n url: string;\n // Defaults to POST.\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/**\n * Like fetch, resolves with any response, even a 404. An object body is sent as JSON.\n * @since 1.0\n */\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: readAs, ...request } = options as HttpRequest & { as?: ReadAs };\n const response = call('dash.network.http.request', wireRequest(request, readAs), callOptions);\n return readBody(response, readAs);\n}\n\n/**\n * Saves a 2xx response's body, up to 256 MB, to a temporary file.\n * @since 1.0\n */\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/**\n * Sends the dot's files as a multipart form.\n * @since 1.0\n */\nexport function upload<ResponseBody = string>(\n options: HttpUploadRequest & HttpReadOptions<ResponseBody>,\n callOptions?: CallOptions,\n): DashRequest<HttpResponse<ResponseBody>> {\n const { as: readAs, ...request } = options as HttpUploadRequest & { as?: ReadAs };\n const files = request.files.map((upload) => ({ ...upload, file: upload.file.id }));\n const params = { ...request, files };\n if (readAs === '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, readAs);\n}\n\nfunction wireRequest<Request extends HttpRequest>(\n request: Request,\n readAs?: ReadAs,\n): WireRequest<Request> {\n let headers = request.headers;\n let body: string | undefined;\n if (readAs === '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 if (headers === undefined) {\n return { [name]: value };\n }\n const lowerName = name.toLowerCase();\n const alreadySet = Object.keys(headers).some((existing) => existing.toLowerCase() === lowerName);\n if (alreadySet) {\n return headers;\n }\n return { ...headers, [name]: value };\n}\n\nfunction readBody<Body>(\n response: DashRequest<HttpResponse>,\n readAs: ReadAs | undefined,\n): DashRequest<HttpResponse<Body>> {\n if (readAs !== '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 { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\nexport type ConnectionType = 'wifi' | 'cellular' | 'other' | 'none';\n\nexport interface NetworkStatus {\n online: boolean;\n type: ConnectionType;\n}\n\nexport interface StatusMethods {\n 'dash.network.status': { params: Record<string, never>; result: NetworkStatus };\n}\n\n/**\n * Whether the phone is online now, and how. It can still be online without reaching a server.\n * @since 1.0\n */\nexport function status(callOptions?: CallOptions): DashRequest<NetworkStatus> {\n return call('dash.network.status', {}, callOptions);\n}\n","import type { HttpMethods } from './http';\nimport * as http from './http';\nimport type { StatusMethods } from './status';\n\nexport { http };\nexport { status } from './status';\nexport type { ConnectionType, NetworkStatus } from './status';\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 & StatusMethods;\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\n// A dot's own key-value cache, apart from its files. It holds up to 64 MB of JSON values, each kept\n// until removed or until 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 // How many milliseconds the entry lasts. Without it, or with 0 or less, it lasts until removed.\n ttl?: number | undefined;\n}\n\n/**\n * Resolves with null for a missing or expired key.\n * @since 1.0\n */\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\n/** @since 1.0 */\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\n/** @since 1.0 */\nexport function remove(key: string, callOptions?: CallOptions): DashRequest<void> {\n return call('dash.storage.cache.remove', { key }, callOptions);\n}\n\n/** @since 1.0 */\nexport function exists(key: string, callOptions?: CallOptions): DashRequest<boolean> {\n return call('dash.storage.cache.exists', { key }, callOptions);\n}\n\n/**\n * The keys, sorted.\n * @since 1.0\n */\nexport function keys(callOptions?: CallOptions): DashRequest<string[]> {\n return call('dash.storage.cache.keys', {}, callOptions);\n}\n\n/** @since 1.0 */\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';\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\", and '' is the folder itself. A call on a path with nothing there fails with\n// `failed`, so check first with `stat`, which gives null for it.\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/**\n * Reads a file of up to 5 MB.\n * @since 1.0\n */\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/**\n * Creates any missing folders above the file.\n * @since 1.0\n */\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\n/** @since 1.0 */\nexport function stat(path: string, callOptions?: CallOptions): DashRequest<FileEntry | null> {\n return call('dash.storage.file.stat', { path }, callOptions);\n}\n\n/**\n * Sorted by path.\n * @since 1.0\n */\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\n/** @since 1.0 */\nexport function createFolder(path: string, callOptions?: CallOptions): DashRequest<FileEntry> {\n return call('dash.storage.file.createFolder', { path }, callOptions);\n}\n\n/** @since 1.0 */\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\n/** @since 1.0 */\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/**\n * Removing a folder that isn't empty needs `recursive`.\n * @since 1.0\n */\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/**\n * Keeps a temporary file, such as a download, at `path`.\n * @since 1.0\n */\nexport function save(\n file: DotFile,\n path: string,\n options: ReplaceOptions = {},\n callOptions?: CallOptions,\n): DashRequest<FileEntry> {\n return call('dash.storage.file.save', { file: file.id, path, ...options }, callOptions);\n}\n\n/**\n * A stored file as a DotFile, to show with its `url` or send with `http.upload`.\n * @since 1.0\n */\nexport function open(path: string, callOptions?: CallOptions): DashRequest<DotFile> {\n return call('dash.storage.file.open', { path }, callOptions);\n}\n\n/** @since 1.0 */\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 tokens its own API gives the person. Holds up to 32 strings of up to 4 KB\n// each, encrypted with a key that never leaves the device. Don't keep the dot's own API keys here:\n// they would 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\n/** @since 1.0 */\nexport function get(key: string, callOptions?: CallOptions): DashRequest<string | null> {\n return call('dash.storage.secret.get', { key }, callOptions);\n}\n\n/** @since 1.0 */\nexport function set(key: string, value: string, callOptions?: CallOptions): DashRequest<void> {\n return call('dash.storage.secret.set', { key, value }, callOptions);\n}\n\n/** @since 1.0 */\nexport function remove(key: string, callOptions?: CallOptions): DashRequest<void> {\n return call('dash.storage.secret.remove', { key }, callOptions);\n}\n\n/** @since 1.0 */\nexport function clear(callOptions?: CallOptions): DashRequest<void> {\n return call('dash.storage.secret.clear', {}, callOptions);\n}\n","// A dot's own data, kept on this device for the signed-in Dash user only. It's never backed up or\n// moved to a new phone, and another user who signs in sees none of it. Keep what matters on the\n// dot's server, and treat this as a copy you 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\n/** @since 1.0 */\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/**\n * Resolves after `milliseconds`. The host keeps the time, since a dot's logic has no timers.\n * @since 1.0\n */\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 interface DialMethods {\n 'dash.system.dial': { params: { number: string }; result: void };\n}\n\n/**\n * Opens the phone's dialer with `number` ready, such as \"+232 76 123456\" or a USSD code such as\n * \"*715#\". The person taps Call. Spaces and dashes are fine; anything else but digits, +, * and #\n * rejects with `invalid`.\n * @since 1.0\n */\nexport function dial(number: string, callOptions?: CallOptions): DashRequest<void> {\n return call('dash.system.dial', { number }, 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/**\n * Plays a short vibration. Resolves once it's done.\n * @since 1.0\n */\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 type Platform = 'ios' | 'android' | 'simulator';\n\nexport interface SystemInfo {\n platform: Platform;\n // Such as \"18.2\" on iOS or \"15\" on Android.\n osVersion: string;\n // The person's language, such as \"en\", and their region, such as \"SL\", or null if unknown.\n language: string;\n region: string | null;\n // Such as \"Africa/Freetown\".\n timeZone: string;\n // The version of Dash the dot runs in, such as \"2.4.0\", and of DotHost inside it.\n dashVersion: string;\n hostVersion: string;\n // The Dash API versions it offers, such as [\"1.4\"], one for each major it supports.\n apiVersions: string[];\n}\n\nexport interface InfoMethods {\n 'dash.system.info': { params: Record<string, never>; result: SystemInfo };\n}\n\n/**\n * The phone and the Dash the dot runs in. It has nothing that identifies the person or the phone.\n * @since 1.0\n */\nexport function info(callOptions?: CallOptions): DashRequest<SystemInfo> {\n return call('dash.system.info', {}, 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/**\n * Opens an https address in the device's browser. Any other address rejects with `invalid`.\n * @since 1.0\n */\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';\n\nexport type BrightnessLevel = 'max' | 'normal';\n\nexport interface ScreenMethods {\n 'dash.system.keepAwake': { params: { on: boolean }; result: void };\n 'dash.system.brightness': { params: { level: BrightnessLevel }; result: void };\n}\n\n/**\n * Keeps the screen from dimming and locking while the dot shows, such as while a ticket's QR code is\n * up. Dash undoes it when the dot closes.\n * @since 1.0\n */\nexport function keepAwake(on: boolean, callOptions?: CallOptions): DashRequest<void> {\n return call('dash.system.keepAwake', { on }, callOptions);\n}\n\n/**\n * `max` makes the screen as bright as it goes, so a scanner can read a QR code on it, and `normal`\n * puts it back. Dash puts it back too when the dot closes or the person leaves the app.\n * @since 1.0\n */\nexport function brightness(level: BrightnessLevel, callOptions?: CallOptions): DashRequest<void> {\n return call('dash.system.brightness', { level }, 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, for apps that use one, such as email.\n title?: string;\n text?: string;\n url?: string;\n file?: DotFile;\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/**\n * Opens the device's share sheet. Resolves once it shows.\n * @since 1.0\n */\nexport function share(options: ShareOptions, callOptions?: CallOptions): DashRequest<void> {\n const { file, ...content } = options;\n if (file === undefined) {\n return call('dash.system.share', content, callOptions);\n }\n return call('dash.system.share', { ...content, file: file.id }, callOptions);\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\nexport interface TorchMethods {\n 'dash.system.torch': { params: { on: boolean }; result: void };\n}\n\n/**\n * Turns the torch on or off. Rejects with `unsupported` on a device without one.\n * @since 1.0\n */\nexport function torch(on: boolean, callOptions?: CallOptions): DashRequest<void> {\n return call('dash.system.torch', { on }, callOptions);\n}\n","import type { ClipboardMethods } from './clipboard';\nimport type { DelayMethods } from './delay';\nimport type { DialMethods } from './dial';\nimport type { HapticsMethods } from './haptics';\nimport type { InfoMethods } from './info';\nimport type { OpenUrlMethods } from './open-url';\nimport type { ScreenMethods } from './screen';\nimport type { ShareMethods } from './share';\nimport type { TorchMethods } from './torch';\n\nexport { copyText } from './clipboard';\nexport { delay } from './delay';\nexport { dial } from './dial';\nexport { vibrate } from './haptics';\nexport { info } from './info';\nexport { openUrl } from './open-url';\nexport { brightness, keepAwake } from './screen';\nexport { share } from './share';\nexport { torch } from './torch';\nexport type { VibrateOptions, VibrationStyle } from './haptics';\nexport type { Platform, SystemInfo } from './info';\nexport type { BrightnessLevel } from './screen';\nexport type { ShareOptions } from './share';\n\nexport type SystemMethods = ClipboardMethods &\n DelayMethods &\n DialMethods &\n HapticsMethods &\n InfoMethods &\n OpenUrlMethods &\n ScreenMethods &\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 can't be undone.\n role?: 'default' | 'cancel' | 'destructive' | undefined;\n}\n\nexport interface AlertOptions {\n title: string;\n message?: string | undefined;\n // Defaults to one OK button.\n actions?: AlertAction[] | undefined;\n}\n\nexport interface AlertResult {\n // The `id` of the action the person chose.\n action: string;\n}\n\nexport interface DialogMethods {\n 'dash.ui.alert': { params: AlertOptions; result: AlertResult };\n}\n\n/**\n * Shows a native alert. Resolves with the action the person chose.\n * @since 1.0\n */\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 { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\nexport interface PickDateOptions {\n title?: string | undefined;\n // Dates such as \"2026-10-24\". `value` is the one chosen when the picker opens.\n value?: string | undefined;\n min?: string | undefined;\n max?: string | undefined;\n}\n\nexport interface PickTimeOptions {\n title?: string | undefined;\n // A time of day in 24 hours, such as \"19:30\", chosen when the picker opens.\n value?: string | undefined;\n}\n\nexport interface PickerMethods {\n 'dash.ui.pickDate': { params: PickDateOptions; result: string };\n 'dash.ui.pickTime': { params: PickTimeOptions; result: string };\n}\n\n/**\n * Opens the phone's own calendar. Resolves with the chosen date, such as \"2026-10-24\", or rejects\n * with `cancelled` if the person closes it.\n * @since 1.0\n */\nexport function pickDate(\n options: PickDateOptions = {},\n callOptions?: CallOptions,\n): DashRequest<string> {\n return call('dash.ui.pickDate', options, callOptions);\n}\n\n/**\n * Opens the phone's own clock. Resolves with the chosen time in 24 hours, such as \"19:30\", or\n * rejects with `cancelled` if the person closes it.\n * @since 1.0\n */\nexport function pickTime(\n options: PickTimeOptions = {},\n callOptions?: CallOptions,\n): DashRequest<string> {\n return call('dash.ui.pickTime', options, callOptions);\n}\n","import type { DialogMethods } from './dialogs';\nimport type { PickerMethods } from './pickers';\n\nexport { alert } from './dialogs';\nexport { pickDate, pickTime } from './pickers';\nexport type { AlertAction, AlertOptions, AlertResult } from './dialogs';\nexport type { PickDateOptions, PickTimeOptions } from './pickers';\n\nexport type UIMethods = DialogMethods & PickerMethods;\n","// Text to base64 or hex and back, as UTF-8. These run in the dot itself, so they need no Dash and\n// answer at once. The engines that run a dot's logic have no TextEncoder, so UTF-8 is done here.\n\nconst BASE64_ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nconst BASE64_PATTERN = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;\nconst HEX_PATTERN = /^(?:[0-9a-fA-F]{2})*$/;\n\nexport const base64 = {\n // \"Salone\" -> \"U2Fsb25l\"\n encode(text: string): string {\n return bytesToBase64(utf8Bytes(text));\n },\n // Throws for text that isn't base64.\n decode(encoded: string): string {\n return utf8Text(base64ToBytes(encoded));\n },\n};\n\nexport const hex = {\n // \"Salone\" -> \"53616c6f6e65\"\n encode(text: string): string {\n return utf8Bytes(text)\n .map((byte) => byte.toString(16).padStart(2, '0'))\n .join('');\n },\n // Throws for text that isn't hex.\n decode(encoded: string): string {\n if (!HEX_PATTERN.test(encoded)) {\n throw new Error(`\"${encoded.slice(0, 20)}\" isn't hex. Use pairs of 0-9 and a-f.`);\n }\n const bytes: number[] = [];\n for (let index = 0; index < encoded.length; index += 2) {\n bytes.push(parseInt(encoded.slice(index, index + 2), 16));\n }\n return utf8Text(bytes);\n },\n};\n\n// Each group of 3 bytes is 24 bits, written as 4 characters of 6 bits. A shorter last group writes\n// one character per byte plus one, and pads with \"=\" to 4.\nfunction bytesToBase64(bytes: number[]): string {\n let encoded = '';\n for (let index = 0; index < bytes.length; index += 3) {\n const group = bytes.slice(index, index + 3);\n const bits = ((group[0] ?? 0) << 16) | ((group[1] ?? 0) << 8) | (group[2] ?? 0);\n const sextets = [(bits >> 18) & 0x3f, (bits >> 12) & 0x3f, (bits >> 6) & 0x3f, bits & 0x3f];\n const characterCount = group.length + 1;\n for (const sextet of sextets.slice(0, characterCount)) {\n encoded += BASE64_ALPHABET[sextet];\n }\n encoded += '='.repeat(4 - characterCount);\n }\n return encoded;\n}\n\n// The reverse of bytesToBase64: each 4 characters give 3 bytes, less one for each \"=\".\nfunction base64ToBytes(encoded: string): number[] {\n if (!BASE64_PATTERN.test(encoded)) {\n throw new Error(`\"${encoded.slice(0, 20)}\" isn't base64.`);\n }\n const bytes: number[] = [];\n for (let index = 0; index < encoded.length; index += 4) {\n const characters = encoded.slice(index, index + 4);\n let bits = 0;\n let padding = 0;\n for (const character of characters) {\n bits <<= 6;\n if (character === '=') {\n padding += 1;\n } else {\n bits |= BASE64_ALPHABET.indexOf(character);\n }\n }\n bytes.push((bits >> 16) & 0xff);\n if (padding < 2) {\n bytes.push((bits >> 8) & 0xff);\n }\n if (padding < 1) {\n bytes.push(bits & 0xff);\n }\n }\n return bytes;\n}\n\nfunction utf8Bytes(text: string): number[] {\n const bytes: number[] = [];\n for (const character of text) {\n const codePoint = character.codePointAt(0)!;\n if (codePoint < 0x80) {\n bytes.push(codePoint);\n } else if (codePoint < 0x800) {\n bytes.push(0xc0 | (codePoint >> 6), 0x80 | (codePoint & 0x3f));\n } else if (codePoint < 0x10000) {\n bytes.push(\n 0xe0 | (codePoint >> 12),\n 0x80 | ((codePoint >> 6) & 0x3f),\n 0x80 | (codePoint & 0x3f),\n );\n } else {\n bytes.push(\n 0xf0 | (codePoint >> 18),\n 0x80 | ((codePoint >> 12) & 0x3f),\n 0x80 | ((codePoint >> 6) & 0x3f),\n 0x80 | (codePoint & 0x3f),\n );\n }\n }\n return bytes;\n}\n\nconst MAX_CODE_POINT = 0x10ffff;\n\n// Bytes that aren't UTF-8 become \"�\", as browsers read them.\nfunction utf8Text(bytes: number[]): string {\n let text = '';\n let index = 0;\n while (index < bytes.length) {\n const first = bytes[index]!;\n const length = sequenceLength(first);\n const continuation = bytes.slice(index + 1, index + length);\n if (length === 0 || !isCompleteContinuation(continuation, length)) {\n text += '�';\n index += 1;\n continue;\n }\n let codePoint = firstByteBits(first, length);\n for (const byte of continuation) {\n codePoint = (codePoint << 6) | (byte & 0x3f);\n }\n // Four bytes can spell a number past the last character, as f7 bf bf bf does.\n if (codePoint > MAX_CODE_POINT) {\n text += '�';\n index += 1;\n continue;\n }\n text += String.fromCodePoint(codePoint);\n index += length;\n }\n return text;\n}\n\n// How many bytes a UTF-8 character takes, from its first byte. 0 for a byte that can't start one.\nfunction sequenceLength(first: number): number {\n if (first < 0x80) {\n return 1;\n }\n if (first >= 0xf0) {\n return 4;\n }\n if (first >= 0xe0) {\n return 3;\n }\n if (first >= 0xc0) {\n return 2;\n }\n return 0;\n}\n\n// Whether the bytes after a first byte are all there, and each is a continuation byte: 10xxxxxx.\nfunction isCompleteContinuation(continuation: number[], length: number): boolean {\n if (continuation.length !== length - 1) {\n return false;\n }\n return continuation.every((byte) => (byte & 0xc0) === 0x80);\n}\n\n// The bits of the code point that a first byte holds, after its length marker of 1s and a 0.\nfunction firstByteBits(first: number, length: number): number {\n if (length === 1) {\n return first;\n }\n return first & (0xff >> (length + 1));\n}\n","// Helpers that run in the dot itself, so they need no Dash and answer at once, without `await`.\n\n/**\n * Text to base64 and back, as UTF-8: `dash.utils.base64.encode(\"Salone\")` is `\"U2Fsb25l\"`.\n * `decode` throws for text that isn't base64.\n * @since 1.0\n */\nexport { base64 } from './encoding';\n\n/**\n * Text to hex and back, as UTF-8: `dash.utils.hex.encode(\"Salone\")` is `\"53616c6f6e65\"`.\n * `decode` throws for text that isn't hex.\n * @since 1.0\n */\nexport { hex } from './encoding';\n","import type { DashRequest } from './call';\n\n// A copy of `group`, such as `dash`, that passes each request it starts to `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 startCall = member as (...args: unknown[]) => unknown;\n copy[name] = (...args: unknown[]) => {\n const result = startCall(...args);\n // Only calls return a request to track. dash.supports answers at once.\n if (result instanceof Promise) {\n track(result as DashRequest<unknown>);\n }\n return result;\n };\n } else {\n copy[name] = tracked(member as object, track);\n }\n }\n return copy as Group;\n}\n","import type { HostErrorCode } from '@monimesl/dot-core';\nimport { HostError } from '@monimesl/dot-core';\n\ntype DashErrorWith<Code extends HostErrorCode> = HostError & { readonly code: Code };\n\nexport function isDashError<Code extends HostErrorCode>(\n error: unknown,\n ...codes: Code[]\n): error is DashErrorWith<Code> {\n if (error instanceof HostError) {\n return codes.length === 0 || codes.includes(error.code as Code);\n }\n return false;\n}\n\nexport function isDashCancelled(error: unknown): error is DashErrorWith<'cancelled'> {\n return isDashError(error, 'cancelled');\n}\n\nexport function isDashTimeout(error: unknown): error is DashErrorWith<'timeout'> {\n return isDashError(error, 'timeout');\n}\n\nexport function isDashDenied(error: unknown): error is DashErrorWith<'denied'> {\n return isDashError(error, 'denied');\n}\n\nexport function isDashInvalid(error: unknown): error is DashErrorWith<'invalid'> {\n return isDashError(error, 'invalid');\n}\n\nexport function isDashUnsupported(error: unknown): error is DashErrorWith<'unsupported'> {\n return isDashError(error, 'unsupported');\n}\n\nexport function isDashFailed(error: unknown): error is DashErrorWith<'failed'> {\n return isDashError(error, 'failed');\n}\n\n// The message to show for anything a call threw, even if it isn't an Error.\nexport function errorMessage(error: unknown): string {\n if (error instanceof Error) {\n return error.message;\n }\n if (typeof error === 'string' && error) {\n return error;\n }\n return 'Something went wrong. Try again.';\n}\n\n// Waits for a call, such as a picker, and gives undefined if the person closed it or it was\n// cancelled. Other errors still throw.\nexport async function unlessCancelled<Result>(\n call: PromiseLike<Result>,\n): Promise<Result | undefined> {\n try {\n return await call;\n } catch (error) {\n if (isDashCancelled(error)) {\n return undefined;\n }\n throw error;\n }\n}\n","import type { DashRequest } from './call';\nimport { isDashCancelled } from './errors';\nimport type { Dash } from './index';\n\n// Each call given to it cancels the one before, so an older answer can't arrive after a newer one.\n// The cancelled call rejects with `cancelled`, which unlessCancelled turns into undefined.\nexport function latest(): <Result>(call: DashRequest<Result>) => DashRequest<Result> {\n let running: DashRequest<unknown> | undefined;\n return (call) => {\n running?.cancel();\n running = call;\n return call;\n };\n}\n\n// Resolves true once `milliseconds` pass without another call, such as a pause in typing, and false\n// for a wait a newer call cut short. It waits through the page's `this.dash`, since a dot has no timers.\nexport function debounce(milliseconds: number): (dash: Dash) => Promise<boolean> {\n const wait = latest();\n return async (dash) => {\n try {\n await wait(dash.system.delay(milliseconds));\n return true;\n } catch (error) {\n if (isDashCancelled(error)) {\n return false;\n }\n throw error;\n }\n };\n}\n","import * as account from './account';\nimport { supports } from './api-versions';\nimport * as contacts from './contacts';\nimport * as crypto from './crypto';\nimport * as dot from './dot';\nimport * as media from './media';\nimport * as network from './network';\nimport * as storage from './storage';\nimport * as system from './system';\nimport * as ui from './ui';\nimport * as utils from './utils';\n\n// Dash's features for a dot's logic, in groups: `dash.ui.alert(...)`, `dash.system.torch(...)`,\n// `dash.network.http.request(...)`. `dash.supports(...)` says whether this Dash has a newer one.\n// `dash.utils` holds helpers that run in the dot and answer at once, such as `dash.utils.base64`.\nexport const dash = {\n ui,\n system,\n network,\n storage,\n media,\n contacts,\n dot,\n account,\n crypto,\n utils,\n supports,\n};\n\nexport type Dash = typeof dash;\n\nexport { tracked } from './tracked';\nexport {\n DASH_API_SINCE,\n DASH_API_VERSION,\n useHostDashApiVersions,\n warnAboveDashApiVersion,\n} from './api-versions';\nexport type { DashFeature } from './api-versions';\n\nexport { HostError } from '@monimesl/dot-core';\nexport type { HostErrorCode } from '@monimesl/dot-core';\n// The error a Dash call fails with, by the name a dot knows it from `this.dash`. It's HostError\n// itself, so `instanceof` and `code` work the same with either name.\nexport { HostError as DashError } from '@monimesl/dot-core';\nexport type { HostErrorCode as DashErrorCode } from '@monimesl/dot-core';\nexport {\n errorMessage,\n isDashCancelled,\n isDashDenied,\n isDashError,\n isDashFailed,\n isDashInvalid,\n isDashTimeout,\n isDashUnsupported,\n unlessCancelled,\n} from './errors';\nexport { debounce, latest } from './latest';\nexport type { AccountProfile, ReadProfileOptions } from './account';\nexport type { CryptoInput, CryptoOutputOptions, HmacAlgorithm } from './crypto';\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 CodeFormat,\n MediaMethods,\n PhotoSource,\n PickFileOptions,\n PickPhotoOptions,\n ScannedCode,\n} from './media';\nexport type { ContactsMethods, PickedContact } from './contacts';\nexport type {\n ConnectionType,\n HttpDownloadRequest,\n HttpDownloadResponse,\n HttpMethod,\n HttpReadOptions,\n HttpRequest,\n HttpRequestBody,\n HttpResponse,\n HttpUploadFile,\n HttpUploadRequest,\n NetworkMethods,\n NetworkStatus,\n} from './network';\nexport type {\n BrightnessLevel,\n Platform,\n ShareOptions,\n SystemInfo,\n SystemMethods,\n VibrateOptions,\n VibrationStyle,\n} from './system';\nexport type {\n AlertAction,\n AlertOptions,\n AlertResult,\n PickDateOptions,\n PickTimeOptions,\n UIMethods,\n} from './ui';\n"],"mappings":";;;AAGA,MAAa,mBAAmB;AAKhC,MAAa,iBAAiB;CAC5B,uBAAuB;CACvB,sBAAsB;CACtB,eAAe;CACf,sBAAsB;CACtB,qBAAqB;CACrB,iBAAiB;CACjB,iBAAiB;CACjB,aAA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,SAAgB,SAAS,cAAwD;CAC/E,MAAM,OAAO,OAAO;CACpB,OAAO,OAAO,SAAS;EACrB,IAAI;GACF,MAAM,KAAK,KAAK,OAAO,MAAM,YAAY,CAAC;GAC1C,OAAO;EACT,SAAS,OAAO;GACd,IAAI,gBAAgB,KAAK,GACvB,OAAO;GAET,MAAM;EACR;CACF;AACF;;;ACfA,MAAa,OAAO;CAClB,IAAA;CACA,QAAA;CACA,SAAA;CACA,SAAA;CACA,OAAA;CACA,UAAA;CACA,KAAA;CACA,SAAA;CACA,QAAA;CACA,OAAA;CACA;AACF"}
1
+ {"version":3,"file":"index.js","names":["get","set","remove","clear","remove"],"sources":["../src/api-versions.ts","../src/call.ts","../src/account/index.ts","../src/contacts/pick-phone.ts","../src/contacts/index.ts","../src/crypto/index.ts","../src/dot/index.ts","../src/media/pick-file.ts","../src/media/pick-photo.ts","../src/media/scan-code.ts","../src/media/index.ts","../src/network/http.ts","../src/network/status.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/dial.ts","../src/system/haptics.ts","../src/system/info.ts","../src/system/open-url.ts","../src/system/screen.ts","../src/system/share.ts","../src/system/torch.ts","../src/system/index.ts","../src/ui/dialogs.ts","../src/ui/pickers.ts","../src/ui/index.ts","../src/utils/encoding.ts","../src/utils/index.ts","../src/tracked.ts","../src/errors.ts","../src/latest.ts","../src/index.ts"],"sourcesContent":["import { DEFAULT_DASH_API_VERSION, offersDashApiVersion } from '@monimesl/dot-core';\n\n// The newest Dash API version this library knows.\nexport const DASH_API_VERSION = '1.0';\n\n// The Dash API version each call came in, by its name in `dash`, such as \"system.dial\". A field\n// added to a call later gets its own row, such as \"ui.pickDate.title\". The `@since` tag on each call\n// says the same, and a test keeps the two in step.\nexport const DASH_API_SINCE = {\n 'account.readProfile': '1.0',\n 'contacts.pickPhone': '1.0',\n 'crypto.hmac': '1.0',\n 'crypto.randomBytes': '1.0',\n 'crypto.randomUUID': '1.0',\n 'crypto.sha256': '1.0',\n 'crypto.sha512': '1.0',\n 'dot.close': '1.0',\n 'media.pickFile': '1.0',\n 'media.pickPhoto': '1.0',\n 'media.scanCode': '1.0',\n 'network.http.download': '1.0',\n 'network.http.request': '1.0',\n 'network.http.upload': '1.0',\n 'network.status': '1.0',\n 'storage.cache.clear': '1.0',\n 'storage.cache.exists': '1.0',\n 'storage.cache.get': '1.0',\n 'storage.cache.keys': '1.0',\n 'storage.cache.remove': '1.0',\n 'storage.cache.set': '1.0',\n 'storage.file.copy': '1.0',\n 'storage.file.createFolder': '1.0',\n 'storage.file.list': '1.0',\n 'storage.file.move': '1.0',\n 'storage.file.open': '1.0',\n 'storage.file.read': '1.0',\n 'storage.file.remove': '1.0',\n 'storage.file.save': '1.0',\n 'storage.file.stat': '1.0',\n 'storage.file.usage': '1.0',\n 'storage.file.write': '1.0',\n 'storage.secret.clear': '1.0',\n 'storage.secret.get': '1.0',\n 'storage.secret.remove': '1.0',\n 'storage.secret.set': '1.0',\n 'system.brightness': '1.0',\n 'system.copyText': '1.0',\n 'system.delay': '1.0',\n 'system.dial': '1.0',\n 'system.info': '1.0',\n 'system.keepAwake': '1.0',\n 'system.openUrl': '1.0',\n 'system.share': '1.0',\n 'system.torch': '1.0',\n 'system.vibrate': '1.0',\n 'ui.alert': '1.0',\n 'ui.pickDate': '1.0',\n 'ui.pickTime': '1.0',\n} as const satisfies Record<string, string>;\n\n// A call or field `dash.supports` can check, such as \"contacts.pickPhone\".\nexport type DashFeature = keyof typeof DASH_API_SINCE;\n\nlet hostApiVersions: readonly string[] = [DEFAULT_DASH_API_VERSION];\nlet dotMinApiVersion: string | undefined;\nconst checkedFeatures = new Set<string>();\nconst warnedFeatures = new Set<string>();\n\n// The service passes on the Dash API versions the host says it offers.\nexport function useHostDashApiVersions(versions: readonly string[]): void {\n hostApiVersions = versions;\n}\n\n// While developing, the service names the dot's minApiVersion, so calls newer than it are pointed out.\nexport function warnAboveDashApiVersion(minApiVersion: string | undefined): void {\n dotMinApiVersion = minApiVersion;\n}\n\n/**\n * Whether the Dash the dot runs in has `feature`: a call, such as \"contacts.pickPhone\", or a field\n * added to a call later. Check it before using one that's newer than the dot's minApiVersion.\n * @since 1.0\n */\nexport function supports(feature: DashFeature): boolean {\n checkedFeatures.add(feature);\n const since = sinceOf(feature);\n return since !== undefined && offersDashApiVersion(hostApiVersions, since);\n}\n\n// Warns once for each call, or field it sends, that's newer than the dot's minApiVersion, unless the\n// dot checked it with dash.supports first. Older Dash would answer `unsupported`.\nexport function warnIfNewerThanDot(method: string, params: unknown): void {\n if (dotMinApiVersion === undefined) {\n return;\n }\n const callName = method.replace(/^dash\\./, '');\n for (const feature of [callName, ...fieldsSent(callName, params)]) {\n const since = sinceOf(feature);\n if (since === undefined) {\n continue;\n }\n if (checkedFeatures.has(feature) || warnedFeatures.has(feature)) {\n continue;\n }\n if (offersDashApiVersion([dotMinApiVersion], since)) {\n continue;\n }\n warnedFeatures.add(feature);\n console.warn(\n `dash.${feature} came in Dash API ${since}, but this dot's minApiVersion is ${dotMinApiVersion}, ` +\n `so older Dash doesn't have it. Raise \"minApiVersion\" in dot.json, or check ` +\n `dash.supports('${feature}') first.`,\n );\n }\n}\n\nfunction sinceOf(feature: string): string | undefined {\n const table: Record<string, string> = DASH_API_SINCE;\n return Object.hasOwn(table, feature) ? table[feature] : undefined;\n}\n\n// \"ui.pickDate.title\" for a `title` sent to `dash.ui.pickDate`, when that field has its own row.\nfunction fieldsSent(callName: string, params: unknown): string[] {\n if (typeof params !== 'object' || params === null) {\n return [];\n }\n return Object.keys(params)\n .map((field) => `${callName}.${field}`)\n .filter((feature) => sinceOf(feature) !== undefined);\n}\n","import type { HostCallOptions, HostRequest } from '@monimesl/dot-core';\nimport { callHost } from '@monimesl/dot-core';\n\nimport { warnIfNewerThanDot } from './api-versions';\nimport type { DashMethod, DashMethods } from './methods';\n\nexport type CallOptions = HostCallOptions;\n\n// A running Dash call. 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 warnIfNewerThanDot(method, params);\n return callHost(method, params, options);\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\nexport interface ReadProfileOptions {\n // Mixed into the token. The same nonce gives the same token, so a fixed one names the person in\n // this dot, and a fresh one gives a token only for this call.\n nonce: string;\n}\n\nexport interface AccountProfile {\n // A SHA-256 hash, in hex, of the person's Monimeer id, the dot's id and the nonce. Dash makes it on\n // the phone, so it names the person but proves nothing to the dot's server.\n accountIdToken: string;\n fullName: string;\n}\n\nexport interface AccountMethods {\n 'dash.account.readProfile': { params: { nonce: string }; result: AccountProfile };\n}\n\n/**\n * The person signed in to Dash: their full name, and a token that names them in this dot. Needs the\n * `account` permission. Rejects with `invalid` for a nonce that's empty or longer than 128\n * characters, and with `failed` when no one is signed in.\n * @since 1.0\n */\nexport function readProfile(\n options: ReadProfileOptions,\n callOptions?: CallOptions,\n): DashRequest<AccountProfile> {\n return call('dash.account.readProfile', { nonce: options.nonce }, callOptions);\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\nexport interface PickedContact {\n name: string;\n // As the contact has it, such as \"+232 76 123456\" or \"076 123456\".\n phone: string;\n}\n\nexport interface PickPhoneMethods {\n 'dash.contacts.pickPhone': { params: Record<string, never>; result: PickedContact };\n}\n\n/**\n * Shows the phone's contacts so the person chooses one phone number, such as who to send money to.\n * Needs the `contacts` permission. The dot sees only the chosen contact. Rejects with `cancelled` if\n * the person closes it.\n * @since 1.0\n */\nexport function pickPhone(callOptions?: CallOptions): DashRequest<PickedContact> {\n return call('dash.contacts.pickPhone', {}, callOptions);\n}\n","import type { PickPhoneMethods } from './pick-phone';\n\nexport { pickPhone } from './pick-phone';\nexport type { PickedContact } from './pick-phone';\n\nexport type ContactsMethods = PickPhoneMethods;\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\n// Text is read as UTF-8. Binary data, such as a file's contents, comes as base64.\nexport type CryptoInput = string | { base64: string };\n\n// Hex by default.\nexport interface CryptoOutputOptions {\n as?: 'hex' | 'base64';\n}\n\nexport type HmacAlgorithm = 'sha256' | 'sha512';\n\n// Named, since key and data take the same kinds of value and a swapped pair signs wrongly.\nexport interface HmacOptions extends CryptoOutputOptions {\n algorithm: HmacAlgorithm;\n key: CryptoInput;\n data: CryptoInput;\n}\n\ntype InputEncoding = 'text' | 'base64';\ntype OutputEncoding = 'hex' | 'base64';\n\ninterface WireInput {\n data: string;\n dataEncoding: InputEncoding;\n as: OutputEncoding;\n}\n\nexport interface CryptoMethods {\n 'dash.crypto.sha256': { params: WireInput; result: string };\n 'dash.crypto.sha512': { params: WireInput; result: string };\n 'dash.crypto.hmac': {\n params: WireInput & { algorithm: HmacAlgorithm; key: string; keyEncoding: InputEncoding };\n result: string;\n };\n 'dash.crypto.randomBytes': { params: { count: number; as: OutputEncoding }; result: string };\n 'dash.crypto.randomUUID': { params: Record<string, never>; result: string };\n}\n\n/** @since 1.0 */\nexport function sha256(\n data: CryptoInput,\n options: CryptoOutputOptions = {},\n callOptions?: CallOptions,\n): DashRequest<string> {\n return call('dash.crypto.sha256', wireInput(data, options), callOptions);\n}\n\n/** @since 1.0 */\nexport function sha512(\n data: CryptoInput,\n options: CryptoOutputOptions = {},\n callOptions?: CallOptions,\n): DashRequest<string> {\n return call('dash.crypto.sha512', wireInput(data, options), callOptions);\n}\n\n/**\n * Signs `data` with `key`, as HMAC-SHA256 or HMAC-SHA512, such as\n * `hmac({ algorithm: 'sha256', key, data })`.\n * @since 1.0\n */\nexport function hmac(options: HmacOptions, callOptions?: CallOptions): DashRequest<string> {\n const wireKey = valueAndEncoding(options.key);\n const params = {\n ...wireInput(options.data, options),\n algorithm: options.algorithm,\n key: wireKey.value,\n keyEncoding: wireKey.encoding,\n };\n return call('dash.crypto.hmac', params, callOptions);\n}\n\n/**\n * `count` secure random bytes, from 1 to 1024, such as for a nonce.\n * @since 1.0\n */\nexport function randomBytes(\n count: number,\n options: CryptoOutputOptions = {},\n callOptions?: CallOptions,\n): DashRequest<string> {\n return call('dash.crypto.randomBytes', { count, as: outputEncoding(options) }, callOptions);\n}\n\n/**\n * A random version 4 UUID, such as \"3f0e5c3a-6d1b-4c8e-9a2f-1b7d4e6a9c05\".\n * @since 1.0\n */\nexport function randomUUID(callOptions?: CallOptions): DashRequest<string> {\n return call('dash.crypto.randomUUID', {}, callOptions);\n}\n\nfunction wireInput(data: CryptoInput, options: CryptoOutputOptions): WireInput {\n const { value, encoding } = valueAndEncoding(data);\n return { data: value, dataEncoding: encoding, as: outputEncoding(options) };\n}\n\nfunction outputEncoding(options: CryptoOutputOptions): OutputEncoding {\n return options.as ?? 'hex';\n}\n\nfunction valueAndEncoding(input: CryptoInput): { value: string; encoding: InputEncoding } {\n if (typeof input === 'string') {\n return { value: input, encoding: 'text' };\n }\n return { value: input.base64, encoding: 'base64' };\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\nexport interface DotMethods {\n 'dash.dot.close': { params: Record<string, never>; result: void };\n}\n\n/**\n * Closes the dot, as going back from its first page does. Calls still running are cancelled.\n * @since 1.0\n */\nexport function close(callOptions?: CallOptions): DashRequest<void> {\n return call('dash.dot.close', {}, callOptions);\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\nimport type { DotFile } from '../files';\n\nexport interface PickFileOptions {\n // Content types the person may choose, such as 'application/pdf' or 'image/*'. Any file without them.\n types?: string[];\n}\n\nexport interface PickFileMethods {\n 'dash.media.pickFile': { params: { types?: string[] }; result: DotFile };\n}\n\n/**\n * Lets the person choose a file from their phone, of at most 25 MB. Needs the `files` permission.\n * Rejects with `cancelled` if they close the picker, and with `invalid` for a larger file. Like a\n * download, it lasts until the dot closes, so `dash.storage.file.save` it to keep it.\n * @since 1.0\n */\nexport function pickFile(\n options: PickFileOptions = {},\n callOptions?: CallOptions,\n): DashRequest<DotFile> {\n const params: { types?: string[] } = {};\n if (options.types) {\n params.types = options.types;\n }\n return call('dash.media.pickFile', params, callOptions);\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\nimport type { DotFile } from '../files';\n\nexport type PhotoSource = 'library' | 'camera';\n\nexport interface PickPhotoOptions {\n // `library` needs the `photoLibrary` permission, and `camera` the `camera` permission.\n source: PhotoSource;\n}\n\nexport interface PickPhotoMethods {\n 'dash.media.pickPhoto': { params: { source: PhotoSource }; result: DotFile };\n}\n\n/**\n * Lets the person choose a photo or take one. Resolves with it as a JPEG of at most 2048 pixels on its\n * longest side, without its location or other details. Rejects with `cancelled` if they close the\n * picker, and with `unsupported` on a device without a camera. Save it with `dash.storage.file.save`\n * to keep it after the dot closes.\n * @since 1.0\n */\nexport function pickPhoto(\n options: PickPhotoOptions,\n callOptions?: CallOptions,\n): DashRequest<DotFile> {\n return call('dash.media.pickPhoto', { source: options.source }, callOptions);\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\n// Only QR codes for now. More formats can come later without changing what a dot gets.\nexport type CodeFormat = 'qr';\n\nexport interface ScannedCode {\n text: string;\n format: CodeFormat;\n}\n\nexport interface ScanCodeMethods {\n 'dash.media.scanCode': { params: Record<string, never>; result: ScannedCode };\n}\n\n/**\n * Opens Dash's scanner until it reads a QR code. Needs the `camera` permission. Rejects with\n * `cancelled` if the person closes it, and with `unsupported` where Dash has no scanner.\n * @since 1.0\n */\nexport function scanCode(callOptions?: CallOptions): DashRequest<ScannedCode> {\n return call('dash.media.scanCode', {}, callOptions);\n}\n","import type { PickFileMethods } from './pick-file';\nimport type { PickPhotoMethods } from './pick-photo';\nimport type { ScanCodeMethods } from './scan-code';\n\nexport { pickFile } from './pick-file';\nexport { pickPhoto } from './pick-photo';\nexport { scanCode } from './scan-code';\nexport type { PickFileOptions } from './pick-file';\nexport type { PhotoSource, PickPhotoOptions } from './pick-photo';\nexport type { CodeFormat, ScannedCode } from './scan-code';\n\nexport type MediaMethods = PickFileMethods & PickPhotoMethods & ScanCodeMethods;\n","import { createHostRequest, HostError } from '@monimesl/dot-core';\n\nimport type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\nimport type { DotFile } 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// Any body type other than 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;\n name?: string;\n}\n\nexport interface HttpUploadRequest {\n url: string;\n // Defaults to POST.\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/**\n * Like fetch, resolves with any response, even a 404. An object body is sent as JSON.\n * @since 1.0\n */\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: readAs, ...request } = options as HttpRequest & { as?: ReadAs };\n const response = call('dash.network.http.request', wireRequest(request, readAs), callOptions);\n return readBody(response, readAs);\n}\n\n/**\n * Saves a 2xx response's body, up to 256 MB, to a temporary file.\n * @since 1.0\n */\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/**\n * Sends the dot's files as a multipart form.\n * @since 1.0\n */\nexport function upload<ResponseBody = string>(\n options: HttpUploadRequest & HttpReadOptions<ResponseBody>,\n callOptions?: CallOptions,\n): DashRequest<HttpResponse<ResponseBody>> {\n const { as: readAs, ...request } = options as HttpUploadRequest & { as?: ReadAs };\n const files = request.files.map((upload) => ({ ...upload, file: upload.file.id }));\n const params = { ...request, files };\n if (readAs === '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, readAs);\n}\n\nfunction wireRequest<Request extends HttpRequest>(\n request: Request,\n readAs?: ReadAs,\n): WireRequest<Request> {\n let headers = request.headers;\n let body: string | undefined;\n if (readAs === '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 if (headers === undefined) {\n return { [name]: value };\n }\n const lowerName = name.toLowerCase();\n const alreadySet = Object.keys(headers).some((existing) => existing.toLowerCase() === lowerName);\n if (alreadySet) {\n return headers;\n }\n return { ...headers, [name]: value };\n}\n\nfunction readBody<Body>(\n response: DashRequest<HttpResponse>,\n readAs: ReadAs | undefined,\n): DashRequest<HttpResponse<Body>> {\n if (readAs !== '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 { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\nexport type ConnectionType = 'wifi' | 'cellular' | 'other' | 'none';\n\nexport interface NetworkStatus {\n online: boolean;\n type: ConnectionType;\n}\n\nexport interface StatusMethods {\n 'dash.network.status': { params: Record<string, never>; result: NetworkStatus };\n}\n\n/**\n * Whether the phone is online now, and how. It can still be online without reaching a server.\n * @since 1.0\n */\nexport function status(callOptions?: CallOptions): DashRequest<NetworkStatus> {\n return call('dash.network.status', {}, callOptions);\n}\n","import type { HttpMethods } from './http';\nimport * as http from './http';\nimport type { StatusMethods } from './status';\n\nexport { http };\nexport { status } from './status';\nexport type { ConnectionType, NetworkStatus } from './status';\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 & StatusMethods;\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\n// A dot's own key-value cache, apart from its files. It holds up to 64 MB of JSON values, each kept\n// until removed or until 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 // How many milliseconds the entry lasts. Without it, or with 0 or less, it lasts until removed.\n ttl?: number | undefined;\n}\n\n/**\n * Resolves with null for a missing or expired key.\n * @since 1.0\n */\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\n/** @since 1.0 */\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\n/** @since 1.0 */\nexport function remove(key: string, callOptions?: CallOptions): DashRequest<void> {\n return call('dash.storage.cache.remove', { key }, callOptions);\n}\n\n/** @since 1.0 */\nexport function exists(key: string, callOptions?: CallOptions): DashRequest<boolean> {\n return call('dash.storage.cache.exists', { key }, callOptions);\n}\n\n/**\n * The keys, sorted.\n * @since 1.0\n */\nexport function keys(callOptions?: CallOptions): DashRequest<string[]> {\n return call('dash.storage.cache.keys', {}, callOptions);\n}\n\n/** @since 1.0 */\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';\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\", and '' is the folder itself. A call on a path with nothing there fails with\n// `missing`, while `stat` gives null for it.\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/**\n * Reads a file of up to 5 MB.\n * @since 1.0\n */\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/**\n * Creates any missing folders above the file.\n * @since 1.0\n */\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\n/** @since 1.0 */\nexport function stat(path: string, callOptions?: CallOptions): DashRequest<FileEntry | null> {\n return call('dash.storage.file.stat', { path }, callOptions);\n}\n\n/**\n * Sorted by path.\n * @since 1.0\n */\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\n/** @since 1.0 */\nexport function createFolder(path: string, callOptions?: CallOptions): DashRequest<FileEntry> {\n return call('dash.storage.file.createFolder', { path }, callOptions);\n}\n\n/** @since 1.0 */\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\n/** @since 1.0 */\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/**\n * Removing a folder that isn't empty needs `recursive`.\n * @since 1.0\n */\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/**\n * Keeps a temporary file, such as a download, at `path`.\n * @since 1.0\n */\nexport function save(\n file: DotFile,\n path: string,\n options: ReplaceOptions = {},\n callOptions?: CallOptions,\n): DashRequest<FileEntry> {\n return call('dash.storage.file.save', { file: file.id, path, ...options }, callOptions);\n}\n\n/**\n * A stored file as a DotFile, to show with its `url` or send with `http.upload`.\n * @since 1.0\n */\nexport function open(path: string, callOptions?: CallOptions): DashRequest<DotFile> {\n return call('dash.storage.file.open', { path }, callOptions);\n}\n\n/** @since 1.0 */\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 tokens its own API gives the person. Holds up to 32 strings of up to 4 KB\n// each, encrypted with a key that never leaves the device. Don't keep the dot's own API keys here:\n// they would 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\n/** @since 1.0 */\nexport function get(key: string, callOptions?: CallOptions): DashRequest<string | null> {\n return call('dash.storage.secret.get', { key }, callOptions);\n}\n\n/** @since 1.0 */\nexport function set(key: string, value: string, callOptions?: CallOptions): DashRequest<void> {\n return call('dash.storage.secret.set', { key, value }, callOptions);\n}\n\n/** @since 1.0 */\nexport function remove(key: string, callOptions?: CallOptions): DashRequest<void> {\n return call('dash.storage.secret.remove', { key }, callOptions);\n}\n\n/** @since 1.0 */\nexport function clear(callOptions?: CallOptions): DashRequest<void> {\n return call('dash.storage.secret.clear', {}, callOptions);\n}\n","// A dot's own data, kept on this device for the signed-in Dash user only. It's never backed up or\n// moved to a new phone, and another user who signs in sees none of it. Keep what matters on the\n// dot's server, and treat this as a copy you 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\n/** @since 1.0 */\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/**\n * Resolves after `milliseconds`. The host keeps the time, since a dot's logic has no timers.\n * @since 1.0\n */\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 interface DialMethods {\n 'dash.system.dial': { params: { number: string }; result: void };\n}\n\n/**\n * Opens the phone's dialer with `number` ready, such as \"+232 76 123456\" or a USSD code such as\n * \"*715#\". The person taps Call. Spaces and dashes are fine; anything else but digits, +, * and #\n * rejects with `invalid`.\n * @since 1.0\n */\nexport function dial(number: string, callOptions?: CallOptions): DashRequest<void> {\n return call('dash.system.dial', { number }, 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/**\n * Plays a short vibration. Resolves once it's done.\n * @since 1.0\n */\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 type Platform = 'ios' | 'android' | 'simulator';\n\nexport interface SystemInfo {\n platform: Platform;\n // Such as \"18.2\" on iOS or \"15\" on Android.\n osVersion: string;\n // The person's language, such as \"en\", and their region, such as \"SL\", or null if unknown.\n language: string;\n region: string | null;\n // Such as \"Africa/Freetown\".\n timeZone: string;\n // The version of Dash the dot runs in, such as \"2.4.0\". To check for a call, use dash.supports.\n dashVersion: string;\n // The Dash API versions it offers, such as [\"1.4\"], one for each major it supports.\n apiVersions: string[];\n}\n\nexport interface InfoMethods {\n 'dash.system.info': { params: Record<string, never>; result: SystemInfo };\n}\n\n/**\n * The phone and the Dash the dot runs in. It has nothing that identifies the person or the phone.\n * @since 1.0\n */\nexport function info(callOptions?: CallOptions): DashRequest<SystemInfo> {\n return call('dash.system.info', {}, 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/**\n * Opens an https address in the device's browser. Any other address rejects with `invalid`.\n * @since 1.0\n */\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';\n\nexport type BrightnessLevel = 'max' | 'normal';\n\nexport interface ScreenMethods {\n 'dash.system.keepAwake': { params: { on: boolean }; result: void };\n 'dash.system.brightness': { params: { level: BrightnessLevel }; result: void };\n}\n\n/**\n * Keeps the screen from dimming and locking while the dot shows, such as while a ticket's QR code is\n * up. Dash undoes it when the dot closes.\n * @since 1.0\n */\nexport function keepAwake(on: boolean, callOptions?: CallOptions): DashRequest<void> {\n return call('dash.system.keepAwake', { on }, callOptions);\n}\n\n/**\n * `max` makes the screen as bright as it goes, so a scanner can read a QR code on it, and `normal`\n * puts it back. Dash puts it back too when the dot closes or the person leaves the app.\n * @since 1.0\n */\nexport function brightness(level: BrightnessLevel, callOptions?: CallOptions): DashRequest<void> {\n return call('dash.system.brightness', { level }, 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, for apps that use one, such as email.\n title?: string;\n text?: string;\n url?: string;\n file?: DotFile;\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/**\n * Opens the device's share sheet. Resolves once it shows.\n * @since 1.0\n */\nexport function share(options: ShareOptions, callOptions?: CallOptions): DashRequest<void> {\n const { file, ...content } = options;\n if (file === undefined) {\n return call('dash.system.share', content, callOptions);\n }\n return call('dash.system.share', { ...content, file: file.id }, callOptions);\n}\n","import type { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\nexport interface TorchMethods {\n 'dash.system.torch': { params: { on: boolean }; result: void };\n}\n\n/**\n * Turns the torch on or off. Rejects with `unsupported` on a device without one.\n * @since 1.0\n */\nexport function torch(on: boolean, callOptions?: CallOptions): DashRequest<void> {\n return call('dash.system.torch', { on }, callOptions);\n}\n","import type { ClipboardMethods } from './clipboard';\nimport type { DelayMethods } from './delay';\nimport type { DialMethods } from './dial';\nimport type { HapticsMethods } from './haptics';\nimport type { InfoMethods } from './info';\nimport type { OpenUrlMethods } from './open-url';\nimport type { ScreenMethods } from './screen';\nimport type { ShareMethods } from './share';\nimport type { TorchMethods } from './torch';\n\nexport { copyText } from './clipboard';\nexport { delay } from './delay';\nexport { dial } from './dial';\nexport { vibrate } from './haptics';\nexport { info } from './info';\nexport { openUrl } from './open-url';\nexport { brightness, keepAwake } from './screen';\nexport { share } from './share';\nexport { torch } from './torch';\nexport type { VibrateOptions, VibrationStyle } from './haptics';\nexport type { Platform, SystemInfo } from './info';\nexport type { BrightnessLevel } from './screen';\nexport type { ShareOptions } from './share';\n\nexport type SystemMethods = ClipboardMethods &\n DelayMethods &\n DialMethods &\n HapticsMethods &\n InfoMethods &\n OpenUrlMethods &\n ScreenMethods &\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 can't be undone.\n role?: 'default' | 'cancel' | 'destructive' | undefined;\n}\n\nexport interface AlertOptions {\n title: string;\n message?: string | undefined;\n // Defaults to one OK button.\n actions?: AlertAction[] | undefined;\n}\n\nexport interface AlertResult {\n // The `id` of the action the person chose.\n action: string;\n}\n\nexport interface DialogMethods {\n 'dash.ui.alert': { params: AlertOptions; result: AlertResult };\n}\n\n/**\n * Shows a native alert. Resolves with the action the person chose.\n * @since 1.0\n */\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 { CallOptions, DashRequest } from '../call';\nimport { call } from '../call';\n\nexport interface PickDateOptions {\n title?: string | undefined;\n // Dates such as \"2026-10-24\". `value` is the one chosen when the picker opens.\n value?: string | undefined;\n min?: string | undefined;\n max?: string | undefined;\n}\n\nexport interface PickTimeOptions {\n title?: string | undefined;\n // A time of day in 24 hours, such as \"19:30\", chosen when the picker opens.\n value?: string | undefined;\n}\n\nexport interface PickerMethods {\n 'dash.ui.pickDate': { params: PickDateOptions; result: string };\n 'dash.ui.pickTime': { params: PickTimeOptions; result: string };\n}\n\n/**\n * Opens the phone's own calendar. Resolves with the chosen date, such as \"2026-10-24\", or rejects\n * with `cancelled` if the person closes it.\n * @since 1.0\n */\nexport function pickDate(\n options: PickDateOptions = {},\n callOptions?: CallOptions,\n): DashRequest<string> {\n return call('dash.ui.pickDate', options, callOptions);\n}\n\n/**\n * Opens the phone's own clock. Resolves with the chosen time in 24 hours, such as \"19:30\", or\n * rejects with `cancelled` if the person closes it.\n * @since 1.0\n */\nexport function pickTime(\n options: PickTimeOptions = {},\n callOptions?: CallOptions,\n): DashRequest<string> {\n return call('dash.ui.pickTime', options, callOptions);\n}\n","import type { DialogMethods } from './dialogs';\nimport type { PickerMethods } from './pickers';\n\nexport { alert } from './dialogs';\nexport { pickDate, pickTime } from './pickers';\nexport type { AlertAction, AlertOptions, AlertResult } from './dialogs';\nexport type { PickDateOptions, PickTimeOptions } from './pickers';\n\nexport type UIMethods = DialogMethods & PickerMethods;\n","// Text to base64 or hex and back, as UTF-8. These run in the dot itself, so they need no Dash and\n// answer at once. The engines that run a dot's logic have no TextEncoder, so UTF-8 is done here.\n\nconst BASE64_ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nconst BASE64_PATTERN = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;\nconst HEX_PATTERN = /^(?:[0-9a-fA-F]{2})*$/;\n\nexport const base64 = {\n // \"Salone\" -> \"U2Fsb25l\"\n encode(text: string): string {\n return bytesToBase64(utf8Bytes(text));\n },\n // Throws for text that isn't base64.\n decode(encoded: string): string {\n return utf8Text(base64ToBytes(encoded));\n },\n};\n\nexport const hex = {\n // \"Salone\" -> \"53616c6f6e65\"\n encode(text: string): string {\n return utf8Bytes(text)\n .map((byte) => byte.toString(16).padStart(2, '0'))\n .join('');\n },\n // Throws for text that isn't hex.\n decode(encoded: string): string {\n if (!HEX_PATTERN.test(encoded)) {\n throw new Error(`\"${encoded.slice(0, 20)}\" isn't hex. Use pairs of 0-9 and a-f.`);\n }\n const bytes: number[] = [];\n for (let index = 0; index < encoded.length; index += 2) {\n bytes.push(parseInt(encoded.slice(index, index + 2), 16));\n }\n return utf8Text(bytes);\n },\n};\n\n// Each group of 3 bytes is 24 bits, written as 4 characters of 6 bits. A shorter last group writes\n// one character per byte plus one, and pads with \"=\" to 4.\nfunction bytesToBase64(bytes: number[]): string {\n let encoded = '';\n for (let index = 0; index < bytes.length; index += 3) {\n const group = bytes.slice(index, index + 3);\n const bits = ((group[0] ?? 0) << 16) | ((group[1] ?? 0) << 8) | (group[2] ?? 0);\n const sextets = [(bits >> 18) & 0x3f, (bits >> 12) & 0x3f, (bits >> 6) & 0x3f, bits & 0x3f];\n const characterCount = group.length + 1;\n for (const sextet of sextets.slice(0, characterCount)) {\n encoded += BASE64_ALPHABET[sextet];\n }\n encoded += '='.repeat(4 - characterCount);\n }\n return encoded;\n}\n\n// The reverse of bytesToBase64: each 4 characters give 3 bytes, less one for each \"=\".\nfunction base64ToBytes(encoded: string): number[] {\n if (!BASE64_PATTERN.test(encoded)) {\n throw new Error(`\"${encoded.slice(0, 20)}\" isn't base64.`);\n }\n const bytes: number[] = [];\n for (let index = 0; index < encoded.length; index += 4) {\n const characters = encoded.slice(index, index + 4);\n let bits = 0;\n let padding = 0;\n for (const character of characters) {\n bits <<= 6;\n if (character === '=') {\n padding += 1;\n } else {\n bits |= BASE64_ALPHABET.indexOf(character);\n }\n }\n bytes.push((bits >> 16) & 0xff);\n if (padding < 2) {\n bytes.push((bits >> 8) & 0xff);\n }\n if (padding < 1) {\n bytes.push(bits & 0xff);\n }\n }\n return bytes;\n}\n\nfunction utf8Bytes(text: string): number[] {\n const bytes: number[] = [];\n for (const character of text) {\n const codePoint = character.codePointAt(0)!;\n if (codePoint < 0x80) {\n bytes.push(codePoint);\n } else if (codePoint < 0x800) {\n bytes.push(0xc0 | (codePoint >> 6), 0x80 | (codePoint & 0x3f));\n } else if (codePoint < 0x10000) {\n bytes.push(\n 0xe0 | (codePoint >> 12),\n 0x80 | ((codePoint >> 6) & 0x3f),\n 0x80 | (codePoint & 0x3f),\n );\n } else {\n bytes.push(\n 0xf0 | (codePoint >> 18),\n 0x80 | ((codePoint >> 12) & 0x3f),\n 0x80 | ((codePoint >> 6) & 0x3f),\n 0x80 | (codePoint & 0x3f),\n );\n }\n }\n return bytes;\n}\n\nconst MAX_CODE_POINT = 0x10ffff;\n\n// Bytes that aren't UTF-8 become \"�\", as browsers read them.\nfunction utf8Text(bytes: number[]): string {\n let text = '';\n let index = 0;\n while (index < bytes.length) {\n const first = bytes[index]!;\n const length = sequenceLength(first);\n const continuation = bytes.slice(index + 1, index + length);\n if (length === 0 || !isCompleteContinuation(continuation, length)) {\n text += '�';\n index += 1;\n continue;\n }\n let codePoint = firstByteBits(first, length);\n for (const byte of continuation) {\n codePoint = (codePoint << 6) | (byte & 0x3f);\n }\n // Four bytes can spell a number past the last character, as f7 bf bf bf does.\n if (codePoint > MAX_CODE_POINT) {\n text += '�';\n index += 1;\n continue;\n }\n text += String.fromCodePoint(codePoint);\n index += length;\n }\n return text;\n}\n\n// How many bytes a UTF-8 character takes, from its first byte. 0 for a byte that can't start one.\nfunction sequenceLength(first: number): number {\n if (first < 0x80) {\n return 1;\n }\n if (first >= 0xf0) {\n return 4;\n }\n if (first >= 0xe0) {\n return 3;\n }\n if (first >= 0xc0) {\n return 2;\n }\n return 0;\n}\n\n// Whether the bytes after a first byte are all there, and each is a continuation byte: 10xxxxxx.\nfunction isCompleteContinuation(continuation: number[], length: number): boolean {\n if (continuation.length !== length - 1) {\n return false;\n }\n return continuation.every((byte) => (byte & 0xc0) === 0x80);\n}\n\n// The bits of the code point that a first byte holds, after its length marker of 1s and a 0.\nfunction firstByteBits(first: number, length: number): number {\n if (length === 1) {\n return first;\n }\n return first & (0xff >> (length + 1));\n}\n","// Helpers that run in the dot itself, so they need no Dash and answer at once, without `await`.\n\n/**\n * Text to base64 and back, as UTF-8: `dash.utils.base64.encode(\"Salone\")` is `\"U2Fsb25l\"`.\n * `decode` throws for text that isn't base64.\n * @since 1.0\n */\nexport { base64 } from './encoding';\n\n/**\n * Text to hex and back, as UTF-8: `dash.utils.hex.encode(\"Salone\")` is `\"53616c6f6e65\"`.\n * `decode` throws for text that isn't hex.\n * @since 1.0\n */\nexport { hex } from './encoding';\n","import type { DashRequest } from './call';\n\n// A copy of `group`, such as `dash`, that passes each request it starts to `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 startCall = member as (...args: unknown[]) => unknown;\n copy[name] = (...args: unknown[]) => {\n const result = startCall(...args);\n // Only calls return a request to track. dash.supports answers at once.\n if (result instanceof Promise) {\n track(result as DashRequest<unknown>);\n }\n return result;\n };\n } else {\n copy[name] = tracked(member as object, track);\n }\n }\n return copy as Group;\n}\n","import type { HostErrorCode } from '@monimesl/dot-core';\nimport { HostError } from '@monimesl/dot-core';\n\ntype DashErrorWith<Code extends HostErrorCode> = HostError & { readonly code: Code };\n\nexport function isDashError<Code extends HostErrorCode>(\n error: unknown,\n ...codes: Code[]\n): error is DashErrorWith<Code> {\n if (error instanceof HostError) {\n return codes.length === 0 || codes.includes(error.code as Code);\n }\n return false;\n}\n\n// The message to show for anything a call threw, even if it isn't an Error.\nexport function errorMessage(error: unknown): string {\n if (error instanceof Error) {\n return error.message;\n }\n if (typeof error === 'string' && error) {\n return error;\n }\n return 'Something went wrong. Try again.';\n}\n\n// Waits for a call, such as a picker, and gives undefined if the person closed it or it was\n// cancelled. Other errors still throw.\nexport async function unlessCancelled<Result>(\n call: PromiseLike<Result>,\n): Promise<Result | undefined> {\n try {\n return await call;\n } catch (error) {\n if (isDashError(error, 'cancelled')) {\n return undefined;\n }\n throw error;\n }\n}\n","import type { DashRequest } from './call';\nimport { isDashError } from './errors';\nimport type { Dash } from './index';\n\n// Each call given to it cancels the one before, so an older answer can't arrive after a newer one.\n// The cancelled call rejects with `cancelled`, which unlessCancelled turns into undefined.\nexport function latest(): <Result>(call: DashRequest<Result>) => DashRequest<Result> {\n let running: DashRequest<unknown> | undefined;\n return (call) => {\n running?.cancel();\n running = call;\n return call;\n };\n}\n\n// Resolves true once `milliseconds` pass without another call, such as a pause in typing, and false\n// for a wait a newer call cut short. It waits through the page's `this.dash`, since a dot has no timers.\nexport function debounce(milliseconds: number): (dash: Dash) => Promise<boolean> {\n const wait = latest();\n return async (dash) => {\n try {\n await wait(dash.system.delay(milliseconds));\n return true;\n } catch (error) {\n if (isDashError(error, 'cancelled')) {\n return false;\n }\n throw error;\n }\n };\n}\n","import * as account from './account';\nimport { supports } from './api-versions';\nimport * as contacts from './contacts';\nimport * as crypto from './crypto';\nimport * as dot from './dot';\nimport * as media from './media';\nimport * as network from './network';\nimport * as storage from './storage';\nimport * as system from './system';\nimport * as ui from './ui';\nimport * as utils from './utils';\n\n// Dash's features for a dot's logic, in groups: `dash.ui.alert(...)`, `dash.system.torch(...)`,\n// `dash.network.http.request(...)`. `dash.supports(...)` says whether this Dash has a newer one.\n// `dash.utils` holds helpers that run in the dot and answer at once, such as `dash.utils.base64`.\nexport const dash = {\n ui,\n system,\n network,\n storage,\n media,\n contacts,\n dot,\n account,\n crypto,\n utils,\n supports,\n};\n\nexport type Dash = typeof dash;\n\nexport { tracked } from './tracked';\nexport {\n DASH_API_SINCE,\n DASH_API_VERSION,\n useHostDashApiVersions,\n warnAboveDashApiVersion,\n} from './api-versions';\nexport type { DashFeature } from './api-versions';\n\n// The error a Dash call fails with. Inside the libraries it's core's HostError.\nexport { HostError as DashError } from '@monimesl/dot-core';\nexport type { HostErrorCode as DashErrorCode } from '@monimesl/dot-core';\nexport { errorMessage, isDashError, unlessCancelled } from './errors';\nexport { debounce, latest } from './latest';\nexport type { AccountProfile, ReadProfileOptions } from './account';\nexport type { CryptoInput, CryptoOutputOptions, HmacAlgorithm, HmacOptions } from './crypto';\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 CodeFormat,\n MediaMethods,\n PhotoSource,\n PickFileOptions,\n PickPhotoOptions,\n ScannedCode,\n} from './media';\nexport type { ContactsMethods, PickedContact } from './contacts';\nexport type {\n ConnectionType,\n HttpDownloadRequest,\n HttpDownloadResponse,\n HttpMethod,\n HttpReadOptions,\n HttpRequest,\n HttpRequestBody,\n HttpResponse,\n HttpUploadFile,\n HttpUploadRequest,\n NetworkMethods,\n NetworkStatus,\n} from './network';\nexport type {\n BrightnessLevel,\n Platform,\n ShareOptions,\n SystemInfo,\n SystemMethods,\n VibrateOptions,\n VibrationStyle,\n} from './system';\nexport type {\n AlertAction,\n AlertOptions,\n AlertResult,\n PickDateOptions,\n PickTimeOptions,\n UIMethods,\n} from './ui';\n"],"mappings":";;;AAGA,MAAa,mBAAmB;AAKhC,MAAa,iBAAiB;CAC5B,uBAAuB;CACvB,sBAAsB;CACtB,eAAe;CACf,sBAAsB;CACtB,qBAAqB;CACrB,iBA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AAA;CACA;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monimesl/dot-dash",
3
- "version": "0.1.0-alpha.23",
3
+ "version": "0.1.0-alpha.24",
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.23"
27
+ "@monimesl/dot-core": "0.1.0-alpha.24"
28
28
  },
29
29
  "devDependencies": {
30
30
  "publint": "^0.3.24",