@ghostlytools/cli 1.10.2 → 1.10.3
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/README.md +4 -2
- package/dist/assets/{api-DcE4KylM.js → api-BdaxsDvA.js} +2 -2
- package/dist/assets/{api-EUGHGnRz.js → api-C4MLg5Rs.js} +42 -17
- package/dist/assets/api-C4MLg5Rs.js.map +1 -0
- package/dist/assets/{apiKit-CJVp_crp.js → apiKit-BbNaxZGZ.js} +27 -11
- package/dist/assets/apiKit-BbNaxZGZ.js.map +1 -0
- package/dist/assets/{apps-C54T_MOT.js → apps-BluQgEhv.js} +3 -3
- package/dist/assets/{apps-C54T_MOT.js.map → apps-BluQgEhv.js.map} +1 -1
- package/dist/assets/{apps-C-KbyLCa.js → apps-BtGFth7o.js} +1 -1
- package/dist/assets/{arkade-BmxJTa65.js → arkade-DdZx4b_I.js} +2 -2
- package/dist/assets/{arkade-BmxJTa65.js.map → arkade-DdZx4b_I.js.map} +1 -1
- package/dist/assets/{backup-BxSH5BZG.js → backup-DyDsW7sC.js} +6 -6
- package/dist/assets/{backup-BxSH5BZG.js.map → backup-DyDsW7sC.js.map} +1 -1
- package/dist/assets/{backup-C0Plp-DF.js → backup-I1n7ccz7.js} +1 -1
- package/dist/assets/{buttons-B-ZJYdo0.js → buttons-Do7dCku6.js} +4 -4
- package/dist/assets/{buttons-B-ZJYdo0.js.map → buttons-Do7dCku6.js.map} +1 -1
- package/dist/assets/buttons-DpjwXePb.js +2 -0
- package/dist/assets/{client-CDa87uYD.js → client-CWsjRiH8.js} +2 -2
- package/dist/assets/{client-CDa87uYD.js.map → client-CWsjRiH8.js.map} +1 -1
- package/dist/assets/{codec-D45W1L8n.js → codec-DPaXhuYc.js} +2 -2
- package/dist/assets/{codec-D45W1L8n.js.map → codec-DPaXhuYc.js.map} +1 -1
- package/dist/assets/{envelope-C3yFCQa-.js → envelope-5Gu9yGk_.js} +2 -2
- package/dist/assets/{envelope-C3yFCQa-.js.map → envelope-5Gu9yGk_.js.map} +1 -1
- package/dist/assets/{fixedHosts-C6nCHjOa.js → fixedHosts-PR1BcfKX.js} +7 -8
- package/dist/assets/fixedHosts-PR1BcfKX.js.map +1 -0
- package/dist/assets/{groupFiles-DYopNE57.js → groupFiles-BuToTMUk.js} +213 -90
- package/dist/assets/groupFiles-BuToTMUk.js.map +1 -0
- package/dist/assets/{host-G5seUwaI.js → host-fkQYBvKH.js} +226 -29
- package/dist/assets/host-fkQYBvKH.js.map +1 -0
- package/dist/assets/{hyperdhtRelay-B_uHjg_r.js → hyperdhtRelay-DDCak5PY.js} +2 -2
- package/dist/assets/{hyperdhtRelay-B_uHjg_r.js.map → hyperdhtRelay-DDCak5PY.js.map} +1 -1
- package/dist/assets/{irohWeb-C-2oslSU.js → irohWeb-B4_swKx0.js} +2 -2
- package/dist/assets/{irohWeb-C-2oslSU.js.map → irohWeb-B4_swKx0.js.map} +1 -1
- package/dist/assets/{main-Dk--nD7X.js → main-ClYsttvY.js} +49 -30
- package/dist/assets/main-ClYsttvY.js.map +1 -0
- package/dist/assets/{mainline-HPlVrl8R.js → mainline-Hsk2SZ1B.js} +63 -3
- package/dist/assets/mainline-Hsk2SZ1B.js.map +1 -0
- package/dist/assets/{networkReason-CfpO9ayz.js → networkReason-C9Hr-hO7.js} +4 -4
- package/dist/assets/{networkReason-CfpO9ayz.js.map → networkReason-C9Hr-hO7.js.map} +1 -1
- package/dist/assets/{nwc-BY7BPttn.js → nwc-BbK6qNxS.js} +3 -3
- package/dist/assets/{nwc-BY7BPttn.js.map → nwc-BbK6qNxS.js.map} +1 -1
- package/dist/assets/{nwcProvider-CfpbNUf7.js → nwcProvider-D_tt2X3Z.js} +2 -2
- package/dist/assets/{nwcProvider-CfpbNUf7.js.map → nwcProvider-D_tt2X3Z.js.map} +1 -1
- package/dist/assets/{ownDid-DJFZM2cV.js → ownDid-DkK_jem4.js} +2 -2
- package/dist/assets/{ownDid-DJFZM2cV.js.map → ownDid-DkK_jem4.js.map} +1 -1
- package/dist/assets/{profiles-DKmZGXp6.js → profiles-aV9vaK0B.js} +7 -5
- package/dist/assets/profiles-aV9vaK0B.js.map +1 -0
- package/dist/assets/{registry-CAzrtV0_.js → registry-C9T6tYCO.js} +1 -1
- package/dist/assets/{registry-BUm4cAzV.js → registry-CEjnubep.js} +8 -7
- package/dist/assets/registry-CEjnubep.js.map +1 -0
- package/dist/assets/{resolve-CDD4X68j.js → resolve-BBOrN13E.js} +24 -5
- package/dist/assets/resolve-BBOrN13E.js.map +1 -0
- package/dist/assets/{server-DcOsgYDU.js → server-BJ3T-kx3.js} +247 -107
- package/dist/assets/server-BJ3T-kx3.js.map +1 -0
- package/dist/assets/{src-D31D1_oY.js → src-BIdfHB7t.js} +254 -71
- package/dist/assets/src-BIdfHB7t.js.map +1 -0
- package/dist/assets/{sshForges-DerRwMf3.js → sshForges-CRg-NGld.js} +2 -2
- package/dist/assets/{sshForges-DerRwMf3.js.map → sshForges-CRg-NGld.js.map} +1 -1
- package/dist/assets/{translate-C-sj0VJe.js → translate-b0X61WMI.js} +2 -2
- package/dist/assets/{translate-C-sj0VJe.js.map → translate-b0X61WMI.js.map} +1 -1
- package/dist/assets/{usdt-DwHqp625.js → usdt-6CQdfye1.js} +7 -4
- package/dist/assets/usdt-6CQdfye1.js.map +1 -0
- package/dist/assets/{waitNotice-D52RWbV4.js → waitNotice-Ce3YCinu.js} +27 -5
- package/dist/assets/waitNotice-Ce3YCinu.js.map +1 -0
- package/dist/assets/{words-Db9WgatT.js → words-Dk6o6wz4.js} +3 -3
- package/dist/assets/words-Dk6o6wz4.js.map +1 -0
- package/dist/ghostly.mjs +1 -1
- package/package.json +1 -1
- package/dist/assets/api-EUGHGnRz.js.map +0 -1
- package/dist/assets/apiKit-CJVp_crp.js.map +0 -1
- package/dist/assets/buttons-DA3wZfG0.js +0 -2
- package/dist/assets/fixedHosts-C6nCHjOa.js.map +0 -1
- package/dist/assets/groupFiles-DYopNE57.js.map +0 -1
- package/dist/assets/host-G5seUwaI.js.map +0 -1
- package/dist/assets/main-Dk--nD7X.js.map +0 -1
- package/dist/assets/mainline-HPlVrl8R.js.map +0 -1
- package/dist/assets/profiles-DKmZGXp6.js.map +0 -1
- package/dist/assets/registry-BUm4cAzV.js.map +0 -1
- package/dist/assets/resolve-CDD4X68j.js.map +0 -1
- package/dist/assets/server-DcOsgYDU.js.map +0 -1
- package/dist/assets/src-D31D1_oY.js.map +0 -1
- package/dist/assets/usdt-DwHqp625.js.map +0 -1
- package/dist/assets/waitNotice-D52RWbV4.js.map +0 -1
- package/dist/assets/words-Db9WgatT.js.map +0 -1
package/README.md
CHANGED
|
@@ -132,7 +132,7 @@ The rows are in alphabetical order of their first command, and every command of
|
|
|
132
132
|
| `chat request <chat> <sats> [--memo t] [--method m] [--rail r]`, `chat pay-request <chat> <payment>` | Ask a contact to pay; pay the contact's request. Refused as `chat pay` is when the contact offers no way of paying, or when `chat request` has no Cashu wallet of the network here (`no_wallet`). `chat pay-request` names its chat by the chat's id, its contact's key or a label given here, never only by the contact's own name or a prefix of its id |
|
|
133
133
|
| `chat transport <chat> <auto\|dht\|webrtc\|iroh\|hyperdht>` | What carries the chat |
|
|
134
134
|
| `chat verify <chat> --code <code>` | Mark the contact verified after comparing the codes out of band |
|
|
135
|
-
| `chat wait <chat> [--until live\|text\|paired] [--timeout s]` | Wait for a chat to go live, carry text, or see its contact. Live means a session that exists now, in this run of the daemon: a chat that was live before a restart counts once its contact answers again |
|
|
135
|
+
| `chat wait <chat> [--until live\|text\|paired] [--timeout s]` | Wait for a chat to go live, carry text, or see its contact. Live means a session that exists now, in this run of the daemon: a chat that was live before a restart counts once its contact answers again. Paired answers at once for a chat that paired before, whether its contact is online or not |
|
|
136
136
|
| `daemon [--detach] [--timeout s]`, `daemon status [--timeout s]`, `daemon stop [--timeout s]`, `daemon restart [--timeout s]` | Keep the profile online; `status` names its version and its socket (`socket`, for the [socket API](#the-socket-api)), or says `"starting": true` with the `pid` of a daemon whose socket does not listen yet (`stop` and `restart` wait up to `--timeout` for that socket, then stop it); `restart` stops it and starts this release's code in the background ([After an upgrade](#after-an-upgrade)). Ctrl-C, SIGTERM and the terminal closing (SIGHUP) stop it cleanly. A command that holds the profile for a moment (a bot's `send` while a service manager restarts it) is waited for, up to `--timeout` (60 s): still held then, `busy` with its pid |
|
|
137
137
|
| `edit <chat> <message> [text… \| --text <text> \| --stdin] [--force] [--wait none\|confirmed] [--timeout s]` | Replace the text of a message you sent (1:1 chats, `group edit` for a group; `<message>` is the `messageId` `send` gave, or its wire id). The contact sees it in place, marked edited; `--wait confirmed` waits for its app to confirm (the default without a daemon). At most 100 edits a message, no time limit; an older contact app gets it once it shows edits |
|
|
138
138
|
| `engine <method> [json \| -] [--confirm-real] [--show-secret] [--yes] [--force]`, `engine --list [--verbose]` | Any call of the app's engine; `--verbose` lists what each takes (`{ linkId, label }`, `?` for an optional key). A call given less than it takes is refused as `bad_request`. One that deletes chats or groups (`clearProfileData`, `removeLink`, `leaveGroup`, `forgetGroup`, `deviceRemove`) needs `--yes`; `clearProfileData` answers what it removed and stops a daemon. `removeLink`, and `setChatTransport` or `setDeliveryMode` to `dht`, are refused (`busy`) while a call is on in the chat, as `chat remove` and `chat transport dht` are; `clearProfileData` while a call is on in any chat. One that sends a text that looks like a secret (`sendMessage`, `sendGroupMessage`, `editMessage`, `forwardMessages`, a payment's memo or comment, a file's name, a group's name in `createGroup` or `renameGroup`, the nick in `updateSettings`) needs `--force` |
|
|
@@ -321,7 +321,9 @@ chat (`chat list`, `chat show`, `chat rename`, …) and `engine getState` print
|
|
|
321
321
|
said, which orders nothing (a clock can be wrong).
|
|
322
322
|
- A message's `from` is `me`, `peer`, or `system` for a group's own line in `group history` (`event`: created, joined,
|
|
323
323
|
renamed, …; the stream says it as `group.event`): nobody wrote it, whatever `member` key it carries.
|
|
324
|
-
- `seq` grows by one per event in the profile, across restarts
|
|
324
|
+
- `seq` grows by one per event in the profile, across restarts, and is never given to two events; after a crash, or a
|
|
325
|
+
full disk that kept events out of the journal, it can skip numbers, and a replay across them starts with
|
|
326
|
+
`events.gap`. `id` is the same whenever the same fact is reported.
|
|
325
327
|
Dedupe by `id`; resume with `--since <seq>`, or let `--cursor <file>` remember the last event handled. A cursor
|
|
326
328
|
file that holds no event number (empty, edited by hand) is refused at start (`bad_request`, naming the file): fix or
|
|
327
329
|
remove it, or give `--since`.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { l as findGroup, s as findChat, x as startNamedChats } from "./apiKit-
|
|
2
|
-
import { a as hideStateSecrets, i as groupSendRefused, n as SETTABLE, o as mentionsFor, r as callApi, s as redactSettings, t as API_METHODS } from "./api-
|
|
1
|
+
import { l as findGroup, s as findChat, x as startNamedChats } from "./apiKit-BbNaxZGZ.js";
|
|
2
|
+
import { a as hideStateSecrets, i as groupSendRefused, n as SETTABLE, o as mentionsFor, r as callApi, s as redactSettings, t as API_METHODS } from "./api-C4MLg5Rs.js";
|
|
3
3
|
export { API_METHODS, SETTABLE, callApi, findChat, findGroup, groupSendRefused, hideStateSecrets, mentionsFor, redactSettings, startNamedChats };
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { Aa as
|
|
1
|
+
import { Aa as VOICE_LIMITS, Ao as claimedTime, Bn as NO_PICTURE_METADATA, Co as cardLine, Da as sanitizeFileName, Do as statusCardBytes, Fa as parseVoiceMeta, Ia as voiceDownloadName, Jr as TYPING_REFRESH_MS, La as voiceLevel, Ma as baseMime, Mu as relayUrlProblem, Na as downsamplePeaks, Nl as readImageMeta, Oa as sanitizeMime, Ri as identityStatement, Tl as isAppRef, To as checkStatusCard, Un as stripPictureMetadata, Wn as withoutPictureMetadata, Xr as sanitizeTypingStatus, Xu as MAX_AVATAR_LENGTH, Yl as ownInviteRefusal, Yo as AWAITING_PEER_MS, Z as groupName, Zu as sanitizeAvatar, ad as toBase64Url, as as parseLocalTarget, bl as appRef, bo as appCardId, fl as isAppUrl, gi as APP_DATA_MAX_BYTES, id as randomBytes$1, ja as VOICE_METER, ju as normalizeRelayUrl, ka as PLAYABLE_AUDIO, lo as replySnippet, nr as GROUP_FILE_LIMITS, ql as inviteLink, qr as TYPING_KINDS, rs as GhostlyHttpError, sl as APP_PERMISSIONS, ss as LIMITS, vo as STATUS_CARD_LIMITS, xo as appCardUrl, zn as withoutVideoMetadata } from "./src-BIdfHB7t.js";
|
|
2
2
|
import { u as fileStore } from "./idb-BHsAqENE.js";
|
|
3
|
-
import { O as waitingGroupFile, T as removeStored, X as iceServerSetting, Y as iceServerProblem, i as groupOfFile, k as IDENTITY_DRAFT_TTL_MS, l as replyRef, n as groupFileId, v as paymentNetwork } from "./groupFiles-
|
|
3
|
+
import { O as waitingGroupFile, T as removeStored, X as iceServerSetting, Y as iceServerProblem, i as groupOfFile, k as IDENTITY_DRAFT_TTL_MS, l as replyRef, n as groupFileId, v as paymentNetwork } from "./groupFiles-BuToTMUk.js";
|
|
4
4
|
import { f as FILE_BYTES_STEP, o as fileBytes, s as fileBytesOf } from "./fileBytes-DjBYYyXT.js";
|
|
5
|
-
import { t as IDENTITY_PROVIDERS } from "./registry-
|
|
5
|
+
import { t as IDENTITY_PROVIDERS } from "./registry-CEjnubep.js";
|
|
6
6
|
import { n as secretWords, r as findSecret, t as guardText } from "./secretGuard-B7Hj0Kvz.js";
|
|
7
7
|
import { i as localFileError, r as asCliError, t as CliError } from "./errors-Dt-ZnyOX.js";
|
|
8
|
-
import { a as WALLET_TYPES, c as DESTRUCTIVE_CALLS, d as ENGINE_READS, f as READ_PARAMS, i as TRANSPORT_NAMES, l as ENGINE_METHODS, m as engineParamsProblem, n as CHAT_METHODS, r as PAY_METHODS, s as withStoredIds, t as ADDRESS_TYPES, u as ENGINE_PARAMS } from "./words-
|
|
9
|
-
import { C as str, S as state, T as waitForState, _ as node, a as cleanName, b as sentAt, c as findChatOrGroup, d as groupOf, f as groupPrefixed, h as messageOf, i as chatOrGroup, l as findGroup, m as list, n as bool, o as dhtOnly, p as inviteTaken, r as chatOf, s as findChat, u as findOwnNamedChat, v as num, w as transportOffered, y as oneOf } from "./apiKit-
|
|
8
|
+
import { a as WALLET_TYPES, c as DESTRUCTIVE_CALLS, d as ENGINE_READS, f as READ_PARAMS, i as TRANSPORT_NAMES, l as ENGINE_METHODS, m as engineParamsProblem, n as CHAT_METHODS, r as PAY_METHODS, s as withStoredIds, t as ADDRESS_TYPES, u as ENGINE_PARAMS } from "./words-Dk6o6wz4.js";
|
|
9
|
+
import { C as str, S as state, T as waitForState, _ as node, a as cleanName, b as sentAt, c as findChatOrGroup, d as groupOf, f as groupPrefixed, h as messageOf, i as chatOrGroup, l as findGroup, m as list, n as bool, o as dhtOnly, p as inviteTaken, r as chatOf, s as findChat, u as findOwnNamedChat, v as num, w as transportOffered, y as oneOf } from "./apiKit-BbNaxZGZ.js";
|
|
10
10
|
import { t as childEnv } from "./childEnv-BVOQK9EA.js";
|
|
11
|
-
import { a as checkShownName } from "./profiles-
|
|
12
|
-
import {
|
|
13
|
-
import { t as
|
|
14
|
-
import {
|
|
11
|
+
import { a as checkShownName } from "./profiles-aV9vaK0B.js";
|
|
12
|
+
import { t as chatState } from "./waitNotice-Ce3YCinu.js";
|
|
13
|
+
import { a as waitForConfirmed, c as waitForMessage, i as pressable, l as waitForRemoval, n as buttonsCard, o as waitForEdit, s as waitForGroupFrame, t as BUTTON_METHODS } from "./buttons-Do7dCku6.js";
|
|
14
|
+
import { t as BACKUP_METHODS } from "./backup-DyDsW7sC.js";
|
|
15
|
+
import { o as checkedBundle } from "./apps-BluQgEhv.js";
|
|
15
16
|
import { generateMnemonic } from "@scure/bip39";
|
|
16
17
|
import { wordlist } from "@scure/bip39/wordlists/english.js";
|
|
17
18
|
import { execFile, spawn } from "node:child_process";
|
|
@@ -1261,6 +1262,14 @@ var FILE_METHODS = {
|
|
|
1261
1262
|
target = `${stem} (${n})${ext}`;
|
|
1262
1263
|
}
|
|
1263
1264
|
const partial = join(dirname(target), `.ghostly-save-${process.pid}-${toBase64Url(randomBytes$1(6))}.partial`);
|
|
1265
|
+
const asked = (error, where) => {
|
|
1266
|
+
const failed = error;
|
|
1267
|
+
if (failed instanceof Error && failed.path === partial) {
|
|
1268
|
+
failed.path = where;
|
|
1269
|
+
failed.message = failed.message.replaceAll(partial, where);
|
|
1270
|
+
}
|
|
1271
|
+
return error;
|
|
1272
|
+
};
|
|
1264
1273
|
let out;
|
|
1265
1274
|
try {
|
|
1266
1275
|
out = await open(partial, "wx", 384);
|
|
@@ -1271,7 +1280,7 @@ var FILE_METHODS = {
|
|
|
1271
1280
|
if (!there) throw new CliError("not_found", `No such file or folder: ${folder}`);
|
|
1272
1281
|
if (!there.isDirectory()) throw new CliError("not_found", `${folder} is a file, not a folder`);
|
|
1273
1282
|
}
|
|
1274
|
-
throw error;
|
|
1283
|
+
throw asked(error, dirname(target));
|
|
1275
1284
|
}
|
|
1276
1285
|
let written = 0, complete = false;
|
|
1277
1286
|
try {
|
|
@@ -1304,6 +1313,8 @@ var FILE_METHODS = {
|
|
|
1304
1313
|
throw refused ?? error;
|
|
1305
1314
|
}
|
|
1306
1315
|
if (stored.direction !== "out") await markDownloaded(target);
|
|
1316
|
+
} catch (error) {
|
|
1317
|
+
throw asked(error, target);
|
|
1307
1318
|
} finally {
|
|
1308
1319
|
await out?.close();
|
|
1309
1320
|
await rm(partial, { force: true });
|
|
@@ -3911,7 +3922,8 @@ var CHAT_NAME_LENGTH = 48;
|
|
|
3911
3922
|
* A chat's name on this side (`chat rename`, an invite's `--label`), as the engine stores it (`cleanName`): a tab or a
|
|
3912
3923
|
* line break is a space, invisible characters go, and what is left is counted. Longer than the engine keeps whole is
|
|
3913
3924
|
* refused, not cut. An empty name (or spaces) is the documented one of `chat rename` (the contact's own name) and no
|
|
3914
|
-
* label for an invite; a name with nothing that shows is refused: given as is, the engine cleared the chat's name.
|
|
3925
|
+
* label for an invite; a name with nothing that shows is refused: given as is, the engine cleared the chat's name. A
|
|
3926
|
+
* name starting with `group:` is refused: `group:<ref>` names a group in every command (`groupPrefixed`).
|
|
3915
3927
|
*/
|
|
3916
3928
|
function chatName(params, name) {
|
|
3917
3929
|
const value = str(params, name);
|
|
@@ -3919,6 +3931,7 @@ function chatName(params, name) {
|
|
|
3919
3931
|
const clean = cleanName(value, CHAT_NAME_LENGTH);
|
|
3920
3932
|
if (clean === void 0) throw new CliError("bad_request", `A chat's name is up to ${CHAT_NAME_LENGTH} characters on one line`);
|
|
3921
3933
|
if (!clean) throw new CliError("bad_request", `A chat's name needs a character that shows (an empty name gives back the contact's own)`);
|
|
3934
|
+
if (groupPrefixed(clean) !== null) throw new CliError("bad_request", `A chat's name can't start with "group:": that names a group`);
|
|
3922
3935
|
return clean;
|
|
3923
3936
|
}
|
|
3924
3937
|
/** Code points before `index` (UTF-16) in `text`: mentions count code points (WISP 902 § Mentions). */
|
|
@@ -4004,6 +4017,17 @@ function showUntilPaired(ctx, linkId) {
|
|
|
4004
4017
|
});
|
|
4005
4018
|
inviteShown.set(ctx, stop);
|
|
4006
4019
|
}
|
|
4020
|
+
/**
|
|
4021
|
+
* `invite create`'s `reason` when no relay took the invite. The engine's words ("Publish failed on every relay: Error:
|
|
4022
|
+
* http://… did not answer a moment ago; retry shortly; Error: …") read as the CLI failing, a class name per relay, beside
|
|
4023
|
+
* a `note` that says the invite is good: the relays are named, and nothing is asked of whoever reads it.
|
|
4024
|
+
*/
|
|
4025
|
+
function inviteNotOut(detail) {
|
|
4026
|
+
if (!detail.startsWith("Publish failed on every relay:")) return detail;
|
|
4027
|
+
const hosts = [...new Set([...detail.matchAll(/\bhttps?:\/\/[^\s;,]+/g)].map(([url]) => URL.canParse(url) ? new URL(url).host : url))];
|
|
4028
|
+
const named = hosts.length ? ` (${hosts.join(", ")})` : "";
|
|
4029
|
+
return `${/ responded \d{3}\b/.test(detail) ? "No relay took the invite" : "No relay answered"}${named}: it goes out once one does`;
|
|
4030
|
+
}
|
|
4007
4031
|
/** V8's words for reading what a value does not have: an `engine.call` given a parameter of the wrong kind. */
|
|
4008
4032
|
var BAD_VALUE = /^Cannot (destructure|read properties of (undefined|null))|is not (a function|iterable)/;
|
|
4009
4033
|
var METHODS = {
|
|
@@ -4126,7 +4150,7 @@ var METHODS = {
|
|
|
4126
4150
|
return {
|
|
4127
4151
|
...answer,
|
|
4128
4152
|
...waitUntil !== void 0 && { retryInMs: Math.max(0, waitUntil - Date.now()) },
|
|
4129
|
-
...progress?.detail && { reason: progress.detail },
|
|
4153
|
+
...progress?.detail && { reason: inviteNotOut(progress.detail) },
|
|
4130
4154
|
note: "The invite is good: it goes out by itself once a relay answers, while a daemon runs for this profile"
|
|
4131
4155
|
};
|
|
4132
4156
|
},
|
|
@@ -4608,8 +4632,8 @@ var METHODS = {
|
|
|
4608
4632
|
return chatJson(await waitForState(ctx, (s) => {
|
|
4609
4633
|
const now = s.links.find((l) => l.id === link.id);
|
|
4610
4634
|
if (!now) throw new CliError("not_found", `Chat ${link.id} was removed`);
|
|
4611
|
-
return (until === "live" ? isLive(now) : until === "text" ? now.textDelivery === "stream" || now.textDelivery === "dht" || now.textDelivery === "hold" : !!now.pairingProgress?.peerSeen || now.pairing?.status === "ready" || isLive(now)) ? now : void 0;
|
|
4612
|
-
}, ms, `chat ${link.id}
|
|
4635
|
+
return (until === "live" ? isLive(now) : until === "text" ? now.textDelivery === "stream" || now.textDelivery === "dht" || now.textDelivery === "hold" : !!now.peerParticipationKey || !!now.pairingProgress?.peerSeen || now.pairing?.status === "ready" || isLive(now)) ? now : void 0;
|
|
4636
|
+
}, ms, `chat ${link.id} ${chatState(until).to}`));
|
|
4613
4637
|
},
|
|
4614
4638
|
async "group.create"(ctx, params) {
|
|
4615
4639
|
const clean = cleanName(str(params, "name", true), 64);
|
|
@@ -5058,8 +5082,9 @@ async function saveMark(ctx, params, remove) {
|
|
|
5058
5082
|
messageId,
|
|
5059
5083
|
remove
|
|
5060
5084
|
});
|
|
5061
|
-
|
|
5062
|
-
if (result.error
|
|
5085
|
+
const where = target.group ? "group" : "chat";
|
|
5086
|
+
if (result.error && /not in this chat/.test(result.error)) throw new CliError("not_found", remove ? `No saved message ${JSON.stringify(messageId)} in this ${where} (ghostly saved list shows the saved ones)` : `No message ${JSON.stringify(messageId)} in this ${where}`);
|
|
5087
|
+
if (result.error) throw new CliError("bad_request", result.error);
|
|
5063
5088
|
return {
|
|
5064
5089
|
[target.group ? "group" : "chat"]: target.id,
|
|
5065
5090
|
messageId,
|
|
@@ -5151,4 +5176,4 @@ async function callApi(ctx, method, params = {}) {
|
|
|
5151
5176
|
//#endregion
|
|
5152
5177
|
export { flushCardUpdates as _, hideStateSecrets as a, paymentJson as c, nodeLocalFetch as d, chatJson as f, resumeHolds as g, groupMessageJson as h, groupSendRefused as i, reportAppFrames as l, groupJson as m, SETTABLE as n, mentionsFor as o, chatMessageJson as p, callApi as r, redactSettings as s, API_METHODS as t, servedApps as u };
|
|
5153
5178
|
|
|
5154
|
-
//# sourceMappingURL=api-
|
|
5179
|
+
//# sourceMappingURL=api-C4MLg5Rs.js.map
|