@monimesl/dot-dash 0.1.0-alpha.25 → 0.1.0-alpha.27

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
@@ -780,9 +780,9 @@ type DashMethod = keyof DashMethods;
780
780
  type CallOptions = HostCallOptions;
781
781
  type DashRequest<Result> = HostRequest<Result>;
782
782
  declare namespace index_d_exports$1 {
783
- export { AccountMethods, SignInMode, SimpleSignIn, SimpleSignInOptions, signIn };
783
+ export { AccountMethods, OidcProfile, OidcScope, OidcSignIn, OidcSignInOptions, SignInMode, SimpleSignIn, SimpleSignInOptions, signIn };
784
784
  }
785
- type SignInMode = 'simple';
785
+ type SignInMode = 'simple' | 'oidc';
786
786
  interface SimpleSignInOptions {
787
787
  mode: 'simple';
788
788
  nonce?: string | undefined;
@@ -792,23 +792,48 @@ interface SimpleSignIn {
792
792
  alias: string;
793
793
  accountIdToken: string;
794
794
  }
795
+ type OidcScope = 'profile' | 'phone' | 'email';
796
+ interface OidcSignInOptions {
797
+ mode: 'oidc';
798
+ scopes?: OidcScope[] | undefined;
799
+ nonce?: string | undefined;
800
+ }
801
+ interface OidcProfile {
802
+ name?: string | undefined;
803
+ givenName?: string | undefined;
804
+ familyName?: string | undefined;
805
+ phone?: string | undefined;
806
+ email?: string | undefined;
807
+ }
808
+ interface OidcSignIn {
809
+ id: string;
810
+ idToken: string;
811
+ expiresAt: string;
812
+ profile: OidcProfile;
813
+ }
795
814
  interface AccountMethods {
796
815
  'dash.account.signIn': {
797
816
  params: {
798
817
  mode: SignInMode;
799
818
  nonce: string;
819
+ scopes?: OidcScope[];
800
820
  };
801
- result: SimpleSignIn;
821
+ result: SimpleSignIn | OidcSignIn;
802
822
  };
803
823
  }
804
824
  /**
805
- * Signs the person in to the dot with their Dash account. With `mode: 'simple'`, it resolves with
806
- * their full name, their phone number or email address, and a token that names them in this dot.
807
- * Needs the `account` permission. Rejects with `invalid` for a nonce longer than 128 characters,
808
- * with `unsupported` for a mode this Dash doesn't have, and with `failed` when no one is signed in.
825
+ * Signs the person in to the dot with their Dash account. Needs the `account` permission.
826
+ *
827
+ * With `mode: 'simple'`, resolves with their full name, their phone number or email address, and a
828
+ * token that names them in this dot. With `mode: 'oidc'`, OpenID Connect, it will resolve with an ID
829
+ * token for the dot's server; until Dash has it, it rejects with `unsupported`.
830
+ *
831
+ * Rejects with `invalid` for a nonce longer than 128 characters, with `unsupported` for a mode this
832
+ * Dash doesn't have, and with `failed` when no one is signed in or Dash can't reach Monime.
809
833
  * @since 1.0
810
834
  */
811
835
  declare function signIn(options: SimpleSignInOptions, callOptions?: CallOptions): DashRequest<SimpleSignIn>;
836
+ declare function signIn(options: OidcSignInOptions, callOptions?: CallOptions): DashRequest<OidcSignIn>;
812
837
  //#endregion
813
838
  //#region src/api-versions.d.ts
814
839
  export declare const DASH_API_VERSION = "1.0";
@@ -917,5 +942,5 @@ export declare const dash: {
917
942
  };
918
943
  export type Dash = typeof dash;
919
944
  //#endregion
920
- export { 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 ReplaceOptions, type ScannedCode, type ShareOptions, type SignInMode, type SimpleSignIn, type SimpleSignInOptions, type StorageMethods, type StorageUsage, type SystemInfo, type SystemMethods, type UIMethods, type VibrateOptions, type VibrationStyle, type WriteOptions };
945
+ export { 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 OidcProfile, type OidcScope, type OidcSignIn, type OidcSignInOptions, type PhotoSource, type PickDateOptions, type PickFileOptions, type PickPhotoOptions, type PickTimeOptions, type PickedContact, type Platform, type ReadOptions, type ReplaceOptions, type ScannedCode, type ShareOptions, type SignInMode, type SimpleSignIn, type SimpleSignInOptions, type StorageMethods, type StorageUsage, type SystemInfo, type SystemMethods, type UIMethods, type VibrateOptions, type VibrationStyle, type WriteOptions };
921
946
  //# 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":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ources":["../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;UAGK,oBAAoB;EACnC,WAAW;EACX,KAAK;EACL,MAAM;;KAGH;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;;;;;;iBASa,KAAK,SAAS,aAAa,cAAc,cAAc;;;;;iBAevD,YACd,eACA,UAAS,qBACT,cAAc,cACb;;;;;iBAQa,WAAW,cAAc,cAAc;;;;UCvFtC;EACf;IAAoB,QAAQ;IAAuB;;;;;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e;;;;;;;;;;;;;;iBAeX,OACd,SAAS,qBACT,cAAc,cACb,YAAY;iBACC,OACd,SAAS,mBACT,cAAc,cACb,YAAY;;;qBC7EF;qBAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,iBAAiB;WAAuB,MAAM;;wBAE9D,YAAY,aAAa,eACvC,mBACG,OAAO,SACT,SAAS,cAAc;wBAQV,aAAa;wBAYP,gBAAgB,QACpC,MAAM,YAAY,UACjB,QAAQ;;;wBCxBK,WAAW,QAAQ,MAAM,YAAY,YAAY,YAAY;wBAW7D,SAAS,wBAAwB,MAAM,SAAS;;;qBCFnD;;;;;;;;;;;;;YAcD,cAAc"}
package/dist/index.js CHANGED
@@ -102,18 +102,13 @@ function call(method, params, options = {}) {
102
102
  //#endregion
103
103
  //#region src/account/index.ts
104
104
  var account_exports = /* @__PURE__ */ __exportAll({ signIn: () => signIn });
105
- /**
106
- * Signs the person in to the dot with their Dash account. With `mode: 'simple'`, it resolves with
107
- * their full name, their phone number or email address, and a token that names them in this dot.
108
- * Needs the `account` permission. Rejects with `invalid` for a nonce longer than 128 characters,
109
- * with `unsupported` for a mode this Dash doesn't have, and with `failed` when no one is signed in.
110
- * @since 1.0
111
- */
112
105
  function signIn(options, callOptions) {
113
- return call("dash.account.signIn", {
106
+ const params = {
114
107
  mode: options.mode,
115
108
  nonce: options.nonce ?? ""
116
- }, callOptions);
109
+ };
110
+ if (options.mode === "oidc" && options.scopes) params.scopes = options.scopes;
111
+ return call("dash.account.signIn", params, callOptions);
117
112
  }
118
113
  //#endregion
119
114
  //#region src/contacts/pick-phone.ts
package/dist/index.js.map CHANGED
@@ -1 +1 @@
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.signIn': '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\n// How a dot signs the person in. Only `simple` for now: Dash says who the person is, on the phone.\n// A mode with OpenID Connect may come later, with its own result.\nexport type SignInMode = 'simple';\n\nexport interface SimpleSignInOptions {\n mode: 'simple';\n // Mixed into the token. The same nonce gives the same token, so leaving it out, or a fixed one,\n // names the person the same way each time in this dot, and a fresh one gives a token only for\n // this call. An empty nonce is the same as none.\n nonce?: string | undefined;\n}\n\nexport interface SimpleSignIn {\n fullName: string;\n // The phone number or email address the person uses Dash with, such as \"+232 76 123456\". It's the\n // phone number when the account has one.\n alias: string;\n // A SHA-512 hash, in hex, of the dot's id, the person's Monimeer 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}\n\nexport interface AccountMethods {\n 'dash.account.signIn': { params: { mode: SignInMode; nonce: string }; result: SimpleSignIn };\n}\n\n/**\n * Signs the person in to the dot with their Dash account. With `mode: 'simple'`, it resolves with\n * their full name, their phone number or email address, and a token that names them in this dot.\n * Needs the `account` permission. Rejects with `invalid` for a nonce longer than 128 characters,\n * with `unsupported` for a mode this Dash doesn't have, and with `failed` when no one is signed in.\n * @since 1.0\n */\nexport function signIn(\n options: SimpleSignInOptions,\n callOptions?: CallOptions,\n): DashRequest<SimpleSignIn> {\n return call(\n 'dash.account.signIn',\n { mode: options.mode, nonce: options.nonce ?? '' },\n callOptions,\n );\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 { SignInMode, SimpleSignIn, SimpleSignInOptions } 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,kBAAkB;CAClB,sBAAsB;CACtB,eAAe;CACf,sBAAsB;CACtB,qBAAqB;CACrB,iBAAiB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;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.signIn': '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\n// How a dot signs the person in. `simple`: Dash says who the person is. `oidc`: OpenID Connect,\n// with an ID token the dot's server can check. `oidc` isn't ready yet, so it fails with `unsupported`.\nexport type SignInMode = 'simple' | 'oidc';\n\nexport interface SimpleSignInOptions {\n mode: 'simple';\n // Mixed into the token. The same nonce gives the same token, so leaving it out, or a fixed one,\n // names the person the same way each time in this dot, and a fresh one gives a token only for\n // this call. An empty nonce is the same as none.\n nonce?: string | undefined;\n}\n\nexport interface SimpleSignIn {\n fullName: string;\n // The phone number or email address the person uses Dash with, such as \"+232 76 123456\". It's the\n // phone number when the account has one.\n alias: string;\n // Monime makes it from the dot's id, the person and the nonce, with a key only Monime knows, so the\n // same person gets the same token on any phone. It names the person but proves nothing to the\n // dot's server: Dash hands it over as it is.\n accountIdToken: string;\n}\n\n// What the dot asks to see besides who the person is. Each needs the person's consent.\nexport type OidcScope = 'profile' | 'phone' | 'email';\n\nexport interface OidcSignInOptions {\n mode: 'oidc';\n scopes?: OidcScope[] | undefined;\n // Goes into the ID token. The dot's server should give a fresh one for each sign-in and check it.\n nonce?: string | undefined;\n}\n\n// Only what the person agreed to, by scope.\nexport interface OidcProfile {\n name?: string | undefined;\n givenName?: string | undefined;\n familyName?: string | undefined;\n phone?: string | undefined;\n email?: string | undefined;\n}\n\nexport interface OidcSignIn {\n // The person's id for this dot's publisher. The same in each of the publisher's dots.\n id: string;\n // A signed JWT the dot's server checks with Monime's keys before trusting `id`.\n idToken: string;\n // When `idToken` stops being valid, such as \"2026-10-24T10:05:00Z\".\n expiresAt: string;\n profile: OidcProfile;\n}\n\nexport interface AccountMethods {\n 'dash.account.signIn': {\n params: { mode: SignInMode; nonce: string; scopes?: OidcScope[] };\n result: SimpleSignIn | OidcSignIn;\n };\n}\n\n/**\n * Signs the person in to the dot with their Dash account. Needs the `account` permission.\n *\n * With `mode: 'simple'`, resolves with their full name, their phone number or email address, and a\n * token that names them in this dot. With `mode: 'oidc'`, OpenID Connect, it will resolve with an ID\n * token for the dot's server; until Dash has it, it rejects with `unsupported`.\n *\n * Rejects with `invalid` for a nonce longer than 128 characters, with `unsupported` for a mode this\n * Dash doesn't have, and with `failed` when no one is signed in or Dash can't reach Monime.\n * @since 1.0\n */\nexport function signIn(\n options: SimpleSignInOptions,\n callOptions?: CallOptions,\n): DashRequest<SimpleSignIn>;\nexport function signIn(\n options: OidcSignInOptions,\n callOptions?: CallOptions,\n): DashRequest<OidcSignIn>;\nexport function signIn(\n options: SimpleSignInOptions | OidcSignInOptions,\n callOptions?: CallOptions,\n): DashRequest<SimpleSignIn | OidcSignIn> {\n const params: AccountMethods['dash.account.signIn']['params'] = {\n mode: options.mode,\n nonce: options.nonce ?? '',\n };\n if (options.mode === 'oidc' && options.scopes) {\n params.scopes = options.scopes;\n }\n return call('dash.account.signIn', params, 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 // Names are lowercase, such as \"content-type\". A header sent more than once comes once, with its\n // values joined by \", \".\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 // In bytes, and 0 for a folder.\n size: number;\n kind: 'file' | 'folder';\n // When it last changed, in milliseconds since 1 January 1970, as Date.now() gives.\n modifiedAt: number;\n contentType?: string;\n}\n\nexport type FileEncoding = 'text' | 'base64';\n\n// In bytes: what the dot's files take, and the most they may take.\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. On Android, Back or a tap outside the alert chooses it too. An\n // alert without one stays until the person chooses an action. `destructive` marks something that\n // 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 {\n OidcProfile,\n OidcScope,\n OidcSignIn,\n OidcSignInOptions,\n SignInMode,\n SimpleSignIn,\n SimpleSignInOptions,\n} 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,kBAAkB;CAClB,sBAAsB;CACtB,eAAe;CACf,sBAAsB;CACtB,qBAAqB;CACrB,iBAAiB;CACjB,iBAAiB;CACjB,aAAa;CACb,kBAAkB;CAClB,mBAAmB;CACnB,kBAAkB;CAClB,yBAAyB;CACzB,w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;CACA,OAAA;CACA;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monimesl/dot-dash",
3
- "version": "0.1.0-alpha.25",
3
+ "version": "0.1.0-alpha.27",
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.25"
27
+ "@monimesl/dot-core": "0.1.0-alpha.27"
28
28
  },
29
29
  "devDependencies": {
30
30
  "publint": "^0.3.24",