diff --git a/tools/cropper.js b/tools/cropper.js index 8bca1b4..61d1cd2 100644 --- a/tools/cropper.js +++ b/tools/cropper.js @@ -12,7 +12,17 @@ import { stripPhonePrefix, cropPermission } from './permit.js'; const require = createRequire(import.meta.url); const QUEUE_NAME = 'id-images'; -/** Queue domains that differ from their a2loft code (legacy bot behaviour). */ +/** + * Queue domains that differ from their a2loft identity code. + * + * A queue item's `domain` comes from the Telegram intake: the operator tags a + * photo (e.g. `#core`) and the bot stores that label verbatim, then translated + * it before every a2loft call. a2loft has no `core` domain — `GET + * {a2loft}/identity/core/units` answers "Invalid domain code specified." while + * `uc` is valid — so the label must be mapped before the save is forwarded. + * (The proper fix is on the intake side: enqueue the a2loft code, or register + * `core` upstream; until then this keeps existing queue data working.) + */ const DOMAIN_ALIASES = { core: 'uc' }; const BUCKET = 'files'; const REMOVEBG_URL = 'https://removebg.itcass.net/api/removebg';