diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md index 67cd6d2..00f02f1 100644 --- a/THIRD_PARTY_NOTICES.md +++ b/THIRD_PARTY_NOTICES.md @@ -6,10 +6,40 @@ The DingTalk device-authorization request sequence and AI Card streaming protoco The WeCom QR-authorization request sequence is adapted from the official [`@wecom/wecom-openclaw-cli`](https://www.npmjs.com/package/@wecom/wecom-openclaw-cli) 1.1.0 package, whose npm metadata declares the ISC License. No CLI source or OpenClaw runtime is bundled in this package. -This package depends on [`@larksuiteoapi/node-sdk`](https://github.com/larksuite/node-sdk) 1.73.0, [`dingtalk-stream`](https://github.com/open-dingtalk/dingtalk-stream-sdk-nodejs) 2.1.4, [`@wecom/aibot-node-sdk`](https://github.com/WecomTeam/aibot-node-sdk) 1.0.7, [`@tencent-connect/qqbot-nodejs`](https://github.com/tencent-connect/qqbot) 1.0.4, and [`qrcode`](https://github.com/soldair/node-qrcode) 1.5.4. These packages are licensed under the MIT License; `dingtalk-stream` is copyright 2023 钉钉开放平台团队. +The Host bundle includes [`@larksuiteoapi/node-sdk`](https://github.com/larksuite/node-sdk) 1.73.0 and its [`protobufjs`](https://github.com/protobufjs/protobuf.js) 7.6.5 runtime. The Lark SDK is licensed under the MIT License. protobufjs is licensed under the BSD 3-Clause License; both license texts are reproduced below. + +This package depends at runtime on [`dingtalk-stream`](https://github.com/open-dingtalk/dingtalk-stream-sdk-nodejs) 2.1.4, [`@wecom/aibot-node-sdk`](https://github.com/WecomTeam/aibot-node-sdk) 1.0.7, [`@tencent-connect/qqbot-nodejs`](https://github.com/tencent-connect/qqbot) 1.0.4, and [`qrcode`](https://github.com/soldair/node-qrcode) 1.5.4. These packages are licensed under the MIT License; `dingtalk-stream` is copyright 2023 钉钉开放平台团队. QQ QR binding uses Tencent Connect's official [`@tencent-connect/qqbot-connector`](https://www.npmjs.com/package/@tencent-connect/qqbot-connector) 1.2.0 package as an external runtime dependency. Its npm metadata declares `UNLICENSED`; no connector source is copied into this project. This project is an independent DeepSeek Harness integration. It does not bundle OpenClaw and is not endorsed by Tencent, WeCom, Feishu, DingTalk, QQ, Telegram, or Discord. The WeChat, QQ, Telegram, and Discord marks use path data published by Simple Icons under the CC0 1.0 Universal license. The Feishu, DingTalk, and WeCom marks are inline vectors used for channel identification. Product names and logos remain trademarks of their respective owners. + +## Lark Node SDK license + +MIT License + +Copyright (c) 2022 Lark Technologies Pte. Ltd. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +## protobufjs license + +This license applies to all parts of protobuf.js except those files either explicitly including or referencing a different license or located in a directory containing a different LICENSE file. + +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +- Neither the name of its author, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Code generated by the command line utilities is owned by the owner of the input file used when generating it. This code is not standalone and requires a support library to be linked with it. This support library is itself covered by the above license. diff --git a/lib/index.js b/lib/index.js index c4c2abf..0abfd45 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,13339 +1,185 @@ -// plugin-src/host/channels/dingtalk/production.mjs -import { unlink as unlink3 } from "node:fs/promises"; -import { homedir } from "node:os"; -import { join, resolve } from "node:path"; - -// src/channels/dingtalk/config-store.mjs -import { createHash, randomUUID } from "node:crypto"; -import { mkdir, readFile, rename, unlink, writeFile } from "node:fs/promises"; -import { dirname } from "node:path"; -var EMPTY_DOCUMENT = Object.freeze({ version: 1, bots: Object.freeze([]) }); -var STORED_BOT_KEYS = /* @__PURE__ */ new Set(["clientId", "secretRef", "approvedSenders"]); -function cleanString(value) { - return typeof value === "string" && value.trim() ? value.trim() : null; -} -function digest(value) { - return createHash("sha256").update(value).digest("hex"); -} -function safeBotId(value) { - const id = cleanString(value); - return id && /^dt_[a-f0-9]{24}$/.test(id) ? id : null; -} -function safeSecretRef(value) { - const ref = cleanString(value); - return ref && /^DSH_DINGTALK_BOT_SECRET_[A-F0-9]{24}$/.test(ref) ? ref : null; -} -function safeSenderKey(value) { - const key = cleanString(value); - return key && /^dt_sender_[a-f0-9]{32}$/.test(key) ? key : null; -} -function normalizeApprovedSender(value) { - const record = typeof value === "string" ? { staffId: value } : value; - if (!record || typeof record !== "object" || Array.isArray(record)) return null; - const senderKey = safeSenderKey(record.senderKey); - const staffId = cleanString(record.staffId); - if (!senderKey || !staffId) return null; - return Object.freeze({ - senderKey, - staffId, - displayName: cleanString(record.displayName), - approvedAt: cleanString(record.approvedAt) - }); -} -function normalizeApprovedSenders(value) { - if (!Array.isArray(value)) return null; - const senders = value.map(normalizeApprovedSender); - if (senders.some((sender) => sender === null)) return null; - const ids = /* @__PURE__ */ new Set(); - const keys = /* @__PURE__ */ new Set(); - for (const sender of senders) { - if (ids.has(sender.staffId) || keys.has(sender.senderKey)) return null; - ids.add(sender.staffId); - keys.add(sender.senderKey); - } - return Object.freeze(senders); -} -function deriveDingtalkBotIdentity(clientId) { - const value = cleanString(clientId); - if (!value) throw new TypeError("clientId is required"); - const valueDigest = digest(value).slice(0, 24); - return Object.freeze({ - botId: `dt_${valueDigest}`, - secretRef: `DSH_DINGTALK_BOT_SECRET_${valueDigest.toUpperCase()}` - }); -} -function deriveDingtalkSenderKey() { - return `dt_sender_${randomUUID().replaceAll("-", "")}`; -} -function maskDingtalkSenderId(staffId) { - const value = cleanString(staffId); - if (!value) return "\u9489\u9489\u7528\u6237"; - return "\u8EAB\u4EFD\u5DF2\u9690\u85CF"; -} -function maskDingtalkClientId(clientId) { - const value = cleanString(clientId); - if (!value) return "\u9489\u9489\u673A\u5668\u4EBA"; - if (value.length <= 8) return `${value.slice(0, 2)}\u2022\u2022\u2022\u2022`; - return `${value.slice(0, 4)}\u2022\u2022\u2022\u2022${value.slice(-4)}`; -} -function normalizeBot(value, { stored = false } = {}) { - if (!value || typeof value !== "object" || Array.isArray(value)) return null; - if ("clientSecret" in value || "client_secret" in value || "deviceCode" in value) return null; - if (stored && Object.keys(value).some((key) => !STORED_BOT_KEYS.has(key))) return null; - const clientId = cleanString(value.clientId); - const secretRef = safeSecretRef(value.secretRef); - const approvedSenders = normalizeApprovedSenders(value.approvedSenders ?? []); - if (!clientId || !secretRef || !approvedSenders) return null; - const identity = deriveDingtalkBotIdentity(clientId); - if (identity.secretRef !== secretRef) return null; - const suppliedBotId = value.botId === void 0 ? identity.botId : safeBotId(value.botId); - if (suppliedBotId !== identity.botId) return null; - return Object.freeze({ - botId: identity.botId, - clientId, - secretRef, - approvedSenders - }); -} -function normalizeDocument(value) { - if (!value || value.version !== 1 || !Array.isArray(value.bots)) return null; - const bots = value.bots.map((bot) => normalizeBot(bot, { stored: true })); - if (bots.some((bot) => bot === null)) return null; - const botIds = /* @__PURE__ */ new Set(); - const clientIds = /* @__PURE__ */ new Set(); - const secretRefs = /* @__PURE__ */ new Set(); - for (const bot of bots) { - if (botIds.has(bot.botId) || clientIds.has(bot.clientId) || secretRefs.has(bot.secretRef)) { - return null; - } - botIds.add(bot.botId); - clientIds.add(bot.clientId); - secretRefs.add(bot.secretRef); - } - return Object.freeze({ version: 1, bots: Object.freeze(bots) }); -} -function storedDocument(document) { - return { - version: 1, - bots: document.bots.map((bot) => ({ - clientId: bot.clientId, - secretRef: bot.secretRef, - approvedSenders: bot.approvedSenders.map((sender) => ({ - senderKey: sender.senderKey, - staffId: sender.staffId, - displayName: sender.displayName, - approvedAt: sender.approvedAt - })) - })) - }; -} -var DingtalkConfigStore = class { - #path; - #value = EMPTY_DOCUMENT; - #writeQueue = Promise.resolve(); - /** @param {string} path Absolute or process-relative configuration file path. */ - constructor(path) { - if (!cleanString(path)) throw new TypeError("config path is required"); - this.#path = path; - } - /** @returns {Promise} Loaded store. */ - async load() { - try { - const normalized = normalizeDocument(JSON.parse(await readFile(this.#path, "utf8"))); - if (!normalized) throw new Error("dsh-dingtalk config contains invalid bot data"); - this.#value = normalized; - } catch (error) { - if (error?.code !== "ENOENT") throw error; - this.#value = EMPTY_DOCUMENT; - } - return this; - } - /** @returns {Array} Cloned bot configurations with derived bot IDs. */ - list() { - return structuredClone(this.#value.bots); - } - /** @param {string} botId Derived bot ID. @returns {object|null} Bot configuration. */ - get(botId) { - const found = this.#value.bots.find((bot) => bot.botId === botId); - return found ? structuredClone(found) : null; - } - /** @param {string} clientId DingTalk client ID. @returns {object|null} Bot configuration. */ - getByClientId(clientId) { - const found = this.#value.bots.find((bot) => bot.clientId === clientId); - return found ? structuredClone(found) : null; - } - /** @param {object} value Bot configuration without a client secret. @returns {Promise} Saved config. */ - async save(value) { - const normalized = normalizeBot(value); - if (!normalized) throw new Error("Refusing to persist invalid dsh-dingtalk bot data"); - return this.#mutate((bots) => { - const collision = bots.find( - (bot) => (bot.clientId === normalized.clientId || bot.secretRef === normalized.secretRef) && bot.botId !== normalized.botId - ); - if (collision) throw new Error("Duplicate DingTalk bot identity"); - const index = bots.findIndex((bot) => bot.botId === normalized.botId); - if (index === -1) bots.push(normalized); - else bots[index] = normalized; - return structuredClone(normalized); - }); - } - /** @param {string} botId Derived bot ID. @returns {Promise} Removed config. */ - async remove(botId) { - if (!safeBotId(botId)) throw new TypeError("Invalid DingTalk bot id"); - return this.#mutate((bots) => { - const index = bots.findIndex((bot) => bot.botId === botId); - if (index === -1) return null; - const [removed] = bots.splice(index, 1); - return structuredClone(removed); - }); - } - /** Removes the configuration file and resets the in-memory store. */ - async clear() { - const operation = this.#writeQueue.then(async () => { - try { - await unlink(this.#path); - } catch (error) { - if (error?.code !== "ENOENT") throw error; - } - this.#value = EMPTY_DOCUMENT; - }); - this.#writeQueue = operation.then(() => void 0, () => void 0); - await operation; - } - async #mutate(mutator) { - let result; - const operation = this.#writeQueue.then(async () => { - const bots = [...this.#value.bots]; - result = mutator(bots); - const document = Object.freeze({ version: 1, bots: Object.freeze(bots) }); - await this.#write(document); - this.#value = document; - }); - this.#writeQueue = operation.then(() => void 0, () => void 0); - await operation; - return result; - } - async #write(document) { - await mkdir(dirname(this.#path), { recursive: true, mode: 448 }); - const temporary = `${this.#path}.${process.pid}.${randomUUID()}.tmp`; - try { - await writeFile(temporary, `${JSON.stringify(storedDocument(document), null, 2)} -`, { - encoding: "utf8", - flag: "wx", - mode: 384 - }); - await rename(temporary, this.#path); - } catch (error) { - try { - await unlink(temporary); - } catch (cleanupError) { - if (cleanupError?.code !== "ENOENT") throw new AggregateError([error, cleanupError]); - } - throw error; - } - } -}; - -// src/channels/dingtalk/device-auth.mjs -var DEFAULT_REGISTRATION_BASE_URL = "https://oapi.dingtalk.com"; -var REGISTRATION_SOURCE = "DING_DWS_CLAW"; -function cleanString2(value) { - return typeof value === "string" && value.trim() ? value.trim() : null; -} -function positiveNumber(value, fallback) { - const number = Number(value); - return Number.isFinite(number) && number > 0 ? number : fallback; -} -function normalizeBaseUrl(value) { - let url; - try { - url = new URL(cleanString2(value) ?? DEFAULT_REGISTRATION_BASE_URL); - } catch { - throw new TypeError("DingTalk registration base URL must be a valid HTTPS URL"); - } - const isDingtalkHost2 = url.hostname === "dingtalk.com" || url.hostname.endsWith(".dingtalk.com"); - if (url.protocol !== "https:" || url.port || !isDingtalkHost2 || url.username || url.password || url.search || url.hash) { - throw new TypeError("DingTalk registration base URL must be a valid HTTPS URL"); - } - url.pathname = url.pathname.replace(/\/+$/, ""); - return url.href.replace(/\/$/, ""); -} -function readNow(clock) { - const value = typeof clock?.now === "function" ? clock.now() : clock(); - if (!Number.isFinite(value)) throw new TypeError("clock must return a finite timestamp"); - return value; -} -function assertRecord(value, action) { - if (!value || typeof value !== "object" || Array.isArray(value)) { - throw new DingtalkDeviceAuthError( - "invalid-response", - `DingTalk ${action} returned an invalid response`, - action - ); - } - if (Number(value.errcode) !== 0) { - throw new DingtalkDeviceAuthError( - "api-error", - `DingTalk ${action} request was rejected`, - action - ); - } - return value; -} -var DingtalkDeviceAuthError = class extends Error { - /** - * @param {string} code Stable failure code. - * @param {string} message Safe diagnostic that does not include response credentials. - * @param {string} action Registration stage that failed. - * @param {{cause?: unknown}} [options] Optional underlying error. - */ - constructor(code, message, action, options = {}) { - super(message, options); - this.name = "DingtalkDeviceAuthError"; - this.code = code; - this.action = action; - } -}; -var DingtalkDeviceAuth = class { - #fetch; - #clock; - #baseUrl; - #timeoutMs; - /** - * @param {{fetch?: typeof globalThis.fetch, clock?: {now(): number}|(()=>number), baseUrl?: string, timeoutMs?: number}} [options] - * Device-registration dependencies. - */ - constructor({ - fetch: fetch2 = globalThis.fetch, - clock = Date, - baseUrl = DEFAULT_REGISTRATION_BASE_URL, - timeoutMs = 15e3 - } = {}) { - if (typeof fetch2 !== "function") throw new TypeError("fetch is required"); - if (typeof clock !== "function" && typeof clock?.now !== "function") { - throw new TypeError("clock must be a function or expose now()"); - } - if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) { - throw new TypeError("timeoutMs must be a positive number"); - } - this.#fetch = fetch2; - this.#clock = clock; - this.#baseUrl = normalizeBaseUrl(baseUrl); - this.#timeoutMs = timeoutMs; - } - /** - * Starts a QR registration and returns the host-only device code with QR metadata. - * @param {{signal?: AbortSignal}} [options] Optional cancellation signal. - * @returns {Promise} Device registration details. - */ - async start({ signal } = {}) { - const initialized = await this.#post( - "/app/registration/init", - { source: REGISTRATION_SOURCE }, - "initialization", - signal - ); - const nonce = cleanString2(initialized.nonce); - if (!nonce) { - throw new DingtalkDeviceAuthError( - "missing-nonce", - "DingTalk registration initialization did not return a nonce", - "initialization" - ); - } - const begun = await this.#post( - "/app/registration/begin", - { nonce }, - "begin", - signal - ); - const deviceCode = cleanString2(begun.device_code); - const verificationUrl = cleanString2(begun.verification_uri_complete); - if (!deviceCode || !verificationUrl) { - throw new DingtalkDeviceAuthError( - "incomplete-registration", - "DingTalk registration did not return complete QR metadata", - "begin" - ); - } - const expiresInSeconds = positiveNumber(begun.expires_in, 7200); - const pollIntervalMs = positiveNumber(begun.interval, 5) * 1e3; - return Object.freeze({ - deviceCode, - verificationUrl, - verificationUri: cleanString2(begun.verification_uri), - userCode: cleanString2(begun.user_code), - expiresAt: readNow(this.#clock) + expiresInSeconds * 1e3, - pollIntervalMs - }); - } - /** - * Polls one registration attempt. - * @param {{deviceCode: string, signal?: AbortSignal}|string} request Host-only device code. - * @returns {Promise} Normalized registration state and credentials on success. - */ - async poll(request) { - const deviceCode = cleanString2(typeof request === "string" ? request : request?.deviceCode); - const signal = typeof request === "object" ? request?.signal : void 0; - if (!deviceCode) throw new TypeError("deviceCode is required"); - const response = await this.#post( - "/app/registration/poll", - { device_code: deviceCode }, - "poll", - signal - ); - const rawStatus = cleanString2(response.status)?.toUpperCase(); - const status = ["WAITING", "SUCCESS", "FAIL", "EXPIRED"].includes(rawStatus) ? rawStatus : "UNKNOWN"; - return Object.freeze({ - status, - clientId: cleanString2(response.client_id), - clientSecret: cleanString2(response.client_secret), - failReason: cleanString2(response.fail_reason) - }); - } - async #post(path, body, action, signal) { - let response; - const timeoutSignal = AbortSignal.timeout(this.#timeoutMs); - const requestSignal3 = signal ? AbortSignal.any([signal, timeoutSignal]) : timeoutSignal; - try { - response = await this.#fetch(`${this.#baseUrl}${path}`, { - method: "POST", - headers: { - accept: "application/json", - "content-type": "application/json" - }, - body: JSON.stringify(body), - redirect: "error", - signal: requestSignal3 - }); - } catch (error) { - if (signal?.aborted) throw signal.reason ?? error; - if (timeoutSignal.aborted) { - throw new DingtalkDeviceAuthError( - "timeout", - `DingTalk ${action} request timed out`, - action, - { cause: error } - ); - } - if (error?.name === "AbortError") throw error; - throw new DingtalkDeviceAuthError( - "network-error", - `DingTalk ${action} request could not be completed`, - action, - { cause: error } - ); - } - if (!response || response.ok === false || typeof response.json !== "function") { - throw new DingtalkDeviceAuthError( - "http-error", - `DingTalk ${action} request failed`, - action - ); - } - let value; - try { - value = await response.json(); - } catch (error) { - throw new DingtalkDeviceAuthError( - "invalid-json", - `DingTalk ${action} returned invalid JSON`, - action, - { cause: error } - ); - } - return assertRecord(value, action); - } -}; - -// src/channels/dingtalk/dingtalk-controller.mjs -import { randomUUID as randomUUID2 } from "node:crypto"; -var ACTIVE_ATTEMPT_STATES = /* @__PURE__ */ new Set(["starting", "pending", "connecting"]); -var TERMINAL_ATTEMPT_STATES = /* @__PURE__ */ new Set(["connected", "expired", "failed", "cancelled"]); -function cleanString3(value) { - return typeof value === "string" && value.trim() ? value.trim() : null; -} -function safeError(code, message) { - return Object.freeze({ code, message }); -} -function nowFrom(clock) { - return typeof clock?.now === "function" ? clock.now() : clock(); -} -function isoNow(clock) { - return new Date(nowFrom(clock)).toISOString(); -} -function abortError() { - return new DOMException("DingTalk provisioning was cancelled", "AbortError"); -} -function publicAttempt(record) { - if (!record) return null; - return { - attemptId: record.id, - status: record.state, - ...record.verificationUrl ? { verificationUrl: record.verificationUrl } : {}, - ...record.expiresAt ? { expiresAt: record.expiresAt } : {}, - ...record.pollIntervalMs ? { pollIntervalMs: record.pollIntervalMs } : {}, - ...record.botId ? { botId: record.botId } : {}, - ...record.alreadyConnected ? { alreadyConnected: true } : {}, - ...record.error ? { error: structuredClone(record.error) } : {} - }; -} -function runtimeStatus(runtime) { - if (!runtime) return {}; - const value = typeof runtime.status === "function" ? runtime.status() : runtime.status; - return value && typeof value === "object" && !Array.isArray(value) ? value : {}; -} -function isRuntimeConnected(runtime, status) { - if (!runtime) return false; - if (status.connected === false || status.ready === false) return false; - const state = cleanString3( - status.dingtalkStreamState ?? status.dingtalkConnectionState ?? status.connectionState ?? status.state - )?.toLowerCase(); - if (["failed", "error", "offline", "disconnected", "stopped"].includes(state)) return false; - return status.connected === true || status.ready === true || state === "connected" || state === "ready"; -} -function normalizePendingSender(value) { - if (!value || typeof value !== "object" || Array.isArray(value)) return null; - const staffId = cleanString3(value.staffId ?? value.senderStaffId ?? value.senderId); - if (!staffId) return null; - const suppliedRequestId = cleanString3(value.requestId); - const opaqueRequestId = suppliedRequestId && /^ding_sender_[A-Za-z0-9_-]{1,100}$/.test(suppliedRequestId) && !suppliedRequestId.includes(staffId) ? suppliedRequestId : null; - if (!opaqueRequestId) return null; - return { - requestId: opaqueRequestId, - staffId, - displayName: cleanString3(value.displayName ?? value.senderName ?? value.senderNick) ?? "\u9489\u9489\u7528\u6237", - requestedAt: cleanString3(value.requestedAt) - }; -} -function internalPendingSenders(status) { - if (!Array.isArray(status.pendingSenders)) return []; - const seen = /* @__PURE__ */ new Set(); - const senders = []; - for (const value of status.pendingSenders) { - const sender = normalizePendingSender(value); - if (!sender || seen.has(sender.staffId)) continue; - seen.add(sender.staffId); - senders.push(sender); - } - return senders; -} -function publicPendingSender(sender) { - return { - requestId: sender.requestId, - displayName: sender.displayName, - senderIdMasked: maskDingtalkSenderId(sender.staffId), - requestedAt: sender.requestedAt - }; -} -function publicApprovedSender(sender) { - return { - senderKey: sender.senderKey, - displayName: cleanString3(sender.displayName) ?? "\u9489\u9489\u7528\u6237", - senderIdMasked: maskDingtalkSenderId(sender.staffId), - approvedAt: cleanString3(sender.approvedAt) - }; -} -var DingtalkController = class { - #deviceAuth; - #credentials; - #configStore; - #createRuntime; - #deleteState; - #logger; - #clock; - #runtimes = /* @__PURE__ */ new Map(); - #errors = /* @__PURE__ */ new Map(); - #attempts = /* @__PURE__ */ new Map(); - #activeAttemptId = null; - #transitions = /* @__PURE__ */ new Map(); - #revision = 0; - #closed = false; - /** - * @param {object} options Controller dependencies. - * @param {object} options.deviceAuth Host-only DingTalk device auth client. - * @param {object} options.credentials DSH credential provider. - * @param {object} options.configStore Loaded DingTalk config store. - * @param {Function} options.createRuntime Runtime factory. - * @param {Function} [options.deleteState] Per-bot state cleanup callback. - * @param {Console} [options.logger] Host logger. - * @param {{now(): number}|(()=>number)} [options.clock] Injectable clock. - */ - constructor({ - deviceAuth, - credentials, - configStore, - createRuntime, - deleteState = async () => { - }, - logger = console, - clock = Date - }) { - if (!deviceAuth || typeof deviceAuth.start !== "function" || typeof deviceAuth.poll !== "function") { - throw new TypeError("DingtalkController requires a DingTalk device auth client"); - } - if (!credentials || typeof credentials.resolve !== "function" || typeof credentials.set !== "function" || typeof credentials.unset !== "function") { - throw new TypeError("DingtalkController requires the DSH credential provider"); - } - if (!configStore || typeof configStore.list !== "function" || typeof configStore.get !== "function" || typeof configStore.getByClientId !== "function" || typeof configStore.save !== "function" || typeof configStore.remove !== "function") { - throw new TypeError("DingtalkController requires a loaded config store"); - } - if (typeof createRuntime !== "function") throw new TypeError("createRuntime is required"); - if (typeof deleteState !== "function") throw new TypeError("deleteState must be a function"); - if (typeof clock !== "function" && typeof clock?.now !== "function") { - throw new TypeError("clock must be a function or expose now()"); - } - this.#deviceAuth = deviceAuth; - this.#credentials = credentials; - this.#configStore = configStore; - this.#createRuntime = createRuntime; - this.#deleteState = deleteState; - this.#logger = logger; - this.#clock = clock; - } - /** Starts all configured DingTalk runtimes whose secrets are available. */ - async initialize() { - if (this.#closed) return this.status(); - for (const config of this.#configStore.list()) { - const current = this.#runtimes.get(config.botId); - try { - if (isRuntimeConnected(current, runtimeStatus(current))) continue; - } catch { - } - await this.#withBotTransition(config.botId, async () => { - const latest = this.#configStore.get(config.botId); - if (!latest || this.#closed) return; - const clientSecret = await this.#resolveSecret(latest.secretRef); - if (!clientSecret) { - this.#errors.set( - latest.botId, - safeError("missing-secret", "\u9489\u9489\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002") - ); - this.#touch(); - return; - } - try { - await this.#startRuntime(latest, clientSecret); - this.#errors.delete(latest.botId); - } catch { - this.#errors.set( - latest.botId, - safeError("connection-failed", "\u9489\u9489\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002") - ); - this.#logger.warn?.(`[dsh-dingtalk] bot ${latest.botId} failed to initialize`); - } - this.#touch(); - }); - } - return this.status(); - } - /** Starts one DingTalk QR registration, cancelling any prior active attempt. */ - async startProvisioning({ signal } = {}) { - if (this.#closed) throw new Error("dsh-dingtalk controller is closed"); - if (this.#activeAttemptId) await this.cancelProvisioning(this.#activeAttemptId); - const record = { - id: randomUUID2(), - state: "starting", - controller: new AbortController(), - deviceCode: null, - verificationUrl: null, - expiresAt: null, - pollIntervalMs: null, - pollTask: null, - botId: null, - alreadyConnected: false, - error: null - }; - this.#attempts.set(record.id, record); - this.#activeAttemptId = record.id; - this.#touch(); - const abortFromRequest = () => record.controller.abort(signal?.reason); - if (signal?.aborted) abortFromRequest(); - else signal?.addEventListener("abort", abortFromRequest, { once: true }); - try { - const begun = await this.#deviceAuth.start({ signal: record.controller.signal }); - this.#assertAttemptActive(record); - record.deviceCode = cleanString3(begun.deviceCode); - record.verificationUrl = cleanString3(begun.verificationUrl); - record.expiresAt = Number(begun.expiresAt); - record.pollIntervalMs = Number(begun.pollIntervalMs); - if (!record.deviceCode || !record.verificationUrl || !Number.isFinite(record.expiresAt) || !Number.isFinite(record.pollIntervalMs) || record.pollIntervalMs <= 0) { - throw new Error("DingTalk device auth returned incomplete registration metadata"); - } - record.state = "pending"; - this.#touch(); - return publicAttempt(record); - } catch (error) { - if (record.controller.signal.aborted || error?.name === "AbortError") { - record.state = "cancelled"; - record.error = safeError("cancelled", "\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"); - } else { - record.state = "failed"; - record.error = safeError("qr-start-failed", "\u65E0\u6CD5\u751F\u6210\u9489\u9489\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"); - } - if (this.#activeAttemptId === record.id) this.#activeAttemptId = null; - this.#touch(); - if (record.state === "failed") throw error; - return publicAttempt(record); - } finally { - signal?.removeEventListener("abort", abortFromRequest); - } - } - /** Binds one DingTalk application with an existing Client ID and Client Secret. */ - async bindCredentials({ clientId, clientSecret } = {}) { - if (this.#closed) throw new Error("dsh-dingtalk controller is closed"); - const normalizedClientId = cleanString3(clientId); - const normalizedSecret = cleanString3(clientSecret); - if (!normalizedClientId || !normalizedSecret) { - throw new TypeError("DingTalk Client ID and Client Secret are required"); - } - if (this.#activeAttemptId) await this.cancelProvisioning(this.#activeAttemptId); - if (this.#closed) throw new Error("dsh-dingtalk controller is closed"); - const identity = deriveDingtalkBotIdentity(normalizedClientId); - await this.#withBotTransition(identity.botId, async () => { - if (this.#closed) throw abortError(); - const previousConfig = this.#configStore.getByClientId(normalizedClientId); - const previousSecret = await this.#credentials.resolve(identity.secretRef).catch(() => void 0); - if (this.#closed) throw abortError(); - const config = { - botId: identity.botId, - clientId: normalizedClientId, - secretRef: identity.secretRef, - approvedSenders: previousConfig?.approvedSenders ?? [] - }; - await this.#credentials.set(identity.secretRef, normalizedSecret); - try { - await this.#configStore.save(config); - } catch (error) { - await this.#restoreCredential(identity.secretRef, previousSecret); - throw error; - } - try { - await this.#startRuntime(config, normalizedSecret); - this.#errors.delete(identity.botId); - } catch { - this.#errors.set( - identity.botId, - safeError("connection-failed", "\u9489\u9489\u5DF2\u63A5\u5165\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002") - ); - this.#logger.warn?.("[dsh-dingtalk] credential-bound bot saved but its connection is not ready"); - } - this.#touch(); - }); - return this.status(); - } - /** Polls one QR registration without exposing its device code or returned secret. */ - async registrationStatus(attemptId) { - const record = this.#attempts.get(attemptId); - if (!record) return null; - if (TERMINAL_ATTEMPT_STATES.has(record.state) || record.state === "starting") { - return publicAttempt(record); - } - if (nowFrom(this.#clock) >= record.expiresAt) { - record.state = "expired"; - record.error = safeError("expired", "\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002"); - if (this.#activeAttemptId === record.id) this.#activeAttemptId = null; - this.#touch(); - return publicAttempt(record); - } - if (!record.pollTask) { - const task = this.#pollRegistration(record).finally(() => { - if (record.pollTask === task) record.pollTask = null; - }); - record.pollTask = task; - } - await record.pollTask; - return publicAttempt(record); - } - /** Cancels an active QR registration. */ - async cancelProvisioning(attemptId) { - const record = this.#attempts.get(attemptId); - if (!record) return null; - if (!TERMINAL_ATTEMPT_STATES.has(record.state)) { - record.controller.abort(); - await record.pollTask?.catch(() => void 0); - if (!TERMINAL_ATTEMPT_STATES.has(record.state)) record.state = "cancelled"; - record.error ??= safeError("cancelled", "\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"); - } - if (this.#activeAttemptId === record.id) this.#activeAttemptId = null; - this.#touch(); - return publicAttempt(record); - } - /** Replaces one bot runtime using its stored credential. */ - async reconnectBot(botId) { - const config = this.#configStore.get(botId); - if (!config) throw new Error("Unknown DingTalk bot"); - await this.#withBotTransition(botId, async () => { - const clientSecret = await this.#resolveSecret(config.secretRef); - if (!clientSecret) throw new Error("The DingTalk client secret is missing"); - try { - await this.#startRuntime(config, clientSecret); - this.#errors.delete(botId); - } catch (error) { - this.#errors.set( - botId, - safeError("connection-failed", "\u9489\u9489\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002") - ); - throw error; - } finally { - this.#touch(); - } - }); - return this.status(); - } - /** Removes one bot, its secret, runtime, and local conversation state. */ - async deleteBot(botId) { - const config = this.#configStore.get(botId); - if (!config) throw new Error("Unknown DingTalk bot"); - await this.#withBotTransition(botId, async () => { - const previousSecret = await this.#credentials.resolve(config.secretRef).catch(() => void 0); - await this.#stopRuntime(botId); - try { - await this.#credentials.unset(config.secretRef); - await this.#configStore.remove(botId); - } catch (error) { - if (cleanString3(previousSecret?.value)) { - await this.#credentials.set(config.secretRef, previousSecret.value).catch(() => void 0); - await this.#startRuntime(config, previousSecret.value).catch(() => void 0); - } - throw new Error("Unable to remove the DingTalk bot safely.", { cause: error }); - } - try { - await this.#deleteState({ botId, config }); - } catch { - this.#logger.warn?.(`[dsh-dingtalk] bot ${botId} state cleanup failed`); - } - this.#errors.delete(botId); - this.#touch(); - }); - return this.status(); - } - /** Approves one opaque pending-sender request for a bot. */ - async approveSender(botId, requestId) { - const config = this.#configStore.get(botId); - if (!config) throw new Error("Unknown DingTalk bot"); - const runtime = this.#runtimes.get(botId); - const direct = typeof runtime?.pendingSender === "function" ? normalizePendingSender(runtime.pendingSender(requestId)) : null; - const pending = internalPendingSenders(runtimeStatus(runtime)); - const sender = direct?.requestId === requestId ? direct : pending.find((candidate) => candidate.requestId === requestId); - if (!sender) throw new Error("Unknown DingTalk sender approval request"); - if (config.approvedSenders.some((approved) => approved.staffId === sender.staffId)) { - return this.status(); - } - const updated = { - ...config, - approvedSenders: [ - ...config.approvedSenders, - { - senderKey: deriveDingtalkSenderKey(), - staffId: sender.staffId, - displayName: sender.displayName, - approvedAt: isoNow(this.#clock) - } - ] - }; - await this.#saveAndRestart(config, updated); - return this.status(); - } - /** Revokes one approved sender by its browser-safe sender key. */ - async revokeSender(botId, senderKey) { - const config = this.#configStore.get(botId); - if (!config) throw new Error("Unknown DingTalk bot"); - const index = config.approvedSenders.findIndex( - (sender) => sender.senderKey === senderKey - ); - if (index === -1) throw new Error("Unknown approved DingTalk sender"); - const approvedSenders = [...config.approvedSenders]; - approvedSenders.splice(index, 1); - await this.#saveAndRestart(config, { ...config, approvedSenders }); - return this.status(); - } - /** Returns browser-safe bot, health, and sender-approval state. */ - status() { - const bots = this.#configStore.list().map((config) => { - const runtime = this.#runtimes.get(config.botId); - let currentStatus = {}; - try { - currentStatus = runtimeStatus(runtime); - } catch { - currentStatus = { state: "error" }; - } - const connected = isRuntimeConnected(runtime, currentStatus); - const accountError = this.#errors.get(config.botId); - const state = connected ? "connected" : accountError ? "error" : "offline"; - const approvedIds = new Set(config.approvedSenders.map((sender) => sender.staffId)); - const pending = internalPendingSenders(currentStatus).filter((sender) => !approvedIds.has(sender.staffId)).map(publicPendingSender); - return { - botId: config.botId, - state, - connected, - configured: true, - bot: { - name: "\u9489\u9489\u673A\u5668\u4EBA", - clientIdMasked: maskDingtalkClientId(config.clientId) - }, - health: { - status: connected ? "healthy" : accountError ? "error" : "offline", - summary: connected ? "\u9489\u9489 Stream \u6D88\u606F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38" : accountError?.message ?? "\u9489\u9489\u6D88\u606F\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF", - lastCheckedAt: currentStatus.lastCheckedAt ?? null - }, - stats: { - messagesReceived: Number(currentStatus.messagesReceived) || 0, - messagesReplied: Number(currentStatus.messagesReplied) || 0 - }, - senders: { - pending, - approved: config.approvedSenders.map(publicApprovedSender) - }, - error: accountError ? structuredClone(accountError) : null - }; - }); - const connectedCount = bots.filter((bot) => bot.connected).length; - const active = this.#activeAttemptId ? this.#attempts.get(this.#activeAttemptId) : null; - return { - schemaVersion: 1, - revision: this.#revision, - state: active && ACTIVE_ATTEMPT_STATES.has(active.state) ? "provisioning" : bots.length === 0 ? "disconnected" : connectedCount === bots.length ? "connected" : connectedCount > 0 ? "degraded" : "offline", - bots, - totals: { configured: bots.length, connected: connectedCount }, - ...active && ACTIVE_ATTEMPT_STATES.has(active.state) ? { provisioning: publicAttempt(active) } : {} - }; - } - /** Cancels provisioning and stops every bot runtime. */ - async close() { - if (this.#closed) return; - this.#closed = true; - if (this.#activeAttemptId) await this.cancelProvisioning(this.#activeAttemptId); - await Promise.allSettled([...this.#runtimes.keys()].map((botId) => this.#stopRuntime(botId))); - await Promise.allSettled([...this.#transitions.values()]); - await Promise.allSettled([...this.#runtimes.keys()].map((botId) => this.#stopRuntime(botId))); - } - async #pollRegistration(record) { - try { - this.#assertAttemptActive(record); - const response = await this.#deviceAuth.poll({ - deviceCode: record.deviceCode, - signal: record.controller.signal - }); - this.#assertAttemptActive(record); - const state = cleanString3(response.status)?.toUpperCase(); - if (state === "WAITING") { - record.state = "pending"; - record.error = null; - } else if (state === "SUCCESS") { - const clientId = cleanString3(response.clientId); - const clientSecret = cleanString3(response.clientSecret); - if (!clientId || !clientSecret) throw new Error("DingTalk returned incomplete credentials"); - record.state = "connecting"; - record.error = null; - this.#touch(); - const activation = await this.#activateBot(record, { clientId, clientSecret }); - record.botId = activation.botId; - record.alreadyConnected = activation.alreadyConnected; - record.state = "connected"; - if (this.#activeAttemptId === record.id) this.#activeAttemptId = null; - } else if (state === "EXPIRED") { - record.state = "expired"; - record.error = safeError("expired", "\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002"); - if (this.#activeAttemptId === record.id) this.#activeAttemptId = null; - } else if (state === "FAIL") { - record.state = "failed"; - record.error = safeError("authorization-failed", "\u9489\u9489\u672A\u5B8C\u6210\u673A\u5668\u4EBA\u6388\u6743\uFF0C\u8BF7\u91CD\u65B0\u626B\u7801\u3002"); - if (this.#activeAttemptId === record.id) this.#activeAttemptId = null; - } else { - record.state = "pending"; - record.error = safeError("poll-pending", "\u9489\u9489\u6388\u6743\u72B6\u6001\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u6B63\u5728\u91CD\u8BD5\u3002"); - } - } catch (error) { - if (record.controller.signal.aborted || error?.name === "AbortError") { - record.state = "cancelled"; - record.error = safeError("cancelled", "\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"); - if (this.#activeAttemptId === record.id) this.#activeAttemptId = null; - } else if (record.state === "connecting") { - record.state = "failed"; - record.error = safeError( - "activation-failed", - "\u9489\u9489\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u5B89\u5168\u4FDD\u5B58\u63A5\u5165\u914D\u7F6E\u3002" - ); - if (this.#activeAttemptId === record.id) this.#activeAttemptId = null; - this.#logger.error?.("[dsh-dingtalk] bot activation failed"); - } else { - record.state = "pending"; - record.error = safeError("poll-failed", "\u9489\u9489\u6388\u6743\u67E5\u8BE2\u6682\u65F6\u5931\u8D25\uFF0C\u6B63\u5728\u91CD\u8BD5\u3002"); - } - } finally { - this.#touch(); - this.#pruneAttempts(); - } - } - async #activateBot(record, { clientId, clientSecret }) { - const identity = deriveDingtalkBotIdentity(clientId); - const previousConfig = this.#configStore.getByClientId(clientId); - const previousSecret = await this.#credentials.resolve(identity.secretRef).catch(() => void 0); - const config = { - botId: identity.botId, - clientId, - secretRef: identity.secretRef, - approvedSenders: previousConfig?.approvedSenders ?? [] - }; - return this.#withBotTransition(identity.botId, async () => { - const rollback = async () => { - await this.#stopRuntime(identity.botId); - if (previousConfig) await this.#configStore.save(previousConfig).catch(() => void 0); - else if (this.#configStore.get(identity.botId)) { - await this.#configStore.remove(identity.botId).catch(() => void 0); - } - await this.#restoreCredential(identity.secretRef, previousSecret); - if (previousConfig && cleanString3(previousSecret?.value)) { - await this.#startRuntime(previousConfig, previousSecret.value).catch(() => void 0); - } - }; - await this.#credentials.set(identity.secretRef, clientSecret); - try { - this.#assertAttemptActive(record); - await this.#configStore.save(config); - this.#assertAttemptActive(record); - } catch (error) { - await rollback(); - throw error; - } - try { - await this.#startRuntime(config, clientSecret); - this.#assertAttemptActive(record); - this.#errors.delete(identity.botId); - } catch (error) { - if (record.controller.signal.aborted || this.#activeAttemptId !== record.id) { - await rollback(); - throw abortError(); - } - this.#errors.set( - identity.botId, - safeError("connection-failed", "\u9489\u9489\u5DF2\u63A5\u5165\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002") - ); - this.#logger.warn?.("[dsh-dingtalk] authorized bot saved but its connection is not ready"); - } - return { botId: identity.botId, alreadyConnected: Boolean(previousConfig) }; - }); - } - async #saveAndRestart(previousConfig, nextConfig) { - return this.#withBotTransition(previousConfig.botId, async () => { - const clientSecret = await this.#resolveSecret(previousConfig.secretRef); - if (!clientSecret) throw new Error("The DingTalk client secret is missing"); - await this.#configStore.save(nextConfig); - try { - await this.#startRuntime(nextConfig, clientSecret); - this.#errors.delete(previousConfig.botId); - } catch (error) { - await this.#configStore.save(previousConfig).catch(() => void 0); - await this.#startRuntime(previousConfig, clientSecret).catch(() => void 0); - this.#errors.set( - previousConfig.botId, - safeError("connection-failed", "\u9489\u9489\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002") - ); - throw error; - } finally { - this.#touch(); - } - }); - } - async #startRuntime(config, clientSecret) { - if (this.#closed) throw abortError(); - await this.#stopRuntime(config.botId); - if (this.#closed) throw abortError(); - const runtime = await this.#createRuntime({ - botId: config.botId, - config: structuredClone(config), - clientSecret - }); - if (!runtime || typeof runtime.start !== "function" || typeof runtime.stop !== "function") { - throw new TypeError("createRuntime returned an invalid DingTalk runtime"); - } - if (this.#closed) { - await runtime.stop().catch(() => void 0); - throw abortError(); - } - this.#runtimes.set(config.botId, runtime); - try { - await runtime.start(); - if (this.#closed) { - await runtime.stop().catch(() => void 0); - throw abortError(); - } - } catch (error) { - if (this.#runtimes.get(config.botId) === runtime) this.#runtimes.delete(config.botId); - await runtime.stop().catch(() => void 0); - throw error; - } - } - async #stopRuntime(botId) { - const runtime = this.#runtimes.get(botId); - this.#runtimes.delete(botId); - await runtime?.stop().catch(() => { - this.#logger.warn?.(`[dsh-dingtalk] bot ${botId} failed to stop cleanly`); - }); - } - async #resolveSecret(secretRef) { - const result = await this.#credentials.resolve(secretRef).catch(() => void 0); - return cleanString3(result?.value); - } - async #restoreCredential(secretRef, previous) { - try { - if (cleanString3(previous?.value)) await this.#credentials.set(secretRef, previous.value); - else await this.#credentials.unset(secretRef); - } catch { - this.#logger.error?.(`[dsh-dingtalk] failed to restore credential ${secretRef}`); - } - } - #assertAttemptActive(record) { - if (record.controller.signal.aborted || this.#activeAttemptId !== record.id) throw abortError(); - } - #withBotTransition(botId, operation) { - if (this.#closed) return Promise.reject(new Error("dsh-dingtalk controller is closed")); - const previous = this.#transitions.get(botId) ?? Promise.resolve(); - const current = previous.catch(() => void 0).then(operation); - const settled = current.finally(() => { - if (this.#transitions.get(botId) === settled) this.#transitions.delete(botId); - }); - this.#transitions.set(botId, settled); - return settled; - } - #pruneAttempts() { - for (const [id, record] of this.#attempts) { - if (id !== this.#activeAttemptId && TERMINAL_ATTEMPT_STATES.has(record.state) && this.#attempts.size > 16) { - this.#attempts.delete(id); - } - } - } - #touch() { - this.#revision += 1; - } -}; - -// src/channels/dingtalk/dingtalk-api.mjs -import { randomUUID as randomUUID3 } from "node:crypto"; -var DINGTALK_REGISTRATION_BASE_URL = "https://oapi.dingtalk.com/"; -var DINGTALK_API_BASE_URL = "https://api.dingtalk.com/"; -var DINGTALK_REGISTRATION_SOURCE = "DING_DWS_CLAW"; -var DINGTALK_AI_CARD_TEMPLATE_ID = "02fcf2f4-5e02-4a85-b672-46d1f715543e.schema"; -var DEFAULT_TIMEOUT_MS = 15e3; -var REGISTRATION_STATUSES = /* @__PURE__ */ new Set(["WAITING", "SUCCESS", "FAIL", "EXPIRED"]); -var DingtalkApiError = class extends Error { - constructor(code, message, options = {}) { - super(message, options); - this.name = "DingtalkApiError"; - this.code = code; - this.status = options.status; - } -}; -function nonEmptyString(value) { - return typeof value === "string" && value.trim() ? value.trim() : null; -} -function isDingtalkHost(hostname) { - const normalized = hostname.toLowerCase().replace(/\.$/, ""); - return normalized === "dingtalk.com" || normalized.endsWith(".dingtalk.com"); -} -function normalizeTrustedUrl(value, { label, requireSubdomain = true } = {}) { - let url; - try { - url = new URL(value); - } catch { - throw new DingtalkApiError("invalid-url", `${label ?? "\u9489\u9489\u670D\u52A1"}\u8FD4\u56DE\u4E86\u65E0\u6548\u5730\u5740\u3002`); - } - const normalizedHost = url.hostname.toLowerCase().replace(/\.$/, ""); - const trustedHost = requireSubdomain ? normalizedHost !== "dingtalk.com" && isDingtalkHost(normalizedHost) : isDingtalkHost(normalizedHost); - if (url.protocol !== "https:" || !trustedHost || url.port && url.port !== "443") { - throw new DingtalkApiError("untrusted-url", `${label ?? "\u9489\u9489\u670D\u52A1"}\u5730\u5740\u4E0D\u53D7\u4FE1\u4EFB\u3002`); - } - if (url.username || url.password) { - throw new DingtalkApiError("untrusted-url", `${label ?? "\u9489\u9489\u670D\u52A1"}\u5730\u5740\u4E0D\u53D7\u4FE1\u4EFB\u3002`); - } - return url; -} -function normalizeDingtalkSessionWebhook(value) { - const text = nonEmptyString(value); - if (!text) throw new DingtalkApiError("invalid-session-webhook", "\u9489\u9489\u6D88\u606F\u6CA1\u6709\u53EF\u7528\u7684\u56DE\u590D\u5730\u5740\u3002"); - const url = normalizeTrustedUrl(text, { label: "\u9489\u9489\u56DE\u590D", requireSubdomain: false }); - url.hash = ""; - return url.toString(); -} -function splitDingtalkText(value, maxChars = 4e3) { - const text = typeof value === "string" ? value.trim() : ""; - if (!text) return []; - if (!Number.isInteger(maxChars) || maxChars < 1) throw new TypeError("maxChars must be a positive integer"); - if (text.length <= maxChars) return [text]; - const chunks = []; - let remaining = text; - while (remaining.length > maxChars) { - let splitAt = remaining.lastIndexOf("\n", maxChars); - if (splitAt < Math.floor(maxChars * 0.6)) splitAt = maxChars; - chunks.push(remaining.slice(0, splitAt)); - remaining = remaining.slice(splitAt).replace(/^\n+/, ""); - } - if (remaining) chunks.push(remaining); - return chunks; -} -function abortError2(signal) { - if (signal?.reason instanceof Error) return signal.reason; - return new DOMException("The operation was aborted", "AbortError"); -} -function abortableDelay(ms, signal) { - if (ms <= 0) return Promise.resolve(); - return new Promise((resolve7, reject) => { - if (signal?.aborted) { - reject(abortError2(signal)); - return; - } - const timer = setTimeout(() => { - signal?.removeEventListener("abort", onAbort); - resolve7(); - }, ms); - const onAbort = () => { - clearTimeout(timer); - reject(abortError2(signal)); - }; - signal?.addEventListener("abort", onAbort, { once: true }); - }); -} -async function requestJson(fetchImpl, url, { - body, - signal, - timeoutMs = DEFAULT_TIMEOUT_MS, - headers = {}, - method = "POST", - action = "request" -} = {}) { - const controller = new AbortController(); - let timedOut = false; - const onAbort = () => controller.abort(signal?.reason); - if (signal?.aborted) throw abortError2(signal); - signal?.addEventListener("abort", onAbort, { once: true }); - const timer = timeoutMs > 0 ? setTimeout(() => { - timedOut = true; - controller.abort(); - }, timeoutMs) : null; - try { - const response = await fetchImpl(url, { - method, - redirect: "error", - headers: { "content-type": "application/json", ...headers }, - body: JSON.stringify(body ?? {}), - signal: controller.signal - }); - if (!response.ok) { - throw new DingtalkApiError( - "http-error", - `\u9489\u9489\u670D\u52A1\u8BF7\u6C42\u5931\u8D25\uFF08HTTP ${response.status}\uFF09\u3002`, - { status: response.status } - ); - } - try { - return await response.json(); - } catch (error) { - throw new DingtalkApiError("invalid-response", "\u9489\u9489\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u89E3\u6790\u7684\u54CD\u5E94\u3002", { cause: error }); - } - } catch (error) { - if (signal?.aborted) throw abortError2(signal); - if (timedOut) throw new DingtalkApiError("timeout", "\u9489\u9489\u670D\u52A1\u8BF7\u6C42\u8D85\u65F6\u3002", { cause: error }); - if (error instanceof DingtalkApiError) throw error; - throw new DingtalkApiError("network-error", `\u6682\u65F6\u65E0\u6CD5\u5B8C\u6210\u9489\u9489${action}\u8BF7\u6C42\u3002`, { cause: error }); - } finally { - if (timer) clearTimeout(timer); - signal?.removeEventListener("abort", onAbort); - } -} -function normalizeCardTarget(target) { - if (target?.type === "user") { - const userId = nonEmptyString(target.userId); - if (userId) return { type: "user", userId }; - } - if (target?.type === "group") { - const openConversationId = nonEmptyString(target.openConversationId); - if (openConversationId) return { type: "group", openConversationId }; - } - throw new TypeError("DingTalk AI Card target is invalid"); -} -function cardData(text, flowStatus) { - return { - cardParamMap: { - flowStatus, - msgContent: normalizeDingtalkCardMarkdown(text), - staticMsgContent: "", - sys_full_json_obj: JSON.stringify({ order: ["msgContent"] }), - config: JSON.stringify({ autoLayout: true }) - } - }; -} -function cardDeliverBody(cardInstanceId, target, robotCode) { - const base = { outTrackId: cardInstanceId, userIdType: 1 }; - if (target.type === "group") { - return { - ...base, - openSpaceId: `dtv1.card//IM_GROUP.${target.openConversationId}`, - imGroupOpenDeliverModel: { robotCode } - }; - } - return { - ...base, - openSpaceId: `dtv1.card//IM_ROBOT.${target.userId}`, - imRobotOpenDeliverModel: { - spaceType: "IM_ROBOT", - robotCode, - extension: { dynamicSummary: "true" } - } - }; -} -function normalizeDingtalkCardMarkdown(value) { - const text = typeof value === "string" ? value.replace(/\r\n?/g, "\n") : ""; - const lines = text.split("\n"); - let inCodeBlock = false; - return lines.map((line, index) => { - const fenced = /^\s{0,3}```/.test(line); - const currentInCodeBlock = inCodeBlock; - if (fenced) inCodeBlock = !inCodeBlock; - if (index === lines.length - 1) return line; - if (currentInCodeBlock || fenced || inCodeBlock || !line || !lines[index + 1]) return `${line} -`; - if (/^\s{0,3}(?:[-*+] |\d+[.)] |#{1,6} |\||> )/.test(lines[index + 1])) return `${line} -`; - return `${line}
`; - }).join(""); -} -function assertRegistrationOk(value, action) { - if (!value || typeof value !== "object" || value.errcode !== 0) { - throw new DingtalkApiError( - "registration-rejected", - `\u9489\u9489\u626B\u7801${action}\u5931\u8D25\u3002` - ); - } - return value; -} -function positiveNumber2(value, fallback) { - const number = Number(value); - return Number.isFinite(number) && number > 0 ? number : fallback; -} -function createDingtalkApi({ - fetchImpl = fetch, - registrationBaseUrl = process.env.DINGTALK_REGISTRATION_BASE_URL || DINGTALK_REGISTRATION_BASE_URL, - registrationSource = process.env.DINGTALK_REGISTRATION_SOURCE || DINGTALK_REGISTRATION_SOURCE, - now = () => Date.now(), - cardMinIntervalMs = 50, - cardBackoffMs = 1e3, - delay: delay3 = abortableDelay -} = {}) { - if (typeof fetchImpl !== "function") throw new TypeError("fetchImpl must be a function"); - if (typeof now !== "function") throw new TypeError("now must be a function"); - if (!Number.isFinite(cardMinIntervalMs) || cardMinIntervalMs < 0) { - throw new TypeError("cardMinIntervalMs must be a non-negative number"); - } - if (!Number.isFinite(cardBackoffMs) || cardBackoffMs < 0) { - throw new TypeError("cardBackoffMs must be a non-negative number"); - } - if (typeof delay3 !== "function") throw new TypeError("delay must be a function"); - const registrationBase = normalizeTrustedUrl(registrationBaseUrl, { - label: "\u9489\u9489\u6CE8\u518C\u670D\u52A1", - requireSubdomain: false - }); - const apiBase = new URL(DINGTALK_API_BASE_URL); - const source = nonEmptyString(registrationSource); - if (!source) throw new TypeError("registrationSource is required"); - const tokenCache = /* @__PURE__ */ new Map(); - const tokenRequests = /* @__PURE__ */ new Map(); - let cardSlotTail = Promise.resolve(); - let nextCardRequestAt = 0; - const endpoint = (base, pathname) => new URL(pathname.replace(/^\//, ""), base); - async function accessToken({ clientId, clientSecret, signal }) { - const appKey = nonEmptyString(clientId); - const appSecret = nonEmptyString(clientSecret); - if (!appKey || !appSecret) throw new TypeError("clientId and clientSecret are required"); - const cached = tokenCache.get(appKey); - if (cached && cached.expiresAt > now()) return cached.token; - if (tokenRequests.has(appKey)) return tokenRequests.get(appKey); - const request = (async () => { - const value = await requestJson(fetchImpl, endpoint(apiBase, "v1.0/oauth2/accessToken"), { - body: { appKey, appSecret }, - signal, - action: "\u9274\u6743" - }); - const token = nonEmptyString(value?.accessToken); - if (!token) throw new DingtalkApiError("invalid-access-token", "\u9489\u9489\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u8BBF\u95EE\u4EE4\u724C\u3002"); - const expiresInSeconds = positiveNumber2(value?.expireIn ?? value?.expiresIn, 7200); - const refreshAfterMs = Math.max(1e3, (expiresInSeconds - 60) * 1e3); - tokenCache.set(appKey, { token, expiresAt: now() + refreshAfterMs }); - return token; - })().finally(() => tokenRequests.delete(appKey)); - tokenRequests.set(appKey, request); - return request; - } - function acquireCardRequestSlot(signal) { - const acquire = async () => { - const waitMs = Math.max(0, nextCardRequestAt - now()); - if (waitMs > 0) await delay3(waitMs, signal); - nextCardRequestAt = Math.max(nextCardRequestAt, now()) + cardMinIntervalMs; - }; - const slot = cardSlotTail.then(acquire, acquire); - cardSlotTail = slot.catch(() => void 0); - return slot; - } - async function cardRequest(pathname, options) { - await acquireCardRequestSlot(options.signal); - try { - return await requestJson(fetchImpl, endpoint(apiBase, pathname), options); - } catch (error) { - if (!(error instanceof DingtalkApiError) || error.status !== 403) throw error; - await delay3(cardBackoffMs, options.signal); - await acquireCardRequestSlot(options.signal); - return requestJson(fetchImpl, endpoint(apiBase, pathname), options); - } - } - async function failCard({ clientId, clientSecret, cardInstanceId, text, signal }) { - const instanceId = nonEmptyString(cardInstanceId); - const content = nonEmptyString(text); - if (!instanceId) throw new TypeError("cardInstanceId is required"); - if (!content) throw new TypeError("text is required"); - const token = await accessToken({ clientId, clientSecret, signal }); - const headers = { "x-acs-dingtalk-access-token": token }; - const requests = [ - cardRequest("v1.0/card/streaming", { - method: "PUT", - body: { - outTrackId: instanceId, - guid: randomUUID3(), - key: "msgContent", - content: normalizeDingtalkCardMarkdown(content), - isFull: true, - isFinalize: false, - isError: true - }, - headers, - signal, - action: "AI Card \u5931\u8D25\u6536\u53E3" - }), - cardRequest("v1.0/card/instances", { - method: "PUT", - body: { - outTrackId: instanceId, - cardData: cardData(content, "5"), - cardUpdateOptions: { updateCardDataByKey: true } - }, - headers, - signal, - action: "AI Card \u5931\u8D25\u72B6\u6001" - }) - ]; - const results = await Promise.allSettled(requests); - if (results.every(({ status }) => status === "rejected")) throw results[0].reason; - return true; - } - return Object.freeze({ - async beginRegistration({ signal } = {}) { - const initialized = assertRegistrationOk(await requestJson( - fetchImpl, - endpoint(registrationBase, "app/registration/init"), - { body: { source }, signal, action: "\u521D\u59CB\u5316" } - ), "\u521D\u59CB\u5316"); - const nonce = nonEmptyString(initialized.nonce); - if (!nonce) throw new DingtalkApiError("invalid-registration", "\u9489\u9489\u626B\u7801\u521D\u59CB\u5316\u7F3A\u5C11 nonce\u3002"); - const begun = assertRegistrationOk(await requestJson( - fetchImpl, - endpoint(registrationBase, "app/registration/begin"), - { body: { nonce }, signal, action: "\u521B\u5EFA" } - ), "\u521B\u5EFA"); - const deviceCode = nonEmptyString(begun.device_code); - const verificationUriComplete = nonEmptyString(begun.verification_uri_complete); - if (!deviceCode || !verificationUriComplete) { - throw new DingtalkApiError("invalid-registration", "\u9489\u9489\u626B\u7801\u670D\u52A1\u8FD4\u56DE\u7684\u4FE1\u606F\u4E0D\u5B8C\u6574\u3002"); - } - const verificationUrl = normalizeTrustedUrl(verificationUriComplete, { - label: "\u9489\u9489\u626B\u7801", - requireSubdomain: false - }).toString(); - return { - deviceCode, - userCode: nonEmptyString(begun.user_code) ?? void 0, - verificationUri: nonEmptyString(begun.verification_uri) ?? void 0, - verificationUriComplete: verificationUrl, - expiresInSeconds: positiveNumber2(begun.expires_in, 7200), - intervalSeconds: positiveNumber2(begun.interval, 5) - }; - }, - async pollRegistration({ deviceCode, signal } = {}) { - const code = nonEmptyString(deviceCode); - if (!code) throw new TypeError("deviceCode is required"); - const polled = assertRegistrationOk(await requestJson( - fetchImpl, - endpoint(registrationBase, "app/registration/poll"), - { body: { device_code: code }, signal, action: "\u72B6\u6001\u67E5\u8BE2" } - ), "\u72B6\u6001\u67E5\u8BE2"); - const status = nonEmptyString(polled.status)?.toUpperCase(); - if (!status || !REGISTRATION_STATUSES.has(status)) { - throw new DingtalkApiError("invalid-registration-status", "\u9489\u9489\u626B\u7801\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u72B6\u6001\u3002"); - } - const result = { - status, - failReason: nonEmptyString(polled.fail_reason) ?? void 0 - }; - if (status === "SUCCESS") { - result.clientId = nonEmptyString(polled.client_id) ?? void 0; - result.clientSecret = nonEmptyString(polled.client_secret) ?? void 0; - if (!result.clientId || !result.clientSecret) { - throw new DingtalkApiError("missing-credentials", "\u9489\u9489\u626B\u7801\u5DF2\u786E\u8BA4\uFF0C\u4F46\u6CA1\u6709\u8FD4\u56DE\u673A\u5668\u4EBA\u51ED\u636E\u3002"); - } - } - return result; - }, - accessToken, - async createAiCard({ clientId, clientSecret, target, initialText, signal }) { - const appKey = nonEmptyString(clientId); - const appSecret = nonEmptyString(clientSecret); - const content = nonEmptyString(initialText); - if (!appKey || !appSecret) throw new TypeError("clientId and clientSecret are required"); - if (!content) throw new TypeError("initialText is required"); - const normalizedTarget = normalizeCardTarget(target); - const token = await accessToken({ clientId: appKey, clientSecret: appSecret, signal }); - const cardInstanceId = `dsh_${randomUUID3()}`; - const headers = { "x-acs-dingtalk-access-token": token }; - let delivered = false; - try { - await cardRequest("v1.0/card/instances", { - body: { - cardTemplateId: DINGTALK_AI_CARD_TEMPLATE_ID, - outTrackId: cardInstanceId, - cardData: { - cardParamMap: { config: JSON.stringify({ autoLayout: true }) } - }, - callbackType: "STREAM", - imGroupOpenSpaceModel: { supportForward: true }, - imRobotOpenSpaceModel: { supportForward: true } - }, - headers, - signal, - action: "AI Card \u521B\u5EFA" - }); - await cardRequest("v1.0/card/instances/deliver", { - body: cardDeliverBody(cardInstanceId, normalizedTarget, appKey), - headers, - signal, - action: "AI Card \u6295\u653E" - }); - delivered = true; - await cardRequest("v1.0/card/instances", { - method: "PUT", - body: { outTrackId: cardInstanceId, cardData: cardData(content, "2") }, - headers, - signal, - action: "AI Card \u542F\u52A8" - }); - await cardRequest("v1.0/card/streaming", { - method: "PUT", - body: { - outTrackId: cardInstanceId, - guid: randomUUID3(), - key: "msgContent", - content: normalizeDingtalkCardMarkdown(content).replace(/\n+$/, ""), - isFull: true, - isFinalize: false, - isError: false - }, - headers, - signal, - action: "AI Card \u542F\u52A8" - }); - } catch (error) { - if (delivered) { - const cleanupSignal = AbortSignal.timeout(5e3); - await failCard({ - clientId: appKey, - clientSecret: appSecret, - cardInstanceId, - text: "\u6D88\u606F\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002", - signal: cleanupSignal - }).catch(() => void 0); - } - throw error; - } - return { cardInstanceId }; - }, - async updateAiCard({ clientId, clientSecret, cardInstanceId, text, signal }) { - const instanceId = nonEmptyString(cardInstanceId); - const content = nonEmptyString(text); - if (!instanceId) throw new TypeError("cardInstanceId is required"); - if (!content) throw new TypeError("text is required"); - const token = await accessToken({ clientId, clientSecret, signal }); - await cardRequest("v1.0/card/streaming", { - method: "PUT", - body: { - outTrackId: instanceId, - guid: randomUUID3(), - key: "msgContent", - content: normalizeDingtalkCardMarkdown(content).replace(/\n+$/, ""), - isFull: true, - isFinalize: false, - isError: false - }, - headers: { "x-acs-dingtalk-access-token": token }, - signal, - action: "AI Card \u66F4\u65B0" - }); - return true; - }, - async finishAiCard({ clientId, clientSecret, cardInstanceId, text, signal }) { - const instanceId = nonEmptyString(cardInstanceId); - const content = nonEmptyString(text); - if (!instanceId) throw new TypeError("cardInstanceId is required"); - if (!content) throw new TypeError("text is required"); - const token = await accessToken({ clientId, clientSecret, signal }); - const headers = { "x-acs-dingtalk-access-token": token }; - const normalizedContent = normalizeDingtalkCardMarkdown(content); - await cardRequest("v1.0/card/streaming", { - method: "PUT", - body: { - outTrackId: instanceId, - guid: randomUUID3(), - key: "msgContent", - content: normalizedContent, - isFull: true, - isFinalize: true, - isError: false - }, - headers, - signal, - action: "AI Card \u5B8C\u6210" - }); - let completed = true; - const completionRequest = { - method: "PUT", - body: { - outTrackId: instanceId, - cardData: cardData(content, "3"), - cardUpdateOptions: { updateCardDataByKey: true } - }, - headers, - signal, - action: "AI Card \u6536\u53E3" - }; - try { - await cardRequest("v1.0/card/instances", completionRequest); - } catch { - try { - await cardRequest("v1.0/card/instances", completionRequest); - } catch { - completed = false; - } - } - return { delivered: true, completed }; - }, - failAiCard: failCard, - async sendText({ clientId, clientSecret, sessionWebhook, text, signal }) { - const content = nonEmptyString(text); - if (!content) throw new TypeError("text is required"); - const webhook = normalizeDingtalkSessionWebhook(sessionWebhook); - const token = await accessToken({ clientId, clientSecret, signal }); - const response = await requestJson(fetchImpl, webhook, { - body: { msgtype: "text", text: { content } }, - headers: { "x-acs-dingtalk-access-token": token }, - signal, - action: "\u6D88\u606F\u56DE\u590D" - }); - if (response?.errcode !== void 0 && response.errcode !== 0 || response?.code !== void 0 && response.code !== 0) { - throw new DingtalkApiError("send-rejected", "\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u56DE\u590D\u6D88\u606F\u3002"); - } - return true; - }, - clearAccessToken(clientId) { - const appKey = nonEmptyString(clientId); - if (appKey) tokenCache.delete(appKey); - } - }); -} - -// src/channels/dingtalk/dingtalk-card-stream.mjs -var DEFAULT_UPDATE_INTERVAL_MS = 500; -var FAILURE_TEXT = "\u6D88\u606F\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"; -function requiredText(value, name2) { - if (typeof value !== "string") throw new TypeError(`${name2} must be a string`); - return value; -} -function requiredCredential(value, name2) { - if (typeof value !== "string" || !value.trim()) { - throw new TypeError(`${name2} is required`); - } - return value.trim(); -} -function createDingTalkCardStream({ - api, - clientId, - clientSecret, - target, - signal, - logger = console, - updateIntervalMs = DEFAULT_UPDATE_INTERVAL_MS, - clock = () => Date.now(), - timer = { - setTimeout: (callback, delay3) => globalThis.setTimeout(callback, delay3), - clearTimeout: (handle) => globalThis.clearTimeout(handle) - } -} = {}) { - if (!api || typeof api.createAiCard !== "function" || typeof api.updateAiCard !== "function" || typeof api.finishAiCard !== "function") { - throw new TypeError("DingTalk AI Card API is required"); - } - const normalizedClientId = requiredCredential(clientId, "clientId"); - const normalizedClientSecret = requiredCredential(clientSecret, "clientSecret"); - if (target === void 0 || target === null) throw new TypeError("target is required"); - if (!Number.isFinite(updateIntervalMs) || updateIntervalMs < 0) { - throw new TypeError("updateIntervalMs must be a non-negative number"); - } - if (typeof clock !== "function") throw new TypeError("clock must be a function"); - if (typeof timer?.setTimeout !== "function" || typeof timer?.clearTimeout !== "function") { - throw new TypeError("timer must provide setTimeout and clearTimeout"); - } - const readClock = () => { - const value = clock(); - if (!Number.isFinite(value)) throw new TypeError("clock must return a finite timestamp"); - return value; - }; - readClock(); - let phase = signal?.aborted ? "aborted" : "idle"; - let cardRequest = null; - let pendingText = null; - let scheduledUpdate = null; - let updateWorker = null; - let finishPromise = null; - let cleanupPromise = null; - let lastUpdateAt = 0; - const clearScheduledUpdate = () => { - if (scheduledUpdate === null) return; - timer.clearTimeout(scheduledUpdate); - scheduledUpdate = null; - }; - const removeAbortListener = () => signal?.removeEventListener("abort", onAbort); - const close = (nextPhase) => { - phase = nextPhase; - pendingText = null; - clearScheduledUpdate(); - removeAbortListener(); - }; - const cleanupCard = () => { - if (!cardRequest || typeof api.failAiCard !== "function") return Promise.resolve(false); - if (!cleanupPromise) { - cleanupPromise = api.failAiCard({ - ...cardRequest, - text: FAILURE_TEXT, - signal: AbortSignal.timeout(5e3) - }).then( - () => true, - () => false - ); - } - return cleanupPromise; - }; - const fail = (operation) => { - if (phase === "failed" || phase === "finished" || phase === "aborted") return; - void cleanupCard(); - close("failed"); - logger?.error?.(`[dsh-dingtalk] AI Card ${operation} failed`); - }; - function onAbort() { - if (phase === "finished" || phase === "failed" || phase === "aborted") return; - void cleanupCard(); - close("aborted"); - } - if (phase !== "aborted") signal?.addEventListener("abort", onAbort, { once: true }); - const launchUpdate = () => { - if (phase !== "active" || updateWorker || pendingText === null) return; - const delay3 = Math.max(0, lastUpdateAt + updateIntervalMs - readClock()); - if (delay3 > 0) { - scheduledUpdate = timer.setTimeout(() => { - scheduledUpdate = null; - launchUpdate(); - }, delay3); - return; - } - const text = pendingText; - pendingText = null; - updateWorker = (async () => { - try { - await api.updateAiCard({ ...cardRequest, text, finished: false }); - lastUpdateAt = readClock(); - } catch { - if (signal?.aborted || phase === "aborted") return; - fail("update"); - } - })().finally(() => { - updateWorker = null; - if (phase === "active" && pendingText !== null) launchUpdate(); - }); - }; - const start = async (initialText) => { - requiredText(initialText, "initialText"); - if (phase !== "idle") return false; - phase = "starting"; - try { - const created = await api.createAiCard({ - clientId: normalizedClientId, - clientSecret: normalizedClientSecret, - target, - initialText, - signal - }); - const cardInstanceId = typeof created?.cardInstanceId === "string" ? created.cardInstanceId.trim() : ""; - if (!cardInstanceId) throw new TypeError("DingTalk did not return a card instance id"); - cardRequest = Object.freeze({ - clientId: normalizedClientId, - clientSecret: normalizedClientSecret, - target, - cardInstanceId, - signal - }); - if (phase !== "starting") { - void cleanupCard(); - return false; - } - lastUpdateAt = readClock(); - phase = "active"; - return true; - } catch { - if (signal?.aborted || phase === "aborted") { - close("aborted"); - return false; - } - fail("creation"); - return false; - } - }; - const push = (progressText3) => { - requiredText(progressText3, "progressText"); - if (phase !== "active") return; - pendingText = progressText3; - if (!scheduledUpdate && !updateWorker) launchUpdate(); - }; - const finish = (finalText) => { - requiredText(finalText, "finalText"); - if (phase === "finished") return Promise.resolve(true); - if (phase === "finishing") return finishPromise; - if (phase !== "active") return Promise.resolve(false); - phase = "finishing"; - pendingText = null; - clearScheduledUpdate(); - const activeUpdate = updateWorker; - finishPromise = (async () => { - if (activeUpdate) await activeUpdate; - if (phase !== "finishing") return false; - try { - await api.finishAiCard({ ...cardRequest, text: finalText }); - if (phase !== "finishing") return false; - close("finished"); - return true; - } catch { - if (signal?.aborted || phase === "aborted") { - close("aborted"); - return false; - } - fail("finish"); - return false; - } - })(); - return finishPromise; - }; - return Object.freeze({ start, push, finish }); -} - -// src/channels/dingtalk/dingtalk-bridge.mjs -var CARD_INITIAL_TEXT = "\u5DF2\u8FDE\u63A5 DeepSeek Harness\uFF0C\u6B63\u5728\u601D\u8003\u2026"; -var CARD_ERROR_TEXT = "\u6D88\u606F\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"; -var HELP_TEXT = [ - "\u9489\u9489\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002", - "", - "\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002", - "/new \u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD", - "/status \u68C0\u67E5\u8FDE\u63A5\u72B6\u6001", - "/help \u663E\u793A\u672C\u5E2E\u52A9" -].join("\n"); -function nonEmptyString2(value) { - return typeof value === "string" && value.trim() ? value.trim() : null; -} -function senderStaffId(message) { - return nonEmptyString2(message?.senderStaffId) ?? nonEmptyString2(message?.senderId); -} -function conversationKey(message, sender) { - if (String(message?.conversationType) === "2") { - const conversationId = nonEmptyString2(message?.conversationId); - if (!conversationId) throw new Error("DingTalk group message has no conversation id"); - return `group:${conversationId}`; - } - return `p2p:${sender}`; -} -function cardTarget(message, sender) { - if (String(message?.conversationType) === "2") { - return { type: "group", openConversationId: nonEmptyString2(message?.conversationId) }; - } - return { type: "user", userId: sender }; -} -function progressText(update) { - if (update?.type === "text" && nonEmptyString2(update.text)) return update.text; - if (update?.type === "tool") { - if (update.name === "web_search") return "_\u6B63\u5728\u641C\u7D22\u7F51\u7EDC\u5E76\u6574\u7406\u4FE1\u606F\u2026_"; - return `_\u6B63\u5728\u4F7F\u7528 ${nonEmptyString2(update.name) ?? "\u5DE5\u5177"}\u2026_`; - } - return `_${nonEmptyString2(update?.text) ?? "\u6B63\u5728\u5904\u7406\u2026"}_`; -} -function ensureStats(status) { - status.stats ??= {}; - for (const key of ["messagesReceived", "messagesReplied", "messagesRejected", "messagesIgnored"]) { - status[key] ??= 0; - status.stats[key] = status[key]; - } - status.pendingSenders ??= []; -} -function increment(status, key) { - status[key] = (status[key] ?? 0) + 1; - status.stats ??= {}; - status.stats[key] = status[key]; -} -function createDingtalkBridgeStatus({ pendingSenders = [] } = {}) { - return { - messagesReceived: 0, - messagesReplied: 0, - messagesRejected: 0, - messagesIgnored: 0, - lastMessageAt: null, - lastReplyAt: null, - lastRejectedAt: null, - lastError: null, - pendingSenders: structuredClone(pendingSenders), - stats: { - messagesReceived: 0, - messagesReplied: 0, - messagesRejected: 0, - messagesIgnored: 0 - } - }; -} -var DingtalkHarnessBridge = class { - #api; - #clientId; - #clientSecret; - #harness; - #state; - #status; - #logger; - #replyTimeoutMs; - #maxMessageChars; - #signal; - #queues = /* @__PURE__ */ new Map(); - #acceptedMessageIds = /* @__PURE__ */ new Set(); - constructor({ - api, - clientId, - clientSecret, - harness, - state, - status = createDingtalkBridgeStatus(), - logger = console, - replyTimeoutMs = 6e5, - maxMessageChars = 4e3, - signal - }) { - if (!api || typeof api.sendText !== "function") throw new TypeError("DingTalk API is required"); - if (!nonEmptyString2(clientId) || !nonEmptyString2(clientSecret)) { - throw new TypeError("DingTalk app credentials are required"); - } - if (!harness || !state) throw new TypeError("Harness client and state store are required"); - this.#api = api; - this.#clientId = clientId.trim(); - this.#clientSecret = clientSecret.trim(); - this.#harness = harness; - this.#state = state; - this.#status = status; - this.#logger = logger; - this.#replyTimeoutMs = replyTimeoutMs; - this.#maxMessageChars = maxMessageChars; - this.#signal = signal; - ensureStats(this.#status); - this.#refreshPendingSenders(); - } - get status() { - this.#refreshPendingSenders(); - return structuredClone(this.#status); - } - accept(message) { - if (this.#signal?.aborted) return Promise.resolve(); - const messageId = nonEmptyString2(message?.msgId); - const sender = senderStaffId(message); - if (!messageId || !sender || this.#state.hasSeen(messageId) || this.#acceptedMessageIds.has(messageId)) return Promise.resolve(); - this.#acceptedMessageIds.add(messageId); - let key; - try { - key = conversationKey(message, sender); - } catch { - this.#acceptedMessageIds.delete(messageId); - increment(this.#status, "messagesRejected"); - this.#status.lastRejectedAt = (/* @__PURE__ */ new Date()).toISOString(); - return Promise.resolve(); - } - const previous = this.#queues.get(key) ?? Promise.resolve(); - const current = previous.catch(() => void 0).then(() => this.#process(message, messageId, sender, key)).finally(() => { - this.#acceptedMessageIds.delete(messageId); - if (this.#queues.get(key) === current) this.#queues.delete(key); - }); - this.#queues.set(key, current); - return current; - } - async waitForIdle() { - await Promise.allSettled([...this.#queues.values()]); - } - async #process(message, messageId, sender, key) { - this.#signal?.throwIfAborted(); - if (this.#state.hasSeen(messageId)) return; - await this.#state.markSeen(messageId); - increment(this.#status, "messagesReceived"); - this.#status.lastMessageAt = (/* @__PURE__ */ new Date()).toISOString(); - if (String(message.conversationType) === "2" && message.isInAtList !== true) { - increment(this.#status, "messagesIgnored"); - return; - } - let sessionWebhook; - try { - sessionWebhook = normalizeDingtalkSessionWebhook(message.sessionWebhook); - } catch { - increment(this.#status, "messagesRejected"); - this.#status.lastRejectedAt = (/* @__PURE__ */ new Date()).toISOString(); - this.#status.lastError = "\u9489\u9489\u6D88\u606F\u6CA1\u6709\u5B89\u5168\u7684\u56DE\u590D\u5730\u5740\u3002"; - return; - } - const text = message?.msgtype === "text" ? nonEmptyString2(message?.text?.content) : null; - let cardStream = null; - let cardStarted = false; - try { - if (!text) { - await this.#send(sessionWebhook, "\u76EE\u524D\u4EC5\u652F\u6301\u6587\u5B57\u6D88\u606F\u3002"); - return; - } - const command = text.toLowerCase(); - if (command === "/help") { - await this.#send(sessionWebhook, HELP_TEXT); - return; - } - if (command === "/status") { - await this.#harness.ensureRunning({ signal: this.#signal }); - await this.#send(sessionWebhook, "\u9489\u9489\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002"); - return; - } - if (command === "/new") { - await this.#state.clearSession(key); - await this.#send(sessionWebhook, "\u5DF2\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002\u8BF7\u53D1\u9001\u4F60\u7684\u95EE\u9898\u3002"); - return; - } - let sessionId = this.#state.sessionFor(key); - if (!sessionId || !await this.#harness.sessionExists(sessionId, { signal: this.#signal })) { - sessionId = await this.#harness.createSession({ signal: this.#signal }); - await this.#state.setSession(key, sessionId); - } - if (typeof this.#api.createAiCard === "function" && typeof this.#api.updateAiCard === "function" && typeof this.#api.finishAiCard === "function") { - cardStream = createDingTalkCardStream({ - api: this.#api, - clientId: this.#clientId, - clientSecret: this.#clientSecret, - target: cardTarget(message, sender), - signal: this.#signal, - logger: this.#logger - }); - cardStarted = await cardStream.start(CARD_INITIAL_TEXT); - } - const answer = await this.#harness.ask(sessionId, text, { - timeoutMs: this.#replyTimeoutMs, - signal: this.#signal, - onUpdate: cardStarted ? (update) => cardStream.push(progressText(update)) : void 0 - }); - const streamed = cardStarted && await cardStream.finish(answer); - if (!streamed) await this.#send(sessionWebhook, answer); - increment(this.#status, "messagesReplied"); - this.#status.lastReplyAt = (/* @__PURE__ */ new Date()).toISOString(); - this.#status.lastError = null; - } catch { - if (this.#signal?.aborted) return; - this.#status.lastError = "\u9489\u9489\u6D88\u606F\u5904\u7406\u5931\u8D25\u3002"; - this.#logger.error?.("[dsh-dingtalk] failed to process an inbound message"); - try { - const streamed = cardStarted && await cardStream.finish(CARD_ERROR_TEXT); - if (!streamed) await this.#send(sessionWebhook, CARD_ERROR_TEXT); - } catch { - this.#logger.error?.("[dsh-dingtalk] failed to send the safe error reply"); - } - } - } - #refreshPendingSenders() { - if (typeof this.#state.pendingSenders === "function") { - this.#status.pendingSenders = this.#state.pendingSenders(); - } - } - async #send(sessionWebhook, text) { - for (const chunk of splitDingtalkText(text, this.#maxMessageChars)) { - this.#signal?.throwIfAborted(); - await this.#api.sendText({ - clientId: this.#clientId, - clientSecret: this.#clientSecret, - sessionWebhook, - text: chunk, - signal: this.#signal - }); - } - } -}; - -// src/channels/dingtalk/dingtalk-runtime.mjs -function nonEmptyString3(value) { - return typeof value === "string" && value.trim() ? value.trim() : null; -} -function approvedSenderIds(config) { - const entries = Array.isArray(config?.approvedSenders) ? config.approvedSenders : config?.approvedSenders instanceof Set ? [...config.approvedSenders] : []; - return new Set(entries.map((entry) => nonEmptyString3( - typeof entry === "string" ? entry : entry?.staffId - )).filter(Boolean)); -} -function approvedSenderCount(config) { - return approvedSenderIds(config).size; -} -function streamIsOpen(client) { - return client?.connected === true || client?.socket?.readyState === 1; -} -function abortable(promise, signal) { - return new Promise((resolve7, reject) => { - if (signal.aborted) { - reject(signal.reason); - return; - } - const onAbort = () => reject(signal.reason); - signal.addEventListener("abort", onAbort, { once: true }); - Promise.resolve(promise).then( - (value) => { - signal.removeEventListener("abort", onAbort); - resolve7(value); - }, - (error) => { - signal.removeEventListener("abort", onAbort); - reject(error); - } - ); - }); -} -async function waitForStreamOpen(client, pollIntervalMs, signal) { - while (true) { - signal?.throwIfAborted(); - if (streamIsOpen(client)) return; - await new Promise((resolve7, reject) => { - const timer = setTimeout(() => { - signal?.removeEventListener("abort", onAbort); - resolve7(); - }, pollIntervalMs); - const onAbort = () => { - clearTimeout(timer); - reject(signal.reason ?? new DOMException("Aborted", "AbortError")); - }; - signal?.addEventListener("abort", onAbort, { once: true }); - }); - } -} -async function connectStream(client, timeoutMs, pollIntervalMs, signal) { - const timeoutSignal = AbortSignal.timeout(timeoutMs); - const connectSignal = AbortSignal.any([signal, timeoutSignal]); - let connectSettled = false; - const connectTask = Promise.resolve().then(() => client.connect()).finally(() => { - connectSettled = true; - }); - try { - await abortable(connectTask, connectSignal); - await waitForStreamOpen(client, pollIntervalMs, connectSignal); - } catch (error) { - if (connectSignal.aborted) { - if (!connectSettled) { - void connectTask.then(() => client.disconnect()).catch(() => void 0); - } - if (signal.aborted) throw signal.reason; - throw new Error(`DingTalk Stream handshake timed out after ${timeoutMs}ms`); - } - throw error; - } -} -async function defaultStreamFactory({ clientId, clientSecret }) { - const { DWClient, TOPIC_ROBOT } = await import("dingtalk-stream"); - return { - client: new DWClient({ - clientId, - clientSecret, - endpoint: "https://api.dingtalk.com", - autoReconnect: false, - keepAlive: true, - debug: false - }), - topic: TOPIC_ROBOT - }; -} -function createDingtalkRuntimeStatus({ - pendingSenders = [], - approvedSenders = 0 -} = {}) { - return { - startedAt: null, - ready: false, - dingtalkStreamState: "idle", - harnessReachable: false, - lastConnectedAt: null, - lastCheckedAt: null, - lastCallbackAt: null, - authorizationMode: "sender-staff-id-approval", - approvedSenderCount: approvedSenders, - ...createDingtalkBridgeStatus({ pendingSenders }) - }; -} -var DingtalkRuntime = class { - #config; - #clientSecret; - #harness; - #state; - #logger; - #replyTimeoutMs; - #maxMessageChars; - #connectTimeoutMs; - #connectPollIntervalMs; - #api; - #streamFactory; - #status; - #client = null; - #bridge = null; - #topic = null; - #starting = null; - #connectionMonitor = null; - #abortController = null; - #callbackTasks = /* @__PURE__ */ new Set(); - constructor({ - config, - clientSecret, - harness, - state, - logger = console, - replyTimeoutMs = 6e5, - maxMessageChars = 4e3, - connectTimeoutMs = 15e3, - connectPollIntervalMs = 25, - api = createDingtalkApi(), - streamFactory = defaultStreamFactory - }) { - if (!config || !nonEmptyString3(config.clientId) || !nonEmptyString3(clientSecret)) { - throw new TypeError("DingtalkRuntime requires app credentials"); - } - if (!harness || !state) throw new TypeError("DingtalkRuntime requires Harness and state"); - if (typeof streamFactory !== "function") throw new TypeError("streamFactory must be a function"); - this.#config = config; - this.#clientSecret = clientSecret.trim(); - this.#harness = harness; - this.#state = state; - this.#logger = logger; - this.#replyTimeoutMs = replyTimeoutMs; - this.#maxMessageChars = maxMessageChars; - this.#connectTimeoutMs = connectTimeoutMs; - this.#connectPollIntervalMs = connectPollIntervalMs; - this.#api = api; - this.#streamFactory = streamFactory; - this.#status = createDingtalkRuntimeStatus({ - pendingSenders: this.#pendingSenders(), - approvedSenders: approvedSenderCount(config) - }); - } - get status() { - if (this.#bridge) { - const bridgeStatus = this.#bridge.status; - Object.assign(this.#status, bridgeStatus); - } else { - this.#status.pendingSenders = this.#pendingSenders(); - } - return structuredClone(this.#status); - } - pendingSender(requestId) { - return typeof this.#state.pendingSender === "function" ? this.#state.pendingSender(requestId) : null; - } - pendingSenders() { - return this.#pendingSenders(); - } - async start() { - if (this.#client && this.#status.ready) return this.status; - if (this.#starting) return this.#starting; - this.#starting = this.#start().finally(() => { - this.#starting = null; - }); - return this.#starting; - } - async #start() { - await this.stop(); - const abortController = new AbortController(); - this.#abortController = abortController; - const { signal } = abortController; - this.#status.startedAt = (/* @__PURE__ */ new Date()).toISOString(); - this.#status.dingtalkStreamState = "connecting"; - this.#status.lastError = null; - try { - await this.#harness.ensureRunning({ signal }); - this.#status.harnessReachable = true; - if (typeof this.#state.removePendingSenderByStaffId === "function") { - for (const staffId of approvedSenderIds(this.#config)) { - await this.#state.removePendingSenderByStaffId(staffId); - } - this.#status.pendingSenders = this.#pendingSenders(); - } - this.#bridge = new DingtalkHarnessBridge({ - api: this.#api, - clientId: this.#config.clientId, - clientSecret: this.#clientSecret, - approvedSenders: this.#config.approvedSenders, - harness: this.#harness, - state: this.#state, - status: this.#status, - logger: this.#logger, - replyTimeoutMs: this.#replyTimeoutMs, - maxMessageChars: this.#maxMessageChars, - signal - }); - const created = await this.#streamFactory({ - clientId: this.#config.clientId, - clientSecret: this.#clientSecret - }); - signal.throwIfAborted(); - this.#client = created?.client ?? created; - this.#topic = created?.topic ?? created?.TOPIC_ROBOT ?? "/v1.0/im/bot/messages/get"; - if (!this.#client || typeof this.#client.registerCallbackListener !== "function" || typeof this.#client.connect !== "function" || typeof this.#client.disconnect !== "function" || typeof this.#client.socketCallBackResponse !== "function") { - throw new TypeError("streamFactory returned an invalid DingTalk Stream client"); - } - const client = this.#client; - const bridge = this.#bridge; - client.registerCallbackListener(this.#topic, (response) => { - if (this.#client !== client || this.#bridge !== bridge) return; - const callbackMessageId = nonEmptyString3(response?.headers?.messageId); - if (callbackMessageId) { - try { - client.socketCallBackResponse(callbackMessageId, { success: true }); - } catch { - this.#logger.warn?.("[dsh-dingtalk] unable to acknowledge an inbound callback"); - } - } - const task = Promise.resolve().then(async () => { - if (this.#bridge !== bridge) return; - let message; - try { - message = typeof response?.data === "string" ? JSON.parse(response.data) : response?.data; - } catch { - this.#status.lastError = "\u9489\u9489\u6D88\u606F\u683C\u5F0F\u65E0\u6548\u3002"; - this.#logger.warn?.("[dsh-dingtalk] ignored an invalid callback payload"); - return; - } - if (!message || typeof message !== "object") return; - this.#status.lastCallbackAt = Date.now(); - await bridge.accept(message); - }).catch(() => { - if (signal.aborted || this.#bridge !== bridge) return; - this.#status.lastError = "\u9489\u9489\u6D88\u606F\u5904\u7406\u5931\u8D25\u3002"; - this.#logger.error?.("[dsh-dingtalk] callback processing failed"); - }).finally(() => this.#callbackTasks.delete(task)); - this.#callbackTasks.add(task); - }); - await connectStream( - client, - this.#connectTimeoutMs, - this.#connectPollIntervalMs, - signal - ); - this.#status.ready = true; - this.#status.dingtalkStreamState = "connected"; - this.#status.lastConnectedAt = Date.now(); - this.#status.lastCheckedAt = Date.now(); - this.#status.lastError = null; - this.#connectionMonitor = setInterval(() => { - const connected = streamIsOpen(client); - this.#status.ready = connected; - this.#status.dingtalkStreamState = connected ? "connected" : "reconnecting"; - this.#status.lastCheckedAt = Date.now(); - if (connected) this.#status.lastError = null; - }, 1e3); - this.#connectionMonitor.unref?.(); - return this.status; - } catch (error) { - const aborted = signal.aborted; - this.#status.ready = false; - this.#status.dingtalkStreamState = aborted ? "idle" : "failed"; - this.#status.lastError = aborted ? null : error?.message ?? String(error); - await this.stop({ preserveError: !aborted }); - throw error; - } - } - async stop({ preserveError = false } = {}) { - const lastError = preserveError ? this.#status.lastError : null; - const abortController = this.#abortController; - this.#abortController = null; - abortController?.abort(new DOMException("DingTalk runtime stopped", "AbortError")); - if (this.#connectionMonitor) clearInterval(this.#connectionMonitor); - this.#connectionMonitor = null; - this.#status.ready = false; - const client = this.#client; - this.#client = null; - this.#topic = null; - if (client) { - try { - await client.disconnect(); - } catch { - this.#logger.warn?.("[dsh-dingtalk] DingTalk Stream disconnect failed"); - } - } - await Promise.allSettled([...this.#callbackTasks]); - this.#callbackTasks.clear(); - if (this.#bridge) await this.#bridge.waitForIdle(); - this.#bridge = null; - this.#status.dingtalkStreamState = preserveError ? "failed" : "idle"; - this.#status.lastError = lastError; - return this.status; - } - #pendingSenders() { - return typeof this.#state.pendingSenders === "function" ? this.#state.pendingSenders() : []; - } -}; - -// src/channels/dingtalk/harness-client.mjs -import { spawn } from "node:child_process"; -import { randomUUID as randomUUID4 } from "node:crypto"; -function sleep(ms, signal) { - return new Promise((resolve7, reject) => { - if (signal?.aborted) { - reject(signal.reason ?? new DOMException("Aborted", "AbortError")); - return; - } - const timer = setTimeout(() => { - signal?.removeEventListener("abort", onAbort); - resolve7(); - }, ms); - const onAbort = () => { - clearTimeout(timer); - reject(signal.reason ?? new DOMException("Aborted", "AbortError")); - }; - signal?.addEventListener("abort", onAbort, { once: true }); - }); -} -function assistantMessageText(event) { - return (event?.data?.message?.content ?? []).filter((part) => part.type === "text" && typeof part.text === "string").map((part) => part.text).join("\n").trim(); -} -var HarnessReplyTracker = class { - #promptRpcId; - #lastSeq; - #openTurn = null; - #targetTurn = null; - #stepText = /* @__PURE__ */ new Map(); - #latestText = ""; - #finished = false; - #reason = null; - constructor({ promptRpcId, afterSeq = -1 }) { - this.#promptRpcId = promptRpcId; - this.#lastSeq = afterSeq; - } - get finished() { - return this.#finished; - } - get answer() { - return this.#latestText.trim(); - } - get reason() { - return this.#reason; - } - consume(entries) { - let update = null; - const ordered = [...entries].map((entry) => entry?.event ?? entry).filter(Boolean).sort((left, right) => (left.seq ?? -1) - (right.seq ?? -1)); - for (const event of ordered) { - const seq = event.seq ?? -1; - if (seq <= this.#lastSeq) continue; - this.#lastSeq = seq; - if (event.type === "turn/start") this.#openTurn = event.data?.turn ?? null; - if (event.type === "user/message" && event.data?.source?.rpcId === this.#promptRpcId) { - this.#targetTurn = this.#openTurn; - continue; - } - if (this.#targetTurn === null) continue; - if (event.type === "turn/end") { - if (event.data?.turn !== this.#targetTurn) continue; - this.#finished = true; - this.#reason = event.data?.reason ?? null; - this.#openTurn = null; - continue; - } - if (event.data?.turn !== this.#targetTurn) continue; - if (event.type === "assistant/chunk" && event.data?.chunk?.type === "text-delta") { - const step = event.data?.step ?? 0; - const index = event.data.chunk.index ?? 0; - const key = `${step}:${index}`; - this.#stepText.set(key, (this.#stepText.get(key) ?? "") + event.data.chunk.text); - const prefix = `${step}:`; - const text = [...this.#stepText.entries()].filter(([partKey]) => partKey.startsWith(prefix)).sort(([left], [right]) => Number(left.split(":")[1]) - Number(right.split(":")[1])).map(([, part]) => part).join("\n").trim(); - if (text && text !== this.#latestText) { - this.#latestText = text; - update = { type: "text", text }; - } - continue; - } - if (event.type === "assistant/message") { - const text = assistantMessageText(event); - if (text && text !== this.#latestText) { - this.#latestText = text; - update = { type: "text", text }; - } - continue; - } - if (event.type === "tool/call") { - update = { type: "tool", name: event.data?.name ?? "\u5DE5\u5177" }; - } else if (event.type === "tool/result") { - update = { type: "status", text: "\u6B63\u5728\u6574\u7406\u7ED3\u679C\u2026" }; - } - } - return update; - } -}; -var HarnessRpcError = class extends Error { - constructor(method, error) { - super(`${method}: ${error?.message ?? "unknown Harness RPC error"}`); - this.name = "HarnessRpcError"; - this.method = method; - this.code = error?.code ?? "internal"; - this.details = error?.details ?? {}; - } -}; -var HarnessClient = class { - #baseUrl; - #workspace; - #agentPreset; - #autostart; - #dshBin; - #fetch; - #managedProcess = null; - constructor({ - baseUrl, - workspace, - agentPreset = "standard", - autostart = false, - dshBin = "dsh", - fetchImpl = fetch - }) { - this.#baseUrl = new URL(baseUrl); - this.#workspace = workspace; - this.#agentPreset = agentPreset; - this.#autostart = autostart; - this.#dshBin = dshBin; - this.#fetch = fetchImpl; - } - async rpc(method, payload = {}, timeoutMs = 3e4, options = {}) { - const rpcId = options.rpcId ?? `dingtalk-${randomUUID4()}`; - const timeoutSignal = AbortSignal.timeout(timeoutMs); - const signal = options.signal ? AbortSignal.any([options.signal, timeoutSignal]) : timeoutSignal; - const response = await this.#fetch(new URL(`/api/${method}`, this.#baseUrl), { - method: "POST", - headers: { "content-type": "application/json" }, - body: JSON.stringify({ type: "client-request", rpcId, method, payload }), - signal - }); - if (!response.ok) throw new Error(`Harness transport ${method} failed: HTTP ${response.status}`); - const body = await response.json(); - if (body?.type !== "server-response" || body?.rpcId !== rpcId) { - throw new Error(`Harness returned an invalid response for ${method}`); - } - if (!body.result?.ok) throw new HarnessRpcError(method, body.result?.error); - return body.result.value; - } - async health(options = {}) { - await this.rpc("host.describe", {}, 5e3, options); - return true; - } - async ensureRunning(options = {}) { - try { - return await this.health(options); - } catch (firstError) { - if (!this.#autostart) throw firstError; - } - if (!this.#managedProcess || this.#managedProcess.exitCode !== null) { - const port = this.#baseUrl.port || (this.#baseUrl.protocol === "https:" ? "443" : "80"); - this.#managedProcess = spawn(this.#dshBin, [ - "web", - "--host", - this.#baseUrl.hostname, - "--port", - port - ], { - cwd: this.#workspace, - env: process.env, - stdio: ["ignore", "inherit", "inherit"] - }); - this.#managedProcess.on("error", (error) => { - console.error("[dsh-dingtalk] failed to start Harness:", error.message); - }); - } - const deadline = Date.now() + 6e4; - let lastError; - while (Date.now() < deadline) { - await sleep(1e3, options.signal); - try { - return await this.health(options); - } catch (error) { - lastError = error; - } - } - throw new Error(`Harness did not become ready: ${lastError?.message ?? "timeout"}`); - } - async workspaceId(options = {}) { - const { items } = await this.rpc("workspace.list", {}, 3e4, options); - const existing = items.find((item) => item.path === this.#workspace); - if (existing) return existing.workspaceId; - const created = await this.rpc("workspace.create", { path: this.#workspace }, 3e4, options); - return created.workspace.workspaceId; - } - async createSession(options = {}) { - await this.ensureRunning(options); - const workspaceId = await this.workspaceId(options); - const created = await this.rpc("session.create", { - workspaceId, - agentPreset: this.#agentPreset - }, 3e4, options); - return created.sessionId; - } - async sessionExists(sessionId, options = {}) { - try { - await this.rpc("session.history", { sessionId, maxMessages: 1 }, 3e4, options); - return true; - } catch (error) { - if (error instanceof HarnessRpcError && error.code === "session-not-found") return false; - throw error; - } - } - async ask(sessionId, text, options = {}) { - if (typeof options === "number") options = { timeoutMs: options }; - const timeoutMs = options.timeoutMs ?? 6e5; - const signal = options.signal; - const onUpdate = typeof options.onUpdate === "function" ? options.onUpdate : null; - await this.ensureRunning({ signal }); - const before = await this.rpc( - "session.history", - { sessionId, maxMessages: 1 }, - 3e4, - { signal } - ); - const baselineSeq = Math.max(-1, ...(before.events ?? []).map(({ event }) => event.seq ?? -1)); - const promptRpcId = `dingtalk-${randomUUID4()}`; - const tracker = new HarnessReplyTracker({ promptRpcId, afterSeq: baselineSeq }); - await this.rpc("session.prompt", { - sessionId, - mode: "queue", - content: [{ type: "text", text }], - clientTimeZone: Intl.DateTimeFormat().resolvedOptions().timeZone - }, 3e4, { rpcId: promptRpcId, signal }); - const deadline = Date.now() + timeoutMs; - while (Date.now() < deadline) { - await sleep(300, signal); - const history = await this.rpc( - "session.history", - { sessionId, maxMessages: 50 }, - 3e4, - { signal } - ); - const update = tracker.consume(history.events ?? []); - if (update && onUpdate) { - try { - await onUpdate(update); - } catch (error) { - console.warn("[dsh-dingtalk] ignored a progress update failure:", error.message); - } - } - if (!tracker.finished) continue; - if (tracker.answer) return tracker.answer; - throw new Error( - `Harness turn ended without a text reply${tracker.reason ? ` (${JSON.stringify(tracker.reason)})` : ""}` - ); - } - throw new Error(`Harness reply timed out after ${Math.round(timeoutMs / 1e3)} seconds`); - } - stopManagedProcess() { - if (this.#managedProcess?.exitCode === null) this.#managedProcess.kill("SIGTERM"); - } -}; - -// src/channels/dingtalk/state-store.mjs -import { randomUUID as randomUUID5 } from "node:crypto"; -import { mkdir as mkdir2, readFile as readFile2, rename as rename2, unlink as unlink2, writeFile as writeFile2 } from "node:fs/promises"; -import { dirname as dirname2 } from "node:path"; -var EMPTY_STATE = Object.freeze({ - version: 1, - sessions: {}, - seenMessageIds: [], - pendingSenders: {} -}); -function nonEmptyString4(value) { - return typeof value === "string" && value.trim() ? value.trim() : null; -} -function displayName(value) { - return (nonEmptyString4(value) ?? "\u9489\u9489\u7528\u6237").slice(0, 100); -} -function normalizePendingSender2(value, fallbackRequestId) { - if (!value || typeof value !== "object") return null; - const requestId = nonEmptyString4(value.requestId) ?? nonEmptyString4(fallbackRequestId); - const staffId = nonEmptyString4(value.staffId); - const requestedAt = nonEmptyString4(value.requestedAt) ?? nonEmptyString4(value.lastSeenAt); - const lastSeenAt = nonEmptyString4(value.lastSeenAt) ?? requestedAt; - if (!requestId || !staffId || !requestedAt || !lastSeenAt) return null; - return { - requestId, - staffId, - displayName: displayName(value.displayName ?? value.nick), - requestedAt, - lastSeenAt - }; -} -function normalizeState(value) { - if (!value || typeof value !== "object") return structuredClone(EMPTY_STATE); - const sessions = {}; - if (value.sessions && typeof value.sessions === "object" && !Array.isArray(value.sessions)) { - for (const [key, sessionId] of Object.entries(value.sessions)) { - const normalizedKey = nonEmptyString4(key); - const normalizedSession = nonEmptyString4(sessionId); - if (normalizedKey && normalizedSession) sessions[normalizedKey] = normalizedSession; - } - } - const pendingSenders = {}; - const entries = Array.isArray(value.pendingSenders) ? value.pendingSenders.map((entry) => [entry?.requestId, entry]) : Object.entries(value.pendingSenders && typeof value.pendingSenders === "object" ? value.pendingSenders : {}); - for (const [key, candidate] of entries) { - const pending = normalizePendingSender2(candidate, key); - if (!pending) continue; - const duplicate = Object.values(pendingSenders).find((entry) => entry.staffId === pending.staffId); - if (!duplicate || duplicate.lastSeenAt < pending.lastSeenAt) { - if (duplicate) delete pendingSenders[duplicate.requestId]; - pendingSenders[pending.requestId] = pending; - } - } - return { - version: 1, - sessions, - seenMessageIds: Array.isArray(value.seenMessageIds) ? [...new Set(value.seenMessageIds.map(nonEmptyString4).filter(Boolean))].slice(-1e3) : [], - pendingSenders - }; -} -var DingtalkStateStore = class { - #path; - #state = structuredClone(EMPTY_STATE); - #writeQueue = Promise.resolve(); - #idFactory; - #now; - constructor(path, { idFactory = randomUUID5, now = () => (/* @__PURE__ */ new Date()).toISOString() } = {}) { - if (!nonEmptyString4(path)) throw new TypeError("state path is required"); - if (typeof idFactory !== "function" || typeof now !== "function") { - throw new TypeError("idFactory and now must be functions"); - } - this.#path = path; - this.#idFactory = idFactory; - this.#now = now; - } - async load() { - try { - this.#state = normalizeState(JSON.parse(await readFile2(this.#path, "utf8"))); - } catch (error) { - if (error?.code !== "ENOENT") throw error; - this.#state = structuredClone(EMPTY_STATE); - await this.#persist(); - } - return this; - } - sessionFor(key) { - return this.#state.sessions[key] ?? null; - } - async setSession(key, sessionId) { - const normalizedKey = nonEmptyString4(key); - const normalizedSession = nonEmptyString4(sessionId); - if (!normalizedKey || !normalizedSession) throw new TypeError("key and sessionId are required"); - this.#state.sessions[normalizedKey] = normalizedSession; - await this.#persist(); - } - async clearSession(key) { - const normalizedKey = nonEmptyString4(key); - if (!normalizedKey || !(normalizedKey in this.#state.sessions)) return; - delete this.#state.sessions[normalizedKey]; - await this.#persist(); - } - hasSeen(messageId) { - const id = nonEmptyString4(messageId); - return Boolean(id && this.#state.seenMessageIds.includes(id)); - } - async markSeen(messageId) { - const id = nonEmptyString4(messageId); - if (!id) throw new TypeError("messageId is required"); - if (this.hasSeen(id)) return; - this.#state.seenMessageIds.push(id); - if (this.#state.seenMessageIds.length > 1e3) { - this.#state.seenMessageIds.splice(0, this.#state.seenMessageIds.length - 1e3); - } - await this.#persist(); - } - pendingSenders() { - return Object.values(this.#state.pendingSenders).sort((left, right) => left.requestedAt.localeCompare(right.requestedAt)).map((entry) => structuredClone(entry)); - } - pendingSender(requestId) { - const id = nonEmptyString4(requestId); - const entry = id ? this.#state.pendingSenders[id] : null; - return entry ? structuredClone(entry) : null; - } - async recordPendingSender(staffIdOrEntry, name2, seenAt) { - const input = staffIdOrEntry && typeof staffIdOrEntry === "object" ? staffIdOrEntry : { staffId: staffIdOrEntry, displayName: name2, lastSeenAt: seenAt }; - const staffId = nonEmptyString4(input.staffId); - if (!staffId) throw new TypeError("staffId is required"); - const timestamp = nonEmptyString4(input.lastSeenAt) ?? nonEmptyString4(input.requestedAt) ?? this.#now(); - const existing = Object.values(this.#state.pendingSenders).find((entry2) => entry2.staffId === staffId); - const entry = { - requestId: existing?.requestId ?? `ding_sender_${this.#idFactory()}`, - staffId, - displayName: displayName(input.displayName ?? input.nick ?? name2), - requestedAt: existing?.requestedAt ?? timestamp, - lastSeenAt: timestamp - }; - this.#state.pendingSenders[entry.requestId] = entry; - await this.#persist(); - return structuredClone(entry); - } - async removePendingSender(requestId) { - const id = nonEmptyString4(requestId); - if (!id || !this.#state.pendingSenders[id]) return false; - delete this.#state.pendingSenders[id]; - await this.#persist(); - return true; - } - async removePendingSenderByStaffId(staffId) { - const id = nonEmptyString4(staffId); - const pending = id ? Object.values(this.#state.pendingSenders).find((entry) => entry.staffId === id) : null; - return pending ? this.removePendingSender(pending.requestId) : false; - } - snapshot() { - return structuredClone(this.#state); - } - async remove() { - await this.#writeQueue; - try { - await unlink2(this.#path); - } catch (error) { - if (error?.code !== "ENOENT") throw error; - } - this.#state = structuredClone(EMPTY_STATE); - } - async #persist() { - const snapshot = `${JSON.stringify(this.#state, null, 2)} -`; - const operation = this.#writeQueue.then(async () => { - await mkdir2(dirname2(this.#path), { recursive: true, mode: 448 }); - const temporary = `${this.#path}.tmp`; - await writeFile2(temporary, snapshot, { encoding: "utf8", mode: 384 }); - await rename2(temporary, this.#path); - }); - this.#writeQueue = operation.then(() => void 0, () => void 0); - await operation; - } -}; - -// plugin-src/host/channels/dingtalk/connection-supervisor.mjs -var DEFAULT_RETRY_DELAYS_MS = Object.freeze([250, 1e3, 3e3, 5e3, 1e4, 3e4]); -function retryDelays(value) { - if (!Array.isArray(value) || value.length === 0) return [...DEFAULT_RETRY_DELAYS_MS]; - const valid = value.filter((delay3) => Number.isFinite(delay3) && delay3 >= 0); - return valid.length > 0 ? valid : [...DEFAULT_RETRY_DELAYS_MS]; -} -var ConnectionSupervisor = class { - #controller; - #harness; - #logger; - #retryDelays; - #healthyIntervalMs; - #setTimeout; - #clearTimeout; - #timer = null; - #running = null; - #retryIndex = 0; - #closed = false; - #started = false; - #ready; - #resolveReady; - constructor({ - controller, - harness, - logger = console, - retryDelaysMs, - healthyIntervalMs = 15e3, - setTimeoutImpl = setTimeout, - clearTimeoutImpl = clearTimeout - }) { - if (!controller || typeof controller.initialize !== "function" || typeof controller.status !== "function") { - throw new TypeError("ConnectionSupervisor requires a controller"); - } - if (!harness || typeof harness.ensureRunning !== "function") { - throw new TypeError("ConnectionSupervisor requires a Harness client"); - } - this.#controller = controller; - this.#harness = harness; - this.#logger = logger; - this.#retryDelays = retryDelays(retryDelaysMs); - this.#healthyIntervalMs = Number.isFinite(healthyIntervalMs) && healthyIntervalMs >= 0 ? healthyIntervalMs : 15e3; - this.#setTimeout = setTimeoutImpl; - this.#clearTimeout = clearTimeoutImpl; - this.#ready = new Promise((resolve7) => { - this.#resolveReady = resolve7; - }); - } - get ready() { - return this.#ready; - } - start() { - if (this.#started || this.#closed) return this; - this.#started = true; - this.#schedule(0); - return this; - } - async close() { - if (this.#closed) return; - this.#closed = true; - if (this.#timer !== null) this.#clearTimeout(this.#timer); - this.#timer = null; - await this.#running?.catch(() => void 0); - this.#resolveReady?.(null); - this.#resolveReady = null; - } - #schedule(delayMs) { - if (this.#closed) return; - this.#timer = this.#setTimeout(() => { - this.#timer = null; - void this.#run(); - }, delayMs); - this.#timer?.unref?.(); - } - async #run() { - if (this.#closed || this.#running) return; - const operation = this.#reconcile(); - this.#running = operation; - try { - await operation; - } finally { - if (this.#running === operation) this.#running = null; - } - } - async #reconcile() { - try { - await this.#harness.ensureRunning(); - if (this.#closed) return; - const status = await this.#controller.initialize(); - if (this.#closed) return; - this.#resolveReady?.(status); - this.#resolveReady = null; - const { configured, connected } = status.totals; - if (connected < configured) { - const delayMs = this.#retryDelays[Math.min(this.#retryIndex, this.#retryDelays.length - 1)]; - this.#retryIndex += 1; - this.#logger.warn?.( - `[dsh-dingtalk] ${connected}/${configured} bots connected; retrying in ${delayMs}ms` - ); - this.#schedule(delayMs); - return; - } - this.#retryIndex = 0; - this.#schedule(this.#healthyIntervalMs); - } catch (error) { - if (this.#closed) return; - const delayMs = this.#retryDelays[Math.min(this.#retryIndex, this.#retryDelays.length - 1)]; - this.#retryIndex += 1; - this.#logger.warn?.( - `[dsh-dingtalk] connection reconciliation failed; retrying in ${delayMs}ms`, - error - ); - this.#schedule(delayMs); - } - } -}; -function createConnectionSupervisor(options) { - return new ConnectionSupervisor(options); -} - -// plugin-src/host/channels/dingtalk/production.mjs -function harnessOrigin(webServer, configured) { - if (configured !== void 0) return new URL(configured); - const port = webServer?.port; - if (!Number.isInteger(port) || port < 1 || port > 65535) { - throw new Error("dsh-dingtalk requires an initialized DSH webServer port"); - } - return new URL(`http://127.0.0.1:${port}`); -} -function pluginPaths(config) { - const dshHome = resolve(config.dshHome ?? process.env.DSH_HOME ?? join(homedir(), ".dsh")); - const root = resolve(config.dataDir ?? join(dshHome, "integrations", "dsh-dingtalk")); - return { - root, - config: resolve(config.configPath ?? join(root, "config.json")), - bots: resolve(config.botsDir ?? join(root, "bots")) - }; -} -async function createProductionController(ctx, config = {}, internals = {}) { - if (!ctx?.credentials) throw new TypeError("dsh-dingtalk requires ctx.credentials"); - if (!ctx?.webServer) throw new TypeError("dsh-dingtalk requires ctx.webServer"); - const ConfigStore = internals.ConfigStore ?? DingtalkConfigStore; - const DeviceAuth = internals.DeviceAuth ?? DingtalkDeviceAuth; - const StateStore2 = internals.StateStore ?? DingtalkStateStore; - const Harness = internals.HarnessClient ?? HarnessClient; - const Controller = internals.Controller ?? DingtalkController; - const Runtime = internals.Runtime ?? DingtalkRuntime; - const createSupervisor = internals.createConnectionSupervisor ?? createConnectionSupervisor; - const logger = typeof ctx.logger === "function" ? ctx.logger("dsh-dingtalk") : ctx.logger ?? console; - const paths = pluginPaths(config); - const configStore = await new ConfigStore(paths.config).load(); - const deviceAuth = internals.deviceAuth ?? new DeviceAuth({ - baseUrl: config.registrationBaseUrl - }); - const stateStores = /* @__PURE__ */ new Map(); - const statePath = (botId) => resolve(paths.bots, botId, "state.json"); - const stateFor = async (botId) => { - let state = stateStores.get(botId); - if (!state) { - state = await new StateStore2(statePath(botId)).load(); - stateStores.set(botId, state); - } - return state; - }; - const harness = new Harness({ - baseUrl: harnessOrigin(ctx.webServer, config.harnessBaseUrl), - workspace: resolve(config.workspace ?? process.cwd()), - agentPreset: config.agentPreset ?? "standard", - autostart: false, - dshBin: config.dshBin ?? "dsh" - }); - const controller = new Controller({ - deviceAuth, - credentials: ctx.credentials, - configStore, - logger, - createRuntime: async ({ botId, config: botConfig, clientSecret }) => { - const state = await stateFor(botId); - return new Runtime({ - config: botConfig, - clientSecret, - harness, - state, - replyTimeoutMs: config.replyTimeoutMs ?? 6e5, - maxMessageChars: config.maxMessageChars ?? 4e3, - connectTimeoutMs: config.connectTimeoutMs ?? 15e3, - logger: { - error: (...args) => logger.error?.(`[${botId}]`, ...args), - warn: (...args) => logger.warn?.(`[${botId}]`, ...args), - info: (...args) => logger.info?.(`[${botId}]`, ...args), - debug: (...args) => logger.debug?.(`[${botId}]`, ...args) - } - }); - }, - deleteState: async ({ botId }) => { - const state = stateStores.get(botId); - stateStores.delete(botId); - if (state && typeof state.remove === "function") { - await state.remove(); - return; - } - try { - await unlink3(statePath(botId)); - } catch (error) { - if (error?.code !== "ENOENT") throw error; - } - } - }); - const supervisor = createSupervisor({ - controller, - harness, - logger, - retryDelaysMs: config.retryDelaysMs, - healthyIntervalMs: config.healthyIntervalMs - }).start(); - return { - controller, - ready: supervisor.ready, - async close() { - await supervisor.close(); - await controller.close(); - harness.stopManagedProcess(); - } - }; -} - -// plugin-src/host/channels/dingtalk/rpc.mjs -import QRCode from "qrcode"; - -// plugin-src/host/rpc-authority.mjs -var RPC_AUTHORITIES = /* @__PURE__ */ new Set(["loopback", "trusted-host"]); -function resolveRpcAuthority(value) { - if (value === void 0) return "loopback"; - if (RPC_AUTHORITIES.has(value)) return value; - throw new TypeError('dsh-im rpcAuthority must be "loopback" or "trusted-host"'); -} - -// plugin-src/host/channels/dingtalk/rpc.mjs -var DINGTALK_RPC_CHANNEL = "/dingtalk"; -var DINGTALK_ENDPOINTS = Object.freeze({ - status: "connection.status", - beginProvisioning: "provision.begin", - pollProvisioning: "provision.poll", - cancelProvisioning: "provision.cancel", - bindCredentials: "bot.bind-credentials", - reconnectBot: "bot.reconnect", - deleteBot: "bot.delete", - approveSender: "bot.sender.approve", - revokeSender: "bot.sender.revoke" -}); -var DINGTALK_RPC_ENDPOINTS = Object.freeze(Object.values(DINGTALK_ENDPOINTS)); -var FORBIDDEN_PUBLIC_KEYS = /* @__PURE__ */ new Set([ - "clientSecret", - "client_secret", - "deviceCode", - "device_code", - "secretRef", - "staffId", - "senderStaffId", - "verificationUrl", - "verificationUri", - "userCode" -]); -function isRecord(value) { - return value !== null && typeof value === "object" && !Array.isArray(value); -} -function exactKeys(value, allowed) { - return isRecord(value) && Object.keys(value).every((key) => allowed.includes(key)); -} -function validId(value) { - return typeof value === "string" && /^[A-Za-z0-9_-]{1,128}$/.test(value); -} -function validCredential(value, maxLength) { - return typeof value === "string" && value.trim().length > 0 && value.length <= maxLength; -} -function payloadFailure(endpoint, payload) { - if (!isRecord(payload)) return "Payload must be an object."; - if (endpoint === DINGTALK_ENDPOINTS.status) { - return exactKeys(payload, []) ? null : "connection.status does not accept fields."; - } - if (endpoint === DINGTALK_ENDPOINTS.beginProvisioning) { - return exactKeys(payload, ["locale"]) && (payload.locale === void 0 || payload.locale === "zh-CN") ? null : "provision.begin received unsupported fields."; - } - if ([DINGTALK_ENDPOINTS.pollProvisioning, DINGTALK_ENDPOINTS.cancelProvisioning].includes(endpoint)) { - return exactKeys(payload, ["attemptId"]) && validId(payload.attemptId) ? null : `${endpoint} requires an attemptId.`; - } - if (endpoint === DINGTALK_ENDPOINTS.bindCredentials) { - return exactKeys(payload, ["clientId", "clientSecret"]) && validCredential(payload.clientId, 256) && validCredential(payload.clientSecret, 1024) ? null : "bot.bind-credentials requires Client ID and Client Secret."; - } - if (endpoint === DINGTALK_ENDPOINTS.reconnectBot) { - return exactKeys(payload, ["botId"]) && validId(payload.botId) ? null : "bot.reconnect requires a botId."; - } - if (endpoint === DINGTALK_ENDPOINTS.deleteBot) { - return exactKeys(payload, ["botId", "confirm"]) && validId(payload.botId) && payload.confirm === true ? null : "bot.delete requires a botId and confirm=true."; - } - if (endpoint === DINGTALK_ENDPOINTS.approveSender) { - return exactKeys(payload, ["botId", "requestId", "confirm"]) && validId(payload.botId) && validId(payload.requestId) && payload.confirm === true ? null : "bot.sender.approve requires botId, requestId, and confirm=true."; - } - if (endpoint === DINGTALK_ENDPOINTS.revokeSender) { - return exactKeys(payload, ["botId", "senderKey", "confirm"]) && validId(payload.botId) && validId(payload.senderKey) && payload.confirm === true ? null : "bot.sender.revoke requires botId, senderKey, and confirm=true."; - } - return "Unknown DingTalk endpoint."; -} -function badRequest(message) { - return { ok: false, error: { code: "bad-request", message } }; -} -function cancelled() { - return { ok: false, error: { code: "cancelled", message: "The request was cancelled." } }; -} -function internalFailure() { - return { - ok: false, - error: { code: "dingtalk-operation-failed", message: "\u9489\u9489\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002" } - }; -} -function sanitizePublic(value) { - if (Array.isArray(value)) return value.map(sanitizePublic); - if (!isRecord(value)) return value; - const safe = {}; - for (const [key, child] of Object.entries(value)) { - if (!FORBIDDEN_PUBLIC_KEYS.has(key)) safe[key] = sanitizePublic(child); - } - return safe; -} -async function qrDataUrl(value) { - return QRCode.toDataURL(value, { - type: "image/png", - errorCorrectionLevel: "M", - margin: 2, - width: 320 - }); -} -async function withEncodedQr(value, encodeQr) { - if (!value || typeof value.verificationUrl !== "string") return sanitizePublic(value); - return sanitizePublic({ - ...value, - qrCodeDataUrl: await encodeQr(value.verificationUrl) - }); -} -async function publicStatus(status, encodeQr) { - const value = structuredClone(status); - if (value?.provisioning) { - value.provisioning = await withEncodedQr(value.provisioning, encodeQr); - } - return sanitizePublic(value); -} -function assertController(controller) { - for (const method of [ - "status", - "startProvisioning", - "registrationStatus", - "cancelProvisioning", - "bindCredentials", - "reconnectBot", - "deleteBot", - "approveSender", - "revokeSender" - ]) { - if (typeof controller?.[method] !== "function") { - throw new TypeError(`A complete DingTalk controller is required (${method})`); - } - } -} -function createDingtalkRpcHandler(controller, { encodeQr = qrDataUrl } = {}) { - assertController(controller); - const qrCache = /* @__PURE__ */ new Map(); - const cachedEncode = (url) => { - let encoded = qrCache.get(url); - if (!encoded) { - if (qrCache.size >= 16) qrCache.delete(qrCache.keys().next().value); - encoded = Promise.resolve().then(() => encodeQr(url)); - qrCache.set(url, encoded); - } - return encoded; - }; - return async (endpoint, payload, signal) => { - if (signal?.aborted) return cancelled(); - if (!DINGTALK_RPC_ENDPOINTS.includes(endpoint)) return badRequest("Unknown DingTalk endpoint."); - const invalid = payloadFailure(endpoint, payload); - if (invalid) return badRequest(invalid); - try { - let value; - if (endpoint === DINGTALK_ENDPOINTS.status) { - value = await publicStatus(await controller.status(), cachedEncode); - } else if (endpoint === DINGTALK_ENDPOINTS.beginProvisioning) { - const started = await controller.startProvisioning({ signal }); - if (signal?.aborted) { - await controller.cancelProvisioning(started.attemptId); - return cancelled(); - } - value = await withEncodedQr(started, cachedEncode); - } else if (endpoint === DINGTALK_ENDPOINTS.pollProvisioning) { - const current = await controller.registrationStatus(payload.attemptId); - if (!current) return badRequest("The provisioning attempt no longer exists."); - value = await withEncodedQr(current, cachedEncode); - } else if (endpoint === DINGTALK_ENDPOINTS.cancelProvisioning) { - value = await controller.cancelProvisioning(payload.attemptId); - if (!value) return badRequest("The provisioning attempt no longer exists."); - value = sanitizePublic(value); - } else if (endpoint === DINGTALK_ENDPOINTS.bindCredentials) { - value = await publicStatus(await controller.bindCredentials(payload), cachedEncode); - } else if (endpoint === DINGTALK_ENDPOINTS.reconnectBot) { - value = await publicStatus(await controller.reconnectBot(payload.botId), cachedEncode); - } else if (endpoint === DINGTALK_ENDPOINTS.deleteBot) { - value = await publicStatus(await controller.deleteBot(payload.botId), cachedEncode); - } else if (endpoint === DINGTALK_ENDPOINTS.approveSender) { - value = await publicStatus( - await controller.approveSender(payload.botId, payload.requestId), - cachedEncode - ); - } else { - value = await publicStatus( - await controller.revokeSender(payload.botId, payload.senderKey), - cachedEncode - ); - } - return signal?.aborted ? cancelled() : { ok: true, value }; - } catch { - return signal?.aborted ? cancelled() : internalFailure(); - } - }; -} -function installDingtalkRpc(ctx, controller, options, authority) { - if (!ctx?.connection?.rpc || typeof ctx.connection.rpc.handle !== "function") { - throw new TypeError("DSH Host Connection RPC is required"); - } - return ctx.connection.rpc.handle( - DINGTALK_RPC_CHANNEL, - createDingtalkRpcHandler(controller, options), - { authority: resolveRpcAuthority(authority) } - ); -} - -// plugin-src/host/channels/dingtalk/index.mjs -async function apply(ctx, config = {}) { - if (config?.controller) { - return installDingtalkRpc(ctx, config.controller, config.rpcOptions, config.rpcAuthority); - } - const production = await createProductionController(ctx, config, config.internals); - const disposeRpc = installDingtalkRpc( - ctx, - production.controller, - config.rpcOptions, - config.rpcAuthority - ); - ctx.effect(() => async () => { - await production.close(); - }, "dsh-dingtalk: close bot connections"); - return disposeRpc; -} - -// src/channels/shared/token-config-store.mjs -import { createHash as createHash2 } from "node:crypto"; -import { mkdir as mkdir3, readFile as readFile3, rename as rename3, unlink as unlink4, writeFile as writeFile3 } from "node:fs/promises"; -import { dirname as dirname3 } from "node:path"; -var EMPTY_DOCUMENT2 = Object.freeze({ version: 1, bots: Object.freeze([]) }); -function cleanString4(value) { - return typeof value === "string" && value.trim() ? value.trim() : null; -} -function escapePattern(value) { - return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); -} -function deriveTokenBotIdentity(platformId, { botPrefix, tokenRefPrefix }) { - const raw = cleanString4(platformId); - if (!raw) throw new TypeError("platformId is required"); - const digest2 = createHash2("sha256").update(raw).digest("hex").slice(0, 24); - return { - botId: `${botPrefix}_${digest2}`, - tokenRef: `${tokenRefPrefix}_${digest2.toUpperCase()}` - }; -} -function maskPlatformId(platformId, fallback) { - const value = cleanString4(platformId) ?? ""; - if (value.length <= 10) return value ? `${value.slice(0, 3)}\u2022\u2022\u2022` : fallback; - return `${value.slice(0, 6)}\u2022\u2022\u2022\u2022${value.slice(-4)}`; -} -var TokenBotConfigStore = class { - #path; - #channel; - #botPrefix; - #tokenRefPrefix; - #botIdPattern; - #tokenRefPattern; - #value = EMPTY_DOCUMENT2; - #writeQueue = Promise.resolve(); - constructor(path, { channel, botPrefix, tokenRefPrefix }) { - this.#path = path; - this.#channel = channel; - this.#botPrefix = botPrefix; - this.#tokenRefPrefix = tokenRefPrefix; - this.#botIdPattern = new RegExp(`^${escapePattern(botPrefix)}_[a-f0-9]{24}$`); - this.#tokenRefPattern = new RegExp(`^${escapePattern(tokenRefPrefix)}_[A-F0-9]{24}$`); - } - async load() { - try { - const normalized = this.#normalizeDocument(JSON.parse(await readFile3(this.#path, "utf8"))); - if (!normalized) throw new Error(`dsh-im ${this.#channel} config contains invalid bot data`); - this.#value = normalized; - } catch (error) { - if (error?.code !== "ENOENT") throw error; - this.#value = EMPTY_DOCUMENT2; - } - return this; - } - list() { - return structuredClone(this.#value.bots); - } - get(botId) { - const bot = this.#value.bots.find((candidate) => candidate.botId === botId); - return bot ? structuredClone(bot) : null; - } - getByPlatformId(platformId) { - const bot = this.#value.bots.find((candidate) => candidate.platformId === platformId); - return bot ? structuredClone(bot) : null; - } - async save(value) { - const normalized = this.#normalizeBot(value); - if (!normalized) throw new Error(`Refusing to persist incomplete ${this.#channel} bot data`); - return this.#mutate((bots) => { - const identityCollision = bots.find( - (bot) => bot.platformId === normalized.platformId && bot.botId !== normalized.botId - ); - const refCollision = bots.find( - (bot) => bot.tokenRef === normalized.tokenRef && bot.botId !== normalized.botId - ); - if (identityCollision || refCollision) throw new Error(`Duplicate ${this.#channel} bot identity`); - const index = bots.findIndex((bot) => bot.botId === normalized.botId); - if (index === -1) bots.push(normalized); - else bots[index] = normalized; - return structuredClone(normalized); - }); - } - async remove(botId) { - if (!this.#botIdPattern.test(botId)) throw new TypeError(`Invalid ${this.#channel} bot id`); - return this.#mutate((bots) => { - const index = bots.findIndex((bot) => bot.botId === botId); - if (index === -1) return null; - const [removed] = bots.splice(index, 1); - return structuredClone(removed); - }); - } - async clear() { - const operation = this.#writeQueue.then(async () => { - try { - await unlink4(this.#path); - } catch (error) { - if (error?.code !== "ENOENT") throw error; - } - this.#value = EMPTY_DOCUMENT2; - }); - this.#writeQueue = operation.then(() => void 0, () => void 0); - await operation; - } - #normalizeBot(value) { - if (!value || typeof value !== "object") return null; - const platformId = cleanString4(value.platformId); - const botId = cleanString4(value.botId); - const tokenRef = cleanString4(value.tokenRef); - const name2 = cleanString4(value.name); - if (!platformId || !botId || !tokenRef || !name2 || !this.#botIdPattern.test(botId) || !this.#tokenRefPattern.test(tokenRef)) return null; - const derived = deriveTokenBotIdentity(platformId, { - botPrefix: this.#botPrefix, - tokenRefPrefix: this.#tokenRefPrefix - }); - if (derived.botId !== botId || derived.tokenRef !== tokenRef) return null; - return Object.freeze({ - botId, - platformId, - tokenRef, - name: name2, - username: cleanString4(value.username), - createdAt: cleanString4(value.createdAt) ?? (/* @__PURE__ */ new Date()).toISOString(), - connectedAt: cleanString4(value.connectedAt) - }); - } - #normalizeDocument(value) { - if (!value || value.version !== 1 || !Array.isArray(value.bots)) return null; - const bots = value.bots.map((bot) => this.#normalizeBot(bot)); - if (bots.some((bot) => bot === null)) return null; - const ids = /* @__PURE__ */ new Set(); - const platformIds = /* @__PURE__ */ new Set(); - const refs = /* @__PURE__ */ new Set(); - for (const bot of bots) { - if (ids.has(bot.botId) || platformIds.has(bot.platformId) || refs.has(bot.tokenRef)) return null; - ids.add(bot.botId); - platformIds.add(bot.platformId); - refs.add(bot.tokenRef); - } - return Object.freeze({ version: 1, bots: Object.freeze(bots) }); - } - async #mutate(mutator) { - let result; - const operation = this.#writeQueue.then(async () => { - const bots = [...this.#value.bots]; - result = mutator(bots); - const document = Object.freeze({ version: 1, bots: Object.freeze(bots) }); - await this.#write(document); - this.#value = document; - }); - this.#writeQueue = operation.then(() => void 0, () => void 0); - await operation; - return result; - } - async #write(document) { - await mkdir3(dirname3(this.#path), { recursive: true, mode: 448 }); - const temporary = `${this.#path}.tmp`; - await writeFile3(temporary, `${JSON.stringify(document, null, 2)} -`, { - encoding: "utf8", - mode: 384 - }); - await rename3(temporary, this.#path); - } -}; - -// src/channels/discord/config-store.mjs -var IDENTITY_OPTIONS = Object.freeze({ - botPrefix: "discord", - tokenRefPrefix: "DSH_DISCORD_BOT_TOKEN" -}); -function deriveDiscordBotIdentity(platformId) { - return deriveTokenBotIdentity(platformId, IDENTITY_OPTIONS); -} -function maskDiscordBotId(platformId) { - return maskPlatformId(platformId, "Discord\u673A\u5668\u4EBA"); -} -var DiscordConfigStore = class extends TokenBotConfigStore { - constructor(path) { - super(path, { channel: "Discord", ...IDENTITY_OPTIONS }); - } -}; - -// src/channels/shared/token-bot-controller.mjs -function cleanString5(value) { - return typeof value === "string" && value.trim() ? value.trim() : null; -} -function safeError2(code, message) { - return Object.freeze({ code, message }); -} -var TokenBotController = class { - #descriptor; - #credentials; - #configStore; - #inspectToken; - #deriveIdentity; - #maskPlatformId; - #createRuntime; - #deleteState; - #logger; - #runtimes = /* @__PURE__ */ new Map(); - #errors = /* @__PURE__ */ new Map(); - #transitions = /* @__PURE__ */ new Map(); - #revision = 0; - #closed = false; - constructor({ - descriptor, - credentials, - configStore, - inspectToken, - deriveIdentity, - maskPlatformId: maskPlatformId2, - createRuntime, - deleteState = async () => { - }, - logger = console - }) { - if (!descriptor?.key || !descriptor?.label || !descriptor?.connectionLabel) { - throw new TypeError("TokenBotController requires a channel descriptor"); - } - if (!credentials || typeof credentials.resolve !== "function" || typeof credentials.set !== "function" || typeof credentials.unset !== "function") { - throw new TypeError(`${descriptor.label} requires the DSH credential provider`); - } - if (!configStore || typeof configStore.list !== "function" || typeof configStore.save !== "function" || typeof configStore.remove !== "function") { - throw new TypeError(`${descriptor.label} requires a config store`); - } - if (typeof inspectToken !== "function" || typeof deriveIdentity !== "function" || typeof maskPlatformId2 !== "function" || typeof createRuntime !== "function") { - throw new TypeError(`${descriptor.label} controller dependencies are incomplete`); - } - this.#descriptor = descriptor; - this.#credentials = credentials; - this.#configStore = configStore; - this.#inspectToken = inspectToken; - this.#deriveIdentity = deriveIdentity; - this.#maskPlatformId = maskPlatformId2; - this.#createRuntime = createRuntime; - this.#deleteState = deleteState; - this.#logger = logger; - } - async initialize() { - if (this.#closed) return this.status(); - for (const config of this.#configStore.list()) { - await this.#withBotTransition(config.botId, async () => { - if (this.#closed || this.#runtimes.get(config.botId)?.status?.ready) return; - const token = await this.#resolveToken(config.tokenRef); - if (!token) { - this.#errors.set(config.botId, safeError2( - "missing-token", - `${this.#descriptor.label}\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u63A5\u5165\u3002` - )); - return; - } - try { - await this.#startRuntime(config, token); - this.#errors.delete(config.botId); - } catch (error) { - this.#errors.set(config.botId, safeError2( - "connection-failed", - `${this.#descriptor.label}\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002` - )); - this.#logger.warn?.( - `[dsh-im:${this.#descriptor.key}] bot ${config.botId} failed to initialize:`, - error - ); - } finally { - this.#touch(); - } - }); - } - return this.status(); - } - async bindCredentials({ token } = {}) { - if (this.#closed) throw new Error(`${this.#descriptor.label} controller is closed`); - const normalizedToken = cleanString5(token); - if (!normalizedToken) throw new TypeError(`${this.#descriptor.label} Bot Token is required`); - const inspected = await this.#inspectToken(normalizedToken); - const platformId = cleanString5(inspected?.platformId); - const name2 = cleanString5(inspected?.name); - if (!platformId || !name2) throw new Error(`${this.#descriptor.label} returned an invalid bot identity`); - const identity = this.#deriveIdentity(platformId); - await this.#withBotTransition(identity.botId, async () => { - if (this.#closed) throw new Error(`${this.#descriptor.label} controller is closed`); - const previousConfig = this.#configStore.getByPlatformId(platformId); - const previousToken = await this.#credentials.resolve(identity.tokenRef).catch(() => void 0); - const config = { - botId: identity.botId, - platformId, - tokenRef: identity.tokenRef, - name: name2, - username: cleanString5(inspected.username), - createdAt: previousConfig?.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(), - connectedAt: (/* @__PURE__ */ new Date()).toISOString() - }; - await this.#credentials.set(identity.tokenRef, normalizedToken); - try { - await this.#configStore.save(config); - } catch (error) { - await this.#restoreCredential(identity.tokenRef, previousToken); - throw error; - } - try { - await this.#startRuntime(config, normalizedToken); - this.#errors.delete(identity.botId); - } catch (error) { - this.#errors.set(identity.botId, safeError2( - "connection-failed", - `${this.#descriptor.label}\u673A\u5668\u4EBA\u5DF2\u63A5\u5165\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002` - )); - this.#logger.warn?.( - `[dsh-im:${this.#descriptor.key}] bot ${identity.botId} credential connection failed:`, - error - ); - } - this.#touch(); - }); - return this.status(); - } - async reconnectBot(botId) { - const config = this.#configStore.get(botId); - if (!config) throw new Error(`Unknown ${this.#descriptor.label} bot`); - await this.#withBotTransition(botId, async () => { - const token = await this.#resolveToken(config.tokenRef); - if (!token) throw new Error(`${this.#descriptor.label} bot token is missing`); - try { - await this.#startRuntime(config, token); - this.#errors.delete(botId); - } catch (error) { - this.#errors.set(botId, safeError2( - "connection-failed", - `${this.#descriptor.label}\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002` - )); - throw error; - } finally { - this.#touch(); - } - }); - return this.status(); - } - async deleteBot(botId) { - const config = this.#configStore.get(botId); - if (!config) throw new Error(`Unknown ${this.#descriptor.label} bot`); - await this.#withBotTransition(botId, async () => { - const previous = await this.#credentials.resolve(config.tokenRef).catch(() => void 0); - await this.#stopRuntime(botId); - try { - await this.#credentials.unset(config.tokenRef); - await this.#configStore.remove(botId); - } catch (error) { - if (previous?.value) { - await this.#credentials.set(config.tokenRef, previous.value).catch(() => void 0); - await this.#startRuntime(config, previous.value).catch(() => void 0); - } - throw new Error(`Unable to remove the ${this.#descriptor.label} bot safely.`, { cause: error }); - } - await this.#deleteState({ botId, config }).catch((error) => { - this.#logger.warn?.( - `[dsh-im:${this.#descriptor.key}] bot ${botId} state cleanup failed:`, - error - ); - }); - this.#errors.delete(botId); - this.#touch(); - }); - return this.status(); - } - status() { - const bots = this.#configStore.list().map((config) => { - const runtimeStatus2 = this.#runtimes.get(config.botId)?.status ?? null; - const connected = runtimeStatus2?.ready === true && runtimeStatus2.connectionState === "connected" && runtimeStatus2.harnessReachable === true; - const state = connected ? "connected" : runtimeStatus2?.connectionState === "connecting" ? "connecting" : this.#errors.has(config.botId) || runtimeStatus2?.connectionState === "failed" ? "error" : "offline"; - return { - botId: config.botId, - state, - connected, - configured: true, - bot: { - name: config.name, - username: config.username, - idMasked: this.#maskPlatformId(config.platformId) - }, - health: { - status: connected ? "healthy" : state === "error" ? "error" : "offline", - summary: connected ? `${this.#descriptor.label}${this.#descriptor.connectionLabel}\u8FD0\u884C\u6B63\u5E38` : state === "error" ? `${this.#descriptor.label}\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5` : `${this.#descriptor.label}\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF`, - lastCheckedAt: runtimeStatus2?.lastCheckedAt ?? null, - lastConnectedAt: runtimeStatus2?.lastConnectedAt ?? null - }, - stats: { - messagesReceived: runtimeStatus2?.messagesReceived ?? 0, - messagesReplied: runtimeStatus2?.messagesReplied ?? 0 - }, - error: structuredClone(this.#errors.get(config.botId) ?? null) - }; - }); - const connectedCount = bots.filter((bot) => bot.connected).length; - return { - schemaVersion: 1, - revision: this.#revision, - state: bots.length === 0 ? "disconnected" : connectedCount === bots.length ? "connected" : connectedCount > 0 ? "degraded" : "offline", - bots, - totals: { configured: bots.length, connected: connectedCount } - }; - } - async close() { - if (this.#closed) return; - this.#closed = true; - await Promise.allSettled([...this.#transitions.values()]); - await Promise.allSettled([...this.#runtimes.keys()].map((botId) => this.#stopRuntime(botId))); - } - async #startRuntime(config, token) { - if (this.#closed) throw new Error(`${this.#descriptor.label} controller is closed`); - await this.#stopRuntime(config.botId); - if (this.#closed) throw new Error(`${this.#descriptor.label} controller is closed`); - const runtime = await this.#createRuntime({ botId: config.botId, config, token }); - if (!runtime || typeof runtime.start !== "function" || typeof runtime.stop !== "function") { - throw new TypeError(`createRuntime returned an invalid ${this.#descriptor.label} runtime`); - } - this.#runtimes.set(config.botId, runtime); - try { - await runtime.start(); - } catch (error) { - await runtime.stop().catch(() => void 0); - this.#runtimes.delete(config.botId); - throw error; - } - } - async #stopRuntime(botId) { - const runtime = this.#runtimes.get(botId); - this.#runtimes.delete(botId); - await runtime?.stop().catch((error) => { - this.#logger.warn?.( - `[dsh-im:${this.#descriptor.key}] bot ${botId} failed to stop cleanly:`, - error - ); - }); - } - async #resolveToken(ref) { - const result = await this.#credentials.resolve(ref).catch(() => void 0); - return cleanString5(result?.value); - } - async #restoreCredential(ref, previous) { - if (previous?.value) await this.#credentials.set(ref, previous.value).catch(() => void 0); - else await this.#credentials.unset(ref).catch(() => void 0); - } - #withBotTransition(botId, operation) { - const previous = this.#transitions.get(botId) ?? Promise.resolve(); - const current = previous.catch(() => void 0).then(operation); - const settled = current.finally(() => { - if (this.#transitions.get(botId) === settled) this.#transitions.delete(botId); - }); - this.#transitions.set(botId, settled); - return settled; - } - #touch() { - this.#revision += 1; - } -}; - -// src/channels/discord/discord-api.mjs -var DEFAULT_BASE_URL = "https://discord.com/api/v10/"; -function cleanString6(value) { - return typeof value === "string" && value.trim() ? value.trim() : null; -} -function requestSignal(signal, timeoutMs) { - const timeout = AbortSignal.timeout(timeoutMs); - return signal ? AbortSignal.any([signal, timeout]) : timeout; -} -function delay(ms, signal) { - return new Promise((resolve7, reject) => { - if (signal?.aborted) { - reject(signal.reason ?? new DOMException("Aborted", "AbortError")); - return; - } - const timer = setTimeout(resolve7, ms); - timer?.unref?.(); - signal?.addEventListener("abort", () => { - clearTimeout(timer); - reject(signal.reason ?? new DOMException("Aborted", "AbortError")); - }, { once: true }); - }); -} -function snowflake(value, name2) { - const id = cleanString6(value); - if (!id || !/^\d{5,30}$/.test(id)) throw new TypeError(`Invalid Discord ${name2}`); - return id; -} -function validDiscordToken(value) { - return typeof value === "string" && /^[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{4,}\.[A-Za-z0-9_-]{20,}$/.test(value.trim()); -} -var DiscordApi = class { - #token; - #fetch; - #baseUrl; - constructor({ token, fetchImpl = fetch, baseUrl = DEFAULT_BASE_URL }) { - if (!validDiscordToken(token)) throw new TypeError("Discord Bot Token is invalid"); - if (typeof fetchImpl !== "function") throw new TypeError("DiscordApi requires fetch"); - this.#token = token.trim(); - this.#fetch = fetchImpl; - this.#baseUrl = new URL(baseUrl); - } - getCurrentUser(options = {}) { - return this.#request("users/@me", { ...options, method: "GET" }); - } - getGatewayBot(options = {}) { - return this.#request("gateway/bot", { ...options, method: "GET" }); - } - createMessage({ channelId, content, replyToMessageId, signal }) { - return this.#request(`channels/${snowflake(channelId, "channel id")}/messages`, { - method: "POST", - signal, - body: { - content, - allowed_mentions: { parse: [], replied_user: false }, - ...replyToMessageId ? { - message_reference: { - message_id: snowflake(replyToMessageId, "message id"), - channel_id: snowflake(channelId, "channel id"), - fail_if_not_exists: false - } - } : {} - } - }); - } - editMessage({ channelId, messageId, content, signal }) { - return this.#request( - `channels/${snowflake(channelId, "channel id")}/messages/${snowflake(messageId, "message id")}`, - { - method: "PATCH", - signal, - body: { content, allowed_mentions: { parse: [], replied_user: false } } - } - ); - } - sendTyping({ channelId, signal }) { - return this.#request(`channels/${snowflake(channelId, "channel id")}/typing`, { - method: "POST", - signal, - expectBody: false - }); - } - async #request(path, { - method, - body, - signal, - timeoutMs = 15e3, - expectBody = true, - retry = true - }) { - let response; - try { - response = await this.#fetch(new URL(path, this.#baseUrl), { - method, - headers: { - authorization: `Bot ${this.#token}`, - "content-type": "application/json", - "user-agent": "DeepSeek-Harness-dsh-im (https://github.com/xmanrui/dsh-im, 0.1.0)" - }, - ...body === void 0 ? {} : { body: JSON.stringify(body) }, - signal: requestSignal(signal, timeoutMs), - redirect: "error" - }); - } catch (error) { - if (error?.name === "AbortError" || error?.name === "TimeoutError") throw error; - throw new Error(`Discord ${method} transport failed`); - } - let parsed = null; - if (expectBody || response.status === 429 || !response.ok) { - try { - parsed = await response.json(); - } catch { - if (expectBody) throw new Error(`Discord ${method} returned invalid JSON`); - } - } - if (response.status === 429 && retry) { - const retryAfterMs = Math.min(1e4, Math.max(50, Number(parsed?.retry_after) * 1e3 || 1e3)); - await delay(retryAfterMs, signal); - return this.#request(path, { method, body, signal, timeoutMs, expectBody, retry: false }); - } - if (!response.ok) { - const error = new Error(cleanString6(parsed?.message) ?? `Discord API failed with HTTP ${response.status}`); - error.code = `discord-${response.status}`; - throw error; - } - return expectBody ? parsed : null; - } -}; -async function inspectDiscordToken(token, options = {}) { - const api = new DiscordApi({ token, ...options }); - const bot = await api.getCurrentUser(); - if (!bot?.id || bot?.bot !== true) throw new Error("Discord token does not belong to a bot"); - return { - platformId: String(bot.id), - name: cleanString6(bot.global_name) ?? cleanString6(bot.username) ?? "Discord\u673A\u5668\u4EBA", - username: cleanString6(bot.username) - }; -} - -// src/channels/shared/text-harness-bridge.mjs -function cleanText(value) { - return typeof value === "string" ? value.trim() : ""; -} -function createTextBridgeStatus() { - return { - messagesReceived: 0, - messagesReplied: 0, - messagesRejected: 0, - lastMessageAt: null, - lastReplyAt: null, - lastRejectedAt: null, - lastError: null - }; -} -var TextHarnessBridge = class { - #descriptor; - #bot; - #harness; - #state; - #status; - #logger; - #replyTimeoutMs; - #queues = /* @__PURE__ */ new Map(); - constructor({ - descriptor, - bot, - harness, - state, - status = createTextBridgeStatus(), - logger = console, - replyTimeoutMs = 6e5 - }) { - if (!descriptor?.key || !descriptor?.label) throw new TypeError("A channel descriptor is required"); - if (!bot || typeof bot.sendText !== "function") throw new TypeError("A bot client is required"); - if (!harness || !state) throw new TypeError("Harness client and state store are required"); - this.#descriptor = descriptor; - this.#bot = bot; - this.#harness = harness; - this.#state = state; - this.#status = status; - this.#logger = logger; - this.#replyTimeoutMs = replyTimeoutMs; - } - get status() { - return structuredClone(this.#status); - } - accept(message) { - const conversationId = cleanText(message?.conversationId); - const kind = message?.kind === "group" ? "group" : "direct"; - const key = `${kind}:${conversationId}`; - const previous = this.#queues.get(key) ?? Promise.resolve(); - const current = previous.catch(() => void 0).then(() => this.#process({ ...message, kind, conversationId })).finally(() => { - if (this.#queues.get(key) === current) this.#queues.delete(key); - }); - this.#queues.set(key, current); - return current; - } - async waitForIdle() { - await Promise.allSettled([...this.#queues.values()]); - } - async #process(message) { - const messageId = cleanText(message.messageId); - const senderId = cleanText(message.senderId); - if (!messageId || !senderId || !message.conversationId || message.senderIsBot === true) return; - if (this.#state.hasSeen(messageId)) return; - this.#status.messagesReceived += 1; - this.#status.lastMessageAt = (/* @__PURE__ */ new Date()).toISOString(); - if (message.kind === "group" && message.addressed !== true) { - this.#status.messagesRejected += 1; - this.#status.lastRejectedAt = (/* @__PURE__ */ new Date()).toISOString(); - return; - } - const target = message.replyTarget; - const text = cleanText(message.content); - try { - if (!text) { - await this.#bot.sendText(target, "\u76EE\u524D\u4EC5\u652F\u6301\u6587\u5B57\u6D88\u606F\u3002"); - await this.#state.markSeen(messageId); - return; - } - const command = text.toLowerCase(); - if (command === "/help") { - await this.#bot.sendText(target, [ - `${this.#descriptor.label}\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002`, - "", - "\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002", - "/new \u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD", - "/status \u68C0\u67E5\u8FDE\u63A5\u72B6\u6001", - "/help \u663E\u793A\u672C\u5E2E\u52A9" - ].join("\n")); - await this.#state.markSeen(messageId); - return; - } - if (command === "/status") { - await this.#harness.ensureRunning(); - await this.#bot.sendText(target, `${this.#descriptor.label}\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002`); - await this.#state.markSeen(messageId); - return; - } - const conversationKey6 = `${message.kind}:${message.conversationId}`; - if (command === "/new") { - await this.#state.clearSession(conversationKey6); - await this.#bot.sendText(target, "\u5DF2\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002\u8BF7\u53D1\u9001\u4F60\u7684\u95EE\u9898\u3002"); - await this.#state.markSeen(messageId); - return; - } - let sessionId = this.#state.sessionFor(conversationKey6); - if (!sessionId || !await this.#harness.sessionExists(sessionId)) { - sessionId = await this.#harness.createSession(); - await this.#state.setSession(conversationKey6, sessionId); - } - await this.#bot.sendTyping?.(target).catch((error) => { - this.#logger.warn?.(`[dsh-im:${this.#descriptor.key}] typing indicator failed:`, error); - }); - let stream = null; - let streamFinished = false; - if (typeof this.#bot.openStream === "function") { - try { - stream = await this.#bot.openStream(target); - } catch (error) { - this.#logger.warn?.( - `[dsh-im:${this.#descriptor.key}] unable to start a streamed reply; using text:`, - error - ); - } - } - const answer = await this.#harness.ask(sessionId, text, { - timeoutMs: this.#replyTimeoutMs, - onUpdate: stream ? async (update) => { - const progress = update.type === "text" ? update.text : update.type === "tool" ? `\u6B63\u5728\u4F7F\u7528${update.name}\u2026` : update.text; - if (progress) await stream.update(progress); - } : void 0 - }); - if (stream) { - try { - await stream.finish(answer); - streamFinished = true; - } catch (error) { - stream.cancel?.(); - this.#logger.warn?.( - `[dsh-im:${this.#descriptor.key}] streamed reply finalization failed; using text:`, - error - ); - } - } - if (!streamFinished) await this.#bot.sendText(target, answer); - await this.#state.markSeen(messageId); - this.#status.messagesReplied += 1; - this.#status.lastReplyAt = (/* @__PURE__ */ new Date()).toISOString(); - this.#status.lastError = null; - } catch (error) { - this.#status.lastError = error?.message ?? String(error); - this.#logger.error?.(`[dsh-im:${this.#descriptor.key}] failed to process a message:`, error); - try { - await this.#bot.sendText(target, "\u6D88\u606F\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"); - await this.#state.markSeen(messageId); - } catch (sendError) { - this.#logger.error?.( - `[dsh-im:${this.#descriptor.key}] failed to send the safe error reply:`, - sendError - ); - } - } - } -}; - -// src/channels/discord/discord-bridge.mjs -var DISCORD_DESCRIPTOR = Object.freeze({ - key: "discord", - label: "Discord", - connectionLabel: " Gateway \u957F\u8FDE\u63A5" -}); -var DiscordHarnessBridge = class extends TextHarnessBridge { - constructor(options) { - super({ descriptor: DISCORD_DESCRIPTOR, ...options }); - } -}; - -// src/channels/discord/discord-controller.mjs -var DiscordController = class extends TokenBotController { - constructor(options) { - super({ - ...options, - descriptor: DISCORD_DESCRIPTOR, - inspectToken: options.inspectToken ?? inspectDiscordToken, - deriveIdentity: deriveDiscordBotIdentity, - maskPlatformId: maskDiscordBotId - }); - } -}; - -// src/channels/weixin/harness-client.mjs -import { spawn as spawn2 } from "node:child_process"; -import { randomUUID as randomUUID6 } from "node:crypto"; -var sleep2 = (ms) => new Promise((resolve7) => setTimeout(resolve7, ms)); -function assistantMessageText2(event) { - return (event?.data?.message?.content ?? []).filter((part) => part.type === "text" && typeof part.text === "string").map((part) => part.text).join("\n").trim(); -} -var HarnessReplyTracker2 = class { - #promptRpcId; - #lastSeq; - #openTurn = null; - #targetTurn = null; - #stepText = /* @__PURE__ */ new Map(); - #latestText = ""; - #finished = false; - #reason = null; - constructor({ promptRpcId, afterSeq = -1 }) { - this.#promptRpcId = promptRpcId; - this.#lastSeq = afterSeq; - } - get finished() { - return this.#finished; - } - get answer() { - return this.#latestText.trim(); - } - get reason() { - return this.#reason; - } - consume(entries) { - let update = null; - const ordered = [...entries].map((entry) => entry?.event ?? entry).filter(Boolean).sort((left, right) => (left.seq ?? -1) - (right.seq ?? -1)); - for (const event of ordered) { - const seq = event.seq ?? -1; - if (seq <= this.#lastSeq) continue; - this.#lastSeq = seq; - if (event.type === "turn/start") this.#openTurn = event.data?.turn ?? null; - if (event.type === "user/message" && event.data?.source?.rpcId === this.#promptRpcId) { - this.#targetTurn = this.#openTurn; - continue; - } - if (this.#targetTurn === null) continue; - if (event.type === "turn/end") { - if (event.data?.turn !== this.#targetTurn) continue; - this.#finished = true; - this.#reason = event.data?.reason ?? null; - this.#openTurn = null; - continue; - } - if (event.data?.turn !== this.#targetTurn) continue; - if (event.type === "assistant/chunk" && event.data?.chunk?.type === "text-delta") { - const step = event.data?.step ?? 0; - const index = event.data.chunk.index ?? 0; - const key = `${step}:${index}`; - this.#stepText.set(key, (this.#stepText.get(key) ?? "") + event.data.chunk.text); - const prefix = `${step}:`; - const text = [...this.#stepText.entries()].filter(([partKey]) => partKey.startsWith(prefix)).sort(([left], [right]) => Number(left.split(":")[1]) - Number(right.split(":")[1])).map(([, part]) => part).join("\n").trim(); - if (text && text !== this.#latestText) { - this.#latestText = text; - update = { type: "text", text }; - } - continue; - } - if (event.type === "assistant/message") { - const text = assistantMessageText2(event); - if (text && text !== this.#latestText) { - this.#latestText = text; - update = { type: "text", text }; - } - continue; - } - if (event.type === "tool/call") { - update = { type: "tool", name: event.data?.name ?? "\u5DE5\u5177" }; - } else if (event.type === "tool/result") { - update = { type: "status", text: "\u6B63\u5728\u6574\u7406\u7ED3\u679C\u2026" }; - } - } - return update; - } -}; -var HarnessRpcError2 = class extends Error { - constructor(method, error) { - super(`${method}: ${error?.message ?? "unknown Harness RPC error"}`); - this.name = "HarnessRpcError"; - this.method = method; - this.code = error?.code ?? "internal"; - this.details = error?.details ?? {}; - } -}; -var HarnessClient2 = class { - #baseUrl; - #workspace; - #agentPreset; - #autostart; - #dshBin; - #managedProcess = null; - constructor({ baseUrl, workspace, agentPreset = "standard", autostart = false, dshBin = "dsh" }) { - this.#baseUrl = new URL(baseUrl); - this.#workspace = workspace; - this.#agentPreset = agentPreset; - this.#autostart = autostart; - this.#dshBin = dshBin; - } - async rpc(method, payload = {}, timeoutMs = 3e4, options = {}) { - const rpcId = options.rpcId ?? `weixin-${randomUUID6()}`; - const response = await fetch(new URL(`/api/${method}`, this.#baseUrl), { - method: "POST", - headers: { "content-type": "application/json" }, - body: JSON.stringify({ type: "client-request", rpcId, method, payload }), - signal: AbortSignal.timeout(timeoutMs) - }); - if (!response.ok) throw new Error(`Harness transport ${method} failed: HTTP ${response.status}`); - const body = await response.json(); - if (body?.type !== "server-response" || body?.rpcId !== rpcId) { - throw new Error(`Harness returned an invalid response for ${method}`); - } - if (!body.result?.ok) throw new HarnessRpcError2(method, body.result?.error); - return body.result.value; - } - async health() { - await this.rpc("host.describe", {}, 5e3); - return true; - } - async ensureRunning() { - try { - return await this.health(); - } catch (firstError) { - if (!this.#autostart) throw firstError; - } - if (!this.#managedProcess || this.#managedProcess.exitCode !== null) { - const port = this.#baseUrl.port || (this.#baseUrl.protocol === "https:" ? "443" : "80"); - this.#managedProcess = spawn2(this.#dshBin, [ - "web", - "--host", - this.#baseUrl.hostname, - "--port", - port - ], { - cwd: this.#workspace, - env: process.env, - stdio: ["ignore", "inherit", "inherit"] - }); - this.#managedProcess.on("error", (error) => { - console.error("[dsh-weixin] failed to start Harness:", error.message); - }); - } - const deadline = Date.now() + 6e4; - let lastError; - while (Date.now() < deadline) { - await sleep2(1e3); - try { - return await this.health(); - } catch (error) { - lastError = error; - } - } - throw new Error(`Harness did not become ready: ${lastError?.message ?? "timeout"}`); - } - async workspaceId() { - const { items } = await this.rpc("workspace.list", {}); - const existing = items.find((item) => item.path === this.#workspace); - if (existing) return existing.workspaceId; - const created = await this.rpc("workspace.create", { path: this.#workspace }); - return created.workspace.workspaceId; - } - async createSession() { - await this.ensureRunning(); - const workspaceId = await this.workspaceId(); - const created = await this.rpc("session.create", { - workspaceId, - agentPreset: this.#agentPreset - }); - return created.sessionId; - } - async sessionExists(sessionId) { - try { - await this.rpc("session.history", { sessionId, maxMessages: 1 }); - return true; - } catch (error) { - if (error instanceof HarnessRpcError2 && error.code === "session-not-found") return false; - throw error; - } - } - async ask(sessionId, text, options = {}) { - if (typeof options === "number") options = { timeoutMs: options }; - const timeoutMs = options.timeoutMs ?? 6e5; - const onUpdate = typeof options.onUpdate === "function" ? options.onUpdate : null; - await this.ensureRunning(); - const before = await this.rpc("session.history", { sessionId, maxMessages: 1 }); - const baselineSeq = Math.max(-1, ...(before.events ?? []).map(({ event }) => event.seq ?? -1)); - const promptRpcId = `weixin-${randomUUID6()}`; - const tracker = new HarnessReplyTracker2({ promptRpcId, afterSeq: baselineSeq }); - await this.rpc("session.prompt", { - sessionId, - mode: "queue", - content: [{ type: "text", text }], - clientTimeZone: Intl.DateTimeFormat().resolvedOptions().timeZone - }, 3e4, { rpcId: promptRpcId }); - const deadline = Date.now() + timeoutMs; - while (Date.now() < deadline) { - await sleep2(300); - const history = await this.rpc("session.history", { sessionId, maxMessages: 50 }); - const update = tracker.consume(history.events ?? []); - if (update && onUpdate) { - try { - await onUpdate(update); - } catch (error) { - console.warn("[dsh-weixin] ignored a progress update failure:", error.message); - } - } - if (!tracker.finished) continue; - if (tracker.answer) return tracker.answer; - throw new Error( - `Harness turn ended without a text reply${tracker.reason ? ` (${JSON.stringify(tracker.reason)})` : ""}` - ); - } - throw new Error(`Harness reply timed out after ${Math.round(timeoutMs / 1e3)} seconds`); - } - stopManagedProcess() { - if (this.#managedProcess?.exitCode === null) this.#managedProcess.kill("SIGTERM"); - } -}; - -// src/channels/discord/harness-client.mjs -var DiscordHarnessClient = class extends HarnessClient2 { -}; - -// src/channels/shared/editable-message-stream.mjs -function splitMessageText(value, limit) { - const text = typeof value === "string" ? value.trim() : ""; - if (!text) return []; - const chunks = []; - let remaining = text; - while (remaining.length > limit) { - let cut = remaining.lastIndexOf("\n", limit); - if (cut < Math.floor(limit * 0.55)) cut = remaining.lastIndexOf(" ", limit); - if (cut < Math.floor(limit * 0.55)) cut = limit; - chunks.push(remaining.slice(0, cut).trim()); - remaining = remaining.slice(cut).trimStart(); - } - if (remaining) chunks.push(remaining); - return chunks; -} -function createEditableMessageStream({ - initialText = "\u6B63\u5728\u5904\u7406\u2026", - limit, - updateIntervalMs = 800, - create, - edit, - sendRemainder, - logger = console -}) { - let messageId; - let pending = null; - let timer = null; - let inFlight = null; - let closed = false; - let lastSent = initialText; - const schedule = () => { - if (closed || timer !== null || inFlight || !pending) return; - timer = setTimeout(() => { - timer = null; - const text = pending; - pending = null; - const next = splitMessageText(text, limit)[0] ?? initialText; - inFlight = Promise.resolve(next === lastSent ? void 0 : edit(messageId, next)).then(() => { - lastSent = next; - }).catch((error) => logger.warn?.("[dsh-im] streamed message update failed:", error)).finally(() => { - inFlight = null; - schedule(); - }); - }, updateIntervalMs); - timer?.unref?.(); - }; - return { - async start() { - messageId = await create(initialText); - return this; - }, - update(text) { - if (closed || typeof text !== "string" || !text.trim()) return; - pending = text; - schedule(); - }, - async finish(text) { - if (closed) throw new Error("Message stream is already closed"); - closed = true; - if (timer !== null) clearTimeout(timer); - timer = null; - pending = null; - await inFlight?.catch(() => void 0); - const chunks = splitMessageText(text, limit); - const first = chunks[0] ?? "\u5904\u7406\u5B8C\u6210\u3002"; - if (first !== lastSent) await edit(messageId, first); - lastSent = first; - for (const chunk of chunks.slice(1)) await sendRemainder(chunk); - }, - cancel() { - closed = true; - pending = null; - if (timer !== null) clearTimeout(timer); - timer = null; - } - }; -} - -// src/channels/discord/discord-runtime.mjs -var DISCORD_GATEWAY_INTENTS = 1 << 0 | 1 << 9 | 1 << 12; -var RECONNECT_DELAYS_MS = Object.freeze([1e3, 3e3, 5e3, 1e4, 3e4]); -function socketUrl(value) { - const url = new URL(value); - if (url.protocol !== "wss:") throw new Error("Discord returned an insecure Gateway URL"); - url.searchParams.set("v", "10"); - url.searchParams.set("encoding", "json"); - return url.href; -} -function addSocketListener(socket, event, listener) { - if (typeof socket.addEventListener === "function") socket.addEventListener(event, listener); - else if (typeof socket.on === "function") socket.on(event, listener); - else throw new TypeError("Discord WebSocket does not support events"); -} -function eventData(event) { - if (typeof event === "string") return event; - if (typeof event?.data === "string") return event.data; - if (Buffer.isBuffer(event)) return event.toString("utf8"); - if (Buffer.isBuffer(event?.data)) return event.data.toString("utf8"); - return null; -} -function gatewayCloseError(code) { - if (code === 4004) { - const error2 = new Error("Discord Bot Token \u65E0\u6548\uFF0C\u8BF7\u91CD\u65B0\u586B\u5199\u3002"); - error2.code = "discord-401"; - return error2; - } - if (code === 4013 || code === 4014) { - const error2 = new Error("Discord Gateway Intents \u914D\u7F6E\u4E0D\u6B63\u786E\uFF0C\u8BF7\u68C0\u67E5 Developer Portal \u7684 Bot \u8BBE\u7F6E\u3002"); - error2.code = "discord-intents"; - return error2; - } - const error = new Error(`Discord Gateway closed (${code || "unknown"})`); - error.code = "discord-gateway-closed"; - return error; -} -function stripBotMention(text, botId) { - if (typeof text !== "string") return ""; - return text.replace(new RegExp(`<@!?${botId}>`, "g"), "").trim(); -} -function normalizeDiscordMessage(message, botId) { - if (!message?.id || !message?.channel_id || !message?.author?.id) return null; - const direct = !message.guild_id; - const addressed = direct || message.mentions?.some((mention) => String(mention?.id) === String(botId)); - return { - messageId: String(message.id), - senderId: String(message.author.id), - senderIsBot: message.author.bot === true, - kind: direct ? "direct" : "group", - conversationId: String(message.channel_id), - content: stripBotMention(message.content ?? "", botId), - addressed, - replyTarget: { - channelId: String(message.channel_id), - replyToMessageId: String(message.id) - } - }; -} -var DiscordBotClient = class { - #api; - #signal; - constructor({ api, signal }) { - this.#api = api; - this.#signal = signal; - } - async sendText(target, text) { - const chunks = splitMessageText(text, 1900); - let result = null; - for (const [index, chunk] of chunks.entries()) { - result = await this.#api.createMessage({ - channelId: target.channelId, - content: chunk, - replyToMessageId: index === 0 ? target.replyToMessageId : void 0, - signal: this.#signal - }); - } - return result; - } - sendTyping(target) { - return this.#api.sendTyping({ channelId: target.channelId, signal: this.#signal }); - } - async openStream(target) { - const stream = createEditableMessageStream({ - limit: 1900, - create: async (content) => { - const message = await this.#api.createMessage({ - channelId: target.channelId, - content, - replyToMessageId: target.replyToMessageId, - signal: this.#signal - }); - return message.id; - }, - edit: (messageId, content) => this.#api.editMessage({ - channelId: target.channelId, - messageId, - content, - signal: this.#signal - }), - sendRemainder: (content) => this.#api.createMessage({ - channelId: target.channelId, - content, - signal: this.#signal - }) - }); - return stream.start(); - } -}; -function createDiscordRuntimeStatus() { - return { - startedAt: null, - ready: false, - connectionState: "idle", - harnessReachable: false, - lastCheckedAt: null, - lastConnectedAt: null, - lastError: null, - ...createTextBridgeStatus() - }; -} -var DiscordRuntime = class { - #config; - #token; - #harness; - #state; - #logger; - #replyTimeoutMs; - #connectTimeoutMs; - #createApi; - #createWebSocket; - #random; - #status = createDiscordRuntimeStatus(); - #api = null; - #bridge = null; - #abortController = null; - #socket = null; - #gatewayUrl = null; - #resumeUrl = null; - #sessionId = null; - #sequence = null; - #heartbeatTimer = null; - #heartbeatAcked = true; - #reconnectTimer = null; - #reconnectAttempt = 0; - #generation = 0; - #stopped = true; - #starting = null; - constructor({ - config, - token, - harness, - state, - logger = console, - replyTimeoutMs = 6e5, - connectTimeoutMs = 2e4, - createApi = (options) => new DiscordApi(options), - createWebSocket = (url) => new WebSocket(url), - random = Math.random - }) { - if (!config || !token || !harness || !state) { - throw new TypeError("DiscordRuntime requires config, token, Harness, and state"); - } - if (typeof createWebSocket !== "function") throw new TypeError("DiscordRuntime requires WebSocket"); - this.#config = config; - this.#token = token; - this.#harness = harness; - this.#state = state; - this.#logger = logger; - this.#replyTimeoutMs = replyTimeoutMs; - this.#connectTimeoutMs = connectTimeoutMs; - this.#createApi = createApi; - this.#createWebSocket = createWebSocket; - this.#random = random; - } - get status() { - return structuredClone(this.#status); - } - async start() { - if (this.#status.ready && this.#socket) return this.status; - if (this.#starting) return this.#starting; - this.#starting = this.#start().finally(() => { - this.#starting = null; - }); - return this.#starting; - } - async #start() { - await this.stop(); - this.#stopped = false; - this.#sessionId = null; - this.#resumeUrl = null; - this.#sequence = null; - this.#reconnectAttempt = 0; - this.#status.startedAt = (/* @__PURE__ */ new Date()).toISOString(); - this.#status.connectionState = "connecting"; - this.#status.lastError = null; - await this.#harness.ensureRunning(); - this.#status.harnessReachable = true; - const controller = new AbortController(); - this.#abortController = controller; - const api = this.#createApi({ token: this.#token }); - this.#api = api; - try { - const [bot, gateway] = await Promise.all([ - api.getCurrentUser({ signal: controller.signal }), - api.getGatewayBot({ signal: controller.signal }) - ]); - if (String(bot?.id ?? "") !== this.#config.platformId || bot?.bot !== true) { - throw new Error("Discord token identity does not match the saved bot"); - } - this.#gatewayUrl = gateway?.url; - const client = new DiscordBotClient({ api, signal: controller.signal }); - this.#bridge = new DiscordHarnessBridge({ - bot: client, - harness: this.#harness, - state: this.#state, - status: this.#status, - logger: this.#logger, - replyTimeoutMs: this.#replyTimeoutMs - }); - let timer; - try { - await Promise.race([ - this.#openSocket(false), - new Promise((_, reject) => { - timer = setTimeout(() => reject(new Error("Discord Gateway did not become ready in time")), this.#connectTimeoutMs); - }) - ]); - } finally { - clearTimeout(timer); - } - return this.status; - } catch (error) { - this.#status.ready = false; - this.#status.connectionState = "failed"; - this.#status.lastError = error?.message ?? String(error); - await this.stop(); - throw error; - } - } - #openSocket(resume) { - if (this.#stopped) return Promise.reject(new Error("Discord runtime is stopped")); - const generation = ++this.#generation; - const url = socketUrl(resume && this.#resumeUrl ? this.#resumeUrl : this.#gatewayUrl); - const socket = this.#createWebSocket(url); - this.#socket = socket; - let settled = false; - return new Promise((resolve7, reject) => { - const markReady = () => { - if (settled || generation !== this.#generation) return; - settled = true; - this.#reconnectAttempt = 0; - const now = Date.now(); - this.#status.ready = true; - this.#status.connectionState = "connected"; - this.#status.lastCheckedAt = now; - this.#status.lastConnectedAt = now; - this.#status.lastError = null; - resolve7(); - }; - addSocketListener(socket, "message", (event) => { - if (generation !== this.#generation || this.#stopped) return; - const raw = eventData(event); - if (!raw) return; - let packet; - try { - packet = JSON.parse(raw); - } catch { - this.#logger.warn?.("[dsh-im:discord] ignored malformed Gateway JSON"); - return; - } - if (Number.isSafeInteger(packet.s)) this.#sequence = packet.s; - if (packet.op === 10) { - this.#startHeartbeat(packet.d?.heartbeat_interval, socket, generation); - if (resume && this.#sessionId) { - this.#sendGateway(socket, { - op: 6, - d: { token: this.#token, session_id: this.#sessionId, seq: this.#sequence } - }); - } else { - this.#sendGateway(socket, { - op: 2, - d: { - token: this.#token, - intents: DISCORD_GATEWAY_INTENTS, - properties: { - os: process.platform, - browser: "dsh-im", - device: "dsh-im" - } - } - }); - } - return; - } - if (packet.op === 11) { - this.#heartbeatAcked = true; - this.#status.lastCheckedAt = Date.now(); - return; - } - if (packet.op === 1) { - this.#heartbeat(socket); - return; - } - if (packet.op === 7) { - socket.close(4e3, "Reconnect requested"); - return; - } - if (packet.op === 9) { - if (packet.d !== true) { - this.#sessionId = null; - this.#resumeUrl = null; - this.#sequence = null; - } - socket.close(4e3, "Invalid session"); - return; - } - if (packet.op !== 0) return; - if (packet.t === "READY") { - this.#sessionId = packet.d?.session_id ?? null; - this.#resumeUrl = packet.d?.resume_gateway_url ?? null; - markReady(); - } else if (packet.t === "RESUMED") { - markReady(); - } else if (packet.t === "MESSAGE_CREATE") { - const message = normalizeDiscordMessage(packet.d, this.#config.platformId); - if (message) void this.#bridge?.accept(message); - } - }); - addSocketListener(socket, "close", (event = {}) => { - if (generation !== this.#generation) return; - this.#clearHeartbeat(); - if (this.#socket === socket) this.#socket = null; - if (this.#stopped) { - if (!settled) reject(new DOMException("Stopped", "AbortError")); - return; - } - const error = gatewayCloseError(Number(event.code) || 0); - this.#status.ready = false; - this.#status.connectionState = "connecting"; - this.#status.lastError = error.message; - if (!settled) { - settled = true; - reject(error); - } - if (error.code === "discord-401" || error.code === "discord-intents") { - this.#status.connectionState = "failed"; - return; - } - this.#scheduleReconnect(); - }); - addSocketListener(socket, "error", () => { - if (generation !== this.#generation || this.#stopped) return; - this.#status.lastError = "Discord Gateway WebSocket error"; - }); - }); - } - #sendGateway(socket, payload) { - if (socket.readyState !== 1) return; - socket.send(JSON.stringify(payload)); - } - #startHeartbeat(interval, socket, generation) { - this.#clearHeartbeat(); - if (!Number.isFinite(interval) || interval < 1e3) { - socket.close(4e3, "Invalid heartbeat interval"); - return; - } - this.#heartbeatAcked = true; - const schedule = (delay3) => { - this.#heartbeatTimer = setTimeout(() => { - if (this.#stopped || generation !== this.#generation || this.#socket !== socket) return; - if (!this.#heartbeatAcked) { - socket.close(4e3, "Heartbeat was not acknowledged"); - return; - } - this.#heartbeat(socket); - schedule(interval); - }, delay3); - this.#heartbeatTimer?.unref?.(); - }; - schedule(Math.floor(interval * this.#random())); - } - #heartbeat(socket) { - this.#heartbeatAcked = false; - this.#sendGateway(socket, { op: 1, d: this.#sequence }); - } - #clearHeartbeat() { - if (this.#heartbeatTimer !== null) clearTimeout(this.#heartbeatTimer); - this.#heartbeatTimer = null; - this.#heartbeatAcked = true; - } - #scheduleReconnect() { - if (this.#stopped || this.#reconnectTimer !== null) return; - const delay3 = RECONNECT_DELAYS_MS[Math.min(this.#reconnectAttempt, RECONNECT_DELAYS_MS.length - 1)]; - this.#reconnectAttempt += 1; - this.#reconnectTimer = setTimeout(() => { - this.#reconnectTimer = null; - void this.#openSocket(Boolean(this.#sessionId)).catch((error) => { - if (this.#stopped) return; - this.#logger.warn?.("[dsh-im:discord] Gateway reconnect failed:", error); - this.#scheduleReconnect(); - }); - }, delay3); - this.#reconnectTimer?.unref?.(); - } - async stop() { - this.#stopped = true; - this.#generation += 1; - this.#abortController?.abort(); - this.#abortController = null; - if (this.#reconnectTimer !== null) clearTimeout(this.#reconnectTimer); - this.#reconnectTimer = null; - this.#clearHeartbeat(); - const socket = this.#socket; - const bridge = this.#bridge; - this.#socket = null; - this.#bridge = null; - this.#api = null; - try { - if (socket && socket.readyState < 2) socket.close(1e3, "Plugin stopped"); - } catch (error) { - this.#logger.warn?.(`[dsh-im:discord] bot ${this.#config.botId} failed to close Gateway:`, error); - } - await Promise.race([ - bridge?.waitForIdle() ?? Promise.resolve(), - new Promise((resolve7) => setTimeout(resolve7, 2e3)) - ]); - this.#status.ready = false; - this.#status.connectionState = "idle"; - return this.status; - } -}; - -// src/channels/shared/conversation-state-store.mjs -import { mkdir as mkdir4, readFile as readFile4, rename as rename4, unlink as unlink5, writeFile as writeFile4 } from "node:fs/promises"; -import { dirname as dirname4 } from "node:path"; -var EMPTY_STATE2 = Object.freeze({ version: 1, sessions: {}, seenMessageIds: [], cursor: null }); -function normalizeState2(value) { - if (!value || typeof value !== "object") return structuredClone(EMPTY_STATE2); - const sessions = {}; - if (value.sessions && typeof value.sessions === "object" && !Array.isArray(value.sessions)) { - for (const [key, sessionId] of Object.entries(value.sessions)) { - if (typeof key === "string" && key && typeof sessionId === "string" && sessionId) { - sessions[key] = sessionId; - } - } - } - return { - version: 1, - sessions, - seenMessageIds: Array.isArray(value.seenMessageIds) ? value.seenMessageIds.filter((id) => typeof id === "string" && id).slice(-1e3) : [], - cursor: Number.isSafeInteger(value.cursor) && value.cursor >= 0 ? value.cursor : null - }; -} -var ConversationStateStore = class { - #path; - #state = structuredClone(EMPTY_STATE2); - #writeQueue = Promise.resolve(); - constructor(path) { - this.#path = path; - } - async load() { - try { - this.#state = normalizeState2(JSON.parse(await readFile4(this.#path, "utf8"))); - } catch (error) { - if (error?.code !== "ENOENT") throw error; - this.#state = structuredClone(EMPTY_STATE2); - await this.#persist(); - } - return this; - } - sessionFor(key) { - return this.#state.sessions[key] ?? null; - } - async setSession(key, sessionId) { - this.#state.sessions[key] = sessionId; - await this.#persist(); - } - async clearSession(key) { - delete this.#state.sessions[key]; - await this.#persist(); - } - hasSeen(messageId) { - return this.#state.seenMessageIds.includes(messageId); - } - async markSeen(messageId) { - if (this.hasSeen(messageId)) return; - this.#state.seenMessageIds.push(messageId); - if (this.#state.seenMessageIds.length > 1e3) { - this.#state.seenMessageIds.splice(0, this.#state.seenMessageIds.length - 1e3); - } - await this.#persist(); - } - cursor() { - return this.#state.cursor; - } - async setCursor(cursor) { - if (!Number.isSafeInteger(cursor) || cursor < 0) throw new TypeError("Invalid update cursor"); - this.#state.cursor = cursor; - await this.#persist(); - } - snapshot() { - return structuredClone(this.#state); - } - async remove() { - try { - await unlink5(this.#path); - } catch (error) { - if (error?.code !== "ENOENT") throw error; - } - this.#state = structuredClone(EMPTY_STATE2); - } - async #persist() { - const snapshot = `${JSON.stringify(this.#state, null, 2)} -`; - const operation = this.#writeQueue.then(async () => { - await mkdir4(dirname4(this.#path), { recursive: true, mode: 448 }); - const temporary = `${this.#path}.tmp`; - await writeFile4(temporary, snapshot, { encoding: "utf8", mode: 384 }); - await rename4(temporary, this.#path); - }); - this.#writeQueue = operation.then(() => void 0, () => void 0); - await operation; - } -}; - -// src/channels/discord/state-store.mjs -var DiscordStateStore = class extends ConversationStateStore { -}; - -// plugin-src/host/channels/shared/production.mjs -import { unlink as unlink6 } from "node:fs/promises"; -import { homedir as homedir2 } from "node:os"; -import { join as join2, resolve as resolve2 } from "node:path"; - -// plugin-src/host/channels/shared/connection-supervisor.mjs -var DEFAULT_RETRY_DELAYS_MS2 = Object.freeze([250, 1e3, 3e3, 5e3, 1e4, 3e4]); -function retryDelays2(value) { - if (!Array.isArray(value) || value.length === 0) return [...DEFAULT_RETRY_DELAYS_MS2]; - const valid = value.filter((delay3) => Number.isFinite(delay3) && delay3 >= 0); - return valid.length > 0 ? valid : [...DEFAULT_RETRY_DELAYS_MS2]; -} -var TokenConnectionSupervisor = class { - #channel; - #controller; - #harness; - #logger; - #retryDelays; - #healthyIntervalMs; - #setTimeout; - #clearTimeout; - #timer = null; - #running = null; - #retryIndex = 0; - #closed = false; - #started = false; - #ready; - #resolveReady; - constructor({ - channel, - controller, - harness, - logger = console, - retryDelaysMs, - healthyIntervalMs = 15e3, - setTimeoutImpl = setTimeout, - clearTimeoutImpl = clearTimeout - }) { - if (!channel) throw new TypeError("TokenConnectionSupervisor requires a channel"); - if (!controller || typeof controller.initialize !== "function" || typeof controller.status !== "function") { - throw new TypeError("TokenConnectionSupervisor requires a controller"); - } - if (!harness || typeof harness.ensureRunning !== "function") { - throw new TypeError("TokenConnectionSupervisor requires a Harness client"); - } - this.#channel = channel; - this.#controller = controller; - this.#harness = harness; - this.#logger = logger; - this.#retryDelays = retryDelays2(retryDelaysMs); - this.#healthyIntervalMs = Number.isFinite(healthyIntervalMs) && healthyIntervalMs >= 0 ? healthyIntervalMs : 15e3; - this.#setTimeout = setTimeoutImpl; - this.#clearTimeout = clearTimeoutImpl; - this.#ready = new Promise((resolve7) => { - this.#resolveReady = resolve7; - }); - } - get ready() { - return this.#ready; - } - start() { - if (this.#started || this.#closed) return this; - this.#started = true; - this.#schedule(0); - return this; - } - async close() { - if (this.#closed) return; - this.#closed = true; - if (this.#timer !== null) this.#clearTimeout(this.#timer); - this.#timer = null; - await this.#running?.catch(() => void 0); - this.#resolveReady?.(null); - this.#resolveReady = null; - } - #schedule(delayMs) { - if (this.#closed) return; - this.#timer = this.#setTimeout(() => { - this.#timer = null; - void this.#run(); - }, delayMs); - this.#timer?.unref?.(); - } - async #run() { - if (this.#closed || this.#running) return; - const operation = this.#reconcile(); - this.#running = operation; - try { - await operation; - } finally { - if (this.#running === operation) this.#running = null; - } - } - async #reconcile() { - try { - await this.#harness.ensureRunning(); - if (this.#closed) return; - const status = await this.#controller.initialize(); - if (this.#closed) return; - this.#resolveReady?.(status); - this.#resolveReady = null; - const { configured, connected } = status.totals; - if (connected < configured) { - const delay3 = this.#retryDelays[Math.min(this.#retryIndex, this.#retryDelays.length - 1)]; - this.#retryIndex += 1; - this.#logger.warn?.( - `[dsh-im:${this.#channel}] ${connected}/${configured} bots connected; retrying in ${delay3}ms` - ); - this.#schedule(delay3); - return; - } - this.#retryIndex = 0; - this.#schedule(this.#healthyIntervalMs); - } catch (error) { - if (this.#closed) return; - const delay3 = this.#retryDelays[Math.min(this.#retryIndex, this.#retryDelays.length - 1)]; - this.#retryIndex += 1; - this.#logger.warn?.( - `[dsh-im:${this.#channel}] connection reconciliation failed; retrying in ${delay3}ms`, - error - ); - this.#schedule(delay3); - } - } -}; -function createTokenConnectionSupervisor(options) { - return new TokenConnectionSupervisor(options); -} - -// plugin-src/host/channels/shared/production.mjs -function harnessOrigin2(webServer, configured) { - if (configured !== void 0) return new URL(configured); - const port = webServer?.port; - if (!Number.isInteger(port) || port < 1 || port > 65535) { - throw new Error("dsh-im token channel requires an initialized DSH webServer port"); - } - return new URL(`http://127.0.0.1:${port}`); -} -function pluginPaths2(config, channel) { - const dshHome = resolve2(config.dshHome ?? process.env.DSH_HOME ?? join2(homedir2(), ".dsh")); - const root = resolve2(config.dataDir ?? join2(dshHome, "integrations", `dsh-${channel}`)); - return { - config: resolve2(config.configPath ?? join2(root, "config.json")), - bots: resolve2(config.botsDir ?? join2(root, "bots")) - }; -} -async function createTokenProductionController(ctx, config, internals, definitions) { - const { channel, ConfigStore, StateStore: StateStore2, HarnessClient: HarnessClient4, Controller, Runtime } = definitions; - if (!ctx?.credentials) throw new TypeError(`dsh-im ${channel} requires ctx.credentials`); - if (!ctx?.webServer) throw new TypeError(`dsh-im ${channel} requires ctx.webServer`); - const ResolvedConfigStore = internals.ConfigStore ?? ConfigStore; - const ResolvedStateStore = internals.StateStore ?? StateStore2; - const ResolvedHarness = internals.HarnessClient ?? HarnessClient4; - const ResolvedController = internals.Controller ?? Controller; - const ResolvedRuntime = internals.Runtime ?? Runtime; - const createSupervisor = internals.createConnectionSupervisor ?? createTokenConnectionSupervisor; - const logger = typeof ctx.logger === "function" ? ctx.logger(`dsh-im:${channel}`) : ctx.logger ?? console; - const paths = pluginPaths2(config, channel); - const configStore = await new ResolvedConfigStore(paths.config).load(); - const stateStores = /* @__PURE__ */ new Map(); - const statePath = (botId) => resolve2(paths.bots, botId, "state.json"); - const stateFor = async (botId) => { - let state = stateStores.get(botId); - if (!state) { - state = await new ResolvedStateStore(statePath(botId)).load(); - stateStores.set(botId, state); - } - return state; - }; - const harness = new ResolvedHarness({ - baseUrl: harnessOrigin2(ctx.webServer, config.harnessBaseUrl), - workspace: resolve2(config.workspace ?? process.cwd()), - agentPreset: config.agentPreset ?? "standard", - autostart: false, - dshBin: config.dshBin ?? "dsh" - }); - const controller = new ResolvedController({ - credentials: ctx.credentials, - configStore, - logger, - ...internals.inspectToken ? { inspectToken: internals.inspectToken } : {}, - createRuntime: async ({ botId, config: botConfig, token }) => new ResolvedRuntime({ - config: botConfig, - token, - harness, - state: await stateFor(botId), - replyTimeoutMs: config.replyTimeoutMs ?? 6e5, - connectTimeoutMs: config.connectTimeoutMs ?? 2e4, - logger: { - error: (...args) => logger.error?.(`[${botId}]`, ...args), - warn: (...args) => logger.warn?.(`[${botId}]`, ...args), - info: (...args) => logger.info?.(`[${botId}]`, ...args), - debug: (...args) => logger.debug?.(`[${botId}]`, ...args) - } - }), - deleteState: async ({ botId }) => { - const state = stateStores.get(botId); - stateStores.delete(botId); - if (state && typeof state.remove === "function") return state.remove(); - try { - await unlink6(statePath(botId)); - } catch (error) { - if (error?.code !== "ENOENT") throw error; - } - } - }); - const supervisor = createSupervisor({ - channel, - controller, - harness, - logger, - retryDelaysMs: config.retryDelaysMs, - healthyIntervalMs: config.healthyIntervalMs - }).start(); - return { - controller, - ready: supervisor.ready, - async close() { - await supervisor.close(); - await controller.close(); - harness.stopManagedProcess(); - } - }; -} - -// plugin-src/host/channels/discord/production.mjs -function createProductionController2(ctx, config = {}, internals = {}) { - return createTokenProductionController(ctx, config, internals, { - channel: "discord", - ConfigStore: DiscordConfigStore, - StateStore: DiscordStateStore, - HarnessClient: DiscordHarnessClient, - Controller: DiscordController, - Runtime: DiscordRuntime - }); -} - -// plugin-src/host/channels/shared/rpc.mjs -var TOKEN_BOT_ENDPOINTS = Object.freeze({ - status: "connection.status", - bindCredentials: "bot.bind-credentials", - reconnectBot: "bot.reconnect", - deleteBot: "bot.delete" -}); -var ENDPOINTS = Object.freeze(Object.values(TOKEN_BOT_ENDPOINTS)); -var FORBIDDEN_PUBLIC_KEYS2 = /* @__PURE__ */ new Set([ - "token", - "botToken", - "tokenRef", - "platformId", - "secret", - "secretRef" -]); -function isRecord2(value) { - return value !== null && typeof value === "object" && !Array.isArray(value); -} -function exactKeys2(value, allowed) { - return isRecord2(value) && Object.keys(value).every((key) => allowed.includes(key)); -} -function validId2(value) { - return typeof value === "string" && /^[A-Za-z0-9_-]{1,128}$/.test(value); -} -function validToken(value) { - return typeof value === "string" && value.trim().length >= 20 && value.length <= 4096; -} -function payloadFailure2(endpoint, payload) { - if (!isRecord2(payload)) return "Payload must be an object."; - if (endpoint === TOKEN_BOT_ENDPOINTS.status) { - return exactKeys2(payload, []) ? null : "connection.status does not accept fields."; - } - if (endpoint === TOKEN_BOT_ENDPOINTS.bindCredentials) { - return exactKeys2(payload, ["token"]) && validToken(payload.token) ? null : "bot.bind-credentials requires a Bot Token."; - } - if (endpoint === TOKEN_BOT_ENDPOINTS.reconnectBot) { - return exactKeys2(payload, ["botId"]) && validId2(payload.botId) ? null : "bot.reconnect requires a botId."; - } - if (endpoint === TOKEN_BOT_ENDPOINTS.deleteBot) { - return exactKeys2(payload, ["botId", "confirm"]) && validId2(payload.botId) && payload.confirm === true ? null : "bot.delete requires a botId and confirm=true."; - } - return "Unknown bot endpoint."; -} -function sanitizePublic2(value) { - if (Array.isArray(value)) return value.map(sanitizePublic2); - if (!isRecord2(value)) return value; - const safe = {}; - for (const [key, child] of Object.entries(value)) { - if (!FORBIDDEN_PUBLIC_KEYS2.has(key)) safe[key] = sanitizePublic2(child); - } - return safe; -} -function operationError(channel, error) { - if (error?.code === "webhook-configured") { - return { code: "webhook-configured", message: error.message }; - } - if (error?.code === "telegram-401" || error?.code === "discord-401") { - return { code: "invalid-token", message: `${channel} Bot Token \u65E0\u6548\uFF0C\u8BF7\u91CD\u65B0\u586B\u5199\u3002` }; - } - if (error?.code === "discord-intents") { - return { code: "discord-intents", message: error.message }; - } - return { code: `${channel.toLowerCase()}-operation-failed`, message: `${channel} \u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002` }; -} -function createTokenBotRpcHandler(controller, { channel }) { - for (const method of ["status", "bindCredentials", "reconnectBot", "deleteBot"]) { - if (typeof controller?.[method] !== "function") { - throw new TypeError(`A complete ${channel} controller is required (${method})`); - } - } - return async (endpoint, payload, signal) => { - if (signal?.aborted) { - return { ok: false, error: { code: "cancelled", message: "The request was cancelled." } }; - } - if (!ENDPOINTS.includes(endpoint)) { - return { ok: false, error: { code: "bad-request", message: `Unknown ${channel} endpoint.` } }; - } - const invalid = payloadFailure2(endpoint, payload); - if (invalid) return { ok: false, error: { code: "bad-request", message: invalid } }; - try { - let value; - if (endpoint === TOKEN_BOT_ENDPOINTS.status) value = await controller.status(); - else if (endpoint === TOKEN_BOT_ENDPOINTS.bindCredentials) { - value = await controller.bindCredentials(payload); - } else if (endpoint === TOKEN_BOT_ENDPOINTS.reconnectBot) { - value = await controller.reconnectBot(payload.botId); - } else { - value = await controller.deleteBot(payload.botId); - } - return signal?.aborted ? { ok: false, error: { code: "cancelled", message: "The request was cancelled." } } : { ok: true, value: sanitizePublic2(value) }; - } catch (error) { - return signal?.aborted ? { ok: false, error: { code: "cancelled", message: "The request was cancelled." } } : { ok: false, error: operationError(channel, error) }; - } - }; -} -function installTokenBotRpc(ctx, controller, { channel, rpcChannel, authority }) { - if (!ctx?.connection?.rpc || typeof ctx.connection.rpc.handle !== "function") { - throw new TypeError("DSH Host Connection RPC is required"); - } - return ctx.connection.rpc.handle( - rpcChannel, - createTokenBotRpcHandler(controller, { channel }), - { authority: resolveRpcAuthority(authority) } - ); -} - -// plugin-src/host/channels/discord/rpc.mjs -var DISCORD_RPC_CHANNEL = "/discord"; -var DISCORD_ENDPOINTS = TOKEN_BOT_ENDPOINTS; -var DISCORD_RPC_ENDPOINTS = Object.freeze(Object.values(DISCORD_ENDPOINTS)); -function installDiscordRpc(ctx, controller, authority) { - return installTokenBotRpc(ctx, controller, { - channel: "Discord", - rpcChannel: DISCORD_RPC_CHANNEL, - authority - }); -} - -// plugin-src/host/channels/discord/index.mjs -async function apply2(ctx, config = {}) { - if (config?.controller) { - return installDiscordRpc(ctx, config.controller, config.rpcAuthority); - } - const production = await createProductionController2(ctx, config, config.internals ?? {}); - const disposeRpc = installDiscordRpc(ctx, production.controller, config.rpcAuthority); - ctx.effect(() => async () => production.close(), "dsh-im: close Discord bot connections"); - return disposeRpc; -} - -// plugin-src/host/channels/feishu/controller.mjs -var ACTIVE_REGISTRATION_STATES = /* @__PURE__ */ new Set([ - "starting", - "qr_ready", - "polling", - "slow_down", - "domain_switched" -]); -function credentialResult(result) { - const appId = result?.client_id ?? result?.appId; - const appSecret = result?.client_secret ?? result?.appSecret; - if (typeof appId !== "string" || appId.length === 0 || typeof appSecret !== "string" || appSecret.length === 0) { - throw new TypeError("Feishu registration returned invalid credentials"); - } - return { - appId, - appSecret, - userInfo: result?.user_info ?? result?.userInfo - }; -} -async function readConnectionStatus(connectionManager) { - if (typeof connectionManager.status !== "function") return {}; - return await connectionManager.status(); -} -function isConnected(status) { - if (status?.connected === true) return true; - return status?.ready === true && status?.feishuLongConnectionState === "connected" && status?.harnessReachable === true; -} -var ProvisioningBackedController = class { - #credentialStore; - #connectionManager; - #registrationOptions; - #manager; - #knownConfigured = false; - #lastError = null; - constructor({ - createProvisioningManager, - credentialStore, - connectionManager, - registrationOptions = {} - } = {}) { - if (typeof createProvisioningManager !== "function") { - throw new TypeError("createProvisioningManager is required"); - } - if (!credentialStore || typeof credentialStore.save !== "function" || typeof credentialStore.clear !== "function") { - throw new TypeError("credentialStore.save/clear are required"); - } - if (!connectionManager || typeof connectionManager.connect !== "function" || typeof connectionManager.disconnect !== "function") { - throw new TypeError("connectionManager.connect/disconnect are required"); - } - if (registrationOptions === null || typeof registrationOptions !== "object" || Array.isArray(registrationOptions)) { - throw new TypeError("registrationOptions must be an object"); - } - this.#credentialStore = credentialStore; - this.#connectionManager = connectionManager; - this.#registrationOptions = structuredClone(registrationOptions); - this.#manager = createProvisioningManager({ - onCredentials: (result) => this.#acceptCredentials(result) - }); - if (!this.#manager || typeof this.#manager.start !== "function" || typeof this.#manager.status !== "function" || typeof this.#manager.cancel !== "function") { - throw new TypeError("The provisioning manager must implement start/status/cancel"); - } - } - async startRegistration() { - this.#lastError = null; - await this.#manager.start(structuredClone(this.#registrationOptions)); - return this.status(); - } - async cancelRegistration() { - await this.#manager.cancel(); - return this.status(); - } - async disconnect() { - await this.#manager.cancel(); - await this.#connectionManager.disconnect(); - try { - await this.#credentialStore.clear(); - this.#knownConfigured = false; - this.#lastError = null; - } catch { - this.#lastError = { - code: "credential_removal_failed", - message: "Unable to remove the Feishu credentials." - }; - } - return this.status(); - } - async status() { - const registration = await this.#manager.status(); - const connection = await readConnectionStatus(this.#connectionManager); - const connected = isConnected(connection); - let configured = this.#knownConfigured; - if (typeof this.#credentialStore.configured === "function") { - try { - configured = await this.#credentialStore.configured(); - } catch { - configured = this.#knownConfigured; - } - } - let phase = "unconfigured"; - if (connected) phase = "connected"; - else if (ACTIVE_REGISTRATION_STATES.has(registration?.state)) phase = "registering"; - else if (registration?.state === "saving") phase = "connecting"; - else if (this.#lastError || registration?.state === "error") phase = "error"; - else if (configured) phase = "disconnected"; - return { - phase, - connected, - configured, - registration, - connection, - error: this.#lastError ?? registration?.error ?? null - }; - } - async close() { - await this.#manager.cancel(); - await this.#connectionManager.disconnect(); - } - async #acceptCredentials(result) { - const credentials = credentialResult(result); - try { - await this.#credentialStore.save(credentials); - this.#knownConfigured = true; - await this.#connectionManager.connect(credentials); - this.#lastError = null; - } catch { - this.#lastError = { - code: "connection_failed", - message: "The bot was created, but its connection could not be started." - }; - throw new Error("Unable to activate the Feishu connection."); - } - } -}; -function createProvisioningBackedController(options) { - return new ProvisioningBackedController(options); -} - -// plugin-src/host/channels/feishu/production.mjs -import { homedir as homedir3 } from "node:os"; -import { join as join3, resolve as resolve3 } from "node:path"; -import { unlink as unlink8 } from "node:fs/promises"; -import * as Lark from "@larksuiteoapi/node-sdk"; - -// plugin-src/host/channels/feishu/connection-supervisor.mjs -var DEFAULT_RETRY_DELAYS_MS3 = Object.freeze([250, 1e3, 3e3, 5e3, 1e4, 3e4]); -function safeDelay(value, fallback) { - return Number.isFinite(value) && value >= 0 ? value : fallback; -} -function safeRetryDelays(value) { - if (!Array.isArray(value) || value.length === 0) return [...DEFAULT_RETRY_DELAYS_MS3]; - const delays = value.map((delay3) => safeDelay(delay3, -1)).filter((delay3) => delay3 >= 0); - return delays.length > 0 ? delays : [...DEFAULT_RETRY_DELAYS_MS3]; -} -function totals(status) { - const configured = Number.isInteger(status?.totals?.configured) ? status.totals.configured : Array.isArray(status?.bots) ? status.bots.length : 0; - const connected = Number.isInteger(status?.totals?.connected) ? status.totals.connected : Array.isArray(status?.bots) ? status.bots.filter((bot) => bot?.connected === true).length : 0; - return { configured, connected }; -} -var ConnectionSupervisor2 = class { - #controller; - #harness; - #logger; - #retryDelaysMs; - #healthyIntervalMs; - #setTimeout; - #clearTimeout; - #timer = null; - #running = null; - #retryIndex = 0; - #started = false; - #closed = false; - #ready; - #resolveReady; - constructor({ - controller, - harness, - logger = console, - retryDelaysMs, - healthyIntervalMs = 15e3, - setTimeoutImpl = setTimeout, - clearTimeoutImpl = clearTimeout - }) { - if (!controller || typeof controller.initialize !== "function" || typeof controller.status !== "function") { - throw new TypeError("ConnectionSupervisor requires a controller"); - } - if (!harness || typeof harness.ensureRunning !== "function") { - throw new TypeError("ConnectionSupervisor requires a Harness client"); - } - this.#controller = controller; - this.#harness = harness; - this.#logger = logger; - this.#retryDelaysMs = safeRetryDelays(retryDelaysMs); - this.#healthyIntervalMs = safeDelay(healthyIntervalMs, 15e3); - this.#setTimeout = setTimeoutImpl; - this.#clearTimeout = clearTimeoutImpl; - this.#ready = new Promise((resolve7) => { - this.#resolveReady = resolve7; - }); - } - get ready() { - return this.#ready; - } - start() { - if (this.#started || this.#closed) return this; - this.#started = true; - this.#schedule(0); - return this; - } - async close() { - if (this.#closed) return; - this.#closed = true; - if (this.#timer !== null) { - this.#clearTimeout(this.#timer); - this.#timer = null; - } - await this.#running?.catch(() => void 0); - this.#resolveReady?.(null); - this.#resolveReady = null; - } - #schedule(delayMs) { - if (this.#closed) return; - this.#timer = this.#setTimeout(() => { - this.#timer = null; - void this.#run(); - }, delayMs); - this.#timer?.unref?.(); - } - async #run() { - if (this.#closed || this.#running) return; - const operation = this.#reconcile(); - this.#running = operation; - try { - await operation; - } finally { - if (this.#running === operation) this.#running = null; - } - } - async #reconcile() { - try { - await this.#harness.ensureRunning(); - } catch (error) { - if (this.#closed) return; - this.#retry("Harness Host is not ready", error); - return; - } - if (this.#closed) return; - try { - await this.#controller.initialize(); - if (this.#closed) return; - const status = this.#controller.status(); - this.#resolveReady?.(status); - this.#resolveReady = null; - const current = totals(status); - if (current.connected < current.configured) { - const delay3 = this.#retryDelaysMs[Math.min(this.#retryIndex, this.#retryDelaysMs.length - 1)]; - this.#retryIndex += 1; - this.#logger.warn?.( - `[dsh-feishu] ${current.connected}/${current.configured} bots connected; retrying automatically in ${delay3}ms` - ); - this.#schedule(delay3); - return; - } - this.#retryIndex = 0; - this.#schedule(this.#healthyIntervalMs); - } catch (error) { - if (this.#closed) return; - this.#retry("Bot connection reconciliation failed", error); - } - } - #retry(message, error) { - const delay3 = this.#retryDelaysMs[Math.min(this.#retryIndex, this.#retryDelaysMs.length - 1)]; - this.#retryIndex += 1; - this.#logger.warn?.( - `[dsh-feishu] ${message}; retrying automatically in ${delay3}ms`, - error - ); - this.#schedule(delay3); - } -}; -function createConnectionSupervisor2(options) { - return new ConnectionSupervisor2(options); -} - -// src/channels/feishu/feishu-app.mjs -function endpointFor(domain, path) { - const origin = domain === "lark" ? "https://open.larksuite.com" : "https://open.feishu.cn"; - return new URL(path, origin); -} -async function jsonResponse(response, operation) { - let body; - try { - body = await response.json(); - } catch { - throw new Error(`${operation} returned a non-JSON response`); - } - if (!response.ok || body?.code !== 0) { - throw new Error(`${operation} failed: ${body?.msg || `HTTP ${response.status}`}`); - } - return body; -} -async function verifyFeishuApp({ - appId, - appSecret, - domain = "feishu", - fetchImpl = fetch, - timeoutMs = 15e3 -}) { - if (!appId || !appSecret) throw new Error("Feishu credentials are incomplete"); - const tokenResponse = await fetchImpl(endpointFor(domain, "/open-apis/auth/v3/tenant_access_token/internal"), { - method: "POST", - headers: { "content-type": "application/json; charset=utf-8" }, - body: JSON.stringify({ app_id: appId, app_secret: appSecret }), - signal: AbortSignal.timeout(timeoutMs) - }); - const tokenBody = await jsonResponse(tokenResponse, "Feishu authentication"); - if (!tokenBody.tenant_access_token) { - throw new Error("Feishu authentication returned no tenant access token"); - } - const botResponse = await fetchImpl(endpointFor(domain, "/open-apis/bot/v3/info/"), { - headers: { authorization: `Bearer ${tokenBody.tenant_access_token}` }, - signal: AbortSignal.timeout(timeoutMs) - }); - const botBody = await jsonResponse(botResponse, "Feishu bot verification"); - const bot = botBody.bot ?? {}; - return Object.freeze({ - appId, - name: bot.app_name ?? bot.bot_name ?? null, - openId: bot.open_id ?? null, - activated: bot.activate_status ?? null - }); -} - -// src/channels/feishu/message-utils.mjs -function conversationKey2(event) { - const chatType = event?.message?.chat_type; - if (chatType === "p2p") { - const senderId = event?.sender?.sender_id?.open_id || event?.sender?.sender_id?.user_id; - if (!senderId) throw new Error("Feishu p2p event has no sender id"); - return `p2p:${senderId}`; - } - const chatId = event?.message?.chat_id; - if (!chatId) throw new Error("Feishu group event has no chat id"); - return `group:${chatId}`; -} -function extractText(event) { - if (event?.message?.message_type !== "text") return null; - let parsed; - try { - parsed = JSON.parse(event.message.content); - } catch { - return null; - } - let text = typeof parsed.text === "string" ? parsed.text : ""; - for (const mention of event.message.mentions ?? []) { - if (typeof mention.key === "string" && mention.key) text = text.replaceAll(mention.key, ""); - } - return text.trim(); -} -function splitText(text, maxChars = 9e3) { - if (text.length <= maxChars) return [text]; - const chunks = []; - let remaining = text; - while (remaining.length > maxChars) { - let splitAt = remaining.lastIndexOf("\n", maxChars); - if (splitAt < Math.floor(maxChars * 0.6)) splitAt = maxChars; - chunks.push(remaining.slice(0, splitAt)); - remaining = remaining.slice(splitAt).replace(/^\n+/, ""); - } - if (remaining) chunks.push(remaining); - return chunks; -} -function isBotSender(event) { - return event?.sender?.sender_type === "bot"; -} -function isAllowedSender(event, allowedOpenIds) { - if (!allowedOpenIds || allowedOpenIds.size === 0) return false; - if (allowedOpenIds.has("*")) return true; - const senderOpenId = event?.sender?.sender_id?.open_id; - return typeof senderOpenId === "string" && allowedOpenIds.has(senderOpenId); -} - -// src/channels/feishu/bridge.mjs -var HELP_TEXT2 = [ - "\u5317\u6C47\u661F\u6CB3 AIOS \u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002", - "", - "\u76F4\u63A5\u53D1\u9001\u95EE\u9898\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002", - "/new \u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD", - "/status \u68C0\u67E5\u8FDE\u63A5\u72B6\u6001", - "/help \u663E\u793A\u672C\u5E2E\u52A9" -].join("\n"); -var FeishuHarnessBridge = class { - #client; - #channel; - #harness; - #state; - #queues = /* @__PURE__ */ new Map(); - #acceptedMessageIds = /* @__PURE__ */ new Set(); - #status; - #allowedSenderOpenIds; - #replyTimeoutMs; - constructor({ - client, - channel, - harness, - state, - status, - allowedSenderOpenIds = /* @__PURE__ */ new Set(), - replyTimeoutMs = 6e5 - }) { - this.#client = client; - this.#channel = channel; - this.#harness = harness; - this.#state = state; - this.#status = status; - this.#allowedSenderOpenIds = allowedSenderOpenIds; - this.#replyTimeoutMs = replyTimeoutMs; - } - accept(event) { - const messageId = event?.message?.message_id; - if (!messageId || isBotSender(event) || event?.message?.message_type !== "text") return; - if (!isAllowedSender(event, this.#allowedSenderOpenIds)) { - this.#status.messagesRejected += 1; - this.#status.lastRejectedAt = (/* @__PURE__ */ new Date()).toISOString(); - console.warn("[bridge] ignored a message from a sender outside the allowlist"); - return; - } - if (this.#state.hasSeen(messageId) || this.#acceptedMessageIds.has(messageId)) return; - this.#acceptedMessageIds.add(messageId); - const processingReaction = this.#addReaction(messageId, "OnIt"); - const key = conversationKey2(event); - const previous = this.#queues.get(key) ?? Promise.resolve(); - const task = previous.catch(() => void 0).then(() => this.#handle(event, key)).then(() => this.#finishReaction(messageId, processingReaction, "DONE")).catch(async (error) => { - console.error("[bridge] message handling failed:", error.message); - this.#status.lastError = error.message; - await this.#finishReaction(messageId, processingReaction, "ERROR"); - await this.#send( - event.message.chat_id, - "\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002\u5982\u679C\u95EE\u9898\u6301\u7EED\uFF0C\u8BF7\u5728 DeepSeek Harness \u7684\u98DE\u4E66\u63D2\u4EF6\u9875\u9762\u68C0\u67E5\u8FDE\u63A5\u72B6\u6001\u3002" - ).catch(() => void 0); - }).finally(() => { - this.#acceptedMessageIds.delete(messageId); - if (this.#queues.get(key) === task) this.#queues.delete(key); - }); - this.#queues.set(key, task); - } - async waitForIdle() { - await Promise.allSettled([...this.#queues.values()]); - } - async #handle(event, key) { - const messageId = event.message.message_id; - await this.#state.markSeen(messageId); - this.#status.lastMessageAt = (/* @__PURE__ */ new Date()).toISOString(); - this.#status.messagesReceived += 1; - const text = extractText(event); - if (!text) return; - if (text === "/help") { - await this.#send(event.message.chat_id, HELP_TEXT2); - return; - } - if (text === "/new") { - await this.#state.clearSession(key); - await this.#send(event.message.chat_id, "\u5DF2\u5F00\u542F\u5168\u65B0 Harness \u4F1A\u8BDD\u3002"); - return; - } - if (text === "/status") { - await this.#harness.ensureRunning(); - await this.#send(event.message.chat_id, "\u98DE\u4E66\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002"); - return; - } - let sessionId = this.#state.sessionFor(key); - if (!sessionId || !await this.#harness.sessionExists(sessionId)) { - sessionId = await this.#harness.createSession(); - await this.#state.setSession(key, sessionId); - } - console.info(`[bridge] processing ${event.message.chat_type} message ${messageId} in ${sessionId}`); - await this.#answerWithStream(event, sessionId, text); - this.#status.messagesReplied += 1; - this.#status.lastReplyAt = (/* @__PURE__ */ new Date()).toISOString(); - this.#status.lastError = null; - } - async #answerWithStream(event, sessionId, text) { - const chatId = event.message.chat_id; - const messageId = event.message.message_id; - if (!this.#channel?.stream) { - const answer = await this.#harness.ask(sessionId, text, { timeoutMs: this.#replyTimeoutMs }); - for (const chunk of splitText(answer)) await this.#send(chatId, chunk); - this.#status.streamFallbacks = (this.#status.streamFallbacks ?? 0) + 1; - return; - } - let promptStarted = false; - let completedAnswer = ""; - try { - await this.#channel.stream(chatId, { - markdown: async (controller) => { - promptStarted = true; - completedAnswer = await this.#harness.ask(sessionId, text, { - timeoutMs: this.#replyTimeoutMs, - onUpdate: async (update) => { - await controller.setContent(this.#progressText(update)); - this.#status.streamUpdates = (this.#status.streamUpdates ?? 0) + 1; - } - }); - await controller.setContent(completedAnswer); - } - }, { replyTo: messageId }); - this.#status.streamResponses = (this.#status.streamResponses ?? 0) + 1; - } catch (error) { - this.#status.streamErrors = (this.#status.streamErrors ?? 0) + 1; - if (completedAnswer) { - console.warn("[bridge] native Feishu stream failed after generation; sending final text:", error.message); - for (const chunk of splitText(completedAnswer)) await this.#send(chatId, chunk); - this.#status.streamFallbacks = (this.#status.streamFallbacks ?? 0) + 1; - return; - } - if (promptStarted) throw error; - console.warn("[bridge] native Feishu stream unavailable; using text fallback:", error.message); - const answer = await this.#harness.ask(sessionId, text, { timeoutMs: this.#replyTimeoutMs }); - for (const chunk of splitText(answer)) await this.#send(chatId, chunk); - this.#status.streamFallbacks = (this.#status.streamFallbacks ?? 0) + 1; - } - } - #progressText(update) { - if (update.type === "text" && update.text) return update.text; - if (update.type === "tool") { - if (update.name === "web_search") return "_\u6B63\u5728\u641C\u7D22\u7F51\u7EDC\u5E76\u6574\u7406\u4FE1\u606F\u2026_"; - return `_\u6B63\u5728\u4F7F\u7528 ${update.name || "\u5DE5\u5177"}\u2026_`; - } - return `_${update.text || "\u6B63\u5728\u5904\u7406\u2026"}_`; - } - async #addReaction(messageId, emojiType) { - if (!this.#channel?.addReaction) return null; - try { - const reactionId = await this.#channel.addReaction(messageId, emojiType); - this.#status.reactionsAdded = (this.#status.reactionsAdded ?? 0) + 1; - return reactionId; - } catch (error) { - this.#status.reactionErrors = (this.#status.reactionErrors ?? 0) + 1; - console.warn(`[bridge] unable to add ${emojiType} reaction:`, error.message); - return null; - } - } - async #finishReaction(messageId, processingReaction, finalEmojiType) { - const reactionId = await processingReaction; - if (reactionId && this.#channel?.removeReaction) { - try { - await this.#channel.removeReaction(messageId, reactionId); - this.#status.reactionsRemoved = (this.#status.reactionsRemoved ?? 0) + 1; - } catch (error) { - this.#status.reactionErrors = (this.#status.reactionErrors ?? 0) + 1; - console.warn("[bridge] unable to remove processing reaction:", error.message); - } - } - await this.#addReaction(messageId, finalEmojiType); - } - async #send(chatId, text) { - const response = await this.#client.im.v1.message.create({ - params: { receive_id_type: "chat_id" }, - data: { - receive_id: chatId, - msg_type: "text", - content: JSON.stringify({ text }) - } - }); - if (response?.code && response.code !== 0) { - throw new Error(`Feishu send failed: ${response.msg || response.code}`); - } - } -}; - -// src/channels/feishu/feishu-channel.mjs -var STREAM_ELEMENT_ID = "stream_md"; -var DEFAULT_INITIAL_TEXT = "\u5DF2\u8FDE\u63A5 DeepSeek Harness\uFF0C\u6B63\u5728\u601D\u8003\u2026"; -var MAX_STREAM_CHARS = 28e3; -function assertApiSuccess(operation, response) { - if (response?.code && response.code !== 0) { - throw new Error(`${operation} failed: ${response.msg || response.code}`); - } - return response; -} -function summaryOf(text) { - const summary = String(text ?? "").replace(/\s+/g, " ").trim(); - return summary.length <= 50 ? summary : `${summary.slice(0, 49)}\u2026`; -} -function streamingCard(initialText) { - return { - schema: "2.0", - config: { - streaming_mode: true, - summary: { content: "\u6B63\u5728\u751F\u6210\u2026" }, - streaming_config: { - print_frequency_ms: { default: 70 }, - print_step: { default: 1 }, - print_strategy: "fast" - } - }, - body: { - elements: [{ - tag: "markdown", - element_id: STREAM_ELEMENT_ID, - content: initialText - }] - } - }; -} -var VerifiedFeishuChannel = class { - #client; - #initialText; - constructor({ client, initialText = DEFAULT_INITIAL_TEXT }) { - this.#client = client; - this.#initialText = initialText; - } - async stream(chatId, input, options = {}) { - if (typeof input?.markdown !== "function") { - throw new Error("Feishu stream requires a markdown producer"); - } - let messageId = null; - const cardResponse = assertApiSuccess("Feishu card.create", await this.#client.cardkit.v1.card.create({ - data: { - type: "card_json", - data: JSON.stringify(streamingCard(this.#initialText)) - } - })); - const cardId = cardResponse?.data?.card_id; - if (!cardId) throw new Error("Feishu card.create returned no card_id"); - try { - messageId = await this.#sendCard(chatId, cardId, options.replyTo); - let sequence = 0; - let lastContent = this.#initialText; - const controller = { - messageId, - setContent: async (content) => { - const next = String(content ?? "") || "\u2026"; - if (next === lastContent) return; - if (next.length > MAX_STREAM_CHARS) { - throw new Error(`Feishu stream content exceeds ${MAX_STREAM_CHARS} characters`); - } - const response = await this.#client.cardkit.v1.cardElement.content({ - path: { card_id: cardId, element_id: STREAM_ELEMENT_ID }, - data: { - content: next, - sequence: ++sequence, - uuid: `content_${cardId}_${sequence}` - } - }); - assertApiSuccess("Feishu cardElement.content", response); - lastContent = next; - } - }; - await input.markdown(controller); - const finishResponse = await this.#client.cardkit.v1.card.settings({ - path: { card_id: cardId }, - data: { - settings: JSON.stringify({ - config: { - streaming_mode: false, - summary: { content: summaryOf(lastContent) || "\u56DE\u7B54\u5B8C\u6210" } - } - }), - sequence: ++sequence, - uuid: `settings_${cardId}_${sequence}` - } - }); - assertApiSuccess("Feishu card.settings", finishResponse); - return { messageId }; - } catch (error) { - if (messageId) await this.#recall(messageId); - throw error; - } - } - async #sendCard(chatId, cardId, replyTo) { - const content = JSON.stringify({ type: "card", data: { card_id: cardId } }); - const response = replyTo ? await this.#client.im.v1.message.reply({ - path: { message_id: replyTo }, - data: { msg_type: "interactive", content } - }) : await this.#client.im.v1.message.create({ - params: { receive_id_type: "chat_id" }, - data: { receive_id: chatId, msg_type: "interactive", content } - }); - assertApiSuccess("Feishu message send", response); - const messageId = response?.data?.message_id; - if (!messageId) throw new Error("Feishu message send returned no message_id"); - return messageId; - } - async #recall(messageId) { - try { - const response = await this.#client.im.v1.message.delete({ - path: { message_id: messageId } - }); - assertApiSuccess("Feishu message delete", response); - } catch (error) { - console.warn("[bridge] unable to recall a failed streaming card:", error.message); - } - } - async addReaction(messageId, emojiType) { - const response = assertApiSuccess("Feishu reaction.create", await this.#client.im.v1.messageReaction.create({ - path: { message_id: messageId }, - data: { reaction_type: { emoji_type: emojiType } } - })); - const reactionId = response?.data?.reaction_id; - if (!reactionId) throw new Error("Feishu reaction.create returned no reaction_id"); - return reactionId; - } - async removeReaction(messageId, reactionId) { - assertApiSuccess("Feishu reaction.delete", await this.#client.im.v1.messageReaction.delete({ - path: { message_id: messageId, reaction_id: reactionId } - })); - } -}; - -// src/channels/feishu/feishu-runtime.mjs -function createBridgeStatus({ allowedSenderCount = 1 } = {}) { - return { - startedAt: null, - ready: false, - feishuLongConnectionState: "idle", - harnessReachable: false, - messagesReceived: 0, - messagesReplied: 0, - messagesRejected: 0, - reactionsAdded: 0, - reactionsRemoved: 0, - reactionErrors: 0, - streamResponses: 0, - streamUpdates: 0, - streamFallbacks: 0, - streamErrors: 0, - lastMessageAt: null, - lastReplyAt: null, - lastRejectedAt: null, - lastError: null, - agentPreset: "standard", - authorizationMode: "sender-open-id-allowlist", - allowedSenderCount - }; -} -var FeishuRuntime = class { - #lark; - #appId; - #appSecret; - #domain; - #ownerOpenIds; - #harness; - #state; - #replyTimeoutMs; - #connectTimeoutMs; - #logger; - #client = null; - #bridge = null; - #wsClient = null; - #starting = null; - #status; - constructor({ - lark, - appId, - appSecret, - domain = "feishu", - ownerOpenId, - ownerOpenIds, - harness, - state, - replyTimeoutMs = 6e5, - connectTimeoutMs = 15e3, - logger = console - }) { - if (!lark) throw new Error("FeishuRuntime requires the Feishu SDK"); - if (!appId || !appSecret) throw new Error("FeishuRuntime requires app credentials"); - const allowedOwners = Array.isArray(ownerOpenIds) ? ownerOpenIds : [ownerOpenId]; - const normalizedOwners = [...new Set(allowedOwners.filter((value) => typeof value === "string" && value))]; - if (normalizedOwners.length === 0) throw new Error("FeishuRuntime requires at least one owner open_id"); - if (!harness) throw new Error("FeishuRuntime requires a Harness client"); - if (!state) throw new Error("FeishuRuntime requires a state store"); - this.#lark = lark; - this.#appId = appId; - this.#appSecret = appSecret; - this.#domain = domain; - this.#ownerOpenIds = normalizedOwners; - this.#harness = harness; - this.#state = state; - this.#replyTimeoutMs = replyTimeoutMs; - this.#connectTimeoutMs = connectTimeoutMs; - this.#logger = logger; - this.#status = createBridgeStatus({ allowedSenderCount: normalizedOwners.length }); - } - get status() { - return structuredClone(this.#status); - } - async start() { - if (this.#wsClient && this.#status.ready) return this.status; - if (this.#starting) return this.#starting; - this.#starting = this.#start().finally(() => { - this.#starting = null; - }); - return this.#starting; - } - async #start() { - this.#status.startedAt = (/* @__PURE__ */ new Date()).toISOString(); - this.#status.feishuLongConnectionState = "connecting"; - this.#status.lastError = null; - try { - await this.#harness.ensureRunning(); - this.#status.harnessReachable = true; - const sdkDomain = this.#domain === "lark" ? this.#lark.Domain.Lark : this.#lark.Domain.Feishu; - const larkConfig = { - appId: this.#appId, - appSecret: this.#appSecret, - domain: sdkDomain - }; - this.#client = new this.#lark.Client(larkConfig); - const channel = new VerifiedFeishuChannel({ - client: this.#client, - initialText: "\u5DF2\u8FDE\u63A5 DeepSeek Harness\uFF0C\u6B63\u5728\u601D\u8003\u2026" - }); - this.#bridge = new FeishuHarnessBridge({ - client: this.#client, - channel, - harness: this.#harness, - state: this.#state, - status: this.#status, - allowedSenderOpenIds: new Set(this.#ownerOpenIds), - replyTimeoutMs: this.#replyTimeoutMs - }); - const dispatcher = new this.#lark.EventDispatcher({}).register({ - "im.message.receive_v1": (event) => { - this.#bridge.accept(event); - return {}; - }, - "im.message.reaction.created_v1": () => ({}), - "im.message.reaction.deleted_v1": () => ({}) - }); - let settleReady; - let settleError; - const ready = new Promise((resolve7, reject) => { - let settled = false; - const timer = setTimeout(() => { - if (settled) return; - settled = true; - reject(new Error(`Feishu WebSocket handshake timed out after ${this.#connectTimeoutMs}ms`)); - }, this.#connectTimeoutMs); - settleReady = () => { - if (settled) return; - settled = true; - clearTimeout(timer); - resolve7(); - }; - settleError = (error) => { - if (settled) return; - settled = true; - clearTimeout(timer); - reject(error); - }; - }); - this.#wsClient = new this.#lark.WSClient({ - ...larkConfig, - loggerLevel: this.#lark.LoggerLevel.info, - handshakeTimeoutMs: 15e3, - onReady: () => { - this.#status.feishuLongConnectionState = "connected"; - this.#status.ready = true; - this.#status.lastError = null; - settleReady(); - }, - onError: (error) => { - this.#status.feishuLongConnectionState = "failed"; - this.#status.ready = false; - this.#status.lastError = error?.message ?? String(error); - this.#logger.error("[dsh-feishu] Feishu long connection failed:", this.#status.lastError); - settleError(error); - }, - onReconnecting: () => { - this.#status.feishuLongConnectionState = "reconnecting"; - this.#status.ready = false; - }, - onReconnected: () => { - this.#status.feishuLongConnectionState = "connected"; - this.#status.ready = true; - this.#status.lastError = null; - } - }); - await this.#wsClient.start({ eventDispatcher: dispatcher }).catch((error) => { - settleError(error); - }); - await ready; - return this.status; - } catch (error) { - this.#status.ready = false; - this.#status.feishuLongConnectionState = "failed"; - this.#status.lastError = error?.message ?? String(error); - await this.stop({ preserveError: true }); - throw error; - } - } - async stop({ preserveError = false } = {}) { - const error = preserveError ? this.#status.lastError : null; - this.#status.ready = false; - if (this.#wsClient) { - this.#wsClient.close({ force: true }); - this.#wsClient = null; - } - if (this.#bridge) { - await this.#bridge.waitForIdle(); - this.#bridge = null; - } - this.#client = null; - this.#status.feishuLongConnectionState = preserveError ? "failed" : "idle"; - this.#status.lastError = error; - return this.status; - } -}; - -// src/channels/feishu/harness-client.mjs -import { spawn as spawn3 } from "node:child_process"; -import { randomUUID as randomUUID7 } from "node:crypto"; -var sleep3 = (ms) => new Promise((resolve7) => setTimeout(resolve7, ms)); -function messageText(event) { - return (event?.data?.message?.content ?? []).filter((part) => part.type === "text" && typeof part.text === "string").map((part) => part.text).join("\n").trim(); -} -var HarnessReplyTracker3 = class { - #promptRpcId; - #lastSeq; - #openTurn = null; - #targetTurn = null; - #stepText = /* @__PURE__ */ new Map(); - #latestText = ""; - #finished = false; - #reason = null; - constructor({ promptRpcId, afterSeq = -1 }) { - this.#promptRpcId = promptRpcId; - this.#lastSeq = afterSeq; - } - get finished() { - return this.#finished; - } - get answer() { - return this.#latestText.trim(); - } - get reason() { - return this.#reason; - } - consume(entries) { - let update = null; - const ordered = [...entries].map((entry) => entry?.event ?? entry).filter(Boolean).sort((left, right) => (left.seq ?? -1) - (right.seq ?? -1)); - for (const event of ordered) { - const seq = event.seq ?? -1; - if (seq <= this.#lastSeq) continue; - this.#lastSeq = seq; - if (event.type === "turn/start") { - this.#openTurn = event.data?.turn ?? null; - } - if (event.type === "user/message" && event.data?.source?.rpcId === this.#promptRpcId) { - this.#targetTurn = this.#openTurn; - continue; - } - if (this.#targetTurn === null) continue; - if (event.type === "turn/end") { - if (event.data?.turn !== this.#targetTurn) continue; - this.#finished = true; - this.#reason = event.data?.reason ?? null; - this.#openTurn = null; - continue; - } - if (event.data?.turn !== this.#targetTurn) continue; - if (event.type === "assistant/chunk" && event.data?.chunk?.type === "text-delta") { - const step = event.data?.step ?? 0; - const index = event.data.chunk.index ?? 0; - const key = `${step}:${index}`; - this.#stepText.set(key, (this.#stepText.get(key) ?? "") + event.data.chunk.text); - const stepPrefix = `${step}:`; - const text = [...this.#stepText.entries()].filter(([partKey]) => partKey.startsWith(stepPrefix)).sort(([left], [right]) => Number(left.split(":")[1]) - Number(right.split(":")[1])).map(([, part]) => part).join("\n").trim(); - if (text && text !== this.#latestText) { - this.#latestText = text; - update = { type: "text", text }; - } - continue; - } - if (event.type === "assistant/message") { - const text = messageText(event); - if (text && text !== this.#latestText) { - this.#latestText = text; - update = { type: "text", text }; - } - continue; - } - if (event.type === "tool/call") { - update = { type: "tool", name: event.data?.name ?? "\u5DE5\u5177" }; - } else if (event.type === "tool/result") { - update = { type: "status", text: "\u6B63\u5728\u6574\u7406\u7ED3\u679C\u2026" }; - } - } - return update; - } -}; -var HarnessRpcError3 = class extends Error { - constructor(method, error) { - super(`${method}: ${error?.message ?? "unknown Harness RPC error"}`); - this.name = "HarnessRpcError"; - this.method = method; - this.code = error?.code ?? "internal"; - this.details = error?.details ?? {}; - } -}; -var HarnessClient3 = class { - #baseUrl; - #workspace; - #agentPreset; - #autostart; - #dshBin; - #managedProcess = null; - constructor({ baseUrl, workspace, agentPreset, autostart, dshBin }) { - this.#baseUrl = new URL(baseUrl); - this.#workspace = workspace; - this.#agentPreset = agentPreset; - this.#autostart = autostart; - this.#dshBin = dshBin; - } - async rpc(method, payload = {}, timeoutMs = 3e4, options = {}) { - const rpcId = options.rpcId ?? `feishu-${randomUUID7()}`; - const response = await fetch(new URL(`/api/${method}`, this.#baseUrl), { - method: "POST", - headers: { "content-type": "application/json" }, - body: JSON.stringify({ type: "client-request", rpcId, method, payload }), - signal: AbortSignal.timeout(timeoutMs) - }); - if (!response.ok) throw new Error(`Harness transport ${method} failed: HTTP ${response.status}`); - const body = await response.json(); - if (body?.type !== "server-response" || body?.rpcId !== rpcId) { - throw new Error(`Harness returned an invalid response for ${method}`); - } - if (!body.result?.ok) throw new HarnessRpcError3(method, body.result?.error); - return body.result.value; - } - async health() { - await this.rpc("host.describe", {}, 5e3); - return true; - } - async ensureRunning() { - try { - return await this.health(); - } catch (firstError) { - if (!this.#autostart) throw firstError; - } - if (!this.#managedProcess || this.#managedProcess.exitCode !== null) { - const port = this.#baseUrl.port || (this.#baseUrl.protocol === "https:" ? "443" : "80"); - this.#managedProcess = spawn3(this.#dshBin, [ - "web", - "--host", - this.#baseUrl.hostname, - "--port", - port - ], { - cwd: this.#workspace, - env: process.env, - stdio: ["ignore", "inherit", "inherit"] - }); - this.#managedProcess.on("error", (error) => { - console.error("[bridge] failed to start Harness:", error.message); - }); - } - const deadline = Date.now() + 6e4; - let lastError; - while (Date.now() < deadline) { - await sleep3(1e3); - try { - return await this.health(); - } catch (error) { - lastError = error; - } - } - throw new Error(`Harness did not become ready: ${lastError?.message ?? "timeout"}`); - } - async workspaceId() { - const { items } = await this.rpc("workspace.list", {}); - const existing = items.find((item) => item.path === this.#workspace); - if (existing) return existing.workspaceId; - const created = await this.rpc("workspace.create", { path: this.#workspace }); - return created.workspace.workspaceId; - } - async createSession() { - await this.ensureRunning(); - const workspaceId = await this.workspaceId(); - const created = await this.rpc("session.create", { - workspaceId, - agentPreset: this.#agentPreset - }); - return created.sessionId; - } - async sessionExists(sessionId) { - try { - await this.rpc("session.history", { sessionId, maxMessages: 1 }); - return true; - } catch (error) { - if (error instanceof HarnessRpcError3 && error.code === "session-not-found") return false; - throw error; - } - } - async ask(sessionId, text, options = {}) { - if (typeof options === "number") options = { timeoutMs: options }; - const timeoutMs = options.timeoutMs ?? 6e5; - const onUpdate = typeof options.onUpdate === "function" ? options.onUpdate : null; - await this.ensureRunning(); - const before = await this.rpc("session.history", { sessionId, maxMessages: 1 }); - const baselineSeq = Math.max(-1, ...(before.events ?? []).map(({ event }) => event.seq ?? -1)); - const promptRpcId = `feishu-${randomUUID7()}`; - const tracker = new HarnessReplyTracker3({ promptRpcId, afterSeq: baselineSeq }); - await this.rpc("session.prompt", { - sessionId, - mode: "queue", - content: [{ type: "text", text }], - clientTimeZone: Intl.DateTimeFormat().resolvedOptions().timeZone - }, 3e4, { rpcId: promptRpcId }); - const deadline = Date.now() + timeoutMs; - while (Date.now() < deadline) { - await sleep3(300); - const history = await this.rpc("session.history", { sessionId, maxMessages: 50 }); - const update = tracker.consume(history.events ?? []); - if (update && onUpdate) { - try { - await onUpdate(update); - } catch (error) { - console.warn("[bridge] ignored a progress update failure:", error.message); - } - } - if (!tracker.finished) continue; - if (tracker.answer) return tracker.answer; - throw new Error(`Harness turn ended without a text reply${tracker.reason ? ` (${JSON.stringify(tracker.reason)})` : ""}`); - } - throw new Error(`Harness reply timed out after ${Math.round(timeoutMs / 1e3)} seconds`); - } - stopManagedProcess() { - if (this.#managedProcess?.exitCode === null) this.#managedProcess.kill("SIGTERM"); - } -}; - -// src/channels/feishu/plugin-config-store.mjs -import { createHash as createHash3 } from "node:crypto"; -import { mkdir as mkdir5, readFile as readFile5, rename as rename5, unlink as unlink7, writeFile as writeFile5 } from "node:fs/promises"; -import { dirname as dirname5 } from "node:path"; -var LEGACY_FEISHU_SECRET_REF = "DSH_FEISHU_APP_SECRET"; -function cleanString7(value) { - return typeof value === "string" && value.trim() ? value.trim() : null; -} -function safeId(value) { - const id = cleanString7(value); - return id && /^[A-Za-z0-9_-]{1,128}$/.test(id) ? id : null; -} -function legacyBotId(appId) { - return `bot_${createHash3("sha256").update(appId).digest("hex").slice(0, 24)}`; -} -function normalizeOwners(value) { - const candidates = Array.isArray(value.ownerOpenIds) ? value.ownerOpenIds : [value.ownerOpenId]; - return [...new Set(candidates.map(cleanString7).filter(Boolean))]; -} -function normalizeBot2(value, { legacy = false } = {}) { - if (!value || typeof value !== "object") return null; - const appId = cleanString7(value.appId); - const ownerOpenIds = normalizeOwners(value); - if (!appId || ownerOpenIds.length === 0) return null; - const id = safeId(value.id) ?? (legacy ? legacyBotId(appId) : null); - const secretRef = cleanString7(value.secretRef) ?? (legacy ? LEGACY_FEISHU_SECRET_REF : null); - if (!id || !secretRef) return null; - if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(secretRef)) return null; - const domain = value.domain === "lark" ? "lark" : "feishu"; - return Object.freeze({ - id, - appId, - secretRef, - ownerOpenIds: Object.freeze(ownerOpenIds), - domain, - botName: cleanString7(value.botName), - botOpenId: cleanString7(value.botOpenId), - activated: value.activated ?? null, - deletionPending: value.deletionPending === true, - connectedAt: cleanString7(value.connectedAt), - createdAt: cleanString7(value.createdAt) ?? cleanString7(value.connectedAt) - }); -} -function normalizeDocument2(value) { - if (!value || typeof value !== "object") return null; - if (value.version === 2 && Array.isArray(value.bots)) { - const bots = value.bots.map((bot) => normalizeBot2(bot)); - if (bots.some((bot) => bot === null)) { - throw new Error("dsh-feishu config contains an invalid bot entry"); - } - const ids = /* @__PURE__ */ new Set(); - const refs = /* @__PURE__ */ new Set(); - const appIds = /* @__PURE__ */ new Set(); - for (const bot of bots) { - if (ids.has(bot.id) || refs.has(bot.secretRef) || appIds.has(bot.appId)) { - throw new Error("dsh-feishu config contains duplicate bot identities"); - } - ids.add(bot.id); - refs.add(bot.secretRef); - appIds.add(bot.appId); - } - return { value: Object.freeze({ version: 2, bots: Object.freeze(bots) }), migrated: false }; - } - const legacyBot = normalizeBot2(value, { legacy: true }); - if (!legacyBot) return null; - return { - value: Object.freeze({ version: 2, bots: Object.freeze([legacyBot]) }), - migrated: true - }; -} -var PluginConfigStore = class { - #path; - #value = Object.freeze({ version: 2, bots: Object.freeze([]) }); - #writeQueue = Promise.resolve(); - constructor(path) { - this.#path = path; - } - async load() { - try { - const parsed = JSON.parse(await readFile5(this.#path, "utf8")); - const normalized = normalizeDocument2(parsed); - if (!normalized) throw new Error("dsh-feishu config is incomplete or invalid"); - this.#value = normalized.value; - if (normalized.migrated) await this.#writeDocument(this.#value); - } catch (error) { - if (error?.code !== "ENOENT") throw error; - this.#value = Object.freeze({ version: 2, bots: Object.freeze([]) }); - } - return this; - } - /** Backward-compatible single-bot view used by the original controller. */ - get() { - const bot = this.#value.bots[0]; - if (!bot) return null; - const result = structuredClone(bot); - result.ownerOpenId = result.ownerOpenIds[0]; - return result; - } - list() { - return structuredClone(this.#value.bots); - } - getBot(id) { - const bot = this.#value.bots.find((candidate) => candidate.id === id); - return bot ? structuredClone(bot) : null; - } - /** Backward-compatible save replaces the original single-bot view. */ - async save(value) { - const fallback = { ...value }; - if (!fallback.id) fallback.id = legacyBotId(cleanString7(fallback.appId) ?? "invalid"); - if (!fallback.secretRef) fallback.secretRef = LEGACY_FEISHU_SECRET_REF; - const normalized = normalizeBot2(fallback); - if (!normalized) throw new Error("Refusing to persist incomplete dsh-feishu configuration"); - await this.#replaceBots([normalized]); - return this.get(); - } - async saveBot(value) { - const normalized = normalizeBot2(value); - if (!normalized) throw new Error("Refusing to persist incomplete dsh-feishu bot configuration"); - return this.#mutate((bots) => { - const collision = bots.find((bot) => bot.secretRef === normalized.secretRef && bot.id !== normalized.id); - if (collision) throw new Error("Refusing to share a credential reference between Feishu bots"); - const appCollision = bots.find((bot) => bot.appId === normalized.appId && bot.id !== normalized.id); - if (appCollision) throw new Error("Refusing to persist the same Feishu app twice"); - const index = bots.findIndex((bot) => bot.id === normalized.id); - if (index === -1) bots.push(normalized); - else bots[index] = normalized; - return structuredClone(normalized); - }); - } - async removeBot(id) { - if (!safeId(id)) throw new TypeError("Invalid Feishu bot id"); - return this.#mutate((bots) => { - const index = bots.findIndex((bot) => bot.id === id); - if (index === -1) return null; - const [removed] = bots.splice(index, 1); - return structuredClone(removed); - }); - } - async clear() { - const operation = this.#writeQueue.then(async () => { - try { - await unlink7(this.#path); - } catch (error) { - if (error?.code !== "ENOENT") throw error; - } - this.#value = Object.freeze({ version: 2, bots: Object.freeze([]) }); - }); - this.#writeQueue = operation.then(() => void 0, () => void 0); - await operation; - } - async #replaceBots(bots) { - const document = Object.freeze({ version: 2, bots: Object.freeze([...bots]) }); - const operation = this.#writeQueue.then(async () => { - await this.#writeDocument(document); - this.#value = document; - }); - this.#writeQueue = operation.then(() => void 0, () => void 0); - await operation; - } - async #mutate(mutator) { - let result; - const operation = this.#writeQueue.then(async () => { - const bots = [...this.#value.bots]; - result = mutator(bots); - const document = Object.freeze({ version: 2, bots: Object.freeze(bots) }); - await this.#writeDocument(document); - this.#value = document; - }); - this.#writeQueue = operation.then(() => void 0, () => void 0); - await operation; - return result; - } - async #writeDocument(document) { - await mkdir5(dirname5(this.#path), { recursive: true, mode: 448 }); - const temporary = `${this.#path}.tmp`; - await writeFile5(temporary, `${JSON.stringify(document, null, 2)} -`, { encoding: "utf8", mode: 384 }); - await rename5(temporary, this.#path); - } -}; - -// src/channels/feishu/multi-bot-controller.mjs -import { randomUUID as randomUUID8 } from "node:crypto"; - -// src/channels/feishu/registration-manager.mjs -var ACTIVE_STATES = /* @__PURE__ */ new Set([ - "starting", - "qr_ready", - "polling", - "slow_down", - "domain_switched", - "saving" -]); -var SDK_POLLING_STATES = /* @__PURE__ */ new Set([ - "polling", - "slow_down", - "domain_switched" -]); -var REGISTRATION_STATES = Object.freeze({ - IDLE: "idle", - STARTING: "starting", - QR_READY: "qr_ready", - POLLING: "polling", - SLOW_DOWN: "slow_down", - DOMAIN_SWITCHED: "domain_switched", - SAVING: "saving", - SUCCEEDED: "succeeded", - EXPIRED: "expired", - CANCELLED: "cancelled", - ERROR: "error" -}); -function errorCode(error) { - if (["access_denied", "expired_token", "abort"].includes(error?.code)) return error.code; - return "registration_failed"; -} -function publicError(error) { - const code = errorCode(error); - const messages = { - access_denied: "Registration was denied.", - abort: "Registration was cancelled.", - expired_token: "The registration QR code expired." - }; - return { - code, - message: messages[code] ?? "Unable to register the Feishu app." - }; -} -function expirySeconds(value) { - const seconds = Number(value); - if (!Number.isFinite(seconds) || seconds <= 0) { - throw new TypeError("registerApp onQRCodeReady returned an invalid expireIn"); - } - return seconds; -} -function copyUserInfo(userInfo) { - if (userInfo === void 0) return void 0; - if (userInfo === null || typeof userInfo !== "object" || Array.isArray(userInfo)) { - throw new TypeError("registerApp returned invalid user_info"); - } - return { ...userInfo }; -} -var RegistrationManager = class { - #registerApp; - #onCredentials; - #now; - #setTimeout; - #clearTimeout; - #attempt = 0; - #active = null; - #snapshot; - constructor({ - registerApp, - onCredentials, - now = Date.now, - setTimeout: setTimeoutFn = globalThis.setTimeout, - clearTimeout: clearTimeoutFn = globalThis.clearTimeout - } = {}) { - if (typeof registerApp !== "function") { - throw new TypeError("RegistrationManager requires a registerApp function"); - } - if (typeof onCredentials !== "function") { - throw new TypeError("RegistrationManager requires an onCredentials function"); - } - if (typeof now !== "function" || typeof setTimeoutFn !== "function" || typeof clearTimeoutFn !== "function") { - throw new TypeError("RegistrationManager clock dependencies must be functions"); - } - this.#registerApp = registerApp; - this.#onCredentials = onCredentials; - this.#now = now; - this.#setTimeout = setTimeoutFn; - this.#clearTimeout = clearTimeoutFn; - this.#snapshot = this.#makeSnapshot(null, REGISTRATION_STATES.IDLE); - } - start(registerOptions = {}) { - if (registerOptions === null || typeof registerOptions !== "object" || Array.isArray(registerOptions)) { - throw new TypeError("Registration options must be an object"); - } - this.#supersedeActiveAttempt(); - const run = { - id: ++this.#attempt, - controller: new AbortController(), - qrCodeUrl: null, - expiresAt: null, - pollIntervalSeconds: null, - expiryTimer: null - }; - this.#active = run; - this.#snapshot = this.#makeSnapshot(run, REGISTRATION_STATES.STARTING); - const options = { - ...registerOptions, - signal: run.controller.signal, - onQRCodeReady: (info) => this.#onQRCodeReady(run, info), - onStatusChange: (info) => this.#onStatusChange(run, info) - }; - const registration = Promise.resolve().then(() => this.#registerApp(options)); - void registration.then( - (result) => this.#onRegistrationSucceeded(run, result), - (error) => this.#onRegistrationFailed(run, error) - ); - return this.status(); - } - status() { - this.#expireIfNeeded(); - const snapshot = { ...this.#snapshot }; - if (snapshot.error) snapshot.error = { ...snapshot.error }; - const run = this.#active; - if (run && run.expiresAt !== null && ACTIVE_STATES.has(snapshot.state)) { - snapshot.remainingSeconds = Math.max(0, Math.ceil((run.expiresAt - this.#now()) / 1e3)); - } - return snapshot; - } - cancel() { - const run = this.#active; - if (!run) return this.status(); - this.#finishRun(run, REGISTRATION_STATES.CANCELLED, { - error: { - code: "abort", - message: "Registration was cancelled." - } - }); - run.controller.abort(); - return this.status(); - } - #isCurrent(run) { - return this.#active === run; - } - #makeSnapshot(run, state, extra = {}) { - const snapshot = { - state, - attempt: run?.id ?? this.#attempt, - updatedAt: this.#now(), - ...extra - }; - if (run?.qrCodeUrl && ACTIVE_STATES.has(state)) { - snapshot.qrCodeUrl = run.qrCodeUrl; - snapshot.expiresAt = run.expiresAt; - } - if (run?.pollIntervalSeconds !== null && ACTIVE_STATES.has(state)) { - snapshot.pollIntervalSeconds = run.pollIntervalSeconds; - } - return snapshot; - } - #setRunState(run, state, extra = {}) { - if (!this.#isCurrent(run)) return; - this.#snapshot = this.#makeSnapshot(run, state, extra); - } - #onQRCodeReady(run, info) { - if (!this.#isCurrent(run)) return; - if (typeof info?.url !== "string" || !info.url) { - throw new TypeError("registerApp onQRCodeReady returned an invalid URL"); - } - const seconds = expirySeconds(info.expireIn); - run.qrCodeUrl = info.url; - run.expiresAt = this.#now() + seconds * 1e3; - this.#clearExpiryTimer(run); - run.expiryTimer = this.#setTimeout(() => this.#expireRun(run), seconds * 1e3); - run.expiryTimer?.unref?.(); - this.#setRunState(run, REGISTRATION_STATES.QR_READY); - } - #onStatusChange(run, info) { - if (!this.#isCurrent(run) || !SDK_POLLING_STATES.has(info?.status)) return; - if (info.status === REGISTRATION_STATES.SLOW_DOWN && Number.isFinite(Number(info.interval))) { - run.pollIntervalSeconds = Number(info.interval); - } - this.#setRunState(run, info.status); - } - async #onRegistrationSucceeded(run, result) { - if (!this.#isCurrent(run)) return; - const clientId = result?.client_id; - const clientSecret = result?.client_secret; - if (typeof clientId !== "string" || !clientId || typeof clientSecret !== "string" || !clientSecret) { - this.#finishRun(run, REGISTRATION_STATES.ERROR, { - error: { - code: "invalid_credentials", - message: "Feishu registration returned invalid credentials." - } - }); - return; - } - let userInfo; - try { - userInfo = copyUserInfo(result.user_info); - } catch { - this.#finishRun(run, REGISTRATION_STATES.ERROR, { - error: { - code: "invalid_credentials", - message: "Feishu registration returned invalid credentials." - } - }); - return; - } - this.#clearExpiryTimer(run); - run.qrCodeUrl = null; - run.expiresAt = null; - run.pollIntervalSeconds = null; - this.#setRunState(run, REGISTRATION_STATES.SAVING); - try { - await this.#onCredentials({ - client_id: clientId, - client_secret: clientSecret, - user_info: userInfo - }); - } catch { - if (this.#isCurrent(run)) { - this.#finishRun(run, REGISTRATION_STATES.ERROR, { - error: { - code: "credentials_callback_failed", - message: "Unable to store the Feishu credentials." - } - }); - } - return; - } - if (this.#isCurrent(run)) { - this.#finishRun(run, REGISTRATION_STATES.SUCCEEDED); - } - } - #onRegistrationFailed(run, error) { - if (!this.#isCurrent(run)) return; - const code = errorCode(error); - if (code === "expired_token") { - this.#finishRun(run, REGISTRATION_STATES.EXPIRED, { - error: publicError(error) - }); - return; - } - if (code === "abort") { - this.#finishRun(run, REGISTRATION_STATES.CANCELLED, { - error: publicError(error) - }); - return; - } - this.#finishRun(run, REGISTRATION_STATES.ERROR, { - error: publicError(error) - }); - } - #expireIfNeeded() { - const run = this.#active; - if (run && run.expiresAt !== null && this.#now() >= run.expiresAt) { - this.#expireRun(run); - } - } - #expireRun(run) { - if (!this.#isCurrent(run)) return; - this.#finishRun(run, REGISTRATION_STATES.EXPIRED, { - error: { - code: "expired_token", - message: "The registration QR code expired." - } - }); - run.controller.abort(); - } - #finishRun(run, state, extra = {}) { - if (!this.#isCurrent(run)) return; - this.#clearExpiryTimer(run); - this.#snapshot = this.#makeSnapshot(run, state, extra); - this.#active = null; - } - #clearExpiryTimer(run) { - if (run.expiryTimer !== null) { - this.#clearTimeout(run.expiryTimer); - run.expiryTimer = null; - } - } - #supersedeActiveAttempt() { - const previous = this.#active; - if (!previous) return; - this.#clearExpiryTimer(previous); - this.#active = null; - previous.controller.abort(); - } -}; - -// src/channels/feishu/plugin-controller.mjs -var REQUIRED_TENANT_SCOPES = Object.freeze([ - "im:message.p2p_msg:readonly", - "im:message.group_at_msg:readonly", - "im:message:send_as_bot", - "im:message.reactions:write_only", - "im:message:recall", - "cardkit:card:write" -]); - -// src/channels/feishu/multi-bot-controller.mjs -var ACTIVE_REGISTRATION_STATES2 = /* @__PURE__ */ new Set([ - "starting", - "qr_ready", - "polling", - "slow_down", - "domain_switched" -]); -var MUTABLE_REGISTRATION_STATES = /* @__PURE__ */ new Set([...ACTIVE_REGISTRATION_STATES2, "saving"]); -var ALL_VISIBLE_SENDERS = "*"; -function idleConnection() { - return { - ready: false, - feishuLongConnectionState: "idle", - harnessReachable: false - }; -} -function connectionStatus(runtime) { - return runtime ? runtime.status : idleConnection(); -} -function isConnected2(connection) { - return connection.ready === true && connection.feishuLongConnectionState === "connected" && connection.harnessReachable === true; -} -function maskedAppId(appId) { - return appId.length > 12 ? `${appId.slice(0, 8)}\u2022\u2022\u2022\u2022${appId.slice(-4)}` : "cli_\u2022\u2022\u2022\u2022"; -} -function publicBot(config) { - return { - name: config.botName, - appIdMasked: maskedAppId(config.appId), - activated: config.activated, - domain: config.domain - }; -} -function botPhase({ connected, error, connection }) { - if (connected) return "connected"; - if (error || connection.feishuLongConnectionState === "failed") return "error"; - return "disconnected"; -} -function makeBotId() { - return `bot_${randomUUID8().replaceAll("-", "")}`; -} -function makeRegistrationId() { - return `reg_${randomUUID8().replaceAll("-", "")}`; -} -function secretRefFor(botId) { - return `DSH_FEISHU_APP_SECRET_${botId.slice(4).toUpperCase()}`; -} -var MultiBotDshFeishuController = class { - #registerApp; - #verifyApp; - #credentials; - #configStore; - #createRuntime; - #deleteState; - #createBotId; - #createRegistrationId; - #runtimes = /* @__PURE__ */ new Map(); - #botErrors = /* @__PURE__ */ new Map(); - #registrations = /* @__PURE__ */ new Map(); - #botOwnership = /* @__PURE__ */ new Map(); - #latestRegistrationId = null; - #configTransition = Promise.resolve(); - #botTransitions = /* @__PURE__ */ new Map(); - #revision = 1; - #closed = false; - constructor({ - registerApp, - verifyApp, - credentials, - configStore, - createRuntime, - deleteState = async () => { - }, - createBotId = makeBotId, - createRegistrationId = makeRegistrationId - }) { - if (typeof registerApp !== "function") throw new Error("registerApp is required"); - if (typeof verifyApp !== "function") throw new Error("verifyApp is required"); - if (!credentials) throw new Error("credentials service is required"); - if (!configStore || typeof configStore.list !== "function") { - throw new Error("multi-bot config store is required"); - } - if (typeof createRuntime !== "function") throw new Error("createRuntime is required"); - if (typeof deleteState !== "function") throw new Error("deleteState must be a function"); - this.#registerApp = registerApp; - this.#verifyApp = verifyApp; - this.#credentials = credentials; - this.#configStore = configStore; - this.#createRuntime = createRuntime; - this.#deleteState = deleteState; - this.#createBotId = createBotId; - this.#createRegistrationId = createRegistrationId; - } - async initialize() { - if (this.#closed) return this.status(); - const bots = this.#configStore.list(); - let attempted = false; - await Promise.allSettled(bots.map((config) => this.#withBotTransition(config.id, async () => { - const current = connectionStatus(this.#runtimes.get(config.id)); - if (isConnected2(current) || current.feishuLongConnectionState === "connecting" || current.feishuLongConnectionState === "reconnecting") { - return; - } - attempted = true; - if (config.deletionPending) { - this.#botErrors.set(config.id, { - code: "deletion_pending", - message: "\u673A\u5668\u4EBA\u6B63\u5728\u7B49\u5F85\u5B8C\u6210\u672C\u5730\u5220\u9664\uFF0C\u8BF7\u91CD\u8BD5\u79FB\u9664\u3002" - }); - return; - } - let resolved; - try { - resolved = await this.#credentials.resolve(config.secretRef); - } catch { - this.#botErrors.set(config.id, { - code: "missing_credentials", - message: "\u65E0\u6CD5\u8BFB\u53D6\u673A\u5668\u4EBA\u51ED\u636E\uFF0C\u8BF7\u68C0\u67E5\u51ED\u636E\u5B58\u50A8\u3002" - }); - return; - } - if (!resolved?.value) { - this.#botErrors.set(config.id, { - code: "missing_credentials", - message: "\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u5220\u9664\u540E\u91CD\u65B0\u626B\u7801\u63A5\u5165\u3002" - }); - return; - } - try { - await this.#startRuntime(config, resolved.value); - this.#botErrors.delete(config.id); - } catch { - this.#botErrors.set(config.id, { - code: "connection_failed", - message: "\u673A\u5668\u4EBA\u6682\u65F6\u65E0\u6CD5\u8FDE\u63A5\u98DE\u4E66\uFF0C\u8BF7\u91CD\u8BD5\u3002" - }); - } - }))); - if (attempted) this.#touch(); - return this.status(); - } - startRegistration() { - this.#assertOpen(); - const id = this.#createRegistrationId(); - if (typeof id !== "string" || !/^[A-Za-z0-9_-]{1,128}$/.test(id) || this.#registrations.has(id)) { - throw new Error("Registration id generator returned an invalid or duplicate id"); - } - const record = { id, manager: null, botId: null, createdNew: false, cancelled: false }; - record.manager = new RegistrationManager({ - registerApp: this.#registerApp, - onCredentials: (result) => this.#serializeConfig(() => this.#acceptCredentials(record, result)) - }); - this.#registrations.set(id, record); - this.#latestRegistrationId = id; - this.#trimRegistrations(); - record.manager.start({ - source: "deepseek-harness", - createOnly: true, - appPreset: { - name: "{user} \u7684\u5317\u6C47\u661F\u6CB3 AI \u52A9\u624B", - desc: "\u8FDE\u63A5\u98DE\u4E66\u4E0E DeepSeek Harness\uFF0C\u5728\u804A\u5929\u4E2D\u4F7F\u7528\u4F01\u4E1A AI \u52A9\u624B\u3002" - }, - addons: { - preset: false, - scopes: { tenant: [...REQUIRED_TENANT_SCOPES] }, - events: { items: { tenant: ["im.message.receive_v1"] } } - } - }); - this.#touch(); - return this.registrationStatus(id); - } - hasRegistration(attemptId) { - return this.#registrations.has(attemptId); - } - registrationStatus(attemptId) { - const record = this.#registrations.get(attemptId); - if (!record) return null; - return this.#status({ registration: record, selectedBotId: record.botId }); - } - async cancelRegistration(attemptId = this.#latestRegistrationId) { - const record = this.#registrations.get(attemptId); - if (!record) return this.status(); - if (!MUTABLE_REGISTRATION_STATES.has(record.manager.status().state)) { - return this.registrationStatus(attemptId); - } - record.cancelled = true; - record.manager.cancel(); - await this.#serializeConfig(async () => { - if (record.createdNew && record.botId && this.#botOwnership.get(record.botId) === record.id && this.#configStore.getBot(record.botId)) { - await this.#withBotTransition(record.botId, () => this.#deleteBot(record.botId)); - } - }); - this.#touch(); - return this.registrationStatus(attemptId) ?? this.status(); - } - status(botId) { - return this.#status({ - registration: this.#registrations.get(this.#latestRegistrationId) ?? null, - selectedBotId: botId - }); - } - async bindCredentials({ appId, appSecret, domain = "feishu" } = {}) { - this.#assertOpen(); - const normalizedAppId = typeof appId === "string" ? appId.trim() : ""; - const normalizedSecret = typeof appSecret === "string" ? appSecret.trim() : ""; - const normalizedDomain = domain === "lark" ? "lark" : "feishu"; - if (!normalizedAppId || !normalizedSecret) { - throw new TypeError("Feishu App ID and App Secret are required"); - } - return this.#serializeConfig(async () => { - this.#assertOpen(); - const bot = await this.#verifyApp({ - appId: normalizedAppId, - appSecret: normalizedSecret, - domain: normalizedDomain - }); - this.#assertOpen(); - const existing = this.#configStore.list().find( - (candidate) => candidate.appId === normalizedAppId - ); - const botId = existing?.id ?? this.#createBotId(); - if (typeof botId !== "string" || !/^[A-Za-z0-9_-]{1,128}$/.test(botId) || !existing && this.#configStore.getBot(botId)) { - throw new Error("Bot id generator returned an invalid or duplicate id"); - } - const secretRef = existing?.secretRef ?? secretRefFor(botId); - const previousSecret = await this.#credentials.resolve(secretRef).catch(() => void 0); - const config = { - ...existing, - id: botId, - appId: normalizedAppId, - secretRef, - ownerOpenIds: existing?.ownerOpenIds?.length ? existing.ownerOpenIds : [ALL_VISIBLE_SENDERS], - domain: normalizedDomain, - botName: bot.name, - botOpenId: bot.openId, - activated: bot.activated, - deletionPending: false, - connectedAt: (/* @__PURE__ */ new Date()).toISOString(), - createdAt: existing?.createdAt ?? (/* @__PURE__ */ new Date()).toISOString() - }; - await this.#credentials.set(secretRef, normalizedSecret); - let saved; - try { - saved = await this.#configStore.saveBot(config); - } catch (error) { - await this.#restoreCredential(secretRef, previousSecret); - throw error; - } - await this.#withBotTransition(botId, async () => { - try { - await this.#startRuntime(saved, normalizedSecret); - this.#botErrors.delete(botId); - } catch { - this.#botErrors.set(botId, { - code: "connection_failed", - message: "\u673A\u5668\u4EBA\u5DF2\u7ECF\u7ED1\u5B9A\uFF0C\u4F46\u957F\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u70B9\u51FB\u91CD\u8BD5\u3002" - }); - } - }); - this.#touch(); - return this.status(botId); - }); - } - async reconnectBot(botId) { - this.#assertOpen(); - return this.#withBotTransition(botId, async () => { - const config = this.#requireBot(botId); - if (config.deletionPending) { - this.#botErrors.set(botId, { - code: "deletion_pending", - message: "\u673A\u5668\u4EBA\u6B63\u5728\u7B49\u5F85\u5B8C\u6210\u672C\u5730\u5220\u9664\uFF0C\u8BF7\u91CD\u8BD5\u79FB\u9664\u3002" - }); - return this.status(botId); - } - if (isConnected2(connectionStatus(this.#runtimes.get(botId)))) { - return this.status(botId); - } - let resolved; - try { - resolved = await this.#credentials.resolve(config.secretRef); - } catch { - resolved = null; - } - if (!resolved?.value) { - this.#botErrors.set(botId, { - code: "missing_credentials", - message: "\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u5220\u9664\u540E\u91CD\u65B0\u626B\u7801\u63A5\u5165\u3002" - }); - this.#touch(); - return this.status(botId); - } - try { - await this.#startRuntime(config, resolved.value); - this.#botErrors.delete(botId); - } catch { - this.#botErrors.set(botId, { - code: "connection_failed", - message: "\u673A\u5668\u4EBA\u6682\u65F6\u65E0\u6CD5\u8FDE\u63A5\u98DE\u4E66\uFF0C\u8BF7\u91CD\u8BD5\u3002" - }); - } - this.#touch(); - return this.status(botId); - }); - } - async disconnectBot(botId) { - this.#assertOpen(); - return this.#withBotTransition(botId, async () => { - this.#requireBot(botId); - await this.#stopRuntime(botId); - this.#botErrors.delete(botId); - this.#touch(); - return this.status(botId); - }); - } - async deleteBot(botId) { - this.#assertOpen(); - return this.#serializeConfig(() => this.#withBotTransition(botId, async () => { - this.#requireBot(botId); - await this.#deleteBot(botId); - this.#touch(); - return this.status(); - })); - } - // Compatibility methods for the original one-bot browser contract. - async reconnect() { - const bot = this.#configStore.list()[0]; - return bot ? this.reconnectBot(bot.id) : this.status(); - } - async disconnect() { - const bot = this.#configStore.list()[0]; - return bot ? this.deleteBot(bot.id) : this.status(); - } - async close() { - if (this.#closed) return; - this.#closed = true; - for (const record of this.#registrations.values()) { - if (MUTABLE_REGISTRATION_STATES.has(record.manager.status().state)) { - record.cancelled = true; - record.manager.cancel(); - } - } - await this.#configTransition; - await Promise.allSettled([...this.#botTransitions.values()]); - await Promise.allSettled([...this.#runtimes.keys()].map((id) => this.#stopRuntime(id))); - } - #status({ registration, selectedBotId } = {}) { - const bots = this.#configStore.list().map((config) => { - const connection = connectionStatus(this.#runtimes.get(config.id)); - const connected = isConnected2(connection); - const error = this.#botErrors.get(config.id) ?? null; - return { - botId: config.id, - phase: botPhase({ connected, error, connection }), - connected, - configured: true, - bot: publicBot(config), - connection, - error - }; - }); - const registrationSnapshot = registration ? this.#registrationSnapshot(registration) : { - state: "idle", - attempt: 0, - updatedAt: Date.now() - }; - const registering = ACTIVE_REGISTRATION_STATES2.has(registrationSnapshot.state); - const connecting = registrationSnapshot.state === "saving"; - const registrationOwnsProjection = Boolean(registration) && (registering || connecting); - const selected = bots.find((bot) => bot.botId === selectedBotId) ?? (registrationOwnsProjection ? null : bots[0] ?? null); - const aggregateConnected = bots.some((bot) => bot.connected); - let phase = selected?.phase ?? "unconfigured"; - if (registering) phase = "registering"; - else if (connecting) phase = "connecting"; - else if (registrationSnapshot.state === "error" && !selected) phase = "error"; - return { - schemaVersion: 2, - revision: this.#revision, - phase, - connected: selected?.connected ?? false, - configured: bots.length > 0, - bot: selected?.bot ?? null, - connection: selected?.connection ?? idleConnection(), - error: selected?.error ?? registrationSnapshot.error ?? null, - registration: registrationSnapshot, - bots, - totals: { - configured: bots.length, - connected: bots.filter((bot) => bot.connected).length - }, - anyConnected: aggregateConnected - }; - } - #registrationSnapshot(record) { - const snapshot = record.manager.status(); - return { - ...snapshot, - attempt: record.id, - ...record.botId ? { botId: record.botId } : {} - }; - } - async #acceptCredentials(record, result) { - if (record.cancelled) throw new Error("Registration was cancelled"); - const appId = result.client_id; - const appSecret = result.client_secret; - const ownerOpenId = result.user_info?.open_id; - const domain = result.user_info?.tenant_brand === "lark" ? "lark" : "feishu"; - if (!ownerOpenId) throw new Error("Feishu registration returned no owner open_id"); - const bot = await this.#verifyApp({ appId, appSecret, domain }); - if (record.cancelled) throw new Error("Registration was cancelled"); - const existing = this.#configStore.list().find((candidate) => candidate.appId === appId); - const botId = existing?.id ?? this.#createBotId(); - if (typeof botId !== "string" || !/^[A-Za-z0-9_-]{1,128}$/.test(botId) || !existing && this.#configStore.getBot(botId)) { - throw new Error("Bot id generator returned an invalid or duplicate id"); - } - const secretRef = existing?.secretRef ?? secretRefFor(botId); - const previousOwnership = this.#botOwnership.get(botId); - const previousSecret = await this.#credentials.resolve(secretRef).catch(() => void 0); - await this.#credentials.set(secretRef, appSecret); - let config; - try { - config = await this.#configStore.saveBot({ - ...existing, - id: botId, - appId, - secretRef, - ownerOpenIds: [.../* @__PURE__ */ new Set([...existing?.ownerOpenIds ?? [], ownerOpenId])], - domain, - botName: bot.name, - botOpenId: bot.openId, - activated: bot.activated, - deletionPending: false, - connectedAt: (/* @__PURE__ */ new Date()).toISOString(), - createdAt: existing?.createdAt ?? (/* @__PURE__ */ new Date()).toISOString() - }); - record.botId = botId; - record.createdNew = !existing; - this.#botOwnership.set(botId, record.id); - } catch (error) { - try { - await this.#restoreCredential(secretRef, previousSecret); - } catch (restoreError) { - throw new Error("Unable to restore the Feishu credential after a config failure.", { - cause: restoreError - }); - } - throw error; - } - if (record.cancelled) { - if (record.createdNew) { - await this.#withBotTransition(botId, () => this.#deleteBot(botId)); - } else { - await this.#configStore.saveBot(existing); - await this.#restoreCredential(secretRef, previousSecret); - if (previousOwnership) this.#botOwnership.set(botId, previousOwnership); - else this.#botOwnership.delete(botId); - } - throw new Error("Registration was cancelled"); - } - let cancellationRolledBack = false; - try { - await this.#withBotTransition(botId, () => this.#startRuntime(config, appSecret)); - if (record.cancelled) { - if (record.createdNew) { - await this.#withBotTransition(botId, () => this.#deleteBot(botId)); - } else { - await this.#configStore.saveBot(existing); - await this.#restoreCredential(secretRef, previousSecret); - if (previousOwnership) this.#botOwnership.set(botId, previousOwnership); - else this.#botOwnership.delete(botId); - if (previousSecret?.value && !existing.deletionPending) { - await this.#withBotTransition(botId, () => this.#startRuntime(existing, previousSecret.value)); - } else { - await this.#withBotTransition(botId, () => this.#stopRuntime(botId)); - } - } - cancellationRolledBack = true; - throw new Error("Registration was cancelled"); - } - this.#botErrors.delete(botId); - this.#touch(); - } catch (error) { - if (record.cancelled) { - if (!cancellationRolledBack && record.createdNew && this.#configStore.getBot(botId)) { - await this.#withBotTransition(botId, () => this.#deleteBot(botId)); - } else if (!cancellationRolledBack && existing) { - await this.#configStore.saveBot(existing); - await this.#restoreCredential(secretRef, previousSecret); - if (previousOwnership) this.#botOwnership.set(botId, previousOwnership); - else this.#botOwnership.delete(botId); - if (!this.#closed && previousSecret?.value && !existing.deletionPending) { - await this.#withBotTransition(botId, () => this.#startRuntime(existing, previousSecret.value)); - } else { - await this.#withBotTransition(botId, () => this.#stopRuntime(botId)); - } - } - this.#touch(); - throw error; - } - if (existing && previousSecret?.value) { - try { - await this.#configStore.saveBot(existing); - await this.#restoreCredential(secretRef, previousSecret); - if (previousOwnership) this.#botOwnership.set(botId, previousOwnership); - else this.#botOwnership.delete(botId); - if (!existing.deletionPending) { - await this.#withBotTransition(botId, () => this.#startRuntime(existing, previousSecret.value)); - this.#botErrors.delete(botId); - } else { - await this.#withBotTransition(botId, () => this.#stopRuntime(botId)); - this.#botErrors.set(botId, { - code: "deletion_pending", - message: "\u673A\u5668\u4EBA\u6B63\u5728\u7B49\u5F85\u5B8C\u6210\u672C\u5730\u5220\u9664\uFF0C\u8BF7\u91CD\u8BD5\u79FB\u9664\u3002" - }); - } - this.#touch(); - throw error; - } catch (restoreError) { - if (restoreError === error) throw error; - this.#botErrors.set(botId, { - code: "connection_failed", - message: "\u673A\u5668\u4EBA\u8FDE\u63A5\u66F4\u65B0\u5931\u8D25\uFF0C\u4E14\u539F\u8FDE\u63A5\u65E0\u6CD5\u6062\u590D\uFF0C\u8BF7\u91CD\u8BD5\u3002" - }); - this.#touch(); - throw new Error("Unable to restore the previous Feishu bot connection.", { - cause: restoreError - }); - } - } - this.#botErrors.set(botId, { - code: "connection_failed", - message: "\u673A\u5668\u4EBA\u5DF2\u7ECF\u521B\u5EFA\uFF0C\u4F46\u957F\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u70B9\u51FB\u91CD\u8BD5\u3002" - }); - this.#touch(); - throw error; - } - } - async #startRuntime(config, appSecret) { - await this.#stopRuntime(config.id); - const runtime = await this.#createRuntime({ - botId: config.id, - config, - appSecret - }); - this.#runtimes.set(config.id, runtime); - try { - await runtime.start(); - } catch (error) { - if (this.#runtimes.get(config.id) === runtime) this.#runtimes.delete(config.id); - await runtime.stop({ preserveError: true }).catch(() => void 0); - throw error; - } - } - async #stopRuntime(botId) { - const runtime = this.#runtimes.get(botId); - this.#runtimes.delete(botId); - if (runtime) await runtime.stop(); - } - async #deleteBot(botId) { - let config = this.#configStore.getBot(botId); - if (!config) return; - if (!config.deletionPending) { - config = await this.#configStore.saveBot({ ...config, deletionPending: true }); - } - await this.#stopRuntime(botId); - try { - await this.#credentials.unset(config.secretRef); - } catch (error) { - this.#botErrors.set(botId, { - code: "credential_removal_failed", - message: "\u65E0\u6CD5\u5220\u9664\u673A\u5668\u4EBA\u51ED\u636E\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002" - }); - throw new Error("Unable to remove the Feishu credential.", { cause: error }); - } - try { - await this.#deleteState({ botId, config }); - } catch (error) { - this.#botErrors.set(botId, { - code: "state_cleanup_failed", - message: "\u65E0\u6CD5\u5220\u9664\u673A\u5668\u4EBA\u7684\u672C\u5730\u4F1A\u8BDD\u6570\u636E\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002" - }); - throw new Error("Unable to remove the Feishu bot session state.", { cause: error }); - } - await this.#configStore.removeBot(botId); - this.#botErrors.delete(botId); - this.#botOwnership.delete(botId); - } - async #restoreCredential(secretRef, previous) { - if (previous?.value) await this.#credentials.set(secretRef, previous.value); - else await this.#credentials.unset(secretRef); - } - #requireBot(botId) { - const config = this.#configStore.getBot(botId); - if (!config) throw new Error("Unknown Feishu bot"); - return config; - } - #assertOpen() { - if (this.#closed) throw new Error("The Feishu controller is closed"); - } - #serializeConfig(operation) { - const result = this.#configTransition.then(operation, operation); - this.#configTransition = result.then(() => void 0, () => void 0); - return result; - } - #withBotTransition(botId, operation) { - const previous = this.#botTransitions.get(botId) ?? Promise.resolve(); - const result = previous.then(operation, operation); - const tail = result.then(() => void 0, () => void 0); - this.#botTransitions.set(botId, tail); - void tail.finally(() => { - if (this.#botTransitions.get(botId) === tail) this.#botTransitions.delete(botId); - }); - return result; - } - #trimRegistrations() { - if (this.#registrations.size <= 32) return; - for (const [id, record] of this.#registrations) { - if (id === this.#latestRegistrationId) continue; - const state = record.manager.status().state; - if (!ACTIVE_REGISTRATION_STATES2.has(state) && state !== "saving") { - this.#registrations.delete(id); - } - if (this.#registrations.size <= 32) break; - } - } - #touch() { - this.#revision += 1; - } -}; - -// src/channels/feishu/state-store.mjs -import { mkdir as mkdir6, readFile as readFile6, rename as rename6, writeFile as writeFile6 } from "node:fs/promises"; -import { dirname as dirname6 } from "node:path"; -var EMPTY_STATE3 = Object.freeze({ version: 1, sessions: {}, seenMessageIds: [] }); -var StateStore = class { - #path; - #state = structuredClone(EMPTY_STATE3); - #writeQueue = Promise.resolve(); - constructor(path) { - this.#path = path; - } - async load() { - try { - const parsed = JSON.parse(await readFile6(this.#path, "utf8")); - this.#state = { - version: 1, - sessions: parsed.sessions && typeof parsed.sessions === "object" ? parsed.sessions : {}, - seenMessageIds: Array.isArray(parsed.seenMessageIds) ? parsed.seenMessageIds.slice(-1e3) : [] - }; - } catch (error) { - if (error?.code !== "ENOENT") throw error; - await this.#persist(); - } - return this; - } - sessionFor(key) { - return this.#state.sessions[key] ?? null; - } - async setSession(key, sessionId) { - this.#state.sessions[key] = sessionId; - await this.#persist(); - } - async clearSession(key) { - delete this.#state.sessions[key]; - await this.#persist(); - } - hasSeen(messageId) { - return this.#state.seenMessageIds.includes(messageId); - } - async markSeen(messageId) { - if (this.hasSeen(messageId)) return; - this.#state.seenMessageIds.push(messageId); - if (this.#state.seenMessageIds.length > 1e3) { - this.#state.seenMessageIds.splice(0, this.#state.seenMessageIds.length - 1e3); - } - await this.#persist(); - } - snapshot() { - return structuredClone(this.#state); - } - async #persist() { - const snapshot = JSON.stringify(this.#state, null, 2) + "\n"; - this.#writeQueue = this.#writeQueue.then(async () => { - await mkdir6(dirname6(this.#path), { recursive: true, mode: 448 }); - const temporary = `${this.#path}.tmp`; - await writeFile6(temporary, snapshot, { encoding: "utf8", mode: 384 }); - await rename6(temporary, this.#path); - }); - await this.#writeQueue; - } -}; - -// plugin-src/host/channels/feishu/production.mjs -function harnessOrigin3(webServer, configured) { - if (configured !== void 0) return new URL(configured); - const port = webServer?.port; - if (!Number.isInteger(port) || port < 1 || port > 65535) { - throw new Error("dsh-feishu requires an initialized DSH webServer port"); - } - return new URL(`http://127.0.0.1:${port}`); -} -function pluginPaths3(config) { - const dshHome = resolve3(config.dshHome ?? process.env.DSH_HOME ?? join3(homedir3(), ".dsh")); - const root = resolve3(config.dataDir ?? join3(dshHome, "integrations", "dsh-feishu")); - return { - root, - config: resolve3(config.configPath ?? join3(root, "config.json")), - legacyState: resolve3(config.statePath ?? join3(root, "state.json")), - bots: resolve3(config.botsDir ?? join3(root, "bots")) - }; -} -async function createProductionController3(ctx, config = {}, internals = {}) { - if (!ctx?.credentials) throw new TypeError("dsh-feishu requires ctx.credentials"); - if (!ctx?.webServer) throw new TypeError("dsh-feishu requires ctx.webServer"); - const lark = internals.lark ?? Lark; - const Controller = internals.Controller ?? MultiBotDshFeishuController; - const ConfigStore = internals.ConfigStore ?? PluginConfigStore; - const SessionStateStore = internals.StateStore ?? StateStore; - const Harness = internals.HarnessClient ?? HarnessClient3; - const Runtime = internals.FeishuRuntime ?? FeishuRuntime; - const verifyApp = internals.verifyFeishuApp ?? verifyFeishuApp; - const createSupervisor = internals.createConnectionSupervisor ?? createConnectionSupervisor2; - const logger = typeof ctx.logger === "function" ? ctx.logger("dsh-feishu") : ctx.logger ?? console; - const paths = pluginPaths3(config); - const configStore = await new ConfigStore(paths.config).load(); - const stateStores = /* @__PURE__ */ new Map(); - const statePathFor = (botConfig) => !botConfig.id || !botConfig.secretRef || botConfig.secretRef === LEGACY_FEISHU_SECRET_REF ? paths.legacyState : resolve3(paths.bots, botConfig.id, "state.json"); - const stateFor = async (botConfig) => { - const stateKey = botConfig.id ?? "__legacy__"; - let state = stateStores.get(stateKey); - if (!state) { - state = await new SessionStateStore(statePathFor(botConfig)).load(); - stateStores.set(stateKey, state); - } - return state; - }; - const harness = new Harness({ - baseUrl: harnessOrigin3(ctx.webServer, config.harnessBaseUrl), - workspace: resolve3(config.workspace ?? process.cwd()), - agentPreset: config.agentPreset ?? "standard", - // This plugin is already hosted by a running DSH process. Starting a - // second DSH would create a competing server and lifecycle. - autostart: false, - dshBin: config.dshBin ?? "dsh" - }); - const controller = new Controller({ - registerApp: (options) => lark.registerApp(options), - verifyApp, - credentials: ctx.credentials, - configStore, - createRuntime: async ({ botId, config: botConfig, appSecret }) => { - const state = await stateFor(botConfig); - return new Runtime({ - lark, - appId: botConfig.appId, - appSecret, - domain: botConfig.domain, - ownerOpenIds: botConfig.ownerOpenIds ?? [botConfig.ownerOpenId], - harness, - state, - replyTimeoutMs: config.replyTimeoutMs ?? 6e5, - logger: { - error: (...args) => logger.error?.(`[${botId ?? botConfig.id}]`, ...args), - warn: (...args) => logger.warn?.(`[${botId ?? botConfig.id}]`, ...args), - info: (...args) => logger.info?.(`[${botId ?? botConfig.id}]`, ...args), - debug: (...args) => logger.debug?.(`[${botId ?? botConfig.id}]`, ...args) - } - }); - }, - deleteState: async ({ botId, config: botConfig }) => { - stateStores.delete(botId); - try { - await unlink8(statePathFor(botConfig)); - } catch (error) { - if (error?.code !== "ENOENT") throw error; - } - } - }); - const supervisor = createSupervisor({ - controller, - harness, - logger, - retryDelaysMs: config.retryDelaysMs, - healthyIntervalMs: config.healthyIntervalMs - }).start(); - return { - controller, - ready: supervisor.ready, - async close() { - await supervisor.close(); - await controller.close(); - harness.stopManagedProcess(); - } - }; -} - -// plugin-src/host/channels/feishu/rpc.mjs -import QRCode2 from "qrcode"; - -// plugin-src/client/channels/feishu/api.js -var FEISHU_RPC_CHANNEL = "/feishu"; -var FEISHU_ENDPOINTS = Object.freeze({ - status: "connection.status", - beginProvisioning: "provision.begin", - pollProvisioning: "provision.poll", - cancelProvisioning: "provision.cancel", - bindCredentials: "bot.bind-credentials", - reconnectBot: "bot.reconnect", - disconnectBot: "bot.disconnect", - deleteBot: "bot.delete", - // Kept for rolling upgrades. The multi-bot UI never calls these endpoints. - testConnection: "connection.test", - disconnect: "connection.disconnect" -}); - -// plugin-src/host/channels/feishu/rpc.mjs -var FEISHU_MULTI_ENDPOINTS = Object.freeze({ - reconnectBot: "bot.reconnect", - disconnectBot: "bot.disconnect", - deleteBot: "bot.delete" -}); -var FEISHU_RPC_ENDPOINTS = Object.freeze([ - .../* @__PURE__ */ new Set([...Object.values(FEISHU_ENDPOINTS), ...Object.values(FEISHU_MULTI_ENDPOINTS)]) -]); -var REGISTRATION_STATES2 = /* @__PURE__ */ new Set([ - "idle", - "starting", - "qr_ready", - "polling", - "slow_down", - "domain_switched", - "saving", - "succeeded", - "expired", - "cancelled", - "error" -]); -var SAFE_ID = /^[A-Za-z0-9_-]{1,128}$/; -var PUBLIC_ERROR_MESSAGES = Object.freeze({ - abort: "Registration was cancelled.", - access_denied: "Registration was denied.", - expired_token: "The registration QR code expired.", - invalid_credentials: "Feishu returned invalid app credentials.", - credentials_callback_failed: "Unable to activate the Feishu connection.", - registration_failed: "Unable to register the Feishu app.", - connection_failed: "The bot was created, but its connection could not be started.", - credential_removal_failed: "Unable to remove the Feishu credentials.", - state_cleanup_failed: "Unable to remove the bot session data. Please retry.", - deletion_pending: "Bot deletion is incomplete. Retry removal to finish cleanup.", - missing_credentials: "The bot credentials are missing. Delete it and scan again." -}); -var POLL_STATUS_BY_REGISTRATION = Object.freeze({ - idle: "pending", - starting: "pending", - qr_ready: "pending", - polling: "pending", - slow_down: "pending", - domain_switched: "pending", - saving: "connecting", - succeeded: "connected", - expired: "expired", - cancelled: "failed", - error: "failed" -}); -function isPlainObject(value) { - if (value === null || typeof value !== "object" || Array.isArray(value)) return false; - const prototype = Object.getPrototypeOf(value); - return prototype === Object.prototype || prototype === null; -} -function hasOnlyKeys(value, allowed) { - return isPlainObject(value) && Reflect.ownKeys(value).every((key) => typeof key === "string" && allowed.has(key)); -} -function finiteNumber(value) { - return Number.isFinite(value) ? value : void 0; -} -function safeOpaqueId(value) { - return typeof value === "string" && SAFE_ID.test(value); -} -function validCredential2(value, maxLength) { - return typeof value === "string" && value.trim().length > 0 && value.length <= maxLength; -} -function publicError2(error) { - if (!error || typeof error !== "object") return null; - const code = typeof error.code === "string" && Object.hasOwn(PUBLIC_ERROR_MESSAGES, error.code) ? error.code : "registration_failed"; - return { code, message: PUBLIC_ERROR_MESSAGES[code] }; -} -function publicRegistration(registration) { - if (!registration || typeof registration !== "object") return { state: "idle", attempt: 0 }; - const state = REGISTRATION_STATES2.has(registration.state) ? registration.state : "error"; - const attempt = safeOpaqueId(registration.attempt) ? registration.attempt : finiteNumber(registration.attempt) ?? 0; - const result = { state, attempt }; - const updatedAt = finiteNumber(registration.updatedAt); - const expiresAt = finiteNumber(registration.expiresAt); - const remainingSeconds = finiteNumber(registration.remainingSeconds); - const pollIntervalSeconds = finiteNumber(registration.pollIntervalSeconds); - if (updatedAt !== void 0) result.updatedAt = updatedAt; - if (typeof registration.qrCodeUrl === "string" && registration.qrCodeUrl.length > 0) { - result.qrCodeUrl = registration.qrCodeUrl; - } - if (expiresAt !== void 0) result.expiresAt = expiresAt; - if (remainingSeconds !== void 0) result.remainingSeconds = remainingSeconds; - if (pollIntervalSeconds !== void 0) result.pollIntervalSeconds = pollIntervalSeconds; - if (safeOpaqueId(registration.botId)) result.botId = registration.botId; - const error = publicError2(registration.error); - if (error) result.error = error; - return result; -} -function connectionFacts(connection) { - const source = connection && typeof connection === "object" ? connection : {}; - const connected = source.connected === true || source.ready === true && source.feishuLongConnectionState === "connected" && source.harnessReachable === true; - return { - connected, - ready: source.ready === true, - harnessReachable: source.harnessReachable === true - }; -} -function publicBot2(bot) { - const source = bot && typeof bot === "object" ? bot : {}; - const result = { - name: typeof source.name === "string" && source.name.length > 0 ? source.name : "\u98DE\u4E66\u673A\u5668\u4EBA" - }; - if (typeof source.avatarUrl === "string") result.avatarUrl = source.avatarUrl; - if (typeof source.appIdMasked === "string") result.appIdMasked = source.appIdMasked; - if (typeof source.tenantName === "string") result.tenantName = source.tenantName; - if (source.domain === "feishu" || source.domain === "lark") result.domain = source.domain; - if (typeof source.activated === "boolean" || typeof source.activated === "number") { - result.activated = source.activated; - } - return result; -} -function publicHealth(status, connected) { - if (connected) return { status: "healthy", summary: "\u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38", lastCheckedAt: Date.now() }; - if (status?.configured === true) { - return { status: "offline", summary: "\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5", lastCheckedAt: Date.now() }; - } - return { status: "offline", summary: "\u5C1A\u672A\u63A5\u5165\u98DE\u4E66\u673A\u5668\u4EBA", lastCheckedAt: Date.now() }; -} -function connectionState(status, registration, connected) { - if (connected) return "connected"; - if (status?.phase === "error" || registration.state === "error") return "error"; - if (status?.phase === "connecting" || registration.state === "saving") return "connecting"; - if (status?.phase === "registering" || ["starting", "qr_ready", "polling", "slow_down", "domain_switched"].includes(registration.state)) { - return "provisioning"; - } - return "disconnected"; -} -async function qrCodeDataUrl(verificationUrl) { - return QRCode2.toDataURL(verificationUrl, { - errorCorrectionLevel: "M", - margin: 1, - width: 320, - type: "image/png" - }); -} -async function publicProvisioning(registration, encodeQr) { - if (!registration.qrCodeUrl) return void 0; - return { - attemptId: String(registration.attempt), - verificationUrl: registration.qrCodeUrl, - qrCodeDataUrl: await encodeQr(registration.qrCodeUrl), - expiresAt: registration.expiresAt ?? Date.now() + 5 * 6e4, - pollIntervalMs: Math.max(800, Math.min(1e4, (registration.pollIntervalSeconds ?? 1.8) * 1e3)) - }; -} -function publicBotEntry(entry) { - const source = entry && typeof entry === "object" ? entry : {}; - if (!safeOpaqueId(source.botId)) return null; - const facts = connectionFacts(source.connection); - const connected = source.connected === true || facts.connected; - const registration = { state: "idle" }; - const result = { - botId: source.botId, - state: connectionState(source, registration, connected), - connected, - configured: source.configured === true, - bot: publicBot2(source.bot), - health: publicHealth(source, connected) - }; - const error = publicError2(source.error); - if (error) result.error = error; - return result; -} -async function toPublicFeishuStatus(status, { encodeQr = qrCodeDataUrl } = {}) { - const source = status && typeof status === "object" ? status : {}; - const registration = publicRegistration(source.registration); - const facts = connectionFacts(source.connection); - const connected = source.connected === true || facts.connected; - const provisioning = await publicProvisioning(registration, encodeQr); - const error = publicError2(source.error) ?? registration.error ?? null; - const bots = Array.isArray(source.bots) ? source.bots.map(publicBotEntry).filter(Boolean) : []; - const snapshot = { - schemaVersion: source.schemaVersion === 2 ? 2 : 1, - revision: Number.isSafeInteger(source.revision) && source.revision >= 0 ? source.revision : 0, - state: connectionState(source, registration, connected), - connected, - configured: source.configured === true, - bot: publicBot2(source.bot), - health: publicHealth(source, connected), - bots, - totals: { - configured: bots.length || (source.configured === true ? 1 : 0), - connected: bots.length ? bots.filter((bot) => bot.connected).length : connected ? 1 : 0 - } - }; - if (provisioning) snapshot.provisioning = provisioning; - if (error) snapshot.error = error; - return snapshot; -} -function badRequest2(message) { - return { ok: false, error: { code: "bad-request", message, details: { issues: [] } } }; -} -function cancelled2() { - return { ok: false, error: { code: "cancelled", message: "The Feishu request was cancelled.", details: {} } }; -} -function internalFailure2() { - return { ok: false, error: { code: "internal", message: "The Feishu integration operation failed.", details: {} } }; -} -function validPayload(endpoint, payload) { - if (endpoint === FEISHU_ENDPOINTS.status) { - return hasOnlyKeys(payload, /* @__PURE__ */ new Set()) ? null : "This endpoint accepts an empty payload only."; - } - if (endpoint === FEISHU_ENDPOINTS.testConnection) { - return hasOnlyKeys(payload, /* @__PURE__ */ new Set()) ? null : "This endpoint accepts an empty payload only."; - } - if (endpoint === FEISHU_ENDPOINTS.beginProvisioning) { - if (!hasOnlyKeys(payload, /* @__PURE__ */ new Set(["locale", "replaceAttemptId"]))) { - return "Provisioning accepts locale and replaceAttemptId only."; - } - if (payload.locale !== void 0 && payload.locale !== "zh-CN") return "The provisioning locale must be zh-CN."; - if (payload.replaceAttemptId !== void 0 && !safeOpaqueId(payload.replaceAttemptId)) { - return "replaceAttemptId must be a valid opaque id."; - } - return null; - } - if (endpoint === FEISHU_ENDPOINTS.bindCredentials) { - return hasOnlyKeys(payload, /* @__PURE__ */ new Set(["appId", "appSecret"])) && validCredential2(payload.appId, 256) && validCredential2(payload.appSecret, 1024) ? null : "Credential binding requires App ID and App Secret."; - } - if (endpoint === FEISHU_ENDPOINTS.pollProvisioning || endpoint === FEISHU_ENDPOINTS.cancelProvisioning) { - return hasOnlyKeys(payload, /* @__PURE__ */ new Set(["attemptId"])) && safeOpaqueId(payload.attemptId) ? null : "A single valid attemptId is required."; - } - if (endpoint === FEISHU_ENDPOINTS.disconnect) { - return hasOnlyKeys(payload, /* @__PURE__ */ new Set(["removeCredentials"])) && payload.removeCredentials === true ? null : "Disconnect requires removeCredentials=true."; - } - if (endpoint === FEISHU_MULTI_ENDPOINTS.reconnectBot || endpoint === FEISHU_MULTI_ENDPOINTS.disconnectBot) { - return hasOnlyKeys(payload, /* @__PURE__ */ new Set(["botId"])) && safeOpaqueId(payload.botId) ? null : "A single valid botId is required."; - } - if (endpoint === FEISHU_MULTI_ENDPOINTS.deleteBot) { - return hasOnlyKeys(payload, /* @__PURE__ */ new Set(["botId", "confirm"])) && safeOpaqueId(payload.botId) && payload.confirm === true ? null : "Deleting a bot requires a valid botId and confirm=true."; - } - return "Unknown Feishu endpoint."; -} -function abortableDelay2(milliseconds, signal) { - return new Promise((resolve7, reject) => { - if (signal?.aborted) { - reject(signal.reason ?? new Error("aborted")); - return; - } - const timer = setTimeout(done, milliseconds); - timer.unref?.(); - function done() { - signal?.removeEventListener("abort", aborted); - resolve7(); - } - function aborted() { - clearTimeout(timer); - reject(signal.reason ?? new Error("aborted")); - } - signal?.addEventListener("abort", aborted, { once: true }); - }); -} -async function statusForRegistration(controller, attemptId) { - if (typeof controller.registrationStatus === "function") { - return controller.registrationStatus(attemptId); - } - return controller.status(); -} -async function waitForQr(controller, initial, attemptId, signal) { - let current = initial; - const deadline = Date.now() + 15e3; - for (; ; ) { - const registration = publicRegistration(current?.registration); - if (registration.qrCodeUrl) return current; - if (["error", "expired", "cancelled"].includes(registration.state)) { - throw new Error("Provisioning stopped before the QR code was ready."); - } - if (Date.now() >= deadline) throw new Error("Provisioning QR code timed out."); - await abortableDelay2(50, signal); - current = await statusForRegistration(controller, attemptId); - if (!current) throw new Error("The provisioning attempt is no longer active."); - } -} -function sameAttempt(status, attemptId) { - return String(publicRegistration(status?.registration).attempt) === attemptId; -} -function pollStatus(status) { - const registration = publicRegistration(status?.registration); - if (registration.state === "succeeded") { - const connected = registration.botId && (status?.connected === true || connectionFacts(status?.connection).connected); - return connected ? "connected" : "connecting"; - } - return POLL_STATUS_BY_REGISTRATION[registration.state] ?? "failed"; -} -function assertController2(controller) { - if (!controller || typeof controller.status !== "function" || typeof controller.startRegistration !== "function" || typeof controller.cancelRegistration !== "function" || typeof controller.disconnect !== "function") { - throw new TypeError("A Feishu controller with status/start/cancel/disconnect is required"); - } -} -function createFeishuRpcHandler(controller, { encodeQr = qrCodeDataUrl } = {}) { - assertController2(controller); - const qrCache = /* @__PURE__ */ new Map(); - const attemptQr = /* @__PURE__ */ new Map(); - const cachedEncodeQr = (url) => { - let encoded = qrCache.get(url); - if (!encoded) { - if (qrCache.size >= 32) qrCache.delete(qrCache.keys().next().value); - encoded = Promise.resolve().then(() => encodeQr(url)); - qrCache.set(url, encoded); - } - return encoded; - }; - return async (endpoint, payload, signal) => { - if (signal?.aborted) return cancelled2(); - if (!FEISHU_RPC_ENDPOINTS.includes(endpoint)) return badRequest2("Unknown Feishu endpoint."); - const payloadFailure6 = validPayload(endpoint, payload); - if (payloadFailure6) return badRequest2(payloadFailure6); - try { - let value; - if (endpoint === FEISHU_ENDPOINTS.status) { - value = await toPublicFeishuStatus(await controller.status(), { encodeQr: cachedEncodeQr }); - } else if (endpoint === FEISHU_ENDPOINTS.beginProvisioning) { - if (payload.replaceAttemptId) { - await controller.cancelRegistration(payload.replaceAttemptId); - } - const started = await controller.startRegistration({ locale: payload.locale }); - const attemptId = String(publicRegistration(started?.registration).attempt); - const ready = await waitForQr(controller, started, attemptId, signal); - value = (await toPublicFeishuStatus(ready, { encodeQr: cachedEncodeQr })).provisioning; - if (!value) throw new Error("Provisioning did not produce a QR code."); - attemptQr.set(attemptId, value.verificationUrl); - } else if (endpoint === FEISHU_ENDPOINTS.pollProvisioning) { - const current = await statusForRegistration(controller, payload.attemptId); - if (!current || !sameAttempt(current, payload.attemptId)) { - return badRequest2("The provisioning attempt is no longer active."); - } - const registration = publicRegistration(current.registration); - const connection = await toPublicFeishuStatus(current, { encodeQr: cachedEncodeQr }); - value = { - status: pollStatus(current), - ...registration.botId ? { botId: registration.botId } : {}, - ...connection.provisioning ? { provisioning: connection.provisioning } : {}, - ...registration.botId && connection.connected ? { connection } : {}, - ...connection.error ? { message: connection.error.message } : {} - }; - if (["connected", "expired", "failed"].includes(value.status)) { - const url = attemptQr.get(payload.attemptId); - if (url) qrCache.delete(url); - attemptQr.delete(payload.attemptId); - } - } else if (endpoint === FEISHU_ENDPOINTS.cancelProvisioning) { - const current = await statusForRegistration(controller, payload.attemptId); - if (!current || !sameAttempt(current, payload.attemptId)) { - return badRequest2("The provisioning attempt is no longer active."); - } - const multi = typeof controller.registrationStatus === "function"; - const registration = publicRegistration(current.registration); - if (!multi && registration.state === "saving") await controller.disconnect(); - else await controller.cancelRegistration(payload.attemptId); - const url = attemptQr.get(payload.attemptId); - if (url) qrCache.delete(url); - attemptQr.delete(payload.attemptId); - value = { status: "failed", message: "Registration was cancelled." }; - } else if (endpoint === FEISHU_ENDPOINTS.bindCredentials) { - if (typeof controller.bindCredentials !== "function") { - throw new Error("Credential binding is unavailable"); - } - value = await toPublicFeishuStatus( - await controller.bindCredentials(payload), - { encodeQr: cachedEncodeQr } - ); - } else if (endpoint === FEISHU_ENDPOINTS.testConnection) { - const current = await controller.status(); - const alreadyConnected = current?.connected === true || connectionFacts(current?.connection).connected; - const checked = alreadyConnected || typeof controller.reconnect !== "function" ? current : await controller.reconnect(); - value = await toPublicFeishuStatus(checked, { encodeQr: cachedEncodeQr }); - } else if (endpoint === FEISHU_ENDPOINTS.disconnect) { - value = await toPublicFeishuStatus(await controller.disconnect(), { encodeQr: cachedEncodeQr }); - } else if (endpoint === FEISHU_MULTI_ENDPOINTS.reconnectBot) { - if (typeof controller.reconnectBot !== "function") throw new Error("Multi-bot reconnect is unavailable"); - value = await toPublicFeishuStatus(await controller.reconnectBot(payload.botId), { encodeQr: cachedEncodeQr }); - } else if (endpoint === FEISHU_MULTI_ENDPOINTS.disconnectBot) { - if (typeof controller.disconnectBot !== "function") throw new Error("Multi-bot disconnect is unavailable"); - value = await toPublicFeishuStatus(await controller.disconnectBot(payload.botId), { encodeQr: cachedEncodeQr }); - } else { - if (typeof controller.deleteBot !== "function") throw new Error("Multi-bot delete is unavailable"); - value = await toPublicFeishuStatus(await controller.deleteBot(payload.botId), { encodeQr: cachedEncodeQr }); - } - if (signal?.aborted) return cancelled2(); - return { ok: true, value }; - } catch { - return signal?.aborted ? cancelled2() : internalFailure2(); - } - }; -} -function installFeishuRpc(ctx, controller, options, authority) { - if (!ctx?.connection?.rpc || typeof ctx.connection.rpc.handle !== "function") { - throw new TypeError("DSH Host Connection RPC is required"); - } - return ctx.connection.rpc.handle( - FEISHU_RPC_CHANNEL, - createFeishuRpcHandler(controller, options), - { authority: resolveRpcAuthority(authority) } - ); -} - -// plugin-src/host/channels/feishu/index.mjs -function controllerFrom(ctx, config) { - if (config?.controller) return config.controller; - if (typeof config?.createController === "function") return config.createController(); - if (typeof config?.createProvisioningManager === "function") { - return createProvisioningBackedController(config); - } - return void 0; -} -async function apply3(ctx, config = {}) { - const controller = controllerFrom(ctx, config); - if (controller) { - return installFeishuRpc(ctx, controller, config.rpcOptions, config.rpcAuthority); - } - const production = await createProductionController3(ctx, config); - const disposeRpc = installFeishuRpc( - ctx, - production.controller, - config.rpcOptions, - config.rpcAuthority - ); - ctx.effect(() => async () => { - await production.close(); - }, "dsh-feishu: close controller and live connection"); - return disposeRpc; -} - -// plugin-src/host/channels/qq/production.mjs -import { unlink as unlink11 } from "node:fs/promises"; -import { homedir as homedir4 } from "node:os"; -import { join as join4, resolve as resolve4 } from "node:path"; - -// src/channels/qq/config-store.mjs -import { createHash as createHash4 } from "node:crypto"; -import { mkdir as mkdir7, readFile as readFile7, rename as rename7, unlink as unlink9, writeFile as writeFile7 } from "node:fs/promises"; -import { dirname as dirname7 } from "node:path"; -var EMPTY_DOCUMENT3 = Object.freeze({ version: 1, bots: Object.freeze([]) }); -function cleanString8(value) { - return typeof value === "string" && value.trim() ? value.trim() : null; -} -function safeBotId2(value) { - const id = cleanString8(value); - return id && /^qq_[a-f0-9]{24}$/.test(id) ? id : null; -} -function safeSecretRef2(value) { - const ref = cleanString8(value); - return ref && /^DSH_QQBOT_APP_SECRET_[A-F0-9]{24}$/.test(ref) ? ref : null; -} -function deriveQqBotIdentity(appId) { - const raw = cleanString8(appId); - if (!raw) throw new TypeError("appId is required"); - const digest2 = createHash4("sha256").update(raw).digest("hex").slice(0, 24); - return { - botId: `qq_${digest2}`, - secretRef: `DSH_QQBOT_APP_SECRET_${digest2.toUpperCase()}` - }; -} -function maskQqAppId(appId) { - const value = cleanString8(appId) ?? ""; - if (value.length <= 10) return value ? `${value.slice(0, 3)}\u2022\u2022\u2022` : "QQ\u673A\u5668\u4EBA"; - return `${value.slice(0, 6)}\u2022\u2022\u2022\u2022${value.slice(-4)}`; -} -function normalizeBot3(value) { - if (!value || typeof value !== "object") return null; - const appId = cleanString8(value.appId); - const ownerUserOpenid = cleanString8(value.ownerUserOpenid); - const botId = safeBotId2(value.botId); - const secretRef = safeSecretRef2(value.secretRef); - if (!appId || !ownerUserOpenid || !botId || !secretRef) return null; - const derived = deriveQqBotIdentity(appId); - if (derived.botId !== botId || derived.secretRef !== secretRef) return null; - return Object.freeze({ - botId, - appId, - secretRef, - ownerUserOpenid, - createdAt: cleanString8(value.createdAt) ?? (/* @__PURE__ */ new Date()).toISOString(), - connectedAt: cleanString8(value.connectedAt) - }); -} -function normalizeDocument3(value) { - if (!value || value.version !== 1 || !Array.isArray(value.bots)) return null; - const bots = value.bots.map(normalizeBot3); - if (bots.some((bot) => bot === null)) return null; - const ids = /* @__PURE__ */ new Set(); - const appIds = /* @__PURE__ */ new Set(); - const refs = /* @__PURE__ */ new Set(); - for (const bot of bots) { - if (ids.has(bot.botId) || appIds.has(bot.appId) || refs.has(bot.secretRef)) return null; - ids.add(bot.botId); - appIds.add(bot.appId); - refs.add(bot.secretRef); - } - return Object.freeze({ version: 1, bots: Object.freeze(bots) }); -} -var QqConfigStore = class { - #path; - #value = EMPTY_DOCUMENT3; - #writeQueue = Promise.resolve(); - constructor(path) { - this.#path = path; - } - async load() { - try { - const normalized = normalizeDocument3(JSON.parse(await readFile7(this.#path, "utf8"))); - if (!normalized) throw new Error("dsh-im QQ config contains invalid bot data"); - this.#value = normalized; - } catch (error) { - if (error?.code !== "ENOENT") throw error; - this.#value = EMPTY_DOCUMENT3; - } - return this; - } - list() { - return structuredClone(this.#value.bots); - } - get(botId) { - const bot = this.#value.bots.find((candidate) => candidate.botId === botId); - return bot ? structuredClone(bot) : null; - } - getByAppId(appId) { - const bot = this.#value.bots.find((candidate) => candidate.appId === appId); - return bot ? structuredClone(bot) : null; - } - async save(value) { - const normalized = normalizeBot3(value); - if (!normalized) throw new Error("Refusing to persist incomplete QQ bot data"); - return this.#mutate((bots) => { - const appCollision = bots.find( - (bot) => bot.appId === normalized.appId && bot.botId !== normalized.botId - ); - const refCollision = bots.find( - (bot) => bot.secretRef === normalized.secretRef && bot.botId !== normalized.botId - ); - if (appCollision || refCollision) throw new Error("Duplicate QQ bot identity"); - const index = bots.findIndex((bot) => bot.botId === normalized.botId); - if (index === -1) bots.push(normalized); - else bots[index] = normalized; - return structuredClone(normalized); - }); - } - async remove(botId) { - if (!safeBotId2(botId)) throw new TypeError("Invalid QQ bot id"); - return this.#mutate((bots) => { - const index = bots.findIndex((bot) => bot.botId === botId); - if (index === -1) return null; - const [removed] = bots.splice(index, 1); - return structuredClone(removed); - }); - } - async clear() { - const operation = this.#writeQueue.then(async () => { - try { - await unlink9(this.#path); - } catch (error) { - if (error?.code !== "ENOENT") throw error; - } - this.#value = EMPTY_DOCUMENT3; - }); - this.#writeQueue = operation.then(() => void 0, () => void 0); - await operation; - } - async #mutate(mutator) { - let result; - const operation = this.#writeQueue.then(async () => { - const bots = [...this.#value.bots]; - result = mutator(bots); - const document = Object.freeze({ version: 1, bots: Object.freeze(bots) }); - await this.#write(document); - this.#value = document; - }); - this.#writeQueue = operation.then(() => void 0, () => void 0); - await operation; - return result; - } - async #write(document) { - await mkdir7(dirname7(this.#path), { recursive: true, mode: 448 }); - const temporary = `${this.#path}.tmp`; - await writeFile7(temporary, `${JSON.stringify(document, null, 2)} -`, { - encoding: "utf8", - mode: 384 - }); - await rename7(temporary, this.#path); - } -}; - -// src/channels/qq/harness-client.mjs -var QqHarnessClient = class extends HarnessClient2 { -}; - -// src/channels/qq/qq-controller.mjs -import { randomUUID as randomUUID9 } from "node:crypto"; -var ACTIVE_ATTEMPT_STATES2 = /* @__PURE__ */ new Set(["starting", "pending", "refreshing", "connecting"]); -var TERMINAL_ATTEMPT_STATES2 = /* @__PURE__ */ new Set(["connected", "failed", "cancelled"]); -var QR_TTL_MS = 5 * 6e4; -function cleanString9(value) { - return typeof value === "string" && value.trim() ? value.trim() : null; -} -function safeError3(code, message) { - return Object.freeze({ code, message }); -} -function publicAttempt2(record) { - if (!record) return null; - return { - attemptId: record.id, - status: record.state, - qrRevision: record.qrRevision, - pollIntervalMs: 1e3, - ...record.verificationUrl ? { verificationUrl: record.verificationUrl } : {}, - ...record.expiresAt ? { expiresAt: record.expiresAt } : {}, - ...record.botId ? { botId: record.botId } : {}, - ...record.error ? { error: structuredClone(record.error) } : {} - }; -} -var QqController = class { - #qrAuth; - #credentials; - #configStore; - #createRuntime; - #deleteState; - #logger; - #runtimes = /* @__PURE__ */ new Map(); - #errors = /* @__PURE__ */ new Map(); - #attempts = /* @__PURE__ */ new Map(); - #activeAttemptId = null; - #transitions = /* @__PURE__ */ new Map(); - #revision = 0; - #closed = false; - constructor({ - qrAuth, - credentials, - configStore, - createRuntime, - deleteState = async () => { - }, - logger = console - }) { - if (!qrAuth || typeof qrAuth.start !== "function") throw new TypeError("QQ QR auth is required"); - if (!credentials || typeof credentials.resolve !== "function" || typeof credentials.set !== "function" || typeof credentials.unset !== "function") { - throw new TypeError("QqController requires the DSH credential provider"); - } - if (!configStore || typeof configStore.list !== "function" || typeof configStore.save !== "function" || typeof configStore.remove !== "function") { - throw new TypeError("QqController requires a config store"); - } - if (typeof createRuntime !== "function") throw new TypeError("createRuntime is required"); - this.#qrAuth = qrAuth; - this.#credentials = credentials; - this.#configStore = configStore; - this.#createRuntime = createRuntime; - this.#deleteState = deleteState; - this.#logger = logger; - } - async initialize() { - if (this.#closed) return this.status(); - for (const config of this.#configStore.list()) { - await this.#withBotTransition(config.botId, async () => { - if (this.#closed || this.#runtimes.get(config.botId)?.status?.ready) return; - const appSecret = await this.#resolveSecret(config.secretRef); - if (!appSecret) { - this.#errors.set(config.botId, safeError3("missing-secret", "QQ \u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002")); - return; - } - try { - await this.#startRuntime(config, appSecret); - this.#errors.delete(config.botId); - } catch (error) { - this.#errors.set(config.botId, safeError3("connection-failed", "QQ \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002")); - this.#logger.warn?.(`[dsh-im:qq] bot ${config.botId} failed to initialize:`, error); - } finally { - this.#touch(); - } - }); - } - return this.status(); - } - async startProvisioning() { - if (this.#closed) throw new Error("QQ controller is closed"); - if (this.#activeAttemptId) await this.cancelProvisioning(this.#activeAttemptId); - let firstQrResolve; - let firstQrReject; - const firstQr = new Promise((resolve7, reject) => { - firstQrResolve = resolve7; - firstQrReject = reject; - }); - const record = { - id: randomUUID9(), - state: "starting", - createdAt: Date.now(), - expiresAt: null, - qrRevision: 0, - verificationUrl: null, - controller: new AbortController(), - dispose: null, - task: null, - error: null, - botId: null - }; - this.#attempts.set(record.id, record); - this.#activeAttemptId = record.id; - this.#touch(); - try { - record.dispose = this.#qrAuth.start({ - onQrDisplayed: (url) => { - if (record.controller.signal.aborted || TERMINAL_ATTEMPT_STATES2.has(record.state)) return; - const verificationUrl = cleanString9(url); - if (!verificationUrl) return; - record.verificationUrl = verificationUrl; - record.qrRevision += 1; - record.expiresAt = Date.now() + QR_TTL_MS; - record.state = "pending"; - this.#touch(); - firstQrResolve(); - }, - onQrExpired: () => { - if (record.controller.signal.aborted || TERMINAL_ATTEMPT_STATES2.has(record.state)) return; - record.state = "refreshing"; - record.verificationUrl = null; - record.expiresAt = null; - this.#touch(); - }, - onSuccess: (credentials) => { - if (record.controller.signal.aborted || TERMINAL_ATTEMPT_STATES2.has(record.state)) return; - record.task = this.#completeProvisioning(record, credentials); - }, - onFailure: (error) => { - if (record.controller.signal.aborted || TERMINAL_ATTEMPT_STATES2.has(record.state)) return; - record.state = "failed"; - record.error = safeError3("qr-connect-failed", "QQ \u626B\u7801\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002"); - if (this.#activeAttemptId === record.id) this.#activeAttemptId = null; - this.#touch(); - firstQrReject(error); - } - }, { signal: record.controller.signal }); - await firstQr; - return publicAttempt2(record); - } catch (error) { - if (record.controller.signal.aborted) { - record.state = "cancelled"; - record.error = safeError3("cancelled", "\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"); - } else if (!TERMINAL_ATTEMPT_STATES2.has(record.state)) { - record.state = "failed"; - record.error = safeError3("qr-start-failed", "\u65E0\u6CD5\u751F\u6210 QQ \u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"); - } - if (this.#activeAttemptId === record.id) this.#activeAttemptId = null; - this.#touch(); - throw error; - } - } - registrationStatus(attemptId) { - return publicAttempt2(this.#attempts.get(attemptId)); - } - async bindCredentials({ appId, appSecret } = {}) { - if (this.#closed) throw new Error("QQ controller is closed"); - const normalizedAppId = cleanString9(appId); - const normalizedSecret = cleanString9(appSecret); - if (!normalizedAppId || !normalizedSecret) { - throw new TypeError("QQ AppID and AppSecret are required"); - } - if (this.#activeAttemptId) await this.cancelProvisioning(this.#activeAttemptId); - if (this.#closed) throw new Error("QQ controller is closed"); - const identity = deriveQqBotIdentity(normalizedAppId); - await this.#withBotTransition(identity.botId, async () => { - if (this.#closed) throw new Error("QQ controller is closed"); - const previousConfig = this.#configStore.getByAppId(normalizedAppId); - const previousSecret = await this.#credentials.resolve(identity.secretRef).catch(() => void 0); - if (this.#closed) throw new Error("QQ controller is closed"); - const config = { - botId: identity.botId, - appId: normalizedAppId, - secretRef: identity.secretRef, - ownerUserOpenid: previousConfig?.ownerUserOpenid ?? "*", - createdAt: previousConfig?.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(), - connectedAt: (/* @__PURE__ */ new Date()).toISOString() - }; - await this.#credentials.set(identity.secretRef, normalizedSecret); - try { - await this.#configStore.save(config); - } catch (error) { - await this.#restoreCredential(identity.secretRef, previousSecret); - throw error; - } - try { - await this.#startRuntime(config, normalizedSecret); - this.#errors.delete(identity.botId); - } catch (error) { - this.#errors.set(identity.botId, safeError3("connection-failed", "QQ \u673A\u5668\u4EBA\u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002")); - this.#logger.warn?.(`[dsh-im:qq] bot ${identity.botId} credential connection failed:`, error); - } - this.#touch(); - }); - return this.status(); - } - async cancelProvisioning(attemptId) { - const record = this.#attempts.get(attemptId); - if (!record) return null; - if (!TERMINAL_ATTEMPT_STATES2.has(record.state)) { - record.controller.abort(); - record.dispose?.(); - await record.task?.catch(() => void 0); - if (!TERMINAL_ATTEMPT_STATES2.has(record.state)) record.state = "cancelled"; - record.error ??= safeError3("cancelled", "\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"); - } - if (this.#activeAttemptId === record.id) this.#activeAttemptId = null; - this.#touch(); - return publicAttempt2(record); - } - async reconnectBot(botId) { - const config = this.#configStore.get(botId); - if (!config) throw new Error("Unknown QQ bot"); - await this.#withBotTransition(botId, async () => { - const secret = await this.#resolveSecret(config.secretRef); - if (!secret) throw new Error("QQ bot secret is missing"); - try { - await this.#startRuntime(config, secret); - this.#errors.delete(botId); - } catch (error) { - this.#errors.set(botId, safeError3("connection-failed", "QQ \u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")); - throw error; - } finally { - this.#touch(); - } - }); - return this.status(); - } - async deleteBot(botId) { - const config = this.#configStore.get(botId); - if (!config) throw new Error("Unknown QQ bot"); - await this.#withBotTransition(botId, async () => { - const previous = await this.#credentials.resolve(config.secretRef).catch(() => void 0); - await this.#stopRuntime(botId); - try { - await this.#credentials.unset(config.secretRef); - await this.#configStore.remove(botId); - } catch (error) { - if (previous?.value) { - await this.#credentials.set(config.secretRef, previous.value).catch(() => void 0); - await this.#startRuntime(config, previous.value).catch(() => void 0); - } - throw new Error("Unable to remove the QQ bot safely.", { cause: error }); - } - await this.#deleteState({ botId, config }).catch((error) => { - this.#logger.warn?.(`[dsh-im:qq] bot ${botId} state cleanup failed:`, error); - }); - this.#errors.delete(botId); - this.#touch(); - }); - return this.status(); - } - status() { - const bots = this.#configStore.list().map((config) => { - const runtimeStatus2 = this.#runtimes.get(config.botId)?.status ?? null; - const connected = runtimeStatus2?.ready === true && runtimeStatus2.qqConnectionState === "connected" && runtimeStatus2.harnessReachable === true; - const state = connected ? "connected" : runtimeStatus2?.qqConnectionState === "connecting" ? "connecting" : this.#errors.has(config.botId) || runtimeStatus2?.qqConnectionState === "failed" ? "error" : "offline"; - return { - botId: config.botId, - state, - connected, - configured: true, - bot: { name: "QQ\u673A\u5668\u4EBA", appIdMasked: maskQqAppId(config.appId) }, - health: { - status: connected ? "healthy" : state === "error" ? "error" : "offline", - summary: connected ? "QQ WebSocket \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38" : state === "error" ? "QQ \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5" : "QQ \u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF", - lastCheckedAt: runtimeStatus2?.lastCheckedAt ?? null, - lastConnectedAt: runtimeStatus2?.lastConnectedAt ?? null - }, - stats: { - messagesReceived: runtimeStatus2?.messagesReceived ?? 0, - messagesReplied: runtimeStatus2?.messagesReplied ?? 0 - }, - error: structuredClone(this.#errors.get(config.botId) ?? null) - }; - }); - const connectedCount = bots.filter((bot) => bot.connected).length; - const active = this.#activeAttemptId ? this.#attempts.get(this.#activeAttemptId) : null; - return { - schemaVersion: 1, - revision: this.#revision, - state: active && ACTIVE_ATTEMPT_STATES2.has(active.state) ? "provisioning" : bots.length === 0 ? "disconnected" : connectedCount === bots.length ? "connected" : connectedCount > 0 ? "degraded" : "offline", - bots, - totals: { configured: bots.length, connected: connectedCount }, - ...active && ACTIVE_ATTEMPT_STATES2.has(active.state) ? { provisioning: publicAttempt2(active) } : {} - }; - } - async close() { - if (this.#closed) return; - this.#closed = true; - if (this.#activeAttemptId) await this.cancelProvisioning(this.#activeAttemptId); - await Promise.allSettled([...this.#transitions.values()]); - await Promise.allSettled([...this.#runtimes.keys()].map((botId) => this.#stopRuntime(botId))); - } - async #completeProvisioning(record, credentials) { - try { - record.state = "connecting"; - record.verificationUrl = null; - record.expiresAt = null; - this.#touch(); - const credential = Array.isArray(credentials) ? credentials[0] : null; - const appId = cleanString9(credential?.appId); - const appSecret = cleanString9(credential?.appSecret); - const ownerUserOpenid = cleanString9(credential?.userOpenid); - if (!appId || !appSecret || !ownerUserOpenid) { - throw new Error("QQ authorization returned incomplete credentials"); - } - record.botId = await this.#activateBot(record, { appId, appSecret, ownerUserOpenid }); - record.state = "connected"; - record.error = null; - } catch (error) { - if (record.controller.signal.aborted) { - record.state = "cancelled"; - record.error = safeError3("cancelled", "\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"); - } else { - record.state = "failed"; - record.error = safeError3("activation-failed", "QQ \u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u5B89\u5168\u4FDD\u5B58\u63A5\u5165\u914D\u7F6E\u3002"); - this.#logger.error?.("[dsh-im:qq] provisioning failed:", error); - } - } finally { - record.dispose?.(); - if (this.#activeAttemptId === record.id) this.#activeAttemptId = null; - this.#touch(); - } - } - async #activateBot(record, { appId, appSecret, ownerUserOpenid }) { - const identity = deriveQqBotIdentity(appId); - const previousConfig = this.#configStore.getByAppId(appId); - const previousSecret = await this.#credentials.resolve(identity.secretRef).catch(() => void 0); - const config = { - botId: identity.botId, - appId, - secretRef: identity.secretRef, - ownerUserOpenid, - createdAt: previousConfig?.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(), - connectedAt: (/* @__PURE__ */ new Date()).toISOString() - }; - return this.#withBotTransition(identity.botId, async () => { - await this.#credentials.set(identity.secretRef, appSecret); - try { - if (record.controller.signal.aborted) throw new DOMException("Cancelled", "AbortError"); - await this.#configStore.save(config); - } catch (error) { - await this.#restoreCredential(identity.secretRef, previousSecret); - throw error; - } - try { - if (record.controller.signal.aborted) throw new DOMException("Cancelled", "AbortError"); - await this.#startRuntime(config, appSecret); - this.#errors.delete(identity.botId); - } catch (error) { - if (record.controller.signal.aborted) { - await this.#stopRuntime(identity.botId); - if (previousConfig) await this.#configStore.save(previousConfig).catch(() => void 0); - else await this.#configStore.remove(identity.botId).catch(() => void 0); - await this.#restoreCredential(identity.secretRef, previousSecret); - throw error; - } - this.#errors.set(identity.botId, safeError3("connection-failed", "QQ \u673A\u5668\u4EBA\u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002")); - this.#logger.warn?.(`[dsh-im:qq] bot ${identity.botId} activation connection failed:`, error); - } - this.#touch(); - return identity.botId; - }); - } - async #startRuntime(config, appSecret) { - if (this.#closed) throw new Error("QQ controller is closed"); - await this.#stopRuntime(config.botId); - if (this.#closed) throw new Error("QQ controller is closed"); - const runtime = await this.#createRuntime({ botId: config.botId, config, appSecret }); - if (!runtime || typeof runtime.start !== "function" || typeof runtime.stop !== "function") { - throw new TypeError("createRuntime returned an invalid QQ runtime"); - } - this.#runtimes.set(config.botId, runtime); - try { - await runtime.start(); - } catch (error) { - await runtime.stop().catch(() => void 0); - this.#runtimes.delete(config.botId); - throw error; - } - } - async #stopRuntime(botId) { - const runtime = this.#runtimes.get(botId); - this.#runtimes.delete(botId); - await runtime?.stop().catch((error) => { - this.#logger.warn?.(`[dsh-im:qq] bot ${botId} failed to stop cleanly:`, error); - }); - } - async #resolveSecret(ref) { - const result = await this.#credentials.resolve(ref).catch(() => void 0); - return cleanString9(result?.value); - } - async #restoreCredential(ref, previous) { - if (previous?.value) await this.#credentials.set(ref, previous.value).catch(() => void 0); - else await this.#credentials.unset(ref).catch(() => void 0); - } - #withBotTransition(botId, operation) { - const previous = this.#transitions.get(botId) ?? Promise.resolve(); - const current = previous.catch(() => void 0).then(operation); - const settled = current.finally(() => { - if (this.#transitions.get(botId) === settled) this.#transitions.delete(botId); - }); - this.#transitions.set(botId, settled); - return settled; - } - #touch() { - this.#revision += 1; - } -}; - -// src/channels/qq/qq-runtime.mjs -import { QQBot, typingIndicator } from "@tencent-connect/qqbot-nodejs"; - -// src/channels/qq/qq-bridge.mjs -var HELP_TEXT3 = [ - "QQ \u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002", - "", - "\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002", - "/new \u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD", - "/status \u68C0\u67E5\u8FDE\u63A5\u72B6\u6001", - "/help \u663E\u793A\u672C\u5E2E\u52A9" -].join("\n"); -function conversationKey3(message) { - return `${message.kind}:${message.kind === "group" ? message.groupOpenid : message.senderId}`; -} -function safeText(message) { - return typeof message?.content === "string" ? message.content.trim() : ""; -} -function createQqBridgeStatus() { - return { - messagesReceived: 0, - messagesReplied: 0, - messagesRejected: 0, - lastMessageAt: null, - lastReplyAt: null, - lastRejectedAt: null, - lastError: null - }; -} -var QqHarnessBridge = class { - #bot; - #ownerUserOpenid; - #harness; - #state; - #status; - #logger; - #replyTimeoutMs; - #queues = /* @__PURE__ */ new Map(); - constructor({ - bot, - ownerUserOpenid, - harness, - state, - status = createQqBridgeStatus(), - logger = console, - replyTimeoutMs = 6e5 - }) { - if (!bot || typeof bot.sendText !== "function") throw new TypeError("QQ bot client is required"); - if (!ownerUserOpenid) throw new TypeError("QQ scanner identity is required"); - if (!harness || !state) throw new TypeError("Harness client and state store are required"); - this.#bot = bot; - this.#ownerUserOpenid = ownerUserOpenid; - this.#harness = harness; - this.#state = state; - this.#status = status; - this.#logger = logger; - this.#replyTimeoutMs = replyTimeoutMs; - } - get status() { - return structuredClone(this.#status); - } - accept(message) { - const key = conversationKey3(message); - const previous = this.#queues.get(key) ?? Promise.resolve(); - const current = previous.catch(() => void 0).then(() => this.#process(message)).finally(() => { - if (this.#queues.get(key) === current) this.#queues.delete(key); - }); - this.#queues.set(key, current); - return current; - } - async waitForIdle() { - await Promise.allSettled([...this.#queues.values()]); - } - async #process(message) { - const messageId = typeof message?.messageId === "string" ? message.messageId : ""; - const sender = typeof message?.senderId === "string" ? message.senderId : ""; - if (!messageId || !sender || message.senderIsBot === true) return; - if (!["c2c", "group"].includes(message.kind) || this.#state.hasSeen(messageId)) return; - this.#status.messagesReceived += 1; - this.#status.lastMessageAt = (/* @__PURE__ */ new Date()).toISOString(); - if (this.#ownerUserOpenid !== "*" && sender !== this.#ownerUserOpenid) { - this.#status.messagesRejected += 1; - this.#status.lastRejectedAt = (/* @__PURE__ */ new Date()).toISOString(); - return; - } - if (message.kind === "group" && message.rawEventType !== "GROUP_AT_MESSAGE_CREATE") return; - const target = message.replyTarget; - const text = safeText(message); - try { - if (!text) { - await this.#bot.sendText(target, "\u76EE\u524D\u4EC5\u652F\u6301\u6587\u5B57\u6D88\u606F\u3002"); - await this.#state.markSeen(messageId); - return; - } - const command = text.toLowerCase(); - if (command === "/help") { - await this.#bot.sendText(target, HELP_TEXT3); - await this.#state.markSeen(messageId); - return; - } - if (command === "/status") { - await this.#harness.ensureRunning(); - await this.#bot.sendText(target, "QQ \u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002"); - await this.#state.markSeen(messageId); - return; - } - const key = conversationKey3(message); - if (command === "/new") { - await this.#state.clearSession(key); - await this.#bot.sendText(target, "\u5DF2\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002\u8BF7\u53D1\u9001\u4F60\u7684\u95EE\u9898\u3002"); - await this.#state.markSeen(messageId); - return; - } - let sessionId = this.#state.sessionFor(key); - if (!sessionId || !await this.#harness.sessionExists(sessionId)) { - sessionId = await this.#harness.createSession(); - await this.#state.setSession(key, sessionId); - } - let stream = null; - let streamFinished = false; - if (message.kind === "c2c" && target?.msgId && typeof this.#bot.openStream === "function") { - try { - stream = this.#bot.openStream({ target }); - } catch (error) { - this.#logger.warn?.("[dsh-im:qq] unable to start a QQ stream; using a text reply:", error); - } - } - const answer = await this.#harness.ask(sessionId, text, { - timeoutMs: this.#replyTimeoutMs, - onUpdate: stream ? async (update) => { - const progress = update.type === "text" ? update.text : update.type === "tool" ? `\u6B63\u5728\u4F7F\u7528${update.name}\u2026` : update.text; - if (progress) await stream.update(progress); - } : void 0 - }); - if (stream) { - try { - await stream.update(answer); - await stream.complete(); - streamFinished = true; - } catch (error) { - stream.cancel?.(); - this.#logger.warn?.("[dsh-im:qq] QQ stream finalization failed; using a text reply:", error); - } - } - if (!streamFinished) await this.#bot.sendText(target, answer); - await this.#state.markSeen(messageId); - this.#status.messagesReplied += 1; - this.#status.lastReplyAt = (/* @__PURE__ */ new Date()).toISOString(); - this.#status.lastError = null; - } catch (error) { - this.#status.lastError = error?.message ?? String(error); - this.#logger.error?.("[dsh-im:qq] failed to process an inbound message:", error); - try { - await this.#bot.sendText(target, "\u6D88\u606F\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"); - await this.#state.markSeen(messageId); - } catch (sendError) { - this.#logger.error?.("[dsh-im:qq] failed to send the safe error reply:", sendError); - } - } - } -}; - -// src/channels/qq/qq-runtime.mjs -function timeoutError() { - const error = new Error("QQ WebSocket did not become ready in time"); - error.code = "connect-timeout"; - return error; -} -function createQqRuntimeStatus() { - return { - startedAt: null, - ready: false, - qqConnectionState: "idle", - harnessReachable: false, - lastCheckedAt: null, - lastConnectedAt: null, - lastError: null, - ...createQqBridgeStatus() - }; -} -var QqRuntime = class { - #config; - #appSecret; - #harness; - #state; - #logger; - #replyTimeoutMs; - #connectTimeoutMs; - #createBot; - #typingMiddleware; - #status = createQqRuntimeStatus(); - #bot = null; - #bridge = null; - #abortController = null; - #runTask = null; - #starting = null; - constructor({ - config, - appSecret, - harness, - state, - logger = console, - replyTimeoutMs = 6e5, - connectTimeoutMs = 2e4, - createBot = (options) => new QQBot(options), - typingMiddleware = typingIndicator - }) { - if (!config || !appSecret || !harness || !state) { - throw new TypeError("QqRuntime requires config, app secret, Harness, and state"); - } - this.#config = config; - this.#appSecret = appSecret; - this.#harness = harness; - this.#state = state; - this.#logger = logger; - this.#replyTimeoutMs = replyTimeoutMs; - this.#connectTimeoutMs = connectTimeoutMs; - this.#createBot = createBot; - this.#typingMiddleware = typingMiddleware; - } - get status() { - return structuredClone(this.#status); - } - async start() { - if (this.#status.ready && this.#bot) return this.status; - if (this.#starting) return this.#starting; - this.#starting = this.#start().finally(() => { - this.#starting = null; - }); - return this.#starting; - } - async #start() { - await this.stop(); - this.#status.startedAt = (/* @__PURE__ */ new Date()).toISOString(); - this.#status.qqConnectionState = "connecting"; - this.#status.lastError = null; - await this.#harness.ensureRunning(); - this.#status.harnessReachable = true; - const sdkLogger = { - error: (...args) => this.#logger.error?.(...args), - warn: (...args) => this.#logger.warn?.(...args), - info: (...args) => this.#logger.info?.(...args), - debug: () => { - } - }; - const bot = this.#createBot({ - appId: this.#config.appId, - appSecret: this.#appSecret, - accountId: this.#config.botId, - logger: sdkLogger, - transport: "websocket", - tokenPrefetch: "sync" - }); - if (!bot || typeof bot.start !== "function" || typeof bot.stop !== "function") { - throw new TypeError("QQ bot factory returned an invalid client"); - } - this.#bot = bot; - this.#bridge = new QqHarnessBridge({ - bot, - ownerUserOpenid: this.#config.ownerUserOpenid, - harness: this.#harness, - state: this.#state, - status: this.#status, - logger: this.#logger, - replyTimeoutMs: this.#replyTimeoutMs - }); - bot.use?.(this.#typingMiddleware({ - keepAlive: true, - predicate: (ctx) => this.#config.ownerUserOpenid === "*" || ctx?.message?.senderId === this.#config.ownerUserOpenid - })); - const controller = new AbortController(); - this.#abortController = controller; - let readyResolve; - let readyReject; - const ready = new Promise((resolve7, reject) => { - readyResolve = resolve7; - readyReject = reject; - }); - const onReady = () => { - const now = Date.now(); - this.#status.ready = true; - this.#status.qqConnectionState = "connected"; - this.#status.lastCheckedAt = now; - this.#status.lastConnectedAt = now; - this.#status.lastError = null; - readyResolve(); - }; - const onError = (error) => { - if (!this.#status.ready) readyReject(error); - else { - this.#status.lastError = error?.message ?? String(error); - this.#logger.warn?.(`[dsh-im:qq] bot ${this.#config.botId} connection error:`, error); - } - }; - const onMessage = (_ctx, message) => this.#bridge?.accept(message); - bot.on("ready", onReady); - bot.on("resumed", onReady); - bot.on("error", onError); - bot.on("message", onMessage); - const runTask = Promise.resolve().then(() => bot.start(controller.signal)); - this.#runTask = runTask; - runTask.catch((error) => { - if (controller.signal.aborted) return; - readyReject(error); - this.#status.ready = false; - this.#status.qqConnectionState = "failed"; - this.#status.lastError = error?.message ?? String(error); - this.#logger.error?.(`[dsh-im:qq] bot ${this.#config.botId} connection stopped:`, error); - }); - let timer; - try { - await Promise.race([ - ready, - new Promise((_, reject) => { - timer = setTimeout(() => reject(timeoutError()), this.#connectTimeoutMs); - }) - ]); - this.#status.ready = true; - this.#status.qqConnectionState = "connected"; - this.#status.lastCheckedAt = Date.now(); - this.#status.lastConnectedAt = Date.now(); - return this.status; - } catch (error) { - this.#status.ready = false; - this.#status.qqConnectionState = "failed"; - this.#status.lastError = error?.message ?? String(error); - await this.stop(); - throw error; - } finally { - clearTimeout(timer); - } - } - async stop() { - const bot = this.#bot; - const bridge = this.#bridge; - const runTask = this.#runTask; - this.#abortController?.abort(); - this.#abortController = null; - this.#bot = null; - this.#bridge = null; - this.#runTask = null; - try { - bot?.stop(); - } catch (error) { - this.#logger.warn?.(`[dsh-im:qq] bot ${this.#config.botId} failed to stop cleanly:`, error); - } - await Promise.race([ - runTask?.catch(() => void 0) ?? Promise.resolve(), - new Promise((resolve7) => setTimeout(resolve7, 2e3)) - ]); - await bridge?.waitForIdle(); - this.#status.ready = false; - this.#status.qqConnectionState = "idle"; - return this.status; - } -}; - -// src/channels/qq/qr-auth.mjs -import { startQrConnect } from "@tencent-connect/qqbot-connector"; -var QqQrAuth = class { - #start; - #source; - constructor({ start = startQrConnect, source = "deepseek-harness" } = {}) { - if (typeof start !== "function") throw new TypeError("QQ QR connector is required"); - this.#start = start; - this.#source = source; - } - start(callbacks, { signal } = {}) { - if (!callbacks || typeof callbacks.onSuccess !== "function" || typeof callbacks.onFailure !== "function") { - throw new TypeError("QQ QR callbacks are required"); - } - return this.#start(callbacks, { - displayQrCodeToConsole: false, - source: this.#source, - signal - }); - } -}; - -// src/channels/qq/state-store.mjs -import { mkdir as mkdir8, readFile as readFile8, rename as rename8, unlink as unlink10, writeFile as writeFile8 } from "node:fs/promises"; -import { dirname as dirname8 } from "node:path"; -var EMPTY_STATE4 = Object.freeze({ version: 1, sessions: {}, seenMessageIds: [] }); -function normalizeState3(value) { - if (!value || typeof value !== "object") return structuredClone(EMPTY_STATE4); - const sessions = {}; - if (value.sessions && typeof value.sessions === "object" && !Array.isArray(value.sessions)) { - for (const [key, sessionId] of Object.entries(value.sessions)) { - if (typeof key === "string" && typeof sessionId === "string" && sessionId) { - sessions[key] = sessionId; - } - } - } - return { - version: 1, - sessions, - seenMessageIds: Array.isArray(value.seenMessageIds) ? value.seenMessageIds.filter((id) => typeof id === "string").slice(-1e3) : [] - }; -} -var QqStateStore = class { - #path; - #state = structuredClone(EMPTY_STATE4); - #writeQueue = Promise.resolve(); - constructor(path) { - this.#path = path; - } - async load() { - try { - this.#state = normalizeState3(JSON.parse(await readFile8(this.#path, "utf8"))); - } catch (error) { - if (error?.code !== "ENOENT") throw error; - this.#state = structuredClone(EMPTY_STATE4); - await this.#persist(); - } - return this; - } - sessionFor(key) { - return this.#state.sessions[key] ?? null; - } - async setSession(key, sessionId) { - this.#state.sessions[key] = sessionId; - await this.#persist(); - } - async clearSession(key) { - delete this.#state.sessions[key]; - await this.#persist(); - } - hasSeen(messageId) { - return this.#state.seenMessageIds.includes(messageId); - } - async markSeen(messageId) { - if (this.hasSeen(messageId)) return; - this.#state.seenMessageIds.push(messageId); - if (this.#state.seenMessageIds.length > 1e3) { - this.#state.seenMessageIds.splice(0, this.#state.seenMessageIds.length - 1e3); - } - await this.#persist(); - } - snapshot() { - return structuredClone(this.#state); - } - async remove() { - try { - await unlink10(this.#path); - } catch (error) { - if (error?.code !== "ENOENT") throw error; - } - this.#state = structuredClone(EMPTY_STATE4); - } - async #persist() { - const snapshot = `${JSON.stringify(this.#state, null, 2)} -`; - const operation = this.#writeQueue.then(async () => { - await mkdir8(dirname8(this.#path), { recursive: true, mode: 448 }); - const temporary = `${this.#path}.tmp`; - await writeFile8(temporary, snapshot, { encoding: "utf8", mode: 384 }); - await rename8(temporary, this.#path); - }); - this.#writeQueue = operation.then(() => void 0, () => void 0); - await operation; - } -}; - -// plugin-src/host/channels/qq/connection-supervisor.mjs -var DEFAULT_RETRY_DELAYS_MS4 = Object.freeze([250, 1e3, 3e3, 5e3, 1e4, 3e4]); -function retryDelays3(value) { - if (!Array.isArray(value) || value.length === 0) return [...DEFAULT_RETRY_DELAYS_MS4]; - const valid = value.filter((delay3) => Number.isFinite(delay3) && delay3 >= 0); - return valid.length > 0 ? valid : [...DEFAULT_RETRY_DELAYS_MS4]; -} -var ConnectionSupervisor3 = class { - #controller; - #harness; - #logger; - #retryDelays; - #healthyIntervalMs; - #setTimeout; - #clearTimeout; - #timer = null; - #running = null; - #retryIndex = 0; - #closed = false; - #started = false; - #ready; - #resolveReady; - constructor({ - controller, - harness, - logger = console, - retryDelaysMs, - healthyIntervalMs = 15e3, - setTimeoutImpl = setTimeout, - clearTimeoutImpl = clearTimeout - }) { - if (!controller || typeof controller.initialize !== "function" || typeof controller.status !== "function") { - throw new TypeError("ConnectionSupervisor requires a controller"); - } - if (!harness || typeof harness.ensureRunning !== "function") { - throw new TypeError("ConnectionSupervisor requires a Harness client"); - } - this.#controller = controller; - this.#harness = harness; - this.#logger = logger; - this.#retryDelays = retryDelays3(retryDelaysMs); - this.#healthyIntervalMs = Number.isFinite(healthyIntervalMs) && healthyIntervalMs >= 0 ? healthyIntervalMs : 15e3; - this.#setTimeout = setTimeoutImpl; - this.#clearTimeout = clearTimeoutImpl; - this.#ready = new Promise((resolve7) => { - this.#resolveReady = resolve7; - }); - } - get ready() { - return this.#ready; - } - start() { - if (this.#started || this.#closed) return this; - this.#started = true; - this.#schedule(0); - return this; - } - async close() { - if (this.#closed) return; - this.#closed = true; - if (this.#timer !== null) this.#clearTimeout(this.#timer); - this.#timer = null; - await this.#running?.catch(() => void 0); - this.#resolveReady?.(null); - this.#resolveReady = null; - } - #schedule(delayMs) { - if (this.#closed) return; - this.#timer = this.#setTimeout(() => { - this.#timer = null; - void this.#run(); - }, delayMs); - this.#timer?.unref?.(); - } - async #run() { - if (this.#closed || this.#running) return; - const operation = this.#reconcile(); - this.#running = operation; - try { - await operation; - } finally { - if (this.#running === operation) this.#running = null; - } - } - async #reconcile() { - try { - await this.#harness.ensureRunning(); - if (this.#closed) return; - const status = await this.#controller.initialize(); - if (this.#closed) return; - this.#resolveReady?.(status); - this.#resolveReady = null; - const { configured, connected } = status.totals; - if (connected < configured) { - const delay3 = this.#retryDelays[Math.min(this.#retryIndex, this.#retryDelays.length - 1)]; - this.#retryIndex += 1; - this.#logger.warn?.(`[dsh-im:qq] ${connected}/${configured} bots connected; retrying in ${delay3}ms`); - this.#schedule(delay3); - return; - } - this.#retryIndex = 0; - this.#schedule(this.#healthyIntervalMs); - } catch (error) { - if (this.#closed) return; - const delay3 = this.#retryDelays[Math.min(this.#retryIndex, this.#retryDelays.length - 1)]; - this.#retryIndex += 1; - this.#logger.warn?.(`[dsh-im:qq] connection reconciliation failed; retrying in ${delay3}ms`, error); - this.#schedule(delay3); - } - } -}; -function createConnectionSupervisor3(options) { - return new ConnectionSupervisor3(options); -} - -// plugin-src/host/channels/qq/production.mjs -function harnessOrigin4(webServer, configured) { - if (configured !== void 0) return new URL(configured); - const port = webServer?.port; - if (!Number.isInteger(port) || port < 1 || port > 65535) { - throw new Error("dsh-im QQ requires an initialized DSH webServer port"); - } - return new URL(`http://127.0.0.1:${port}`); -} -function pluginPaths4(config) { - const dshHome = resolve4(config.dshHome ?? process.env.DSH_HOME ?? join4(homedir4(), ".dsh")); - const root = resolve4(config.dataDir ?? join4(dshHome, "integrations", "dsh-qq")); - return { - config: resolve4(config.configPath ?? join4(root, "config.json")), - bots: resolve4(config.botsDir ?? join4(root, "bots")) - }; -} -async function createProductionController4(ctx, config = {}, internals = {}) { - if (!ctx?.credentials) throw new TypeError("dsh-im QQ requires ctx.credentials"); - if (!ctx?.webServer) throw new TypeError("dsh-im QQ requires ctx.webServer"); - const ConfigStore = internals.ConfigStore ?? QqConfigStore; - const StateStore2 = internals.StateStore ?? QqStateStore; - const Harness = internals.HarnessClient ?? QqHarnessClient; - const Controller = internals.Controller ?? QqController; - const Runtime = internals.Runtime ?? QqRuntime; - const QrAuth = internals.QrAuth ?? QqQrAuth; - const createSupervisor = internals.createConnectionSupervisor ?? createConnectionSupervisor3; - const logger = typeof ctx.logger === "function" ? ctx.logger("dsh-im:qq") : ctx.logger ?? console; - const paths = pluginPaths4(config); - const configStore = await new ConfigStore(paths.config).load(); - const qrAuth = internals.qrAuth ?? new QrAuth({ source: config.qrSource ?? "deepseek-harness" }); - const stateStores = /* @__PURE__ */ new Map(); - const statePath = (botId) => resolve4(paths.bots, botId, "state.json"); - const stateFor = async (botId) => { - let state = stateStores.get(botId); - if (!state) { - state = await new StateStore2(statePath(botId)).load(); - stateStores.set(botId, state); - } - return state; - }; - const harness = new Harness({ - baseUrl: harnessOrigin4(ctx.webServer, config.harnessBaseUrl), - workspace: resolve4(config.workspace ?? process.cwd()), - agentPreset: config.agentPreset ?? "standard", - autostart: false, - dshBin: config.dshBin ?? "dsh" - }); - const controller = new Controller({ - qrAuth, - credentials: ctx.credentials, - configStore, - logger, - createRuntime: async ({ botId, config: botConfig, appSecret }) => new Runtime({ - config: botConfig, - appSecret, - harness, - state: await stateFor(botId), - replyTimeoutMs: config.replyTimeoutMs ?? 6e5, - connectTimeoutMs: config.connectTimeoutMs ?? 2e4, - logger: { - error: (...args) => logger.error?.(`[${botId}]`, ...args), - warn: (...args) => logger.warn?.(`[${botId}]`, ...args), - info: (...args) => logger.info?.(`[${botId}]`, ...args), - debug: (...args) => logger.debug?.(`[${botId}]`, ...args) - } - }), - deleteState: async ({ botId }) => { - const state = stateStores.get(botId); - stateStores.delete(botId); - if (state && typeof state.remove === "function") return state.remove(); - try { - await unlink11(statePath(botId)); - } catch (error) { - if (error?.code !== "ENOENT") throw error; - } - } - }); - const supervisor = createSupervisor({ - controller, - harness, - logger, - retryDelaysMs: config.retryDelaysMs, - healthyIntervalMs: config.healthyIntervalMs - }).start(); - return { - controller, - ready: supervisor.ready, - async close() { - await supervisor.close(); - await controller.close(); - harness.stopManagedProcess(); - } - }; -} - -// plugin-src/host/channels/qq/rpc.mjs -import QRCode3 from "qrcode"; -var QQ_RPC_CHANNEL = "/qq"; -var QQ_ENDPOINTS = Object.freeze({ - status: "connection.status", - beginProvisioning: "provision.begin", - pollProvisioning: "provision.poll", - cancelProvisioning: "provision.cancel", - bindCredentials: "bot.bind-credentials", - reconnectBot: "bot.reconnect", - deleteBot: "bot.delete" -}); -var QQ_RPC_ENDPOINTS = Object.freeze(Object.values(QQ_ENDPOINTS)); -var FORBIDDEN_PUBLIC_KEYS3 = /* @__PURE__ */ new Set([ - "appSecret", - "app_secret", - "secretRef", - "ownerUserOpenid", - "userOpenid", - "verificationUrl" -]); -function isRecord3(value) { - return value !== null && typeof value === "object" && !Array.isArray(value); -} -function exactKeys3(value, allowed) { - return isRecord3(value) && Object.keys(value).every((key) => allowed.includes(key)); -} -function validId3(value) { - return typeof value === "string" && /^[A-Za-z0-9_-]{1,128}$/.test(value); -} -function validCredential3(value, maxLength) { - return typeof value === "string" && value.trim().length > 0 && value.length <= maxLength; -} -function payloadFailure3(endpoint, payload) { - if (!isRecord3(payload)) return "Payload must be an object."; - if (endpoint === QQ_ENDPOINTS.status) return exactKeys3(payload, []) ? null : "connection.status does not accept fields."; - if (endpoint === QQ_ENDPOINTS.beginProvisioning) { - return exactKeys3(payload, ["locale"]) && (payload.locale === void 0 || payload.locale === "zh-CN") ? null : "provision.begin received unsupported fields."; - } - if ([QQ_ENDPOINTS.pollProvisioning, QQ_ENDPOINTS.cancelProvisioning].includes(endpoint)) { - return exactKeys3(payload, ["attemptId"]) && validId3(payload.attemptId) ? null : `${endpoint} requires an attemptId.`; - } - if (endpoint === QQ_ENDPOINTS.bindCredentials) { - return exactKeys3(payload, ["appId", "appSecret"]) && validCredential3(payload.appId, 256) && validCredential3(payload.appSecret, 1024) ? null : "bot.bind-credentials requires AppID and AppSecret."; - } - if (endpoint === QQ_ENDPOINTS.reconnectBot) { - return exactKeys3(payload, ["botId"]) && validId3(payload.botId) ? null : "bot.reconnect requires a botId."; - } - if (endpoint === QQ_ENDPOINTS.deleteBot) { - return exactKeys3(payload, ["botId", "confirm"]) && validId3(payload.botId) && payload.confirm === true ? null : "bot.delete requires a botId and confirm=true."; - } - return "Unknown QQ endpoint."; -} -function sanitizePublic3(value) { - if (Array.isArray(value)) return value.map(sanitizePublic3); - if (!isRecord3(value)) return value; - const safe = {}; - for (const [key, child] of Object.entries(value)) { - if (!FORBIDDEN_PUBLIC_KEYS3.has(key)) safe[key] = sanitizePublic3(child); - } - return safe; -} -async function qrDataUrl2(value) { - return QRCode3.toDataURL(value, { - type: "image/png", - errorCorrectionLevel: "M", - margin: 2, - width: 320 - }); -} -async function withEncodedQr2(value, encodeQr) { - if (!value || typeof value.verificationUrl !== "string") return sanitizePublic3(value); - return sanitizePublic3({ ...value, qrCodeDataUrl: await encodeQr(value.verificationUrl) }); -} -async function publicStatus2(status, encodeQr) { - const value = structuredClone(status); - if (value?.provisioning) value.provisioning = await withEncodedQr2(value.provisioning, encodeQr); - return sanitizePublic3(value); -} -function createQqRpcHandler(controller, { encodeQr = qrDataUrl2 } = {}) { - for (const method of ["status", "startProvisioning", "registrationStatus", "cancelProvisioning", "bindCredentials", "reconnectBot", "deleteBot"]) { - if (typeof controller?.[method] !== "function") throw new TypeError(`A complete QQ controller is required (${method})`); - } - const qrCache = /* @__PURE__ */ new Map(); - const cachedEncode = (url) => { - let encoded = qrCache.get(url); - if (!encoded) { - if (qrCache.size >= 16) qrCache.delete(qrCache.keys().next().value); - encoded = Promise.resolve().then(() => encodeQr(url)); - qrCache.set(url, encoded); - } - return encoded; - }; - return async (endpoint, payload, signal) => { - if (signal?.aborted) return { ok: false, error: { code: "cancelled", message: "The request was cancelled." } }; - if (!QQ_RPC_ENDPOINTS.includes(endpoint)) return { ok: false, error: { code: "bad-request", message: "Unknown QQ endpoint." } }; - const invalid = payloadFailure3(endpoint, payload); - if (invalid) return { ok: false, error: { code: "bad-request", message: invalid } }; - try { - let value; - if (endpoint === QQ_ENDPOINTS.status) value = await publicStatus2(await controller.status(), cachedEncode); - else if (endpoint === QQ_ENDPOINTS.beginProvisioning) value = await withEncodedQr2(await controller.startProvisioning(), cachedEncode); - else if (endpoint === QQ_ENDPOINTS.pollProvisioning) { - const current = await controller.registrationStatus(payload.attemptId); - if (!current) return { ok: false, error: { code: "bad-request", message: "The provisioning attempt no longer exists." } }; - value = await withEncodedQr2(current, cachedEncode); - } else if (endpoint === QQ_ENDPOINTS.cancelProvisioning) { - value = sanitizePublic3(await controller.cancelProvisioning(payload.attemptId)); - } else if (endpoint === QQ_ENDPOINTS.bindCredentials) { - value = await publicStatus2(await controller.bindCredentials(payload), cachedEncode); - } else if (endpoint === QQ_ENDPOINTS.reconnectBot) { - value = await publicStatus2(await controller.reconnectBot(payload.botId), cachedEncode); - } else { - value = await publicStatus2(await controller.deleteBot(payload.botId), cachedEncode); - } - return signal?.aborted ? { ok: false, error: { code: "cancelled", message: "The request was cancelled." } } : { ok: true, value }; - } catch { - return signal?.aborted ? { ok: false, error: { code: "cancelled", message: "The request was cancelled." } } : { ok: false, error: { code: "qq-operation-failed", message: "QQ \u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002" } }; - } - }; -} -function installQqRpc(ctx, controller, options, authority) { - if (!ctx?.connection?.rpc || typeof ctx.connection.rpc.handle !== "function") { - throw new TypeError("DSH Host Connection RPC is required"); - } - return ctx.connection.rpc.handle( - QQ_RPC_CHANNEL, - createQqRpcHandler(controller, options), - { authority: resolveRpcAuthority(authority) } - ); -} - -// plugin-src/host/channels/qq/index.mjs -async function apply4(ctx, config = {}) { - if (config?.controller) { - return installQqRpc(ctx, config.controller, config.rpcOptions, config.rpcAuthority); - } - const production = await createProductionController4(ctx, config, config.internals); - const disposeRpc = installQqRpc( - ctx, - production.controller, - config.rpcOptions, - config.rpcAuthority - ); - ctx.effect(() => async () => production.close(), "dsh-im: close QQ bot connections"); - return disposeRpc; -} - -// src/channels/telegram/config-store.mjs -var IDENTITY_OPTIONS2 = Object.freeze({ - botPrefix: "telegram", - tokenRefPrefix: "DSH_TELEGRAM_BOT_TOKEN" -}); -function deriveTelegramBotIdentity(platformId) { - return deriveTokenBotIdentity(platformId, IDENTITY_OPTIONS2); -} -function maskTelegramBotId(platformId) { - return maskPlatformId(platformId, "Telegram\u673A\u5668\u4EBA"); -} -var TelegramConfigStore = class extends TokenBotConfigStore { - constructor(path) { - super(path, { channel: "Telegram", ...IDENTITY_OPTIONS2 }); - } -}; - -// src/channels/telegram/harness-client.mjs -var TelegramHarnessClient = class extends HarnessClient2 { -}; - -// src/channels/telegram/telegram-api.mjs -var DEFAULT_BASE_URL2 = "https://api.telegram.org/"; -function cleanString10(value) { - return typeof value === "string" && value.trim() ? value.trim() : null; -} -function requestSignal2(signal, timeoutMs) { - const timeout = AbortSignal.timeout(timeoutMs); - return signal ? AbortSignal.any([signal, timeout]) : timeout; -} -function validTelegramToken(value) { - return typeof value === "string" && /^\d{5,20}:[A-Za-z0-9_-]{20,}$/.test(value.trim()); -} -var TelegramApi = class { - #token; - #fetch; - #baseUrl; - constructor({ token, fetchImpl = fetch, baseUrl = DEFAULT_BASE_URL2 }) { - if (!validTelegramToken(token)) throw new TypeError("Telegram Bot Token is invalid"); - if (typeof fetchImpl !== "function") throw new TypeError("TelegramApi requires fetch"); - this.#token = token.trim(); - this.#fetch = fetchImpl; - this.#baseUrl = new URL(baseUrl); - } - async getMe(options = {}) { - return this.#call("getMe", {}, options); - } - async getWebhookInfo(options = {}) { - return this.#call("getWebhookInfo", {}, options); - } - async getUpdates({ offset, timeout = 25, signal } = {}) { - const payload = { - timeout, - limit: 100, - allowed_updates: ["message"], - ...Number.isSafeInteger(offset) ? { offset } : {} - }; - return this.#call("getUpdates", payload, { - signal, - timeoutMs: Math.max(1e4, (timeout + 10) * 1e3) - }); - } - async sendMessage({ chatId, text, replyToMessageId, messageThreadId, signal }) { - return this.#call("sendMessage", { - chat_id: chatId, - text, - link_preview_options: { is_disabled: true }, - ...replyToMessageId ? { - reply_parameters: { message_id: replyToMessageId, allow_sending_without_reply: true } - } : {}, - ...messageThreadId ? { message_thread_id: messageThreadId } : {} - }, { signal }); - } - async editMessageText({ chatId, messageId, text, signal }) { - return this.#call("editMessageText", { - chat_id: chatId, - message_id: messageId, - text, - link_preview_options: { is_disabled: true } - }, { signal }); - } - async sendChatAction({ chatId, messageThreadId, signal }) { - return this.#call("sendChatAction", { - chat_id: chatId, - action: "typing", - ...messageThreadId ? { message_thread_id: messageThreadId } : {} - }, { signal }); - } - async #call(method, payload, { signal, timeoutMs = 15e3 } = {}) { - const url = new URL(this.#baseUrl); - url.pathname = `${url.pathname.replace(/\/$/, "")}/bot${this.#token}/${method}`; - let response; - try { - response = await this.#fetch(url, { - method: "POST", - headers: { "content-type": "application/json" }, - body: JSON.stringify(payload), - signal: requestSignal2(signal, timeoutMs), - redirect: "error" - }); - } catch (error) { - if (error?.name === "AbortError" || error?.name === "TimeoutError") throw error; - throw new Error(`Telegram ${method} transport failed`); - } - let body; - try { - body = await response.json(); - } catch { - throw new Error(`Telegram ${method} returned invalid JSON`); - } - if (!response.ok || body?.ok !== true) { - const description = cleanString10(body?.description); - const error = new Error(description ?? `Telegram ${method} failed`); - error.code = Number.isInteger(body?.error_code) ? `telegram-${body.error_code}` : "telegram-api-error"; - throw error; - } - return body.result; - } -}; -async function inspectTelegramToken(token, options = {}) { - const api = new TelegramApi({ token, ...options }); - const bot = await api.getMe(); - if (!bot?.id || bot?.is_bot !== true) throw new Error("Telegram token does not belong to a bot"); - return { - platformId: String(bot.id), - name: cleanString10([bot.first_name, bot.last_name].filter(Boolean).join(" ")) ?? "Telegram\u673A\u5668\u4EBA", - username: cleanString10(bot.username) - }; -} - -// src/channels/telegram/telegram-bridge.mjs -var TELEGRAM_DESCRIPTOR = Object.freeze({ - key: "telegram", - label: "Telegram", - connectionLabel: " Bot API \u957F\u8F6E\u8BE2" -}); -var TelegramHarnessBridge = class extends TextHarnessBridge { - constructor(options) { - super({ descriptor: TELEGRAM_DESCRIPTOR, ...options }); - } -}; - -// src/channels/telegram/telegram-controller.mjs -var TelegramController = class extends TokenBotController { - constructor(options) { - super({ - ...options, - descriptor: TELEGRAM_DESCRIPTOR, - inspectToken: options.inspectToken ?? inspectTelegramToken, - deriveIdentity: deriveTelegramBotIdentity, - maskPlatformId: maskTelegramBotId - }); - } -}; - -// src/channels/telegram/telegram-runtime.mjs -function escaped(value) { - return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); -} -function mentionedUsername(message, username) { - if (!username || typeof message?.text !== "string" || !Array.isArray(message.entities)) return false; - return message.entities.some((entity) => { - if (entity?.type !== "mention" || !Number.isInteger(entity.offset) || !Number.isInteger(entity.length)) { - return false; - } - return message.text.slice(entity.offset, entity.offset + entity.length).toLowerCase() === `@${username.toLowerCase()}`; - }); -} -function withoutBotMention(text, username) { - if (!username || typeof text !== "string") return text; - return text.replace(new RegExp(`@${escaped(username)}\\b`, "ig"), "").trim(); -} -function normalizeTelegramUpdate(update, { botId, username }) { - const message = update?.message; - const chatId = message?.chat?.id; - const senderId = message?.from?.id; - const messageId = message?.message_id; - if (!Number.isSafeInteger(update?.update_id) || chatId === void 0 || senderId === void 0 || !Number.isSafeInteger(messageId)) return null; - if (!["private", "group", "supergroup"].includes(message.chat?.type)) return null; - const direct = message.chat.type === "private"; - const addressed = direct || String(message.reply_to_message?.from?.id ?? "") === String(botId) || mentionedUsername(message, username); - return { - messageId: String(update.update_id), - senderId: String(senderId), - senderIsBot: message.from?.is_bot === true, - kind: direct ? "direct" : "group", - conversationId: String(chatId), - content: withoutBotMention(message.text ?? message.caption ?? "", username), - addressed, - replyTarget: { - chatId, - replyToMessageId: messageId, - messageThreadId: Number.isSafeInteger(message.message_thread_id) ? message.message_thread_id : void 0 - } - }; -} -var TelegramBotClient = class { - #api; - #signal; - constructor({ api, signal }) { - this.#api = api; - this.#signal = signal; - } - async sendText(target, text) { - const chunks = splitMessageText(text, 4e3); - let result = null; - for (const [index, chunk] of chunks.entries()) { - result = await this.#api.sendMessage({ - chatId: target.chatId, - text: chunk, - replyToMessageId: index === 0 ? target.replyToMessageId : void 0, - messageThreadId: target.messageThreadId, - signal: this.#signal - }); - } - return result; - } - sendTyping(target) { - return this.#api.sendChatAction({ - chatId: target.chatId, - messageThreadId: target.messageThreadId, - signal: this.#signal - }); - } - async openStream(target) { - const stream = createEditableMessageStream({ - limit: 4e3, - create: async (text) => { - const message = await this.#api.sendMessage({ - chatId: target.chatId, - text, - replyToMessageId: target.replyToMessageId, - messageThreadId: target.messageThreadId, - signal: this.#signal - }); - return message.message_id; - }, - edit: (messageId, text) => this.#api.editMessageText({ - chatId: target.chatId, - messageId, - text, - signal: this.#signal - }), - sendRemainder: (text) => this.#api.sendMessage({ - chatId: target.chatId, - text, - messageThreadId: target.messageThreadId, - signal: this.#signal - }) - }); - return stream.start(); - } -}; -function createTelegramRuntimeStatus() { - return { - startedAt: null, - ready: false, - connectionState: "idle", - harnessReachable: false, - lastCheckedAt: null, - lastConnectedAt: null, - lastError: null, - ...createTextBridgeStatus() - }; -} -var TelegramRuntime = class { - #config; - #token; - #harness; - #state; - #logger; - #replyTimeoutMs; - #createApi; - #status = createTelegramRuntimeStatus(); - #api = null; - #bridge = null; - #abortController = null; - #pollTask = null; - #starting = null; - constructor({ - config, - token, - harness, - state, - logger = console, - replyTimeoutMs = 6e5, - createApi = (options) => new TelegramApi(options) - }) { - if (!config || !token || !harness || !state) { - throw new TypeError("TelegramRuntime requires config, token, Harness, and state"); - } - this.#config = config; - this.#token = token; - this.#harness = harness; - this.#state = state; - this.#logger = logger; - this.#replyTimeoutMs = replyTimeoutMs; - this.#createApi = createApi; - } - get status() { - return structuredClone(this.#status); - } - async start() { - if (this.#status.ready && this.#pollTask) return this.status; - if (this.#starting) return this.#starting; - this.#starting = this.#start().finally(() => { - this.#starting = null; - }); - return this.#starting; - } - async #start() { - await this.stop(); - this.#status.startedAt = (/* @__PURE__ */ new Date()).toISOString(); - this.#status.connectionState = "connecting"; - this.#status.lastError = null; - await this.#harness.ensureRunning(); - this.#status.harnessReachable = true; - const controller = new AbortController(); - this.#abortController = controller; - const api = this.#createApi({ token: this.#token }); - this.#api = api; - try { - const bot = await api.getMe({ signal: controller.signal }); - if (String(bot?.id ?? "") !== this.#config.platformId || bot?.is_bot !== true) { - throw new Error("Telegram token identity does not match the saved bot"); - } - const webhook = await api.getWebhookInfo({ signal: controller.signal }); - if (typeof webhook?.url === "string" && webhook.url) { - const error = new Error("\u8BE5 Telegram \u673A\u5668\u4EBA\u5DF2\u914D\u7F6E Webhook\uFF0C\u8BF7\u5148\u5728\u539F\u670D\u52A1\u4E2D\u79FB\u9664 Webhook \u540E\u91CD\u8BD5\u3002"); - error.code = "webhook-configured"; - throw error; - } - const client = new TelegramBotClient({ api, signal: controller.signal }); - this.#bridge = new TelegramHarnessBridge({ - bot: client, - harness: this.#harness, - state: this.#state, - status: this.#status, - logger: this.#logger, - replyTimeoutMs: this.#replyTimeoutMs - }); - let cursor = this.#state.cursor(); - if (cursor === null) { - const latest = await api.getUpdates({ offset: -1, timeout: 0, signal: controller.signal }); - cursor = latest.length > 0 ? latest.at(-1).update_id + 1 : 0; - await this.#state.setCursor(cursor); - } - const now = Date.now(); - this.#status.ready = true; - this.#status.connectionState = "connected"; - this.#status.lastCheckedAt = now; - this.#status.lastConnectedAt = now; - this.#pollTask = this.#poll(cursor, controller.signal); - this.#pollTask.catch((error) => { - if (controller.signal.aborted) return; - this.#status.ready = false; - this.#status.connectionState = "failed"; - this.#status.lastError = error?.message ?? String(error); - this.#logger.error?.(`[dsh-im:telegram] bot ${this.#config.botId} polling stopped:`, error); - }); - return this.status; - } catch (error) { - this.#status.ready = false; - this.#status.connectionState = "failed"; - this.#status.lastError = error?.message ?? String(error); - await this.stop(); - throw error; - } - } - async #poll(initialCursor, signal) { - let cursor = initialCursor; - while (!signal.aborted) { - const updates = await this.#api.getUpdates({ offset: cursor, timeout: 25, signal }); - this.#status.lastCheckedAt = Date.now(); - for (const update of updates) { - if (signal.aborted) return; - const message = normalizeTelegramUpdate(update, { - botId: this.#config.platformId, - username: this.#config.username - }); - if (message) await this.#bridge.accept(message); - cursor = update.update_id + 1; - await this.#state.setCursor(cursor); - } - } - } - async stop() { - const pollTask = this.#pollTask; - const bridge = this.#bridge; - this.#abortController?.abort(); - this.#abortController = null; - this.#pollTask = null; - this.#api = null; - this.#bridge = null; - await Promise.race([ - pollTask?.catch(() => void 0) ?? Promise.resolve(), - new Promise((resolve7) => setTimeout(resolve7, 2e3)) - ]); - await Promise.race([ - bridge?.waitForIdle() ?? Promise.resolve(), - new Promise((resolve7) => setTimeout(resolve7, 2e3)) - ]); - this.#status.ready = false; - this.#status.connectionState = "idle"; - return this.status; - } -}; - -// src/channels/telegram/state-store.mjs -var TelegramStateStore = class extends ConversationStateStore { -}; - -// plugin-src/host/channels/telegram/production.mjs -function createProductionController5(ctx, config = {}, internals = {}) { - return createTokenProductionController(ctx, config, internals, { - channel: "telegram", - ConfigStore: TelegramConfigStore, - StateStore: TelegramStateStore, - HarnessClient: TelegramHarnessClient, - Controller: TelegramController, - Runtime: TelegramRuntime - }); -} - -// plugin-src/host/channels/telegram/rpc.mjs -var TELEGRAM_RPC_CHANNEL = "/telegram"; -var TELEGRAM_ENDPOINTS = TOKEN_BOT_ENDPOINTS; -var TELEGRAM_RPC_ENDPOINTS = Object.freeze(Object.values(TELEGRAM_ENDPOINTS)); -function installTelegramRpc(ctx, controller, authority) { - return installTokenBotRpc(ctx, controller, { - channel: "Telegram", - rpcChannel: TELEGRAM_RPC_CHANNEL, - authority - }); -} - -// plugin-src/host/channels/telegram/index.mjs -async function apply5(ctx, config = {}) { - if (config?.controller) { - return installTelegramRpc(ctx, config.controller, config.rpcAuthority); - } - const production = await createProductionController5(ctx, config, config.internals ?? {}); - const disposeRpc = installTelegramRpc(ctx, production.controller, config.rpcAuthority); - ctx.effect(() => async () => production.close(), "dsh-im: close Telegram bot connections"); - return disposeRpc; -} - -// plugin-src/host/channels/wecom/production.mjs -import { unlink as unlink14 } from "node:fs/promises"; -import { homedir as homedir5 } from "node:os"; -import { join as join5, resolve as resolve5 } from "node:path"; - -// src/channels/wecom/config-store.mjs -import { createHash as createHash5 } from "node:crypto"; -import { mkdir as mkdir9, readFile as readFile9, rename as rename9, unlink as unlink12, writeFile as writeFile9 } from "node:fs/promises"; -import { dirname as dirname9 } from "node:path"; -var EMPTY_DOCUMENT4 = Object.freeze({ version: 1, bots: Object.freeze([]) }); -function cleanString11(value) { - return typeof value === "string" && value.trim() ? value.trim() : null; -} -function safeIntegrationId(value) { - const id = cleanString11(value); - return id && /^wecom_[a-f0-9]{24}$/.test(id) ? id : null; -} -function safeSecretRef3(value) { - const ref = cleanString11(value); - return ref && /^DSH_WECOM_BOT_SECRET_[A-F0-9]{24}$/.test(ref) ? ref : null; -} -function deriveWecomBotIdentity(remoteBotId) { - const raw = cleanString11(remoteBotId); - if (!raw) throw new TypeError("Enterprise WeChat bot ID is required"); - const digest2 = createHash5("sha256").update(raw).digest("hex").slice(0, 24); - return { - botId: `wecom_${digest2}`, - secretRef: `DSH_WECOM_BOT_SECRET_${digest2.toUpperCase()}` - }; -} -function maskWecomBotId(remoteBotId) { - const value = cleanString11(remoteBotId) ?? ""; - if (!value) return "\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA"; - if (value.length <= 10) return `${value.slice(0, 3)}\u2022\u2022\u2022`; - return `${value.slice(0, 6)}\u2022\u2022\u2022\u2022${value.slice(-4)}`; -} -function normalizeBot4(value) { - if (!value || typeof value !== "object") return null; - const botId = safeIntegrationId(value.botId); - const remoteBotId = cleanString11(value.remoteBotId); - const secretRef = safeSecretRef3(value.secretRef); - if (!botId || !remoteBotId || !secretRef) return null; - const derived = deriveWecomBotIdentity(remoteBotId); - if (derived.botId !== botId || derived.secretRef !== secretRef) return null; - return Object.freeze({ - botId, - remoteBotId, - secretRef, - createdAt: cleanString11(value.createdAt) ?? (/* @__PURE__ */ new Date()).toISOString(), - connectedAt: cleanString11(value.connectedAt) - }); -} -function normalizeDocument4(value) { - if (!value || value.version !== 1 || !Array.isArray(value.bots)) return null; - const bots = value.bots.map(normalizeBot4); - if (bots.some((bot) => bot === null)) return null; - const ids = /* @__PURE__ */ new Set(); - const remoteIds = /* @__PURE__ */ new Set(); - const refs = /* @__PURE__ */ new Set(); - for (const bot of bots) { - if (ids.has(bot.botId) || remoteIds.has(bot.remoteBotId) || refs.has(bot.secretRef)) return null; - ids.add(bot.botId); - remoteIds.add(bot.remoteBotId); - refs.add(bot.secretRef); - } - return Object.freeze({ version: 1, bots: Object.freeze(bots) }); -} -var WecomConfigStore = class { - #path; - #value = EMPTY_DOCUMENT4; - #writeQueue = Promise.resolve(); - constructor(path) { - this.#path = path; - } - async load() { - try { - const normalized = normalizeDocument4(JSON.parse(await readFile9(this.#path, "utf8"))); - if (!normalized) throw new Error("dsh-im Enterprise WeChat config contains invalid bot data"); - this.#value = normalized; - } catch (error) { - if (error?.code !== "ENOENT") throw error; - this.#value = EMPTY_DOCUMENT4; - } - return this; - } - list() { - return structuredClone(this.#value.bots); - } - get(botId) { - const bot = this.#value.bots.find((candidate) => candidate.botId === botId); - return bot ? structuredClone(bot) : null; - } - getByRemoteBotId(remoteBotId) { - const bot = this.#value.bots.find((candidate) => candidate.remoteBotId === remoteBotId); - return bot ? structuredClone(bot) : null; - } - async save(value) { - const normalized = normalizeBot4(value); - if (!normalized) throw new Error("Refusing to persist incomplete Enterprise WeChat bot data"); - return this.#mutate((bots) => { - const remoteCollision = bots.find( - (bot) => bot.remoteBotId === normalized.remoteBotId && bot.botId !== normalized.botId - ); - const refCollision = bots.find( - (bot) => bot.secretRef === normalized.secretRef && bot.botId !== normalized.botId - ); - if (remoteCollision || refCollision) throw new Error("Duplicate Enterprise WeChat bot identity"); - const index = bots.findIndex((bot) => bot.botId === normalized.botId); - if (index === -1) bots.push(normalized); - else bots[index] = normalized; - return structuredClone(normalized); - }); - } - async remove(botId) { - if (!safeIntegrationId(botId)) throw new TypeError("Invalid Enterprise WeChat bot ID"); - return this.#mutate((bots) => { - const index = bots.findIndex((bot) => bot.botId === botId); - if (index === -1) return null; - const [removed] = bots.splice(index, 1); - return structuredClone(removed); - }); - } - async clear() { - const operation = this.#writeQueue.then(async () => { - try { - await unlink12(this.#path); - } catch (error) { - if (error?.code !== "ENOENT") throw error; - } - this.#value = EMPTY_DOCUMENT4; - }); - this.#writeQueue = operation.then(() => void 0, () => void 0); - await operation; - } - async #mutate(mutator) { - let result; - const operation = this.#writeQueue.then(async () => { - const bots = [...this.#value.bots]; - result = mutator(bots); - const document = Object.freeze({ version: 1, bots: Object.freeze(bots) }); - await this.#write(document); - this.#value = document; - }); - this.#writeQueue = operation.then(() => void 0, () => void 0); - await operation; - return result; - } - async #write(document) { - await mkdir9(dirname9(this.#path), { recursive: true, mode: 448 }); - const temporary = `${this.#path}.tmp`; - await writeFile9(temporary, `${JSON.stringify(document, null, 2)} -`, { - encoding: "utf8", - mode: 384 - }); - await rename9(temporary, this.#path); - } -}; - -// src/channels/wecom/harness-client.mjs -var WecomHarnessClient = class extends HarnessClient2 { -}; - -// src/channels/wecom/qr-auth.mjs -var GENERATE_URL = "https://work.weixin.qq.com/ai/qc/generate"; -var POLL_URL = "https://work.weixin.qq.com/ai/qc/query_result"; -var QR_TTL_MS2 = 5 * 6e4; -var POLL_INTERVAL_MS = 3e3; -function defaultPlatform() { - if (process.platform === "win32") return 2; - if (process.platform === "linux") return 3; - return 1; -} -function cleanString12(value) { - return typeof value === "string" && value.trim() ? value.trim() : null; -} -function safeVerificationUrl(value) { - const raw = cleanString12(value); - if (!raw) return null; - try { - const url = new URL(raw); - return url.protocol === "https:" && url.hostname === "work.weixin.qq.com" && (!url.port || url.port === "443") ? url.href : null; - } catch { - return null; - } -} -function combinedSignal(signal, timeoutMs) { - return signal ? AbortSignal.any([signal, AbortSignal.timeout(timeoutMs)]) : AbortSignal.timeout(timeoutMs); -} -async function requestJson2(fetchImpl, url, signal) { - const response = await fetchImpl(url, { - method: "GET", - redirect: "error", - signal: combinedSignal(signal, 1e4), - headers: { accept: "application/json" } - }); - if (!response.ok) throw new Error(`Enterprise WeChat QR service returned HTTP ${response.status}`); - return response.json(); -} -var WecomQrAuth = class { - #fetch; - #clock; - #source; - #platform; - constructor({ - fetch: fetchImpl = globalThis.fetch, - clock = () => Date.now(), - source = "deepseek-harness", - platform = defaultPlatform() - } = {}) { - if (typeof fetchImpl !== "function") throw new TypeError("A fetch implementation is required"); - this.#fetch = fetchImpl; - this.#clock = clock; - this.#source = source; - this.#platform = [1, 2, 3].includes(platform) ? platform : defaultPlatform(); - } - async start({ signal } = {}) { - const url = new URL(GENERATE_URL); - url.searchParams.set("source", this.#source); - url.searchParams.set("plat", String(this.#platform)); - const body = await requestJson2(this.#fetch, url, signal); - const scode = cleanString12(body?.data?.scode); - const verificationUrl = safeVerificationUrl(body?.data?.auth_url); - if (!scode || !verificationUrl) throw new Error("Enterprise WeChat QR service returned invalid data"); - return { - scode, - verificationUrl, - expiresAt: this.#clock() + QR_TTL_MS2, - pollIntervalMs: POLL_INTERVAL_MS - }; - } - async poll({ scode, signal } = {}) { - const code = cleanString12(scode); - if (!code) throw new TypeError("Enterprise WeChat QR poll code is required"); - const url = new URL(POLL_URL); - url.searchParams.set("scode", code); - const body = await requestJson2(this.#fetch, url, signal); - const state = cleanString12(body?.data?.status)?.toLowerCase(); - if (state === "success") { - const remoteBotId = cleanString12(body?.data?.bot_info?.botid); - const secret = cleanString12(body?.data?.bot_info?.secret); - if (!remoteBotId || !secret) throw new Error("Enterprise WeChat QR result omitted bot credentials"); - return { status: "success", remoteBotId, secret }; - } - if (["expired", "timeout"].includes(state)) return { status: "expired" }; - if (["fail", "failed", "error"].includes(state)) return { status: "failed" }; - return { status: "waiting" }; - } -}; - -// src/channels/wecom/state-store.mjs -import { mkdir as mkdir10, readFile as readFile10, rename as rename10, unlink as unlink13, writeFile as writeFile10 } from "node:fs/promises"; -import { dirname as dirname10 } from "node:path"; -var EMPTY_STATE5 = Object.freeze({ version: 1, sessions: {}, seenMessageIds: [] }); -function normalizeState4(value) { - if (!value || typeof value !== "object") return structuredClone(EMPTY_STATE5); - const sessions = {}; - if (value.sessions && typeof value.sessions === "object" && !Array.isArray(value.sessions)) { - for (const [key, sessionId] of Object.entries(value.sessions)) { - if (typeof key === "string" && typeof sessionId === "string" && sessionId) sessions[key] = sessionId; - } - } - return { - version: 1, - sessions, - seenMessageIds: Array.isArray(value.seenMessageIds) ? value.seenMessageIds.filter((id) => typeof id === "string").slice(-1e3) : [] - }; -} -var WecomStateStore = class { - #path; - #state = structuredClone(EMPTY_STATE5); - #writeQueue = Promise.resolve(); - constructor(path) { - this.#path = path; - } - async load() { - try { - this.#state = normalizeState4(JSON.parse(await readFile10(this.#path, "utf8"))); - } catch (error) { - if (error?.code !== "ENOENT") throw error; - this.#state = structuredClone(EMPTY_STATE5); - await this.#persist(); - } - return this; - } - sessionFor(key) { - return this.#state.sessions[key] ?? null; - } - async setSession(key, sessionId) { - this.#state.sessions[key] = sessionId; - await this.#persist(); - } - async clearSession(key) { - delete this.#state.sessions[key]; - await this.#persist(); - } - hasSeen(messageId) { - return this.#state.seenMessageIds.includes(messageId); - } - async markSeen(messageId) { - if (this.hasSeen(messageId)) return; - this.#state.seenMessageIds.push(messageId); - if (this.#state.seenMessageIds.length > 1e3) { - this.#state.seenMessageIds.splice(0, this.#state.seenMessageIds.length - 1e3); - } - await this.#persist(); - } - async remove() { - try { - await unlink13(this.#path); - } catch (error) { - if (error?.code !== "ENOENT") throw error; - } - this.#state = structuredClone(EMPTY_STATE5); - } - async #persist() { - const snapshot = `${JSON.stringify(this.#state, null, 2)} -`; - const operation = this.#writeQueue.then(async () => { - await mkdir10(dirname10(this.#path), { recursive: true, mode: 448 }); - const temporary = `${this.#path}.tmp`; - await writeFile10(temporary, snapshot, { encoding: "utf8", mode: 384 }); - await rename10(temporary, this.#path); - }); - this.#writeQueue = operation.then(() => void 0, () => void 0); - await operation; - } -}; - -// src/channels/wecom/wecom-controller.mjs -import { randomUUID as randomUUID10 } from "node:crypto"; -var ACTIVE_ATTEMPT_STATES3 = /* @__PURE__ */ new Set(["pending", "connecting"]); -var TERMINAL_ATTEMPT_STATES3 = /* @__PURE__ */ new Set(["connected", "failed", "cancelled", "expired"]); -function cleanString13(value) { - return typeof value === "string" && value.trim() ? value.trim() : null; -} -function safeError4(code, message) { - return Object.freeze({ code, message }); -} -function publicAttempt3(record) { - if (!record) return null; - return { - attemptId: record.id, - status: record.state, - pollIntervalMs: record.pollIntervalMs, - qrRevision: record.qrRevision, - ...record.verificationUrl ? { verificationUrl: record.verificationUrl } : {}, - ...record.expiresAt ? { expiresAt: record.expiresAt } : {}, - ...record.botId ? { botId: record.botId } : {}, - ...record.error ? { error: structuredClone(record.error) } : {} - }; -} -var WecomController = class { - #qrAuth; - #credentials; - #configStore; - #createRuntime; - #deleteState; - #logger; - #runtimes = /* @__PURE__ */ new Map(); - #errors = /* @__PURE__ */ new Map(); - #attempts = /* @__PURE__ */ new Map(); - #activeAttemptId = null; - #transitions = /* @__PURE__ */ new Map(); - #revision = 0; - #closed = false; - constructor({ - qrAuth, - credentials, - configStore, - createRuntime, - deleteState = async () => { - }, - logger = console - }) { - if (!qrAuth || typeof qrAuth.start !== "function" || typeof qrAuth.poll !== "function") { - throw new TypeError("Enterprise WeChat QR auth is required"); - } - if (!credentials || typeof credentials.resolve !== "function" || typeof credentials.set !== "function" || typeof credentials.unset !== "function") { - throw new TypeError("WecomController requires the DSH credential provider"); - } - if (!configStore || typeof configStore.list !== "function" || typeof configStore.save !== "function" || typeof configStore.remove !== "function") { - throw new TypeError("WecomController requires a config store"); - } - if (typeof createRuntime !== "function") throw new TypeError("createRuntime is required"); - this.#qrAuth = qrAuth; - this.#credentials = credentials; - this.#configStore = configStore; - this.#createRuntime = createRuntime; - this.#deleteState = deleteState; - this.#logger = logger; - } - async initialize() { - if (this.#closed) return this.status(); - for (const config of this.#configStore.list()) { - await this.#withBotTransition(config.botId, async () => { - const existing = this.#runtimes.get(config.botId)?.status; - if (this.#closed || existing?.ready || existing?.wecomConnectionState === "connecting") return; - const secret = await this.#resolveSecret(config.secretRef); - if (!secret) { - this.#errors.set(config.botId, safeError4("missing-secret", "\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002")); - return; - } - try { - await this.#startRuntime(config, secret); - this.#errors.delete(config.botId); - } catch (error) { - this.#errors.set(config.botId, safeError4("connection-failed", "\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002")); - this.#logger.warn?.(`[dsh-im:wecom] bot ${config.botId} failed to initialize`); - } finally { - this.#touch(); - } - }); - } - return this.status(); - } - async startProvisioning() { - if (this.#closed) throw new Error("Enterprise WeChat controller is closed"); - if (this.#activeAttemptId) await this.cancelProvisioning(this.#activeAttemptId); - const record = { - id: randomUUID10(), - state: "pending", - createdAt: Date.now(), - expiresAt: null, - pollIntervalMs: 3e3, - qrRevision: 1, - verificationUrl: null, - scode: null, - botId: null, - error: null, - controller: new AbortController(), - polling: null, - transition: null - }; - this.#attempts.set(record.id, record); - this.#activeAttemptId = record.id; - this.#touch(); - try { - const started = await this.#qrAuth.start({ signal: record.controller.signal }); - record.scode = cleanString13(started.scode); - record.verificationUrl = cleanString13(started.verificationUrl); - record.expiresAt = Number(started.expiresAt); - record.pollIntervalMs = Math.min(1e4, Math.max(500, Number(started.pollIntervalMs) || 3e3)); - if (!record.scode || !record.verificationUrl || !Number.isFinite(record.expiresAt)) { - throw new Error("Enterprise WeChat QR auth returned incomplete data"); - } - this.#touch(); - return publicAttempt3(record); - } catch (error) { - record.state = record.controller.signal.aborted ? "cancelled" : "failed"; - record.error = record.controller.signal.aborted ? safeError4("cancelled", "\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002") : safeError4("qr-start-failed", "\u65E0\u6CD5\u751F\u6210\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"); - this.#finishAttempt(record); - throw error; - } - } - async registrationStatus(attemptId) { - const record = this.#attempts.get(attemptId); - if (!record || TERMINAL_ATTEMPT_STATES3.has(record.state)) return publicAttempt3(record); - if (record.state === "connecting") { - await record.transition?.catch(() => void 0); - return publicAttempt3(record); - } - if (Date.now() >= record.expiresAt) { - record.state = "expired"; - record.error = safeError4("expired", "\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002"); - record.controller.abort(); - this.#finishAttempt(record); - return publicAttempt3(record); - } - if (!record.polling) { - const polling = this.#pollAttempt(record).finally(() => { - if (record.polling === polling) record.polling = null; - }); - record.polling = polling; - } - await record.polling.catch(() => void 0); - return publicAttempt3(record); - } - async bindCredentials({ botId, secret } = {}) { - if (this.#closed) throw new Error("Enterprise WeChat controller is closed"); - const remoteBotId = cleanString13(botId); - const normalizedSecret = cleanString13(secret); - if (!remoteBotId || !normalizedSecret) { - throw new TypeError("Enterprise WeChat Bot ID and Secret are required"); - } - if (this.#activeAttemptId) await this.cancelProvisioning(this.#activeAttemptId); - if (this.#closed) throw new Error("Enterprise WeChat controller is closed"); - const identity = deriveWecomBotIdentity(remoteBotId); - await this.#withBotTransition(identity.botId, async () => { - if (this.#closed) throw new Error("Enterprise WeChat controller is closed"); - const previousConfig = this.#configStore.getByRemoteBotId(remoteBotId); - const previousSecret = await this.#credentials.resolve(identity.secretRef).catch(() => void 0); - if (this.#closed) throw new Error("Enterprise WeChat controller is closed"); - const config = { - botId: identity.botId, - remoteBotId, - secretRef: identity.secretRef, - createdAt: previousConfig?.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(), - connectedAt: (/* @__PURE__ */ new Date()).toISOString() - }; - await this.#credentials.set(identity.secretRef, normalizedSecret); - try { - await this.#configStore.save(config); - } catch (error) { - await this.#restoreCredential(identity.secretRef, previousSecret); - throw error; - } - try { - await this.#startRuntime(config, normalizedSecret); - this.#errors.delete(identity.botId); - } catch { - this.#errors.set( - identity.botId, - safeError4("connection-failed", "\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002") - ); - this.#logger.warn?.(`[dsh-im:wecom] bot ${identity.botId} credential connection failed`); - } - this.#touch(); - }); - return this.status(); - } - async cancelProvisioning(attemptId) { - const record = this.#attempts.get(attemptId); - if (!record) return null; - if (!TERMINAL_ATTEMPT_STATES3.has(record.state)) { - record.controller.abort(); - await Promise.allSettled([record.polling, record.transition].filter(Boolean)); - if (!TERMINAL_ATTEMPT_STATES3.has(record.state)) record.state = "cancelled"; - record.error ??= safeError4("cancelled", "\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"); - this.#finishAttempt(record); - } - return publicAttempt3(record); - } - async reconnectBot(botId) { - const config = this.#configStore.get(botId); - if (!config) throw new Error("Unknown Enterprise WeChat bot"); - await this.#withBotTransition(botId, async () => { - const secret = await this.#resolveSecret(config.secretRef); - if (!secret) throw new Error("Enterprise WeChat bot secret is missing"); - try { - await this.#startRuntime(config, secret); - this.#errors.delete(botId); - } catch (error) { - this.#errors.set(botId, safeError4("connection-failed", "\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")); - throw error; - } finally { - this.#touch(); - } - }); - return this.status(); - } - async deleteBot(botId) { - const config = this.#configStore.get(botId); - if (!config) throw new Error("Unknown Enterprise WeChat bot"); - await this.#withBotTransition(botId, async () => { - const previous = await this.#credentials.resolve(config.secretRef).catch(() => void 0); - await this.#stopRuntime(botId); - try { - await this.#credentials.unset(config.secretRef); - await this.#configStore.remove(botId); - } catch (error) { - if (previous?.value) { - await this.#credentials.set(config.secretRef, previous.value).catch(() => void 0); - await this.#startRuntime(config, previous.value).catch(() => void 0); - } - throw new Error("Unable to remove the Enterprise WeChat bot safely.", { cause: error }); - } - await this.#deleteState({ botId, config }).catch((error) => { - this.#logger.warn?.(`[dsh-im:wecom] bot ${botId} state cleanup failed:`, error); - }); - this.#errors.delete(botId); - this.#touch(); - }); - return this.status(); - } - status() { - const bots = this.#configStore.list().map((config) => { - const runtimeStatus2 = this.#runtimes.get(config.botId)?.status ?? null; - const connected = runtimeStatus2?.ready === true && runtimeStatus2.wecomConnectionState === "connected" && runtimeStatus2.harnessReachable === true; - const state = connected ? "connected" : runtimeStatus2?.wecomConnectionState === "connecting" ? "connecting" : this.#errors.has(config.botId) || runtimeStatus2?.wecomConnectionState === "failed" ? "error" : "offline"; - return { - botId: config.botId, - state, - connected, - configured: true, - bot: { name: "\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA", appIdMasked: maskWecomBotId(config.remoteBotId) }, - health: { - status: connected ? "healthy" : state === "error" ? "error" : "offline", - summary: connected ? "\u4F01\u4E1A\u5FAE\u4FE1 WebSocket \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38" : state === "error" ? "\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5" : "\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF", - lastCheckedAt: runtimeStatus2?.lastCheckedAt ?? null, - lastConnectedAt: runtimeStatus2?.lastConnectedAt ?? null - }, - stats: { - messagesReceived: runtimeStatus2?.messagesReceived ?? 0, - messagesReplied: runtimeStatus2?.messagesReplied ?? 0 - }, - error: structuredClone(this.#errors.get(config.botId) ?? null) - }; - }); - const connectedCount = bots.filter((bot) => bot.connected).length; - const active = this.#activeAttemptId ? this.#attempts.get(this.#activeAttemptId) : null; - return { - schemaVersion: 1, - revision: this.#revision, - state: active && ACTIVE_ATTEMPT_STATES3.has(active.state) ? "provisioning" : bots.length === 0 ? "disconnected" : connectedCount === bots.length ? "connected" : connectedCount > 0 ? "degraded" : "offline", - bots, - totals: { configured: bots.length, connected: connectedCount }, - ...active && ACTIVE_ATTEMPT_STATES3.has(active.state) ? { provisioning: publicAttempt3(active) } : {} - }; - } - async close() { - if (this.#closed) return; - this.#closed = true; - if (this.#activeAttemptId) await this.cancelProvisioning(this.#activeAttemptId); - await Promise.allSettled([...this.#transitions.values()]); - await Promise.allSettled([...this.#runtimes.keys()].map((botId) => this.#stopRuntime(botId))); - } - async #pollAttempt(record) { - try { - const result = await this.#qrAuth.poll({ scode: record.scode, signal: record.controller.signal }); - if (record.controller.signal.aborted || TERMINAL_ATTEMPT_STATES3.has(record.state)) return; - if (result.status === "waiting") return; - if (result.status === "expired") { - record.state = "expired"; - record.error = safeError4("expired", "\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002"); - this.#finishAttempt(record); - return; - } - if (result.status !== "success") { - record.state = "failed"; - record.error = safeError4("qr-connect-failed", "\u4F01\u4E1A\u5FAE\u4FE1\u626B\u7801\u6CA1\u6709\u5B8C\u6210\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002"); - this.#finishAttempt(record); - return; - } - record.state = "connecting"; - record.verificationUrl = null; - record.expiresAt = null; - record.scode = null; - this.#touch(); - const transition = this.#completeProvisioning(record, result); - record.transition = transition; - await transition; - } catch (error) { - if (record.controller.signal.aborted) return; - record.state = "failed"; - record.error = safeError4("qr-connect-failed", "\u4F01\u4E1A\u5FAE\u4FE1\u626B\u7801\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002"); - this.#logger.warn?.("[dsh-im:wecom] QR polling failed"); - this.#finishAttempt(record); - } - } - async #completeProvisioning(record, result) { - try { - const remoteBotId = cleanString13(result.remoteBotId); - const secret = cleanString13(result.secret); - if (!remoteBotId || !secret) throw new Error("Enterprise WeChat authorization returned incomplete credentials"); - record.botId = await this.#activateBot(record, { remoteBotId, secret }); - record.state = "connected"; - record.error = null; - } catch (error) { - if (record.controller.signal.aborted) { - record.state = "cancelled"; - record.error = safeError4("cancelled", "\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"); - } else { - record.state = "failed"; - record.error = safeError4("activation-failed", "\u4F01\u4E1A\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u5B89\u5168\u4FDD\u5B58\u63A5\u5165\u914D\u7F6E\u3002"); - this.#logger.error?.("[dsh-im:wecom] provisioning failed"); - } - } finally { - this.#finishAttempt(record); - } - } - async #activateBot(record, { remoteBotId, secret }) { - const identity = deriveWecomBotIdentity(remoteBotId); - const previousConfig = this.#configStore.getByRemoteBotId(remoteBotId); - const previousSecret = await this.#credentials.resolve(identity.secretRef).catch(() => void 0); - const config = { - botId: identity.botId, - remoteBotId, - secretRef: identity.secretRef, - createdAt: previousConfig?.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(), - connectedAt: (/* @__PURE__ */ new Date()).toISOString() - }; - return this.#withBotTransition(identity.botId, async () => { - await this.#credentials.set(identity.secretRef, secret); - try { - if (record.controller.signal.aborted) throw new DOMException("Cancelled", "AbortError"); - await this.#configStore.save(config); - } catch (error) { - await this.#restoreCredential(identity.secretRef, previousSecret); - throw error; - } - try { - if (record.controller.signal.aborted) throw new DOMException("Cancelled", "AbortError"); - await this.#startRuntime(config, secret); - this.#errors.delete(identity.botId); - } catch (error) { - if (record.controller.signal.aborted) { - await this.#stopRuntime(identity.botId); - if (previousConfig) await this.#configStore.save(previousConfig).catch(() => void 0); - else await this.#configStore.remove(identity.botId).catch(() => void 0); - await this.#restoreCredential(identity.secretRef, previousSecret); - throw error; - } - this.#errors.set(identity.botId, safeError4("connection-failed", "\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002")); - this.#logger.warn?.(`[dsh-im:wecom] bot ${identity.botId} activation connection failed`); - } - this.#touch(); - return identity.botId; - }); - } - async #startRuntime(config, secret) { - if (this.#closed) throw new Error("Enterprise WeChat controller is closed"); - await this.#stopRuntime(config.botId); - if (this.#closed) throw new Error("Enterprise WeChat controller is closed"); - const runtime = await this.#createRuntime({ botId: config.botId, config, secret }); - if (!runtime || typeof runtime.start !== "function" || typeof runtime.stop !== "function") { - throw new TypeError("createRuntime returned an invalid Enterprise WeChat runtime"); - } - this.#runtimes.set(config.botId, runtime); - try { - await runtime.start(); - } catch (error) { - await runtime.stop().catch(() => void 0); - this.#runtimes.delete(config.botId); - throw error; - } - } - async #stopRuntime(botId) { - const runtime = this.#runtimes.get(botId); - this.#runtimes.delete(botId); - await runtime?.stop().catch((error) => { - this.#logger.warn?.(`[dsh-im:wecom] bot ${botId} failed to stop cleanly:`, error); - }); - } - async #resolveSecret(ref) { - const result = await this.#credentials.resolve(ref).catch(() => void 0); - return cleanString13(result?.value); - } - async #restoreCredential(ref, previous) { - if (previous?.value) await this.#credentials.set(ref, previous.value).catch(() => void 0); - else await this.#credentials.unset(ref).catch(() => void 0); - } - #withBotTransition(botId, operation) { - const previous = this.#transitions.get(botId) ?? Promise.resolve(); - const current = previous.catch(() => void 0).then(operation); - const settled = current.finally(() => { - if (this.#transitions.get(botId) === settled) this.#transitions.delete(botId); - }); - this.#transitions.set(botId, settled); - return settled; - } - #finishAttempt(record) { - record.scode = null; - record.verificationUrl = null; - record.expiresAt = null; - if (this.#activeAttemptId === record.id) this.#activeAttemptId = null; - this.#touch(); - const terminal = [...this.#attempts.values()].filter((attempt) => TERMINAL_ATTEMPT_STATES3.has(attempt.state)); - while (terminal.length > 16) this.#attempts.delete(terminal.shift().id); - } - #touch() { - this.#revision += 1; - } -}; - -// src/channels/wecom/wecom-runtime.mjs -import { WSAuthFailureError, WSClient, WSReconnectExhaustedError } from "@wecom/aibot-node-sdk"; - -// src/channels/wecom/wecom-bridge.mjs -import { generateReqId } from "@wecom/aibot-node-sdk"; -var HELP_TEXT4 = [ - "\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002", - "", - "\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002", - "/new \u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD", - "/status \u68C0\u67E5\u8FDE\u63A5\u72B6\u6001", - "/help \u663E\u793A\u672C\u5E2E\u52A9" -].join("\n"); -var MAX_REPLY_BYTES = 18e3; -function bodyOf(frame) { - return frame?.body && typeof frame.body === "object" ? frame.body : {}; -} -function conversationKey4(frame) { - const body = bodyOf(frame); - return body.chattype === "group" ? `group:${body.chatid}` : `direct:${body.from?.userid}`; -} -function messageText2(frame) { - const body = bodyOf(frame); - if (body.msgtype === "text") return typeof body.text?.content === "string" ? body.text.content.trim() : ""; - if (body.msgtype === "voice") return typeof body.voice?.content === "string" ? body.voice.content.trim() : ""; - if (body.msgtype === "mixed" && Array.isArray(body.mixed?.msg_item)) { - return body.mixed.msg_item.filter((item) => item?.msgtype === "text" && typeof item.text?.content === "string").map((item) => item.text.content).join("\n").trim(); - } - return ""; -} -function splitUtf8(text, maxBytes = MAX_REPLY_BYTES) { - const source = String(text ?? "").trim(); - if (!source) return []; - const chunks = []; - let current = ""; - let bytes = 0; - for (const character of source) { - const size = Buffer.byteLength(character); - if (current && bytes + size > maxBytes) { - chunks.push(current); - current = character; - bytes = size; - } else { - current += character; - bytes += size; - } - } - if (current) chunks.push(current); - return chunks; -} -function progressText2(update) { - if (update?.type === "text") return update.text; - if (update?.type === "tool") return `\u6B63\u5728\u4F7F\u7528${update.name}\u2026`; - return update?.text; -} -function createWecomBridgeStatus() { - return { - messagesReceived: 0, - messagesReplied: 0, - messagesRejected: 0, - lastMessageAt: null, - lastReplyAt: null, - lastRejectedAt: null, - lastError: null - }; -} -var WecomHarnessBridge = class { - #client; - #harness; - #state; - #status; - #logger; - #replyTimeoutMs; - #generateReqId; - #queues = /* @__PURE__ */ new Map(); - constructor({ - client, - harness, - state, - status = createWecomBridgeStatus(), - logger = console, - replyTimeoutMs = 6e5, - generateStreamId = generateReqId - }) { - if (!client || typeof client.replyStream !== "function" || typeof client.sendMessage !== "function") { - throw new TypeError("Enterprise WeChat client is required"); - } - if (!harness || !state) throw new TypeError("Harness client and state store are required"); - this.#client = client; - this.#harness = harness; - this.#state = state; - this.#status = status; - this.#logger = logger; - this.#replyTimeoutMs = replyTimeoutMs; - this.#generateReqId = generateStreamId; - } - get status() { - return structuredClone(this.#status); - } - accept(frame) { - const key = conversationKey4(frame); - const previous = this.#queues.get(key) ?? Promise.resolve(); - const current = previous.catch(() => void 0).then(() => this.#process(frame)).finally(() => { - if (this.#queues.get(key) === current) this.#queues.delete(key); - }); - this.#queues.set(key, current); - return current; - } - async waitForIdle() { - await Promise.allSettled([...this.#queues.values()]); - } - async #sendActive(chatId, text) { - for (const chunk of splitUtf8(text)) { - await this.#client.sendMessage(chatId, { msgtype: "markdown", markdown: { content: chunk } }); - } - } - async #sendImmediate(frame, chatId, text) { - const chunks = splitUtf8(text); - if (chunks.length === 0) return; - try { - await this.#client.replyStream(frame, this.#generateReqId("stream"), chunks[0], true); - for (const chunk of chunks.slice(1)) { - await this.#client.sendMessage(chatId, { msgtype: "markdown", markdown: { content: chunk } }); - } - } catch { - await this.#sendActive(chatId, text); - } - } - async #process(frame) { - const body = bodyOf(frame); - const messageId = typeof body.msgid === "string" ? body.msgid : ""; - const senderId = typeof body.from?.userid === "string" ? body.from.userid : ""; - const chatId = body.chattype === "group" ? body.chatid : senderId; - if (!messageId || !senderId || !chatId || !["single", "group"].includes(body.chattype)) return; - if (this.#state.hasSeen(messageId)) return; - this.#status.messagesReceived += 1; - this.#status.lastMessageAt = (/* @__PURE__ */ new Date()).toISOString(); - const text = messageText2(frame); - let streamId = null; - let streamStarted = false; - try { - if (!text) { - await this.#sendImmediate(frame, chatId, "\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u8BED\u97F3\u8F6C\u5199\u548C\u56FE\u6587\u6DF7\u6392\u4E2D\u7684\u6587\u5B57\u6D88\u606F\u3002"); - await this.#state.markSeen(messageId); - return; - } - const command = text.toLowerCase(); - if (command === "/help") { - await this.#sendImmediate(frame, chatId, HELP_TEXT4); - await this.#state.markSeen(messageId); - return; - } - if (command === "/status") { - await this.#harness.ensureRunning(); - await this.#sendImmediate(frame, chatId, "\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002"); - await this.#state.markSeen(messageId); - return; - } - const key = conversationKey4(frame); - if (command === "/new") { - await this.#state.clearSession(key); - await this.#sendImmediate(frame, chatId, "\u5DF2\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002\u8BF7\u53D1\u9001\u4F60\u7684\u95EE\u9898\u3002"); - await this.#state.markSeen(messageId); - return; - } - let sessionId = this.#state.sessionFor(key); - if (!sessionId || !await this.#harness.sessionExists(sessionId)) { - sessionId = await this.#harness.createSession(); - await this.#state.setSession(key, sessionId); - } - streamId = this.#generateReqId("stream"); - try { - await this.#client.replyStream(frame, streamId, "\u6B63\u5728\u601D\u8003\u4E2D\u2026", false); - streamStarted = true; - } catch (error) { - this.#logger.warn?.("[dsh-im:wecom] unable to start a stream; using an active reply:", error); - } - const answer = await this.#harness.ask(sessionId, text, { - timeoutMs: this.#replyTimeoutMs, - onUpdate: streamStarted && typeof this.#client.replyStreamNonBlocking === "function" ? async (update) => { - const progress = splitUtf8(progressText2(update))[0]; - if (progress) await this.#client.replyStreamNonBlocking(frame, streamId, progress, false); - } : void 0 - }); - const chunks = splitUtf8(answer || "\u4EFB\u52A1\u5DF2\u5B8C\u6210\uFF0C\u4F46\u6CA1\u6709\u751F\u6210\u53EF\u663E\u793A\u7684\u6587\u672C\u3002"); - let finalSent = false; - if (streamStarted && chunks.length > 0) { - try { - await this.#client.replyStream(frame, streamId, chunks[0], true); - for (const chunk of chunks.slice(1)) { - await this.#client.sendMessage(chatId, { msgtype: "markdown", markdown: { content: chunk } }); - } - finalSent = true; - } catch (error) { - this.#logger.warn?.("[dsh-im:wecom] stream finalization failed; using an active reply:", error); - } - } - if (!finalSent) await this.#sendActive(chatId, answer); - await this.#state.markSeen(messageId); - this.#status.messagesReplied += 1; - this.#status.lastReplyAt = (/* @__PURE__ */ new Date()).toISOString(); - this.#status.lastError = null; - } catch (error) { - this.#status.lastError = error?.message ?? String(error); - this.#logger.error?.("[dsh-im:wecom] failed to process an inbound message"); - try { - if (streamStarted && streamId) { - await this.#client.replyStream(frame, streamId, "\u6D88\u606F\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002", true); - } else { - await this.#sendImmediate(frame, chatId, "\u6D88\u606F\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"); - } - await this.#state.markSeen(messageId); - } catch { - this.#logger.error?.("[dsh-im:wecom] failed to send the safe error reply"); - } - } - } -}; - -// src/channels/wecom/wecom-runtime.mjs -function timeoutError2() { - const error = new Error("Enterprise WeChat WebSocket authentication timed out"); - error.code = "connect-timeout"; - return error; -} -function createWecomRuntimeStatus() { - return { - startedAt: null, - ready: false, - wecomConnectionState: "idle", - harnessReachable: false, - lastCheckedAt: null, - lastConnectedAt: null, - lastError: null, - ...createWecomBridgeStatus() - }; -} -var WecomRuntime = class { - #config; - #secret; - #harness; - #state; - #logger; - #replyTimeoutMs; - #connectTimeoutMs; - #maxReconnectAttempts; - #createClient; - #status = createWecomRuntimeStatus(); - #client = null; - #bridge = null; - #starting = null; - #startController = null; - constructor({ - config, - secret, - harness, - state, - logger = console, - replyTimeoutMs = 6e5, - connectTimeoutMs = 2e4, - maxReconnectAttempts = 10, - createClient = (options) => new WSClient(options) - }) { - if (!config || !secret || !harness || !state) { - throw new TypeError("WecomRuntime requires config, secret, Harness, and state"); - } - this.#config = config; - this.#secret = secret; - this.#harness = harness; - this.#state = state; - this.#logger = logger; - this.#replyTimeoutMs = replyTimeoutMs; - this.#connectTimeoutMs = connectTimeoutMs; - this.#maxReconnectAttempts = maxReconnectAttempts; - this.#createClient = createClient; - } - get status() { - return structuredClone(this.#status); - } - async start() { - if (this.#status.ready && this.#client) return this.status; - if (this.#starting) return this.#starting; - const controller = new AbortController(); - this.#startController = controller; - this.#starting = this.#start(controller.signal).finally(() => { - if (this.#startController === controller) this.#startController = null; - this.#starting = null; - }); - return this.#starting; - } - async #start(signal) { - await this.#stopActive(); - signal.throwIfAborted(); - this.#status.startedAt = (/* @__PURE__ */ new Date()).toISOString(); - this.#status.wecomConnectionState = "connecting"; - this.#status.lastError = null; - await this.#harness.ensureRunning(); - this.#status.harnessReachable = true; - const silentSdkLogger = { debug() { - }, info() { - }, warn() { - }, error() { - } }; - const client = this.#createClient({ - botId: this.#config.remoteBotId, - secret: this.#secret, - logger: silentSdkLogger, - maxReconnectAttempts: this.#maxReconnectAttempts - }); - if (!client || typeof client.connect !== "function" || typeof client.disconnect !== "function") { - throw new TypeError("Enterprise WeChat client factory returned an invalid client"); - } - this.#client = client; - this.#bridge = new WecomHarnessBridge({ - client, - harness: this.#harness, - state: this.#state, - status: this.#status, - logger: this.#logger, - replyTimeoutMs: this.#replyTimeoutMs - }); - let readyResolve; - let readyReject; - let authenticated = false; - const ready = new Promise((resolve7, reject) => { - readyResolve = resolve7; - readyReject = reject; - }); - const onAuthenticated = () => { - if (this.#client !== client || signal.aborted) return; - authenticated = true; - const now = Date.now(); - this.#status.ready = true; - this.#status.wecomConnectionState = "connected"; - this.#status.lastCheckedAt = now; - this.#status.lastConnectedAt = now; - this.#status.lastError = null; - readyResolve(); - }; - const onDisconnected = () => { - if (this.#client !== client) return; - this.#status.ready = false; - this.#status.wecomConnectionState = "connecting"; - this.#status.lastCheckedAt = Date.now(); - }; - const onReconnecting = () => { - if (this.#client !== client) return; - this.#status.ready = false; - this.#status.wecomConnectionState = "connecting"; - this.#status.lastCheckedAt = Date.now(); - }; - const onError = (error) => { - if (this.#client !== client) return; - const terminal = error instanceof WSAuthFailureError || error instanceof WSReconnectExhaustedError; - if (!authenticated && terminal) readyReject(error); - if (terminal) { - this.#status.ready = false; - this.#status.wecomConnectionState = "failed"; - } - this.#status.lastError = terminal ? error.name : "connection-error"; - this.#logger.warn?.(`[dsh-im:wecom] bot ${this.#config.botId} connection error`); - }; - const onMessage = (frame) => this.#bridge?.accept(frame); - client.on("authenticated", onAuthenticated); - client.on("disconnected", onDisconnected); - client.on("reconnecting", onReconnecting); - client.on("error", onError); - client.on("message", onMessage); - let timer; - try { - client.connect(); - await Promise.race([ - ready, - new Promise((_, reject) => { - signal.addEventListener("abort", () => reject(signal.reason), { once: true }); - }), - new Promise((_, reject) => { - timer = setTimeout(() => reject(timeoutError2()), this.#connectTimeoutMs); - }) - ]); - return this.status; - } catch (error) { - if (signal.aborted) { - await this.#stopActive(); - throw error; - } - this.#status.ready = false; - this.#status.wecomConnectionState = "failed"; - this.#status.lastError = error?.message ?? String(error); - await this.#stopActive(); - throw error; - } finally { - clearTimeout(timer); - } - } - async stop() { - const starting = this.#starting; - this.#startController?.abort(new DOMException("Enterprise WeChat runtime stopped", "AbortError")); - await this.#stopActive(); - await starting?.catch(() => void 0); - return this.status; - } - async #stopActive() { - const client = this.#client; - const bridge = this.#bridge; - this.#client = null; - this.#bridge = null; - try { - client?.disconnect(); - client?.removeAllListeners?.(); - } catch (error) { - this.#logger.warn?.(`[dsh-im:wecom] bot ${this.#config.botId} failed to stop cleanly`); - } - await bridge?.waitForIdle(); - this.#status.ready = false; - this.#status.wecomConnectionState = "idle"; - } -}; - -// plugin-src/host/channels/wecom/connection-supervisor.mjs -var DEFAULT_RETRY_DELAYS_MS5 = Object.freeze([250, 1e3, 3e3, 5e3, 1e4, 3e4]); -function retryDelays4(value) { - if (!Array.isArray(value) || value.length === 0) return [...DEFAULT_RETRY_DELAYS_MS5]; - const valid = value.filter((delay3) => Number.isFinite(delay3) && delay3 >= 0); - return valid.length > 0 ? valid : [...DEFAULT_RETRY_DELAYS_MS5]; -} -var ConnectionSupervisor4 = class { - #controller; - #harness; - #logger; - #retryDelays; - #healthyIntervalMs; - #setTimeout; - #clearTimeout; - #timer = null; - #running = null; - #retryIndex = 0; - #closed = false; - #started = false; - #ready; - #resolveReady; - constructor({ - controller, - harness, - logger = console, - retryDelaysMs, - healthyIntervalMs = 15e3, - setTimeoutImpl = setTimeout, - clearTimeoutImpl = clearTimeout - }) { - if (!controller || typeof controller.initialize !== "function" || typeof controller.status !== "function") { - throw new TypeError("ConnectionSupervisor requires a controller"); - } - if (!harness || typeof harness.ensureRunning !== "function") { - throw new TypeError("ConnectionSupervisor requires a Harness client"); - } - this.#controller = controller; - this.#harness = harness; - this.#logger = logger; - this.#retryDelays = retryDelays4(retryDelaysMs); - this.#healthyIntervalMs = Number.isFinite(healthyIntervalMs) && healthyIntervalMs >= 0 ? healthyIntervalMs : 15e3; - this.#setTimeout = setTimeoutImpl; - this.#clearTimeout = clearTimeoutImpl; - this.#ready = new Promise((resolve7) => { - this.#resolveReady = resolve7; - }); - } - get ready() { - return this.#ready; - } - start() { - if (this.#started || this.#closed) return this; - this.#started = true; - this.#schedule(0); - return this; - } - async close() { - if (this.#closed) return; - this.#closed = true; - if (this.#timer !== null) this.#clearTimeout(this.#timer); - this.#timer = null; - await this.#running?.catch(() => void 0); - this.#resolveReady?.(null); - this.#resolveReady = null; - } - #schedule(delayMs) { - if (this.#closed) return; - this.#timer = this.#setTimeout(() => { - this.#timer = null; - void this.#run(); - }, delayMs); - this.#timer?.unref?.(); - } - async #run() { - if (this.#closed || this.#running) return; - const operation = this.#reconcile(); - this.#running = operation; - try { - await operation; - } finally { - if (this.#running === operation) this.#running = null; - } - } - async #reconcile() { - try { - await this.#harness.ensureRunning(); - if (this.#closed) return; - const status = await this.#controller.initialize(); - if (this.#closed) return; - this.#resolveReady?.(status); - this.#resolveReady = null; - const { configured, connected } = status.totals; - if (connected < configured) { - const delay3 = this.#retryDelays[Math.min(this.#retryIndex, this.#retryDelays.length - 1)]; - this.#retryIndex += 1; - this.#logger.warn?.(`[dsh-im:wecom] ${connected}/${configured} bots connected; retrying in ${delay3}ms`); - this.#schedule(delay3); - return; - } - this.#retryIndex = 0; - this.#schedule(this.#healthyIntervalMs); - } catch (error) { - if (this.#closed) return; - const delay3 = this.#retryDelays[Math.min(this.#retryIndex, this.#retryDelays.length - 1)]; - this.#retryIndex += 1; - this.#logger.warn?.(`[dsh-im:wecom] connection reconciliation failed; retrying in ${delay3}ms`, error); - this.#schedule(delay3); - } - } -}; -function createConnectionSupervisor4(options) { - return new ConnectionSupervisor4(options); -} - -// plugin-src/host/channels/wecom/production.mjs -function harnessOrigin5(webServer, configured) { - if (configured !== void 0) return new URL(configured); - const port = webServer?.port; - if (!Number.isInteger(port) || port < 1 || port > 65535) { - throw new Error("dsh-im Enterprise WeChat requires an initialized DSH webServer port"); - } - return new URL(`http://127.0.0.1:${port}`); -} -function pluginPaths5(config) { - const dshHome = resolve5(config.dshHome ?? process.env.DSH_HOME ?? join5(homedir5(), ".dsh")); - const root = resolve5(config.dataDir ?? join5(dshHome, "integrations", "dsh-wecom")); - return { - config: resolve5(config.configPath ?? join5(root, "config.json")), - bots: resolve5(config.botsDir ?? join5(root, "bots")) - }; -} -async function createProductionController6(ctx, config = {}, internals = {}) { - if (!ctx?.credentials) throw new TypeError("dsh-im Enterprise WeChat requires ctx.credentials"); - if (!ctx?.webServer) throw new TypeError("dsh-im Enterprise WeChat requires ctx.webServer"); - const ConfigStore = internals.ConfigStore ?? WecomConfigStore; - const StateStore2 = internals.StateStore ?? WecomStateStore; - const Harness = internals.HarnessClient ?? WecomHarnessClient; - const Controller = internals.Controller ?? WecomController; - const Runtime = internals.Runtime ?? WecomRuntime; - const QrAuth = internals.QrAuth ?? WecomQrAuth; - const createSupervisor = internals.createConnectionSupervisor ?? createConnectionSupervisor4; - const logger = typeof ctx.logger === "function" ? ctx.logger("dsh-im:wecom") : ctx.logger ?? console; - const paths = pluginPaths5(config); - const configStore = await new ConfigStore(paths.config).load(); - const qrAuth = internals.qrAuth ?? new QrAuth({ - source: config.qrSource ?? "deepseek-harness", - platform: config.qrPlatform - }); - const stateStores = /* @__PURE__ */ new Map(); - const statePath = (botId) => resolve5(paths.bots, botId, "state.json"); - const stateFor = async (botId) => { - let state = stateStores.get(botId); - if (!state) { - state = await new StateStore2(statePath(botId)).load(); - stateStores.set(botId, state); - } - return state; - }; - const harness = new Harness({ - baseUrl: harnessOrigin5(ctx.webServer, config.harnessBaseUrl), - workspace: resolve5(config.workspace ?? process.cwd()), - agentPreset: config.agentPreset ?? "standard", - autostart: false, - dshBin: config.dshBin ?? "dsh" - }); - const controller = new Controller({ - qrAuth, - credentials: ctx.credentials, - configStore, - logger, - createRuntime: async ({ botId, config: botConfig, secret }) => new Runtime({ - config: botConfig, - secret, - harness, - state: await stateFor(botId), - replyTimeoutMs: config.replyTimeoutMs ?? 6e5, - connectTimeoutMs: config.connectTimeoutMs ?? 2e4, - maxReconnectAttempts: config.maxReconnectAttempts ?? 10, - logger: { - error: (...args) => logger.error?.(`[${botId}]`, ...args), - warn: (...args) => logger.warn?.(`[${botId}]`, ...args), - info: (...args) => logger.info?.(`[${botId}]`, ...args), - debug: (...args) => logger.debug?.(`[${botId}]`, ...args) - } - }), - deleteState: async ({ botId }) => { - const state = stateStores.get(botId); - stateStores.delete(botId); - if (state && typeof state.remove === "function") return state.remove(); - try { - await unlink14(statePath(botId)); - } catch (error) { - if (error?.code !== "ENOENT") throw error; - } - } - }); - const supervisor = createSupervisor({ - controller, - harness, - logger, - retryDelaysMs: config.retryDelaysMs, - healthyIntervalMs: config.healthyIntervalMs - }).start(); - return { - controller, - ready: supervisor.ready, - async close() { - await supervisor.close(); - await controller.close(); - harness.stopManagedProcess(); - } - }; -} - -// plugin-src/host/channels/wecom/rpc.mjs -import QRCode4 from "qrcode"; -var WECOM_RPC_CHANNEL = "/wecom"; -var WECOM_ENDPOINTS = Object.freeze({ - status: "connection.status", - beginProvisioning: "provision.begin", - pollProvisioning: "provision.poll", - cancelProvisioning: "provision.cancel", - bindCredentials: "bot.bind-credentials", - reconnectBot: "bot.reconnect", - deleteBot: "bot.delete" -}); -var WECOM_RPC_ENDPOINTS = Object.freeze(Object.values(WECOM_ENDPOINTS)); -var FORBIDDEN_PUBLIC_KEYS4 = /* @__PURE__ */ new Set([ - "secret", - "secretRef", - "scode", - "remoteBotId", - "verificationUrl", - "bot_info", - "botid" -]); -function isRecord4(value) { - return value !== null && typeof value === "object" && !Array.isArray(value); -} -function exactKeys4(value, allowed) { - return isRecord4(value) && Object.keys(value).every((key) => allowed.includes(key)); -} -function validId4(value) { - return typeof value === "string" && /^[A-Za-z0-9_-]{1,128}$/.test(value); -} -function validCredential4(value, maxLength) { - return typeof value === "string" && value.trim().length > 0 && value.length <= maxLength; -} -function payloadFailure4(endpoint, payload) { - if (!isRecord4(payload)) return "Payload must be an object."; - if (endpoint === WECOM_ENDPOINTS.status) return exactKeys4(payload, []) ? null : "connection.status does not accept fields."; - if (endpoint === WECOM_ENDPOINTS.beginProvisioning) { - return exactKeys4(payload, ["locale"]) && (payload.locale === void 0 || payload.locale === "zh-CN") ? null : "provision.begin received unsupported fields."; - } - if ([WECOM_ENDPOINTS.pollProvisioning, WECOM_ENDPOINTS.cancelProvisioning].includes(endpoint)) { - return exactKeys4(payload, ["attemptId"]) && validId4(payload.attemptId) ? null : `${endpoint} requires an attemptId.`; - } - if (endpoint === WECOM_ENDPOINTS.bindCredentials) { - return exactKeys4(payload, ["botId", "secret"]) && validCredential4(payload.botId, 512) && validCredential4(payload.secret, 1024) ? null : "bot.bind-credentials requires Bot ID and Secret."; - } - if (endpoint === WECOM_ENDPOINTS.reconnectBot) { - return exactKeys4(payload, ["botId"]) && validId4(payload.botId) ? null : "bot.reconnect requires a botId."; - } - if (endpoint === WECOM_ENDPOINTS.deleteBot) { - return exactKeys4(payload, ["botId", "confirm"]) && validId4(payload.botId) && payload.confirm === true ? null : "bot.delete requires a botId and confirm=true."; - } - return "Unknown Enterprise WeChat endpoint."; -} -function sanitizePublic4(value) { - if (Array.isArray(value)) return value.map(sanitizePublic4); - if (!isRecord4(value)) return value; - const safe = {}; - for (const [key, child] of Object.entries(value)) { - if (!FORBIDDEN_PUBLIC_KEYS4.has(key)) safe[key] = sanitizePublic4(child); - } - return safe; -} -async function qrDataUrl3(value) { - return QRCode4.toDataURL(value, { - type: "image/png", - errorCorrectionLevel: "M", - margin: 2, - width: 320 - }); -} -async function withEncodedQr3(value, encodeQr) { - if (!value || typeof value.verificationUrl !== "string") return sanitizePublic4(value); - return sanitizePublic4({ ...value, qrCodeDataUrl: await encodeQr(value.verificationUrl) }); -} -async function publicStatus3(status, encodeQr) { - const value = structuredClone(status); - if (value?.provisioning) value.provisioning = await withEncodedQr3(value.provisioning, encodeQr); - return sanitizePublic4(value); -} -function createWecomRpcHandler(controller, { encodeQr = qrDataUrl3 } = {}) { - for (const method of ["status", "startProvisioning", "registrationStatus", "cancelProvisioning", "bindCredentials", "reconnectBot", "deleteBot"]) { - if (typeof controller?.[method] !== "function") { - throw new TypeError(`A complete Enterprise WeChat controller is required (${method})`); - } - } - const qrCache = /* @__PURE__ */ new Map(); - const cachedEncode = (url) => { - let encoded = qrCache.get(url); - if (!encoded) { - if (qrCache.size >= 16) qrCache.delete(qrCache.keys().next().value); - encoded = Promise.resolve().then(() => encodeQr(url)); - qrCache.set(url, encoded); - } - return encoded; - }; - return async (endpoint, payload, signal) => { - if (signal?.aborted) return { ok: false, error: { code: "cancelled", message: "The request was cancelled." } }; - if (!WECOM_RPC_ENDPOINTS.includes(endpoint)) { - return { ok: false, error: { code: "bad-request", message: "Unknown Enterprise WeChat endpoint." } }; - } - const invalid = payloadFailure4(endpoint, payload); - if (invalid) return { ok: false, error: { code: "bad-request", message: invalid } }; - try { - let value; - if (endpoint === WECOM_ENDPOINTS.status) value = await publicStatus3(await controller.status(), cachedEncode); - else if (endpoint === WECOM_ENDPOINTS.beginProvisioning) { - value = await withEncodedQr3(await controller.startProvisioning(), cachedEncode); - } else if (endpoint === WECOM_ENDPOINTS.pollProvisioning) { - const current = await controller.registrationStatus(payload.attemptId); - if (!current) return { ok: false, error: { code: "bad-request", message: "The provisioning attempt no longer exists." } }; - value = await withEncodedQr3(current, cachedEncode); - } else if (endpoint === WECOM_ENDPOINTS.cancelProvisioning) { - value = sanitizePublic4(await controller.cancelProvisioning(payload.attemptId)); - } else if (endpoint === WECOM_ENDPOINTS.bindCredentials) { - value = await publicStatus3(await controller.bindCredentials(payload), cachedEncode); - } else if (endpoint === WECOM_ENDPOINTS.reconnectBot) { - value = await publicStatus3(await controller.reconnectBot(payload.botId), cachedEncode); - } else { - value = await publicStatus3(await controller.deleteBot(payload.botId), cachedEncode); - } - return signal?.aborted ? { ok: false, error: { code: "cancelled", message: "The request was cancelled." } } : { ok: true, value }; - } catch { - return signal?.aborted ? { ok: false, error: { code: "cancelled", message: "The request was cancelled." } } : { ok: false, error: { code: "wecom-operation-failed", message: "\u4F01\u4E1A\u5FAE\u4FE1\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002" } }; - } - }; -} -function installWecomRpc(ctx, controller, options, authority) { - if (!ctx?.connection?.rpc || typeof ctx.connection.rpc.handle !== "function") { - throw new TypeError("DSH Host Connection RPC is required"); - } - return ctx.connection.rpc.handle( - WECOM_RPC_CHANNEL, - createWecomRpcHandler(controller, options), - { authority: resolveRpcAuthority(authority) } - ); -} - -// plugin-src/host/channels/wecom/index.mjs -async function apply6(ctx, config = {}) { - if (config?.controller) { - return installWecomRpc(ctx, config.controller, config.rpcOptions, config.rpcAuthority); - } - const production = await createProductionController6(ctx, config, config.internals); - const disposeRpc = installWecomRpc( - ctx, - production.controller, - config.rpcOptions, - config.rpcAuthority - ); - ctx.effect(() => async () => production.close(), "dsh-im: close Enterprise WeChat bot connections"); - return disposeRpc; -} - -// plugin-src/host/channels/weixin/production.mjs -import { unlink as unlink17 } from "node:fs/promises"; -import { homedir as homedir6 } from "node:os"; -import { join as join6, resolve as resolve6 } from "node:path"; - -// src/channels/weixin/config-store.mjs -import { createHash as createHash6 } from "node:crypto"; -import { mkdir as mkdir11, readFile as readFile11, rename as rename11, unlink as unlink15, writeFile as writeFile11 } from "node:fs/promises"; -import { dirname as dirname11 } from "node:path"; - -// src/channels/weixin/weixin-api.mjs -import { randomBytes, randomUUID as randomUUID11 } from "node:crypto"; -var WEIXIN_QR_BASE_URL = "https://ilinkai.weixin.qq.com/"; -var WEIXIN_PROTOCOL_VERSION = "2.4.6"; -var DEFAULT_BOT_TYPE = "3"; -var ILINK_APP_ID = "bot"; -var ILINK_CLIENT_VERSION = 2 << 16 | 4 << 8 | 6; -var DEFAULT_TIMEOUT_MS2 = 15e3; -var DEFAULT_LONG_POLL_TIMEOUT_MS = 35e3; -var LOGIN_STATUSES = /* @__PURE__ */ new Set([ - "wait", - "scaned", - "confirmed", - "expired", - "scaned_but_redirect", - "need_verifycode", - "verify_code_blocked", - "binded_redirect" -]); -var WeixinApiError = class extends Error { - constructor(code, message, options = {}) { - super(message, options); - this.name = "WeixinApiError"; - this.code = code; - this.status = options.status; - } -}; -function nonEmptyString5(value) { - return typeof value === "string" && value.trim() ? value.trim() : null; -} -function isWeixinHost(hostname) { - const normalized = hostname.toLowerCase().replace(/\.$/, ""); - return normalized === "weixin.qq.com" || normalized.endsWith(".weixin.qq.com"); -} -function normalizeWeixinApiBaseUrl(value) { - let url; - try { - url = new URL(value); - } catch { - throw new WeixinApiError("invalid-base-url", "\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u8FDE\u63A5\u5730\u5740\u3002"); - } - if (url.protocol !== "https:" || !isWeixinHost(url.hostname) || url.port !== "" && url.port !== "443") { - throw new WeixinApiError("untrusted-base-url", "\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u53D7\u4FE1\u4EFB\u7684\u8FDE\u63A5\u5730\u5740\u3002"); - } - url.username = ""; - url.password = ""; - url.search = ""; - url.hash = ""; - if (!url.pathname.endsWith("/")) url.pathname += "/"; - return url.toString(); -} -function normalizeWeixinQrUrl(value) { - const text = nonEmptyString5(value); - if (!text) throw new WeixinApiError("invalid-qr", "\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u626B\u7801\u5730\u5740\u3002"); - let url; - try { - url = new URL(text); - } catch { - throw new WeixinApiError("invalid-qr", "\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u626B\u7801\u5730\u5740\u3002"); - } - if (url.protocol !== "https:" || !isWeixinHost(url.hostname)) { - throw new WeixinApiError("untrusted-qr", "\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u53D7\u4FE1\u4EFB\u7684\u626B\u7801\u5730\u5740\u3002"); - } - return url.toString(); -} -function commonHeaders() { - return { - "iLink-App-Id": ILINK_APP_ID, - "iLink-App-ClientVersion": String(ILINK_CLIENT_VERSION) - }; -} -function authenticatedHeaders(token) { - const headers = { - ...commonHeaders(), - "content-type": "application/json", - AuthorizationType: "ilink_bot_token", - "X-WECHAT-UIN": Buffer.from(String(randomBytes(4).readUInt32BE(0)), "utf8").toString("base64") - }; - if (nonEmptyString5(token)) headers.Authorization = `Bearer ${token.trim()}`; - return headers; -} -function baseInfo() { - return { - channel_version: WEIXIN_PROTOCOL_VERSION, - bot_agent: "DeepSeekHarness/0.1.0" - }; -} -function abortError3(signal) { - if (signal?.reason instanceof Error) return signal.reason; - return new DOMException("The operation was aborted", "AbortError"); -} -async function requestJson3(fetchImpl, { - method, - baseUrl, - endpoint, - body, - token, - timeoutMs = DEFAULT_TIMEOUT_MS2, - signal, - authenticated = true -}) { - const trustedBase = normalizeWeixinApiBaseUrl(baseUrl); - const url = new URL(endpoint, trustedBase); - if (!isWeixinHost(url.hostname)) { - throw new WeixinApiError("untrusted-endpoint", "\u62D2\u7EDD\u8BBF\u95EE\u4E0D\u53D7\u4FE1\u4EFB\u7684\u5FAE\u4FE1\u670D\u52A1\u5730\u5740\u3002"); - } - const controller = new AbortController(); - let timedOut = false; - const onAbort = () => controller.abort(signal?.reason); - if (signal?.aborted) throw abortError3(signal); - signal?.addEventListener("abort", onAbort, { once: true }); - const timer = timeoutMs > 0 ? setTimeout(() => { - timedOut = true; - controller.abort(); - }, timeoutMs) : null; - try { - const response = await fetchImpl(url, { - method, - headers: authenticated ? authenticatedHeaders(token) : commonHeaders(), - ...body === void 0 ? {} : { body: JSON.stringify(body) }, - signal: controller.signal - }); - if (!response.ok) { - throw new WeixinApiError( - "http-error", - `\u5FAE\u4FE1\u670D\u52A1\u8BF7\u6C42\u5931\u8D25\uFF08HTTP ${response.status}\uFF09\u3002`, - { status: response.status } - ); - } - try { - return await response.json(); - } catch (error) { - throw new WeixinApiError("invalid-response", "\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u89E3\u6790\u7684\u54CD\u5E94\u3002", { cause: error }); - } - } catch (error) { - if (signal?.aborted) throw abortError3(signal); - if (timedOut) { - throw new WeixinApiError("timeout", "\u5FAE\u4FE1\u670D\u52A1\u8BF7\u6C42\u8D85\u65F6\u3002", { cause: error }); - } - if (error instanceof WeixinApiError) throw error; - throw new WeixinApiError("network-error", "\u6682\u65F6\u65E0\u6CD5\u8BBF\u95EE\u5FAE\u4FE1\u670D\u52A1\u3002", { cause: error }); - } finally { - if (timer) clearTimeout(timer); - signal?.removeEventListener("abort", onAbort); - } -} -function validateLoginResponse(value) { - if (!value || typeof value !== "object" || !LOGIN_STATUSES.has(value.status)) { - throw new WeixinApiError("invalid-login-status", "\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u626B\u7801\u72B6\u6001\u3002"); - } - return value; -} -function createWeixinApi({ fetchImpl = fetch } = {}) { - if (typeof fetchImpl !== "function") throw new TypeError("fetchImpl must be a function"); - return Object.freeze({ - async beginLogin({ localTokens = [], botType = DEFAULT_BOT_TYPE, signal } = {}) { - const tokens = [...new Set(localTokens.map(nonEmptyString5).filter(Boolean))].slice(-10); - const response = await requestJson3(fetchImpl, { - method: "POST", - baseUrl: WEIXIN_QR_BASE_URL, - endpoint: `ilink/bot/get_bot_qrcode?bot_type=${encodeURIComponent(botType)}`, - body: { local_token_list: tokens }, - timeoutMs: 1e4, - signal - }); - const qrcode = nonEmptyString5(response?.qrcode); - if (!qrcode) throw new WeixinApiError("invalid-qr", "\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u4E8C\u7EF4\u7801\u4EE4\u724C\u3002"); - return { - qrcode, - qrcodeUrl: normalizeWeixinQrUrl(response.qrcode_img_content) - }; - }, - async pollLogin({ qrcode, baseUrl = WEIXIN_QR_BASE_URL, verifyCode, signal }) { - const qr = nonEmptyString5(qrcode); - if (!qr) throw new TypeError("qrcode is required"); - let endpoint = `ilink/bot/get_qrcode_status?qrcode=${encodeURIComponent(qr)}`; - if (nonEmptyString5(verifyCode)) endpoint += `&verify_code=${encodeURIComponent(verifyCode.trim())}`; - const response = await requestJson3(fetchImpl, { - method: "GET", - baseUrl, - endpoint, - timeoutMs: DEFAULT_LONG_POLL_TIMEOUT_MS, - signal, - authenticated: false - }); - return validateLoginResponse(response); - }, - async getUpdates({ baseUrl, token, getUpdatesBuf = "", timeoutMs, signal }) { - try { - return await requestJson3(fetchImpl, { - method: "POST", - baseUrl, - endpoint: "ilink/bot/getupdates", - body: { get_updates_buf: getUpdatesBuf, base_info: baseInfo() }, - token, - timeoutMs: timeoutMs ?? DEFAULT_LONG_POLL_TIMEOUT_MS, - signal - }); - } catch (error) { - if (error instanceof WeixinApiError && error.code === "timeout") { - return { ret: 0, msgs: [], get_updates_buf: getUpdatesBuf }; - } - throw error; - } - }, - async sendText({ baseUrl, token, toUserId, text, contextToken, runId, signal }) { - const recipient = nonEmptyString5(toUserId); - const content = nonEmptyString5(text); - if (!recipient || !content) throw new TypeError("toUserId and text are required"); - const response = await requestJson3(fetchImpl, { - method: "POST", - baseUrl, - endpoint: "ilink/bot/sendmessage", - token, - signal, - body: { - msg: { - from_user_id: "", - to_user_id: recipient, - client_id: `dsh-weixin-${randomUUID11()}`, - message_type: 2, - message_state: 2, - item_list: [{ type: 1, text_item: { text: content } }], - ...nonEmptyString5(contextToken) ? { context_token: contextToken.trim() } : {}, - ...nonEmptyString5(runId) ? { run_id: runId.trim() } : {} - }, - base_info: baseInfo() - } - }); - if (response?.ret !== void 0 && response.ret !== 0) { - throw new WeixinApiError("send-rejected", "\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u56DE\u590D\u6D88\u606F\u3002"); - } - return true; - }, - async notifyStart({ baseUrl, token, signal }) { - const response = await requestJson3(fetchImpl, { - method: "POST", - baseUrl, - endpoint: "ilink/bot/msg/notifystart", - token, - signal, - timeoutMs: 1e4, - body: { base_info: baseInfo() } - }); - if (response?.ret !== void 0 && response.ret !== 0) { - throw new WeixinApiError("start-rejected", "\u5FAE\u4FE1\u8D26\u53F7\u8FDE\u63A5\u542F\u52A8\u5931\u8D25\u3002"); - } - return response; - }, - async notifyStop({ baseUrl, token, signal }) { - return requestJson3(fetchImpl, { - method: "POST", - baseUrl, - endpoint: "ilink/bot/msg/notifystop", - token, - signal, - timeoutMs: 1e4, - body: { base_info: baseInfo() } - }); - } - }); -} -function extractWeixinText(message) { - for (const item of message?.item_list ?? []) { - if (item?.type === 1 && typeof item.text_item?.text === "string") { - const text = item.text_item.text.trim(); - if (text) return text; - } - if (item?.type === 3 && typeof item.voice_item?.text === "string") { - const text = item.voice_item.text.trim(); - if (text) return text; - } - } - return null; -} -function weixinMessageId(message) { - if (message?.message_id !== void 0 && message.message_id !== null) { - return String(message.message_id); - } - return nonEmptyString5(message?.client_id); -} -function splitWeixinText(text, maxChars = 4e3) { - if (text.length <= maxChars) return [text]; - const chunks = []; - let remaining = text; - while (remaining.length > maxChars) { - let splitAt = remaining.lastIndexOf("\n", maxChars); - if (splitAt < Math.floor(maxChars * 0.6)) splitAt = maxChars; - chunks.push(remaining.slice(0, splitAt)); - remaining = remaining.slice(splitAt).replace(/^\n+/, ""); - } - if (remaining) chunks.push(remaining); - return chunks; -} - -// src/channels/weixin/config-store.mjs -var EMPTY_DOCUMENT5 = Object.freeze({ version: 1, accounts: Object.freeze([]) }); -function cleanString14(value) { - return typeof value === "string" && value.trim() ? value.trim() : null; -} -function safeBotId3(value) { - const id = cleanString14(value); - return id && /^wx_[a-f0-9]{24}$/.test(id) ? id : null; -} -function safeTokenRef(value) { - const ref = cleanString14(value); - return ref && /^DSH_WEIXIN_BOT_TOKEN_[A-F0-9]{24}$/.test(ref) ? ref : null; -} -function deriveWeixinBotIdentity(accountId) { - const raw = cleanString14(accountId); - if (!raw) throw new TypeError("accountId is required"); - const digest2 = createHash6("sha256").update(raw).digest("hex").slice(0, 24); - return { - botId: `wx_${digest2}`, - tokenRef: `DSH_WEIXIN_BOT_TOKEN_${digest2.toUpperCase()}` - }; -} -function maskWeixinAccountId(accountId) { - const value = cleanString14(accountId) ?? ""; - if (value.length <= 10) return value ? `${value.slice(0, 3)}\u2022\u2022\u2022` : "\u5FAE\u4FE1\u673A\u5668\u4EBA"; - return `${value.slice(0, 6)}\u2022\u2022\u2022\u2022${value.slice(-4)}`; -} -function normalizeAccount(value) { - if (!value || typeof value !== "object") return null; - const accountId = cleanString14(value.accountId); - const ownerUserId = cleanString14(value.ownerUserId); - const botId = safeBotId3(value.botId); - const tokenRef = safeTokenRef(value.tokenRef); - if (!accountId || !ownerUserId || !botId || !tokenRef) return null; - const derived = deriveWeixinBotIdentity(accountId); - if (derived.botId !== botId || derived.tokenRef !== tokenRef) return null; - let baseUrl; - try { - baseUrl = normalizeWeixinApiBaseUrl(value.baseUrl); - } catch { - return null; - } - return Object.freeze({ - botId, - accountId, - tokenRef, - ownerUserId, - baseUrl, - createdAt: cleanString14(value.createdAt) ?? (/* @__PURE__ */ new Date()).toISOString(), - connectedAt: cleanString14(value.connectedAt) - }); -} -function normalizeDocument5(value) { - if (!value || value.version !== 1 || !Array.isArray(value.accounts)) return null; - const accounts = value.accounts.map(normalizeAccount); - if (accounts.some((account) => account === null)) return null; - const ids = /* @__PURE__ */ new Set(); - const accountIds = /* @__PURE__ */ new Set(); - const refs = /* @__PURE__ */ new Set(); - for (const account of accounts) { - if (ids.has(account.botId) || accountIds.has(account.accountId) || refs.has(account.tokenRef)) { - return null; - } - ids.add(account.botId); - accountIds.add(account.accountId); - refs.add(account.tokenRef); - } - return Object.freeze({ version: 1, accounts: Object.freeze(accounts) }); -} -var WeixinConfigStore = class { - #path; - #value = EMPTY_DOCUMENT5; - #writeQueue = Promise.resolve(); - constructor(path) { - this.#path = path; - } - async load() { - try { - const normalized = normalizeDocument5(JSON.parse(await readFile11(this.#path, "utf8"))); - if (!normalized) throw new Error("dsh-weixin config contains invalid account data"); - this.#value = normalized; - } catch (error) { - if (error?.code !== "ENOENT") throw error; - this.#value = EMPTY_DOCUMENT5; - } - return this; - } - list() { - return structuredClone(this.#value.accounts); - } - get(botId) { - const account = this.#value.accounts.find((candidate) => candidate.botId === botId); - return account ? structuredClone(account) : null; - } - getByAccountId(accountId) { - const account = this.#value.accounts.find((candidate) => candidate.accountId === accountId); - return account ? structuredClone(account) : null; - } - async save(value) { - const normalized = normalizeAccount(value); - if (!normalized) throw new Error("Refusing to persist incomplete dsh-weixin account data"); - return this.#mutate((accounts) => { - const accountCollision = accounts.find( - (account) => account.accountId === normalized.accountId && account.botId !== normalized.botId - ); - const refCollision = accounts.find( - (account) => account.tokenRef === normalized.tokenRef && account.botId !== normalized.botId - ); - if (accountCollision || refCollision) throw new Error("Duplicate Weixin account identity"); - const index = accounts.findIndex((account) => account.botId === normalized.botId); - if (index === -1) accounts.push(normalized); - else accounts[index] = normalized; - return structuredClone(normalized); - }); - } - async remove(botId) { - if (!safeBotId3(botId)) throw new TypeError("Invalid Weixin bot id"); - return this.#mutate((accounts) => { - const index = accounts.findIndex((account) => account.botId === botId); - if (index === -1) return null; - const [removed] = accounts.splice(index, 1); - return structuredClone(removed); - }); - } - async clear() { - const operation = this.#writeQueue.then(async () => { - try { - await unlink15(this.#path); - } catch (error) { - if (error?.code !== "ENOENT") throw error; - } - this.#value = EMPTY_DOCUMENT5; - }); - this.#writeQueue = operation.then(() => void 0, () => void 0); - await operation; - } - async #mutate(mutator) { - let result; - const operation = this.#writeQueue.then(async () => { - const accounts = [...this.#value.accounts]; - result = mutator(accounts); - const document = Object.freeze({ version: 1, accounts: Object.freeze(accounts) }); - await this.#write(document); - this.#value = document; - }); - this.#writeQueue = operation.then(() => void 0, () => void 0); - await operation; - return result; - } - async #write(document) { - await mkdir11(dirname11(this.#path), { recursive: true, mode: 448 }); - const temporary = `${this.#path}.tmp`; - await writeFile11(temporary, `${JSON.stringify(document, null, 2)} -`, { - encoding: "utf8", - mode: 384 - }); - await rename11(temporary, this.#path); - } -}; - -// src/channels/weixin/state-store.mjs -import { mkdir as mkdir12, readFile as readFile12, rename as rename12, unlink as unlink16, writeFile as writeFile12 } from "node:fs/promises"; -import { dirname as dirname12 } from "node:path"; -var EMPTY_STATE6 = Object.freeze({ - version: 1, - sessions: {}, - seenMessageIds: [], - getUpdatesBuf: "" -}); -function normalizeState5(value) { - if (!value || typeof value !== "object") return structuredClone(EMPTY_STATE6); - const sessions = {}; - if (value.sessions && typeof value.sessions === "object" && !Array.isArray(value.sessions)) { - for (const [key, sessionId] of Object.entries(value.sessions)) { - if (typeof key === "string" && typeof sessionId === "string" && sessionId) { - sessions[key] = sessionId; - } - } - } - return { - version: 1, - sessions, - seenMessageIds: Array.isArray(value.seenMessageIds) ? value.seenMessageIds.filter((id) => typeof id === "string").slice(-1e3) : [], - getUpdatesBuf: typeof value.getUpdatesBuf === "string" ? value.getUpdatesBuf : "" - }; -} -var WeixinStateStore = class { - #path; - #state = structuredClone(EMPTY_STATE6); - #writeQueue = Promise.resolve(); - constructor(path) { - this.#path = path; - } - async load() { - try { - this.#state = normalizeState5(JSON.parse(await readFile12(this.#path, "utf8"))); - } catch (error) { - if (error?.code !== "ENOENT") throw error; - this.#state = structuredClone(EMPTY_STATE6); - await this.#persist(); - } - return this; - } - sessionFor(key) { - return this.#state.sessions[key] ?? null; - } - async setSession(key, sessionId) { - this.#state.sessions[key] = sessionId; - await this.#persist(); - } - async clearSession(key) { - delete this.#state.sessions[key]; - await this.#persist(); - } - hasSeen(messageId) { - return this.#state.seenMessageIds.includes(messageId); - } - async markSeen(messageId) { - if (this.hasSeen(messageId)) return; - this.#state.seenMessageIds.push(messageId); - if (this.#state.seenMessageIds.length > 1e3) { - this.#state.seenMessageIds.splice(0, this.#state.seenMessageIds.length - 1e3); - } - await this.#persist(); - } - getUpdatesBuf() { - return this.#state.getUpdatesBuf; - } - async setGetUpdatesBuf(value) { - if (typeof value !== "string" || value === this.#state.getUpdatesBuf) return; - this.#state.getUpdatesBuf = value; - await this.#persist(); - } - snapshot() { - return structuredClone(this.#state); - } - async remove() { - try { - await unlink16(this.#path); - } catch (error) { - if (error?.code !== "ENOENT") throw error; - } - this.#state = structuredClone(EMPTY_STATE6); - } - async #persist() { - const snapshot = `${JSON.stringify(this.#state, null, 2)} -`; - const operation = this.#writeQueue.then(async () => { - await mkdir12(dirname12(this.#path), { recursive: true, mode: 448 }); - const temporary = `${this.#path}.tmp`; - await writeFile12(temporary, snapshot, { encoding: "utf8", mode: 384 }); - await rename12(temporary, this.#path); - }); - this.#writeQueue = operation.then(() => void 0, () => void 0); - await operation; - } -}; - -// src/channels/weixin/weixin-controller.mjs -import { randomUUID as randomUUID12 } from "node:crypto"; -var ACTIVE_ATTEMPT_STATES4 = /* @__PURE__ */ new Set([ - "starting", - "pending", - "scanned", - "needs_verification", - "connecting" -]); -var TERMINAL_ATTEMPT_STATES4 = /* @__PURE__ */ new Set(["connected", "expired", "failed", "cancelled"]); -var QR_TTL_MS3 = 5 * 6e4; -function cleanString15(value) { - return typeof value === "string" && value.trim() ? value.trim() : null; -} -function abortError4() { - return new DOMException("Provisioning was cancelled", "AbortError"); -} -function apiBaseFromServer(value, fallback) { - const raw = cleanString15(value); - if (!raw) return normalizeWeixinApiBaseUrl(fallback); - return normalizeWeixinApiBaseUrl(raw.includes("://") ? raw : `https://${raw}`); -} -function publicAttempt4(record) { - if (!record) return null; - return { - attemptId: record.id, - status: record.state, - ...record.verificationUrl ? { verificationUrl: record.verificationUrl } : {}, - ...record.expiresAt ? { expiresAt: record.expiresAt } : {}, - pollIntervalMs: 1e3, - ...record.state === "needs_verification" ? { verificationRequired: true } : {}, - ...record.botId ? { botId: record.botId } : {}, - ...record.alreadyConnected ? { alreadyConnected: true } : {}, - ...record.error ? { error: structuredClone(record.error) } : {} - }; -} -function safeAccountError(code, message) { - return Object.freeze({ code, message }); -} -var WeixinController = class { - #api; - #credentials; - #configStore; - #createRuntime; - #deleteState; - #logger; - #runtimes = /* @__PURE__ */ new Map(); - #errors = /* @__PURE__ */ new Map(); - #attempts = /* @__PURE__ */ new Map(); - #activeAttemptId = null; - #transitions = /* @__PURE__ */ new Map(); - #revision = 0; - #closed = false; - constructor({ - api, - credentials, - configStore, - createRuntime, - deleteState = async () => { - }, - logger = console - }) { - if (!api || typeof api.beginLogin !== "function" || typeof api.pollLogin !== "function") { - throw new TypeError("WeixinController requires a Weixin API client"); - } - if (!credentials || typeof credentials.resolve !== "function" || typeof credentials.set !== "function" || typeof credentials.unset !== "function") { - throw new TypeError("WeixinController requires the DSH credential provider"); - } - if (!configStore || typeof configStore.list !== "function" || typeof configStore.save !== "function" || typeof configStore.remove !== "function") { - throw new TypeError("WeixinController requires a config store"); - } - if (typeof createRuntime !== "function") throw new TypeError("createRuntime is required"); - this.#api = api; - this.#credentials = credentials; - this.#configStore = configStore; - this.#createRuntime = createRuntime; - this.#deleteState = deleteState; - this.#logger = logger; - } - async initialize() { - if (this.#closed) return this.status(); - for (const config of this.#configStore.list()) { - const current = this.#runtimes.get(config.botId); - if (current?.status?.ready === true) continue; - await this.#withBotTransition(config.botId, async () => { - const latest = this.#configStore.get(config.botId); - if (!latest || this.#closed) return; - try { - const token = await this.#resolveToken(latest.tokenRef); - if (!token) { - this.#errors.set( - latest.botId, - safeAccountError("missing-token", "\u767B\u5F55\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u8D26\u53F7\u540E\u91CD\u65B0\u626B\u7801\u3002") - ); - return; - } - await this.#startRuntime(latest, token); - this.#errors.delete(latest.botId); - } catch (error) { - this.#errors.set( - latest.botId, - safeAccountError("connection-failed", "\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002") - ); - this.#logger.warn?.(`[dsh-weixin] account ${latest.botId} failed to initialize:`, error); - } finally { - this.#touch(); - } - }); - } - return this.status(); - } - async startProvisioning() { - if (this.#closed) throw new Error("dsh-weixin controller is closed"); - if (this.#activeAttemptId) await this.cancelProvisioning(this.#activeAttemptId); - const record = { - id: randomUUID12(), - state: "starting", - createdAt: Date.now(), - expiresAt: Date.now() + QR_TTL_MS3, - controller: new AbortController(), - pendingVerifyCode: null, - verifyResolve: null, - currentBaseUrl: WEIXIN_QR_BASE_URL, - error: null, - botId: null, - task: null - }; - this.#attempts.set(record.id, record); - this.#activeAttemptId = record.id; - this.#touch(); - try { - const localTokens = (await Promise.all( - this.#configStore.list().slice(-10).map(async (config) => this.#resolveToken(config.tokenRef)) - )).filter(Boolean); - const login = await this.#api.beginLogin({ - localTokens, - signal: record.controller.signal - }); - this.#assertAttemptActive(record); - record.qrcode = login.qrcode; - record.verificationUrl = login.qrcodeUrl; - record.state = "pending"; - record.expiresAt = Date.now() + QR_TTL_MS3; - this.#touch(); - record.task = this.#runProvisioning(record); - return publicAttempt4(record); - } catch (error) { - if (record.controller.signal.aborted) { - record.state = "cancelled"; - record.error = safeAccountError("cancelled", "\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"); - } else { - record.state = "failed"; - record.error = safeAccountError( - error instanceof WeixinApiError ? error.code : "qr-start-failed", - error instanceof WeixinApiError ? error.message : "\u65E0\u6CD5\u751F\u6210\u5FAE\u4FE1\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002" - ); - } - if (this.#activeAttemptId === record.id) this.#activeAttemptId = null; - this.#touch(); - throw error; - } - } - registrationStatus(attemptId) { - return publicAttempt4(this.#attempts.get(attemptId)); - } - async submitVerification(attemptId, verifyCode) { - const record = this.#attempts.get(attemptId); - if (!record || record.state !== "needs_verification") { - throw new Error("The provisioning attempt is not waiting for a verification code"); - } - const code = cleanString15(verifyCode); - if (!code || !/^\d{4,8}$/.test(code)) { - throw new TypeError("Verification code must contain 4 to 8 digits"); - } - record.pendingVerifyCode = code; - record.state = "scanned"; - record.verifyResolve?.(); - record.verifyResolve = null; - this.#touch(); - return publicAttempt4(record); - } - async cancelProvisioning(attemptId) { - const record = this.#attempts.get(attemptId); - if (!record) return null; - if (!TERMINAL_ATTEMPT_STATES4.has(record.state)) { - record.controller.abort(); - record.verifyResolve?.(); - record.verifyResolve = null; - await record.task?.catch(() => void 0); - if (!TERMINAL_ATTEMPT_STATES4.has(record.state)) record.state = "cancelled"; - record.error ??= safeAccountError("cancelled", "\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"); - } - if (this.#activeAttemptId === record.id) this.#activeAttemptId = null; - this.#touch(); - return publicAttempt4(record); - } - async reconnectBot(botId) { - const config = this.#configStore.get(botId); - if (!config) throw new Error("Unknown Weixin account"); - await this.#withBotTransition(botId, async () => { - const token = await this.#resolveToken(config.tokenRef); - if (!token) throw new Error("The Weixin token is missing"); - try { - await this.#startRuntime(config, token); - this.#errors.delete(botId); - } catch (error) { - this.#errors.set(botId, safeAccountError("connection-failed", "\u5FAE\u4FE1\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")); - throw error; - } finally { - this.#touch(); - } - }); - return this.status(); - } - async deleteBot(botId) { - const config = this.#configStore.get(botId); - if (!config) throw new Error("Unknown Weixin account"); - await this.#withBotTransition(botId, async () => { - const previousToken = await this.#credentials.resolve(config.tokenRef).catch(() => void 0); - await this.#stopRuntime(botId); - try { - await this.#credentials.unset(config.tokenRef); - await this.#configStore.remove(botId); - } catch (error) { - if (previousToken?.value) { - await this.#credentials.set(config.tokenRef, previousToken.value).catch(() => void 0); - await this.#startRuntime(config, previousToken.value).catch(() => void 0); - } - throw new Error("Unable to remove the Weixin account safely.", { cause: error }); - } - try { - await this.#deleteState({ botId, config }); - } catch (error) { - this.#logger.warn?.(`[dsh-weixin] account ${botId} state cleanup failed:`, error); - } - this.#errors.delete(botId); - this.#touch(); - }); - return this.status(); - } - status() { - const accounts = this.#configStore.list().map((config) => { - const runtimeStatus2 = this.#runtimes.get(config.botId)?.status ?? null; - const connected = runtimeStatus2?.ready === true && runtimeStatus2.weixinConnectionState === "connected" && runtimeStatus2.harnessReachable === true; - const state = connected ? "connected" : runtimeStatus2?.weixinConnectionState === "connecting" ? "connecting" : this.#errors.has(config.botId) || runtimeStatus2?.weixinConnectionState === "failed" ? "error" : "offline"; - const error = this.#errors.get(config.botId) ?? (state === "error" ? safeAccountError("connection-failed", "\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002") : null); - return { - botId: config.botId, - state, - connected, - configured: true, - bot: { - name: "\u5FAE\u4FE1\u673A\u5668\u4EBA", - accountIdMasked: maskWeixinAccountId(config.accountId) - }, - health: { - status: connected ? "healthy" : state === "error" ? "error" : "offline", - summary: connected ? "\u5FAE\u4FE1\u6D88\u606F\u957F\u8F6E\u8BE2\u8FD0\u884C\u6B63\u5E38" : state === "error" ? "\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5" : "\u5FAE\u4FE1\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF", - lastCheckedAt: runtimeStatus2?.lastCheckedAt ?? null - }, - stats: { - messagesReceived: runtimeStatus2?.messagesReceived ?? 0, - messagesReplied: runtimeStatus2?.messagesReplied ?? 0 - }, - error: error ? structuredClone(error) : null - }; - }); - const connectedCount = accounts.filter((account) => account.connected).length; - const active = this.#activeAttemptId ? this.#attempts.get(this.#activeAttemptId) : null; - return { - schemaVersion: 1, - revision: this.#revision, - state: active && ACTIVE_ATTEMPT_STATES4.has(active.state) ? "provisioning" : accounts.length === 0 ? "disconnected" : connectedCount === accounts.length ? "connected" : connectedCount > 0 ? "degraded" : "offline", - bots: accounts, - totals: { configured: accounts.length, connected: connectedCount }, - ...active && ACTIVE_ATTEMPT_STATES4.has(active.state) ? { provisioning: publicAttempt4(active) } : {} - }; - } - async close() { - if (this.#closed) return; - this.#closed = true; - if (this.#activeAttemptId) await this.cancelProvisioning(this.#activeAttemptId); - await Promise.allSettled([...this.#runtimes.keys()].map((botId) => this.#stopRuntime(botId))); - } - async #runProvisioning(record) { - try { - while (!record.controller.signal.aborted && Date.now() < record.expiresAt) { - if (record.state === "needs_verification" && !record.pendingVerifyCode) { - await new Promise((resolve7) => { - record.verifyResolve = resolve7; - if (record.controller.signal.aborted) resolve7(); - }); - record.verifyResolve = null; - this.#assertAttemptActive(record); - } - const response = await this.#api.pollLogin({ - qrcode: record.qrcode, - baseUrl: record.currentBaseUrl, - verifyCode: record.pendingVerifyCode, - signal: record.controller.signal - }); - this.#assertAttemptActive(record); - if (response.status === "wait") { - record.state = "pending"; - } else if (response.status === "scaned") { - record.pendingVerifyCode = null; - record.state = "scanned"; - } else if (response.status === "need_verifycode") { - record.pendingVerifyCode = null; - record.state = "needs_verification"; - } else if (response.status === "verify_code_blocked") { - record.state = "failed"; - record.error = safeAccountError("verification-blocked", "\u914D\u5BF9\u7801\u591A\u6B21\u9519\u8BEF\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002"); - break; - } else if (response.status === "expired") { - record.state = "expired"; - record.error = safeAccountError("expired", "\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002"); - break; - } else if (response.status === "scaned_but_redirect") { - record.currentBaseUrl = apiBaseFromServer(response.redirect_host, record.currentBaseUrl); - record.state = "scanned"; - } else if (response.status === "binded_redirect") { - const existing = this.#configStore.list().find( - (config) => this.#runtimes.get(config.botId)?.status?.ready === true - ) ?? this.#configStore.list()[0]; - if (!existing) { - record.state = "failed"; - record.error = safeAccountError("already-bound", "\u8BE5\u5FAE\u4FE1\u8D26\u53F7\u5DF2\u7ED1\u5B9A\uFF0C\u4F46\u672C\u673A\u6CA1\u6709\u53EF\u6062\u590D\u7684\u51ED\u636E\u3002"); - } else { - record.state = "connected"; - record.botId = existing.botId; - record.alreadyConnected = true; - } - break; - } else if (response.status === "confirmed") { - const token = cleanString15(response.bot_token); - const accountId = cleanString15(response.ilink_bot_id); - const ownerUserId = cleanString15(response.ilink_user_id); - if (!token || !accountId || !ownerUserId) { - throw new WeixinApiError("incomplete-login", "\u5FAE\u4FE1\u6388\u6743\u6210\u529F\uFF0C\u4F46\u8FD4\u56DE\u7684\u8D26\u53F7\u51ED\u636E\u4E0D\u5B8C\u6574\u3002"); - } - record.state = "connecting"; - this.#touch(); - const baseUrl = apiBaseFromServer(response.baseurl, record.currentBaseUrl); - record.botId = await this.#activateAccount(record, { - token, - accountId, - ownerUserId, - baseUrl - }); - record.state = "connected"; - record.error = null; - break; - } - this.#touch(); - } - if (!record.controller.signal.aborted && Date.now() >= record.expiresAt && !TERMINAL_ATTEMPT_STATES4.has(record.state)) { - record.state = "expired"; - record.error = safeAccountError("expired", "\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002"); - } - } catch (error) { - if (record.controller.signal.aborted || error?.name === "AbortError") { - record.state = "cancelled"; - record.error = safeAccountError("cancelled", "\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"); - } else { - record.state = "failed"; - record.error = safeAccountError( - error instanceof WeixinApiError ? error.code : "activation-failed", - error instanceof WeixinApiError ? error.message : "\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u4FDD\u5B58\u51ED\u636E\u6216\u542F\u52A8\u6D88\u606F\u8FDE\u63A5\u3002" - ); - this.#logger.error?.("[dsh-weixin] provisioning failed:", error); - } - } finally { - record.pendingVerifyCode = null; - record.verifyResolve?.(); - record.verifyResolve = null; - if (this.#activeAttemptId === record.id) this.#activeAttemptId = null; - this.#touch(); - this.#pruneAttempts(); - } - } - async #activateAccount(record, { token, accountId, ownerUserId, baseUrl }) { - const identity = deriveWeixinBotIdentity(accountId); - const previousConfig = this.#configStore.getByAccountId(accountId); - const config = { - botId: identity.botId, - accountId, - tokenRef: identity.tokenRef, - ownerUserId, - baseUrl, - createdAt: previousConfig?.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(), - connectedAt: (/* @__PURE__ */ new Date()).toISOString() - }; - const previousToken = await this.#credentials.resolve(identity.tokenRef).catch(() => void 0); - return this.#withBotTransition(identity.botId, async () => { - await this.#credentials.set(identity.tokenRef, token); - try { - this.#assertAttemptActive(record); - await this.#configStore.save(config); - this.#assertAttemptActive(record); - await this.#startRuntime(config, token); - this.#assertAttemptActive(record); - this.#errors.delete(identity.botId); - this.#touch(); - return identity.botId; - } catch (error) { - await this.#stopRuntime(identity.botId); - if (previousConfig) await this.#configStore.save(previousConfig).catch(() => void 0); - else if (this.#configStore.get(identity.botId)) { - await this.#configStore.remove(identity.botId).catch(() => void 0); - } - await this.#restoreCredential(identity.tokenRef, previousToken); - if (previousConfig && previousToken?.value) { - await this.#startRuntime(previousConfig, previousToken.value).catch(() => void 0); - } - throw error; - } - }); - } - async #startRuntime(config, token) { - await this.#stopRuntime(config.botId); - const runtime = await this.#createRuntime({ botId: config.botId, config, token }); - if (!runtime || typeof runtime.start !== "function" || typeof runtime.stop !== "function") { - throw new TypeError("createRuntime returned an invalid Weixin runtime"); - } - try { - await runtime.start(); - this.#runtimes.set(config.botId, runtime); - } catch (error) { - await runtime.stop().catch(() => void 0); - throw error; - } - } - async #stopRuntime(botId) { - const runtime = this.#runtimes.get(botId); - this.#runtimes.delete(botId); - await runtime?.stop().catch((error) => { - this.#logger.warn?.(`[dsh-weixin] account ${botId} failed to stop cleanly:`, error); - }); - } - async #resolveToken(ref) { - const result = await this.#credentials.resolve(ref).catch(() => void 0); - return cleanString15(result?.value); - } - async #restoreCredential(ref, previous) { - try { - if (previous?.value) await this.#credentials.set(ref, previous.value); - else await this.#credentials.unset(ref); - } catch (error) { - this.#logger.error?.(`[dsh-weixin] failed to restore credential ${ref}:`, error); - } - } - #assertAttemptActive(record) { - if (record.controller.signal.aborted || this.#activeAttemptId !== record.id) throw abortError4(); - } - #withBotTransition(botId, operation) { - const previous = this.#transitions.get(botId) ?? Promise.resolve(); - const current = previous.catch(() => void 0).then(operation); - const settled = current.finally(() => { - if (this.#transitions.get(botId) === settled) this.#transitions.delete(botId); - }); - this.#transitions.set(botId, settled); - return settled; - } - #pruneAttempts() { - for (const [id, record] of this.#attempts) { - if (id !== this.#activeAttemptId && TERMINAL_ATTEMPT_STATES4.has(record.state) && this.#attempts.size > 16) { - this.#attempts.delete(id); - } - } - } - #touch() { - this.#revision += 1; - } -}; - -// src/channels/weixin/weixin-bridge.mjs -var HELP_TEXT5 = [ - "\u5FAE\u4FE1\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002", - "", - "\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u6216\u5E26\u6587\u5B57\u8BC6\u522B\u7ED3\u679C\u7684\u8BED\u97F3\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002", - "/new \u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD", - "/status \u68C0\u67E5\u8FDE\u63A5\u72B6\u6001", - "/help \u663E\u793A\u672C\u5E2E\u52A9" -].join("\n"); -function conversationKey5(userId) { - return `p2p:${userId}`; -} -function createWeixinBridgeStatus() { - return { - messagesReceived: 0, - messagesReplied: 0, - messagesRejected: 0, - lastMessageAt: null, - lastReplyAt: null, - lastRejectedAt: null, - lastError: null - }; -} -var WeixinHarnessBridge = class { - #api; - #baseUrl; - #token; - #ownerUserId; - #harness; - #state; - #status; - #logger; - #replyTimeoutMs; - #maxMessageChars; - #queues = /* @__PURE__ */ new Map(); - constructor({ - api, - baseUrl, - token, - ownerUserId, - harness, - state, - status = createWeixinBridgeStatus(), - logger = console, - replyTimeoutMs = 6e5, - maxMessageChars = 4e3 - }) { - if (!api || typeof api.sendText !== "function") throw new TypeError("Weixin API is required"); - if (!baseUrl || !token || !ownerUserId) throw new TypeError("Weixin account credentials are required"); - if (!harness || !state) throw new TypeError("Harness client and state store are required"); - this.#api = api; - this.#baseUrl = baseUrl; - this.#token = token; - this.#ownerUserId = ownerUserId; - this.#harness = harness; - this.#state = state; - this.#status = status; - this.#logger = logger; - this.#replyTimeoutMs = replyTimeoutMs; - this.#maxMessageChars = maxMessageChars; - } - get status() { - return structuredClone(this.#status); - } - accept(message) { - const sender = typeof message?.from_user_id === "string" ? message.from_user_id : ""; - const previous = this.#queues.get(sender) ?? Promise.resolve(); - const current = previous.catch(() => void 0).then(() => this.#process(message)).finally(() => { - if (this.#queues.get(sender) === current) this.#queues.delete(sender); - }); - this.#queues.set(sender, current); - return current; - } - async waitForIdle() { - await Promise.allSettled([...this.#queues.values()]); - } - async #process(message) { - if (message?.message_type === 2) return; - const messageId = weixinMessageId(message); - const sender = typeof message?.from_user_id === "string" ? message.from_user_id : ""; - if (!messageId || !sender) return; - if (this.#state.hasSeen(messageId)) return; - this.#status.messagesReceived += 1; - this.#status.lastMessageAt = (/* @__PURE__ */ new Date()).toISOString(); - if (sender !== this.#ownerUserId) { - this.#status.messagesRejected += 1; - this.#status.lastRejectedAt = (/* @__PURE__ */ new Date()).toISOString(); - return; - } - const contextToken = typeof message.context_token === "string" ? message.context_token : void 0; - const runId = typeof message.run_id === "string" ? message.run_id : void 0; - const text = extractWeixinText(message); - try { - if (!text) { - await this.#send(sender, "\u76EE\u524D\u4EC5\u652F\u6301\u6587\u5B57\u6D88\u606F\uFF0C\u4EE5\u53CA\u5FAE\u4FE1\u5DF2\u8F6C\u6210\u6587\u5B57\u7684\u8BED\u97F3\u6D88\u606F\u3002", contextToken, runId); - await this.#state.markSeen(messageId); - return; - } - const command = text.trim().toLowerCase(); - if (command === "/help") { - await this.#send(sender, HELP_TEXT5, contextToken, runId); - await this.#state.markSeen(messageId); - return; - } - if (command === "/status") { - await this.#harness.ensureRunning(); - await this.#send(sender, "\u5FAE\u4FE1\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002", contextToken, runId); - await this.#state.markSeen(messageId); - return; - } - if (command === "/new") { - await this.#state.clearSession(conversationKey5(sender)); - await this.#send(sender, "\u5DF2\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002\u8BF7\u53D1\u9001\u4F60\u7684\u95EE\u9898\u3002", contextToken, runId); - await this.#state.markSeen(messageId); - return; - } - const key = conversationKey5(sender); - let sessionId = this.#state.sessionFor(key); - if (!sessionId || !await this.#harness.sessionExists(sessionId)) { - sessionId = await this.#harness.createSession(); - await this.#state.setSession(key, sessionId); - } - const answer = await this.#harness.ask(sessionId, text, { timeoutMs: this.#replyTimeoutMs }); - await this.#send(sender, answer, contextToken, runId); - await this.#state.markSeen(messageId); - this.#status.messagesReplied += 1; - this.#status.lastReplyAt = (/* @__PURE__ */ new Date()).toISOString(); - this.#status.lastError = null; - } catch (error) { - this.#status.lastError = error?.message ?? String(error); - this.#logger.error?.("[dsh-weixin] failed to process an inbound message:", error); - try { - await this.#send(sender, "\u6D88\u606F\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002", contextToken, runId); - await this.#state.markSeen(messageId); - } catch (sendError) { - this.#logger.error?.("[dsh-weixin] failed to send the safe error reply:", sendError); - } - } - } - async #send(toUserId, text, contextToken, runId) { - for (const chunk of splitWeixinText(text, this.#maxMessageChars)) { - await this.#api.sendText({ - baseUrl: this.#baseUrl, - token: this.#token, - toUserId, - text: chunk, - contextToken, - runId - }); - } - } -}; - -// src/channels/weixin/weixin-runtime.mjs -function delay2(ms, signal) { - return new Promise((resolve7, reject) => { - if (signal?.aborted) { - reject(signal.reason ?? new DOMException("Aborted", "AbortError")); - return; - } - const finish = () => { - signal?.removeEventListener("abort", onAbort); - resolve7(); - }; - const timer = setTimeout(finish, ms); - const onAbort = () => { - clearTimeout(timer); - signal?.removeEventListener("abort", onAbort); - reject(signal.reason ?? new DOMException("Aborted", "AbortError")); - }; - signal?.addEventListener("abort", onAbort, { once: true }); - }); -} -function createWeixinRuntimeStatus() { - return { - startedAt: null, - ready: false, - weixinConnectionState: "idle", - harnessReachable: false, - lastCheckedAt: null, - lastError: null, - ...createWeixinBridgeStatus() - }; -} -var WeixinRuntime = class { - #api; - #config; - #token; - #harness; - #state; - #logger; - #replyTimeoutMs; - #maxMessageChars; - #status = createWeixinRuntimeStatus(); - #bridge = null; - #abortController = null; - #monitor = null; - #starting = null; - constructor({ - api, - config, - token, - harness, - state, - logger = console, - replyTimeoutMs = 6e5, - maxMessageChars = 4e3 - }) { - if (!api || !config || !token || !harness || !state) { - throw new TypeError("WeixinRuntime requires API, account, token, Harness, and state"); - } - this.#api = api; - this.#config = config; - this.#token = token; - this.#harness = harness; - this.#state = state; - this.#logger = logger; - this.#replyTimeoutMs = replyTimeoutMs; - this.#maxMessageChars = maxMessageChars; - } - get status() { - return structuredClone(this.#status); - } - async start() { - if (this.#status.ready && this.#monitor) return this.status; - if (this.#starting) return this.#starting; - this.#starting = this.#start().finally(() => { - this.#starting = null; - }); - return this.#starting; - } - async #start() { - await this.stop(); - this.#status.startedAt = (/* @__PURE__ */ new Date()).toISOString(); - this.#status.weixinConnectionState = "connecting"; - this.#status.lastError = null; - try { - await this.#harness.ensureRunning(); - this.#status.harnessReachable = true; - await this.#api.notifyStart({ - baseUrl: this.#config.baseUrl, - token: this.#token - }); - this.#bridge = new WeixinHarnessBridge({ - api: this.#api, - baseUrl: this.#config.baseUrl, - token: this.#token, - ownerUserId: this.#config.ownerUserId, - harness: this.#harness, - state: this.#state, - status: this.#status, - logger: this.#logger, - replyTimeoutMs: this.#replyTimeoutMs, - maxMessageChars: this.#maxMessageChars - }); - this.#abortController = new AbortController(); - this.#status.ready = true; - this.#status.weixinConnectionState = "connected"; - this.#status.lastCheckedAt = Date.now(); - const signal = this.#abortController.signal; - this.#monitor = this.#runMonitor(signal).catch((error) => { - if (signal.aborted) return; - this.#status.ready = false; - this.#status.weixinConnectionState = "failed"; - this.#status.lastError = error?.message ?? String(error); - this.#logger.error?.(`[dsh-weixin] account ${this.#config.botId} monitor stopped:`, error); - }); - return this.status; - } catch (error) { - this.#status.ready = false; - this.#status.weixinConnectionState = "failed"; - this.#status.lastError = error?.message ?? String(error); - throw error; - } - } - async #runMonitor(signal) { - let consecutiveFailures = 0; - while (!signal.aborted) { - try { - const response = await this.#api.getUpdates({ - baseUrl: this.#config.baseUrl, - token: this.#token, - getUpdatesBuf: this.#state.getUpdatesBuf(), - signal - }); - if (signal.aborted) return; - const rejected = response?.ret !== void 0 && response.ret !== 0 || response?.errcode !== void 0 && response.errcode !== 0; - if (rejected) { - const code = response.errcode ?? response.ret; - throw new WeixinApiError( - code === -14 ? "stale-token" : "updates-rejected", - code === -14 ? "\u5FAE\u4FE1\u767B\u5F55\u51ED\u636E\u5DF2\u5931\u6548\uFF0C\u8BF7\u79FB\u9664\u8D26\u53F7\u540E\u91CD\u65B0\u626B\u7801\u3002" : "\u5FAE\u4FE1\u6D88\u606F\u540C\u6B65\u8BF7\u6C42\u88AB\u62D2\u7EDD\u3002" - ); - } - consecutiveFailures = 0; - this.#status.ready = true; - this.#status.weixinConnectionState = "connected"; - this.#status.lastCheckedAt = Date.now(); - this.#status.lastError = null; - for (const message of response?.msgs ?? []) { - await this.#bridge.accept(message); - } - if (typeof response?.get_updates_buf === "string" && response.get_updates_buf) { - await this.#state.setGetUpdatesBuf(response.get_updates_buf); - } - } catch (error) { - if (signal.aborted) return; - consecutiveFailures += 1; - this.#status.lastError = error?.message ?? String(error); - this.#logger.warn?.( - `[dsh-weixin] account ${this.#config.botId} poll failed (${consecutiveFailures}/3):`, - error - ); - if (error instanceof WeixinApiError && error.code === "stale-token") throw error; - if (consecutiveFailures >= 3) throw error; - await delay2(Math.min(2e3 * 2 ** (consecutiveFailures - 1), 1e4), signal); - } - } - } - async stop() { - const monitor = this.#monitor; - const bridge = this.#bridge; - const wasStarted = Boolean(this.#abortController || monitor || this.#status.ready); - this.#abortController?.abort(); - this.#abortController = null; - this.#monitor = null; - await monitor?.catch(() => void 0); - await bridge?.waitForIdle(); - this.#bridge = null; - if (wasStarted) { - try { - await this.#api.notifyStop({ - baseUrl: this.#config.baseUrl, - token: this.#token, - signal: AbortSignal.timeout(1e4) - }); - } catch (error) { - this.#logger.warn?.(`[dsh-weixin] account ${this.#config.botId} stop notification failed:`, error); - } - } - this.#status.ready = false; - this.#status.weixinConnectionState = "idle"; - return this.status; - } -}; - -// plugin-src/host/channels/weixin/connection-supervisor.mjs -var DEFAULT_RETRY_DELAYS_MS6 = Object.freeze([250, 1e3, 3e3, 5e3, 1e4, 3e4]); -function retryDelays5(value) { - if (!Array.isArray(value) || value.length === 0) return [...DEFAULT_RETRY_DELAYS_MS6]; - const valid = value.filter((delay3) => Number.isFinite(delay3) && delay3 >= 0); - return valid.length > 0 ? valid : [...DEFAULT_RETRY_DELAYS_MS6]; -} -var ConnectionSupervisor5 = class { - #controller; - #harness; - #logger; - #retryDelays; - #healthyIntervalMs; - #setTimeout; - #clearTimeout; - #timer = null; - #running = null; - #retryIndex = 0; - #closed = false; - #started = false; - #ready; - #resolveReady; - constructor({ - controller, - harness, - logger = console, - retryDelaysMs, - healthyIntervalMs = 15e3, - setTimeoutImpl = setTimeout, - clearTimeoutImpl = clearTimeout - }) { - if (!controller || typeof controller.initialize !== "function" || typeof controller.status !== "function") { - throw new TypeError("ConnectionSupervisor requires a controller"); - } - if (!harness || typeof harness.ensureRunning !== "function") { - throw new TypeError("ConnectionSupervisor requires a Harness client"); - } - this.#controller = controller; - this.#harness = harness; - this.#logger = logger; - this.#retryDelays = retryDelays5(retryDelaysMs); - this.#healthyIntervalMs = Number.isFinite(healthyIntervalMs) && healthyIntervalMs >= 0 ? healthyIntervalMs : 15e3; - this.#setTimeout = setTimeoutImpl; - this.#clearTimeout = clearTimeoutImpl; - this.#ready = new Promise((resolve7) => { - this.#resolveReady = resolve7; - }); - } - get ready() { - return this.#ready; - } - start() { - if (this.#started || this.#closed) return this; - this.#started = true; - this.#schedule(0); - return this; - } - async close() { - if (this.#closed) return; - this.#closed = true; - if (this.#timer !== null) this.#clearTimeout(this.#timer); - this.#timer = null; - await this.#running?.catch(() => void 0); - this.#resolveReady?.(null); - this.#resolveReady = null; - } - #schedule(delayMs) { - if (this.#closed) return; - this.#timer = this.#setTimeout(() => { - this.#timer = null; - void this.#run(); - }, delayMs); - this.#timer?.unref?.(); - } - async #run() { - if (this.#closed || this.#running) return; - const operation = this.#reconcile(); - this.#running = operation; - try { - await operation; - } finally { - if (this.#running === operation) this.#running = null; - } - } - async #reconcile() { - try { - await this.#harness.ensureRunning(); - if (this.#closed) return; - const status = await this.#controller.initialize(); - if (this.#closed) return; - this.#resolveReady?.(status); - this.#resolveReady = null; - const { configured, connected } = status.totals; - if (connected < configured) { - const delayMs = this.#retryDelays[Math.min(this.#retryIndex, this.#retryDelays.length - 1)]; - this.#retryIndex += 1; - this.#logger.warn?.( - `[dsh-weixin] ${connected}/${configured} accounts connected; retrying in ${delayMs}ms` - ); - this.#schedule(delayMs); - return; - } - this.#retryIndex = 0; - this.#schedule(this.#healthyIntervalMs); - } catch (error) { - if (this.#closed) return; - const delayMs = this.#retryDelays[Math.min(this.#retryIndex, this.#retryDelays.length - 1)]; - this.#retryIndex += 1; - this.#logger.warn?.(`[dsh-weixin] connection reconciliation failed; retrying in ${delayMs}ms`, error); - this.#schedule(delayMs); - } - } -}; -function createConnectionSupervisor5(options) { - return new ConnectionSupervisor5(options); -} - -// plugin-src/host/channels/weixin/production.mjs -function harnessOrigin6(webServer, configured) { - if (configured !== void 0) return new URL(configured); - const port = webServer?.port; - if (!Number.isInteger(port) || port < 1 || port > 65535) { - throw new Error("dsh-weixin requires an initialized DSH webServer port"); - } - return new URL(`http://127.0.0.1:${port}`); -} -function pluginPaths6(config) { - const dshHome = resolve6(config.dshHome ?? process.env.DSH_HOME ?? join6(homedir6(), ".dsh")); - const root = resolve6(config.dataDir ?? join6(dshHome, "integrations", "dsh-weixin")); - return { - root, - config: resolve6(config.configPath ?? join6(root, "config.json")), - accounts: resolve6(config.accountsDir ?? join6(root, "accounts")) - }; -} -async function createProductionController7(ctx, config = {}, internals = {}) { - if (!ctx?.credentials) throw new TypeError("dsh-weixin requires ctx.credentials"); - if (!ctx?.webServer) throw new TypeError("dsh-weixin requires ctx.webServer"); - const ConfigStore = internals.ConfigStore ?? WeixinConfigStore; - const StateStore2 = internals.StateStore ?? WeixinStateStore; - const Harness = internals.HarnessClient ?? HarnessClient2; - const Controller = internals.Controller ?? WeixinController; - const Runtime = internals.Runtime ?? WeixinRuntime; - const api = internals.api ?? createWeixinApi(); - const createSupervisor = internals.createConnectionSupervisor ?? createConnectionSupervisor5; - const logger = typeof ctx.logger === "function" ? ctx.logger("dsh-weixin") : ctx.logger ?? console; - const paths = pluginPaths6(config); - const configStore = await new ConfigStore(paths.config).load(); - const stateStores = /* @__PURE__ */ new Map(); - const statePath = (botId) => resolve6(paths.accounts, botId, "state.json"); - const stateFor = async (botId) => { - let state = stateStores.get(botId); - if (!state) { - state = await new StateStore2(statePath(botId)).load(); - stateStores.set(botId, state); - } - return state; - }; - const harness = new Harness({ - baseUrl: harnessOrigin6(ctx.webServer, config.harnessBaseUrl), - workspace: resolve6(config.workspace ?? process.cwd()), - agentPreset: config.agentPreset ?? "standard", - autostart: false, - dshBin: config.dshBin ?? "dsh" - }); - const controller = new Controller({ - api, - credentials: ctx.credentials, - configStore, - logger, - createRuntime: async ({ botId, config: accountConfig, token }) => { - const state = await stateFor(botId); - return new Runtime({ - api, - config: accountConfig, - token, - harness, - state, - replyTimeoutMs: config.replyTimeoutMs ?? 6e5, - maxMessageChars: config.maxMessageChars ?? 4e3, - logger: { - error: (...args) => logger.error?.(`[${botId}]`, ...args), - warn: (...args) => logger.warn?.(`[${botId}]`, ...args), - info: (...args) => logger.info?.(`[${botId}]`, ...args), - debug: (...args) => logger.debug?.(`[${botId}]`, ...args) - } - }); - }, - deleteState: async ({ botId }) => { - const state = stateStores.get(botId); - stateStores.delete(botId); - if (state && typeof state.remove === "function") { - await state.remove(); - return; - } - try { - await unlink17(statePath(botId)); - } catch (error) { - if (error?.code !== "ENOENT") throw error; - } - } - }); - const supervisor = createSupervisor({ - controller, - harness, - logger, - retryDelaysMs: config.retryDelaysMs, - healthyIntervalMs: config.healthyIntervalMs - }).start(); - return { - controller, - ready: supervisor.ready, - async close() { - await supervisor.close(); - await controller.close(); - harness.stopManagedProcess(); - } - }; -} - -// plugin-src/host/channels/weixin/rpc.mjs -import QRCode5 from "qrcode"; -var WEIXIN_RPC_CHANNEL = "/weixin"; -var WEIXIN_ENDPOINTS = Object.freeze({ - status: "connection.status", - beginProvisioning: "provision.begin", - pollProvisioning: "provision.poll", - submitVerification: "provision.verify", - cancelProvisioning: "provision.cancel", - reconnectBot: "bot.reconnect", - deleteBot: "bot.delete" -}); -var WEIXIN_RPC_ENDPOINTS = Object.freeze(Object.values(WEIXIN_ENDPOINTS)); -function isRecord5(value) { - return value !== null && typeof value === "object" && !Array.isArray(value); -} -function exactKeys5(value, allowed) { - return isRecord5(value) && Object.keys(value).every((key) => allowed.includes(key)); -} -function validId5(value) { - return typeof value === "string" && /^[A-Za-z0-9_-]{1,128}$/.test(value); -} -function payloadFailure5(endpoint, payload) { - if (!isRecord5(payload)) return "Payload must be an object."; - if (endpoint === WEIXIN_ENDPOINTS.status) { - return exactKeys5(payload, []) ? null : "connection.status does not accept fields."; - } - if (endpoint === WEIXIN_ENDPOINTS.beginProvisioning) { - return exactKeys5(payload, ["locale"]) && (payload.locale === void 0 || payload.locale === "zh-CN") ? null : "provision.begin received unsupported fields."; - } - if ([WEIXIN_ENDPOINTS.pollProvisioning, WEIXIN_ENDPOINTS.cancelProvisioning].includes(endpoint)) { - return exactKeys5(payload, ["attemptId"]) && validId5(payload.attemptId) ? null : `${endpoint} requires an attemptId.`; - } - if (endpoint === WEIXIN_ENDPOINTS.submitVerification) { - return exactKeys5(payload, ["attemptId", "verifyCode"]) && validId5(payload.attemptId) && typeof payload.verifyCode === "string" && /^\d{4,8}$/.test(payload.verifyCode) ? null : "provision.verify requires an attemptId and a 4-to-8-digit code."; - } - if (endpoint === WEIXIN_ENDPOINTS.reconnectBot) { - return exactKeys5(payload, ["botId"]) && validId5(payload.botId) ? null : "bot.reconnect requires a botId."; - } - if (endpoint === WEIXIN_ENDPOINTS.deleteBot) { - return exactKeys5(payload, ["botId", "confirm"]) && validId5(payload.botId) && payload.confirm === true ? null : "bot.delete requires a botId and confirm=true."; - } - return "Unknown Weixin endpoint."; -} -function badRequest3(message) { - return { ok: false, error: { code: "bad-request", message } }; -} -function cancelled3() { - return { ok: false, error: { code: "cancelled", message: "The request was cancelled." } }; -} -function internalFailure3() { - return { - ok: false, - error: { code: "weixin-operation-failed", message: "\u5FAE\u4FE1\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002" } - }; -} -async function qrDataUrl4(value) { - return QRCode5.toDataURL(value, { - type: "image/png", - errorCorrectionLevel: "M", - margin: 2, - width: 320 - }); -} -async function withEncodedQr4(value, encodeQr) { - if (!value || !value.verificationUrl) return value; - return { - ...value, - qrCodeDataUrl: await encodeQr(value.verificationUrl) - }; -} -async function publicStatus4(status, encodeQr) { - const safe = structuredClone(status); - if (safe.provisioning) safe.provisioning = await withEncodedQr4(safe.provisioning, encodeQr); - return safe; -} -function assertController3(controller) { - if (!controller || typeof controller.status !== "function" || typeof controller.startProvisioning !== "function" || typeof controller.registrationStatus !== "function" || typeof controller.submitVerification !== "function" || typeof controller.cancelProvisioning !== "function" || typeof controller.reconnectBot !== "function" || typeof controller.deleteBot !== "function") { - throw new TypeError("A complete Weixin controller is required"); - } -} -function createWeixinRpcHandler(controller, { encodeQr = qrDataUrl4 } = {}) { - assertController3(controller); - const qrCache = /* @__PURE__ */ new Map(); - const cachedEncode = (url) => { - let encoded = qrCache.get(url); - if (!encoded) { - if (qrCache.size >= 16) qrCache.delete(qrCache.keys().next().value); - encoded = Promise.resolve().then(() => encodeQr(url)); - qrCache.set(url, encoded); - } - return encoded; - }; - return async (endpoint, payload, signal) => { - if (signal?.aborted) return cancelled3(); - if (!WEIXIN_RPC_ENDPOINTS.includes(endpoint)) return badRequest3("Unknown Weixin endpoint."); - const invalid = payloadFailure5(endpoint, payload); - if (invalid) return badRequest3(invalid); - try { - let value; - if (endpoint === WEIXIN_ENDPOINTS.status) { - value = await publicStatus4(await controller.status(), cachedEncode); - } else if (endpoint === WEIXIN_ENDPOINTS.beginProvisioning) { - const started = await controller.startProvisioning(); - if (signal?.aborted) { - await controller.cancelProvisioning(started.attemptId); - return cancelled3(); - } - value = await withEncodedQr4(started, cachedEncode); - } else if (endpoint === WEIXIN_ENDPOINTS.pollProvisioning) { - const current = await controller.registrationStatus(payload.attemptId); - if (!current) return badRequest3("The provisioning attempt no longer exists."); - value = await withEncodedQr4(current, cachedEncode); - } else if (endpoint === WEIXIN_ENDPOINTS.submitVerification) { - value = await withEncodedQr4( - await controller.submitVerification(payload.attemptId, payload.verifyCode), - cachedEncode - ); - } else if (endpoint === WEIXIN_ENDPOINTS.cancelProvisioning) { - value = await controller.cancelProvisioning(payload.attemptId); - if (!value) return badRequest3("The provisioning attempt no longer exists."); - } else if (endpoint === WEIXIN_ENDPOINTS.reconnectBot) { - value = await publicStatus4(await controller.reconnectBot(payload.botId), cachedEncode); - } else { - value = await publicStatus4(await controller.deleteBot(payload.botId), cachedEncode); - } - return signal?.aborted ? cancelled3() : { ok: true, value }; - } catch { - return signal?.aborted ? cancelled3() : internalFailure3(); - } - }; -} -function installWeixinRpc(ctx, controller, options, authority) { - if (!ctx?.connection?.rpc || typeof ctx.connection.rpc.handle !== "function") { - throw new TypeError("DSH Host Connection RPC is required"); - } - return ctx.connection.rpc.handle( - WEIXIN_RPC_CHANNEL, - createWeixinRpcHandler(controller, options), - { authority: resolveRpcAuthority(authority) } - ); -} - -// plugin-src/host/channels/weixin/index.mjs -async function apply7(ctx, config = {}) { - if (config?.controller) { - return installWeixinRpc(ctx, config.controller, config.rpcOptions, config.rpcAuthority); - } - const production = await createProductionController7(ctx, config, config.internals); - const disposeRpc = installWeixinRpc( - ctx, - production.controller, - config.rpcOptions, - config.rpcAuthority - ); - ctx.effect(() => async () => { - await production.close(); - }, "dsh-weixin: close account connections"); - return disposeRpc; -} - -// plugin-src/host/index.mjs -var name = "dsh-im-host"; -var inject = ["connection", "credentials", "webServer"]; -function channelConfig(config, name2) { - const channel = config[name2] ?? {}; - return config.rpcAuthority === void 0 ? channel : { ...channel, rpcAuthority: config.rpcAuthority }; -} -function createImHostPlugin(internals = {}) { - const startFeishu = internals.applyFeishu ?? apply3; - const startWeixin = internals.applyWeixin ?? apply7; - const startDingtalk = internals.applyDingtalk ?? apply; - const startWecom = internals.applyWecom ?? apply6; - const startQq = internals.applyQq ?? apply4; - const startTelegram = internals.applyTelegram ?? apply5; - const startDiscord = internals.applyDiscord ?? apply2; - return Object.freeze({ - name, - inject, - async apply(ctx, config = {}) { - await startFeishu(ctx, channelConfig(config, "feishu")); - await startWeixin(ctx, channelConfig(config, "weixin")); - await startDingtalk(ctx, channelConfig(config, "dingtalk")); - await startWecom(ctx, channelConfig(config, "wecom")); - await startQq(ctx, channelConfig(config, "qq")); - await startTelegram(ctx, channelConfig(config, "telegram")); - await startDiscord(ctx, channelConfig(config, "discord")); - } - }); -} -async function apply8(ctx, config = {}) { - return createImHostPlugin().apply(ctx, config); -} -export { - apply8 as apply, - createImHostPlugin, - inject, - name -}; +import { createRequire as __dshCreateRequire } from 'node:module'; +import { dirname as __dshDirname } from 'node:path'; +import { fileURLToPath as __dshFileURLToPath } from 'node:url'; +const require = __dshCreateRequire(import.meta.url); +const __filename = __dshFileURLToPath(import.meta.url); +const __dirname = __dshDirname(__filename); +var lP=Object.create;var Jd=Object.defineProperty;var pP=Object.getOwnPropertyDescriptor;var uP=Object.getOwnPropertyNames;var mP=Object.getPrototypeOf,fP=Object.prototype.hasOwnProperty;var Q=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var j=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),ig=(n,t)=>{for(var r in t)Jd(n,r,{get:t[r],enumerable:!0})},yP=(n,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of uP(t))!fP.call(n,i)&&i!==r&&Jd(n,i,{get:()=>t[i],enumerable:!(a=pP(t,i))||a.enumerable});return n};var Ve=(n,t,r)=>(r=n!=null?lP(mP(n)):{},yP(t||!n||!n.__esModule?Jd(r,"default",{value:n,enumerable:!0}):r,n));var lv=j((P4,cv)=>{var dv=Q("stream").Stream,TF=Q("util");cv.exports=Tt;function Tt(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}TF.inherits(Tt,dv);Tt.create=function(n,t){var r=new this;t=t||{};for(var a in t)r[a]=t[a];r.source=n;var i=n.emit;return n.emit=function(){return r._handleEmit(arguments),i.apply(n,arguments)},n.on("error",function(){}),r.pauseStream&&n.pause(),r};Object.defineProperty(Tt.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}});Tt.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};Tt.prototype.resume=function(){this._released||this.release(),this.source.resume()};Tt.prototype.pause=function(){this.source.pause()};Tt.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(n){this.emit.apply(this,n)}.bind(this)),this._bufferedEvents=[]};Tt.prototype.pipe=function(){var n=dv.prototype.pipe.apply(this,arguments);return this.resume(),n};Tt.prototype._handleEmit=function(n){if(this._released){this.emit.apply(this,n);return}n[0]==="data"&&(this.dataSize+=n[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(n)};Tt.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var n="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(n))}}});var fv=j((q4,mv)=>{var xF=Q("util"),uv=Q("stream").Stream,pv=lv();mv.exports=Pe;function Pe(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}xF.inherits(Pe,uv);Pe.create=function(n){var t=new this;n=n||{};for(var r in n)t[r]=n[r];return t};Pe.isStreamLike=function(n){return typeof n!="function"&&typeof n!="string"&&typeof n!="boolean"&&typeof n!="number"&&!Buffer.isBuffer(n)};Pe.prototype.append=function(n){var t=Pe.isStreamLike(n);if(t){if(!(n instanceof pv)){var r=pv.create(n,{maxDataSize:1/0,pauseStream:this.pauseStreams});n.on("data",this._checkDataSize.bind(this)),n=r}this._handleErrors(n),this.pauseStreams&&n.pause()}return this._streams.push(n),this};Pe.prototype.pipe=function(n,t){return uv.prototype.pipe.call(this,n,t),this.resume(),n};Pe.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};Pe.prototype._realGetNext=function(){var n=this._streams.shift();if(typeof n>"u"){this.end();return}if(typeof n!="function"){this._pipeNext(n);return}var t=n;t(function(r){var a=Pe.isStreamLike(r);a&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};Pe.prototype._pipeNext=function(n){this._currentStream=n;var t=Pe.isStreamLike(n);if(t){n.on("end",this._getNext.bind(this)),n.pipe(this,{end:!1});return}var r=n;this.write(r),this._getNext()};Pe.prototype._handleErrors=function(n){var t=this;n.on("error",function(r){t._emitError(r)})};Pe.prototype.write=function(n){this.emit("data",n)};Pe.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};Pe.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};Pe.prototype.end=function(){this._reset(),this.emit("end")};Pe.prototype.destroy=function(){this._reset(),this.emit("close")};Pe.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};Pe.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var n="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(n))}};Pe.prototype._updateDataSize=function(){this.dataSize=0;var n=this;this._streams.forEach(function(t){t.dataSize&&(n.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};Pe.prototype._emitError=function(n){this._reset(),this.emit("error",n)}});var yv=j((E4,PF)=>{PF.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var vv=j((F4,gv)=>{gv.exports=yv()});var wv=j(Ze=>{"use strict";var nn=vv(),qF=Q("path").extname,_v=/^\s*([^;\s]*)(?:;|\s|$)/,EF=/^text\//i;Ze.charset=bv;Ze.charsets={lookup:bv};Ze.contentType=FF;Ze.extension=OF;Ze.extensions=Object.create(null);Ze.lookup=$F;Ze.types=Object.create(null);zF(Ze.extensions,Ze.types);function bv(n){if(!n||typeof n!="string")return!1;var t=_v.exec(n),r=t&&nn[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&EF.test(t[1])?"UTF-8":!1}function FF(n){if(!n||typeof n!="string")return!1;var t=n.indexOf("/")===-1?Ze.lookup(n):n;if(!t)return!1;if(t.indexOf("charset")===-1){var r=Ze.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}function OF(n){if(!n||typeof n!="string")return!1;var t=_v.exec(n),r=t&&Ze.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}function $F(n){if(!n||typeof n!="string")return!1;var t=qF("x."+n).toLowerCase().substr(1);return t&&Ze.types[t]||!1}function zF(n,t){var r=["nginx","apache",void 0,"iana"];Object.keys(nn).forEach(function(i){var s=nn[i],o=s.extensions;if(!(!o||!o.length)){n[i]=o;for(var e=0;ef||u===f&&t[y].substr(0,12)==="application/"))continue}t[y]=i}}})}});var Iv=j(($4,Sv)=>{Sv.exports=RF;function RF(n){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(n):setTimeout(n,0)}});var qc=j((z4,Tv)=>{var kv=Iv();Tv.exports=AF;function AF(n){var t=!1;return kv(function(){t=!0}),function(a,i){t?n(a,i):kv(function(){n(a,i)})}}});var Ec=j((R4,xv)=>{xv.exports=CF;function CF(n){Object.keys(n.jobs).forEach(jF.bind(n)),n.jobs={}}function jF(n){typeof this.jobs[n]=="function"&&this.jobs[n]()}});var Fc=j((A4,qv)=>{var Pv=qc(),DF=Ec();qv.exports=GF;function GF(n,t,r,a){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=BF(t,i,n[i],function(s,o){i in r.jobs&&(delete r.jobs[i],s?DF(r):r.results[i]=o,a(s,r.results))})}function BF(n,t,r,a){var i;return n.length==2?i=n(r,Pv(a)):i=n(r,t,Pv(a)),i}});var Oc=j((C4,Ev)=>{Ev.exports=MF;function MF(n,t){var r=!Array.isArray(n),a={index:0,keyedList:r||t?Object.keys(n):null,jobs:{},results:r?{}:[],size:r?Object.keys(n).length:n.length};return t&&a.keyedList.sort(r?t:function(i,s){return t(n[i],n[s])}),a}});var $c=j((j4,Fv)=>{var LF=Ec(),NF=qc();Fv.exports=UF;function UF(n){Object.keys(this.jobs).length&&(this.index=this.size,LF(this),NF(n)(null,this.results))}});var $v=j((D4,Ov)=>{var WF=Fc(),HF=Oc(),QF=$c();Ov.exports=VF;function VF(n,t,r){for(var a=HF(n);a.index<(a.keyedList||n).length;)WF(n,t,a,function(i,s){if(i){r(i,s);return}if(Object.keys(a.jobs).length===0){r(null,a.results);return}}),a.index++;return QF.bind(a,r)}});var zc=j((G4,hn)=>{var zv=Fc(),KF=Oc(),JF=$c();hn.exports=XF;hn.exports.ascending=Rv;hn.exports.descending=YF;function XF(n,t,r,a){var i=KF(n,r);return zv(n,t,i,function s(o,e){if(o){a(o,e);return}if(i.index++,i.index<(i.keyedList||n).length){zv(n,t,i,s);return}a(null,i.results)}),JF.bind(i,a)}function Rv(n,t){return nt?1:0}function YF(n,t){return-1*Rv(n,t)}});var Cv=j((B4,Av)=>{var ZF=zc();Av.exports=e1;function e1(n,t,r){return ZF(n,t,null,r)}});var Dv=j((M4,jv)=>{jv.exports={parallel:$v(),serial:Cv(),serialOrdered:zc()}});var Rc=j((L4,Gv)=>{"use strict";Gv.exports=Object});var Mv=j((N4,Bv)=>{"use strict";Bv.exports=Error});var Nv=j((U4,Lv)=>{"use strict";Lv.exports=EvalError});var Wv=j((W4,Uv)=>{"use strict";Uv.exports=RangeError});var Qv=j((H4,Hv)=>{"use strict";Hv.exports=ReferenceError});var Kv=j((Q4,Vv)=>{"use strict";Vv.exports=SyntaxError});var lr=j((V4,Jv)=>{"use strict";Jv.exports=TypeError});var Yv=j((K4,Xv)=>{"use strict";Xv.exports=URIError});var e_=j((J4,Zv)=>{"use strict";Zv.exports=Math.abs});var r_=j((X4,t_)=>{"use strict";t_.exports=Math.floor});var i_=j((Y4,a_)=>{"use strict";a_.exports=Math.max});var o_=j((Z4,s_)=>{"use strict";s_.exports=Math.min});var h_=j((eH,n_)=>{"use strict";n_.exports=Math.pow});var c_=j((tH,d_)=>{"use strict";d_.exports=Math.round});var p_=j((rH,l_)=>{"use strict";l_.exports=Number.isNaN||function(t){return t!==t}});var m_=j((aH,u_)=>{"use strict";var t1=p_();u_.exports=function(t){return t1(t)||t===0?t:t<0?-1:1}});var y_=j((iH,f_)=>{"use strict";f_.exports=Object.getOwnPropertyDescriptor});var Ac=j((sH,g_)=>{"use strict";var dn=y_();if(dn)try{dn([],"length")}catch{dn=null}g_.exports=dn});var Cc=j((oH,v_)=>{"use strict";var cn=Object.defineProperty||!1;if(cn)try{cn({},"a",{value:1})}catch{cn=!1}v_.exports=cn});var jc=j((nH,__)=>{"use strict";__.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),a=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(a)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var e=Object.getOwnPropertyDescriptor(t,r);if(e.value!==i||e.enumerable!==!0)return!1}return!0}});var S_=j((hH,w_)=>{"use strict";var b_=typeof Symbol<"u"&&Symbol,r1=jc();w_.exports=function(){return typeof b_!="function"||typeof Symbol!="function"||typeof b_("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:r1()}});var Dc=j((dH,I_)=>{"use strict";I_.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Gc=j((cH,k_)=>{"use strict";var a1=Rc();k_.exports=a1.getPrototypeOf||null});var P_=j((lH,x_)=>{"use strict";var i1="Function.prototype.bind called on incompatible ",s1=Object.prototype.toString,o1=Math.max,n1="[object Function]",T_=function(t,r){for(var a=[],i=0;i{"use strict";var c1=P_();q_.exports=Function.prototype.bind||c1});var ln=j((uH,E_)=>{"use strict";E_.exports=Function.prototype.call});var Bc=j((mH,F_)=>{"use strict";F_.exports=Function.prototype.apply});var $_=j((fH,O_)=>{"use strict";O_.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var R_=j((yH,z_)=>{"use strict";var l1=Xi(),p1=Bc(),u1=ln(),m1=$_();z_.exports=m1||l1.call(u1,p1)});var Mc=j((gH,A_)=>{"use strict";var f1=Xi(),y1=lr(),g1=ln(),v1=R_();A_.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new y1("a function is required");return v1(f1,g1,t)}});var M_=j((vH,B_)=>{"use strict";var _1=Mc(),C_=Ac(),D_;try{D_=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var Lc=!!D_&&C_&&C_(Object.prototype,"__proto__"),G_=Object,j_=G_.getPrototypeOf;B_.exports=Lc&&typeof Lc.get=="function"?_1([Lc.get]):typeof j_=="function"?function(t){return j_(t==null?t:G_(t))}:!1});var H_=j((_H,W_)=>{"use strict";var L_=Dc(),N_=Gc(),U_=M_();W_.exports=L_?function(t){return L_(t)}:N_?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return N_(t)}:U_?function(t){return U_(t)}:null});var pn=j((bH,Q_)=>{"use strict";var b1=Function.prototype.call,w1=Object.prototype.hasOwnProperty,S1=Xi();Q_.exports=S1.call(b1,w1)});var ts=j((wH,Z_)=>{"use strict";var re,I1=Rc(),k1=Mv(),T1=Nv(),x1=Wv(),P1=Qv(),Ga=Kv(),Da=lr(),q1=Yv(),E1=e_(),F1=r_(),O1=i_(),$1=o_(),z1=h_(),R1=c_(),A1=m_(),X_=Function,Nc=function(n){try{return X_('"use strict"; return ('+n+").constructor;")()}catch{}},Yi=Ac(),C1=Cc(),Uc=function(){throw new Da},j1=Yi?(function(){try{return arguments.callee,Uc}catch{try{return Yi(arguments,"callee").get}catch{return Uc}}})():Uc,Ca=S_()(),je=H_(),D1=Gc(),G1=Dc(),Y_=Bc(),Zi=ln(),ja={},B1=typeof Uint8Array>"u"||!je?re:je(Uint8Array),jr={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?re:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?re:ArrayBuffer,"%ArrayIteratorPrototype%":Ca&&je?je([][Symbol.iterator]()):re,"%AsyncFromSyncIteratorPrototype%":re,"%AsyncFunction%":ja,"%AsyncGenerator%":ja,"%AsyncGeneratorFunction%":ja,"%AsyncIteratorPrototype%":ja,"%Atomics%":typeof Atomics>"u"?re:Atomics,"%BigInt%":typeof BigInt>"u"?re:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?re:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?re:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?re:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":k1,"%eval%":eval,"%EvalError%":T1,"%Float16Array%":typeof Float16Array>"u"?re:Float16Array,"%Float32Array%":typeof Float32Array>"u"?re:Float32Array,"%Float64Array%":typeof Float64Array>"u"?re:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?re:FinalizationRegistry,"%Function%":X_,"%GeneratorFunction%":ja,"%Int8Array%":typeof Int8Array>"u"?re:Int8Array,"%Int16Array%":typeof Int16Array>"u"?re:Int16Array,"%Int32Array%":typeof Int32Array>"u"?re:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ca&&je?je(je([][Symbol.iterator]())):re,"%JSON%":typeof JSON=="object"?JSON:re,"%Map%":typeof Map>"u"?re:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ca||!je?re:je(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":I1,"%Object.getOwnPropertyDescriptor%":Yi,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?re:Promise,"%Proxy%":typeof Proxy>"u"?re:Proxy,"%RangeError%":x1,"%ReferenceError%":P1,"%Reflect%":typeof Reflect>"u"?re:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?re:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ca||!je?re:je(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?re:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ca&&je?je(""[Symbol.iterator]()):re,"%Symbol%":Ca?Symbol:re,"%SyntaxError%":Ga,"%ThrowTypeError%":j1,"%TypedArray%":B1,"%TypeError%":Da,"%Uint8Array%":typeof Uint8Array>"u"?re:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?re:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?re:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?re:Uint32Array,"%URIError%":q1,"%WeakMap%":typeof WeakMap>"u"?re:WeakMap,"%WeakRef%":typeof WeakRef>"u"?re:WeakRef,"%WeakSet%":typeof WeakSet>"u"?re:WeakSet,"%Function.prototype.call%":Zi,"%Function.prototype.apply%":Y_,"%Object.defineProperty%":C1,"%Object.getPrototypeOf%":D1,"%Math.abs%":E1,"%Math.floor%":F1,"%Math.max%":O1,"%Math.min%":$1,"%Math.pow%":z1,"%Math.round%":R1,"%Math.sign%":A1,"%Reflect.getPrototypeOf%":G1};if(je)try{null.error}catch(n){V_=je(je(n)),jr["%Error.prototype%"]=V_}var V_,M1=function n(t){var r;if(t==="%AsyncFunction%")r=Nc("async function () {}");else if(t==="%GeneratorFunction%")r=Nc("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Nc("async function* () {}");else if(t==="%AsyncGenerator%"){var a=n("%AsyncGeneratorFunction%");a&&(r=a.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=n("%AsyncGenerator%");i&&je&&(r=je(i.prototype))}return jr[t]=r,r},K_={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},es=Xi(),un=pn(),L1=es.call(Zi,Array.prototype.concat),N1=es.call(Y_,Array.prototype.splice),J_=es.call(Zi,String.prototype.replace),mn=es.call(Zi,String.prototype.slice),U1=es.call(Zi,RegExp.prototype.exec),W1=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,H1=/\\(\\)?/g,Q1=function(t){var r=mn(t,0,1),a=mn(t,-1);if(r==="%"&&a!=="%")throw new Ga("invalid intrinsic syntax, expected closing `%`");if(a==="%"&&r!=="%")throw new Ga("invalid intrinsic syntax, expected opening `%`");var i=[];return J_(t,W1,function(s,o,e,y){i[i.length]=e?J_(y,H1,"$1"):o||s}),i},V1=function(t,r){var a=t,i;if(un(K_,a)&&(i=K_[a],a="%"+i[0]+"%"),un(jr,a)){var s=jr[a];if(s===ja&&(s=M1(a)),typeof s>"u"&&!r)throw new Da("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:a,value:s}}throw new Ga("intrinsic "+t+" does not exist!")};Z_.exports=function(t,r){if(typeof t!="string"||t.length===0)throw new Da("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Da('"allowMissing" argument must be a boolean');if(U1(/^%?[^%]*%?$/,t)===null)throw new Ga("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var a=Q1(t),i=a.length>0?a[0]:"",s=V1("%"+i+"%",r),o=s.name,e=s.value,y=!1,u=s.alias;u&&(i=u[0],N1(a,L1([0,1],u)));for(var f=1,d=!0;f=a.length){var b=Yi(e,m);d=!!b,d&&"get"in b&&!("originalValue"in b.get)?e=b.get:e=e[m]}else d=un(e,m),e=e[m];d&&!y&&(jr[o]=e)}}return e}});var t0=j((SH,e0)=>{"use strict";var K1=jc();e0.exports=function(){return K1()&&!!Symbol.toStringTag}});var i0=j((IH,a0)=>{"use strict";var J1=ts(),r0=J1("%Object.defineProperty%",!0),X1=t0()(),Y1=pn(),Z1=lr(),fn=X1?Symbol.toStringTag:null;a0.exports=function(t,r){var a=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof a<"u"&&typeof a!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new Z1("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");fn&&(a||!Y1(t,fn))&&(r0?r0(t,fn,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[fn]=r)}});var o0=j((kH,s0)=>{"use strict";s0.exports=function(n,t){return Object.keys(t).forEach(function(r){n[r]=n[r]||t[r]}),n}});var d0=j((TH,h0)=>{"use strict";var Vc=fv(),eO=Q("util"),Wc=Q("path"),tO=Q("http"),rO=Q("https"),aO=Q("url").parse,iO=Q("fs"),sO=Q("stream").Stream,oO=Q("crypto"),Hc=wv(),nO=Dv(),hO=i0(),pr=pn(),Qc=o0();function n0(n){return String(n).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}function se(n){if(!(this instanceof se))return new se(n);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Vc.call(this),n=n||{};for(var t in n)this[t]=n[t]}eO.inherits(se,Vc);se.LINE_BREAK=`\r +`;se.DEFAULT_CONTENT_TYPE="application/octet-stream";se.prototype.append=function(n,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var a=Vc.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(n,t,r),s=this._multiPartFooter();a(i),a(t),a(s),this._trackLength(i,t,r)};se.prototype._trackLength=function(n,t,r){var a=0;r.knownLength!=null?a+=Number(r.knownLength):Buffer.isBuffer(t)?a=t.length:typeof t=="string"&&(a=Buffer.byteLength(t)),this._valueLength+=a,this._overheadLength+=Buffer.byteLength(n)+se.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&pr(t,"httpVersion"))&&!(t instanceof sO))&&(r.knownLength||this._valuesToMeasure.push(t))};se.prototype._lengthRetriever=function(n,t){pr(n,"fd")?n.end!=null&&n.end!=1/0&&n.start!=null?t(null,n.end+1-(n.start?n.start:0)):iO.stat(n.path,function(r,a){if(r){t(r);return}var i=a.size-(n.start?n.start:0);t(null,i)}):pr(n,"httpVersion")?t(null,Number(n.headers["content-length"])):pr(n,"httpModule")?(n.on("response",function(r){n.pause(),t(null,Number(r.headers["content-length"]))}),n.resume()):t("Unknown stream")};se.prototype._multiPartHeader=function(n,t,r){if(typeof r.header=="string")return r.header;var a=this._getContentDisposition(t,r),i=this._getContentType(t,r),s="",o={"Content-Disposition":["form-data",'name="'+n0(n)+'"'].concat(a||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&Qc(o,r.header);var e;for(var y in o)if(pr(o,y)){if(e=o[y],e==null)continue;Array.isArray(e)||(e=[e]),e.length&&(s+=y+": "+e.join("; ")+se.LINE_BREAK)}return"--"+this.getBoundary()+se.LINE_BREAK+s+se.LINE_BREAK};se.prototype._getContentDisposition=function(n,t){var r;if(typeof t.filepath=="string"?r=Wc.normalize(t.filepath).replace(/\\/g,"/"):t.filename||n&&(n.name||n.path)?r=Wc.basename(t.filename||n&&(n.name||n.path)):n&&n.readable&&pr(n,"httpVersion")&&(r=Wc.basename(n.client._httpMessage.path||"")),r)return'filename="'+n0(r)+'"'};se.prototype._getContentType=function(n,t){var r=t.contentType;return!r&&n&&n.name&&(r=Hc.lookup(n.name)),!r&&n&&n.path&&(r=Hc.lookup(n.path)),!r&&n&&n.readable&&pr(n,"httpVersion")&&(r=n.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=Hc.lookup(t.filepath||t.filename)),!r&&n&&typeof n=="object"&&(r=se.DEFAULT_CONTENT_TYPE),r};se.prototype._multiPartFooter=function(){return function(n){var t=se.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),n(t)}.bind(this)};se.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+se.LINE_BREAK};se.prototype.getHeaders=function(n){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in n)pr(n,t)&&(r[t.toLowerCase()]=n[t]);return r};se.prototype.setBoundary=function(n){if(typeof n!="string")throw new TypeError("FormData boundary must be a string");this._boundary=n};se.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};se.prototype.getBuffer=function(){for(var n=new Buffer.alloc(0),t=this.getBoundary(),r=0,a=this._streams.length;r{var La=1e3,Na=La*60,Ua=Na*60,Br=Ua*24,$O=Br*7,zO=Br*365.25;k0.exports=function(n,t){t=t||{};var r=typeof n;if(r==="string"&&n.length>0)return RO(n);if(r==="number"&&isFinite(n))return t.long?CO(n):AO(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function RO(n){if(n=String(n),!(n.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(n);if(t){var r=parseFloat(t[1]),a=(t[2]||"ms").toLowerCase();switch(a){case"years":case"year":case"yrs":case"yr":case"y":return r*zO;case"weeks":case"week":case"w":return r*$O;case"days":case"day":case"d":return r*Br;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Ua;case"minutes":case"minute":case"mins":case"min":case"m":return r*Na;case"seconds":case"second":case"secs":case"sec":case"s":return r*La;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function AO(n){var t=Math.abs(n);return t>=Br?Math.round(n/Br)+"d":t>=Ua?Math.round(n/Ua)+"h":t>=Na?Math.round(n/Na)+"m":t>=La?Math.round(n/La)+"s":n+"ms"}function CO(n){var t=Math.abs(n);return t>=Br?_n(n,t,Br,"day"):t>=Ua?_n(n,t,Ua,"hour"):t>=Na?_n(n,t,Na,"minute"):t>=La?_n(n,t,La,"second"):n+" ms"}function _n(n,t,r,a){var i=t>=r*1.5;return Math.round(n/r)+" "+a+(i?"s":"")}});var cl=j((q6,x0)=>{function jO(n){r.debug=r,r.default=r,r.coerce=y,r.disable=o,r.enable=i,r.enabled=e,r.humanize=T0(),r.destroy=u,Object.keys(n).forEach(f=>{r[f]=n[f]}),r.names=[],r.skips=[],r.formatters={};function t(f){let d=0;for(let m=0;m{if(A==="%%")return"%";F++;let M=r.formatters[G];if(typeof M=="function"){let N=w[F];A=M.call(S,N),w.splice(F,1),F--}return A}),r.formatArgs.call(S,w),(S.log||r.log).apply(S,w)}return b.namespace=f,b.useColors=r.useColors(),b.color=r.selectColor(f),b.extend=a,b.destroy=r.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(g!==r.namespaces&&(g=r.namespaces,_=r.enabled(f)),_),set:w=>{m=w}}),typeof r.init=="function"&&r.init(b),b}function a(f,d){let m=r(this.namespace+(typeof d>"u"?":":d)+f);return m.log=this.log,m}function i(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let d=(typeof f=="string"?f:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let m of d)m[0]==="-"?r.skips.push(m.slice(1)):r.names.push(m)}function s(f,d){let m=0,g=0,_=-1,b=0;for(;m"-"+d)].join(",");return r.enable(""),f}function e(f){for(let d of r.skips)if(s(f,d))return!1;for(let d of r.names)if(s(f,d))return!0;return!1}function y(f){return f instanceof Error?f.stack||f.message:f}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}x0.exports=jO});var P0=j((et,bn)=>{et.formatArgs=GO;et.save=BO;et.load=MO;et.useColors=DO;et.storage=LO();et.destroy=(()=>{let n=!1;return()=>{n||(n=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();et.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function DO(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let n;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(n=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(n[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function GO(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+bn.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;n.splice(1,0,t,"color: inherit");let r=0,a=0;n[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(a=r))}),n.splice(a,0,t)}et.log=console.debug||console.log||(()=>{});function BO(n){try{n?et.storage.setItem("debug",n):et.storage.removeItem("debug")}catch{}}function MO(){let n;try{n=et.storage.getItem("debug")||et.storage.getItem("DEBUG")}catch{}return!n&&typeof process<"u"&&"env"in process&&(n=process.env.DEBUG),n}function LO(){try{return localStorage}catch{}}bn.exports=cl()(et);var{formatters:NO}=bn.exports;NO.j=function(n){try{return JSON.stringify(n)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var E0=j((De,Sn)=>{var UO=Q("tty"),wn=Q("util");De.init=XO;De.log=VO;De.formatArgs=HO;De.save=KO;De.load=JO;De.useColors=WO;De.destroy=wn.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");De.colors=[6,2,3,4,5,1];try{let n=Q("supports-color");n&&(n.stderr||n).level>=2&&(De.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}De.inspectOpts=Object.keys(process.env).filter(n=>/^debug_/i.test(n)).reduce((n,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(i,s)=>s.toUpperCase()),a=process.env[t];return/^(yes|on|true|enabled)$/i.test(a)?a=!0:/^(no|off|false|disabled)$/i.test(a)?a=!1:a==="null"?a=null:a=Number(a),n[r]=a,n},{});function WO(){return"colors"in De.inspectOpts?!!De.inspectOpts.colors:UO.isatty(process.stderr.fd)}function HO(n){let{namespace:t,useColors:r}=this;if(r){let a=this.color,i="\x1B[3"+(a<8?a:"8;5;"+a),s=` ${i};1m${t} \x1B[0m`;n[0]=s+n[0].split(` +`).join(` +`+s),n.push(i+"m+"+Sn.exports.humanize(this.diff)+"\x1B[0m")}else n[0]=QO()+t+" "+n[0]}function QO(){return De.inspectOpts.hideDate?"":new Date().toISOString()+" "}function VO(...n){return process.stderr.write(wn.formatWithOptions(De.inspectOpts,...n)+` +`)}function KO(n){n?process.env.DEBUG=n:delete process.env.DEBUG}function JO(){return process.env.DEBUG}function XO(n){n.inspectOpts={};let t=Object.keys(De.inspectOpts);for(let r=0;rt.trim()).join(" ")};q0.O=function(n){return this.inspectOpts.colors=this.useColors,wn.inspect(n,this.inspectOpts)}});var is=j((E6,ll)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?ll.exports=P0():ll.exports=E0()});var F0=j(pl=>{"use strict";Object.defineProperty(pl,"__esModule",{value:!0});function YO(n){return function(t,r){return new Promise((a,i)=>{n.call(this,t,r,(s,o)=>{s?i(s):a(o)})})}}pl.default=YO});var z0=j((ml,$0)=>{"use strict";var O0=ml&&ml.__importDefault||function(n){return n&&n.__esModule?n:{default:n}},ZO=Q("events"),e$=O0(is()),t$=O0(F0()),ss=e$.default("agent-base");function r$(n){return!!n&&typeof n.addRequest=="function"}function ul(){let{stack:n}=new Error;return typeof n!="string"?!1:n.split(` +`).some(t=>t.indexOf("(https.js:")!==-1||t.indexOf("node:https:")!==-1)}function In(n,t){return new In.Agent(n,t)}(function(n){class t extends ZO.EventEmitter{constructor(a,i){super();let s=i;typeof a=="function"?this.callback=a:a&&(s=a),this.timeout=null,s&&typeof s.timeout=="number"&&(this.timeout=s.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return typeof this.explicitDefaultPort=="number"?this.explicitDefaultPort:ul()?443:80}set defaultPort(a){this.explicitDefaultPort=a}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:ul()?"https:":"http:"}set protocol(a){this.explicitProtocol=a}callback(a,i,s){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(a,i){let s=Object.assign({},i);typeof s.secureEndpoint!="boolean"&&(s.secureEndpoint=ul()),s.host==null&&(s.host="localhost"),s.port==null&&(s.port=s.secureEndpoint?443:80),s.protocol==null&&(s.protocol=s.secureEndpoint?"https:":"http:"),s.host&&s.path&&delete s.path,delete s.agent,delete s.hostname,delete s._defaultAgent,delete s.defaultPort,delete s.createConnection,a._last=!0,a.shouldKeepAlive=!1;let o=!1,e=null,y=s.timeout||this.timeout,u=g=>{a._hadError||(a.emit("error",g),a._hadError=!0)},f=()=>{e=null,o=!0;let g=new Error(`A "socket" was not created for HTTP request before ${y}ms`);g.code="ETIMEOUT",u(g)},d=g=>{o||(e!==null&&(clearTimeout(e),e=null),u(g))},m=g=>{if(o)return;if(e!=null&&(clearTimeout(e),e=null),r$(g)){ss("Callback returned another Agent instance %o",g.constructor.name),g.addRequest(a,s);return}if(g){g.once("free",()=>{this.freeSocket(g,s)}),a.onSocket(g);return}let _=new Error(`no Duplex stream was returned to agent-base for \`${a.method} ${a.path}\``);u(_)};if(typeof this.callback!="function"){u(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(ss("Converting legacy callback function to promise"),this.promisifiedCallback=t$.default(this.callback)):this.promisifiedCallback=this.callback),typeof y=="number"&&y>0&&(e=setTimeout(f,y)),"port"in s&&typeof s.port!="number"&&(s.port=Number(s.port));try{ss("Resolving socket for %o request: %o",s.protocol,`${a.method} ${a.path}`),Promise.resolve(this.promisifiedCallback(a,s)).then(m,d)}catch(g){Promise.reject(g).catch(d)}}freeSocket(a,i){ss("Freeing socket %o %o",a.constructor.name,i),a.destroy()}destroy(){ss("Destroying agent %o",this.constructor.name)}}n.Agent=t,n.prototype=n.Agent.prototype})(In||(In={}));$0.exports=In});var R0=j(ns=>{"use strict";var a$=ns&&ns.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(ns,"__esModule",{value:!0});var i$=a$(is()),os=i$.default("https-proxy-agent:parse-proxy-response");function s$(n){return new Promise((t,r)=>{let a=0,i=[];function s(){let d=n.read();d?f(d):n.once("readable",s)}function o(){n.removeListener("end",y),n.removeListener("error",u),n.removeListener("close",e),n.removeListener("readable",s)}function e(d){os("onclose had error %o",d)}function y(){os("onend")}function u(d){o(),os("onerror %o",d),r(d)}function f(d){i.push(d),a+=d.length;let m=Buffer.concat(i,a);if(m.indexOf(`\r +\r +`)===-1){os("have not received end of HTTP headers yet..."),s();return}let _=m.toString("ascii",0,m.indexOf(`\r +`)),b=+_.split(" ")[1];os("got proxy server response: %o",_),t({statusCode:b,buffered:m})}n.on("error",u),n.on("close",e),n.on("end",y),s()})}ns.default=s$});var j0=j(Mr=>{"use strict";var o$=Mr&&Mr.__awaiter||function(n,t,r,a){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function e(f){try{u(a.next(f))}catch(d){o(d)}}function y(f){try{u(a.throw(f))}catch(d){o(d)}}function u(f){f.done?s(f.value):i(f.value).then(e,y)}u((a=a.apply(n,t||[])).next())})},Wa=Mr&&Mr.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Mr,"__esModule",{value:!0});var A0=Wa(Q("net")),C0=Wa(Q("tls")),n$=Wa(Q("url")),h$=Wa(Q("assert")),d$=Wa(is()),c$=z0(),l$=Wa(R0()),hs=d$.default("https-proxy-agent:agent"),fl=class extends c$.Agent{constructor(t){let r;if(typeof t=="string"?r=n$.default.parse(t):r=t,!r)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");hs("creating new HttpsProxyAgent instance: %o",r),super(r);let a=Object.assign({},r);this.secureProxy=r.secureProxy||m$(a.protocol),a.host=a.hostname||a.host,typeof a.port=="string"&&(a.port=parseInt(a.port,10)),!a.port&&a.host&&(a.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in a)&&(a.ALPNProtocols=["http 1.1"]),a.host&&a.path&&(delete a.path,delete a.pathname),this.proxy=a}callback(t,r){return o$(this,void 0,void 0,function*(){let{proxy:a,secureProxy:i}=this,s;i?(hs("Creating `tls.Socket`: %o",a),s=C0.default.connect(a)):(hs("Creating `net.Socket`: %o",a),s=A0.default.connect(a));let o=Object.assign({},a.headers),y=`CONNECT ${`${r.host}:${r.port}`} HTTP/1.1\r +`;a.auth&&(o["Proxy-Authorization"]=`Basic ${Buffer.from(a.auth).toString("base64")}`);let{host:u,port:f,secureEndpoint:d}=r;u$(f,d)||(u+=`:${f}`),o.Host=u,o.Connection="close";for(let w of Object.keys(o))y+=`${w}: ${o[w]}\r +`;let m=l$.default(s);s.write(`${y}\r +`);let{statusCode:g,buffered:_}=yield m;if(g===200){if(t.once("socket",p$),r.secureEndpoint){hs("Upgrading socket connection to TLS");let w=r.servername||r.host;return C0.default.connect(Object.assign(Object.assign({},f$(r,"host","hostname","path","port")),{socket:s,servername:w}))}return s}s.destroy();let b=new A0.default.Socket({writable:!1});return b.readable=!0,t.once("socket",w=>{hs("replaying proxy buffer for failed request"),h$.default(w.listenerCount("data")>0),w.push(_),w.push(null)}),b})}};Mr.default=fl;function p$(n){n.resume()}function u$(n,t){return!!(!t&&n===80||t&&n===443)}function m$(n){return typeof n=="string"?/^https:?$/i.test(n):!1}function f$(n,...t){let r={},a;for(a in n)t.includes(a)||(r[a]=n[a]);return r}});var G0=j((vl,D0)=>{"use strict";var y$=vl&&vl.__importDefault||function(n){return n&&n.__esModule?n:{default:n}},yl=y$(j0());function gl(n){return new yl.default(n)}(function(n){n.HttpsProxyAgent=yl.default,n.prototype=yl.default.prototype})(gl||(gl={}));D0.exports=gl});var M0=j((z6,B0)=>{var ds;B0.exports=function(){if(!ds){try{ds=is()("follow-redirects")}catch{}typeof ds!="function"&&(ds=function(){})}ds.apply(null,arguments)}});var H0=j((R6,Fl)=>{var ls=Q("url"),cs=ls.URL,g$=Q("http"),v$=Q("https"),Il=Q("stream").Writable,kl=Q("assert"),L0=M0();(function(){var t=typeof process<"u",r=typeof window<"u"&&typeof document<"u",a=Nr(Error.captureStackTrace);!t&&(r||!a)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var Tl=!1;try{kl(new cs(""))}catch(n){Tl=n.code==="ERR_INVALID_URL"}var _$=["Authorization","Proxy-Authorization","Cookie"],b$=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],xl=["abort","aborted","connect","error","socket","timeout"],Pl=Object.create(null);xl.forEach(function(n){Pl[n]=function(t,r,a){this._redirectable.emit(n,t,r,a)}});var bl=ps("ERR_INVALID_URL","Invalid URL",TypeError),wl=ps("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),w$=ps("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",wl),S$=ps("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),I$=ps("ERR_STREAM_WRITE_AFTER_END","write after end"),k$=Il.prototype.destroy||U0;function tt(n,t){Il.call(this),this._sanitizeOptions(n),this._options=n,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var r=this;this._onNativeResponse=function(a){try{r._processResponse(a)}catch(i){r.emit("error",i instanceof wl?i:new wl({cause:i}))}},this._headerFilter=new RegExp("^(?:"+_$.concat(n.sensitiveHeaders).map(F$).join("|")+")$","i"),this._performRequest()}tt.prototype=Object.create(Il.prototype);tt.prototype.abort=function(){El(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};tt.prototype.destroy=function(n){return El(this._currentRequest,n),k$.call(this,n),this};tt.prototype.write=function(n,t,r){if(this._ending)throw new I$;if(!Lr(n)&&!q$(n))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Nr(t)&&(r=t,t=null),n.length===0){r&&r();return}this._requestBodyLength+n.length<=this._options.maxBodyLength?(this._requestBodyLength+=n.length,this._requestBodyBuffers.push({data:n,encoding:t}),this._currentRequest.write(n,t,r)):(this.emit("error",new S$),this.abort())};tt.prototype.end=function(n,t,r){if(Nr(n)?(r=n,n=t=null):Nr(t)&&(r=t,t=null),!n)this._ended=this._ending=!0,this._currentRequest.end(null,null,r);else{var a=this,i=this._currentRequest;this.write(n,t,function(){a._ended=!0,i.end(null,null,r)}),this._ending=!0}};tt.prototype.setHeader=function(n,t){this._options.headers[n]=t,this._currentRequest.setHeader(n,t)};tt.prototype.removeHeader=function(n){delete this._options.headers[n],this._currentRequest.removeHeader(n)};tt.prototype.setTimeout=function(n,t){var r=this;function a(o){o.setTimeout(n),o.removeListener("timeout",o.destroy),o.addListener("timeout",o.destroy)}function i(o){r._timeout&&clearTimeout(r._timeout),r._timeout=setTimeout(function(){r.emit("timeout"),s()},n),a(o)}function s(){r._timeout&&(clearTimeout(r._timeout),r._timeout=null),r.removeListener("abort",s),r.removeListener("error",s),r.removeListener("response",s),r.removeListener("close",s),t&&r.removeListener("timeout",t),r.socket||r._currentRequest.removeListener("socket",i)}return t&&this.on("timeout",t),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",a),this.on("abort",s),this.on("error",s),this.on("response",s),this.on("close",s),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(n){tt.prototype[n]=function(t,r){return this._currentRequest[n](t,r)}});["aborted","connection","socket"].forEach(function(n){Object.defineProperty(tt.prototype,n,{get:function(){return this._currentRequest[n]}})});tt.prototype._sanitizeOptions=function(n){if(n.headers||(n.headers={}),P$(n.sensitiveHeaders)||(n.sensitiveHeaders=[]),n.host&&(n.hostname||(n.hostname=n.host),delete n.host),!n.pathname&&n.path){var t=n.path.indexOf("?");t<0?n.pathname=n.path:(n.pathname=n.path.substring(0,t),n.search=n.path.substring(t))}};tt.prototype._performRequest=function(){var n=this._options.protocol,t=this._options.nativeProtocols[n];if(!t)throw new TypeError("Unsupported protocol "+n);if(this._options.agents){var r=n.slice(0,-1);this._options.agent=this._options.agents[r]}var a=this._currentRequest=t.request(this._options,this._onNativeResponse);a._redirectable=this;for(var i of xl)a.on(i,Pl[i]);if(this._currentUrl=/^\//.test(this._options.path)?ls.format(this._options):this._options.path,this._isRedirect){var s=0,o=this,e=this._requestBodyBuffers;(function y(u){if(a===o._currentRequest)if(u)o.emit("error",u);else if(s=400){n.responseUrl=this._currentUrl,n.redirects=this._redirects,this.emit("response",n),this._requestBodyBuffers=[];return}if(El(this._currentRequest),n.destroy(),++this._redirectCount>this._options.maxRedirects)throw new w$;var a,i=this._options.beforeRedirect;i&&(a=Object.assign({Host:n.req.getHeader("host")},this._options.headers));var s=this._options.method;((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],_l(/^content-/i,this._options.headers));var o=_l(/^host$/i,this._options.headers),e=ql(this._currentUrl),y=o||e.host,u=/^\w+:/.test(r)?this._currentUrl:ls.format(Object.assign(e,{host:y})),f=T$(r,u);if(L0("redirecting to",f.href),this._isRedirect=!0,Sl(f,this._options),(f.protocol!==e.protocol&&f.protocol!=="https:"||f.host!==y&&!x$(f.host,y))&&_l(this._headerFilter,this._options.headers),Nr(i)){var d={headers:n.headers,statusCode:t},m={url:u,method:s,headers:a};i(this._options,d,m),this._sanitizeOptions(this._options)}this._performRequest()};function N0(n){var t={maxRedirects:21,maxBodyLength:10485760},r={};return Object.keys(n).forEach(function(a){var i=a+":",s=r[i]=n[a],o=t[a]=Object.create(s);function e(u,f,d){return E$(u)?u=Sl(u):Lr(u)?u=Sl(ql(u)):(d=f,f=W0(u),u={protocol:i}),Nr(f)&&(d=f,f=null),f=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},u,f),f.nativeProtocols=r,!Lr(f.host)&&!Lr(f.hostname)&&(f.hostname="::1"),kl.equal(f.protocol,i,"protocol mismatch"),L0("options",f),new tt(f,d)}function y(u,f,d){var m=o.request(u,f,d);return m.end(),m}Object.defineProperties(o,{request:{value:e,configurable:!0,enumerable:!0,writable:!0},get:{value:y,configurable:!0,enumerable:!0,writable:!0}})}),t}function U0(){}function ql(n){var t;if(Tl)t=new cs(n);else if(t=W0(ls.parse(n)),!Lr(t.protocol))throw new bl({input:n});return t}function T$(n,t){return Tl?new cs(n,t):ql(ls.resolve(t,n))}function W0(n){if(/^\[/.test(n.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(n.hostname))throw new bl({input:n.href||n});if(/^\[/.test(n.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(n.host))throw new bl({input:n.href||n});return n}function Sl(n,t){var r=t||{};for(var a of b$)r[a]=n[a];return r.hostname.startsWith("[")&&(r.hostname=r.hostname.slice(1,-1)),r.port!==""&&(r.port=Number(r.port)),r.path=r.search?r.pathname+r.search:r.pathname,r}function _l(n,t){var r;for(var a in t)n.test(a)&&(r=t[a],delete t[a]);return r===null||typeof r>"u"?void 0:String(r).trim()}function ps(n,t,r){function a(i){Nr(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,i||{}),this.code=n,this.message=this.cause?t+": "+this.cause.message:t}return a.prototype=new(r||Error),Object.defineProperties(a.prototype,{constructor:{value:a,enumerable:!1},name:{value:"Error ["+n+"]",enumerable:!1}}),a}function El(n,t){for(var r of xl)n.removeListener(r,Pl[r]);n.on("error",U0),n.destroy(t)}function x$(n,t){kl(Lr(n)&&Lr(t));var r=n.length-t.length-1;return r>0&&n[r]==="."&&n.endsWith(t)}function P$(n){return n instanceof Array}function Lr(n){return typeof n=="string"||n instanceof String}function Nr(n){return typeof n=="function"}function q$(n){return typeof n=="object"&&"length"in n}function E$(n){return cs&&n instanceof cs}function F$(n){return n.replace(/[\]\\/()*+?.$]/g,"\\$&")}Fl.exports=N0({http:g$,https:v$});Fl.exports.wrap=N0});var Lb=j((Z7,Mb)=>{Mb.exports=Q("util").inspect});var Is=j((e9,hw)=>{var hp=typeof Map=="function"&&Map.prototype,Zl=Object.getOwnPropertyDescriptor&&hp?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,$n=hp&&Zl&&typeof Zl.get=="function"?Zl.get:null,Nb=hp&&Map.prototype.forEach,dp=typeof Set=="function"&&Set.prototype,ep=Object.getOwnPropertyDescriptor&&dp?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,zn=dp&&ep&&typeof ep.get=="function"?ep.get:null,Ub=dp&&Set.prototype.forEach,Nz=typeof WeakMap=="function"&&WeakMap.prototype,bs=Nz?WeakMap.prototype.has:null,Uz=typeof WeakSet=="function"&&WeakSet.prototype,ws=Uz?WeakSet.prototype.has:null,Wz=typeof WeakRef=="function"&&WeakRef.prototype,Wb=Wz?WeakRef.prototype.deref:null,Hz=Boolean.prototype.valueOf,Qz=Object.prototype.toString,Vz=Function.prototype.toString,Kz=String.prototype.match,cp=String.prototype.slice,fr=String.prototype.replace,Jz=String.prototype.toUpperCase,Hb=String.prototype.toLowerCase,tw=RegExp.prototype.test,Qb=Array.prototype.concat,Ct=Array.prototype.join,Xz=Array.prototype.slice,Vb=Math.floor,ap=typeof BigInt=="function"?BigInt.prototype.valueOf:null,tp=Object.getOwnPropertySymbols,ip=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ka=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Ss=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ka||!0)?Symbol.toStringTag:null,rw=Object.prototype.propertyIsEnumerable,Kb=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function Jb(n,t){if(n===1/0||n===-1/0||n!==n||n&&n>-1e3&&n<1e3||tw.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var a=n<0?-Vb(-n):Vb(n);if(a!==n){var i=String(a),s=cp.call(t,i.length+1);return fr.call(i,r,"$&_")+"."+fr.call(fr.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return fr.call(t,r,"$&_")}var sp=Lb(),Xb=sp.custom,Yb=sw(Xb)?Xb:null,aw={__proto__:null,double:'"',single:"'"},Yz={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};hw.exports=function n(t,r,a,i){var s=r||{};if(Jt(s,"quoteStyle")&&!Jt(aw,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Jt(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=Jt(s,"customInspect")?s.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Jt(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Jt(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var e=s.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return nw(t,s);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var y=String(t);return e?Jb(t,y):y}if(typeof t=="bigint"){var u=String(t)+"n";return e?Jb(t,u):u}var f=typeof s.depth>"u"?5:s.depth;if(typeof a>"u"&&(a=0),a>=f&&f>0&&typeof t=="object")return op(t)?"[Array]":"[Object]";var d=yR(s,a);if(typeof i>"u")i=[];else if(ow(i,t)>=0)return"[Circular]";function m(z,P,D){if(P&&(i=Xz.call(i),i.push(P)),D){var H={depth:s.depth};return Jt(s,"quoteStyle")&&(H.quoteStyle=s.quoteStyle),n(z,H,a+1,i)}return n(z,s,a+1,i)}if(typeof t=="function"&&!Zb(t)){var g=nR(t),_=On(t,m);return"[Function"+(g?": "+g:" (anonymous)")+"]"+(_.length>0?" { "+Ct.call(_,", ")+" }":"")}if(sw(t)){var b=Ka?fr.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):ip.call(t);return typeof t=="object"&&!Ka?_s(b):b}if(uR(t)){for(var w="<"+Hb.call(String(t.nodeName)),S=t.attributes||[],O=0;O",w}if(op(t)){if(t.length===0)return"[]";var E=On(t,m);return d&&!fR(E)?"["+np(E,d)+"]":"[ "+Ct.call(E,", ")+" ]"}if(tR(t)){var F=On(t,m);return!("cause"in Error.prototype)&&"cause"in t&&!rw.call(t,"cause")?"{ ["+String(t)+"] "+Ct.call(Qb.call("[cause]: "+m(t.cause),F),", ")+" }":F.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Ct.call(F,", ")+" }"}if(typeof t=="object"&&o){if(Yb&&typeof t[Yb]=="function"&&sp)return sp(t,{depth:f-a});if(o!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(hR(t)){var $=[];return Nb&&Nb.call(t,function(z,P){$.push(m(P,t,!0)+" => "+m(z,t))}),ew("Map",$n.call(t),$,d)}if(lR(t)){var A=[];return Ub&&Ub.call(t,function(z){A.push(m(z,t))}),ew("Set",zn.call(t),A,d)}if(dR(t))return rp("WeakMap");if(pR(t))return rp("WeakSet");if(cR(t))return rp("WeakRef");if(aR(t))return _s(m(Number(t)));if(sR(t))return _s(m(ap.call(t)));if(iR(t))return _s(Hz.call(t));if(rR(t))return _s(m(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof global<"u"&&t===global)return"{ [object globalThis] }";if(!eR(t)&&!Zb(t)){var G=On(t,m),M=Kb?Kb(t)===Object.prototype:t instanceof Object||t.constructor===Object,N=t instanceof Object?"":"null prototype",B=!M&&Ss&&Object(t)===t&&Ss in t?cp.call(yr(t),8,-1):N?"Object":"",R=M||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",de=R+(B||N?"["+Ct.call(Qb.call([],B||[],N||[]),": ")+"] ":"");return G.length===0?de+"{}":d?de+"{"+np(G,d)+"}":de+"{ "+Ct.call(G,", ")+" }"}return String(t)};function iw(n,t,r){var a=r.quoteStyle||t,i=aw[a];return i+n+i}function Zz(n){return fr.call(String(n),/"/g,""")}function Wr(n){return!Ss||!(typeof n=="object"&&(Ss in n||typeof n[Ss]<"u"))}function op(n){return yr(n)==="[object Array]"&&Wr(n)}function eR(n){return yr(n)==="[object Date]"&&Wr(n)}function Zb(n){return yr(n)==="[object RegExp]"&&Wr(n)}function tR(n){return yr(n)==="[object Error]"&&Wr(n)}function rR(n){return yr(n)==="[object String]"&&Wr(n)}function aR(n){return yr(n)==="[object Number]"&&Wr(n)}function iR(n){return yr(n)==="[object Boolean]"&&Wr(n)}function sw(n){if(Ka)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!ip)return!1;try{return ip.call(n),!0}catch{}return!1}function sR(n){if(!n||typeof n!="object"||!ap)return!1;try{return ap.call(n),!0}catch{}return!1}var oR=Object.prototype.hasOwnProperty||function(n){return n in this};function Jt(n,t){return oR.call(n,t)}function yr(n){return Qz.call(n)}function nR(n){if(n.name)return n.name;var t=Kz.call(Vz.call(n),/^function\s*([\w$]+)/);return t?t[1]:null}function ow(n,t){if(n.indexOf)return n.indexOf(t);for(var r=0,a=n.length;rt.maxStringLength){var r=n.length-t.maxStringLength,a="... "+r+" more character"+(r>1?"s":"");return nw(cp.call(n,0,t.maxStringLength),t)+a}var i=Yz[t.quoteStyle||"single"];i.lastIndex=0;var s=fr.call(fr.call(n,i,"\\$1"),/[\x00-\x1f]/g,mR);return iw(s,"single",t)}function mR(n){var t=n.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+Jz.call(t.toString(16))}function _s(n){return"Object("+n+")"}function rp(n){return n+" { ? }"}function ew(n,t,r,a){var i=a?np(r,a):Ct.call(r,", ");return n+" ("+t+") {"+i+"}"}function fR(n){for(var t=0;t=0)return!1;return!0}function yR(n,t){var r;if(n.indent===" ")r=" ";else if(typeof n.indent=="number"&&n.indent>0)r=Ct.call(Array(n.indent+1)," ");else return null;return{base:r,prev:Ct.call(Array(t+1),r)}}function np(n,t){if(n.length===0)return"";var r=` +`+t.prev+t.base;return r+Ct.call(n,","+r)+` +`+t.prev}function On(n,t){var r=op(n),a=[];if(r){a.length=n.length;for(var i=0;i{"use strict";var gR=Is(),vR=lr(),Rn=function(n,t,r){for(var a=n,i;(i=a.next)!=null;a=i)if(i.key===t)return a.next=i.next,r||(i.next=n.next,n.next=i),i},_R=function(n,t){if(n){var r=Rn(n,t);return r&&r.value}},bR=function(n,t,r){var a=Rn(n,t);a?a.value=r:n.next={key:t,next:n.next,value:r}},wR=function(n,t){return n?!!Rn(n,t):!1},SR=function(n,t){if(n)return Rn(n,t,!0)};dw.exports=function(){var t,r={assert:function(a){if(!r.has(a))throw new vR("Side channel does not contain "+gR(a))},delete:function(a){var i=SR(t,a);return i&&t&&!t.next&&(t=void 0),!!i},get:function(a){return _R(t,a)},has:function(a){return wR(t,a)},set:function(a,i){t||(t={next:void 0}),bR(t,a,i)}};return r}});var lp=j((r9,uw)=>{"use strict";var lw=ts(),pw=Mc(),IR=pw([lw("%String.prototype.indexOf%")]);uw.exports=function(t,r){var a=lw(t,!!r);return typeof a=="function"&&IR(t,".prototype.")>-1?pw([a]):a}});var pp=j((a9,fw)=>{"use strict";var kR=ts(),ks=lp(),TR=Is(),xR=lr(),mw=kR("%Map%",!0),PR=ks("Map.prototype.get",!0),qR=ks("Map.prototype.set",!0),ER=ks("Map.prototype.has",!0),FR=ks("Map.prototype.delete",!0),OR=ks("Map.prototype.size",!0);fw.exports=!!mw&&function(){var t,r={assert:function(a){if(!r.has(a))throw new xR("Side channel does not contain "+TR(a))},delete:function(a){if(t){var i=FR(t,a);return OR(t)===0&&(t=void 0),i}return!1},get:function(a){if(t)return PR(t,a)},has:function(a){return t?ER(t,a):!1},set:function(a,i){t||(t=new mw),qR(t,a,i)}};return r}});var gw=j((i9,yw)=>{"use strict";var $R=ts(),Cn=lp(),zR=Is(),An=pp(),RR=lr(),Ja=$R("%WeakMap%",!0),AR=Cn("WeakMap.prototype.get",!0),CR=Cn("WeakMap.prototype.set",!0),jR=Cn("WeakMap.prototype.has",!0),DR=Cn("WeakMap.prototype.delete",!0);yw.exports=Ja?function(){var t,r,a={assert:function(i){if(!a.has(i))throw new RR("Side channel does not contain "+zR(i))},delete:function(i){if(Ja&&i&&(typeof i=="object"||typeof i=="function")){if(t)return DR(t,i)}else if(An&&r)return r.delete(i);return!1},get:function(i){return Ja&&i&&(typeof i=="object"||typeof i=="function")&&t?AR(t,i):r&&r.get(i)},has:function(i){return Ja&&i&&(typeof i=="object"||typeof i=="function")&&t?jR(t,i):!!r&&r.has(i)},set:function(i,s){Ja&&i&&(typeof i=="object"||typeof i=="function")?(t||(t=new Ja),CR(t,i,s)):An&&(r||(r=An()),r.set(i,s))}};return a}:An});var up=j((s9,vw)=>{"use strict";var GR=lr(),BR=Is(),MR=cw(),LR=pp(),NR=gw(),UR=NR||LR||MR;vw.exports=function(){var t,r={assert:function(a){if(!r.has(a)){var i=a&&Object(a)===a?"the given object key":BR(a);throw new GR("Side channel does not contain "+i)}},delete:function(a){return!!t&&t.delete(a)},get:function(a){return t&&t.get(a)},has:function(a){return!!t&&t.has(a)},set:function(a,i){t||(t=UR()),t.set(a,i)}};return r}});var jn=j((o9,_w)=>{"use strict";var WR=String.prototype.replace,HR=/%20/g,mp={RFC1738:"RFC1738",RFC3986:"RFC3986"};_w.exports={default:mp.RFC3986,formatters:{RFC1738:function(n){return WR.call(n,HR,"+")},RFC3986:function(n){return String(n)}},RFC1738:mp.RFC1738,RFC3986:mp.RFC3986}});var vp=j((n9,Sw)=>{"use strict";var QR=jn(),ww=up(),bw=Cc(),fp=Object.prototype.hasOwnProperty,Hr=Array.isArray,Gn=ww(),Qr=function(t,r){return Gn.set(t,r),t},Vr=function(t){return Gn.has(t)},Ts=function(t){return Gn.get(t)},yp=function(t,r){Gn.set(t,r)},jt=(function(){for(var n=[],t=0;t<256;++t)n[n.length]="%"+((t<16?"0":"")+t.toString(16)).toUpperCase();return n})(),VR=function(t){for(;t.length>1;){var r=t.pop(),a=r.obj[r.prop];if(Hr(a)){for(var i=[],s=0;s=a.arrayLimit){if(a.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+a.arrayLimit+" element"+(a.arrayLimit===1?"":"s")+" allowed in an array.");return Qr(Xa(t.concat(r),a),i)}t[i]=r}else if(t&&typeof t=="object")if(Vr(t)){var s=Ts(t)+1;t[s]=r,yp(t,s)}else{if(a&&a.strictMerge)return[t,r];(a&&(a.plainObjects||a.allowPrototypes)||!fp.call(Object.prototype,r))&&(t[r]=!0)}else return[t,r];return t}if(!t||typeof t!="object"){if(Vr(r)){for(var o=Object.keys(r),e=a&&a.plainObjects?{__proto__:null,0:t}:{0:t},y=0;ya.arrayLimit){if(a.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+a.arrayLimit+" element"+(a.arrayLimit===1?"":"s")+" allowed in an array.");return Qr(Xa(f,a),f.length-1)}return f}var d=t;if(Hr(t)&&!Hr(r)&&(d=Xa(t,a)),Hr(t)&&Hr(r)){if(r.forEach(function(m,g){if(fp.call(t,g)){var _=t[g];_&&typeof _=="object"&&m&&typeof m=="object"?t[g]=n(_,m,a):t[t.length]=m}else t[g]=m}),a&&typeof a.arrayLimit=="number"&&t.length>a.arrayLimit){if(a.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+a.arrayLimit+" element"+(a.arrayLimit===1?"":"s")+" allowed in an array.");return Qr(Xa(t,a),t.length-1)}return t}return Object.keys(r).reduce(function(m,g){var _=r[g];if(fp.call(m,g)?gp(m,g,n(m[g],_,a)):gp(m,g,_),Vr(r)&&!Vr(m)&&Qr(m,Ts(r)),Vr(m)){var b=parseInt(g,10);String(b)===g&&b>=0&&b>Ts(m)&&yp(m,b)}return m},d)},JR=function(t,r){return Object.keys(r).reduce(function(a,i){return gp(a,i,r[i]),a},t)},XR=function(n,t,r){var a=n.replace(/\+/g," ");if(r==="iso-8859-1")return a.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(a)}catch{return a}},Dn=1024,YR=function(t,r,a,i,s){if(t.length===0)return t;var o=t;if(typeof t=="symbol"?o=Symbol.prototype.toString.call(t):typeof t!="string"&&(o=String(t)),a==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(_){return"%26%23"+parseInt(_.slice(2),16)+"%3B"});for(var e="",y=0;y=Dn?o.slice(y,y+Dn):o;if(y+Dn=55296&&f<=56319&&(u=u.slice(0,-1),y-=1)}for(var d=[],m=0;m=48&&g<=57||g>=65&&g<=90||g>=97&&g<=122||s===QR.RFC1738&&(g===40||g===41)){d[d.length]=u.charAt(m);continue}if(g<128){d[d.length]=jt[g];continue}if(g<2048){d[d.length]=jt[192|g>>6]+jt[128|g&63];continue}if(g<55296||g>=57344){d[d.length]=jt[224|g>>12]+jt[128|g>>6&63]+jt[128|g&63];continue}m+=1,g=65536+((g&1023)<<10|u.charCodeAt(m)&1023),d[d.length]=jt[240|g>>18]+jt[128|g>>12&63]+jt[128|g>>6&63]+jt[128|g&63]}e+=d.join("")}return e},ZR=function(t){for(var r=[{obj:{o:t},prop:"o"}],a=ww(),i=0;ia){if(s)throw new RangeError("Array limit exceeded. Only "+a+" element"+(a===1?"":"s")+" allowed in an array.");return Qr(Xa(e,{plainObjects:i}),e.length-1)}return e},aA=function(t,r){if(Hr(t)){for(var a=[],i=0;i{"use strict";var kw=up(),Bn=vp(),xs=jn(),iA=Object.prototype.hasOwnProperty,Tw={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,r){return t+"["+r+"]"},repeat:function(t){return t}},Dt=Array.isArray,sA=Array.prototype.push,xw=function(n,t){sA.apply(n,Dt(t)?t:[t])},oA=Date.prototype.toISOString,Iw=xs.default,$e={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Bn.encode,encodeValuesOnly:!1,filter:void 0,format:Iw,formatter:xs.formatters[Iw],indices:!1,serializeDate:function(t){return oA.call(t)},skipNulls:!1,strictNullHandling:!1},nA=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},_p={},hA=function n(t,r,a,i,s,o,e,y,u,f,d,m,g,_,b,w,S,O){for(var E=t,F=O,$=0,A=!1;(F=F.get(_p))!==void 0&&!A;){var G=F.get(t);if($+=1,typeof G<"u"){if(G===$)throw new RangeError("Cyclic object value");A=!0}typeof F.get(_p)>"u"&&($=0)}if(typeof f=="function"?E=f(r,E):E instanceof Date?E=g(E):a==="comma"&&Dt(E)&&(E=Bn.maybeMap(E,function(V){return V instanceof Date?g(V):V})),E===null){if(o)return b(u&&!w?u(r,$e.encoder,S,"key",_):r);E=""}if(nA(E)||Bn.isBuffer(E)){if(u){var M=w?r:u(r,$e.encoder,S,"key",_);return[b(M)+"="+b(u(E,$e.encoder,S,"value",_))]}return[b(r)+"="+b(String(E))]}var N=[];if(typeof E>"u")return N;var B;if(a==="comma"&&Dt(E))w&&u&&(E=Bn.maybeMap(E,function(V){return V==null?V:u(V)})),B=[{value:E.length>0?E.join(",")||null:void 0}];else if(Dt(f))B=f;else{var R=Object.keys(E);B=d?R.sort(d):R}var de=y?String(r).replace(/\./g,"%2E"):String(r),z=i&&Dt(E)&&E.length===1?de+"[]":de;if(s&&Dt(E)&&E.length===0)return z+"[]";for(var P=0;P"u"?t.encodeDotInKeys===!0?!0:$e.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:$e.addQueryPrefix,allowDots:e,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:$e.allowEmptyArrays,arrayFormat:o,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:$e.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?$e.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:$e.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:$e.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:$e.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:$e.encodeValuesOnly,filter:s,format:a,formatter:i,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:$e.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:$e.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:$e.strictNullHandling}};Pw.exports=function(n,t){var r=n,a=dA(t),i,s;typeof a.filter=="function"?(s=a.filter,r=s("",r)):Dt(a.filter)&&(s=a.filter,i=s);var o=[];if(typeof r!="object"||r===null)return"";var e=Tw[a.arrayFormat],y=e==="comma"&&a.commaRoundTrip;i||(i=Object.keys(r)),a.sort&&i.sort(a.sort);for(var u=kw(),f=0;f"u"||d===null)){var m=r[d];a.skipNulls&&m===null||xw(o,hA(m,d,e,y,a.allowEmptyArrays,a.strictNullHandling,a.skipNulls,a.encodeDotInKeys,a.encode?a.encoder:null,a.filter,a.sort,a.allowDots,a.serializeDate,a.format,a.formatter,a.encodeValuesOnly,a.charset,u))}}var g=o.join(a.delimiter),_=a.addQueryPrefix===!0?"?":"";return a.charsetSentinel&&(a.charset==="iso-8859-1"?_+="utf8=%26%2310003%3B"+a.delimiter:_+="utf8=%E2%9C%93"+a.delimiter),g.length>0?_+g:""}});var Ow=j((d9,Fw)=>{"use strict";var Gt=vp(),Mn=Object.prototype.hasOwnProperty,bp=Array.isArray,Se={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Gt.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},cA=function(n){return n.replace(/&#(\d+);/g,function(t,r){return String.fromCharCode(parseInt(r,10))})},Ew=function(n,t,r,a){if(n&&typeof n=="string"&&t.comma&&n.indexOf(",")>-1){if(a&&t.throwOnLimitExceeded)for(var i=0,s=n.indexOf(",");s>-1;){if(i+=1,i>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");s=n.indexOf(",",s+1)}return n.split(",")}if(t.throwOnLimitExceeded&&r>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");return n},lA="utf8=%26%2310003%3B",pA="utf8=%E2%9C%93",uA=function(t,r){var a={__proto__:null},i=r.ignoreQueryPrefix?t.replace(/^\?/,""):t;i=i.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var s=r.parameterLimit===1/0?void 0:r.parameterLimit,o=i.split(r.delimiter,r.throwOnLimitExceeded&&typeof s<"u"?s+1:s);if(r.throwOnLimitExceeded&&typeof s<"u"&&o.length>s)throw new RangeError("Parameter limit exceeded. Only "+s+" parameter"+(s===1?"":"s")+" allowed.");var e=-1,y,u=r.charset;if(r.charsetSentinel)for(y=0;y-1&&(_=bp(_)?[_]:_),r.comma&&bp(_)&&_.length>r.arrayLimit&&(_=Gt.combine([],_,r.arrayLimit,r.plainObjects,r.throwOnLimitExceeded)),g!==null){var b=Mn.call(a,g);b&&(r.duplicates==="combine"||f.indexOf("[]=")>-1)?a[g]=Gt.combine(a[g],_,r.arrayLimit,r.plainObjects,r.throwOnLimitExceeded):(!b||r.duplicates==="last")&&(a[g]=_)}}return a},mA=function(n,t,r,a){var i=0;if(n.length>0&&n[n.length-1]==="[]"){var s=n.slice(0,-1).join("");i=Array.isArray(t)&&t[s]?t[s].length:0}for(var o=a?t:Ew(t,r,i),e=n.length-1;e>=0;--e){var y,u=n[e];if(u==="[]"&&r.parseArrays)Gt.isOverflow(o)?y=o:y=r.allowEmptyArrays&&(o===""||r.strictNullHandling&&o===null)?[]:Gt.combine([],o,r.arrayLimit,r.plainObjects,r.throwOnLimitExceeded);else{y=r.plainObjects?{__proto__:null}:{};var f=u.charAt(0)==="["&&u.charAt(u.length-1)==="]"?u.slice(1,-1):u,d=r.decodeDotInKeys?f.replace(/%2E/g,"."):f,m=parseInt(d,10),g=!isNaN(m)&&u!==d&&String(m)===d&&m>=0&&r.parseArrays;if(!r.parseArrays&&d==="")y={0:o};else if(g&&m=0?a.slice(0,s):a;if(o){if(!r.plainObjects&&Mn.call(Object.prototype,o)&&!r.allowPrototypes)return;i[i.length]=o}for(var e=a.length,y=s,u=0;y>=0&&u=0){if(r.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");i[i.length]="["+a.slice(y)+"]"}return i},yA=function(t,r,a,i){if(t){var s=fA(t,a);if(s)return mA(s,r,a,i)}},gA=function(t){if(!t)return Se;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.decodeDotInKeys<"u"&&typeof t.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(t.decoder!==null&&typeof t.decoder<"u"&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof t.throwOnLimitExceeded<"u"&&typeof t.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var r=typeof t.charset>"u"?Se.charset:t.charset,a=typeof t.duplicates>"u"?Se.duplicates:t.duplicates;if(a!=="combine"&&a!=="first"&&a!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var i=typeof t.allowDots>"u"?t.decodeDotInKeys===!0?!0:Se.allowDots:!!t.allowDots;return{allowDots:i,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Se.allowEmptyArrays,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:Se.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:Se.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:Se.arrayLimit,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Se.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:Se.comma,decodeDotInKeys:typeof t.decodeDotInKeys=="boolean"?t.decodeDotInKeys:Se.decodeDotInKeys,decoder:typeof t.decoder=="function"?t.decoder:Se.decoder,delimiter:typeof t.delimiter=="string"||Gt.isRegExp(t.delimiter)?t.delimiter:Se.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:Se.depth,duplicates:a,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:Se.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:Se.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:Se.plainObjects,strictDepth:typeof t.strictDepth=="boolean"?!!t.strictDepth:Se.strictDepth,strictMerge:typeof t.strictMerge=="boolean"?!!t.strictMerge:Se.strictMerge,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Se.strictNullHandling,throwOnLimitExceeded:typeof t.throwOnLimitExceeded=="boolean"?t.throwOnLimitExceeded:!1}};Fw.exports=function(n,t){var r=gA(t);if(n===""||n===null||typeof n>"u")return r.plainObjects?{__proto__:null}:{};for(var a=typeof n=="string"?uA(n,r):n,i=r.plainObjects?{__proto__:null}:{},s=Object.keys(a),o=0;o{"use strict";var vA=qw(),_A=Ow(),bA=jn();$w.exports={formats:bA,parse:_A,stringify:vA}});var Aw=j((l9,Rw)=>{function wA(n){return n}Rw.exports=wA});var vS=j((Ps,Za)=>{var SA=200,IA="Expected a function",$p="__lodash_hash_undefined__",Vn=1,ei=2,Ww=1/0,Hw=9007199254740991,Ln="[object Arguments]",Ip="[object Array]",Qw="[object Boolean]",Vw="[object Date]",Kw="[object Error]",Jw="[object Function]",kA="[object GeneratorFunction]",Nn="[object Map]",Xw="[object Number]",Ya="[object Object]",Cw="[object Promise]",Yw="[object RegExp]",Un="[object Set]",Zw="[object String]",eS="[object Symbol]",kp="[object WeakMap]",tS="[object ArrayBuffer]",Wn="[object DataView]",TA="[object Float32Array]",xA="[object Float64Array]",PA="[object Int8Array]",qA="[object Int16Array]",EA="[object Int32Array]",FA="[object Uint8Array]",OA="[object Uint8ClampedArray]",$A="[object Uint16Array]",zA="[object Uint32Array]",RA=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,AA=/^\w*$/,CA=/^\./,jA=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,DA=/[\\^$.*+?()[\]{}|]/g,GA=/\\(\\)?/g,BA=/^\[object .+?Constructor\]$/,MA=/^(?:0|[1-9]\d*)$/,ve={};ve[TA]=ve[xA]=ve[PA]=ve[qA]=ve[EA]=ve[FA]=ve[OA]=ve[$A]=ve[zA]=!0;ve[Ln]=ve[Ip]=ve[tS]=ve[Qw]=ve[Wn]=ve[Vw]=ve[Kw]=ve[Jw]=ve[Nn]=ve[Xw]=ve[Ya]=ve[Yw]=ve[Un]=ve[Zw]=ve[kp]=!1;var rS=typeof global=="object"&&global&&global.Object===Object&&global,LA=typeof self=="object"&&self&&self.Object===Object&&self,_r=rS||LA||Function("return this")(),aS=typeof Ps=="object"&&Ps&&!Ps.nodeType&&Ps,jw=aS&&typeof Za=="object"&&Za&&!Za.nodeType&&Za,NA=jw&&jw.exports===aS,Dw=NA&&rS.process,Gw=(function(){try{return Dw&&Dw.binding("util")}catch{}})(),Bw=Gw&&Gw.isTypedArray;function iS(n,t){for(var r=-1,a=t.length,i=n.length;++r-1}function vC(n,t){var r=this.__data__,a=Jn(r,n);return a<0?r.push([n,t]):r[a][1]=t,this}Yt.prototype.clear=mC;Yt.prototype.delete=fC;Yt.prototype.get=yC;Yt.prototype.has=gC;Yt.prototype.set=vC;function Zt(n){var t=-1,r=n?n.length:0;for(this.clear();++te))return!1;var u=s.get(n);if(u&&s.get(t))return u==t;var f=-1,d=!0,m=i&Vn?new Qn:void 0;for(s.set(n,t),s.set(t,n);++f-1&&n%1==0&&n-1&&n%1==0&&n<=Hw}function Fs(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function eh(n){return!!n&&typeof n=="object"}function Dp(n){return typeof n=="symbol"||eh(n)&&ti.call(n)==eS}var ij=Bw?QA(Bw):jC;function sj(n){return n==null?"":WC(n)}function oj(n,t,r){var a=n==null?void 0:nS(n,t);return a===void 0?r:a}function nj(n,t){return n!=null&&YC(n,t,zC)}function Op(n){return Cp(n)?oS(n):GC(n)}function hj(n){return Cp(n)?oS(n,!0):BC(n)}function dj(n,t){return n==null?{}:NC(n,VC(n),DC(t))}function cj(n){return n}function lj(n){return Yn(n)?WA(Zn(n)):UC(n)}function gS(){return[]}Za.exports=dj});var QS=j((Os,ai)=>{var pj=200,qS="__lodash_hash_undefined__",uj=800,mj=16,ES=9007199254740991,FS="[object Arguments]",fj="[object Array]",yj="[object AsyncFunction]",gj="[object Boolean]",vj="[object Date]",_j="[object Error]",OS="[object Function]",bj="[object GeneratorFunction]",wj="[object Map]",Sj="[object Number]",Ij="[object Null]",$S="[object Object]",kj="[object Proxy]",Tj="[object RegExp]",xj="[object Set]",Pj="[object String]",qj="[object Undefined]",Ej="[object WeakMap]",Fj="[object ArrayBuffer]",Oj="[object DataView]",$j="[object Float32Array]",zj="[object Float64Array]",Rj="[object Int8Array]",Aj="[object Int16Array]",Cj="[object Int32Array]",jj="[object Uint8Array]",Dj="[object Uint8ClampedArray]",Gj="[object Uint16Array]",Bj="[object Uint32Array]",Mj=/[\\^$.*+?()[\]{}|]/g,Lj=/^\[object .+?Constructor\]$/,Nj=/^(?:0|[1-9]\d*)$/,_e={};_e[$j]=_e[zj]=_e[Rj]=_e[Aj]=_e[Cj]=_e[jj]=_e[Dj]=_e[Gj]=_e[Bj]=!0;_e[FS]=_e[fj]=_e[Fj]=_e[gj]=_e[Oj]=_e[vj]=_e[_j]=_e[OS]=_e[wj]=_e[Sj]=_e[$S]=_e[Tj]=_e[xj]=_e[Pj]=_e[Ej]=!1;var zS=typeof global=="object"&&global&&global.Object===Object&&global,Uj=typeof self=="object"&&self&&self.Object===Object&&self,Rs=zS||Uj||Function("return this")(),RS=typeof Os=="object"&&Os&&!Os.nodeType&&Os,$s=RS&&typeof ai=="object"&&ai&&!ai.nodeType&&ai,AS=$s&&$s.exports===RS,Gp=AS&&zS.process,_S=(function(){try{var n=$s&&$s.require&&$s.require("util").types;return n||Gp&&Gp.binding&&Gp.binding("util")}catch{}})(),bS=_S&&_S.isTypedArray;function Wj(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function Hj(n,t){for(var r=-1,a=Array(n);++r-1}function mD(n,t){var r=this.__data__,a=sh(r,n);return a<0?(++this.size,r.push([n,t])):r[a][1]=t,this}tr.prototype.clear=cD;tr.prototype.delete=lD;tr.prototype.get=pD;tr.prototype.has=uD;tr.prototype.set=mD;function ii(n){var t=-1,r=n==null?0:n.length;for(this.clear();++t1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(s=n.length>3&&typeof s=="function"?(i--,s):void 0,o&&ND(r[0],r[1],o)&&(s=i<3?void 0:s,i=1),t=Object(t);++a-1&&n%1==0&&n0){if(++t>=uj)return arguments[0]}else t=0;return n.apply(void 0,arguments)}}function XD(n){if(n!=null){try{return ih.call(n)}catch{}try{return n+""}catch{}}return""}function hh(n,t){return n===t||n!==n&&t!==t}var Np=PS((function(){return arguments})())?PS:function(n){return As(n)&&er.call(n,"callee")&&!eD.call(n,"callee")},Up=Array.isArray;function Qp(n){return n!=null&&NS(n.length)&&!Vp(n)}function YD(n){return As(n)&&Qp(n)}var LS=rD||a2;function Vp(n){if(!Zr(n))return!1;var t=oh(n);return t==OS||t==bj||t==yj||t==kj}function NS(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=ES}function Zr(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}function As(n){return n!=null&&typeof n=="object"}function ZD(n){if(!As(n)||oh(n)!=$S)return!1;var t=jS(n);if(t===null)return!0;var r=er.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&ih.call(r)==Yj}var US=bS?Qj(bS):ED;function e2(n){return DD(n,WS(n))}function WS(n){return Qp(n)?TD(n,!0):FD(n)}var t2=GD(function(n,t,r){GS(n,t,r)});function r2(n){return function(){return n}}function HS(n){return n}function a2(){return!1}ai.exports=t2});var rr=j((p9,JS)=>{"use strict";var VS=["nodebuffer","arraybuffer","fragments"],KS=typeof Blob<"u";KS&&VS.push("blob");JS.exports={BINARY_TYPES:VS,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:KS,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Cs=j((u9,dh)=>{"use strict";var{EMPTY_BUFFER:i2}=rr(),Kp=Buffer[Symbol.species];function s2(n,t){if(n.length===0)return i2;if(n.length===1)return n[0];let r=Buffer.allocUnsafe(t),a=0;for(let i=0;i{"use strict";var ZS=Symbol("kDone"),Xp=Symbol("kRun"),Yp=class{constructor(t){this[ZS]=()=>{this.pending--,this[Xp]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[Xp]()}[Xp](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[ZS])}}};eI.exports=Yp});var hi=j((f9,sI)=>{"use strict";var js=Q("zlib"),rI=Cs(),n2=tI(),{kStatusCode:aI}=rr(),h2=Buffer[Symbol.species],d2=Buffer.from([0,0,255,255]),lh=Symbol("permessage-deflate"),ar=Symbol("total-length"),oi=Symbol("callback"),br=Symbol("buffers"),ni=Symbol("error"),ch,Zp=class{constructor(t){if(this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!ch){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;ch=new n2(r)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[oi];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,a=t.find(i=>!(r.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>i.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&(typeof i.client_max_window_bits=="number"?r.clientMaxWindowBits>i.client_max_window_bits:!i.client_max_window_bits)));if(!a)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(a.server_no_context_takeover=!0),r.clientNoContextTakeover&&(a.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(a.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?a.client_max_window_bits=r.clientMaxWindowBits:(a.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete a.client_max_window_bits,a}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(a=>{let i=r[a];if(i.length>1)throw new Error(`Parameter "${a}" must have only a single value`);if(i=i[0],a==="client_max_window_bits"){if(i!==!0){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${a}": ${i}`);i=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${a}": ${i}`)}else if(a==="server_max_window_bits"){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${a}": ${i}`);i=s}else if(a==="client_no_context_takeover"||a==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${a}": ${i}`)}else throw new Error(`Unknown parameter "${a}"`);r[a]=i})}),t}decompress(t,r,a){ch.add(i=>{this._decompress(t,r,(s,o)=>{i(),a(s,o)})})}compress(t,r,a){ch.add(i=>{this._compress(t,r,(s,o)=>{i(),a(s,o)})})}_decompress(t,r,a){let i=this._isServer?"client":"server";if(!this._inflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?js.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=js.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[lh]=this,this._inflate[ar]=0,this._inflate[br]=[],this._inflate.on("error",l2),this._inflate.on("data",iI)}this._inflate[oi]=a,this._inflate.write(t),r&&this._inflate.write(d2),this._inflate.flush(()=>{let s=this._inflate[ni];if(s){this._inflate.close(),this._inflate=null,a(s);return}let o=rI.concat(this._inflate[br],this._inflate[ar]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[ar]=0,this._inflate[br]=[],r&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),a(null,o)})}_compress(t,r,a){let i=this._isServer?"server":"client";if(!this._deflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?js.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=js.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[ar]=0,this._deflate[br]=[],this._deflate.on("data",c2)}this._deflate[oi]=a,this._deflate.write(t),this._deflate.flush(js.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=rI.concat(this._deflate[br],this._deflate[ar]);r&&(s=new h2(s.buffer,s.byteOffset,s.length-4)),this._deflate[oi]=null,this._deflate[ar]=0,this._deflate[br]=[],r&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),a(null,s)})}};sI.exports=Zp;function c2(n){this[br].push(n),this[ar]+=n.length}function iI(n){if(this[ar]+=n.length,this[lh]._maxPayload<1||this[ar]<=this[lh]._maxPayload){this[br].push(n);return}this[ni]=new RangeError("Max payload size exceeded"),this[ni].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[ni][aI]=1009,this.removeListener("data",iI),this.reset()}function l2(n){if(this[lh]._inflate=null,this[ni]){this[oi](this[ni]);return}n[aI]=1007,this[oi](n)}});var di=j((y9,ph)=>{"use strict";var{isUtf8:oI}=Q("buffer"),{hasBlob:p2}=rr(),u2=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function m2(n){return n>=1e3&&n<=1014&&n!==1004&&n!==1005&&n!==1006||n>=3e3&&n<=4999}function eu(n){let t=n.length,r=0;for(;r=t||(n[r+1]&192)!==128||(n[r+2]&192)!==128||n[r]===224&&(n[r+1]&224)===128||n[r]===237&&(n[r+1]&224)===160)return!1;r+=3}else if((n[r]&248)===240){if(r+3>=t||(n[r+1]&192)!==128||(n[r+2]&192)!==128||(n[r+3]&192)!==128||n[r]===240&&(n[r+1]&240)===128||n[r]===244&&n[r+1]>143||n[r]>244)return!1;r+=4}else return!1;return!0}function f2(n){return p2&&typeof n=="object"&&typeof n.arrayBuffer=="function"&&typeof n.type=="string"&&typeof n.stream=="function"&&(n[Symbol.toStringTag]==="Blob"||n[Symbol.toStringTag]==="File")}ph.exports={isBlob:f2,isValidStatusCode:m2,isValidUTF8:eu,tokenChars:u2};if(oI)ph.exports.isValidUTF8=function(n){return n.length<24?eu(n):oI(n)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let n=Q("utf-8-validate");ph.exports.isValidUTF8=function(t){return t.length<32?eu(t):n(t)}}catch{}});var su=j((g9,uI)=>{"use strict";var{Writable:y2}=Q("stream"),nI=hi(),{BINARY_TYPES:g2,EMPTY_BUFFER:hI,kStatusCode:v2,kWebSocket:_2}=rr(),{concat:tu,toArrayBuffer:b2,unmask:w2}=Cs(),{isValidStatusCode:S2,isValidUTF8:dI}=di(),uh=Buffer[Symbol.species],gt=0,cI=1,lI=2,pI=3,ru=4,au=5,mh=6,iu=class extends y2{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||g2[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxBufferedChunks=t.maxBufferedChunks|0,this._maxFragments=t.maxFragments|0,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[_2]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._numFragments=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=gt}_write(t,r,a){if(this._opcode===8&&this._state==gt)return a();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){a(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(a)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t=a.length?r.set(this._buffers.shift(),i):(r.set(new Uint8Array(a.buffer,a.byteOffset,t),i),this._buffers[0]=new uh(a.buffer,a.byteOffset+t,a.length-t)),t-=a.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case gt:this.getInfo(t);break;case cI:this.getPayloadLength16(t);break;case lI:this.getPayloadLength64(t);break;case pI:this.getMask();break;case ru:this.getData(t);break;case au:case mh:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(i);return}let a=(r[0]&64)===64;if(a&&!this._extensions[nI.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(i);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(a){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(i);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(i);return}this._compressed=a}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(i);return}if(a){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(i);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let i=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(i);return}this._payloadLength===126?this._state=cI:this._payloadLength===127?this._state=lI:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),a=r.readUInt32BE(0);if(a>Math.pow(2,21)-1){let i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(i);return}this._payloadLength=a*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(r);return}this._masked?this._state=pI:this._state=ru}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=ru}getData(t){let r=hI;if(this._payloadLength){if(this._bufferedBytes7){this.controlMessage(r,t);return}if(this._maxFragments>0&&++this._numFragments>this._maxFragments){let a=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");t(a);return}if(this._compressed){this._state=au,this.decompress(r,t);return}r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage(t)}decompress(t,r){this._extensions[nI.extensionName].decompress(t,this._fin,(i,s)=>{if(i)return r(i);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(o);return}this._fragments.push(s)}this.dataMessage(r),this._state===gt&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=gt;return}let r=this._messageLength,a=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._numFragments=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=tu(a,r):this._binaryType==="arraybuffer"?i=b2(tu(a,r)):this._binaryType==="blob"?i=new Blob(a):i=a,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=gt):(this._state=mh,setImmediate(()=>{this.emit("message",i,!0),this._state=gt,this.startLoop(t)}))}else{let i=tu(a,r);if(!this._skipUTF8Validation&&!dI(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._state===au||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=gt):(this._state=mh,setImmediate(()=>{this.emit("message",i,!1),this._state=gt,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,hI),this.end();else{let a=t.readUInt16BE(0);if(!S2(a)){let s=this.createError(RangeError,`invalid status code ${a}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(s);return}let i=new uh(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!dI(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(s);return}this._loop=!1,this.emit("conclude",a,i),this.end()}this._state=gt;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=gt):(this._state=mh,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=gt,this.startLoop(r)}))}createError(t,r,a,i,s){this._loop=!1,this._errored=!0;let o=new t(a?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(o,this.createError),o.code=s,o[v2]=i,o}};uI.exports=iu});var hu=j((_9,yI)=>{"use strict";var{Duplex:v9}=Q("stream"),{randomFillSync:I2}=Q("crypto"),{types:{isUint8Array:k2}}=Q("util"),mI=hi(),{EMPTY_BUFFER:T2,kWebSocket:x2,NOOP:P2}=rr(),{isBlob:ci,isValidStatusCode:q2}=di(),{mask:fI,toBuffer:ea}=Cs(),vt=Symbol("kByteLength"),E2=Buffer.alloc(4),fh=8*1024,ta,li=fh,qt=0,F2=1,O2=2,ou=class n{constructor(t,r,a){this._extensions=r||{},a&&(this._generateMask=a,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=qt,this.onerror=P2,this[x2]=void 0}static frame(t,r){let a,i=!1,s=2,o=!1;r.mask&&(a=r.maskBuffer||E2,r.generateMask?r.generateMask(a):(li===fh&&(ta===void 0&&(ta=Buffer.alloc(fh)),I2(ta,0,fh),li=0),a[0]=ta[li++],a[1]=ta[li++],a[2]=ta[li++],a[3]=ta[li++]),o=(a[0]|a[1]|a[2]|a[3])===0,s=6);let e;typeof t=="string"?(!r.mask||o)&&r[vt]!==void 0?e=r[vt]:(t=Buffer.from(t),e=t.length):(e=t.length,i=r.mask&&r.readOnly&&!o);let y=e;e>=65536?(s+=8,y=127):e>125&&(s+=2,y=126);let u=Buffer.allocUnsafe(i?e+s:s);return u[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(u[0]|=64),u[1]=y,y===126?u.writeUInt16BE(e,2):y===127&&(u[2]=u[3]=0,u.writeUIntBE(e,4,6)),r.mask?(u[1]|=128,u[s-4]=a[0],u[s-3]=a[1],u[s-2]=a[2],u[s-1]=a[3],o?[u,t]:i?(fI(t,a,u,s,e),[u]):(fI(t,a,t,0,e),[u,t])):[u,t]}close(t,r,a,i){let s;if(t===void 0)s=T2;else{if(typeof t!="number"||!q2(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(t,0);else{let e=Buffer.byteLength(r);if(e>123)throw new RangeError("The message must not be greater than 123 bytes");if(s=Buffer.allocUnsafe(2+e),s.writeUInt16BE(t,0),typeof r=="string")s.write(r,2);else if(k2(r))s.set(r,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let o={[vt]:s.length,fin:!0,generateMask:this._generateMask,mask:a,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==qt?this.enqueue([this.dispatch,s,!1,o,i]):this.sendFrame(n.frame(s,o),i)}ping(t,r,a){let i,s;if(typeof t=="string"?(i=Buffer.byteLength(t),s=!1):ci(t)?(i=t.size,s=!1):(t=ea(t),i=t.length,s=ea.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[vt]:i,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};ci(t)?this._state!==qt?this.enqueue([this.getBlobData,t,!1,o,a]):this.getBlobData(t,!1,o,a):this._state!==qt?this.enqueue([this.dispatch,t,!1,o,a]):this.sendFrame(n.frame(t,o),a)}pong(t,r,a){let i,s;if(typeof t=="string"?(i=Buffer.byteLength(t),s=!1):ci(t)?(i=t.size,s=!1):(t=ea(t),i=t.length,s=ea.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[vt]:i,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};ci(t)?this._state!==qt?this.enqueue([this.getBlobData,t,!1,o,a]):this.getBlobData(t,!1,o,a):this._state!==qt?this.enqueue([this.dispatch,t,!1,o,a]):this.sendFrame(n.frame(t,o),a)}send(t,r,a){let i=this._extensions[mI.extensionName],s=r.binary?2:1,o=r.compress,e,y;typeof t=="string"?(e=Buffer.byteLength(t),y=!1):ci(t)?(e=t.size,y=!1):(t=ea(t),e=t.length,y=ea.readOnly),this._firstFragment?(this._firstFragment=!1,o&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=e>=i._threshold),this._compress=o):(o=!1,s=0),r.fin&&(this._firstFragment=!0);let u={[vt]:e,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:y,rsv1:o};ci(t)?this._state!==qt?this.enqueue([this.getBlobData,t,this._compress,u,a]):this.getBlobData(t,this._compress,u,a):this._state!==qt?this.enqueue([this.dispatch,t,this._compress,u,a]):this.dispatch(t,this._compress,u,a)}getBlobData(t,r,a,i){this._bufferedBytes+=a[vt],this._state=O2,t.arrayBuffer().then(s=>{if(this._socket.destroyed){let e=new Error("The socket was closed while the blob was being read");process.nextTick(nu,this,e,i);return}this._bufferedBytes-=a[vt];let o=ea(s);r?this.dispatch(o,r,a,i):(this._state=qt,this.sendFrame(n.frame(o,a),i),this.dequeue())}).catch(s=>{process.nextTick($2,this,s,i)})}dispatch(t,r,a,i){if(!r){this.sendFrame(n.frame(t,a),i);return}let s=this._extensions[mI.extensionName];this._bufferedBytes+=a[vt],this._state=F2,s.compress(t,a.fin,(o,e)=>{if(this._socket.destroyed){let y=new Error("The socket was closed while data was being compressed");nu(this,y,i);return}this._bufferedBytes-=a[vt],this._state=qt,a.readOnly=!1,this.sendFrame(n.frame(e,a),i),this.dequeue()})}dequeue(){for(;this._state===qt&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][vt],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][vt],this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};yI.exports=ou;function nu(n,t,r){typeof r=="function"&&r(t);for(let a=0;a{"use strict";var{kForOnEventAttribute:Ds,kListener:du}=rr(),gI=Symbol("kCode"),vI=Symbol("kData"),_I=Symbol("kError"),bI=Symbol("kMessage"),wI=Symbol("kReason"),pi=Symbol("kTarget"),SI=Symbol("kType"),II=Symbol("kWasClean"),ir=class{constructor(t){this[pi]=null,this[SI]=t}get target(){return this[pi]}get type(){return this[SI]}};Object.defineProperty(ir.prototype,"target",{enumerable:!0});Object.defineProperty(ir.prototype,"type",{enumerable:!0});var ra=class extends ir{constructor(t,r={}){super(t),this[gI]=r.code===void 0?0:r.code,this[wI]=r.reason===void 0?"":r.reason,this[II]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[gI]}get reason(){return this[wI]}get wasClean(){return this[II]}};Object.defineProperty(ra.prototype,"code",{enumerable:!0});Object.defineProperty(ra.prototype,"reason",{enumerable:!0});Object.defineProperty(ra.prototype,"wasClean",{enumerable:!0});var ui=class extends ir{constructor(t,r={}){super(t),this[_I]=r.error===void 0?null:r.error,this[bI]=r.message===void 0?"":r.message}get error(){return this[_I]}get message(){return this[bI]}};Object.defineProperty(ui.prototype,"error",{enumerable:!0});Object.defineProperty(ui.prototype,"message",{enumerable:!0});var Gs=class extends ir{constructor(t,r={}){super(t),this[vI]=r.data===void 0?null:r.data}get data(){return this[vI]}};Object.defineProperty(Gs.prototype,"data",{enumerable:!0});var z2={addEventListener(n,t,r={}){for(let i of this.listeners(n))if(!r[Ds]&&i[du]===t&&!i[Ds])return;let a;if(n==="message")a=function(s,o){let e=new Gs("message",{data:o?s:s.toString()});e[pi]=this,yh(t,this,e)};else if(n==="close")a=function(s,o){let e=new ra("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});e[pi]=this,yh(t,this,e)};else if(n==="error")a=function(s){let o=new ui("error",{error:s,message:s.message});o[pi]=this,yh(t,this,o)};else if(n==="open")a=function(){let s=new ir("open");s[pi]=this,yh(t,this,s)};else return;a[Ds]=!!r[Ds],a[du]=t,r.once?this.once(n,a):this.on(n,a)},removeEventListener(n,t){for(let r of this.listeners(n))if(r[du]===t&&!r[Ds]){this.removeListener(n,r);break}}};kI.exports={CloseEvent:ra,ErrorEvent:ui,Event:ir,EventTarget:z2,MessageEvent:Gs};function yh(n,t,r){typeof n=="object"&&n.handleEvent?n.handleEvent.call(n,r):n.call(t,r)}});var gh=j((w9,xI)=>{"use strict";var{tokenChars:Bs}=di();function Mt(n,t,r){n[t]===void 0?n[t]=[r]:n[t].push(r)}function R2(n){let t=Object.create(null),r=Object.create(null),a=!1,i=!1,s=!1,o,e,y=-1,u=-1,f=-1,d=0;for(;d{let r=n[t];return Array.isArray(r)||(r=[r]),r.map(a=>[t].concat(Object.keys(a).map(i=>{let s=a[i];return Array.isArray(s)||(s=[s]),s.map(o=>o===!0?i:`${i}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}xI.exports={format:A2,parse:R2}});var wh=j((k9,DI)=>{"use strict";var C2=Q("events"),j2=Q("https"),D2=Q("http"),EI=Q("net"),G2=Q("tls"),{randomBytes:B2,createHash:M2}=Q("crypto"),{Duplex:S9,Readable:I9}=Q("stream"),{URL:cu}=Q("url"),wr=hi(),L2=su(),N2=hu(),{isBlob:U2}=di(),{BINARY_TYPES:PI,CLOSE_TIMEOUT:W2,EMPTY_BUFFER:vh,GUID:H2,kForOnEventAttribute:lu,kListener:Q2,kStatusCode:V2,kWebSocket:Ge,NOOP:FI}=rr(),{EventTarget:{addEventListener:K2,removeEventListener:J2}}=TI(),{format:X2,parse:Y2}=gh(),{toBuffer:Z2}=Cs(),OI=Symbol("kAborted"),pu=[8,13],sr=["CONNECTING","OPEN","CLOSING","CLOSED"],eG=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,be=class n extends C2{constructor(t,r,a){super(),this._binaryType=PI[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=vh,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=n.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(a=r,r=[]):r=[r]),$I(this,t,r,a)):(this._autoPong=a.autoPong,this._closeTimeout=a.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){PI.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,a){let i=new L2({allowSynchronousEvents:a.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:a.maxBufferedChunks,maxFragments:a.maxFragments,maxPayload:a.maxPayload,skipUTF8Validation:a.skipUTF8Validation}),s=new N2(t,this._extensions,a.generateMask);this._receiver=i,this._sender=s,this._socket=t,i[Ge]=this,s[Ge]=this,t[Ge]=this,i.on("conclude",aG),i.on("drain",iG),i.on("error",sG),i.on("message",oG),i.on("ping",nG),i.on("pong",hG),s.onerror=dG,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",AI),t.on("data",bh),t.on("end",CI),t.on("error",jI),this._readyState=n.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=n.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[wr.extensionName]&&this._extensions[wr.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=n.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==n.CLOSED){if(this.readyState===n.CONNECTING){ot(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===n.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=n.CLOSING,this._sender.close(t,r,!this._isServer,a=>{a||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),RI(this)}}pause(){this.readyState===n.CONNECTING||this.readyState===n.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,a){if(this.readyState===n.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(a=t,t=r=void 0):typeof r=="function"&&(a=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==n.OPEN){uu(this,t,a);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||vh,r,a)}pong(t,r,a){if(this.readyState===n.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(a=t,t=r=void 0):typeof r=="function"&&(a=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==n.OPEN){uu(this,t,a);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||vh,r,a)}resume(){this.readyState===n.CONNECTING||this.readyState===n.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,a){if(this.readyState===n.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(a=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==n.OPEN){uu(this,t,a);return}let i={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[wr.extensionName]||(i.compress=!1),this._sender.send(t||vh,i,a)}terminate(){if(this.readyState!==n.CLOSED){if(this.readyState===n.CONNECTING){ot(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=n.CLOSING,this._socket.destroy())}}};Object.defineProperty(be,"CONNECTING",{enumerable:!0,value:sr.indexOf("CONNECTING")});Object.defineProperty(be.prototype,"CONNECTING",{enumerable:!0,value:sr.indexOf("CONNECTING")});Object.defineProperty(be,"OPEN",{enumerable:!0,value:sr.indexOf("OPEN")});Object.defineProperty(be.prototype,"OPEN",{enumerable:!0,value:sr.indexOf("OPEN")});Object.defineProperty(be,"CLOSING",{enumerable:!0,value:sr.indexOf("CLOSING")});Object.defineProperty(be.prototype,"CLOSING",{enumerable:!0,value:sr.indexOf("CLOSING")});Object.defineProperty(be,"CLOSED",{enumerable:!0,value:sr.indexOf("CLOSED")});Object.defineProperty(be.prototype,"CLOSED",{enumerable:!0,value:sr.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(n=>{Object.defineProperty(be.prototype,n,{enumerable:!0})});["open","error","close","message"].forEach(n=>{Object.defineProperty(be.prototype,`on${n}`,{enumerable:!0,get(){for(let t of this.listeners(n))if(t[lu])return t[Q2];return null},set(t){for(let r of this.listeners(n))if(r[lu]){this.removeListener(n,r);break}typeof t=="function"&&this.addEventListener(n,t,{[lu]:!0})}})});be.prototype.addEventListener=K2;be.prototype.removeEventListener=J2;DI.exports=be;function $I(n,t,r,a){let i={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:W2,protocolVersion:pu[1],maxBufferedChunks:262144,maxFragments:16384,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...a,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(n._autoPong=i.autoPong,n._closeTimeout=i.closeTimeout,!pu.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${pu.join(", ")})`);let s;if(t instanceof cu)s=t;else try{s=new cu(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),n._url=s.href;let o=s.protocol==="wss:",e=s.protocol==="ws+unix:",y;if(s.protocol!=="ws:"&&!o&&!e?y=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:e&&!s.pathname?y="The URL's pathname is empty":s.hash&&(y="The URL contains a fragment identifier"),y){let b=new SyntaxError(y);if(n._redirects===0)throw b;_h(n,b);return}let u=o?443:80,f=B2(16).toString("base64"),d=o?j2.request:D2.request,m=new Set,g;if(i.createConnection=i.createConnection||(o?rG:tG),i.defaultPort=i.defaultPort||u,i.port=s.port||u,i.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":f,Connection:"Upgrade",Upgrade:"websocket"},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(g=new wr({...i.perMessageDeflate,isServer:!1,maxPayload:i.maxPayload}),i.headers["Sec-WebSocket-Extensions"]=X2({[wr.extensionName]:g.offer()})),r.length){for(let b of r){if(typeof b!="string"||!eG.test(b)||m.has(b))throw new SyntaxError("An invalid or duplicated subprotocol was specified");m.add(b)}i.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(s.username||s.password)&&(i.auth=`${s.username}:${s.password}`),e){let b=i.path.split(":");i.socketPath=b[0],i.path=b[1]}let _;if(i.followRedirects){if(n._redirects===0){n._originalIpc=e,n._originalSecure=o,n._originalHostOrSocketPath=e?i.socketPath:s.host;let b=a&&a.headers;if(a={...a,headers:{}},b)for(let[w,S]of Object.entries(b))a.headers[w.toLowerCase()]=S}else if(n.listenerCount("redirect")===0){let b=e?n._originalIpc?i.socketPath===n._originalHostOrSocketPath:!1:n._originalIpc?!1:s.host===n._originalHostOrSocketPath;(!b||n._originalSecure&&!o)&&(delete i.headers.authorization,delete i.headers.cookie,b||delete i.headers.host,i.auth=void 0)}i.auth&&!a.headers.authorization&&(a.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),_=n._req=d(i),n._redirects&&n.emit("redirect",n.url,_)}else _=n._req=d(i);i.timeout&&_.on("timeout",()=>{ot(n,_,"Opening handshake has timed out")}),_.on("error",b=>{_===null||_[OI]||(_=n._req=null,_h(n,b))}),_.on("response",b=>{let w=b.headers.location,S=b.statusCode;if(w&&i.followRedirects&&S>=300&&S<400){if(++n._redirects>i.maxRedirects){ot(n,_,"Maximum redirects exceeded");return}_.abort();let O;try{O=new cu(w,t)}catch{let F=new SyntaxError(`Invalid URL: ${w}`);_h(n,F);return}$I(n,O,r,a)}else n.emit("unexpected-response",_,b)||ot(n,_,`Unexpected server response: ${b.statusCode}`)}),_.on("upgrade",(b,w,S)=>{if(n.emit("upgrade",b),n.readyState!==be.CONNECTING)return;_=n._req=null;let O=b.headers.upgrade;if(O===void 0||O.toLowerCase()!=="websocket"){ot(n,w,"Invalid Upgrade header");return}let E=M2("sha1").update(f+H2).digest("base64");if(b.headers["sec-websocket-accept"]!==E){ot(n,w,"Invalid Sec-WebSocket-Accept header");return}let F=b.headers["sec-websocket-protocol"],$;if(F!==void 0?m.size?m.has(F)||($="Server sent an invalid subprotocol"):$="Server sent a subprotocol but none was requested":m.size&&($="Server sent no subprotocol"),$){ot(n,w,$);return}F&&(n._protocol=F);let A=b.headers["sec-websocket-extensions"];if(A!==void 0){if(!g){ot(n,w,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let G;try{G=Y2(A)}catch{ot(n,w,"Invalid Sec-WebSocket-Extensions header");return}let M=Object.keys(G);if(M.length!==1||M[0]!==wr.extensionName){ot(n,w,"Server indicated an extension that was not requested");return}try{g.accept(G[wr.extensionName])}catch{ot(n,w,"Invalid Sec-WebSocket-Extensions header");return}n._extensions[wr.extensionName]=g}n.setSocket(w,S,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxBufferedChunks:i.maxBufferedChunks,maxFragments:i.maxFragments,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(_,n):_.end()}function _h(n,t){n._readyState=be.CLOSING,n._errorEmitted=!0,n.emit("error",t),n.emitClose()}function tG(n){return n.path=n.socketPath,EI.connect(n)}function rG(n){return n.path=void 0,!n.servername&&n.servername!==""&&(n.servername=EI.isIP(n.host)?"":n.host),G2.connect(n)}function ot(n,t,r){n._readyState=be.CLOSING;let a=new Error(r);Error.captureStackTrace(a,ot),t.setHeader?(t[OI]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(_h,n,a)):(t.destroy(a),t.once("error",n.emit.bind(n,"error")),t.once("close",n.emitClose.bind(n)))}function uu(n,t,r){if(t){let a=U2(t)?t.size:Z2(t).length;n._socket?n._sender._bufferedBytes+=a:n._bufferedAmount+=a}if(r){let a=new Error(`WebSocket is not open: readyState ${n.readyState} (${sr[n.readyState]})`);process.nextTick(r,a)}}function aG(n,t){let r=this[Ge];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=n,r._socket[Ge]!==void 0&&(r._socket.removeListener("data",bh),process.nextTick(zI,r._socket),n===1005?r.close():r.close(n,t))}function iG(){let n=this[Ge];n.isPaused||n._socket.resume()}function sG(n){let t=this[Ge];t._socket[Ge]!==void 0&&(t._socket.removeListener("data",bh),process.nextTick(zI,t._socket),t.close(n[V2])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",n))}function qI(){this[Ge].emitClose()}function oG(n,t){this[Ge].emit("message",n,t)}function nG(n){let t=this[Ge];t._autoPong&&t.pong(n,!this._isServer,FI),t.emit("ping",n)}function hG(n){this[Ge].emit("pong",n)}function zI(n){n.resume()}function dG(n){let t=this[Ge];t.readyState!==be.CLOSED&&(t.readyState===be.OPEN&&(t._readyState=be.CLOSING,RI(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",n)))}function RI(n){n._closeTimer=setTimeout(n._socket.destroy.bind(n._socket),n._closeTimeout)}function AI(){let n=this[Ge];if(this.removeListener("close",AI),this.removeListener("data",bh),this.removeListener("end",CI),n._readyState=be.CLOSING,!this._readableState.endEmitted&&!n._closeFrameReceived&&!n._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);n._receiver.write(t)}n._receiver.end(),this[Ge]=void 0,clearTimeout(n._closeTimer),n._receiver._writableState.finished||n._receiver._writableState.errorEmitted?n.emitClose():(n._receiver.on("error",qI),n._receiver.on("finish",qI))}function bh(n){this[Ge]._receiver.write(n)||this.pause()}function CI(){let n=this[Ge];n._readyState=be.CLOSING,n._receiver.end(),this.end()}function jI(){let n=this[Ge];this.removeListener("error",jI),this.on("error",FI),n&&(n._readyState=be.CLOSING,this.destroy())}});var LI=j((x9,MI)=>{"use strict";var T9=wh(),{Duplex:cG}=Q("stream");function GI(n){n.emit("close")}function lG(){!this.destroyed&&this._writableState.finished&&this.destroy()}function BI(n){this.removeListener("error",BI),this.destroy(),this.listenerCount("error")===0&&this.emit("error",n)}function pG(n,t){let r=!0,a=new cG({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return n.on("message",function(s,o){let e=!o&&a._readableState.objectMode?s.toString():s;a.push(e)||n.pause()}),n.once("error",function(s){a.destroyed||(r=!1,a.destroy(s))}),n.once("close",function(){a.destroyed||a.push(null)}),a._destroy=function(i,s){if(n.readyState===n.CLOSED){s(i),process.nextTick(GI,a);return}let o=!1;n.once("error",function(y){o=!0,s(y)}),n.once("close",function(){o||s(i),process.nextTick(GI,a)}),r&&n.terminate()},a._final=function(i){if(n.readyState===n.CONNECTING){n.once("open",function(){a._final(i)});return}n._socket!==null&&(n._socket._writableState.finished?(i(),a._readableState.endEmitted&&a.destroy()):(n._socket.once("finish",function(){i()}),n.close()))},a._read=function(){n.isPaused&&n.resume()},a._write=function(i,s,o){if(n.readyState===n.CONNECTING){n.once("open",function(){a._write(i,s,o)});return}n.send(i,o)},a.on("end",lG),a.on("error",BI),a}MI.exports=pG});var mu=j((P9,NI)=>{"use strict";var{tokenChars:uG}=di();function mG(n){let t=new Set,r=-1,a=-1,i=0;for(i;i{"use strict";var fG=Q("events"),Sh=Q("http"),{Duplex:q9}=Q("stream"),{createHash:yG}=Q("crypto"),UI=gh(),aa=hi(),gG=mu(),vG=wh(),{CLOSE_TIMEOUT:_G,GUID:bG,kWebSocket:wG}=rr(),SG=/^[+/0-9A-Za-z]{22}==$/,WI=0,HI=1,VI=2,fu=class extends fG{constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:256*1024,maxFragments:16*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:_G,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:vG,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=Sh.createServer((a,i)=>{let s=Sh.STATUS_CODES[426];i.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),i.end(s)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let a=this.emit.bind(this,"connection");this._removeListeners=IG(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,s,o)=>{this.handleUpgrade(i,s,o,a)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=WI}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===VI){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(Ms,this);return}if(t&&this.once("close",t),this._state!==HI)if(this._state=HI,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(Ms,this):process.nextTick(Ms,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{Ms(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,a,i){r.on("error",QI);let s=t.headers["sec-websocket-key"],o=t.headers.upgrade,e=+t.headers["sec-websocket-version"];if(t.method!=="GET"){ia(this,t,r,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){ia(this,t,r,400,"Invalid Upgrade header");return}if(s===void 0||!SG.test(s)){ia(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(e!==13&&e!==8){ia(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){Ls(r,400);return}let y=t.headers["sec-websocket-protocol"],u=new Set;if(y!==void 0)try{u=gG.parse(y)}catch{ia(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let f=t.headers["sec-websocket-extensions"],d={};if(this.options.perMessageDeflate&&f!==void 0){let m=new aa({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let g=UI.parse(f);g[aa.extensionName]&&(m.accept(g[aa.extensionName]),d[aa.extensionName]=m)}catch{ia(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let m={origin:t.headers[`${e===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(m,(g,_,b,w)=>{if(!g)return Ls(r,_||401,b,w);this.completeUpgrade(d,s,u,t,r,a,i)});return}if(!this.options.verifyClient(m))return Ls(r,401)}this.completeUpgrade(d,s,u,t,r,a,i)}completeUpgrade(t,r,a,i,s,o,e){if(!s.readable||!s.writable)return s.destroy();if(s[wG])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>WI)return Ls(s,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${yG("sha1").update(r+bG).digest("base64")}`],f=new this.options.WebSocket(null,void 0,this.options);if(a.size){let d=this.options.handleProtocols?this.options.handleProtocols(a,i):a.values().next().value;d&&(u.push(`Sec-WebSocket-Protocol: ${d}`),f._protocol=d)}if(t[aa.extensionName]){let d=t[aa.extensionName].params,m=UI.format({[aa.extensionName]:[d]});u.push(`Sec-WebSocket-Extensions: ${m}`),f._extensions=t}this.emit("headers",u,i),s.write(u.concat(`\r +`).join(`\r +`)),s.removeListener("error",QI),f.setSocket(s,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(f),f.on("close",()=>{this.clients.delete(f),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Ms,this)})),e(f,i)}};KI.exports=fu;function IG(n,t){for(let r of Object.keys(t))n.on(r,t[r]);return function(){for(let a of Object.keys(t))n.removeListener(a,t[a])}}function Ms(n){n._state=VI,n.emit("close")}function QI(){this.destroy()}function Ls(n,t,r,a){r=r||Sh.STATUS_CODES[t],a={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...a},n.once("finish",n.destroy),n.end(`HTTP/1.1 ${t} ${Sh.STATUS_CODES[t]}\r +`+Object.keys(a).map(i=>`${i}: ${a[i]}`).join(`\r +`)+`\r +\r +`+r)}function ia(n,t,r,a,i,s){if(n.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,ia),n.emit("wsClientError",o,r,t)}else Ls(r,a,i,s)}});var ZI=j((O9,YI)=>{"use strict";YI.exports=OG;function OG(n,t){for(var r=new Array(arguments.length-1),a=0,i=2,s=!0;i{"use strict";var Ih=rk;Ih.length=function(t){var r=t.length;if(!r)return 0;for(var a=0;--r%4>1&&t.charAt(r)==="=";)++a;return Math.ceil(t.length*3)/4-a};var mi=new Array(64),tk=new Array(123);for(Et=0;Et<64;)tk[mi[Et]=Et<26?Et+65:Et<52?Et+71:Et<62?Et-4:Et-59|43]=Et++;var Et;Ih.encode=function(t,r,a){for(var i=null,s=[],o=0,e=0,y;r>2],y=(u&3)<<4,e=1;break;case 1:s[o++]=mi[y|u>>4],y=(u&15)<<2,e=2;break;case 2:s[o++]=mi[y|u>>6],s[o++]=mi[u&63],e=0;break}o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),o=0)}return e&&(s[o++]=mi[y],s[o++]=61,e===1&&(s[o++]=61)),i?(o&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))};var ek="invalid encoding";Ih.decode=function(t,r,a){for(var i=a,s=0,o,e=0;e1)break;if((y=tk[y])===void 0)throw Error(ek);switch(s){case 0:o=y,s=1;break;case 1:r[a++]=o<<2|(y&48)>>4,o=y,s=2;break;case 2:r[a++]=(o&15)<<4|(y&60)>>2,o=y,s=3;break;case 3:r[a++]=(o&3)<<6|y,s=0;break}}if(s===1)throw Error(ek);return a-i};Ih.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}});var sk=j((z9,ik)=>{"use strict";ik.exports=kh;function kh(){this._listeners=Object.create(null)}kh.prototype.on=function(t,r,a){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:r,ctx:a||this}),this};kh.prototype.off=function(t,r){if(t===void 0)this._listeners=Object.create(null);else if(r===void 0)this._listeners[t]=[];else{var a=this._listeners[t];if(!a)return this;for(var i=0;i{"use strict";lk.exports=ok(ok);function ok(n){return typeof Float32Array<"u"?(function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),a=r[3]===128;function i(y,u,f){t[0]=y,u[f]=r[0],u[f+1]=r[1],u[f+2]=r[2],u[f+3]=r[3]}function s(y,u,f){t[0]=y,u[f]=r[3],u[f+1]=r[2],u[f+2]=r[1],u[f+3]=r[0]}n.writeFloatLE=a?i:s,n.writeFloatBE=a?s:i;function o(y,u){return r[0]=y[u],r[1]=y[u+1],r[2]=y[u+2],r[3]=y[u+3],t[0]}function e(y,u){return r[3]=y[u],r[2]=y[u+1],r[1]=y[u+2],r[0]=y[u+3],t[0]}n.readFloatLE=a?o:e,n.readFloatBE=a?e:o})():(function(){function t(a,i,s,o){var e=i<0?1:0;if(e&&(i=-i),i===0)a(1/i>0?0:2147483648,s,o);else if(isNaN(i))a(2143289344,s,o);else if(i>34028234663852886e22)a((e<<31|2139095040)>>>0,s,o);else if(i<11754943508222875e-54)a((e<<31|Math.round(i/1401298464324817e-60))>>>0,s,o);else{var y=Math.floor(Math.log(i)/Math.LN2),u=Math.round(i*Math.pow(2,-y)*8388608)&8388607;a((e<<31|y+127<<23|u)>>>0,s,o)}}n.writeFloatLE=t.bind(null,nk),n.writeFloatBE=t.bind(null,hk);function r(a,i,s){var o=a(i,s),e=(o>>31)*2+1,y=o>>>23&255,u=o&8388607;return y===255?u?NaN:e*(1/0):y===0?e*1401298464324817e-60*u:e*Math.pow(2,y-150)*(u+8388608)}n.readFloatLE=r.bind(null,dk),n.readFloatBE=r.bind(null,ck)})(),typeof Float64Array<"u"?(function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),a=r[7]===128;function i(y,u,f){t[0]=y,u[f]=r[0],u[f+1]=r[1],u[f+2]=r[2],u[f+3]=r[3],u[f+4]=r[4],u[f+5]=r[5],u[f+6]=r[6],u[f+7]=r[7]}function s(y,u,f){t[0]=y,u[f]=r[7],u[f+1]=r[6],u[f+2]=r[5],u[f+3]=r[4],u[f+4]=r[3],u[f+5]=r[2],u[f+6]=r[1],u[f+7]=r[0]}n.writeDoubleLE=a?i:s,n.writeDoubleBE=a?s:i;function o(y,u){return r[0]=y[u],r[1]=y[u+1],r[2]=y[u+2],r[3]=y[u+3],r[4]=y[u+4],r[5]=y[u+5],r[6]=y[u+6],r[7]=y[u+7],t[0]}function e(y,u){return r[7]=y[u],r[6]=y[u+1],r[5]=y[u+2],r[4]=y[u+3],r[3]=y[u+4],r[2]=y[u+5],r[1]=y[u+6],r[0]=y[u+7],t[0]}n.readDoubleLE=a?o:e,n.readDoubleBE=a?e:o})():(function(){function t(a,i,s,o,e,y){var u=o<0?1:0;if(u&&(o=-o),o===0)a(0,e,y+i),a(1/o>0?0:2147483648,e,y+s);else if(isNaN(o))a(0,e,y+i),a(2146959360,e,y+s);else if(o>17976931348623157e292)a(0,e,y+i),a((u<<31|2146435072)>>>0,e,y+s);else{var f;if(o<22250738585072014e-324)f=o/5e-324,a(f>>>0,e,y+i),a((u<<31|f/4294967296)>>>0,e,y+s);else{var d=Math.floor(Math.log(o)/Math.LN2);d===1024&&(d=1023),f=o*Math.pow(2,-d),a(f*4503599627370496>>>0,e,y+i),a((u<<31|d+1023<<20|f*1048576&1048575)>>>0,e,y+s)}}}n.writeDoubleLE=t.bind(null,nk,0,4),n.writeDoubleBE=t.bind(null,hk,4,0);function r(a,i,s,o,e){var y=a(o,e+i),u=a(o,e+s),f=(u>>31)*2+1,d=u>>>20&2047,m=4294967296*(u&1048575)+y;return d===2047?m?NaN:f*(1/0):d===0?f*5e-324*m:f*Math.pow(2,d-1075)*(m+4503599627370496)}n.readDoubleLE=r.bind(null,dk,0,4),n.readDoubleBE=r.bind(null,ck,4,0)})(),n}function nk(n,t,r){t[r]=n&255,t[r+1]=n>>>8&255,t[r+2]=n>>>16&255,t[r+3]=n>>>24}function hk(n,t,r){t[r]=n>>>24,t[r+1]=n>>>16&255,t[r+2]=n>>>8&255,t[r+3]=n&255}function dk(n,t){return(n[t]|n[t+1]<<8|n[t+2]<<16|n[t+3]<<24)>>>0}function ck(n,t){return(n[t]<<24|n[t+1]<<16|n[t+2]<<8|n[t+3])>>>0}});var mk=j(uk=>{"use strict";var gu=uk,yu=65533;gu.length=function(t){for(var r=0,a=0,i=0;i=192&&e<224?(u=(e&31)<<6|t[r++]&63,s[o++]=u>=128?u:yu):e>=224&&e<240?(f=(e&15)<<12|(t[r++]&63)<<6|t[r++]&63,s[o++]=f>=2048?f:yu):e>=240&&(y=(e&7)<<18|(t[r++]&63)<<12|(t[r++]&63)<<6|t[r++]&63,y<65536||y>1114111?s[o++]=yu:(y-=65536,s[o++]=55296+(y>>10),s[o++]=56320+(y&1023))),o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s.slice(0,o))),o=0);return i?(o&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))};gu.write=function(t,r,a){for(var i=a,s,o,e=0;e>6|192,r[a++]=s&63|128):(s&64512)===55296&&((o=t.charCodeAt(e+1))&64512)===56320?(s=65536+((s&1023)<<10)+(o&1023),++e,r[a++]=s>>18|240,r[a++]=s>>12&63|128,r[a++]=s>>6&63|128,r[a++]=s&63|128):(r[a++]=s>>12|224,r[a++]=s>>6&63|128,r[a++]=s&63|128);return a-i}});var yk=j((C9,fk)=>{"use strict";fk.exports=$G;function $G(n,t,r){var a=r||8192,i=a>>>1,s=null,o=a;return function(y){if(y<1||y>i)return n(y);o+y>a&&(s=n(a),o=0);var u=t.call(s,o,o+=y);return o&7&&(o=(o|7)+1),u}}});var vk=j((j9,gk)=>{"use strict";gk.exports=Be;var Us=Ir();function Be(n,t){this.lo=n>>>0,this.hi=t>>>0}var sa=Be.zero=new Be(0,0);sa.toNumber=function(){return 0};sa.zzEncode=sa.zzDecode=function(){return this};sa.length=function(){return 1};var zG=Be.zeroHash="\0\0\0\0\0\0\0\0";Be.fromNumber=function(t){if(t===0)return sa;var r=t<0;r&&(t=-t);var a=t>>>0,i=(t-a)/4294967296>>>0;return r&&(i=~i>>>0,a=~a>>>0,++a>4294967295&&(a=0,++i>4294967295&&(i=0))),new Be(a,i)};Be.from=function(t){if(typeof t=="number")return Be.fromNumber(t);if(Us.isString(t))if(Us.Long)t=Us.Long.fromString(t);else return Be.fromNumber(parseInt(t,10));return t.low||t.high?new Be(t.low>>>0,t.high>>>0):sa};Be.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var r=~this.lo+1>>>0,a=~this.hi>>>0;return r||(a=a+1>>>0),-(r+a*4294967296)}return this.lo+this.hi*4294967296};Be.prototype.toLong=function(t){return Us.Long?new Us.Long(this.lo|0,this.hi|0,!!t):{low:this.lo|0,high:this.hi|0,unsigned:!!t}};var Sr=String.prototype.charCodeAt;Be.fromHash=function(t){return t===zG?sa:new Be((Sr.call(t,0)|Sr.call(t,1)<<8|Sr.call(t,2)<<16|Sr.call(t,3)<<24)>>>0,(Sr.call(t,4)|Sr.call(t,5)<<8|Sr.call(t,6)<<16|Sr.call(t,7)<<24)>>>0)};Be.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};Be.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this};Be.prototype.zzDecode=function(){var t=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this};Be.prototype.length=function(){var t=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,a=this.hi>>>24;return a===0?r===0?t<16384?t<128?1:2:t<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:a<128?9:10}});var _k=j((Ws,vu)=>{(function(n,t){function r(a){return a.default||a}typeof define=="function"&&define.amd?define([],function(){var a={};return t(a),r(a)}):typeof Ws=="object"?(t(Ws),typeof vu=="object"&&(vu.exports=r(Ws))):(function(){var a={};t(a),n.Long=r(a)})()})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:Ws,function(n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function r(z,P,D){this.low=z|0,this.high=P|0,this.unsigned=!!D}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0});function a(z){return(z&&z.__isLong__)===!0}function i(z){var P=Math.clz32(z&-z);return z?31-P:P}r.isLong=a;var s={},o={};function e(z,P){var D,H,Z;return P?(z>>>=0,(Z=0<=z&&z<256)&&(H=o[z],H)?H:(D=u(z,0,!0),Z&&(o[z]=D),D)):(z|=0,(Z=-128<=z&&z<128)&&(H=s[z],H)?H:(D=u(z,z<0?-1:0,!1),Z&&(s[z]=D),D))}r.fromInt=e;function y(z,P){if(isNaN(z))return P?F:E;if(P){if(z<0)return F;if(z>=w)return N}else{if(z<=-S)return B;if(z+1>=S)return M}return z<0?y(-z,P).neg():u(z%b|0,z/b|0,P)}r.fromNumber=y;function u(z,P,D){return new r(z,P,D)}r.fromBits=u;var f=Math.pow;function d(z,P,D){if(z.length===0)throw Error("empty string");if(typeof P=="number"?(D=P,P=!1):P=!!P,z==="NaN"||z==="Infinity"||z==="+Infinity"||z==="-Infinity")return P?F:E;if(D=D||10,D<2||360)throw Error("interior hyphen");if(H===0)return d(z.substring(1),P,D).neg();for(var Z=y(f(D,8)),he=E,ue=0;ue>>0:this.low},R.toNumber=function(){return this.unsigned?(this.high>>>0)*b+(this.low>>>0):this.high*b+(this.low>>>0)},R.toString=function(P){if(P=P||10,P<2||36>>0,ce=ee.toString(P);if(ue=ae,ue.isZero())return ce+V;for(;ce.length<6;)ce="0"+ce;V=""+ce+V}},R.getHighBits=function(){return this.high},R.getHighBitsUnsigned=function(){return this.high>>>0},R.getLowBits=function(){return this.low},R.getLowBitsUnsigned=function(){return this.low>>>0},R.getNumBitsAbs=function(){if(this.isNegative())return this.eq(B)?64:this.neg().getNumBitsAbs();for(var P=this.high!=0?this.high:this.low,D=31;D>0&&(P&1<>21;return P?this.unsigned?!1:P===-1&&!(this.low===0&&this.high===-2097152):!0},R.isZero=function(){return this.high===0&&this.low===0},R.eqz=R.isZero,R.isNegative=function(){return!this.unsigned&&this.high<0},R.isPositive=function(){return this.unsigned||this.high>=0},R.isOdd=function(){return(this.low&1)===1},R.isEven=function(){return(this.low&1)===0},R.equals=function(P){return a(P)||(P=m(P)),this.unsigned!==P.unsigned&&this.high>>>31===1&&P.high>>>31===1?!1:this.high===P.high&&this.low===P.low},R.eq=R.equals,R.notEquals=function(P){return!this.eq(P)},R.neq=R.notEquals,R.ne=R.notEquals,R.lessThan=function(P){return this.comp(P)<0},R.lt=R.lessThan,R.lessThanOrEqual=function(P){return this.comp(P)<=0},R.lte=R.lessThanOrEqual,R.le=R.lessThanOrEqual,R.greaterThan=function(P){return this.comp(P)>0},R.gt=R.greaterThan,R.greaterThanOrEqual=function(P){return this.comp(P)>=0},R.gte=R.greaterThanOrEqual,R.ge=R.greaterThanOrEqual,R.compare=function(P){if(a(P)||(P=m(P)),this.eq(P))return 0;var D=this.isNegative(),H=P.isNegative();return D&&!H?-1:!D&&H?1:this.unsigned?P.high>>>0>this.high>>>0||P.high===this.high&&P.low>>>0>this.low>>>0?-1:1:this.sub(P).isNegative()?-1:1},R.comp=R.compare,R.negate=function(){return!this.unsigned&&this.eq(B)?B:this.not().add($)},R.neg=R.negate,R.add=function(P){a(P)||(P=m(P));var D=this.high>>>16,H=this.high&65535,Z=this.low>>>16,he=this.low&65535,ue=P.high>>>16,V=P.high&65535,ae=P.low>>>16,ee=P.low&65535,ce=0,ke=0,ye=0,K=0;return K+=he+ee,ye+=K>>>16,K&=65535,ye+=Z+ae,ke+=ye>>>16,ye&=65535,ke+=H+V,ce+=ke>>>16,ke&=65535,ce+=D+ue,ce&=65535,u(ye<<16|K,ce<<16|ke,this.unsigned)},R.subtract=function(P){return a(P)||(P=m(P)),this.add(P.neg())},R.sub=R.subtract,R.multiply=function(P){if(this.isZero())return this;if(a(P)||(P=m(P)),t){var D=t.mul(this.low,this.high,P.low,P.high);return u(D,t.get_high(),this.unsigned)}if(P.isZero())return this.unsigned?F:E;if(this.eq(B))return P.isOdd()?B:E;if(P.eq(B))return this.isOdd()?B:E;if(this.isNegative())return P.isNegative()?this.neg().mul(P.neg()):this.neg().mul(P).neg();if(P.isNegative())return this.mul(P.neg()).neg();if(this.lt(O)&&P.lt(O))return y(this.toNumber()*P.toNumber(),this.unsigned);var H=this.high>>>16,Z=this.high&65535,he=this.low>>>16,ue=this.low&65535,V=P.high>>>16,ae=P.high&65535,ee=P.low>>>16,ce=P.low&65535,ke=0,ye=0,K=0,Te=0;return Te+=ue*ce,K+=Te>>>16,Te&=65535,K+=he*ce,ye+=K>>>16,K&=65535,K+=ue*ee,ye+=K>>>16,K&=65535,ye+=Z*ce,ke+=ye>>>16,ye&=65535,ye+=he*ee,ke+=ye>>>16,ye&=65535,ye+=ue*ae,ke+=ye>>>16,ye&=65535,ke+=H*ce+Z*ee+he*ae+ue*V,ke&=65535,u(K<<16|Te,ke<<16|ye,this.unsigned)},R.mul=R.multiply,R.divide=function(P){if(a(P)||(P=m(P)),P.isZero())throw Error("division by zero");if(t){if(!this.unsigned&&this.high===-2147483648&&P.low===-1&&P.high===-1)return this;var D=(this.unsigned?t.div_u:t.div_s)(this.low,this.high,P.low,P.high);return u(D,t.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?F:E;var H,Z,he;if(this.unsigned){if(P.unsigned||(P=P.toUnsigned()),P.gt(this))return F;if(P.gt(this.shru(1)))return A;he=F}else{if(this.eq(B)){if(P.eq($)||P.eq(G))return B;if(P.eq(B))return $;var ue=this.shr(1);return H=ue.div(P).shl(1),H.eq(E)?P.isNegative()?$:G:(Z=this.sub(P.mul(H)),he=H.add(Z.div(P)),he)}else if(P.eq(B))return this.unsigned?F:E;if(this.isNegative())return P.isNegative()?this.neg().div(P.neg()):this.neg().div(P).neg();if(P.isNegative())return this.div(P.neg()).neg();he=E}for(Z=this;Z.gte(P);){H=Math.max(1,Math.floor(Z.toNumber()/P.toNumber()));for(var V=Math.ceil(Math.log(H)/Math.LN2),ae=V<=48?1:f(2,V-48),ee=y(H),ce=ee.mul(P);ce.isNegative()||ce.gt(Z);)H-=ae,ee=y(H,this.unsigned),ce=ee.mul(P);ee.isZero()&&(ee=$),he=he.add(ee),Z=Z.sub(ce)}return he},R.div=R.divide,R.modulo=function(P){if(a(P)||(P=m(P)),t){var D=(this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,P.low,P.high);return u(D,t.get_high(),this.unsigned)}return this.sub(this.div(P).mul(P))},R.mod=R.modulo,R.rem=R.modulo,R.not=function(){return u(~this.low,~this.high,this.unsigned)},R.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},R.clz=R.countLeadingZeros,R.countTrailingZeros=function(){return this.low?i(this.low):i(this.high)+32},R.ctz=R.countTrailingZeros,R.and=function(P){return a(P)||(P=m(P)),u(this.low&P.low,this.high&P.high,this.unsigned)},R.or=function(P){return a(P)||(P=m(P)),u(this.low|P.low,this.high|P.high,this.unsigned)},R.xor=function(P){return a(P)||(P=m(P)),u(this.low^P.low,this.high^P.high,this.unsigned)},R.shiftLeft=function(P){return a(P)&&(P=P.toInt()),(P&=63)===0?this:P<32?u(this.low<>>32-P,this.unsigned):u(0,this.low<>>P|this.high<<32-P,this.high>>P,this.unsigned):u(this.high>>P-32,this.high>=0?0:-1,this.unsigned)},R.shr=R.shiftRight,R.shiftRightUnsigned=function(P){return a(P)&&(P=P.toInt()),(P&=63)===0?this:P<32?u(this.low>>>P|this.high<<32-P,this.high>>>P,this.unsigned):P===32?u(this.high,0,this.unsigned):u(this.high>>>P-32,0,this.unsigned)},R.shru=R.shiftRightUnsigned,R.shr_u=R.shiftRightUnsigned,R.rotateLeft=function(P){var D;return a(P)&&(P=P.toInt()),(P&=63)===0?this:P===32?u(this.high,this.low,this.unsigned):P<32?(D=32-P,u(this.low<>>D,this.high<>>D,this.unsigned)):(P-=32,D=32-P,u(this.high<>>D,this.low<>>D,this.unsigned))},R.rotl=R.rotateLeft,R.rotateRight=function(P){var D;return a(P)&&(P=P.toInt()),(P&=63)===0?this:P===32?u(this.high,this.low,this.unsigned):P<32?(D=32-P,u(this.high<>>P,this.low<>>P,this.unsigned)):(P-=32,D=32-P,u(this.low<>>P,this.high<>>P,this.unsigned))},R.rotr=R.rotateRight,R.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},R.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},R.toBytes=function(P){return P?this.toBytesLE():this.toBytesBE()},R.toBytesLE=function(){var P=this.high,D=this.low;return[D&255,D>>>8&255,D>>>16&255,D>>>24,P&255,P>>>8&255,P>>>16&255,P>>>24]},R.toBytesBE=function(){var P=this.high,D=this.low;return[P>>>24,P>>>16&255,P>>>8&255,P&255,D>>>24,D>>>16&255,D>>>8&255,D&255]},r.fromBytes=function(P,D,H){return H?r.fromBytesLE(P,D):r.fromBytesBE(P,D)},r.fromBytesLE=function(P,D){return new r(P[0]|P[1]<<8|P[2]<<16|P[3]<<24,P[4]|P[5]<<8|P[6]<<16|P[7]<<24,D)},r.fromBytesBE=function(P,D){return new r(P[4]<<24|P[5]<<16|P[6]<<8|P[7],P[0]<<24|P[1]<<16|P[2]<<8|P[3],D)},typeof BigInt=="function"&&(r.fromBigInt=function(P,D){var H=Number(BigInt.asIntN(32,P)),Z=Number(BigInt.asIntN(32,P>>BigInt(32)));return u(H,Z,D)},r.fromValue=function(P,D){return typeof P=="bigint"?r.fromBigInt(P,D):m(P,D)},R.toBigInt=function(){var P=BigInt(this.low>>>0),D=BigInt(this.unsigned?this.high>>>0:this.high);return D<{"use strict";var W=_u;W.asPromise=ZI();W.base64=ak();W.EventEmitter=sk();W.float=pk();W.utf8=mk();W.pool=yk();W.LongBits=vk();function bk(n){return n==="__proto__"||n==="prototype"||n==="constructor"}W.isUnsafeProperty=bk;W.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);W.global=W.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||_u;W.emptyArray=Object.freeze?Object.freeze([]):[];W.emptyObject=Object.freeze?Object.freeze({}):{};W.isInteger=Number.isInteger||function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t};W.isString=function(t){return typeof t=="string"||t instanceof String};W.isObject=function(t){return t&&typeof t=="object"};W.isset=W.isSet=function(t,r){var a=t[r];return a!=null&&Object.hasOwnProperty.call(t,r)?typeof a!="object"||(Array.isArray(a)?a.length:Object.keys(a).length)>0:!1};W.Buffer=(function(){try{var n=W.global.Buffer;return n.prototype.utf8Write?n:null}catch{return null}})();W._Buffer_from=null;W._Buffer_allocUnsafe=null;W.newBuffer=function(t){return typeof t=="number"?W.Buffer?W._Buffer_allocUnsafe(t):new W.Array(t):W.Buffer?W._Buffer_from(t):typeof Uint8Array>"u"?t:new Uint8Array(t)};W.Array=typeof Uint8Array<"u"?Uint8Array:Array;W.Long=W.global.dcodeIO&&W.global.dcodeIO.Long||W.global.Long||(function(){try{var n=_k();return n&&n.isLong?n:null}catch{return null}})();W.key2Re=/^true|false|0|1$/;W.key32Re=/^-?(?:0|[1-9][0-9]*)$/;W.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;W.longToHash=function(t){return t?W.LongBits.from(t).toHash():W.LongBits.zeroHash};W.longFromHash=function(t,r){var a=W.LongBits.fromHash(t);return W.Long?W.Long.fromBits(a.lo,a.hi,r):a.toNumber(!!r)};function wk(n){var t=typeof arguments[arguments.length-1]=="boolean",r=t?arguments.length-1:arguments.length;t=t&&arguments[arguments.length-1];for(var a=1;a-1;--s)if(r[i[s]]===1&&this[i[s]]!==void 0&&this[i[s]]!==null)return i[s]}};W.oneOfSetter=function(t){return function(r){for(var a=0;a{"use strict";xk.exports=ne;var _t=Ir(),bu,Th=_t.LongBits,Ik=_t.base64,kk=_t.utf8;function Hs(n,t,r){this.fn=n,this.len=t,this.next=void 0,this.val=r}function Su(){}function RG(n){this.head=n.head,this.tail=n.tail,this.len=n.len,this.next=n.states}function ne(){this.len=0,this.head=new Hs(Su,0,0),this.tail=this.head,this.states=null}var Tk=function(){return _t.Buffer?function(){return(ne.create=function(){return new bu})()}:function(){return new ne}};ne.create=Tk();ne.alloc=function(t){return new _t.Array(t)};_t.Array!==Array&&(ne.alloc=_t.pool(ne.alloc,_t.Array.prototype.subarray));ne.prototype._push=function(t,r,a){return this.tail=this.tail.next=new Hs(t,r,a),this.len+=r,this};function Iu(n,t,r){t[r]=n&255}function AG(n,t,r){for(;n>127;)t[r++]=n&127|128,n>>>=7;t[r]=n}function ku(n,t){this.len=n,this.next=void 0,this.val=t}ku.prototype=Object.create(Hs.prototype);ku.prototype.fn=AG;ne.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new ku((t=t>>>0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this};ne.prototype.int32=function(t){return(t|=0)<0?this._push(Tu,10,Th.fromNumber(t)):this.uint32(t)};ne.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)};function Tu(n,t,r){for(var a=n.lo,i=n.hi;i;)t[r++]=a&127|128,a=(a>>>7|i<<25)>>>0,i>>>=7;for(;a>127;)t[r++]=a&127|128,a=a>>>7;t[r++]=a}ne.prototype.uint64=function(t){var r=Th.from(t);return this._push(Tu,r.length(),r)};ne.prototype.int64=ne.prototype.uint64;ne.prototype.sint64=function(t){var r=Th.from(t).zzEncode();return this._push(Tu,r.length(),r)};ne.prototype.bool=function(t){return this._push(Iu,1,t?1:0)};function wu(n,t,r){t[r]=n&255,t[r+1]=n>>>8&255,t[r+2]=n>>>16&255,t[r+3]=n>>>24}ne.prototype.fixed32=function(t){return this._push(wu,4,t>>>0)};ne.prototype.sfixed32=ne.prototype.fixed32;ne.prototype.fixed64=function(t){var r=Th.from(t);return this._push(wu,4,r.lo)._push(wu,4,r.hi)};ne.prototype.sfixed64=ne.prototype.fixed64;ne.prototype.float=function(t){return this._push(_t.float.writeFloatLE,4,t)};ne.prototype.double=function(t){return this._push(_t.float.writeDoubleLE,8,t)};var CG=_t.Array.prototype.set?function(t,r,a){r.set(t,a)}:function(t,r,a){for(var i=0;i>>0;if(!r)return this._push(Iu,1,0);if(_t.isString(t)){var a=ne.alloc(r=Ik.length(t));Ik.decode(t,a,0),t=a}return this.uint32(r)._push(CG,r,t)};ne.prototype.string=function(t){var r=kk.length(t);return r?this.uint32(r)._push(kk.write,r,t):this._push(Iu,1,0)};ne.prototype.fork=function(){return this.states=new RG(this),this.head=this.tail=new Hs(Su,0,0),this.len=0,this};ne.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Hs(Su,0,0),this.len=0),this};ne.prototype.ldelim=function(){var t=this.head,r=this.tail,a=this.len;return this.reset().uint32(a),a&&(this.tail.next=t.next,this.tail=r,this.len+=a),this};ne.prototype.finish=function(){for(var t=this.head.next,r=this.constructor.alloc(this.len),a=0;t;)t.fn(t.val,r,a),a+=t.len,t=t.next;return r};ne._configure=function(n){bu=n,ne.create=Tk(),bu._configure()}});var Ek=j((B9,qk)=>{"use strict";qk.exports=Lt;var Pk=xu();(Lt.prototype=Object.create(Pk.prototype)).constructor=Lt;var kr=Ir();function Lt(){Pk.call(this)}Lt._configure=function(){Lt.alloc=kr._Buffer_allocUnsafe,Lt.writeBytesBuffer=kr.Buffer&&kr.Buffer.prototype instanceof Uint8Array&&kr.Buffer.prototype.set.name==="set"?function(t,r,a){r.set(t,a)}:function(t,r,a){if(t.copy)t.copy(r,a,0,t.length);else for(var i=0;i>>0;return this.uint32(r),r&&this._push(Lt.writeBytesBuffer,r,t),this};function jG(n,t,r){n.length<40?kr.utf8.write(n,t,r):t.utf8Write?t.utf8Write(n,r):t.write(n,r)}Lt.prototype.string=function(t){var r=kr.Buffer.byteLength(t);return this.uint32(r),r&&this._push(jG,r,t),this};Lt._configure()});var Eu=j((M9,Rk)=>{"use strict";Rk.exports=Ie;var bt=Ir(),qu,$k=bt.LongBits,DG=bt.utf8;function Ft(n,t){return RangeError("index out of range: "+n.pos+" + "+(t||1)+" > "+n.len)}function Ie(n){this.buf=n,this.pos=0,this.len=n.length}var Fk=typeof Uint8Array<"u"?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new Ie(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new Ie(t);throw Error("illegal buffer")},zk=function(){return bt.Buffer?function(r){return(Ie.create=function(i){return bt.Buffer.isBuffer(i)?new qu(i):Fk(i)})(r)}:Fk};Ie.create=zk();Ie.prototype._slice=bt.Array.prototype.subarray||bt.Array.prototype.slice;Ie.prototype.uint32=(function(){var t=4294967295;return function(){if(t=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(t=(t|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return t;if((this.pos+=5)>this.len)throw this.pos=this.len,Ft(this,10);return t}})();Ie.prototype.int32=function(){return this.uint32()|0};Ie.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(t&1)|0};function Pu(){var n=new $k(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(n.lo=(n.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return n;if(n.lo=(n.lo|(this.buf[this.pos]&127)<<28)>>>0,n.hi=(n.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return n;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw Ft(this);if(n.lo=(n.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return n}return n.lo=(n.lo|(this.buf[this.pos++]&127)<>>0,n}if(this.len-this.pos>4){for(;t<5;++t)if(n.hi=(n.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return n}else for(;t<5;++t){if(this.pos>=this.len)throw Ft(this);if(n.hi=(n.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return n}throw Error("invalid varint encoding")}Ie.prototype.bool=function(){return this.uint32()!==0};function xh(n,t){return(n[t-4]|n[t-3]<<8|n[t-2]<<16|n[t-1]<<24)>>>0}Ie.prototype.fixed32=function(){if(this.pos+4>this.len)throw Ft(this,4);return xh(this.buf,this.pos+=4)};Ie.prototype.sfixed32=function(){if(this.pos+4>this.len)throw Ft(this,4);return xh(this.buf,this.pos+=4)|0};function Ok(){if(this.pos+8>this.len)throw Ft(this,8);return new $k(xh(this.buf,this.pos+=4),xh(this.buf,this.pos+=4))}Ie.prototype.float=function(){if(this.pos+4>this.len)throw Ft(this,4);var t=bt.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t};Ie.prototype.double=function(){if(this.pos+8>this.len)throw Ft(this,4);var t=bt.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t};Ie.prototype.bytes=function(){var t=this.uint32(),r=this.pos,a=this.pos+t;if(a>this.len)throw Ft(this,t);if(this.pos+=t,Array.isArray(this.buf))return this.buf.slice(r,a);if(r===a){var i=bt.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,r,a)};Ie.prototype.string=function(){var t=this.bytes();return DG.read(t,0,t.length)};Ie.prototype.skip=function(t){if(typeof t=="number"){if(this.pos+t>this.len)throw Ft(this,t);this.pos+=t}else do if(this.pos>=this.len)throw Ft(this);while(this.buf[this.pos++]&128);return this};Ie.recursionLimit=bt.recursionLimit;Ie.prototype.skipType=function(n,t){if(t===void 0&&(t=0),t>Ie.recursionLimit)throw Error("maximum nesting depth exceeded");switch(n){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(n=this.uint32()&7)!==4;)this.skipType(n,t+1);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+n+" at offset "+this.pos)}return this};Ie._configure=function(n){qu=n,Ie.create=zk(),qu._configure();var t=bt.Long?"toLong":"toNumber";bt.merge(Ie.prototype,{int64:function(){return Pu.call(this)[t](!1)},uint64:function(){return Pu.call(this)[t](!0)},sint64:function(){return Pu.call(this).zzDecode()[t](!1)},fixed64:function(){return Ok.call(this)[t](!0)},sfixed64:function(){return Ok.call(this)[t](!1)}})}});var Dk=j((L9,jk)=>{"use strict";jk.exports=oa;var Ck=Eu();(oa.prototype=Object.create(Ck.prototype)).constructor=oa;var Ak=Ir();function oa(n){Ck.call(this,n)}oa._configure=function(){Ak.Buffer&&(oa.prototype._slice=Ak.Buffer.prototype.slice)};oa.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))};oa._configure()});var Bk=j((N9,Gk)=>{"use strict";Gk.exports=Qs;var Fu=Ir();(Qs.prototype=Object.create(Fu.EventEmitter.prototype)).constructor=Qs;function Qs(n,t,r){if(typeof n!="function")throw TypeError("rpcImpl must be a function");Fu.EventEmitter.call(this),this.rpcImpl=n,this.requestDelimited=!!t,this.responseDelimited=!!r}Qs.prototype.rpcCall=function n(t,r,a,i,s){if(!i)throw TypeError("request must be specified");var o=this;if(!s)return Fu.asPromise(n,o,t,r,a,i);if(!o.rpcImpl){setTimeout(function(){s(Error("already ended"))},0);return}try{return o.rpcImpl(t,r[o.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(y,u){if(y)return o.emit("error",y,t),s(y);if(u===null){o.end(!0);return}if(!(u instanceof a))try{u=a[o.responseDelimited?"decodeDelimited":"decode"](u)}catch(f){return o.emit("error",f,t),s(f)}return o.emit("data",u,t),s(null,u)})}catch(e){o.emit("error",e,t),setTimeout(function(){s(e)},0);return}};Qs.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var Lk=j(Mk=>{"use strict";var GG=Mk;GG.Service=Bk()});var Uk=j((W9,Nk)=>{"use strict";Nk.exports=Object.create(null)});var Qk=j(Hk=>{"use strict";var rt=Hk;rt.build="minimal";rt.Writer=xu();rt.BufferWriter=Ek();rt.Reader=Eu();rt.BufferReader=Dk();rt.util=Ir();rt.rpc=Lk();rt.roots=Uk();rt.configure=Wk;function Wk(){rt.util._configure(),rt.Writer._configure(rt.BufferWriter),rt.Reader._configure(rt.BufferReader)}Wk()});var Kk=j((Q9,Vk)=>{"use strict";Vk.exports=Qk()});import{unlink as bq}from"node:fs/promises";import{homedir as wq}from"node:os";import{join as Co,resolve as wa}from"node:path";import{createHash as gP,randomUUID as og}from"node:crypto";import{mkdir as vP,readFile as _P,rename as bP,unlink as sg,writeFile as wP}from"node:fs/promises";import{dirname as SP}from"node:path";var Xd=Object.freeze({version:1,bots:Object.freeze([])}),IP=new Set(["clientId","secretRef","approvedSenders"]);function St(n){return typeof n=="string"&&n.trim()?n.trim():null}function kP(n){return gP("sha256").update(n).digest("hex")}function ng(n){let t=St(n);return t&&/^dt_[a-f0-9]{24}$/.test(t)?t:null}function TP(n){let t=St(n);return t&&/^DSH_DINGTALK_BOT_SECRET_[A-F0-9]{24}$/.test(t)?t:null}function xP(n){let t=St(n);return t&&/^dt_sender_[a-f0-9]{32}$/.test(t)?t:null}function PP(n){let t=typeof n=="string"?{staffId:n}:n;if(!t||typeof t!="object"||Array.isArray(t))return null;let r=xP(t.senderKey),a=St(t.staffId);return!r||!a?null:Object.freeze({senderKey:r,staffId:a,displayName:St(t.displayName),approvedAt:St(t.approvedAt)})}function qP(n){if(!Array.isArray(n))return null;let t=n.map(PP);if(t.some(i=>i===null))return null;let r=new Set,a=new Set;for(let i of t){if(r.has(i.staffId)||a.has(i.senderKey))return null;r.add(i.staffId),a.add(i.senderKey)}return Object.freeze(t)}function To(n){let t=St(n);if(!t)throw new TypeError("clientId is required");let r=kP(t).slice(0,24);return Object.freeze({botId:`dt_${r}`,secretRef:`DSH_DINGTALK_BOT_SECRET_${r.toUpperCase()}`})}function hg(){return`dt_sender_${og().replaceAll("-","")}`}function Yd(n){return St(n)?"\u8EAB\u4EFD\u5DF2\u9690\u85CF":"\u9489\u9489\u7528\u6237"}function dg(n){let t=St(n);return t?t.length<=8?`${t.slice(0,2)}\u2022\u2022\u2022\u2022`:`${t.slice(0,4)}\u2022\u2022\u2022\u2022${t.slice(-4)}`:"\u9489\u9489\u673A\u5668\u4EBA"}function cg(n,{stored:t=!1}={}){if(!n||typeof n!="object"||Array.isArray(n)||"clientSecret"in n||"client_secret"in n||"deviceCode"in n||t&&Object.keys(n).some(e=>!IP.has(e)))return null;let r=St(n.clientId),a=TP(n.secretRef),i=qP(n.approvedSenders??[]);if(!r||!a||!i)return null;let s=To(r);return s.secretRef!==a||(n.botId===void 0?s.botId:ng(n.botId))!==s.botId?null:Object.freeze({botId:s.botId,clientId:r,secretRef:a,approvedSenders:i})}function EP(n){if(!n||n.version!==1||!Array.isArray(n.bots))return null;let t=n.bots.map(s=>cg(s,{stored:!0}));if(t.some(s=>s===null))return null;let r=new Set,a=new Set,i=new Set;for(let s of t){if(r.has(s.botId)||a.has(s.clientId)||i.has(s.secretRef))return null;r.add(s.botId),a.add(s.clientId),i.add(s.secretRef)}return Object.freeze({version:1,bots:Object.freeze(t)})}function FP(n){return{version:1,bots:n.bots.map(t=>({clientId:t.clientId,secretRef:t.secretRef,approvedSenders:t.approvedSenders.map(r=>({senderKey:r.senderKey,staffId:r.staffId,displayName:r.displayName,approvedAt:r.approvedAt}))}))}}var ko=class{#t;#e=Xd;#r=Promise.resolve();constructor(t){if(!St(t))throw new TypeError("config path is required");this.#t=t}async load(){try{let t=EP(JSON.parse(await _P(this.#t,"utf8")));if(!t)throw new Error("dsh-dingtalk config contains invalid bot data");this.#e=t}catch(t){if(t?.code!=="ENOENT")throw t;this.#e=Xd}return this}list(){return structuredClone(this.#e.bots)}get(t){let r=this.#e.bots.find(a=>a.botId===t);return r?structuredClone(r):null}getByClientId(t){let r=this.#e.bots.find(a=>a.clientId===t);return r?structuredClone(r):null}async save(t){let r=cg(t);if(!r)throw new Error("Refusing to persist invalid dsh-dingtalk bot data");return this.#a(a=>{if(a.find(o=>(o.clientId===r.clientId||o.secretRef===r.secretRef)&&o.botId!==r.botId))throw new Error("Duplicate DingTalk bot identity");let s=a.findIndex(o=>o.botId===r.botId);return s===-1?a.push(r):a[s]=r,structuredClone(r)})}async remove(t){if(!ng(t))throw new TypeError("Invalid DingTalk bot id");return this.#a(r=>{let a=r.findIndex(s=>s.botId===t);if(a===-1)return null;let[i]=r.splice(a,1);return structuredClone(i)})}async clear(){let t=this.#r.then(async()=>{try{await sg(this.#t)}catch(r){if(r?.code!=="ENOENT")throw r}this.#e=Xd});this.#r=t.then(()=>{},()=>{}),await t}async#a(t){let r,a=this.#r.then(async()=>{let i=[...this.#e.bots];r=t(i);let s=Object.freeze({version:1,bots:Object.freeze(i)});await this.#n(s),this.#e=s});return this.#r=a.then(()=>{},()=>{}),await a,r}async#n(t){await vP(SP(this.#t),{recursive:!0,mode:448});let r=`${this.#t}.${process.pid}.${og()}.tmp`;try{await wP(r,`${JSON.stringify(FP(t),null,2)} +`,{encoding:"utf8",flag:"wx",mode:384}),await bP(r,this.#t)}catch(a){try{await sg(r)}catch(i){if(i?.code!=="ENOENT")throw new AggregateError([a,i])}throw a}}};var pg="https://oapi.dingtalk.com",OP="DING_DWS_CLAW";function It(n){return typeof n=="string"&&n.trim()?n.trim():null}function lg(n,t){let r=Number(n);return Number.isFinite(r)&&r>0?r:t}function $P(n){let t;try{t=new URL(It(n)??pg)}catch{throw new TypeError("DingTalk registration base URL must be a valid HTTPS URL")}let r=t.hostname==="dingtalk.com"||t.hostname.endsWith(".dingtalk.com");if(t.protocol!=="https:"||t.port||!r||t.username||t.password||t.search||t.hash)throw new TypeError("DingTalk registration base URL must be a valid HTTPS URL");return t.pathname=t.pathname.replace(/\/+$/,""),t.href.replace(/\/$/,"")}function zP(n){let t=typeof n?.now=="function"?n.now():n();if(!Number.isFinite(t))throw new TypeError("clock must return a finite timestamp");return t}function RP(n,t){if(!n||typeof n!="object"||Array.isArray(n))throw new Rt("invalid-response",`DingTalk ${t} returned an invalid response`,t);if(Number(n.errcode)!==0)throw new Rt("api-error",`DingTalk ${t} request was rejected`,t);return n}var Rt=class extends Error{constructor(t,r,a,i={}){super(r,i),this.name="DingtalkDeviceAuthError",this.code=t,this.action=a}},xo=class{#t;#e;#r;#a;constructor({fetch:t=globalThis.fetch,clock:r=Date,baseUrl:a=pg,timeoutMs:i=15e3}={}){if(typeof t!="function")throw new TypeError("fetch is required");if(typeof r!="function"&&typeof r?.now!="function")throw new TypeError("clock must be a function or expose now()");if(!Number.isFinite(i)||i<=0)throw new TypeError("timeoutMs must be a positive number");this.#t=t,this.#e=r,this.#r=$P(a),this.#a=i}async start({signal:t}={}){let r=await this.#n("/app/registration/init",{source:OP},"initialization",t),a=It(r.nonce);if(!a)throw new Rt("missing-nonce","DingTalk registration initialization did not return a nonce","initialization");let i=await this.#n("/app/registration/begin",{nonce:a},"begin",t),s=It(i.device_code),o=It(i.verification_uri_complete);if(!s||!o)throw new Rt("incomplete-registration","DingTalk registration did not return complete QR metadata","begin");let e=lg(i.expires_in,7200),y=lg(i.interval,5)*1e3;return Object.freeze({deviceCode:s,verificationUrl:o,verificationUri:It(i.verification_uri),userCode:It(i.user_code),expiresAt:zP(this.#e)+e*1e3,pollIntervalMs:y})}async poll(t){let r=It(typeof t=="string"?t:t?.deviceCode),a=typeof t=="object"?t?.signal:void 0;if(!r)throw new TypeError("deviceCode is required");let i=await this.#n("/app/registration/poll",{device_code:r},"poll",a),s=It(i.status)?.toUpperCase(),o=["WAITING","SUCCESS","FAIL","EXPIRED"].includes(s)?s:"UNKNOWN";return Object.freeze({status:o,clientId:It(i.client_id),clientSecret:It(i.client_secret),failReason:It(i.fail_reason)})}async#n(t,r,a,i){let s,o=AbortSignal.timeout(this.#a),e=i?AbortSignal.any([i,o]):o;try{s=await this.#t(`${this.#r}${t}`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(r),redirect:"error",signal:e})}catch(u){throw i?.aborted?i.reason??u:o.aborted?new Rt("timeout",`DingTalk ${a} request timed out`,a,{cause:u}):u?.name==="AbortError"?u:new Rt("network-error",`DingTalk ${a} request could not be completed`,a,{cause:u})}if(!s||s.ok===!1||typeof s.json!="function")throw new Rt("http-error",`DingTalk ${a} request failed`,a);let y;try{y=await s.json()}catch(u){throw new Rt("invalid-json",`DingTalk ${a} returned invalid JSON`,a,{cause:u})}return RP(y,a)}};import{randomUUID as AP}from"node:crypto";var ug=new Set(["starting","pending","connecting"]),Po=new Set(["connected","expired","failed","cancelled"]);function Ce(n){return typeof n=="string"&&n.trim()?n.trim():null}function We(n,t){return Object.freeze({code:n,message:t})}function yg(n){return typeof n?.now=="function"?n.now():n()}function CP(n){return new Date(yg(n)).toISOString()}function dr(){return new DOMException("DingTalk provisioning was cancelled","AbortError")}function Fr(n){return n?{attemptId:n.id,status:n.state,...n.verificationUrl?{verificationUrl:n.verificationUrl}:{},...n.expiresAt?{expiresAt:n.expiresAt}:{},...n.pollIntervalMs?{pollIntervalMs:n.pollIntervalMs}:{},...n.botId?{botId:n.botId}:{},...n.alreadyConnected?{alreadyConnected:!0}:{},...n.error?{error:structuredClone(n.error)}:{}}:null}function Zd(n){if(!n)return{};let t=typeof n.status=="function"?n.status():n.status;return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function mg(n,t){if(!n||t.connected===!1||t.ready===!1)return!1;let r=Ce(t.dingtalkStreamState??t.dingtalkConnectionState??t.connectionState??t.state)?.toLowerCase();return["failed","error","offline","disconnected","stopped"].includes(r)?!1:t.connected===!0||t.ready===!0||r==="connected"||r==="ready"}function gg(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let t=Ce(n.staffId??n.senderStaffId??n.senderId);if(!t)return null;let r=Ce(n.requestId),a=r&&/^ding_sender_[A-Za-z0-9_-]{1,100}$/.test(r)&&!r.includes(t)?r:null;return a?{requestId:a,staffId:t,displayName:Ce(n.displayName??n.senderName??n.senderNick)??"\u9489\u9489\u7528\u6237",requestedAt:Ce(n.requestedAt)}:null}function fg(n){if(!Array.isArray(n.pendingSenders))return[];let t=new Set,r=[];for(let a of n.pendingSenders){let i=gg(a);!i||t.has(i.staffId)||(t.add(i.staffId),r.push(i))}return r}function jP(n){return{requestId:n.requestId,displayName:n.displayName,senderIdMasked:Yd(n.staffId),requestedAt:n.requestedAt}}function DP(n){return{senderKey:n.senderKey,displayName:Ce(n.displayName)??"\u9489\u9489\u7528\u6237",senderIdMasked:Yd(n.staffId),approvedAt:Ce(n.approvedAt)}}var Ri=class{#t;#e;#r;#a;#n;#o;#d;#h=new Map;#c=new Map;#i=new Map;#s=null;#l=new Map;#p=0;#m=!1;constructor({deviceAuth:t,credentials:r,configStore:a,createRuntime:i,deleteState:s=async()=>{},logger:o=console,clock:e=Date}){if(!t||typeof t.start!="function"||typeof t.poll!="function")throw new TypeError("DingtalkController requires a DingTalk device auth client");if(!r||typeof r.resolve!="function"||typeof r.set!="function"||typeof r.unset!="function")throw new TypeError("DingtalkController requires the DSH credential provider");if(!a||typeof a.list!="function"||typeof a.get!="function"||typeof a.getByClientId!="function"||typeof a.save!="function"||typeof a.remove!="function")throw new TypeError("DingtalkController requires a loaded config store");if(typeof i!="function")throw new TypeError("createRuntime is required");if(typeof s!="function")throw new TypeError("deleteState must be a function");if(typeof e!="function"&&typeof e?.now!="function")throw new TypeError("clock must be a function or expose now()");this.#t=t,this.#e=r,this.#r=a,this.#a=i,this.#n=s,this.#o=o,this.#d=e}async initialize(){if(this.#m)return this.status();for(let t of this.#r.list()){let r=this.#h.get(t.botId);try{if(mg(r,Zd(r)))continue}catch{}await this.#_(t.botId,async()=>{let a=this.#r.get(t.botId);if(!a||this.#m)return;let i=await this.#w(a.secretRef);if(!i){this.#c.set(a.botId,We("missing-secret","\u9489\u9489\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002")),this.#I();return}try{await this.#g(a,i),this.#c.delete(a.botId)}catch{this.#c.set(a.botId,We("connection-failed","\u9489\u9489\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")),this.#o.warn?.(`[dsh-dingtalk] bot ${a.botId} failed to initialize`)}this.#I()})}return this.status()}async startProvisioning({signal:t}={}){if(this.#m)throw new Error("dsh-dingtalk controller is closed");this.#s&&await this.cancelProvisioning(this.#s);let r={id:AP(),state:"starting",controller:new AbortController,deviceCode:null,verificationUrl:null,expiresAt:null,pollIntervalMs:null,pollTask:null,botId:null,alreadyConnected:!1,error:null};this.#i.set(r.id,r),this.#s=r.id,this.#I();let a=()=>r.controller.abort(t?.reason);t?.aborted?a():t?.addEventListener("abort",a,{once:!0});try{let i=await this.#t.start({signal:r.controller.signal});if(this.#S(r),r.deviceCode=Ce(i.deviceCode),r.verificationUrl=Ce(i.verificationUrl),r.expiresAt=Number(i.expiresAt),r.pollIntervalMs=Number(i.pollIntervalMs),!r.deviceCode||!r.verificationUrl||!Number.isFinite(r.expiresAt)||!Number.isFinite(r.pollIntervalMs)||r.pollIntervalMs<=0)throw new Error("DingTalk device auth returned incomplete registration metadata");return r.state="pending",this.#I(),Fr(r)}catch(i){if(r.controller.signal.aborted||i?.name==="AbortError"?(r.state="cancelled",r.error=We("cancelled","\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002")):(r.state="failed",r.error=We("qr-start-failed","\u65E0\u6CD5\u751F\u6210\u9489\u9489\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")),this.#s===r.id&&(this.#s=null),this.#I(),r.state==="failed")throw i;return Fr(r)}finally{t?.removeEventListener("abort",a)}}async bindCredentials({clientId:t,clientSecret:r}={}){if(this.#m)throw new Error("dsh-dingtalk controller is closed");let a=Ce(t),i=Ce(r);if(!a||!i)throw new TypeError("DingTalk Client ID and Client Secret are required");if(this.#s&&await this.cancelProvisioning(this.#s),this.#m)throw new Error("dsh-dingtalk controller is closed");let s=To(a);return await this.#_(s.botId,async()=>{if(this.#m)throw dr();let o=this.#r.getByClientId(a),e=await this.#e.resolve(s.secretRef).catch(()=>{});if(this.#m)throw dr();let y={botId:s.botId,clientId:a,secretRef:s.secretRef,approvedSenders:o?.approvedSenders??[]};await this.#e.set(s.secretRef,i);try{await this.#r.save(y)}catch(u){throw await this.#v(s.secretRef,e),u}try{await this.#g(y,i),this.#c.delete(s.botId)}catch{this.#c.set(s.botId,We("connection-failed","\u9489\u9489\u5DF2\u63A5\u5165\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")),this.#o.warn?.("[dsh-dingtalk] credential-bound bot saved but its connection is not ready")}this.#I()}),this.status()}async registrationStatus(t){let r=this.#i.get(t);if(!r)return null;if(Po.has(r.state)||r.state==="starting")return Fr(r);if(yg(this.#d)>=r.expiresAt)return r.state="expired",r.error=We("expired","\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002"),this.#s===r.id&&(this.#s=null),this.#I(),Fr(r);if(!r.pollTask){let a=this.#u(r).finally(()=>{r.pollTask===a&&(r.pollTask=null)});r.pollTask=a}return await r.pollTask,Fr(r)}async cancelProvisioning(t){let r=this.#i.get(t);return r?(Po.has(r.state)||(r.controller.abort(),await r.pollTask?.catch(()=>{}),Po.has(r.state)||(r.state="cancelled"),r.error??=We("cancelled","\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002")),this.#s===r.id&&(this.#s=null),this.#I(),Fr(r)):null}async reconnectBot(t){let r=this.#r.get(t);if(!r)throw new Error("Unknown DingTalk bot");return await this.#_(t,async()=>{let a=await this.#w(r.secretRef);if(!a)throw new Error("The DingTalk client secret is missing");try{await this.#g(r,a),this.#c.delete(t)}catch(i){throw this.#c.set(t,We("connection-failed","\u9489\u9489\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")),i}finally{this.#I()}}),this.status()}async deleteBot(t){let r=this.#r.get(t);if(!r)throw new Error("Unknown DingTalk bot");return await this.#_(t,async()=>{let a=await this.#e.resolve(r.secretRef).catch(()=>{});await this.#b(t);try{await this.#e.unset(r.secretRef),await this.#r.remove(t)}catch(i){throw Ce(a?.value)&&(await this.#e.set(r.secretRef,a.value).catch(()=>{}),await this.#g(r,a.value).catch(()=>{})),new Error("Unable to remove the DingTalk bot safely.",{cause:i})}try{await this.#n({botId:t,config:r})}catch{this.#o.warn?.(`[dsh-dingtalk] bot ${t} state cleanup failed`)}this.#c.delete(t),this.#I()}),this.status()}async approveSender(t,r){let a=this.#r.get(t);if(!a)throw new Error("Unknown DingTalk bot");let i=this.#h.get(t),s=typeof i?.pendingSender=="function"?gg(i.pendingSender(r)):null,o=fg(Zd(i)),e=s?.requestId===r?s:o.find(u=>u.requestId===r);if(!e)throw new Error("Unknown DingTalk sender approval request");if(a.approvedSenders.some(u=>u.staffId===e.staffId))return this.status();let y={...a,approvedSenders:[...a.approvedSenders,{senderKey:hg(),staffId:e.staffId,displayName:e.displayName,approvedAt:CP(this.#d)}]};return await this.#y(a,y),this.status()}async revokeSender(t,r){let a=this.#r.get(t);if(!a)throw new Error("Unknown DingTalk bot");let i=a.approvedSenders.findIndex(o=>o.senderKey===r);if(i===-1)throw new Error("Unknown approved DingTalk sender");let s=[...a.approvedSenders];return s.splice(i,1),await this.#y(a,{...a,approvedSenders:s}),this.status()}status(){let t=this.#r.list().map(i=>{let s=this.#h.get(i.botId),o={};try{o=Zd(s)}catch{o={state:"error"}}let e=mg(s,o),y=this.#c.get(i.botId),u=e?"connected":y?"error":"offline",f=new Set(i.approvedSenders.map(m=>m.staffId)),d=fg(o).filter(m=>!f.has(m.staffId)).map(jP);return{botId:i.botId,state:u,connected:e,configured:!0,bot:{name:"\u9489\u9489\u673A\u5668\u4EBA",clientIdMasked:dg(i.clientId)},health:{status:e?"healthy":y?"error":"offline",summary:e?"\u9489\u9489 Stream \u6D88\u606F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38":y?.message??"\u9489\u9489\u6D88\u606F\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF",lastCheckedAt:o.lastCheckedAt??null},stats:{messagesReceived:Number(o.messagesReceived)||0,messagesReplied:Number(o.messagesReplied)||0},senders:{pending:d,approved:i.approvedSenders.map(DP)},error:y?structuredClone(y):null}}),r=t.filter(i=>i.connected).length,a=this.#s?this.#i.get(this.#s):null;return{schemaVersion:1,revision:this.#p,state:a&&ug.has(a.state)?"provisioning":t.length===0?"disconnected":r===t.length?"connected":r>0?"degraded":"offline",bots:t,totals:{configured:t.length,connected:r},...a&&ug.has(a.state)?{provisioning:Fr(a)}:{}}}async close(){this.#m||(this.#m=!0,this.#s&&await this.cancelProvisioning(this.#s),await Promise.allSettled([...this.#h.keys()].map(t=>this.#b(t))),await Promise.allSettled([...this.#l.values()]),await Promise.allSettled([...this.#h.keys()].map(t=>this.#b(t))))}async#u(t){try{this.#S(t);let r=await this.#t.poll({deviceCode:t.deviceCode,signal:t.controller.signal});this.#S(t);let a=Ce(r.status)?.toUpperCase();if(a==="WAITING")t.state="pending",t.error=null;else if(a==="SUCCESS"){let i=Ce(r.clientId),s=Ce(r.clientSecret);if(!i||!s)throw new Error("DingTalk returned incomplete credentials");t.state="connecting",t.error=null,this.#I();let o=await this.#f(t,{clientId:i,clientSecret:s});t.botId=o.botId,t.alreadyConnected=o.alreadyConnected,t.state="connected",this.#s===t.id&&(this.#s=null)}else a==="EXPIRED"?(t.state="expired",t.error=We("expired","\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002"),this.#s===t.id&&(this.#s=null)):a==="FAIL"?(t.state="failed",t.error=We("authorization-failed","\u9489\u9489\u672A\u5B8C\u6210\u673A\u5668\u4EBA\u6388\u6743\uFF0C\u8BF7\u91CD\u65B0\u626B\u7801\u3002"),this.#s===t.id&&(this.#s=null)):(t.state="pending",t.error=We("poll-pending","\u9489\u9489\u6388\u6743\u72B6\u6001\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u6B63\u5728\u91CD\u8BD5\u3002"))}catch(r){t.controller.signal.aborted||r?.name==="AbortError"?(t.state="cancelled",t.error=We("cancelled","\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"),this.#s===t.id&&(this.#s=null)):t.state==="connecting"?(t.state="failed",t.error=We("activation-failed","\u9489\u9489\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u5B89\u5168\u4FDD\u5B58\u63A5\u5165\u914D\u7F6E\u3002"),this.#s===t.id&&(this.#s=null),this.#o.error?.("[dsh-dingtalk] bot activation failed")):(t.state="pending",t.error=We("poll-failed","\u9489\u9489\u6388\u6743\u67E5\u8BE2\u6682\u65F6\u5931\u8D25\uFF0C\u6B63\u5728\u91CD\u8BD5\u3002"))}finally{this.#I(),this.#T()}}async#f(t,{clientId:r,clientSecret:a}){let i=To(r),s=this.#r.getByClientId(r),o=await this.#e.resolve(i.secretRef).catch(()=>{}),e={botId:i.botId,clientId:r,secretRef:i.secretRef,approvedSenders:s?.approvedSenders??[]};return this.#_(i.botId,async()=>{let y=async()=>{await this.#b(i.botId),s?await this.#r.save(s).catch(()=>{}):this.#r.get(i.botId)&&await this.#r.remove(i.botId).catch(()=>{}),await this.#v(i.secretRef,o),s&&Ce(o?.value)&&await this.#g(s,o.value).catch(()=>{})};await this.#e.set(i.secretRef,a);try{this.#S(t),await this.#r.save(e),this.#S(t)}catch(u){throw await y(),u}try{await this.#g(e,a),this.#S(t),this.#c.delete(i.botId)}catch{if(t.controller.signal.aborted||this.#s!==t.id)throw await y(),dr();this.#c.set(i.botId,We("connection-failed","\u9489\u9489\u5DF2\u63A5\u5165\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")),this.#o.warn?.("[dsh-dingtalk] authorized bot saved but its connection is not ready")}return{botId:i.botId,alreadyConnected:!!s}})}async#y(t,r){return this.#_(t.botId,async()=>{let a=await this.#w(t.secretRef);if(!a)throw new Error("The DingTalk client secret is missing");await this.#r.save(r);try{await this.#g(r,a),this.#c.delete(t.botId)}catch(i){throw await this.#r.save(t).catch(()=>{}),await this.#g(t,a).catch(()=>{}),this.#c.set(t.botId,We("connection-failed","\u9489\u9489\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")),i}finally{this.#I()}})}async#g(t,r){if(this.#m||(await this.#b(t.botId),this.#m))throw dr();let a=await this.#a({botId:t.botId,config:structuredClone(t),clientSecret:r});if(!a||typeof a.start!="function"||typeof a.stop!="function")throw new TypeError("createRuntime returned an invalid DingTalk runtime");if(this.#m)throw await a.stop().catch(()=>{}),dr();this.#h.set(t.botId,a);try{if(await a.start(),this.#m)throw await a.stop().catch(()=>{}),dr()}catch(i){throw this.#h.get(t.botId)===a&&this.#h.delete(t.botId),await a.stop().catch(()=>{}),i}}async#b(t){let r=this.#h.get(t);this.#h.delete(t),await r?.stop().catch(()=>{this.#o.warn?.(`[dsh-dingtalk] bot ${t} failed to stop cleanly`)})}async#w(t){let r=await this.#e.resolve(t).catch(()=>{});return Ce(r?.value)}async#v(t,r){try{Ce(r?.value)?await this.#e.set(t,r.value):await this.#e.unset(t)}catch{this.#o.error?.(`[dsh-dingtalk] failed to restore credential ${t}`)}}#S(t){if(t.controller.signal.aborted||this.#s!==t.id)throw dr()}#_(t,r){if(this.#m)return Promise.reject(new Error("dsh-dingtalk controller is closed"));let s=(this.#l.get(t)??Promise.resolve()).catch(()=>{}).then(r).finally(()=>{this.#l.get(t)===s&&this.#l.delete(t)});return this.#l.set(t,s),s}#T(){for(let[t,r]of this.#i)t!==this.#s&&Po.has(r.state)&&this.#i.size>16&&this.#i.delete(t)}#I(){this.#p+=1}};import{randomUUID as Ai}from"node:crypto";var GP="https://oapi.dingtalk.com/",BP="https://api.dingtalk.com/",MP="DING_DWS_CLAW",LP="02fcf2f4-5e02-4a85-b672-46d1f715543e.schema",NP=15e3,UP=new Set(["WAITING","SUCCESS","FAIL","EXPIRED"]),Fe=class extends Error{constructor(t,r,a={}){super(r,a),this.name="DingtalkApiError",this.code=t,this.status=a.status}};function pe(n){return typeof n=="string"&&n.trim()?n.trim():null}function vg(n){let t=n.toLowerCase().replace(/\.$/,"");return t==="dingtalk.com"||t.endsWith(".dingtalk.com")}function ac(n,{label:t,requireSubdomain:r=!0}={}){let a;try{a=new URL(n)}catch{throw new Fe("invalid-url",`${t??"\u9489\u9489\u670D\u52A1"}\u8FD4\u56DE\u4E86\u65E0\u6548\u5730\u5740\u3002`)}let i=a.hostname.toLowerCase().replace(/\.$/,""),s=r?i!=="dingtalk.com"&&vg(i):vg(i);if(a.protocol!=="https:"||!s||a.port&&a.port!=="443")throw new Fe("untrusted-url",`${t??"\u9489\u9489\u670D\u52A1"}\u5730\u5740\u4E0D\u53D7\u4FE1\u4EFB\u3002`);if(a.username||a.password)throw new Fe("untrusted-url",`${t??"\u9489\u9489\u670D\u52A1"}\u5730\u5740\u4E0D\u53D7\u4FE1\u4EFB\u3002`);return a}function ic(n){let t=pe(n);if(!t)throw new Fe("invalid-session-webhook","\u9489\u9489\u6D88\u606F\u6CA1\u6709\u53EF\u7528\u7684\u56DE\u590D\u5730\u5740\u3002");let r=ac(t,{label:"\u9489\u9489\u56DE\u590D",requireSubdomain:!1});return r.hash="",r.toString()}function _g(n,t=4e3){let r=typeof n=="string"?n.trim():"";if(!r)return[];if(!Number.isInteger(t)||t<1)throw new TypeError("maxChars must be a positive integer");if(r.length<=t)return[r];let a=[],i=r;for(;i.length>t;){let s=i.lastIndexOf(` +`,t);s{if(t?.aborted){a(qo(t));return}let i=setTimeout(()=>{t?.removeEventListener("abort",s),r()},n),s=()=>{clearTimeout(i),a(qo(t))};t?.addEventListener("abort",s,{once:!0})})}async function Or(n,t,{body:r,signal:a,timeoutMs:i=NP,headers:s={},method:o="POST",action:e="request"}={}){let y=new AbortController,u=!1,f=()=>y.abort(a?.reason);if(a?.aborted)throw qo(a);a?.addEventListener("abort",f,{once:!0});let d=i>0?setTimeout(()=>{u=!0,y.abort()},i):null;try{let m=await n(t,{method:o,redirect:"error",headers:{"content-type":"application/json",...s},body:JSON.stringify(r??{}),signal:y.signal});if(!m.ok)throw new Fe("http-error",`\u9489\u9489\u670D\u52A1\u8BF7\u6C42\u5931\u8D25\uFF08HTTP ${m.status}\uFF09\u3002`,{status:m.status});try{return await m.json()}catch(g){throw new Fe("invalid-response","\u9489\u9489\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u89E3\u6790\u7684\u54CD\u5E94\u3002",{cause:g})}}catch(m){throw a?.aborted?qo(a):u?new Fe("timeout","\u9489\u9489\u670D\u52A1\u8BF7\u6C42\u8D85\u65F6\u3002",{cause:m}):m instanceof Fe?m:new Fe("network-error",`\u6682\u65F6\u65E0\u6CD5\u5B8C\u6210\u9489\u9489${e}\u8BF7\u6C42\u3002`,{cause:m})}finally{d&&clearTimeout(d),a?.removeEventListener("abort",f)}}function HP(n){if(n?.type==="user"){let t=pe(n.userId);if(t)return{type:"user",userId:t}}if(n?.type==="group"){let t=pe(n.openConversationId);if(t)return{type:"group",openConversationId:t}}throw new TypeError("DingTalk AI Card target is invalid")}function ec(n,t){return{cardParamMap:{flowStatus:t,msgContent:Ci(n),staticMsgContent:"",sys_full_json_obj:JSON.stringify({order:["msgContent"]}),config:JSON.stringify({autoLayout:!0})}}}function QP(n,t,r){let a={outTrackId:n,userIdType:1};return t.type==="group"?{...a,openSpaceId:`dtv1.card//IM_GROUP.${t.openConversationId}`,imGroupOpenDeliverModel:{robotCode:r}}:{...a,openSpaceId:`dtv1.card//IM_ROBOT.${t.userId}`,imRobotOpenDeliverModel:{spaceType:"IM_ROBOT",robotCode:r,extension:{dynamicSummary:"true"}}}}function Ci(n){let r=(typeof n=="string"?n.replace(/\r\n?/g,` +`):"").split(` +`),a=!1;return r.map((i,s)=>{let o=/^\s{0,3}```/.test(i),e=a;return o&&(a=!a),s===r.length-1?i:e||o||a||!i||!r[s+1]?`${i} +`:/^\s{0,3}(?:[-*+] |\d+[.)] |#{1,6} |\||> )/.test(r[s+1])?`${i} +`:`${i}
`}).join("")}function tc(n,t){if(!n||typeof n!="object"||n.errcode!==0)throw new Fe("registration-rejected",`\u9489\u9489\u626B\u7801${t}\u5931\u8D25\u3002`);return n}function rc(n,t){let r=Number(n);return Number.isFinite(r)&&r>0?r:t}function bg({fetchImpl:n=fetch,registrationBaseUrl:t=process.env.DINGTALK_REGISTRATION_BASE_URL||GP,registrationSource:r=process.env.DINGTALK_REGISTRATION_SOURCE||MP,now:a=()=>Date.now(),cardMinIntervalMs:i=50,cardBackoffMs:s=1e3,delay:o=WP}={}){if(typeof n!="function")throw new TypeError("fetchImpl must be a function");if(typeof a!="function")throw new TypeError("now must be a function");if(!Number.isFinite(i)||i<0)throw new TypeError("cardMinIntervalMs must be a non-negative number");if(!Number.isFinite(s)||s<0)throw new TypeError("cardBackoffMs must be a non-negative number");if(typeof o!="function")throw new TypeError("delay must be a function");let e=ac(t,{label:"\u9489\u9489\u6CE8\u518C\u670D\u52A1",requireSubdomain:!1}),y=new URL(BP),u=pe(r);if(!u)throw new TypeError("registrationSource is required");let f=new Map,d=new Map,m=Promise.resolve(),g=0,_=(E,F)=>new URL(F.replace(/^\//,""),E);async function b({clientId:E,clientSecret:F,signal:$}){let A=pe(E),G=pe(F);if(!A||!G)throw new TypeError("clientId and clientSecret are required");let M=f.get(A);if(M&&M.expiresAt>a())return M.token;if(d.has(A))return d.get(A);let N=(async()=>{let B=await Or(n,_(y,"v1.0/oauth2/accessToken"),{body:{appKey:A,appSecret:G},signal:$,action:"\u9274\u6743"}),R=pe(B?.accessToken);if(!R)throw new Fe("invalid-access-token","\u9489\u9489\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u8BBF\u95EE\u4EE4\u724C\u3002");let de=rc(B?.expireIn??B?.expiresIn,7200),z=Math.max(1e3,(de-60)*1e3);return f.set(A,{token:R,expiresAt:a()+z}),R})().finally(()=>d.delete(A));return d.set(A,N),N}function w(E){let F=async()=>{let A=Math.max(0,g-a());A>0&&await o(A,E),g=Math.max(g,a())+i},$=m.then(F,F);return m=$.catch(()=>{}),$}async function S(E,F){await w(F.signal);try{return await Or(n,_(y,E),F)}catch($){if(!($ instanceof Fe)||$.status!==403)throw $;return await o(s,F.signal),await w(F.signal),Or(n,_(y,E),F)}}async function O({clientId:E,clientSecret:F,cardInstanceId:$,text:A,signal:G}){let M=pe($),N=pe(A);if(!M)throw new TypeError("cardInstanceId is required");if(!N)throw new TypeError("text is required");let R={"x-acs-dingtalk-access-token":await b({clientId:E,clientSecret:F,signal:G})},de=[S("v1.0/card/streaming",{method:"PUT",body:{outTrackId:M,guid:Ai(),key:"msgContent",content:Ci(N),isFull:!0,isFinalize:!1,isError:!0},headers:R,signal:G,action:"AI Card \u5931\u8D25\u6536\u53E3"}),S("v1.0/card/instances",{method:"PUT",body:{outTrackId:M,cardData:ec(N,"5"),cardUpdateOptions:{updateCardDataByKey:!0}},headers:R,signal:G,action:"AI Card \u5931\u8D25\u72B6\u6001"})],z=await Promise.allSettled(de);if(z.every(({status:P})=>P==="rejected"))throw z[0].reason;return!0}return Object.freeze({async beginRegistration({signal:E}={}){let F=tc(await Or(n,_(e,"app/registration/init"),{body:{source:u},signal:E,action:"\u521D\u59CB\u5316"}),"\u521D\u59CB\u5316"),$=pe(F.nonce);if(!$)throw new Fe("invalid-registration","\u9489\u9489\u626B\u7801\u521D\u59CB\u5316\u7F3A\u5C11 nonce\u3002");let A=tc(await Or(n,_(e,"app/registration/begin"),{body:{nonce:$},signal:E,action:"\u521B\u5EFA"}),"\u521B\u5EFA"),G=pe(A.device_code),M=pe(A.verification_uri_complete);if(!G||!M)throw new Fe("invalid-registration","\u9489\u9489\u626B\u7801\u670D\u52A1\u8FD4\u56DE\u7684\u4FE1\u606F\u4E0D\u5B8C\u6574\u3002");let N=ac(M,{label:"\u9489\u9489\u626B\u7801",requireSubdomain:!1}).toString();return{deviceCode:G,userCode:pe(A.user_code)??void 0,verificationUri:pe(A.verification_uri)??void 0,verificationUriComplete:N,expiresInSeconds:rc(A.expires_in,7200),intervalSeconds:rc(A.interval,5)}},async pollRegistration({deviceCode:E,signal:F}={}){let $=pe(E);if(!$)throw new TypeError("deviceCode is required");let A=tc(await Or(n,_(e,"app/registration/poll"),{body:{device_code:$},signal:F,action:"\u72B6\u6001\u67E5\u8BE2"}),"\u72B6\u6001\u67E5\u8BE2"),G=pe(A.status)?.toUpperCase();if(!G||!UP.has(G))throw new Fe("invalid-registration-status","\u9489\u9489\u626B\u7801\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u72B6\u6001\u3002");let M={status:G,failReason:pe(A.fail_reason)??void 0};if(G==="SUCCESS"&&(M.clientId=pe(A.client_id)??void 0,M.clientSecret=pe(A.client_secret)??void 0,!M.clientId||!M.clientSecret))throw new Fe("missing-credentials","\u9489\u9489\u626B\u7801\u5DF2\u786E\u8BA4\uFF0C\u4F46\u6CA1\u6709\u8FD4\u56DE\u673A\u5668\u4EBA\u51ED\u636E\u3002");return M},accessToken:b,async createAiCard({clientId:E,clientSecret:F,target:$,initialText:A,signal:G}){let M=pe(E),N=pe(F),B=pe(A);if(!M||!N)throw new TypeError("clientId and clientSecret are required");if(!B)throw new TypeError("initialText is required");let R=HP($),de=await b({clientId:M,clientSecret:N,signal:G}),z=`dsh_${Ai()}`,P={"x-acs-dingtalk-access-token":de},D=!1;try{await S("v1.0/card/instances",{body:{cardTemplateId:LP,outTrackId:z,cardData:{cardParamMap:{config:JSON.stringify({autoLayout:!0})}},callbackType:"STREAM",imGroupOpenSpaceModel:{supportForward:!0},imRobotOpenSpaceModel:{supportForward:!0}},headers:P,signal:G,action:"AI Card \u521B\u5EFA"}),await S("v1.0/card/instances/deliver",{body:QP(z,R,M),headers:P,signal:G,action:"AI Card \u6295\u653E"}),D=!0,await S("v1.0/card/instances",{method:"PUT",body:{outTrackId:z,cardData:ec(B,"2")},headers:P,signal:G,action:"AI Card \u542F\u52A8"}),await S("v1.0/card/streaming",{method:"PUT",body:{outTrackId:z,guid:Ai(),key:"msgContent",content:Ci(B).replace(/\n+$/,""),isFull:!0,isFinalize:!1,isError:!1},headers:P,signal:G,action:"AI Card \u542F\u52A8"})}catch(H){if(D){let Z=AbortSignal.timeout(5e3);await O({clientId:M,clientSecret:N,cardInstanceId:z,text:"\u6D88\u606F\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",signal:Z}).catch(()=>{})}throw H}return{cardInstanceId:z}},async updateAiCard({clientId:E,clientSecret:F,cardInstanceId:$,text:A,signal:G}){let M=pe($),N=pe(A);if(!M)throw new TypeError("cardInstanceId is required");if(!N)throw new TypeError("text is required");let B=await b({clientId:E,clientSecret:F,signal:G});return await S("v1.0/card/streaming",{method:"PUT",body:{outTrackId:M,guid:Ai(),key:"msgContent",content:Ci(N).replace(/\n+$/,""),isFull:!0,isFinalize:!1,isError:!1},headers:{"x-acs-dingtalk-access-token":B},signal:G,action:"AI Card \u66F4\u65B0"}),!0},async finishAiCard({clientId:E,clientSecret:F,cardInstanceId:$,text:A,signal:G}){let M=pe($),N=pe(A);if(!M)throw new TypeError("cardInstanceId is required");if(!N)throw new TypeError("text is required");let R={"x-acs-dingtalk-access-token":await b({clientId:E,clientSecret:F,signal:G})},de=Ci(N);await S("v1.0/card/streaming",{method:"PUT",body:{outTrackId:M,guid:Ai(),key:"msgContent",content:de,isFull:!0,isFinalize:!0,isError:!1},headers:R,signal:G,action:"AI Card \u5B8C\u6210"});let z=!0,P={method:"PUT",body:{outTrackId:M,cardData:ec(N,"3"),cardUpdateOptions:{updateCardDataByKey:!0}},headers:R,signal:G,action:"AI Card \u6536\u53E3"};try{await S("v1.0/card/instances",P)}catch{try{await S("v1.0/card/instances",P)}catch{z=!1}}return{delivered:!0,completed:z}},failAiCard:O,async sendText({clientId:E,clientSecret:F,sessionWebhook:$,text:A,signal:G}){let M=pe(A);if(!M)throw new TypeError("text is required");let N=ic($),B=await b({clientId:E,clientSecret:F,signal:G}),R=await Or(n,N,{body:{msgtype:"text",text:{content:M}},headers:{"x-acs-dingtalk-access-token":B},signal:G,action:"\u6D88\u606F\u56DE\u590D"});if(R?.errcode!==void 0&&R.errcode!==0||R?.code!==void 0&&R.code!==0)throw new Fe("send-rejected","\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u56DE\u590D\u6D88\u606F\u3002");return!0},clearAccessToken(E){let F=pe(E);F&&f.delete(F)}})}var VP="\u6D88\u606F\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002";function sc(n,t){if(typeof n!="string")throw new TypeError(`${t} must be a string`);return n}function wg(n,t){if(typeof n!="string"||!n.trim())throw new TypeError(`${t} is required`);return n.trim()}function Sg({api:n,clientId:t,clientSecret:r,target:a,signal:i,logger:s=console,updateIntervalMs:o=500,clock:e=()=>Date.now(),timer:y={setTimeout:(u,f)=>globalThis.setTimeout(u,f),clearTimeout:u=>globalThis.clearTimeout(u)}}={}){if(!n||typeof n.createAiCard!="function"||typeof n.updateAiCard!="function"||typeof n.finishAiCard!="function")throw new TypeError("DingTalk AI Card API is required");let u=wg(t,"clientId"),f=wg(r,"clientSecret");if(a==null)throw new TypeError("target is required");if(!Number.isFinite(o)||o<0)throw new TypeError("updateIntervalMs must be a non-negative number");if(typeof e!="function")throw new TypeError("clock must be a function");if(typeof y?.setTimeout!="function"||typeof y?.clearTimeout!="function")throw new TypeError("timer must provide setTimeout and clearTimeout");let d=()=>{let P=e();if(!Number.isFinite(P))throw new TypeError("clock must return a finite timestamp");return P};d();let m=i?.aborted?"aborted":"idle",g=null,_=null,b=null,w=null,S=null,O=null,E=0,F=()=>{b!==null&&(y.clearTimeout(b),b=null)},$=()=>i?.removeEventListener("abort",N),A=P=>{m=P,_=null,F(),$()},G=()=>!g||typeof n.failAiCard!="function"?Promise.resolve(!1):(O||(O=n.failAiCard({...g,text:VP,signal:AbortSignal.timeout(5e3)}).then(()=>!0,()=>!1)),O),M=P=>{m==="failed"||m==="finished"||m==="aborted"||(G(),A("failed"),s?.error?.(`[dsh-dingtalk] AI Card ${P} failed`))};function N(){m==="finished"||m==="failed"||m==="aborted"||(G(),A("aborted"))}m!=="aborted"&&i?.addEventListener("abort",N,{once:!0});let B=()=>{if(m!=="active"||w||_===null)return;let P=Math.max(0,E+o-d());if(P>0){b=y.setTimeout(()=>{b=null,B()},P);return}let D=_;_=null,w=(async()=>{try{await n.updateAiCard({...g,text:D,finished:!1}),E=d()}catch{if(i?.aborted||m==="aborted")return;M("update")}})().finally(()=>{w=null,m==="active"&&_!==null&&B()})};return Object.freeze({start:async P=>{if(sc(P,"initialText"),m!=="idle")return!1;m="starting";try{let D=await n.createAiCard({clientId:u,clientSecret:f,target:a,initialText:P,signal:i}),H=typeof D?.cardInstanceId=="string"?D.cardInstanceId.trim():"";if(!H)throw new TypeError("DingTalk did not return a card instance id");return g=Object.freeze({clientId:u,clientSecret:f,target:a,cardInstanceId:H,signal:i}),m!=="starting"?(G(),!1):(E=d(),m="active",!0)}catch{return i?.aborted||m==="aborted"?(A("aborted"),!1):(M("creation"),!1)}},push:P=>{sc(P,"progressText"),m==="active"&&(_=P,!b&&!w&&B())},finish:P=>{if(sc(P,"finalText"),m==="finished")return Promise.resolve(!0);if(m==="finishing")return S;if(m!=="active")return Promise.resolve(!1);m="finishing",_=null,F();let D=w;return S=(async()=>{if(D&&await D,m!=="finishing")return!1;try{return await n.finishAiCard({...g,text:P}),m!=="finishing"?!1:(A("finished"),!0)}catch{return i?.aborted||m==="aborted"?(A("aborted"),!1):(M("finish"),!1)}})(),S}})}var KP="\u5DF2\u8FDE\u63A5 DeepSeek Harness\uFF0C\u6B63\u5728\u601D\u8003\u2026",Ig="\u6D88\u606F\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",JP=["\u9489\u9489\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002","","\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002","/new \u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD","/status \u68C0\u67E5\u8FDE\u63A5\u72B6\u6001","/help \u663E\u793A\u672C\u5E2E\u52A9"].join(` +`);function kt(n){return typeof n=="string"&&n.trim()?n.trim():null}function XP(n){return kt(n?.senderStaffId)??kt(n?.senderId)}function YP(n,t){if(String(n?.conversationType)==="2"){let r=kt(n?.conversationId);if(!r)throw new Error("DingTalk group message has no conversation id");return`group:${r}`}return`p2p:${t}`}function ZP(n,t){return String(n?.conversationType)==="2"?{type:"group",openConversationId:kt(n?.conversationId)}:{type:"user",userId:t}}function eq(n){return n?.type==="text"&&kt(n.text)?n.text:n?.type==="tool"?n.name==="web_search"?"_\u6B63\u5728\u641C\u7D22\u7F51\u7EDC\u5E76\u6574\u7406\u4FE1\u606F\u2026_":`_\u6B63\u5728\u4F7F\u7528 ${kt(n.name)??"\u5DE5\u5177"}\u2026_`:`_${kt(n?.text)??"\u6B63\u5728\u5904\u7406\u2026"}_`}function tq(n){n.stats??={};for(let t of["messagesReceived","messagesReplied","messagesRejected","messagesIgnored"])n[t]??=0,n.stats[t]=n[t];n.pendingSenders??=[]}function ji(n,t){n[t]=(n[t]??0)+1,n.stats??={},n.stats[t]=n[t]}function oc({pendingSenders:n=[]}={}){return{messagesReceived:0,messagesReplied:0,messagesRejected:0,messagesIgnored:0,lastMessageAt:null,lastReplyAt:null,lastRejectedAt:null,lastError:null,pendingSenders:structuredClone(n),stats:{messagesReceived:0,messagesReplied:0,messagesRejected:0,messagesIgnored:0}}}var Eo=class{#t;#e;#r;#a;#n;#o;#d;#h;#c;#i;#s=new Map;#l=new Set;constructor({api:t,clientId:r,clientSecret:a,harness:i,state:s,status:o=oc(),logger:e=console,replyTimeoutMs:y=6e5,maxMessageChars:u=4e3,signal:f}){if(!t||typeof t.sendText!="function")throw new TypeError("DingTalk API is required");if(!kt(r)||!kt(a))throw new TypeError("DingTalk app credentials are required");if(!i||!s)throw new TypeError("Harness client and state store are required");this.#t=t,this.#e=r.trim(),this.#r=a.trim(),this.#a=i,this.#n=s,this.#o=o,this.#d=e,this.#h=y,this.#c=u,this.#i=f,tq(this.#o),this.#m()}get status(){return this.#m(),structuredClone(this.#o)}accept(t){if(this.#i?.aborted)return Promise.resolve();let r=kt(t?.msgId),a=XP(t);if(!r||!a||this.#n.hasSeen(r)||this.#l.has(r))return Promise.resolve();this.#l.add(r);let i;try{i=YP(t,a)}catch{return this.#l.delete(r),ji(this.#o,"messagesRejected"),this.#o.lastRejectedAt=new Date().toISOString(),Promise.resolve()}let o=(this.#s.get(i)??Promise.resolve()).catch(()=>{}).then(()=>this.#p(t,r,a,i)).finally(()=>{this.#l.delete(r),this.#s.get(i)===o&&this.#s.delete(i)});return this.#s.set(i,o),o}async waitForIdle(){await Promise.allSettled([...this.#s.values()])}async#p(t,r,a,i){if(this.#i?.throwIfAborted(),this.#n.hasSeen(r))return;if(await this.#n.markSeen(r),ji(this.#o,"messagesReceived"),this.#o.lastMessageAt=new Date().toISOString(),String(t.conversationType)==="2"&&t.isInAtList!==!0){ji(this.#o,"messagesIgnored");return}let s;try{s=ic(t.sessionWebhook)}catch{ji(this.#o,"messagesRejected"),this.#o.lastRejectedAt=new Date().toISOString(),this.#o.lastError="\u9489\u9489\u6D88\u606F\u6CA1\u6709\u5B89\u5168\u7684\u56DE\u590D\u5730\u5740\u3002";return}let o=t?.msgtype==="text"?kt(t?.text?.content):null,e=null,y=!1;try{if(!o){await this.#u(s,"\u76EE\u524D\u4EC5\u652F\u6301\u6587\u5B57\u6D88\u606F\u3002");return}let u=o.toLowerCase();if(u==="/help"){await this.#u(s,JP);return}if(u==="/status"){await this.#a.ensureRunning({signal:this.#i}),await this.#u(s,"\u9489\u9489\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002");return}if(u==="/new"){await this.#n.clearSession(i),await this.#u(s,"\u5DF2\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002\u8BF7\u53D1\u9001\u4F60\u7684\u95EE\u9898\u3002");return}let f=this.#n.sessionFor(i);(!f||!await this.#a.sessionExists(f,{signal:this.#i}))&&(f=await this.#a.createSession({signal:this.#i}),await this.#n.setSession(i,f)),typeof this.#t.createAiCard=="function"&&typeof this.#t.updateAiCard=="function"&&typeof this.#t.finishAiCard=="function"&&(e=Sg({api:this.#t,clientId:this.#e,clientSecret:this.#r,target:ZP(t,a),signal:this.#i,logger:this.#d}),y=await e.start(KP));let d=await this.#a.ask(f,o,{timeoutMs:this.#h,signal:this.#i,onUpdate:y?g=>e.push(eq(g)):void 0});y&&await e.finish(d)||await this.#u(s,d),ji(this.#o,"messagesReplied"),this.#o.lastReplyAt=new Date().toISOString(),this.#o.lastError=null}catch{if(this.#i?.aborted)return;this.#o.lastError="\u9489\u9489\u6D88\u606F\u5904\u7406\u5931\u8D25\u3002",this.#d.error?.("[dsh-dingtalk] failed to process an inbound message");try{y&&await e.finish(Ig)||await this.#u(s,Ig)}catch{this.#d.error?.("[dsh-dingtalk] failed to send the safe error reply")}}}#m(){typeof this.#n.pendingSenders=="function"&&(this.#o.pendingSenders=this.#n.pendingSenders())}async#u(t,r){for(let a of _g(r,this.#c))this.#i?.throwIfAborted(),await this.#t.sendText({clientId:this.#e,clientSecret:this.#r,sessionWebhook:t,text:a,signal:this.#i})}};function Fo(n){return typeof n=="string"&&n.trim()?n.trim():null}function kg(n){let t=Array.isArray(n?.approvedSenders)?n.approvedSenders:n?.approvedSenders instanceof Set?[...n.approvedSenders]:[];return new Set(t.map(r=>Fo(typeof r=="string"?r:r?.staffId)).filter(Boolean))}function rq(n){return kg(n).size}function Tg(n){return n?.connected===!0||n?.socket?.readyState===1}function aq(n,t){return new Promise((r,a)=>{if(t.aborted){a(t.reason);return}let i=()=>a(t.reason);t.addEventListener("abort",i,{once:!0}),Promise.resolve(n).then(s=>{t.removeEventListener("abort",i),r(s)},s=>{t.removeEventListener("abort",i),a(s)})})}async function iq(n,t,r){for(;;){if(r?.throwIfAborted(),Tg(n))return;await new Promise((a,i)=>{let s=setTimeout(()=>{r?.removeEventListener("abort",o),a()},t),o=()=>{clearTimeout(s),i(r.reason??new DOMException("Aborted","AbortError"))};r?.addEventListener("abort",o,{once:!0})})}}async function sq(n,t,r,a){let i=AbortSignal.timeout(t),s=AbortSignal.any([a,i]),o=!1,e=Promise.resolve().then(()=>n.connect()).finally(()=>{o=!0});try{await aq(e,s),await iq(n,r,s)}catch(y){throw s.aborted?(o||e.then(()=>n.disconnect()).catch(()=>{}),a.aborted?a.reason:new Error(`DingTalk Stream handshake timed out after ${t}ms`)):y}}async function oq({clientId:n,clientSecret:t}){let{DWClient:r,TOPIC_ROBOT:a}=await import("dingtalk-stream");return{client:new r({clientId:n,clientSecret:t,endpoint:"https://api.dingtalk.com",autoReconnect:!1,keepAlive:!0,debug:!1}),topic:a}}function nq({pendingSenders:n=[],approvedSenders:t=0}={}){return{startedAt:null,ready:!1,dingtalkStreamState:"idle",harnessReachable:!1,lastConnectedAt:null,lastCheckedAt:null,lastCallbackAt:null,authorizationMode:"sender-staff-id-approval",approvedSenderCount:t,...oc({pendingSenders:n})}}var Di=class{#t;#e;#r;#a;#n;#o;#d;#h;#c;#i;#s;#l;#p=null;#m=null;#u=null;#f=null;#y=null;#g=null;#b=new Set;constructor({config:t,clientSecret:r,harness:a,state:i,logger:s=console,replyTimeoutMs:o=6e5,maxMessageChars:e=4e3,connectTimeoutMs:y=15e3,connectPollIntervalMs:u=25,api:f=bg(),streamFactory:d=oq}){if(!t||!Fo(t.clientId)||!Fo(r))throw new TypeError("DingtalkRuntime requires app credentials");if(!a||!i)throw new TypeError("DingtalkRuntime requires Harness and state");if(typeof d!="function")throw new TypeError("streamFactory must be a function");this.#t=t,this.#e=r.trim(),this.#r=a,this.#a=i,this.#n=s,this.#o=o,this.#d=e,this.#h=y,this.#c=u,this.#i=f,this.#s=d,this.#l=nq({pendingSenders:this.#v(),approvedSenders:rq(t)})}get status(){if(this.#m){let t=this.#m.status;Object.assign(this.#l,t)}else this.#l.pendingSenders=this.#v();return structuredClone(this.#l)}pendingSender(t){return typeof this.#a.pendingSender=="function"?this.#a.pendingSender(t):null}pendingSenders(){return this.#v()}async start(){return this.#p&&this.#l.ready?this.status:this.#f?this.#f:(this.#f=this.#w().finally(()=>{this.#f=null}),this.#f)}async#w(){await this.stop();let t=new AbortController;this.#g=t;let{signal:r}=t;this.#l.startedAt=new Date().toISOString(),this.#l.dingtalkStreamState="connecting",this.#l.lastError=null;try{if(await this.#r.ensureRunning({signal:r}),this.#l.harnessReachable=!0,typeof this.#a.removePendingSenderByStaffId=="function"){for(let o of kg(this.#t))await this.#a.removePendingSenderByStaffId(o);this.#l.pendingSenders=this.#v()}this.#m=new Eo({api:this.#i,clientId:this.#t.clientId,clientSecret:this.#e,approvedSenders:this.#t.approvedSenders,harness:this.#r,state:this.#a,status:this.#l,logger:this.#n,replyTimeoutMs:this.#o,maxMessageChars:this.#d,signal:r});let a=await this.#s({clientId:this.#t.clientId,clientSecret:this.#e});if(r.throwIfAborted(),this.#p=a?.client??a,this.#u=a?.topic??a?.TOPIC_ROBOT??"/v1.0/im/bot/messages/get",!this.#p||typeof this.#p.registerCallbackListener!="function"||typeof this.#p.connect!="function"||typeof this.#p.disconnect!="function"||typeof this.#p.socketCallBackResponse!="function")throw new TypeError("streamFactory returned an invalid DingTalk Stream client");let i=this.#p,s=this.#m;return i.registerCallbackListener(this.#u,o=>{if(this.#p!==i||this.#m!==s)return;let e=Fo(o?.headers?.messageId);if(e)try{i.socketCallBackResponse(e,{success:!0})}catch{this.#n.warn?.("[dsh-dingtalk] unable to acknowledge an inbound callback")}let y=Promise.resolve().then(async()=>{if(this.#m!==s)return;let u;try{u=typeof o?.data=="string"?JSON.parse(o.data):o?.data}catch{this.#l.lastError="\u9489\u9489\u6D88\u606F\u683C\u5F0F\u65E0\u6548\u3002",this.#n.warn?.("[dsh-dingtalk] ignored an invalid callback payload");return}!u||typeof u!="object"||(this.#l.lastCallbackAt=Date.now(),await s.accept(u))}).catch(()=>{r.aborted||this.#m!==s||(this.#l.lastError="\u9489\u9489\u6D88\u606F\u5904\u7406\u5931\u8D25\u3002",this.#n.error?.("[dsh-dingtalk] callback processing failed"))}).finally(()=>this.#b.delete(y));this.#b.add(y)}),await sq(i,this.#h,this.#c,r),this.#l.ready=!0,this.#l.dingtalkStreamState="connected",this.#l.lastConnectedAt=Date.now(),this.#l.lastCheckedAt=Date.now(),this.#l.lastError=null,this.#y=setInterval(()=>{let o=Tg(i);this.#l.ready=o,this.#l.dingtalkStreamState=o?"connected":"reconnecting",this.#l.lastCheckedAt=Date.now(),o&&(this.#l.lastError=null)},1e3),this.#y.unref?.(),this.status}catch(a){let i=r.aborted;throw this.#l.ready=!1,this.#l.dingtalkStreamState=i?"idle":"failed",this.#l.lastError=i?null:a?.message??String(a),await this.stop({preserveError:!i}),a}}async stop({preserveError:t=!1}={}){let r=t?this.#l.lastError:null,a=this.#g;this.#g=null,a?.abort(new DOMException("DingTalk runtime stopped","AbortError")),this.#y&&clearInterval(this.#y),this.#y=null,this.#l.ready=!1;let i=this.#p;if(this.#p=null,this.#u=null,i)try{await i.disconnect()}catch{this.#n.warn?.("[dsh-dingtalk] DingTalk Stream disconnect failed")}return await Promise.allSettled([...this.#b]),this.#b.clear(),this.#m&&await this.#m.waitForIdle(),this.#m=null,this.#l.dingtalkStreamState=t?"failed":"idle",this.#l.lastError=r,this.status}#v(){return typeof this.#a.pendingSenders=="function"?this.#a.pendingSenders():[]}};import{spawn as hq}from"node:child_process";import{randomUUID as xg}from"node:crypto";function Pg(n,t){return new Promise((r,a)=>{if(t?.aborted){a(t.reason??new DOMException("Aborted","AbortError"));return}let i=setTimeout(()=>{t?.removeEventListener("abort",s),r()},n),s=()=>{clearTimeout(i),a(t.reason??new DOMException("Aborted","AbortError"))};t?.addEventListener("abort",s,{once:!0})})}function dq(n){return(n?.data?.message?.content??[]).filter(t=>t.type==="text"&&typeof t.text=="string").map(t=>t.text).join(` +`).trim()}var nc=class{#t;#e;#r=null;#a=null;#n=new Map;#o="";#d=!1;#h=null;constructor({promptRpcId:t,afterSeq:r=-1}){this.#t=t,this.#e=r}get finished(){return this.#d}get answer(){return this.#o.trim()}get reason(){return this.#h}consume(t){let r=null,a=[...t].map(i=>i?.event??i).filter(Boolean).sort((i,s)=>(i.seq??-1)-(s.seq??-1));for(let i of a){let s=i.seq??-1;if(!(s<=this.#e)){if(this.#e=s,i.type==="turn/start"&&(this.#r=i.data?.turn??null),i.type==="user/message"&&i.data?.source?.rpcId===this.#t){this.#a=this.#r;continue}if(this.#a!==null){if(i.type==="turn/end"){if(i.data?.turn!==this.#a)continue;this.#d=!0,this.#h=i.data?.reason??null,this.#r=null;continue}if(i.data?.turn===this.#a){if(i.type==="assistant/chunk"&&i.data?.chunk?.type==="text-delta"){let o=i.data?.step??0,e=i.data.chunk.index??0,y=`${o}:${e}`;this.#n.set(y,(this.#n.get(y)??"")+i.data.chunk.text);let u=`${o}:`,f=[...this.#n.entries()].filter(([d])=>d.startsWith(u)).sort(([d],[m])=>Number(d.split(":")[1])-Number(m.split(":")[1])).map(([,d])=>d).join(` +`).trim();f&&f!==this.#o&&(this.#o=f,r={type:"text",text:f});continue}if(i.type==="assistant/message"){let o=dq(i);o&&o!==this.#o&&(this.#o=o,r={type:"text",text:o});continue}i.type==="tool/call"?r={type:"tool",name:i.data?.name??"\u5DE5\u5177"}:i.type==="tool/result"&&(r={type:"status",text:"\u6B63\u5728\u6574\u7406\u7ED3\u679C\u2026"})}}}}return r}},Oo=class extends Error{constructor(t,r){super(`${t}: ${r?.message??"unknown Harness RPC error"}`),this.name="HarnessRpcError",this.method=t,this.code=r?.code??"internal",this.details=r?.details??{}}},$o=class{#t;#e;#r;#a;#n;#o;#d=null;constructor({baseUrl:t,workspace:r,agentPreset:a="standard",autostart:i=!1,dshBin:s="dsh",fetchImpl:o=fetch}){this.#t=new URL(t),this.#e=r,this.#r=a,this.#a=i,this.#n=s,this.#o=o}async rpc(t,r={},a=3e4,i={}){let s=i.rpcId??`dingtalk-${xg()}`,o=AbortSignal.timeout(a),e=i.signal?AbortSignal.any([i.signal,o]):o,y=await this.#o(new URL(`/api/${t}`,this.#t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({type:"client-request",rpcId:s,method:t,payload:r}),signal:e});if(!y.ok)throw new Error(`Harness transport ${t} failed: HTTP ${y.status}`);let u=await y.json();if(u?.type!=="server-response"||u?.rpcId!==s)throw new Error(`Harness returned an invalid response for ${t}`);if(!u.result?.ok)throw new Oo(t,u.result?.error);return u.result.value}async health(t={}){return await this.rpc("host.describe",{},5e3,t),!0}async ensureRunning(t={}){try{return await this.health(t)}catch(i){if(!this.#a)throw i}if(!this.#d||this.#d.exitCode!==null){let i=this.#t.port||(this.#t.protocol==="https:"?"443":"80");this.#d=hq(this.#n,["web","--host",this.#t.hostname,"--port",i],{cwd:this.#e,env:process.env,stdio:["ignore","inherit","inherit"]}),this.#d.on("error",s=>{console.error("[dsh-dingtalk] failed to start Harness:",s.message)})}let r=Date.now()+6e4,a;for(;Date.now()s.path===this.#e);return a?a.workspaceId:(await this.rpc("workspace.create",{path:this.#e},3e4,t)).workspace.workspaceId}async createSession(t={}){await this.ensureRunning(t);let r=await this.workspaceId(t);return(await this.rpc("session.create",{workspaceId:r,agentPreset:this.#r},3e4,t)).sessionId}async sessionExists(t,r={}){try{return await this.rpc("session.history",{sessionId:t,maxMessages:1},3e4,r),!0}catch(a){if(a instanceof Oo&&a.code==="session-not-found")return!1;throw a}}async ask(t,r,a={}){typeof a=="number"&&(a={timeoutMs:a});let i=a.timeoutMs??6e5,s=a.signal,o=typeof a.onUpdate=="function"?a.onUpdate:null;await this.ensureRunning({signal:s});let e=await this.rpc("session.history",{sessionId:t,maxMessages:1},3e4,{signal:s}),y=Math.max(-1,...(e.events??[]).map(({event:m})=>m.seq??-1)),u=`dingtalk-${xg()}`,f=new nc({promptRpcId:u,afterSeq:y});await this.rpc("session.prompt",{sessionId:t,mode:"queue",content:[{type:"text",text:r}],clientTimeZone:Intl.DateTimeFormat().resolvedOptions().timeZone},3e4,{rpcId:u,signal:s});let d=Date.now()+i;for(;Date.now()[i?.requestId,i]):Object.entries(n.pendingSenders&&typeof n.pendingSenders=="object"?n.pendingSenders:{});for(let[i,s]of a){let o=gq(s,i);if(!o)continue;let e=Object.values(r).find(y=>y.staffId===o.staffId);(!e||e.lastSeenAtnew Date().toISOString()}={}){if(!xe(t))throw new TypeError("state path is required");if(typeof r!="function"||typeof a!="function")throw new TypeError("idFactory and now must be functions");this.#t=t,this.#a=r,this.#n=a}async load(){try{this.#e=vq(JSON.parse(await pq(this.#t,"utf8")))}catch(t){if(t?.code!=="ENOENT")throw t;this.#e=structuredClone(zo),await this.#o()}return this}sessionFor(t){return this.#e.sessions[t]??null}async setSession(t,r){let a=xe(t),i=xe(r);if(!a||!i)throw new TypeError("key and sessionId are required");this.#e.sessions[a]=i,await this.#o()}async clearSession(t){let r=xe(t);!r||!(r in this.#e.sessions)||(delete this.#e.sessions[r],await this.#o())}hasSeen(t){let r=xe(t);return!!(r&&this.#e.seenMessageIds.includes(r))}async markSeen(t){let r=xe(t);if(!r)throw new TypeError("messageId is required");this.hasSeen(r)||(this.#e.seenMessageIds.push(r),this.#e.seenMessageIds.length>1e3&&this.#e.seenMessageIds.splice(0,this.#e.seenMessageIds.length-1e3),await this.#o())}pendingSenders(){return Object.values(this.#e.pendingSenders).sort((t,r)=>t.requestedAt.localeCompare(r.requestedAt)).map(t=>structuredClone(t))}pendingSender(t){let r=xe(t),a=r?this.#e.pendingSenders[r]:null;return a?structuredClone(a):null}async recordPendingSender(t,r,a){let i=t&&typeof t=="object"?t:{staffId:t,displayName:r,lastSeenAt:a},s=xe(i.staffId);if(!s)throw new TypeError("staffId is required");let o=xe(i.lastSeenAt)??xe(i.requestedAt)??this.#n(),e=Object.values(this.#e.pendingSenders).find(u=>u.staffId===s),y={requestId:e?.requestId??`ding_sender_${this.#a()}`,staffId:s,displayName:qg(i.displayName??i.nick??r),requestedAt:e?.requestedAt??o,lastSeenAt:o};return this.#e.pendingSenders[y.requestId]=y,await this.#o(),structuredClone(y)}async removePendingSender(t){let r=xe(t);return!r||!this.#e.pendingSenders[r]?!1:(delete this.#e.pendingSenders[r],await this.#o(),!0)}async removePendingSenderByStaffId(t){let r=xe(t),a=r?Object.values(this.#e.pendingSenders).find(i=>i.staffId===r):null;return a?this.removePendingSender(a.requestId):!1}snapshot(){return structuredClone(this.#e)}async remove(){await this.#r;try{await mq(this.#t)}catch(t){if(t?.code!=="ENOENT")throw t}this.#e=structuredClone(zo)}async#o(){let t=`${JSON.stringify(this.#e,null,2)} +`,r=this.#r.then(async()=>{await lq(yq(this.#t),{recursive:!0,mode:448});let a=`${this.#t}.tmp`;await fq(a,t,{encoding:"utf8",mode:384}),await uq(a,this.#t)});this.#r=r.then(()=>{},()=>{}),await r}};var Eg=Object.freeze([250,1e3,3e3,5e3,1e4,3e4]);function _q(n){if(!Array.isArray(n)||n.length===0)return[...Eg];let t=n.filter(r=>Number.isFinite(r)&&r>=0);return t.length>0?t:[...Eg]}var Ao=class{#t;#e;#r;#a;#n;#o;#d;#h=null;#c=null;#i=0;#s=!1;#l=!1;#p;#m;constructor({controller:t,harness:r,logger:a=console,retryDelaysMs:i,healthyIntervalMs:s=15e3,setTimeoutImpl:o=setTimeout,clearTimeoutImpl:e=clearTimeout}){if(!t||typeof t.initialize!="function"||typeof t.status!="function")throw new TypeError("ConnectionSupervisor requires a controller");if(!r||typeof r.ensureRunning!="function")throw new TypeError("ConnectionSupervisor requires a Harness client");this.#t=t,this.#e=r,this.#r=a,this.#a=_q(i),this.#n=Number.isFinite(s)&&s>=0?s:15e3,this.#o=o,this.#d=e,this.#p=new Promise(y=>{this.#m=y})}get ready(){return this.#p}start(){return this.#l||this.#s?this:(this.#l=!0,this.#u(0),this)}async close(){this.#s||(this.#s=!0,this.#h!==null&&this.#d(this.#h),this.#h=null,await this.#c?.catch(()=>{}),this.#m?.(null),this.#m=null)}#u(t){this.#s||(this.#h=this.#o(()=>{this.#h=null,this.#f()},t),this.#h?.unref?.())}async#f(){if(this.#s||this.#c)return;let t=this.#y();this.#c=t;try{await t}finally{this.#c===t&&(this.#c=null)}}async#y(){try{if(await this.#e.ensureRunning(),this.#s)return;let t=await this.#t.initialize();if(this.#s)return;this.#m?.(t),this.#m=null;let{configured:r,connected:a}=t.totals;if(a65535)throw new Error("dsh-dingtalk requires an initialized DSH webServer port");return new URL(`http://127.0.0.1:${r}`)}function Iq(n){let t=wa(n.dshHome??process.env.DSH_HOME??Co(wq(),".dsh")),r=wa(n.dataDir??Co(t,"integrations","dsh-dingtalk"));return{root:r,config:wa(n.configPath??Co(r,"config.json")),bots:wa(n.botsDir??Co(r,"bots"))}}async function dc(n,t={},r={}){if(!n?.credentials)throw new TypeError("dsh-dingtalk requires ctx.credentials");if(!n?.webServer)throw new TypeError("dsh-dingtalk requires ctx.webServer");let a=r.ConfigStore??ko,i=r.DeviceAuth??xo,s=r.StateStore??Ro,o=r.HarnessClient??$o,e=r.Controller??Ri,y=r.Runtime??Di,u=r.createConnectionSupervisor??hc,f=typeof n.logger=="function"?n.logger("dsh-dingtalk"):n.logger??console,d=Iq(t),m=await new a(d.config).load(),g=r.deviceAuth??new i({baseUrl:t.registrationBaseUrl}),_=new Map,b=F=>wa(d.bots,F,"state.json"),w=async F=>{let $=_.get(F);return $||($=await new s(b(F)).load(),_.set(F,$)),$},S=new o({baseUrl:Sq(n.webServer,t.harnessBaseUrl),workspace:wa(t.workspace??process.cwd()),agentPreset:t.agentPreset??"standard",autostart:!1,dshBin:t.dshBin??"dsh"}),O=new e({deviceAuth:g,credentials:n.credentials,configStore:m,logger:f,createRuntime:async({botId:F,config:$,clientSecret:A})=>{let G=await w(F);return new y({config:$,clientSecret:A,harness:S,state:G,replyTimeoutMs:t.replyTimeoutMs??6e5,maxMessageChars:t.maxMessageChars??4e3,connectTimeoutMs:t.connectTimeoutMs??15e3,logger:{error:(...M)=>f.error?.(`[${F}]`,...M),warn:(...M)=>f.warn?.(`[${F}]`,...M),info:(...M)=>f.info?.(`[${F}]`,...M),debug:(...M)=>f.debug?.(`[${F}]`,...M)}})},deleteState:async({botId:F})=>{let $=_.get(F);if(_.delete(F),$&&typeof $.remove=="function"){await $.remove();return}try{await bq(b(F))}catch(A){if(A?.code!=="ENOENT")throw A}}}),E=u({controller:O,harness:S,logger:f,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:O,ready:E.ready,async close(){await E.close(),await O.close(),S.stopManagedProcess()}}}import Tq from"qrcode";var kq=new Set(["loopback","trusted-host"]);function pt(n){if(n===void 0)return"loopback";if(kq.has(n))return n;throw new TypeError('dsh-im rpcAuthority must be "loopback" or "trusted-host"')}var Og="/dingtalk",Oe=Object.freeze({status:"connection.status",beginProvisioning:"provision.begin",pollProvisioning:"provision.poll",cancelProvisioning:"provision.cancel",bindCredentials:"bot.bind-credentials",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",approveSender:"bot.sender.approve",revokeSender:"bot.sender.revoke"}),$g=Object.freeze(Object.values(Oe)),xq=new Set(["clientSecret","client_secret","deviceCode","device_code","secretRef","staffId","senderStaffId","verificationUrl","verificationUri","userCode"]);function lc(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function cr(n,t){return lc(n)&&Object.keys(n).every(r=>t.includes(r))}function $r(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function Fg(n,t){return typeof n=="string"&&n.trim().length>0&&n.length<=t}function Pq(n,t){return lc(t)?n===Oe.status?cr(t,[])?null:"connection.status does not accept fields.":n===Oe.beginProvisioning?cr(t,["locale"])&&(t.locale===void 0||t.locale==="zh-CN")?null:"provision.begin received unsupported fields.":[Oe.pollProvisioning,Oe.cancelProvisioning].includes(n)?cr(t,["attemptId"])&&$r(t.attemptId)?null:`${n} requires an attemptId.`:n===Oe.bindCredentials?cr(t,["clientId","clientSecret"])&&Fg(t.clientId,256)&&Fg(t.clientSecret,1024)?null:"bot.bind-credentials requires Client ID and Client Secret.":n===Oe.reconnectBot?cr(t,["botId"])&&$r(t.botId)?null:"bot.reconnect requires a botId.":n===Oe.deleteBot?cr(t,["botId","confirm"])&&$r(t.botId)&&t.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===Oe.approveSender?cr(t,["botId","requestId","confirm"])&&$r(t.botId)&&$r(t.requestId)&&t.confirm===!0?null:"bot.sender.approve requires botId, requestId, and confirm=true.":n===Oe.revokeSender?cr(t,["botId","senderKey","confirm"])&&$r(t.botId)&&$r(t.senderKey)&&t.confirm===!0?null:"bot.sender.revoke requires botId, senderKey, and confirm=true.":"Unknown DingTalk endpoint.":"Payload must be an object."}function jo(n){return{ok:!1,error:{code:"bad-request",message:n}}}function Do(){return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}}function qq(){return{ok:!1,error:{code:"dingtalk-operation-failed",message:"\u9489\u9489\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"}}}function Ia(n){if(Array.isArray(n))return n.map(Ia);if(!lc(n))return n;let t={};for(let[r,a]of Object.entries(n))xq.has(r)||(t[r]=Ia(a));return t}async function Eq(n){return Tq.toDataURL(n,{type:"image/png",errorCorrectionLevel:"M",margin:2,width:320})}async function cc(n,t){return!n||typeof n.verificationUrl!="string"?Ia(n):Ia({...n,qrCodeDataUrl:await t(n.verificationUrl)})}async function Sa(n,t){let r=structuredClone(n);return r?.provisioning&&(r.provisioning=await cc(r.provisioning,t)),Ia(r)}function Fq(n){for(let t of["status","startProvisioning","registrationStatus","cancelProvisioning","bindCredentials","reconnectBot","deleteBot","approveSender","revokeSender"])if(typeof n?.[t]!="function")throw new TypeError(`A complete DingTalk controller is required (${t})`)}function zg(n,{encodeQr:t=Eq}={}){Fq(n);let r=new Map,a=i=>{let s=r.get(i);return s||(r.size>=16&&r.delete(r.keys().next().value),s=Promise.resolve().then(()=>t(i)),r.set(i,s)),s};return async(i,s,o)=>{if(o?.aborted)return Do();if(!$g.includes(i))return jo("Unknown DingTalk endpoint.");let e=Pq(i,s);if(e)return jo(e);try{let y;if(i===Oe.status)y=await Sa(await n.status(),a);else if(i===Oe.beginProvisioning){let u=await n.startProvisioning({signal:o});if(o?.aborted)return await n.cancelProvisioning(u.attemptId),Do();y=await cc(u,a)}else if(i===Oe.pollProvisioning){let u=await n.registrationStatus(s.attemptId);if(!u)return jo("The provisioning attempt no longer exists.");y=await cc(u,a)}else if(i===Oe.cancelProvisioning){if(y=await n.cancelProvisioning(s.attemptId),!y)return jo("The provisioning attempt no longer exists.");y=Ia(y)}else i===Oe.bindCredentials?y=await Sa(await n.bindCredentials(s),a):i===Oe.reconnectBot?y=await Sa(await n.reconnectBot(s.botId),a):i===Oe.deleteBot?y=await Sa(await n.deleteBot(s.botId),a):i===Oe.approveSender?y=await Sa(await n.approveSender(s.botId,s.requestId),a):y=await Sa(await n.revokeSender(s.botId,s.senderKey),a);return o?.aborted?Do():{ok:!0,value:y}}catch{return o?.aborted?Do():qq()}}}function Go(n,t,r,a){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(Og,zg(t,r),{authority:pt(a)})}async function Rg(n,t={}){if(t?.controller)return Go(n,t.controller,t.rpcOptions,t.rpcAuthority);let r=await dc(n,t,t.internals),a=Go(n,r.controller,t.rpcOptions,t.rpcAuthority);return n.effect(()=>async()=>{await r.close()},"dsh-dingtalk: close bot connections"),a}import{createHash as Oq}from"node:crypto";import{mkdir as $q,readFile as zq,rename as Rq,unlink as Aq,writeFile as Cq}from"node:fs/promises";import{dirname as jq}from"node:path";var pc=Object.freeze({version:1,bots:Object.freeze([])});function Qt(n){return typeof n=="string"&&n.trim()?n.trim():null}function Ag(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Gi(n,{botPrefix:t,tokenRefPrefix:r}){let a=Qt(n);if(!a)throw new TypeError("platformId is required");let i=Oq("sha256").update(a).digest("hex").slice(0,24);return{botId:`${t}_${i}`,tokenRef:`${r}_${i.toUpperCase()}`}}function Bo(n,t){let r=Qt(n)??"";return r.length<=10?r?`${r.slice(0,3)}\u2022\u2022\u2022`:t:`${r.slice(0,6)}\u2022\u2022\u2022\u2022${r.slice(-4)}`}var ka=class{#t;#e;#r;#a;#n;#o;#d=pc;#h=Promise.resolve();constructor(t,{channel:r,botPrefix:a,tokenRefPrefix:i}){this.#t=t,this.#e=r,this.#r=a,this.#a=i,this.#n=new RegExp(`^${Ag(a)}_[a-f0-9]{24}$`),this.#o=new RegExp(`^${Ag(i)}_[A-F0-9]{24}$`)}async load(){try{let t=this.#i(JSON.parse(await zq(this.#t,"utf8")));if(!t)throw new Error(`dsh-im ${this.#e} config contains invalid bot data`);this.#d=t}catch(t){if(t?.code!=="ENOENT")throw t;this.#d=pc}return this}list(){return structuredClone(this.#d.bots)}get(t){let r=this.#d.bots.find(a=>a.botId===t);return r?structuredClone(r):null}getByPlatformId(t){let r=this.#d.bots.find(a=>a.platformId===t);return r?structuredClone(r):null}async save(t){let r=this.#c(t);if(!r)throw new Error(`Refusing to persist incomplete ${this.#e} bot data`);return this.#s(a=>{let i=a.find(e=>e.platformId===r.platformId&&e.botId!==r.botId),s=a.find(e=>e.tokenRef===r.tokenRef&&e.botId!==r.botId);if(i||s)throw new Error(`Duplicate ${this.#e} bot identity`);let o=a.findIndex(e=>e.botId===r.botId);return o===-1?a.push(r):a[o]=r,structuredClone(r)})}async remove(t){if(!this.#n.test(t))throw new TypeError(`Invalid ${this.#e} bot id`);return this.#s(r=>{let a=r.findIndex(s=>s.botId===t);if(a===-1)return null;let[i]=r.splice(a,1);return structuredClone(i)})}async clear(){let t=this.#h.then(async()=>{try{await Aq(this.#t)}catch(r){if(r?.code!=="ENOENT")throw r}this.#d=pc});this.#h=t.then(()=>{},()=>{}),await t}#c(t){if(!t||typeof t!="object")return null;let r=Qt(t.platformId),a=Qt(t.botId),i=Qt(t.tokenRef),s=Qt(t.name);if(!r||!a||!i||!s||!this.#n.test(a)||!this.#o.test(i))return null;let o=Gi(r,{botPrefix:this.#r,tokenRefPrefix:this.#a});return o.botId!==a||o.tokenRef!==i?null:Object.freeze({botId:a,platformId:r,tokenRef:i,name:s,username:Qt(t.username),createdAt:Qt(t.createdAt)??new Date().toISOString(),connectedAt:Qt(t.connectedAt)})}#i(t){if(!t||t.version!==1||!Array.isArray(t.bots))return null;let r=t.bots.map(o=>this.#c(o));if(r.some(o=>o===null))return null;let a=new Set,i=new Set,s=new Set;for(let o of r){if(a.has(o.botId)||i.has(o.platformId)||s.has(o.tokenRef))return null;a.add(o.botId),i.add(o.platformId),s.add(o.tokenRef)}return Object.freeze({version:1,bots:Object.freeze(r)})}async#s(t){let r,a=this.#h.then(async()=>{let i=[...this.#d.bots];r=t(i);let s=Object.freeze({version:1,bots:Object.freeze(i)});await this.#l(s),this.#d=s});return this.#h=a.then(()=>{},()=>{}),await a,r}async#l(t){await $q(jq(this.#t),{recursive:!0,mode:448});let r=`${this.#t}.tmp`;await Cq(r,`${JSON.stringify(t,null,2)} +`,{encoding:"utf8",mode:384}),await Rq(r,this.#t)}};var Cg=Object.freeze({botPrefix:"discord",tokenRefPrefix:"DSH_DISCORD_BOT_TOKEN"});function jg(n){return Gi(n,Cg)}function Dg(n){return Bo(n,"Discord\u673A\u5668\u4EBA")}var Mo=class extends ka{constructor(t){super(t,{channel:"Discord",...Cg})}};function Bi(n){return typeof n=="string"&&n.trim()?n.trim():null}function Lo(n,t){return Object.freeze({code:n,message:t})}var Ta=class{#t;#e;#r;#a;#n;#o;#d;#h;#c;#i=new Map;#s=new Map;#l=new Map;#p=0;#m=!1;constructor({descriptor:t,credentials:r,configStore:a,inspectToken:i,deriveIdentity:s,maskPlatformId:o,createRuntime:e,deleteState:y=async()=>{},logger:u=console}){if(!t?.key||!t?.label||!t?.connectionLabel)throw new TypeError("TokenBotController requires a channel descriptor");if(!r||typeof r.resolve!="function"||typeof r.set!="function"||typeof r.unset!="function")throw new TypeError(`${t.label} requires the DSH credential provider`);if(!a||typeof a.list!="function"||typeof a.save!="function"||typeof a.remove!="function")throw new TypeError(`${t.label} requires a config store`);if(typeof i!="function"||typeof s!="function"||typeof o!="function"||typeof e!="function")throw new TypeError(`${t.label} controller dependencies are incomplete`);this.#t=t,this.#e=r,this.#r=a,this.#a=i,this.#n=s,this.#o=o,this.#d=e,this.#h=y,this.#c=u}async initialize(){if(this.#m)return this.status();for(let t of this.#r.list())await this.#b(t.botId,async()=>{if(this.#m||this.#i.get(t.botId)?.status?.ready)return;let r=await this.#y(t.tokenRef);if(!r){this.#s.set(t.botId,Lo("missing-token",`${this.#t.label}\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u63A5\u5165\u3002`));return}try{await this.#u(t,r),this.#s.delete(t.botId)}catch(a){this.#s.set(t.botId,Lo("connection-failed",`${this.#t.label}\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002`)),this.#c.warn?.(`[dsh-im:${this.#t.key}] bot ${t.botId} failed to initialize:`,a)}finally{this.#w()}});return this.status()}async bindCredentials({token:t}={}){if(this.#m)throw new Error(`${this.#t.label} controller is closed`);let r=Bi(t);if(!r)throw new TypeError(`${this.#t.label} Bot Token is required`);let a=await this.#a(r),i=Bi(a?.platformId),s=Bi(a?.name);if(!i||!s)throw new Error(`${this.#t.label} returned an invalid bot identity`);let o=this.#n(i);return await this.#b(o.botId,async()=>{if(this.#m)throw new Error(`${this.#t.label} controller is closed`);let e=this.#r.getByPlatformId(i),y=await this.#e.resolve(o.tokenRef).catch(()=>{}),u={botId:o.botId,platformId:i,tokenRef:o.tokenRef,name:s,username:Bi(a.username),createdAt:e?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString()};await this.#e.set(o.tokenRef,r);try{await this.#r.save(u)}catch(f){throw await this.#g(o.tokenRef,y),f}try{await this.#u(u,r),this.#s.delete(o.botId)}catch(f){this.#s.set(o.botId,Lo("connection-failed",`${this.#t.label}\u673A\u5668\u4EBA\u5DF2\u63A5\u5165\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002`)),this.#c.warn?.(`[dsh-im:${this.#t.key}] bot ${o.botId} credential connection failed:`,f)}this.#w()}),this.status()}async reconnectBot(t){let r=this.#r.get(t);if(!r)throw new Error(`Unknown ${this.#t.label} bot`);return await this.#b(t,async()=>{let a=await this.#y(r.tokenRef);if(!a)throw new Error(`${this.#t.label} bot token is missing`);try{await this.#u(r,a),this.#s.delete(t)}catch(i){throw this.#s.set(t,Lo("connection-failed",`${this.#t.label}\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002`)),i}finally{this.#w()}}),this.status()}async deleteBot(t){let r=this.#r.get(t);if(!r)throw new Error(`Unknown ${this.#t.label} bot`);return await this.#b(t,async()=>{let a=await this.#e.resolve(r.tokenRef).catch(()=>{});await this.#f(t);try{await this.#e.unset(r.tokenRef),await this.#r.remove(t)}catch(i){throw a?.value&&(await this.#e.set(r.tokenRef,a.value).catch(()=>{}),await this.#u(r,a.value).catch(()=>{})),new Error(`Unable to remove the ${this.#t.label} bot safely.`,{cause:i})}await this.#h({botId:t,config:r}).catch(i=>{this.#c.warn?.(`[dsh-im:${this.#t.key}] bot ${t} state cleanup failed:`,i)}),this.#s.delete(t),this.#w()}),this.status()}status(){let t=this.#r.list().map(a=>{let i=this.#i.get(a.botId)?.status??null,s=i?.ready===!0&&i.connectionState==="connected"&&i.harnessReachable===!0,o=s?"connected":i?.connectionState==="connecting"?"connecting":this.#s.has(a.botId)||i?.connectionState==="failed"?"error":"offline";return{botId:a.botId,state:o,connected:s,configured:!0,bot:{name:a.name,username:a.username,idMasked:this.#o(a.platformId)},health:{status:s?"healthy":o==="error"?"error":"offline",summary:s?`${this.#t.label}${this.#t.connectionLabel}\u8FD0\u884C\u6B63\u5E38`:o==="error"?`${this.#t.label}\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5`:`${this.#t.label}\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF`,lastCheckedAt:i?.lastCheckedAt??null,lastConnectedAt:i?.lastConnectedAt??null},stats:{messagesReceived:i?.messagesReceived??0,messagesReplied:i?.messagesReplied??0},error:structuredClone(this.#s.get(a.botId)??null)}}),r=t.filter(a=>a.connected).length;return{schemaVersion:1,revision:this.#p,state:t.length===0?"disconnected":r===t.length?"connected":r>0?"degraded":"offline",bots:t,totals:{configured:t.length,connected:r}}}async close(){this.#m||(this.#m=!0,await Promise.allSettled([...this.#l.values()]),await Promise.allSettled([...this.#i.keys()].map(t=>this.#f(t))))}async#u(t,r){if(this.#m)throw new Error(`${this.#t.label} controller is closed`);if(await this.#f(t.botId),this.#m)throw new Error(`${this.#t.label} controller is closed`);let a=await this.#d({botId:t.botId,config:t,token:r});if(!a||typeof a.start!="function"||typeof a.stop!="function")throw new TypeError(`createRuntime returned an invalid ${this.#t.label} runtime`);this.#i.set(t.botId,a);try{await a.start()}catch(i){throw await a.stop().catch(()=>{}),this.#i.delete(t.botId),i}}async#f(t){let r=this.#i.get(t);this.#i.delete(t),await r?.stop().catch(a=>{this.#c.warn?.(`[dsh-im:${this.#t.key}] bot ${t} failed to stop cleanly:`,a)})}async#y(t){let r=await this.#e.resolve(t).catch(()=>{});return Bi(r?.value)}async#g(t,r){r?.value?await this.#e.set(t,r.value).catch(()=>{}):await this.#e.unset(t).catch(()=>{})}#b(t,r){let s=(this.#l.get(t)??Promise.resolve()).catch(()=>{}).then(r).finally(()=>{this.#l.get(t)===s&&this.#l.delete(t)});return this.#l.set(t,s),s}#w(){this.#p+=1}};var Dq="https://discord.com/api/v10/";function Mi(n){return typeof n=="string"&&n.trim()?n.trim():null}function Gq(n,t){let r=AbortSignal.timeout(t);return n?AbortSignal.any([n,r]):r}function Bq(n,t){return new Promise((r,a)=>{if(t?.aborted){a(t.reason??new DOMException("Aborted","AbortError"));return}let i=setTimeout(r,n);i?.unref?.(),t?.addEventListener("abort",()=>{clearTimeout(i),a(t.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function xa(n,t){let r=Mi(n);if(!r||!/^\d{5,30}$/.test(r))throw new TypeError(`Invalid Discord ${t}`);return r}function Mq(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{4,}\.[A-Za-z0-9_-]{20,}$/.test(n.trim())}var Li=class{#t;#e;#r;constructor({token:t,fetchImpl:r=fetch,baseUrl:a=Dq}){if(!Mq(t))throw new TypeError("Discord Bot Token is invalid");if(typeof r!="function")throw new TypeError("DiscordApi requires fetch");this.#t=t.trim(),this.#e=r,this.#r=new URL(a)}getCurrentUser(t={}){return this.#a("users/@me",{...t,method:"GET"})}getGatewayBot(t={}){return this.#a("gateway/bot",{...t,method:"GET"})}createMessage({channelId:t,content:r,replyToMessageId:a,signal:i}){return this.#a(`channels/${xa(t,"channel id")}/messages`,{method:"POST",signal:i,body:{content:r,allowed_mentions:{parse:[],replied_user:!1},...a?{message_reference:{message_id:xa(a,"message id"),channel_id:xa(t,"channel id"),fail_if_not_exists:!1}}:{}}})}editMessage({channelId:t,messageId:r,content:a,signal:i}){return this.#a(`channels/${xa(t,"channel id")}/messages/${xa(r,"message id")}`,{method:"PATCH",signal:i,body:{content:a,allowed_mentions:{parse:[],replied_user:!1}}})}sendTyping({channelId:t,signal:r}){return this.#a(`channels/${xa(t,"channel id")}/typing`,{method:"POST",signal:r,expectBody:!1})}async#a(t,{method:r,body:a,signal:i,timeoutMs:s=15e3,expectBody:o=!0,retry:e=!0}){let y;try{y=await this.#e(new URL(t,this.#r),{method:r,headers:{authorization:`Bot ${this.#t}`,"content-type":"application/json","user-agent":"DeepSeek-Harness-dsh-im (https://github.com/xmanrui/dsh-im, 0.1.1)"},...a===void 0?{}:{body:JSON.stringify(a)},signal:Gq(i,s),redirect:"error"})}catch(f){throw f?.name==="AbortError"||f?.name==="TimeoutError"?f:new Error(`Discord ${r} transport failed`)}let u=null;if(o||y.status===429||!y.ok)try{u=await y.json()}catch{if(o)throw new Error(`Discord ${r} returned invalid JSON`)}if(y.status===429&&e){let f=Math.min(1e4,Math.max(50,Number(u?.retry_after)*1e3||1e3));return await Bq(f,i),this.#a(t,{method:r,body:a,signal:i,timeoutMs:s,expectBody:o,retry:!1})}if(!y.ok){let f=new Error(Mi(u?.message)??`Discord API failed with HTTP ${y.status}`);throw f.code=`discord-${y.status}`,f}return o?u:null}};async function Gg(n,t={}){let a=await new Li({token:n,...t}).getCurrentUser();if(!a?.id||a?.bot!==!0)throw new Error("Discord token does not belong to a bot");return{platformId:String(a.id),name:Mi(a.global_name)??Mi(a.username)??"Discord\u673A\u5668\u4EBA",username:Mi(a.username)}}function No(n){return typeof n=="string"?n.trim():""}function zr(){return{messagesReceived:0,messagesReplied:0,messagesRejected:0,lastMessageAt:null,lastReplyAt:null,lastRejectedAt:null,lastError:null}}var Pa=class{#t;#e;#r;#a;#n;#o;#d;#h=new Map;constructor({descriptor:t,bot:r,harness:a,state:i,status:s=zr(),logger:o=console,replyTimeoutMs:e=6e5}){if(!t?.key||!t?.label)throw new TypeError("A channel descriptor is required");if(!r||typeof r.sendText!="function")throw new TypeError("A bot client is required");if(!a||!i)throw new TypeError("Harness client and state store are required");this.#t=t,this.#e=r,this.#r=a,this.#a=i,this.#n=s,this.#o=o,this.#d=e}get status(){return structuredClone(this.#n)}accept(t){let r=No(t?.conversationId),a=t?.kind==="group"?"group":"direct",i=`${a}:${r}`,o=(this.#h.get(i)??Promise.resolve()).catch(()=>{}).then(()=>this.#c({...t,kind:a,conversationId:r})).finally(()=>{this.#h.get(i)===o&&this.#h.delete(i)});return this.#h.set(i,o),o}async waitForIdle(){await Promise.allSettled([...this.#h.values()])}async#c(t){let r=No(t.messageId),a=No(t.senderId);if(!r||!a||!t.conversationId||t.senderIsBot===!0||this.#a.hasSeen(r))return;if(this.#n.messagesReceived+=1,this.#n.lastMessageAt=new Date().toISOString(),t.kind==="group"&&t.addressed!==!0){this.#n.messagesRejected+=1,this.#n.lastRejectedAt=new Date().toISOString();return}let i=t.replyTarget,s=No(t.content);try{if(!s){await this.#e.sendText(i,"\u76EE\u524D\u4EC5\u652F\u6301\u6587\u5B57\u6D88\u606F\u3002"),await this.#a.markSeen(r);return}let o=s.toLowerCase();if(o==="/help"){await this.#e.sendText(i,[`${this.#t.label}\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002`,"","\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002","/new \u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD","/status \u68C0\u67E5\u8FDE\u63A5\u72B6\u6001","/help \u663E\u793A\u672C\u5E2E\u52A9"].join(` +`)),await this.#a.markSeen(r);return}if(o==="/status"){await this.#r.ensureRunning(),await this.#e.sendText(i,`${this.#t.label}\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002`),await this.#a.markSeen(r);return}let e=`${t.kind}:${t.conversationId}`;if(o==="/new"){await this.#a.clearSession(e),await this.#e.sendText(i,"\u5DF2\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002\u8BF7\u53D1\u9001\u4F60\u7684\u95EE\u9898\u3002"),await this.#a.markSeen(r);return}let y=this.#a.sessionFor(e);(!y||!await this.#r.sessionExists(y))&&(y=await this.#r.createSession(),await this.#a.setSession(e,y)),await this.#e.sendTyping?.(i).catch(m=>{this.#o.warn?.(`[dsh-im:${this.#t.key}] typing indicator failed:`,m)});let u=null,f=!1;if(typeof this.#e.openStream=="function")try{u=await this.#e.openStream(i)}catch(m){this.#o.warn?.(`[dsh-im:${this.#t.key}] unable to start a streamed reply; using text:`,m)}let d=await this.#r.ask(y,s,{timeoutMs:this.#d,onUpdate:u?async m=>{let g=m.type==="text"?m.text:m.type==="tool"?`\u6B63\u5728\u4F7F\u7528${m.name}\u2026`:m.text;g&&await u.update(g)}:void 0});if(u)try{await u.finish(d),f=!0}catch(m){u.cancel?.(),this.#o.warn?.(`[dsh-im:${this.#t.key}] streamed reply finalization failed; using text:`,m)}f||await this.#e.sendText(i,d),await this.#a.markSeen(r),this.#n.messagesReplied+=1,this.#n.lastReplyAt=new Date().toISOString(),this.#n.lastError=null}catch(o){this.#n.lastError=o?.message??String(o),this.#o.error?.(`[dsh-im:${this.#t.key}] failed to process a message:`,o);try{await this.#e.sendText(i,"\u6D88\u606F\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"),await this.#a.markSeen(r)}catch(e){this.#o.error?.(`[dsh-im:${this.#t.key}] failed to send the safe error reply:`,e)}}}};var uc=Object.freeze({key:"discord",label:"Discord",connectionLabel:" Gateway \u957F\u8FDE\u63A5"}),Uo=class extends Pa{constructor(t){super({descriptor:uc,...t})}};var Ni=class extends Ta{constructor(t){super({...t,descriptor:uc,inspectToken:t.inspectToken??Gg,deriveIdentity:jg,maskPlatformId:Dg})}};import{spawn as Lq}from"node:child_process";import{randomUUID as Bg}from"node:crypto";var Mg=n=>new Promise(t=>setTimeout(t,n));function Nq(n){return(n?.data?.message?.content??[]).filter(t=>t.type==="text"&&typeof t.text=="string").map(t=>t.text).join(` +`).trim()}var mc=class{#t;#e;#r=null;#a=null;#n=new Map;#o="";#d=!1;#h=null;constructor({promptRpcId:t,afterSeq:r=-1}){this.#t=t,this.#e=r}get finished(){return this.#d}get answer(){return this.#o.trim()}get reason(){return this.#h}consume(t){let r=null,a=[...t].map(i=>i?.event??i).filter(Boolean).sort((i,s)=>(i.seq??-1)-(s.seq??-1));for(let i of a){let s=i.seq??-1;if(!(s<=this.#e)){if(this.#e=s,i.type==="turn/start"&&(this.#r=i.data?.turn??null),i.type==="user/message"&&i.data?.source?.rpcId===this.#t){this.#a=this.#r;continue}if(this.#a!==null){if(i.type==="turn/end"){if(i.data?.turn!==this.#a)continue;this.#d=!0,this.#h=i.data?.reason??null,this.#r=null;continue}if(i.data?.turn===this.#a){if(i.type==="assistant/chunk"&&i.data?.chunk?.type==="text-delta"){let o=i.data?.step??0,e=i.data.chunk.index??0,y=`${o}:${e}`;this.#n.set(y,(this.#n.get(y)??"")+i.data.chunk.text);let u=`${o}:`,f=[...this.#n.entries()].filter(([d])=>d.startsWith(u)).sort(([d],[m])=>Number(d.split(":")[1])-Number(m.split(":")[1])).map(([,d])=>d).join(` +`).trim();f&&f!==this.#o&&(this.#o=f,r={type:"text",text:f});continue}if(i.type==="assistant/message"){let o=Nq(i);o&&o!==this.#o&&(this.#o=o,r={type:"text",text:o});continue}i.type==="tool/call"?r={type:"tool",name:i.data?.name??"\u5DE5\u5177"}:i.type==="tool/result"&&(r={type:"status",text:"\u6B63\u5728\u6574\u7406\u7ED3\u679C\u2026"})}}}}return r}},Wo=class extends Error{constructor(t,r){super(`${t}: ${r?.message??"unknown Harness RPC error"}`),this.name="HarnessRpcError",this.method=t,this.code=r?.code??"internal",this.details=r?.details??{}}},ut=class{#t;#e;#r;#a;#n;#o=null;constructor({baseUrl:t,workspace:r,agentPreset:a="standard",autostart:i=!1,dshBin:s="dsh"}){this.#t=new URL(t),this.#e=r,this.#r=a,this.#a=i,this.#n=s}async rpc(t,r={},a=3e4,i={}){let s=i.rpcId??`weixin-${Bg()}`,o=await fetch(new URL(`/api/${t}`,this.#t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({type:"client-request",rpcId:s,method:t,payload:r}),signal:AbortSignal.timeout(a)});if(!o.ok)throw new Error(`Harness transport ${t} failed: HTTP ${o.status}`);let e=await o.json();if(e?.type!=="server-response"||e?.rpcId!==s)throw new Error(`Harness returned an invalid response for ${t}`);if(!e.result?.ok)throw new Wo(t,e.result?.error);return e.result.value}async health(){return await this.rpc("host.describe",{},5e3),!0}async ensureRunning(){try{return await this.health()}catch(a){if(!this.#a)throw a}if(!this.#o||this.#o.exitCode!==null){let a=this.#t.port||(this.#t.protocol==="https:"?"443":"80");this.#o=Lq(this.#n,["web","--host",this.#t.hostname,"--port",a],{cwd:this.#e,env:process.env,stdio:["ignore","inherit","inherit"]}),this.#o.on("error",i=>{console.error("[dsh-weixin] failed to start Harness:",i.message)})}let t=Date.now()+6e4,r;for(;Date.now()i.path===this.#e);return r?r.workspaceId:(await this.rpc("workspace.create",{path:this.#e})).workspace.workspaceId}async createSession(){await this.ensureRunning();let t=await this.workspaceId();return(await this.rpc("session.create",{workspaceId:t,agentPreset:this.#r})).sessionId}async sessionExists(t){try{return await this.rpc("session.history",{sessionId:t,maxMessages:1}),!0}catch(r){if(r instanceof Wo&&r.code==="session-not-found")return!1;throw r}}async ask(t,r,a={}){typeof a=="number"&&(a={timeoutMs:a});let i=a.timeoutMs??6e5,s=typeof a.onUpdate=="function"?a.onUpdate:null;await this.ensureRunning();let o=await this.rpc("session.history",{sessionId:t,maxMessages:1}),e=Math.max(-1,...(o.events??[]).map(({event:d})=>d.seq??-1)),y=`weixin-${Bg()}`,u=new mc({promptRpcId:y,afterSeq:e});await this.rpc("session.prompt",{sessionId:t,mode:"queue",content:[{type:"text",text:r}],clientTimeZone:Intl.DateTimeFormat().resolvedOptions().timeZone},3e4,{rpcId:y});let f=Date.now()+i;for(;Date.now()t;){let s=i.lastIndexOf(` +`,t);s{d||u!==null||f||!y||(u=setTimeout(()=>{u=null;let _=y;y=null;let b=qa(_,t)[0]??n;f=Promise.resolve(b===m?void 0:i(e,b)).then(()=>{m=b}).catch(w=>o.warn?.("[dsh-im] streamed message update failed:",w)).finally(()=>{f=null,g()})},r),u?.unref?.())};return{async start(){return e=await a(n),this},update(_){d||typeof _!="string"||!_.trim()||(y=_,g())},async finish(_){if(d)throw new Error("Message stream is already closed");d=!0,u!==null&&clearTimeout(u),u=null,y=null,await f?.catch(()=>{});let b=qa(_,t),w=b[0]??"\u5904\u7406\u5B8C\u6210\u3002";w!==m&&await i(e,w),m=w;for(let S of b.slice(1))await s(S)},cancel(){d=!0,y=null,u!==null&&clearTimeout(u),u=null}}}var Uq=4609,Lg=Object.freeze([1e3,3e3,5e3,1e4,3e4]);function Wq(n){let t=new URL(n);if(t.protocol!=="wss:")throw new Error("Discord returned an insecure Gateway URL");return t.searchParams.set("v","10"),t.searchParams.set("encoding","json"),t.href}function fc(n,t,r){if(typeof n.addEventListener=="function")n.addEventListener(t,r);else if(typeof n.on=="function")n.on(t,r);else throw new TypeError("Discord WebSocket does not support events")}function Hq(n){return typeof n=="string"?n:typeof n?.data=="string"?n.data:Buffer.isBuffer(n)?n.toString("utf8"):Buffer.isBuffer(n?.data)?n.data.toString("utf8"):null}function Qq(n){if(n===4004){let r=new Error("Discord Bot Token \u65E0\u6548\uFF0C\u8BF7\u91CD\u65B0\u586B\u5199\u3002");return r.code="discord-401",r}if(n===4013||n===4014){let r=new Error("Discord Gateway Intents \u914D\u7F6E\u4E0D\u6B63\u786E\uFF0C\u8BF7\u68C0\u67E5 Developer Portal \u7684 Bot \u8BBE\u7F6E\u3002");return r.code="discord-intents",r}let t=new Error(`Discord Gateway closed (${n||"unknown"})`);return t.code="discord-gateway-closed",t}function Vq(n,t){return typeof n!="string"?"":n.replace(new RegExp(`<@!?${t}>`,"g"),"").trim()}function Kq(n,t){if(!n?.id||!n?.channel_id||!n?.author?.id)return null;let r=!n.guild_id,a=r||n.mentions?.some(i=>String(i?.id)===String(t));return{messageId:String(n.id),senderId:String(n.author.id),senderIsBot:n.author.bot===!0,kind:r?"direct":"group",conversationId:String(n.channel_id),content:Vq(n.content??"",t),addressed:a,replyTarget:{channelId:String(n.channel_id),replyToMessageId:String(n.id)}}}var yc=class{#t;#e;constructor({api:t,signal:r}){this.#t=t,this.#e=r}async sendText(t,r){let a=qa(r,1900),i=null;for(let[s,o]of a.entries())i=await this.#t.createMessage({channelId:t.channelId,content:o,replyToMessageId:s===0?t.replyToMessageId:void 0,signal:this.#e});return i}sendTyping(t){return this.#t.sendTyping({channelId:t.channelId,signal:this.#e})}async openStream(t){return Qo({limit:1900,create:async a=>(await this.#t.createMessage({channelId:t.channelId,content:a,replyToMessageId:t.replyToMessageId,signal:this.#e})).id,edit:(a,i)=>this.#t.editMessage({channelId:t.channelId,messageId:a,content:i,signal:this.#e}),sendRemainder:a=>this.#t.createMessage({channelId:t.channelId,content:a,signal:this.#e})}).start()}};function Jq(){return{startedAt:null,ready:!1,connectionState:"idle",harnessReachable:!1,lastCheckedAt:null,lastConnectedAt:null,lastError:null,...zr()}}var Ui=class{#t;#e;#r;#a;#n;#o;#d;#h;#c;#i;#s=Jq();#l=null;#p=null;#m=null;#u=null;#f=null;#y=null;#g=null;#b=null;#w=null;#v=!0;#S=null;#_=0;#T=0;#I=!0;#P=null;constructor({config:t,token:r,harness:a,state:i,logger:s=console,replyTimeoutMs:o=6e5,connectTimeoutMs:e=2e4,createApi:y=d=>new Li(d),createWebSocket:u=d=>new WebSocket(d),random:f=Math.random}){if(!t||!r||!a||!i)throw new TypeError("DiscordRuntime requires config, token, Harness, and state");if(typeof u!="function")throw new TypeError("DiscordRuntime requires WebSocket");this.#t=t,this.#e=r,this.#r=a,this.#a=i,this.#n=s,this.#o=o,this.#d=e,this.#h=y,this.#c=u,this.#i=f}get status(){return structuredClone(this.#s)}async start(){return this.#s.ready&&this.#u?this.status:this.#P?this.#P:(this.#P=this.#q().finally(()=>{this.#P=null}),this.#P)}async#q(){await this.stop(),this.#I=!1,this.#g=null,this.#y=null,this.#b=null,this.#_=0,this.#s.startedAt=new Date().toISOString(),this.#s.connectionState="connecting",this.#s.lastError=null,await this.#r.ensureRunning(),this.#s.harnessReachable=!0;let t=new AbortController;this.#m=t;let r=this.#h({token:this.#e});this.#l=r;try{let[a,i]=await Promise.all([r.getCurrentUser({signal:t.signal}),r.getGatewayBot({signal:t.signal})]);if(String(a?.id??"")!==this.#t.platformId||a?.bot!==!0)throw new Error("Discord token identity does not match the saved bot");this.#f=i?.url;let s=new yc({api:r,signal:t.signal});this.#p=new Uo({bot:s,harness:this.#r,state:this.#a,status:this.#s,logger:this.#n,replyTimeoutMs:this.#o});let o;try{await Promise.race([this.#k(!1),new Promise((e,y)=>{o=setTimeout(()=>y(new Error("Discord Gateway did not become ready in time")),this.#d)})])}finally{clearTimeout(o)}return this.status}catch(a){throw this.#s.ready=!1,this.#s.connectionState="failed",this.#s.lastError=a?.message??String(a),await this.stop(),a}}#k(t){if(this.#I)return Promise.reject(new Error("Discord runtime is stopped"));let r=++this.#T,a=Wq(t&&this.#y?this.#y:this.#f),i=this.#c(a);this.#u=i;let s=!1;return new Promise((o,e)=>{let y=()=>{if(s||r!==this.#T)return;s=!0,this.#_=0;let u=Date.now();this.#s.ready=!0,this.#s.connectionState="connected",this.#s.lastCheckedAt=u,this.#s.lastConnectedAt=u,this.#s.lastError=null,o()};fc(i,"message",u=>{if(r!==this.#T||this.#I)return;let f=Hq(u);if(!f)return;let d;try{d=JSON.parse(f)}catch{this.#n.warn?.("[dsh-im:discord] ignored malformed Gateway JSON");return}if(Number.isSafeInteger(d.s)&&(this.#b=d.s),d.op===10){this.#x(d.d?.heartbeat_interval,i,r),t&&this.#g?this.#E(i,{op:6,d:{token:this.#e,session_id:this.#g,seq:this.#b}}):this.#E(i,{op:2,d:{token:this.#e,intents:Uq,properties:{os:process.platform,browser:"dsh-im",device:"dsh-im"}}});return}if(d.op===11){this.#v=!0,this.#s.lastCheckedAt=Date.now();return}if(d.op===1){this.#O(i);return}if(d.op===7){i.close(4e3,"Reconnect requested");return}if(d.op===9){d.d!==!0&&(this.#g=null,this.#y=null,this.#b=null),i.close(4e3,"Invalid session");return}if(d.op===0){if(d.t==="READY")this.#g=d.d?.session_id??null,this.#y=d.d?.resume_gateway_url??null,y();else if(d.t==="RESUMED")y();else if(d.t==="MESSAGE_CREATE"){let m=Kq(d.d,this.#t.platformId);m&&this.#p?.accept(m)}}}),fc(i,"close",(u={})=>{if(r!==this.#T)return;if(this.#F(),this.#u===i&&(this.#u=null),this.#I){s||e(new DOMException("Stopped","AbortError"));return}let f=Qq(Number(u.code)||0);if(this.#s.ready=!1,this.#s.connectionState="connecting",this.#s.lastError=f.message,s||(s=!0,e(f)),f.code==="discord-401"||f.code==="discord-intents"){this.#s.connectionState="failed";return}this.#$()}),fc(i,"error",()=>{r!==this.#T||this.#I||(this.#s.lastError="Discord Gateway WebSocket error")})})}#E(t,r){t.readyState===1&&t.send(JSON.stringify(r))}#x(t,r,a){if(this.#F(),!Number.isFinite(t)||t<1e3){r.close(4e3,"Invalid heartbeat interval");return}this.#v=!0;let i=s=>{this.#w=setTimeout(()=>{if(!(this.#I||a!==this.#T||this.#u!==r)){if(!this.#v){r.close(4e3,"Heartbeat was not acknowledged");return}this.#O(r),i(t)}},s),this.#w?.unref?.()};i(Math.floor(t*this.#i()))}#O(t){this.#v=!1,this.#E(t,{op:1,d:this.#b})}#F(){this.#w!==null&&clearTimeout(this.#w),this.#w=null,this.#v=!0}#$(){if(this.#I||this.#S!==null)return;let t=Lg[Math.min(this.#_,Lg.length-1)];this.#_+=1,this.#S=setTimeout(()=>{this.#S=null,this.#k(!!this.#g).catch(r=>{this.#I||(this.#n.warn?.("[dsh-im:discord] Gateway reconnect failed:",r),this.#$())})},t),this.#S?.unref?.()}async stop(){this.#I=!0,this.#T+=1,this.#m?.abort(),this.#m=null,this.#S!==null&&clearTimeout(this.#S),this.#S=null,this.#F();let t=this.#u,r=this.#p;this.#u=null,this.#p=null,this.#l=null;try{t&&t.readyState<2&&t.close(1e3,"Plugin stopped")}catch(a){this.#n.warn?.(`[dsh-im:discord] bot ${this.#t.botId} failed to close Gateway:`,a)}return await Promise.race([r?.waitForIdle()??Promise.resolve(),new Promise(a=>setTimeout(a,2e3))]),this.#s.ready=!1,this.#s.connectionState="idle",this.status}};import{mkdir as Xq,readFile as Yq,rename as Zq,unlink as eE,writeFile as tE}from"node:fs/promises";import{dirname as rE}from"node:path";var Vo=Object.freeze({version:1,sessions:{},seenMessageIds:[],cursor:null});function aE(n){if(!n||typeof n!="object")return structuredClone(Vo);let t={};if(n.sessions&&typeof n.sessions=="object"&&!Array.isArray(n.sessions))for(let[r,a]of Object.entries(n.sessions))typeof r=="string"&&r&&typeof a=="string"&&a&&(t[r]=a);return{version:1,sessions:t,seenMessageIds:Array.isArray(n.seenMessageIds)?n.seenMessageIds.filter(r=>typeof r=="string"&&r).slice(-1e3):[],cursor:Number.isSafeInteger(n.cursor)&&n.cursor>=0?n.cursor:null}}var Ea=class{#t;#e=structuredClone(Vo);#r=Promise.resolve();constructor(t){this.#t=t}async load(){try{this.#e=aE(JSON.parse(await Yq(this.#t,"utf8")))}catch(t){if(t?.code!=="ENOENT")throw t;this.#e=structuredClone(Vo),await this.#a()}return this}sessionFor(t){return this.#e.sessions[t]??null}async setSession(t,r){this.#e.sessions[t]=r,await this.#a()}async clearSession(t){delete this.#e.sessions[t],await this.#a()}hasSeen(t){return this.#e.seenMessageIds.includes(t)}async markSeen(t){this.hasSeen(t)||(this.#e.seenMessageIds.push(t),this.#e.seenMessageIds.length>1e3&&this.#e.seenMessageIds.splice(0,this.#e.seenMessageIds.length-1e3),await this.#a())}cursor(){return this.#e.cursor}async setCursor(t){if(!Number.isSafeInteger(t)||t<0)throw new TypeError("Invalid update cursor");this.#e.cursor=t,await this.#a()}snapshot(){return structuredClone(this.#e)}async remove(){try{await eE(this.#t)}catch(t){if(t?.code!=="ENOENT")throw t}this.#e=structuredClone(Vo)}async#a(){let t=`${JSON.stringify(this.#e,null,2)} +`,r=this.#r.then(async()=>{await Xq(rE(this.#t),{recursive:!0,mode:448});let a=`${this.#t}.tmp`;await tE(a,t,{encoding:"utf8",mode:384}),await Zq(a,this.#t)});this.#r=r.then(()=>{},()=>{}),await r}};var Ko=class extends Ea{};import{unlink as sE}from"node:fs/promises";import{homedir as oE}from"node:os";import{join as Jo,resolve as Fa}from"node:path";var Ng=Object.freeze([250,1e3,3e3,5e3,1e4,3e4]);function iE(n){if(!Array.isArray(n)||n.length===0)return[...Ng];let t=n.filter(r=>Number.isFinite(r)&&r>=0);return t.length>0?t:[...Ng]}var gc=class{#t;#e;#r;#a;#n;#o;#d;#h;#c=null;#i=null;#s=0;#l=!1;#p=!1;#m;#u;constructor({channel:t,controller:r,harness:a,logger:i=console,retryDelaysMs:s,healthyIntervalMs:o=15e3,setTimeoutImpl:e=setTimeout,clearTimeoutImpl:y=clearTimeout}){if(!t)throw new TypeError("TokenConnectionSupervisor requires a channel");if(!r||typeof r.initialize!="function"||typeof r.status!="function")throw new TypeError("TokenConnectionSupervisor requires a controller");if(!a||typeof a.ensureRunning!="function")throw new TypeError("TokenConnectionSupervisor requires a Harness client");this.#t=t,this.#e=r,this.#r=a,this.#a=i,this.#n=iE(s),this.#o=Number.isFinite(o)&&o>=0?o:15e3,this.#d=e,this.#h=y,this.#m=new Promise(u=>{this.#u=u})}get ready(){return this.#m}start(){return this.#p||this.#l?this:(this.#p=!0,this.#f(0),this)}async close(){this.#l||(this.#l=!0,this.#c!==null&&this.#h(this.#c),this.#c=null,await this.#i?.catch(()=>{}),this.#u?.(null),this.#u=null)}#f(t){this.#l||(this.#c=this.#d(()=>{this.#c=null,this.#y()},t),this.#c?.unref?.())}async#y(){if(this.#l||this.#i)return;let t=this.#g();this.#i=t;try{await t}finally{this.#i===t&&(this.#i=null)}}async#g(){try{if(await this.#r.ensureRunning(),this.#l)return;let t=await this.#e.initialize();if(this.#l)return;this.#u?.(t),this.#u=null;let{configured:r,connected:a}=t.totals;if(a65535)throw new Error("dsh-im token channel requires an initialized DSH webServer port");return new URL(`http://127.0.0.1:${r}`)}function hE(n,t){let r=Fa(n.dshHome??process.env.DSH_HOME??Jo(oE(),".dsh")),a=Fa(n.dataDir??Jo(r,"integrations",`dsh-${t}`));return{config:Fa(n.configPath??Jo(a,"config.json")),bots:Fa(n.botsDir??Jo(a,"bots"))}}async function Xo(n,t,r,a){let{channel:i,ConfigStore:s,StateStore:o,HarnessClient:e,Controller:y,Runtime:u}=a;if(!n?.credentials)throw new TypeError(`dsh-im ${i} requires ctx.credentials`);if(!n?.webServer)throw new TypeError(`dsh-im ${i} requires ctx.webServer`);let f=r.ConfigStore??s,d=r.StateStore??o,m=r.HarnessClient??e,g=r.Controller??y,_=r.Runtime??u,b=r.createConnectionSupervisor??Ug,w=typeof n.logger=="function"?n.logger(`dsh-im:${i}`):n.logger??console,S=hE(t,i),O=await new f(S.config).load(),E=new Map,F=N=>Fa(S.bots,N,"state.json"),$=async N=>{let B=E.get(N);return B||(B=await new d(F(N)).load(),E.set(N,B)),B},A=new m({baseUrl:nE(n.webServer,t.harnessBaseUrl),workspace:Fa(t.workspace??process.cwd()),agentPreset:t.agentPreset??"standard",autostart:!1,dshBin:t.dshBin??"dsh"}),G=new g({credentials:n.credentials,configStore:O,logger:w,...r.inspectToken?{inspectToken:r.inspectToken}:{},createRuntime:async({botId:N,config:B,token:R})=>new _({config:B,token:R,harness:A,state:await $(N),replyTimeoutMs:t.replyTimeoutMs??6e5,connectTimeoutMs:t.connectTimeoutMs??2e4,logger:{error:(...de)=>w.error?.(`[${N}]`,...de),warn:(...de)=>w.warn?.(`[${N}]`,...de),info:(...de)=>w.info?.(`[${N}]`,...de),debug:(...de)=>w.debug?.(`[${N}]`,...de)}}),deleteState:async({botId:N})=>{let B=E.get(N);if(E.delete(N),B&&typeof B.remove=="function")return B.remove();try{await sE(F(N))}catch(R){if(R?.code!=="ENOENT")throw R}}}),M=b({channel:i,controller:G,harness:A,logger:w,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:G,ready:M.ready,async close(){await M.close(),await G.close(),A.stopManagedProcess()}}}function vc(n,t={},r={}){return Xo(n,t,r,{channel:"discord",ConfigStore:Mo,StateStore:Ko,HarnessClient:Ho,Controller:Ni,Runtime:Ui})}var mt=Object.freeze({status:"connection.status",bindCredentials:"bot.bind-credentials",reconnectBot:"bot.reconnect",deleteBot:"bot.delete"}),dE=Object.freeze(Object.values(mt)),cE=new Set(["token","botToken","tokenRef","platformId","secret","secretRef"]);function bc(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function Yo(n,t){return bc(n)&&Object.keys(n).every(r=>t.includes(r))}function Wg(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function lE(n){return typeof n=="string"&&n.trim().length>=20&&n.length<=4096}function pE(n,t){return bc(t)?n===mt.status?Yo(t,[])?null:"connection.status does not accept fields.":n===mt.bindCredentials?Yo(t,["token"])&&lE(t.token)?null:"bot.bind-credentials requires a Bot Token.":n===mt.reconnectBot?Yo(t,["botId"])&&Wg(t.botId)?null:"bot.reconnect requires a botId.":n===mt.deleteBot?Yo(t,["botId","confirm"])&&Wg(t.botId)&&t.confirm===!0?null:"bot.delete requires a botId and confirm=true.":"Unknown bot endpoint.":"Payload must be an object."}function _c(n){if(Array.isArray(n))return n.map(_c);if(!bc(n))return n;let t={};for(let[r,a]of Object.entries(n))cE.has(r)||(t[r]=_c(a));return t}function uE(n,t){return t?.code==="webhook-configured"?{code:"webhook-configured",message:t.message}:t?.code==="telegram-401"||t?.code==="discord-401"?{code:"invalid-token",message:`${n} Bot Token \u65E0\u6548\uFF0C\u8BF7\u91CD\u65B0\u586B\u5199\u3002`}:t?.code==="discord-intents"?{code:"discord-intents",message:t.message}:{code:`${n.toLowerCase()}-operation-failed`,message:`${n} \u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002`}}function wc(n,{channel:t}){for(let r of["status","bindCredentials","reconnectBot","deleteBot"])if(typeof n?.[r]!="function")throw new TypeError(`A complete ${t} controller is required (${r})`);return async(r,a,i)=>{if(i?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(!dE.includes(r))return{ok:!1,error:{code:"bad-request",message:`Unknown ${t} endpoint.`}};let s=pE(r,a);if(s)return{ok:!1,error:{code:"bad-request",message:s}};try{let o;return r===mt.status?o=await n.status():r===mt.bindCredentials?o=await n.bindCredentials(a):r===mt.reconnectBot?o=await n.reconnectBot(a.botId):o=await n.deleteBot(a.botId),i?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!0,value:_c(o)}}catch(o){return i?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!1,error:uE(t,o)}}}}function Zo(n,t,{channel:r,rpcChannel:a,authority:i}){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(a,wc(t,{channel:r}),{authority:pt(i)})}var Hg="/discord",Qg=mt,mE=Object.freeze(Object.values(Qg));function en(n,t,r){return Zo(n,t,{channel:"Discord",rpcChannel:Hg,authority:r})}async function Vg(n,t={}){if(t?.controller)return en(n,t.controller,t.rpcAuthority);let r=await vc(n,t,t.internals??{}),a=en(n,r.controller,t.rpcAuthority);return n.effect(()=>async()=>r.close(),"dsh-im: close Discord bot connections"),a}var fE=new Set(["starting","qr_ready","polling","slow_down","domain_switched"]);function yE(n){let t=n?.client_id??n?.appId,r=n?.client_secret??n?.appSecret;if(typeof t!="string"||t.length===0||typeof r!="string"||r.length===0)throw new TypeError("Feishu registration returned invalid credentials");return{appId:t,appSecret:r,userInfo:n?.user_info??n?.userInfo}}async function gE(n){return typeof n.status!="function"?{}:await n.status()}function vE(n){return n?.connected===!0?!0:n?.ready===!0&&n?.feishuLongConnectionState==="connected"&&n?.harnessReachable===!0}var tn=class{#t;#e;#r;#a;#n=!1;#o=null;constructor({createProvisioningManager:t,credentialStore:r,connectionManager:a,registrationOptions:i={}}={}){if(typeof t!="function")throw new TypeError("createProvisioningManager is required");if(!r||typeof r.save!="function"||typeof r.clear!="function")throw new TypeError("credentialStore.save/clear are required");if(!a||typeof a.connect!="function"||typeof a.disconnect!="function")throw new TypeError("connectionManager.connect/disconnect are required");if(i===null||typeof i!="object"||Array.isArray(i))throw new TypeError("registrationOptions must be an object");if(this.#t=r,this.#e=a,this.#r=structuredClone(i),this.#a=t({onCredentials:s=>this.#d(s)}),!this.#a||typeof this.#a.start!="function"||typeof this.#a.status!="function"||typeof this.#a.cancel!="function")throw new TypeError("The provisioning manager must implement start/status/cancel")}async startRegistration(){return this.#o=null,await this.#a.start(structuredClone(this.#r)),this.status()}async cancelRegistration(){return await this.#a.cancel(),this.status()}async disconnect(){await this.#a.cancel(),await this.#e.disconnect();try{await this.#t.clear(),this.#n=!1,this.#o=null}catch{this.#o={code:"credential_removal_failed",message:"Unable to remove the Feishu credentials."}}return this.status()}async status(){let t=await this.#a.status(),r=await gE(this.#e),a=vE(r),i=this.#n;if(typeof this.#t.configured=="function")try{i=await this.#t.configured()}catch{i=this.#n}let s="unconfigured";return a?s="connected":fE.has(t?.state)?s="registering":t?.state==="saving"?s="connecting":this.#o||t?.state==="error"?s="error":i&&(s="disconnected"),{phase:s,connected:a,configured:i,registration:t,connection:r,error:this.#o??t?.error??null}}async close(){await this.#a.cancel(),await this.#e.disconnect()}async#d(t){let r=yE(t);try{await this.#t.save(r),this.#n=!0,await this.#e.connect(r),this.#o=null}catch{throw this.#o={code:"connection_failed",message:"The bot was created, but its connection could not be started."},new Error("Unable to activate the Feishu connection.")}}};function Sc(n){return new tn(n)}import{homedir as OL}from"node:os";import{join as lo,resolve as ha}from"node:path";import{unlink as $L}from"node:fs/promises";var vy={};ig(vy,{AESCipher:()=>io,AccessTokenError:()=>gi,Aily:()=>Vf,AppType:()=>Nt,CAppTicket:()=>ao,CTenantAccessToken:()=>Ys,CardActionHandler:()=>Uf,Client:()=>jh,ClientAssertionError:()=>Qe,DefaultCache:()=>Rh,Domain:()=>Ut,EventDispatcher:()=>Gh,LarkChannel:()=>Wh,LarkChannelError:()=>me,LoggerLevel:()=>dt,LoggerProxy:()=>xr,WSClient:()=>Mh,adaptDefault:()=>hB,adaptExpress:()=>dB,adaptKoa:()=>cB,adaptKoaRouter:()=>lB,createLarkChannel:()=>KM,defaultHttpInstance:()=>vi,defaultLogger:()=>nr,generateChallenge:()=>oo,internalCache:()=>so,messageCard:()=>uB,normalize:()=>jT,normalizeBotAdded:()=>AT,normalizeCardAction:()=>RT,normalizeComment:()=>CT,normalizeReaction:()=>ny,registerApp:()=>kB,withAll:()=>rB,withHelpDeskCredential:()=>iB,withTenantKey:()=>aB,withTenantToken:()=>sB,withUserAccessToken:()=>oB});function Wi(n,t){return function(){return n.apply(t,arguments)}}var{toString:_E}=Object.prototype,{getPrototypeOf:Oa}=Object,{iterator:Qi,toStringTag:Xg}=Symbol,an=(({hasOwnProperty:n})=>(t,r)=>n.call(t,r))(Object.prototype),Hi=(n,t)=>{let r=n,a=[];for(;r!=null&&r!==Object.prototype;){if(a.indexOf(r)!==-1)return!1;if(a.push(r),an(r,t))return!0;r=Oa(r)}return!1},bE=(n,t)=>n!=null&&Hi(n,t)?n[t]:void 0,kc=(n=>t=>{let r=_E.call(t);return n[r]||(n[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ft=n=>(n=n.toLowerCase(),t=>kc(t)===n),sn=n=>t=>typeof t===n,{isArray:Ar}=Array,Cr=sn("undefined");function $a(n){return n!==null&&!Cr(n)&&n.constructor!==null&&!Cr(n.constructor)&&Ye(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}var Yg=ft("ArrayBuffer");function wE(n){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(n):t=n&&n.buffer&&Yg(n.buffer),t}var SE=sn("string"),Ye=sn("function"),Zg=sn("number"),za=n=>n!==null&&typeof n=="object",IE=n=>n===!0||n===!1,rn=n=>{if(!za(n))return!1;let t=Oa(n);return(t===null||t===Object.prototype||Oa(t)===null)&&!Hi(n,Xg)&&!Hi(n,Qi)},kE=n=>{if(!za(n)||$a(n))return!1;try{return Object.keys(n).length===0&&Object.getPrototypeOf(n)===Object.prototype}catch{return!1}},TE=ft("Date"),xE=ft("File"),PE=n=>!!(n&&typeof n.uri<"u"),qE=n=>n&&typeof n.getParts<"u",EE=ft("Blob"),FE=ft("FileList"),OE=ft("Set"),$E=n=>za(n)&&Ye(n.pipe);function zE(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}var Kg=zE(),Jg=typeof Kg.FormData<"u"?Kg.FormData:void 0,RE=n=>{if(!n)return!1;if(Jg&&n instanceof Jg)return!0;let t=Oa(n);if(!t||t===Object.prototype||!Ye(n.append))return!1;let r=kc(n);return r==="formdata"||r==="object"&&Ye(n.toString)&&n.toString()==="[object FormData]"},AE=ft("URLSearchParams"),[CE,jE,DE,GE]=["ReadableStream","Request","Response","Headers"].map(ft),BE=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Vi(n,t,{allOwnKeys:r=!1}={}){if(n===null||typeof n>"u")return;let a,i;if(typeof n!="object"&&(n=[n]),Ar(n))for(a=0,i=n.length;a0;)if(i=r[a],t===i.toLowerCase())return i;return null}var Rr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,tv=n=>!Cr(n)&&n!==Rr;function Ic(...n){let{caseless:t,skipUndefined:r}=tv(this)&&this||{},a={},i=(s,o)=>{if(o==="__proto__"||o==="constructor"||o==="prototype")return;let e=t&&typeof o=="string"&&ev(a,o)||o,y=an(a,e)?a[e]:void 0;rn(y)&&rn(s)?a[e]=Ic(y,s):rn(s)?a[e]=Ic({},s):Ar(s)?a[e]=s.slice():(!r||!Cr(s))&&(a[e]=s)};for(let s=0,o=n.length;s(Vi(t,(i,s)=>{r&&Ye(i)?Object.defineProperty(n,s,{__proto__:null,value:Wi(i,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(n,s,{__proto__:null,value:i,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:a}),n),LE=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),NE=(n,t,r,a)=>{n.prototype=Object.create(t.prototype,a),Object.defineProperty(n.prototype,"constructor",{__proto__:null,value:n,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(n,"super",{__proto__:null,value:t.prototype}),r&&Object.assign(n.prototype,r)},UE=(n,t,r,a)=>{let i,s,o,e={};if(t=t||{},n==null)return t;do{for(i=Object.getOwnPropertyNames(n),s=i.length;s-- >0;)o=i[s],(!a||a(o,n,t))&&!e[o]&&(t[o]=n[o],e[o]=!0);n=r!==!1&&Oa(n)}while(n&&(!r||r(n,t))&&n!==Object.prototype);return t},WE=(n,t,r)=>{n=String(n),(r===void 0||r>n.length)&&(r=n.length),r-=t.length;let a=n.indexOf(t,r);return a!==-1&&a===r},HE=n=>{if(!n)return null;if(Ar(n))return n;let t=n.length;if(!Zg(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=n[t];return r},QE=(n=>t=>n&&t instanceof n)(typeof Uint8Array<"u"&&Oa(Uint8Array)),VE=(n,t)=>{let a=(n&&n[Qi]).call(n),i;for(;(i=a.next())&&!i.done;){let s=i.value;t.call(n,s[0],s[1])}},KE=(n,t)=>{let r,a=[];for(;(r=n.exec(t))!==null;)a.push(r);return a},JE=ft("HTMLFormElement"),XE=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,a,i){return a.toUpperCase()+i}),{propertyIsEnumerable:YE}=Object.prototype,ZE=ft("RegExp"),rv=(n,t)=>{let r=Object.getOwnPropertyDescriptors(n),a={};Vi(r,(i,s)=>{let o;(o=t(i,s,n))!==!1&&(a[s]=o||i)}),Object.defineProperties(n,a)},eF=n=>{rv(n,(t,r)=>{if(Ye(n)&&["arguments","caller","callee"].includes(r))return!1;let a=n[r];if(Ye(a)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},tF=(n,t)=>{let r={},a=i=>{i.forEach(s=>{r[s]=!0})};return Ar(n)?a(n):a(String(n).split(t)),r},rF=()=>{},aF=(n,t)=>n!=null&&Number.isFinite(n=+n)?n:t;function iF(n){return!!(n&&Ye(n.append)&&n[Xg]==="FormData"&&n[Qi])}var sF=n=>{let t=new WeakSet,r=a=>{if(za(a)){if(t.has(a))return;if($a(a))return a;if(!("toJSON"in a)){t.add(a);let i;if(OE(a)){i=[];for(let s of a){let o=r(s);!Cr(o)&&i.push(o)}}else i=Ar(a)?[]:{},Vi(a,(s,o)=>{let e=r(s);!Cr(e)&&(i[o]=e)});return t.delete(a),i}}return a};return r(n)},oF=ft("AsyncFunction"),nF=n=>n&&(za(n)||Ye(n))&&Ye(n.then)&&Ye(n.catch),av=((n,t)=>n?setImmediate:t?((r,a)=>(Rr.addEventListener("message",({source:i,data:s})=>{i===Rr&&s===r&&a.length&&a.shift()()},!1),i=>{a.push(i),Rr.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Ye(Rr.postMessage)),hF=typeof queueMicrotask<"u"?queueMicrotask.bind(Rr):typeof process<"u"&&process.nextTick||av,iv=n=>n!=null&&Ye(n[Qi]),dF=n=>n!=null&&Hi(n,Qi)&&iv(n),q={isArray:Ar,isArrayBuffer:Yg,isBuffer:$a,isFormData:RE,isArrayBufferView:wE,isString:SE,isNumber:Zg,isBoolean:IE,isObject:za,isPlainObject:rn,isEmptyObject:kE,isReadableStream:CE,isRequest:jE,isResponse:DE,isHeaders:GE,isUndefined:Cr,isDate:TE,isFile:xE,isReactNativeBlob:PE,isReactNative:qE,isBlob:EE,isRegExp:ZE,isFunction:Ye,isStream:$E,isURLSearchParams:AE,isTypedArray:QE,isFileList:FE,forEach:Vi,merge:Ic,extend:ME,trim:BE,stripBOM:LE,inherits:NE,toFlatObject:UE,kindOf:kc,kindOfTest:ft,endsWith:WE,toArray:HE,forEachEntry:VE,matchAll:KE,isHTMLForm:JE,hasOwnProperty:an,hasOwnProp:an,hasOwnInPrototypeChain:Hi,getSafeProp:bE,reduceDescriptors:rv,freezeMethods:eF,toObjectSet:tF,toCamelCase:XE,noop:rF,toFiniteNumber:aF,findKey:ev,global:Rr,isContextDefined:tv,isSpecCompliantForm:iF,toJSONObject:sF,isAsyncFn:oF,isThenable:nF,setImmediate:av,asap:hF,isIterable:iv,isSafeIterable:dF};var cF=q.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),sv=n=>{let t={},r,a,i;return n&&n.split(` +`).forEach(function(o){i=o.indexOf(":"),r=o.substring(0,i).trim().toLowerCase(),a=o.substring(i+1).trim();let e=q.hasOwnProp(t,r);!r||e&&q.hasOwnProp(cF,r)||(r==="set-cookie"?e?t[r].push(a):t[r]=[a]:t[r]=e?t[r]+", "+a:a)}),t};function lF(n){let t=0,r=n.length;for(;tt;){let a=n.charCodeAt(r-1);if(a!==9&&a!==32)break;r-=1}return t===0&&r===n.length?n:n.slice(t,r)}var pF=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),uF=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Tc(n,t){return q.isArray(n)?n.map(r=>Tc(r,t)):lF(String(n).replace(t,""))}var ov=n=>Tc(n,pF),mF=n=>Tc(n,uF);function Ra(n){let t=Object.create(null);return q.forEach(n.toJSON(),(r,a)=>{t[a]=mF(r)}),t}var nv=Symbol("internals");function Ki(n){return n&&String(n).trim().toLowerCase()}function on(n){return n===!1||n==null?n:q.isArray(n)?n.map(on):ov(String(n))}function fF(n){let t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,a;for(;a=r.exec(n);)t[a[1]]=a[2];return t}var yF=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function xc(n){let t=0,r=n.length;for(;tt;){let a=n.charCodeAt(r-1);if(a!==9&&a!==32)break;r-=1}return t===0&&r===n.length?n:n.slice(t,r)}function gF(n){let t=n.length-1;if(t<1||n.charCodeAt(0)!==34||n.charCodeAt(t)!==34)return n;let r="";for(let a=1;a=t))return n;r+=n[a]}return r}function vF(n){let t=Object.create(null),r=String(n),a=0,i=!1,s=!1;function o(e){let y=xc(r.slice(a,e)),u=y.indexOf("=");if(u<1)return;let f=xc(y.slice(0,u));if(!yF.test(f))return;let d=f.toLowerCase();if(d==="__proto__"||d==="constructor"||d==="prototype")return;let m=xc(y.slice(u+1));t[d]=gF(m)}for(let e=0;e/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function Pc(n,t,r,a,i){if(q.isFunction(a))return a.call(this,t,r);if(i&&(t=r),!!q.isString(t)){if(q.isString(a))return t.indexOf(a)!==-1;if(q.isRegExp(a))return a.test(t)}}function bF(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,a)=>r.toUpperCase()+a)}function wF(n,t){let r=q.toCamelCase(" "+t);["get","set","has"].forEach(a=>{Object.defineProperty(n,a+r,{__proto__:null,value:function(i,s,o){return this[a].call(this,t,i,s,o)},configurable:!0})})}var Aa=class{constructor(t){t&&this.set(t)}set(t,r,a){let i=this;function s(e,y,u){let f=Ki(y);if(!f)return;let d=q.findKey(i,f);(!d||i[d]===void 0||u===!0||u===void 0&&i[d]!==!1)&&(i[d||y]=on(e))}let o=(e,y)=>q.forEach(e,(u,f)=>s(u,f,y));if(q.isPlainObject(t)||t instanceof this.constructor)o(t,r);else if(q.isString(t)&&(t=t.trim())&&!_F(t))o(sv(t),r);else if(q.isObject(t)&&q.isSafeIterable(t)){let e=Object.create(null),y,u;for(let f of t){if(!q.isArray(f))throw new TypeError("Object iterator must return a key-value pair");u=f[0],q.hasOwnProp(e,u)?(y=e[u],e[u]=q.isArray(y)?[...y,f[1]]:[y,f[1]]):e[u]=f[1]}o(e,r)}else t!=null&&s(r,t,a);return this}get(t,r){if(t=Ki(t),t){let a=q.findKey(this,t);if(a){let i=this[a];if(!r)return i;if(r===!0)return fF(i);if(q.isFunction(r))return r.call(this,i,a);if(q.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Ki(t),t){let a=q.findKey(this,t);return!!(a&&this[a]!==void 0&&(!r||Pc(this,this[a],a,r)))}return!1}delete(t,r){let a=this,i=!1;function s(o){if(o=Ki(o),o){let e=q.findKey(a,o);e&&(!r||Pc(a,a[e],e,r))&&(delete a[e],i=!0)}}return q.isArray(t)?t.forEach(s):s(t),i}clear(t){let r=Object.keys(this),a=r.length,i=!1;for(;a--;){let s=r[a];(!t||Pc(this,this[s],s,t,!0))&&(delete this[s],i=!0)}return i}normalize(t){let r=this,a={};return q.forEach(this,(i,s)=>{let o=q.findKey(a,s);if(o){r[o]=on(i),delete r[s];return}let e=t?bF(s):String(s).trim();e!==s&&delete r[s],r[e]=on(i),a[e]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let r=Object.create(null);return q.forEach(this,(a,i)=>{a!=null&&a!==!1&&(r[i]=t&&q.isArray(a)?a.join(", "):a)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(` +`)}getSetCookie(){let t=this.get("set-cookie");return q.isArray(t)?t:t==null||t===!1?[]:[t]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static parseParameters(t){return vF(t)}static concat(t,...r){let a=new this(t);return r.forEach(i=>a.set(i)),a}static accessor(t){let a=(this[nv]=this[nv]={accessors:{}}).accessors,i=this.prototype;function s(o){let e=Ki(o);a[e]||(wF(i,o),a[e]=!0)}return q.isArray(t)?t.forEach(s):s(t),this}};Aa.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);q.reduceDescriptors(Aa.prototype,({value:n},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(a){this[r]=a}}});q.freezeMethods(Aa);var ge=Aa;var Ji="[REDACTED ****]";function SF(n){if(q.hasOwnProp(n,"toJSON"))return!0;let t=Object.getPrototypeOf(n);for(;t&&t!==Object.prototype;){if(q.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function IF(n,t){let r=new Set(t.map(s=>String(s).toLowerCase())),a=[],i=s=>{if(s===null||typeof s!="object"||q.isBuffer(s))return s;if(a.indexOf(s)!==-1)return;s instanceof ge&&(s=s.toJSON()),a.push(s);let o;if(q.isArray(s))o=[],s.forEach((e,y)=>{let u=i(e);q.isUndefined(u)||(o[y]=u)});else{if(!q.isPlainObject(s)&&SF(s))return a.pop(),s;o=Object.create(null);for(let[e,y]of Object.entries(s)){let u=r.has(e.toLowerCase())?Ji:i(y);q.isUndefined(u)||(o[e]=u)}}return a.pop(),o};return i(n)}function hv(n){try{return String(n)}catch{return""}}function kF(n){return n.errors.map(r=>{try{return r&&r.message?hv(r.message):hv(r)}catch{return""}}).filter(Boolean).join("; ")||n.name||"AggregateError"}var Le=class n extends Error{static from(t,r,a,i,s,o){let e=t.message;!e&&q.isArray(t.errors)&&t.errors.length&&(e=kF(t));let y=new n(e,r||t.code,a,i,s);return Object.defineProperty(y,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),y.name=t.name,t.status!=null&&y.status==null&&(y.status=t.status),o&&Object.assign(y,o),y}constructor(t,r,a,i,s){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),a&&(this.config=a),i&&(this.request=i),s&&(this.response=s,this.status=s.status)}toJSON(){let t=this.config,r=t&&q.hasOwnProp(t,"redact")?t.redact:void 0,a=q.isArray(r)&&r.length>0?IF(t,r):q.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a,code:this.code,status:this.status}}};Le.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";Le.ERR_BAD_OPTION="ERR_BAD_OPTION";Le.ECONNABORTED="ECONNABORTED";Le.ETIMEDOUT="ETIMEDOUT";Le.ECONNREFUSED="ECONNREFUSED";Le.ERR_NETWORK="ERR_NETWORK";Le.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";Le.ERR_DEPRECATED="ERR_DEPRECATED";Le.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";Le.ERR_BAD_REQUEST="ERR_BAD_REQUEST";Le.ERR_CANCELED="ERR_CANCELED";Le.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";Le.ERR_INVALID_URL="ERR_INVALID_URL";Le.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";var C=Le;var c0=Ve(d0(),1),yn=c0.default;var gn={isBufferAvailable(){return typeof Buffer<"u"},from(n){return Buffer.from(n)}};var Xc=100;function Jc(n){return q.isPlainObject(n)||q.isArray(n)}function l0(n){return q.endsWith(n,"[]")?n.slice(0,-2):n}function Kc(n,t,r){return n?n.concat(t).map(function(i,s){return i=l0(i),!r&&s?"["+i+"]":i}).join(r?".":""):t}function dO(n){return q.isArray(n)&&!n.some(Jc)}var cO=q.toFlatObject(q,{},null,function(t){return/^is[A-Z]/.test(t)});function lO(n,t,r){if(!q.isObject(n))throw new TypeError("target must be an object");t=t||new(yn||FormData),r=q.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(O,E){return!q.isUndefined(E[O])});let a=r.metaTokens,i=r.visitor||_,s=r.dots,o=r.indexes,e=r.Blob||typeof Blob<"u"&&Blob,y=r.maxDepth===void 0?Xc:r.maxDepth,u=e&&q.isSpecCompliantForm(t),f=[];if(!q.isFunction(i))throw new TypeError("visitor must be a function");function d(S){if(S===null)return"";if(q.isDate(S))return S.toISOString();if(q.isBoolean(S))return S.toString();if(!u&&q.isBlob(S))throw new C("Blob is not supported. Use a Buffer instead.");if(q.isArrayBuffer(S)||q.isTypedArray(S)){if(u&&typeof e=="function")return new e([S]);if(gn&&gn.isBufferAvailable())return gn.from(S);throw new C("Blob is not supported. Use a Buffer instead.",C.ERR_NOT_SUPPORT)}return S}function m(S){if(S>y)throw new C("Object is too deeply nested ("+S+" levels). Max depth: "+y,C.ERR_FORM_DATA_DEPTH_EXCEEDED)}function g(S,O){if(y===1/0)return JSON.stringify(S);let E=[];return JSON.stringify(S,function($,A){if(!q.isObject(A))return A;for(;E.length&&E[E.length-1]!==this;)E.pop();return E.push(A),m(O+E.length-1),A})}function _(S,O,E){let F=S;if(q.isReactNative(t)&&q.isReactNativeBlob(S))return t.append(Kc(E,O,s),d(S)),!1;if(S&&!E&&typeof S=="object"){if(q.endsWith(O,"{}"))O=a?O:O.slice(0,-2),S=g(S,1);else if(q.isArray(S)&&dO(S)||(q.isFileList(S)||q.endsWith(O,"[]"))&&(F=q.toArray(S)))return O=l0(O),F.forEach(function(A,G){!(q.isUndefined(A)||A===null)&&t.append(o===!0?Kc([O],G,s):o===null?O:O+"[]",d(A))}),!1}return Jc(S)?!0:(t.append(Kc(E,O,s),d(S)),!1)}let b=Object.assign(cO,{defaultVisitor:_,convertValue:d,isVisitable:Jc});function w(S,O,E=0){if(!q.isUndefined(S)){if(m(E),f.indexOf(S)!==-1)throw new Error("Circular reference detected in "+O.join("."));f.push(S),q.forEach(S,function($,A){(!(q.isUndefined($)||$===null)&&i.call(t,$,q.isString(A)?A.trim():A,O,b))===!0&&w($,O?O.concat(A):[A],E+1)}),f.pop()}}if(!q.isObject(n))throw new TypeError("data must be an object");return w(n),t}var ur=lO;function p0(n){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(n).replace(/[!'()~]|%20/g,function(a){return t[a]})}function u0(n,t){this._pairs=[],n&&ur(n,this,t)}var m0=u0.prototype;m0.append=function(t,r){this._pairs.push([t,r])};m0.toString=function(t){let r=t?a=>t.call(this,a,p0):p0;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};var f0=u0;function pO(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Dr(n,t,r){if(!t)return n;n=n||"";let a=q.isFunction(r)?{serialize:r}:r,i=q.getSafeProp(a,"encode")||pO,s=q.getSafeProp(a,"serialize"),o;if(s?o=s(t,a):o=q.isURLSearchParams(t)?t.toString():new f0(t,a).toString(i),o){let e=n.indexOf("#");e!==-1&&(n=n.slice(0,e)),n+=(n.indexOf("?")===-1?"?":"&")+o}return n}var Yc=class{constructor(){this.handlers=[]}use(t,r,a){return this.handlers.push({fulfilled:t,rejected:r,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){q.forEach(this.handlers,function(a){a!==null&&t(a)})}},Zc=Yc;var mr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0};import mO from"crypto";import uO from"url";var y0=uO.URLSearchParams;var el="abcdefghijklmnopqrstuvwxyz",g0="0123456789",v0={DIGIT:g0,ALPHA:el,ALPHA_DIGIT:el+el.toUpperCase()+g0},fO=(n=16,t=v0.ALPHA_DIGIT)=>{let r="",{length:a}=t,i=new Uint32Array(n);mO.randomFillSync(i);for(let s=0;srl,hasStandardBrowserEnv:()=>yO,hasStandardBrowserWebWorkerEnv:()=>gO,navigator:()=>tl,origin:()=>vO});var rl=typeof window<"u"&&typeof document<"u",tl=typeof navigator=="object"&&navigator||void 0,yO=rl&&(!tl||["ReactNative","NativeScript","NS"].indexOf(tl.product)<0),gO=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",vO=rl&&window.location.href||"http://localhost";var oe={...al,..._0};function il(n,t){return ur(n,new oe.classes.URLSearchParams,{visitor:function(r,a,i,s){return oe.isNode&&q.isBuffer(r)?(this.append(a,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}var b0=Xc;function w0(n){if(n>b0)throw new C("FormData field is too deeply nested ("+n+" levels). Max depth: "+b0,C.ERR_FORM_DATA_DEPTH_EXCEEDED)}function _O(n){let t=[],r=/[^.[\]]+|\[([^.[\]]*)]/g,a;for(;(a=r.exec(n))!==null;)w0(t.length),t.push(a[0]==="[]"?"":a[1]||a[0]);return t}function bO(n){let t={},r=Object.keys(n),a,i=r.length,s;for(a=0;a=r.length;return o=!o&&q.isArray(i)?i.length:o,y?(q.hasOwnProp(i,o)?i[o]=q.isArray(i[o])?i[o].concat(a):[i[o],a]:i[o]=a,!e):((!q.hasOwnProp(i,o)||!q.isObject(i[o]))&&(i[o]=[]),t(r,a,i[o],s)&&q.isArray(i[o])&&(i[o]=bO(i[o])),!e)}if(q.isFormData(n)&&q.isFunction(n.entries)){let r={};return q.forEachEntry(n,(a,i)=>{t(_O(a),i,r,0)}),r}return null}var vn=wO;var Ba=(n,t)=>n!=null&&q.hasOwnProp(n,t)?n[t]:void 0;function SO(n,t,r){if(q.isString(n))try{return(t||JSON.parse)(n),q.trim(n)}catch(a){if(a.name!=="SyntaxError")throw a}return(r||JSON.stringify)(n)}var sl={transitional:mr,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let a=r.getContentType()||"",i=a.indexOf("application/json")>-1,s=q.isObject(t);if(s&&q.isHTMLForm(t)&&(t=new FormData(t)),q.isFormData(t))return i?JSON.stringify(vn(t)):t;if(q.isArrayBuffer(t)||q.isBuffer(t)||q.isStream(t)||q.isFile(t)||q.isBlob(t)||q.isReadableStream(t))return t;if(q.isArrayBufferView(t))return t.buffer;if(q.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let e;if(s){let y=Ba(this,"formSerializer");if(a.indexOf("application/x-www-form-urlencoded")>-1)return il(t,y).toString();if((e=q.isFileList(t))||a.indexOf("multipart/form-data")>-1){let u=Ba(this,"env"),f=u&&u.FormData;return ur(e?{"files[]":t}:t,f&&new f,y)}}return s||i?(r.setContentType("application/json",!1),SO(t)):t}],transformResponse:[function(t){let r=Ba(this,"transitional")||sl.transitional,a=r&&r.forcedJSONParsing,i=Ba(this,"responseType"),s=i==="json";if(q.isResponse(t)||q.isReadableStream(t))return t;if(t&&q.isString(t)&&(a&&!i||s)){let e=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(t,Ba(this,"parseReviver"))}catch(y){if(e)throw y.name==="SyntaxError"?C.from(y,C.ERR_BAD_RESPONSE,this,null,Ba(this,"response")):y}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:oe.classes.FormData,Blob:oe.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};q.forEach(["delete","get","head","post","put","patch","query"],n=>{sl.headers[n]={}});var Ma=sl;function rs(n,t){let r=this||Ma,a=t||r,i=ge.from(a.headers),s=a.data;return q.forEach(n,function(e){s=e.call(r,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function as(n){return!!(n&&n.__CANCEL__)}var ol=class extends C{constructor(t,r,a){super(t??"canceled",C.ERR_CANCELED,r,a),this.name="CanceledError",this.__CANCEL__=!0}},st=ol;function At(n,t,r){let a=r.config.validateStatus;!r.status||!a||a(r.status)?n(r):t(new C("Request failed with status code "+r.status,r.status>=400&&r.status<500?C.ERR_BAD_REQUEST:C.ERR_BAD_RESPONSE,r.config,r.request,r))}function nl(n){return typeof n!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function hl(n,t){if(!t)return n;let r=n.length;for(;r>0&&n.charCodeAt(r-1)===47;)r--;return n.slice(0,r)+"/"+t.replace(/^\/+/,"")}var IO=/^https?:(?!\/\/)/i,kO=/[\t\n\r]/g;function TO(n){let t=0;for(;t`${r}${a}${Ji}`)}function qO(n){let t=n.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${Ji}@`),r=t.indexOf("#"),i=(r===-1?t:t.slice(0,r)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${Ji}`);return r===-1?i:`${i}#${PO(t.slice(r+1))}`}function S0(n,t){if(typeof n=="string"){let r=xO(n);if(IO.test(r))throw new C(`Invalid URL ${JSON.stringify(qO(r))}: missing "//" after protocol`,C.ERR_INVALID_URL,t)}}function Gr(n,t,r,a){S0(t,a);let i=!nl(t);return n&&(i||r===!1)?(S0(n,a),hl(n,t)):t}var EO={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};function FO(n){try{return new URL(n)}catch{return null}}function I0(n){var t=(typeof n=="string"?FO(n):n)||{},r=t.protocol,a=t.host,i=t.port;if(typeof a!="string"||!a||typeof r!="string"||(r=r.split(":",1)[0],a=a.replace(/:\d*$/,""),i=parseInt(i)||EO[r]||0,!OO(a,i)))return"";var s=dl(r+"_proxy")||dl("all_proxy");return s&&s.indexOf("://")===-1&&(s=r+"://"+s),s}function OO(n,t){var r=dl("no_proxy").toLowerCase();return r?r==="*"?!1:r.split(/[,\s]/).every(function(a){if(!a)return!0;var i=a.match(/^(.+):(\d+)$/),s=i?i[1]:a,o=i?parseInt(i[2]):0;return o&&o!==t?!0:/^[.*]/.test(s)?(s.charAt(0)==="*"&&(s=s.slice(1)),!n.endsWith(s)):n!==s}):!0}function dl(n){return process.env[n.toLowerCase()]||process.env[n.toUpperCase()]||""}var Ll=Ve(G0(),1),wb=Ve(H0(),1);import _b from"http";import bb from"https";import oz from"http2";import nz from"util";import{resolve as db}from"path";import yt from"zlib";var Vt="1.19.0";function us(n){let t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(n);return t&&t[1]||""}var O$=/^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/;function Ol(n,t,r){let a=r&&r.Blob||oe.classes.Blob,i=us(n);if(t===void 0&&a&&(t=!0),i==="data"){n=i.length?n.slice(i.length+1):n;let s=O$.exec(n);if(!s)throw new C("Invalid URL",C.ERR_INVALID_URL);let o=s[1],e=s[2],y=s[3]?"base64":"utf8",u=s[4],f="";o?f=e?o+e:o:e&&(f="text/plain"+e);let d=y==="base64"?Buffer.from(u,"base64"):Buffer.from(decodeURIComponent(u),y);if(t){if(!a)throw new C("Blob is not supported",C.ERR_NOT_SUPPORT);return new a([d],{type:f})}return d}throw new C("Unsupported protocol "+i,C.ERR_NOT_SUPPORT)}import xt from"stream";var $$=["content-type","content-length"];function ms(n,t,r){if(r!=="content-only"){n.set(t);return}Object.entries(t||{}).forEach(([a,i])=>{$$.includes(a.toLowerCase())&&n.set(a,i)})}import z$ from"stream";var $l=Symbol("internals"),zl=class extends z$.Transform{constructor(t){t=q.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(a,i)=>!q.isUndefined(i[a])),super({readableHighWaterMark:t.chunkSize});let r=this[$l]={timeWindow:t.timeWindow,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",a=>{a==="progress"&&(r.isCaptured||(r.isCaptured=!0))})}_read(t){let r=this[$l];return r.onReadCallback&&r.onReadCallback(),super._read(t)}_transform(t,r,a){let i=this[$l],s=i.maxRate,o=this.readableHighWaterMark,e=i.timeWindow,y=1e3/e,u=s/y,f=i.minChunkSize!==!1?Math.max(i.minChunkSize,u*.01):0,d=(g,_)=>{let b=Buffer.byteLength(g);i.bytesSeen+=b,i.bytes+=b,i.isCaptured&&this.emit("progress",i.bytesSeen),this.push(g)?process.nextTick(_):i.onReadCallback=()=>{i.onReadCallback=null,process.nextTick(_)}},m=(g,_)=>{let b=Buffer.byteLength(g),w=null,S=o,O,E=0;if(s){let F=Date.now();(!i.ts||(E=F-i.ts)>=e)&&(i.ts=F,O=u-i.bytes,i.bytes=O<0?-O:0,E=0),O=u-i.bytes}if(s){if(O<=0)return setTimeout(()=>{_(null,g)},e-E);OS&&b-S>f&&(w=g.subarray(S),g=g.subarray(0,S)),d(g,w?()=>{process.nextTick(_,null,w)}:_)};m(t,function g(_,b){if(_)return a(_);b?m(b,g):a(null)})}},Rl=zl;import{EventEmitter as hz}from"events";import A$ from"util";import{Readable as C$}from"stream";var{asyncIterator:Q0}=Symbol,R$=async function*(n){n.stream?yield*n.stream():n.arrayBuffer?yield await n.arrayBuffer():n[Q0]?yield*n[Q0]():yield n},kn=R$;var j$=oe.ALPHABET.ALPHA_DIGIT+"-_",fs=typeof TextEncoder=="function"?new TextEncoder:new A$.TextEncoder,Ur=`\r +`,D$=fs.encode(Ur),G$=2,Al=class{constructor(t,r){let{escapeName:a}=this.constructor,i=q.isString(r),s=`Content-Disposition: form-data; name="${a(t)}"${!i&&r.name?`; filename="${a(r.name)}"`:""}${Ur}`;if(i)r=fs.encode(String(r).replace(/\r?\n|\r\n?/g,Ur));else{let o=String(r.type||"application/octet-stream").replace(/[\r\n]/g,"");s+=`Content-Type: ${o}${Ur}`}this.headers=fs.encode(s+Ur),this.contentLength=i?r.byteLength:r.size,this.size=this.headers.byteLength+this.contentLength+G$,this.name=t,this.value=r}async*encode(){yield this.headers;let{value:t}=this;q.isTypedArray(t)?yield t:yield*kn(t),yield D$}static escapeName(t){return String(t).replace(/[\r\n"]/g,r=>({"\r":"%0D","\n":"%0A",'"':"%22"})[r])}},B$=(n,t,r)=>{let{tag:a="form-data-boundary",size:i=25,boundary:s=a+"-"+oe.generateString(i,j$)}=r||{};if(!q.isFormData(n))throw new TypeError("FormData instance required");if(s.length<1||s.length>70)throw new Error("boundary must be 1-70 characters long");let o=fs.encode("--"+s+Ur),e=fs.encode("--"+s+"--"+Ur),y=e.byteLength,u=Array.from(n.entries()).map(([d,m])=>{let g=new Al(d,m);return y+=g.size,g});y+=o.byteLength*u.length,y=q.toFiniteNumber(y);let f={"Content-Type":`multipart/form-data; boundary=${s}`};return Number.isFinite(y)&&(f["Content-Length"]=y),t&&t(f),C$.from((async function*(){for(let d of u)yield o,yield*d.encode();yield e})())},V0=B$;import M$ from"stream";var Cl=class extends M$.Transform{__transform(t,r,a){this.push(t),a()}_transform(t,r,a){if(t.length!==0&&(this._transform=this.__transform,t[0]!==120)){let i=Buffer.alloc(2);i[0]=120,i[1]=156,this.push(i,r)}this.__transform(t,r,a)}},K0=Cl;import L$ from"http2";import N$ from"util";var jl=class{constructor(){this.sessions=Object.create(null)}getSession(t,r){r=Object.assign({sessionTimeout:1e3},r);let a=this.sessions[t];if(a){let d=a.length;for(let m=0;m{if(s)return;s=!0,o&&(clearTimeout(o),o=null);let d=a,m=d.length,g=m;for(;g--;)if(d[g][0]===i){m===1?delete this.sessions[t]:d.splice(g,1),i.closed||i.close();return}},y=i.request,{sessionTimeout:u}=r;if(u!=null){let d=0;i.request=function(){let m=y.apply(this,arguments);return d++,o&&(clearTimeout(o),o=null),m.once("close",()=>{--d||(o=setTimeout(()=>{o=null,e()},u))}),m}}i.once("close",e);let f=[i,r];return a?a.push(f):a=this.sessions[t]=[f],i}},J0=jl;var U$=(n,t)=>q.isAsyncFn(n)?function(...r){let a=r.pop();n.apply(this,r).then(i=>{try{t?a(null,...t(i)):a(null,i)}catch(s){a(s)}},a)}:n,X0=U$;var W$=new Set(["localhost","0.0.0.0"]),eb=n=>{let t=n.split(".");return t.length!==4||t[0]!=="127"?!1:t.every(r=>/^\d+$/.test(r)&&Number(r)>=0&&Number(r)<=255)},Dl=n=>{if(/^0[xX][0-9a-fA-F]+$/.test(n)){let t=parseInt(n.slice(2),16);return Number.isFinite(t)?t:null}if(n.length>1&&/^0[0-7]+$/.test(n)){let t=parseInt(n,8);return Number.isFinite(t)?t:null}if(n.length>1&&/^0[0-9]+$/.test(n))return null;if(/^[0-9]+$/.test(n)){let t=parseInt(n,10);return Number.isFinite(t)?t:null}return null},H$=n=>{if(typeof n!="string"||!n||n.indexOf(":")!==-1)return n;let t=n;if(t.charAt(0)==="["&&t.charAt(t.length-1)==="]"&&(t=t.slice(1,-1)),t=t.replace(/\.+$/,""),!/^[0-9.xXa-fA-F]+$/.test(t))return n;let r=t.split(".");if(r.some(f=>f===""))return n;if(r.length===4){let f=r.map(Dl);return f.some(d=>d===null||d<0||d>255)?n:f.join(".")}if(r.length>4||r.length===1)return n;let a=r.slice(0,-1),i=r[r.length-1],s=4-a.length,o=Dl(i);if(o===null)return n;let e=(1<<8*s)-1;if(o<0||o>e)return n;let y=new Array(s).fill(0);for(let f=s-1,d=o;f>=0;f--,d>>=8)y[f]=d&255;let u=a.map(Dl);return u.some(f=>f===null||f<0||f>255)?n:[...u,...y].join(".")},Gl=n=>/^0{1,4}$/.test(n),Q$=n=>{if(n==="::")return!0;let t=n.indexOf("::");if(t!==-1){if(t!==n.lastIndexOf("::"))return!1;let a=n.slice(0,t),i=n.slice(t+2),s=a?a.split(":"):[],o=i?i.split(":"):[];return s.length+o.length<8&&s.every(Gl)&&o.every(Gl)}let r=n.split(":");return r.length===8&&r.every(Gl)},V$=n=>{if(n==="::1")return!0;let t=n.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);if(t)return eb(t[1]);let r=n.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i);if(r){let i=parseInt(r[1],16);return i>=32512&&i<=32767}let a=n.split(":");if(a.length===8){for(let i=0;i<7;i++)if(!/^0+$/.test(a[i]))return!1;return/^0*1$/.test(a[7])}return!1},Y0=n=>n?W$.has(n)||eb(n)||Q$(n)?!0:V$(n):!1,K$={http:80,https:443,ws:80,wss:443,ftp:21},J$=n=>{let t=n,r=0;if(t.charAt(0)==="["){let s=t.indexOf("]");if(s!==-1){let o=t.slice(1,s),e=t.slice(s+1);return e.charAt(0)===":"&&/^\d+$/.test(e.slice(1))&&(r=Number.parseInt(e.slice(1),10)),[o,r]}}let a=t.indexOf(":"),i=t.lastIndexOf(":");return a!==-1&&a===i&&/^\d+$/.test(t.slice(i+1))&&(r=Number.parseInt(t.slice(i+1),10),t=t.slice(0,i)),[t,r]},X$=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:(\d+\.\d+\.\d+\.\d+)$/i,Y$=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i,Z$=n=>{if(typeof n!="string"||n.indexOf(":")===-1)return n;let t=n.match(X$);if(t)return t[1];let r=n.match(Y$);if(r){let a=parseInt(r[1],16),i=parseInt(r[2],16);return`${a>>8}.${a&255}.${i>>8}.${i&255}`}return n},Z0=n=>{if(!n)return n;n.charAt(0)==="["&&n.charAt(n.length-1)==="]"&&(n=n.slice(1,-1));let t=n.replace(/\.+$/,""),r=H$(t);return r!==t?r:Z$(t)};function Bl(n){let t;try{t=new URL(n)}catch{return!1}let r=(process.env.no_proxy||process.env.NO_PROXY||"").toLowerCase();if(!r)return!1;if(r==="*")return!0;let a=Number.parseInt(t.port,10)||K$[t.protocol.split(":",1)[0]]||0,i=Z0(t.hostname.toLowerCase());return r.split(/[\s,]+/).some(s=>{if(!s)return!1;if(s==="*")return!0;let[o,e]=J$(s);return o=Z0(o),!o||e&&e!==a?!1:(o.charAt(0)==="*"&&(o=o.slice(1)),o.charAt(0)==="."?i.endsWith(o):i===o||Y0(i)&&Y0(o))})}function ez(n,t){n=n||10;let r=new Array(n),a=new Array(n),i=0,s=0,o;return t=t!==void 0?t:1e3,function(y){let u=Date.now(),f=a[s];o||(o=u),r[i]=y,a[i]=u;let d=s,m=0;for(;d!==i;)m+=r[d++],d=d%n;if(i=(i+1)%n,i===s&&(s=(s+1)%n),u-o{r=f,i=null,s&&(clearTimeout(s),s=null),n(...u)};return[(...u)=>{let f=Date.now(),d=f-r;d>=a?o(u,f):(i=u,s||(s=setTimeout(()=>{s=null,o(i)},a-d)))},()=>i&&o(i)]}var rb=tz;var Kt=(n,t,r=3)=>{let a=0,i=tb(50,250);return rb(s=>{if(!s||typeof s.loaded!="number")return;let o=s.loaded,e=s.lengthComputable?s.total:void 0,y=Math.max(0,e!=null?Math.min(o,e):o),u=Math.max(0,y-a),f=i(u);a=Math.max(a,y);let d={loaded:y,total:e,progress:e?y/e:void 0,bytes:u,rate:f||void 0,estimated:f&&e?(e-y)/f:void 0,event:s,lengthComputable:e!=null,[t?"download":"upload"]:!0};n(d)},r)},Ha=(n,t)=>{let r=n!=null;return[a=>t[0]({lengthComputable:r,total:n,loaded:a}),t[1]]},Qa=(n,t=q.asap)=>(...r)=>t(()=>n(...r));var ab=n=>n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102,sb=(n,t,r)=>t+2n<=57?n-48:(n&223)-55,rz=n=>n>=65&&n<=90||n>=97&&n<=122||n>=48&&n<=57||n===43||n===47||n===45||n===95,az=n=>n===9||n===10||n===12||n===13||n===32,iz=n=>{let t=Math.floor(n/4),r=n%4;return t*3+(r===2?1:r===3?2:0)},ob=n=>{let t=n.length,r=0;return t>0&&n.charCodeAt(t-1)===61&&(r++,t>1&&n.charCodeAt(t-2)===61&&r++),Math.floor((t-r)*3/4)},sz=n=>{let t=n.length,r=0,a=0,i=!1;for(let s=0;s0){i=!0;continue}r++}}return i||a>2||a>0&&(r+a)%4!==0||r%4===1?ob(n):iz(r)},nb=(n,t)=>{if(!n||typeof n!="string"||!n.startsWith("data:"))return 0;let r=n.indexOf(",");if(r<0)return 0;let a=n.slice(5,r),i=n.slice(r+1);if(/;base64/i.test(a))return t(i);let o=0;for(let e=0,y=i.length;e=55296&&u<=56319&&e+1=56320&&f<=57343?(o+=4,e++):o+=3}else o+=3}return o};function Ml(n){let t=typeof n=="string"?n.indexOf("#"):-1;return nb(t===-1?n:n.slice(0,t),sz)}function hb(n){return nb(n,ob)}var cb={flush:yt.constants.Z_SYNC_FLUSH,finishFlush:yt.constants.Z_SYNC_FLUSH},dz={flush:yt.constants.BROTLI_OPERATION_FLUSH,finishFlush:yt.constants.BROTLI_OPERATION_FLUSH},cz={flush:yt.constants.ZSTD_e_flush,finishFlush:yt.constants.ZSTD_e_flush},Sb=q.isFunction(yt.createBrotliDecompress),Ib=q.isFunction(yt.createZstdDecompress),kb="gzip, compress, deflate"+(Sb?", br":""),lz=kb+(Ib?", zstd":""),lb=typeof process<"u"&&process.nextTick?process.nextTick.bind(process):q.asap,{http:pz,https:uz}=wb.default,Nl=/https:?/,pb=Symbol("axios.http.socketListener"),Tn=Symbol("axios.http.currentReq"),Tb=Symbol("axios.http.installedTunnel"),mz=new Map,ub=new WeakMap,mb={22:21,24:5};function fz(n=process.versions&&process.versions.node){if(!n)return!1;let[t,r]=n.split(".").map(a=>Number(a));return!Number.isInteger(t)||!Number.isInteger(r)?!1:t>24?!0:mb[t]!=null&&r>=mb[t]}function yz(n,t=process.versions&&process.versions.node){if(!fz(t))return!1;let r=n&&n.options;return!!(r&&q.hasOwnProp(r,"proxyEnv")&&r.proxyEnv!=null)}function gz(n,t,r){return Nl.test(n.protocol)?r||bb.globalAgent:t||_b.globalAgent}function vz(n,t){let r=n.protocol+"//"+n.hostname+":"+(n.port||"")+"#"+(n.auth||""),a=t?ub.get(t)||ub.set(t,new Map).get(t):mz,i=a.get(r);if(i)return i;let s=t&&t.options?{...t.options,...n}:n;if(i=new Ll.default(s),t&&t.options){let o={...t.options},e=i.callback;i.callback=function(u,f){return e.call(this,u,{...o,...f})}}return i[Tb]=!0,a.set(r,i),i}var fb=oe.protocols.map(n=>n+":"),yb=n=>{if(!q.isString(n))return n;try{return decodeURIComponent(n)}catch{return n}},gb=(n,[t,r])=>(n.on("end",r).on("error",r),t),_z=new J0;function bz(n,t,r){n.beforeRedirects.proxy&&n.beforeRedirects.proxy(n),n.beforeRedirects.auth&&n.beforeRedirects.auth(n),n.beforeRedirects.sensitiveHeaders&&n.beforeRedirects.sensitiveHeaders(n,r),n.beforeRedirects.config&&n.beforeRedirects.config(n,t,r)}function wz(n,t){n&&Object.keys(n).forEach(r=>{t.has(r.toLowerCase())&&delete n[r]})}function Sz(n,t){if(!t)return!1;try{return new URL(t.url).origin===new URL(n.href).origin}catch{return!1}}function xb(n,t,r,a,i,s){let o=t,e=gz(n,s,i);if(!o&&o!==!1&&!yz(e)){let y=I0(r);y&&(Bl(r)||(o=new URL(y)))}if(a&&n.headers)for(let y of Object.keys(n.headers))y.toLowerCase()==="proxy-authorization"&&delete n.headers[y];if(a&&n.agent&&n.agent[Tb]&&(n.agent=void 0),o){let y=o instanceof URL,u=_=>y||q.hasOwnProp(o,_)?o[_]:void 0,f=u("username"),d=u("password"),m=q.hasOwnProp(o,"auth")?o.auth:void 0;if(f&&(m=(f||"")+":"+(d||"")),m){let _=typeof m=="object",b=_&&q.hasOwnProp(m,"username")?m.username:void 0,w=_&&q.hasOwnProp(m,"password")?m.password:void 0;if(!!(b||w))m=(b||"")+":"+(w||"");else if(_)throw new C("Invalid proxy authorization",C.ERR_BAD_OPTION,{proxy:o})}if(Nl.test(n.protocol)){if(!(i instanceof Ll.default)){let _=u("hostname")||u("host"),b=u("port"),w=u("protocol"),S=w?w.includes(":")?w:`${w}:`:"http:",O=_&&_.includes(":")&&!_.startsWith("[")?`[${_}]`:_,E=new URL(`${S}//${O}${b?":"+b:""}`),F={protocol:E.protocol,hostname:E.hostname.replace(/^\[|\]$/g,""),port:E.port,auth:m&&typeof m=="string"?m:void 0};E.protocol==="https:"&&(F.ALPNProtocols=["http/1.1"]);let $=vz(F,i);n.agent=$,n.agents&&(n.agents.https=$)}}else{if(m){let S=Buffer.from(m,"utf8").toString("base64");n.headers["Proxy-Authorization"]="Basic "+S}let _=!1;for(let S of Object.keys(n.headers))if(S.toLowerCase()==="host"){_=!0;break}_||(n.headers.host=n.hostname+(n.port?":"+n.port:""));let b=u("hostname")||u("host");n.hostname=b,n.host=b,n.port=u("port"),n.path=r;let w=u("protocol");w&&(n.protocol=w.includes(":")?w:`${w}:`)}}n.beforeRedirects.proxy=function(u){xb(u,t,u.href,!0,i,s)}}var Iz=typeof process<"u"&&q.kindOf(process)==="process",kz=n=>new Promise((t,r)=>{let a,i,s=(y,u)=>{i||(i=!0,a&&a(y,u))},o=y=>{s(y),t(y)},e=y=>{s(y,!0),r(y)};n(o,e,y=>a=y).catch(e)}),Tz=({address:n,family:t})=>{if(!q.isString(n))throw TypeError("address must be a string");return{address:n,family:t||(n.indexOf(".")<0?6:4)}},vb=(n,t)=>Tz(q.isObject(n)?n:{address:n,family:t}),xz={request(n,t){let r=n.protocol+"//"+n.hostname+":"+(n.port||(n.protocol==="https:"?443:80)),{http2Options:a,headers:i}=n,s=_z.getSession(r,a),{HTTP2_HEADER_SCHEME:o,HTTP2_HEADER_METHOD:e,HTTP2_HEADER_PATH:y,HTTP2_HEADER_STATUS:u}=oz.constants,f={[o]:n.protocol.replace(":",""),[e]:n.method,[y]:n.path};q.forEach(i,(m,g)=>{g.charAt(0)!==":"&&(f[g]=m)});let d=s.request(f);return d.once("response",m=>{let g=d;m=Object.assign({},m);let _=m[u];delete m[u],g.headers=m,g.statusCode=+_,t(g)}),d}},Pb=Iz&&function(t){return kz(async function(a,i,s){let o=U=>q.getSafeProp(t,U),e=o("transitional")||mr,y=o("data"),u=o("lookup"),f=o("family"),d=o("httpVersion");d===void 0&&(d=1);let m=o("http2Options"),g=o("httpAgent"),_=o("httpsAgent"),b=o("proxy"),w=o("responseType"),S=o("responseEncoding"),O=o("socketPath"),E=o("method").toUpperCase(),F=o("maxRedirects"),$=o("maxBodyLength"),A=o("maxContentLength"),G=o("decompress"),M,N=!1,B,R;if(d=+d,Number.isNaN(d))throw TypeError(`Invalid protocol version: '${t.httpVersion}' is not a number`);if(d!==1&&d!==2)throw TypeError(`Unsupported protocol version '${d}'`);let de=d===2;if(u){let U=X0(u,L=>q.isArray(L)?L:[L]);u=(L,ie,we)=>{U(L,ie,(Y,Re,Ue)=>{if(Y)return we(Y);let qe=q.isArray(Re)?Re.map(ba=>vb(ba)):[vb(Re,Ue)];ie.all?we(Y,qe):we(Y,qe[0].address,qe[0].family)})}}let z=new hz;function P(U){try{z.emit("abort",!U||U.type?new st(null,t,B):U)}catch{}}function D(){R&&(clearTimeout(R),R=null)}function H(){let U=o("timeout"),L=U?"timeout of "+U+"ms exceeded":"timeout exceeded",ie=o("timeoutErrorMessage");return ie&&(L=ie),new C(L,e.clarifyTimeoutError?C.ETIMEDOUT:C.ECONNABORTED,t,B)}z.once("abort",i);let Z=()=>{D(),t.cancelToken&&t.cancelToken.unsubscribe(P),t.signal&&t.signal.removeEventListener("abort",P),z.removeAllListeners()};(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe(P),t.signal&&(t.signal.aborted?P():t.signal.addEventListener("abort",P))),s((U,L)=>{if(M=!0,D(),L){N=!0,Z();return}let{data:ie}=U;if(ie instanceof xt.Readable||ie instanceof xt.Duplex){let we=xt.finished(ie,()=>{we(),Z()})}else Z()});let he=Gr(o("baseURL"),o("url"),o("allowAbsoluteUrls"),t),ue=O?"http://localhost":oe.hasBrowserEnv?oe.origin:void 0,V=new URL(he,ue),ae=V.protocol||fb[0];if(ae==="data:"){if(A>-1){let L=String(o("url")||he||"");if(hb(L)>A)return i(new C("maxContentLength size of "+A+" exceeded",C.ERR_BAD_RESPONSE,t))}let U;if(E!=="GET")return At(a,i,{status:405,statusText:"method not allowed",headers:{},config:t});try{U=Ol(o("url"),w==="blob",{Blob:t.env&&t.env.Blob})}catch(L){throw C.from(L,C.ERR_BAD_REQUEST,t)}return w==="text"?(U=U.toString(S),(!S||S==="utf8")&&(U=q.stripBOM(U))):w==="stream"&&(U=xt.Readable.from(U)),At(a,i,{data:U,status:200,statusText:"OK",headers:new ge,config:t})}if(fb.indexOf(ae)===-1)return i(new C("Unsupported protocol "+ae,C.ERR_BAD_REQUEST,t));let ee=ge.from(t.headers).normalize();ee.set("User-Agent","axios/"+Vt,!1);let{onUploadProgress:ce,onDownloadProgress:ke}=t,ye=t.maxRate,K,Te;if(q.isSpecCompliantForm(y)){let U=ee.getContentType(/boundary=([-_\w\d]{10,70})/i);y=V0(y,L=>{ee.set(L)},{tag:`axios-${Vt}-boundary`,boundary:U&&U[1]||void 0})}else if(q.isFormData(y)&&q.isFunction(y.getHeaders)&&y.getHeaders!==Object.prototype.getHeaders){if(ms(ee,y.getHeaders(),o("formDataHeaderPolicy")),!ee.hasContentLength())try{let U=await nz.promisify(y.getLength).call(y);Number.isFinite(U)&&U>=0&&ee.setContentLength(U)}catch{}}else if(q.isBlob(y)||q.isFile(y))y.size&&ee.setContentType(y.type||"application/octet-stream"),ee.setContentLength(y.size||0),y=xt.Readable.from(kn(y));else if(y&&!q.isStream(y)){if(!Buffer.isBuffer(y))if(q.isArrayBuffer(y))y=Buffer.from(new Uint8Array(y));else if(q.isString(y))y=Buffer.from(y,"utf-8");else return i(new C("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",C.ERR_BAD_REQUEST,t));if(ee.setContentLength(y.length,!1),$>-1&&y.length>$)return i(new C("Request body larger than maxBodyLength limit",C.ERR_BAD_REQUEST,t))}let va=q.toFiniteNumber(ee.getContentLength());q.isArray(ye)?(K=ye[0],Te=ye[1]):K=Te=ye,y&&(ce||K)&&(q.isStream(y)||(y=xt.Readable.from(y,{objectMode:!1})),y=xt.pipeline([y,new Rl({maxRate:q.toFiniteNumber(K)})],q.noop),ce&&y.on("progress",gb(y,Ha(va,Kt(Qa(ce,lb),!1,3)))));let zt,Oi=o("auth");if(Oi){let U=q.getSafeProp(Oi,"username")||"",L=q.getSafeProp(Oi,"password")||"";zt=U+":"+L}if(!zt&&(V.username||V.password)){let U=yb(V.username),L=yb(V.password);zt=U+":"+L}zt&&ee.delete("authorization");let $i;try{$i=Dr(V.pathname+V.search,o("params"),o("paramsSerializer")).replace(/^\?/,"")}catch(U){return i(C.from(U,C.ERR_BAD_REQUEST,t,null,null,{url:o("url"),exists:!0}))}ee.set("Accept-Encoding",q.hasOwnProp(e,"advertiseZstdAcceptEncoding")&&e.advertiseZstdAcceptEncoding===!0?lz:kb,!1);let le=Object.assign(Object.create(null),{path:$i,method:E,headers:Ra(ee),agents:{http:g,https:_},auth:zt,protocol:ae,family:f,beforeRedirect:bz,beforeRedirects:Object.create(null),http2Options:m});if(!q.isUndefined(u)&&(le.lookup=u),O){if(typeof O!="string")return i(new C("socketPath must be a string",C.ERR_BAD_OPTION_VALUE,t));let U=o("allowedSocketPaths");if(U!=null){let L=Array.isArray(U)?U:[U],ie=db(O);if(!L.some(Y=>typeof Y=="string"&&db(Y)===ie))return i(new C(`socketPath "${O}" is not permitted by allowedSocketPaths`,C.ERR_BAD_OPTION_VALUE,t))}le.socketPath=O}else le.hostname=V.hostname.startsWith("[")?V.hostname.slice(1,-1):V.hostname,le.port=V.port,xb(le,b,ae+"//"+V.hostname+(V.port?":"+V.port:"")+le.path,!1,_,g);let hr,_a=!1,lt=!1,J=Nl.test(le.protocol);if(le.agent==null&&(le.agent=J?_:g),de)hr=xz;else{let U=o("transport");if(U)hr=U;else if(F===0)hr=J?bb:_b,_a=!0;else{lt=!0,le.sensitiveHeaders=[],F&&(le.maxRedirects=F);let L=o("beforeRedirect");if(L&&(le.beforeRedirects.config=L),zt){let we=V.origin,Y=zt;le.beforeRedirects.auth=function(Ue){try{new URL(Ue.href).origin===we&&(Ue.auth=Y)}catch{}}}let ie=o("sensitiveHeaders");if(ie!=null){if(!q.isArray(ie))return i(new C("sensitiveHeaders must be an array of strings",C.ERR_BAD_OPTION_VALUE,t));let we=new Set;for(let Y of ie){if(!q.isString(Y))return i(new C("sensitiveHeaders must be an array of strings",C.ERR_BAD_OPTION_VALUE,t));we.add(Y.toLowerCase())}we.size&&(le.sensitiveHeaders=Array.from(we),le.beforeRedirects.sensitiveHeaders=function(Re,Ue){Sz(Re,Ue)||wz(Re.headers,we)})}hr=J?uz:pz}}$>-1?le.maxBodyLength=$:le.maxBodyLength=1/0,le.insecureHTTPParser=!!o("insecureHTTPParser"),B=hr.request(le,function(L){if(D(),B.destroyed)return;let ie=[L],we=q.toFiniteNumber(L.headers["content-length"]);if(ke||Te){let qe=new Rl({maxRate:q.toFiniteNumber(Te)});ke&&qe.on("progress",gb(qe,Ha(we,Kt(Qa(ke,lb),!0,3)))),ie.push(qe)}let Y=L,Re=L.req||B;if(G!==!1&&L.headers["content-encoding"])switch((E==="HEAD"||L.statusCode===204)&&delete L.headers["content-encoding"],(L.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":ie.push(yt.createUnzip(cb)),delete L.headers["content-encoding"];break;case"deflate":ie.push(new K0),ie.push(yt.createUnzip(cb)),delete L.headers["content-encoding"];break;case"br":Sb&&(ie.push(yt.createBrotliDecompress(dz)),delete L.headers["content-encoding"]);break;case"zstd":Ib&&(ie.push(yt.createZstdDecompress(cz)),delete L.headers["content-encoding"]);break}Y=ie.length>1?xt.pipeline(ie,q.noop):ie[0];let Ue={status:L.statusCode,statusText:L.statusMessage,headers:new ge(L.headers),config:t,request:Re};if(w==="stream"){if(A>-1){let qe=A,ba=Y;async function*zi(){let Ae=0;for await(let ag of ba){if(Ae+=ag.length,Ae>qe)throw new C("maxContentLength size of "+qe+" exceeded",C.ERR_BAD_RESPONSE,t,Re);yield ag}}Y=xt.Readable.from(zi(),{objectMode:!1})}Ue.data=Y,At(a,i,Ue)}else{let qe=[],ba=0;Y.on("data",function(Ae){qe.push(Ae),ba+=Ae.length,A>-1&&ba>A&&(N=!0,Y.destroy(),P(new C("maxContentLength size of "+A+" exceeded",C.ERR_BAD_RESPONSE,t,Re)))}),Y.on("aborted",function(){if(N)return;let Ae=new C("stream has been aborted",C.ERR_BAD_RESPONSE,t,Re,Ue);Y.destroy(Ae),i(Ae)}),Y.on("error",function(Ae){N||i(C.from(Ae,null,t,Re,Ue))}),Y.on("end",function(){try{let Ae=qe.length===1?qe[0]:Buffer.concat(qe);w!=="arraybuffer"&&(Ae=Ae.toString(S),(!S||S==="utf8")&&(Ae=q.stripBOM(Ae))),Ue.data=Ae}catch(Ae){return i(C.from(Ae,null,t,Ue.request,Ue))}At(a,i,Ue)})}z.once("abort",qe=>{Y.destroyed||(Y.emit("error",qe),Y.destroy())})}),z.once("abort",U=>{B.close?B.close():B.destroy(U)}),B.on("error",function(L){i(C.from(L,null,t,B))});let Me=new Set;if(B.on("socket",function(L){typeof L.setKeepAlive=="function"&&L.setKeepAlive(!0,1e3*60),L[pb]||(L.on("error",function(we){let Y=L[Tn];Y&&!Y.destroyed&&Y.destroy(we)}),L[pb]=!0),L[Tn]=B,Me.add(L)}),B.once("close",function(){D();for(let L of Me)L[Tn]===B&&(L[Tn]=null);Me.clear()}),o("timeout")){let U=parseInt(o("timeout"),10);if(Number.isNaN(U)){P(new C("error trying to parse `config.timeout` to int",C.ERR_BAD_OPTION_VALUE,t,B));return}let L=function(){M||P(H())};_a&&U>0&&(R=setTimeout(L,U)),B.setTimeout(U,L)}else B.setTimeout(0);if(q.isStream(y)){let U=!1,L=!1;y.on("end",()=>{U=!0}),y.once("error",we=>{L=!0,B.destroy(we)}),y.on("close",()=>{!U&&!L&&P(new st("Request stream has been aborted",t,B))});let ie=y;if($>-1&&!lt){let we=$,Y=0;ie=xt.pipeline([y,new xt.Transform({transform(Re,Ue,qe){if(Y+=Re.length,Y>we)return qe(new C("Request body larger than maxBodyLength limit",C.ERR_BAD_REQUEST,t,B));qe(null,Re)}})],q.noop),ie.on("error",Re=>{B.destroyed||B.destroy(Re)})}ie.pipe(B)}else y&&B.write(y),B.end()})};var qb=oe.hasStandardBrowserEnv?((n,t)=>r=>(r=new URL(r,oe.origin),n.protocol===r.protocol&&n.host===r.host&&(t||n.port===r.port)))(new URL(oe.origin),oe.navigator&&/(msie|trident)/i.test(oe.navigator.userAgent)):()=>!0;var Eb=oe.hasStandardBrowserEnv?{write(n,t,r,a,i,s,o){if(typeof document>"u")return;let e=[`${n}=${encodeURIComponent(t)}`];q.isNumber(r)&&e.push(`expires=${new Date(r).toUTCString()}`),q.isString(a)&&e.push(`path=${a}`),q.isString(i)&&e.push(`domain=${i}`),s===!0&&e.push("secure"),q.isString(o)&&e.push(`SameSite=${o}`),document.cookie=e.join("; ")},read(n){if(typeof document>"u")return null;let t=document.cookie.split(";");for(let r=0;rn instanceof ge?{...n}:n,Pz=n=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(n).concat(Object.getOwnPropertySymbols(n).filter(t=>Object.getOwnPropertyDescriptor(n,t).enumerable)):Object.keys(n);function Pt(n,t){n=n||{},t=t||{};let r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function a(f,d,m,g){return q.isPlainObject(f)&&q.isPlainObject(d)?q.merge.call({caseless:g},f,d):q.isPlainObject(d)?q.merge({},d):q.isArray(d)?d.slice():d}function i(f,d,m,g){if(q.isUndefined(d)){if(!q.isUndefined(f))return a(void 0,f,m,g)}else return a(f,d,m,g)}function s(f,d){if(!q.isUndefined(d))return a(void 0,d)}function o(f,d){if(q.isUndefined(d)){if(!q.isUndefined(f))return a(void 0,f)}else return a(void 0,d)}function e(f){let d=q.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!q.isUndefined(d))if(q.isPlainObject(d)){if(q.hasOwnProp(d,f))return d[f]}else return;let m=q.hasOwnProp(n,"transitional")?n.transitional:void 0;if(q.isPlainObject(m)&&q.hasOwnProp(m,f))return m[f]}function y(f,d,m){if(q.hasOwnProp(t,m))return a(f,d);if(q.hasOwnProp(n,m))return a(void 0,f)}let u={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:y,headers:(f,d,m)=>i(Fb(f),Fb(d),m,!0)};return q.forEach(Pz({...n,...t}),function(d){if(d==="__proto__"||d==="constructor"||d==="prototype")return;let m=q.hasOwnProp(u,d)?u[d]:i,g=q.hasOwnProp(n,d)?n[d]:void 0,_=q.hasOwnProp(t,d)?t[d]:void 0,b=m(g,_,d);q.isUndefined(b)&&m!==y||(r[d]=b)}),q.hasOwnProp(t,"validateStatus")&&q.isUndefined(t.validateStatus)&&e("validateStatusUndefinedResolves")===!1&&(q.hasOwnProp(n,"validateStatus")?r.validateStatus=a(void 0,n.validateStatus):delete r.validateStatus),r}var qz=n=>encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16)));function Ez(n){let t=Pt({},n),r=m=>q.hasOwnProp(t,m)?t[m]:void 0,a=r("data"),i=r("withXSRFToken"),s=r("xsrfHeaderName"),o=r("xsrfCookieName"),e=r("headers"),y=r("auth"),u=r("baseURL"),f=r("allowAbsoluteUrls"),d=r("url");if(t.headers=e=ge.from(e),t.url=Dr(Gr(u,d,f,t),r("params"),r("paramsSerializer")),y){let m=q.getSafeProp(y,"username")||"",g=q.getSafeProp(y,"password")||"";try{e.set("Authorization","Basic "+btoa(m+":"+(g?qz(g):"")))}catch(_){throw C.from(_,C.ERR_BAD_OPTION_VALUE,n)}}if(q.isFormData(a)&&(oe.hasStandardBrowserEnv||oe.hasStandardBrowserWebWorkerEnv||q.isReactNative(a)?e.setContentType(void 0):q.isFunction(a.getHeaders)&&ms(e,a.getHeaders(),r("formDataHeaderPolicy"))),oe.hasStandardBrowserEnv&&(q.isFunction(i)&&(i=i(t)),i===!0||i==null&&qb(t.url))){let g=s&&o&&Eb.read(o);g&&e.set(s,g)}return t}var xn=Ez;var Fz=typeof XMLHttpRequest<"u",Ob=Fz&&function(n){return new Promise(function(r,a){let i=xn(n),s=i.data,o=ge.from(i.headers).normalize(),{responseType:e,onUploadProgress:y,onDownloadProgress:u}=i,f,d,m,g,_;function b(){g&&g(),_&&_(),i.cancelToken&&i.cancelToken.unsubscribe(f),i.signal&&i.signal.removeEventListener("abort",f)}let w=new XMLHttpRequest;w.open(i.method.toUpperCase(),i.url,!0),w.timeout=i.timeout;function S(){if(!w)return;let E=ge.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),$={data:!e||e==="text"||e==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:E,config:n,request:w};At(function(G){r(G),b()},function(G){a(G),b()},$),w=null}"onloadend"in w?w.onloadend=S:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.startsWith("file:"))||setTimeout(S)},w.onabort=function(){w&&(a(new C("Request aborted",C.ECONNABORTED,n,w)),b(),w=null)},w.onerror=function(F){let $=F&&F.message?F.message:"Network Error",A=new C($,C.ERR_NETWORK,n,w);A.event=F||null,a(A),b(),w=null},w.ontimeout=function(){let F=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded",$=i.transitional||mr;i.timeoutErrorMessage&&(F=i.timeoutErrorMessage),a(new C(F,$.clarifyTimeoutError?C.ETIMEDOUT:C.ECONNABORTED,n,w)),b(),w=null},s===void 0&&o.setContentType(null),"setRequestHeader"in w&&q.forEach(Ra(o),function(F,$){w.setRequestHeader($,F)}),q.isUndefined(i.withCredentials)||(w.withCredentials=!!i.withCredentials),e&&e!=="json"&&(w.responseType=i.responseType),u&&([m,_]=Kt(u,!0),w.addEventListener("progress",m)),y&&w.upload&&([d,g]=Kt(y),w.upload.addEventListener("progress",d),w.upload.addEventListener("loadend",g)),(i.cancelToken||i.signal)&&(f=E=>{w&&(a(!E||E.type?new st(null,n,w):E),w.abort(),b(),w=null)},i.cancelToken&&i.cancelToken.subscribe(f),i.signal&&(i.signal.aborted?f():i.signal.addEventListener("abort",f)));let O=us(i.url);if(O&&!oe.protocols.includes(O)){a(new C("Unsupported protocol "+O+":",C.ERR_BAD_REQUEST,n)),b();return}w.send(s||null)})};var Oz=(n,t)=>{if(n=n?n.filter(Boolean):[],!t&&!n.length)return;let r=new AbortController,a=!1,i=function(y){if(!a){a=!0,o();let u=y instanceof Error?y:this.reason;r.abort(u instanceof C?u:new st(u instanceof Error?u.message:u))}},s=t&&setTimeout(()=>{s=null,i(new C(`timeout of ${t}ms exceeded`,C.ETIMEDOUT))},t),o=()=>{n&&(s&&clearTimeout(s),s=null,n.forEach(y=>{y.unsubscribe?y.unsubscribe(i):y.removeEventListener("abort",i)}),n=null)};n.forEach(y=>{if(!a){if(y.aborted){i.call(y);return}y.addEventListener("abort",i,{once:!0})}});let{signal:e}=r;return e.unsubscribe=()=>q.asap(o),e},$b=Oz;var $z=function*(n,t){let r=n.byteLength;if(!t||r{let i=zz(n,t),s=0,o,e=y=>{o||(o=!0,a&&a(y))};return new ReadableStream({async pull(y){try{let{done:u,value:f}=await i.next();if(u){e(),y.close();return}let d=f.byteLength;if(r){let m=s+=d;r(m)}y.enqueue(new Uint8Array(f))}catch(u){throw e(u),u}},cancel(y){return e(y),i.return()}},{highWaterMark:2})};var zb=64*1024,{isFunction:Pn}=q,Az=n=>encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16))),Rb=n=>{if(!q.isString(n))return n;try{return decodeURIComponent(n)}catch{return n}},Ab=(n,...t)=>{try{return!!n(...t)}catch{return!1}},Cz=n=>{let t=n.indexOf("://"),r=n;return t!==-1&&(r=r.slice(t+3)),r.includes("@")||r.includes(":")},jz=n=>{let t=q.global!==void 0&&q.global!==null?q.global:globalThis,{ReadableStream:r,TextEncoder:a}=t;n=q.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},n);let{fetch:i,Request:s,Response:o}=n,e=i?Pn(i):typeof fetch=="function",y=Pn(s),u=Pn(o);if(!e)return!1;let f=e&&Pn(r),d=e&&(typeof a=="function"?(S=>O=>S.encode(O))(new a):async S=>new Uint8Array(await new s(S).arrayBuffer())),m=y&&f&&Ab(()=>{let S=!1,O=new s(oe.origin,{body:new r,method:"POST",get duplex(){return S=!0,"half"}}),E=O.headers.has("Content-Type");return O.body!=null&&O.body.cancel(),S&&!E}),g=u&&f&&Ab(()=>q.isReadableStream(new o("").body)),_={stream:g&&(S=>S.body)};e&&["text","arrayBuffer","blob","formData","stream"].forEach(S=>{!_[S]&&(_[S]=(O,E)=>{let F=O&&O[S];if(F)return F.call(O);throw new C(`Response type '${S}' is not supported`,C.ERR_NOT_SUPPORT,E)})});let b=async S=>{if(S==null)return 0;if(q.isBlob(S))return S.size;if(q.isSpecCompliantForm(S))return(await new s(oe.origin,{method:"POST",body:S}).arrayBuffer()).byteLength;if(q.isArrayBufferView(S)||q.isArrayBuffer(S))return S.byteLength;if(q.isURLSearchParams(S)&&(S=S+""),q.isString(S))return(await d(S)).byteLength},w=async(S,O)=>{let E=q.toFiniteNumber(S.getContentLength());return E??b(O)};return async S=>{let{url:O,method:E,data:F,signal:$,cancelToken:A,timeout:G,onDownloadProgress:M,onUploadProgress:N,responseType:B,headers:R,withCredentials:de="same-origin",fetchOptions:z,maxContentLength:P,maxBodyLength:D}=xn(S),H=q.isNumber(P)&&P>-1,Z=q.isNumber(D)&&D>-1,he=K=>q.hasOwnProp(S,K)?S[K]:void 0,ue=i||fetch;B=B?(B+"").toLowerCase():"text";let V=$b([$,A&&A.toAbortSignal()],G),ae=null,ee=V&&V.unsubscribe&&(()=>{V.unsubscribe()}),ce,ke=null,ye=()=>new C("Request body larger than maxBodyLength limit",C.ERR_BAD_REQUEST,S,ae);try{let K,Te=he("auth");if(Te){let J=q.getSafeProp(Te,"username")||"",Me=q.getSafeProp(Te,"password")||"";K={username:J,password:Me}}if(Cz(O)){let J=new URL(O,oe.origin);if(!K&&(J.username||J.password)){let Me=Rb(J.username),U=Rb(J.password);K={username:Me,password:U}}(J.username||J.password)&&(J.username="",J.password="",O=J.href)}if(K&&(R.delete("authorization"),R.set("Authorization","Basic "+btoa(Az((K.username||"")+":"+(K.password||""))))),H&&typeof O=="string"&&O.startsWith("data:")&&Ml(O)>P)throw new C("maxContentLength size of "+P+" exceeded",C.ERR_BAD_RESPONSE,S,ae);if(Z&&E!=="get"&&E!=="head"){let J=await b(F);if(typeof J=="number"&&isFinite(J)&&(ce=J,J>D))throw ye()}let va=Z&&(q.isReadableStream(F)||q.isStream(F)),zt=(J,Me,U)=>Ul(J,zb,L=>{if(Z&&L>D)throw ke=ye();Me&&Me(L)},U);if(m&&E!=="get"&&E!=="head"&&(N||va)){if(ce=ce??await w(R,F),ce!==0||va){let J=new s(O,{method:"POST",body:F,duplex:"half"}),Me;if(q.isFormData(F)&&(Me=J.headers.get("content-type"))&&R.setContentType(Me),J.body){let[U,L]=N&&Ha(ce,Kt(Qa(N)))||[];F=zt(J.body,U,L)}}}else if(va&&!y&&f&&E!=="get"&&E!=="head")F=zt(F);else if(va&&y&&!m&&E!=="get"&&E!=="head")throw new C("Stream request bodies are not supported by the current fetch implementation",C.ERR_NOT_SUPPORT,S,ae);q.isString(de)||(de=de?"include":"omit");let Oi=y&&"credentials"in s.prototype;if(q.isFormData(F)){let J=R.getContentType();J&&/^multipart\/form-data/i.test(J)&&!/boundary=/i.test(J)&&R.delete("content-type")}R.set("User-Agent","axios/"+Vt,!1);let $i={...z,signal:V,method:E.toUpperCase(),headers:Ra(R.normalize()),body:F,duplex:"half",credentials:Oi?de:void 0};ae=y&&new s(O,$i);let le=await(y?ue(ae,z):ue(O,$i)),hr=ge.from(le.headers);if(H){let J=q.toFiniteNumber(hr.getContentLength());if(J!=null&&J>P)throw new C("maxContentLength size of "+P+" exceeded",C.ERR_BAD_RESPONSE,S,ae)}let _a=g&&(B==="stream"||B==="response");if(g&&le.body&&(M||H||_a&&ee)){let J={};["status","statusText","headers"].forEach(Y=>{J[Y]=le[Y]});let Me=q.toFiniteNumber(hr.getContentLength()),[U,L]=M&&Ha(Me,Kt(Qa(M),!0))||[],ie=0,we=Y=>{if(H&&(ie=Y,ie>P))throw new C("maxContentLength size of "+P+" exceeded",C.ERR_BAD_RESPONSE,S,ae);U&&U(Y)};le=new o(Ul(le.body,zb,we,()=>{L&&L(),ee&&ee()}),J)}B=B||"text";let lt=await _[q.findKey(_,B)||"text"](le,S);if(H&&!g&&!_a){let J;if(lt!=null&&(typeof lt.byteLength=="number"?J=lt.byteLength:typeof lt.size=="number"?J=lt.size:typeof lt=="string"&&(J=typeof a=="function"?new a().encode(lt).byteLength:lt.length)),typeof J=="number"&&J>P)throw new C("maxContentLength size of "+P+" exceeded",C.ERR_BAD_RESPONSE,S,ae)}return!_a&&ee&&ee(),await new Promise((J,Me)=>{At(J,Me,{data:lt,headers:ge.from(le.headers),status:le.status,statusText:le.statusText,config:S,request:ae})})}catch(K){if(ee&&ee(),V&&V.aborted&&V.reason instanceof C){let Te=V.reason;throw Te.config=S,ae&&(Te.request=ae),K!==Te&&Object.defineProperty(Te,"cause",{__proto__:null,value:K,writable:!0,enumerable:!1,configurable:!0}),Te}if(ke)throw ae&&!ke.request&&(ke.request=ae),ke;if(K instanceof C)throw ae&&!K.request&&(K.request=ae),K;if(K&&K.name==="TypeError"&&/Load failed|fetch/i.test(K.message)){let Te=new C("Network Error",C.ERR_NETWORK,S,ae,K&&K.response);throw Object.defineProperty(Te,"cause",{__proto__:null,value:K.cause||K,writable:!0,enumerable:!1,configurable:!0}),Te}throw C.from(K,K&&K.code,S,ae,K&&K.response)}}},Dz=new Map,Wl=n=>{let t=n&&n.env||{},{fetch:r,Request:a,Response:i}=t,s=[a,i,r],o=s.length,e=o,y,u,f=Dz;for(;e--;)y=s[e],u=f.get(y),u===void 0&&f.set(y,u=e?new Map:jz(t)),f=u;return u},G5=Wl();var Hl={http:Pb,xhr:Ob,fetch:{get:Wl}};q.forEach(Hl,(n,t)=>{if(n){try{Object.defineProperty(n,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(n,"adapterName",{__proto__:null,value:t})}});var Cb=n=>`- ${n}`,Bz=n=>q.isFunction(n)||n===null||n===!1;function Mz(n,t){n=q.isArray(n)?n:[n];let{length:r}=n,a,i,s={};for(let o=0;o`adapter ${y} `+(u===!1?"is not supported by the environment":"is not available in the build")),e=r?o.length>1?`since : +`+o.map(Cb).join(` +`):" "+Cb(o[0]):"as no adapter specified";throw new C("There is no suitable adapter to dispatch the request "+e,C.ERR_NOT_SUPPORT)}return i}var qn={getAdapter:Mz,adapters:Hl};function Ql(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new st(null,n)}function ys(n){return Ql(n),n.headers=ge.from(n.headers),n.data=rs.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),qn.getAdapter(n.adapter||Ma.adapter,n)(n).then(function(a){Ql(n),n.response=a;try{a.data=rs.call(n,n.transformResponse,a)}finally{delete n.response}return a.headers=ge.from(a.headers),a},function(a){if(!as(a)&&(Ql(n),a&&a.response)){n.response=a.response;try{a.response.data=rs.call(n,n.transformResponse,a.response)}finally{delete n.response}a.response.headers=ge.from(a.response.headers)}return Promise.reject(a)})}var En={};["object","boolean","number","function","string","symbol"].forEach((n,t)=>{En[n]=function(a){return typeof a===n||"a"+(t<1?"n ":" ")+n}});var jb={};En.transitional=function(t,r,a){function i(s,o){return"[Axios v"+Vt+"] Transitional option '"+s+"'"+o+(a?". "+a:"")}return(s,o,e)=>{if(t===!1)throw new C(i(o," has been removed"+(r?" in "+r:"")),C.ERR_DEPRECATED);return r&&!jb[o]&&(jb[o]=!0,console.warn(i(o," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,o,e):!0}};En.spelling=function(t){return(r,a)=>(console.warn(`${a} is likely a misspelling of ${t}`),!0)};function Lz(n,t,r){if(typeof n!="object"||n===null)throw new C("options must be an object",C.ERR_BAD_OPTION_VALUE);let a=Object.keys(n),i=a.length;for(;i-- >0;){let s=a[i],o=Object.prototype.hasOwnProperty.call(t,s)?t[s]:void 0;if(o){let e=n[s],y=e===void 0||o(e,s,n);if(y!==!0)throw new C("option "+s+" must be "+y,C.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new C("Unknown option "+s,C.ERR_BAD_OPTION)}}var gs={assertOptions:Lz,validators:En};var He=gs.validators,Va=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Zc,response:new Zc}}async request(t,r){try{return await this._request(t,r)}catch(a){if(a instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;let s=(()=>{if(!i.stack)return"";let o=i.stack.indexOf(` +`);return o===-1?"":i.stack.slice(o+1)})();try{if(!a.stack)a.stack=s;else if(s){let o=s.indexOf(` +`),e=o===-1?-1:s.indexOf(` +`,o+1),y=e===-1?"":s.slice(e+1);String(a.stack).endsWith(y)||(a.stack+=` +`+s)}}catch{}}throw a}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Pt(this.defaults,r);let{transitional:a,paramsSerializer:i,headers:s}=r;a!==void 0&&gs.assertOptions(a,{silentJSONParsing:He.transitional(He.boolean),forcedJSONParsing:He.transitional(He.boolean),clarifyTimeoutError:He.transitional(He.boolean),legacyInterceptorReqResOrdering:He.transitional(He.boolean),advertiseZstdAcceptEncoding:He.transitional(He.boolean),validateStatusUndefinedResolves:He.transitional(He.boolean)},!1),i!=null&&(q.isFunction(i)?r.paramsSerializer={serialize:i}:gs.assertOptions(i,{encode:He.function,serialize:He.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),gs.assertOptions(r,{baseUrl:He.spelling("baseURL"),withXsrfToken:He.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=s&&q.merge(s.common,s[r.method]);s&&q.forEach(["delete","get","head","post","put","patch","query","common"],_=>{delete s[_]}),r.headers=ge.concat(o,s);let e=[],y=!0;this.interceptors.request.forEach(function(b){if(typeof b.runWhen=="function"&&b.runWhen(r)===!1)return;y=y&&b.synchronous;let w=r.transitional||mr;w&&w.legacyInterceptorReqResOrdering?e.unshift(b.fulfilled,b.rejected):e.push(b.fulfilled,b.rejected)});let u=[];this.interceptors.response.forEach(function(b){u.push(b.fulfilled,b.rejected)});let f,d=0,m;if(!y){let _=[ys.bind(this),void 0];for(_.unshift(...e),_.push(...u),m=_.length,f=Promise.resolve(r);dys.call(this,g)))}catch(S){f=Promise.reject(S)}break}}if(!f)try{f=ys.call(this,g)}catch(_){f=Promise.reject(_)}for(d=0,m=u.length;d{if(!a._listeners)return;let s=a._listeners.length;for(;s-- >0;)a._listeners[s](i);a._listeners=null}),this.promise.then=i=>{let s,o=new Promise(e=>{a.subscribe(e),s=e}).then(i);return o.cancel=function(){a.unsubscribe(s)},o},t(function(s,o,e){a.reason||(a.reason=new st(s,o,e),r(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){let t=new AbortController,r=a=>{t.abort(a)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new n(function(i){t=i}),cancel:t}}},Db=Vl;function Kl(n){return function(r){return n.apply(null,r)}}function Jl(n){return q.isObject(n)&&n.isAxiosError===!0}var Xl={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Xl).forEach(([n,t])=>{Xl[t]=n});var Gb=Xl;function Bb(n){let t=new vs(n),r=Wi(vs.prototype.request,t);return q.extend(r,vs.prototype,t,{allOwnKeys:!0}),q.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return Bb(Pt(n,i))},r}var Ee=Bb(Ma);Ee.Axios=vs;Ee.CanceledError=st;Ee.CancelToken=Db;Ee.isCancel=as;Ee.VERSION=Vt;Ee.toFormData=ur;Ee.AxiosError=C;Ee.Cancel=Ee.CanceledError;Ee.all=function(t){return Promise.all(t)};Ee.spread=Kl;Ee.isAxiosError=Jl;Ee.mergeConfig=Pt;Ee.AxiosHeaders=ge;Ee.formToJSON=n=>vn(q.isHTMLForm(n)?new FormData(n):n);Ee.getAdapter=qn.getAdapter;Ee.HttpStatusCode=Gb;Ee.default=Ee;var Fn=Ee;var{Axios:C7,AxiosError:Yl,CanceledError:j7,isCancel:D7,CancelToken:G7,VERSION:B7,all:M7,Cancel:L7,isAxiosError:N7,spread:U7,toFormData:W7,AxiosHeaders:H7,HttpStatusCode:Q7,formToJSON:V7,getAdapter:K7,mergeConfig:J7,create:X7}=Fn;var c=Ve(zw()),I=Ve(Aw()),k=Ve(vS()),yT=Ve(QS());import te from"fs";import Zs from"path";import Oh from"crypto";import BG from"querystring";var kG=Ve(LI(),1),TG=Ve(gh(),1),xG=Ve(hi(),1),PG=Ve(su(),1),qG=Ve(hu(),1),EG=Ve(mu(),1),XI=Ve(wh(),1),FG=Ve(JI(),1);var Ns=XI.default;import{gzipSync as MG}from"zlib";import LG from"http";import NG from"https";import{promises as UG}from"dns";import{isIP as gT}from"net";function T(n,t){var r={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&t.indexOf(a)<0&&(r[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,a=Object.getOwnPropertySymbols(n);i=n.length&&(n=void 0),{value:n&&n[a++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(n){return this instanceof v?(this.v=n,this):new v(n)}function x(n,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=r.apply(n,t||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(m){a[m]&&(i[m]=function(g){return new Promise(function(_,b){s.push([m,g,_,b])>1||e(m,g)})})}function e(m,g){try{y(a[m](g))}catch(_){d(s[0][3],_)}}function y(m){m.value instanceof v?Promise.resolve(m.value.v).then(u,f):d(s[0][2],m)}function u(m){e("next",m)}function f(m){e("throw",m)}function d(m,g){m(g),s.shift(),s.length&&e(s[0][0],s[0][1])}}function Xk(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n[Symbol.asyncIterator],r;return t?t.call(n):(n=typeof Jk=="function"?Jk(n):n[Symbol.iterator](),r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r);function a(s){r[s]=n[s]&&function(o){return new Promise(function(e,y){o=n[s](o),i(e,y,o.done,o.value)})}}function i(s,o,e,y){Promise.resolve(y).then(function(u){s({value:u,done:e})},o)}}var Ph;function WG(){if(Ph!==void 0)return Ph;let n=[Zs.resolve(__dirname,"..","package.json"),Zs.resolve(__dirname,"..","..","package.json")];for(let t of n)try{let r=JSON.parse(te.readFileSync(t,"utf-8"));if(r.name==="@larksuiteoapi/node-sdk"&&typeof r.version=="string")return Ph=r.version,r.version}catch{}return Ph="unknown","unknown"}function Yk(n){return n.replace(/[^a-zA-Z0-9._-]/g,"_").slice(0,64)}function hy(n,t){let r=`oapi-node-sdk/${WG()}`;if(n){let a=Yk(n);a&&(r+=` source/${a}`)}if(t?.extraTags)for(let a of t.extraTags){let i=Yk(a);i&&(r+=` ${i}`)}return r}var vi=Fn.create(),HG=hy();vi.interceptors.request.use(n=>(n.headers&&!n.headers["User-Agent"]&&(n.headers["User-Agent"]=HG),n),void 0,{synchronous:!0});vi.interceptors.response.use(n=>n.config.$return_headers?{data:n.data,headers:n.headers}:n.data);var Nt;(function(n){n[n.SelfBuild=0]="SelfBuild",n[n.ISV=1]="ISV"})(Nt||(Nt={}));var Ut;(function(n){n[n.Feishu=0]="Feishu",n[n.Lark=1]="Lark"})(Ut||(Ut={}));var dt;(function(n){n[n.fatal=0]="fatal",n[n.error=1]="error",n[n.warn=2]="warn",n[n.info=3]="info",n[n.debug=4]="debug",n[n.trace=5]="trace"})(dt||(dt={}));var $h=Symbol("event-type"),zh=Symbol("tenant-key"),ao=Symbol("app-ticket"),Ys=Symbol("tenant-access-token"),vT=Symbol("with-helpdesk-authorization"),_T=Symbol("with-user-access-token"),QG=Symbol("user-access-token"),Zk=Symbol("aily-session-record"),VG=n=>Buffer.from(n).toString("base64"),Rh=class{constructor(){this.values=new Map}getCacheKey(t,r){return r?`${r}/${t.toString()}`:t}get(t,r){return h(this,void 0,void 0,function*(){let a=this.getCacheKey(t,r?.namespace),i=this.values.get(a);if(i){let{value:s,expiredTime:o}=i;if(!o||o-new Date().getTime()>0)return s}})}set(t,r,a,i){return h(this,void 0,void 0,function*(){let s=this.getCacheKey(t,i?.namespace);return this.values.set(s,{value:r,expiredTime:a}),!0})}},so=new Rh,io=class{constructor(t){let r=Oh.createHash("sha256");r.update(t),this.key=r.digest()}decrypt(t){let r=Buffer.from(t,"base64"),a=Oh.createDecipheriv("aes-256-cbc",this.key,r.slice(0,16)),i=a.update(r.slice(16).toString("hex"),"hex","utf8");return i+=a.final("utf8"),i}},bT=n=>{switch(n){case Ut.Feishu:return"https://open.feishu.cn";case Ut.Lark:return"https://open.larksuite.com";default:return n}},l=(n,t={})=>n.replace(/:([^/]+)/g,(r,a)=>{if(t[a]!==void 0)return t[a];throw new Error(`request miss ${a} path argument`)}),Ah=(n,t)=>h(void 0,void 0,void 0,function*(){(typeof n=="function"?n():n)&&(yield t())}),KG=n=>n?n.replace(/^\//,""):"",qh=(n,t=[])=>{let r={};return n&&t.forEach(a=>{Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])}),r},p=n=>{var t;if(n instanceof Yl){let{message:r,response:a,request:i,config:s}=qh(n,["message","response","request","config"]),e=[{message:r,config:qh(s,["data","url","params","method"]),request:qh(i,["protocol","host","path","method"]),response:qh(a,["data","status","statusText"])}],y=(t=n?.response)===null||t===void 0?void 0:t.data;return y&&(typeof y=="object"?e.push(Object.assign(Object.assign({},y),y.error?y.error:{})):e.push(y)),e}return[n]},$u=class{constructor(){this.acs={accessRecord:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/access_records`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/access_records`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},device:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/devices`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},accessRecordAccessPhoto:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/access_records/:access_record_id/access_photo`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}})},user:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/users/:user_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/users/:user_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/users`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/users`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userFace:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/users/:user_id/face`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/users/:user_id/face`,o),method:"PUT",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},ruleExternal:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/rule_external`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/rule_external`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),deviceBind:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/rule_external/device_bind`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/rule_external`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},visitor:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/visitors/:visitor_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/visitors`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{accessRecord:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/access_records`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/access_records`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},device:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/devices`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},accessRecordAccessPhoto:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/access_records/:access_record_id/access_photo`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}})},user:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/users/:user_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/users/:user_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/users`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/users`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userFace:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/users/:user_id/face`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/users/:user_id/face`,o),method:"PUT",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},ruleExternal:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/rule_external`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/rule_external`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),deviceBind:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/rule_external/device_bind`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/rule_external`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},visitor:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/visitors/:visitor_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/acs/v1/visitors`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},zu=class extends $u{constructor(){super(...arguments),this.admin={badgeGrant:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},badge:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/badges/:badge_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/badges/:badge_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/badges`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/badges`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/badges`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},password:{reset:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/password/reset`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},badgeImage:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/badge_images`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},auditInfo:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/audit_infos`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/audit_infos`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},adminUserStat:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/admin_user_stats`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},adminDeptStat:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/admin_dept_stats`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{badgeGrant:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},badge:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/badges/:badge_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/badges/:badge_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/badges`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/badges`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/badges`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},password:{reset:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/password/reset`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},badgeImage:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/badge_images`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},auditInfo:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/audit_infos`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/audit_infos`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},adminUserStat:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/admin_user_stats`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},adminDeptStat:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/admin/v1/admin_dept_stats`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Ru=class extends zu{constructor(){super(...arguments),this.aily_rag={}}},Au=class extends Ru{constructor(){super(...arguments),this.aily={v1:{ailySession:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/sessions`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appDataAssetTag:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_asset_tags`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_asset_tags`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appSkill:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/apps/:app_id/skills`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/apps/:app_id/skills`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),start:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/apps/:app_id/skills/:skill_id/start`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/apps/:app_id/skills/:skill_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appKnowledge:{ask:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/apps/:app_id/knowledges/ask`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appDataAsset:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets/:data_asset_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets/:data_asset_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),uploadFile:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets/upload_file`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},ailySessionRun:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs/:run_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),cancel:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs/:run_id/cancel`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},ailySessionAilyMessage:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/messages`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/messages`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/messages/:aily_message_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/messages`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},agentAgentVisibility:{check:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/agents/:agent_id/agent_visibility/check`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},agentAgentAttachment:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/agents/:agent_id/attachments`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},tenantAppStat:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/app_stats`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/app_stats`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},agentAgentChat:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/agents/:agent_id/chats/:agent_chat_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/agents/:agent_id/chats`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},agentAgentChatSession:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/agents/:agent_id/sessions/:agent_chat_session_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/agents/:agent_id/sessions`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/agents/:agent_id/sessions/:agent_chat_session_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/agents/:agent_id/sessions`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},agentAgentArtifact:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/aily/v1/agents/:agent_id/artifacts/:agent_artifact_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Cu=class extends Au{constructor(){super(...arguments),this.apaas={v1:{approvalTask:{addAssignee:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/approval_tasks/:approval_task_id/add_assignee`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),agree:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/approval_tasks/:approval_task_id/agree`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),transfer:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/approval_tasks/:approval_task_id/transfer`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),reject:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/approval_tasks/:approval_task_id/reject`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},applicationObjectRecord:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/:id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/:id/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/batch_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/:id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/batch_delete`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/batch_update`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchQuery:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/batch_query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},applicationObject:{oqlQuery:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/oql_query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},applicationFunction:{invoke:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/applications/:namespace/functions/:function_api_name/invoke`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},applicationRoleMember:{batchRemoveAuthorization:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/applications/:namespace/roles/:role_api_name/member/batch_remove_authorization`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/applications/:namespace/roles/:role_api_name/member`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreateAuthorization:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/applications/:namespace/roles/:role_api_name/member/batch_create_authorization`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},applicationRecordPermissionMember:{batchCreateAuthorization:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/applications/:namespace/record_permissions/:record_permission_api_name/member/batch_create_authorization`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchRemoveAuthorization:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/applications/:namespace/record_permissions/:record_permission_api_name/member/batch_remove_authorization`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},applicationEnvironmentVariable:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/applications/:namespace/environment_variables/:environment_variable_api_name`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/applications/:namespace/environment_variables/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userTask:{expediting:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/expediting`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),cc:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/cc`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),chatGroup:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/chat_group`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),rollback:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/rollback`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),rollbackPoints:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/rollback_points`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/user_task/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},applicationFlow:{execute:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/applications/:namespace/flows/:flow_id/execute`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},approvalInstance:{cancel:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/approval_instances/:approval_instance_id/cancel`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},applicationAuditLog:{auditLogList:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/applications/:namespace/audit_log/audit_log_list`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/applications/:namespace/audit_log`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),dataChangeLogsList:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/applications/:namespace/audit_log/data_change_logs_list`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),dataChangeLogDetail:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/applications/:namespace/audit_log/data_change_log_detail`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},seatAssignment:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/seat_assignments`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/seat_assignments`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},seatActivity:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/seat_activities`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/seat_activities`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},app:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/apps`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/apps`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},workspaceTable:{recordsBatchUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records_batch_update`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),recordsDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),recordsPatch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),recordsGet:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),recordsPost:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),tableGet:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},workspace:{sqlCommands:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/sql_commands`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},workspaceView:{viewsGet:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/views/:view_name/records`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},workspaceEnum:{enumGet:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/enums/:enum_name`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/enums`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},tenantAppMetrics:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/apaas/v1/tenant_app_metrics/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},ju=class extends Cu{constructor(){super(...arguments),this.application={applicationAppUsage:{overview:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/overview`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),messagePushOverview:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/message_push_overview`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),departmentOverview:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/department_overview`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},applicationFeedback:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/feedbacks`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/feedbacks/:feedback_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appRecommendRule:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/app_recommend_rules`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/app_recommend_rules`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},application:{contactsRangeConfiguration:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/contacts_range_configuration`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),underauditlistWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/underauditlist`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),underauditlist:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/underauditlist`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},applicationAppVersion:{contactsRangeSuggest:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id/contacts_range_suggest`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},applicationVisibility:{checkWhiteBlackList:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/visibility/check_white_black_list`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/visibility`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},applicationContactsRange:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/contacts_range`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},applicationCollaborators:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/collaborators`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/collaborators`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},applicationOwner:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/owner`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},applicationManagement:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/management`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},scope:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/scopes`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),apply:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/scopes/apply`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appBadge:{set:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/app_badge/set`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v5:{application:{favouriteWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v5/applications/favourite`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),favourite:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v5/applications/favourite`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),recommendWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v5/applications/recommend`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),recommend:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v5/applications/recommend`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}},v6:{applicationAppUsage:{overview:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/overview`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),messagePushOverview:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/message_push_overview`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),departmentOverview:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/department_overview`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},applicationFeedback:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/feedbacks`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/feedbacks/:feedback_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appRecommendRule:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/app_recommend_rules`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/app_recommend_rules`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},application:{contactsRangeConfiguration:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/contacts_range_configuration`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),underauditlistWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/underauditlist`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),underauditlist:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/underauditlist`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},applicationAppVersion:{contactsRangeSuggest:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id/contacts_range_suggest`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},applicationVisibility:{checkWhiteBlackList:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/visibility/check_white_black_list`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/visibility`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},applicationContactsRange:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/contacts_range`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},applicationCollaborators:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/collaborators`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/collaborators`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},applicationOwner:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/owner`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},applicationManagement:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/applications/:app_id/management`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},scope:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/scopes`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),apply:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/scopes/apply`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appBadge:{set:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v6/app_badge/set`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}},v7:{applicationBase:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v7/applications/:app_id/base`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},applicationPublish:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v7/applications/:app_id/publish`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appAvatarUpload:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v7/app_avatar/upload`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},applicationConfig:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v7/applications/:app_id/config`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},applicationAbility:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/application/v7/applications/:app_id/ability`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Du=class extends ju{constructor(){super(...arguments),this.approval={instance:{specifiedRollback:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/specified_rollback`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),cc:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/cc`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),addSign:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/add_sign`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/query`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchCc:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/search_cc`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),cancel:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/cancel`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),preview:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/preview`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),remind:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/remind`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),addCc:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/add_cc`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),recall:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/recall`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/:instance_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),detail:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/detail`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),initiatedWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/initiated`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),initiated:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/initiated`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),subscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/subscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),unsubscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/subscription`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},task:{transfer:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/transfer`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),reject:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/reject`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),resubmit:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/resubmit`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),approve:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/approve`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/query`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),refuse:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/refuse`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),pass:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/pass`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),forward:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/forward`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),addSign:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/add_sign`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),rollback:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/rollback`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),unsubscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/subscription`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),subscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/subscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},approval:{unsubscribe:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/approvals/:approval_code/unsubscribe`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),subscribe:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/approvals/:approval_code/subscribe`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/approvals`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/approvals/:approval_code`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},instanceComment:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments/:comment_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),remove:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments/remove`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},externalTask:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/external_tasks`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/external_tasks`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},externalInstance:{check:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/external_instances/check`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/external_instances`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},externalApproval:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/external_approvals/:approval_code`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/external_approvals`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},district:{searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/districts/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/districts/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/districts`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/districts`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v4:{instance:{specifiedRollback:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/specified_rollback`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),cc:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/cc`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),addSign:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/add_sign`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/query`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchCc:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/search_cc`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),cancel:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/cancel`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),preview:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/preview`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),remind:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/remind`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),addCc:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/add_cc`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),recall:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/recall`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/:instance_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),detail:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/detail`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),initiatedWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/initiated`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),initiated:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/initiated`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),subscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/subscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),unsubscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/subscription`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},task:{transfer:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/transfer`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),reject:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/reject`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),resubmit:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/resubmit`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),approve:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/approve`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/query`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),refuse:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/refuse`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),pass:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/pass`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),forward:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/forward`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),addSign:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/add_sign`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),rollback:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/rollback`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),unsubscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/subscription`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),subscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/tasks/subscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},approval:{unsubscribe:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/approvals/:approval_code/unsubscribe`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),subscribe:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/approvals/:approval_code/subscribe`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/approvals`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/approvals/:approval_code`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},instanceComment:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments/:comment_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),remove:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments/remove`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},externalTask:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/external_tasks`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/external_tasks`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},externalInstance:{check:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/external_instances/check`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/external_instances`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},externalApproval:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/external_approvals/:approval_code`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/external_approvals`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},district:{searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/districts/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/districts/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/districts`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/approval/v4/districts`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Gu=class extends Du{constructor(){super(...arguments),this.attendance_machine={}}},Bu=class extends Gu{constructor(){super(...arguments),this.attendance={file:{download:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/files/:file_id/download`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}}),upload:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/files/upload`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},group:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/groups`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/groups`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/groups/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/groups/:group_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listUser:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/groups/:group_id/list_user`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/groups`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/groups/:group_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userDailyShift:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/batch_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreateTemp:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/batch_create_temp`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userTaskRemedy:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_task_remedys`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryUserAllowedRemedys:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_task_remedys/query_user_allowed_remedys`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_task_remedys/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},shift:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/shifts`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/shifts`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/shifts/:shift_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/shifts/:shift_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/shifts/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/shifts`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userStatsField:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_stats_fields/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userStatsView:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_stats_views/:user_stats_view_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_stats_views/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},approvalInfo:{process:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/approval_infos/process`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userSetting:{modify:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_settings/modify`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_settings/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userStatsData:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_stats_datas/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},archiveRule:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/archive_rule`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/archive_rule`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),userStatsFieldsQuery:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/archive_rule/user_stats_fields_query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delReport:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/archive_rule/del_report`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),uploadReport:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/archive_rule/upload_report`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},leaveEmployExpireRecord:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/leave_employ_expire_records/:leave_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},leaveAccrualRecord:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/leave_accrual_record/:leave_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userFlow:{batchDel:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_flows/batch_del`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_flows/batch_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_flows/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_flows/:user_flow_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userApproval:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_approvals`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_approvals/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userTask:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_tasks/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{file:{download:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/files/:file_id/download`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}}),upload:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/files/upload`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},group:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/groups`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/groups`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/groups/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/groups/:group_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listUser:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/groups/:group_id/list_user`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/groups`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/groups/:group_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userDailyShift:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/batch_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreateTemp:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/batch_create_temp`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userTaskRemedy:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_task_remedys`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryUserAllowedRemedys:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_task_remedys/query_user_allowed_remedys`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_task_remedys/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},shift:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/shifts`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/shifts`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/shifts/:shift_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/shifts/:shift_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/shifts/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/shifts`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userStatsField:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_stats_fields/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userStatsView:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_stats_views/:user_stats_view_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_stats_views/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},approvalInfo:{process:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/approval_infos/process`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userSetting:{modify:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_settings/modify`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_settings/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userStatsData:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_stats_datas/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},archiveRule:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/archive_rule`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/archive_rule`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),userStatsFieldsQuery:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/archive_rule/user_stats_fields_query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delReport:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/archive_rule/del_report`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),uploadReport:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/archive_rule/upload_report`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},leaveEmployExpireRecord:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/leave_employ_expire_records/:leave_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},leaveAccrualRecord:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/leave_accrual_record/:leave_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userFlow:{batchDel:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_flows/batch_del`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_flows/batch_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_flows/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_flows/:user_flow_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userApproval:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_approvals`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_approvals/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userTask:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/attendance/v1/user_tasks/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Mu=class extends Bu{constructor(){super(...arguments),this.audio_video_ai={}}},Lu=class extends Mu{constructor(){super(...arguments),this.auth={appAccessToken:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/auth/v3/app_access_token`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),internal:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/auth/v3/app_access_token/internal`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},tenantAccessToken:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/auth/v3/tenant_access_token`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),internal:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/auth/v3/tenant_access_token/internal`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appTicket:{resend:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/auth/v3/app_ticket/resend`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v3:{appAccessToken:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/auth/v3/app_access_token`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),internal:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/auth/v3/app_access_token/internal`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},tenantAccessToken:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/auth/v3/tenant_access_token`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),internal:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/auth/v3/tenant_access_token/internal`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appTicket:{resend:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/auth/v3/app_ticket/resend`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Nu=class extends Lu{constructor(){super(...arguments),this.authen={userInfo:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/authen/v1/user_info`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},accessToken:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/authen/v1/access_token`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},refreshAccessToken:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/authen/v1/refresh_access_token`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},oidcAccessToken:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/authen/v1/oidc/access_token`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},oidcRefreshAccessToken:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/authen/v1/oidc/refresh_access_token`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{userInfo:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/authen/v1/user_info`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},accessToken:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/authen/v1/access_token`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},refreshAccessToken:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/authen/v1/refresh_access_token`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},oidcAccessToken:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/authen/v1/oidc/access_token`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},oidcRefreshAccessToken:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/authen/v1/oidc/refresh_access_token`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Uu=class extends Nu{constructor(){super(...arguments),this.authz={}}},Wu=class extends Uu{constructor(){super(...arguments),this.aweme_ecosystem={}}},Hu=class extends Wu{constructor(){super(...arguments),this.baike={entity:{match:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/entities/match`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),highlight:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/entities/highlight`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/entities/:entity_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/entities`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/entities`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),extract:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/entities/extract`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/entities/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/entities/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/entities`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/entities/:entity_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},classification:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/classifications`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/classifications`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},file:{upload:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/files/upload`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null}),download:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/files/:file_token/download`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}})},draft:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/drafts`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/drafts/:draft_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{entity:{match:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/entities/match`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),highlight:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/entities/highlight`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/entities/:entity_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/entities`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/entities`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),extract:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/entities/extract`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/entities/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/entities/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/entities`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/entities/:entity_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},classification:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/classifications`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/classifications`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},file:{upload:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/files/upload`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null}),download:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/files/:file_token/download`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}})},draft:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/drafts`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/baike/v1/drafts/:draft_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Qu=class extends Hu{constructor(){super(...arguments),this.base={v2:{appRole:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/base/v2/apps/:app_token/roles`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/base/v2/apps/:app_token/roles`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/base/v2/apps/:app_token/roles`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/base/v2/apps/:app_token/roles/:role_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Vu=class extends Qu{constructor(){super(...arguments),this.bitable={appTable:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/batch_delete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/batch_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appDashboard:{copy:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards/:block_id/copy`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},app:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),copy:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/copy`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appTableRecord:{batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_delete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_update`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchGet:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_get`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appRoleMember:{batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_delete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/:member_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appRole:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appTableView:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appTableForm:{upgrade:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/upgrade`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appTableFieldGroup:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/field_groups`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appTableFormField:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields/:field_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appWorkflow:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows/:workflow_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appTableField:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appBlockWorkflow:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/block_workflows`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{appTable:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/batch_delete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/batch_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appDashboard:{copy:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards/:block_id/copy`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},app:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),copy:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/copy`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appTableRecord:{batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_delete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_update`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchGet:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_get`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appRoleMember:{batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_delete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/:member_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appRole:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appTableView:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appTableForm:{upgrade:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/upgrade`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appTableFieldGroup:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/field_groups`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appTableFormField:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields/:field_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appWorkflow:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows/:workflow_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appTableField:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appBlockWorkflow:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bitable/v1/apps/:app_token/block_workflows`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Ku=class extends Vu{constructor(){super(...arguments),this.block={entity:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/block/v2/entities`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/block/v2/entities/:block_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},message:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/block/v2/message`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v2:{entity:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/block/v2/entities`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/block/v2/entities/:block_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},message:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/block/v2/message`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Ju=class extends Ku{constructor(){super(...arguments),this.board={v1:{whiteboardNode:{batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/nodes/batch_delete`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),createPlantuml:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/nodes/plantuml`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/nodes`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/nodes`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},whiteboard:{downloadAsImage:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/download_as_image`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}}),theme:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/theme`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),updateTheme:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/update_theme`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Xu=class extends Ju{constructor(){super(...arguments),this.bot={v4:{bot:{searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/bot/v4/bot/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/bot/v4/bot/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Yu=class extends Xu{constructor(){super(...arguments),this.c360={}}},Zu=class extends Yu{constructor(){super(...arguments),this.calendar={exchangeBinding:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/exchange_bindings`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},calendar:{subscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/subscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),unsubscribe:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/unsubscribe`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),unsubscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/unsubscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),subscribe:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/subscribe`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),mget:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/mget`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),primarys:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/primarys`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),primary:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/primary`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},calendarAcl:{unsubscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/unsubscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),subscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/subscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/:acl_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},calendarEvent:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),reply:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/reply`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),unsubscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/unsubscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),subscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/subscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),instances:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/instances`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),instanceView:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/instance_view`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},calendarEventAttendee:{batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/batch_delete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},setting:{generateCaldavConf:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/settings/generate_caldav_conf`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},timeoffEvent:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/timeoff_events/:timeoff_event_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/timeoff_events`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},calendarEventMeetingMinute:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_minute`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},calendarEventMeetingChat:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},freebusy:{batch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/freebusy/batch`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/freebusy/list`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},calendarEventAttendeeChatMember:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v4:{exchangeBinding:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/exchange_bindings`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},calendar:{subscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/subscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),unsubscribe:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/unsubscribe`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),unsubscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/unsubscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),subscribe:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/subscribe`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),mget:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/mget`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),primarys:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/primarys`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),primary:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/primary`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},calendarAcl:{unsubscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/unsubscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),subscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/subscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/:acl_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},calendarEvent:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),reply:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/reply`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),unsubscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/unsubscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),subscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/subscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),instances:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/instances`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),instanceView:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/instance_view`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},calendarEventAttendee:{batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/batch_delete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},setting:{generateCaldavConf:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/settings/generate_caldav_conf`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},timeoffEvent:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/timeoff_events/:timeoff_event_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/timeoff_events`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},calendarEventMeetingMinute:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_minute`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},calendarEventMeetingChat:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},freebusy:{batch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/freebusy/batch`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/freebusy/list`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},calendarEventAttendeeChatMember:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},em=class extends Zu{constructor(){super(...arguments),this.cardkit={v1:{card:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/cardkit/v1/cards`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),settings:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/settings`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/cardkit/v1/cards/:card_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),idConvert:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/cardkit/v1/cards/id_convert`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/batch_update`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},cardElement:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements/:element_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),content:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements/:element_id/content`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements/:element_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements/:element_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},tm=class extends em{constructor(){super(...arguments),this.ccm_unified_resource={}}},rm=class extends tm{constructor(){super(...arguments),this.collab_plugins={}}},am=class extends rm{constructor(){super(...arguments),this.comment_sdk={}}},im=class extends am{constructor(){super(...arguments),this.compensation={v1:{indicator:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/indicators`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/indicators`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},socialPlan:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/social_plans/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/social_plans`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/social_plans`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},item:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/items`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/items`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},plan:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/plans`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/plans`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},socialInsurance:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/social_insurances`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},itemCategory:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/item_categories`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/item_categories`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},changeReason:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/change_reasons`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/change_reasons`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},archive:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/archives`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/archives/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},recurringPayment:{queryWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/recurring_payment/query`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/recurring_payment/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/recurring_payment/batch_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/recurring_payment/batch_update`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchRemove:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/recurring_payment/batch_remove`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},socialArchive:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/social_archive/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},socialArchiveAdjustRecord:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/social_archive_adjust_record/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},lumpSumPayment:{batchRemove:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/batch_remove`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/batch_update`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/query`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/batch_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryDetailWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/query_detail`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),queryDetail:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/query_detail`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},sm=class extends im{constructor(){super(...arguments),this.contact={group:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/group/:group_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),memberBelong:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/group/member_belong`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/group/:group_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),simplelistWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/group/simplelist`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),simplelist:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/group/simplelist`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/group`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/group/:group_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},unit:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/unit`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listDepartment:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/unit/list_department`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),unbindDepartment:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/unit/unbind_department`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),bindDepartment:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/unit/bind_department`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/unit`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},groupMember:{simplelist:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/group/:group_id/member/simplelist`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),add:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/group/:group_id/member/add`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),remove:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/group/:group_id/member/remove`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchRemove:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/group/:group_id/member/batch_remove`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchAdd:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/group/:group_id/member/batch_add`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},department:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/:department_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),updateDepartmentId:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/:department_id/update_department_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),unbindDepartmentChat:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/unbind_department_chat`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),parentWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/parent`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),parent:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/parent`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),childrenWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/:department_id/children`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),children:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/:department_id/children`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/:department_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/:department_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/batch`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/:department_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobLevel:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_levels`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_levels`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_levels`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobFamily:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_families`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_families`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_families`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},user:{updateUserId:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users/:user_id/update_user_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),resurrect:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users/:user_id/resurrect`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users/:user_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchGetId:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users/batch_get_id`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users/:user_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),findByDepartmentWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users/find_by_department`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),findByDepartment:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users/find_by_department`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users/:user_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users/:user_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),basicBatch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users/basic_batch`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users/batch`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},employeeTypeEnum:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/employee_type_enums`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/employee_type_enums`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/employee_type_enums`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/employee_type_enums/:enum_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/employee_type_enums/:enum_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},functionalRoleMember:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/:member_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/batch_delete`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),scopes:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/scopes`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/batch_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},functionalRole:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/functional_roles`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobTitle:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_titles/:job_title_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_titles`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_titles`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},workCity:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/work_cities/:work_city_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/work_cities`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/work_cities`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},scope:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/scopes`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/scopes`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},customAttr:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/custom_attrs`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/custom_attrs`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v3:{group:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/group/:group_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),memberBelong:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/group/member_belong`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/group/:group_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),simplelistWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/group/simplelist`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),simplelist:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/group/simplelist`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/group`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/group/:group_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},unit:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/unit`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listDepartment:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/unit/list_department`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),unbindDepartment:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/unit/unbind_department`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),bindDepartment:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/unit/bind_department`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/unit`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},groupMember:{simplelist:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/group/:group_id/member/simplelist`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),add:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/group/:group_id/member/add`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),remove:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/group/:group_id/member/remove`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchRemove:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/group/:group_id/member/batch_remove`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchAdd:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/group/:group_id/member/batch_add`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},department:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/:department_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),updateDepartmentId:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/:department_id/update_department_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),unbindDepartmentChat:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/unbind_department_chat`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),parentWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/parent`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),parent:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/parent`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),childrenWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/:department_id/children`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),children:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/:department_id/children`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/:department_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/:department_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/batch`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/departments/:department_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobLevel:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_levels`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_levels`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_levels`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobFamily:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_families`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_families`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_families`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},user:{updateUserId:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users/:user_id/update_user_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),resurrect:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users/:user_id/resurrect`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users/:user_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchGetId:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users/batch_get_id`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users/:user_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),findByDepartmentWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users/find_by_department`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),findByDepartment:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users/find_by_department`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users/:user_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users/:user_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),basicBatch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users/basic_batch`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/users/batch`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},employeeTypeEnum:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/employee_type_enums`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/employee_type_enums`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/employee_type_enums`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/employee_type_enums/:enum_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/employee_type_enums/:enum_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},functionalRoleMember:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/:member_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/batch_delete`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),scopes:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/scopes`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/batch_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},functionalRole:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/functional_roles`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobTitle:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_titles/:job_title_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_titles`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/job_titles`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},workCity:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/work_cities/:work_city_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/work_cities`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/work_cities`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},scope:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/scopes`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/scopes`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},customAttr:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/custom_attrs`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/contact/v3/custom_attrs`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},om=class extends sm{constructor(){super(...arguments),this.content_check={}}},nm=class extends om{constructor(){super(...arguments),this.contract={}}},hm=class extends nm{constructor(){super(...arguments),this.corehr={contract:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/contracts`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/contracts`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},company:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/companies`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/companies`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},employeeType:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/employee_types`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/employee_types`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},nationalIdType:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/national_id_types`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/national_id_types`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},subregion:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/subregions`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/subregions/:subregion_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},countryRegion:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/country_regions`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/country_regions/:country_region_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},subdivision:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/subdivisions/:subdivision_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/subdivisions`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},preHire:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/pre_hires`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},person:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),upload:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/persons/upload`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/persons`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},employment:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/employments/:employment_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/employments`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/employments/:employment_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobLevel:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_levels`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_levels`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobFamily:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_families`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_families`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},job:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/jobs`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/jobs`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobChange:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_changes`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},workingHoursType:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/working_hours_types`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/working_hours_types`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},department:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/departments`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/departments`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},location:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/locations/:location_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/locations`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/locations`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/locations/:location_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},file:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/files/:id`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}})},processFormVariableData:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/processes/:process_id/form_variable_data`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},commonDataId:{convert:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/common_data/id/convert`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},leaveGrantingRecord:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/leave_granting_records/:leave_granting_record_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/leave_granting_records`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},leave:{leaveTypes:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/leaves/leave_types`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),workCalendar:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/leaves/work_calendar`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),workCalendarDate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/leaves/work_calendar_date`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),calendarByScope:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/leaves/calendar_by_scope`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),leaveBalances:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/leaves/leave_balances`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),leaveRequestHistory:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/leaves/leave_request_history`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},offboarding:{submit:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/offboardings/submit`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/offboardings/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/offboardings/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/offboardings/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},securityGroup:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/security_groups`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/security_groups/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},customField:{listObjectApiName:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/custom_fields/list_object_api_name`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getByParam:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/custom_fields/get_by_param`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/custom_fields/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},commonDataMetaData:{editEnumOption:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/common_data/meta_data/edit_enum_option`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),addEnumOption:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/common_data/meta_data/add_enum_option`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},authorization:{updateRoleAssign:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/authorizations/update_role_assign`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),removeRoleAssign:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/authorizations/remove_role_assign`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),addRoleAssign:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/authorizations/add_role_assign`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getByParam:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/authorizations/get_by_param`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/authorizations/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},assignedUser:{search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/assigned_users/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobData:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_datas`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_datas`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},currency:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/currencies`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/currencies/:currency_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},transferReason:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/transfer_reasons/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},transferType:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/transfer_types/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},compensationStandard:{match:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/compensation_standards/match`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{contract:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/contracts`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/contracts`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},company:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/companies`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/companies`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},employeeType:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/employee_types`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/employee_types`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},nationalIdType:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/national_id_types`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/national_id_types`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},subregion:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/subregions`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/subregions/:subregion_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},countryRegion:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/country_regions`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/country_regions/:country_region_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},subdivision:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/subdivisions/:subdivision_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/subdivisions`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},preHire:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/pre_hires`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},person:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),upload:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/persons/upload`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/persons`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},employment:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/employments/:employment_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/employments`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/employments/:employment_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobLevel:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_levels`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_levels`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobFamily:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_families`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_families`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},job:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/jobs`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/jobs`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobChange:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_changes`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},workingHoursType:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/working_hours_types`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/working_hours_types`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},department:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/departments`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/departments`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},location:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/locations/:location_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/locations`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/locations`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/locations/:location_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},file:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/files/:id`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}})},processFormVariableData:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/processes/:process_id/form_variable_data`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},commonDataId:{convert:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/common_data/id/convert`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},leaveGrantingRecord:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/leave_granting_records/:leave_granting_record_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/leave_granting_records`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},leave:{leaveTypes:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/leaves/leave_types`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),workCalendar:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/leaves/work_calendar`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),workCalendarDate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/leaves/work_calendar_date`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),calendarByScope:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/leaves/calendar_by_scope`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),leaveBalances:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/leaves/leave_balances`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),leaveRequestHistory:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/leaves/leave_request_history`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},offboarding:{submit:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/offboardings/submit`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/offboardings/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/offboardings/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/offboardings/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},securityGroup:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/security_groups`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/security_groups/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},customField:{listObjectApiName:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/custom_fields/list_object_api_name`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getByParam:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/custom_fields/get_by_param`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/custom_fields/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},commonDataMetaData:{editEnumOption:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/common_data/meta_data/edit_enum_option`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),addEnumOption:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/common_data/meta_data/add_enum_option`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},authorization:{updateRoleAssign:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/authorizations/update_role_assign`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),removeRoleAssign:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/authorizations/remove_role_assign`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),addRoleAssign:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/authorizations/add_role_assign`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getByParam:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/authorizations/get_by_param`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/authorizations/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},assignedUser:{search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/assigned_users/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobData:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_datas`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/job_datas`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},currency:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/currencies`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/currencies/:currency_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},transferReason:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/transfer_reasons/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},transferType:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/transfer_types/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},compensationStandard:{match:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v1/compensation_standards/match`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}},v2:{costCenter:{search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/cost_centers/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryRecentChangeWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/cost_centers/query_recent_change`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),queryRecentChange:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/cost_centers/query_recent_change`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryMultiTimeline:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/cost_centers/query_multi_timeline`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/cost_centers`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),tree:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/cost_centers/tree`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},basicInfoCountryRegionSubdivision:{searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/basic_info/country_region_subdivisions/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/basic_info/country_region_subdivisions/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},probation:{submit:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/probation/submit`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),withdraw:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/probation/withdraw`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),enableDisableAssessment:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/probation/enable_disable_assessment`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),edit:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/probation/edit`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/probation/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/probation/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},probationAssessment:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/probation/assessments/:assessment_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/probation/assessments/:assessment_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/probation/assessments`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},customOrg:{deleteOrg:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/custom_orgs/delete_org`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),active:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/custom_orgs/active`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryRecentChangeWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/custom_orgs/query_recent_change`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),queryRecentChange:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/custom_orgs/query_recent_change`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/custom_orgs/:org_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),updateRule:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/custom_orgs/update_rule`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/custom_orgs`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/custom_orgs/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},preHire:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/pre_hires/:pre_hire_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),transitTask:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/pre_hires/:pre_hire_id/transit_task`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),withdrawOnboarding:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/pre_hires/withdraw_onboarding`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),restoreFlowInstance:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/pre_hires/restore_flow_instance`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),transformOnboardingTask:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/pre_hires/transform_onboarding_task`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),complete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/pre_hires/:pre_hire_id/complete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/pre_hires/:pre_hire_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/pre_hires`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/pre_hires/query`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/pre_hires/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/pre_hires/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/pre_hires/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobGrade:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/job_grades/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/job_grades/:job_grade_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/job_grades/:job_grade_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/job_grades`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryRecentChangeWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/job_grades/query_recent_change`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),queryRecentChange:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/job_grades/query_recent_change`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},position:{active:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/positions/active`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delPosition:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/positions/del_position`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryRecentChangeWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/positions/query_recent_change`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),queryRecentChange:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/positions/query_recent_change`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/positions/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/positions`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/positions/:position_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},employeesBp:{batchGet:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/employees/bps/batch_get`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},bp:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/bps`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/bps`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getByDepartment:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/bps/get_by_department`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},employeesAdditionalJob:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs/:additional_job_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs/:additional_job_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs/batch`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),batch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs/batch`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},basicInfoNationality:{searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/basic_info/nationalities/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/basic_info/nationalities/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},basicInfoCountryRegion:{searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/basic_info/country_regions/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/basic_info/country_regions/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},basicInfoCity:{searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/basic_info/cities/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/basic_info/cities/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},basicInfoDistrict:{searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/basic_info/districts/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/basic_info/districts/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},basicInfoBank:{searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/basic_info/banks/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/basic_info/banks/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},basicInfoCurrency:{searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/basic_info/currencies/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/basic_info/currencies/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},employeeCustomOrg:{del:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/custom_org/del`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),createEmpCustomOrg:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/custom_org/create_emp_custom_org`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),editEmpCustomOrg:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/custom_org/edit_emp_custom_org`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),employmentCustomOrgRecord:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/custom_org/employment_custom_org_record`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),querybyid:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/custom_org/querybyid`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},signatureFile:{listByBizId:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/signature_files/list_by_biz_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),download:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/signature_files/:signature_file_id/download`,o),method:"POST",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}}),terminate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/signature_files/terminate`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/signature_files/query`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/signature_files/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/signature_files`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/signature_files`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},signatureNode:{listByFileId:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/signature_nodes/list_by_file_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},company:{active:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/companies/active`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryRecentChangeWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/companies/query_recent_change`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),queryRecentChange:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/companies/query_recent_change`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryMultiTimeline:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/companies/query_multi_timeline`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchGet:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/companies/batch_get`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},department:{queryRecentChangeWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/departments/query_recent_change`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),queryRecentChange:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/departments/query_recent_change`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryOperationLogsWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/departments/query_operation_logs`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),queryOperationLogs:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/departments/query_operation_logs`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchGet:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/departments/batch_get`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/departments/:department_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/departments/:department_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryTimeline:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/departments/query_timeline`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryMultiTimeline:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/departments/query_multi_timeline`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),parents:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/departments/parents`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/departments/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/departments/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),tree:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/departments/tree`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},draft:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/drafts/:draft_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},approvalGroups:{openQueryPositionChangeListByIds:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/approval_groups/open_query_position_change_list_by_ids`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/approval_groups/:process_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),openQueryJobChangeListByIds:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/approval_groups/open_query_job_change_list_by_ids`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),openQueryDepartmentChangeListByIds:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/approval_groups/open_query_department_change_list_by_ids`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},location:{active:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/locations/active`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryRecentChangeWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/locations/query_recent_change`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),queryRecentChange:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/locations/query_recent_change`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryMultiTimeline:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/locations/query_multi_timeline`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchGet:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/locations/batch_get`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/locations/:location_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},locationAddress:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/locations/:location_id/addresses/:address_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/locations/:location_id/addresses/:address_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/locations/:location_id/addresses`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},basicInfoLanguage:{searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/basic_info/languages/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/basic_info/languages/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},basicInfoTimeZone:{searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/basic_info/time_zones/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/basic_info/time_zones/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},reportDetailRow:{batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/report_detail_row/batchDelete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchSave:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/report_detail_row/batchSave`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},workforcePlanDetailRow:{batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/workforce_plan_detail_row/batchDelete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchSave:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/workforce_plan_detail_row/batchSave`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},offboarding:{submitV2:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/offboardings/submit_v2`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),edit:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/offboardings/edit`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),revoke:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/offboardings/revoke`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},basicInfoBankBranch:{searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/basic_info/bank_branchs/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/basic_info/bank_branchs/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},enum:{search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/enums/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},process:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/processes`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/processes`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),flowVariableData:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/processes/:process_id/flow_variable_data`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/processes/:process_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},processApprover:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/processes/:process_id/approvers/:approver_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},processWithdraw:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/process_withdraw/:process_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},approver:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/approvers`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/approvers`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},processTransfer:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/processes/:process_id/transfer`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},processExtra:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/processes/:process_id/extra`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobLevel:{queryRecentChangeWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/job_levels/query_recent_change`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),queryRecentChange:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/job_levels/query_recent_change`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchGet:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/job_levels/batch_get`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobFamily:{queryRecentChangeWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/job_families/query_recent_change`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),queryRecentChange:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/job_families/query_recent_change`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryMultiTimeline:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/job_families/query_multi_timeline`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchGet:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/job_families/batch_get`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},job:{queryRecentChangeWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/jobs/query_recent_change`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),queryRecentChange:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/jobs/query_recent_change`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryMultiTimeline:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/jobs/query_multi_timeline`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/jobs/:job_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/jobs`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchGet:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/jobs/batch_get`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},employeesInternationalAssignment:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/employees/international_assignments/:international_assignment_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/employees/international_assignments`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/employees/international_assignments`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/employees/international_assignments/:international_assignment_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/employees/international_assignments`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},processFormVariableData:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/processes/:process_id/form_variable_data`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},pathway:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/pathways`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/pathways/:pathway_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/pathways/:pathway_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),active:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/pathways/active`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchGet:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/pathways/batch_get`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},processStart:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/process_start`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},costAllocation:{batchQuery:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/cost_allocations/batch_query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),updateVersion:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/cost_allocations/update_version`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),createVersion:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/cost_allocations/create_version`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),removeVersion:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/cost_allocations/remove_version`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},costCenterVersion:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id/versions/:version_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id/versions`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id/versions/:version_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},processQueryFlowDataTemplate:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/query_flow_data_template`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},defaultCostCenter:{createVersion:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/default_cost_centers/create_version`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchQuery:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/default_cost_centers/batch_query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),removeVersion:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/default_cost_centers/remove_version`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),updateVersion:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/default_cost_centers/update_version`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},processRevoke:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/process_revoke/:process_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},signatureTemplateInfoWithThumbnail:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/signature_template_info_with_thumbnails`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/signature_template_info_with_thumbnails`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobChange:{revoke:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/job_changes/:job_change_id/revoke`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/job_changes`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/job_changes/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/job_changes/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},contract:{searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/contracts/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/contracts/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},workforcePlanDetail:{batch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/workforce_plan_details/batch`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchV2:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/workforce_plan_details/batch_v2`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},employee:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/employees`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchGet:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/employees/batch_get`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/employees/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/employees/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},signatureTemplate:{search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/signature_templates/search`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},employeesJobData:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/employees/job_datas/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchGet:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/employees/job_datas/batch_get`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},person:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/persons/:person_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/persons`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},workforcePlan:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/workforce_plans`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/corehr/v2/workforce_plans`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},dm=class extends hm{constructor(){super(...arguments),this.data_cube={}}},cm=class extends dm{constructor(){super(...arguments),this.device={}}},lm=class extends cm{constructor(){super(...arguments),this.directory={v1:{employee:{resurrect:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/directory/v1/employees/:employee_id/resurrect`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),regular:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/directory/v1/employees/:employee_id/regular`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),toBeResigned:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/directory/v1/employees/:employee_id/to_be_resigned`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/directory/v1/employees/:employee_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/directory/v1/employees`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/directory/v1/employees/:employee_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),filter:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/directory/v1/employees/filter`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/directory/v1/employees/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),mget:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/directory/v1/employees/mget`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},collaborationTenant:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/directory/v1/collaboration_tenants`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/directory/v1/collaboration_tenants`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},collaborationRule:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/directory/v1/collaboration_rules/:collaboration_rule_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/directory/v1/collaboration_rules`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/directory/v1/collaboration_rules`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/directory/v1/collaboration_rules`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/directory/v1/collaboration_rules/:collaboration_rule_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},collborationShareEntity:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/directory/v1/share_entities`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/directory/v1/share_entities`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},department:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/directory/v1/departments`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/directory/v1/departments/:department_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/directory/v1/departments/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),mget:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/directory/v1/departments/mget`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/directory/v1/departments/:department_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),filter:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/directory/v1/departments/filter`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},pm=class extends lm{constructor(){super(...arguments),this.docs_ai={}}},um=class extends pm{constructor(){super(...arguments),this.docs_tool={}}},mm=class extends um{constructor(){super(...arguments),this.docs={v1:{content:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docs/v1/content`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},fm=class extends mm{constructor(){super(...arguments),this.document_ai={v1:{businessCard:{recognize:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/document_ai/v1/business_card/recognize`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},contract:{fieldExtraction:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/document_ai/v1/contract/field_extraction`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},businessLicense:{recognize:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/document_ai/v1/business_license/recognize`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},drivingLicense:{recognize:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/document_ai/v1/driving_license/recognize`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},vehicleLicense:{recognize:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/document_ai/v1/vehicle_license/recognize`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},foodManageLicense:{recognize:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/document_ai/v1/food_manage_license/recognize`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},foodProduceLicense:{recognize:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/document_ai/v1/food_produce_license/recognize`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},hkmMainlandTravelPermit:{recognize:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/document_ai/v1/hkm_mainland_travel_permit/recognize`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},chinesePassport:{recognize:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/document_ai/v1/chinese_passport/recognize`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},twMainlandTravelPermit:{recognize:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/document_ai/v1/tw_mainland_travel_permit/recognize`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},healthCertificate:{recognize:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/document_ai/v1/health_certificate/recognize`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},vehicleInvoice:{recognize:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/document_ai/v1/vehicle_invoice/recognize`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},resume:{parse:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/document_ai/v1/resume/parse`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},bankCard:{recognize:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/document_ai/v1/bank_card/recognize`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},trainInvoice:{recognize:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/document_ai/v1/train_invoice/recognize`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},taxiInvoice:{recognize:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/document_ai/v1/taxi_invoice/recognize`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},vatInvoice:{recognize:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/document_ai/v1/vat_invoice/recognize`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},idCard:{recognize:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/document_ai/v1/id_card/recognize`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})}}}}},ym=class extends fm{constructor(){super(...arguments),this.docx={document:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/:document_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),rawContent:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/:document_id/raw_content`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),convert:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/blocks/convert`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chatAnnouncementBlockChildren:{batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children/batch_delete`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},documentBlockChildren:{batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children/batch_delete`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chatAnnouncement:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chatAnnouncementBlock:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/batch_update`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},documentBlock:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/batch_update`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},documentBlockDescendant:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/descendant`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{document:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/:document_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),rawContent:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/:document_id/raw_content`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),convert:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/blocks/convert`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chatAnnouncementBlockChildren:{batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children/batch_delete`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},documentBlockChildren:{batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children/batch_delete`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chatAnnouncement:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chatAnnouncementBlock:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/batch_update`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},documentBlock:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/batch_update`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},documentBlockDescendant:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/descendant`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},gm=class extends ym{constructor(){super(...arguments),this.drive={file:{createFolder:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/create_folder`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),move:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/move`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),copy:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/copy`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),createShortcut:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/create_shortcut`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),uploadPart:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/upload_part`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),taskCheck:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/task_check`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),deleteSubscribe:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/delete_subscribe`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getSubscribe:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/get_subscribe`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),subscribe:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/subscribe`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),download:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/download`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}}),uploadPrepare:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/upload_prepare`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),uploadFinish:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/upload_finish`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),uploadAll:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/upload_all`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},meta:{batchQuery:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/metas/batch_query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},fileSubscription:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},exportTask:{download:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/export_tasks/file/:file_token/download`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/export_tasks/:ticket`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/export_tasks`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},fileVersion:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},fileViewRecord:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/view_records`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/view_records`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},fileStatistics:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/statistics`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},permissionPublicPassword:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},fileComment:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchQuery:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/batch_query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},media:{batchGetTmpDownloadUrl:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/medias/batch_get_tmp_download_url`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),download:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/medias/:file_token/download`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}}),uploadPart:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/medias/upload_part`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null}),uploadFinish:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/medias/upload_finish`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),uploadAll:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/medias/upload_all`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null}),uploadPrepare:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/medias/upload_prepare`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},importTask:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/import_tasks/:ticket`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/import_tasks`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},user:{subscriptionStatus:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/user/subscription_status`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),removeSubscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/user/remove_subscription`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),subscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/user/subscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},fileCommentReply:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},permissionPublic:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/permissions/:token/public`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/permissions/:token/public`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},permissionMember:{batchCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/permissions/:token/members/batch_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/permissions/:token/members/:member_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/permissions/:token/members/:member_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),transferOwner:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/permissions/:token/members/transfer_owner`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),auth:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/permissions/:token/members/auth`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/permissions/:token/members`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/permissions/:token/members`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{file:{createFolder:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/create_folder`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),move:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/move`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),copy:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/copy`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),createShortcut:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/create_shortcut`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),uploadPart:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/upload_part`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),taskCheck:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/task_check`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),deleteSubscribe:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/delete_subscribe`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getSubscribe:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/get_subscribe`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),subscribe:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/subscribe`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),download:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/download`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}}),uploadPrepare:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/upload_prepare`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),uploadFinish:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/upload_finish`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),uploadAll:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/upload_all`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},meta:{batchQuery:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/metas/batch_query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},fileSubscription:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},exportTask:{download:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/export_tasks/file/:file_token/download`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/export_tasks/:ticket`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/export_tasks`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},fileVersion:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},fileViewRecord:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/view_records`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/view_records`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},fileStatistics:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/statistics`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},permissionPublicPassword:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},fileComment:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchQuery:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/batch_query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},media:{batchGetTmpDownloadUrl:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/medias/batch_get_tmp_download_url`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),download:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/medias/:file_token/download`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}}),uploadPart:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/medias/upload_part`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null}),uploadFinish:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/medias/upload_finish`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),uploadAll:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/medias/upload_all`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null}),uploadPrepare:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/medias/upload_prepare`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},importTask:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/import_tasks/:ticket`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/import_tasks`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},user:{subscriptionStatus:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/user/subscription_status`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),removeSubscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/user/remove_subscription`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),subscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/user/subscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},fileCommentReply:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},permissionPublic:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/permissions/:token/public`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/permissions/:token/public`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},permissionMember:{batchCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/permissions/:token/members/batch_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/permissions/:token/members/:member_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/permissions/:token/members/:member_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),transferOwner:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/permissions/:token/members/transfer_owner`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),auth:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/permissions/:token/members/auth`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/permissions/:token/members`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v1/permissions/:token/members`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}},v2:{fileLike:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v2/files/:file_token/likes`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v2/files/:file_token/likes`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},commentReaction:{updateReaction:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v2/files/:file_token/comments/reaction`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},permissionPublic:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v2/permissions/:token/public`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/drive/v2/permissions/:token/public`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},vm=class extends gm{constructor(){super(...arguments),this.ea_symphony={}}},_m=class extends vm{constructor(){super(...arguments),this.edu={}}},bm=class extends _m{constructor(){super(...arguments),this.ehr={attachment:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/ehr/v1/attachments/:token`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}})},employee:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/ehr/v1/employees`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/ehr/v1/employees`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{attachment:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/ehr/v1/attachments/:token`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}})},employee:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/ehr/v1/employees`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/ehr/v1/employees`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},wm=class extends bm{constructor(){super(...arguments),this.elearning={}}},Sm=class extends wm{constructor(){super(...arguments),this.event={outboundIp:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/event/v1/outbound_ip`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/event/v1/outbound_ip`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},connection:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/event/v1/connection`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{outboundIp:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/event/v1/outbound_ip`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/event/v1/outbound_ip`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},connection:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/event/v1/connection`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Im=class extends Sm{constructor(){super(...arguments),this.exam={}}},km=class extends Im{constructor(){super(...arguments),this.face_detection={}}},Tm=class extends km{constructor(){super(...arguments),this.financial_access_platform={}}},xm=class extends Tm{constructor(){super(...arguments),this.grounding={}}},Pm=class extends xm{constructor(){super(...arguments),this.gtm_ai={}}},qm=class extends Pm{constructor(){super(...arguments),this.helpdesk={agent:{agentEmail:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agent_emails`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},agentSchedule:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agent_schedules`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agent_schedules`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},agentSkill:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agent_skills`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agent_skills`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},agentSkillRule:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agent_skill_rules`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},category:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/categories`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/categories`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},event:{subscribe:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/events/subscribe`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),unsubscribe:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/events/unsubscribe`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},faq:{faqImage:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/faqs/:id/image/:image_key`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/faqs`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/faqs`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/faqs/search`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/faqs/search`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/faqs`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},agentSchedules:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},ticket:{customizedFields:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/customized_fields`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),ticketImage:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/ticket_images`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/tickets`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),startService:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/start_service`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),answerUserQuery:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/answer_user_query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},ticketCustomizedField:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},notification:{cancelApprove:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/cancel_approve`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),cancelSend:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/cancel_send`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/notifications`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),executeSend:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/execute_send`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),preview:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/preview`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),submitApprove:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/submit_approve`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},ticketMessage:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/messages`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/messages`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},botMessage:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/message`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{agent:{agentEmail:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agent_emails`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},agentSchedule:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agent_schedules`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agent_schedules`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},agentSkill:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agent_skills`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agent_skills`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},agentSkillRule:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agent_skill_rules`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},category:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/categories`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/categories`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},event:{subscribe:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/events/subscribe`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),unsubscribe:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/events/unsubscribe`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},faq:{faqImage:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/faqs/:id/image/:image_key`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/faqs`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/faqs`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/faqs/search`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/faqs/search`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/faqs`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},agentSchedules:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},ticket:{customizedFields:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/customized_fields`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),ticketImage:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/ticket_images`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/tickets`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),startService:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/start_service`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),answerUserQuery:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/answer_user_query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},ticketCustomizedField:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},notification:{cancelApprove:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/cancel_approve`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),cancelSend:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/cancel_send`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/notifications`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),executeSend:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/execute_send`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),preview:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/preview`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),submitApprove:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/submit_approve`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},ticketMessage:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/messages`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/messages`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},botMessage:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/helpdesk/v1/message`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Em=class extends qm{constructor(){super(...arguments),this.hire={websiteChannel:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels/:channel_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels/:channel_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},interviewRoundType:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interview_round_types`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},offerCustomField:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/offer_custom_fields/:offer_custom_field_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},websiteDelivery:{createByAttachment:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/deliveries/create_by_attachment`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),createByResume:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/deliveries/create_by_resume`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},interviewRecordAttachment:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interview_records/attachments`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},talent:{batchGetId:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talents/batch_get_id`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),onboardStatus:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talents/:talent_id/onboard_status`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),addToFolder:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talents/add_to_folder`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),tag:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talents/:talent_id/tag`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),removeToFolder:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talents/remove_to_folder`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),combinedCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talents/combined_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talents`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talents/:talent_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),combinedUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talents/combined_update`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},externalInterviewAssessment:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_interview_assessments/:external_interview_assessment_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_interview_assessments`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},referralWebsiteJobPost:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts/:job_post_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},job:{config:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/jobs/:job_id/config`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),close:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/jobs/:job_id/close`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/jobs/:job_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),updateConfig:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/jobs/:job_id/update_config`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),open:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/jobs/:job_id/open`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),recruiter:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/jobs/:job_id/recruiter`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),combinedUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/jobs/:job_id/combined_update`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),combinedCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/jobs/combined_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getDetail:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/jobs/:job_id/get_detail`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/jobs`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},location:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/locations/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/locations`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/locations`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},externalReferralReward:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_referral_rewards`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_referral_rewards/:external_referral_reward_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},note:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/notes/:note_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/notes/:note_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/notes`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/notes`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/notes/:note_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},offerApprovalTemplate:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/offer_approval_templates`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},website:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},examMarkingTask:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/exam_marking_tasks`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/exam_marking_tasks`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},referral:{getByApplication:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/referrals/get_by_application`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/referrals/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},exam:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/exams`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobRequirementSchema:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_requirement_schemas`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},ecoAccountCustomField:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields/batch_delete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields/batch_update`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},talentExternalInfo:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talents/:talent_id/external_info`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talents/:talent_id/external_info`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},questionnaire:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/questionnaires`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},ecoExamPaper:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_exam_papers`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_exam_papers/batch_update`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_exam_papers/batch_delete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},offer:{internOfferStatus:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/offers/:offer_id/intern_offer_status`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/offers`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),offerStatus:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/offers/:offer_id/offer_status`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/offers`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/offers/:offer_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/offers/:offer_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},ecoBackgroundCheck:{cancel:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_background_checks/cancel`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),updateResult:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_background_checks/update_result`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),updateProgress:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_background_checks/update_progress`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},agency:{protect:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/agencies/protect`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchQuery:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/agencies/batch_query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/agencies/:agency_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),protectSearch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/agencies/protection_period/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/agencies/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),operateAgencyAccount:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/agencies/operate_agency_account`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getAgencyAccount:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/agencies/get_agency_account`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},talentPool:{searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talent_pools/`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talent_pools/`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchChangeTalentPool:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talent_pools/:talent_pool_id/batch_change_talent_pool`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),moveTalent:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talent_pools/:talent_pool_id/talent_relationship`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},diversityInclusion:{search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/applications/diversity_inclusions/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},ecoExam:{loginInfo:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_exams/:exam_id/login_info`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),updateResult:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_exams/:exam_id/update_result`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},terminationReason:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/termination_reasons`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/termination_reasons`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobManager:{batchUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/jobs/:job_id/managers/batch_update`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/jobs/:job_id/managers/:manager_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobPublishRecord:{search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_publish_records/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},websiteJobPost:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/:job_post_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobType:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_types`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_types`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},externalApplication:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_applications`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_applications`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_applications/:external_application_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_applications`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_applications/:external_application_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},ecoBackgroundCheckCustomField:{batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields/batch_delete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields/batch_update`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},application:{transferStage:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/applications/:application_id/transfer_stage`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),recover:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/applications/:application_id/recover`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),terminate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/applications/:application_id/terminate`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),transferOnboard:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/applications/:application_id/transfer_onboard`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),offer:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/applications/:application_id/offer`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/applications`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/applications/:application_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/applications`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),cancelOnboard:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/applications/:application_id/cancel_onboard`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getDetail:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/applications/:application_id/get_detail`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},registrationSchema:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/registration_schemas`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/registration_schemas`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},role:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/roles`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/roles`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/roles/:role_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},interviewRecord:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interview_records/:interview_record_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interview_records`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interview_records`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},interviewer:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interviewers/:interviewer_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interviewers`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interviewers`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},talentFolder:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talent_folders`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talent_folders`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},interview:{getByTalent:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interviews/get_by_talent`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interviews`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},referralAccount:{enable:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/referral_account/enable`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),withdraw:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/referral_account/:referral_account_id/withdraw`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),deactivate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/referral_account/:referral_account_id/deactivate`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),reconciliation:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/referral_account/reconciliation`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/referral_account`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getAccountAssets:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/referral_account/get_account_assets`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},ehrImportTask:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/ehr_import_tasks/:ehr_import_task_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},websiteDeliveryTask:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/delivery_tasks/:delivery_task_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},talentObject:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talent_objects/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobSchema:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_schemas`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobFunction:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_functions`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_functions`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},advertisement:{publish:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/advertisements/:advertisement_id/publish`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},offerSchema:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/offer_schemas/:offer_schema_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},attachment:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/attachments/:attachment_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),preview:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/attachments/:attachment_id/preview`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/attachments`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},applicationInterview:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/applications/:application_id/interviews`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},websiteSiteUser:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/site_users`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},tripartiteAgreement:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/tripartite_agreements/:tripartite_agreement_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/tripartite_agreements/:tripartite_agreement_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},ecoBackgroundCheckPackage:{batchUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_background_check_packages/batch_update`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_background_check_packages`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_background_check_packages/batch_delete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},resumeSource:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/resume_sources`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/resume_sources`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},offerApplicationForm:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/offer_application_forms`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/offer_application_forms/:offer_application_form_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},talentTag:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talent_tags`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talent_tags`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},talentOperationLog:{search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talent_operation_logs/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userRole:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/user_roles`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/user_roles`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},externalInterview:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_interviews/:external_interview_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchQueryWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_interviews/batch_query`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),batchQuery:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_interviews/batch_query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_interviews`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_interviews/:external_interview_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},externalBackgroundCheck:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_background_checks`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_background_checks/:external_background_check_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_background_checks/:external_background_check_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchQueryWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_background_checks/batch_query`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),batchQuery:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_background_checks/batch_query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},todo:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/todos`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/todos`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},externalOffer:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_offers/:external_offer_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchQueryWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_offers/batch_query`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),batchQuery:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_offers/batch_query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_offers/:external_offer_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_offers`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},talentBlocklist:{changeTalentBlock:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talent_blocklist/change_talent_block`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},portalApplySchema:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/portal_apply_schemas`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/portal_apply_schemas`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},interviewRegistrationSchema:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interview_registration_schemas`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interview_registration_schemas`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobRequirement:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_requirements/:job_requirement_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_requirements`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listById:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_requirements/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_requirements`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_requirements/:job_requirement_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},backgroundCheckOrder:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/background_check_orders`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchQuery:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/background_check_orders/batch_query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},employee:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/employees/:employee_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getByApplication:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/employees/get_by_application`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/employees/:employee_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},subject:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/subjects`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},interviewFeedbackForm:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interview_feedback_forms`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interview_feedback_forms`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},evaluationTask:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/evaluation_tasks`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/evaluation_tasks`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},evaluation:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/evaluations`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/evaluations`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},interviewTask:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interview_tasks`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interview_tasks`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobProcess:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_processes`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},minutes:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/minutes`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},test:{searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/tests/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/tests/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{websiteChannel:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels/:channel_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels/:channel_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},interviewRoundType:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interview_round_types`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},offerCustomField:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/offer_custom_fields/:offer_custom_field_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},websiteDelivery:{createByAttachment:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/deliveries/create_by_attachment`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),createByResume:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/deliveries/create_by_resume`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},interviewRecordAttachment:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interview_records/attachments`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},talent:{batchGetId:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talents/batch_get_id`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),onboardStatus:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talents/:talent_id/onboard_status`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),addToFolder:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talents/add_to_folder`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),tag:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talents/:talent_id/tag`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),removeToFolder:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talents/remove_to_folder`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),combinedCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talents/combined_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talents`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talents/:talent_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),combinedUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talents/combined_update`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},externalInterviewAssessment:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_interview_assessments/:external_interview_assessment_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_interview_assessments`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},referralWebsiteJobPost:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts/:job_post_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},job:{config:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/jobs/:job_id/config`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),close:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/jobs/:job_id/close`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/jobs/:job_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),updateConfig:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/jobs/:job_id/update_config`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),open:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/jobs/:job_id/open`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),recruiter:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/jobs/:job_id/recruiter`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),combinedUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/jobs/:job_id/combined_update`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),combinedCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/jobs/combined_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getDetail:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/jobs/:job_id/get_detail`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/jobs`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},location:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/locations/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/locations`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/locations`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},externalReferralReward:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_referral_rewards`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_referral_rewards/:external_referral_reward_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},note:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/notes/:note_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/notes/:note_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/notes`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/notes`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/notes/:note_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},offerApprovalTemplate:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/offer_approval_templates`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},website:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},examMarkingTask:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/exam_marking_tasks`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/exam_marking_tasks`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},referral:{getByApplication:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/referrals/get_by_application`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/referrals/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},exam:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/exams`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobRequirementSchema:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_requirement_schemas`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},ecoAccountCustomField:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields/batch_delete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields/batch_update`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},talentExternalInfo:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talents/:talent_id/external_info`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talents/:talent_id/external_info`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},questionnaire:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/questionnaires`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},ecoExamPaper:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_exam_papers`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_exam_papers/batch_update`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_exam_papers/batch_delete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},offer:{internOfferStatus:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/offers/:offer_id/intern_offer_status`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/offers`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),offerStatus:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/offers/:offer_id/offer_status`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/offers`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/offers/:offer_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/offers/:offer_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},ecoBackgroundCheck:{cancel:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_background_checks/cancel`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),updateResult:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_background_checks/update_result`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),updateProgress:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_background_checks/update_progress`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},agency:{protect:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/agencies/protect`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchQuery:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/agencies/batch_query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/agencies/:agency_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),protectSearch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/agencies/protection_period/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/agencies/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),operateAgencyAccount:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/agencies/operate_agency_account`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getAgencyAccount:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/agencies/get_agency_account`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},talentPool:{searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talent_pools/`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talent_pools/`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchChangeTalentPool:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talent_pools/:talent_pool_id/batch_change_talent_pool`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),moveTalent:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talent_pools/:talent_pool_id/talent_relationship`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},diversityInclusion:{search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/applications/diversity_inclusions/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},ecoExam:{loginInfo:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_exams/:exam_id/login_info`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),updateResult:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_exams/:exam_id/update_result`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},terminationReason:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/termination_reasons`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/termination_reasons`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobManager:{batchUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/jobs/:job_id/managers/batch_update`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/jobs/:job_id/managers/:manager_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobPublishRecord:{search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_publish_records/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},websiteJobPost:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/:job_post_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobType:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_types`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_types`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},externalApplication:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_applications`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_applications`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_applications/:external_application_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_applications`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_applications/:external_application_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},ecoBackgroundCheckCustomField:{batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields/batch_delete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields/batch_update`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},application:{transferStage:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/applications/:application_id/transfer_stage`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),recover:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/applications/:application_id/recover`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),terminate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/applications/:application_id/terminate`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),transferOnboard:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/applications/:application_id/transfer_onboard`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),offer:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/applications/:application_id/offer`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/applications`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/applications/:application_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/applications`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),cancelOnboard:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/applications/:application_id/cancel_onboard`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getDetail:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/applications/:application_id/get_detail`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},registrationSchema:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/registration_schemas`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/registration_schemas`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},role:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/roles`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/roles`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/roles/:role_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},interviewRecord:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interview_records/:interview_record_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interview_records`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interview_records`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},interviewer:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interviewers/:interviewer_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interviewers`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interviewers`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},talentFolder:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talent_folders`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talent_folders`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},interview:{getByTalent:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interviews/get_by_talent`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interviews`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},referralAccount:{enable:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/referral_account/enable`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),withdraw:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/referral_account/:referral_account_id/withdraw`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),deactivate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/referral_account/:referral_account_id/deactivate`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),reconciliation:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/referral_account/reconciliation`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/referral_account`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getAccountAssets:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/referral_account/get_account_assets`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},ehrImportTask:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/ehr_import_tasks/:ehr_import_task_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},websiteDeliveryTask:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/delivery_tasks/:delivery_task_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},talentObject:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talent_objects/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobSchema:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_schemas`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobFunction:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_functions`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_functions`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},advertisement:{publish:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/advertisements/:advertisement_id/publish`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},offerSchema:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/offer_schemas/:offer_schema_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},attachment:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/attachments/:attachment_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),preview:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/attachments/:attachment_id/preview`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/attachments`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},applicationInterview:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/applications/:application_id/interviews`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},websiteSiteUser:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/websites/:website_id/site_users`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},tripartiteAgreement:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/tripartite_agreements/:tripartite_agreement_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/tripartite_agreements/:tripartite_agreement_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},ecoBackgroundCheckPackage:{batchUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_background_check_packages/batch_update`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_background_check_packages`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/eco_background_check_packages/batch_delete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},resumeSource:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/resume_sources`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/resume_sources`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},offerApplicationForm:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/offer_application_forms`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/offer_application_forms/:offer_application_form_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},talentTag:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talent_tags`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talent_tags`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},talentOperationLog:{search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talent_operation_logs/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userRole:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/user_roles`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/user_roles`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},externalInterview:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_interviews/:external_interview_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchQueryWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_interviews/batch_query`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),batchQuery:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_interviews/batch_query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_interviews`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_interviews/:external_interview_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},externalBackgroundCheck:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_background_checks`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_background_checks/:external_background_check_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_background_checks/:external_background_check_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchQueryWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_background_checks/batch_query`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),batchQuery:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_background_checks/batch_query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},todo:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/todos`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/todos`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},externalOffer:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_offers/:external_offer_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchQueryWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_offers/batch_query`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),batchQuery:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_offers/batch_query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_offers/:external_offer_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/external_offers`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},talentBlocklist:{changeTalentBlock:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/talent_blocklist/change_talent_block`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},portalApplySchema:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/portal_apply_schemas`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/portal_apply_schemas`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},interviewRegistrationSchema:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interview_registration_schemas`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interview_registration_schemas`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobRequirement:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_requirements/:job_requirement_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_requirements`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listById:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_requirements/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_requirements`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_requirements/:job_requirement_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},backgroundCheckOrder:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/background_check_orders`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchQuery:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/background_check_orders/batch_query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},employee:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/employees/:employee_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getByApplication:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/employees/get_by_application`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/employees/:employee_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},subject:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/subjects`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},interviewFeedbackForm:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interview_feedback_forms`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interview_feedback_forms`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},evaluationTask:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/evaluation_tasks`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/evaluation_tasks`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},evaluation:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/evaluations`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/evaluations`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},interviewTask:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interview_tasks`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/interview_tasks`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},jobProcess:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/job_processes`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},minutes:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/minutes`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},test:{searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/tests/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v1/tests/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}},v2:{talent:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v2/talents/:talent_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},interviewRecord:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v2/interview_records`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v2/interview_records`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/hire/v2/interview_records/:interview_record_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Fm=class extends Em{constructor(){super(...arguments),this.human_authentication={identity:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/human_authentication/v1/identities`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{identity:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/human_authentication/v1/identities`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Om=class extends Fm{constructor(){super(...arguments),this.im={message:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),pushFollowUp:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/push_follow_up`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),urgentApp:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_app`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),urgentPhone:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_phone`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),urgentSms:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_sms`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),reply:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/reply`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),mergeForward:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/merge_forward`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),forward:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/forward`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),readUsers:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/read_users`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),replyByCard:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),{template_id:e,template_variable:y}=s,u=T(s,["template_id","template_variable"]),f=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:e,template_variable:y}})},u);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/reply`,o),method:"POST",data:f,params:i,headers:a,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{throw this.logger.error(p(d)),d})}),createByCard:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),{template_id:e,template_variable:y}=s,u=T(s,["template_id","template_variable"]),f=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:e,template_variable:y}})},u);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages`,o),method:"POST",data:f,params:i,headers:a,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{throw this.logger.error(p(d)),d})}),updateByCard:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),{template_id:e,template_variable:y}=s,u=T(s,["template_id","template_variable"]),f=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:e,template_variable:y}})},u);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id`,o),method:"PUT",data:f,params:i,headers:a,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{throw this.logger.error(p(d)),d})})},batchMessage:{readUser:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id/read_user`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getProgress:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id/get_progress`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chatMembers:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),isInChat:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/members/is_in_chat`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),meJoin:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/members/me_join`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},pin:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/pins/:message_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/pins`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/pins`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/pins`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chat:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),link:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/link`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/search`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/search`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chatModeration:{getWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chatTab:{listTabs:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/list_tabs`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),sortTabs:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/sort_tabs`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),deleteTabs:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/delete_tabs`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),updateTabs:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/update_tabs`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chatTopNotice:{deleteTopNotice:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/top_notice/delete_top_notice`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),putTopNotice:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/top_notice/put_top_notice`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chatAnnouncement:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/announcement`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/announcement`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chatMenuTree:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),sort:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree/sort`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chatManagers:{deleteManagers:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/managers/delete_managers`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),addManagers:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/managers/add_managers`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chatMenuItem:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_items/:menu_item_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},image:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/images/:image_key`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/images`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},messageReaction:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions/:reaction_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchQuery:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/reactions/batch_query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},file:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/files/:file_key`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/files`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},messageResource:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/resources/:file_key`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}})},thread:{forward:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/threads/:thread_id/forward`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{message:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),pushFollowUp:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/push_follow_up`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),urgentApp:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_app`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),urgentPhone:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_phone`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),urgentSms:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_sms`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),reply:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/reply`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),mergeForward:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/merge_forward`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),forward:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/forward`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),readUsers:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/read_users`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),replyByCard:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),{template_id:e,template_variable:y}=s,u=T(s,["template_id","template_variable"]),f=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:e,template_variable:y}})},u);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/reply`,o),method:"POST",data:f,params:i,headers:a,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{throw this.logger.error(p(d)),d})}),createByCard:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),{template_id:e,template_variable:y}=s,u=T(s,["template_id","template_variable"]),f=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:e,template_variable:y}})},u);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages`,o),method:"POST",data:f,params:i,headers:a,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{throw this.logger.error(p(d)),d})}),updateByCard:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),{template_id:e,template_variable:y}=s,u=T(s,["template_id","template_variable"]),f=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:e,template_variable:y}})},u);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id`,o),method:"PUT",data:f,params:i,headers:a,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{throw this.logger.error(p(d)),d})})},batchMessage:{readUser:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id/read_user`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getProgress:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id/get_progress`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chatMembers:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),isInChat:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/members/is_in_chat`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),meJoin:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/members/me_join`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},pin:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/pins/:message_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/pins`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/pins`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/pins`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chat:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),link:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/link`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/search`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/search`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chatModeration:{getWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chatTab:{listTabs:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/list_tabs`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),sortTabs:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/sort_tabs`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),deleteTabs:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/delete_tabs`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),updateTabs:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/update_tabs`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chatTopNotice:{deleteTopNotice:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/top_notice/delete_top_notice`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),putTopNotice:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/top_notice/put_top_notice`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chatAnnouncement:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/announcement`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/announcement`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chatMenuTree:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),sort:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree/sort`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chatManagers:{deleteManagers:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/managers/delete_managers`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),addManagers:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/managers/add_managers`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chatMenuItem:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_items/:menu_item_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},image:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/images/:image_key`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/images`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},messageReaction:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions/:reaction_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchQuery:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/reactions/batch_query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},file:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/files/:file_key`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/files`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},messageResource:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/messages/:message_id/resources/:file_key`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}})},thread:{forward:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v1/threads/:thread_id/forward`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}},v2:{bizEntityTagRelation:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v2/biz_entity_tag_relation`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v2/biz_entity_tag_relation`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v2/biz_entity_tag_relation`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},urlPreview:{batchUpdate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v2/url_previews/batch_update`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appFeedCardBatch:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v2/app_feed_card/batch`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v2/app_feed_card/batch`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},feedCard:{botTimeSentive:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v2/feed_cards/bot_time_sentive`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v2/feed_cards/:feed_card_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},tag:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v2/tags`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v2/tags/:tag_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chatButton:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v2/chat_button`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appFeedCard:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v2/app_feed_card`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},chat:{searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v2/chats/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/im/v2/chats/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},$m=class extends Om{constructor(){super(...arguments),this.inline_platform={}}},zm=class extends $m{constructor(){super(...arguments),this.laps={}}},Rm=class extends zm{constructor(){super(...arguments),this.lingo={v1:{file:{download:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/lingo/v1/files/:file_token/download`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}}),upload:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/lingo/v1/files/upload`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},entity:{match:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/lingo/v1/entities/match`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/lingo/v1/entities/:entity_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),highlight:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/lingo/v1/entities/highlight`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/lingo/v1/entities`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/lingo/v1/entities`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/lingo/v1/entities/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/lingo/v1/entities/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/lingo/v1/entities/:entity_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/lingo/v1/entities`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/lingo/v1/entities/:entity_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},repo:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/lingo/v1/repos`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},classification:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/lingo/v1/classifications`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/lingo/v1/classifications`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},draft:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/lingo/v1/drafts`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/lingo/v1/drafts/:draft_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Am=class extends Rm{constructor(){super(...arguments),this.llpp={}}},Cm=class extends Am{constructor(){super(...arguments),this.mail={mailgroupMember:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_delete`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},mailgroupPermissionMember:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_delete`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},mailgroup:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},publicMailboxMember:{clear:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/clear`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_delete`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},mailgroupAlias:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases/:alias_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},publicMailboxAlias:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases/:alias_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailbox:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),accessibleMailboxes:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/accessible_mailboxes`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),profile:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/profile`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxAlias:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases/:alias_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},mailgroupManager:{batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_delete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},publicMailbox:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),removeToRecycleBin:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/remove_to_recycle_bin`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},user:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/users/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxMessage:{getByCard:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/get_by_card`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),send:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/send`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchModify:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_modify`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),sendStatus:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/send_status`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),modify:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/modify`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchTrash:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_trash`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),trash:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/trash`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listThreadMessage:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/messages`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchGet:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_get`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxThread:{batchModify:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/batch_modify`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchTrash:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/batch_trash`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),modify:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/modify`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),trash:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/trash`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxEvent:{unsubscribe:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/unsubscribe`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),subscribe:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/subscribe`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),subscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/subscription`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxMailContact:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts/:mail_contact_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts/:mail_contact_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxLabel:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxDraft:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),cancelScheduledSend:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/cancel_scheduled_send`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),send:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id/send`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxRule:{reorder:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/reorder`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/:rule_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/:rule_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxSetting:{sendAs:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/settings/send_as`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getSignatures:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/settings/signatures`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxSentMessage:{getRecallDetail:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/recall`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),recall:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/recall`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxTemplate:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxTemplateAttachment:{downloadUrl:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id/attachments/download_url`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},multiEntity:{search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/multi_entity/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxFolder:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxMessageAttachment:{downloadUrl:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/attachments/download_url`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{mailgroupMember:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_delete`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},mailgroupPermissionMember:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_delete`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},mailgroup:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},publicMailboxMember:{clear:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/clear`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_delete`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},mailgroupAlias:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases/:alias_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},publicMailboxAlias:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases/:alias_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailbox:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),accessibleMailboxes:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/accessible_mailboxes`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),profile:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/profile`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxAlias:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases/:alias_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},mailgroupManager:{batchDelete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_delete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchCreate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_create`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},publicMailbox:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),removeToRecycleBin:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/remove_to_recycle_bin`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/public_mailboxes`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},user:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/users/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxMessage:{getByCard:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/get_by_card`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),send:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/send`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchModify:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_modify`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),sendStatus:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/send_status`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),modify:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/modify`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchTrash:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_trash`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),trash:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/trash`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listThreadMessage:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/messages`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchGet:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_get`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxThread:{batchModify:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/batch_modify`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchTrash:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/batch_trash`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),modify:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/modify`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),trash:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/trash`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxEvent:{unsubscribe:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/unsubscribe`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),subscribe:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/subscribe`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),subscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/subscription`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxMailContact:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts/:mail_contact_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts/:mail_contact_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxLabel:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxDraft:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),cancelScheduledSend:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/cancel_scheduled_send`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),send:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id/send`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxRule:{reorder:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/reorder`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/:rule_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/:rule_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxSetting:{sendAs:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/settings/send_as`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getSignatures:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/settings/signatures`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxSentMessage:{getRecallDetail:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/recall`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),recall:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/recall`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxTemplate:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxTemplateAttachment:{downloadUrl:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id/attachments/download_url`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},multiEntity:{search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/multi_entity/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxFolder:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMailboxMessageAttachment:{downloadUrl:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/attachments/download_url`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},jm=class extends Cm{constructor(){super(...arguments),this.mcp={}}},Dm=class extends jm{constructor(){super(...arguments),this.mdm={userAuthDataRelation:{unbind:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mdm/v1/user_auth_data_relations/unbind`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),bind:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mdm/v1/user_auth_data_relations/bind`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{userAuthDataRelation:{unbind:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mdm/v1/user_auth_data_relations/unbind`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),bind:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mdm/v1/user_auth_data_relations/bind`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}},v3:{countryRegion:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mdm/v3/country_regions`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},batchCountryRegion:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/mdm/v3/batch_country_region`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Gm=class extends Dm{constructor(){super(...arguments),this.meeting_room={}}},Bm=class extends Gm{constructor(){super(...arguments),this.mindnote={}}},Mm=class extends Bm{constructor(){super(...arguments),this.minutes={v1:{minuteTranscript:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token/transcript`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}})},minuteStatistics:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token/statistics`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},minuteMedia:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token/media`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},minute:{subscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/minutes/v1/minutes/subscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),unsubscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/minutes/v1/minutes/unsubscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/minutes/v1/minutes/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/minutes/v1/minutes/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),artifacts:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token/artifacts`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Lm=class extends Mm{constructor(){super(...arguments),this.moments={post:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/moments/v1/posts/:post_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{post:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/moments/v1/posts/:post_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Nm=class extends Lm{constructor(){super(...arguments),this.myai_ai_extension={}}},Um=class extends Nm{constructor(){super(...arguments),this.myai_assistant={}}},Wm=class extends Um{constructor(){super(...arguments),this.myai_base_ai={}}},Hm=class extends Wm{constructor(){super(...arguments),this.myai_ccm_extension={}}},Qm=class extends Hm{constructor(){super(...arguments),this.myai_data={}}},Vm=class extends Qm{constructor(){super(...arguments),this.myai_im_extension={}}},Km=class extends Vm{constructor(){super(...arguments),this.myai_mail={}}},Jm=class extends Km{constructor(){super(...arguments),this.myai_memory_reflection={}}},Xm=class extends Jm{constructor(){super(...arguments),this.myai_scenario_summary={}}},Ym=class extends Xm{constructor(){super(...arguments),this.myai_slides={}}},Zm=class extends Ym{constructor(){super(...arguments),this.myai_url_extension={}}},ef=class extends Zm{constructor(){super(...arguments),this.myai={}}},tf=class extends ef{constructor(){super(...arguments),this.okr={review:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v1/reviews/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},periodRule:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v1/period_rules`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},progressRecord:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v1/progress_records`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},period:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v1/periods`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v1/periods`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v1/periods/:period_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},okr:{batchGet:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v1/okrs/batch_get`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userOkr:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v1/users/:user_id/okrs`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},image:{upload:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v1/images/upload`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})},v1:{review:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v1/reviews/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},periodRule:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v1/period_rules`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},progressRecord:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v1/progress_records`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},period:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v1/periods`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v1/periods`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v1/periods/:period_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},okr:{batchGet:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v1/okrs/batch_get`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userOkr:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v1/users/:user_id/okrs`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},image:{upload:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v1/images/upload`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null})}},v2:{okrAlignment:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/alignments/:alignment_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/alignments/:alignment_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},okrObjective:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/objectives/:objective_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),keyResultsPosition:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/key_results_position`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/objectives/:objective_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),keyResultsWeight:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/key_results_weight`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/objectives/:objective_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},okrKeyResult:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},okrObjectiveAlignment:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/alignments`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/alignments`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/alignments`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},okrCategory:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/categories`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/categories`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},okrCycle:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/cycles`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/cycles`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),objectivesWeight:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/cycles/:cycle_id/objectives_weight`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),objectivesPosition:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/cycles/:cycle_id/objectives_position`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},okrObjectiveKeyResult:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/key_results`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/key_results`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/key_results`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},okrKeyResultIndicator:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id/indicators`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},okrObjectiveIndicator:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/indicators`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},okrCycleObjective:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/cycles/:cycle_id/objectives`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/cycles/:cycle_id/objectives`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/cycles/:cycle_id/objectives`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},okrIndicator:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/indicators/:indicator_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},okrObjectiveProgress:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/progresses`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/progresses`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},okrKeyResultProgress:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id/progresses`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id/progresses`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},rf=class extends tf{constructor(){super(...arguments),this.optical_char_recognition={image:{basicRecognize:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/optical_char_recognition/v1/image/basic_recognize`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{image:{basicRecognize:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/optical_char_recognition/v1/image/basic_recognize`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},af=class extends rf{constructor(){super(...arguments),this.partner_ai={}}},sf=class extends af{constructor(){super(...arguments),this.passport={session:{logout:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/passport/v1/sessions/logout`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/passport/v1/sessions/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},password:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/passport/v1/password`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{session:{logout:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/passport/v1/sessions/logout`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/passport/v1/sessions/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},password:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/passport/v1/password`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},of=class extends sf{constructor(){super(...arguments),this.payroll={v1:{datasourceRecord:{save:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/payroll/v1/datasource_records/save`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/payroll/v1/datasource_records/query`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/payroll/v1/datasource_records/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},paymentDetail:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/payroll/v1/payment_detail/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},paymentActivity:{archive:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/payroll/v1/payment_activitys/archive`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/payroll/v1/payment_activitys`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/payroll/v1/payment_activitys`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},costAllocationPlan:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/payroll/v1/cost_allocation_plans`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/payroll/v1/cost_allocation_plans`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},paymentActivityDetail:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/payroll/v1/payment_activity_details`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},datasource:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/payroll/v1/datasources`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/payroll/v1/datasources`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},costAllocationDetail:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/payroll/v1/cost_allocation_details`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/payroll/v1/cost_allocation_details`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},costAllocationReport:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/payroll/v1/cost_allocation_reports`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/payroll/v1/cost_allocation_reports`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},paygroup:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/payroll/v1/paygroups`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/payroll/v1/paygroups`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},acctItem:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/payroll/v1/acct_items`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/payroll/v1/acct_items`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},nf=class extends of{constructor(){super(...arguments),this.people_admin={}}},hf=class extends nf{constructor(){super(...arguments),this.people_ai={}}},df=class extends hf{constructor(){super(...arguments),this.people_bytedance={}}},cf=class extends df{constructor(){super(...arguments),this.performance={v1:{reviewData:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v1/review_datas/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},stageTask:{findByUserList:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v1/stage_tasks/find_by_user_list`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),findByPage:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v1/stage_tasks/find_by_page`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},semester:{list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v1/semesters`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}},v2:{reviewee:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v2/reviewees/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},additionalInformationsBatch:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v2/additional_informations/batch`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},metricDetail:{import:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v2/metric_details/import`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v2/metric_details/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},question:{queryWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v2/questions/query`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v2/questions/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},indicator:{queryWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v2/indicators/query`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v2/indicators/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},activity:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v2/activity/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},metricTag:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v2/metric_tags`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v2/metric_tags`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},metricField:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v2/metric_fields/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},metricLib:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v2/metric_libs/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},reviewData:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v2/review_datas/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},metricTemplate:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v2/metric_templates/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userInfo:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v2/user_info/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},reviewTemplate:{queryWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v2/review_templates/query`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v2/review_templates/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userGroupUserRel:{write:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v2/user_group_user_rels/write`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},additionalInformation:{import:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v2/additional_informations/import`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),queryWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v2/additional_informations/query`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/performance/v2/additional_informations/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},lf=class extends cf{constructor(){super(...arguments),this.personal_settings={systemStatus:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchClose:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_close`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchOpen:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_open`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{systemStatus:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchClose:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_close`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchOpen:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_open`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},pf=class extends lf{constructor(){super(...arguments),this.profile={}}},uf=class extends pf{constructor(){super(...arguments),this.report={rule:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/report/v1/rules/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},ruleView:{remove:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/report/v1/rules/:rule_id/views/remove`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},task:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/report/v1/tasks/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{rule:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/report/v1/rules/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},ruleView:{remove:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/report/v1/rules/:rule_id/views/remove`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},task:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/report/v1/tasks/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},mf=class extends uf{constructor(){super(...arguments),this.rule_engine={}}},ff=class extends mf{constructor(){super(...arguments),this.saasbi={}}},yf=class extends ff{constructor(){super(...arguments),this.scim={}}},gf=class extends yf{constructor(){super(...arguments),this.search_in_app={}}},vf=class extends gf{constructor(){super(...arguments),this.search={dataSource:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/data_sources`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/data_sources`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/data_sources`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},message:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/message`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},schema:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/schemas`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},dataSourceItem:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items/:item_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items/:item_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},app:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/app`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},docWiki:{searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/doc_wiki/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/doc_wiki/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v2:{dataSource:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/data_sources`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/data_sources`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/data_sources`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},message:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/message`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},schema:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/schemas`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},dataSourceItem:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items/:item_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items/:item_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},app:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/app`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},docWiki:{searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/doc_wiki/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/search/v2/doc_wiki/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},_f=class extends vf{constructor(){super(...arguments),this.security_and_compliance={openapiLog:{listData:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/security_and_compliance/v1/openapi_logs/list_data`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMigration:{cancel:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/cancel`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/:user_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},multiGeoEntityTenant:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/security_and_compliance/v1/multi_geo_entity/tenant`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{openapiLog:{listData:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/security_and_compliance/v1/openapi_logs/list_data`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},userMigration:{cancel:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/cancel`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/:user_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},multiGeoEntityTenant:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/security_and_compliance/v1/multi_geo_entity/tenant`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}},v2:{deviceApplyRecord:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/security_and_compliance/v2/device_apply_records/:device_apply_record_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},deviceRecord:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/security_and_compliance/v2/device_records/:device_record_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),mine:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/security_and_compliance/v2/device_records/mine`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/security_and_compliance/v2/device_records/:device_record_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/security_and_compliance/v2/device_records`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/security_and_compliance/v2/device_records/:device_record_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/security_and_compliance/v2/device_records`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/security_and_compliance/v2/device_records`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},bf=class extends _f{constructor(){super(...arguments),this.security_plugin={}}},wf=class extends bf{constructor(){super(...arguments),this.sheet_ai={}}},Sf=class extends wf{constructor(){super(...arguments),this.sheets={spreadsheet:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},spreadsheetSheet:{replace:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/replace`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),moveDimension:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/move_dimension`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),find:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/find`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},spreadsheetSheetFilter:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},spreadsheetSheetFilterView:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},spreadsheetSheetFilterViewCondition:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},spreadsheetSheetFloatImage:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v3:{spreadsheet:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},spreadsheetSheet:{replace:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/replace`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),moveDimension:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/move_dimension`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),find:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/find`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},spreadsheetSheetFilter:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},spreadsheetSheetFilterView:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},spreadsheetSheetFilterViewCondition:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},spreadsheetSheetFloatImage:{create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},If=class extends Sf{constructor(){super(...arguments),this.slides_ai={}}},kf=class extends If{constructor(){super(...arguments),this.slides={}}},Tf=class extends kf{constructor(){super(...arguments),this.spark={v1:{appTable:{deleteTableRecords:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name/records`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),postTableRecords:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name/records`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patchTableRecords:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name/records`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchUpdateTableRecords:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name/records_batch_update`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getTableDetail:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getTableList:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getTableRecordList:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name/records`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appEnum:{getEnumDetail:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/spark/v1/apps/:app_id/enums/:enum_name`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getEnumList:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/spark/v1/apps/:app_id/enums`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appView:{getViewRecordList:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/spark/v1/apps/:app_id/views/:view_name/records`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},appStorage:{upload:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/spark/v1/apps/:app_id/storage/upload`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null}),download:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/spark/v1/apps/:app_id/storage`,o),method:"GET",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null}),uploadInitialize:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/spark/v1/apps/:app_id/storage/upload/initialize`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),uploadPart:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/spark/v1/apps/:app_id/storage/upload/part`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null}),uploadComplete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/spark/v1/apps/:app_id/storage/upload/complete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},app:{icon:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/spark/v1/icon`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null}),uploadHtmlCodeAndRelease:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/spark/v1/apps/:app_id/upload_and_release_html_code`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null}),getAppVisibility:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/spark/v1/apps/:app_id/access-scope`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),updateAppVisibility:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/spark/v1/apps/:app_id/access-scope`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),sqlCommands:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/spark/v1/apps/:app_id/sql_commands`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/spark/v1/apps/:app_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/spark/v1/apps`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/spark/v1/apps`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},directoryUser:{idConvert:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/spark/v1/directory/user/id_convert`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},xf=class extends Tf{constructor(){super(...arguments),this.speech_to_text={speech:{fileRecognize:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/speech_to_text/v1/speech/file_recognize`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),streamRecognize:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/speech_to_text/v1/speech/stream_recognize`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{speech:{fileRecognize:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/speech_to_text/v1/speech/file_recognize`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),streamRecognize:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/speech_to_text/v1/speech/stream_recognize`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Pf=class extends xf{constructor(){super(...arguments),this.subscriptions={}}},qf=class extends Pf{constructor(){super(...arguments),this.task={task:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchDeleteFollower:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/batch_delete_follower`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchDeleteCollaborator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/batch_delete_collaborator`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),uncomplete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/uncomplete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),complete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/complete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},taskComment:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},taskCollaborator:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators/:collaborator_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},taskFollower:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers/:follower_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},taskReminder:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders/:reminder_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{task:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchDeleteFollower:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/batch_delete_follower`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),batchDeleteCollaborator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/batch_delete_collaborator`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),uncomplete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/uncomplete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),complete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/complete`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},taskComment:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},taskCollaborator:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators/:collaborator_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},taskFollower:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers/:follower_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},taskReminder:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders/:reminder_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}},v2:{task:{tasklists:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasks/:task_guid/tasklists`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasks/:task_guid`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),addDependencies:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasks/:task_guid/add_dependencies`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),removeDependencies:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasks/:task_guid/remove_dependencies`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasks/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasks/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),setAncestorTask:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasks/:task_guid/set_ancestor_task`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),addMembers:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasks/:task_guid/add_members`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasks`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasks`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),addReminders:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasks/:task_guid/add_reminders`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),removeMembers:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasks/:task_guid/remove_members`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),removeReminders:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasks/:task_guid/remove_reminders`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasks`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasks/:task_guid`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),removeTasklist:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasks/:task_guid/remove_tasklist`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasks/:task_guid`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),addTasklist:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasks/:task_guid/add_tasklist`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},comment:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/comments/:comment_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/comments`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/comments`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/comments/:comment_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/comments/:comment_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/comments`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},section:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/sections/:section_guid`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),tasksWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/sections/:section_guid/tasks`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),tasks:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/sections/:section_guid/tasks`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/sections/:section_guid`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/sections/:section_guid`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/sections`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/sections`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/sections`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},tasklist:{tasks:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/tasks`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasklists`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasklists`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),addMembers:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/add_members`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),removeMembers:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/remove_members`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasklists`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasklists/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasklists/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},customField:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/custom_fields`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),add:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid/add`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),remove:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid/remove`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/custom_fields`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/custom_fields`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},tasklistActivitySubscription:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},attachment:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/attachments/:attachment_guid`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/attachments/:attachment_guid`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),upload:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/attachments/upload`,o),method:"POST",data:s,params:i,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:y=>(0,c.stringify)(y,{arrayFormat:"repeat"})}).catch(y=>{throw this.logger.error(p(y)),y});return e?.data||null}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/attachments`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/attachments`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},customFieldOption:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid/options/:option_guid`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid/options`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},taskV2:{taskSubscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/task_v2/task_subscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listRelatedTaskWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/task_v2/list_related_task`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),listRelatedTask:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/task_v2/list_related_task`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},taskSubtask:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasks/:task_guid/subtasks`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasks/:task_guid/subtasks`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/task/v2/tasks/:task_guid/subtasks`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Ef=class extends qf{constructor(){super(...arguments),this.tenant={tenant:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/tenant/v2/tenant/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},tenantProductAssignInfo:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/tenant/v2/tenant/assign_info_list/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v2:{tenant:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/tenant/v2/tenant/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},tenantProductAssignInfo:{query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/tenant/v2/tenant/assign_info_list/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Ff=class extends Ef{constructor(){super(...arguments),this.translation={text:{translate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/translation/v1/text/translate`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),detect:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/translation/v1/text/detect`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{text:{translate:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/translation/v1/text/translate`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),detect:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/translation/v1/text/detect`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Of=class extends Ff{constructor(){super(...arguments),this.trust_layer={}}},$f=class extends Of{constructor(){super(...arguments),this.trust_party={v1:{collaborationTenantCollaborationUser:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/trust_party/v1/collaboration_tenants/:target_tenant_key/collaboration_users/:target_user_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},collaborationTenantCollaborationDepartment:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/trust_party/v1/collaboration_tenants/:target_tenant_key/collaboration_departments/:target_department_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},collaborationTenant:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/trust_party/v1/collaboration_tenants/:target_tenant_key`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/trust_party/v1/collaboration_tenants`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),visibleOrganization:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/trust_party/v1/collaboration_tenants/:target_tenant_key/visible_organization`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},zf=class extends $f{constructor(){super(...arguments),this.unified_kms_log={}}},Rf=class extends zf{constructor(){super(...arguments),this.unified_kms={}}},Af=class extends Rf{constructor(){super(...arguments),this.vault={}}},Cf=class extends Af{constructor(){super(...arguments),this.vc={material:{uploadMeta:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/materials/upload_meta`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),remove:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/materials/remove`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),pullMeta:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/materials/pull_meta`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},meetingRecording:{start:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/start`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),stop:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/stop`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),setPermission:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/set_permission`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},roomConfig:{del:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_configs/del`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),setCheckboardAccessCode:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_configs/set_checkboard_access_code`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),setRoomAccessCode:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_configs/set_room_access_code`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_configs/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),set:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_configs/set`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},reserve:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),apply:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserves/apply`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getActiveMeeting:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id/get_active_meeting`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},myAiVcMeeting:{getCommonReply:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_common_reply`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),doOperation:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/do_operation`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getTodoTask:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_todo_task`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),seedAiPullData:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/seed_ai_pull_data`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),docBasedSuggestQuestion:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/doc_based_suggest_question`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),callback:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/callback`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),sectionSummary:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/section_summary`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getRecap:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_recap`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),fetchStepSummaryStream:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_step_summary_stream`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),fetchSectionSummaryStream:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_section_summary_stream`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),fetchRecapStream:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_recap_stream`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},meeting:{end:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/end`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),kickout:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/kickout`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),setHost:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/set_host`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),invite:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/invite`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),changeName:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/change_name`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listByNoWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/list_by_no`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),listByNo:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/list_by_no`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),subscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/subscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),unsubscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/unsubscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},myAiRoom:{joinOfflineMeeting:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_room/join_offline_meeting`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),reserveInstantEvent:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_room/reserve_instant_event`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),helpSceneType:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_room/help_scene_type`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),joinMeeting:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_room/join_meeting`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),checkInSchedule:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_room/check_in_schedule`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),exit:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_room/exit`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),autoReleaseEvent:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_room/auto_release_event`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),autoWelcome:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_room/auto_welcome`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),roomCalling:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_room/room_calling`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),joinMeetingNumber:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_room/join_meeting_number`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),leaveMeeting:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_room/leave_meeting`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},myAiMm:{mediaParse:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_mm/media_parse`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),extensionBoarding:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_mm/extension_boarding`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),querySuggestContext:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_mm/query_suggest_context`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),mediaBind:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_mm/media_bind`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_mm/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},myAiSip:{createEventCard:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_sip/create_event_card`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},alert:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/alerts`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/alerts`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},myAiVc:{cardCallback:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc/card_callback`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),startAnalysis:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc/start_analysis`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),fetchMeetingList:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc/fetch_meeting_list`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),setMeetingList:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc/set_meeting_list`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),meetingAnalyze:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc/meeting_analyze`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),fetchMeetingAnalyze:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc/fetch_meeting_analyze`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},report:{getDaily:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reports/get_daily`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getTopUser:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reports/get_top_user`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},room:{search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/rooms/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),mget:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/rooms/mget`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/rooms`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/rooms`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/rooms`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},resourceReservationList:{getWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/resource_reservation_list`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/resource_reservation_list`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},participantQualityList:{getWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/participant_quality_list`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/participant_quality_list`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},roomLevel:{mget:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_levels/mget`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_levels/:room_level_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_levels/search`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),del:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_levels/del`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_levels/:room_level_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_levels`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_levels`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_levels`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},scopeConfig:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/scope_config`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/scope_config`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),accessCode:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/scope_config/access_code`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},reserveConfigForm:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/form`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/form`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},reserveConfigAdmin:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},reserveConfigDisableInform:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},reserveConfig:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),reserveScope:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserve_configs/reserve_scope`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},export:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/exports/:task_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),download:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/exports/download`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}}),resourceReservationList:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/exports/resource_reservation_list`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),participantQualityList:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/exports/participant_quality_list`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),participantList:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/exports/participant_list`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),meetingList:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/exports/meeting_list`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},meetingList:{getWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meeting_list`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meeting_list`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},participantList:{getWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/participant_list`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/participant_list`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},meetingPullSubtitle:{getWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/pull_subtitle`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/pull_subtitle`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},note:{subscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/notes/subscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),unsubscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/notes/unsubscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),unifiedNoteTranscriptWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/notes/:note_id/unified_note_transcript`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),unifiedNoteTranscript:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/notes/:note_id/unified_note_transcript`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/notes/:note_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},recording:{unsubscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/recordings/unsubscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),subscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/recordings/subscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},bot:{realtimeEndpoint:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/realtime/endpoint`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),leave:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/bots/leave`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),message:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/bots/message`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),userActiveMeeting:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/bots/user_active_meeting`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),join:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/bots/join`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),eventsWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/bots/events`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),events:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/bots/events`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{material:{uploadMeta:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/materials/upload_meta`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),remove:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/materials/remove`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),pullMeta:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/materials/pull_meta`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},meetingRecording:{start:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/start`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),stop:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/stop`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),setPermission:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/set_permission`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},roomConfig:{del:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_configs/del`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),setCheckboardAccessCode:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_configs/set_checkboard_access_code`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),setRoomAccessCode:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_configs/set_room_access_code`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_configs/query`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),set:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_configs/set`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},reserve:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),apply:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserves/apply`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getActiveMeeting:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id/get_active_meeting`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},myAiVcMeeting:{getCommonReply:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_common_reply`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),doOperation:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/do_operation`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getTodoTask:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_todo_task`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),seedAiPullData:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/seed_ai_pull_data`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),docBasedSuggestQuestion:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/doc_based_suggest_question`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),callback:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/callback`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),sectionSummary:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/section_summary`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getRecap:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_recap`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),fetchStepSummaryStream:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_step_summary_stream`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),fetchSectionSummaryStream:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_section_summary_stream`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),fetchRecapStream:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_recap_stream`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},meeting:{end:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/end`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),kickout:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/kickout`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),setHost:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/set_host`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),invite:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/invite`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),changeName:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/change_name`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listByNoWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/list_by_no`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),listByNo:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/list_by_no`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),subscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/subscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),unsubscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/unsubscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},myAiRoom:{joinOfflineMeeting:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_room/join_offline_meeting`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),reserveInstantEvent:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_room/reserve_instant_event`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),helpSceneType:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_room/help_scene_type`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),joinMeeting:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_room/join_meeting`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),checkInSchedule:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_room/check_in_schedule`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),exit:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_room/exit`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),autoReleaseEvent:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_room/auto_release_event`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),autoWelcome:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_room/auto_welcome`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),roomCalling:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_room/room_calling`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),joinMeetingNumber:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_room/join_meeting_number`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),leaveMeeting:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_room/leave_meeting`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},myAiMm:{mediaParse:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_mm/media_parse`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),extensionBoarding:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_mm/extension_boarding`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),querySuggestContext:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_mm/query_suggest_context`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),mediaBind:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_mm/media_bind`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),query:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_mm/query`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},myAiSip:{createEventCard:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_sip/create_event_card`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},alert:{listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/alerts`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/alerts`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},myAiVc:{cardCallback:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc/card_callback`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),startAnalysis:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc/start_analysis`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),fetchMeetingList:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc/fetch_meeting_list`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),setMeetingList:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc/set_meeting_list`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),meetingAnalyze:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc/meeting_analyze`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),fetchMeetingAnalyze:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/my_ai_vc/fetch_meeting_analyze`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},report:{getDaily:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reports/get_daily`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),getTopUser:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reports/get_top_user`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},room:{search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/rooms/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),mget:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/rooms/mget`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/rooms`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/rooms`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/rooms`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},resourceReservationList:{getWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/resource_reservation_list`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/resource_reservation_list`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},participantQualityList:{getWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/participant_quality_list`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/participant_quality_list`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},roomLevel:{mget:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_levels/mget`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_levels/:room_level_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_levels/search`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),del:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_levels/del`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_levels/:room_level_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_levels`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_levels`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/room_levels`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},scopeConfig:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/scope_config`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/scope_config`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),accessCode:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/scope_config/access_code`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},reserveConfigForm:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/form`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/form`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},reserveConfigAdmin:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},reserveConfigDisableInform:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},reserveConfig:{patch:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id`,o),method:"PATCH",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),reserveScope:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/reserve_configs/reserve_scope`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},export:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/exports/:task_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),download:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/exports/download`,o),method:"GET",headers:a,data:s,params:i,responseType:"stream",paramsSerializer:u=>(0,c.stringify)(u,{arrayFormat:"repeat"}),$return_headers:!0}).catch(u=>{throw this.logger.error(p(u)),u}),y=()=>{let u="The stream has already been consumed";if(!e.data.readable)throw this.logger.error(u),new Error(u)};return{writeFile:u=>h(this,void 0,void 0,function*(){return y(),new Promise((f,d)=>{let m=te.createWriteStream(u);m.on("finish",()=>{f(u)}),m.on("error",g=>{d(g)}),e.data.pipe(m)})}),getReadableStream:()=>(y(),e.data),headers:e.headers}}),resourceReservationList:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/exports/resource_reservation_list`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),participantQualityList:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/exports/participant_quality_list`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),participantList:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/exports/participant_list`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),meetingList:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/exports/meeting_list`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},meetingList:{getWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meeting_list`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meeting_list`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},participantList:{getWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/participant_list`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/participant_list`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},meetingPullSubtitle:{getWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/pull_subtitle`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/pull_subtitle`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},note:{subscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/notes/subscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),unsubscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/notes/unsubscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),unifiedNoteTranscriptWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/notes/:note_id/unified_note_transcript`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),unifiedNoteTranscript:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/notes/:note_id/unified_note_transcript`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/notes/:note_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},recording:{unsubscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/recordings/unsubscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),subscription:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/recordings/subscription`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},bot:{realtimeEndpoint:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/realtime/endpoint`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),leave:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/bots/leave`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),message:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/bots/message`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),userActiveMeeting:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/bots/user_active_meeting`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),join:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/bots/join`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),eventsWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/bots/events`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),events:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/vc/v1/bots/events`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},jf=class extends Cf{constructor(){super(...arguments),this.verification={v1:{verification:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/verification/v1/verification`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Df=class extends jf{constructor(){super(...arguments),this.wiki={spaceSetting:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/setting`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},spaceNode:{updateTitle:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/update_title`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),moveDocsToWiki:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/move_docs_to_wiki`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),copy:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/copy`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),move:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/move`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},spaceMember:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members/:member_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},space:{getNode:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/get_node`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/:space_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},task:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/tasks/:task_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{node:{searchWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v1/nodes/search`,o),method:"POST",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v1/nodes/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}},v2:{spaceSetting:{update:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/setting`,o),method:"PUT",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},spaceNode:{updateTitle:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/update_title`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),moveDocsToWiki:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/move_docs_to_wiki`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),copy:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/copy`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),move:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/move`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},spaceMember:{delete:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members/:member_id`,o),method:"DELETE",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},space:{getNode:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/get_node`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),create:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces/:space_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})}),listWithIterator:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r),e=u=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces`,o),method:"GET",headers:(0,k.default)(u.headers,I.default),params:(0,k.default)(u.params,I.default),data:s,paramsSerializer:d=>(0,c.stringify)(d,{arrayFormat:"repeat"})}).catch(d=>{this.logger.error(p(d))})});return{[Symbol.asyncIterator](){return x(this,arguments,function*(){let f=!0,d;for(;f;)try{let m=yield v(e({headers:a,params:Object.assign(Object.assign({},i),{page_token:d}),data:s})),g=m?.data||{},{has_more:_,page_token:b,next_page_token:w}=g,S=T(g,["has_more","page_token","next_page_token"]);yield yield v(S),f=!!_,d=b||w}catch{yield yield v(null);break}})}}}),list:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/spaces`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},task:{get:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/wiki/v2/tasks/:task_id`,o),method:"GET",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},Gf=class extends Df{constructor(){super(...arguments),this.workplace={workplaceAccessData:{search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/workplace/v1/workplace_access_data/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},workplaceBlockAccessData:{search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/workplace/v1/workplace_block_access_data/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},customWorkplaceAccessData:{search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/workplace/v1/custom_workplace_access_data/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},v1:{workplaceAccessData:{search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/workplace/v1/workplace_access_data/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},workplaceBlockAccessData:{search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/workplace/v1/workplace_block_access_data/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})},customWorkplaceAccessData:{search:(t,r)=>h(this,void 0,void 0,function*(){let{headers:a,params:i,data:s,path:o}=yield this.formatPayload(t,r);return this.httpInstance.request({url:l(`${this.domain}/open-apis/workplace/v1/custom_workplace_access_data/search`,o),method:"POST",data:s,params:i,headers:a,paramsSerializer:e=>(0,c.stringify)(e,{arrayFormat:"repeat"})}).catch(e=>{throw this.logger.error(p(e)),e})})}}}}},nr={error:(...n)=>{console.log("[error]:",...n)},warn:(...n)=>{console.warn("[warn]:",...n)},info:(...n)=>{console.info("[info]:",...n)},debug:(...n)=>{console.debug("[debug]:",...n)},trace:(...n)=>{console.trace("[trace]:",...n)}},xr=class{constructor(t,r){this.level=t,this.logger=r}error(...t){this.level>=dt.error&&this.logger.error(t)}warn(...t){this.level>=dt.warn&&this.logger.warn(t)}info(...t){this.level>=dt.info&&this.logger.info(t)}debug(...t){this.level>=dt.debug&&this.logger.debug(t)}trace(...t){this.level>=dt.trace&&this.logger.trace(t)}},Bf=class{constructor(t){this.appId=t.appId,this.appSecret=t.appSecret,this.cache=t.cache,this.domain=t.domain,this.logger=t.logger,this.appType=t.appType,this.httpInstance=t.httpInstance,this.logger.debug("app ticket manager is ready"),this.checkAppTicket()}checkAppTicket(){var t;return h(this,void 0,void 0,function*(){this.appType===Nt.ISV&&((yield(t=this.cache)===null||t===void 0?void 0:t.get(ao,{namespace:this.appId}))||this.requestAppTicket())})}requestAppTicket(){return h(this,void 0,void 0,function*(){this.logger.debug("request app ticket"),yield this.httpInstance.post(`${this.domain}/open-apis/auth/v3/app_ticket/resend`,{app_id:this.appId,app_secret:this.appSecret}).catch(t=>{this.logger.error(t)})})}getAppTicket(){var t;return h(this,void 0,void 0,function*(){let r=yield(t=this.cache)===null||t===void 0?void 0:t.get(ao,{namespace:this.appId});if(r)return this.logger.debug("use cache app ticket"),r;yield this.requestAppTicket()})}},Ch="/oauth/v3/token",JG="urn:ietf:params:oauth:grant-type:jwt-bearer",wT="urn:ietf:params:oauth:client-assertion-type:jwt-bearer",XG="authorization_code",YG="refresh_token",dy="X-Target-Service",ST=7100,cy=7101,IT=7102,ly=7104,ZG=Object.freeze({"open.feishu.cn":"https://accounts.feishu.cn","open.larksuite.com":"https://accounts.larksuite.com"}),Qe=class extends Error{constructor(t,r){super(r),this.name="ClientAssertionError",this.code=t,this.msg=r}},gi=class extends Error{constructor(t,r,a,i){super(i||a||"access token request failed"),this.name="AccessTokenError",this.statusCode=t,this.code=r,this.error=a,this.errorDescription=i}},py=n=>n.includes("://")?n:`https://${n}`;function uy(n){let t=new URL(py(n));if(!t.host)throw new Error(`invalid url: ${n}`);return t.host}function my(n){if(n.oauthBaseUrl)return py(n.oauthBaseUrl).replace(/\/+$/,"");let t=uy(n.domain),r=ZG[t];if(r)return r;throw new Error("oauthBaseUrl is not configured. When domain is a non-default value (neither open.feishu.cn nor open.larksuite.com), set oauthBaseUrl explicitly.")}function kT(n){return uy(my(n))}function fy(n,t){let r=new URL(py(n.targetService));if(r.protocol!=="https:")throw new Error("targetService must use https");if(r.username||r.password)throw new Error("targetService must not contain userinfo");let i=`${n.targetPrefix||""}${t}`.replace(/\/{2,}/g,"/");if(/(^|\/)\.\.(\/|$)/.test(i))throw new Error("targetPrefix must not contain path traversal");return`${r.protocol}//${r.host}${i}`}function eB(n,t){var r,a;let i=(r=t?.code)!==null&&r!==void 0?r:"unknown",s=(a=t?.msg)!==null&&a!==void 0?a:"no message";return`failed to get ${n}, code: ${i}, msg: ${s}`}var Mf=class{constructor(t){this.appId=t.appId,this.appSecret=t.appSecret,this.cache=t.cache,this.domain=t.domain,this.logger=t.logger,this.appType=t.appType,this.httpInstance=t.httpInstance,this.clientAssertionProvider=t.clientAssertionProvider,this.oauthBaseUrl=t.oauthBaseUrl,this.appTicketManager=new Bf({appId:this.appId,appSecret:this.appSecret,cache:this.cache,domain:this.domain,logger:this.logger,appType:this.appType,httpInstance:this.httpInstance}),this.logger.debug("token manager is ready")}requestToken(t,r,a){return h(this,void 0,void 0,function*(){let i=yield this.httpInstance.post(t,r).catch(s=>{throw this.logger.error(s),s});if(!i||!i[a])throw new Error(eB(a,i));return i})}getCustomTenantAccessToken(){var t,r;return h(this,void 0,void 0,function*(){if(this.clientAssertionProvider)return this.getTenantTokenByClientAssertion();let a=yield(t=this.cache)===null||t===void 0?void 0:t.get(Ys,{namespace:this.appId});if(a)return this.logger.debug("use cache token"),a;this.logger.debug("request token");let{tenant_access_token:i,expire:s}=yield this.requestToken(`${this.domain}/open-apis/auth/v3/tenant_access_token/internal`,{app_id:this.appId,app_secret:this.appSecret},"tenant_access_token");return yield(r=this.cache)===null||r===void 0?void 0:r.set(Ys,i,new Date().getTime()+s*1e3-180*1e3,{namespace:this.appId}),i})}getTenantTokenByClientAssertion(){var t,r,a,i,s,o,e,y;return h(this,void 0,void 0,function*(){let u=my({oauthBaseUrl:this.oauthBaseUrl,domain:this.domain}),f=kT({oauthBaseUrl:this.oauthBaseUrl,domain:this.domain}),d=yield(t=this.cache)===null||t===void 0?void 0:t.get(Ys,{namespace:this.appId});if(d)return this.logger.debug("use cache token"),d;let m;try{m=yield this.clientAssertionProvider.retrieveToken(f)}catch(O){throw new Qe(IT,O?.message||"client assertion provider failed")}if(!m||!m.value)throw new Qe(cy,"client assertion token is empty");let g=`${u}${Ch}`,_={};m.targetInfo&&(g=fy(m.targetInfo,Ch),_[dy]=f),this.logger.debug("request token (client assertion)");let b;try{b=yield this.httpInstance.request({method:"post",url:g,headers:_,data:{grant_type:JG,client_assertion_type:wT,client_assertion:m.value,client_id:this.appId}})}catch(O){throw this.logger.error(O),new Qe(((a=(r=O?.response)===null||r===void 0?void 0:r.data)===null||a===void 0?void 0:a.code)||0,((s=(i=O?.response)===null||i===void 0?void 0:i.data)===null||s===void 0?void 0:s.error_description)||((e=(o=O?.response)===null||o===void 0?void 0:o.data)===null||e===void 0?void 0:e.error)||"client assertion token exchange failed")}let w=b?.access_token;if(!w)throw new Qe(b?.code||0,b?.error_description||b?.error||"oauth token response missing access token");let S=Number(b?.expires_in)||0;return yield(y=this.cache)===null||y===void 0?void 0:y.set(Ys,w,new Date().getTime()+Math.max(S-180,0)*1e3,{namespace:this.appId}),w})}getMarketTenantAccessToken(t){var r;return h(this,void 0,void 0,function*(){if(this.clientAssertionProvider)throw new Qe(ST,"ClientAssertion mode is not supported for ISV apps");if(!t){this.logger.error("market app request need tenant key");return}let a=yield(r=this.cache)===null||r===void 0?void 0:r.get(`larkMarketAccessToken${t}`,{namespace:this.appId});if(a)return this.logger.debug("use cache token"),a;this.logger.debug("get app ticket");let i=yield this.appTicketManager.getAppTicket();if(!i){this.logger.warn("no app ticket");return}this.logger.debug("get app access token");let{app_access_token:s}=yield this.requestToken(`${this.domain}/open-apis/auth/v3/app_access_token`,{app_id:this.appId,app_secret:this.appSecret,app_ticket:i},"app_access_token");this.logger.debug("get tenant access token");let{tenant_access_token:o,expire:e}=yield this.requestToken(`${this.domain}/open-apis/auth/v3/tenant_access_token`,{app_access_token:s,tenant_key:t},"tenant_access_token");return yield this.cache.set(`larkMarketAccessToken${t}`,o,new Date().getTime()+e*1e3-180*1e3,{namespace:this.appId}),o})}getTenantAccessToken(t){return h(this,void 0,void 0,function*(){return Ah(this.appType===Nt.SelfBuild,()=>h(this,void 0,void 0,function*(){this.logger.debug("get custom app token")})),Ah(this.appType===Nt.ISV,()=>h(this,void 0,void 0,function*(){this.logger.debug("get market app token ")})),this.appType===Nt.SelfBuild?yield this.getCustomTenantAccessToken():yield this.getMarketTenantAccessToken(t?.[zh])})}},TT=(n,t)=>{let r=Object.assign({},n);for(let[a,i]of Object.entries(t))i!==void 0&&(r[a]=i);return r},Lf=class{constructor(t){this.client=t.client}getCacheKey(t,r){return`${r?.namespace||this.client.appId}/${QG.toString()}/${t}`}calibrateTime(t){return new Date().getTime()+(t||0)*1e3-180*1e3}initWithCode(t,r){return h(this,void 0,void 0,function*(){let a={};for(let[i,s]of Object.entries(t)){let o=yield this.client.authen.oidcAccessToken.create({data:{grant_type:"authorization_code",code:s}});if(o.code!==0){this.client.logger.error("init user access token error",i,o.msg||o.message);continue}if(!o.data){this.client.logger.error("user access code expired",i,s);continue}a[i]={code:s,token:o.data.access_token,refreshToken:o.data.refresh_token,expiredTime:this.calibrateTime(o.data.expires_in)}}return yield this.update(a,{namespace:r?.namespace}),a})}update(t,r){return h(this,void 0,void 0,function*(){for(let[a,i]of Object.entries(t)){let s=this.getCacheKey(a,{namespace:r?.namespace}),o=(yield this.client.cache.get(s))||{},{code:e,token:y,refreshToken:u,expiredTime:f}=i,d=TT(o,{code:e,token:y,refreshToken:u,expiredTime:f});yield this.client.cache.set(s,d,1/0)}})}get(t,r){return h(this,void 0,void 0,function*(){let a=this.getCacheKey(t,{namespace:r?.namespace}),i=yield this.client.cache.get(a);if(!i){this.client.logger.error("user access token needs to be initialized or updated first");return}let{token:s,code:o,refreshToken:e,expiredTime:y}=i;if(s&&y&&y-new Date().getTime()>0)return s;if(e){let u=yield this.client.authen.oidcRefreshAccessToken.create({data:{grant_type:"refresh_token",refresh_token:e}});if(u.code===0&&u.data)return yield this.update({[t]:{token:u.data.access_token,refreshToken:u.data.refresh_token,expiredTime:this.calibrateTime(u.data.expires_in)}}),u.data.access_token;this.client.logger.error("get user access token by refresh token failed.",u.msg);return}if(o){let u=yield this.client.authen.oidcAccessToken.create({data:{grant_type:"authorization_code",code:o}});u.code===0&&u.data?yield this.update({[t]:{token:u.data.access_token,refreshToken:u.data.refresh_token,expiredTime:this.calibrateTime(u.data.expires_in)}}):this.client.logger.error("get user access token by code failed.",u.msg)}})}},fi=n=>n===""||n===0||n===null||n===void 0?void 0:n,tB=n=>{if(!n||n.error)return!0;let{code:t}=n;return t!==void 0&&t!==0&&t!=="0"&&t!==""},Nf=class{constructor(t){this.appId=t.appId,this.appSecret=t.appSecret,this.clientAssertionProvider=t.clientAssertionProvider,this.oauthBaseUrl=t.oauthBaseUrl,this.domain=t.domain,this.httpInstance=t.httpInstance,this.logger=t.logger}retrieveByAuthorizationCode(t){return h(this,void 0,void 0,function*(){return this.doRequest({grant_type:XG,code:t.code,redirect_uri:t.redirectUri,code_verifier:t.codeVerifier,scope:t.scope},t.headers)})}refresh(t){return h(this,void 0,void 0,function*(){return this.doRequest({grant_type:YG,refresh_token:t.refreshToken,scope:t.scope},t.headers)})}doRequest(t,r){return h(this,void 0,void 0,function*(){let a=my({oauthBaseUrl:this.oauthBaseUrl,domain:this.domain}),i=kT({oauthBaseUrl:this.oauthBaseUrl,domain:this.domain}),s={client_id:this.appId};for(let[d,m]of Object.entries(t))m!=null&&(s[d]=m);let o=`${a}${Ch}`,e=Object.assign({},r||{});if(this.clientAssertionProvider){let d;try{d=yield this.clientAssertionProvider.retrieveToken(i)}catch(m){throw new Qe(IT,m?.message||"client assertion provider failed")}if(!d||!d.value)throw new Qe(cy,"client assertion token is empty");s.client_assertion_type=wT,s.client_assertion=d.value,d.targetInfo&&(o=fy(d.targetInfo,Ch),e[dy]=i)}else if(this.appSecret)s.client_secret=this.appSecret;else throw new Qe(ly,"appSecret and clientAssertionProvider cannot both be empty for accessToken APIs");let y=200,u;try{u=yield this.httpInstance.request({method:"post",url:o,headers:e,data:s})}catch(d){if(this.logger.error(d),d?.response)y=d.response.status,u=d.response.data;else throw new gi(0,0,"",d?.message||"oauth token request failed")}if(y!==200||tB(u))throw new gi(y,u?.code||0,u?.error||"",u?.error_description||u?.msg||"");let f=fi(u?.access_token);if(!f)throw new gi(y,u?.code||0,u?.error||"",u?.error_description||"oauth token response missing access_token");return{accessToken:f,tokenType:fi(u.token_type),expiresIn:fi(u.expires_in),refreshToken:fi(u.refresh_token),refreshTokenExpiresIn:fi(u.refresh_token_expires_in),scope:fi(u.scope)}})}},jh=class extends Gf{constructor(t){if(super(),this.appId="",this.appSecret="",this.helpDeskId="",this.helpDeskToken="",this.appType=Nt.SelfBuild,this.logger=new xr(t.loggerLevel||dt.info,t.logger||nr),this.appId=t.appId,this.appSecret=t.appSecret||"",this.clientAssertionProvider=t.clientAssertionProvider,this.oauthBaseUrl=t.oauthBaseUrl,this.disableTokenCache=t.disableTokenCache,this.userAgent=hy(t.source,{extraTags:t.extraUaTags}),Ah(!this.appId,()=>this.logger.error("appId is needed")),this.helpDeskId=t.helpDeskId,this.helpDeskToken=t.helpDeskToken,this.appType=t?.appType||Nt.SelfBuild,!this.appSecret&&!this.clientAssertionProvider)throw new Qe(ly,"appSecret or clientAssertionProvider is required");if(this.clientAssertionProvider&&this.appType===Nt.ISV)throw new Qe(ST,"ClientAssertion mode is not supported for ISV apps");this.domain=bT(t.domain||Ut.Feishu),this.logger.debug(`use domain url: ${this.domain}`),this.cache=t.cache||so,this.httpInstance=t.httpInstance||vi,this.tokenManager=new Mf({appId:this.appId,appSecret:this.appSecret,cache:this.cache,domain:this.domain,logger:this.logger,appType:this.appType,httpInstance:this.httpInstance,clientAssertionProvider:this.clientAssertionProvider,oauthBaseUrl:this.oauthBaseUrl}),this.userAccessToken=new Lf({client:this}),this.accessToken=new Nf({appId:this.appId,appSecret:this.appSecret,clientAssertionProvider:this.clientAssertionProvider,oauthBaseUrl:this.oauthBaseUrl,domain:this.domain,httpInstance:this.httpInstance,logger:this.logger}),this.logger.info("client ready")}formatPayload(t,r){var a,i,s;return h(this,void 0,void 0,function*(){let o=["lark","params","data","headers","path"].reduce((u,f)=>(u[f]=r?.[f]||{},u),{}),e=(a=o?.lark)===null||a===void 0?void 0:a[_T];if(e)this.logger.debug("use passed token"),o.headers.Authorization=`Bearer ${e}`;else if(!this.disableTokenCache){let u=yield this.tokenManager.getTenantAccessToken({[zh]:(i=o?.lark)===null||i===void 0?void 0:i[zh]});u?o.headers.Authorization=`Bearer ${u}`:this.logger.warn("failed to obtain token")}if((s=o?.lark)===null||s===void 0?void 0:s[vT]){this.logger.debug("generate help desk credential");let u=VG(`${this.helpDeskId}:${this.helpDeskToken}`);o.headers["X-Lark-Helpdesk-Authorization"]=`Bearer ${u}`}return{params:Object.assign(Object.assign({},t?.params||{}),o.params),headers:Object.assign(Object.assign({"User-Agent":this.userAgent},t?.headers||{}),o.headers),data:Object.assign(Object.assign({},t?.data||{}),o.data),path:Object.assign(Object.assign({},t?.path||{}),o.path)}})}request(t,r){var a;return h(this,void 0,void 0,function*(){let{data:i,params:s,headers:o,url:e}=t,y=T(t,["data","params","headers","url"]),u=yield this.formatPayload({data:i,params:s,headers:o},r),f=((a=t.method)===null||a===void 0?void 0:a.toLowerCase())==="get"&&Object.keys(u.data).length===0?void 0:u.data;return this.logger.trace(`send request [${t.method}]: ${t.url}`),yield this.httpInstance.request(Object.assign(Object.assign({},y),{url:/^http/.test(e)?e:`${this.domain}/${KG(e)}`,headers:u.headers,data:f,params:u.params})).catch(m=>{throw this.logger.error(m),m})})}},rB=n=>n.reduce((t,r)=>(0,yT.default)(t,r),{}),aB=n=>({lark:{[zh]:n}}),iB=()=>({lark:{[vT]:!0}}),sB=n=>({headers:{Authorization:`Bearer ${n}`}}),oB=n=>({lark:{[_T]:n}}),Dh=class{constructor(t){let{encryptKey:r,verificationToken:a,logger:i}=t;this.verificationToken=a,this.encryptKey=r,this.logger=i,r&&(this.aesCipher=new io(r))}parse(t){var r,a;let i=(()=>{var e;let y=t||{},{encrypt:u}=y,f=T(y,["encrypt"]);if(u)try{return Object.assign(Object.assign({},JSON.parse((e=this.aesCipher)===null||e===void 0?void 0:e.decrypt(u))),f)}catch{return this.logger.error("parse encrypt data failed"),{}}return f})();if("schema"in i){let{header:e,event:y}=i,u=T(i,["header","event"]);return Object.assign(Object.assign(Object.assign({[$h]:(r=i?.header)===null||r===void 0?void 0:r.event_type},u),e),y)}let{event:s}=i,o=T(i,["event"]);return Object.assign(Object.assign({[$h]:(a=i?.event)===null||a===void 0?void 0:a.type},s),o)}checkIsCardEventValidated(t){if("encrypt"in t||"schema"in t)return this.checkIsEventValidated(t);let{"x-lark-request-timestamp":r,"x-lark-request-nonce":a,"x-lark-signature":i}=t.headers;return this.verificationToken?Oh.createHash("sha1").update(r+a+this.verificationToken+JSON.stringify(t)).digest("hex")===i:!0}checkIsEventValidated(t){if(!this.encryptKey)return!0;let{"x-lark-request-timestamp":r,"x-lark-request-nonce":a,"x-lark-signature":i}=t.headers,s=r+a+this.encryptKey+JSON.stringify(t);return Oh.createHash("sha256").update(s).digest("hex")===i}},nB="app_ticket",Gh=class{constructor(t){this.verificationToken="",this.encryptKey="",this.handles=new Map;let{encryptKey:r,verificationToken:a}=t;this.encryptKey=r||"",this.verificationToken=a||"",this.logger=new xr(t.loggerLevel||dt.info,t.logger||nr),this.requestHandle=new Dh({encryptKey:r,verificationToken:a,logger:this.logger}),this.cache=t.cache||so,this.registerAppTicketHandle(),this.logger.info("event-dispatch is ready")}registerAppTicketHandle(){this.register({app_ticket:t=>h(this,void 0,void 0,function*(){let{app_ticket:r,app_id:a}=t;r?(yield this.cache.set(ao,r,void 0,{namespace:a}),this.logger.debug("set app ticket")):this.logger.warn("response not include app ticket")})})}register(t){return Object.keys(t).forEach(r=>{this.handles.has(r)&&r!==nB&&this.logger.error(`this ${r} handle is registered`),this.handles.set(r,t[r]),this.logger.debug(`register ${r} handle`)}),this}invoke(t,r){var a,i;return h(this,void 0,void 0,function*(){if(r?.needCheck!==!1&&!(!((a=this.requestHandle)===null||a===void 0)&&a.checkIsEventValidated(t))){this.logger.warn("verification failed event");return}let o=(i=this.requestHandle)===null||i===void 0?void 0:i.parse(t),e=o[$h];if(this.handles.has(e)){let y=yield this.handles.get(e)(o);return this.logger.debug(`execute ${e} handle`),y}return this.logger.warn(`no ${e} handle`),`no ${e} event handle`})}},Uf=class{constructor(t,r){this.verificationToken="",this.encryptKey="",this.handles=new Map;let{verificationToken:a,encryptKey:i}=t;this.encryptKey=i||"",this.verificationToken=a||"",this.cardHandler=r,this.logger=new xr(t.loggerLevel||dt.info,t.logger||nr),this.requestHandle=new Dh({encryptKey:i,verificationToken:a,logger:this.logger}),this.cache=t.cache||so,this.registerAppTicketHandle(),this.logger.info("card-action-handle is ready")}registerAppTicketHandle(){this.register({app_ticket:t=>h(this,void 0,void 0,function*(){let{app_ticket:r,app_id:a}=t;r?(yield this.cache.set(ao,r,void 0,{namespace:a}),this.logger.debug("set app ticket")):this.logger.warn("response not include app ticket")})})}register(t){return Object.keys(t).forEach(r=>{this.handles.set(r,t[r]),this.logger.debug(`register ${r} handle`)}),this}invoke(t){var r,a;return h(this,void 0,void 0,function*(){if(!(!((r=this.requestHandle)===null||r===void 0)&&r.checkIsCardEventValidated(t))){this.logger.warn("verification failed event");return}let i=(a=this.requestHandle)===null||a===void 0?void 0:a.parse(t),s=i[$h];if(this.handles.has(s))try{return yield this.handles.get(s)(i)}catch(o){this.logger.error(o);return}try{let o=yield this.cardHandler(i);return this.logger.debug("execute card handle"),o}catch(o){this.logger.error(o)}})}},Hh=n=>new Promise(t=>{let r="";n.on("data",a=>{r+=a}),n.on("end",()=>{try{let a=JSON.parse(r);t(a)}catch{t("")}})}),oo=(n,t)=>{if("encrypt"in n&&!t.encryptKey)throw new Error("auto-challenge need encryptKey, please check for missing in dispatcher");let r="encrypt"in n?JSON.parse(new io(t.encryptKey).decrypt(n.encrypt)):n;return{isChallenge:r.type==="url_verification",challenge:{challenge:r.challenge}}},hB=(n,t,r)=>(a,i)=>h(void 0,void 0,void 0,function*(){if(a.url!==n)return;let s=Object.assign(Object.create({headers:a.headers}),yield Hh(a));if(r?.autoChallenge||!1){let{isChallenge:y,challenge:u}=oo(s,{encryptKey:t.encryptKey});if(y){i.end(JSON.stringify(u));return}}let e=yield t.invoke(s);i.end(JSON.stringify(e))}),dB=(n,t)=>(r,a)=>h(void 0,void 0,void 0,function*(){let i=yield h(void 0,void 0,void 0,function*(){return r.body?r.body:r.complete?((t?.logger||nr).error("unable to obtain request body, if parsed it in other middleware, please manually set in ctx.request.body"),null):yield Hh(r)}),s=Object.assign(Object.create({headers:r.headers}),i);if(t?.autoChallenge||!1){let{isChallenge:y,challenge:u}=oo(s,{encryptKey:n.encryptKey});if(y){a.json(u);return}}let e=yield n.invoke(s);a.json(e)}),cB=(n,t,r)=>(a,i)=>h(void 0,void 0,void 0,function*(){let{originalUrl:s,req:o,request:e}=a;if(s===n){let y=yield h(void 0,void 0,void 0,function*(){return e.body?e.body:o.complete?((r?.logger||nr).error("unable to obtain request body, if parsed it in other middleware, please manually set in ctx.request.body"),null):yield Hh(o)}),u=Object.assign(Object.create({headers:o.headers}),y);if(r?.autoChallenge||!1){let{isChallenge:m,challenge:g}=oo(u,{encryptKey:t.encryptKey});if(m){a.body=g,yield i();return}}let d=yield t.invoke(u);a.body=JSON.stringify(d)}yield i()}),lB=(n,t)=>(r,a)=>h(void 0,void 0,void 0,function*(){let{req:i,request:s}=r,o=yield h(void 0,void 0,void 0,function*(){return s.body?s.body:i.complete?((t?.logger||nr).error("unable to obtain request body, if parsed it in other middleware, please manually set in ctx.request.body"),null):yield Hh(i)}),e=Object.assign(Object.create({headers:i.headers}),o);if(t?.autoChallenge||!1){let{isChallenge:f,challenge:d}=oo(e,{encryptKey:n.encryptKey});if(f){r.body=d,yield a();return}}let u=yield n.invoke(e);r.body=JSON.stringify(u),yield a()}),pB=n=>{let{title:t,content:r}=n;return JSON.stringify({config:{wide_screen_mode:!0},elements:[{tag:"markdown",content:r}],header:{template:"blue",title:{content:t,tag:"plain_text"}}})},uB=Object.freeze({__proto__:null,defaultCard:pB}),or=Kk();or.util.Long=void 0;or.configure();var Tr=or.Reader,eT=or.Writer,X=or.util,wt=or.roots.default||(or.roots.default={}),xT=wt.pbbp2=(()=>{let n={};return n.Header=(function(){function t(r){if(r)for(let a=Object.keys(r),i=0;i>>3){case 1:{o.key=a.string();break}case 2:{o.value=a.string();break}default:a.skipType(e&7);break}}if(!o.hasOwnProperty("key"))throw X.ProtocolError("missing required 'key'",{instance:o});if(!o.hasOwnProperty("value"))throw X.ProtocolError("missing required 'value'",{instance:o});return o},t.decodeDelimited=function(a){return a instanceof Tr||(a=new Tr(a)),this.decode(a,a.uint32())},t.verify=function(a){return typeof a!="object"||a===null?"object expected":X.isString(a.key)?X.isString(a.value)?null:"value: string expected":"key: string expected"},t.fromObject=function(a){if(a instanceof wt.pbbp2.Header)return a;let i=new wt.pbbp2.Header;return a.key!=null&&(i.key=String(a.key)),a.value!=null&&(i.value=String(a.value)),i},t.toObject=function(a,i){i||(i={});let s={};return i.defaults&&(s.key="",s.value=""),a.key!=null&&a.hasOwnProperty("key")&&(s.key=a.key),a.value!=null&&a.hasOwnProperty("value")&&(s.value=a.value),s},t.prototype.toJSON=function(){return this.constructor.toObject(this,or.util.toJSONOptions)},t.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/pbbp2.Header"},t})(),n.Frame=(function(){function t(r){if(this.headers=[],r)for(let a=Object.keys(r),i=0;i>>3){case 1:{o.SeqID=a.uint64();break}case 2:{o.LogID=a.uint64();break}case 3:{o.service=a.int32();break}case 4:{o.method=a.int32();break}case 5:{o.headers&&o.headers.length||(o.headers=[]),o.headers.push(wt.pbbp2.Header.decode(a,a.uint32()));break}case 6:{o.payloadEncoding=a.string();break}case 7:{o.payloadType=a.string();break}case 8:{o.payload=a.bytes();break}case 9:{o.LogIDNew=a.string();break}default:a.skipType(e&7);break}}if(!o.hasOwnProperty("SeqID"))throw X.ProtocolError("missing required 'SeqID'",{instance:o});if(!o.hasOwnProperty("LogID"))throw X.ProtocolError("missing required 'LogID'",{instance:o});if(!o.hasOwnProperty("service"))throw X.ProtocolError("missing required 'service'",{instance:o});if(!o.hasOwnProperty("method"))throw X.ProtocolError("missing required 'method'",{instance:o});return o},t.decodeDelimited=function(a){return a instanceof Tr||(a=new Tr(a)),this.decode(a,a.uint32())},t.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(!X.isInteger(a.SeqID)&&!(a.SeqID&&X.isInteger(a.SeqID.low)&&X.isInteger(a.SeqID.high)))return"SeqID: integer|Long expected";if(!X.isInteger(a.LogID)&&!(a.LogID&&X.isInteger(a.LogID.low)&&X.isInteger(a.LogID.high)))return"LogID: integer|Long expected";if(!X.isInteger(a.service))return"service: integer expected";if(!X.isInteger(a.method))return"method: integer expected";if(a.headers!=null&&a.hasOwnProperty("headers")){if(!Array.isArray(a.headers))return"headers: array expected";for(let i=0;i>>0,a.SeqID.high>>>0).toNumber(!0))),a.LogID!=null&&(X.Long?(i.LogID=X.Long.fromValue(a.LogID)).unsigned=!0:typeof a.LogID=="string"?i.LogID=parseInt(a.LogID,10):typeof a.LogID=="number"?i.LogID=a.LogID:typeof a.LogID=="object"&&(i.LogID=new X.LongBits(a.LogID.low>>>0,a.LogID.high>>>0).toNumber(!0))),a.service!=null&&(i.service=a.service|0),a.method!=null&&(i.method=a.method|0),a.headers){if(!Array.isArray(a.headers))throw TypeError(".pbbp2.Frame.headers: array expected");i.headers=[];for(let s=0;s=0&&(i.payload=a.payload)),a.LogIDNew!=null&&(i.LogIDNew=String(a.LogIDNew)),i},t.toObject=function(a,i){i||(i={});let s={};if((i.arrays||i.defaults)&&(s.headers=[]),i.defaults){if(X.Long){let o=new X.Long(0,0,!0);s.SeqID=i.longs===String?o.toString():i.longs===Number?o.toNumber():o}else s.SeqID=i.longs===String?"0":0;if(X.Long){let o=new X.Long(0,0,!0);s.LogID=i.longs===String?o.toString():i.longs===Number?o.toNumber():o}else s.LogID=i.longs===String?"0":0;s.service=0,s.method=0,s.payloadEncoding="",s.payloadType="",i.bytes===String?s.payload="":(s.payload=[],i.bytes!==Array&&(s.payload=X.newBuffer(s.payload))),s.LogIDNew=""}if(a.SeqID!=null&&a.hasOwnProperty("SeqID")&&(typeof a.SeqID=="number"?s.SeqID=i.longs===String?String(a.SeqID):a.SeqID:s.SeqID=i.longs===String?X.Long.prototype.toString.call(a.SeqID):i.longs===Number?new X.LongBits(a.SeqID.low>>>0,a.SeqID.high>>>0).toNumber(!0):a.SeqID),a.LogID!=null&&a.hasOwnProperty("LogID")&&(typeof a.LogID=="number"?s.LogID=i.longs===String?String(a.LogID):a.LogID:s.LogID=i.longs===String?X.Long.prototype.toString.call(a.LogID):i.longs===Number?new X.LongBits(a.LogID.low>>>0,a.LogID.high>>>0).toNumber(!0):a.LogID),a.service!=null&&a.hasOwnProperty("service")&&(s.service=a.service),a.method!=null&&a.hasOwnProperty("method")&&(s.method=a.method),a.headers&&a.headers.length){s.headers=[];for(let o=0;oxT.Frame.decode(n),Wf=class{constructor(){this.client={appId:"",appSecret:"",domain:Ut.Feishu},this.ws={connectUrl:"",pingInterval:120*1e3,reconnectCount:-1,reconnectInterval:120*1e3,reconnectNonce:30*1e3,deviceId:"",serviceId:"",autoReconnect:!0},this.wsInstance=null}updateClient(t){Object.assign(this.client,t)}updateWs(t){Object.assign(this.ws,t)}getClient(t){return t===void 0?this.client:this.client[t]}getWS(t){return t===void 0?this.ws:this.ws[t]}get wsConfigUrl(){return`${this.getClient("domain")}/callback/ws/endpoint`}setWSInstance(t){this.wsInstance=t}getWSInstance(){return this.wsInstance}},Hf=class{constructor(t){this.cache=new Map,this.logger=t.logger,this.clearAtInterval()}mergeData(t){let{message_id:r,sum:a,seq:i,trace_id:s,data:o}=t,e=this.cache.get(r);if(e)e.buffer[i]=o;else{let u=new Array(a).fill(void 0);u[i]=o,this.cache.set(r,{buffer:u,trace_id:s,message_id:r,create_time:Date.now()})}let y=this.cache.get(r);if(y?.buffer.every(u=>!!u)){let u=y.buffer.reduce((m,g)=>{let _=new Uint8Array(m.byteLength+g.byteLength);return _.set(m,0),_.set(g,m.length),_},new Uint8Array([])),f=new TextDecoder("utf-8").decode(u),d=JSON.parse(f);return this.deleteCache(r),d}return null}deleteCache(t){this.cache.delete(t)}clearAtInterval(){if(this.timer)return;let t=1e4;this.timer=setInterval(()=>{let r=Date.now();this.cache.forEach((a,i)=>{var s;let{create_time:o,trace_id:e,message_id:y}=a;r-o>t&&((s=this.logger)===null||s===void 0||s.debug(`${y} event data is deleted as expired, trace_id: ${e}`),this.deleteCache(i))})},t),typeof this.timer.unref=="function"&&this.timer.unref()}destroy(){this.timer&&(clearInterval(this.timer),this.timer=void 0),this.cache.clear()}},eo;(function(n){n[n.ok=0]="ok",n[n.system_busy=1]="system_busy",n[n.forbidden=403]="forbidden",n[n.auth_failed=514]="auth_failed",n[n.internal_error=1000040343]="internal_error",n[n.exceed_conn_limit=1000040350]="exceed_conn_limit"})(eo||(eo={}));var to;(function(n){n[n.control=0]="control",n[n.data=1]="data"})(to||(to={}));var ro;(function(n){n.type="type",n.message_id="message_id",n.sum="sum",n.seq="seq",n.trace_id="trace_id",n.biz_rt="biz_rt",n.handshake_status="handshake-status",n.handshake_msg="handshake-msg",n.handshake_autherrcode="handshake-autherrcode"})(ro||(ro={}));var yi;(function(n){n.event="event",n.card="card",n.ping="ping",n.pong="pong"})(yi||(yi={}));var Bh;(function(n){n[n.ok=200]="ok",n[n.internal_server_error=500]="internal_server_error"})(Bh||(Bh={}));var Mh=class{constructor(t){var r;this.wsConfig=new Wf,this.reconnectGeneration=0,this.isConnecting=!1,this.reconnectInfo={lastConnectTime:0,nextConnectTime:0},this.hasEverConnected=!1,this.terminalError=!1,this.currentReconnectAttempts=0;let{appId:a,appSecret:i,clientAssertionProvider:s,agent:o,domain:e=Ut.Feishu,httpInstance:y=vi,loggerLevel:u=dt.info,logger:f=nr,autoReconnect:d=!0,source:m,extraUaTags:g,onReady:_,onError:b,onReconnecting:w,onReconnected:S,handshakeTimeoutMs:O,wsConfig:E}=t;if(this.userAgent=hy(m,{extraTags:g}),this.logger=new xr(u,f),Ah(!a,()=>this.logger.error("appId is needed")),!i&&!s)throw new Qe(ly,"appSecret or clientAssertionProvider is required");this.agent=o,this.dataCache=new Hf({logger:this.logger}),this.httpInstance=y,this.wsConfig.updateClient({appId:a,appSecret:i||"",clientAssertionProvider:s,domain:bT(e)}),this.wsConfig.updateWs({autoReconnect:d}),this.onReady=_,this.onError=b,this.onReconnecting=w,this.onReconnected=S,this.handshakeTimeoutMs=O,this.pingTimeoutSec=(r=E?.pingTimeout)!==null&&r!==void 0?r:0}armLiveness(){this.pingTimeoutSec&&(this.livenessTimer&&clearTimeout(this.livenessTimer),this.livenessTimer=setTimeout(()=>{var t;this.livenessTimer=void 0,this.logger.warn("[ws]",`no pong/inbound within ${this.pingTimeoutSec}s of last ping, terminating to trigger reconnect`);try{(t=this.wsConfig.getWSInstance())===null||t===void 0||t.terminate()}catch{}},this.pingTimeoutSec*1e3))}clearLiveness(){this.livenessTimer&&(clearTimeout(this.livenessTimer),this.livenessTimer=void 0)}safeInvoke(t,r,...a){if(r)try{r(...a)}catch(i){this.logger.error(`[ws] ${t} callback threw`,i)}}pullConnectConfig(){return h(this,void 0,void 0,function*(){let{appId:t,appSecret:r,clientAssertionProvider:a,domain:i}=this.wsConfig.getClient(),s="/callback/ws/endpoint",o=this.wsConfig.wsConfigUrl,e={locale:"zh","User-Agent":this.userAgent},y={AppID:t};try{if(a){let b=uy(i),w=yield a.retrieveToken(b);if(!w||!w.value)throw new Qe(cy,"client assertion token is empty");y.AppSecret="",y.ClientAssertion=w.value,w.targetInfo&&(o=fy(w.targetInfo,s),e[dy]=b)}else y.AppSecret=r;let{code:u,data:{URL:f,ClientConfig:d},msg:m}=yield this.httpInstance.request({method:"post",url:o,data:y,headers:e,timeout:15e3});if(u!==eo.ok){let b=u===eo.system_busy?"system busy":m;return this.logger.error("[ws]",`code: ${u}, ${b}`),u===eo.internal_error?{ok:!1,retryable:!0}:{ok:!1,retryable:!1,error:`pullConnectConfig failed: code=${u}, msg=${b}`}}let{device_id:g,service_id:_}=BG.parse(f);return this.wsConfig.updateWs({connectUrl:f,deviceId:g,serviceId:_,pingInterval:d.PingInterval*1e3,reconnectCount:d.ReconnectCount,reconnectInterval:d.ReconnectInterval*1e3,reconnectNonce:d.ReconnectNonce*1e3}),this.logger.debug("[ws]",`get connect config success, ws url: ${f}`),{ok:!0}}catch(u){return this.logger.error("[ws]",u?.message||"system busy"),u instanceof Qe?{ok:!1,retryable:!1,error:u.message}:{ok:!1,retryable:!0}}})}connect(){let t=this.wsConfig.getWS("connectUrl"),r;try{let{agent:a}=this;r=new Ns(t,{agent:a})}catch{this.logger.error("[ws]","new WebSocket error")}return r?new Promise(a=>{let i=!1,s,o=e=>{i||(i=!0,s&&clearTimeout(s),a(e))};this.handshakeTimeoutMs&&this.handshakeTimeoutMs>0&&(s=setTimeout(()=>{this.logger.error("[ws]",`handshake timeout after ${this.handshakeTimeoutMs}ms`),r.removeAllListeners();try{r.terminate()}catch{}o(!1)},this.handshakeTimeoutMs)),r.on("open",()=>{this.logger.debug("[ws]","ws connect success"),this.wsConfig.setWSInstance(r),this.pingLoop(),o(!0)}),r.on("error",()=>{this.logger.error("[ws]","ws connect failed"),o(!1)})}):Promise.resolve(!1)}reConnect(t=!1){return h(this,void 0,void 0,function*(){if(this.isConnecting&&!t){this.logger.debug("[ws]","repeat connection");return}this.isConnecting=!0;let r=++this.reconnectGeneration,a=()=>h(this,void 0,void 0,function*(){this.reconnectInfo.lastConnectTime=Date.now();let f=yield this.pullConnectConfig();return f.ok?(yield this.connect())?(this.communicate(),{ok:!0}):{ok:!1,retryable:!0}:f});this.pingInterval&&clearTimeout(this.pingInterval),this.reconnectInterval&&clearTimeout(this.reconnectInterval);let i=this.wsConfig.getWSInstance();if(t){i&&i?.terminate();let f={ok:!1,retryable:!0};try{f=yield a()}finally{this.isConnecting=!1}if(f.ok)this.hasEverConnected=!0,this.safeInvoke("onReady",this.onReady);else if(f.retryable)this.logger.error("[ws]","connect failed"),yield this.reConnect();else{this.hasEverConnected=!1,this.terminalError=!0,this.safeInvoke("onError",this.onError,new Error(f.error));return}this.logger.info("[ws]","ws client ready");return}let{autoReconnect:s,reconnectNonce:o,reconnectCount:e,reconnectInterval:y}=this.wsConfig.getWS();if(!s){this.hasEverConnected||(this.terminalError=!0,this.safeInvoke("onError",this.onError,new Error("WebSocket connect failed and autoReconnect is disabled")));return}this.logger.info("[ws]","reconnect"),this.hasEverConnected&&this.safeInvoke("onReconnecting",this.onReconnecting),i&&i?.terminate(),this.wsConfig.setWSInstance(null);let u=o?o*Math.random():0;this.reconnectInterval=setTimeout(()=>h(this,void 0,void 0,function*(){(function f(d){return h(this,void 0,void 0,function*(){if(r!==this.reconnectGeneration)return;d++,this.currentReconnectAttempts=d;let m=yield a();if(r===this.reconnectGeneration){if(m.ok){this.logger.debug("[ws]","reconnect success"),this.currentReconnectAttempts=0,this.hasEverConnected?this.safeInvoke("onReconnected",this.onReconnected):(this.hasEverConnected=!0,this.safeInvoke("onReady",this.onReady)),this.isConnecting=!1;return}if(!m.retryable){this.isConnecting=!1,this.hasEverConnected=!1,this.terminalError=!0,this.safeInvoke("onError",this.onError,new Error(m.error));return}if(this.logger.info("ws",`unable to connect to the server after trying ${d} times")`),e>=0&&d>=e){this.isConnecting=!1,this.terminalError=!0,this.safeInvoke("onError",this.onError,new Error(`WebSocket reconnect exhausted after ${d} attempts`));return}this.reconnectInterval=setTimeout(()=>{f.bind(this)(d)},y),this.reconnectInfo.nextConnectTime=Date.now()+y}})}).bind(this)(0)}),u),this.reconnectInfo.nextConnectTime=Date.now()+u})}pingLoop(){let{serviceId:t,pingInterval:r}=this.wsConfig.getWS(),a=this.wsConfig.getWSInstance();if(a?.readyState===Ns.OPEN){let i={headers:[{key:ro.type,value:yi.ping}],service:Number(t),method:to.control,SeqID:0,LogID:0};this.sendMessage(i),this.armLiveness(),this.logger.trace("[ws]","ping success")}this.pingInterval=setTimeout(this.pingLoop.bind(this),r)}communicate(){let t=this.wsConfig.getWSInstance();t?.on("message",r=>h(this,void 0,void 0,function*(){this.clearLiveness();let a=mB(r),{method:i}=a;i===to.control&&(yield this.handleControlData(a)),i===to.data&&(yield this.handleEventData(a))})),t?.on("error",r=>{this.logger.error("[ws]","ws error")}),t?.on("close",()=>{this.logger.debug("[ws]","client closed"),this.clearLiveness(),this.reConnect()})}handleControlData(t){var r;return h(this,void 0,void 0,function*(){let a=(r=t.headers.find(s=>s.key===ro.type))===null||r===void 0?void 0:r.value,i=t.payload;if(a!==yi.ping&&a===yi.pong&&i){this.logger.trace("[ws]","receive pong");let s=new TextDecoder("utf-8").decode(i),{PingInterval:o,ReconnectCount:e,ReconnectInterval:y,ReconnectNonce:u}=JSON.parse(s);this.wsConfig.updateWs({pingInterval:o*1e3,reconnectCount:e,reconnectInterval:y*1e3,reconnectNonce:u*1e3}),this.logger.trace("[ws]","update wsConfig with pong data")}})}handleEventData(t){var r;return h(this,void 0,void 0,function*(){let a=t.headers.reduce((_,b)=>(_[b.key]=b.value,_),{}),{message_id:i,sum:s,seq:o,type:e,trace_id:y}=a,u=t.payload;if(e!==yi.event)return;let f=this.dataCache.mergeData({message_id:i,sum:Number(s),seq:Number(o),trace_id:y,data:u});if(!f)return;this.logger.debug("[ws]",`receive message, message_type: ${e}; message_id: ${i}; trace_id: ${y}; data: ${f.data}`);let d={code:Bh.ok},m=Date.now();try{let _=yield(r=this.eventDispatcher)===null||r===void 0?void 0:r.invoke(f,{needCheck:!1});_&&(d.data=Buffer.from(JSON.stringify(_)).toString("base64"))}catch(_){d.code=Bh.internal_server_error,this.logger.error("[ws]",`invoke event failed, message_type: ${e}; message_id: ${i}; trace_id: ${y}; error: ${_}`)}let g=Date.now();this.sendMessage(Object.assign(Object.assign({},t),{headers:[...t.headers,{key:ro.biz_rt,value:String(m-g)}],payload:new TextEncoder().encode(JSON.stringify(d))}))})}sendMessage(t){var r;let a=this.wsConfig.getWSInstance();if(a?.readyState===Ns.OPEN){let i=xT.Frame.encode(t).finish();(r=this.wsConfig.getWSInstance())===null||r===void 0||r.send(i,s=>{s&&this.logger.error("[ws]","send data failed")})}}getReconnectInfo(){return this.reconnectInfo}getConnectionStatus(){return{state:this.computeState(),lastConnectTime:this.reconnectInfo.lastConnectTime||void 0,nextConnectTime:this.reconnectInfo.nextConnectTime||void 0,reconnectAttempts:this.currentReconnectAttempts}}computeState(){var t;return this.terminalError?"failed":this.isConnecting&&!this.hasEverConnected?"connecting":this.isConnecting&&this.hasEverConnected?"reconnecting":((t=this.wsConfig.getWSInstance())===null||t===void 0?void 0:t.readyState)===Ns.OPEN?"connected":"idle"}close(t={}){let{force:r=!1}=t;this.reconnectGeneration++,this.pingInterval&&(clearTimeout(this.pingInterval),this.pingInterval=void 0),this.reconnectInterval&&(clearTimeout(this.reconnectInterval),this.reconnectInterval=void 0),this.clearLiveness(),this.dataCache.destroy(),this.isConnecting=!1,this.currentReconnectAttempts=0;let a=this.wsConfig.getWSInstance();a&&(a.removeAllListeners(),r?a.terminate():a.close(),this.wsConfig.setWSInstance(null)),this.logger.info("[ws]",`ws client closed manually${r?" (force)":""}`)}start(t){return h(this,void 0,void 0,function*(){let{appId:r}=this.wsConfig.getClient();if(!/^cli_[0-9a-fA-F]{16}$/.test(r)){this.logger.error("[ws]",`invalid appId: ${r}`);return}let{eventDispatcher:a}=t;if(!a){this.logger.warn("[ws]","client need to start with a eventDispatcher");return}this.terminalError=!1,this.currentReconnectAttempts=0,this.dataCache.clearAtInterval(),this.logger.info("[ws]",`receive events or callbacks through persistent connection only available in self-build & Feishu app, Configured in: + Developer Console(\u5F00\u53D1\u8005\u540E\u53F0) + -> + Events and Callbacks(\u4E8B\u4EF6\u4E0E\u56DE\u8C03) + -> + Mode of event/callback subscription(\u8BA2\u9605\u65B9\u5F0F) + -> + Receive events/callbacks through persistent connection(\u4F7F\u7528 \u957F\u8FDE\u63A5 \u63A5\u6536\u4E8B\u4EF6/\u56DE\u8C03)`),this.eventDispatcher=a,this.reConnect(!0)})}},Qf=class{constructor(){this.sessions=new Map}set(t,r){return h(this,void 0,void 0,function*(){let a=this.sessions.get(t.toString())||{},i=TT(a,r);return this.sessions.set(t.toString(),i),!0})}get(t){return h(this,void 0,void 0,function*(){return this.sessions.get(t.toString())})}},ht;(function(n){n[n.ERROR=-1]="ERROR",n[n.SUCCESS=0]="SUCCESS",n[n.EXPIRED=1]="EXPIRED",n[n.CANCELLED=2]="CANCELLED",n[n.FAILED=3]="FAILED",n[n.OTHER=4]="OTHER"})(ht||(ht={}));var Vf=class{constructor(t){this.completions={create:this.create.bind(this),createWithStream:this.createWithStream.bind(this),sessionRecords:{get:this.getRecords.bind(this),update:this.updateRecords.bind(this)}},this.client=t.client,this.logger=t.client.logger,this.cache=t.cache||new Qf}getSessionId(t){var r;return h(this,void 0,void 0,function*(){let{sessionId:a,payload:i,options:s}=t,o=yield this.getRecords();if(a&&a in o)return o[a];let e=yield this.client.aily.v1.ailySession.create({data:i},s);if(e.code===0&&e.data){let y=(r=e.data.session)===null||r===void 0?void 0:r.id;return a&&(yield this.updateRecords({[a]:y})),y}else{this.logger.error("get aily session id error",e.msg);return}})}waitReply(t,r){var a,i;return h(this,void 0,void 0,function*(){let{sessionId:s,ailyAppId:o,message:e,sessionInfo:y,messageInfo:u,runInfo:f,skillId:d}=t,m=yield this.getSessionId({sessionId:s,payload:y,options:r});if(!m)throw ht.ERROR;let g=yield this.client.aily.v1.ailySessionAilyMessage.create({path:{aily_session_id:m},data:Object.assign(Object.assign({},u),{content:e,idempotent_id:`${Date.now()}`,content_type:"MDX"})},r);if(!(g.code===0&&g.data))throw this.logger.error("create aily message error",g.msg),ht.ERROR;let _=(a=g.data.message)===null||a===void 0?void 0:a.id,b=yield this.client.aily.v1.ailySessionRun.create({path:{aily_session_id:m},data:Object.assign({app_id:o,skill_id:d},f)},r);if(!(b.code===0&&b.data))throw this.logger.error("create aily session run error",b.msg),ht.ERROR;let w=(i=b.data.run)===null||i===void 0?void 0:i.id;if(!w)throw this.logger.error("run id is empty"),ht.ERROR;let S=()=>h(this,void 0,void 0,function*(){return new Promise(E=>{setTimeout(()=>h(this,void 0,void 0,function*(){var F,$;let A=yield this.client.aily.v1.ailySessionRun.get({path:{aily_session_id:m,run_id:w}},r);if(!(A.code===0&&A.data)){E(3);return}switch(($=(F=A.data)===null||F===void 0?void 0:F.run)===null||$===void 0?void 0:$.status){case"QUEUED":case"IN_PROGRESS":yield h(this,void 0,void 0,function*(){let M=yield S();E(M)});case"COMPLETED":E(ht.SUCCESS);case"EXPIRED":E(ht.EXPIRED);case"CANCELLED":E(ht.CANCELLED);case"FAILED":E(ht.FAILED);default:E(ht.OTHER)}}),500)})}),O=yield S();if(O!==ht.SUCCESS)throw this.logger.error("aily run error"),O;return{ailySessionId:m,runId:w,messageId:_}})}create(t,r){var a,i,s,o,e;return h(this,void 0,void 0,function*(){let{ailySessionId:y,runId:u}=yield this.waitReply(t,r),f;try{for(var d=!0,m=Xk(yield this.client.aily.v1.ailySessionAilyMessage.listWithIterator({path:{aily_session_id:y},params:{run_id:u,with_partial_message:!1}},r)),g;g=yield m.next(),a=g.done,!a;){o=g.value,d=!1;try{let _=o;if(!_)continue;(e=_?.messages)===null||e===void 0||e.forEach(b=>{var w;((w=b.sender)===null||w===void 0?void 0:w.sender_type)==="ASSISTANT"&&(f=b)})}finally{d=!0}}}catch(_){i={error:_}}finally{try{!d&&!a&&(s=m.return)&&(yield s.call(m))}finally{if(i)throw i.error}}if(!f)throw this.logger.error("no aily reply"),ht.ERROR;return f})}createWithStream(t,r){return h(this,void 0,void 0,function*(){let{ailySessionId:a,runId:i,messageId:s}=yield this.waitReply(t,r),o=()=>this.client.aily.v1.ailySessionAilyMessage.listWithIterator({path:{aily_session_id:a},params:{run_id:i,with_partial_message:!0}},r),e=!1;return{[Symbol.asyncIterator](){return x(this,arguments,function*(){var f,d,m,g;try{for(var _=!0,b=Xk(yield v(o())),w;w=yield v(b.next()),f=w.done,!f;){g=w.value,_=!1;try{let S=g;if(!S)continue;for(let O of S.messages||[])if(e){if(yield yield v(O),O.status==="COMPLETED")return yield v(void 0)}else O.id===s&&O.status==="COMPLETED"&&(e=!0)}finally{_=!0}}}catch(S){d={error:S}}finally{try{!_&&!f&&(m=b.return)&&(yield v(m.call(b)))}finally{if(d)throw d.error}}})}}})}getRecords(){return h(this,void 0,void 0,function*(){return(yield this.cache.get(Zk))||{}})}updateRecords(t){return h(this,void 0,void 0,function*(){yield this.cache.set(Zk,t)})}};function Vs(n,t){if(typeof n!="object"||n===null||Array.isArray(n))throw new Error(`${t} must be an object`)}function Ks(n,t,r){for(let a of Object.keys(n))if(!t.includes(a))throw new Error(`${r}.${a} is not allowed; allowed keys: ${t.join(", ")}`)}function fB(n,t){if(n!==void 0){if(!Array.isArray(n))throw new Error(`${t} must be an array of strings`);return n.forEach((r,a)=>{if(typeof r!="string"||r==="")throw new Error(`${t}[${a}] must be a non-empty string`)}),n}}function yB(n){Vs(n,"addons"),Ks(n,["preset","scopes","events","callbacks"],"addons");let t=0,r=(i,s)=>{var o;let e=fB(i,s);return t+=(o=e?.length)!==null&&o!==void 0?o:0,e},a={};if(n.preset!==void 0){if(typeof n.preset!="boolean")throw new Error("addons.preset must be a boolean");a.preset=n.preset}if(n.scopes!==void 0&&(Vs(n.scopes,"addons.scopes"),Ks(n.scopes,["tenant","user"],"addons.scopes"),a.scopes={tenant:r(n.scopes.tenant,"addons.scopes.tenant"),user:r(n.scopes.user,"addons.scopes.user")}),n.events!==void 0&&(Vs(n.events,"addons.events"),Ks(n.events,["items"],"addons.events"),n.events.items!==void 0&&(Vs(n.events.items,"addons.events.items"),Ks(n.events.items,["tenant","user"],"addons.events.items"),a.events={items:{tenant:r(n.events.items.tenant,"addons.events.items.tenant"),user:r(n.events.items.user,"addons.events.items.user")}})),n.callbacks!==void 0&&(Vs(n.callbacks,"addons.callbacks"),Ks(n.callbacks,["items"],"addons.callbacks"),a.callbacks={items:r(n.callbacks.items,"addons.callbacks.items")}),t===0&&n.preset!==!1)throw new Error("addons must contain at least one scope, event or callback");return a}function gB(n){let t=JSON.stringify(yB(n));return MG(Buffer.from(t,"utf8")).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Js(n,t){return{code:n,description:t}}var tT="node-sdk",vB="accounts.feishu.cn",_B="accounts.larksuite.com",bB="/oauth/v1/app/registration",rT=6;function wB(n,t){let{avatar:r,name:a,desc:i}=t;if(r!==void 0){let s=Array.isArray(r)?r:[r];if(s.length===0)throw new Error("appPreset.avatar must contain at least 1 URL");if(s.length>rT)throw new Error(`appPreset.avatar supports at most ${rT} URLs, got ${s.length}`);s.forEach((o,e)=>{if(typeof o!="string"||o==="")throw new Error(`appPreset.avatar[${e}] must be a non-empty string`);n.searchParams.append("avatar",o)})}a!==void 0&&n.searchParams.set("name",a),i!==void 0&&n.searchParams.set("desc",i)}function PT(n,t){var r;return h(this,void 0,void 0,function*(){try{return yield vi.post(`${n}${bB}`,new URLSearchParams(t).toString(),{headers:{"Content-Type":"application/x-www-form-urlencoded"}})}catch(a){if(a instanceof Yl&&(!((r=a.response)===null||r===void 0)&&r.data))return a.response.data;throw a}})}function SB(n){return PT(n,{action:"begin",archetype:"PersonalAgent",auth_method:"client_secret",request_user_info:"open_id"})}function IB(n){return new Promise((t,r)=>{var a,i;let{baseUrl:s,interval:o}=n,e=!1,y=null,u=null,f=()=>{var g;y!==null&&(clearTimeout(y),y=null),u!==null&&(clearTimeout(u),u=null),(g=n.signal)===null||g===void 0||g.removeEventListener("abort",d)},d=()=>{f(),r(Js("abort","Registration was aborted"))};if(!((a=n.signal)===null||a===void 0)&&a.aborted)return r(Js("abort","Registration was aborted"));(i=n.signal)===null||i===void 0||i.addEventListener("abort",d,{once:!0}),u=setTimeout(()=>{f(),r(Js("expired_token","Polling timed out"))},n.expireIn);let m=()=>h(this,void 0,void 0,function*(){var g,_,b,w,S,O;try{let E=yield PT(s,{action:"poll",device_code:n.deviceCode});if(((g=E.user_info)===null||g===void 0?void 0:g.tenant_brand)==="lark"&&!e){s=n.larkBaseUrl,e=!0,(_=n.onStatusChange)===null||_===void 0||_.call(n,{status:"domain_switched"}),m();return}if(E.client_id&&E.client_secret){f(),t({client_id:E.client_id,client_secret:E.client_secret,user_info:E.user_info});return}switch(E.error){case"authorization_pending":(b=n.onStatusChange)===null||b===void 0||b.call(n,{status:"polling"});break;case"slow_down":o+=5e3,(w=n.onStatusChange)===null||w===void 0||w.call(n,{status:"slow_down",interval:o/1e3});break;case"access_denied":case"expired_token":f(),r(Js(E.error,(S=E.error_description)!==null&&S!==void 0?S:"Unknown error"));return;default:if(E.error){f(),r(Js(E.error,(O=E.error_description)!==null&&O!==void 0?O:"Unknown error"));return}break}y=setTimeout(m,o)}catch(E){f(),r(E)}});m()})}function kB(n){var t,r,a,i;return h(this,void 0,void 0,function*(){let{domain:s,source:o,signal:e,onQRCodeReady:y,onStatusChange:u,appPreset:f,addons:d,createOnly:m,appId:g}=n;if(g!==void 0&&(typeof g!="string"||g===""))throw new Error("appId must be a non-empty string");let _=`https://${s??vB}`,b=yield SB(_),w=new URL(b.verification_uri_complete);return w.searchParams.set("from","sdk"),w.searchParams.set("source",o?`${tT}/${o}`:tT),w.searchParams.set("tp","sdk"),f&&wB(w,f),d&&w.searchParams.set("addons",gB(d)),m===!0&&w.searchParams.set("createOnly","true"),g&&w.searchParams.set("clientID",g),y({url:w.toString(),expireIn:(t=b.expires_in)!==null&&t!==void 0?t:600}),IB({baseUrl:_,deviceCode:b.device_code,interval:((r=b.interval)!==null&&r!==void 0?r:5)*1e3,expireIn:((a=b.expires_in)!==null&&a!==void 0?a:600)*1e3,larkBaseUrl:`https://${(i=n.larkDomain)!==null&&i!==void 0?i:_B}`,signal:e,onStatusChange:u})})}var me=class extends Error{constructor(t,r,a){super(r),this.name="LarkChannelError",this.code=t,this.cause=a?.cause,this.context=a?.context}},Lh=class{constructor(t,r){this.opts=t,this.fire=r,this.pendingChars=0,this.lastFireAt=0}note(t){if(this.pendingChars+=t,this.pendingChars>=this.opts.chars){this.fireSoon(0);return}if(!this.timer){let r=Date.now()-this.lastFireAt,a=Math.max(0,this.opts.ms-r);this.fireSoon(a)}}fireSoon(t){this.timer&&clearTimeout(this.timer),this.timer=setTimeout(()=>{this.timer=void 0,this.doFire()},t)}flushNow(){return h(this,void 0,void 0,function*(){this.timer&&(clearTimeout(this.timer),this.timer=void 0),this.inFlight&&(yield this.inFlight),yield this.doFire()})}doFire(){return h(this,void 0,void 0,function*(){if(this.inFlight){this.fireSoon(this.opts.ms);return}let t=h(this,void 0,void 0,function*(){this.pendingChars=0,this.lastFireAt=Date.now(),yield this.fire()});this.inFlight=t;try{yield t}finally{this.inFlight=void 0}})}dispose(){this.timer&&(clearTimeout(this.timer),this.timer=void 0)}},Nh=class{constructor(){this.tail=Promise.resolve()}enqueue(t){let r=this.tail.then(t,t);return this.tail=r.then(()=>{},()=>{}),r}drain(){return this.tail}};function TB(n,t){if(!n)return t;if(!t)return n;if(t.startsWith(n))return t;if(n.startsWith(t))return n;let r=Math.min(n.length,t.length);for(let a=r;a>0;a--)if(n.endsWith(t.substring(0,a)))return n+t.substring(a);return n+t}function qT(n,t){if(n.length<=t)return[n];let r=n.split(` +`),a=[],i=[],s=0,o=null,e=()=>{if(i.length===0)return;let y=i.join(` +`);o!==null&&(y+="\n```"),a.push(y),i=[],s=0,o!==null&&(i.push("```"+o),s=i[0].length)};for(let y of r){let u=y.match(/^```(\w*)$/),f=y.length+(i.length>0?1:0),d=/^#{1,6}\s/.test(y),m=s>t*.75;(s+f>t||d&&m&&i.length>0)&&e(),i.push(y),s+=f,u&&(o=o===null?u[1]||"":null)}return e(),a}var xB=100,PB=50,qB="Thinking...",aT="(no content)",EB="[Generating...]",FB=50,OB=` + +\u2014 _(Generation interrupted)_`,$B=3e4,Fh="stream_md";function Ou(n,t=FB){if(!n)return"";let r=n.replace(/\s+/g," ").trim();return r.length<=t?r:r.slice(0,t-1)+"\u2026"}function iT(n){return{schema:"2.0",config:{streaming_mode:!0,summary:{content:EB},streaming_config:{print_frequency_ms:{default:70},print_step:{default:1},print_strategy:"fast"}},body:{elements:[{tag:"markdown",element_id:Fh,content:n}]}}}var Kf=class{constructor(t,r,a,i){var s,o,e;this.sender=t,this.to=r,this.idType=a,this.opts=i,this.content="",this.fullAccumulated="",this._messageId="",this.cardId="",this.sequence=0,this.queue=new Nh,this.started=!1,this.streamingFailed=!1,this.rolloverMessageIds=[];let y=this.sender.config;this.throttle=new Lh({ms:(s=y.streamThrottleMs)!==null&&s!==void 0?s:xB,chars:(o=y.streamThrottleChars)!==null&&o!==void 0?o:PB},()=>this.pushContent()),this.maxChars=(e=y.streamMaxElementChars)!==null&&e!==void 0?e:$B}get messageId(){return this._messageId}append(t){return h(this,void 0,void 0,function*(){if(!t)return;yield this.ensureStarted();let r=TB(this.fullAccumulated,t),a=r.slice(this.fullAccumulated.length);this.fullAccumulated=r,this.content+=a,this.throttle.note(t.length)})}setContent(t){return h(this,void 0,void 0,function*(){yield this.ensureStarted(),this.fullAccumulated=t??"",this.content=t??"",this.throttle.note(Number.MAX_SAFE_INTEGER)})}run(t){return h(this,void 0,void 0,function*(){yield this.ensureStarted();try{yield t(this)}catch(r){throw yield this.failTerminal(r),r}return yield this.completeTerminal(),{messageId:this._messageId}})}ensureStarted(){var t;return h(this,void 0,void 0,function*(){if(this.started)return;this.started=!0;let r=(t=this.sender.config.streamInitialText)!==null&&t!==void 0?t:qB,a=iT(r||"...");this.cardId=yield this.sender.createCardInstance(a),this._messageId=yield this.sender.sendCardByReference(this.to,this.idType,this.cardId,this.opts)})}pushContent(){return h(this,void 0,void 0,function*(){!this.cardId||this.streamingFailed||(yield this.queue.enqueue(()=>h(this,void 0,void 0,function*(){var t,r;if(!this.streamingFailed)try{yield this.pushSnapshot()}catch(a){this.streamingFailed=!0,(r=(t=this.sender.logger).warn)===null||r===void 0||r.call(t,"[stream] update failed",a)}})))})}pushSnapshot(){return h(this,void 0,void 0,function*(){for(;this.content.length>this.maxChars;)yield this.rollover();let t=this.content||"...";yield this.sender.updateCardElementContent(this.cardId,Fh,t,++this.sequence)})}rollover(){return h(this,void 0,void 0,function*(){let t=qT(this.content,this.maxChars);if(t.length<2)throw new Error("rollover: content not splittable below limit");let r=t[0],a=t.slice(1).join(` +`);yield this.sender.updateCardElementContent(this.cardId,Fh,r,++this.sequence);try{yield this.sender.finishStreamingCard(this.cardId,++this.sequence,Ou(r))}catch{}let i=iT(a||"..."),s=yield this.sender.createCardInstance(i),o=yield this.sender.sendCardByReference(this.to,this.idType,s,this.opts);this.cardId=s,this.content=a,this.sequence=0,this.rolloverMessageIds.push(o)})}completeTerminal(){var t,r;return h(this,void 0,void 0,function*(){if(yield this.throttle.flushNow(),yield this.queue.drain(),!!this.cardId){!this.content&&!this.streamingFailed&&(yield this.queue.enqueue(()=>h(this,void 0,void 0,function*(){try{yield this.sender.updateCardElementContent(this.cardId,Fh,aT,++this.sequence)}catch{}})),yield this.queue.drain());try{yield this.sender.finishStreamingCard(this.cardId,++this.sequence,Ou(this.content||aT))}catch(a){(r=(t=this.sender.logger).warn)===null||r===void 0||r.call(t,"[stream] finishStreamingCard failed",a)}}})}failTerminal(t){return h(this,void 0,void 0,function*(){if(this.throttle.dispose(),!!this.cardId){this.content=(this.content||"")+OB,yield this.queue.enqueue(()=>h(this,void 0,void 0,function*(){try{yield this.pushSnapshot()}catch{}})),yield this.queue.drain();try{yield this.sender.finishStreamingCard(this.cardId,++this.sequence,Ou(this.content))}catch{}}})}},Jf=class{constructor(t,r,a,i){this.impl=new Kf(t,r,a,i)}run(t){return this.impl.run(t)}},zB=100,RB=50,Xf=class{constructor(t,r,a,i,s){var o,e;this.sender=t,this.to=r,this.idType=a,this.opts=i,this._messageId="",this.queue=new Nh,this._current=s;let y=t.config;this.throttle=new Lh({ms:(o=y.streamThrottleMs)!==null&&o!==void 0?o:zB,chars:(e=y.streamThrottleChars)!==null&&e!==void 0?e:RB},()=>this.patch())}get messageId(){return this._messageId}get current(){return this._current}update(t){return h(this,void 0,void 0,function*(){let r=typeof t=="function"?t(this._current):t;this._current=r,this.throttle.note(JSON.stringify(r).length)})}run(t){return h(this,void 0,void 0,function*(){yield this.sendInitial();try{yield t(this)}catch(r){throw yield this.failTerminal(r),r}return yield this.completeTerminal(),{messageId:this._messageId}})}sendInitial(){return h(this,void 0,void 0,function*(){let t=yield this.sender.sendOneWithFallback({to:this.to,idType:this.idType,msgType:"interactive",content:this._current,replyTo:this.opts.replyTo,replyInThread:this.opts.replyInThread});this._messageId=t})}patch(){return h(this,void 0,void 0,function*(){if(!this._messageId)return;let t=this._current;yield this.queue.enqueue(()=>h(this,void 0,void 0,function*(){yield this.sender.patchCard(this._messageId,t)}))})}completeTerminal(){return h(this,void 0,void 0,function*(){yield this.throttle.flushNow(),yield this.queue.drain()})}failTerminal(t){return h(this,void 0,void 0,function*(){this.throttle.dispose();let r=AB(this._current);yield this.queue.enqueue(()=>h(this,void 0,void 0,function*(){try{yield this.sender.patchCard(this._messageId,r)}catch{}})),yield this.queue.drain()})}};function AB(n){let t=n,r=Array.isArray(t?.elements)?[...t.elements]:[];return r.push({tag:"note",elements:[{tag:"plain_text",content:"\u26A0\uFE0F \u751F\u6210\u4E2D\u65AD"}]}),Object.assign(Object.assign({},n),{elements:r})}var Yf=class{constructor(t,r,a,i,s){this.impl=new Xf(t,r,a,i,s)}run(t){return this.impl.run(t)}};function CB(n){if(!(!n||n.length<27)){for(let t=n.length-27;t>=0;t--)if(n[t]===79&&n[t+1]===103&&n[t+2]===103&&n[t+3]===83){let r=n.readBigInt64LE(t+6);if(rn.length)return;let i=n.readUInt8(a),s=a+4,o,e;if(i===1){if(s+28>n.length)return;o=n.readUInt32BE(s+16),e=Number(n.readBigUInt64BE(s+20))}else{if(s+16>n.length)return;o=n.readUInt32BE(s+8),e=n.readUInt32BE(s+12)}if(!(!o||!Number.isFinite(o)||!Number.isFinite(e)))return Math.round(e/o*1e3)}function sT(n,t,r,a){let i=t;for(;i+8<=r&&i+8<=n.length;){let s=n.readUInt32BE(i),o=n.slice(i+4,i+8).toString("ascii"),e=s===1?i+Number(n.readBigUInt64BE(i+8)):s===0?r:i+s;if(e<=i||e>r)return;if(o===a)return{start:s===1?i+16:i+8,end:e};i=e}}var DB=[[0,8],[167772160,8],[2130706432,8],[2851995648,16],[2886729728,12],[3232235520,16],[1681915904,10],[3221225472,24],[3221225984,24],[3323068416,15],[3325256704,24],[3405803776,24],[3758096384,4],[4026531840,4]];function GB(n,t={}){var r,a;return h(this,void 0,void 0,function*(){let i=new URL(n);if(i.protocol!=="http:"&&i.protocol!=="https:")throw new Error(`ssrf_blocked: protocol ${i.protocol}`);let s=i.hostname,o=s.startsWith("[")&&s.endsWith("]")?s.slice(1,-1):s,e=(a=(r=t.allowlist)===null||r===void 0?void 0:r.includes(o))!==null&&a!==void 0?a:!1,y;if(gT(o))y=o,e||oT(y);else{let u=yield UG.lookup(o,{all:!0});if(u.length===0)throw new Error(`ssrf_blocked: no DNS records for ${o}`);if(!e)for(let f of u)oT(f.address);y=u[0].address}return{resolvedIp:y,originalHost:o}})}function oT(n){let t=gT(n);if(t===4&&ET(n))throw new Error(`ssrf_blocked: ${n}`);if(t===6&&HB(n))throw new Error(`ssrf_blocked: ${n}`);if(t===0)throw new Error(`ssrf_blocked: not a valid IP: ${n}`)}function ET(n){let t=n.split(".").map(Number);if(t.length!==4||t.some(a=>a<0||a>255))return!0;let r=(t[0]<<24|t[1]<<16|t[2]<<8|t[3])>>>0;return DB.some(([a,i])=>{let s=i===0?0:-1<<32-i>>>0;return(r&s)===(a&s)})}var BB=[[BigInt("0xfe800000000000000000000000000000"),10],[BigInt("0xfc000000000000000000000000000000"),7],[BigInt("0xff000000000000000000000000000000"),8],[BigInt("0x01000000000000000000000000000000"),64],[BigInt("0x20010db8000000000000000000000000"),32],[BigInt("0x20010000000000000000000000000000"),32]],MB=BigInt("0xffffffffffffffffffffffff00000000"),LB=BigInt("0x00000000000000000000ffff00000000"),NB=BigInt(0),UB=BigInt("0x0064ff9b000000000000000000000000"),WB=BigInt("0xffffffff");function HB(n){let t;try{t=QB(n)}catch{return!0}let r=t&MB;if(r===LB||r===UB||r===NB){let a=Number(t&WB),i=[a>>>24&255,a>>>16&255,a>>>8&255,a&255].join(".");return ET(i)}return BB.some(([a,i])=>{let s=BigInt(128-i),e=(BigInt(1)<>s<!Number.isFinite(u)||u<0||u>255))throw new Error("bad v4 suffix");let e=(o[0]<<8|o[1]).toString(16),y=(o[2]<<8|o[3]).toString(16);t=t.slice(0,t.length-r[1].length)+`${e}:${y}`}let a=t.split("::");if(a.length>2)throw new Error('multiple "::"');let i;if(a.length===2){let o=a[0]?a[0].split(":"):[],e=a[1]?a[1].split(":"):[],y=8-o.length-e.length;if(y<0)throw new Error("too many groups");i=[...o,...Array(y).fill("0"),...e]}else i=t.split(":");if(i.length!==8)throw new Error("wrong group count");let s=BigInt(0);for(let o of i){if(!/^[0-9a-f]{0,4}$/.test(o))throw new Error("bad group");s=s<0&&!(yield Promise.all(e.map(m=>h(this,void 0,void 0,function*(){let g=Zs.resolve(m);try{return yield te.promises.realpath(g)}catch{return g}})))).some(m=>u===m||u.startsWith(m+Zs.sep)))throw new me("upload_failed",`file path is outside allowed directories: ${u}`);return yield te.promises.readFile(u)}catch(u){throw u instanceof me?u:new me("upload_failed",`source is neither an http(s) URL nor a readable local file: ${t}`,{cause:u})}}let i=(a=this.config)===null||a===void 0?void 0:a.ssrfGuard,s=i!==!1,o;if(s){let e=typeof i=="object"&&i?{allowlist:i.allowlist}:{};try{({resolvedIp:o}=yield GB(t,e))}catch(y){throw new me("ssrf_blocked",`URL blocked: ${String(y)}`,{cause:y})}}try{let e={url:t,method:"GET",responseType:"arraybuffer",timeout:15e3,maxContentLength:nT,maxBodyLength:nT};if(o){let u=KB(t,o);e.httpAgent=u,e.httpsAgent=u}let y=yield this.client.httpInstance.request(e);return Buffer.from(y)}catch(e){throw new me("upload_failed","fetch source URL failed",{cause:e})}})}assertNotOnPosixBlocklist(t){if(process.platform!=="win32"&&VB.some(r=>t===r.slice(0,-1)||t.startsWith(r)))throw new me("upload_failed",`file path is not allowed: ${t}`)}resolveDuration(t,r){if(t.duration!=null&&t.duration>0)return t.duration;let a=t.kind==="audio"?CB(r):t.kind==="video"?jB(r):void 0;if(a!=null)return a;throw new me("upload_failed",`duration could not be determined for ${t.kind}; pass it explicitly`)}uploadImage(t){var r,a;return h(this,void 0,void 0,function*(){try{let i=yield this.client.im.v1.image.create({data:{image_type:"message",image:t}}),s=(r=i?.image_key)!==null&&r!==void 0?r:(a=i?.data)===null||a===void 0?void 0:a.image_key;if(!s)throw new Error("image_key missing in upload response");return{kind:"image",fileKey:s}}catch(i){throw new me("upload_failed","image upload failed",{cause:i})}})}uploadFile(t,r,a,i){var s,o;return h(this,void 0,void 0,function*(){try{let e={file_type:r,file_name:a,file:t};i!=null&&(e.duration=i);let y=yield this.client.im.v1.file.create({data:e}),u=(s=y?.file_key)!==null&&s!==void 0?s:(o=y?.data)===null||o===void 0?void 0:o.file_key;if(!u)throw new Error("file_key missing in upload response");return{kind:r==="opus"?"audio":r==="mp4"?"video":"file",fileKey:u,durationMs:i}}catch(e){throw e instanceof me?e:new me("upload_failed","file upload failed",{cause:e})}})}};function KB(n,t){let r=n.startsWith("https:")?NG.Agent:LG.Agent,a=new r,i=t.includes(":")?6:4,s=(e,y,u)=>{u(null,t,i)},o=a.createConnection.bind(a);return a.createConnection=(e,y)=>o(Object.assign(Object.assign({},e),{lookup:s}),y),a}function FT(n){var t;if(!n?.length)return"";let r=[];for(let a of n){if(!a.openId)continue;let i=(t=a.name)!==null&&t!==void 0?t:"";r.push(`${i}`)}return r.length>0?r.join(" ")+" ":""}function JB(n,t=1){try{return XB(n,t)}catch{return n}}function XB(n,t){let r="___CB_",a=[],i=n.replace(/(^|\n)(`{3,})([^\n]*)\n[\s\S]*?\n\2(?=\n|$)/g,(o,e="")=>{let y=o.slice(String(e).length);return`${e}${r}${a.push(y)-1}___`});return/^#{1,3} /m.test(n)&&(i=i.replace(/^#{2,6} (.+)$/gm,"##### $1"),i=i.replace(/^# (.+)$/gm,"#### $1")),t>=2?(i=i.replace(/^(#{4,5} .+)\n{1,2}(#{4,5} )/gm,`$1 +
+$2`),i=i.replace(/^([^|\n].*)\n(\|.+\|)/gm,`$1 + +$2`),i=i.replace(/\n\n((?:\|.+\|[^\S\n]*\n?)+)/g,` + +
+ +$1`),i=i.replace(/((?:^\|.+\|[^\S\n]*\n?)+)/gm,(o,e,y)=>{let u=i.slice(y+o.length).replace(/^\n+/,"");return!u||/^(---|#{4,5} |\*\*)/.test(u)?o:o+` +
+`}),i=i.replace(/^((?!#{4,5} )(?!\*\*).+)\n\n(
)\n\n(\|)/gm,`$1 +$2 +$3`),i=i.replace(/^(\*\*.+)\n\n(
)\n\n(\|)/gm,`$1 +$2 + +$3`),i=i.replace(/(\|[^\n]*\n)\n(
\n)((?!#{4,5} )(?!\*\*))/gm,"$1$2$3"),a.forEach((o,e)=>{i=i.replace(`${r}${e}___`,` +
+${o} +
+`)})):a.forEach((o,e)=>{i=i.replace(`${r}${e}___`,o)}),i=i.replace(/\n{3,}/g,` + +`),i}function YB(n,t){var r,a;let i=FT((r=t?.mentions)!==null&&r!==void 0?r:[]),s=JB(i+n,1);return{zh_cn:{title:(a=t?.title)!==null&&a!==void 0?a:"",content:[[{tag:"md",text:s}]]}}}function ZB(n){var t;let r=n?.zh_cn;if(!r?.content)return"";let a=[];for(let i of r.content){if(!Array.isArray(i))continue;let s=[];for(let o of i)switch(o.tag){case"md":case"text":case"a":s.push((t=o.text)!==null&&t!==void 0?t:"");break;case"at":s.push(o.user_name?`@${o.user_name}`:"");break;case"img":s.push(o.image_key?"[image]":"");break}a.push(s.join(""))}return a.join(` +`).trim()}function hT(n){if(!n)throw new Error("empty receive_id");return n.startsWith("oc_")?"chat_id":n.startsWith("ou_")?"open_id":n.startsWith("on_")?"union_id":n.includes("@")?"email":"user_id"}function yy(n,t){if(n instanceof me)return n;let r=eM(n),a=tM(n);return new me(r,a,{cause:n,context:t})}function eM(n){var t,r,a,i,s,o,e,y;let u=n,f=(r=(t=u?.response)===null||t===void 0?void 0:t.status)!==null&&r!==void 0?r:u?.status,d=(e=(s=(i=(a=u?.response)===null||a===void 0?void 0:a.data)===null||i===void 0?void 0:i.code)!==null&&s!==void 0?s:(o=u?.data)===null||o===void 0?void 0:o.code)!==null&&e!==void 0?e:u?.code,m=String((y=u?.message)!==null&&y!==void 0?y:"").toLowerCase();if(typeof d=="number"){if(d===230020||d===230017)return"target_revoked";if(d===99991400||d===99991401)return"permission_denied";if(d===230002||d===230001)return"format_error"}return f===429?"rate_limited":f===401||f===403?"permission_denied":f===400?"format_error":f===404?"target_revoked":m.startsWith("ssrf_blocked")?"ssrf_blocked":m.includes("timeout")||u?.code==="ETIMEDOUT"||u?.code==="ECONNABORTED"?"send_timeout":"unknown"}function tM(n){var t,r,a,i;let s=n;return((r=(t=s?.response)===null||t===void 0?void 0:t.data)===null||r===void 0?void 0:r.msg)||((i=(a=s?.response)===null||a===void 0?void 0:a.data)===null||i===void 0?void 0:i.message)||s?.message||String(n)}function rM(n){return n.code==="rate_limited"||n.code==="unknown"}function aM(n){return n.code==="format_error"}function iM(n){return n.code==="target_revoked"}function sM(n,t={}){var r,a;return h(this,void 0,void 0,function*(){let i=(r=t.maxAttempts)!==null&&r!==void 0?r:3,s=(a=t.baseDelayMs)!==null&&a!==void 0?a:500,o;for(let e=1;e<=i;e++)try{return yield n(e)}catch(y){let u=yy(y,{attempt:e});if(o=u,e>=i||!rM(u))throw u;let f=s*Math.pow(3,e-1);yield oM(f)}throw o})}function oM(n){return new Promise(t=>setTimeout(t,n))}var nM=3500,ey=class{constructor(t,r,a){var i;this.client=t,this.config=r,this.logger=a,this.uploader=new Zf(t,r),this.chunkLimit=(i=r.textChunkLimit)!==null&&i!==void 0?i:nM}send(t,r,a={}){return h(this,void 0,void 0,function*(){let i=hT(t);if("markdown"in r)return this.sendMarkdown(t,i,r.markdown,a);if("text"in r)return this.sendText(t,i,r.text,a);if("post"in r)return this.sendPost(t,i,r.post,a);if("image"in r)return this.sendImage(t,i,r.image,a);if("file"in r)return this.sendFile(t,i,r.file,a);if("audio"in r)return this.sendAudio(t,i,r.audio,a);if("video"in r)return this.sendVideo(t,i,r.video,a);if("card"in r)return this.sendCard(t,i,r.card,a);if("shareChat"in r)return this.sendShareChat(t,i,r.shareChat.chatId,a);if("shareUser"in r)return this.sendShareUser(t,i,r.shareUser.userId,a);if("sticker"in r)return this.sendSticker(t,i,r.sticker.fileKey,a);throw new me("format_error","unrecognized SendInput shape")})}stream(t,r,a={}){return h(this,void 0,void 0,function*(){let i=hT(t);if("markdown"in r)return new Jf(this,t,i,a).run(r.markdown);if("card"in r)return new Yf(this,t,i,a,r.card.initial).run(r.card.producer);throw new me("format_error","unrecognized StreamInput shape")})}sendMarkdown(t,r,a,i){return h(this,void 0,void 0,function*(){let s=qT(a,this.chunkLimit),o=[];for(let e=0;ethis.rawSend(t),this.config.retry)})}rawSend(t){var r,a;return h(this,void 0,void 0,function*(){let i={receive_id:t.to,msg_type:t.msgType,content:JSON.stringify(t.content)};if(t.replyTo){let y=(r=(yield this.client.im.v1.message.reply({path:{message_id:t.replyTo},data:{content:i.content,msg_type:t.msgType,reply_in_thread:t.replyInThread}})).data)===null||r===void 0?void 0:r.message_id;if(!y)throw new me("unknown","message_id missing from reply response");return y}let o=(a=(yield this.client.im.v1.message.create({params:{receive_id_type:t.idType},data:i})).data)===null||a===void 0?void 0:a.message_id;if(!o)throw new me("unknown","message_id missing from create response");return o})}patchCard(t,r){return h(this,void 0,void 0,function*(){yield this.client.im.v1.message.patch({path:{message_id:t},data:{content:JSON.stringify(r)}})})}createCardInstance(t){var r;return h(this,void 0,void 0,function*(){let i=(r=(yield this.client.cardkit.v1.card.create({data:{type:"card_json",data:JSON.stringify(t)}})).data)===null||r===void 0?void 0:r.card_id;if(!i)throw new me("unknown","cardkit.card.create returned no card_id");return i})}sendCardByReference(t,r,a,i){return h(this,void 0,void 0,function*(){return this.rawSendWithRetry({to:t,idType:r,msgType:"interactive",content:{type:"card",data:{card_id:a}},replyTo:i.replyTo,replyInThread:i.replyInThread})})}updateCardElementContent(t,r,a,i){return h(this,void 0,void 0,function*(){yield this.client.cardkit.v1.cardElement.content({path:{card_id:t,element_id:r},data:{content:a,sequence:i,uuid:`c_${t}_${i}`}})})}finishStreamingCard(t,r,a){return h(this,void 0,void 0,function*(){let i={streaming_mode:!1};a!==void 0&&(i.summary={content:a}),yield this.client.cardkit.v1.card.settings({path:{card_id:t},data:{settings:JSON.stringify({config:i}),sequence:r,uuid:`s_${t}_${r}`}})})}makeResult(t){return{messageId:t[0],chunkIds:t.length>1?t:void 0}}};function hM(n,t){if(n.length<=t)return[n];let r=[];for(let a=0;a=this.config.maxMessages||this.bufferChars>=this.config.maxChars){this.clearTimer(),this.enqueueFlush();return}if(this.config.delayMs<=0||this.serialOnly){this.clearTimer(),this.enqueueFlush();return}this.clearTimer();let i=this.bufferChars>=this.config.longThresholdChars?this.config.longDelayMs:this.config.delayMs;this.timer=setTimeout(()=>{this.timer=void 0,this.enqueueFlush()},i)}run(t){this.buffer.length>0&&(this.clearTimer(),this.enqueueFlush());let r=this.tail.then(t,t);return this.tail=r.then(()=>{},()=>{}),r}flushNow(){return h(this,void 0,void 0,function*(){this.buffer.length>0&&(this.clearTimer(),this.enqueueFlush()),yield this.tail})}isIdle(){return this.buffer.length===0&&!this.timer}dispose(){this.clearTimer(),this.buffer=[],this.pendingHandler=void 0}clearTimer(){this.timer&&(clearTimeout(this.timer),this.timer=void 0)}enqueueFlush(){if(this.buffer.length===0)return;let t=this.buffer,r=this.pendingHandler;if(this.buffer=[],this.bufferChars=0,this.pendingHandler=void 0,!r)return;let a={message:dM(t),sourceIds:t.map(o=>o.messageId)},i=()=>r(a),s=this.tail.then(i,i);this.tail=s.then(()=>{},()=>{})}},ry=class{constructor(t){this.config=t,this.pipelines=new Map}push(t,r,a){this.getOrCreate(t,!1).push(r,a)}run(t,r){return this.getOrCreate(t,!0).run(r)}getOrCreate(t,r){let a=this.pipelines.get(t);return a||(a=new ty(this.config,r),this.pipelines.set(t,a)),a}flushAll(){return h(this,void 0,void 0,function*(){yield Promise.all([...this.pipelines.values()].map(t=>t.flushNow()))})}dispose(){return h(this,void 0,void 0,function*(){yield this.flushAll();for(let t of this.pipelines.values())t.dispose();this.pipelines.clear()})}};function dM(n){if(n.length===1)return n[0];let t=n[n.length-1],r=n.map(s=>s.content).filter(s=>s&&s.length>0).join(` + +`),a=dT(n.flatMap(s=>s.resources),s=>s.fileKey),i=dT(n.flatMap(s=>s.mentions),s=>{var o;return(o=s.openId)!==null&&o!==void 0?o:s.key});return Object.assign(Object.assign({},t),{content:r,resources:a,mentions:i,mentionAll:n.some(s=>s.mentionAll),mentionedBot:n.some(s=>s.mentionedBot)})}function dT(n,t){let r=new Set,a=[];for(let i of n){let s=t(i);if(s==null){a.push(i);continue}r.has(s)||(r.add(s),a.push(i))}return a}var Xs={delayMs:600,longThresholdChars:1e3,longDelayMs:2e3,maxMessages:8,maxChars:4e3},Eh={ttl:12*36e5,maxEntries:5e3,sweepIntervalMs:5*6e4,namespace:"channel:seen"},OT=30*6e4,cM=5*6e4;function lM(n){var t,r,a,i,s,o,e;let y=(r=(t=n?.batch)===null||t===void 0?void 0:t.text)!==null&&r!==void 0?r:{};return{delayMs:(a=y.delayMs)!==null&&a!==void 0?a:Xs.delayMs,longThresholdChars:(i=y.longThresholdChars)!==null&&i!==void 0?i:Xs.longThresholdChars,longDelayMs:(s=y.longDelayMs)!==null&&s!==void 0?s:Xs.longDelayMs,maxMessages:(o=y.maxMessages)!==null&&o!==void 0?o:Xs.maxMessages,maxChars:(e=y.maxChars)!==null&&e!==void 0?e:Xs.maxChars}}var ay=class{constructor(t,r={}){var a,i,s,o,e,y;this.cache=t,this.memory=new Map,this.ttlMs=(a=r.ttlMs)!==null&&a!==void 0?a:Eh.ttl,this.maxMem=(i=r.maxMemEntries)!==null&&i!==void 0?i:Eh.maxEntries,this.ns=(s=r.namespace)!==null&&s!==void 0?s:Eh.namespace;let u=(o=r.sweepMs)!==null&&o!==void 0?o:Eh.sweepIntervalMs;this.sweeper=setInterval(()=>this.sweep(),u),(y=(e=this.sweeper).unref)===null||y===void 0||y.call(e)}has(t){return h(this,void 0,void 0,function*(){let r=Date.now(),a=this.memory.get(t);return a&&a>r?(this.memory.delete(t),this.memory.set(t,a),!0):(yield this.cache.get(t,{namespace:this.ns}))?(this.memory.set(t,r+this.ttlMs),this.evictIfNeeded(),!0):!1})}add(t){return h(this,void 0,void 0,function*(){let r=Date.now()+this.ttlMs;this.memory.set(t,r),this.evictIfNeeded();try{yield this.cache.set(t,"1",r,{namespace:this.ns})}catch{}})}evictIfNeeded(){for(;this.memory.size>this.maxMem;){let t=this.memory.keys().next().value;if(t===void 0)break;this.memory.delete(t)}}sweep(){let t=Date.now();for(let[r,a]of this.memory)a<=t&&this.memory.delete(r)}dispose(){clearInterval(this.sweeper),this.memory.clear()}},iy=class{constructor(t,r){this.cfg=Object.assign({},t??{}),this.bot=r}evaluate(t){return t.chatType==="group"?this.evaluateGroup(t):this.evaluateDm(t)}evaluateGroup(t){var r,a;let i=this.cfg.groupAllowlist;return i&&i.length>0&&!i.includes(t.chatId)?{allowed:!1,reason:"group_not_allowed"}:((r=this.cfg.requireMention)!==null&&r!==void 0?r:!0)&&!t.mentionedBot?{allowed:!1,reason:"no_mention"}:t.mentionAll&&!((a=this.cfg.respondToMentionAll)!==null&&a!==void 0&&a)?{allowed:!1,reason:"mention_all_blocked"}:{allowed:!0}}evaluateDm(t){var r,a;let i=(r=this.cfg.dmMode)!==null&&r!==void 0?r:"open";return i==="disabled"?{allowed:!1,reason:"dm_disabled"}:i==="allowlist"&&!((a=this.cfg.dmAllowlist)!==null&&a!==void 0?a:[]).includes(t.senderId)?{allowed:!1,reason:"sender_not_allowed"}:{allowed:!0}}updateConfig(t){this.cfg=Object.assign(Object.assign({},this.cfg),t)}getConfig(){return this.cfg}setBotIdentity(t){this.bot=t}getBotIdentity(){return this.bot}},sy=class{constructor(t=cM,r=6e4){var a,i;this.ttlMs=t,this.locks=new Map,this.sweeper=setInterval(()=>this.sweep(),r),(i=(a=this.sweeper).unref)===null||i===void 0||i.call(a)}acquire(t){let r=Date.now(),a=this.locks.get(t);return a&&a>r?!1:(this.locks.set(t,r+this.ttlMs),!0)}release(t){this.locks.delete(t)}sweep(){let t=Date.now();for(let[r,a]of this.locks)a<=t&&this.locks.delete(r)}dispose(){clearInterval(this.sweeper),this.locks.clear()}};function pM(n,t=OT){return!n||!Number.isFinite(n)?!1:Date.now()-n>t}var oy=class{constructor(t){var r,a,i,s,o,e,y,u,f,d,m;this.logger=t.logger,this.onReject=t.onReject,this.onMessage=t.onMessage,this.staleWindow=(a=(r=t.config)===null||r===void 0?void 0:r.staleMessageWindowMs)!==null&&a!==void 0?a:OT,this.queueEnabled=(o=(s=(i=t.config)===null||i===void 0?void 0:i.chatQueue)===null||s===void 0?void 0:s.enabled)!==null&&o!==void 0?o:!0,this.seenCache=new ay(t.cache,{ttlMs:(y=(e=t.config)===null||e===void 0?void 0:e.dedup)===null||y===void 0?void 0:y.ttl,maxMemEntries:(f=(u=t.config)===null||u===void 0?void 0:u.dedup)===null||f===void 0?void 0:f.maxEntries,sweepMs:(m=(d=t.config)===null||d===void 0?void 0:d.dedup)===null||m===void 0?void 0:m.sweepIntervalMs}),this.lock=new sy,this.policy=new iy(t.policy,t.botIdentity),this.manager=new ry(lM(t.config))}pushMessage(t){var r,a,i,s,o,e,y;return h(this,void 0,void 0,function*(){if(pM(t.createTime,this.staleWindow)){(a=(r=this.logger).debug)===null||a===void 0||a.call(r,`safety: drop stale message ${t.messageId}`);return}if(yield this.seenCache.has(t.messageId)){(s=(i=this.logger).debug)===null||s===void 0||s.call(i,`safety: drop duplicate message ${t.messageId}`);return}let u=this.policy.evaluate(t);if(!u.allowed){this.onReject({messageId:t.messageId,chatId:t.chatId,senderId:t.senderId,reason:(o=u.reason)!==null&&o!==void 0?o:"group_not_allowed"});return}if(!this.lock.acquire(t.messageId)){(y=(e=this.logger).debug)===null||y===void 0||y.call(e,`safety: drop in-flight message ${t.messageId}`);return}let f=d=>h(this,void 0,void 0,function*(){var m,g;try{yield this.onMessage(d.message)}catch(_){(g=(m=this.logger).error)===null||g===void 0||g.call(m,"safety: message handler threw",_)}finally{for(let _ of d.sourceIds){try{yield this.seenCache.add(_)}catch{}this.lock.release(_)}}});this.queueEnabled?this.manager.push(t.chatId,t,f):f({message:t,sourceIds:[t.messageId]})})}pushAction(t,r,a){var i,s,o,e;return h(this,void 0,void 0,function*(){if(yield this.seenCache.has(t)){(s=(i=this.logger).debug)===null||s===void 0||s.call(i,`safety: drop duplicate action ${t}`);return}if(!this.lock.acquire(t)){(e=(o=this.logger).debug)===null||e===void 0||e.call(o,`safety: drop in-flight action ${t}`);return}let y=()=>h(this,void 0,void 0,function*(){var u,f;try{yield a()}catch(d){(f=(u=this.logger).error)===null||f===void 0||f.call(u,"safety: action handler threw",d)}finally{try{yield this.seenCache.add(t)}catch{}this.lock.release(t)}});this.queueEnabled?yield this.manager.run(r,y):yield y()})}pushLight(t,r){var a,i;return h(this,void 0,void 0,function*(){if(!(yield this.seenCache.has(t))){yield this.seenCache.add(t);try{yield r()}catch(s){(i=(a=this.logger).warn)===null||i===void 0||i.call(a,"safety: light handler threw",s)}}})}updatePolicy(t){this.policy.updateConfig(t)}getPolicy(){return this.policy.getConfig()}setBotIdentity(t){this.policy.setBotIdentity(t)}dispose(){return h(this,void 0,void 0,function*(){yield this.manager.dispose(),this.seenCache.dispose(),this.lock.dispose()})}};function uM(n){return n.key==="@_all"}function mM(n,t){var r,a,i;let s=new Map,o=new Map,e=[],y=!1,u=!1;for(let f of n??[]){if(uM(f)){y=!0,s.set(f.key,{key:f.key,name:f.name,isBot:!1});continue}let d=(a=(r=f.id)===null||r===void 0?void 0:r.open_id)!==null&&a!==void 0?a:"",m=(i=f.id)===null||i===void 0?void 0:i.user_id,g=!!(t&&d===t);g&&(u=!0);let _={key:f.key,openId:d||void 0,userId:m,name:f.name,isBot:g};s.set(f.key,_),d&&o.set(d,_),e.push(_)}return{mentions:s,mentionsByOpenId:o,mentionList:e,mentionAll:y,mentionedBot:u}}function fM(n,t){if(!n||t.mentions.size===0)return n;let r=n;for(let[a,i]of t.mentions){if(i.isBot&&t.stripBotMentions){let o=new RegExp(`\\s?${yM(a)}\\s?`,"g");r=r.replace(o," ");continue}let s=i.name?`@${i.name}`:a;r=r.split(a).join(s)}return r.replace(/[ \t]{2,}/g," ").trim()}function yM(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ze(n){if(n)try{return JSON.parse(n)}catch{return}}function gM(n,t){if(!t||t.length===0)return n;let r=n;return t.includes("bold")&&(r=`**${r}**`),t.includes("italic")&&(r=`*${r}*`),t.includes("underline")&&(r=`${r}`),(t.includes("lineThrough")||t.includes("strikethrough"))&&(r=`~~${r}~~`),(t.includes("codeInline")||t.includes("code"))&&(r=`\`${r}\``),r}var vM=["zh_cn","en_us","ja_jp"];function _M(n){if("title"in n||"content"in n)return n;for(let r of vM){let a=n[r];if(a!=null&&typeof a=="object")return a}let t=Object.keys(n)[0];if(t){let r=n[t];if(r!=null&&typeof r=="object")return r}}function $T(n){if(!(n==null||!Number.isFinite(n)||n<0))return n<1e3?`${Math.round(n)}ms`:n%1e3===0?`${n/1e3}s`:`${(n/1e3).toFixed(1)}s`}function Uh(n){if(n==null)return;let t=typeof n=="string"?parseInt(n,10):n;if(!Number.isFinite(t)||t<=0)return;let r=new Date(t+8*36e5),a=r.getUTCFullYear(),i=String(r.getUTCMonth()+1).padStart(2,"0"),s=String(r.getUTCDate()).padStart(2,"0"),o=String(r.getUTCHours()).padStart(2,"0"),e=String(r.getUTCMinutes()).padStart(2,"0");return`${a}-${i}-${s} ${o}:${e}`}function bM(n){let t=new Date(n+288e5),r=t.getUTCFullYear(),a=String(t.getUTCMonth()+1).padStart(2,"0"),i=String(t.getUTCDate()).padStart(2,"0"),s=String(t.getUTCHours()).padStart(2,"0"),o=String(t.getUTCMinutes()).padStart(2,"0"),e=String(t.getUTCSeconds()).padStart(2,"0");return`${r}-${a}-${i}T${s}:${o}:${e}+08:00`}function wM(n,t){return n.split(` +`).map(r=>`${t}${r}`).join(` +`)}function no(n){return n.replace(/"/g,""")}var SM=(n,t)=>h(void 0,void 0,void 0,function*(){let r=ze(n),a=r?.file_key;if(!a)return{content:"[audio]",resources:[]};let i=r?.duration,s=$T(i),o=s?` duration="${s}"`:"";return{content:`