diff --git a/openapi-ts.config.ts b/openapi-ts.config.ts new file mode 100644 index 0000000..fd2ac9a --- /dev/null +++ b/openapi-ts.config.ts @@ -0,0 +1,11 @@ +import { defineConfig } from '@hey-api/openapi-ts'; + +export default defineConfig({ + input: 'openapi.yaml', + output: 'src/generated', + plugins: [ + '@hey-api/client-fetch', + '@hey-api/typescript', + '@hey-api/sdk', + ], +}); diff --git a/package-lock.json b/package-lock.json index 87282a6..4606e3e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,21 +1,20 @@ { - "name": "@getlatedev/node", - "version": "0.2.157", + "name": "@zernio/node", + "version": "0.2.155", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "@getlatedev/node", - "version": "0.2.157", + "name": "@zernio/node", + "version": "0.2.155", "license": "Apache-2.0", "devDependencies": { - "@hey-api/client-fetch": "^0.6.0", - "@hey-api/openapi-ts": "^0.61.0", + "@hey-api/openapi-ts": "^0.97.2", "@types/node": "^20.11.0", "@typescript-eslint/eslint-plugin": "^7.18.0", "@typescript-eslint/parser": "^7.18.0", "eslint": "^8.56.0", - "tsup": "^8.0.1", + "tsdown": "^0.22.0", "tsx": "^4.7.0", "typescript": "^5.3.3", "vitest": "^1.2.0", @@ -25,6 +24,124 @@ "node": ">=18" } }, + "node_modules/@babel/generator": { + "version": "8.0.0-rc.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-8.0.0-rc.5.tgz", + "integrity": "sha512-nFZPWz3FHIS7y6rMIVoa/WBwjdutfIaRJIBQjzn+t3RnecZoRNlGmGcyR2wb0T/IgSd50Kz/6dG8/LvMCRunjg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^8.0.0-rc.5", + "@babel/types": "^8.0.0-rc.5", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "@types/jsesc": "^2.5.0", + "jsesc": "^3.0.2" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/generator/node_modules/@babel/parser": { + "version": "8.0.0-rc.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-8.0.0-rc.5.tgz", + "integrity": "sha512-/Mfg83rK3+jsRbl4Vbd0jqxc6M1A1/WNFtgrowRM1unEsD3XcNnrBdMM0JWakd0/RN9lseQKwPduW1TiEwKOlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^8.0.0-rc.5" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "8.0.0-rc.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-8.0.0-rc.5.tgz", + "integrity": "sha512-sN7R8rBvDurfaziNfDEIjIntlazmlkCDGO4SNl2RJ3wRCn+QxspLV7hzYAE8WWVd2joVuT8sUxeePdLp2idI1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "8.0.0-rc.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-8.0.0-rc.5.tgz", + "integrity": "sha512-ehJDxHvtbZ85RtX/L2fi0h9AGsBNqB5Euv1EB8RMAvGYvD+2X+QbpzzOpbklnNXO+WSZJNOaetw2BBj27xsWVg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@babel/parser": { + "version": "8.0.0-rc.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-8.0.0-rc.4.tgz", + "integrity": "sha512-0S/1yefMa15N4i2v3t8Fw9pgMHhf2gF6Lc1UEXI96Ls6FNAjqvHHZouZ2ZS/deqLhbMFtmfVeFac6iTsvFbLwA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^8.0.0-rc.4" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@babel/types": { + "version": "8.0.0-rc.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-8.0.0-rc.5.tgz", + "integrity": "sha512-JeSVu/m8x/zpp4CLjYHVNXuhEyOkhPXuxM8YOXjh6L4LlvQNKuUNOTo5KdBuKAcTDHw8DquToTaEkhsBqPXOaA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^8.0.0-rc.5", + "@babel/helper-validator-identifier": "^8.0.0-rc.5" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/@emnapi/core": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz", + "integrity": "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.1", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz", + "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz", + "integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.27.2", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.2.tgz", @@ -520,60 +637,117 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/@hey-api/client-fetch": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@hey-api/client-fetch/-/client-fetch-0.6.0.tgz", - "integrity": "sha512-FlhFsVeH8RxJe/nq8xUzxNbiOpe+GadxlD2pfvDyOyLdCTU4o/LRv46ZVWstaW7DgF4nxhI328chy3+AulwVXw==", - "deprecated": "Starting with v0.73.0, this package is bundled directly inside @hey-api/openapi-ts.", + "node_modules/@hey-api/codegen-core": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@hey-api/codegen-core/-/codegen-core-0.8.1.tgz", + "integrity": "sha512-Iciv2vUCJTW9lWM/ROvyZLblmcbYJHPuXfzb1SzeDVVn4xEXu2ilLU1pq3fn+09FZ/Y0P7VyvRE47UDU6om8xA==", "dev": true, "license": "MIT", + "dependencies": { + "@hey-api/types": "0.1.4", + "ansi-colors": "4.1.3", + "c12": "3.3.4", + "color-support": "1.1.3" + }, + "engines": { + "node": ">=22.13.0" + }, "funding": { "url": "https://github.com/sponsors/hey-api" } }, "node_modules/@hey-api/json-schema-ref-parser": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@hey-api/json-schema-ref-parser/-/json-schema-ref-parser-1.0.1.tgz", - "integrity": "sha512-dBt0A7op9kf4BcK++x6HBYDmvCvnJUZEGe5QytghPFHnMXPyKwDKomwL/v5e9ERk6E0e1GzL/e/y6pWUso9zrQ==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@hey-api/json-schema-ref-parser/-/json-schema-ref-parser-1.4.2.tgz", + "integrity": "sha512-ZhCFSKI2ipZHEbgmtUHdyddvRU3wJ4elgCfYUC7T7hZa4EivSrVflTQf2w+v3TuaYxR1Y2V2kq3otqTttrrK8Q==", "dev": true, "license": "MIT", "dependencies": { - "@jsdevtools/ono": "^7.1.3", - "@types/json-schema": "^7.0.15", - "js-yaml": "^4.1.0" + "@jsdevtools/ono": "7.1.3", + "@types/json-schema": "7.0.15", + "js-yaml": "4.1.1" }, "engines": { - "node": ">= 16" + "node": ">=22.13.0" }, "funding": { "url": "https://github.com/sponsors/hey-api" } }, "node_modules/@hey-api/openapi-ts": { - "version": "0.61.3", - "resolved": "https://registry.npmjs.org/@hey-api/openapi-ts/-/openapi-ts-0.61.3.tgz", - "integrity": "sha512-Ls9MBRa5+vg7UHw6fIcfdgcCyZ9vKtRw63nWxwF9zjJIPlzVOZO6xKuzGmDc6o0Pb6XCdTz6lPV5hcV0R4b/ag==", + "version": "0.97.2", + "resolved": "https://registry.npmjs.org/@hey-api/openapi-ts/-/openapi-ts-0.97.2.tgz", + "integrity": "sha512-nA+y0/I5O9loQMeJKumi6BQ40/Y71N0hIMmXZ/I7rh8jEOzYxSxmf5a4TBEI2Ap4RAfZyh7RJzJfVzT98KUYQQ==", "dev": true, "license": "MIT", "dependencies": { - "@hey-api/json-schema-ref-parser": "1.0.1", - "c12": "2.0.1", - "commander": "13.0.0", - "handlebars": "4.7.8" + "@hey-api/codegen-core": "0.8.1", + "@hey-api/json-schema-ref-parser": "1.4.2", + "@hey-api/shared": "0.4.4", + "@hey-api/spec-types": "0.2.0", + "@hey-api/types": "0.1.4", + "@lukeed/ms": "2.0.2", + "ansi-colors": "4.1.3", + "color-support": "1.1.3", + "commander": "14.0.3", + "get-tsconfig": "4.14.0" }, "bin": { - "openapi-ts": "bin/index.cjs" + "openapi-ts": "bin/run.js" }, "engines": { - "node": "^18.20.5 || ^20.11.1 || >=22.11.0" + "node": ">=22.13.0" }, "funding": { "url": "https://github.com/sponsors/hey-api" }, "peerDependencies": { - "typescript": "^5.5.3" + "typescript": ">=5.5.3 || >=6.0.0 || 6.0.1-rc" } }, + "node_modules/@hey-api/shared": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@hey-api/shared/-/shared-0.4.4.tgz", + "integrity": "sha512-UZgaQNEdo/OSGLeNXhSv0VQTHQQm5Q2mHOuoYhFPJkNvLVrz7KZtGdKR8O4QPrhyblshxY+caJli08WKM0gREg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@hey-api/codegen-core": "0.8.1", + "@hey-api/json-schema-ref-parser": "1.4.2", + "@hey-api/spec-types": "0.2.0", + "@hey-api/types": "0.1.4", + "ansi-colors": "4.1.3", + "cross-spawn": "7.0.6", + "open": "11.0.0", + "semver": "7.7.4" + }, + "engines": { + "node": ">=22.13.0" + }, + "funding": { + "url": "https://github.com/sponsors/hey-api" + } + }, + "node_modules/@hey-api/spec-types": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@hey-api/spec-types/-/spec-types-0.2.0.tgz", + "integrity": "sha512-ibQ8Is7evMavzr8GNyJCcTg975d8DpaMUyLmOrQ85UBdy1l6t1KuRAwgChAbesJsIlNV6gjmlXruWyegDX18Fg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@hey-api/types": "0.1.4" + }, + "funding": { + "url": "https://github.com/sponsors/hey-api" + } + }, + "node_modules/@hey-api/types": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@hey-api/types/-/types-0.1.4.tgz", + "integrity": "sha512-thWfawrDIP7wSI9ioT13I5soaaqB5vAPIiZmgD8PbeEVKNrkonc0N/Sjj97ezl7oQgusZmaNphGdMKipPO6IBg==", + "dev": true, + "license": "MIT" + }, "node_modules/@humanwhocodes/config-array": { "version": "0.13.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", @@ -671,6 +845,35 @@ "dev": true, "license": "MIT" }, + "node_modules/@lukeed/ms": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@lukeed/ms/-/ms-2.0.2.tgz", + "integrity": "sha512-9I2Zn6+NJLfaGoz9jN3lpwDgAYvfGeNYdbAIjJOqzs4Tpc+VU3Jqq4IofSUBKajiDS8k9fZIg18/z13mpk1bsA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.4.tgz", + "integrity": "sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@tybys/wasm-util": "^0.10.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1", + "@emnapi/runtime": "^1.7.1" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -709,6 +912,311 @@ "node": ">= 8" } }, + "node_modules/@oxc-project/types": { + "version": "0.130.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.130.0.tgz", + "integrity": "sha512-ibD2usx9JRu7f5pu2tMKMI4cpA4NgXJQoYRP4pQ7Pxmn1l6k/53qWtQWZayhYy3X4QZkt90Ot+mJEaeXouio6Q==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Boshen" + } + }, + "node_modules/@quansync/fs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@quansync/fs/-/fs-1.0.0.tgz", + "integrity": "sha512-4TJ3DFtlf1L5LDMaM6CanJ/0lckGNtJcMjQ1NAV6zDmA0tEHKZtxNKin8EgPaVX1YzljbxckyT2tJrpQKAtngQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "quansync": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sxzz" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.1.tgz", + "integrity": "sha512-fJI3I0r3C3Oj/zdBCpaCmBRZYf07xpaq4yCfDDoSFm+beWNzbIl26puW8RraUdugoJw/95zerNOn6jasAhzSmg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.1.tgz", + "integrity": "sha512-cKnAhWEsV7TPcA/5EAteDp6KcJZBQ2G+BqE7zayMMi7kMvwRsbv7WT9aOnn0WNl4SKEIf43vjS31iUPu80nzXg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.1.tgz", + "integrity": "sha512-YKrVwQjIRBPo+5G/u03wGjbdy4q7pyzCe93DK9VJ7zkVmeg8LJ7GbgsiHWdR4xSoe4CAXRD7Bcjgbtr64bkXNg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.1.tgz", + "integrity": "sha512-z/oBsREo46SsFqBwYtFe0kpJeBijAT48O/WXLI4suiCLBkr03RTtTJMCzSdDd2znlh8VJizL09XVkQgk8IZonw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.1.tgz", + "integrity": "sha512-ik8q7GM11zxvYxFc2PeDcT6TBvhCQMaUxfph/M5l9sKuTs/Sjg3L+Byw0F7w0ZVLBZmx30P+gG0ECzzN+MFcmQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.1.tgz", + "integrity": "sha512-QoSx2EkyrrdZ6kcyE8stqZ62t0Yra8Fs5ia9lOxJrh6TMQJK7gQKmscdTHf7pOXKREKrVwOtJcQG3qVSfc866A==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.1.tgz", + "integrity": "sha512-uwNwFpwKeNiZawfAWBgg0VIztPTV3ihhh1vV334h9ivnNLorxnQMU6Fz8wG1Zb4Qh9LC1/MkcyT3YlDXG3Rsgg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.1.tgz", + "integrity": "sha512-zY1bul7OWr7DFBiJ++wofXvnr8B45ce3QsQUhKrIhXsygAh7bTkwyeM1bi1a2g5C/yC/N8TZyGDEoMfm/l9mpg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.1.tgz", + "integrity": "sha512-0frlsT/f4Ft6I7SMESTKnF3cZsdicQn1dCMkF/jT9wDLE+gGoiQfv1nmT9e+s7s/fekvvy6tZM2jHvI2tkbJDQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.1.tgz", + "integrity": "sha512-XABVmGp9Tg0WspTVvwduTc4fpqy6JnAUrSQe6OuyqD/03nI7r0O9OWUkMIwFrjKAIqolvqoA4ZrJppgwE0Gxmw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.1.tgz", + "integrity": "sha512-bV4fzswuzVcKD90o/VM6QqKxnxlDq0g2BISDLNVmxrnhpv1DDbyPhCIjYfvzYLV+MvkKKnQt2Q6AO86SEBULUQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.1.tgz", + "integrity": "sha512-/Mh0Zhq3OP7fVs0kcQHZP6lZEthMGTaSf8UBQYSFEZDWGXXlEC+nJ6EqenaK2t4LBXMe3A+K/G2BVXXdtOr4PQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.1.tgz", + "integrity": "sha512-+1xc9X45l8ufsBAm6Gjvx2qDRIY9lTVt0cgWNcJ+1gdhXvkbxePA60yRTwSTuXL09CMhyJmjpV7E3NoyxbqFQQ==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "1.10.0", + "@emnapi/runtime": "1.10.0", + "@napi-rs/wasm-runtime": "^1.1.4" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.1.tgz", + "integrity": "sha512-1D+UqZdfnuR+Jy1GgMJwi85bD40H21uNmOPRWQhw4oRSuolZ/B5rixZ45DK2KXOTCvmVCecauWgEhbw8bI7tOw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.1.tgz", + "integrity": "sha512-INAycaWuhlOK3wk4mRHGsdgwYWmd9cChdPdE9bwWmy6rn9VqVNYNFGhOdXrofXUxwHIncSiPNb8tNm8knDVIeQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "dev": true, + "license": "MIT" + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.55.1", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.55.1.tgz", @@ -801,6 +1309,9 @@ "arm" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -815,6 +1326,9 @@ "arm" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -829,6 +1343,9 @@ "arm64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -843,6 +1360,9 @@ "arm64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -857,6 +1377,9 @@ "loong64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -871,6 +1394,9 @@ "loong64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -885,6 +1411,9 @@ "ppc64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -899,6 +1428,9 @@ "ppc64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -913,6 +1445,9 @@ "riscv64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -927,6 +1462,9 @@ "riscv64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -941,6 +1479,9 @@ "s390x" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1066,6 +1607,17 @@ "dev": true, "license": "MIT" }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.2.tgz", + "integrity": "sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@types/estree": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", @@ -1073,6 +1625,13 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/jsesc": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@types/jsesc/-/jsesc-2.5.1.tgz", + "integrity": "sha512-9VN+6yxLOPLOav+7PwjZbxiID2bVaeq0ED4qSQmdQTdjnXJSaCVKTR58t15oqH1H5t8Ng2ZX1SabJVoN9Q34bw==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", @@ -1472,6 +2031,16 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -1498,12 +2067,15 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "node_modules/ansis": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansis/-/ansis-4.3.0.tgz", + "integrity": "sha512-44mvgtPvohuU/70DdY5Oz2AIrLJ9k6/5x4KmoSvPwO+5Moijo0+N9D0fKbbYZQWP1hNm5CpOf+E01jhxG/r8xg==", "dev": true, - "license": "MIT" + "license": "ISC", + "engines": { + "node": ">=14" + } }, "node_modules/argparse": { "version": "2.0.1", @@ -1532,6 +2104,31 @@ "node": "*" } }, + "node_modules/ast-kit": { + "version": "3.0.0-beta.1", + "resolved": "https://registry.npmjs.org/ast-kit/-/ast-kit-3.0.0-beta.1.tgz", + "integrity": "sha512-trmleAnZ2PxN/loHWVhhx1qeOHSRXq4TDsBBxq3GqeJitfk3+jTQ+v/C1km/KYq9M7wKqCewMh+/NAvVH7m+bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^8.0.0-beta.4", + "estree-walker": "^3.0.3", + "pathe": "^2.0.3" + }, + "engines": { + "node": ">=20.19.0" + }, + "funding": { + "url": "https://github.com/sponsors/sxzz" + } + }, + "node_modules/ast-kit/node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -1539,6 +2136,16 @@ "dev": true, "license": "MIT" }, + "node_modules/birpc": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/birpc/-/birpc-4.0.0.tgz", + "integrity": "sha512-LShSxJP0KTmd101b6DRyGBj57LZxSDYWKitQNW/mi8GRMvZb078Uf9+pveax1DrVL89vm7mWe+TovdI/UDOuPw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/brace-expansion": { "version": "1.1.12", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", @@ -1563,44 +2170,44 @@ "node": ">=8" } }, - "node_modules/bundle-require": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-5.1.0.tgz", - "integrity": "sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==", + "node_modules/bundle-name": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz", + "integrity": "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==", "dev": true, "license": "MIT", "dependencies": { - "load-tsconfig": "^0.2.3" + "run-applescript": "^7.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, - "peerDependencies": { - "esbuild": ">=0.18" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/c12": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/c12/-/c12-2.0.1.tgz", - "integrity": "sha512-Z4JgsKXHG37C6PYUtIxCfLJZvo6FyhHJoClwwb9ftUkLpPSkuYqn6Tr+vnaN8hymm0kIbcg6Ey3kv/Q71k5w/A==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/c12/-/c12-3.3.4.tgz", + "integrity": "sha512-cM0ApFQSBXuourJejzwv/AuPRvAxordTyParRVcHjjtXirtkzM0uK2L9TTn9s0cXZbG7E55jCivRQzoxYmRAlA==", "dev": true, "license": "MIT", "dependencies": { - "chokidar": "^4.0.1", - "confbox": "^0.1.7", - "defu": "^6.1.4", - "dotenv": "^16.4.5", - "giget": "^1.2.3", - "jiti": "^2.3.0", - "mlly": "^1.7.1", - "ohash": "^1.1.4", - "pathe": "^1.1.2", - "perfect-debounce": "^1.0.0", - "pkg-types": "^1.2.0", - "rc9": "^2.1.2" + "chokidar": "^5.0.0", + "confbox": "^0.2.4", + "defu": "^6.1.6", + "dotenv": "^17.3.1", + "exsolve": "^1.0.8", + "giget": "^3.2.0", + "jiti": "^2.6.1", + "ohash": "^2.0.11", + "pathe": "^2.0.3", + "perfect-debounce": "^2.1.0", + "pkg-types": "^2.3.0", + "rc9": "^3.0.1" }, "peerDependencies": { - "magicast": "^0.3.5" + "magicast": "*" }, "peerDependenciesMeta": { "magicast": { @@ -1608,6 +2215,62 @@ } } }, + "node_modules/c12/node_modules/chokidar": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz", + "integrity": "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^5.0.0" + }, + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/c12/node_modules/confbox": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.2.4.tgz", + "integrity": "sha512-ysOGlgTFbN2/Y6Cg3Iye8YKulHw+R2fNXHrgSmXISQdMnomY6eNDprVdW9R5xBguEqI954+S6709UyiO7B+6OQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/c12/node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/c12/node_modules/pkg-types": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.3.1.tgz", + "integrity": "sha512-y+ichcgc2LrADuhLNAx8DFjVfgz91pRxfZdI3UDhxHvcVEZsenLO+7XaU5vOp0u/7V/wZ+plyuQxtrDlZJ+yeg==", + "dev": true, + "license": "MIT", + "dependencies": { + "confbox": "^0.2.4", + "exsolve": "^1.0.8", + "pathe": "^2.0.3" + } + }, + "node_modules/c12/node_modules/readdirp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.0.0.tgz", + "integrity": "sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/cac": { "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", @@ -1656,61 +2319,25 @@ "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/check-error": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", - "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", - "dev": true, - "license": "MIT", - "dependencies": { - "get-func-name": "^2.0.2" - }, - "engines": { - "node": "*" - } - }, - "node_modules/chokidar": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", - "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", - "dev": true, - "license": "MIT", - "dependencies": { - "readdirp": "^4.0.1" - }, - "engines": { - "node": ">= 14.16.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", - "dev": true, - "license": "ISC", + }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/citty": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/citty/-/citty-0.1.6.tgz", - "integrity": "sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==", + "node_modules/check-error": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", "dev": true, "license": "MIT", "dependencies": { - "consola": "^3.2.3" + "get-func-name": "^2.0.2" + }, + "engines": { + "node": "*" } }, "node_modules/color-convert": { @@ -1733,14 +2360,24 @@ "dev": true, "license": "MIT" }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true, + "license": "ISC", + "bin": { + "color-support": "bin.js" + } + }, "node_modules/commander": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-13.0.0.tgz", - "integrity": "sha512-oPYleIY8wmTVzkvQq10AEok6YcTC4sRUBl8F9gVuwchGVUCTbl/vhLTaQqutuuySYOsu8YTgV+OxKc/8Yvx+mQ==", + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz", + "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==", "dev": true, "license": "MIT", "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/concat-map": { @@ -1757,16 +2394,6 @@ "dev": true, "license": "MIT" }, - "node_modules/consola": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", - "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^14.18.0 || >=16.10.0" - } - }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -1820,10 +2447,53 @@ "dev": true, "license": "MIT" }, + "node_modules/default-browser": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.5.0.tgz", + "integrity": "sha512-H9LMLr5zwIbSxrmvikGuI/5KGhZ8E2zH3stkMgM5LpOWDutGM2JZaj460Udnf1a+946zc7YBgrqEWwbk7zHvGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "bundle-name": "^4.1.0", + "default-browser-id": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser-id": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.1.tgz", + "integrity": "sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-lazy-prop": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", + "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/defu": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.4.tgz", - "integrity": "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==", + "version": "6.1.7", + "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.7.tgz", + "integrity": "sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==", "dev": true, "license": "MIT" }, @@ -1871,9 +2541,9 @@ } }, "node_modules/dotenv": { - "version": "16.6.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", - "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", + "version": "17.4.2", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.4.2.tgz", + "integrity": "sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==", "dev": true, "license": "BSD-2-Clause", "engines": { @@ -1883,6 +2553,37 @@ "url": "https://dotenvx.com" } }, + "node_modules/dts-resolver": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/dts-resolver/-/dts-resolver-3.0.0.tgz", + "integrity": "sha512-1T1f+z+4tl9XD+m+0HBgWoL/nm0bOIffyWaUuUSBlFg/86IWvfx+wjNaO/ybU0AJzG9/Mi5hBUgGV6zCmWEN7Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^22.18.0 || >=24.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sxzz" + }, + "peerDependencies": { + "oxc-resolver": ">=11.0.0" + }, + "peerDependenciesMeta": { + "oxc-resolver": { + "optional": true + } + } + }, + "node_modules/empathic": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/empathic/-/empathic-2.0.1.tgz", + "integrity": "sha512-YGRs8knHhKHVShLkFET/rWAU8kmHbOV5LwN938RHI0pljAJ1Gf6SzXsSmRaEzcXTtOOmVqJ5+WtQPL5uigY50Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, "node_modules/esbuild": { "version": "0.27.2", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.2.tgz", @@ -2133,6 +2834,13 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, + "node_modules/exsolve": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/exsolve/-/exsolve-1.0.8.tgz", + "integrity": "sha512-LmDxfWXwcTArk8fUEnOfSZpHOJ6zOMUJKOtFLFqJLoKJetuQG874Uc7/Kki7zFLzYybmZhp1M7+98pfMqeX8yA==", + "dev": true, + "license": "MIT" + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -2255,18 +2963,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/fix-dts-default-cjs-exports": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fix-dts-default-cjs-exports/-/fix-dts-default-cjs-exports-1.0.1.tgz", - "integrity": "sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "magic-string": "^0.30.17", - "mlly": "^1.7.4", - "rollup": "^4.34.8" - } - }, "node_modules/flat-cache": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", @@ -2289,32 +2985,6 @@ "dev": true, "license": "ISC" }, - "node_modules/fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "dev": true, - "license": "ISC", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/fs-minipass/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2361,9 +3031,9 @@ } }, "node_modules/get-tsconfig": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.13.0.tgz", - "integrity": "sha512-1VKTZJCwBrvbd+Wn3AOgQP/2Av+TfTCOlE4AcRJE72W1ksZXbAx8PPBR9RzgTeSPzlPMHrbANMH3LbltH73wxQ==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.14.0.tgz", + "integrity": "sha512-yTb+8DXzDREzgvYmh6s9vHsSVCHeC0G3PI5bEXNBHtmshPnO+S5O7qgLEOn0I5QvMy6kpZN8K1NKGyilLb93wA==", "dev": true, "license": "MIT", "dependencies": { @@ -2374,31 +3044,15 @@ } }, "node_modules/giget": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/giget/-/giget-1.2.5.tgz", - "integrity": "sha512-r1ekGw/Bgpi3HLV3h1MRBIlSAdHoIMklpaQ3OQLFcRw9PwAj2rqigvIbg+dBUI51OxVI2jsEtDywDBjSiuf7Ug==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/giget/-/giget-3.2.0.tgz", + "integrity": "sha512-GvHTWcykIR/fP8cj8dMpuMMkvaeJfPvYnhq0oW+chSeIr+ldX21ifU2Ms6KBoyKZQZmVaUAAhQ2EZ68KJF8a7A==", "dev": true, "license": "MIT", - "dependencies": { - "citty": "^0.1.6", - "consola": "^3.4.0", - "defu": "^6.1.4", - "node-fetch-native": "^1.6.6", - "nypm": "^0.5.4", - "pathe": "^2.0.3", - "tar": "^6.2.1" - }, "bin": { "giget": "dist/cli.mjs" } }, - "node_modules/giget/node_modules/pathe": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", - "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", - "dev": true, - "license": "MIT" - }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -2478,28 +3132,6 @@ "dev": true, "license": "MIT" }, - "node_modules/handlebars": { - "version": "4.7.8", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", - "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "minimist": "^1.2.5", - "neo-async": "^2.6.2", - "source-map": "^0.6.1", - "wordwrap": "^1.0.0" - }, - "bin": { - "handlebars": "bin/handlebars" - }, - "engines": { - "node": ">=0.4.7" - }, - "optionalDependencies": { - "uglify-js": "^3.1.4" - } - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -2510,6 +3142,13 @@ "node": ">=8" } }, + "node_modules/hookable": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/hookable/-/hookable-6.1.1.tgz", + "integrity": "sha512-U9LYDy1CwhMCnprUfeAZWZGByVbhd54hwepegYTK7Pi5NvqEj63ifz5z+xukznehT7i6NIZRu89Ay1AZmRsLEQ==", + "dev": true, + "license": "MIT" + }, "node_modules/human-signals": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", @@ -2547,6 +3186,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/import-without-cache": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/import-without-cache/-/import-without-cache-0.4.0.tgz", + "integrity": "sha512-NkJQA7oZ4YHQhd2+H3BoRFKF3d/XNsiKpHZCQEMH9pDX27hQQLsTyOocyRgaIVtf8gHX3Nt3LPkR4e5EdtPAGQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^22.18.0 || >=24.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sxzz" + } + }, "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -2576,6 +3228,22 @@ "dev": true, "license": "ISC" }, + "node_modules/is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "dev": true, + "license": "MIT", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -2599,6 +3267,38 @@ "node": ">=0.10.0" } }, + "node_modules/is-in-ssh": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-in-ssh/-/is-in-ssh-1.0.0.tgz", + "integrity": "sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -2632,6 +3332,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-wsl": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.1.tgz", + "integrity": "sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-inside-container": "^1.0.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -2649,16 +3365,6 @@ "jiti": "lib/jiti-cli.mjs" } }, - "node_modules/joycon": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", - "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - } - }, "node_modules/js-tokens": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz", @@ -2679,6 +3385,19 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -2724,36 +3443,6 @@ "node": ">= 0.8.0" } }, - "node_modules/lilconfig": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", - "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antonk52" - } - }, - "node_modules/lines-and-columns": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true, - "license": "MIT" - }, - "node_modules/load-tsconfig": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz", - "integrity": "sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, "node_modules/local-pkg": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.1.tgz", @@ -2876,72 +3565,12 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/minipass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=8" - } - }, - "node_modules/minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "dev": true, - "license": "MIT", - "dependencies": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/minizlib/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true, - "license": "MIT", - "bin": { - "mkdirp": "bin/cmd.js" + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">=10" + "node": "*" } }, "node_modules/mlly": { @@ -2971,18 +3600,6 @@ "dev": true, "license": "MIT" }, - "node_modules/mz": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "any-promise": "^1.0.0", - "object-assign": "^4.0.1", - "thenify-all": "^1.0.0" - } - }, "node_modules/nanoid": { "version": "3.3.11", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", @@ -3009,20 +3626,6 @@ "dev": true, "license": "MIT" }, - "node_modules/neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true, - "license": "MIT" - }, - "node_modules/node-fetch-native": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.7.tgz", - "integrity": "sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q==", - "dev": true, - "license": "MIT" - }, "node_modules/npm-run-path": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", @@ -3052,48 +3655,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/nypm": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/nypm/-/nypm-0.5.4.tgz", - "integrity": "sha512-X0SNNrZiGU8/e/zAB7sCTtdxWTMSIO73q+xuKgglm2Yvzwlo8UoC5FNySQFCvl84uPaeADkqHUZUkWy4aH4xOA==", - "dev": true, - "license": "MIT", - "dependencies": { - "citty": "^0.1.6", - "consola": "^3.4.0", - "pathe": "^2.0.3", - "pkg-types": "^1.3.1", - "tinyexec": "^0.3.2", - "ufo": "^1.5.4" - }, - "bin": { - "nypm": "dist/cli.mjs" - }, - "engines": { - "node": "^14.16.0 || >=16.10.0" - } - }, - "node_modules/nypm/node_modules/pathe": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", - "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "node_modules/obug": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.1.tgz", + "integrity": "sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==", "dev": true, + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], "license": "MIT" }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/ohash": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/ohash/-/ohash-1.1.6.tgz", - "integrity": "sha512-TBu7PtV8YkAZn0tSxobKY2n2aAQva936lhRrj6957aDaCf9IEtqsKbgMzXE/F/sjqYOwmrukeORHNLe5glk7Cg==", + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/ohash/-/ohash-2.0.11.tgz", + "integrity": "sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==", "dev": true, "license": "MIT" }, @@ -3123,6 +3699,27 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/open": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/open/-/open-11.0.0.tgz", + "integrity": "sha512-smsWv2LzFjP03xmvFoJ331ss6h+jixfA4UUV/Bsiyuu4YJPfN+FIQGOIiv4w9/+MoHkfkJ22UIaQWRVFRfH6Vw==", + "dev": true, + "license": "MIT", + "dependencies": { + "default-browser": "^5.4.0", + "define-lazy-prop": "^3.0.0", + "is-in-ssh": "^1.0.0", + "is-inside-container": "^1.0.0", + "powershell-utils": "^0.1.0", + "wsl-utils": "^0.3.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", @@ -3244,9 +3841,9 @@ } }, "node_modules/perfect-debounce": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/perfect-debounce/-/perfect-debounce-1.0.0.tgz", - "integrity": "sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/perfect-debounce/-/perfect-debounce-2.1.0.tgz", + "integrity": "sha512-LjgdTytVFXeUgtHZr9WYViYSM/g8MkcTPYDlPa3cDqMirHjKiSZPYd6DoL7pK8AJQr+uWkQvCjHNdiMqsrJs+g==", "dev": true, "license": "MIT" }, @@ -3258,9 +3855,9 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "dev": true, "license": "MIT", "engines": { @@ -3270,16 +3867,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/pirates": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", - "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 6" - } - }, "node_modules/pkg-types": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz", @@ -3328,47 +3915,17 @@ "node": "^10 || ^12 || >=14" } }, - "node_modules/postcss-load-config": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz", - "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==", + "node_modules/powershell-utils": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/powershell-utils/-/powershell-utils-0.1.0.tgz", + "integrity": "sha512-dM0jVuXJPsDN6DvRpea484tCUaMiXWjuCn++HGTqUWzGDjv5tZkEZldAJ/UMlqRYGFrD/etByo4/xOuC/snX2A==", "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], "license": "MIT", - "dependencies": { - "lilconfig": "^3.1.1" - }, "engines": { - "node": ">= 18" - }, - "peerDependencies": { - "jiti": ">=1.21.0", - "postcss": ">=8.0.9", - "tsx": "^4.8.1", - "yaml": "^2.4.2" + "node": ">=20" }, - "peerDependenciesMeta": { - "jiti": { - "optional": true - }, - "postcss": { - "optional": true - }, - "tsx": { - "optional": true - }, - "yaml": { - "optional": true - } + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/prelude-ls": { @@ -3419,6 +3976,23 @@ "node": ">=6" } }, + "node_modules/quansync": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/quansync/-/quansync-1.0.0.tgz", + "integrity": "sha512-5xZacEEufv3HSTPQuchrvV6soaiACMFnq1H8wkVioctoH3TRha9Sz66lOxRwPK/qZj7HPiSveih9yAyh98gvqA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/antfu" + }, + { + "type": "individual", + "url": "https://github.com/sponsors/sxzz" + } + ], + "license": "MIT" + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -3441,14 +4015,14 @@ "license": "MIT" }, "node_modules/rc9": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/rc9/-/rc9-2.1.2.tgz", - "integrity": "sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/rc9/-/rc9-3.0.1.tgz", + "integrity": "sha512-gMDyleLWVE+i6Sgtc0QbbY6pEKqYs97NGi6isHQPqYlLemPoO8dxQ3uGi0f4NiP98c+jMW6cG1Kx9dDwfvqARQ==", "dev": true, "license": "MIT", "dependencies": { - "defu": "^6.1.4", - "destr": "^2.0.3" + "defu": "^6.1.6", + "destr": "^2.0.5" } }, "node_modules/react-is": { @@ -3458,20 +4032,6 @@ "dev": true, "license": "MIT" }, - "node_modules/readdirp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", - "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14.18.0" - }, - "funding": { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -3520,6 +4080,100 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/rolldown": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.1.tgz", + "integrity": "sha512-X0KQHljNnEkWNqqiz9zJrGunh1B0HgOxLXvnFpCOcadzcy5qohZ3tqMEUg00vncoRovXuK3ZqCT9KnnKzoInFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.130.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm64": "1.0.1", + "@rolldown/binding-darwin-arm64": "1.0.1", + "@rolldown/binding-darwin-x64": "1.0.1", + "@rolldown/binding-freebsd-x64": "1.0.1", + "@rolldown/binding-linux-arm-gnueabihf": "1.0.1", + "@rolldown/binding-linux-arm64-gnu": "1.0.1", + "@rolldown/binding-linux-arm64-musl": "1.0.1", + "@rolldown/binding-linux-ppc64-gnu": "1.0.1", + "@rolldown/binding-linux-s390x-gnu": "1.0.1", + "@rolldown/binding-linux-x64-gnu": "1.0.1", + "@rolldown/binding-linux-x64-musl": "1.0.1", + "@rolldown/binding-openharmony-arm64": "1.0.1", + "@rolldown/binding-wasm32-wasi": "1.0.1", + "@rolldown/binding-win32-arm64-msvc": "1.0.1", + "@rolldown/binding-win32-x64-msvc": "1.0.1" + } + }, + "node_modules/rolldown-plugin-dts": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/rolldown-plugin-dts/-/rolldown-plugin-dts-0.25.1.tgz", + "integrity": "sha512-zK82aC/8z1iVW+g0bCnlQZq04Y5bNeL/RcRwTYBwsnU6wH0N+6vpIFkN7JC0kYRS5qKA+pxQyfIPvXJ6Q5xSpQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/generator": "8.0.0-rc.5", + "@babel/helper-validator-identifier": "8.0.0-rc.5", + "@babel/parser": "8.0.0-rc.4", + "ast-kit": "^3.0.0-beta.1", + "birpc": "^4.0.0", + "dts-resolver": "^3.0.0", + "get-tsconfig": "5.0.0-beta.5", + "obug": "^2.1.1" + }, + "engines": { + "node": "^22.18.0 || >=24.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sxzz" + }, + "peerDependencies": { + "@ts-macro/tsc": "^0.3.6", + "@typescript/native-preview": ">=7.0.0-dev.20260325.1", + "rolldown": "^1.0.0", + "typescript": "^5.0.0 || ^6.0.0", + "vue-tsc": "~3.2.0" + }, + "peerDependenciesMeta": { + "@ts-macro/tsc": { + "optional": true + }, + "@typescript/native-preview": { + "optional": true + }, + "typescript": { + "optional": true + }, + "vue-tsc": { + "optional": true + } + } + }, + "node_modules/rolldown-plugin-dts/node_modules/get-tsconfig": { + "version": "5.0.0-beta.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-5.0.0-beta.5.tgz", + "integrity": "sha512-/6gFNr0N04nob252sTQxyFLi3eKFRqIg1I87YcqAMT1i6SQrSF6KujUEQrtrjMV0H/eejTCltLdDSTEMzHbnsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "engines": { + "node": ">=20.20.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/rollup": { "version": "4.55.1", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.55.1.tgz", @@ -3565,6 +4219,19 @@ "fsevents": "~2.3.2" } }, + "node_modules/run-applescript": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.1.0.tgz", + "integrity": "sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -3590,9 +4257,9 @@ } }, "node_modules/semver": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", - "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", "dev": true, "license": "ISC", "bin": { @@ -3655,16 +4322,6 @@ "node": ">=8" } }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/source-map-js": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", @@ -3741,39 +4398,6 @@ "url": "https://github.com/sponsors/antfu" } }, - "node_modules/sucrase": { - "version": "3.35.1", - "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.1.tgz", - "integrity": "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.2", - "commander": "^4.0.0", - "lines-and-columns": "^1.1.6", - "mz": "^2.7.0", - "pirates": "^4.0.1", - "tinyglobby": "^0.2.11", - "ts-interface-checker": "^0.1.9" - }, - "bin": { - "sucrase": "bin/sucrase", - "sucrase-node": "bin/sucrase-node" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/sucrase/node_modules/commander": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", - "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 6" - } - }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -3787,24 +4411,6 @@ "node": ">=8" } }, - "node_modules/tar": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", - "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", - "dev": true, - "license": "ISC", - "dependencies": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^5.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -3812,29 +4418,6 @@ "dev": true, "license": "MIT" }, - "node_modules/thenify": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", - "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", - "dev": true, - "license": "MIT", - "dependencies": { - "any-promise": "^1.0.0" - } - }, - "node_modules/thenify-all": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", - "dev": true, - "license": "MIT", - "dependencies": { - "thenify": ">= 3.1.0 < 4" - }, - "engines": { - "node": ">=0.8" - } - }, "node_modules/tinybench": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", @@ -3843,21 +4426,24 @@ "license": "MIT" }, "node_modules/tinyexec": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", - "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.1.2.tgz", + "integrity": "sha512-dAqSqE/RabpBKI8+h26GfLq6Vb3JVXs30XYQjdMjaj/c2tS8IYYMbIzP599KtRj7c57/wYApb3QjgRgXmrCukA==", "dev": true, - "license": "MIT" + "license": "MIT", + "engines": { + "node": ">=18" + } }, "node_modules/tinyglobby": { - "version": "0.2.15", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", - "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "version": "0.2.16", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.16.tgz", + "integrity": "sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==", "dev": true, "license": "MIT", "dependencies": { "fdir": "^6.5.0", - "picomatch": "^4.0.3" + "picomatch": "^4.0.4" }, "engines": { "node": ">=12.0.0" @@ -3922,85 +4508,96 @@ "typescript": ">=4.2.0" } }, - "node_modules/ts-interface-checker": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", - "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", - "dev": true, - "license": "Apache-2.0" - }, - "node_modules/tsup": { - "version": "8.5.1", - "resolved": "https://registry.npmjs.org/tsup/-/tsup-8.5.1.tgz", - "integrity": "sha512-xtgkqwdhpKWr3tKPmCkvYmS9xnQK3m3XgxZHwSUjvfTjp7YfXe5tT3GgWi0F2N+ZSMsOeWeZFh7ZZFg5iPhing==", + "node_modules/tsdown": { + "version": "0.22.0", + "resolved": "https://registry.npmjs.org/tsdown/-/tsdown-0.22.0.tgz", + "integrity": "sha512-FgW0hHb27nGQA/+F3d5+U9wKXkfilk9DVkc5+7x/ZqF03g+Hoz/eeApT32jqxATt9eRoR+1jxk7MUMON+O4CXw==", "dev": true, "license": "MIT", "dependencies": { - "bundle-require": "^5.1.0", - "cac": "^6.7.14", - "chokidar": "^4.0.3", - "consola": "^3.4.0", - "debug": "^4.4.0", - "esbuild": "^0.27.0", - "fix-dts-default-cjs-exports": "^1.0.0", - "joycon": "^3.1.1", - "picocolors": "^1.1.1", - "postcss-load-config": "^6.0.1", - "resolve-from": "^5.0.0", - "rollup": "^4.34.8", - "source-map": "^0.7.6", - "sucrase": "^3.35.0", - "tinyexec": "^0.3.2", - "tinyglobby": "^0.2.11", - "tree-kill": "^1.2.2" + "ansis": "^4.2.0", + "cac": "^7.0.0", + "defu": "^6.1.7", + "empathic": "^2.0.0", + "hookable": "^6.1.1", + "import-without-cache": "^0.4.0", + "obug": "^2.1.1", + "picomatch": "^4.0.4", + "rolldown": "^1.0.0", + "rolldown-plugin-dts": "^0.25.0", + "semver": "^7.7.4", + "tinyexec": "^1.1.2", + "tinyglobby": "^0.2.16", + "tree-kill": "^1.2.2", + "unconfig-core": "^7.5.0" }, "bin": { - "tsup": "dist/cli-default.js", - "tsup-node": "dist/cli-node.js" + "tsdown": "dist/run.mjs" }, "engines": { - "node": ">=18" + "node": "^22.18.0 || >=24.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sxzz" }, "peerDependencies": { - "@microsoft/api-extractor": "^7.36.0", - "@swc/core": "^1", - "postcss": "^8.4.12", - "typescript": ">=4.5.0" + "@arethetypeswrong/core": "^0.18.1", + "@tsdown/css": "0.22.0", + "@tsdown/exe": "0.22.0", + "@vitejs/devtools": "*", + "publint": "^0.3.8", + "tsx": "*", + "typescript": "^5.0.0 || ^6.0.0", + "unplugin-unused": "^0.5.0", + "unrun": "*" }, "peerDependenciesMeta": { - "@microsoft/api-extractor": { + "@arethetypeswrong/core": { + "optional": true + }, + "@tsdown/css": { + "optional": true + }, + "@tsdown/exe": { + "optional": true + }, + "@vitejs/devtools": { "optional": true }, - "@swc/core": { + "publint": { "optional": true }, - "postcss": { + "tsx": { "optional": true }, "typescript": { "optional": true + }, + "unplugin-unused": { + "optional": true + }, + "unrun": { + "optional": true } } }, - "node_modules/tsup/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "node_modules/tsdown/node_modules/cac": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cac/-/cac-7.0.0.tgz", + "integrity": "sha512-tixWYgm5ZoOD+3g6UTea91eow5z6AAHaho3g0V9CNSNb45gM8SmflpAc+GRd1InC4AqN/07Unrgp56Y94N9hJQ==", "dev": true, "license": "MIT", "engines": { - "node": ">=8" + "node": ">=20.19.0" } }, - "node_modules/tsup/node_modules/source-map": { - "version": "0.7.6", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", - "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==", + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">= 12" - } + "license": "0BSD", + "optional": true }, "node_modules/tsx": { "version": "4.21.0", @@ -4079,18 +4676,18 @@ "dev": true, "license": "MIT" }, - "node_modules/uglify-js": { - "version": "3.19.3", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", - "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", + "node_modules/unconfig-core": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/unconfig-core/-/unconfig-core-7.5.0.tgz", + "integrity": "sha512-Su3FauozOGP44ZmKdHy2oE6LPjk51M/TRRjHv2HNCWiDvfvCoxC2lno6jevMA91MYAdCdwP05QnWdWpSbncX/w==", "dev": true, - "license": "BSD-2-Clause", - "optional": true, - "bin": { - "uglifyjs": "bin/uglifyjs" + "license": "MIT", + "dependencies": { + "@quansync/fs": "^1.0.0", + "quansync": "^1.0.0" }, - "engines": { - "node": ">=0.8.0" + "funding": { + "url": "https://github.com/sponsors/antfu" } }, "node_modules/undici-types": { @@ -4732,13 +5329,6 @@ "node": ">=0.10.0" } }, - "node_modules/wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", - "dev": true, - "license": "MIT" - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -4746,12 +5336,22 @@ "dev": true, "license": "ISC" }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "node_modules/wsl-utils": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/wsl-utils/-/wsl-utils-0.3.1.tgz", + "integrity": "sha512-g/eziiSUNBSsdDJtCLB8bdYEUMj4jR7AGeUo96p/3dTafgjHhpF4RiCFPiRILwjQoDXx5MqkBr4fwWtR3Ky4Wg==", "dev": true, - "license": "ISC" + "license": "MIT", + "dependencies": { + "is-wsl": "^3.1.0", + "powershell-utils": "^0.1.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/yaml": { "version": "2.8.2", diff --git a/package.json b/package.json index 6582795..b30e8f0 100644 --- a/package.json +++ b/package.json @@ -2,20 +2,20 @@ "name": "@zernio/node", "version": "0.2.157", "description": "The official Node.js library for the Zernio API", - "main": "dist/index.js", + "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", + "types": "dist/index.d.cts", "sideEffects": false, "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.js" - }, - "./_shims/*": { - "types": "./dist/_shims/*.d.ts", - "import": "./dist/_shims/*.mjs", - "require": "./dist/_shims/*.js" + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ @@ -25,10 +25,10 @@ "LICENSE" ], "scripts": { - "generate": "openapi-ts -i openapi.yaml -o src/generated -c @hey-api/client-fetch && npm run generate:client", + "generate": "openapi-ts && npm run generate:client", "generate:client": "npx tsx scripts/generate-client.ts", - "build": "tsup src/index.ts --format cjs,esm --dts --clean", - "dev": "tsup src/index.ts --format cjs,esm --dts --watch", + "build": "tsdown src/index.ts --format cjs,esm --dts --clean", + "dev": "tsdown src/index.ts --format cjs,esm --dts --watch", "lint": "eslint src", "typecheck": "tsc --noEmit", "test": "vitest run", @@ -69,13 +69,12 @@ "node": ">=18" }, "devDependencies": { - "@hey-api/client-fetch": "^0.6.0", - "@hey-api/openapi-ts": "^0.61.0", + "@hey-api/openapi-ts": "^0.97.2", "@types/node": "^20.11.0", "@typescript-eslint/eslint-plugin": "^7.18.0", "@typescript-eslint/parser": "^7.18.0", "eslint": "^8.56.0", - "tsup": "^8.0.1", + "tsdown": "^0.22.0", "tsx": "^4.7.0", "typescript": "^5.3.3", "vitest": "^1.2.0", diff --git a/scripts/generate-client.ts b/scripts/generate-client.ts index e2b4238..716764c 100644 --- a/scripts/generate-client.ts +++ b/scripts/generate-client.ts @@ -190,8 +190,8 @@ function generateClientCode(namespaces: Map): string { allFunctions.sort(); // Generate imports - const imports = `import { - client, + const imports = `import { client } from './generated/client.gen'; +import { ${allFunctions.map(f => ` ${f},`).join('\n')} } from './generated/sdk.gen'; diff --git a/src/client.ts b/src/client.ts index f4d24d1..9d52cef 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1,5 +1,5 @@ +import { client } from './generated/client.gen'; import { - client, activateSequence, addBroadcastRecipients, addConversionAssociations, diff --git a/src/generated/client.gen.ts b/src/generated/client.gen.ts new file mode 100644 index 0000000..6fd0139 --- /dev/null +++ b/src/generated/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type ClientOptions, type Config, createClient, createConfig } from './client'; +import type { ClientOptions as ClientOptions2 } from './types.gen'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ baseUrl: 'https://zernio.com/api' })); diff --git a/src/generated/client/client.gen.ts b/src/generated/client/client.gen.ts new file mode 100644 index 0000000..fc3f037 --- /dev/null +++ b/src/generated/client/client.gen.ts @@ -0,0 +1,277 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { createSseClient } from '../core/serverSentEvents.gen'; +import type { HttpMethod } from '../core/types.gen'; +import { getValidRequestBody } from '../core/utils.gen'; +import type { Client, Config, RequestOptions, ResolvedRequestOptions } from './types.gen'; +import { + buildUrl, + createConfig, + createInterceptors, + getParseAs, + mergeConfigs, + mergeHeaders, + setAuthParams, +} from './utils.gen'; + +type ReqInit = Omit & { + body?: any; + headers: ReturnType; +}; + +export const createClient = (config: Config = {}): Client => { + let _config = mergeConfigs(createConfig(), config); + + const getConfig = (): Config => ({ ..._config }); + + const setConfig = (config: Config): Config => { + _config = mergeConfigs(_config, config); + return getConfig(); + }; + + const interceptors = createInterceptors(); + + const beforeRequest = async < + TData = unknown, + TResponseStyle extends 'data' | 'fields' = 'fields', + ThrowOnError extends boolean = boolean, + Url extends string = string, + >( + options: RequestOptions, + ) => { + const opts = { + ..._config, + ...options, + fetch: options.fetch ?? _config.fetch ?? globalThis.fetch, + headers: mergeHeaders(_config.headers, options.headers), + serializedBody: undefined as string | undefined, + }; + + if (opts.security) { + await setAuthParams(opts); + } + + if (opts.requestValidator) { + await opts.requestValidator(opts); + } + + if (opts.body !== undefined && opts.bodySerializer) { + opts.serializedBody = opts.bodySerializer(opts.body) as string | undefined; + } + + // remove Content-Type header if body is empty to avoid sending invalid requests + if (opts.body === undefined || opts.serializedBody === '') { + opts.headers.delete('Content-Type'); + } + + const resolvedOpts = opts as typeof opts & + ResolvedRequestOptions; + const url = buildUrl(resolvedOpts); + + return { opts: resolvedOpts, url }; + }; + + const request: Client['request'] = async (options) => { + const throwOnError = options.throwOnError ?? _config.throwOnError; + const responseStyle = options.responseStyle ?? _config.responseStyle; + + let request: Request | undefined; + let response: Response | undefined; + + try { + const { opts, url } = await beforeRequest(options); + const requestInit: ReqInit = { + redirect: 'follow', + ...opts, + body: getValidRequestBody(opts), + }; + + request = new Request(url, requestInit); + + for (const fn of interceptors.request.fns) { + if (fn) { + request = await fn(request, opts); + } + } + + // fetch must be assigned here, otherwise it would throw the error: + // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation + const _fetch = opts.fetch!; + + response = await _fetch(request); + + for (const fn of interceptors.response.fns) { + if (fn) { + response = await fn(response, request, opts); + } + } + + const result = { + request, + response, + }; + + if (response.ok) { + const parseAs = + (opts.parseAs === 'auto' + ? getParseAs(response.headers.get('Content-Type')) + : opts.parseAs) ?? 'json'; + + if (response.status === 204 || response.headers.get('Content-Length') === '0') { + let emptyData: any; + switch (parseAs) { + case 'arrayBuffer': + case 'blob': + case 'text': + emptyData = await response[parseAs](); + break; + case 'formData': + emptyData = new FormData(); + break; + case 'stream': + emptyData = response.body; + break; + case 'json': + default: + emptyData = {}; + break; + } + return opts.responseStyle === 'data' + ? emptyData + : { + data: emptyData, + ...result, + }; + } + + let data: any; + switch (parseAs) { + case 'arrayBuffer': + case 'blob': + case 'formData': + case 'text': + data = await response[parseAs](); + break; + case 'json': { + // Some servers return 200 with no Content-Length and empty body. + // response.json() would throw; read as text and parse if non-empty. + const text = await response.text(); + data = text ? JSON.parse(text) : {}; + break; + } + case 'stream': + return opts.responseStyle === 'data' + ? response.body + : { + data: response.body, + ...result, + }; + } + + if (parseAs === 'json') { + if (opts.responseValidator) { + await opts.responseValidator(data); + } + + if (opts.responseTransformer) { + data = await opts.responseTransformer(data); + } + } + + return opts.responseStyle === 'data' + ? data + : { + data, + ...result, + }; + } + + const textError = await response.text(); + let jsonError: unknown; + + try { + jsonError = JSON.parse(textError); + } catch { + // noop + } + + throw jsonError ?? textError; + } catch (error) { + let finalError = error; + + for (const fn of interceptors.error.fns) { + if (fn) { + finalError = await fn(finalError, response, request, options as ResolvedRequestOptions); + } + } + + finalError = finalError || {}; + + if (throwOnError) { + throw finalError; + } + + // TODO: we probably want to return error and improve types + return responseStyle === 'data' + ? undefined + : { + error: finalError, + request, + response, + }; + } + }; + + const makeMethodFn = (method: Uppercase) => (options: RequestOptions) => + request({ ...options, method }); + + const makeSseFn = (method: Uppercase) => async (options: RequestOptions) => { + const { opts, url } = await beforeRequest(options); + return createSseClient({ + ...opts, + body: opts.body as BodyInit | null | undefined, + method, + onRequest: async (url, init) => { + let request = new Request(url, init); + for (const fn of interceptors.request.fns) { + if (fn) { + request = await fn(request, opts); + } + } + return request; + }, + serializedBody: getValidRequestBody(opts) as BodyInit | null | undefined, + url, + }); + }; + + const _buildUrl: Client['buildUrl'] = (options) => buildUrl({ ..._config, ...options }); + + return { + buildUrl: _buildUrl, + connect: makeMethodFn('CONNECT'), + delete: makeMethodFn('DELETE'), + get: makeMethodFn('GET'), + getConfig, + head: makeMethodFn('HEAD'), + interceptors, + options: makeMethodFn('OPTIONS'), + patch: makeMethodFn('PATCH'), + post: makeMethodFn('POST'), + put: makeMethodFn('PUT'), + request, + setConfig, + sse: { + connect: makeSseFn('CONNECT'), + delete: makeSseFn('DELETE'), + get: makeSseFn('GET'), + head: makeSseFn('HEAD'), + options: makeSseFn('OPTIONS'), + patch: makeSseFn('PATCH'), + post: makeSseFn('POST'), + put: makeSseFn('PUT'), + trace: makeSseFn('TRACE'), + }, + trace: makeMethodFn('TRACE'), + } as Client; +}; diff --git a/src/generated/client/index.ts b/src/generated/client/index.ts new file mode 100644 index 0000000..b295ede --- /dev/null +++ b/src/generated/client/index.ts @@ -0,0 +1,25 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type { Auth } from '../core/auth.gen'; +export type { QuerySerializerOptions } from '../core/bodySerializer.gen'; +export { + formDataBodySerializer, + jsonBodySerializer, + urlSearchParamsBodySerializer, +} from '../core/bodySerializer.gen'; +export { buildClientParams } from '../core/params.gen'; +export { serializeQueryKeyValue } from '../core/queryKeySerializer.gen'; +export { createClient } from './client.gen'; +export type { + Client, + ClientOptions, + Config, + CreateClientConfig, + Options, + RequestOptions, + RequestResult, + ResolvedRequestOptions, + ResponseStyle, + TDataShape, +} from './types.gen'; +export { createConfig, mergeHeaders } from './utils.gen'; diff --git a/src/generated/client/types.gen.ts b/src/generated/client/types.gen.ts new file mode 100644 index 0000000..4b288a5 --- /dev/null +++ b/src/generated/client/types.gen.ts @@ -0,0 +1,217 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Auth } from '../core/auth.gen'; +import type { + ServerSentEventsOptions, + ServerSentEventsResult, +} from '../core/serverSentEvents.gen'; +import type { Client as CoreClient, Config as CoreConfig } from '../core/types.gen'; +import type { Middleware } from './utils.gen'; + +export type ResponseStyle = 'data' | 'fields'; + +export interface Config + extends Omit, CoreConfig { + /** + * Base URL for all requests made by this client. + */ + baseUrl?: T['baseUrl']; + /** + * Fetch API implementation. You can use this option to provide a custom + * fetch instance. + * + * @default globalThis.fetch + */ + fetch?: typeof fetch; + /** + * Please don't use the Fetch client for Next.js applications. The `next` + * options won't have any effect. + * + * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead. + */ + next?: never; + /** + * Return the response data parsed in a specified format. By default, `auto` + * will infer the appropriate method from the `Content-Type` response header. + * You can override this behavior with any of the {@link Body} methods. + * Select `stream` if you don't want to parse response data at all. + * + * @default 'auto' + */ + parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text'; + /** + * Should we return only data or multiple fields (data, error, response, etc.)? + * + * @default 'fields' + */ + responseStyle?: ResponseStyle; + /** + * Throw an error instead of returning it in the response? + * + * @default false + */ + throwOnError?: T['throwOnError']; +} + +export interface RequestOptions< + TData = unknown, + TResponseStyle extends ResponseStyle = 'fields', + ThrowOnError extends boolean = boolean, + Url extends string = string, +> + extends + Config<{ + responseStyle: TResponseStyle; + throwOnError: ThrowOnError; + }>, + Pick< + ServerSentEventsOptions, + | 'onRequest' + | 'onSseError' + | 'onSseEvent' + | 'sseDefaultRetryDelay' + | 'sseMaxRetryAttempts' + | 'sseMaxRetryDelay' + > { + /** + * Any body that you want to add to your request. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} + */ + body?: unknown; + path?: Record; + query?: Record; + /** + * Security mechanism(s) to use for the request. + */ + security?: ReadonlyArray; + url: Url; +} + +export interface ResolvedRequestOptions< + TResponseStyle extends ResponseStyle = 'fields', + ThrowOnError extends boolean = boolean, + Url extends string = string, +> extends RequestOptions { + headers: Headers; + serializedBody?: string; +} + +export type RequestResult< + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = boolean, + TResponseStyle extends ResponseStyle = 'fields', +> = ThrowOnError extends true + ? Promise< + TResponseStyle extends 'data' + ? TData extends Record + ? TData[keyof TData] + : TData + : { + data: TData extends Record ? TData[keyof TData] : TData; + request: Request; + response: Response; + } + > + : Promise< + TResponseStyle extends 'data' + ? (TData extends Record ? TData[keyof TData] : TData) | undefined + : ( + | { + data: TData extends Record ? TData[keyof TData] : TData; + error: undefined; + } + | { + data: undefined; + error: TError extends Record ? TError[keyof TError] : TError; + } + ) & { + /** request may be undefined, because error may be from building the request object itself */ + request?: Request; + /** response may be undefined, because error may be from building the request object itself or from a network error */ + response?: Response; + } + >; + +export interface ClientOptions { + baseUrl?: string; + responseStyle?: ResponseStyle; + throwOnError?: boolean; +} + +type MethodFn = < + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = false, + TResponseStyle extends ResponseStyle = 'fields', +>( + options: Omit, 'method'>, +) => RequestResult; + +type SseFn = < + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = false, + TResponseStyle extends ResponseStyle = 'fields', +>( + options: Omit, 'method'>, +) => Promise>; + +type RequestFn = < + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = false, + TResponseStyle extends ResponseStyle = 'fields', +>( + options: Omit, 'method'> & + Pick>, 'method'>, +) => RequestResult; + +type BuildUrlFn = < + TData extends { + body?: unknown; + path?: Record; + query?: Record; + url: string; + }, +>( + options: TData & Options, +) => string; + +export type Client = CoreClient & { + interceptors: Middleware; +}; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = ( + override?: Config, +) => Config & T>; + +export interface TDataShape { + body?: unknown; + headers?: unknown; + path?: unknown; + query?: unknown; + url: string; +} + +type OmitKeys = Pick>; + +export type Options< + TData extends TDataShape = TDataShape, + ThrowOnError extends boolean = boolean, + TResponse = unknown, + TResponseStyle extends ResponseStyle = 'fields', +> = OmitKeys< + RequestOptions, + 'body' | 'path' | 'query' | 'url' +> & + ([TData] extends [never] ? unknown : Omit); diff --git a/src/generated/client/utils.gen.ts b/src/generated/client/utils.gen.ts new file mode 100644 index 0000000..7800fe4 --- /dev/null +++ b/src/generated/client/utils.gen.ts @@ -0,0 +1,316 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { getAuthToken } from '../core/auth.gen'; +import type { QuerySerializerOptions } from '../core/bodySerializer.gen'; +import { jsonBodySerializer } from '../core/bodySerializer.gen'; +import { + serializeArrayParam, + serializeObjectParam, + serializePrimitiveParam, +} from '../core/pathSerializer.gen'; +import { getUrl } from '../core/utils.gen'; +import type { Client, ClientOptions, Config, RequestOptions } from './types.gen'; + +export const createQuerySerializer = ({ + parameters = {}, + ...args +}: QuerySerializerOptions = {}) => { + const querySerializer = (queryParams: T) => { + const search: string[] = []; + if (queryParams && typeof queryParams === 'object') { + for (const name in queryParams) { + const value = queryParams[name]; + + if (value === undefined || value === null) { + continue; + } + + const options = parameters[name] || args; + + if (Array.isArray(value)) { + const serializedArray = serializeArrayParam({ + allowReserved: options.allowReserved, + explode: true, + name, + style: 'form', + value, + ...options.array, + }); + if (serializedArray) search.push(serializedArray); + } else if (typeof value === 'object') { + const serializedObject = serializeObjectParam({ + allowReserved: options.allowReserved, + explode: true, + name, + style: 'deepObject', + value: value as Record, + ...options.object, + }); + if (serializedObject) search.push(serializedObject); + } else { + const serializedPrimitive = serializePrimitiveParam({ + allowReserved: options.allowReserved, + name, + value: value as string, + }); + if (serializedPrimitive) search.push(serializedPrimitive); + } + } + } + return search.join('&'); + }; + return querySerializer; +}; + +/** + * Infers parseAs value from provided Content-Type header. + */ +export const getParseAs = (contentType: string | null): Exclude => { + if (!contentType) { + // If no Content-Type header is provided, the best we can do is return the raw response body, + // which is effectively the same as the 'stream' option. + return 'stream'; + } + + const cleanContent = contentType.split(';')[0]?.trim(); + + if (!cleanContent) { + return; + } + + if (cleanContent.startsWith('application/json') || cleanContent.endsWith('+json')) { + return 'json'; + } + + if (cleanContent === 'multipart/form-data') { + return 'formData'; + } + + if ( + ['application/', 'audio/', 'image/', 'video/'].some((type) => cleanContent.startsWith(type)) + ) { + return 'blob'; + } + + if (cleanContent.startsWith('text/')) { + return 'text'; + } + + return; +}; + +const checkForExistence = ( + options: Pick & { + headers: Headers; + }, + name?: string, +): boolean => { + if (!name) { + return false; + } + if ( + options.headers.has(name) || + options.query?.[name] || + options.headers.get('Cookie')?.includes(`${name}=`) + ) { + return true; + } + return false; +}; + +export async function setAuthParams( + options: Pick & { + headers: Headers; + }, +): Promise { + for (const auth of options.security ?? []) { + if (checkForExistence(options, auth.name)) { + continue; + } + + const token = await getAuthToken(auth, options.auth); + + if (!token) { + continue; + } + + const name = auth.name ?? 'Authorization'; + + switch (auth.in) { + case 'query': + if (!options.query) { + options.query = {}; + } + options.query[name] = token; + break; + case 'cookie': + options.headers.append('Cookie', `${name}=${token}`); + break; + case 'header': + default: + options.headers.set(name, token); + break; + } + } +} + +export const buildUrl: Client['buildUrl'] = (options) => + getUrl({ + baseUrl: options.baseUrl as string, + path: options.path, + query: options.query, + querySerializer: + typeof options.querySerializer === 'function' + ? options.querySerializer + : createQuerySerializer(options.querySerializer), + url: options.url, + }); + +export const mergeConfigs = (a: Config, b: Config): Config => { + const config = { ...a, ...b }; + if (config.baseUrl?.endsWith('/')) { + config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1); + } + config.headers = mergeHeaders(a.headers, b.headers); + return config; +}; + +const headersEntries = (headers: Headers): Array<[string, string]> => { + const entries: Array<[string, string]> = []; + headers.forEach((value, key) => { + entries.push([key, value]); + }); + return entries; +}; + +export const mergeHeaders = ( + ...headers: Array['headers'] | undefined> +): Headers => { + const mergedHeaders = new Headers(); + for (const header of headers) { + if (!header) { + continue; + } + + const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header); + + for (const [key, value] of iterator) { + if (value === null) { + mergedHeaders.delete(key); + } else if (Array.isArray(value)) { + for (const v of value) { + mergedHeaders.append(key, v as string); + } + } else if (value !== undefined) { + // assume object headers are meant to be JSON stringified, i.e., their + // content value in OpenAPI specification is 'application/json' + mergedHeaders.set( + key, + typeof value === 'object' ? JSON.stringify(value) : (value as string), + ); + } + } + } + return mergedHeaders; +}; + +type ErrInterceptor = ( + error: Err, + /** response may be undefined due to a network error where no response object is produced */ + response: Res | undefined, + /** request may be undefined, because error may be from building the request object itself */ + request: Req | undefined, + options: Options, +) => Err | Promise; + +type ReqInterceptor = (request: Req, options: Options) => Req | Promise; + +type ResInterceptor = ( + response: Res, + request: Req, + options: Options, +) => Res | Promise; + +class Interceptors { + fns: Array = []; + + clear(): void { + this.fns = []; + } + + eject(id: number | Interceptor): void { + const index = this.getInterceptorIndex(id); + if (this.fns[index]) { + this.fns[index] = null; + } + } + + exists(id: number | Interceptor): boolean { + const index = this.getInterceptorIndex(id); + return Boolean(this.fns[index]); + } + + getInterceptorIndex(id: number | Interceptor): number { + if (typeof id === 'number') { + return this.fns[id] ? id : -1; + } + return this.fns.indexOf(id); + } + + update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false { + const index = this.getInterceptorIndex(id); + if (this.fns[index]) { + this.fns[index] = fn; + return id; + } + return false; + } + + use(fn: Interceptor): number { + this.fns.push(fn); + return this.fns.length - 1; + } +} + +export interface Middleware { + error: Interceptors>; + request: Interceptors>; + response: Interceptors>; +} + +export const createInterceptors = (): Middleware< + Req, + Res, + Err, + Options +> => ({ + error: new Interceptors>(), + request: new Interceptors>(), + response: new Interceptors>(), +}); + +const defaultQuerySerializer = createQuerySerializer({ + allowReserved: false, + array: { + explode: true, + style: 'form', + }, + object: { + explode: true, + style: 'deepObject', + }, +}); + +const defaultHeaders = { + 'Content-Type': 'application/json', +}; + +export const createConfig = ( + override: Config & T> = {}, +): Config & T> => ({ + ...jsonBodySerializer, + headers: defaultHeaders, + parseAs: 'auto', + querySerializer: defaultQuerySerializer, + ...override, +}); diff --git a/src/generated/core/auth.gen.ts b/src/generated/core/auth.gen.ts new file mode 100644 index 0000000..3ebf994 --- /dev/null +++ b/src/generated/core/auth.gen.ts @@ -0,0 +1,41 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type AuthToken = string | undefined; + +export interface Auth { + /** + * Which part of the request do we use to send the auth? + * + * @default 'header' + */ + in?: 'header' | 'query' | 'cookie'; + /** + * Header or query parameter name. + * + * @default 'Authorization' + */ + name?: string; + scheme?: 'basic' | 'bearer'; + type: 'apiKey' | 'http'; +} + +export const getAuthToken = async ( + auth: Auth, + callback: ((auth: Auth) => Promise | AuthToken) | AuthToken, +): Promise => { + const token = typeof callback === 'function' ? await callback(auth) : callback; + + if (!token) { + return; + } + + if (auth.scheme === 'bearer') { + return `Bearer ${token}`; + } + + if (auth.scheme === 'basic') { + return `Basic ${btoa(token)}`; + } + + return token; +}; diff --git a/src/generated/core/bodySerializer.gen.ts b/src/generated/core/bodySerializer.gen.ts new file mode 100644 index 0000000..67daca6 --- /dev/null +++ b/src/generated/core/bodySerializer.gen.ts @@ -0,0 +1,82 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ArrayStyle, ObjectStyle, SerializerOptions } from './pathSerializer.gen'; + +export type QuerySerializer = (query: Record) => string; + +export type BodySerializer = (body: unknown) => unknown; + +type QuerySerializerOptionsObject = { + allowReserved?: boolean; + array?: Partial>; + object?: Partial>; +}; + +export type QuerySerializerOptions = QuerySerializerOptionsObject & { + /** + * Per-parameter serialization overrides. When provided, these settings + * override the global array/object settings for specific parameter names. + */ + parameters?: Record; +}; + +const serializeFormDataPair = (data: FormData, key: string, value: unknown): void => { + if (typeof value === 'string' || value instanceof Blob) { + data.append(key, value); + } else if (value instanceof Date) { + data.append(key, value.toISOString()); + } else { + data.append(key, JSON.stringify(value)); + } +}; + +const serializeUrlSearchParamsPair = (data: URLSearchParams, key: string, value: unknown): void => { + if (typeof value === 'string') { + data.append(key, value); + } else { + data.append(key, JSON.stringify(value)); + } +}; + +export const formDataBodySerializer = { + bodySerializer: (body: unknown): FormData => { + const data = new FormData(); + + Object.entries(body as Record).forEach(([key, value]) => { + if (value === undefined || value === null) { + return; + } + if (Array.isArray(value)) { + value.forEach((v) => serializeFormDataPair(data, key, v)); + } else { + serializeFormDataPair(data, key, value); + } + }); + + return data; + }, +}; + +export const jsonBodySerializer = { + bodySerializer: (body: unknown): string => + JSON.stringify(body, (_key, value) => (typeof value === 'bigint' ? value.toString() : value)), +}; + +export const urlSearchParamsBodySerializer = { + bodySerializer: (body: unknown): string => { + const data = new URLSearchParams(); + + Object.entries(body as Record).forEach(([key, value]) => { + if (value === undefined || value === null) { + return; + } + if (Array.isArray(value)) { + value.forEach((v) => serializeUrlSearchParamsPair(data, key, v)); + } else { + serializeUrlSearchParamsPair(data, key, value); + } + }); + + return data.toString(); + }, +}; diff --git a/src/generated/core/params.gen.ts b/src/generated/core/params.gen.ts new file mode 100644 index 0000000..7955601 --- /dev/null +++ b/src/generated/core/params.gen.ts @@ -0,0 +1,169 @@ +// This file is auto-generated by @hey-api/openapi-ts + +type Slot = 'body' | 'headers' | 'path' | 'query'; + +export type Field = + | { + in: Exclude; + /** + * Field name. This is the name we want the user to see and use. + */ + key: string; + /** + * Field mapped name. This is the name we want to use in the request. + * If omitted, we use the same value as `key`. + */ + map?: string; + } + | { + in: Extract; + /** + * Key isn't required for bodies. + */ + key?: string; + map?: string; + } + | { + /** + * Field name. This is the name we want the user to see and use. + */ + key: string; + /** + * Field mapped name. This is the name we want to use in the request. + * If `in` is omitted, `map` aliases `key` to the transport layer. + */ + map: Slot; + }; + +export interface Fields { + allowExtra?: Partial>; + args?: ReadonlyArray; +} + +export type FieldsConfig = ReadonlyArray; + +const extraPrefixesMap: Record = { + $body_: 'body', + $headers_: 'headers', + $path_: 'path', + $query_: 'query', +}; +const extraPrefixes = Object.entries(extraPrefixesMap); + +type KeyMap = Map< + string, + | { + in: Slot; + map?: string; + } + | { + in?: never; + map: Slot; + } +>; + +const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { + if (!map) { + map = new Map(); + } + + for (const config of fields) { + if ('in' in config) { + if (config.key) { + map.set(config.key, { + in: config.in, + map: config.map, + }); + } + } else if ('key' in config) { + map.set(config.key, { + map: config.map, + }); + } else if (config.args) { + buildKeyMap(config.args, map); + } + } + + return map; +}; + +interface Params { + body: unknown; + headers: Record; + path: Record; + query: Record; +} + +const stripEmptySlots = (params: Params) => { + for (const [slot, value] of Object.entries(params)) { + if (value && typeof value === 'object' && !Array.isArray(value) && !Object.keys(value).length) { + delete params[slot as Slot]; + } + } +}; + +export const buildClientParams = (args: ReadonlyArray, fields: FieldsConfig) => { + const params: Params = { + body: {}, + headers: {}, + path: {}, + query: {}, + }; + + const map = buildKeyMap(fields); + + let config: FieldsConfig[number] | undefined; + + for (const [index, arg] of args.entries()) { + if (fields[index]) { + config = fields[index]; + } + + if (!config) { + continue; + } + + if ('in' in config) { + if (config.key) { + const field = map.get(config.key)!; + const name = field.map || config.key; + if (field.in) { + (params[field.in] as Record)[name] = arg; + } + } else { + params.body = arg; + } + } else { + for (const [key, value] of Object.entries(arg ?? {})) { + const field = map.get(key); + + if (field) { + if (field.in) { + const name = field.map || key; + (params[field.in] as Record)[name] = value; + } else { + params[field.map] = value; + } + } else { + const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix)); + + if (extra) { + const [prefix, slot] = extra; + (params[slot] as Record)[key.slice(prefix.length)] = value; + } else if ('allowExtra' in config && config.allowExtra) { + for (const [slot, allowed] of Object.entries(config.allowExtra)) { + if (allowed) { + (params[slot as Slot] as Record)[key] = value; + break; + } + } + } + } + } + } + } + + stripEmptySlots(params); + + return params; +}; diff --git a/src/generated/core/pathSerializer.gen.ts b/src/generated/core/pathSerializer.gen.ts new file mode 100644 index 0000000..994b284 --- /dev/null +++ b/src/generated/core/pathSerializer.gen.ts @@ -0,0 +1,171 @@ +// This file is auto-generated by @hey-api/openapi-ts + +interface SerializeOptions extends SerializePrimitiveOptions, SerializerOptions {} + +interface SerializePrimitiveOptions { + allowReserved?: boolean; + name: string; +} + +export interface SerializerOptions { + /** + * @default true + */ + explode: boolean; + style: T; +} + +export type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; +export type ArraySeparatorStyle = ArrayStyle | MatrixStyle; +type MatrixStyle = 'label' | 'matrix' | 'simple'; +export type ObjectStyle = 'form' | 'deepObject'; +type ObjectSeparatorStyle = ObjectStyle | MatrixStyle; + +interface SerializePrimitiveParam extends SerializePrimitiveOptions { + value: string; +} + +export const separatorArrayExplode = (style: ArraySeparatorStyle) => { + switch (style) { + case 'label': + return '.'; + case 'matrix': + return ';'; + case 'simple': + return ','; + default: + return '&'; + } +}; + +export const separatorArrayNoExplode = (style: ArraySeparatorStyle) => { + switch (style) { + case 'form': + return ','; + case 'pipeDelimited': + return '|'; + case 'spaceDelimited': + return '%20'; + default: + return ','; + } +}; + +export const separatorObjectExplode = (style: ObjectSeparatorStyle) => { + switch (style) { + case 'label': + return '.'; + case 'matrix': + return ';'; + case 'simple': + return ','; + default: + return '&'; + } +}; + +export const serializeArrayParam = ({ + allowReserved, + explode, + name, + style, + value, +}: SerializeOptions & { + value: unknown[]; +}) => { + if (!explode) { + const joinedValues = ( + allowReserved ? value : value.map((v) => encodeURIComponent(v as string)) + ).join(separatorArrayNoExplode(style)); + switch (style) { + case 'label': + return `.${joinedValues}`; + case 'matrix': + return `;${name}=${joinedValues}`; + case 'simple': + return joinedValues; + default: + return `${name}=${joinedValues}`; + } + } + + const separator = separatorArrayExplode(style); + const joinedValues = value + .map((v) => { + if (style === 'label' || style === 'simple') { + return allowReserved ? v : encodeURIComponent(v as string); + } + + return serializePrimitiveParam({ + allowReserved, + name, + value: v as string, + }); + }) + .join(separator); + return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues; +}; + +export const serializePrimitiveParam = ({ + allowReserved, + name, + value, +}: SerializePrimitiveParam) => { + if (value === undefined || value === null) { + return ''; + } + + if (typeof value === 'object') { + throw new Error( + 'Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.', + ); + } + + return `${name}=${allowReserved ? value : encodeURIComponent(value)}`; +}; + +export const serializeObjectParam = ({ + allowReserved, + explode, + name, + style, + value, + valueOnly, +}: SerializeOptions & { + value: Record | Date; + valueOnly?: boolean; +}) => { + if (value instanceof Date) { + return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`; + } + + if (style !== 'deepObject' && !explode) { + let values: string[] = []; + Object.entries(value).forEach(([key, v]) => { + values = [...values, key, allowReserved ? (v as string) : encodeURIComponent(v as string)]; + }); + const joinedValues = values.join(','); + switch (style) { + case 'form': + return `${name}=${joinedValues}`; + case 'label': + return `.${joinedValues}`; + case 'matrix': + return `;${name}=${joinedValues}`; + default: + return joinedValues; + } + } + + const separator = separatorObjectExplode(style); + const joinedValues = Object.entries(value) + .map(([key, v]) => + serializePrimitiveParam({ + allowReserved, + name: style === 'deepObject' ? `${name}[${key}]` : key, + value: v as string, + }), + ) + .join(separator); + return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues; +}; diff --git a/src/generated/core/queryKeySerializer.gen.ts b/src/generated/core/queryKeySerializer.gen.ts new file mode 100644 index 0000000..5000df6 --- /dev/null +++ b/src/generated/core/queryKeySerializer.gen.ts @@ -0,0 +1,117 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * JSON-friendly union that mirrors what Pinia Colada can hash. + */ +export type JsonValue = + | null + | string + | number + | boolean + | JsonValue[] + | { [key: string]: JsonValue }; + +/** + * Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes. + */ +export const queryKeyJsonReplacer = (_key: string, value: unknown) => { + if (value === undefined || typeof value === 'function' || typeof value === 'symbol') { + return undefined; + } + if (typeof value === 'bigint') { + return value.toString(); + } + if (value instanceof Date) { + return value.toISOString(); + } + return value; +}; + +/** + * Safely stringifies a value and parses it back into a JsonValue. + */ +export const stringifyToJsonValue = (input: unknown): JsonValue | undefined => { + try { + const json = JSON.stringify(input, queryKeyJsonReplacer); + if (json === undefined) { + return undefined; + } + return JSON.parse(json) as JsonValue; + } catch { + return undefined; + } +}; + +/** + * Detects plain objects (including objects with a null prototype). + */ +const isPlainObject = (value: unknown): value is Record => { + if (value === null || typeof value !== 'object') { + return false; + } + const prototype = Object.getPrototypeOf(value as object); + return prototype === Object.prototype || prototype === null; +}; + +/** + * Turns URLSearchParams into a sorted JSON object for deterministic keys. + */ +const serializeSearchParams = (params: URLSearchParams): JsonValue => { + const entries = Array.from(params.entries()).sort(([a], [b]) => a.localeCompare(b)); + const result: Record = {}; + + for (const [key, value] of entries) { + const existing = result[key]; + if (existing === undefined) { + result[key] = value; + continue; + } + + if (Array.isArray(existing)) { + (existing as string[]).push(value); + } else { + result[key] = [existing, value]; + } + } + + return result; +}; + +/** + * Normalizes any accepted value into a JSON-friendly shape for query keys. + */ +export const serializeQueryKeyValue = (value: unknown): JsonValue | undefined => { + if (value === null) { + return null; + } + + if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') { + return value; + } + + if (value === undefined || typeof value === 'function' || typeof value === 'symbol') { + return undefined; + } + + if (typeof value === 'bigint') { + return value.toString(); + } + + if (value instanceof Date) { + return value.toISOString(); + } + + if (Array.isArray(value)) { + return stringifyToJsonValue(value); + } + + if (typeof URLSearchParams !== 'undefined' && value instanceof URLSearchParams) { + return serializeSearchParams(value); + } + + if (isPlainObject(value)) { + return stringifyToJsonValue(value); + } + + return undefined; +}; diff --git a/src/generated/core/serverSentEvents.gen.ts b/src/generated/core/serverSentEvents.gen.ts new file mode 100644 index 0000000..ddf3c4d --- /dev/null +++ b/src/generated/core/serverSentEvents.gen.ts @@ -0,0 +1,242 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Config } from './types.gen'; + +export type ServerSentEventsOptions = Omit & + Pick & { + /** + * Fetch API implementation. You can use this option to provide a custom + * fetch instance. + * + * @default globalThis.fetch + */ + fetch?: typeof fetch; + /** + * Implementing clients can call request interceptors inside this hook. + */ + onRequest?: (url: string, init: RequestInit) => Promise; + /** + * Callback invoked when a network or parsing error occurs during streaming. + * + * This option applies only if the endpoint returns a stream of events. + * + * @param error The error that occurred. + */ + onSseError?: (error: unknown) => void; + /** + * Callback invoked when an event is streamed from the server. + * + * This option applies only if the endpoint returns a stream of events. + * + * @param event Event streamed from the server. + * @returns Nothing (void). + */ + onSseEvent?: (event: StreamEvent) => void; + serializedBody?: RequestInit['body']; + /** + * Default retry delay in milliseconds. + * + * This option applies only if the endpoint returns a stream of events. + * + * @default 3000 + */ + sseDefaultRetryDelay?: number; + /** + * Maximum number of retry attempts before giving up. + */ + sseMaxRetryAttempts?: number; + /** + * Maximum retry delay in milliseconds. + * + * Applies only when exponential backoff is used. + * + * This option applies only if the endpoint returns a stream of events. + * + * @default 30000 + */ + sseMaxRetryDelay?: number; + /** + * Optional sleep function for retry backoff. + * + * Defaults to using `setTimeout`. + */ + sseSleepFn?: (ms: number) => Promise; + url: string; + }; + +export interface StreamEvent { + data: TData; + event?: string; + id?: string; + retry?: number; +} + +export type ServerSentEventsResult = { + stream: AsyncGenerator< + TData extends Record ? TData[keyof TData] : TData, + TReturn, + TNext + >; +}; + +export function createSseClient({ + onRequest, + onSseError, + onSseEvent, + responseTransformer, + responseValidator, + sseDefaultRetryDelay, + sseMaxRetryAttempts, + sseMaxRetryDelay, + sseSleepFn, + url, + ...options +}: ServerSentEventsOptions): ServerSentEventsResult { + let lastEventId: string | undefined; + + const sleep = sseSleepFn ?? ((ms: number) => new Promise((resolve) => setTimeout(resolve, ms))); + + const createStream = async function* () { + let retryDelay: number = sseDefaultRetryDelay ?? 3000; + let attempt = 0; + const signal = options.signal ?? new AbortController().signal; + + while (true) { + if (signal.aborted) break; + + attempt++; + + const headers = + options.headers instanceof Headers + ? options.headers + : new Headers(options.headers as Record | undefined); + + if (lastEventId !== undefined) { + headers.set('Last-Event-ID', lastEventId); + } + + try { + const requestInit: RequestInit = { + redirect: 'follow', + ...options, + body: options.serializedBody, + headers, + signal, + }; + let request = new Request(url, requestInit); + if (onRequest) { + request = await onRequest(url, requestInit); + } + // fetch must be assigned here, otherwise it would throw the error: + // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation + const _fetch = options.fetch ?? globalThis.fetch; + const response = await _fetch(request); + + if (!response.ok) throw new Error(`SSE failed: ${response.status} ${response.statusText}`); + + if (!response.body) throw new Error('No body in SSE response'); + + const reader = response.body.pipeThrough(new TextDecoderStream()).getReader(); + + let buffer = ''; + + const abortHandler = () => { + try { + reader.cancel(); + } catch { + // noop + } + }; + + signal.addEventListener('abort', abortHandler); + + try { + while (true) { + const { done, value } = await reader.read(); + if (done) break; + buffer += value; + buffer = buffer.replace(/\r\n?/g, '\n'); // normalize line endings + + const chunks = buffer.split('\n\n'); + buffer = chunks.pop() ?? ''; + + for (const chunk of chunks) { + const lines = chunk.split('\n'); + const dataLines: Array = []; + let eventName: string | undefined; + + for (const line of lines) { + if (line.startsWith('data:')) { + dataLines.push(line.replace(/^data:\s*/, '')); + } else if (line.startsWith('event:')) { + eventName = line.replace(/^event:\s*/, ''); + } else if (line.startsWith('id:')) { + lastEventId = line.replace(/^id:\s*/, ''); + } else if (line.startsWith('retry:')) { + const parsed = Number.parseInt(line.replace(/^retry:\s*/, ''), 10); + if (!Number.isNaN(parsed)) { + retryDelay = parsed; + } + } + } + + let data: unknown; + let parsedJson = false; + + if (dataLines.length) { + const rawData = dataLines.join('\n'); + try { + data = JSON.parse(rawData); + parsedJson = true; + } catch { + data = rawData; + } + } + + if (parsedJson) { + if (responseValidator) { + await responseValidator(data); + } + + if (responseTransformer) { + data = await responseTransformer(data); + } + } + + onSseEvent?.({ + data, + event: eventName, + id: lastEventId, + retry: retryDelay, + }); + + if (dataLines.length) { + yield data as any; + } + } + } + } finally { + signal.removeEventListener('abort', abortHandler); + reader.releaseLock(); + } + + break; // exit loop on normal completion + } catch (error) { + // connection failed or aborted; retry after delay + onSseError?.(error); + + if (sseMaxRetryAttempts !== undefined && attempt >= sseMaxRetryAttempts) { + break; // stop after firing error + } + + // exponential backoff: double retry each attempt, cap at 30s + const backoff = Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 30000); + await sleep(backoff); + } + } + }; + + const stream = createStream(); + + return { stream }; +} diff --git a/src/generated/core/types.gen.ts b/src/generated/core/types.gen.ts new file mode 100644 index 0000000..9efe71d --- /dev/null +++ b/src/generated/core/types.gen.ts @@ -0,0 +1,104 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Auth, AuthToken } from './auth.gen'; +import type { BodySerializer, QuerySerializer, QuerySerializerOptions } from './bodySerializer.gen'; + +export type HttpMethod = + | 'connect' + | 'delete' + | 'get' + | 'head' + | 'options' + | 'patch' + | 'post' + | 'put' + | 'trace'; + +export type Client< + RequestFn = never, + Config = unknown, + MethodFn = never, + BuildUrlFn = never, + SseFn = never, +> = { + /** + * Returns the final request URL. + */ + buildUrl: BuildUrlFn; + getConfig: () => Config; + request: RequestFn; + setConfig: (config: Config) => Config; +} & { + [K in HttpMethod]: MethodFn; +} & ([SseFn] extends [never] ? { sse?: never } : { sse: { [K in HttpMethod]: SseFn } }); + +export interface Config { + /** + * Auth token or a function returning auth token. The resolved value will be + * added to the request payload as defined by its `security` array. + */ + auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; + /** + * A function for serializing request body parameter. By default, + * {@link JSON.stringify()} will be used. + */ + bodySerializer?: BodySerializer | null; + /** + * An object containing any HTTP headers that you want to pre-populate your + * `Headers` object with. + * + * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} + */ + headers?: + | RequestInit['headers'] + | Record< + string, + string | number | boolean | (string | number | boolean)[] | null | undefined | unknown + >; + /** + * The request method. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} + */ + method?: Uppercase; + /** + * A function for serializing request query parameters. By default, arrays + * will be exploded in form style, objects will be exploded in deepObject + * style, and reserved characters are percent-encoded. + * + * This method will have no effect if the native `paramsSerializer()` Axios + * API function is used. + * + * {@link https://swagger.io/docs/specification/serialization/#query View examples} + */ + querySerializer?: QuerySerializer | QuerySerializerOptions; + /** + * A function validating request data. This is useful if you want to ensure + * the request conforms to the desired shape, so it can be safely sent to + * the server. + */ + requestValidator?: (data: unknown) => Promise; + /** + * A function transforming response data before it's returned. This is useful + * for post-processing data, e.g., converting ISO strings into Date objects. + */ + responseTransformer?: (data: unknown) => Promise; + /** + * A function validating response data. This is useful if you want to ensure + * the response conforms to the desired shape, so it can be safely passed to + * the transformers and returned to the user. + */ + responseValidator?: (data: unknown) => Promise; +} + +type IsExactlyNeverOrNeverUndefined = [T] extends [never] + ? true + : [T] extends [never | undefined] + ? [undefined] extends [T] + ? false + : true + : false; + +export type OmitNever> = { + [K in keyof T as IsExactlyNeverOrNeverUndefined extends true ? never : K]: T[K]; +}; diff --git a/src/generated/core/utils.gen.ts b/src/generated/core/utils.gen.ts new file mode 100644 index 0000000..9a4fec7 --- /dev/null +++ b/src/generated/core/utils.gen.ts @@ -0,0 +1,140 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { BodySerializer, QuerySerializer } from './bodySerializer.gen'; +import { + type ArraySeparatorStyle, + serializeArrayParam, + serializeObjectParam, + serializePrimitiveParam, +} from './pathSerializer.gen'; + +export interface PathSerializer { + path: Record; + url: string; +} + +export const PATH_PARAM_RE = /\{[^{}]+\}/g; + +export const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => { + let url = _url; + const matches = _url.match(PATH_PARAM_RE); + if (matches) { + for (const match of matches) { + let explode = false; + let name = match.substring(1, match.length - 1); + let style: ArraySeparatorStyle = 'simple'; + + if (name.endsWith('*')) { + explode = true; + name = name.substring(0, name.length - 1); + } + + if (name.startsWith('.')) { + name = name.substring(1); + style = 'label'; + } else if (name.startsWith(';')) { + name = name.substring(1); + style = 'matrix'; + } + + const value = path[name]; + + if (value === undefined || value === null) { + continue; + } + + if (Array.isArray(value)) { + url = url.replace(match, serializeArrayParam({ explode, name, style, value })); + continue; + } + + if (typeof value === 'object') { + url = url.replace( + match, + serializeObjectParam({ + explode, + name, + style, + value: value as Record, + valueOnly: true, + }), + ); + continue; + } + + if (style === 'matrix') { + url = url.replace( + match, + `;${serializePrimitiveParam({ + name, + value: value as string, + })}`, + ); + continue; + } + + const replaceValue = encodeURIComponent( + style === 'label' ? `.${value as string}` : (value as string), + ); + url = url.replace(match, replaceValue); + } + } + return url; +}; + +export const getUrl = ({ + baseUrl, + path, + query, + querySerializer, + url: _url, +}: { + baseUrl?: string; + path?: Record; + query?: Record; + querySerializer: QuerySerializer; + url: string; +}) => { + const pathUrl = _url.startsWith('/') ? _url : `/${_url}`; + let url = (baseUrl ?? '') + pathUrl; + if (path) { + url = defaultPathSerializer({ path, url }); + } + let search = query ? querySerializer(query) : ''; + if (search.startsWith('?')) { + search = search.substring(1); + } + if (search) { + url += `?${search}`; + } + return url; +}; + +export function getValidRequestBody(options: { + body?: unknown; + bodySerializer?: BodySerializer | null; + serializedBody?: unknown; +}) { + const hasBody = options.body !== undefined; + const isSerializedBody = hasBody && options.bodySerializer; + + if (isSerializedBody) { + if ('serializedBody' in options) { + const hasSerializedBody = + options.serializedBody !== undefined && options.serializedBody !== ''; + + return hasSerializedBody ? options.serializedBody : null; + } + + // not all clients implement a serializedBody property (i.e., client-axios) + return options.body !== '' ? options.body : null; + } + + // plain/text body + if (hasBody) { + return options.body; + } + + // no body was provided + return undefined; +} diff --git a/src/generated/index.ts b/src/generated/index.ts index 81abc82..38a0297 100644 --- a/src/generated/index.ts +++ b/src/generated/index.ts @@ -1,3 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './sdk.gen'; -export * from './types.gen'; \ No newline at end of file + +export { activateSequence, addBroadcastRecipients, addConversionAssociations, addMessageReaction, addTrackingTagSharedAccount, addUsersToAdAudience, addWhatsAppGroupParticipants, approveWhatsAppGroupJoinRequests, batchGetGoogleBusinessReviews, bookmarkPost, boostPost, bulkCreateContacts, bulkUpdateAdCampaignStatus, bulkUploadPosts, cancelBroadcast, clearContactFieldValue, completeTelegramConnect, completeWhatsAppPhoneSelection, configureTikTokAdsBrandIdentity, connectAds, connectBlueskyCredentials, connectWhatsAppCredentials, createAccountGroup, createAdAudience, createApiKey, createBroadcast, createCommentAutomation, createContact, createConversionDestination, createCtwaAd, createCustomField, createGoogleBusinessMedia, createGoogleBusinessPlaceAction, createInboxConversation, createInviteToken, createPost, createProfile, createQueueSlot, createSequence, createStandaloneAd, createTrackingTag, createWebhookSettings, createWhatsAppFlow, createWhatsAppGroupChat, createWhatsAppGroupInviteLink, createWhatsAppTemplate, deleteAccount, deleteAccountGroup, deleteAd, deleteAdAudience, deleteAdCampaign, deleteApiKey, deleteBroadcast, deleteCommentAutomation, deleteContact, deleteConversionDestination, deleteCustomField, deleteGoogleBusinessMedia, deleteGoogleBusinessPlaceAction, deleteGoogleBusinessReviewReply, deleteInboxComment, deleteInboxMessage, deleteInboxReviewReply, deleteInstagramIceBreakers, deleteMessengerMenu, deletePost, deleteProfile, deleteQueueSlot, deleteSequence, deleteTelegramCommands, deleteWebhookSettings, deleteWhatsAppFlow, deleteWhatsAppGroupChat, deleteWhatsAppTemplate, deprecateWhatsAppFlow, duplicateAdCampaign, editInboxMessage, editPost, enrollContacts, followUser, getAccountHealth, getAd, getAdAnalytics, getAdAudience, getAdComments, getAdsTimeline, getAdTree, getAllAccountsHealth, getAnalytics, getBestTimeToPost, getBroadcast, getCommentAutomation, getConnectUrl, getContact, getContactChannels, getContentDecay, getConversionDestination, getConversionMetrics, getDailyMetrics, getDiscordChannels, getDiscordSettings, getFacebookPageInsights, getFacebookPages, getFollowerStats, getGmbLocations, getGoogleBusinessAttributes, getGoogleBusinessFoodMenus, getGoogleBusinessLocationDetails, getGoogleBusinessPerformance, getGoogleBusinessReviews, getGoogleBusinessSearchKeywords, getGoogleBusinessServices, getInboxConversation, getInboxConversationMessages, getInboxPostComments, getInstagramAccountInsights, getInstagramDemographics, getInstagramFollowerHistory, getInstagramIceBreakers, getInstagramStoryInsights, getLinkedInAggregateAnalytics, getLinkedInMentions, getLinkedInOrgAggregateAnalytics, getLinkedInOrganizations, getLinkedInPostAnalytics, getLinkedInPostReactions, getMediaPresignedUrl, getMessengerMenu, getNextQueueSlot, getPendingOAuthData, getPinterestBoards, getPost, getPostingFrequency, getPostTimeline, getProfile, getRedditFeed, getRedditFlairs, getRedditSubreddits, getSequence, getTelegramCommands, getTelegramConnectStatus, getTikTokAccountInsights, getTikTokCreatorInfo, getTrackingTag, getTrackingTagStats, getUsageStats, getUser, getWebhookSettings, getWhatsAppBusinessProfile, getWhatsAppDisplayName, getWhatsAppFlow, getWhatsAppFlowJson, getWhatsAppGroupChat, getWhatsAppPhoneNumber, getWhatsAppPhoneNumbers, getWhatsAppTemplate, getWhatsAppTemplates, getXApiPricing, getYouTubeChannelInsights, getYouTubeDailyViews, getYouTubeDemographics, getYoutubePlaylists, handleOAuthCallback, hideInboxComment, initiateTelegramConnect, likeInboxComment, listAccountGroups, listAccounts, listAdAccounts, listAdAudiences, listAdCampaigns, listAds, listAdsBusinessCenters, listApiKeys, listBroadcastRecipients, listBroadcasts, listCommentAutomationLogs, listCommentAutomations, listContacts, listConversionAssociations, listConversionDestinations, listCustomFields, listFacebookPages, listGoogleBusinessLocations, listGoogleBusinessMedia, listGoogleBusinessPlaceActions, listInboxComments, listInboxConversations, listInboxReviews, listInstagramStories, listLinkedInOrganizations, listLogs, listPinterestBoardsForSelection, listPosts, listProfiles, listQueueSlots, listSequenceEnrollments, listSequences, listSnapchatProfiles, listTrackingTags, listTrackingTagSharedAccounts, listUsers, listWhatsAppFlows, listWhatsAppGroupChats, listWhatsAppGroupJoinRequests, listWhatsAppPhoneNumbers, moveAccountToProfile, type Options, pauseSequence, previewQueue, publishWhatsAppFlow, purchaseWhatsAppPhoneNumber, rejectWhatsAppGroupJoinRequests, releaseWhatsAppPhoneNumber, removeBookmark, removeConversionAssociations, removeMessageReaction, removeTrackingTagSharedAccount, removeWhatsAppGroupParticipants, replyToGoogleBusinessReview, replyToInboxPost, replyToInboxReview, retryPost, retweetPost, scheduleBroadcast, searchAdInterests, searchAdTargetingLocations, searchReddit, selectFacebookPage, selectGoogleBusinessLocation, selectLinkedInOrganization, selectPinterestBoard, selectSnapchatProfile, sendBroadcast, sendConversions, sendInboxMessage, sendPrivateReplyToComment, sendTypingIndicator, sendWhatsAppConversion, sendWhatsAppFlowMessage, setContactFieldValue, setInstagramIceBreakers, setMessengerMenu, setTelegramCommands, testWebhook, undoRetweet, unenrollContact, unfollowUser, unhideInboxComment, unlikeInboxComment, unpublishPost, updateAccount, updateAccountGroup, updateAd, updateAdCampaign, updateAdCampaignStatus, updateAdSet, updateAdSetStatus, updateBroadcast, updateCommentAutomation, updateContact, updateConversionDestination, updateCustomField, updateDiscordSettings, updateFacebookPage, updateGmbLocation, updateGoogleBusinessAttributes, updateGoogleBusinessFoodMenus, updateGoogleBusinessLocationDetails, updateGoogleBusinessPlaceAction, updateGoogleBusinessServices, updateInboxConversation, updateLinkedInOrganization, updatePinterestBoards, updatePost, updatePostMetadata, updateProfile, updateQueueSlot, updateRedditSubreddits, updateSequence, updateTrackingTag, updateWebhookSettings, updateWhatsAppBusinessProfile, updateWhatsAppDisplayName, updateWhatsAppFlow, updateWhatsAppGroupChat, updateWhatsAppTemplate, updateYoutubeDefaultPlaylist, uploadMediaDirect, uploadWhatsAppFlowJson, uploadWhatsAppProfilePhoto, validateMedia, validatePost, validatePostLength, validateSubreddit } from './sdk.gen'; +export type { AccountGetResponse, AccountsListResponse, AccountWithFollowerStats, ActivateSequenceData, ActivateSequenceError, ActivateSequenceErrors, ActivateSequenceResponse, ActivateSequenceResponses, Ad, AdBudget, AdCampaign, AddBroadcastRecipientsData, AddBroadcastRecipientsError, AddBroadcastRecipientsErrors, AddBroadcastRecipientsResponse, AddBroadcastRecipientsResponses, AddConversionAssociationsData, AddConversionAssociationsError, AddConversionAssociationsErrors, AddConversionAssociationsResponse, AddConversionAssociationsResponses, AddMessageReactionData, AddMessageReactionError, AddMessageReactionErrors, AddMessageReactionResponse, AddMessageReactionResponses, AddTrackingTagSharedAccountData, AddTrackingTagSharedAccountError, AddTrackingTagSharedAccountErrors, AddTrackingTagSharedAccountResponse, AddTrackingTagSharedAccountResponses, AddUsersToAdAudienceData, AddUsersToAdAudienceError, AddUsersToAdAudienceErrors, AddUsersToAdAudienceResponse, AddUsersToAdAudienceResponses, AddWhatsAppGroupParticipantsData, AddWhatsAppGroupParticipantsError, AddWhatsAppGroupParticipantsErrors, AddWhatsAppGroupParticipantsResponse, AddWhatsAppGroupParticipantsResponses, AdMetrics, AdStatus, AdTreeAdSet, AdTreeCampaign, AnalyticsListResponse, AnalyticsOverview, AnalyticsSinglePostResponse, ApiKey, ApproveWhatsAppGroupJoinRequestsData, ApproveWhatsAppGroupJoinRequestsError, ApproveWhatsAppGroupJoinRequestsErrors, ApproveWhatsAppGroupJoinRequestsResponse, ApproveWhatsAppGroupJoinRequestsResponses, BatchGetGoogleBusinessReviewsData, BatchGetGoogleBusinessReviewsError, BatchGetGoogleBusinessReviewsErrors, BatchGetGoogleBusinessReviewsResponse, BatchGetGoogleBusinessReviewsResponses, BidStrategy, BlueskyPlatformData, BookmarkPostData, BookmarkPostError, BookmarkPostErrors, BookmarkPostResponse, BookmarkPostResponses, BoostPostData, BoostPostError, BoostPostErrors, BoostPostResponse, BoostPostResponses, BulkCreateContactsData, BulkCreateContactsError, BulkCreateContactsErrors, BulkCreateContactsResponse, BulkCreateContactsResponses, BulkUpdateAdCampaignStatusData, BulkUpdateAdCampaignStatusError, BulkUpdateAdCampaignStatusErrors, BulkUpdateAdCampaignStatusResponse, BulkUpdateAdCampaignStatusResponses, BulkUploadPostsData, BulkUploadPostsError, BulkUploadPostsErrors, BulkUploadPostsResponse, BulkUploadPostsResponses, BusinessCenter, CancelBroadcastData, CancelBroadcastError, CancelBroadcastErrors, CancelBroadcastResponse, CancelBroadcastResponses, ClearContactFieldValueData, ClearContactFieldValueError, ClearContactFieldValueErrors, ClearContactFieldValueResponses, ClientOptions, CompleteTelegramConnectData, CompleteTelegramConnectError, CompleteTelegramConnectErrors, CompleteTelegramConnectResponse, CompleteTelegramConnectResponses, CompleteWhatsAppPhoneSelectionData, CompleteWhatsAppPhoneSelectionError, CompleteWhatsAppPhoneSelectionErrors, CompleteWhatsAppPhoneSelectionResponse, CompleteWhatsAppPhoneSelectionResponses, ConfigureTikTokAdsBrandIdentityData, ConfigureTikTokAdsBrandIdentityError, ConfigureTikTokAdsBrandIdentityErrors, ConfigureTikTokAdsBrandIdentityResponse, ConfigureTikTokAdsBrandIdentityResponses, ConnectAdsData, ConnectAdsError, ConnectAdsErrors, ConnectAdsResponse, ConnectAdsResponses, ConnectBlueskyCredentialsData, ConnectBlueskyCredentialsError, ConnectBlueskyCredentialsErrors, ConnectBlueskyCredentialsResponse, ConnectBlueskyCredentialsResponses, ConnectWhatsAppCredentialsData, ConnectWhatsAppCredentialsErrors, ConnectWhatsAppCredentialsResponse, ConnectWhatsAppCredentialsResponses, ConversionDestination, ConversionEvent, CreateAccountGroupData, CreateAccountGroupError, CreateAccountGroupErrors, CreateAccountGroupResponse, CreateAccountGroupResponses, CreateAdAudienceData, CreateAdAudienceError, CreateAdAudienceErrors, CreateAdAudienceResponse, CreateAdAudienceResponses, CreateApiKeyData, CreateApiKeyError, CreateApiKeyErrors, CreateApiKeyResponse, CreateApiKeyResponses, CreateBroadcastData, CreateBroadcastError, CreateBroadcastErrors, CreateBroadcastResponse, CreateBroadcastResponses, CreateCommentAutomationData, CreateCommentAutomationError, CreateCommentAutomationErrors, CreateCommentAutomationResponse, CreateCommentAutomationResponses, CreateContactData, CreateContactError, CreateContactErrors, CreateContactResponse, CreateContactResponses, CreateConversionDestinationData, CreateConversionDestinationError, CreateConversionDestinationErrors, CreateConversionDestinationResponse, CreateConversionDestinationResponses, CreateCtwaAdData, CreateCtwaAdError, CreateCtwaAdErrors, CreateCtwaAdResponse, CreateCtwaAdResponses, CreateCustomFieldData, CreateCustomFieldError, CreateCustomFieldErrors, CreateCustomFieldResponse, CreateCustomFieldResponses, CreateGoogleBusinessMediaData, CreateGoogleBusinessMediaError, CreateGoogleBusinessMediaErrors, CreateGoogleBusinessMediaResponse, CreateGoogleBusinessMediaResponses, CreateGoogleBusinessPlaceActionData, CreateGoogleBusinessPlaceActionError, CreateGoogleBusinessPlaceActionErrors, CreateGoogleBusinessPlaceActionResponse, CreateGoogleBusinessPlaceActionResponses, CreateInboxConversationData, CreateInboxConversationError, CreateInboxConversationErrors, CreateInboxConversationResponse, CreateInboxConversationResponses, CreateInviteTokenData, CreateInviteTokenError, CreateInviteTokenErrors, CreateInviteTokenResponse, CreateInviteTokenResponses, CreatePostData, CreatePostError, CreatePostErrors, CreatePostResponse, CreatePostResponses, CreateProfileData, CreateProfileError, CreateProfileErrors, CreateProfileResponse, CreateProfileResponses, CreateQueueSlotData, CreateQueueSlotError, CreateQueueSlotErrors, CreateQueueSlotResponse, CreateQueueSlotResponses, CreateSequenceData, CreateSequenceError, CreateSequenceErrors, CreateSequenceResponse, CreateSequenceResponses, CreateStandaloneAdData, CreateStandaloneAdError, CreateStandaloneAdErrors, CreateStandaloneAdResponse, CreateStandaloneAdResponses, CreateTrackingTagData, CreateTrackingTagError, CreateTrackingTagErrors, CreateTrackingTagResponse, CreateTrackingTagResponses, CreateWebhookSettingsData, CreateWebhookSettingsError, CreateWebhookSettingsErrors, CreateWebhookSettingsResponse, CreateWebhookSettingsResponses, CreateWhatsAppFlowData, CreateWhatsAppFlowError, CreateWhatsAppFlowErrors, CreateWhatsAppFlowResponse, CreateWhatsAppFlowResponses, CreateWhatsAppGroupChatData, CreateWhatsAppGroupChatError, CreateWhatsAppGroupChatErrors, CreateWhatsAppGroupChatResponse, CreateWhatsAppGroupChatResponses, CreateWhatsAppGroupInviteLinkData, CreateWhatsAppGroupInviteLinkError, CreateWhatsAppGroupInviteLinkErrors, CreateWhatsAppGroupInviteLinkResponse, CreateWhatsAppGroupInviteLinkResponses, CreateWhatsAppTemplateData, CreateWhatsAppTemplateError, CreateWhatsAppTemplateErrors, CreateWhatsAppTemplateResponse, CreateWhatsAppTemplateResponses, CtwaMultiResponse, CtwaSingleResponse, DeleteAccountData, DeleteAccountError, DeleteAccountErrors, DeleteAccountGroupData, DeleteAccountGroupError, DeleteAccountGroupErrors, DeleteAccountGroupResponse, DeleteAccountGroupResponses, DeleteAccountResponse, DeleteAccountResponses, DeleteAdAudienceData, DeleteAdAudienceError, DeleteAdAudienceErrors, DeleteAdAudienceResponse, DeleteAdAudienceResponses, DeleteAdCampaignData, DeleteAdCampaignError, DeleteAdCampaignErrors, DeleteAdCampaignResponse, DeleteAdCampaignResponses, DeleteAdData, DeleteAdError, DeleteAdErrors, DeleteAdResponse, DeleteAdResponses, DeleteApiKeyData, DeleteApiKeyError, DeleteApiKeyErrors, DeleteApiKeyResponse, DeleteApiKeyResponses, DeleteBroadcastData, DeleteBroadcastError, DeleteBroadcastErrors, DeleteBroadcastResponses, DeleteCommentAutomationData, DeleteCommentAutomationError, DeleteCommentAutomationErrors, DeleteCommentAutomationResponses, DeleteContactData, DeleteContactError, DeleteContactErrors, DeleteContactResponses, DeleteConversionDestinationData, DeleteConversionDestinationError, DeleteConversionDestinationErrors, DeleteConversionDestinationResponse, DeleteConversionDestinationResponses, DeleteCustomFieldData, DeleteCustomFieldError, DeleteCustomFieldErrors, DeleteCustomFieldResponses, DeleteGoogleBusinessMediaData, DeleteGoogleBusinessMediaError, DeleteGoogleBusinessMediaErrors, DeleteGoogleBusinessMediaResponse, DeleteGoogleBusinessMediaResponses, DeleteGoogleBusinessPlaceActionData, DeleteGoogleBusinessPlaceActionError, DeleteGoogleBusinessPlaceActionErrors, DeleteGoogleBusinessPlaceActionResponse, DeleteGoogleBusinessPlaceActionResponses, DeleteGoogleBusinessReviewReplyData, DeleteGoogleBusinessReviewReplyError, DeleteGoogleBusinessReviewReplyErrors, DeleteGoogleBusinessReviewReplyResponse, DeleteGoogleBusinessReviewReplyResponses, DeleteInboxCommentData, DeleteInboxCommentError, DeleteInboxCommentErrors, DeleteInboxCommentResponse, DeleteInboxCommentResponses, DeleteInboxMessageData, DeleteInboxMessageError, DeleteInboxMessageErrors, DeleteInboxMessageResponse, DeleteInboxMessageResponses, DeleteInboxReviewReplyData, DeleteInboxReviewReplyError, DeleteInboxReviewReplyErrors, DeleteInboxReviewReplyResponse, DeleteInboxReviewReplyResponses, DeleteInstagramIceBreakersData, DeleteInstagramIceBreakersError, DeleteInstagramIceBreakersErrors, DeleteInstagramIceBreakersResponses, DeleteMessengerMenuData, DeleteMessengerMenuError, DeleteMessengerMenuErrors, DeleteMessengerMenuResponses, DeletePostData, DeletePostError, DeletePostErrors, DeletePostResponse, DeletePostResponses, DeleteProfileData, DeleteProfileError, DeleteProfileErrors, DeleteProfileResponse, DeleteProfileResponses, DeleteQueueSlotData, DeleteQueueSlotError, DeleteQueueSlotErrors, DeleteQueueSlotResponse, DeleteQueueSlotResponses, DeleteSequenceData, DeleteSequenceError, DeleteSequenceErrors, DeleteSequenceResponses, DeleteTelegramCommandsData, DeleteTelegramCommandsError, DeleteTelegramCommandsErrors, DeleteTelegramCommandsResponses, DeleteWebhookSettingsData, DeleteWebhookSettingsError, DeleteWebhookSettingsErrors, DeleteWebhookSettingsResponse, DeleteWebhookSettingsResponses, DeleteWhatsAppFlowData, DeleteWhatsAppFlowError, DeleteWhatsAppFlowErrors, DeleteWhatsAppFlowResponse, DeleteWhatsAppFlowResponses, DeleteWhatsAppGroupChatData, DeleteWhatsAppGroupChatError, DeleteWhatsAppGroupChatErrors, DeleteWhatsAppGroupChatResponse, DeleteWhatsAppGroupChatResponses, DeleteWhatsAppTemplateData, DeleteWhatsAppTemplateError, DeleteWhatsAppTemplateErrors, DeleteWhatsAppTemplateResponse, DeleteWhatsAppTemplateResponses, DeprecateWhatsAppFlowData, DeprecateWhatsAppFlowError, DeprecateWhatsAppFlowErrors, DeprecateWhatsAppFlowResponse, DeprecateWhatsAppFlowResponses, DiscordPlatformData, DmButton, DuplicateAdCampaignData, DuplicateAdCampaignError, DuplicateAdCampaignErrors, DuplicateAdCampaignResponse, DuplicateAdCampaignResponses, EditInboxMessageData, EditInboxMessageError, EditInboxMessageErrors, EditInboxMessageResponse, EditInboxMessageResponses, EditPostData, EditPostError, EditPostErrors, EditPostResponse, EditPostResponses, EnrollContactsData, EnrollContactsError, EnrollContactsErrors, EnrollContactsResponse, EnrollContactsResponses, ErrorResponse, FacebookPlatformData, FollowerStatsResponse, FollowUserData, FollowUserError, FollowUserErrors, FollowUserResponse, FollowUserResponses, FoodMenu, FoodMenuItem, FoodMenuItemAttributes, FoodMenuLabel, FoodMenuSection, GeoRestriction, GetAccountHealthData, GetAccountHealthError, GetAccountHealthErrors, GetAccountHealthResponse, GetAccountHealthResponses, GetAdAnalyticsData, GetAdAnalyticsError, GetAdAnalyticsErrors, GetAdAnalyticsResponse, GetAdAnalyticsResponses, GetAdAudienceData, GetAdAudienceError, GetAdAudienceErrors, GetAdAudienceResponse, GetAdAudienceResponses, GetAdCommentsData, GetAdCommentsError, GetAdCommentsErrors, GetAdCommentsResponse, GetAdCommentsResponses, GetAdData, GetAdError, GetAdErrors, GetAdResponse, GetAdResponses, GetAdsTimelineData, GetAdsTimelineError, GetAdsTimelineErrors, GetAdsTimelineResponse, GetAdsTimelineResponses, GetAdTreeData, GetAdTreeError, GetAdTreeErrors, GetAdTreeResponse, GetAdTreeResponses, GetAllAccountsHealthData, GetAllAccountsHealthError, GetAllAccountsHealthErrors, GetAllAccountsHealthResponse, GetAllAccountsHealthResponses, GetAnalyticsData, GetAnalyticsError, GetAnalyticsErrors, GetAnalyticsResponse, GetAnalyticsResponses, GetBestTimeToPostData, GetBestTimeToPostError, GetBestTimeToPostErrors, GetBestTimeToPostResponse, GetBestTimeToPostResponses, GetBroadcastData, GetBroadcastError, GetBroadcastErrors, GetBroadcastResponse, GetBroadcastResponses, GetCommentAutomationData, GetCommentAutomationError, GetCommentAutomationErrors, GetCommentAutomationResponse, GetCommentAutomationResponses, GetConnectUrlData, GetConnectUrlError, GetConnectUrlErrors, GetConnectUrlResponse, GetConnectUrlResponses, GetContactChannelsData, GetContactChannelsError, GetContactChannelsErrors, GetContactChannelsResponse, GetContactChannelsResponses, GetContactData, GetContactError, GetContactErrors, GetContactResponse, GetContactResponses, GetContentDecayData, GetContentDecayError, GetContentDecayErrors, GetContentDecayResponse, GetContentDecayResponses, GetConversionDestinationData, GetConversionDestinationError, GetConversionDestinationErrors, GetConversionDestinationResponse, GetConversionDestinationResponses, GetConversionMetricsData, GetConversionMetricsError, GetConversionMetricsErrors, GetConversionMetricsResponse, GetConversionMetricsResponses, GetDailyMetricsData, GetDailyMetricsError, GetDailyMetricsErrors, GetDailyMetricsResponse, GetDailyMetricsResponses, GetDiscordChannelsData, GetDiscordChannelsError, GetDiscordChannelsErrors, GetDiscordChannelsResponse, GetDiscordChannelsResponses, GetDiscordSettingsData, GetDiscordSettingsError, GetDiscordSettingsErrors, GetDiscordSettingsResponse, GetDiscordSettingsResponses, GetFacebookPageInsightsData, GetFacebookPageInsightsError, GetFacebookPageInsightsErrors, GetFacebookPageInsightsResponse, GetFacebookPageInsightsResponses, GetFacebookPagesData, GetFacebookPagesError, GetFacebookPagesErrors, GetFacebookPagesResponse, GetFacebookPagesResponses, GetFollowerStatsData, GetFollowerStatsError, GetFollowerStatsErrors, GetFollowerStatsResponse, GetFollowerStatsResponses, GetGmbLocationsData, GetGmbLocationsError, GetGmbLocationsErrors, GetGmbLocationsResponse, GetGmbLocationsResponses, GetGoogleBusinessAttributesData, GetGoogleBusinessAttributesError, GetGoogleBusinessAttributesErrors, GetGoogleBusinessAttributesResponse, GetGoogleBusinessAttributesResponses, GetGoogleBusinessFoodMenusData, GetGoogleBusinessFoodMenusError, GetGoogleBusinessFoodMenusErrors, GetGoogleBusinessFoodMenusResponse, GetGoogleBusinessFoodMenusResponses, GetGoogleBusinessLocationDetailsData, GetGoogleBusinessLocationDetailsError, GetGoogleBusinessLocationDetailsErrors, GetGoogleBusinessLocationDetailsResponse, GetGoogleBusinessLocationDetailsResponses, GetGoogleBusinessPerformanceData, GetGoogleBusinessPerformanceError, GetGoogleBusinessPerformanceErrors, GetGoogleBusinessPerformanceResponse, GetGoogleBusinessPerformanceResponses, GetGoogleBusinessReviewsData, GetGoogleBusinessReviewsError, GetGoogleBusinessReviewsErrors, GetGoogleBusinessReviewsResponse, GetGoogleBusinessReviewsResponses, GetGoogleBusinessSearchKeywordsData, GetGoogleBusinessSearchKeywordsError, GetGoogleBusinessSearchKeywordsErrors, GetGoogleBusinessSearchKeywordsResponse, GetGoogleBusinessSearchKeywordsResponses, GetGoogleBusinessServicesData, GetGoogleBusinessServicesError, GetGoogleBusinessServicesErrors, GetGoogleBusinessServicesResponse, GetGoogleBusinessServicesResponses, GetInboxConversationData, GetInboxConversationError, GetInboxConversationErrors, GetInboxConversationMessagesData, GetInboxConversationMessagesError, GetInboxConversationMessagesErrors, GetInboxConversationMessagesResponse, GetInboxConversationMessagesResponses, GetInboxConversationResponse, GetInboxConversationResponses, GetInboxPostCommentsData, GetInboxPostCommentsError, GetInboxPostCommentsErrors, GetInboxPostCommentsResponse, GetInboxPostCommentsResponses, GetInstagramAccountInsightsData, GetInstagramAccountInsightsError, GetInstagramAccountInsightsErrors, GetInstagramAccountInsightsResponse, GetInstagramAccountInsightsResponses, GetInstagramDemographicsData, GetInstagramDemographicsError, GetInstagramDemographicsErrors, GetInstagramDemographicsResponse, GetInstagramDemographicsResponses, GetInstagramFollowerHistoryData, GetInstagramFollowerHistoryError, GetInstagramFollowerHistoryErrors, GetInstagramFollowerHistoryResponse, GetInstagramFollowerHistoryResponses, GetInstagramIceBreakersData, GetInstagramIceBreakersError, GetInstagramIceBreakersErrors, GetInstagramIceBreakersResponse, GetInstagramIceBreakersResponses, GetInstagramStoryInsightsData, GetInstagramStoryInsightsError, GetInstagramStoryInsightsErrors, GetInstagramStoryInsightsResponse, GetInstagramStoryInsightsResponses, GetLinkedInAggregateAnalyticsData, GetLinkedInAggregateAnalyticsError, GetLinkedInAggregateAnalyticsErrors, GetLinkedInAggregateAnalyticsResponse, GetLinkedInAggregateAnalyticsResponses, GetLinkedInMentionsData, GetLinkedInMentionsError, GetLinkedInMentionsErrors, GetLinkedInMentionsResponse, GetLinkedInMentionsResponses, GetLinkedInOrgAggregateAnalyticsData, GetLinkedInOrgAggregateAnalyticsError, GetLinkedInOrgAggregateAnalyticsErrors, GetLinkedInOrgAggregateAnalyticsResponse, GetLinkedInOrgAggregateAnalyticsResponses, GetLinkedInOrganizationsData, GetLinkedInOrganizationsError, GetLinkedInOrganizationsErrors, GetLinkedInOrganizationsResponse, GetLinkedInOrganizationsResponses, GetLinkedInPostAnalyticsData, GetLinkedInPostAnalyticsError, GetLinkedInPostAnalyticsErrors, GetLinkedInPostAnalyticsResponse, GetLinkedInPostAnalyticsResponses, GetLinkedInPostReactionsData, GetLinkedInPostReactionsError, GetLinkedInPostReactionsErrors, GetLinkedInPostReactionsResponse, GetLinkedInPostReactionsResponses, GetMediaPresignedUrlData, GetMediaPresignedUrlError, GetMediaPresignedUrlErrors, GetMediaPresignedUrlResponse, GetMediaPresignedUrlResponses, GetMessengerMenuData, GetMessengerMenuError, GetMessengerMenuErrors, GetMessengerMenuResponse, GetMessengerMenuResponses, GetNextQueueSlotData, GetNextQueueSlotError, GetNextQueueSlotErrors, GetNextQueueSlotResponse, GetNextQueueSlotResponses, GetPendingOAuthDataData, GetPendingOAuthDataError, GetPendingOAuthDataErrors, GetPendingOAuthDataResponse, GetPendingOAuthDataResponses, GetPinterestBoardsData, GetPinterestBoardsError, GetPinterestBoardsErrors, GetPinterestBoardsResponse, GetPinterestBoardsResponses, GetPostData, GetPostError, GetPostErrors, GetPostingFrequencyData, GetPostingFrequencyError, GetPostingFrequencyErrors, GetPostingFrequencyResponse, GetPostingFrequencyResponses, GetPostResponse, GetPostResponses, GetPostTimelineData, GetPostTimelineError, GetPostTimelineErrors, GetPostTimelineResponse, GetPostTimelineResponses, GetProfileData, GetProfileError, GetProfileErrors, GetProfileResponse, GetProfileResponses, GetRedditFeedData, GetRedditFeedError, GetRedditFeedErrors, GetRedditFeedResponse, GetRedditFeedResponses, GetRedditFlairsData, GetRedditFlairsError, GetRedditFlairsErrors, GetRedditFlairsResponse, GetRedditFlairsResponses, GetRedditSubredditsData, GetRedditSubredditsError, GetRedditSubredditsErrors, GetRedditSubredditsResponse, GetRedditSubredditsResponses, GetSequenceData, GetSequenceError, GetSequenceErrors, GetSequenceResponse, GetSequenceResponses, GetTelegramCommandsData, GetTelegramCommandsError, GetTelegramCommandsErrors, GetTelegramCommandsResponse, GetTelegramCommandsResponses, GetTelegramConnectStatusData, GetTelegramConnectStatusError, GetTelegramConnectStatusErrors, GetTelegramConnectStatusResponse, GetTelegramConnectStatusResponses, GetTikTokAccountInsightsData, GetTikTokAccountInsightsError, GetTikTokAccountInsightsErrors, GetTikTokAccountInsightsResponse, GetTikTokAccountInsightsResponses, GetTikTokCreatorInfoData, GetTikTokCreatorInfoError, GetTikTokCreatorInfoErrors, GetTikTokCreatorInfoResponse, GetTikTokCreatorInfoResponses, GetTrackingTagData, GetTrackingTagError, GetTrackingTagErrors, GetTrackingTagResponse, GetTrackingTagResponses, GetTrackingTagStatsData, GetTrackingTagStatsError, GetTrackingTagStatsErrors, GetTrackingTagStatsResponse, GetTrackingTagStatsResponses, GetUsageStatsData, GetUsageStatsError, GetUsageStatsErrors, GetUsageStatsResponse, GetUsageStatsResponses, GetUserData, GetUserError, GetUserErrors, GetUserResponse, GetUserResponses, GetWebhookSettingsData, GetWebhookSettingsError, GetWebhookSettingsErrors, GetWebhookSettingsResponse, GetWebhookSettingsResponses, GetWhatsAppBusinessProfileData, GetWhatsAppBusinessProfileError, GetWhatsAppBusinessProfileErrors, GetWhatsAppBusinessProfileResponse, GetWhatsAppBusinessProfileResponses, GetWhatsAppDisplayNameData, GetWhatsAppDisplayNameError, GetWhatsAppDisplayNameErrors, GetWhatsAppDisplayNameResponse, GetWhatsAppDisplayNameResponses, GetWhatsAppFlowData, GetWhatsAppFlowError, GetWhatsAppFlowErrors, GetWhatsAppFlowJsonData, GetWhatsAppFlowJsonError, GetWhatsAppFlowJsonErrors, GetWhatsAppFlowJsonResponse, GetWhatsAppFlowJsonResponses, GetWhatsAppFlowResponse, GetWhatsAppFlowResponses, GetWhatsAppGroupChatData, GetWhatsAppGroupChatError, GetWhatsAppGroupChatErrors, GetWhatsAppGroupChatResponse, GetWhatsAppGroupChatResponses, GetWhatsAppPhoneNumberData, GetWhatsAppPhoneNumberError, GetWhatsAppPhoneNumberErrors, GetWhatsAppPhoneNumberResponse, GetWhatsAppPhoneNumberResponses, GetWhatsAppPhoneNumbersData, GetWhatsAppPhoneNumbersError, GetWhatsAppPhoneNumbersErrors, GetWhatsAppPhoneNumbersResponse, GetWhatsAppPhoneNumbersResponses, GetWhatsAppTemplateData, GetWhatsAppTemplateError, GetWhatsAppTemplateErrors, GetWhatsAppTemplateResponse, GetWhatsAppTemplateResponses, GetWhatsAppTemplatesData, GetWhatsAppTemplatesError, GetWhatsAppTemplatesErrors, GetWhatsAppTemplatesResponse, GetWhatsAppTemplatesResponses, GetXApiPricingData, GetXApiPricingError, GetXApiPricingErrors, GetXApiPricingResponse, GetXApiPricingResponses, GetYouTubeChannelInsightsData, GetYouTubeChannelInsightsError, GetYouTubeChannelInsightsErrors, GetYouTubeChannelInsightsResponse, GetYouTubeChannelInsightsResponses, GetYouTubeDailyViewsData, GetYouTubeDailyViewsError, GetYouTubeDailyViewsErrors, GetYouTubeDailyViewsResponse, GetYouTubeDailyViewsResponses, GetYouTubeDemographicsData, GetYouTubeDemographicsError, GetYouTubeDemographicsErrors, GetYouTubeDemographicsResponse, GetYouTubeDemographicsResponses, GetYoutubePlaylistsData, GetYoutubePlaylistsError, GetYoutubePlaylistsErrors, GetYoutubePlaylistsResponse, GetYoutubePlaylistsResponses, GoogleBusinessPlatformData, HandleOAuthCallbackData, HandleOAuthCallbackError, HandleOAuthCallbackErrors, HandleOAuthCallbackResponses, HideInboxCommentData, HideInboxCommentError, HideInboxCommentErrors, HideInboxCommentResponse, HideInboxCommentResponses, InboxWebhookAccount, InboxWebhookConversation, InboxWebhookMessage, InitiateTelegramConnectData, InitiateTelegramConnectError, InitiateTelegramConnectErrors, InitiateTelegramConnectResponse, InitiateTelegramConnectResponses, InstagramAccountInsightsResponse, InstagramDemographicsResponse, InstagramPlatformData, LikeInboxCommentData, LikeInboxCommentError, LikeInboxCommentErrors, LikeInboxCommentResponse, LikeInboxCommentResponses, LimitParam, LinkedInAggregateAnalyticsDailyResponse, LinkedInAggregateAnalyticsTotalResponse, LinkedInPlatformData, ListAccountGroupsData, ListAccountGroupsError, ListAccountGroupsErrors, ListAccountGroupsResponse, ListAccountGroupsResponses, ListAccountsData, ListAccountsError, ListAccountsErrors, ListAccountsResponse, ListAccountsResponses, ListAdAccountsData, ListAdAccountsError, ListAdAccountsErrors, ListAdAccountsResponse, ListAdAccountsResponses, ListAdAudiencesData, ListAdAudiencesError, ListAdAudiencesErrors, ListAdAudiencesResponse, ListAdAudiencesResponses, ListAdCampaignsData, ListAdCampaignsError, ListAdCampaignsErrors, ListAdCampaignsResponse, ListAdCampaignsResponses, ListAdsBusinessCentersData, ListAdsBusinessCentersError, ListAdsBusinessCentersErrors, ListAdsBusinessCentersResponse, ListAdsBusinessCentersResponses, ListAdsData, ListAdsError, ListAdsErrors, ListAdsResponse, ListAdsResponses, ListApiKeysData, ListApiKeysError, ListApiKeysErrors, ListApiKeysResponse, ListApiKeysResponses, ListBroadcastRecipientsData, ListBroadcastRecipientsError, ListBroadcastRecipientsErrors, ListBroadcastRecipientsResponse, ListBroadcastRecipientsResponses, ListBroadcastsData, ListBroadcastsError, ListBroadcastsErrors, ListBroadcastsResponse, ListBroadcastsResponses, ListCommentAutomationLogsData, ListCommentAutomationLogsError, ListCommentAutomationLogsErrors, ListCommentAutomationLogsResponse, ListCommentAutomationLogsResponses, ListCommentAutomationsData, ListCommentAutomationsError, ListCommentAutomationsErrors, ListCommentAutomationsResponse, ListCommentAutomationsResponses, ListContactsData, ListContactsError, ListContactsErrors, ListContactsResponse, ListContactsResponses, ListConversionAssociationsData, ListConversionAssociationsError, ListConversionAssociationsErrors, ListConversionAssociationsResponse, ListConversionAssociationsResponses, ListConversionDestinationsData, ListConversionDestinationsError, ListConversionDestinationsErrors, ListConversionDestinationsResponse, ListConversionDestinationsResponses, ListCustomFieldsData, ListCustomFieldsError, ListCustomFieldsErrors, ListCustomFieldsResponse, ListCustomFieldsResponses, ListFacebookPagesData, ListFacebookPagesError, ListFacebookPagesErrors, ListFacebookPagesResponse, ListFacebookPagesResponses, ListGoogleBusinessLocationsData, ListGoogleBusinessLocationsError, ListGoogleBusinessLocationsErrors, ListGoogleBusinessLocationsResponse, ListGoogleBusinessLocationsResponses, ListGoogleBusinessMediaData, ListGoogleBusinessMediaError, ListGoogleBusinessMediaErrors, ListGoogleBusinessMediaResponse, ListGoogleBusinessMediaResponses, ListGoogleBusinessPlaceActionsData, ListGoogleBusinessPlaceActionsError, ListGoogleBusinessPlaceActionsErrors, ListGoogleBusinessPlaceActionsResponse, ListGoogleBusinessPlaceActionsResponses, ListInboxCommentsData, ListInboxCommentsError, ListInboxCommentsErrors, ListInboxCommentsResponse, ListInboxCommentsResponses, ListInboxConversationsData, ListInboxConversationsError, ListInboxConversationsErrors, ListInboxConversationsResponse, ListInboxConversationsResponses, ListInboxReviewsData, ListInboxReviewsError, ListInboxReviewsErrors, ListInboxReviewsResponse, ListInboxReviewsResponses, ListInstagramStoriesData, ListInstagramStoriesError, ListInstagramStoriesErrors, ListInstagramStoriesResponse, ListInstagramStoriesResponses, ListLinkedInOrganizationsData, ListLinkedInOrganizationsError, ListLinkedInOrganizationsErrors, ListLinkedInOrganizationsResponse, ListLinkedInOrganizationsResponses, ListLogsData, ListLogsError, ListLogsErrors, ListLogsResponse, ListLogsResponses, ListPinterestBoardsForSelectionData, ListPinterestBoardsForSelectionError, ListPinterestBoardsForSelectionErrors, ListPinterestBoardsForSelectionResponse, ListPinterestBoardsForSelectionResponses, ListPostsData, ListPostsError, ListPostsErrors, ListPostsResponse, ListPostsResponses, ListProfilesData, ListProfilesError, ListProfilesErrors, ListProfilesResponse, ListProfilesResponses, ListQueueSlotsData, ListQueueSlotsError, ListQueueSlotsErrors, ListQueueSlotsResponse, ListQueueSlotsResponses, ListSequenceEnrollmentsData, ListSequenceEnrollmentsError, ListSequenceEnrollmentsErrors, ListSequenceEnrollmentsResponse, ListSequenceEnrollmentsResponses, ListSequencesData, ListSequencesError, ListSequencesErrors, ListSequencesResponse, ListSequencesResponses, ListSnapchatProfilesData, ListSnapchatProfilesError, ListSnapchatProfilesErrors, ListSnapchatProfilesResponse, ListSnapchatProfilesResponses, ListTrackingTagsData, ListTrackingTagsError, ListTrackingTagsErrors, ListTrackingTagSharedAccountsData, ListTrackingTagSharedAccountsError, ListTrackingTagSharedAccountsErrors, ListTrackingTagSharedAccountsResponse, ListTrackingTagSharedAccountsResponses, ListTrackingTagsResponse, ListTrackingTagsResponses, ListUsersData, ListUsersError, ListUsersErrors, ListUsersResponse, ListUsersResponses, ListWhatsAppFlowsData, ListWhatsAppFlowsError, ListWhatsAppFlowsErrors, ListWhatsAppFlowsResponse, ListWhatsAppFlowsResponses, ListWhatsAppGroupChatsData, ListWhatsAppGroupChatsError, ListWhatsAppGroupChatsErrors, ListWhatsAppGroupChatsResponse, ListWhatsAppGroupChatsResponses, ListWhatsAppGroupJoinRequestsData, ListWhatsAppGroupJoinRequestsError, ListWhatsAppGroupJoinRequestsErrors, ListWhatsAppGroupJoinRequestsResponse, ListWhatsAppGroupJoinRequestsResponses, ListWhatsAppPhoneNumbersData, ListWhatsAppPhoneNumbersError, ListWhatsAppPhoneNumbersErrors, ListWhatsAppPhoneNumbersResponse, ListWhatsAppPhoneNumbersResponses, MediaItem, MediaUploadResponse, Money, MoveAccountToProfileData, MoveAccountToProfileError, MoveAccountToProfileErrors, MoveAccountToProfileResponse, MoveAccountToProfileResponses, OnAccountAdsInitialSyncCompletedWebhookPayload, OnAccountAdsInitialSyncCompletedWebhookRequest, OnAccountConnectedWebhookPayload, OnAccountConnectedWebhookRequest, OnAccountDisconnectedWebhookPayload, OnAccountDisconnectedWebhookRequest, OnAdStatusChangedWebhookPayload, OnAdStatusChangedWebhookRequest, OnCommentReceivedWebhookPayload, OnCommentReceivedWebhookRequest, OnMessageDeletedWebhookPayload, OnMessageDeletedWebhookRequest, OnMessageDeliveredWebhookPayload, OnMessageDeliveredWebhookRequest, OnMessageEditedWebhookPayload, OnMessageEditedWebhookRequest, OnMessageFailedWebhookPayload, OnMessageFailedWebhookRequest, OnMessageReadWebhookPayload, OnMessageReadWebhookRequest, OnMessageReceivedWebhookPayload, OnMessageReceivedWebhookRequest, OnMessageSentWebhookPayload, OnMessageSentWebhookRequest, OnPostCancelledWebhookPayload, OnPostCancelledWebhookRequest, OnPostFailedWebhookPayload, OnPostFailedWebhookRequest, OnPostPartialWebhookPayload, OnPostPartialWebhookRequest, OnPostPlatformFailedWebhookPayload, OnPostPlatformFailedWebhookRequest, OnPostPlatformPublishedWebhookPayload, OnPostPlatformPublishedWebhookRequest, OnPostPublishedWebhookPayload, OnPostPublishedWebhookRequest, OnPostRecycledWebhookPayload, OnPostRecycledWebhookRequest, OnPostScheduledWebhookPayload, OnPostScheduledWebhookRequest, OnReviewNewWebhookPayload, OnReviewNewWebhookRequest, OnReviewUpdatedWebhookPayload, OnReviewUpdatedWebhookRequest, OnWebhookTestWebhookPayload, OnWebhookTestWebhookRequest, OnWhatsAppTemplateStatusUpdatedWebhookPayload, OnWhatsAppTemplateStatusUpdatedWebhookRequest, PageParam, Pagination, PauseSequenceData, PauseSequenceError, PauseSequenceErrors, PauseSequenceResponse, PauseSequenceResponses, PinterestPlatformData, PlatformAnalytics, PlatformTarget, Post, PostAnalytics, PostCreateResponse, PostDeleteResponse, PostGetResponse, PostRetryResponse, PostsListResponse, PostUpdateResponse, PreviewQueueData, PreviewQueueError, PreviewQueueErrors, PreviewQueueResponse, PreviewQueueResponses, Profile, ProfileCreateResponse, ProfileDeleteResponse, ProfileGetResponse, ProfilesListResponse, ProfileUpdateResponse, PublishWhatsAppFlowData, PublishWhatsAppFlowError, PublishWhatsAppFlowErrors, PublishWhatsAppFlowResponse, PublishWhatsAppFlowResponses, PurchaseWhatsAppPhoneNumberData, PurchaseWhatsAppPhoneNumberError, PurchaseWhatsAppPhoneNumberErrors, PurchaseWhatsAppPhoneNumberResponse, PurchaseWhatsAppPhoneNumberResponses, QueueDeleteResponse, QueueNextSlotResponse, QueuePreviewResponse, QueueSchedule, QueueSlot, QueueSlotsResponse, QueueUpdateResponse, RecyclingConfig, RecyclingState, RedditPlatformData, RedditPost, RejectWhatsAppGroupJoinRequestsData, RejectWhatsAppGroupJoinRequestsError, RejectWhatsAppGroupJoinRequestsErrors, RejectWhatsAppGroupJoinRequestsResponse, RejectWhatsAppGroupJoinRequestsResponses, ReleaseWhatsAppPhoneNumberData, ReleaseWhatsAppPhoneNumberError, ReleaseWhatsAppPhoneNumberErrors, ReleaseWhatsAppPhoneNumberResponse, ReleaseWhatsAppPhoneNumberResponses, RemoveBookmarkData, RemoveBookmarkError, RemoveBookmarkErrors, RemoveBookmarkResponse, RemoveBookmarkResponses, RemoveConversionAssociationsData, RemoveConversionAssociationsError, RemoveConversionAssociationsErrors, RemoveConversionAssociationsResponse, RemoveConversionAssociationsResponses, RemoveMessageReactionData, RemoveMessageReactionError, RemoveMessageReactionErrors, RemoveMessageReactionResponse, RemoveMessageReactionResponses, RemoveTrackingTagSharedAccountData, RemoveTrackingTagSharedAccountError, RemoveTrackingTagSharedAccountErrors, RemoveTrackingTagSharedAccountResponse, RemoveTrackingTagSharedAccountResponses, RemoveWhatsAppGroupParticipantsData, RemoveWhatsAppGroupParticipantsError, RemoveWhatsAppGroupParticipantsErrors, RemoveWhatsAppGroupParticipantsResponse, RemoveWhatsAppGroupParticipantsResponses, ReplyToGoogleBusinessReviewData, ReplyToGoogleBusinessReviewError, ReplyToGoogleBusinessReviewErrors, ReplyToGoogleBusinessReviewResponse, ReplyToGoogleBusinessReviewResponses, ReplyToInboxPostData, ReplyToInboxPostError, ReplyToInboxPostErrors, ReplyToInboxPostResponse, ReplyToInboxPostResponses, ReplyToInboxReviewData, ReplyToInboxReviewError, ReplyToInboxReviewErrors, ReplyToInboxReviewResponse, ReplyToInboxReviewResponses, RetryPostData, RetryPostError, RetryPostErrors, RetryPostResponse, RetryPostResponses, RetweetPostData, RetweetPostError, RetweetPostErrors, RetweetPostResponse, RetweetPostResponses, ReviewWebhookReview, ScheduleBroadcastData, ScheduleBroadcastError, ScheduleBroadcastErrors, ScheduleBroadcastResponse, ScheduleBroadcastResponses, SearchAdInterestsData, SearchAdInterestsError, SearchAdInterestsErrors, SearchAdInterestsResponse, SearchAdInterestsResponses, SearchAdTargetingLocationsData, SearchAdTargetingLocationsError, SearchAdTargetingLocationsErrors, SearchAdTargetingLocationsResponse, SearchAdTargetingLocationsResponses, SearchRedditData, SearchRedditError, SearchRedditErrors, SearchRedditResponse, SearchRedditResponses, SelectFacebookPageData, SelectFacebookPageError, SelectFacebookPageErrors, SelectFacebookPageResponse, SelectFacebookPageResponses, SelectGoogleBusinessLocationData, SelectGoogleBusinessLocationError, SelectGoogleBusinessLocationErrors, SelectGoogleBusinessLocationResponse, SelectGoogleBusinessLocationResponses, SelectLinkedInOrganizationData, SelectLinkedInOrganizationError, SelectLinkedInOrganizationErrors, SelectLinkedInOrganizationResponse, SelectLinkedInOrganizationResponses, SelectPinterestBoardData, SelectPinterestBoardError, SelectPinterestBoardErrors, SelectPinterestBoardResponse, SelectPinterestBoardResponses, SelectSnapchatProfileData, SelectSnapchatProfileError, SelectSnapchatProfileErrors, SelectSnapchatProfileResponse, SelectSnapchatProfileResponses, SendBroadcastData, SendBroadcastError, SendBroadcastErrors, SendBroadcastResponse, SendBroadcastResponses, SendConversionsData, SendConversionsError, SendConversionsErrors, SendConversionsResponse, SendConversionsResponses, SendInboxMessageData, SendInboxMessageError, SendInboxMessageErrors, SendInboxMessageResponse, SendInboxMessageResponses, SendPrivateReplyToCommentData, SendPrivateReplyToCommentError, SendPrivateReplyToCommentErrors, SendPrivateReplyToCommentResponse, SendPrivateReplyToCommentResponses, SendTypingIndicatorData, SendTypingIndicatorError, SendTypingIndicatorErrors, SendTypingIndicatorResponse, SendTypingIndicatorResponses, SendWhatsAppConversionData, SendWhatsAppConversionError, SendWhatsAppConversionErrors, SendWhatsAppConversionResponse, SendWhatsAppConversionResponses, SendWhatsAppFlowMessageData, SendWhatsAppFlowMessageError, SendWhatsAppFlowMessageErrors, SendWhatsAppFlowMessageResponse, SendWhatsAppFlowMessageResponses, SetContactFieldValueData, SetContactFieldValueError, SetContactFieldValueErrors, SetContactFieldValueResponses, SetInstagramIceBreakersData, SetInstagramIceBreakersError, SetInstagramIceBreakersErrors, SetInstagramIceBreakersResponses, SetMessengerMenuData, SetMessengerMenuError, SetMessengerMenuErrors, SetMessengerMenuResponses, SetTelegramCommandsData, SetTelegramCommandsError, SetTelegramCommandsErrors, SetTelegramCommandsResponses, SharedAdAccount, SnapchatPlatformData, SocialAccount, TelegramPlatformData, TestWebhookData, TestWebhookError, TestWebhookErrors, TestWebhookResponse, TestWebhookResponses, ThreadsPlatformData, TikTokPlatformData, TrackingTag, TwitterPlatformData, UndoRetweetData, UndoRetweetError, UndoRetweetErrors, UndoRetweetResponse, UndoRetweetResponses, UnenrollContactData, UnenrollContactError, UnenrollContactErrors, UnenrollContactResponses, UnfollowUserData, UnfollowUserError, UnfollowUserErrors, UnfollowUserResponse, UnfollowUserResponses, UnhideInboxCommentData, UnhideInboxCommentError, UnhideInboxCommentErrors, UnhideInboxCommentResponse, UnhideInboxCommentResponses, UnlikeInboxCommentData, UnlikeInboxCommentError, UnlikeInboxCommentErrors, UnlikeInboxCommentResponse, UnlikeInboxCommentResponses, UnpublishPostData, UnpublishPostError, UnpublishPostErrors, UnpublishPostResponse, UnpublishPostResponses, UpdateAccountData, UpdateAccountError, UpdateAccountErrors, UpdateAccountGroupData, UpdateAccountGroupError, UpdateAccountGroupErrors, UpdateAccountGroupResponse, UpdateAccountGroupResponses, UpdateAccountResponse, UpdateAccountResponses, UpdateAdCampaignData, UpdateAdCampaignError, UpdateAdCampaignErrors, UpdateAdCampaignResponse, UpdateAdCampaignResponses, UpdateAdCampaignStatusData, UpdateAdCampaignStatusError, UpdateAdCampaignStatusErrors, UpdateAdCampaignStatusResponse, UpdateAdCampaignStatusResponses, UpdateAdData, UpdateAdError, UpdateAdErrors, UpdateAdResponse, UpdateAdResponses, UpdateAdSetData, UpdateAdSetError, UpdateAdSetErrors, UpdateAdSetResponse, UpdateAdSetResponses, UpdateAdSetStatusData, UpdateAdSetStatusError, UpdateAdSetStatusErrors, UpdateAdSetStatusResponse, UpdateAdSetStatusResponses, UpdateBroadcastData, UpdateBroadcastError, UpdateBroadcastErrors, UpdateBroadcastResponse, UpdateBroadcastResponses, UpdateCommentAutomationData, UpdateCommentAutomationError, UpdateCommentAutomationErrors, UpdateCommentAutomationResponse, UpdateCommentAutomationResponses, UpdateContactData, UpdateContactError, UpdateContactErrors, UpdateContactResponse, UpdateContactResponses, UpdateConversionDestinationData, UpdateConversionDestinationError, UpdateConversionDestinationErrors, UpdateConversionDestinationResponse, UpdateConversionDestinationResponses, UpdateCustomFieldData, UpdateCustomFieldError, UpdateCustomFieldErrors, UpdateCustomFieldResponse, UpdateCustomFieldResponses, UpdateDiscordSettingsData, UpdateDiscordSettingsError, UpdateDiscordSettingsErrors, UpdateDiscordSettingsResponse, UpdateDiscordSettingsResponses, UpdateFacebookPageData, UpdateFacebookPageError, UpdateFacebookPageErrors, UpdateFacebookPageResponse, UpdateFacebookPageResponses, UpdateGmbLocationData, UpdateGmbLocationError, UpdateGmbLocationErrors, UpdateGmbLocationResponse, UpdateGmbLocationResponses, UpdateGoogleBusinessAttributesData, UpdateGoogleBusinessAttributesError, UpdateGoogleBusinessAttributesErrors, UpdateGoogleBusinessAttributesResponse, UpdateGoogleBusinessAttributesResponses, UpdateGoogleBusinessFoodMenusData, UpdateGoogleBusinessFoodMenusError, UpdateGoogleBusinessFoodMenusErrors, UpdateGoogleBusinessFoodMenusResponse, UpdateGoogleBusinessFoodMenusResponses, UpdateGoogleBusinessLocationDetailsData, UpdateGoogleBusinessLocationDetailsError, UpdateGoogleBusinessLocationDetailsErrors, UpdateGoogleBusinessLocationDetailsResponse, UpdateGoogleBusinessLocationDetailsResponses, UpdateGoogleBusinessPlaceActionData, UpdateGoogleBusinessPlaceActionError, UpdateGoogleBusinessPlaceActionErrors, UpdateGoogleBusinessPlaceActionResponse, UpdateGoogleBusinessPlaceActionResponses, UpdateGoogleBusinessServicesData, UpdateGoogleBusinessServicesError, UpdateGoogleBusinessServicesErrors, UpdateGoogleBusinessServicesResponse, UpdateGoogleBusinessServicesResponses, UpdateInboxConversationData, UpdateInboxConversationError, UpdateInboxConversationErrors, UpdateInboxConversationResponse, UpdateInboxConversationResponses, UpdateLinkedInOrganizationData, UpdateLinkedInOrganizationError, UpdateLinkedInOrganizationErrors, UpdateLinkedInOrganizationResponse, UpdateLinkedInOrganizationResponses, UpdatePinterestBoardsData, UpdatePinterestBoardsError, UpdatePinterestBoardsErrors, UpdatePinterestBoardsResponse, UpdatePinterestBoardsResponses, UpdatePostData, UpdatePostError, UpdatePostErrors, UpdatePostMetadataData, UpdatePostMetadataError, UpdatePostMetadataErrors, UpdatePostMetadataResponse, UpdatePostMetadataResponses, UpdatePostResponse, UpdatePostResponses, UpdateProfileData, UpdateProfileError, UpdateProfileErrors, UpdateProfileResponse, UpdateProfileResponses, UpdateQueueSlotData, UpdateQueueSlotError, UpdateQueueSlotErrors, UpdateQueueSlotResponse, UpdateQueueSlotResponses, UpdateRedditSubredditsData, UpdateRedditSubredditsError, UpdateRedditSubredditsErrors, UpdateRedditSubredditsResponse, UpdateRedditSubredditsResponses, UpdateSequenceData, UpdateSequenceError, UpdateSequenceErrors, UpdateSequenceResponse, UpdateSequenceResponses, UpdateTrackingTagData, UpdateTrackingTagError, UpdateTrackingTagErrors, UpdateTrackingTagResponse, UpdateTrackingTagResponses, UpdateWebhookSettingsData, UpdateWebhookSettingsError, UpdateWebhookSettingsErrors, UpdateWebhookSettingsResponse, UpdateWebhookSettingsResponses, UpdateWhatsAppBusinessProfileData, UpdateWhatsAppBusinessProfileError, UpdateWhatsAppBusinessProfileErrors, UpdateWhatsAppBusinessProfileResponse, UpdateWhatsAppBusinessProfileResponses, UpdateWhatsAppDisplayNameData, UpdateWhatsAppDisplayNameError, UpdateWhatsAppDisplayNameErrors, UpdateWhatsAppDisplayNameResponse, UpdateWhatsAppDisplayNameResponses, UpdateWhatsAppFlowData, UpdateWhatsAppFlowError, UpdateWhatsAppFlowErrors, UpdateWhatsAppFlowResponse, UpdateWhatsAppFlowResponses, UpdateWhatsAppGroupChatData, UpdateWhatsAppGroupChatError, UpdateWhatsAppGroupChatErrors, UpdateWhatsAppGroupChatResponse, UpdateWhatsAppGroupChatResponses, UpdateWhatsAppTemplateData, UpdateWhatsAppTemplateError, UpdateWhatsAppTemplateErrors, UpdateWhatsAppTemplateResponse, UpdateWhatsAppTemplateResponses, UpdateYoutubeDefaultPlaylistData, UpdateYoutubeDefaultPlaylistError, UpdateYoutubeDefaultPlaylistErrors, UpdateYoutubeDefaultPlaylistResponse, UpdateYoutubeDefaultPlaylistResponses, UploadedFile, UploadMediaDirectData, UploadMediaDirectError, UploadMediaDirectErrors, UploadMediaDirectResponse, UploadMediaDirectResponses, UploadTokenResponse, UploadTokenStatusResponse, UploadWhatsAppFlowJsonData, UploadWhatsAppFlowJsonError, UploadWhatsAppFlowJsonErrors, UploadWhatsAppFlowJsonResponse, UploadWhatsAppFlowJsonResponses, UploadWhatsAppProfilePhotoData, UploadWhatsAppProfilePhotoError, UploadWhatsAppProfilePhotoErrors, UploadWhatsAppProfilePhotoResponse, UploadWhatsAppProfilePhotoResponses, UsageStats, User, UserGetResponse, UsersListResponse, ValidateMediaData, ValidateMediaResponse, ValidateMediaResponses, ValidatePostData, ValidatePostLengthData, ValidatePostLengthResponse, ValidatePostLengthResponses, ValidatePostResponse, ValidatePostResponses, ValidateSubredditData, ValidateSubredditResponse, ValidateSubredditResponses, Webhook, WebhookPayloadAccountAdsInitialSyncCompleted, WebhookPayloadAccountConnected, WebhookPayloadAccountDisconnected, WebhookPayloadAdStatusChanged, WebhookPayloadComment, WebhookPayloadMessage, WebhookPayloadMessageDeleted, WebhookPayloadMessageDeliveryStatus, WebhookPayloadMessageEdited, WebhookPayloadMessageSent, WebhookPayloadPost, WebhookPayloadPostPlatform, WebhookPayloadReviewNew, WebhookPayloadReviewUpdated, WebhookPayloadTest, WebhookPayloadWhatsAppTemplateStatusUpdated, Webhooks, WhatsAppBodyComponent, WhatsAppButtonsComponent, WhatsAppFooterComponent, WhatsAppHeaderComponent, WhatsAppTemplateButton, WhatsAppTemplateComponent, XApiOperation, XApiPricing, YouTubeDailyViewsResponse, YouTubeDemographicsResponse, YouTubePlatformData, YouTubeScopeMissingResponse } from './types.gen'; diff --git a/src/generated/sdk.gen.ts b/src/generated/sdk.gen.ts index 2607178..d54fa1e 100644 --- a/src/generated/sdk.gen.ts +++ b/src/generated/sdk.gen.ts @@ -1,12 +1,26 @@ // This file is auto-generated by @hey-api/openapi-ts -import { createClient, createConfig, type OptionsLegacyParser, formDataBodySerializer } from '@hey-api/client-fetch'; -import type { ValidatePostLengthData, ValidatePostLengthError, ValidatePostLengthResponse, ValidatePostData, ValidatePostError, ValidatePostResponse, ValidateMediaData, ValidateMediaError, ValidateMediaResponse, ValidateSubredditData, ValidateSubredditError, ValidateSubredditResponse, GetAnalyticsData, GetAnalyticsError, GetAnalyticsResponse, GetYouTubeChannelInsightsData, GetYouTubeChannelInsightsError, GetYouTubeChannelInsightsResponse, GetLinkedInOrgAggregateAnalyticsData, GetLinkedInOrgAggregateAnalyticsError, GetLinkedInOrgAggregateAnalyticsResponse, GetTikTokAccountInsightsData, GetTikTokAccountInsightsError, GetTikTokAccountInsightsResponse, GetYouTubeDailyViewsData, GetYouTubeDailyViewsError, GetYouTubeDailyViewsResponse, GetFacebookPageInsightsData, GetFacebookPageInsightsError, GetFacebookPageInsightsResponse, GetInstagramAccountInsightsData, GetInstagramAccountInsightsError, GetInstagramAccountInsightsResponse, GetInstagramFollowerHistoryData, GetInstagramFollowerHistoryError, GetInstagramFollowerHistoryResponse, GetInstagramDemographicsData, GetInstagramDemographicsError, GetInstagramDemographicsResponse, GetYouTubeDemographicsData, GetYouTubeDemographicsError, GetYouTubeDemographicsResponse, GetDailyMetricsData, GetDailyMetricsError, GetDailyMetricsResponse, GetBestTimeToPostData, GetBestTimeToPostError, GetBestTimeToPostResponse, GetContentDecayData, GetContentDecayError, GetContentDecayResponse, GetPostingFrequencyData, GetPostingFrequencyError, GetPostingFrequencyResponse, GetPostTimelineData, GetPostTimelineError, GetPostTimelineResponse, GetGoogleBusinessPerformanceData, GetGoogleBusinessPerformanceError, GetGoogleBusinessPerformanceResponse, GetGoogleBusinessSearchKeywordsData, GetGoogleBusinessSearchKeywordsError, GetGoogleBusinessSearchKeywordsResponse, ListAccountGroupsError, ListAccountGroupsResponse, CreateAccountGroupData, CreateAccountGroupError, CreateAccountGroupResponse, UpdateAccountGroupData, UpdateAccountGroupError, UpdateAccountGroupResponse, DeleteAccountGroupData, DeleteAccountGroupError, DeleteAccountGroupResponse, GetMediaPresignedUrlData, GetMediaPresignedUrlError, GetMediaPresignedUrlResponse, SearchRedditData, SearchRedditError, SearchRedditResponse, GetRedditFeedData, GetRedditFeedError, GetRedditFeedResponse, GetXApiPricingError, GetXApiPricingResponse, GetUsageStatsData, GetUsageStatsError, GetUsageStatsResponse, ListPostsData, ListPostsError, ListPostsResponse, CreatePostData, CreatePostError, CreatePostResponse, GetPostData, GetPostError, GetPostResponse, UpdatePostData, UpdatePostError, UpdatePostResponse, DeletePostData, DeletePostError, DeletePostResponse, BulkUploadPostsData, BulkUploadPostsError, BulkUploadPostsResponse, RetryPostData, RetryPostError, RetryPostResponse, UnpublishPostData, UnpublishPostError, UnpublishPostResponse, EditPostData, EditPostError, EditPostResponse, UpdatePostMetadataData, UpdatePostMetadataError, UpdatePostMetadataResponse, ListUsersError, ListUsersResponse, GetUserData, GetUserError, GetUserResponse, ListProfilesData, ListProfilesError, ListProfilesResponse, CreateProfileData, CreateProfileError, CreateProfileResponse, GetProfileData, GetProfileError, GetProfileResponse, UpdateProfileData, UpdateProfileError, UpdateProfileResponse, DeleteProfileData, DeleteProfileError, DeleteProfileResponse, ListAccountsData, ListAccountsError, ListAccountsResponse, GetFollowerStatsData, GetFollowerStatsError, GetFollowerStatsResponse, UpdateAccountData, UpdateAccountError, UpdateAccountResponse, MoveAccountToProfileData, MoveAccountToProfileError, MoveAccountToProfileResponse, DeleteAccountData, DeleteAccountError, DeleteAccountResponse, GetAllAccountsHealthData, GetAllAccountsHealthError, GetAllAccountsHealthResponse, GetAccountHealthData, GetAccountHealthError, GetAccountHealthResponse, GetTikTokCreatorInfoData, GetTikTokCreatorInfoError, GetTikTokCreatorInfoResponse, ListApiKeysError, ListApiKeysResponse, CreateApiKeyData, CreateApiKeyError, CreateApiKeyResponse, DeleteApiKeyData, DeleteApiKeyError, DeleteApiKeyResponse, CreateInviteTokenData, CreateInviteTokenError, CreateInviteTokenResponse, GetConnectUrlData, GetConnectUrlError, GetConnectUrlResponse, HandleOAuthCallbackData, HandleOAuthCallbackError, HandleOAuthCallbackResponse, ConnectAdsData, ConnectAdsError, ConnectAdsResponse, ConfigureTikTokAdsBrandIdentityData, ConfigureTikTokAdsBrandIdentityError, ConfigureTikTokAdsBrandIdentityResponse, ListFacebookPagesData, ListFacebookPagesError, ListFacebookPagesResponse, SelectFacebookPageData, SelectFacebookPageError, SelectFacebookPageResponse, ListGoogleBusinessLocationsData, ListGoogleBusinessLocationsError, ListGoogleBusinessLocationsResponse, SelectGoogleBusinessLocationData, SelectGoogleBusinessLocationError, SelectGoogleBusinessLocationResponse, GetGoogleBusinessReviewsData, GetGoogleBusinessReviewsError, GetGoogleBusinessReviewsResponse, GetGoogleBusinessFoodMenusData, GetGoogleBusinessFoodMenusError, GetGoogleBusinessFoodMenusResponse, UpdateGoogleBusinessFoodMenusData, UpdateGoogleBusinessFoodMenusError, UpdateGoogleBusinessFoodMenusResponse, GetGoogleBusinessLocationDetailsData, GetGoogleBusinessLocationDetailsError, GetGoogleBusinessLocationDetailsResponse, UpdateGoogleBusinessLocationDetailsData, UpdateGoogleBusinessLocationDetailsError, UpdateGoogleBusinessLocationDetailsResponse, ListGoogleBusinessMediaData, ListGoogleBusinessMediaError, ListGoogleBusinessMediaResponse, CreateGoogleBusinessMediaData, CreateGoogleBusinessMediaError, CreateGoogleBusinessMediaResponse, DeleteGoogleBusinessMediaData, DeleteGoogleBusinessMediaError, DeleteGoogleBusinessMediaResponse, GetGoogleBusinessAttributesData, GetGoogleBusinessAttributesError, GetGoogleBusinessAttributesResponse, UpdateGoogleBusinessAttributesData, UpdateGoogleBusinessAttributesError, UpdateGoogleBusinessAttributesResponse, ListGoogleBusinessPlaceActionsData, ListGoogleBusinessPlaceActionsError, ListGoogleBusinessPlaceActionsResponse, CreateGoogleBusinessPlaceActionData, CreateGoogleBusinessPlaceActionError, CreateGoogleBusinessPlaceActionResponse, DeleteGoogleBusinessPlaceActionData, DeleteGoogleBusinessPlaceActionError, DeleteGoogleBusinessPlaceActionResponse, UpdateGoogleBusinessPlaceActionData, UpdateGoogleBusinessPlaceActionError, UpdateGoogleBusinessPlaceActionResponse, GetGoogleBusinessServicesData, GetGoogleBusinessServicesError, GetGoogleBusinessServicesResponse, UpdateGoogleBusinessServicesData, UpdateGoogleBusinessServicesError, UpdateGoogleBusinessServicesResponse, BatchGetGoogleBusinessReviewsData, BatchGetGoogleBusinessReviewsError, BatchGetGoogleBusinessReviewsResponse, ReplyToGoogleBusinessReviewData, ReplyToGoogleBusinessReviewError, ReplyToGoogleBusinessReviewResponse, DeleteGoogleBusinessReviewReplyData, DeleteGoogleBusinessReviewReplyError, DeleteGoogleBusinessReviewReplyResponse, GetPendingOAuthDataData, GetPendingOAuthDataError, GetPendingOAuthDataResponse, ListLinkedInOrganizationsData, ListLinkedInOrganizationsError, ListLinkedInOrganizationsResponse, SelectLinkedInOrganizationData, SelectLinkedInOrganizationError, SelectLinkedInOrganizationResponse, ListPinterestBoardsForSelectionData, ListPinterestBoardsForSelectionError, ListPinterestBoardsForSelectionResponse, SelectPinterestBoardData, SelectPinterestBoardError, SelectPinterestBoardResponse, ListSnapchatProfilesData, ListSnapchatProfilesError, ListSnapchatProfilesResponse, SelectSnapchatProfileData, SelectSnapchatProfileError, SelectSnapchatProfileResponse, ConnectBlueskyCredentialsData, ConnectBlueskyCredentialsError, ConnectBlueskyCredentialsResponse, ConnectWhatsAppCredentialsData, ConnectWhatsAppCredentialsError, ConnectWhatsAppCredentialsResponse, ListWhatsAppPhoneNumbersData, ListWhatsAppPhoneNumbersError, ListWhatsAppPhoneNumbersResponse, CompleteWhatsAppPhoneSelectionData, CompleteWhatsAppPhoneSelectionError, CompleteWhatsAppPhoneSelectionResponse, GetTelegramConnectStatusData, GetTelegramConnectStatusError, GetTelegramConnectStatusResponse, InitiateTelegramConnectData, InitiateTelegramConnectError, InitiateTelegramConnectResponse, CompleteTelegramConnectData, CompleteTelegramConnectError, CompleteTelegramConnectResponse, GetFacebookPagesData, GetFacebookPagesError, GetFacebookPagesResponse, UpdateFacebookPageData, UpdateFacebookPageError, UpdateFacebookPageResponse, GetLinkedInOrganizationsData, GetLinkedInOrganizationsError, GetLinkedInOrganizationsResponse, GetLinkedInAggregateAnalyticsData, GetLinkedInAggregateAnalyticsError, GetLinkedInAggregateAnalyticsResponse, GetLinkedInPostAnalyticsData, GetLinkedInPostAnalyticsError, GetLinkedInPostAnalyticsResponse, GetLinkedInPostReactionsData, GetLinkedInPostReactionsError, GetLinkedInPostReactionsResponse, UpdateLinkedInOrganizationData, UpdateLinkedInOrganizationError, UpdateLinkedInOrganizationResponse, GetLinkedInMentionsData, GetLinkedInMentionsError, GetLinkedInMentionsResponse, ListInstagramStoriesData, ListInstagramStoriesError, ListInstagramStoriesResponse, GetInstagramStoryInsightsData, GetInstagramStoryInsightsError, GetInstagramStoryInsightsResponse, GetPinterestBoardsData, GetPinterestBoardsError, GetPinterestBoardsResponse, UpdatePinterestBoardsData, UpdatePinterestBoardsError, UpdatePinterestBoardsResponse, GetYoutubePlaylistsData, GetYoutubePlaylistsError, GetYoutubePlaylistsResponse, UpdateYoutubeDefaultPlaylistData, UpdateYoutubeDefaultPlaylistError, UpdateYoutubeDefaultPlaylistResponse, GetGmbLocationsData, GetGmbLocationsError, GetGmbLocationsResponse, UpdateGmbLocationData, UpdateGmbLocationError, UpdateGmbLocationResponse, GetRedditSubredditsData, GetRedditSubredditsError, GetRedditSubredditsResponse, UpdateRedditSubredditsData, UpdateRedditSubredditsError, UpdateRedditSubredditsResponse, GetRedditFlairsData, GetRedditFlairsError, GetRedditFlairsResponse, GetDiscordSettingsData, GetDiscordSettingsError, GetDiscordSettingsResponse, UpdateDiscordSettingsData, UpdateDiscordSettingsError, UpdateDiscordSettingsResponse, GetDiscordChannelsData, GetDiscordChannelsError, GetDiscordChannelsResponse, ListQueueSlotsData, ListQueueSlotsError, ListQueueSlotsResponse, CreateQueueSlotData, CreateQueueSlotError, CreateQueueSlotResponse, UpdateQueueSlotData, UpdateQueueSlotError, UpdateQueueSlotResponse, DeleteQueueSlotData, DeleteQueueSlotError, DeleteQueueSlotResponse, PreviewQueueData, PreviewQueueError, PreviewQueueResponse, GetNextQueueSlotData, GetNextQueueSlotError, GetNextQueueSlotResponse, GetWebhookSettingsError, GetWebhookSettingsResponse, CreateWebhookSettingsData, CreateWebhookSettingsError, CreateWebhookSettingsResponse, UpdateWebhookSettingsData, UpdateWebhookSettingsError, UpdateWebhookSettingsResponse, DeleteWebhookSettingsData, DeleteWebhookSettingsError, DeleteWebhookSettingsResponse, TestWebhookData, TestWebhookError, TestWebhookResponse, ListLogsData, ListLogsError, ListLogsResponse, ListInboxConversationsData, ListInboxConversationsError, ListInboxConversationsResponse, CreateInboxConversationData, CreateInboxConversationError, CreateInboxConversationResponse, GetInboxConversationData, GetInboxConversationError, GetInboxConversationResponse, UpdateInboxConversationData, UpdateInboxConversationError, UpdateInboxConversationResponse, GetInboxConversationMessagesData, GetInboxConversationMessagesError, GetInboxConversationMessagesResponse, SendInboxMessageData, SendInboxMessageError, SendInboxMessageResponse, EditInboxMessageData, EditInboxMessageError, EditInboxMessageResponse, DeleteInboxMessageData, DeleteInboxMessageError, DeleteInboxMessageResponse, SendTypingIndicatorData, SendTypingIndicatorError, SendTypingIndicatorResponse, AddMessageReactionData, AddMessageReactionError, AddMessageReactionResponse, RemoveMessageReactionData, RemoveMessageReactionError, RemoveMessageReactionResponse, UploadMediaDirectData, UploadMediaDirectError, UploadMediaDirectResponse, GetMessengerMenuData, GetMessengerMenuError, GetMessengerMenuResponse, SetMessengerMenuData, SetMessengerMenuError, SetMessengerMenuResponse, DeleteMessengerMenuData, DeleteMessengerMenuError, DeleteMessengerMenuResponse, GetInstagramIceBreakersData, GetInstagramIceBreakersError, GetInstagramIceBreakersResponse, SetInstagramIceBreakersData, SetInstagramIceBreakersError, SetInstagramIceBreakersResponse, DeleteInstagramIceBreakersData, DeleteInstagramIceBreakersError, DeleteInstagramIceBreakersResponse, GetTelegramCommandsData, GetTelegramCommandsError, GetTelegramCommandsResponse, SetTelegramCommandsData, SetTelegramCommandsError, SetTelegramCommandsResponse, DeleteTelegramCommandsData, DeleteTelegramCommandsError, DeleteTelegramCommandsResponse, ListInboxCommentsData, ListInboxCommentsError, ListInboxCommentsResponse, GetInboxPostCommentsData, GetInboxPostCommentsError, GetInboxPostCommentsResponse, ReplyToInboxPostData, ReplyToInboxPostError, ReplyToInboxPostResponse, DeleteInboxCommentData, DeleteInboxCommentError, DeleteInboxCommentResponse, HideInboxCommentData, HideInboxCommentError, HideInboxCommentResponse, UnhideInboxCommentData, UnhideInboxCommentError, UnhideInboxCommentResponse, LikeInboxCommentData, LikeInboxCommentError, LikeInboxCommentResponse, UnlikeInboxCommentData, UnlikeInboxCommentError, UnlikeInboxCommentResponse, SendPrivateReplyToCommentData, SendPrivateReplyToCommentError, SendPrivateReplyToCommentResponse, RetweetPostData, RetweetPostError, RetweetPostResponse, UndoRetweetData, UndoRetweetError, UndoRetweetResponse, BookmarkPostData, BookmarkPostError, BookmarkPostResponse, RemoveBookmarkData, RemoveBookmarkError, RemoveBookmarkResponse, FollowUserData, FollowUserError, FollowUserResponse, UnfollowUserData, UnfollowUserError, UnfollowUserResponse, ListInboxReviewsData, ListInboxReviewsError, ListInboxReviewsResponse, ReplyToInboxReviewData, ReplyToInboxReviewError, ReplyToInboxReviewResponse, DeleteInboxReviewReplyData, DeleteInboxReviewReplyError, DeleteInboxReviewReplyResponse, GetWhatsAppTemplatesData, GetWhatsAppTemplatesError, GetWhatsAppTemplatesResponse, CreateWhatsAppTemplateData, CreateWhatsAppTemplateError, CreateWhatsAppTemplateResponse, GetWhatsAppTemplateData, GetWhatsAppTemplateError, GetWhatsAppTemplateResponse, UpdateWhatsAppTemplateData, UpdateWhatsAppTemplateError, UpdateWhatsAppTemplateResponse, DeleteWhatsAppTemplateData, DeleteWhatsAppTemplateError, DeleteWhatsAppTemplateResponse, GetWhatsAppBusinessProfileData, GetWhatsAppBusinessProfileError, GetWhatsAppBusinessProfileResponse, UpdateWhatsAppBusinessProfileData, UpdateWhatsAppBusinessProfileError, UpdateWhatsAppBusinessProfileResponse, UploadWhatsAppProfilePhotoData, UploadWhatsAppProfilePhotoError, UploadWhatsAppProfilePhotoResponse, GetWhatsAppDisplayNameData, GetWhatsAppDisplayNameError, GetWhatsAppDisplayNameResponse, UpdateWhatsAppDisplayNameData, UpdateWhatsAppDisplayNameError, UpdateWhatsAppDisplayNameResponse, GetWhatsAppPhoneNumbersData, GetWhatsAppPhoneNumbersError, GetWhatsAppPhoneNumbersResponse, PurchaseWhatsAppPhoneNumberData, PurchaseWhatsAppPhoneNumberError, PurchaseWhatsAppPhoneNumberResponse, GetWhatsAppPhoneNumberData, GetWhatsAppPhoneNumberError, GetWhatsAppPhoneNumberResponse, ReleaseWhatsAppPhoneNumberData, ReleaseWhatsAppPhoneNumberError, ReleaseWhatsAppPhoneNumberResponse, ListWhatsAppGroupChatsData, ListWhatsAppGroupChatsError, ListWhatsAppGroupChatsResponse, CreateWhatsAppGroupChatData, CreateWhatsAppGroupChatError, CreateWhatsAppGroupChatResponse, GetWhatsAppGroupChatData, GetWhatsAppGroupChatError, GetWhatsAppGroupChatResponse, UpdateWhatsAppGroupChatData, UpdateWhatsAppGroupChatError, UpdateWhatsAppGroupChatResponse, DeleteWhatsAppGroupChatData, DeleteWhatsAppGroupChatError, DeleteWhatsAppGroupChatResponse, AddWhatsAppGroupParticipantsData, AddWhatsAppGroupParticipantsError, AddWhatsAppGroupParticipantsResponse, RemoveWhatsAppGroupParticipantsData, RemoveWhatsAppGroupParticipantsError, RemoveWhatsAppGroupParticipantsResponse, CreateWhatsAppGroupInviteLinkData, CreateWhatsAppGroupInviteLinkError, CreateWhatsAppGroupInviteLinkResponse, ListWhatsAppGroupJoinRequestsData, ListWhatsAppGroupJoinRequestsError, ListWhatsAppGroupJoinRequestsResponse, ApproveWhatsAppGroupJoinRequestsData, ApproveWhatsAppGroupJoinRequestsError, ApproveWhatsAppGroupJoinRequestsResponse, RejectWhatsAppGroupJoinRequestsData, RejectWhatsAppGroupJoinRequestsError, RejectWhatsAppGroupJoinRequestsResponse, ListWhatsAppFlowsData, ListWhatsAppFlowsError, ListWhatsAppFlowsResponse, CreateWhatsAppFlowData, CreateWhatsAppFlowError, CreateWhatsAppFlowResponse, GetWhatsAppFlowData, GetWhatsAppFlowError, GetWhatsAppFlowResponse, UpdateWhatsAppFlowData, UpdateWhatsAppFlowError, UpdateWhatsAppFlowResponse, DeleteWhatsAppFlowData, DeleteWhatsAppFlowError, DeleteWhatsAppFlowResponse, GetWhatsAppFlowJsonData, GetWhatsAppFlowJsonError, GetWhatsAppFlowJsonResponse, UploadWhatsAppFlowJsonData, UploadWhatsAppFlowJsonError, UploadWhatsAppFlowJsonResponse, PublishWhatsAppFlowData, PublishWhatsAppFlowError, PublishWhatsAppFlowResponse, DeprecateWhatsAppFlowData, DeprecateWhatsAppFlowError, DeprecateWhatsAppFlowResponse, SendWhatsAppFlowMessageData, SendWhatsAppFlowMessageError, SendWhatsAppFlowMessageResponse, ListContactsData, ListContactsError, ListContactsResponse, CreateContactData, CreateContactError, CreateContactResponse, GetContactData, GetContactError, GetContactResponse, UpdateContactData, UpdateContactError, UpdateContactResponse, DeleteContactData, DeleteContactError, DeleteContactResponse, GetContactChannelsData, GetContactChannelsError, GetContactChannelsResponse, BulkCreateContactsData, BulkCreateContactsError, BulkCreateContactsResponse, SetContactFieldValueData, SetContactFieldValueError, SetContactFieldValueResponse, ClearContactFieldValueData, ClearContactFieldValueError, ClearContactFieldValueResponse, ListCustomFieldsData, ListCustomFieldsError, ListCustomFieldsResponse, CreateCustomFieldData, CreateCustomFieldError, CreateCustomFieldResponse, UpdateCustomFieldData, UpdateCustomFieldError, UpdateCustomFieldResponse, DeleteCustomFieldData, DeleteCustomFieldError, DeleteCustomFieldResponse, ListBroadcastsData, ListBroadcastsError, ListBroadcastsResponse, CreateBroadcastData, CreateBroadcastError, CreateBroadcastResponse, GetBroadcastData, GetBroadcastError, GetBroadcastResponse, UpdateBroadcastData, UpdateBroadcastError, UpdateBroadcastResponse, DeleteBroadcastData, DeleteBroadcastError, DeleteBroadcastResponse, SendBroadcastData, SendBroadcastError, SendBroadcastResponse, ScheduleBroadcastData, ScheduleBroadcastError, ScheduleBroadcastResponse, CancelBroadcastData, CancelBroadcastError, CancelBroadcastResponse, ListBroadcastRecipientsData, ListBroadcastRecipientsError, ListBroadcastRecipientsResponse, AddBroadcastRecipientsData, AddBroadcastRecipientsError, AddBroadcastRecipientsResponse, ListSequencesData, ListSequencesError, ListSequencesResponse, CreateSequenceData, CreateSequenceError, CreateSequenceResponse, GetSequenceData, GetSequenceError, GetSequenceResponse, UpdateSequenceData, UpdateSequenceError, UpdateSequenceResponse, DeleteSequenceData, DeleteSequenceError, DeleteSequenceResponse, ActivateSequenceData, ActivateSequenceError, ActivateSequenceResponse, PauseSequenceData, PauseSequenceError, PauseSequenceResponse, EnrollContactsData, EnrollContactsError, EnrollContactsResponse, UnenrollContactData, UnenrollContactError, UnenrollContactResponse, ListSequenceEnrollmentsData, ListSequenceEnrollmentsError, ListSequenceEnrollmentsResponse, ListCommentAutomationsData, ListCommentAutomationsError, ListCommentAutomationsResponse, CreateCommentAutomationData, CreateCommentAutomationError, CreateCommentAutomationResponse, GetCommentAutomationData, GetCommentAutomationError, GetCommentAutomationResponse, UpdateCommentAutomationData, UpdateCommentAutomationError, UpdateCommentAutomationResponse, DeleteCommentAutomationData, DeleteCommentAutomationError, DeleteCommentAutomationResponse, ListCommentAutomationLogsData, ListCommentAutomationLogsError, ListCommentAutomationLogsResponse, ListAdsData, ListAdsError, ListAdsResponse, ListAdCampaignsData, ListAdCampaignsError, ListAdCampaignsResponse, UpdateAdCampaignStatusData, UpdateAdCampaignStatusError, UpdateAdCampaignStatusResponse, UpdateAdCampaignData, UpdateAdCampaignError, UpdateAdCampaignResponse, DeleteAdCampaignData, DeleteAdCampaignError, DeleteAdCampaignResponse, BulkUpdateAdCampaignStatusData, BulkUpdateAdCampaignStatusError, BulkUpdateAdCampaignStatusResponse, DuplicateAdCampaignData, DuplicateAdCampaignError, DuplicateAdCampaignResponse, UpdateAdSetData, UpdateAdSetError, UpdateAdSetResponse, UpdateAdSetStatusData, UpdateAdSetStatusError, UpdateAdSetStatusResponse, GetAdTreeData, GetAdTreeError, GetAdTreeResponse, GetAdsTimelineData, GetAdsTimelineError, GetAdsTimelineResponse, GetAdData, GetAdError, GetAdResponse, UpdateAdData, UpdateAdError, UpdateAdResponse, DeleteAdData, DeleteAdError, DeleteAdResponse, GetAdAnalyticsData, GetAdAnalyticsError, GetAdAnalyticsResponse, GetAdCommentsData, GetAdCommentsError, GetAdCommentsResponse, ListAdsBusinessCentersData, ListAdsBusinessCentersError, ListAdsBusinessCentersResponse, ListAdAccountsData, ListAdAccountsError, ListAdAccountsResponse, BoostPostData, BoostPostError, BoostPostResponse, CreateStandaloneAdData, CreateStandaloneAdError, CreateStandaloneAdResponse, SearchAdInterestsData, SearchAdInterestsError, SearchAdInterestsResponse, SearchAdTargetingLocationsData, SearchAdTargetingLocationsError, SearchAdTargetingLocationsResponse, ListAdAudiencesData, ListAdAudiencesError, ListAdAudiencesResponse, CreateAdAudienceData, CreateAdAudienceError, CreateAdAudienceResponse, GetAdAudienceData, GetAdAudienceError, GetAdAudienceResponse, DeleteAdAudienceData, DeleteAdAudienceError, DeleteAdAudienceResponse, AddUsersToAdAudienceData, AddUsersToAdAudienceError, AddUsersToAdAudienceResponse, SendConversionsData, SendConversionsError, SendConversionsResponse, ListConversionDestinationsData, ListConversionDestinationsError, ListConversionDestinationsResponse, CreateConversionDestinationData, CreateConversionDestinationError, CreateConversionDestinationResponse, GetConversionDestinationData, GetConversionDestinationError, GetConversionDestinationResponse, UpdateConversionDestinationData, UpdateConversionDestinationError, UpdateConversionDestinationResponse, DeleteConversionDestinationData, DeleteConversionDestinationError, DeleteConversionDestinationResponse, ListConversionAssociationsData, ListConversionAssociationsError, ListConversionAssociationsResponse, AddConversionAssociationsData, AddConversionAssociationsError, AddConversionAssociationsResponse, RemoveConversionAssociationsData, RemoveConversionAssociationsError, RemoveConversionAssociationsResponse, GetConversionMetricsData, GetConversionMetricsError, GetConversionMetricsResponse, SendWhatsAppConversionData, SendWhatsAppConversionError, SendWhatsAppConversionResponse, CreateCtwaAdData, CreateCtwaAdError, CreateCtwaAdResponse, ListTrackingTagsData, ListTrackingTagsError, ListTrackingTagsResponse, CreateTrackingTagData, CreateTrackingTagError, CreateTrackingTagResponse, GetTrackingTagData, GetTrackingTagError, GetTrackingTagResponse, UpdateTrackingTagData, UpdateTrackingTagError, UpdateTrackingTagResponse, ListTrackingTagSharedAccountsData, ListTrackingTagSharedAccountsError, ListTrackingTagSharedAccountsResponse, AddTrackingTagSharedAccountData, AddTrackingTagSharedAccountError, AddTrackingTagSharedAccountResponse, RemoveTrackingTagSharedAccountData, RemoveTrackingTagSharedAccountError, RemoveTrackingTagSharedAccountResponse, GetTrackingTagStatsData, GetTrackingTagStatsError, GetTrackingTagStatsResponse } from './types.gen'; +import { type Client, formDataBodySerializer, type Options as Options2, type TDataShape } from './client'; +import { client } from './client.gen'; +import type { ActivateSequenceData, ActivateSequenceErrors, ActivateSequenceResponses, AddBroadcastRecipientsData, AddBroadcastRecipientsErrors, AddBroadcastRecipientsResponses, AddConversionAssociationsData, AddConversionAssociationsErrors, AddConversionAssociationsResponses, AddMessageReactionData, AddMessageReactionErrors, AddMessageReactionResponses, AddTrackingTagSharedAccountData, AddTrackingTagSharedAccountErrors, AddTrackingTagSharedAccountResponses, AddUsersToAdAudienceData, AddUsersToAdAudienceErrors, AddUsersToAdAudienceResponses, AddWhatsAppGroupParticipantsData, AddWhatsAppGroupParticipantsErrors, AddWhatsAppGroupParticipantsResponses, ApproveWhatsAppGroupJoinRequestsData, ApproveWhatsAppGroupJoinRequestsErrors, ApproveWhatsAppGroupJoinRequestsResponses, BatchGetGoogleBusinessReviewsData, BatchGetGoogleBusinessReviewsErrors, BatchGetGoogleBusinessReviewsResponses, BookmarkPostData, BookmarkPostErrors, BookmarkPostResponses, BoostPostData, BoostPostErrors, BoostPostResponses, BulkCreateContactsData, BulkCreateContactsErrors, BulkCreateContactsResponses, BulkUpdateAdCampaignStatusData, BulkUpdateAdCampaignStatusErrors, BulkUpdateAdCampaignStatusResponses, BulkUploadPostsData, BulkUploadPostsErrors, BulkUploadPostsResponses, CancelBroadcastData, CancelBroadcastErrors, CancelBroadcastResponses, ClearContactFieldValueData, ClearContactFieldValueErrors, ClearContactFieldValueResponses, CompleteTelegramConnectData, CompleteTelegramConnectErrors, CompleteTelegramConnectResponses, CompleteWhatsAppPhoneSelectionData, CompleteWhatsAppPhoneSelectionErrors, CompleteWhatsAppPhoneSelectionResponses, ConfigureTikTokAdsBrandIdentityData, ConfigureTikTokAdsBrandIdentityErrors, ConfigureTikTokAdsBrandIdentityResponses, ConnectAdsData, ConnectAdsErrors, ConnectAdsResponses, ConnectBlueskyCredentialsData, ConnectBlueskyCredentialsErrors, ConnectBlueskyCredentialsResponses, ConnectWhatsAppCredentialsData, ConnectWhatsAppCredentialsErrors, ConnectWhatsAppCredentialsResponses, CreateAccountGroupData, CreateAccountGroupErrors, CreateAccountGroupResponses, CreateAdAudienceData, CreateAdAudienceErrors, CreateAdAudienceResponses, CreateApiKeyData, CreateApiKeyErrors, CreateApiKeyResponses, CreateBroadcastData, CreateBroadcastErrors, CreateBroadcastResponses, CreateCommentAutomationData, CreateCommentAutomationErrors, CreateCommentAutomationResponses, CreateContactData, CreateContactErrors, CreateContactResponses, CreateConversionDestinationData, CreateConversionDestinationErrors, CreateConversionDestinationResponses, CreateCtwaAdData, CreateCtwaAdErrors, CreateCtwaAdResponses, CreateCustomFieldData, CreateCustomFieldErrors, CreateCustomFieldResponses, CreateGoogleBusinessMediaData, CreateGoogleBusinessMediaErrors, CreateGoogleBusinessMediaResponses, CreateGoogleBusinessPlaceActionData, CreateGoogleBusinessPlaceActionErrors, CreateGoogleBusinessPlaceActionResponses, CreateInboxConversationData, CreateInboxConversationErrors, CreateInboxConversationResponses, CreateInviteTokenData, CreateInviteTokenErrors, CreateInviteTokenResponses, CreatePostData, CreatePostErrors, CreatePostResponses, CreateProfileData, CreateProfileErrors, CreateProfileResponses, CreateQueueSlotData, CreateQueueSlotErrors, CreateQueueSlotResponses, CreateSequenceData, CreateSequenceErrors, CreateSequenceResponses, CreateStandaloneAdData, CreateStandaloneAdErrors, CreateStandaloneAdResponses, CreateTrackingTagData, CreateTrackingTagErrors, CreateTrackingTagResponses, CreateWebhookSettingsData, CreateWebhookSettingsErrors, CreateWebhookSettingsResponses, CreateWhatsAppFlowData, CreateWhatsAppFlowErrors, CreateWhatsAppFlowResponses, CreateWhatsAppGroupChatData, CreateWhatsAppGroupChatErrors, CreateWhatsAppGroupChatResponses, CreateWhatsAppGroupInviteLinkData, CreateWhatsAppGroupInviteLinkErrors, CreateWhatsAppGroupInviteLinkResponses, CreateWhatsAppTemplateData, CreateWhatsAppTemplateErrors, CreateWhatsAppTemplateResponses, DeleteAccountData, DeleteAccountErrors, DeleteAccountGroupData, DeleteAccountGroupErrors, DeleteAccountGroupResponses, DeleteAccountResponses, DeleteAdAudienceData, DeleteAdAudienceErrors, DeleteAdAudienceResponses, DeleteAdCampaignData, DeleteAdCampaignErrors, DeleteAdCampaignResponses, DeleteAdData, DeleteAdErrors, DeleteAdResponses, DeleteApiKeyData, DeleteApiKeyErrors, DeleteApiKeyResponses, DeleteBroadcastData, DeleteBroadcastErrors, DeleteBroadcastResponses, DeleteCommentAutomationData, DeleteCommentAutomationErrors, DeleteCommentAutomationResponses, DeleteContactData, DeleteContactErrors, DeleteContactResponses, DeleteConversionDestinationData, DeleteConversionDestinationErrors, DeleteConversionDestinationResponses, DeleteCustomFieldData, DeleteCustomFieldErrors, DeleteCustomFieldResponses, DeleteGoogleBusinessMediaData, DeleteGoogleBusinessMediaErrors, DeleteGoogleBusinessMediaResponses, DeleteGoogleBusinessPlaceActionData, DeleteGoogleBusinessPlaceActionErrors, DeleteGoogleBusinessPlaceActionResponses, DeleteGoogleBusinessReviewReplyData, DeleteGoogleBusinessReviewReplyErrors, DeleteGoogleBusinessReviewReplyResponses, DeleteInboxCommentData, DeleteInboxCommentErrors, DeleteInboxCommentResponses, DeleteInboxMessageData, DeleteInboxMessageErrors, DeleteInboxMessageResponses, DeleteInboxReviewReplyData, DeleteInboxReviewReplyErrors, DeleteInboxReviewReplyResponses, DeleteInstagramIceBreakersData, DeleteInstagramIceBreakersErrors, DeleteInstagramIceBreakersResponses, DeleteMessengerMenuData, DeleteMessengerMenuErrors, DeleteMessengerMenuResponses, DeletePostData, DeletePostErrors, DeletePostResponses, DeleteProfileData, DeleteProfileErrors, DeleteProfileResponses, DeleteQueueSlotData, DeleteQueueSlotErrors, DeleteQueueSlotResponses, DeleteSequenceData, DeleteSequenceErrors, DeleteSequenceResponses, DeleteTelegramCommandsData, DeleteTelegramCommandsErrors, DeleteTelegramCommandsResponses, DeleteWebhookSettingsData, DeleteWebhookSettingsErrors, DeleteWebhookSettingsResponses, DeleteWhatsAppFlowData, DeleteWhatsAppFlowErrors, DeleteWhatsAppFlowResponses, DeleteWhatsAppGroupChatData, DeleteWhatsAppGroupChatErrors, DeleteWhatsAppGroupChatResponses, DeleteWhatsAppTemplateData, DeleteWhatsAppTemplateErrors, DeleteWhatsAppTemplateResponses, DeprecateWhatsAppFlowData, DeprecateWhatsAppFlowErrors, DeprecateWhatsAppFlowResponses, DuplicateAdCampaignData, DuplicateAdCampaignErrors, DuplicateAdCampaignResponses, EditInboxMessageData, EditInboxMessageErrors, EditInboxMessageResponses, EditPostData, EditPostErrors, EditPostResponses, EnrollContactsData, EnrollContactsErrors, EnrollContactsResponses, FollowUserData, FollowUserErrors, FollowUserResponses, GetAccountHealthData, GetAccountHealthErrors, GetAccountHealthResponses, GetAdAnalyticsData, GetAdAnalyticsErrors, GetAdAnalyticsResponses, GetAdAudienceData, GetAdAudienceErrors, GetAdAudienceResponses, GetAdCommentsData, GetAdCommentsErrors, GetAdCommentsResponses, GetAdData, GetAdErrors, GetAdResponses, GetAdsTimelineData, GetAdsTimelineErrors, GetAdsTimelineResponses, GetAdTreeData, GetAdTreeErrors, GetAdTreeResponses, GetAllAccountsHealthData, GetAllAccountsHealthErrors, GetAllAccountsHealthResponses, GetAnalyticsData, GetAnalyticsErrors, GetAnalyticsResponses, GetBestTimeToPostData, GetBestTimeToPostErrors, GetBestTimeToPostResponses, GetBroadcastData, GetBroadcastErrors, GetBroadcastResponses, GetCommentAutomationData, GetCommentAutomationErrors, GetCommentAutomationResponses, GetConnectUrlData, GetConnectUrlErrors, GetConnectUrlResponses, GetContactChannelsData, GetContactChannelsErrors, GetContactChannelsResponses, GetContactData, GetContactErrors, GetContactResponses, GetContentDecayData, GetContentDecayErrors, GetContentDecayResponses, GetConversionDestinationData, GetConversionDestinationErrors, GetConversionDestinationResponses, GetConversionMetricsData, GetConversionMetricsErrors, GetConversionMetricsResponses, GetDailyMetricsData, GetDailyMetricsErrors, GetDailyMetricsResponses, GetDiscordChannelsData, GetDiscordChannelsErrors, GetDiscordChannelsResponses, GetDiscordSettingsData, GetDiscordSettingsErrors, GetDiscordSettingsResponses, GetFacebookPageInsightsData, GetFacebookPageInsightsErrors, GetFacebookPageInsightsResponses, GetFacebookPagesData, GetFacebookPagesErrors, GetFacebookPagesResponses, GetFollowerStatsData, GetFollowerStatsErrors, GetFollowerStatsResponses, GetGmbLocationsData, GetGmbLocationsErrors, GetGmbLocationsResponses, GetGoogleBusinessAttributesData, GetGoogleBusinessAttributesErrors, GetGoogleBusinessAttributesResponses, GetGoogleBusinessFoodMenusData, GetGoogleBusinessFoodMenusErrors, GetGoogleBusinessFoodMenusResponses, GetGoogleBusinessLocationDetailsData, GetGoogleBusinessLocationDetailsErrors, GetGoogleBusinessLocationDetailsResponses, GetGoogleBusinessPerformanceData, GetGoogleBusinessPerformanceErrors, GetGoogleBusinessPerformanceResponses, GetGoogleBusinessReviewsData, GetGoogleBusinessReviewsErrors, GetGoogleBusinessReviewsResponses, GetGoogleBusinessSearchKeywordsData, GetGoogleBusinessSearchKeywordsErrors, GetGoogleBusinessSearchKeywordsResponses, GetGoogleBusinessServicesData, GetGoogleBusinessServicesErrors, GetGoogleBusinessServicesResponses, GetInboxConversationData, GetInboxConversationErrors, GetInboxConversationMessagesData, GetInboxConversationMessagesErrors, GetInboxConversationMessagesResponses, GetInboxConversationResponses, GetInboxPostCommentsData, GetInboxPostCommentsErrors, GetInboxPostCommentsResponses, GetInstagramAccountInsightsData, GetInstagramAccountInsightsErrors, GetInstagramAccountInsightsResponses, GetInstagramDemographicsData, GetInstagramDemographicsErrors, GetInstagramDemographicsResponses, GetInstagramFollowerHistoryData, GetInstagramFollowerHistoryErrors, GetInstagramFollowerHistoryResponses, GetInstagramIceBreakersData, GetInstagramIceBreakersErrors, GetInstagramIceBreakersResponses, GetInstagramStoryInsightsData, GetInstagramStoryInsightsErrors, GetInstagramStoryInsightsResponses, GetLinkedInAggregateAnalyticsData, GetLinkedInAggregateAnalyticsErrors, GetLinkedInAggregateAnalyticsResponses, GetLinkedInMentionsData, GetLinkedInMentionsErrors, GetLinkedInMentionsResponses, GetLinkedInOrgAggregateAnalyticsData, GetLinkedInOrgAggregateAnalyticsErrors, GetLinkedInOrgAggregateAnalyticsResponses, GetLinkedInOrganizationsData, GetLinkedInOrganizationsErrors, GetLinkedInOrganizationsResponses, GetLinkedInPostAnalyticsData, GetLinkedInPostAnalyticsErrors, GetLinkedInPostAnalyticsResponses, GetLinkedInPostReactionsData, GetLinkedInPostReactionsErrors, GetLinkedInPostReactionsResponses, GetMediaPresignedUrlData, GetMediaPresignedUrlErrors, GetMediaPresignedUrlResponses, GetMessengerMenuData, GetMessengerMenuErrors, GetMessengerMenuResponses, GetNextQueueSlotData, GetNextQueueSlotErrors, GetNextQueueSlotResponses, GetPendingOAuthDataData, GetPendingOAuthDataErrors, GetPendingOAuthDataResponses, GetPinterestBoardsData, GetPinterestBoardsErrors, GetPinterestBoardsResponses, GetPostData, GetPostErrors, GetPostingFrequencyData, GetPostingFrequencyErrors, GetPostingFrequencyResponses, GetPostResponses, GetPostTimelineData, GetPostTimelineErrors, GetPostTimelineResponses, GetProfileData, GetProfileErrors, GetProfileResponses, GetRedditFeedData, GetRedditFeedErrors, GetRedditFeedResponses, GetRedditFlairsData, GetRedditFlairsErrors, GetRedditFlairsResponses, GetRedditSubredditsData, GetRedditSubredditsErrors, GetRedditSubredditsResponses, GetSequenceData, GetSequenceErrors, GetSequenceResponses, GetTelegramCommandsData, GetTelegramCommandsErrors, GetTelegramCommandsResponses, GetTelegramConnectStatusData, GetTelegramConnectStatusErrors, GetTelegramConnectStatusResponses, GetTikTokAccountInsightsData, GetTikTokAccountInsightsErrors, GetTikTokAccountInsightsResponses, GetTikTokCreatorInfoData, GetTikTokCreatorInfoErrors, GetTikTokCreatorInfoResponses, GetTrackingTagData, GetTrackingTagErrors, GetTrackingTagResponses, GetTrackingTagStatsData, GetTrackingTagStatsErrors, GetTrackingTagStatsResponses, GetUsageStatsData, GetUsageStatsErrors, GetUsageStatsResponses, GetUserData, GetUserErrors, GetUserResponses, GetWebhookSettingsData, GetWebhookSettingsErrors, GetWebhookSettingsResponses, GetWhatsAppBusinessProfileData, GetWhatsAppBusinessProfileErrors, GetWhatsAppBusinessProfileResponses, GetWhatsAppDisplayNameData, GetWhatsAppDisplayNameErrors, GetWhatsAppDisplayNameResponses, GetWhatsAppFlowData, GetWhatsAppFlowErrors, GetWhatsAppFlowJsonData, GetWhatsAppFlowJsonErrors, GetWhatsAppFlowJsonResponses, GetWhatsAppFlowResponses, GetWhatsAppGroupChatData, GetWhatsAppGroupChatErrors, GetWhatsAppGroupChatResponses, GetWhatsAppPhoneNumberData, GetWhatsAppPhoneNumberErrors, GetWhatsAppPhoneNumberResponses, GetWhatsAppPhoneNumbersData, GetWhatsAppPhoneNumbersErrors, GetWhatsAppPhoneNumbersResponses, GetWhatsAppTemplateData, GetWhatsAppTemplateErrors, GetWhatsAppTemplateResponses, GetWhatsAppTemplatesData, GetWhatsAppTemplatesErrors, GetWhatsAppTemplatesResponses, GetXApiPricingData, GetXApiPricingErrors, GetXApiPricingResponses, GetYouTubeChannelInsightsData, GetYouTubeChannelInsightsErrors, GetYouTubeChannelInsightsResponses, GetYouTubeDailyViewsData, GetYouTubeDailyViewsErrors, GetYouTubeDailyViewsResponses, GetYouTubeDemographicsData, GetYouTubeDemographicsErrors, GetYouTubeDemographicsResponses, GetYoutubePlaylistsData, GetYoutubePlaylistsErrors, GetYoutubePlaylistsResponses, HandleOAuthCallbackData, HandleOAuthCallbackErrors, HandleOAuthCallbackResponses, HideInboxCommentData, HideInboxCommentErrors, HideInboxCommentResponses, InitiateTelegramConnectData, InitiateTelegramConnectErrors, InitiateTelegramConnectResponses, LikeInboxCommentData, LikeInboxCommentErrors, LikeInboxCommentResponses, ListAccountGroupsData, ListAccountGroupsErrors, ListAccountGroupsResponses, ListAccountsData, ListAccountsErrors, ListAccountsResponses, ListAdAccountsData, ListAdAccountsErrors, ListAdAccountsResponses, ListAdAudiencesData, ListAdAudiencesErrors, ListAdAudiencesResponses, ListAdCampaignsData, ListAdCampaignsErrors, ListAdCampaignsResponses, ListAdsBusinessCentersData, ListAdsBusinessCentersErrors, ListAdsBusinessCentersResponses, ListAdsData, ListAdsErrors, ListAdsResponses, ListApiKeysData, ListApiKeysErrors, ListApiKeysResponses, ListBroadcastRecipientsData, ListBroadcastRecipientsErrors, ListBroadcastRecipientsResponses, ListBroadcastsData, ListBroadcastsErrors, ListBroadcastsResponses, ListCommentAutomationLogsData, ListCommentAutomationLogsErrors, ListCommentAutomationLogsResponses, ListCommentAutomationsData, ListCommentAutomationsErrors, ListCommentAutomationsResponses, ListContactsData, ListContactsErrors, ListContactsResponses, ListConversionAssociationsData, ListConversionAssociationsErrors, ListConversionAssociationsResponses, ListConversionDestinationsData, ListConversionDestinationsErrors, ListConversionDestinationsResponses, ListCustomFieldsData, ListCustomFieldsErrors, ListCustomFieldsResponses, ListFacebookPagesData, ListFacebookPagesErrors, ListFacebookPagesResponses, ListGoogleBusinessLocationsData, ListGoogleBusinessLocationsErrors, ListGoogleBusinessLocationsResponses, ListGoogleBusinessMediaData, ListGoogleBusinessMediaErrors, ListGoogleBusinessMediaResponses, ListGoogleBusinessPlaceActionsData, ListGoogleBusinessPlaceActionsErrors, ListGoogleBusinessPlaceActionsResponses, ListInboxCommentsData, ListInboxCommentsErrors, ListInboxCommentsResponses, ListInboxConversationsData, ListInboxConversationsErrors, ListInboxConversationsResponses, ListInboxReviewsData, ListInboxReviewsErrors, ListInboxReviewsResponses, ListInstagramStoriesData, ListInstagramStoriesErrors, ListInstagramStoriesResponses, ListLinkedInOrganizationsData, ListLinkedInOrganizationsErrors, ListLinkedInOrganizationsResponses, ListLogsData, ListLogsErrors, ListLogsResponses, ListPinterestBoardsForSelectionData, ListPinterestBoardsForSelectionErrors, ListPinterestBoardsForSelectionResponses, ListPostsData, ListPostsErrors, ListPostsResponses, ListProfilesData, ListProfilesErrors, ListProfilesResponses, ListQueueSlotsData, ListQueueSlotsErrors, ListQueueSlotsResponses, ListSequenceEnrollmentsData, ListSequenceEnrollmentsErrors, ListSequenceEnrollmentsResponses, ListSequencesData, ListSequencesErrors, ListSequencesResponses, ListSnapchatProfilesData, ListSnapchatProfilesErrors, ListSnapchatProfilesResponses, ListTrackingTagsData, ListTrackingTagsErrors, ListTrackingTagSharedAccountsData, ListTrackingTagSharedAccountsErrors, ListTrackingTagSharedAccountsResponses, ListTrackingTagsResponses, ListUsersData, ListUsersErrors, ListUsersResponses, ListWhatsAppFlowsData, ListWhatsAppFlowsErrors, ListWhatsAppFlowsResponses, ListWhatsAppGroupChatsData, ListWhatsAppGroupChatsErrors, ListWhatsAppGroupChatsResponses, ListWhatsAppGroupJoinRequestsData, ListWhatsAppGroupJoinRequestsErrors, ListWhatsAppGroupJoinRequestsResponses, ListWhatsAppPhoneNumbersData, ListWhatsAppPhoneNumbersErrors, ListWhatsAppPhoneNumbersResponses, MoveAccountToProfileData, MoveAccountToProfileErrors, MoveAccountToProfileResponses, PauseSequenceData, PauseSequenceErrors, PauseSequenceResponses, PreviewQueueData, PreviewQueueErrors, PreviewQueueResponses, PublishWhatsAppFlowData, PublishWhatsAppFlowErrors, PublishWhatsAppFlowResponses, PurchaseWhatsAppPhoneNumberData, PurchaseWhatsAppPhoneNumberErrors, PurchaseWhatsAppPhoneNumberResponses, RejectWhatsAppGroupJoinRequestsData, RejectWhatsAppGroupJoinRequestsErrors, RejectWhatsAppGroupJoinRequestsResponses, ReleaseWhatsAppPhoneNumberData, ReleaseWhatsAppPhoneNumberErrors, ReleaseWhatsAppPhoneNumberResponses, RemoveBookmarkData, RemoveBookmarkErrors, RemoveBookmarkResponses, RemoveConversionAssociationsData, RemoveConversionAssociationsErrors, RemoveConversionAssociationsResponses, RemoveMessageReactionData, RemoveMessageReactionErrors, RemoveMessageReactionResponses, RemoveTrackingTagSharedAccountData, RemoveTrackingTagSharedAccountErrors, RemoveTrackingTagSharedAccountResponses, RemoveWhatsAppGroupParticipantsData, RemoveWhatsAppGroupParticipantsErrors, RemoveWhatsAppGroupParticipantsResponses, ReplyToGoogleBusinessReviewData, ReplyToGoogleBusinessReviewErrors, ReplyToGoogleBusinessReviewResponses, ReplyToInboxPostData, ReplyToInboxPostErrors, ReplyToInboxPostResponses, ReplyToInboxReviewData, ReplyToInboxReviewErrors, ReplyToInboxReviewResponses, RetryPostData, RetryPostErrors, RetryPostResponses, RetweetPostData, RetweetPostErrors, RetweetPostResponses, ScheduleBroadcastData, ScheduleBroadcastErrors, ScheduleBroadcastResponses, SearchAdInterestsData, SearchAdInterestsErrors, SearchAdInterestsResponses, SearchAdTargetingLocationsData, SearchAdTargetingLocationsErrors, SearchAdTargetingLocationsResponses, SearchRedditData, SearchRedditErrors, SearchRedditResponses, SelectFacebookPageData, SelectFacebookPageErrors, SelectFacebookPageResponses, SelectGoogleBusinessLocationData, SelectGoogleBusinessLocationErrors, SelectGoogleBusinessLocationResponses, SelectLinkedInOrganizationData, SelectLinkedInOrganizationErrors, SelectLinkedInOrganizationResponses, SelectPinterestBoardData, SelectPinterestBoardErrors, SelectPinterestBoardResponses, SelectSnapchatProfileData, SelectSnapchatProfileErrors, SelectSnapchatProfileResponses, SendBroadcastData, SendBroadcastErrors, SendBroadcastResponses, SendConversionsData, SendConversionsErrors, SendConversionsResponses, SendInboxMessageData, SendInboxMessageErrors, SendInboxMessageResponses, SendPrivateReplyToCommentData, SendPrivateReplyToCommentErrors, SendPrivateReplyToCommentResponses, SendTypingIndicatorData, SendTypingIndicatorErrors, SendTypingIndicatorResponses, SendWhatsAppConversionData, SendWhatsAppConversionErrors, SendWhatsAppConversionResponses, SendWhatsAppFlowMessageData, SendWhatsAppFlowMessageErrors, SendWhatsAppFlowMessageResponses, SetContactFieldValueData, SetContactFieldValueErrors, SetContactFieldValueResponses, SetInstagramIceBreakersData, SetInstagramIceBreakersErrors, SetInstagramIceBreakersResponses, SetMessengerMenuData, SetMessengerMenuErrors, SetMessengerMenuResponses, SetTelegramCommandsData, SetTelegramCommandsErrors, SetTelegramCommandsResponses, TestWebhookData, TestWebhookErrors, TestWebhookResponses, UndoRetweetData, UndoRetweetErrors, UndoRetweetResponses, UnenrollContactData, UnenrollContactErrors, UnenrollContactResponses, UnfollowUserData, UnfollowUserErrors, UnfollowUserResponses, UnhideInboxCommentData, UnhideInboxCommentErrors, UnhideInboxCommentResponses, UnlikeInboxCommentData, UnlikeInboxCommentErrors, UnlikeInboxCommentResponses, UnpublishPostData, UnpublishPostErrors, UnpublishPostResponses, UpdateAccountData, UpdateAccountErrors, UpdateAccountGroupData, UpdateAccountGroupErrors, UpdateAccountGroupResponses, UpdateAccountResponses, UpdateAdCampaignData, UpdateAdCampaignErrors, UpdateAdCampaignResponses, UpdateAdCampaignStatusData, UpdateAdCampaignStatusErrors, UpdateAdCampaignStatusResponses, UpdateAdData, UpdateAdErrors, UpdateAdResponses, UpdateAdSetData, UpdateAdSetErrors, UpdateAdSetResponses, UpdateAdSetStatusData, UpdateAdSetStatusErrors, UpdateAdSetStatusResponses, UpdateBroadcastData, UpdateBroadcastErrors, UpdateBroadcastResponses, UpdateCommentAutomationData, UpdateCommentAutomationErrors, UpdateCommentAutomationResponses, UpdateContactData, UpdateContactErrors, UpdateContactResponses, UpdateConversionDestinationData, UpdateConversionDestinationErrors, UpdateConversionDestinationResponses, UpdateCustomFieldData, UpdateCustomFieldErrors, UpdateCustomFieldResponses, UpdateDiscordSettingsData, UpdateDiscordSettingsErrors, UpdateDiscordSettingsResponses, UpdateFacebookPageData, UpdateFacebookPageErrors, UpdateFacebookPageResponses, UpdateGmbLocationData, UpdateGmbLocationErrors, UpdateGmbLocationResponses, UpdateGoogleBusinessAttributesData, UpdateGoogleBusinessAttributesErrors, UpdateGoogleBusinessAttributesResponses, UpdateGoogleBusinessFoodMenusData, UpdateGoogleBusinessFoodMenusErrors, UpdateGoogleBusinessFoodMenusResponses, UpdateGoogleBusinessLocationDetailsData, UpdateGoogleBusinessLocationDetailsErrors, UpdateGoogleBusinessLocationDetailsResponses, UpdateGoogleBusinessPlaceActionData, UpdateGoogleBusinessPlaceActionErrors, UpdateGoogleBusinessPlaceActionResponses, UpdateGoogleBusinessServicesData, UpdateGoogleBusinessServicesErrors, UpdateGoogleBusinessServicesResponses, UpdateInboxConversationData, UpdateInboxConversationErrors, UpdateInboxConversationResponses, UpdateLinkedInOrganizationData, UpdateLinkedInOrganizationErrors, UpdateLinkedInOrganizationResponses, UpdatePinterestBoardsData, UpdatePinterestBoardsErrors, UpdatePinterestBoardsResponses, UpdatePostData, UpdatePostErrors, UpdatePostMetadataData, UpdatePostMetadataErrors, UpdatePostMetadataResponses, UpdatePostResponses, UpdateProfileData, UpdateProfileErrors, UpdateProfileResponses, UpdateQueueSlotData, UpdateQueueSlotErrors, UpdateQueueSlotResponses, UpdateRedditSubredditsData, UpdateRedditSubredditsErrors, UpdateRedditSubredditsResponses, UpdateSequenceData, UpdateSequenceErrors, UpdateSequenceResponses, UpdateTrackingTagData, UpdateTrackingTagErrors, UpdateTrackingTagResponses, UpdateWebhookSettingsData, UpdateWebhookSettingsErrors, UpdateWebhookSettingsResponses, UpdateWhatsAppBusinessProfileData, UpdateWhatsAppBusinessProfileErrors, UpdateWhatsAppBusinessProfileResponses, UpdateWhatsAppDisplayNameData, UpdateWhatsAppDisplayNameErrors, UpdateWhatsAppDisplayNameResponses, UpdateWhatsAppFlowData, UpdateWhatsAppFlowErrors, UpdateWhatsAppFlowResponses, UpdateWhatsAppGroupChatData, UpdateWhatsAppGroupChatErrors, UpdateWhatsAppGroupChatResponses, UpdateWhatsAppTemplateData, UpdateWhatsAppTemplateErrors, UpdateWhatsAppTemplateResponses, UpdateYoutubeDefaultPlaylistData, UpdateYoutubeDefaultPlaylistErrors, UpdateYoutubeDefaultPlaylistResponses, UploadMediaDirectData, UploadMediaDirectErrors, UploadMediaDirectResponses, UploadWhatsAppFlowJsonData, UploadWhatsAppFlowJsonErrors, UploadWhatsAppFlowJsonResponses, UploadWhatsAppProfilePhotoData, UploadWhatsAppProfilePhotoErrors, UploadWhatsAppProfilePhotoResponses, ValidateMediaData, ValidateMediaResponses, ValidatePostData, ValidatePostLengthData, ValidatePostLengthResponses, ValidatePostResponses, ValidateSubredditData, ValidateSubredditResponses } from './types.gen'; -export const client = createClient(createConfig()); +export type Options = Options2 & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; /** * Validate character count + * * Check weighted character count per platform and whether the text is within each platform's limit. * * Twitter/X uses weighted counting (URLs = 23 chars via t.co, emojis = 2 chars). All other platforms use plain character length. @@ -14,15 +28,19 @@ export const client = createClient(createConfig()); * Returns counts and limits for all 15 supported platform variants. * */ -export const validatePostLength = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/tools/validate/post-length' - }); -}; +export const validatePostLength = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/tools/validate/post-length', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Validate post content + * * Dry-run the full post validation pipeline without publishing. Catches issues like missing media for Instagram/TikTok/YouTube, hashtag limits, invalid thread formats, Facebook Reel requirements, and character limit violations. * * Accepts the same body as POST /v1/posts. Does NOT validate accounts, process media, or track usage. This is content-only validation. @@ -30,15 +48,19 @@ export const validatePostLength = (options * Returns errors for failures and warnings for near-limit content (>90% of character limit). * */ -export const validatePost = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/tools/validate/post' - }); -}; +export const validatePost = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/tools/validate/post', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Validate media URL + * * Check if a media URL is accessible and return metadata (content type, file size) plus per-platform size limit comparisons. * * Performs a HEAD request (with GET fallback) to detect content type and size. Rejects private/localhost URLs for SSRF protection. @@ -46,29 +68,33 @@ export const validatePost = (options: Opti * Platform limits are sourced from each platform's actual upload constraints. * */ -export const validateMedia = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/tools/validate/media' - }); -}; +export const validateMedia = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/tools/validate/media', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Check subreddit existence + * * Check if a subreddit exists and return basic info (title, subscriber count, NSFW status, post types allowed). * * When accountId is provided, uses authenticated Reddit OAuth API with automatic token refresh (recommended). Falls back to Reddit's public JSON API, which may be unreliable from server IPs. Returns exists: false for private, banned, or nonexistent subreddits. * */ -export const validateSubreddit = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/tools/validate/subreddit' - }); -}; +export const validateSubreddit = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/tools/validate/subreddit', + ...options +}); /** * Get post analytics + * * Returns analytics for posts. With postId, returns a single post. Without it, returns a paginated list with overview stats. * Accepts both Zernio Post IDs and External Post IDs (auto-resolved). fromDate defaults to 90 days ago if omitted, max range 366 days. * Single post lookups may return 202 (sync pending) or 424 (all platforms failed). For follower stats, use /v1/accounts/follower-stats. @@ -76,15 +102,15 @@ export const validateSubreddit = (options: * LinkedIn personal accounts: Analytics are only available for posts published through Zernio. LinkedIn's API only returns metrics for posts authored by the authenticated user. Organization/company page analytics work for all posts. * */ -export const getAnalytics = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/analytics' - }); -}; +export const getAnalytics = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/analytics', + ...options +}); /** * Get YouTube channel-level insights + * * Returns channel-scoped aggregate metrics from YouTube Analytics API v2. Saves you * from looping /v1/analytics/youtube/daily-views over every video when you only need * channel totals. @@ -100,15 +126,15 @@ export const getAnalytics = (options?: Opt * to get them is Studio CSV export. This is a Google-side limitation. * */ -export const getYouTubeChannelInsights = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/analytics/youtube/channel-insights' - }); -}; +export const getYouTubeChannelInsights = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/analytics/youtube/channel-insights', + ...options +}); /** * Get LinkedIn organization page aggregate analytics + * * Returns aggregate analytics for a LinkedIn organization page. Parallel to * /v1/accounts/{id}/linkedin-aggregate-analytics (which handles personal accounts only). * Backed by LinkedIn's organizationalEntityShareStatistics, @@ -133,15 +159,15 @@ export const getYouTubeChannelInsights = ( * - Share stats: rolling 12-month window. * */ -export const getLinkedInOrgAggregateAnalytics = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/analytics/linkedin/org-aggregate-analytics' - }); -}; +export const getLinkedInOrgAggregateAnalytics = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/analytics/linkedin/org-aggregate-analytics', + ...options +}); /** * Get TikTok account-level insights + * * Returns account-level TikTok insights from /v2/user/info/ (live) plus historical * time series joined from Zernio's daily snapshotter (AccountStats). * @@ -164,28 +190,28 @@ export const getLinkedInOrgAggregateAnalytics = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/analytics/tiktok/account-insights' - }); -}; +export const getTikTokAccountInsights = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/analytics/tiktok/account-insights', + ...options +}); /** * Get YouTube daily views + * * Returns daily view counts for a YouTube video including views, watch time, and subscriber changes. * Requires yt-analytics.readonly scope (re-authorization may be needed). Data has a 2-3 day delay. Max 90 days, defaults to last 30 days. * */ -export const getYouTubeDailyViews = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/analytics/youtube/daily-views' - }); -}; +export const getYouTubeDailyViews = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/analytics/youtube/daily-views', + ...options +}); /** * Get Facebook Page insights + * * Returns page-level Facebook insights (media views, views, post engagements, video metrics, * follower counts). Response shape matches /v1/analytics/instagram/account-insights so the * same client handling works across platforms. @@ -199,30 +225,30 @@ export const getYouTubeDailyViews = (optio * Max 89 days, defaults to last 30 days. Requires the Analytics add-on. * */ -export const getFacebookPageInsights = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/analytics/facebook/page-insights' - }); -}; +export const getFacebookPageInsights = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/analytics/facebook/page-insights', + ...options +}); /** * Get Instagram insights + * * Returns account-level Instagram insights such as reach, views, accounts engaged, and total interactions. * These metrics reflect the entire account's performance across all content surfaces (feed, stories, explore, profile), * and are fundamentally different from post-level metrics. Data may be delayed up to 48 hours. * Max 90 days, defaults to last 30 days. Requires the Analytics add-on. * */ -export const getInstagramAccountInsights = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/analytics/instagram/account-insights' - }); -}; +export const getInstagramAccountInsights = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/analytics/instagram/account-insights', + ...options +}); /** * Get Instagram follower history + * * Returns a daily running Instagram follower count time series, served from Zernio's * cross-platform daily snapshotter. Exists because Meta removed follower_count from * the /insights endpoint in Graph API v22+ and never exposed a historical daily series @@ -232,115 +258,115 @@ export const getInstagramAccountInsights = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/analytics/instagram/follower-history' - }); -}; +export const getInstagramFollowerHistory = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/analytics/instagram/follower-history', + ...options +}); /** * Get Instagram demographics + * * Returns audience demographic insights for an Instagram account, broken down by age, city, country, and/or gender. * Requires at least 100 followers. Returns top 45 entries per dimension. * Data may be delayed up to 48 hours. Requires the Analytics add-on. * */ -export const getInstagramDemographics = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/analytics/instagram/demographics' - }); -}; +export const getInstagramDemographics = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/analytics/instagram/demographics', + ...options +}); /** * Get YouTube demographics + * * Returns audience demographic insights for a YouTube channel, broken down by age, gender, and/or country. * Age and gender values are viewer percentages (0-100). Country values are view counts. * Data is based on signed-in viewers only, with a 2-3 day delay. Requires the Analytics add-on. * */ -export const getYouTubeDemographics = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/analytics/youtube/demographics' - }); -}; +export const getYouTubeDemographics = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/analytics/youtube/demographics', + ...options +}); /** * Get daily aggregated metrics + * * Returns daily aggregated analytics metrics and a per-platform breakdown. * Each day includes post count, platform distribution, and summed metrics (impressions, reach, likes, comments, shares, saves, clicks, views). * Defaults to the last 180 days. Requires the Analytics add-on. * */ -export const getDailyMetrics = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/analytics/daily-metrics' - }); -}; +export const getDailyMetrics = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/analytics/daily-metrics', + ...options +}); /** * Get best times to post + * * Returns the best times to post based on historical engagement data. * Groups all published posts by day of week and hour (UTC), calculating average engagement per slot. * Use this to auto-schedule posts at optimal times. Requires the Analytics add-on. * */ -export const getBestTimeToPost = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/analytics/best-time' - }); -}; +export const getBestTimeToPost = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/analytics/best-time', + ...options +}); /** * Get content performance decay + * * Returns how engagement accumulates over time after a post is published. * Each bucket shows what percentage of the post's total engagement had been reached by that time window. * Useful for understanding content lifespan (e.g. "posts reach 78% of total engagement within 24 hours"). * Requires the Analytics add-on. * */ -export const getContentDecay = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/analytics/content-decay' - }); -}; +export const getContentDecay = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/analytics/content-decay', + ...options +}); /** * Get frequency vs engagement + * * Returns the correlation between posting frequency (posts per week) and engagement rate, broken down by platform. * Helps find the optimal posting cadence for each platform. Each row represents a specific (platform, posts_per_week) combination * with the average engagement rate observed across all weeks matching that frequency. * Requires the Analytics add-on. * */ -export const getPostingFrequency = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/analytics/posting-frequency' - }); -}; +export const getPostingFrequency = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/analytics/posting-frequency', + ...options +}); /** * Get post analytics timeline + * * Returns a daily timeline of analytics metrics for a specific post, showing how impressions, likes, * and other metrics evolved day-by-day since publishing. Each row represents one day of data per platform. * For multi-platform Zernio posts, returns separate rows for each platform. Requires the Analytics add-on. * */ -export const getPostTimeline = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/analytics/post-timeline' - }); -}; +export const getPostTimeline = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/analytics/post-timeline', + ...options +}); /** * Get GBP performance metrics + * * Returns daily performance metrics for a Google Business Profile location. * Metrics include impressions (Maps/Search, desktop/mobile), website clicks, * call clicks, direction requests, conversations, bookings, and food orders. @@ -348,113 +374,125 @@ export const getPostTimeline = (options: O * Requires the Analytics add-on. * */ -export const getGoogleBusinessPerformance = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/analytics/googlebusiness/performance' - }); -}; +export const getGoogleBusinessPerformance = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/analytics/googlebusiness/performance', + ...options +}); /** * Get GBP search keywords + * * Returns search keywords that triggered impressions for a Google Business Profile location. * Data is aggregated monthly. Keywords below a minimum impression threshold set by Google are excluded. * Max 18 months of historical data. Requires the Analytics add-on. * */ -export const getGoogleBusinessSearchKeywords = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/analytics/googlebusiness/search-keywords' - }); -}; +export const getGoogleBusinessSearchKeywords = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/analytics/googlebusiness/search-keywords', + ...options +}); /** * List groups + * * Returns all account groups visible to the authenticated user. Groups can * contain accounts from multiple profiles. For API keys scoped to specific * profiles, only groups whose accounts all live in allowed profiles are * returned. * */ -export const listAccountGroups = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/account-groups' - }); -}; +export const listAccountGroups = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/account-groups', + ...options +}); /** * Create group + * * Creates a new account group with a name and a list of social account IDs. * Accounts can belong to different profiles; the caller must have access to * every account's profile. Group names must be unique per user. * */ -export const createAccountGroup = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/account-groups' - }); -}; +export const createAccountGroup = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/account-groups', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** - * Update group - * Updates the name or account list of an existing group. You can rename the group, change its accounts, or both. + * Delete group + * + * Permanently deletes an account group. The accounts themselves are not affected. */ -export const updateAccountGroup = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/account-groups/{groupId}' - }); -}; +export const deleteAccountGroup = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/account-groups/{groupId}', + ...options +}); /** - * Delete group - * Permanently deletes an account group. The accounts themselves are not affected. + * Update group + * + * Updates the name or account list of an existing group. You can rename the group, change its accounts, or both. */ -export const deleteAccountGroup = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/account-groups/{groupId}' - }); -}; +export const updateAccountGroup = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/account-groups/{groupId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Get upload URL + * * Get a presigned URL to upload files directly to cloud storage (up to 5GB). Returns an uploadUrl and publicUrl. PUT your file to the uploadUrl, then use the publicUrl in your posts. */ -export const getMediaPresignedUrl = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/media/presign' - }); -}; +export const getMediaPresignedUrl = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/media/presign', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Search posts + * * Search Reddit posts using a connected account. Optionally scope to a specific subreddit. */ -export const searchReddit = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/reddit/search' - }); -}; +export const searchReddit = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/reddit/search', + ...options +}); /** * Get subreddit feed + * * Fetch posts from a subreddit feed. Supports sorting, time filtering, and cursor-based pagination. */ -export const getRedditFeed = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/reddit/feed' - }); -}; +export const getRedditFeed = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/reddit/feed', + ...options +}); /** * Get X/Twitter API pricing table + * * Returns Zernio's canonical X/Twitter API pricing table. Each X action has its * own Metronome product and its own rate, and Zernio passes X API costs through * at exact rates with zero markup. @@ -467,15 +505,15 @@ export const getRedditFeed = (options: Opt * keyed by the same `operation` field you get here. * */ -export const getXApiPricing = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/billing/x-pricing' - }); -}; +export const getXApiPricing = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/billing/x-pricing', + ...options +}); /** * Get plan and usage stats + * * Returns the current plan name, billing period, plan limits, and usage counts. * * The response shape depends on the account's `billingSystem`: @@ -490,26 +528,26 @@ export const getXApiPricing = (options?: O * consume `xApiCallsByOperation` only. * */ -export const getUsageStats = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/usage-stats' - }); -}; +export const getUsageStats = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/usage-stats', + ...options +}); /** * List posts + * * Returns a paginated list of posts. Published posts include platformPostUrl with the public URL on each platform. */ -export const listPosts = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/posts' - }); -}; +export const listPosts = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/posts', + ...options +}); /** * Create post + * * Create and optionally publish a post. Immediate posts (`publishNow: true`) include `platformPostUrl` in the response. * Content is optional when media is attached or all platforms have `customContent`. See each platform's schema for media constraints. * @@ -530,91 +568,103 @@ export const listPosts = (options?: Option * Order: same-`x-request-id` retries (200) are checked first; if no idempotency match, the content-hash dedup (409) runs. * */ -export const createPost = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/posts' - }); -}; +export const createPost = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/posts', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Delete post + * + * Delete a draft or scheduled post from Zernio. Published posts cannot be deleted; use the Unpublish endpoint instead. Upload quota is automatically refunded. + */ +export const deletePost = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/posts/{postId}', + ...options +}); /** * Get post + * * Fetch a single post by ID. For published posts, this returns platformPostUrl for each platform. * */ -export const getPost = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/posts/{postId}' - }); -}; +export const getPost = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/posts/{postId}', + ...options +}); /** * Update post + * * Update an existing post. Only draft, scheduled, failed, and partial posts can be edited. * Published, publishing, and cancelled posts cannot be modified. * */ -export const updatePost = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/posts/{postId}' - }); -}; - -/** - * Delete post - * Delete a draft or scheduled post from Zernio. Published posts cannot be deleted; use the Unpublish endpoint instead. Upload quota is automatically refunded. - */ -export const deletePost = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/posts/{postId}' - }); -}; +export const updatePost = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/posts/{postId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Bulk upload from CSV + * * Create multiple posts by uploading a CSV file. Use dryRun=true to validate without creating posts. */ -export const bulkUploadPosts = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - ...formDataBodySerializer, - headers: { - 'Content-Type': null, - ...options?.headers - }, - url: '/v1/posts/bulk-upload' - }); -}; +export const bulkUploadPosts = (options: Options) => (options.client ?? client).post({ + ...formDataBodySerializer, + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/posts/bulk-upload', + ...options, + headers: { + 'Content-Type': null, + ...options.headers + } +}); /** * Retry failed post + * * Immediately retries publishing a failed post. Returns the updated post with its new status. */ -export const retryPost = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/posts/{postId}/retry' - }); -}; +export const retryPost = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/posts/{postId}/retry', + ...options +}); /** * Unpublish post + * * Deletes a published post from the specified platform. The post record in Zernio is kept but its status is updated to cancelled. * Not supported on Instagram, TikTok, or Snapchat. Threaded posts delete all items. YouTube deletion is permanent. * */ -export const unpublishPost = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/posts/{postId}/unpublish' - }); -}; +export const unpublishPost = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/posts/{postId}/unpublish', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Edit published post + * * Edit a published post on a social media platform. Currently only supported for X (Twitter). * * Requirements: @@ -626,15 +676,19 @@ export const unpublishPost = (options: Opt * The post record in Zernio is updated with the new content and edit history. * */ -export const editPost = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/posts/{postId}/edit' - }); -}; +export const editPost = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/posts/{postId}/edit', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Update post metadata + * * Updates metadata of a published video on the specified platform without re-uploading. * Currently only supported for YouTube. At least one updatable field is required. * @@ -646,137 +700,141 @@ export const editPost = (options: OptionsL * for the connected YouTube channel. * */ -export const updatePostMetadata = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/posts/{postId}/update-metadata' - }); -}; +export const updatePostMetadata = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/posts/{postId}/update-metadata', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List users + * * Returns all users in the workspace including roles and profile access. Also returns the currentUserId of the caller. */ -export const listUsers = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/users' - }); -}; +export const listUsers = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/users', + ...options +}); /** * Get user + * * Returns a single user's details by ID, including name, email, and role. */ -export const getUser = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/users/{userId}' - }); -}; +export const getUser = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/users/{userId}', + ...options +}); /** * List profiles + * * Returns profiles sorted by creation date. Use includeOverLimit=true to include profiles that exceed the plan limit. */ -export const listProfiles = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/profiles' - }); -}; +export const listProfiles = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/profiles', + ...options +}); /** * Create profile + * * Creates a new profile with a name, optional description, and color. */ -export const createProfile = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/profiles' - }); -}; +export const createProfile = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/profiles', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Delete profile + * + * Permanently deletes a profile by ID. + */ +export const deleteProfile = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/profiles/{profileId}', + ...options +}); /** * Get profile + * * Returns a single profile by ID, including its name, color, and default status. */ -export const getProfile = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/profiles/{profileId}' - }); -}; +export const getProfile = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/profiles/{profileId}', + ...options +}); /** * Update profile + * * Updates a profile's name, description, color, or default status. */ -export const updateProfile = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/profiles/{profileId}' - }); -}; - -/** - * Delete profile - * Permanently deletes a profile by ID. - */ -export const deleteProfile = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/profiles/{profileId}' - }); -}; +export const updateProfile = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/profiles/{profileId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List accounts + * * Returns connected social accounts. Only includes accounts within the plan limit by default. Follower data requires analytics add-on. * Supports optional server-side pagination via page/limit params. When omitted, returns all accounts (backward-compatible). * */ -export const listAccounts = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts' - }); -}; +export const listAccounts = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts', + ...options +}); /** * Get follower stats + * * Returns follower count history and growth metrics for connected social accounts. * Requires analytics add-on subscription. Follower counts are refreshed once per day. * */ -export const getFollowerStats = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/follower-stats' - }); -}; +export const getFollowerStats = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/follower-stats', + ...options +}); /** - * Update account - * Updates a connected social account's display name or username override. - * - * For X/Twitter accounts on usage-based billing, also accepts an `xCapabilities` - * object to toggle background API operations that incur X API pass-through costs. - * Both fields are opt-in (default `false`) — when off, no analytics syncs or DM - * polling are performed for that account, and no API call is metered for those - * operations. Publishing and deleting posts are always available regardless of - * these toggles. Setting `xCapabilities` on a non-X account returns 400. + * Disconnect account * + * Disconnects and removes a connected social account. */ -export const updateAccount = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/accounts/{accountId}' - }); -}; +export const deleteAccount = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}', + ...options +}); /** * Move account to a different profile + * * Moves a connected social account to a different profile owned by the same * user. The target profile must belong to the same user as the account. * @@ -785,129 +843,157 @@ export const updateAccount = (options: Opt * Calls with a target profile outside the key's scope return 403. * */ -export const moveAccountToProfile = (options: OptionsLegacyParser) => { - return (options?.client ?? client).patch({ - ...options, - url: '/v1/accounts/{accountId}' - }); -}; +export const moveAccountToProfile = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** - * Disconnect account - * Disconnects and removes a connected social account. + * Update account + * + * Updates a connected social account's display name or username override. + * + * For X/Twitter accounts on usage-based billing, also accepts an `xCapabilities` + * object to toggle background API operations that incur X API pass-through costs. + * Both fields are opt-in (default `false`) — when off, no analytics syncs or DM + * polling are performed for that account, and no API call is metered for those + * operations. Publishing and deleting posts are always available regardless of + * these toggles. Setting `xCapabilities` on a non-X account returns 400. + * */ -export const deleteAccount = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/accounts/{accountId}' - }); -}; +export const updateAccount = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Check accounts health + * * Returns health status of all connected accounts including token validity, permissions, and issues needing attention. */ -export const getAllAccountsHealth = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/health' - }); -}; +export const getAllAccountsHealth = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/health', + ...options +}); /** * Check account health + * * Returns detailed health info for a specific account including token status, permissions, and recommendations. */ -export const getAccountHealth = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/health' - }); -}; +export const getAccountHealth = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/health', + ...options +}); /** * Get TikTok creator info + * * Returns TikTok creator details, available privacy levels, posting limits, and commercial content options for a specific TikTok account. Only works with TikTok accounts. */ -export const getTikTokCreatorInfo = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/tiktok/creator-info' - }); -}; +export const getTikTokCreatorInfo = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/tiktok/creator-info', + ...options +}); /** * List keys + * * Returns all API keys for the authenticated user. Keys are returned with a preview only, not the full key value. */ -export const listApiKeys = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/api-keys' - }); -}; +export const listApiKeys = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/api-keys', + ...options +}); /** * Create key + * * Creates a new API key with an optional expiry. The full key value is only returned once in the response. */ -export const createApiKey = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/api-keys' - }); -}; +export const createApiKey = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/api-keys', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Delete key + * * Permanently revokes and deletes an API key. */ -export const deleteApiKey = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/api-keys/{keyId}' - }); -}; +export const deleteApiKey = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/api-keys/{keyId}', + ...options +}); /** * Create invite token + * * Generate a secure invite link to grant team members access to your profiles. * Invites expire after 7 days and are single-use. * */ -export const createInviteToken = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/invite/tokens' - }); -}; +export const createInviteToken = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/invite/tokens', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Get OAuth connect URL + * * Initiate an OAuth connection flow. Returns an authUrl to redirect the user to. * Standard flow: Zernio hosts the selection UI, then redirects to your redirect_url. Headless mode (headless=true): user is redirected to your redirect_url with OAuth data for custom UI. Use the platform-specific selection endpoints to complete. * */ -export const getConnectUrl = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/connect/{platform}' - }); -}; +export const getConnectUrl = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/connect/{platform}', + ...options +}); /** * Complete OAuth callback + * * Exchange the OAuth authorization code for tokens and connect the account to the specified profile. */ -export const handleOAuthCallback = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/connect/{platform}' - }); -}; +export const handleOAuthCallback = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/connect/{platform}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Connect ads for a platform + * * Unified ads connection endpoint. Creates a dedicated ads SocialAccount for the specified platform. * * Same-token platforms (facebook, instagram, linkedin, pinterest): Creates an ads SocialAccount (metaads, linkedinads, pinterestads) with a copied OAuth token from the parent posting account. If the ads account already exists, returns alreadyConnected: true. No extra OAuth needed. @@ -921,15 +1007,15 @@ export const handleOAuthCallback = (option * Ads accounts appear as regular SocialAccount documents with ads platform values (e.g., metaads, tiktokads) in GET /v1/accounts. * */ -export const connectAds = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/connect/{platform}/ads' - }); -}; +export const connectAds = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/connect/{platform}/ads', + ...options +}); /** * Configure TikTok Ads Brand Identity + * * Set or update the Brand Identity (display name + avatar) for a * `tiktokads` SocialAccount. TikTok requires every ad to carry an * `identity_id + identity_type` pair. The Brand Identity is the @@ -953,300 +1039,348 @@ export const connectAds = (options: Option * configure on first ad creation in a single round-trip. * */ -export const configureTikTokAdsBrandIdentity = (options: OptionsLegacyParser) => { - return (options?.client ?? client).patch({ - ...options, - url: '/v1/connect/tiktok-ads' - }); -}; +export const configureTikTokAdsBrandIdentity = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/connect/tiktok-ads', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List Facebook pages + * * Returns the list of Facebook Pages the user can manage after OAuth. Extract tempToken and userProfile from the OAuth redirect params and pass them here. Use the X-Connect-Token header if connecting via API key. */ -export const listFacebookPages = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/connect/facebook/select-page' - }); -}; +export const listFacebookPages = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-Connect-Token', type: 'apiKey' }], + url: '/v1/connect/facebook/select-page', + ...options +}); /** * Select Facebook page + * * Complete the headless flow by saving the user's selected Facebook page. Pass the userProfile from the OAuth redirect and use X-Connect-Token if connecting via API key. */ -export const selectFacebookPage = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/connect/facebook/select-page' - }); -}; +export const selectFacebookPage = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-Connect-Token', type: 'apiKey' }], + url: '/v1/connect/facebook/select-page', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List GBP locations + * * For headless flows. Returns the list of GBP locations the user can manage. Use pendingDataToken (from the OAuth callback redirect) to list locations without consuming the token, so it remains available for select-location. Use X-Connect-Token header if connecting via API key. * */ -export const listGoogleBusinessLocations = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/connect/googlebusiness/locations' - }); -}; +export const listGoogleBusinessLocations = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-Connect-Token', type: 'apiKey' }], + url: '/v1/connect/googlebusiness/locations', + ...options +}); /** * Select GBP location + * * Complete the headless GBP flow by saving the user's selected location. The pendingDataToken is returned in your redirect URL after OAuth completes (step=select_location). Tokens and profile data are stored server-side, so only the pendingDataToken is needed here. Use X-Connect-Token header if connecting via API key. * */ -export const selectGoogleBusinessLocation = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/connect/googlebusiness/select-location' - }); -}; +export const selectGoogleBusinessLocation = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { name: 'X-Connect-Token', type: 'apiKey' }], + url: '/v1/connect/googlebusiness/select-location', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Get reviews + * * Returns reviews for a GBP account including ratings, comments, and owner replies. Use nextPageToken for pagination. */ -export const getGoogleBusinessReviews = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/gmb-reviews' - }); -}; +export const getGoogleBusinessReviews = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/gmb-reviews', + ...options +}); /** * Get food menus + * * Returns food menus for a GBP location including sections, items, pricing, and dietary info. Only for locations with food menu support. */ -export const getGoogleBusinessFoodMenus = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/gmb-food-menus' - }); -}; +export const getGoogleBusinessFoodMenus = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/gmb-food-menus', + ...options +}); /** * Update food menus + * * Updates food menus for a GBP location. Send the full menus array. Use updateMask for partial updates. */ -export const updateGoogleBusinessFoodMenus = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/accounts/{accountId}/gmb-food-menus' - }); -}; +export const updateGoogleBusinessFoodMenus = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/gmb-food-menus', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Get location details + * * Returns detailed GBP location info (hours, description, phone, website, categories, services). Use readMask to request specific fields. */ -export const getGoogleBusinessLocationDetails = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/gmb-location-details' - }); -}; +export const getGoogleBusinessLocationDetails = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/gmb-location-details', + ...options +}); /** * Update location details + * * Updates GBP location details. The updateMask field is required and specifies which fields to update. * This endpoint proxies Google's Business Information API locations.patch, so any valid updateMask field is supported. * Common fields: regularHours, specialHours, profile.description, websiteUri, phoneNumbers, categories, serviceItems. * */ -export const updateGoogleBusinessLocationDetails = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/accounts/{accountId}/gmb-location-details' - }); -}; +export const updateGoogleBusinessLocationDetails = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/gmb-location-details', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Delete photo + * + * Deletes a photo or media item from a GBP location. + */ +export const deleteGoogleBusinessMedia = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/gmb-media', + ...options +}); /** * List media + * * Lists media items (photos) for a Google Business Profile location. * Returns photo URLs, descriptions, categories, and metadata. * */ -export const listGoogleBusinessMedia = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/gmb-media' - }); -}; +export const listGoogleBusinessMedia = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/gmb-media', + ...options +}); /** * Upload photo + * * Creates a media item (photo) for a location from a publicly accessible URL. * * Categories determine where the photo appears: COVER, PROFILE, LOGO, EXTERIOR, INTERIOR, FOOD_AND_DRINK, MENU, PRODUCT, TEAMS, ADDITIONAL. * */ -export const createGoogleBusinessMedia = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/accounts/{accountId}/gmb-media' - }); -}; - -/** - * Delete photo - * Deletes a photo or media item from a GBP location. - */ -export const deleteGoogleBusinessMedia = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/accounts/{accountId}/gmb-media' - }); -}; +export const createGoogleBusinessMedia = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/gmb-media', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Get attributes + * * Returns GBP location attributes (amenities, services, accessibility, payment types). Available attributes vary by business category. */ -export const getGoogleBusinessAttributes = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/gmb-attributes' - }); -}; +export const getGoogleBusinessAttributes = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/gmb-attributes', + ...options +}); /** * Update attributes + * * Updates location attributes (amenities, services, etc.). * * The attributeMask specifies which attributes to update (comma-separated). * */ -export const updateGoogleBusinessAttributes = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/accounts/{accountId}/gmb-attributes' - }); -}; +export const updateGoogleBusinessAttributes = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/gmb-attributes', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Delete action link + * + * Deletes a place action link (e.g. booking or ordering URL) from a GBP location. + */ +export const deleteGoogleBusinessPlaceAction = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/gmb-place-actions', + ...options +}); /** * List action links + * * Lists place action links for a Google Business Profile location. * * Place actions are the booking, ordering, and reservation buttons that appear on your listing. * */ -export const listGoogleBusinessPlaceActions = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/gmb-place-actions' - }); -}; +export const listGoogleBusinessPlaceActions = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/gmb-place-actions', + ...options +}); /** - * Create action link - * Creates a place action link for a location. + * Update action link * - * Available action types: APPOINTMENT, ONLINE_APPOINTMENT, DINING_RESERVATION, FOOD_ORDERING, FOOD_DELIVERY, FOOD_TAKEOUT, SHOP_ONLINE. + * Updates a place action link (change URL or action type). + * Only the fields included in the request body will be updated. * */ -export const createGoogleBusinessPlaceAction = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/accounts/{accountId}/gmb-place-actions' - }); -}; - -/** - * Delete action link - * Deletes a place action link (e.g. booking or ordering URL) from a GBP location. - */ -export const deleteGoogleBusinessPlaceAction = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/accounts/{accountId}/gmb-place-actions' - }); -}; +export const updateGoogleBusinessPlaceAction = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/gmb-place-actions', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** - * Update action link - * Updates a place action link (change URL or action type). - * Only the fields included in the request body will be updated. + * Create action link + * + * Creates a place action link for a location. + * + * Available action types: APPOINTMENT, ONLINE_APPOINTMENT, DINING_RESERVATION, FOOD_ORDERING, FOOD_DELIVERY, FOOD_TAKEOUT, SHOP_ONLINE. * */ -export const updateGoogleBusinessPlaceAction = (options: OptionsLegacyParser) => { - return (options?.client ?? client).patch({ - ...options, - url: '/v1/accounts/{accountId}/gmb-place-actions' - }); -}; +export const createGoogleBusinessPlaceAction = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/gmb-place-actions', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Get services + * * Gets the services offered by a Google Business Profile location. * Returns an array of service items (structured or free-form with optional price). * */ -export const getGoogleBusinessServices = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/gmb-services' - }); -}; +export const getGoogleBusinessServices = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/gmb-services', + ...options +}); /** * Replace services + * * Replaces the entire service list for a location. * Google's API requires full replacement; individual item updates are not supported. * Each service can be structured (using a predefined serviceTypeId) or free-form (custom label). * */ -export const updateGoogleBusinessServices = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/accounts/{accountId}/gmb-services' - }); -}; +export const updateGoogleBusinessServices = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/gmb-services', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Batch get reviews + * * Fetches reviews across multiple locations in a single request. * More efficient than calling GET /gmb-reviews per location for multi-location businesses. * Reviews are grouped by location in the response. * */ -export const batchGetGoogleBusinessReviews = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/accounts/{accountId}/gmb-reviews/batch' - }); -}; +export const batchGetGoogleBusinessReviews = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/gmb-reviews/batch', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** - * Reply to a review - * Posts (or updates) the business owner reply to a Google Business review. - * The reply is associated with the account's currently selected location (set via /v1/accounts/{accountId}/gmb-locations). - * Calling this endpoint a second time on the same review overwrites the previous reply (PUT semantics on Google's side). + * Delete a review reply * + * Removes the business owner reply from a Google Business review. The review itself remains. */ -export const replyToGoogleBusinessReview = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/accounts/{accountId}/gmb-reviews/{reviewId}/reply' - }); -}; +export const deleteGoogleBusinessReviewReply = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/gmb-reviews/{reviewId}/reply', + ...options +}); /** - * Delete a review reply - * Removes the business owner reply from a Google Business review. The review itself remains. + * Reply to a review + * + * Posts (or updates) the business owner reply to a Google Business review. + * The reply is associated with the account's currently selected location (set via /v1/accounts/{accountId}/gmb-locations). + * Calling this endpoint a second time on the same review overwrites the previous reply (PUT semantics on Google's side). + * */ -export const deleteGoogleBusinessReviewReply = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/accounts/{accountId}/gmb-reviews/{reviewId}/reply' - }); -}; +export const replyToGoogleBusinessReview = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/gmb-reviews/{reviewId}/reply', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Get pending OAuth data + * * Fetch pending OAuth data for headless mode using the pendingDataToken from the redirect URL. * * **Scope**: This endpoint is used only for LinkedIn organizations and Snapchat profiles, where the selection list is too large to fit in URL params. WhatsApp, Facebook, Pinterest, Google Business and other platforms pass selection state directly via URL query params on the redirect (`profileId`, `tempToken`, `step`), no pending record is created, so this endpoint will return 404 for those flows. Use the platform-specific selection endpoint instead (e.g. `/v1/connect/whatsapp/select-phone-number`). @@ -1254,95 +1388,111 @@ export const deleteGoogleBusinessReviewReply = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/connect/pending-data' - }); -}; +export const getPendingOAuthData = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/connect/pending-data', + ...options +}); /** * List LinkedIn orgs + * * Fetch full LinkedIn organization details (logos, vanity names, websites) for custom UI. No authentication required, just the tempToken from OAuth. */ -export const listLinkedInOrganizations = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/connect/linkedin/organizations' - }); -}; +export const listLinkedInOrganizations = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/connect/linkedin/organizations', + ...options +}); /** * Select LinkedIn org + * * Complete the LinkedIn connection flow. Set accountType to "personal" or "organization" to connect as a company page. Use X-Connect-Token if connecting via API key. */ -export const selectLinkedInOrganization = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/connect/linkedin/select-organization' - }); -}; +export const selectLinkedInOrganization = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/connect/linkedin/select-organization', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List Pinterest boards + * * For headless flows. Returns Pinterest boards the user can post to. Use X-Connect-Token from the redirect URL. */ -export const listPinterestBoardsForSelection = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/connect/pinterest/select-board' - }); -}; +export const listPinterestBoardsForSelection = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/connect/pinterest/select-board', + ...options +}); /** * Select Pinterest board + * * Complete the Pinterest connection flow. After OAuth, use this endpoint to save the selected board and complete the account connection. Use the X-Connect-Token header if you initiated the connection via API key. * */ -export const selectPinterestBoard = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/connect/pinterest/select-board' - }); -}; +export const selectPinterestBoard = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/connect/pinterest/select-board', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List Snapchat profiles + * * For headless flows. Returns Snapchat Public Profiles the user can post to. Use X-Connect-Token from the redirect URL. */ -export const listSnapchatProfiles = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/connect/snapchat/select-profile' - }); -}; +export const listSnapchatProfiles = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/connect/snapchat/select-profile', + ...options +}); /** * Select Snapchat profile + * * Complete the Snapchat connection flow by saving the selected Public Profile. Snapchat requires a Public Profile to publish content. Use X-Connect-Token if connecting via API key. */ -export const selectSnapchatProfile = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/connect/snapchat/select-profile' - }); -}; +export const selectSnapchatProfile = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/connect/snapchat/select-profile', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Connect Bluesky account + * * Connect a Bluesky account using identifier (handle or email) and an app password. * To get your userId for the state parameter, call GET /v1/users which includes a currentUserId field. * */ -export const connectBlueskyCredentials = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/connect/bluesky/credentials' - }); -}; +export const connectBlueskyCredentials = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/connect/bluesky/credentials', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Connect WhatsApp via credentials + * * Connect a WhatsApp Business Account by providing Meta credentials directly. * This is the headless alternative to the Embedded Signup browser flow. * @@ -1356,15 +1506,19 @@ export const connectBlueskyCredentials = ( * 7. Get the Phone Number ID from the same page (click on the number) * */ -export const connectWhatsAppCredentials = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/connect/whatsapp/credentials' - }); -}; +export const connectWhatsAppCredentials = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/connect/whatsapp/credentials', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List WhatsApp phone numbers for selection + * * Fetch the WhatsApp phone numbers available across the user's WhatsApp Business Accounts (WABAs) after a headless OAuth flow. * * WhatsApp OAuth grants access at the WABA level. When a connected WABA has 2 or more phone numbers, you must call this endpoint to list them and then `POST /v1/connect/whatsapp/select-phone-number` to bind one to the Zernio profile. Single-phone WABAs auto-complete during the OAuth callback and never reach this endpoint. @@ -1374,143 +1528,159 @@ export const connectWhatsAppCredentials = * Alternative: if you already know `wabaId` and `phoneNumberId` (e.g. from Meta Business Suite), use `connectWhatsAppCredentials` instead, which skips this two-step flow. * */ -export const listWhatsAppPhoneNumbers = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/connect/whatsapp/select-phone-number' - }); -}; +export const listWhatsAppPhoneNumbers = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/connect/whatsapp/select-phone-number', + ...options +}); /** * Complete WhatsApp phone number selection + * * Bind a specific WhatsApp phone number to the Zernio profile after the user picks one from `listWhatsAppPhoneNumbers`. Exchanges the short-lived OAuth token for a long-lived token, subscribes the WABA to webhooks, and creates the SocialAccount. * */ -export const completeWhatsAppPhoneSelection = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/connect/whatsapp/select-phone-number' - }); -}; +export const completeWhatsAppPhoneSelection = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/connect/whatsapp/select-phone-number', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Generate Telegram code + * * Generate an access code (valid 15 minutes) for connecting a Telegram channel or group. Add the bot as admin, then send the code + @yourchannel to the bot. Poll PATCH /v1/connect/telegram to check status. */ -export const getTelegramConnectStatus = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/connect/telegram' - }); -}; - -/** - * Connect Telegram directly - * Connect a Telegram channel/group directly using the chat ID. Alternative to the access code flow. The bot must already be an admin in the channel/group. - */ -export const initiateTelegramConnect = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/connect/telegram' - }); -}; +export const getTelegramConnectStatus = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/connect/telegram', + ...options +}); /** * Check Telegram status + * * Poll this endpoint to check if a Telegram access code has been used to connect a channel/group. Recommended polling interval: 3 seconds. * Status values: pending (waiting for user), connected (channel/group linked), expired (generate a new code). * */ -export const completeTelegramConnect = (options: OptionsLegacyParser) => { - return (options?.client ?? client).patch({ - ...options, - url: '/v1/connect/telegram' - }); -}; +export const completeTelegramConnect = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/connect/telegram', + ...options +}); + +/** + * Connect Telegram directly + * + * Connect a Telegram channel/group directly using the chat ID. Alternative to the access code flow. The bot must already be an admin in the channel/group. + */ +export const initiateTelegramConnect = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/connect/telegram', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List Facebook pages + * * Returns all Facebook pages the connected account has access to, including the currently selected page. */ -export const getFacebookPages = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/facebook-page' - }); -}; +export const getFacebookPages = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/facebook-page', + ...options +}); /** * Update Facebook page + * * Switch which Facebook Page is active for a connected account. */ -export const updateFacebookPage = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/accounts/{accountId}/facebook-page' - }); -}; +export const updateFacebookPage = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/facebook-page', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List LinkedIn orgs + * * Returns LinkedIn organizations (company pages) the connected account has admin access to. */ -export const getLinkedInOrganizations = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/linkedin-organizations' - }); -}; +export const getLinkedInOrganizations = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/linkedin-organizations', + ...options +}); /** * Get LinkedIn aggregate stats + * * Returns aggregate analytics across all posts for a LinkedIn personal account. Only includes posts published through Zernio (LinkedIn API limitation). Org accounts should use /v1/analytics instead. Requires r_member_postAnalytics scope. Saves (POST_SAVE) and sends (POST_SEND) are available for personal accounts; organization pages always return 0 for these two metrics because LinkedIn does not expose them on the organization analytics endpoint. */ -export const getLinkedInAggregateAnalytics = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/linkedin-aggregate-analytics' - }); -}; +export const getLinkedInAggregateAnalytics = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/linkedin-aggregate-analytics', + ...options +}); /** * Get LinkedIn post stats + * * Returns analytics for a specific LinkedIn post by URN. Works for both personal and organization accounts. Saves and sends are only populated for personal accounts (LinkedIn does not expose these metrics on the organization analytics endpoint). */ -export const getLinkedInPostAnalytics = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/linkedin-post-analytics' - }); -}; +export const getLinkedInPostAnalytics = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/linkedin-post-analytics', + ...options +}); /** * Get LinkedIn post reactions + * * Returns individual reactions for a specific LinkedIn post, including reactor profiles * (name, headline/job title, profile picture, profile URL, reaction type). * Only works for organization/company page accounts. LinkedIn restricts reaction * data for personal profiles (r_member_social_feed is a closed permission). * */ -export const getLinkedInPostReactions = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/linkedin-post-reactions' - }); -}; +export const getLinkedInPostReactions = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/linkedin-post-reactions', + ...options +}); /** * Switch LinkedIn account type + * * Switch a LinkedIn account between personal profile and organization (company page) posting. */ -export const updateLinkedInOrganization = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/accounts/{accountId}/linkedin-organization' - }); -}; +export const updateLinkedInOrganization = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/linkedin-organization', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Resolve LinkedIn mention + * * Converts a LinkedIn profile or company URL to a URN for @mentions in posts. * * How to use LinkedIn @mentions (2-step workflow): @@ -1532,15 +1702,15 @@ export const updateLinkedInOrganization = * - Person mentions DO work when published from personal profiles (the URN just needs to be valid). The limitation is only in the resolution step (URL to URN), not in publishing. * */ -export const getLinkedInMentions = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/linkedin-mentions' - }); -}; +export const getLinkedInMentions = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/linkedin-mentions', + ...options +}); /** * List active Instagram stories + * * Returns the IG Business/Creator account's currently-active stories. * Meta keeps stories live for 24h; expired stories are not returned. * @@ -1552,15 +1722,15 @@ export const getLinkedInMentions = (option * - `caption`, `likeCount`, `commentsCount` do not apply to story media * */ -export const listInstagramStories = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/instagram/stories' - }); -}; +export const listInstagramStories = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/instagram/stories', + ...options +}); /** * Get Instagram story insights + * * Returns metrics for a single story. The `source` field discriminates * between three states: * @@ -1575,125 +1745,141 @@ export const listInstagramStories = (optio * is the sum of `tapsForward + tapsBack + exits + swipesForward`. * */ -export const getInstagramStoryInsights = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/instagram/stories/{storyId}/insights' - }); -}; +export const getInstagramStoryInsights = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/instagram/stories/{storyId}/insights', + ...options +}); /** * List Pinterest boards + * * Returns the boards available for a connected Pinterest account. Use this to get a board ID when creating a Pinterest post. */ -export const getPinterestBoards = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/pinterest-boards' - }); -}; +export const getPinterestBoards = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/pinterest-boards', + ...options +}); /** * Set default Pinterest board + * * Sets the default board used when publishing pins for this account. */ -export const updatePinterestBoards = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/accounts/{accountId}/pinterest-boards' - }); -}; +export const updatePinterestBoards = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/pinterest-boards', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List YouTube playlists + * * Returns the playlists available for a connected YouTube account. Use this to get a playlist ID when creating a YouTube post with the playlistId field. */ -export const getYoutubePlaylists = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/youtube-playlists' - }); -}; +export const getYoutubePlaylists = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/youtube-playlists', + ...options +}); /** * Set default YouTube playlist + * * Sets the default playlist used when publishing videos for this account. When a post does not specify a playlistId, the default playlist is not automatically used (it is stored for client-side convenience). */ -export const updateYoutubeDefaultPlaylist = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/accounts/{accountId}/youtube-playlists' - }); -}; +export const updateYoutubeDefaultPlaylist = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/youtube-playlists', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List GBP locations + * * Returns all Google Business Profile locations the connected account has access to, including the currently selected location. */ -export const getGmbLocations = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/gmb-locations' - }); -}; +export const getGmbLocations = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/gmb-locations', + ...options +}); /** * Update GBP location + * * Switch which GBP location is active for a connected account. */ -export const updateGmbLocation = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/accounts/{accountId}/gmb-locations' - }); -}; +export const updateGmbLocation = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/gmb-locations', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List Reddit subreddits + * * Returns the subreddits the connected Reddit account can post to. Use this to get a subreddit name when creating a Reddit post. */ -export const getRedditSubreddits = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/reddit-subreddits' - }); -}; +export const getRedditSubreddits = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/reddit-subreddits', + ...options +}); /** * Set default subreddit + * * Sets the default subreddit used when publishing posts for this Reddit account. */ -export const updateRedditSubreddits = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/accounts/{accountId}/reddit-subreddits' - }); -}; +export const updateRedditSubreddits = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/reddit-subreddits', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List subreddit flairs + * * Returns available post flairs for a subreddit. Some subreddits require a flair when posting. */ -export const getRedditFlairs = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/reddit-flairs' - }); -}; +export const getRedditFlairs = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/reddit-flairs', + ...options +}); /** * Get Discord account settings + * * Returns the current Discord account settings including webhook identity (display name and avatar), connected channel, and guild information. */ -export const getDiscordSettings = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/discord-settings' - }); -}; +export const getDiscordSettings = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/discord-settings', + ...options +}); /** * Update Discord settings + * * Update Discord account settings. Supports two operations (can be combined): * * 1. **Webhook identity** - Set the default display name and avatar that appear as the message author on every post. These are account-level defaults; individual posts can override them via platformSpecificData.webhookUsername / webhookAvatarUrl. @@ -1701,108 +1887,131 @@ export const getDiscordSettings = (options * 2. **Switch channel** - Move the connection to a different channel in the same guild. A new webhook is automatically created in the target channel. * */ -export const updateDiscordSettings = (options: OptionsLegacyParser) => { - return (options?.client ?? client).patch({ - ...options, - url: '/v1/accounts/{accountId}/discord-settings' - }); -}; +export const updateDiscordSettings = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/discord-settings', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List Discord guild channels + * * Returns the text, announcement, and forum channels in the connected Discord guild. Use this to discover available channels when switching the connected channel via PATCH /v1/accounts/{accountId}/discord-settings. */ -export const getDiscordChannels = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/discord-channels' - }); -}; +export const getDiscordChannels = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/discord-channels', + ...options +}); + +/** + * Delete schedule + * + * Delete a queue from a profile. Requires queueId to specify which queue to delete. + * If deleting the default queue, another queue will be promoted to default. + * + */ +export const deleteQueueSlot = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/queue/slots', + ...options +}); /** * List schedules + * * Returns queue schedules for a profile. Use all=true for all queues, or queueId for a specific one. Defaults to the default queue. */ -export const listQueueSlots = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/queue/slots' - }); -}; +export const listQueueSlots = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/queue/slots', + ...options +}); /** * Create schedule + * * Create an additional queue for a profile. The first queue created becomes the default. * Subsequent queues are non-default unless explicitly set. * */ -export const createQueueSlot = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/queue/slots' - }); -}; +export const createQueueSlot = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/queue/slots', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Update schedule - * Create a new queue or update an existing one. Without queueId, creates/updates the default queue. With queueId, updates a specific queue. With setAsDefault=true, makes this queue the default for the profile. * - */ -export const updateQueueSlot = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/queue/slots' - }); -}; - -/** - * Delete schedule - * Delete a queue from a profile. Requires queueId to specify which queue to delete. - * If deleting the default queue, another queue will be promoted to default. + * Create a new queue or update an existing one. Without queueId, creates/updates the default queue. With queueId, updates a specific queue. With setAsDefault=true, makes this queue the default for the profile. * */ -export const deleteQueueSlot = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/queue/slots' - }); -}; +export const updateQueueSlot = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/queue/slots', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Preview upcoming slots + * * Returns the next N upcoming queue slot times for a profile as ISO datetime strings. */ -export const previewQueue = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/queue/preview' - }); -}; +export const previewQueue = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/queue/preview', + ...options +}); /** * Get next available slot + * * Returns the next available queue slot for preview purposes. To create a queue post, use POST /v1/posts with queuedFromProfile instead of scheduledFor. */ -export const getNextQueueSlot = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/queue/next-slot' - }); -}; +export const getNextQueueSlot = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/queue/next-slot', + ...options +}); + +/** + * Delete webhook + * + * Permanently delete a webhook configuration. + */ +export const deleteWebhookSettings = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/webhooks/settings', + ...options +}); /** * List webhooks + * * Retrieve all configured webhooks for the authenticated user. Supports up to 10 webhooks per user. */ -export const getWebhookSettings = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/webhooks/settings' - }); -}; +export const getWebhookSettings = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/webhooks/settings', + ...options +}); /** * Create webhook + * * Create a new webhook configuration. Maximum 10 webhooks per user. * * `name`, `url` and `events` are required. `url` must be a valid URL and `events` must contain at least one event. Whitespace is trimmed from `url` before validation. @@ -1810,15 +2019,19 @@ export const getWebhookSettings = (options * Webhooks are automatically disabled after 10 consecutive delivery failures. * */ -export const createWebhookSettings = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/webhooks/settings' - }); -}; +export const createWebhookSettings = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/webhooks/settings', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Update webhook + * * Update an existing webhook configuration. All fields except `_id` are optional; only provided fields will be updated. * * When provided, `name` must be 1-50 characters, `url` must be a valid URL, and `events` must contain at least one event. Whitespace is trimmed from `url` before validation. @@ -1826,66 +2039,63 @@ export const createWebhookSettings = (opti * Webhooks are automatically disabled after 10 consecutive delivery failures. * */ -export const updateWebhookSettings = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/webhooks/settings' - }); -}; - -/** - * Delete webhook - * Permanently delete a webhook configuration. - */ -export const deleteWebhookSettings = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/webhooks/settings' - }); -}; +export const updateWebhookSettings = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/webhooks/settings', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Send test webhook + * * Send a test webhook to verify your endpoint is configured correctly. The test payload includes event: "webhook.test" to distinguish it from real events. * */ -export const testWebhook = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/webhooks/test' - }); -}; +export const testWebhook = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/webhooks/test', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List activity logs + * * Unified logs endpoint. Returns logs for publishing, connections, webhooks, and messaging. * Filter by type, platform, status, and time range. Logs are retained for 90 days. * */ -export const listLogs = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/logs' - }); -}; +export const listLogs = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/logs', + ...options +}); /** * List conversations + * * Fetch conversations (DMs) from all connected messaging accounts in a single API call. Supports filtering by profile and platform. Results are aggregated and deduplicated. * Supported platforms: Facebook, Instagram, Twitter/X, Bluesky, Reddit, Telegram. * * Twitter/X limitation: X has replaced traditional DMs with encrypted "X Chat" for many accounts. Messages sent or received through encrypted X Chat are not accessible via X's API (the /2/dm_events endpoint only returns legacy unencrypted DMs). This means some Twitter/X conversations may show only outgoing messages or appear empty. This is an X platform limitation that affects all third-party applications. See X's docs on encrypted messaging for more details. * */ -export const listInboxConversations = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/inbox/conversations' - }); -}; +export const listInboxConversations = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/inbox/conversations', + ...options +}); /** * Create conversation + * * Initiate a new direct message conversation with a specified user. If a conversation already exists with the recipient, the message is added to the existing thread. * * Currently supported platforms: Twitter/X only. Other platforms will return PLATFORM_NOT_SUPPORTED. @@ -1897,37 +2107,45 @@ export const listInboxConversations = (opt * Rate limits: 200 requests per 15 minutes, 1,000 per 24 hours per user, 15,000 per 24 hours per app (shared across all DM endpoints). * */ -export const createInboxConversation = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/inbox/conversations' - }); -}; +export const createInboxConversation = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/inbox/conversations', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Get conversation + * * Retrieve details and metadata for a specific conversation. Requires accountId query parameter. */ -export const getInboxConversation = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/inbox/conversations/{conversationId}' - }); -}; +export const getInboxConversation = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/inbox/conversations/{conversationId}', + ...options +}); /** * Update conversation status + * * Archive or activate a conversation. Requires accountId in request body. */ -export const updateInboxConversation = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/inbox/conversations/{conversationId}' - }); -}; +export const updateInboxConversation = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/inbox/conversations/{conversationId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List messages + * * Fetch messages for a specific conversation, with cursor-based pagination * and ordering control. * @@ -1951,15 +2169,15 @@ export const updateInboxConversation = (op * Twitter/X limitation: X's encrypted "X Chat" messages are not accessible via the API. Conversations where the other participant uses encrypted X Chat may only show your outgoing messages. See the list conversations endpoint for more details. * */ -export const getInboxConversationMessages = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/inbox/conversations/{conversationId}/messages' - }); -}; +export const getInboxConversationMessages = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/inbox/conversations/{conversationId}/messages', + ...options +}); /** * Send message + * * Send a message in a conversation. Supports text, attachments, quick replies, * buttons, templates, and message tags. Attachment and interactive message * support varies by platform. @@ -1970,28 +2188,19 @@ export const getInboxConversationMessages = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/inbox/conversations/{conversationId}/messages' - }); -}; - -/** - * Edit message - * Edit the text and/or reply markup of a previously sent Telegram message. - * Only supported for Telegram. Returns 400 for other platforms. - * - */ -export const editInboxMessage = (options: OptionsLegacyParser) => { - return (options?.client ?? client).patch({ - ...options, - url: '/v1/inbox/conversations/{conversationId}/messages/{messageId}' - }); -}; +export const sendInboxMessage = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/inbox/conversations/{conversationId}/messages', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Delete message + * * Delete a message from a conversation. Platform support varies: * - Telegram: Full delete (bot's own messages anytime, others if admin) * - X/Twitter: Full delete (own DM events only) @@ -2000,15 +2209,32 @@ export const editInboxMessage = (options: * - Facebook, Instagram, WhatsApp: Not supported (returns 400) * */ -export const deleteInboxMessage = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/inbox/conversations/{conversationId}/messages/{messageId}' - }); -}; +export const deleteInboxMessage = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/inbox/conversations/{conversationId}/messages/{messageId}', + ...options +}); + +/** + * Edit message + * + * Edit the text and/or reply markup of a previously sent Telegram message. + * Only supported for Telegram. Returns 400 for other platforms. + * + */ +export const editInboxMessage = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/inbox/conversations/{conversationId}/messages/{messageId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Send typing indicator + * * Show a typing indicator in a conversation. Platform support: * - Facebook Messenger: Shows "Page is typing..." for 20 seconds * - Telegram: Shows "Bot is typing..." for 5 seconds @@ -2018,45 +2244,53 @@ export const deleteInboxMessage = (options * Typing indicators are best-effort. The endpoint always returns 200 even if the platform call fails. * */ -export const sendTypingIndicator = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/inbox/conversations/{conversationId}/typing' - }); -}; +export const sendTypingIndicator = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/inbox/conversations/{conversationId}/typing', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** - * Add reaction - * Add an emoji reaction to a message. Platform support: - * - Telegram: Supports a subset of Unicode emoji reactions - * - WhatsApp: Supports any standard emoji (one reaction per message per sender) + * Remove reaction + * + * Remove a reaction from a message. Platform support: + * - Telegram: Send empty reaction array to clear + * - WhatsApp: Send empty emoji to remove * - All others: Returns 400 (not supported) * */ -export const addMessageReaction = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/inbox/conversations/{conversationId}/messages/{messageId}/reactions' - }); -}; +export const removeMessageReaction = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/inbox/conversations/{conversationId}/messages/{messageId}/reactions', + ...options +}); /** - * Remove reaction - * Remove a reaction from a message. Platform support: - * - Telegram: Send empty reaction array to clear - * - WhatsApp: Send empty emoji to remove + * Add reaction + * + * Add an emoji reaction to a message. Platform support: + * - Telegram: Supports a subset of Unicode emoji reactions + * - WhatsApp: Supports any standard emoji (one reaction per message per sender) * - All others: Returns 400 (not supported) * */ -export const removeMessageReaction = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/inbox/conversations/{conversationId}/messages/{messageId}/reactions' - }); -}; +export const addMessageReaction = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/inbox/conversations/{conversationId}/messages/{messageId}/reactions', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Upload media file + * * Upload a media file using API key authentication and get back a publicly accessible URL. * The URL can be used as attachmentUrl when sending inbox messages. * @@ -2067,119 +2301,131 @@ export const removeMessageReaction = (opti * this endpoint uses standard Bearer token authentication for programmatic use. * */ -export const uploadMediaDirect = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - ...formDataBodySerializer, - headers: { - 'Content-Type': null, - ...options?.headers - }, - url: '/v1/media/upload-direct' - }); -}; +export const uploadMediaDirect = (options: Options) => (options.client ?? client).post({ + ...formDataBodySerializer, + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/media/upload-direct', + ...options, + headers: { + 'Content-Type': null, + ...options.headers + } +}); + +/** + * Delete FB persistent menu + * + * Removes the persistent menu from Facebook Messenger conversations for this account. + */ +export const deleteMessengerMenu = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/messenger-menu', + ...options +}); /** * Get FB persistent menu + * * Get the persistent menu configuration for a Facebook Messenger account. */ -export const getMessengerMenu = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/messenger-menu' - }); -}; +export const getMessengerMenu = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/messenger-menu', + ...options +}); /** * Set FB persistent menu + * * Set the persistent menu for a Facebook Messenger account. Max 3 top-level items, max 5 nested items. */ -export const setMessengerMenu = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/accounts/{accountId}/messenger-menu' - }); -}; +export const setMessengerMenu = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/messenger-menu', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** - * Delete FB persistent menu - * Removes the persistent menu from Facebook Messenger conversations for this account. + * Delete IG ice breakers + * + * Removes the ice breaker questions from an Instagram account's Messenger experience. */ -export const deleteMessengerMenu = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/accounts/{accountId}/messenger-menu' - }); -}; +export const deleteInstagramIceBreakers = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/instagram-ice-breakers', + ...options +}); /** * Get IG ice breakers + * * Get the ice breaker configuration for an Instagram account. */ -export const getInstagramIceBreakers = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/instagram-ice-breakers' - }); -}; +export const getInstagramIceBreakers = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/instagram-ice-breakers', + ...options +}); /** * Set IG ice breakers + * * Set ice breakers for an Instagram account. Max 4 ice breakers, question max 80 chars. */ -export const setInstagramIceBreakers = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/accounts/{accountId}/instagram-ice-breakers' - }); -}; +export const setInstagramIceBreakers = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/instagram-ice-breakers', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** - * Delete IG ice breakers - * Removes the ice breaker questions from an Instagram account's Messenger experience. + * Delete TG bot commands + * + * Clears all bot commands configured for a Telegram bot account. */ -export const deleteInstagramIceBreakers = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/accounts/{accountId}/instagram-ice-breakers' - }); -}; +export const deleteTelegramCommands = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/telegram-commands', + ...options +}); /** * Get TG bot commands + * * Get the bot commands configuration for a Telegram account. */ -export const getTelegramCommands = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/telegram-commands' - }); -}; +export const getTelegramCommands = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/telegram-commands', + ...options +}); /** * Set TG bot commands + * * Set bot commands for a Telegram account. */ -export const setTelegramCommands = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/accounts/{accountId}/telegram-commands' - }); -}; - -/** - * Delete TG bot commands - * Clears all bot commands configured for a Telegram bot account. - */ -export const deleteTelegramCommands = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/accounts/{accountId}/telegram-commands' - }); -}; +export const setTelegramCommands = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/telegram-commands', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List commented posts + * * Returns posts with comment counts from all connected accounts. Aggregates data across multiple accounts. * * For users with the Ads add-on (Metronome plans always qualify), the user's Meta ads @@ -2194,102 +2440,114 @@ export const deleteTelegramCommands = (opt * (Instagram side); a row whose count can't be read is omitted. * */ -export const listInboxComments = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/inbox/comments' - }); -}; +export const listInboxComments = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/inbox/comments', + ...options +}); + +/** + * Delete comment + * + * Delete a comment on a post. Supported by Facebook, Instagram, Bluesky, Reddit, YouTube, and LinkedIn. + * Requires accountId and commentId query parameters. + * + */ +export const deleteInboxComment = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/inbox/comments/{postId}', + ...options +}); /** * Get post comments + * * Fetch comments for a specific post. Requires accountId query parameter. */ -export const getInboxPostComments = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/inbox/comments/{postId}' - }); -}; +export const getInboxPostComments = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/inbox/comments/{postId}', + ...options +}); /** * Reply to comment + * * Post a reply to a post or specific comment. Requires accountId in request body. */ -export const replyToInboxPost = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/inbox/comments/{postId}' - }); -}; +export const replyToInboxPost = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/inbox/comments/{postId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** - * Delete comment - * Delete a comment on a post. Supported by Facebook, Instagram, Bluesky, Reddit, YouTube, and LinkedIn. - * Requires accountId and commentId query parameters. + * Unhide comment + * + * Unhide a previously hidden comment. Supported by Facebook, Instagram, Threads, and X/Twitter. * */ -export const deleteInboxComment = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/inbox/comments/{postId}' - }); -}; +export const unhideInboxComment = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/inbox/comments/{postId}/{commentId}/hide', + ...options +}); /** * Hide comment + * * Hide a comment on a post. Supported by Facebook, Instagram, Threads, and X/Twitter. * Hidden comments are only visible to the commenter and page admin. * For X/Twitter, the reply must belong to a conversation started by the authenticated user. * */ -export const hideInboxComment = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/inbox/comments/{postId}/{commentId}/hide' - }); -}; +export const hideInboxComment = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/inbox/comments/{postId}/{commentId}/hide', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** - * Unhide comment - * Unhide a previously hidden comment. Supported by Facebook, Instagram, Threads, and X/Twitter. + * Unlike comment + * + * Remove a like from a comment. Supported platforms: Facebook, Twitter/X, Bluesky, Reddit. + * For Bluesky, the likeUri query parameter is required. * */ -export const unhideInboxComment = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/inbox/comments/{postId}/{commentId}/hide' - }); -}; +export const unlikeInboxComment = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/inbox/comments/{postId}/{commentId}/like', + ...options +}); /** * Like comment + * * Like or upvote a comment on a post. Supported platforms: Facebook, Twitter/X, Bluesky, Reddit. * For Bluesky, the cid (content identifier) is required in the request body. * */ -export const likeInboxComment = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/inbox/comments/{postId}/{commentId}/like' - }); -}; - -/** - * Unlike comment - * Remove a like from a comment. Supported platforms: Facebook, Twitter/X, Bluesky, Reddit. - * For Bluesky, the likeUri query parameter is required. - * - */ -export const unlikeInboxComment = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/inbox/comments/{postId}/{commentId}/like' - }); -}; +export const likeInboxComment = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/inbox/comments/{postId}/{commentId}/like', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Send private reply + * * Send a private message to the author of a comment. Supported on Instagram and Facebook only. * One reply per comment, must be sent within 7 days. Optionally attach interactive elements: * `quickReplies` (chips above the keyboard, max 13) or `buttons` (1-3 inline postback/url @@ -2298,140 +2556,164 @@ export const unlikeInboxComment = (options * `quickReplies` and `buttons` are mutually exclusive. * */ -export const sendPrivateReplyToComment = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/inbox/comments/{postId}/{commentId}/private-reply' - }); -}; +export const sendPrivateReplyToComment = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/inbox/comments/{postId}/{commentId}/private-reply', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Undo retweet + * + * Undo a retweet (un-repost a tweet). + * + */ +export const undoRetweet = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/twitter/retweet', + ...options +}); /** * Retweet a post + * * Retweet (repost) a tweet by ID. * Rate limit: 50 requests per 15-min window. Shares the 300/3hr creation limit with tweet creation. * */ -export const retweetPost = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/twitter/retweet' - }); -}; +export const retweetPost = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/twitter/retweet', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** - * Undo retweet - * Undo a retweet (un-repost a tweet). + * Remove bookmark + * + * Remove a bookmark from a tweet. * */ -export const undoRetweet = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/twitter/retweet' - }); -}; +export const removeBookmark = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/twitter/bookmark', + ...options +}); /** * Bookmark a tweet + * * Bookmark a tweet by ID. * Requires the bookmark.write OAuth scope. * Rate limit: 50 requests per 15-min window. * */ -export const bookmarkPost = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/twitter/bookmark' - }); -}; +export const bookmarkPost = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/twitter/bookmark', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** - * Remove bookmark - * Remove a bookmark from a tweet. + * Unfollow a user + * + * Unfollow a user on X/Twitter. * */ -export const removeBookmark = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/twitter/bookmark' - }); -}; +export const unfollowUser = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/twitter/follow', + ...options +}); /** * Follow a user + * * Follow a user on X/Twitter. * Requires the follows.write OAuth scope. * For protected accounts, a follow request is sent instead (pending_follow will be true). * */ -export const followUser = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/twitter/follow' - }); -}; - -/** - * Unfollow a user - * Unfollow a user on X/Twitter. - * - */ -export const unfollowUser = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/twitter/follow' - }); -}; +export const followUser = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/twitter/follow', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List reviews + * * Fetch reviews from all connected Facebook Pages and Google Business accounts. Aggregates data with filtering and sorting options. * Supported platforms: Facebook, Google Business. * */ -export const listInboxReviews = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/inbox/reviews' - }); -}; +export const listInboxReviews = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/inbox/reviews', + ...options +}); /** - * Reply to review - * Post a reply to a review. Requires accountId in request body. + * Delete review reply + * + * Delete a reply to a review (Google Business only). Requires accountId in request body. */ -export const replyToInboxReview = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/inbox/reviews/{reviewId}/reply' - }); -}; +export const deleteInboxReviewReply = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/inbox/reviews/{reviewId}/reply', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** - * Delete review reply - * Delete a reply to a review (Google Business only). Requires accountId in request body. + * Reply to review + * + * Post a reply to a review. Requires accountId in request body. */ -export const deleteInboxReviewReply = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/inbox/reviews/{reviewId}/reply' - }); -}; +export const replyToInboxReview = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/inbox/reviews/{reviewId}/reply', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List templates + * * List all message templates for the WhatsApp Business Account (WABA) associated with the given account. * Templates are fetched directly from the WhatsApp Cloud API. * */ -export const getWhatsAppTemplates = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/whatsapp/templates' - }); -}; +export const getWhatsAppTemplates = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/templates', + ...options +}); /** * Create template + * * Create a new message template. Supports two modes: * * Custom template: Provide components with your own content. Submitted to Meta for review (can take up to 24h). @@ -2443,136 +2725,152 @@ export const getWhatsAppTemplates = (optio * Browse available library templates at: https://business.facebook.com/wa/manage/message-templates/ * */ -export const createWhatsAppTemplate = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/whatsapp/templates' - }); -}; +export const createWhatsAppTemplate = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/templates', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Delete template + * + * Permanently delete a message template by name. + * + */ +export const deleteWhatsAppTemplate = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/templates/{templateName}', + ...options +}); /** * Get template + * * Retrieve a single message template by name. * */ -export const getWhatsAppTemplate = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/whatsapp/templates/{templateName}' - }); -}; +export const getWhatsAppTemplate = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/templates/{templateName}', + ...options +}); /** * Update template + * * Update a message template's components. Only certain fields can be updated depending on * the template's current approval state. Approved templates can only have components updated. * */ -export const updateWhatsAppTemplate = (options: OptionsLegacyParser) => { - return (options?.client ?? client).patch({ - ...options, - url: '/v1/whatsapp/templates/{templateName}' - }); -}; - -/** - * Delete template - * Permanently delete a message template by name. - * - */ -export const deleteWhatsAppTemplate = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/whatsapp/templates/{templateName}' - }); -}; +export const updateWhatsAppTemplate = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/templates/{templateName}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Get business profile + * * Retrieve the WhatsApp Business profile for the account (about, address, description, email, websites, etc.). * */ -export const getWhatsAppBusinessProfile = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/whatsapp/business-profile' - }); -}; +export const getWhatsAppBusinessProfile = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/business-profile', + ...options +}); /** * Update business profile + * * Update the WhatsApp Business profile. All fields are optional; only provided fields will be updated. * Constraints: about max 139 chars, description max 512 chars, max 2 websites. * */ -export const updateWhatsAppBusinessProfile = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/whatsapp/business-profile' - }); -}; +export const updateWhatsAppBusinessProfile = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/business-profile', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Upload profile picture + * * Upload a new profile picture for the WhatsApp Business Profile. * Uses Meta's resumable upload API under the hood: creates an upload session, * uploads the image bytes, then updates the business profile with the resulting handle. * */ -export const uploadWhatsAppProfilePhoto = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - ...formDataBodySerializer, - headers: { - 'Content-Type': null, - ...options?.headers - }, - url: '/v1/whatsapp/business-profile/photo' - }); -}; +export const uploadWhatsAppProfilePhoto = (options: Options) => (options.client ?? client).post({ + ...formDataBodySerializer, + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/business-profile/photo', + ...options, + headers: { + 'Content-Type': null, + ...options.headers + } +}); /** * Get display name status + * * Fetch the current display name and its Meta review status for a WhatsApp Business account. * Display name changes require Meta approval and can take 1-3 business days. * */ -export const getWhatsAppDisplayName = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/whatsapp/business-profile/display-name' - }); -}; +export const getWhatsAppDisplayName = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/business-profile/display-name', + ...options +}); /** * Request display name change + * * Submit a display name change request for the WhatsApp Business account. * The new name must follow WhatsApp naming guidelines (3-512 characters, must represent your business). * Changes require Meta review and approval, which typically takes 1-3 business days. * */ -export const updateWhatsAppDisplayName = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/whatsapp/business-profile/display-name' - }); -}; +export const updateWhatsAppDisplayName = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/business-profile/display-name', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List phone numbers + * * List all WhatsApp phone numbers purchased by the authenticated user. * By default, released numbers are excluded. * */ -export const getWhatsAppPhoneNumbers = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/whatsapp/phone-numbers' - }); -}; +export const getWhatsAppPhoneNumbers = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/phone-numbers', + ...options +}); /** * Purchase phone number + * * Initiate purchasing a WhatsApp phone number. Payment-first flow: the user does not pick * a specific number. The system either creates a Stripe Checkout Session (first number) * or increments the existing subscription quantity and provisions inline (subsequent numbers). @@ -2580,28 +2878,19 @@ export const getWhatsAppPhoneNumbers = (op * Requires a paid plan. The maximum number of phone numbers is determined by the user's plan. * */ -export const purchaseWhatsAppPhoneNumber = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/whatsapp/phone-numbers/purchase' - }); -}; - -/** - * Get phone number - * Retrieve the current status of a purchased phone number. Used to poll for - * Meta pre-verification completion after purchase. - * - */ -export const getWhatsAppPhoneNumber = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/whatsapp/phone-numbers/{phoneNumberId}' - }); -}; +export const purchaseWhatsAppPhoneNumber = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/phone-numbers/purchase', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Release phone number + * * Release a purchased phone number. This will: * 1. Disconnect any linked WhatsApp social account * 2. Decrement the Stripe subscription quantity (or cancel if last number) @@ -2609,244 +2898,289 @@ export const getWhatsAppPhoneNumber = (opt * 4. Mark the number as released * */ -export const releaseWhatsAppPhoneNumber = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/whatsapp/phone-numbers/{phoneNumberId}' - }); -}; +export const releaseWhatsAppPhoneNumber = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/phone-numbers/{phoneNumberId}', + ...options +}); + +/** + * Get phone number + * + * Retrieve the current status of a purchased phone number. Used to poll for + * Meta pre-verification completion after purchase. + * + */ +export const getWhatsAppPhoneNumber = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/phone-numbers/{phoneNumberId}', + ...options +}); /** * List active groups + * * List active WhatsApp group chats for a business phone number. * These are actual WhatsApp group conversations on the platform. * * Not available on [Coexistence](/platforms/whatsapp#whatsapp-business-app-coexistence) numbers. Requires a Cloud API-only number. * */ -export const listWhatsAppGroupChats = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/whatsapp/wa-groups' - }); -}; +export const listWhatsAppGroupChats = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/wa-groups', + ...options +}); /** * Create group + * * Create a new WhatsApp group chat. Returns the group ID and optionally an invite link. * * Not available on [Coexistence](/platforms/whatsapp#whatsapp-business-app-coexistence) numbers. Requires a Cloud API-only number. * */ -export const createWhatsAppGroupChat = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/whatsapp/wa-groups' - }); -}; +export const createWhatsAppGroupChat = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/wa-groups', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Delete group + * + * Delete a WhatsApp group and remove all participants. + * + * Not available on [Coexistence](/platforms/whatsapp#whatsapp-business-app-coexistence) numbers. Requires a Cloud API-only number. + * + */ +export const deleteWhatsAppGroupChat = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/wa-groups/{groupId}', + ...options +}); /** * Get group info + * * Retrieve metadata about a WhatsApp group including subject, description, * participants, and settings. * * Not available on [Coexistence](/platforms/whatsapp#whatsapp-business-app-coexistence) numbers. Requires a Cloud API-only number. * */ -export const getWhatsAppGroupChat = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/whatsapp/wa-groups/{groupId}' - }); -}; +export const getWhatsAppGroupChat = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/wa-groups/{groupId}', + ...options +}); /** * Update group settings + * * Update the subject, description, or join approval mode of a WhatsApp group. * * Not available on [Coexistence](/platforms/whatsapp#whatsapp-business-app-coexistence) numbers. Requires a Cloud API-only number. * */ -export const updateWhatsAppGroupChat = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/whatsapp/wa-groups/{groupId}' - }); -}; +export const updateWhatsAppGroupChat = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/wa-groups/{groupId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** - * Delete group - * Delete a WhatsApp group and remove all participants. + * Remove participants + * + * Remove participants from a WhatsApp group. * * Not available on [Coexistence](/platforms/whatsapp#whatsapp-business-app-coexistence) numbers. Requires a Cloud API-only number. * */ -export const deleteWhatsAppGroupChat = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/whatsapp/wa-groups/{groupId}' - }); -}; +export const removeWhatsAppGroupParticipants = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/wa-groups/{groupId}/participants', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Add participants + * * Add participants to a WhatsApp group. Maximum 8 participants per request. * * Not available on [Coexistence](/platforms/whatsapp#whatsapp-business-app-coexistence) numbers. Requires a Cloud API-only number. * */ -export const addWhatsAppGroupParticipants = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/whatsapp/wa-groups/{groupId}/participants' - }); -}; +export const addWhatsAppGroupParticipants = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/wa-groups/{groupId}/participants', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** - * Remove participants - * Remove participants from a WhatsApp group. + * Create invite link + * + * Create a new invite link for a WhatsApp group. The previous link is revoked. * * Not available on [Coexistence](/platforms/whatsapp#whatsapp-business-app-coexistence) numbers. Requires a Cloud API-only number. * */ -export const removeWhatsAppGroupParticipants = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/whatsapp/wa-groups/{groupId}/participants' - }); -}; +export const createWhatsAppGroupInviteLink = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/wa-groups/{groupId}/invite-link', + ...options +}); /** - * Create invite link - * Create a new invite link for a WhatsApp group. The previous link is revoked. + * Reject join requests + * + * Reject pending join requests for a WhatsApp group. * * Not available on [Coexistence](/platforms/whatsapp#whatsapp-business-app-coexistence) numbers. Requires a Cloud API-only number. * */ -export const createWhatsAppGroupInviteLink = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/whatsapp/wa-groups/{groupId}/invite-link' - }); -}; +export const rejectWhatsAppGroupJoinRequests = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/wa-groups/{groupId}/join-requests', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List join requests + * * List pending join requests for a WhatsApp group (only for groups with approval_required mode). * * Not available on [Coexistence](/platforms/whatsapp#whatsapp-business-app-coexistence) numbers. Requires a Cloud API-only number. * */ -export const listWhatsAppGroupJoinRequests = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/whatsapp/wa-groups/{groupId}/join-requests' - }); -}; +export const listWhatsAppGroupJoinRequests = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/wa-groups/{groupId}/join-requests', + ...options +}); /** * Approve join requests - * Approve pending join requests for a WhatsApp group. * - * Not available on [Coexistence](/platforms/whatsapp#whatsapp-business-app-coexistence) numbers. Requires a Cloud API-only number. - * - */ -export const approveWhatsAppGroupJoinRequests = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/whatsapp/wa-groups/{groupId}/join-requests' - }); -}; - -/** - * Reject join requests - * Reject pending join requests for a WhatsApp group. + * Approve pending join requests for a WhatsApp group. * * Not available on [Coexistence](/platforms/whatsapp#whatsapp-business-app-coexistence) numbers. Requires a Cloud API-only number. * */ -export const rejectWhatsAppGroupJoinRequests = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/whatsapp/wa-groups/{groupId}/join-requests' - }); -}; +export const approveWhatsAppGroupJoinRequests = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/wa-groups/{groupId}/join-requests', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List flows + * * List all WhatsApp Flows for the Business Account (WABA) associated with the given account. * */ -export const listWhatsAppFlows = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/whatsapp/flows' - }); -}; +export const listWhatsAppFlows = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/flows', + ...options +}); /** * Create flow + * * Create a new WhatsApp Flow in DRAFT status. Optionally clone an existing flow. * After creating, upload a Flow JSON definition, then publish to make it sendable. * */ -export const createWhatsAppFlow = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/whatsapp/flows' - }); -}; +export const createWhatsAppFlow = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/flows', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** - * Get flow - * Get details for a specific flow, including status, categories, validation errors, and preview URL. + * Delete flow + * + * Delete a DRAFT flow. This is irreversible. Only flows in DRAFT status can be deleted. * */ -export const getWhatsAppFlow = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/whatsapp/flows/{flowId}' - }); -}; +export const deleteWhatsAppFlow = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/flows/{flowId}', + ...options +}); /** - * Update flow - * Update metadata (name, categories) of a DRAFT flow. Published flows are immutable. + * Get flow + * + * Get details for a specific flow, including status, categories, validation errors, and preview URL. * */ -export const updateWhatsAppFlow = (options: OptionsLegacyParser) => { - return (options?.client ?? client).patch({ - ...options, - url: '/v1/whatsapp/flows/{flowId}' - }); -}; +export const getWhatsAppFlow = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/flows/{flowId}', + ...options +}); /** - * Delete flow - * Delete a DRAFT flow. This is irreversible. Only flows in DRAFT status can be deleted. + * Update flow + * + * Update metadata (name, categories) of a DRAFT flow. Published flows are immutable. * */ -export const deleteWhatsAppFlow = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/whatsapp/flows/{flowId}' - }); -}; +export const updateWhatsAppFlow = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/flows/{flowId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Get flow JSON asset + * * Get the flow JSON asset metadata, including a temporary download URL for the Flow JSON file. * */ -export const getWhatsAppFlowJson = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/whatsapp/flows/{flowId}/json' - }); -}; +export const getWhatsAppFlowJson = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/flows/{flowId}/json', + ...options +}); /** * Upload flow JSON + * * Upload or update the Flow JSON for a DRAFT flow. The Flow JSON defines all screens, * components (text inputs, dropdowns, date pickers, etc.), and navigation. * @@ -2854,430 +3188,498 @@ export const getWhatsAppFlowJson = (option * See: https://developers.facebook.com/docs/whatsapp/flows/reference/flowjson * */ -export const uploadWhatsAppFlowJson = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/whatsapp/flows/{flowId}/json' - }); -}; +export const uploadWhatsAppFlowJson = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/flows/{flowId}/json', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Publish flow + * * Publish a DRAFT flow. This is irreversible. Once published, the flow and its JSON * become immutable and the flow can be sent to users. To update a published flow, * create a new flow (optionally cloning this one via cloneFlowId). * */ -export const publishWhatsAppFlow = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/whatsapp/flows/{flowId}/publish' - }); -}; +export const publishWhatsAppFlow = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/flows/{flowId}/publish', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Deprecate flow + * * Deprecate a PUBLISHED flow. This is irreversible. Deprecated flows cannot be sent * or opened, but existing active sessions may continue until they complete. * */ -export const deprecateWhatsAppFlow = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/whatsapp/flows/{flowId}/deprecate' - }); -}; +export const deprecateWhatsAppFlow = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/flows/{flowId}/deprecate', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Send flow message + * * Send a published flow as an interactive message with a CTA button. * When the recipient taps the button, the flow opens natively in WhatsApp. * Flow responses are received via webhooks. * */ -export const sendWhatsAppFlowMessage = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/whatsapp/flows/send' - }); -}; +export const sendWhatsAppFlowMessage = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/flows/send', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List contacts + * * List and search contacts for a profile. Supports filtering by tags, platform, subscription status, and full-text search. */ -export const listContacts = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/contacts' - }); -}; +export const listContacts = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/contacts', + ...options +}); /** * Create contact + * * Create a new contact. Optionally create a platform channel in the same request by providing accountId, platform, and platformIdentifier. */ -export const createContact = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/contacts' - }); -}; +export const createContact = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/contacts', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Delete contact + * + * Permanently deletes a contact and all associated channels. + */ +export const deleteContact = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/contacts/{contactId}', + ...options +}); /** * Get contact + * * Returns a contact with all associated messaging channels. */ -export const getContact = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/contacts/{contactId}' - }); -}; +export const getContact = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/contacts/{contactId}', + ...options +}); /** * Update contact + * * Update one or more fields on a contact. Only provided fields are changed. */ -export const updateContact = (options: OptionsLegacyParser) => { - return (options?.client ?? client).patch({ - ...options, - url: '/v1/contacts/{contactId}' - }); -}; - -/** - * Delete contact - * Permanently deletes a contact and all associated channels. - */ -export const deleteContact = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/contacts/{contactId}' - }); -}; +export const updateContact = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/contacts/{contactId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List channels for a contact + * * Returns all messaging channels linked to a contact (e.g. Instagram DM, Telegram, WhatsApp). */ -export const getContactChannels = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/contacts/{contactId}/channels' - }); -}; +export const getContactChannels = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/contacts/{contactId}/channels', + ...options +}); /** * Bulk create contacts + * * Import up to 1000 contacts at a time. Skips duplicates. */ -export const bulkCreateContacts = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/contacts/bulk' - }); -}; +export const bulkCreateContacts = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/contacts/bulk', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** - * Set custom field value - * Set or overwrite a custom field value on a contact. The value type must match the field definition. + * Clear custom field value + * + * Remove a custom field value from a contact. The field definition is not affected. */ -export const setContactFieldValue = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/contacts/{contactId}/fields/{slug}' - }); -}; +export const clearContactFieldValue = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/contacts/{contactId}/fields/{slug}', + ...options +}); /** - * Clear custom field value - * Remove a custom field value from a contact. The field definition is not affected. + * Set custom field value + * + * Set or overwrite a custom field value on a contact. The value type must match the field definition. */ -export const clearContactFieldValue = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/contacts/{contactId}/fields/{slug}' - }); -}; +export const setContactFieldValue = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/contacts/{contactId}/fields/{slug}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List custom field definitions + * * Returns all custom field definitions. Optionally filter by profile. */ -export const listCustomFields = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/custom-fields' - }); -}; +export const listCustomFields = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/custom-fields', + ...options +}); /** * Create custom field + * * Create a new custom field definition. Supported types are text, number, date, boolean, and select. */ -export const createCustomField = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/custom-fields' - }); -}; +export const createCustomField = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/custom-fields', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** - * Update custom field - * Update a custom field definition. The field type cannot be changed after creation. + * Delete custom field + * + * Delete a custom field definition and remove its values from all contacts. */ -export const updateCustomField = (options: OptionsLegacyParser) => { - return (options?.client ?? client).patch({ - ...options, - url: '/v1/custom-fields/{fieldId}' - }); -}; +export const deleteCustomField = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/custom-fields/{fieldId}', + ...options +}); /** - * Delete custom field - * Delete a custom field definition and remove its values from all contacts. + * Update custom field + * + * Update a custom field definition. The field type cannot be changed after creation. */ -export const deleteCustomField = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/custom-fields/{fieldId}' - }); -}; +export const updateCustomField = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/custom-fields/{fieldId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List broadcasts + * * Returns broadcasts with delivery stats. Filter by status, platform, or profile. */ -export const listBroadcasts = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/broadcasts' - }); -}; +export const listBroadcasts = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/broadcasts', + ...options +}); /** * Create broadcast draft + * * Create a broadcast in draft status. Add recipients and then send or schedule it. */ -export const createBroadcast = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/broadcasts' - }); -}; +export const createBroadcast = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/broadcasts', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** - * Get broadcast details - * Returns a broadcast with its full configuration and delivery stats. + * Delete broadcast + * + * Permanently delete a broadcast. Only drafts can be deleted. */ -export const getBroadcast = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/broadcasts/{broadcastId}' - }); -}; +export const deleteBroadcast = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/broadcasts/{broadcastId}', + ...options +}); /** - * Update broadcast - * Update a broadcast's name, message, template, or segment filters. Only draft broadcasts can be updated. + * Get broadcast details + * + * Returns a broadcast with its full configuration and delivery stats. */ -export const updateBroadcast = (options: OptionsLegacyParser) => { - return (options?.client ?? client).patch({ - ...options, - url: '/v1/broadcasts/{broadcastId}' - }); -}; +export const getBroadcast = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/broadcasts/{broadcastId}', + ...options +}); -/** - * Delete broadcast - * Permanently delete a broadcast. Only drafts can be deleted. +/** + * Update broadcast + * + * Update a broadcast's name, message, template, or segment filters. Only draft broadcasts can be updated. */ -export const deleteBroadcast = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/broadcasts/{broadcastId}' - }); -}; +export const updateBroadcast = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/broadcasts/{broadcastId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Send broadcast now + * * Immediately start sending a draft broadcast to its recipients. */ -export const sendBroadcast = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/broadcasts/{broadcastId}/send' - }); -}; +export const sendBroadcast = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/broadcasts/{broadcastId}/send', + ...options +}); /** * Schedule broadcast for later + * * Schedule a draft broadcast to be sent at a future date and time. */ -export const scheduleBroadcast = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/broadcasts/{broadcastId}/schedule' - }); -}; +export const scheduleBroadcast = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/broadcasts/{broadcastId}/schedule', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Cancel broadcast + * * Cancel a scheduled or in-progress broadcast. Already-sent messages are not affected. */ -export const cancelBroadcast = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/broadcasts/{broadcastId}/cancel' - }); -}; +export const cancelBroadcast = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/broadcasts/{broadcastId}/cancel', + ...options +}); /** * List broadcast recipients + * * Returns recipients for a broadcast with individual delivery status. Filter by status. */ -export const listBroadcastRecipients = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/broadcasts/{broadcastId}/recipients' - }); -}; +export const listBroadcastRecipients = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/broadcasts/{broadcastId}/recipients', + ...options +}); /** * Add recipients to a broadcast + * * Add recipients by contact IDs, raw phone numbers, or from the broadcast's segment filters. */ -export const addBroadcastRecipients = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/broadcasts/{broadcastId}/recipients' - }); -}; +export const addBroadcastRecipients = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/broadcasts/{broadcastId}/recipients', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List sequences + * * Returns sequences with enrollment stats. Filter by status, platform, or profile. */ -export const listSequences = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/sequences' - }); -}; +export const listSequences = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/sequences', + ...options +}); /** * Create sequence + * * Create a multi-step messaging sequence. Each step has a delay and a message or WhatsApp template. */ -export const createSequence = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/sequences' - }); -}; +export const createSequence = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/sequences', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Delete sequence + * + * Permanently delete a sequence. Active enrollments are stopped. + */ +export const deleteSequence = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/sequences/{sequenceId}', + ...options +}); /** * Get sequence with steps + * * Returns a sequence with all its steps and enrollment stats. */ -export const getSequence = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/sequences/{sequenceId}' - }); -}; +export const getSequence = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/sequences/{sequenceId}', + ...options +}); /** * Update sequence + * * Update a sequence's name, steps, or exit conditions. Steps can only be modified while the sequence is draft or paused. */ -export const updateSequence = (options: OptionsLegacyParser) => { - return (options?.client ?? client).patch({ - ...options, - url: '/v1/sequences/{sequenceId}' - }); -}; - -/** - * Delete sequence - * Permanently delete a sequence. Active enrollments are stopped. - */ -export const deleteSequence = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/sequences/{sequenceId}' - }); -}; +export const updateSequence = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/sequences/{sequenceId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Activate sequence + * * Start a draft or paused sequence. The sequence must have at least one step. */ -export const activateSequence = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/sequences/{sequenceId}/activate' - }); -}; +export const activateSequence = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/sequences/{sequenceId}/activate', + ...options +}); /** * Pause sequence + * * Pause an active sequence. Enrolled contacts stop receiving messages until the sequence is reactivated. */ -export const pauseSequence = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/sequences/{sequenceId}/pause' - }); -}; +export const pauseSequence = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/sequences/{sequenceId}/pause', + ...options +}); /** * Enroll contacts in a sequence + * * Enroll one or more contacts into a sequence. Contacts already enrolled are skipped. */ -export const enrollContacts = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/sequences/{sequenceId}/enroll' - }); -}; +export const enrollContacts = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/sequences/{sequenceId}/enroll', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Unenroll contact + * * Remove a contact from a sequence. No further messages will be sent to this contact. */ -export const unenrollContact = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/sequences/{sequenceId}/enroll/{contactId}' - }); -}; +export const unenrollContact = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/sequences/{sequenceId}/enroll/{contactId}', + ...options +}); /** * List enrollments for a sequence + * * Returns enrolled contacts with their progress, status, and next scheduled step. */ -export const listSequenceEnrollments = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/sequences/{sequenceId}/enrollments' - }); -}; +export const listSequenceEnrollments = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/sequences/{sequenceId}/enrollments', + ...options +}); /** * List comment-to-DM automations + * * List all comment-to-DM automations for a profile. Returns automations with their stats. */ -export const listCommentAutomations = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/comment-automations' - }); -}; +export const listCommentAutomations = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/comment-automations', + ...options +}); /** * Create comment-to-DM automation + * * Create a keyword-triggered DM automation on an Instagram or Facebook account. * When someone comments a matching keyword, they automatically receive a DM. * @@ -3290,62 +3692,70 @@ export const listCommentAutomations = (opt * independently. Per-post automations take priority on their post. * */ -export const createCommentAutomation = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/comment-automations' - }); -}; +export const createCommentAutomation = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/comment-automations', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Delete automation + * + * Permanently delete an automation and all its trigger logs. + */ +export const deleteCommentAutomation = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/comment-automations/{automationId}', + ...options +}); /** * Get automation details + * * Returns an automation with its configuration, stats, and recent trigger logs. */ -export const getCommentAutomation = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/comment-automations/{automationId}' - }); -}; +export const getCommentAutomation = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/comment-automations/{automationId}', + ...options +}); /** * Update automation settings + * * Update an automation's keywords, DM message, inline buttons, comment reply, or active status. * Pass `buttons: []` to clear all buttons. When `buttons` is non-empty, `dmMessage` (the new * one if you're changing it, otherwise the stored one) must be 640 characters or less. * */ -export const updateCommentAutomation = (options: OptionsLegacyParser) => { - return (options?.client ?? client).patch({ - ...options, - url: '/v1/comment-automations/{automationId}' - }); -}; - -/** - * Delete automation - * Permanently delete an automation and all its trigger logs. - */ -export const deleteCommentAutomation = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/comment-automations/{automationId}' - }); -}; +export const updateCommentAutomation = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/comment-automations/{automationId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List automation logs + * * Paginated list of every comment that triggered this automation, with send status and commenter info. */ -export const listCommentAutomationLogs = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/comment-automations/{automationId}/logs' - }); -}; +export const listCommentAutomationLogs = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/comment-automations/{automationId}/logs', + ...options +}); /** * List ads + * * Returns a paginated list of ads with metrics computed over an optional date range. * Use source=all to include externally-synced ads from platform ad managers. * If no date range is provided, defaults to the last 90 days. Date range is capped at 730 days max. @@ -3357,42 +3767,67 @@ export const listCommentAutomationLogs = ( * GET /v1/ads/{adId}/comments with the returned ad id. * */ -export const listAds = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/ads' - }); -}; +export const listAds = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads', + ...options +}); /** * List campaigns + * * Returns campaigns as virtual aggregations over ad documents grouped by platform campaign ID. * Metrics (spend, impressions, clicks, etc.) are summed across all ads in each campaign. * Campaign status is derived from child ad statuses (active > pending_review > paused > error > completed > cancelled > rejected). * */ -export const listAdCampaigns = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/ads/campaigns' - }); -}; +export const listAdCampaigns = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/campaigns', + ...options +}); /** * Pause or resume a campaign + * * Updates the status of all ads in a campaign. Makes one platform API call (not per-ad) since status cascades through the campaign hierarchy. * Ads in terminal statuses (rejected, completed, cancelled) are automatically skipped. * */ -export const updateAdCampaignStatus = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/ads/campaigns/{campaignId}/status' - }); -}; +export const updateAdCampaignStatus = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/campaigns/{campaignId}/status', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Delete a campaign + * + * Deletes the whole campaign on the platform, cascading to its ad sets + * and ads. Locally, all Ad documents for this campaign are marked + * `status: cancelled`. + * + * Meta-only for now. Other platforms return 501 Not Implemented — fall + * back to DELETE /v1/ads/{adId} per ad in the meantime. + * + */ +export const deleteAdCampaign = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/campaigns/{campaignId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Update a campaign (budget and/or bid strategy) + * * Campaign-level edits. At least one of `budget` or `bidStrategy` is required. * * - `budget` updates the CBO (Campaign Budget Optimization) budget. For ABO campaigns @@ -3404,46 +3839,37 @@ export const updateAdCampaignStatus = (opt * Meta-only for now. Other platforms return 501 Not Implemented. * */ -export const updateAdCampaign = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/ads/campaigns/{campaignId}' - }); -}; - -/** - * Delete a campaign - * Deletes the whole campaign on the platform, cascading to its ad sets - * and ads. Locally, all Ad documents for this campaign are marked - * `status: cancelled`. - * - * Meta-only for now. Other platforms return 501 Not Implemented — fall - * back to DELETE /v1/ads/{adId} per ad in the meantime. - * - */ -export const deleteAdCampaign = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/ads/campaigns/{campaignId}' - }); -}; +export const updateAdCampaign = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/campaigns/{campaignId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Pause or resume many campaigns + * * Process up to 50 campaigns in one call. Each campaign is updated * concurrently and the response contains a per-campaign result so a * single bad row does not fail the whole batch. * */ -export const bulkUpdateAdCampaignStatus = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/ads/campaigns/bulk-status' - }); -}; +export const bulkUpdateAdCampaignStatus = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/campaigns/bulk-status', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Duplicate a campaign + * * Duplicates a campaign, including its ad sets, ads, creatives, and * targeting by default (`deepCopy: true`). The copy is created paused * so callers can review before launching. @@ -3464,15 +3890,19 @@ export const bulkUpdateAdCampaignStatus = * Other platforms return 501 Not Implemented. * */ -export const duplicateAdCampaign = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/ads/campaigns/{campaignId}/duplicate' - }); -}; +export const duplicateAdCampaign = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/campaigns/{campaignId}/duplicate', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Update an ad set (budget, status, and/or bid strategy) + * * Ad-set-level writes. Use this for ABO budget updates, ad-set-scoped * pause/resume, and bid-strategy edits. At least one of `budget`, * `status`, or `bidStrategy` is required. @@ -3487,30 +3917,38 @@ export const duplicateAdCampaign = (option * PUT /v1/ads/campaigns/{campaignId} instead. * */ -export const updateAdSet = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/ads/ad-sets/{adSetId}' - }); -}; +export const updateAdSet = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/ad-sets/{adSetId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Pause or resume a single ad set + * * Ad-set-scoped pause/resume (doesn't touch sibling ad sets). Thin wrapper * over PUT /v1/ads/ad-sets/{adSetId} for callers that only want the * status toggle and prefer a symmetric URL to * /v1/ads/campaigns/{campaignId}/status. * */ -export const updateAdSetStatus = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/ads/ad-sets/{adSetId}/status' - }); -}; +export const updateAdSetStatus = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/ad-sets/{adSetId}/status', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Get campaign tree + * * Returns a nested Campaign > Ad Set > Ad hierarchy with rolled-up metrics at each level. * Uses a two-stage aggregation: ads are grouped into ad sets, then ad sets into campaigns. * Metrics are computed over an optional date range, then rolled up from ad level to ad set @@ -3519,15 +3957,15 @@ export const updateAdSetStatus = (options: * If no date range is provided, defaults to the last 90 days. Date range is capped at 730 days max. * */ -export const getAdTree = (options?: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/ads/tree' - }); -}; +export const getAdTree = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/tree', + ...options +}); /** * Get daily aggregate ad metrics for an account + * * Returns daily aggregate metrics across all ads in a SocialAccount as a single * time series — one row per calendar day in the requested range. Use this for * dashboards that draw a daily-spend or daily-conversions chart, instead of @@ -3542,15 +3980,26 @@ export const getAdTree = (options?: Option * before returning. * */ -export const getAdsTimeline = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/ads/timeline' - }); -}; +export const getAdsTimeline = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/timeline', + ...options +}); + +/** + * Cancel an ad + * + * Cancels the ad on the platform and marks it as cancelled in the database. The ad is preserved for history. + */ +export const deleteAd = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/{adId}', + ...options +}); /** * Get ad details + * * Returns an ad with its creative, targeting, status, and performance metrics. * * The `{adId}` path segment accepts any identifier dialect Zernio indexes for the ad: @@ -3562,15 +4011,15 @@ export const getAdsTimeline = (options: Op * Any of the four resolve to the same ad. Caller doesn't need a translation step. * */ -export const getAd = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/ads/{adId}' - }); -}; +export const getAd = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/{adId}', + ...options +}); /** * Update ad + * * Patch one or more fields on an ad. Status, budget, targeting, and creative changes * are propagated to the platform. * @@ -3582,40 +4031,33 @@ export const getAd = (options: OptionsLega * or `creative` returns 501 with code `unsupported_platform_operation`. * */ -export const updateAd = (options: OptionsLegacyParser) => { - return (options?.client ?? client).put({ - ...options, - url: '/v1/ads/{adId}' - }); -}; - -/** - * Cancel an ad - * Cancels the ad on the platform and marks it as cancelled in the database. The ad is preserved for history. - */ -export const deleteAd = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/ads/{adId}' - }); -}; +export const updateAd = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/{adId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Get ad analytics + * * Returns detailed performance analytics for an ad. Includes summary metrics, a daily timeline * over the requested date range, and optional demographic breakdowns (Meta and TikTok only). * If no date range is provided, defaults to the last 90 days. Date range is capped at 730 days max. * */ -export const getAdAnalytics = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/ads/{adId}/analytics' - }); -}; +export const getAdAnalytics = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/{adId}/analytics', + ...options +}); /** * List comments on an ad + * * Returns comments on an ad's underlying creative post. Useful for moderating or analyzing * engagement on dark posts (ad creatives that never went live organically), which the * regular GET /v1/inbox/comments/{postId} endpoint cannot serve because dark posts are @@ -3645,15 +4087,15 @@ export const getAdAnalytics = (options: Op * translation step. * */ -export const getAdComments = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/ads/{adId}/comments' - }); -}; +export const getAdComments = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/{adId}/comments', + ...options +}); /** * List TikTok Business Centers + * * Returns the TikTok Business Centers (BCs) the connected `tiktokads` account can read. * Each BC reports its advertiser count so callers can build agency-style pickers * without re-walking `/v1/ads/accounts` per BC. @@ -3661,15 +4103,15 @@ export const getAdComments = (options: Opt * TikTok-only. Solo advertisers (non-agency tokens) return an empty array. * */ -export const listAdsBusinessCenters = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/ads/business-centers' - }); -}; +export const listAdsBusinessCenters = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/business-centers', + ...options +}); /** * List ad accounts + * * Returns the platform ad accounts available for the given social account (e.g. Meta ad * accounts, TikTok advertiser IDs, Google Ads customer IDs). * @@ -3680,48 +4122,56 @@ export const listAdsBusinessCenters = (opt * SocialAccount; lazy-refreshed on first call after expiry. * */ -export const listAdAccounts = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/ads/accounts' - }); -}; +export const listAdAccounts = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/accounts', + ...options +}); /** * Boost post as ad + * * Creates a paid ad campaign from an existing published post. Creates the full platform campaign hierarchy (campaign, ad set, ad). */ -export const boostPost = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/ads/boost' - }); -}; +export const boostPost = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/boost', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Create standalone ad + * * Creates a paid ad with custom creative across Meta, Google Ads, Pinterest, TikTok, X/Twitter, and LinkedIn. Supports three mutually-exclusive request shapes selected by the body, a legacy single-creative shape (all platforms, default), a Meta-only multi-creative shape via the creatives array (one ad set with N ads sharing budget and targeting), and a Meta-only attach shape via adSetId (adds one new ad to an existing ad set). Per-platform required fields, budget minimums, and video-ad rules are documented on each property below. LinkedIn creates a Single Image or Single Video Ad backed by a Direct Sponsored Content "dark post" authored by a Company Page (see `organizationId`); supported goals are engagement, traffic, awareness, and video_views (video ads use the `video` field; video_views requires a video), and traffic ads require `linkUrl`. */ -export const createStandaloneAd = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/ads/create' - }); -}; +export const createStandaloneAd = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/create', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Search targeting interests + * * Search for interest-based targeting options available on the platform. */ -export const searchAdInterests = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/ads/interests' - }); -}; +export const searchAdInterests = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/interests', + ...options +}); /** * Search geo targeting locations (Meta) + * * Resolve a human-readable location name into Meta's opaque `key` used in * `targeting.cities[]` / `targeting.regions[]` on `POST /v1/ads/create` * (and the same fields under `targeting.geo_locations` on @@ -3736,70 +4186,78 @@ export const searchAdInterests = (options: * disambiguate when the same name exists in multiple countries. * */ -export const searchAdTargetingLocations = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/ads/targeting/search' - }); -}; +export const searchAdTargetingLocations = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/targeting/search', + ...options +}); /** * List custom audiences + * * Returns custom audiences for the given ad account. Supports Meta, Google, TikTok, and Pinterest. */ -export const listAdAudiences = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/ads/audiences' - }); -}; +export const listAdAudiences = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/audiences', + ...options +}); /** * Create custom audience + * * Create a customer list, website retargeting, or lookalike audience on Meta (Facebook/Instagram). */ -export const createAdAudience = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/ads/audiences' - }); -}; +export const createAdAudience = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/audiences', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** - * Get audience details - * Returns the local audience record and fresh data from Meta (if available). + * Delete custom audience + * + * Deletes the audience from both Meta and the local database. */ -export const getAdAudience = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/ads/audiences/{audienceId}' - }); -}; +export const deleteAdAudience = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/audiences/{audienceId}', + ...options +}); /** - * Delete custom audience - * Deletes the audience from both Meta and the local database. + * Get audience details + * + * Returns the local audience record and fresh data from Meta (if available). */ -export const deleteAdAudience = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/ads/audiences/{audienceId}' - }); -}; +export const getAdAudience = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/audiences/{audienceId}', + ...options +}); /** * Add users to audience + * * Upload user data (emails and/or phone numbers) to a customer_list audience. Data is SHA256-hashed server-side before sending to Meta. Max 10,000 users per request. */ -export const addUsersToAdAudience = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/ads/audiences/{audienceId}/users' - }); -}; +export const addUsersToAdAudience = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/audiences/{audienceId}/users', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Send conversion events to an ad platform + * * Relay one or more conversion events to the target ad platform's native Conversions API. * Platform is inferred from the provided `accountId`. Requires the Ads add-on. * @@ -3839,15 +4297,19 @@ export const addUsersToAdAudience = (optio * - LinkedIn: ignored. The conversion rule's `type` (LEAD, PURCHASE, etc.) is locked to the destination at rule-creation time. Send the standard name for documentation; LinkedIn does not branch on it. * */ -export const sendConversions = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/ads/conversions' - }); -}; +export const sendConversions = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/conversions', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List destinations for the Conversions API + * * Returns the list of pixels (Meta), conversion actions (Google), or * conversion rules (LinkedIn) accessible to the connected ads account. * Use the returned `id` as `destinationId` when posting to @@ -3864,15 +4326,15 @@ export const sendConversions = (options: O * subsequent CRUD calls (update, delete, associations, metrics). * */ -export const listConversionDestinations = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/conversion-destinations' - }); -}; +export const listConversionDestinations = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/conversion-destinations', + ...options +}); /** * Create a conversion destination (LinkedIn) + * * Create a new conversion rule on the platform. LinkedIn-only today; * other platforms manage destinations in their own UIs and return 405. * @@ -3887,29 +4349,52 @@ export const listConversionDestinations = * the API rejects other combinations locally. * */ -export const createConversionDestination = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/accounts/{accountId}/conversion-destinations' - }); -}; +export const createConversionDestination = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/conversion-destinations', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Soft-delete a conversion destination + * + * LinkedIn-only today. LinkedIn does not expose hard-delete on conversion + * rules — what their UI calls "delete" is the same `enabled: false` flip + * we apply here. The rule remains fetchable via GET with + * `status: 'inactive'`; the unified discovery endpoint hides it by + * default. + * + * `adAccountId` may be passed as a query parameter (recommended) or as + * a JSON body field for clients that can send DELETE bodies. + * + */ +export const deleteConversionDestination = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/conversion-destinations/{destinationId}', + ...options +}); /** * Fetch a single conversion destination + * * LinkedIn-only today. Returns the full destination record for one * conversion rule. The `adAccountId` query parameter is required because * LinkedIn rules are scoped to a sponsored ad account. * */ -export const getConversionDestination = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/conversion-destinations/{destinationId}' - }); -}; +export const getConversionDestination = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/conversion-destinations/{destinationId}', + ...options +}); /** * Update a conversion destination + * * Partial-update a conversion rule. LinkedIn-only today. Whitelisted * fields: `name`, `enabled`, attribution windows, `valueType`, `value`, * `attributionType`. The rule's `type` and parent ad account are @@ -3917,81 +4402,70 @@ export const getConversionDestination = (o * need to change. * */ -export const updateConversionDestination = (options: OptionsLegacyParser) => { - return (options?.client ?? client).patch({ - ...options, - url: '/v1/accounts/{accountId}/conversion-destinations/{destinationId}' - }); -}; +export const updateConversionDestination = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/conversion-destinations/{destinationId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** - * Soft-delete a conversion destination - * LinkedIn-only today. LinkedIn does not expose hard-delete on conversion - * rules — what their UI calls "delete" is the same `enabled: false` flip - * we apply here. The rule remains fetchable via GET with - * `status: 'inactive'`; the unified discovery endpoint hides it by - * default. + * Remove campaign↔conversion associations * - * `adAccountId` may be passed as a query parameter (recommended) or as - * a JSON body field for clients that can send DELETE bodies. + * Remove one or more campaign associations from this conversion rule. + * Pass `adAccountId` and `campaignIds` as query parameters + * (`campaignIds` is comma-separated). The route also accepts a JSON + * body with the same fields for clients that prefer DELETE-with-body, + * but the documented surface is query-only because some SDK code + * generators (e.g. Python) collapse query + body parameters with the + * same name into a single kwarg. * */ -export const deleteConversionDestination = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/accounts/{accountId}/conversion-destinations/{destinationId}' - }); -}; +export const removeConversionAssociations = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/conversion-destinations/{destinationId}/associations', + ...options +}); /** * List campaigns associated with a conversion destination + * * LinkedIn-only today. Returns the campaigns currently associated with * this conversion rule. Note that auto-association on rule creation * runs once at create time; campaigns created after the rule still need * explicit association. * */ -export const listConversionAssociations = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/conversion-destinations/{destinationId}/associations' - }); -}; +export const listConversionAssociations = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/conversion-destinations/{destinationId}/associations', + ...options +}); /** * Associate campaigns with a conversion destination + * * Associate one or more campaigns with this conversion rule. Returns a * per-campaign success/failure result so callers can retry only the * rows that failed (e.g. wrong campaign type for the rule's objective). * */ -export const addConversionAssociations = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/accounts/{accountId}/conversion-destinations/{destinationId}/associations' - }); -}; - -/** - * Remove campaign↔conversion associations - * Remove one or more campaign associations from this conversion rule. - * Pass `adAccountId` and `campaignIds` as query parameters - * (`campaignIds` is comma-separated). The route also accepts a JSON - * body with the same fields for clients that prefer DELETE-with-body, - * but the documented surface is query-only because some SDK code - * generators (e.g. Python) collapse query + body parameters with the - * same name into a single kwarg. - * - */ -export const removeConversionAssociations = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/accounts/{accountId}/conversion-destinations/{destinationId}/associations' - }); -}; +export const addConversionAssociations = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/conversion-destinations/{destinationId}/associations', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Fetch attribution metrics for a conversion destination + * * LinkedIn-only today. Returns conversion-attribution metrics * (`externalWebsiteConversions`, `externalWebsitePostClickConversions`, * `externalWebsitePostViewConversions`, `conversionValueInLocalCurrency`, @@ -4007,15 +4481,15 @@ export const removeConversionAssociations = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/conversion-destinations/{destinationId}/metrics' - }); -}; +export const getConversionMetrics = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/conversion-destinations/{destinationId}/metrics', + ...options +}); /** * Send WhatsApp conversion event + * * Forward a WhatsApp Business Messaging conversion event (`LeadSubmitted`, * `Purchase`, `AddToCart`, `InitiateCheckout`, `ViewContent`) to Meta's * Conversions API with `action_source = business_messaging` and @@ -4043,15 +4517,19 @@ export const getConversionMetrics = (optio * as the WABA. * */ -export const sendWhatsAppConversion = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/whatsapp/conversions' - }); -}; +export const sendWhatsAppConversion = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/whatsapp/conversions', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Create Click-to-WhatsApp ad(s) + * * Creates one or more Click-to-WhatsApp (CTWA) ads on Meta under a single campaign and ad set. When tapped, each ad opens a WhatsApp conversation with the business attached to the supplied Facebook Page. The full hierarchy (campaign, ad set, creative(s), ad(s)) is created and activated in one call. The CTA is locked to WHATSAPP_MESSAGE and the destination is hard-coded to api.whatsapp.com/send; Meta resolves the actual WhatsApp number from the Page-to-WA pairing configured in Page settings or Business Manager. * * Supports two mutually-exclusive shapes: @@ -4069,15 +4547,19 @@ export const sendWhatsAppConversion = (opt * * Prerequisites enforced by Meta (surfaced as platform_error on failure): the Facebook Page must be paired with a verified WhatsApp Business number, the WhatsApp Business Account must be business-verified, and the Meta access token must carry ads_management. */ -export const createCtwaAd = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/ads/ctwa' - }); -}; +export const createCtwaAd = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/ads/ctwa', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * List tracking tags (Meta Pixels) + * * Returns the tracking tags (Meta Pixels) the connected ads account can * see. Pass `?adAccountId=act_...` to scope the list to a single ad * account; omit it to list every pixel reachable by the token (the name @@ -4091,15 +4573,15 @@ export const createCtwaAd = (options: Opti * `act_...` ids from `GET /v1/ads/accounts`. * */ -export const listTrackingTags = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/tracking-tags' - }); -}; +export const listTrackingTags = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/tracking-tags', + ...options +}); /** * Create a tracking tag (Meta Pixel) + * * Creates a Meta Pixel on the given ad account (`POST /act_{id}/adspixels` * — `name` is the only input). Returns the created tag including its * install `code`. The pixel is owned by the Business Manager that owns the @@ -4115,29 +4597,33 @@ export const listTrackingTags = (options: * timeout. Meta only (platform `metaads`); other platforms return 405. * */ -export const createTrackingTag = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/accounts/{accountId}/tracking-tags' - }); -}; +export const createTrackingTag = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/tracking-tags', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Fetch a single tracking tag (Meta Pixel) + * * Returns the full tag record including the base-code `code` snippet, * `lastFiredTime`, `ownerBusinessId`, `isUnavailable`, etc. Meta only * (platform `metaads`); other platforms return 405. * */ -export const getTrackingTag = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/tracking-tags/{tagId}' - }); -}; +export const getTrackingTag = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/tracking-tags/{tagId}', + ...options +}); /** * Update a tracking tag (Meta Pixel) + * * Partial-update a pixel. Whitelisted fields: `name` (rename), * `enableAutomaticMatching`, `automaticMatchingFields`, * `firstPartyCookieStatus`, `dataUseSetting`. At least one is required. @@ -4150,26 +4636,44 @@ export const getTrackingTag = (options: Op * Manager. * */ -export const updateTrackingTag = (options: OptionsLegacyParser) => { - return (options?.client ?? client).patch({ - ...options, - url: '/v1/accounts/{accountId}/tracking-tags/{tagId}' - }); -}; +export const updateTrackingTag = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/tracking-tags/{tagId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Stop sharing a tracking tag with an ad account + * + * `adAccountId` may be passed as a query parameter (recommended) or as a + * JSON body field for clients that can send DELETE bodies. Meta only + * (platform `metaads`); other platforms return 405. + * + */ +export const removeTrackingTagSharedAccount = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/tracking-tags/{tagId}/shared-accounts', + ...options +}); /** * List ad accounts a tracking tag is shared with + * * Meta only (platform `metaads`); other platforms return 405. */ -export const listTrackingTagSharedAccounts = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/tracking-tags/{tagId}/shared-accounts' - }); -}; +export const listTrackingTagSharedAccounts = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/tracking-tags/{tagId}/shared-accounts', + ...options +}); /** * Share a tracking tag with an ad account + * * Shares the pixel with another ad account so campaigns/audiences in that * account can use it. Requires that you administer both the pixel's owning * Business Manager and the target ad account; a pixel on a personal @@ -4177,38 +4681,27 @@ export const listTrackingTagSharedAccounts = (options: OptionsLegacyParser) => { - return (options?.client ?? client).post({ - ...options, - url: '/v1/accounts/{accountId}/tracking-tags/{tagId}/shared-accounts' - }); -}; - -/** - * Stop sharing a tracking tag with an ad account - * `adAccountId` may be passed as a query parameter (recommended) or as a - * JSON body field for clients that can send DELETE bodies. Meta only - * (platform `metaads`); other platforms return 405. - * - */ -export const removeTrackingTagSharedAccount = (options: OptionsLegacyParser) => { - return (options?.client ?? client).delete({ - ...options, - url: '/v1/accounts/{accountId}/tracking-tags/{tagId}/shared-accounts' - }); -}; +export const addTrackingTagSharedAccount = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/tracking-tags/{tagId}/shared-accounts', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); /** * Aggregated event stats for a tracking tag (Meta Pixel) + * * Returns aggregated event counts for the pixel (`GET /{pixel_id}/stats`). * Rows are passed through from Meta as-is — their shape depends on the * `aggregation` requested. Meta only (platform `metaads`); other platforms * return 405. * */ -export const getTrackingTagStats = (options: OptionsLegacyParser) => { - return (options?.client ?? client).get({ - ...options, - url: '/v1/accounts/{accountId}/tracking-tags/{tagId}/stats' - }); -}; \ No newline at end of file +export const getTrackingTagStats = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/v1/accounts/{accountId}/tracking-tags/{tagId}/stats', + ...options +}); diff --git a/src/generated/types.gen.ts b/src/generated/types.gen.ts index 850baae..6c7a2ec 100644 --- a/src/generated/types.gen.ts +++ b/src/generated/types.gen.ts @@ -1,2063 +1,1732 @@ // This file is auto-generated by @hey-api/openapi-ts -export type AccountGetResponse = { - account?: SocialAccount; +export type ClientOptions = { + baseUrl: 'https://zernio.com/api' | 'http://localhost:3000/api' | (string & {}); }; -export type AccountsListResponse = { - accounts?: Array; +export type Webhooks = OnPostScheduledWebhookRequest | OnPostPublishedWebhookRequest | OnPostFailedWebhookRequest | OnPostPartialWebhookRequest | OnPostCancelledWebhookRequest | OnPostRecycledWebhookRequest | OnPostPlatformPublishedWebhookRequest | OnPostPlatformFailedWebhookRequest | OnAccountConnectedWebhookRequest | OnAccountDisconnectedWebhookRequest | OnAccountAdsInitialSyncCompletedWebhookRequest | OnMessageReceivedWebhookRequest | OnMessageSentWebhookRequest | OnMessageEditedWebhookRequest | OnMessageDeletedWebhookRequest | OnMessageDeliveredWebhookRequest | OnMessageReadWebhookRequest | OnMessageFailedWebhookRequest | OnCommentReceivedWebhookRequest | OnReviewNewWebhookRequest | OnReviewUpdatedWebhookRequest | OnAdStatusChangedWebhookRequest | OnWhatsAppTemplateStatusUpdatedWebhookRequest | OnWebhookTestWebhookRequest; + +/** + * A normalized Reddit post returned by the feed and search endpoints + */ +export type RedditPost = { /** - * Whether user has analytics add-on access + * Reddit post ID (without type prefix) */ - hasAnalyticsAccess?: boolean; -}; - -export type AccountWithFollowerStats = SocialAccount & { + id?: string; /** - * Current follower count + * Reddit fullname (e.g. t3_abc123) */ - currentFollowers?: number; - lastUpdated?: string; + fullname?: string; + title?: string; + author?: string; + subreddit?: string; /** - * Follower change over period + * Post URL (may be a gallery URL */ - growth?: number; + url?: string; /** - * Percentage growth + * Full permalink to the Reddit post */ - growthPercentage?: number; + permalink?: string; /** - * Number of historical snapshots + * Self-post body text (empty string for link posts) */ - dataPoints?: number; + selftext?: string; /** - * Platform-specific account stats from the latest daily snapshot. - * Fields vary by platform. Only present if metadata has been captured. - * + * Unix timestamp of post creation */ - accountStats?: { - /** - * Number of accounts being followed - */ - followingCount?: number; - /** - * Total media posts (Instagram) - */ - mediaCount?: number; - /** - * Total videos (YouTube - */ - videoCount?: number; - /** - * Total tweets (X/Twitter) - */ - tweetCount?: number; - /** - * Total posts (Bluesky) - */ - postsCount?: number; - /** - * Total pins (Pinterest) - */ - pinCount?: number; - /** - * Total channel views (YouTube) - */ - totalViews?: number; - /** - * Total likes received (TikTok) - */ - likesCount?: number; - /** - * Monthly profile views (Pinterest) - */ - monthlyViews?: number; - /** - * Lists the user appears on (X/Twitter) - */ - listedCount?: number; - /** - * Total boards (Pinterest) - */ - boardCount?: number; + createdUtc?: number; + score?: number; + numComments?: number; + /** + * Whether the post is marked NSFW + */ + over18?: boolean; + stickied?: boolean; + /** + * Link flair text if set + */ + flairText?: string; + /** + * Whether the post is a gallery with multiple images + */ + isGallery?: boolean; + /** + * Individual image URLs for gallery posts (only present when isGallery is true) + */ + galleryImages?: Array; +}; + +export type ErrorResponse = { + error?: string; + details?: { + [key: string]: unknown; }; }; -export type Ad = { - _id?: string; - name?: string; - platform?: 'facebook' | 'instagram' | 'tiktok' | 'linkedin' | 'pinterest' | 'google' | 'twitter'; - status?: AdStatus; - adType?: 'boost' | 'standalone'; - /** - * Available goals vary by platform. Meta (Facebook/Instagram) and TikTok support all 7. LinkedIn supports all except app_promotion. Twitter/X supports engagement, traffic, awareness, video_views, app_promotion. Pinterest and Google Ads support only engagement, traffic, awareness, video_views. - */ - goal?: 'engagement' | 'traffic' | 'awareness' | 'video_views' | 'lead_generation' | 'conversions' | 'app_promotion'; +/** + * A single inline button rendered inside an auto-DM via Meta's button_template. + * Up to 3 buttons per automation. `url` and `postback` work on Instagram and + * Facebook; `phone` is Facebook-only. When buttons are set, `dmMessage` becomes + * the button_template text and must be 640 characters or less. + * + */ +export type DmButton = { + type: 'url' | 'postback' | 'phone'; /** - * True for ads synced from platform ad managers + * Button label (20 chars max) */ - isExternal?: boolean; - budget?: { - amount?: number; - type?: 'daily' | 'lifetime'; - } | null; - metrics?: ((AdMetrics) | null); - platformAdId?: string; - platformAdAccountId?: string; - platformCampaignId?: string; - platformAdSetId?: string; - campaignName?: string; - adSetName?: string; + title: string; /** - * Raw Meta campaign objective (e.g. OUTCOME_SALES, OUTCOME_LEADS, OUTCOME_TRAFFIC). Only present for Meta ads. + * Target URL (required when type is url) */ - platformObjective?: (string) | null; + url?: string; /** - * Meta ad set optimization goal (e.g. OFFSITE_CONVERSIONS, VALUE, LEAD_GENERATION, LINK_CLICKS). Only present for Meta ads. + * Postback payload delivered via the messaging_postbacks webhook (required when type is postback) */ - optimizationGoal?: (string) | null; + payload?: string; /** - * Human-readable advertiser/account name (Meta `AdAccount.name`, TikTok - * `advertiser_name`, LinkedIn / X / Pinterest equivalents). Refreshed every - * sync so platform-side renames propagate within one cycle. `null` when the - * platform doesn't return a name or the sync hasn't run yet. - * + * Phone number, e.g. +14155551234 (required when type is phone; Facebook only) */ - platformAdAccountName?: (string) | null; + phone?: string; +}; + +export type WhatsAppTemplateButton = { + type: 'quick_reply' | 'url' | 'phone_number' | 'otp' | 'flow' | 'mpm' | 'catalog'; + text: string; /** - * Platform-reported creation timestamp (Meta `created_time`, TikTok `create_time`). - * Distinct from `createdAt` which reflects when Zernio first synced the doc — for - * sort/filter by "when the ad was actually created on the platform", read this field. - * `null` for legacy ads synced before this field was added; aggregations fall back - * to `createdAt` in that case. - * + * Required when type is URL */ - platformCreatedAt?: (string) | null; + url?: string; /** - * Ad-set bid strategy (overrides campaign level on Meta). Populated for Meta and - * TikTok. TikTok's native `bid_type` is normalized to the cross-platform Meta enum: - * `BID_TYPE_NO_BID` -> `LOWEST_COST_WITHOUT_CAP`, `BID_TYPE_CUSTOM` -> - * `LOWEST_COST_WITH_BID_CAP`, deep_bid_type=MIN_ROAS or roas_bid>0 -> - * `LOWEST_COST_WITH_MIN_ROAS`, `BID_TYPE_MAX_CONVERSION` -> `LOWEST_COST_WITHOUT_CAP`. - * + * Example values for URL suffix variables */ - bidStrategy?: ((BidStrategy) | null); + example?: Array; /** - * Bid cap in WHOLE currency units of the ad account (USD: 5 = $5.00; JPY: 100 = ¥100). - * Populated when bidStrategy is `LOWEST_COST_WITH_BID_CAP` or `COST_CAP`. `null` for - * auto-bid (`LOWEST_COST_WITHOUT_CAP`). - * - * - Meta source: `bid_amount` on the ad set (smallest-denomination int, decoded here). - * - TikTok source: priority order `bid_price` -> `conversion_bid_price` -> `deep_cpa_bid` - * (whichever is set on the ad group). TikTok stores all three in whole currency units. - * - * Source: facebook-business-sdk-codegen api_specs/specs/AdSet.json (`bid_amount`). - * + * Required when type is phone_number */ - bidAmount?: (number) | null; + phone_number?: string; /** - * Minimum ROAS as a decimal multiplier (2.0 = 2.0x ROAS). Populated when bidStrategy - * is `LOWEST_COST_WITH_MIN_ROAS`. - * - * - Meta source: decoded from `bid_constraints.roas_average_floor` (Meta stores as - * fixed-point int × 10000; we return the decimal). - * - TikTok source: `roas_bid` on the ad group (already a decimal). - * - * Source: facebook-business-sdk-codegen api_specs/specs/AdCampaignBidConstraint.json. - * + * Required when type is otp */ - roasAverageFloor?: (number) | null; + otp_type?: 'copy_code' | 'one_tap' | 'zero_tap'; + autofill_text?: string; + package_name?: string; + signature_hash?: string; + flow_id?: string; + flow_name?: string; + flow_json?: string; + flow_action?: string; + navigate_screen?: string; +}; + +export type WhatsAppTemplateComponent = ({ + type: 'header'; +} & WhatsAppHeaderComponent) | ({ + type: 'body'; +} & WhatsAppBodyComponent) | ({ + type: 'footer'; +} & WhatsAppFooterComponent) | ({ + type: 'buttons'; +} & WhatsAppButtonsComponent); + +export type WhatsAppHeaderComponent = { + type: 'header'; + format: 'text' | 'image' | 'video' | 'gif' | 'document' | 'location'; /** - * Meta promoted object containing conversion event details. Structure varies by objective. Only present for Meta ads. + * Header text (may include {{1}} variable). Used when format is TEXT. */ - promotedObject?: { - /** - * Conversion event type (e.g. PURCHASE, LEAD, COMPLETE_REGISTRATION, ADD_TO_CART) - */ - custom_event_type?: string; - /** - * Meta pixel ID - */ - pixel_id?: string; - /** - * Facebook page ID - */ - page_id?: string; + text?: string; + example?: { /** - * Facebook app ID + * Sample values for header text variables */ - application_id?: string; + header_text?: Array; /** - * Product catalog set ID + * When the header format is a media type (image, video, gif, document), provide a public URL here. Zernio will download and upload it to WhatsApp on your behalf, replacing it with the internal file handle before creating the template. */ - product_set_id?: string; - } | null; + header_handle?: [ + string + ]; + }; +}; + +export type WhatsAppBodyComponent = { + type: 'body'; /** - * Platform-specific creative data. Fields vary by platform. + * Body text with optional {{n}} variables */ - creative?: { + text: string; + /** + * Add security recommendation text (authentication templates only) + */ + add_security_recommendation?: boolean; + example?: { /** - * Primary thumbnail/image URL - */ - thumbnailUrl?: string; - /** - * Alternative image URL - */ - imageUrl?: string; - /** - * Meta video ID for VIDEO-type ads. Null for non-video ads. Callers that need an embeddable MP4 can call GET /{videoId}?fields=source with the page access token. - */ - videoId?: (string) | null; - /** - * Public Facebook watch URL for VIDEO-type ads (https://www.facebook.com/watch/?v={videoId}). Null for non-video ads. - */ - videoUrl?: (string) | null; - /** - * Meta creative object_type (e.g. SHARE, VIDEO, PRIVACY_CHECK_FAIL, POST_DELETED). Use this to render state-aware previews — when Meta moderation strips image/video fields, only thumbnailUrl at 64x64 is available. - */ - objectType?: string; - /** - * Meta creative `object_story_id` (the SHARE reference). Frequently absent — Meta omits it for SHARE creatives. Use effectiveObjectStoryId instead. - */ - objectStoryId?: (string) | null; - /** - * Meta `effective_object_story_id` — `{pageId}_{postId}` of the Facebook post the ad's engagement (comments) lives on. Pass to GET /v1/ads?effectiveObjectStoryId= to map a Business-Manager-visible post back to this ad; GET /v1/ads/{adId}/comments resolves comments against it. - */ - effectiveObjectStoryId?: (string) | null; - /** - * Meta `effective_instagram_media_id` — the Instagram media ID of the boosted post the ad's engagement lives on. Pass to GET /v1/ads?effectiveInstagramMediaId= to map a Business-Manager-visible IG post back to this ad. - */ - effectiveInstagramMediaId?: (string) | null; - /** - * Meta `instagram_user_id` — the Instagram-scoped business ID that owns the boosted media. - */ - instagramUserId?: (string) | null; - /** - * Meta `instagram_permalink_url` — public Instagram post URL of the boosted media. - */ - instagramPermalinkUrl?: (string) | null; - /** - * All media URLs for this ad (carousel images, multiple assets). Populated for Meta (carousel child_attachments), Google Ads (responsive display marketing_images), and LinkedIn (multi-image posts). - */ - mediaUrls?: Array<(string)>; - /** - * Ad copy/text - */ - body?: string; - /** - * Google Ads headline - */ - googleHeadline?: string; - /** - * Google Ads description - */ - googleDescription?: string; - /** - * Destination URL + * Sample values for body variables (array of arrays) */ - linkUrl?: string; - pinterestImageUrl?: string; - pinterestTitle?: string; - pinterestDescription?: string; - } | null; - targeting?: { - [key: string]: unknown; + body_text?: Array>; }; - schedule?: { - startDate?: string; - endDate?: string; - } | null; - rejectionReason?: string; - createdAt?: string; - updatedAt?: string; -}; - -export type platform = 'facebook' | 'instagram' | 'tiktok' | 'linkedin' | 'pinterest' | 'google' | 'twitter'; - -export type adType = 'boost' | 'standalone'; - -/** - * Available goals vary by platform. Meta (Facebook/Instagram) and TikTok support all 7. LinkedIn supports all except app_promotion. Twitter/X supports engagement, traffic, awareness, video_views, app_promotion. Pinterest and Google Ads support only engagement, traffic, awareness, video_views. - */ -export type goal = 'engagement' | 'traffic' | 'awareness' | 'video_views' | 'lead_generation' | 'conversions' | 'app_promotion'; - -export type type = 'daily' | 'lifetime'; - -/** - * Budget amount in the ad account's native currency (see the campaign's `currency` field for the code). - */ -export type AdBudget = { - amount: number; - type: 'daily' | 'lifetime'; }; -export type AdCampaign = { - platformCampaignId?: string; - platform?: 'facebook' | 'instagram' | 'tiktok' | 'linkedin' | 'pinterest' | 'google' | 'twitter'; - campaignName?: string; - /** - * Delivery status derived from child ad statuses. Distinct from `reviewStatus`. - */ - status?: (AdStatus); +export type WhatsAppFooterComponent = { + type: 'footer'; /** - * Platform-side review state of the campaign. See AdTreeCampaign.reviewStatus for the full description. + * Static footer text */ - reviewStatus?: ('in_review' | 'approved' | 'rejected' | 'with_issues') | null; + text?: string; /** - * Raw platform-level campaign status (Meta `effective_status`). + * OTP code expiry in minutes (authentication templates only) */ - platformCampaignStatus?: (string) | null; + code_expiration_minutes?: number; +}; + +export type WhatsAppButtonsComponent = { + type: 'buttons'; + buttons: Array; +}; + +export type FoodMenuLabel = { /** - * Platform-reported campaign issues (Meta `issues_info[]`). + * Display name of the item/section/menu */ - campaignIssuesInfo?: Array<{ - [key: string]: unknown; - }> | null; - adCount?: number; + displayName: string; /** - * Effective budget (back-compat). Use `budgetLevel` to disambiguate CBO vs ABO. + * Optional description */ - budget?: { - amount?: number; - type?: 'daily' | 'lifetime'; - } | null; + description?: string; /** - * Campaign-level budget (CBO). Null for ABO campaigns. + * BCP-47 language code (e.g. en, es) */ - campaignBudget?: { - amount?: number; - type?: 'daily' | 'lifetime'; - } | null; + languageCode?: string; +}; + +export type Money = { /** - * Canonical CBO/ABO indicator. See AdTreeCampaign.budgetLevel. + * ISO 4217 currency code (e.g. USD, EUR) */ - budgetLevel?: ('campaign' | 'adset') | null; + currencyCode: string; /** - * Meta-only. Mirrors Campaign.is_budget_schedule_enabled. + * Whole units of the amount */ - isBudgetScheduleEnabled?: boolean; + units: string; /** - * ISO 4217 currency code for all budget amounts. Budgets are NOT normalized to USD. + * Nano units (10^-9) of the amount */ - currency?: (string) | null; - metrics?: AdMetrics; - platformAdAccountId?: string; + nanos?: number; +}; + +export type FoodMenuItemAttributes = { + price?: Money; /** - * Human-readable advertiser/account name from the platform. Refreshed on every sync. + * Spiciness level (e.g. MILD, MEDIUM, HOT) */ - platformAdAccountName?: (string) | null; - accountId?: string; - profileId?: string; + spiciness?: string; /** - * Raw Meta campaign objective (e.g. OUTCOME_SALES, OUTCOME_LEADS, OUTCOME_TRAFFIC) + * Allergens (e.g. DAIRY, GLUTEN, SHELLFISH) */ - platformObjective?: (string) | null; + allergen?: Array; /** - * Meta optimization goal shared across ad sets, or comma-separated values when ad sets differ (e.g. OFFSITE_CONVERSIONS, VALUE, LEAD_GENERATION) + * Dietary labels (e.g. VEGETARIAN, VEGAN, GLUTEN_FREE) */ - optimizationGoal?: (string) | null; + dietaryRestriction?: Array; /** - * Campaign-level bid strategy. Ad sets inherit this unless they override. + * Number of people the item serves */ - bidStrategy?: ((BidStrategy) | null); + servesNumPeople?: number; /** - * Representative bid cap from the top-spending ad set (whole currency units). Populated when bidStrategy is LOWEST_COST_WITH_BID_CAP or COST_CAP. + * Preparation methods (e.g. GRILLED, FRIED) */ - bidAmount?: (number) | null; + preparationMethods?: Array; /** - * Representative ROAS floor from the top-spending ad set. Decimal multiplier (2.0 = 2.0x). + * Media references for item photos */ - roasAverageFloor?: (number) | null; + mediaKeys?: Array; +}; + +export type FoodMenuItem = { + labels: Array; + attributes?: FoodMenuItemAttributes; /** - * Meta promoted object at campaign level (conversion event details) + * Item variants/options (e.g. sizes, preparations) */ - promotedObject?: { - custom_event_type?: string; - pixel_id?: string; - page_id?: string; - } | null; - earliestAd?: string; - latestAd?: string; + options?: Array<{ + labels?: Array; + attributes?: FoodMenuItemAttributes; + }>; }; -/** - * Platform-side review state of the campaign. See AdTreeCampaign.reviewStatus for the full description. - */ -export type reviewStatus = 'in_review' | 'approved' | 'rejected' | 'with_issues'; - -/** - * Canonical CBO/ABO indicator. See AdTreeCampaign.budgetLevel. - */ -export type budgetLevel = 'campaign' | 'adset'; +export type FoodMenuSection = { + labels: Array; + items?: Array; +}; -export type AdMetrics = { - spend?: number; - impressions?: number; - reach?: number; - clicks?: number; - /** - * Click-through rate (%) - */ - ctr?: number; - /** - * Cost per click - */ - cpc?: number; - /** - * Cost per 1000 impressions - */ - cpm?: number; - engagement?: number; - /** - * Count of conversion events matching the campaign's promoted_object.custom_event_type (PURCHASE, LEAD, etc.) over the requested date range. 0 for non-conversion campaigns or when no events have fired. Meta-only at time of writing; other platforms return 0. - */ - conversions?: number; +export type FoodMenu = { + labels: Array; + sections?: Array; /** - * Derived spend / conversions in the same currency as spend. 0 when conversions is 0. + * Cuisine types (e.g. AMERICAN, ITALIAN, JAPANESE) */ - costPerConversion?: number; + cuisines?: Array; /** - * Raw per-action-type counts from Meta's Insights actions[] array, summed over the date range. Keys are Meta action_type strings (e.g. link_click, offsite_conversion.fb_pixel_purchase, onsite_conversion.lead_grouped). Use this to extract any conversion event (purchases, leads, add_to_cart, etc.) without relying on the derived conversions field. Empty object when no actions are reported. + * URL of the original menu source */ - actions?: { - [key: string]: (number); - }; + sourceUrl?: string; +}; + +export type YouTubeDailyViewsResponse = { + success?: boolean; /** - * Monetary mirror of `actions`, from Meta's Insights `action_values[]` array. Same keying — values are the revenue attributed to each action_type, in ad-account native currency (same unit as `spend`; see the campaign node's `currency` field). Use this to compute revenue-per-event (e.g. avg purchase value). Meta-only; other platforms return {}. + * The YouTube video ID */ - actionValues?: { - [key: string]: (number); + videoId?: string; + dateRange?: { + startDate?: string; + endDate?: string; }; /** - * Convenience sum of purchase-type action values — picked from `actionValues` via the same priority list as `conversions` so both fields describe the same events. In ad-account native currency. 0 when the campaign has no purchase event configured. Meta-only. - */ - purchaseValue?: number; - /** - * Return on ad spend — derived as `purchaseValue / spend`. 0 when `spend` is 0. Equivalent to Meta's `purchase_roas` under default attribution. At ad-set and campaign levels this is recomputed from summed purchaseValue + spend (NOT averaged across children) so it's mathematically correct at every rollup level. + * Sum of views across all days in the range */ - roas?: number; + totalViews?: number; + dailyViews?: Array<{ + date?: string; + views?: number; + estimatedMinutesWatched?: number; + /** + * Average view duration in seconds + */ + averageViewDuration?: number; + subscribersGained?: number; + subscribersLost?: number; + likes?: number; + comments?: number; + shares?: number; + }>; /** - * Present on individual ads only, not on campaign aggregations + * When the data was last synced from YouTube */ lastSyncedAt?: string; + scopeStatus?: { + hasAnalyticsScope?: boolean; + }; }; -export type AdStatus = 'active' | 'paused' | 'pending_review' | 'rejected' | 'completed' | 'cancelled' | 'error'; - -/** - * Ad set (or ad group/line item depending on platform) with rolled-up metrics and child ads - */ -export type AdTreeAdSet = { - platformAdSetId?: string; - adSetName?: string; +export type YouTubeScopeMissingResponse = { + success?: boolean; + error?: string; + code?: string; + scopeStatus?: { + hasAnalyticsScope?: boolean; + requiresReauthorization?: boolean; + /** + * URL to redirect user for reauthorization + */ + reauthorizeUrl?: string; + }; +}; + +/** + * Shared account-insights response envelope used by every platform-level + * analytics endpoint (/v1/analytics/{facebook|instagram|youtube|linkedin|tiktok}*). + * The name is historical - the shape was first shipped for Instagram and every + * new platform endpoint reuses it for response-shape consistency. The platform + * field echoes back which platform served the response. + * + */ +export type InstagramAccountInsightsResponse = { + success?: boolean; /** - * Derived from child ad statuses + * The Zernio SocialAccount ID */ - status?: (AdStatus); - adCount?: number; + accountId?: string; /** - * Effective budget at this level (back-compat). For CBO campaigns this mirrors the parent campaign's budget; for ABO this is the ad-set-specific budget. Use `adSetBudget` / parent `campaignBudget` + `budgetLevel` to disambiguate. + * Platform that served this response. */ - budget?: { - amount?: number; - type?: 'daily' | 'lifetime'; - } | null; + platform?: 'facebook' | 'instagram' | 'youtube' | 'linkedin' | 'tiktok'; + dateRange?: { + since?: string; + until?: string; + }; + metricType?: 'time_series' | 'total_value'; /** - * Ad-set-level budget (ABO). Null for CBO campaigns where the budget is set on the campaign. + * Breakdown dimension used (only present when breakdown was requested) */ - adSetBudget?: { - amount?: number; - type?: 'daily' | 'lifetime'; - } | null; - metrics?: AdMetrics; + breakdown?: string; /** - * Meta ad set optimization goal (e.g. OFFSITE_CONVERSIONS, VALUE, LEAD_GENERATION) + * Object keyed by metric name. For time_series: each metric has "total" (number) and "values" (array of {date, value}). + * For total_value: each metric has "total" (number) and optionally "breakdowns" (array of {dimension, value}). + * */ - optimizationGoal?: (string) | null; + metrics?: { + [key: string]: { + /** + * Sum or aggregate value for the metric + */ + total?: number; + /** + * Daily values (only for time_series) + */ + values?: Array<{ + date?: string; + value?: number; + }>; + /** + * Breakdown values (only for total_value with breakdown) + */ + breakdowns?: Array<{ + dimension?: string; + value?: number; + }>; + }; + }; + dataDelay?: string; +}; + +export type InstagramDemographicsResponse = { + success?: boolean; /** - * Bid strategy for this ad set (overrides campaign level when set) + * The Zernio SocialAccount ID */ - bidStrategy?: ((BidStrategy) | null); + accountId?: string; + platform?: string; + metric?: 'follower_demographics' | 'engaged_audience_demographics'; /** - * Bid cap in whole currency units. Populated when bidStrategy is LOWEST_COST_WITH_BID_CAP or COST_CAP. + * The timeframe used for demographic data */ - bidAmount?: (number) | null; + timeframe?: 'this_week' | 'this_month'; /** - * Minimum ROAS as a decimal multiplier (2.0 = 2.0x). Populated when bidStrategy is LOWEST_COST_WITH_MIN_ROAS. + * Object keyed by breakdown dimension (age, city, country, gender) */ - roasAverageFloor?: (number) | null; + demographics?: { + [key: string]: Array<{ + /** + * The dimension value (e.g., "25-34", "US", "M") + */ + dimension?: string; + /** + * Count of accounts in this dimension + */ + value?: number; + }>; + }; + note?: string; +}; + +export type YouTubeDemographicsResponse = { + success?: boolean; /** - * Meta promoted object for this ad set (conversion event details) + * The Zernio SocialAccount ID */ - promotedObject?: { - custom_event_type?: string; - pixel_id?: string; - page_id?: string; - } | null; + accountId?: string; + platform?: string; /** - * Individual ads within this ad set (capped at 100). Returns a subset of Ad fields from the aggregation (core fields like _id, name, platform, status, budget, metrics, creative, goal are included; targeting and schedule may be absent). + * Object keyed by breakdown dimension (age, gender, country) */ - ads?: Array; + demographics?: { + [key: string]: Array<{ + /** + * The dimension value (e.g., "25-34", "US", "male") + */ + dimension?: string; + /** + * Viewer percentage (age/gender) or view count (country) + */ + value?: number; + }>; + }; + dateRange?: { + startDate?: string; + endDate?: string; + }; + note?: string; }; /** - * Campaign with nested ad sets and rolled-up metrics + * Individual webhook configuration for receiving real-time notifications */ -export type AdTreeCampaign = { - platformCampaignId?: string; - platform?: 'facebook' | 'instagram' | 'tiktok' | 'linkedin' | 'pinterest' | 'google' | 'twitter'; - campaignName?: string; - /** - * Delivery status derived from child ad statuses. Distinct from `reviewStatus`, which reflects the platform-side review state. - */ - status?: (AdStatus); +export type Webhook = { /** - * Platform-side review state of the campaign. Independent of the - * children-derived delivery `status`: a campaign can have ads - * already active (status=active) while the campaign itself is - * still being reviewed by the platform (reviewStatus=in_review). - * For Meta, derived from `effective_status` + `issues_info` on - * the Campaign, plus ad-level PENDING_REVIEW rollup. - * + * Unique webhook identifier */ - reviewStatus?: ('in_review' | 'approved' | 'rejected' | 'with_issues') | null; + _id?: string; /** - * Raw platform-level campaign status (Meta `effective_status`: ACTIVE, PAUSED, DELETED, ARCHIVED, IN_PROCESS, WITH_ISSUES). Distinct from per-ad `platformStatus`. + * Webhook name (for identification) */ - platformCampaignStatus?: (string) | null; + name?: string; /** - * Platform-reported campaign issues (Meta `issues_info[]`). Populated only when the platform has delivery issues to report; contains the specific error codes and messages. + * Webhook endpoint URL */ - campaignIssuesInfo?: Array<{ - [key: string]: unknown; - }> | null; + url?: string; /** - * Total ads across all ad sets + * Secret key for HMAC-SHA256 signature verification. */ - adCount?: number; - adSetCount?: number; + secret?: string; /** - * Effective budget (back-compat). For CBO this mirrors `campaignBudget`, for ABO this mirrors the child ad-set budget. Use `budgetLevel` to disambiguate. + * Events subscribed to */ - budget?: { - amount?: number; - type?: 'daily' | 'lifetime'; - } | null; + events?: Array<'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'message.received' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'comment.received' | 'review.new' | 'review.updated' | 'ad.status_changed' | 'whatsapp.template.status_updated'>; /** - * Campaign-level budget (Campaign Budget Optimization / CBO). Populated only when the platform set the budget at the campaign level. For ABO campaigns this is null and the budget lives on the child ad set. + * Whether webhook delivery is enabled */ - campaignBudget?: { - amount?: number; - type?: 'daily' | 'lifetime'; - } | null; + isActive?: boolean; /** - * Canonical CBO/ABO indicator. `campaign` = CBO (Advantage Campaign Budget, budget lives on the campaign). `adset` = ABO (budget lives on each ad set). Route budget updates to the matching Meta entity. + * Timestamp of last successful webhook delivery */ - budgetLevel?: ('campaign' | 'adset') | null; + lastFiredAt?: string; /** - * Meta-only. Mirrors Campaign.is_budget_schedule_enabled — true when the campaign uses budget scheduling (time-based budget changes). Independent of CBO/ABO. + * Consecutive delivery failures (resets on success, webhook disabled at 10) */ - isBudgetScheduleEnabled?: boolean; + failureCount?: number; /** - * ISO 4217 currency code (e.g. USD, EUR, CLP, JPY) for all budget amounts in this campaign node. Budgets are NOT normalized to USD. + * Custom headers included in webhook requests */ - currency?: (string) | null; - metrics?: AdMetrics; - platformAdAccountId?: string; + customHeaders?: { + [key: string]: string; + }; +}; + +/** + * Webhook payload for post events + */ +export type WebhookPayloadPost = { /** - * Human-readable advertiser/account name from the platform. Refreshed on every sync. + * Stable webhook event ID */ - platformAdAccountName?: (string) | null; - accountId?: string; - profileId?: string; + id: string; + event: 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled'; + post: { + id: string; + content: string; + status: string; + scheduledFor: string; + publishedAt?: string; + platforms: Array<{ + platform: string; + status: string; + platformPostId?: string; + publishedUrl?: string; + error?: string; + }>; + }; + timestamp: string; +}; + +/** + * Webhook payload for the per-platform terminal events + * `post.platform.published` and `post.platform.failed`. Fires once + * per platform target inside a post as that platform reaches a + * terminal state (published or permanent failure). The `post` + * envelope mirrors the shape of `WebhookPayloadPost` so consumers + * can reuse rendering logic; the `platform` block identifies which + * specific platform transitioned; the `account` block identifies + * the connected social account behind that platform-write. + * + */ +export type WebhookPayloadPostPlatform = { /** - * Raw Meta campaign objective (e.g. OUTCOME_SALES, OUTCOME_LEADS, OUTCOME_TRAFFIC) + * Stable webhook event ID. */ - platformObjective?: (string) | null; + id: string; + event: 'post.platform.published' | 'post.platform.failed'; + post: { + id: string; + content: string; + /** + * Post-level status AT FIRE TIME. May still be `publishing` + * if other platforms haven't terminated; check this field + * rather than assuming. + * + */ + status: string; + scheduledFor: string; + publishedAt?: string; + platforms: Array<{ + platform: string; + status: string; + platformPostId?: string; + publishedUrl?: string; + error?: string; + }>; + }; /** - * Meta optimization goal shared across ad sets, or comma-separated values when ad sets differ (e.g. OFFSITE_CONVERSIONS, VALUE, LEAD_GENERATION) + * The specific platform that just transitioned to a terminal state. */ - optimizationGoal?: (string) | null; - /** - * Campaign-level bid strategy. Ad sets inherit this unless they override. - */ - bidStrategy?: ((BidStrategy) | null); - /** - * Representative bid cap for the campaign — bubbled up from the top-spending ad set's `bid_amount` (whole currency units). Populated when the ad-set bidStrategy is LOWEST_COST_WITH_BID_CAP or COST_CAP. - */ - bidAmount?: (number) | null; - /** - * Representative ROAS floor for the campaign — bubbled up from the top-spending ad set. Decimal multiplier (2.0 = 2.0x). - */ - roasAverageFloor?: (number) | null; - /** - * Meta promoted object at campaign level (conversion event details) - */ - promotedObject?: { - custom_event_type?: string; - pixel_id?: string; - page_id?: string; - } | null; - adSets?: Array; -}; - -export type AnalyticsListResponse = { - overview?: AnalyticsOverview; - posts?: Array<{ - _id?: string; + platform: { /** - * Original Zernio post ID if scheduled via Zernio + * Platform name (e.g. `twitter`, `tiktok`, `instagram`). */ - latePostId?: (string) | null; - content?: string; - scheduledFor?: string; - publishedAt?: string; - status?: string; - analytics?: PostAnalytics; - platforms?: Array; - platform?: string; - platformPostUrl?: string; - isExternal?: boolean; - profileId?: (string) | null; - thumbnailUrl?: string; - mediaType?: 'image' | 'video' | 'gif' | 'document' | 'carousel' | 'text'; + name: string; /** - * All media items for this post. Carousel posts contain one entry per slide. + * Terminal status this event fires on. Matches the event suffix. */ - mediaItems?: Array<{ - type?: 'image' | 'video'; - /** - * Direct URL to the media - */ - url?: string; - /** - * Thumbnail URL (same as url for images) - */ - thumbnail?: string; - }>; - }>; - pagination?: Pagination; - /** - * Connected social accounts (followerCount and followersLastUpdated only included if user has analytics add-on) - */ - accounts?: Array; - /** - * Whether user has analytics add-on access - */ - hasAnalyticsAccess?: boolean; -}; - -export type AnalyticsOverview = { - totalPosts?: number; - publishedPosts?: number; - scheduledPosts?: number; - lastSync?: (string) | null; - dataStaleness?: { + status: 'published' | 'failed'; /** - * Number of accounts with stale analytics data + * Platform-native post id. Present on `published`, absent on `failed`. */ - staleAccountCount?: number; + platformPostId?: string; /** - * Whether a background sync was triggered for stale accounts + * Public URL to the platform-side post. Present on `published` (when the platform exposes one and it is not a draft). */ - syncTriggered?: boolean; + publishedUrl?: string; + /** + * Error message from the platform. Present on `failed`, absent on `published`. + */ + error?: string; }; -}; - -export type AnalyticsSinglePostResponse = { - postId?: string; - /** - * Original Zernio post ID if scheduled via Zernio - */ - latePostId?: (string) | null; - /** - * Overall post status. "partial" when some platforms published and others failed. - */ - status?: 'published' | 'failed' | 'partial'; - content?: string; - scheduledFor?: string; - publishedAt?: (string) | null; - analytics?: PostAnalytics; - platformAnalytics?: Array; - platform?: string; - platformPostUrl?: (string) | null; - isExternal?: boolean; - /** - * Overall sync state across all platforms - */ - syncStatus?: 'synced' | 'pending' | 'partial' | 'unavailable'; - /** - * Human-readable status message for pending, partial, or failed states - */ - message?: (string) | null; - thumbnailUrl?: (string) | null; - mediaType?: ('image' | 'video' | 'carousel' | 'text') | null; /** - * All media items for this post. Carousel posts contain one entry per slide. + * The connected social account the platform-write went through. */ - mediaItems?: Array<{ - type?: 'image' | 'video'; - /** - * Direct URL to the media - */ - url?: string; - /** - * Thumbnail URL (same as url for images) - */ - thumbnail?: string; - }>; + account: { + accountId: string; + platform: string; + username: string; + displayName?: string; + }; + timestamp: string; }; /** - * Overall post status. "partial" when some platforms published and others failed. - */ -export type status = 'published' | 'failed' | 'partial'; - -/** - * Overall sync state across all platforms + * Webhook payload for account connected events */ -export type syncStatus = 'synced' | 'pending' | 'partial' | 'unavailable'; - -export type mediaType = 'image' | 'video' | 'carousel' | 'text'; - -export type ApiKey = { - id?: string; - name?: string; - keyPreview?: string; - expiresAt?: string; - createdAt?: string; - /** - * Returned only once, on creation - */ - key?: string; - /** - * 'full' grants access to all profiles, 'profiles' restricts to specific profiles - */ - scope?: 'full' | 'profiles'; - /** - * Profiles this key can access (populated with name and color). Only present when scope is 'profiles'. - */ - profileIds?: Array<{ - _id?: string; - name?: string; - color?: string; - }>; +export type WebhookPayloadAccountConnected = { /** - * 'read-write' allows all operations, 'read' restricts to GET requests only + * Stable webhook event ID */ - permission?: 'read-write' | 'read'; + id: string; + event: 'account.connected'; + account: { + /** + * The account's unique identifier (same as used in /v1/accounts/{accountId}) + */ + accountId: string; + /** + * The profile's unique identifier this account belongs to + */ + profileId: string; + platform: string; + username: string; + displayName?: string; + }; + timestamp: string; }; /** - * 'full' grants access to all profiles, 'profiles' restricts to specific profiles - */ -export type scope = 'full' | 'profiles'; - -/** - * 'read-write' allows all operations, 'read' restricts to GET requests only - */ -export type permission = 'read-write' | 'read'; - -/** - * Meta bid strategy. Same enum applies at campaign and ad-set level; ad-set value (when set) - * overrides campaign-level. Cross-field rules: - * - `LOWEST_COST_WITHOUT_CAP` (default): auto-bid, forbids `bidAmount` and `roasAverageFloor`. - * - `LOWEST_COST_WITH_BID_CAP` / `COST_CAP`: require `bidAmount` (whole currency units). - * - `LOWEST_COST_WITH_MIN_ROAS`: requires `roasAverageFloor` (decimal multiplier, 2.0 = 2.0x). - * Source: facebook-business-sdk-codegen api_specs/specs/enum_types.json (`AdSet_bid_strategy`, - * `Campaign_bid_strategy`). - * - */ -export type BidStrategy = 'LOWEST_COST_WITHOUT_CAP' | 'LOWEST_COST_WITH_BID_CAP' | 'COST_CAP' | 'LOWEST_COST_WITH_MIN_ROAS'; - -/** - * Bluesky post settings. Supports text posts with up to 4 images or a single video. threadItems creates a reply chain (Bluesky thread). Images exceeding 1MB are automatically compressed. Alt text supported via mediaItem properties. - * + * Webhook payload for account disconnected events */ -export type BlueskyPlatformData = { +export type WebhookPayloadAccountDisconnected = { /** - * Complete sequence of posts in a Bluesky thread. The first item becomes the root post, subsequent items are chained as replies. When threadItems is provided, the top-level content field is used only for display and search purposes, it is NOT published. You must include your first post as threadItems[0]. - * + * Stable webhook event ID */ - threadItems?: Array<{ - content?: string; - mediaItems?: Array; - }>; + id: string; + event: 'account.disconnected'; + account: { + /** + * The account's unique identifier (same as used in /v1/accounts/{accountId}) + */ + accountId: string; + /** + * The profile's unique identifier this account belongs to + */ + profileId: string; + platform: string; + username: string; + displayName?: string; + /** + * Whether the disconnection was intentional (user action) or unintentional (token expired/revoked) + */ + disconnectionType: 'intentional' | 'unintentional'; + /** + * Human-readable reason for the disconnection + */ + reason: string; + }; + timestamp: string; }; /** - * TikTok Business Center entity. Returned by `GET /v1/ads/business-centers`. BCs are - * TikTok's agency container — one BC owns N advertisers (ad accounts). Most solo - * advertisers don't have one; the agency token uses BCs to roll up multi-client access. + * Webhook payload for `account.ads.initial_sync_completed` events. + * Fired once per ads-enabled account when the initial discovery + 90-day + * ad backfill finishes (whether it succeeded fully, partially, or failed). * */ -export type BusinessCenter = { - /** - * Business Center ID - */ - bcId?: string; - /** - * Display name set by the BC owner - */ - name?: string; +export type WebhookPayloadAccountAdsInitialSyncCompleted = { /** - * Number of advertisers reachable under this BC for the calling token. - * `null` when the BC asset walk returned empty or failed (typical for - * agency apps without full BC asset read scope) — distinct from `0`, - * which would imply the BC genuinely has no advertisers. - * - */ - advertiserCount?: (number) | null; -}; - -/** - * A discoverable conversion destination on an ad platform — a Meta pixel, - * Google conversion action, or LinkedIn conversion rule. Returned by - * `listConversionDestinations`, `getConversionDestination`, - * `createConversionDestination`, and `updateConversionDestination`. - * - */ -export type ConversionDestination = { - /** - * Platform-native identifier. Pass back as `destinationId` on event - * send and as the path segment on CRUD endpoints. - * + * Stable webhook event ID */ id: string; - name: string; - /** - * Present when the platform locks the event type/category to the - * destination (Google conversion actions, LinkedIn conversion rules). - * Absent for Meta pixels (which accept any event name per request). - * - */ - type?: string; - /** - * For LinkedIn, `inactive` means the rule is soft-deleted (`enabled: false`). - * - */ - status?: 'active' | 'inactive'; - /** - * Set by adapters whose destinations are scoped to a specific ad - * account (LinkedIn). Pass back on subsequent CRUD calls to - * identify the parent ad account. - * - */ - adAccountId?: string; -}; - -/** - * For LinkedIn, `inactive` means the rule is soft-deleted (`enabled: false`). - * - */ -export type status2 = 'active' | 'inactive'; - -/** - * A single conversion event to relay to the ad platform. All PII fields - * (email, phone, names) are hashed with SHA-256 server-side using each - * platform's normalization rules before they leave Zernio. Callers send - * plaintext. - * - */ -export type ConversionEvent = { - /** - * Standard event name (Purchase, Lead, CompleteRegistration, AddToCart, - * InitiateCheckout, AddPaymentInfo, Subscribe, StartTrial, ViewContent, - * Search, Contact, SubmitApplication, Schedule) or a custom string - * (only supported on platforms that accept custom events — Meta). - * - * Per-platform behavior: - * - Meta: free-form; standard names match Meta's built-ins. - * - Google: ignored — the conversion action's category determines the type. - * - LinkedIn: ignored — the conversion rule's `type` is locked to the destination. - * - */ - eventName: string; - /** - * When the conversion happened, in unix seconds. - */ - eventTime: number; - /** - * Unique dedup key. The same eventId must be used on pixel + CAPI - * to prevent double-counting. Mapped to event_id on Meta, - * transactionId on Google, eventId on LinkedIn (LinkedIn deduplicates - * against Insight Tag events with the same eventId; the Insight Tag - * event wins when both arrive). - * - */ - eventId: string; - /** - * Conversion value in the specified currency. - */ - value?: number; - /** - * ISO 4217 currency code. - */ - currency?: string; + event: 'account.ads.initial_sync_completed'; + account: { + /** + * The account's unique identifier (same as used in /v1/accounts/{accountId}) + */ + accountId: string; + /** + * The profile's unique identifier this account belongs to + */ + profileId: string; + platform: string; + username: string; + displayName?: string; + /** + * The platform-side account/ad-account ID (e.g. Meta ad account ID). + */ + platformUserId?: string; + /** + * URL of the account's profile picture, when available. + */ + profilePicture?: string; + /** + * When the consumer scoped the connect call to a single ad account, this echoes + * that ID back so the webhook can be correlated to the originating connect + * request without consulting the consumer's DB. Meta uses the `act_*` shape. + * + */ + platformAdAccountId?: string; + /** + * Every ad-account ID that the connected token could see at discovery time. + * Useful for "we synced ads from these accounts" UX without a follow-up API call. + * Empty array when the token had no ad-account visibility. + * + */ + platformAdAccountIds?: Array; + }; /** - * User identity fields. More signals mean higher match rates. + * Summary of the initial ads sync backfill results. */ - user: { + sync: { /** - * Plaintext email. Hashed server-side. + * Overall outcome of the initial sync. */ - email?: string; + status: 'success' | 'failure'; /** - * Phone number, ideally E.164. Hashed server-side. + * Total number of ads discovered for backfill. */ - phone?: string; + totalAds: number; /** - * Plaintext first name. Hashed server-side. + * Number of ads successfully synced. */ - firstName?: string; + synced: number; /** - * Plaintext last name. Hashed server-side. + * Number of ads that failed to sync. */ - lastName?: string; + failed: number; /** - * Stable customer identifier (e.g. CRM user ID). Hashed - * server-side for Meta and Google. Sent as plaintext to LinkedIn - * (LinkedIn's Conversions API spec requires the raw value). - * Maximum effective list size on LinkedIn is 1. + * Free-form error message from the platform (typically Meta's Marketing API). + * Truncated to ~2KB. Present when `status` is `failure` (and sometimes on `success` + * when discovery saw zero ad accounts). For UX branching prefer `errorCategory`; + * this field is for human display and debugging. * */ - externalId?: string; + error?: string; /** - * Client IP address. Sent plaintext. + * Platform-native error code if parsed (e.g. Meta `190`, `10`, `200`). */ - ipAddress?: string; + errorCode?: string; /** - * Client user-agent string. Sent plaintext. + * Platform-native error subcode if parsed. */ - userAgent?: string; + errorSubcode?: string; /** - * ISO 3166-1 alpha-2 country code, e.g. 'us'. + * Stable category for UX branching. New values may be added; existing ones are + * stable. Mapping: + * - `token_invalid`: access token is expired or revoked. Reconnect. + * - `permission_denied`: token lacks required scope, or the user has no role + * on the Business Manager that owns the ad account. Reconnect with full + * permissions, or have an admin grant access. + * - `no_ad_accounts`: token is valid but sees zero ad accounts. The user + * needs to connect a Business Manager that owns ad accounts. + * - `rate_limited`: platform throttled us. Sync will retry automatically. + * - `discovery_failed`: any other platform-side failure. Inspect `error`. + * - `unknown`: classifier could not categorize the failure. + * */ - country?: string; + errorCategory?: 'token_invalid' | 'permission_denied' | 'no_ad_accounts' | 'rate_limited' | 'discovery_failed' | 'unknown'; + }; + timestamp: string; +}; + +/** + * Webhook payload for comment received events (Instagram, Facebook, Twitter/X, YouTube, LinkedIn, Bluesky, Reddit) + */ +export type WebhookPayloadComment = { + /** + * Stable webhook event ID + */ + id: string; + event: 'comment.received'; + comment: { /** - * Platform click identifiers captured from the originating ad click. + * Platform comment ID */ - clickIds?: { - /** - * Meta click ID (from fbclid URL param). - */ - fbc?: string; - /** - * Meta browser ID (_fbp cookie). - */ - fbp?: string; + id: string; + /** + * Internal post ID (null for posts not published through Zernio) + */ + postId: string; + /** + * Platform's post ID + */ + platformPostId: string; + platform: 'instagram' | 'facebook' | 'twitter' | 'youtube' | 'linkedin' | 'bluesky' | 'reddit'; + /** + * Comment text content + */ + text: string; + author: { /** - * Google click ID (from gclid URL param). + * Author's platform ID */ - gclid?: string; + id: string; + username?: string; + name?: string; + picture?: string; + }; + createdAt: string; + /** + * Whether this is a reply to another comment + */ + isReply: boolean; + /** + * Parent comment ID if this is a reply + */ + parentCommentId: string; + /** + * Ad context. Present only when the comment was made on paid content. + * Instagram: populated from the webhook payload's value.media.ad_id and value.media.ad_title. + * Facebook: populated via a Graph API lookup of the parent post's promotion_status. + * Absent for comments on organic posts that are not currently promoted. + * + */ + ad?: { /** - * Google iOS 14.5+ app attribution ID. + * Meta ad ID (Instagram only). */ - gbraid?: string; + id?: string; /** - * Google iOS 14.5+ web-to-app attribution ID. + * Ad creative title (Instagram only). */ - wbraid?: string; + title?: string; /** - * LinkedIn first-party ad tracking click ID. Captured by - * parsing `li_fat_id` from landing-page URLs after the - * advertiser enables enhanced conversion tracking on the - * LinkedIn Insight Tag. Sent to LinkedIn as the - * LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID userId. Opaque - * token, not hashed. + * Facebook promotion status returned by Graph API. Common values: + * "active" (organic post currently boosted), "ineligible" (dark + * post or ad creative, not promotable because it already is an ad). * */ - li_fat_id?: string; + promotionStatus?: string; }; }; + post: { + /** + * Internal post ID (null for posts not published through Zernio) + */ + id: string; + /** + * Platform's post ID + */ + platformPostId: string; + }; + account: { + /** + * Social account ID + */ + id: string; + platform: string; + username: string; + }; + timestamp: string; +}; + +/** + * Review data shared by review.new and review.updated payloads. + */ +export type ReviewWebhookReview = { /** - * Item-level detail for ecommerce events. - */ - items?: Array<{ - id?: string; - name?: string; - price?: number; - quantity?: number; - category?: string; - }>; - /** - * URL where the conversion originated (used by Meta). + * Platform review ID (e.g. "accounts/123/locations/456/reviews/789" for Google Business). */ - sourceUrl?: string; + id: string; /** - * Where the conversion happened. Used by Meta; Google ignores. + * Platform the review originated on. Currently Google Business Profile only. */ - actionSource?: 'web' | 'app' | 'offline' | 'crm' | 'phone_call' | 'system_generated'; + platform: 'googlebusiness'; /** - * Escape hatch for platform-specific fields we haven't normalized. Forwarded as-is. + * Star rating the reviewer gave. */ - platformData?: { - [key: string]: unknown; + rating: number; + /** + * Review text content. May be empty if the reviewer left only a rating. + */ + text: string; + reviewer: { + /** + * Platform reviewer ID. Null when the platform does not expose it (common on Google Business anonymous reviews). + */ + id: string; + name: string; + profileImage: string; + }; + createdAt: string; + /** + * Whether the connected account has replied to this review. + */ + hasReply: boolean; + /** + * Present when hasReply is true. + */ + reply?: { + text: string; + createdAt: string; }; }; /** - * Where the conversion happened. Used by Meta; Google ignores. - */ -export type actionSource = 'web' | 'app' | 'offline' | 'crm' | 'phone_call' | 'system_generated'; - -/** - * Response returned by `POST /v1/ads/ctwa` when the request used the - * multi-creative shape (`creatives[]`). N persisted Ad documents share - * the returned `platformCampaignId` and `platformAdSetId`. `adType` is - * the union discriminator. - * + * Webhook payload for the review.new event (new review posted on a connected account). */ -export type CtwaMultiResponse = { - adType: 'multi'; +export type WebhookPayloadReviewNew = { /** - * The persisted Ad documents (one per creative), all sharing the same - * `platformCampaignId` and `platformAdSetId`. - * + * Stable webhook event ID */ - ads: Array<{ - [key: string]: unknown; - }>; - platformCampaignId: string; - platformAdSetId: string; - message: string; + id: string; + event: 'review.new'; + review: ReviewWebhookReview; + account: { + id: string; + platform: string; + username: string; + }; + timestamp: string; }; -export type adType2 = 'multi'; - /** - * Response returned by `POST /v1/ads/ctwa` when the request used the - * single-creative shape (top-level headline / body / imageUrl|video). - * `adType` is the union discriminator. + * Webhook payload for the review.updated event. Fired when the reviewer edits + * their text or rating, or when a reply is added (via the API or directly on the + * platform). Same shape as review.new. When a reply is present, review.hasReply + * is true and review.reply is populated. * */ -export type CtwaSingleResponse = { - adType: 'single'; +export type WebhookPayloadReviewUpdated = { /** - * The persisted Ad document. + * Stable webhook event ID */ - ad: { - [key: string]: unknown; + id: string; + event: 'review.updated'; + review: ReviewWebhookReview; + account: { + id: string; + platform: string; + username: string; }; - message: string; + timestamp: string; }; -export type adType3 = 'single'; - /** - * Discord message settings. Supports plain text (2,000 chars), rich embeds (up to 10), native polls, forum posts, threads, and announcement crossposts. Media attachments support images (JPEG, PNG, GIF, WebP), videos (MP4), and documents (up to 10 files, 25 MB each). Webhook identity (username + avatar) can be customized per-account via PATCH /v1/connect/discord or per-post via webhookUsername/webhookAvatarUrl. - * + * The message object included in inbox webhook payloads. */ -export type DiscordPlatformData = { +export type InboxWebhookMessage = { /** - * Target channel snowflake ID. Determines which channel in the connected server receives the message. + * Internal message ID */ - channelId: string; + id: string; /** - * Up to 10 Discord embed objects (combined max 6,000 characters across all embeds). Sent alongside or instead of plain-text content. + * Internal conversation ID */ - embeds?: Array<{ + conversationId: string; + platform: 'instagram' | 'facebook' | 'telegram' | 'whatsapp'; + /** + * Platform's message ID + */ + platformMessageId: string; + direction: 'incoming' | 'outgoing'; + /** + * Message text content (retained on deleted messages for API consumers; Zernio dashboard UI hides this) + */ + text: string; + attachments: Array<{ /** - * Embed title (max 256 chars) + * Attachment type (image, video, file, sticker, audio) */ - title?: string; + type: string; /** - * Embed body text (max 4,096 chars) + * Attachment URL (may expire for Meta platforms) */ - description?: string; + url: string; /** - * URL the title links to + * Additional attachment metadata */ - url?: string; + payload?: { + [key: string]: unknown; + }; + }>; + sender: { /** - * Embed accent color as decimal integer (e.g. 5814783 for blue). Convert hex to decimal. + * Sender's platform identifier. For WhatsApp this is the phone number + * (without leading `+`) when available, otherwise the `businessScopedUserId`. + * For other platforms, the platform's own user ID. + * */ - color?: number; - image?: { - url?: string; - }; - thumbnail?: { - url?: string; - }; - footer?: { - /** - * Footer text (max 2 - */ - text?: string; - icon_url?: string; - }; - author?: { - /** - * Author name (max 256 chars) - */ - name?: string; - url?: string; - icon_url?: string; - }; + id: string; + name?: string; + username?: string; + picture?: string; /** - * Up to 25 fields per embed + * WhatsApp only. Sender's phone number in E.164 format (with leading `+`). + * + * **Nullable during the BSUID rollout (April 2026+).** WhatsApp users + * who adopt a username can message businesses without exposing a phone + * number — this field is omitted for them. Match by `businessScopedUserId` + * instead. See `docs/whatsapp-bsuid-migration.md`. + * */ - fields?: Array<{ - /** - * Field name (max 256 chars) - */ - name: string; - /** - * Field value (max 1 - */ - value: string; - /** - * Display fields side-by-side - */ - inline?: boolean; - }>; - }>; - /** - * Native Discord poll. Cannot be combined with media attachments in the same message. - */ - poll?: { - question?: { - /** - * Poll question (max 300 chars) - */ - text: string; - }; + phoneNumber?: string; /** - * 1-10 answer options + * WhatsApp only. Business-scoped user ID (BSUID) — Meta's canonical + * identifier for a WhatsApp user within your business. Present when + * Meta includes it in the inbound payload (rollout in progress since + * early April 2026). **Recommended primary identity anchor** going + * forward; fall back to `phoneNumber` only when this field is absent. + * */ - answers?: Array<{ - poll_media?: { - /** - * Answer text - */ - text?: string; - }; - }>; + businessScopedUserId?: string; /** - * Poll duration in hours (1-768). Default 24. + * WhatsApp only. Parent BSUID for businesses with linked business + * portfolios. Omitted for standalone portfolios. + * */ - duration?: number; + parentBusinessScopedUserId?: string; /** - * Allow users to select multiple answers. Default false. + * WhatsApp only. User's WhatsApp username (e.g. `@jane`). Not a + * stable identifier — users can change it. Useful for display, not + * recommended as an identity anchor. + * */ - allow_multiselect?: boolean; + whatsappUsername?: string; + /** + * Instagram profile data. Only present for Instagram conversations. + */ + instagramProfile?: { + isFollower?: boolean; + isFollowing?: boolean; + followerCount?: number; + isVerified?: boolean; + }; }; - /** - * Auto-crosspost to every server following this announcement channel (type 5). No-op for regular text channels. - */ - crosspost?: boolean; - /** - * Thread title for forum channel posts (type 15). Required when posting to a forum channel. - */ - forumThreadName?: string; - /** - * Tag snowflake IDs to apply to forum posts. Max 5 tags. - */ - forumAppliedTags?: Array<(string)>; - /** - * Create a follow-up thread under the published message. - */ - threadFromMessage?: { - /** - * Thread name (1-100 chars) - */ - name?: string; - /** - * Auto-archive after inactivity (minutes) - */ - autoArchiveDuration?: 60 | 1440 | 4320 | 10080; - /** - * Slow-mode duration in seconds (0-21600) - */ - rateLimitPerUser?: number; - }; - /** - * Send as text-to-speech message. Discord reads the message aloud in the channel. - */ - tts?: boolean; - /** - * Override the webhook display name for this post only (1-80 chars). Falls back to the account-level default set via PATCH /v1/connect/discord. - */ - webhookUsername?: string; - /** - * Override the webhook avatar URL for this post only. Falls back to the account-level default. - */ - webhookAvatarUrl?: string; + sentAt: string; + isRead: boolean; }; /** - * Auto-archive after inactivity (minutes) + * The conversation context included in inbox webhook payloads. */ -export type autoArchiveDuration = 60 | 1440 | 4320 | 10080; +export type InboxWebhookConversation = { + id: string; + platformConversationId: string; + participantId?: string; + participantName?: string; + participantUsername?: string; + participantPicture?: string; + status: 'active' | 'archived'; +}; /** - * A single inline button rendered inside an auto-DM via Meta's button_template. - * Up to 3 buttons per automation. `url` and `postback` work on Instagram and - * Facebook; `phone` is Facebook-only. When buttons are set, `dmMessage` becomes - * the button_template text and must be 640 characters or less. - * + * The account context included in inbox webhook payloads. */ -export type DmButton = { - type: 'url' | 'postback' | 'phone'; - /** - * Button label (20 chars max) - */ - title: string; - /** - * Target URL (required when type is url) - */ - url?: string; - /** - * Postback payload delivered via the messaging_postbacks webhook (required when type is postback) - */ - payload?: string; +export type InboxWebhookAccount = { /** - * Phone number, e.g. +14155551234 (required when type is phone; Facebook only) + * Social account ID */ - phone?: string; -}; - -export type type2 = 'url' | 'postback' | 'phone'; - -export type ErrorResponse = { - error?: string; - details?: { - [key: string]: unknown; - }; + id: string; + platform: string; + username: string; + displayName?: string; }; /** - * Feed posts support up to 10 images (no mixed video+image). Stories require single media (24h, no captions). Reels require single vertical video (9:16, 3-60s). Carousel posts (carouselCards) render a 2-5 card multi-link post, images only, mutually exclusive with story/reel. Geo-restriction is a hard visibility restriction: users outside the specified countries cannot see the post. Not supported for stories. - * + * Webhook payload for message received events */ -export type FacebookPlatformData = { - /** - * When true, creates the post as an unpublished draft visible in Facebook Publishing Tools instead of publishing immediately. Supported for feed posts (text, link, image, video) and reels. Not supported for stories. Drafts expire after ~30 days. - */ - draft?: boolean; - /** - * Set to 'story' for Page Stories (24h ephemeral) or 'reel' for Reels (short vertical video). Defaults to feed post if omitted. - */ - contentType?: 'story' | 'reel'; - /** - * Reel title (only for contentType=reel). Separate from the caption/content field. - */ - title?: string; - /** - * Optional first comment to post immediately after publishing (feed posts and reels, not stories). Skipped when draft is true. - */ - firstComment?: string; - /** - * Target Facebook Page ID for multi-page posting. If omitted, uses the default page. Use GET /v1/accounts/{id}/facebook-page to list pages. - */ - pageId?: string; - geoRestriction?: GeoRestriction; +export type WebhookPayloadMessage = { /** - * Renders the post as a multi-link carousel (organic Page post). When set, mediaItems must be provided with the same length and all items must be images (no videos). Each cards[i] adds the click-through link and headline for the image at mediaItems[i]. Mutually exclusive with contentType=story|reel. Facebook display truncates name at ~35 chars and description at ~30 chars; longer strings are accepted but get truncated on render. - * + * Stable webhook event ID */ - carouselCards?: Array<{ + id: string; + event: 'message.received'; + message: { /** - * Per-card click destination (required). + * Internal message ID */ - link: string; + id: string; /** - * Per-card headline (optional, ~35-char display). + * Internal conversation ID */ - name?: string; + conversationId: string; + platform: 'instagram' | 'facebook' | 'telegram' | 'whatsapp'; /** - * Per-card subhead (optional, ~30-char display). + * Platform's message ID */ - description?: string; - }>; - /** - * Optional top-level "See more" destination shown on the carousel end card. Defaults to the first card's link when omitted. Only used together with carouselCards. - * - */ - carouselLink?: string; -}; - -/** - * Set to 'story' for Page Stories (24h ephemeral) or 'reel' for Reels (short vertical video). Defaults to feed post if omitted. - */ -export type contentType = 'story' | 'reel'; - -export type FollowerStatsResponse = { - accounts?: Array; - dateRange?: { - from?: string; - to?: string; - }; - aggregation?: 'daily' | 'weekly' | 'monthly'; -}; - -export type aggregation = 'daily' | 'weekly' | 'monthly'; - -export type FoodMenu = { - labels: Array; - sections?: Array; - /** - * Cuisine types (e.g. AMERICAN, ITALIAN, JAPANESE) - */ - cuisines?: Array<(string)>; - /** - * URL of the original menu source - */ - sourceUrl?: string; -}; - -export type FoodMenuItem = { - labels: Array; - attributes?: FoodMenuItemAttributes; - /** - * Item variants/options (e.g. sizes, preparations) - */ - options?: Array<{ - labels?: Array; - attributes?: FoodMenuItemAttributes; - }>; -}; - -export type FoodMenuItemAttributes = { - price?: Money; - /** - * Spiciness level (e.g. MILD, MEDIUM, HOT) - */ - spiciness?: string; - /** - * Allergens (e.g. DAIRY, GLUTEN, SHELLFISH) - */ - allergen?: Array<(string)>; - /** - * Dietary labels (e.g. VEGETARIAN, VEGAN, GLUTEN_FREE) - */ - dietaryRestriction?: Array<(string)>; - /** - * Number of people the item serves - */ - servesNumPeople?: number; - /** - * Preparation methods (e.g. GRILLED, FRIED) - */ - preparationMethods?: Array<(string)>; - /** - * Media references for item photos - */ - mediaKeys?: Array<(string)>; -}; - -export type FoodMenuLabel = { - /** - * Display name of the item/section/menu - */ - displayName: string; - /** - * Optional description - */ - description?: string; - /** - * BCP-47 language code (e.g. en, es) - */ - languageCode?: string; -}; - -export type FoodMenuSection = { - labels: Array; - items?: Array; -}; - -/** - * Country-level geo-restriction (allowlist). When set, the post is only visible to users in the specified countries. Supported on Facebook (feed posts, videos, reels), X/Twitter (media-level restriction), and LinkedIn (organization pages only, min 300 targeted followers). Ignored on unsupported platforms. Stories (Facebook, Instagram) do not support geo-restriction. - * - */ -export type GeoRestriction = { - /** - * ISO 3166-1 alpha-2 country codes (uppercase). Only users in these countries can see the post. Maximum 25 countries per post. Example: ["US", "CA", "GB", "ES"]. - * - */ - countries: Array<(string)>; -}; - -/** - * Text and single image only (no videos). Supports STANDARD, EVENT, OFFER, and ALERT post types. Posts appear on GBP, Google Search, and Maps. Use locationId for multi-location posting. Schedule dates accept both ISO 8601 strings (e.g. '2026-04-15T09:00:00Z') and Google's native {year, month, day} objects. - */ -export type GoogleBusinessPlatformData = { - /** - * Target GBP location ID (e.g. "locations/123456789"). If omitted, uses the default location. Use GET /v1/accounts/{id}/gmb-locations to list locations. - */ - locationId?: string; - /** - * BCP 47 language code (e.g. "en", "de", "es"). Auto-detected if omitted. Set explicitly for short or mixed-language posts. - */ - languageCode?: string; - /** - * Post type. STANDARD is a regular update. EVENT requires the event object. OFFER requires the offer object. Defaults to STANDARD if omitted. - */ - topicType?: 'STANDARD' | 'EVENT' | 'OFFER'; - /** - * Optional call-to-action button displayed on the post - */ - callToAction?: { + platformMessageId: string; + direction: 'incoming' | 'outgoing'; /** - * Button action type: LEARN_MORE, BOOK, ORDER, SHOP, SIGN_UP, CALL + * Message text content */ - type: 'LEARN_MORE' | 'BOOK' | 'ORDER' | 'SHOP' | 'SIGN_UP' | 'CALL'; - /** - * Destination URL for the CTA button (required when callToAction is provided) - */ - url: string; - }; - /** - * Event details. Required when topicType is EVENT. Google returns 400 if omitted for EVENT posts. - */ - event?: { - /** - * Event name (displayed as the event heading on Google Search and Maps) - */ - title: string; - /** - * Event date/time range. Uses Google's date format (NOT ISO 8601). - */ - schedule: { + text: string; + attachments: Array<{ /** - * Event start date as { year, month, day } + * Attachment type (image, video, file, sticker, audio) */ - startDate: { - year: number; - month: number; - day: number; - }; + type: string; /** - * Optional start time as { hours, minutes } in 24h format + * Attachment URL (may expire for Meta platforms) */ - startTime?: { - hours?: number; - minutes?: number; - }; + url: string; /** - * Event end date as { year, month, day } + * Additional attachment metadata */ - endDate: { - year: number; - month: number; - day: number; + payload?: { + [key: string]: unknown; }; + }>; + sender: { /** - * Optional end time as { hours, minutes } in 24h format + * Sender's platform identifier. For WhatsApp this is the phone + * number (without leading `+`) when available, otherwise the + * `businessScopedUserId`. + * */ - endTime?: { - hours?: number; - minutes?: number; + id: string; + name?: string; + username?: string; + picture?: string; + /** + * WhatsApp only. Sender's phone number in E.164 format (with leading `+`). + * + * **Nullable during the BSUID rollout (April 2026+).** WhatsApp + * users who adopt a username can message businesses without + * exposing a phone number — this field is omitted for them. + * Match by `businessScopedUserId` instead. See + * `docs/whatsapp-bsuid-migration.md`. + * + */ + phoneNumber?: string; + /** + * WhatsApp only. Business-scoped user ID (BSUID) — Meta's canonical + * identifier for a WhatsApp user within your business. Present + * when Meta includes it in the inbound payload (rollout in + * progress since early April 2026). **Recommended primary identity + * anchor** going forward; fall back to `phoneNumber` only when + * this field is absent. + * + */ + businessScopedUserId?: string; + /** + * WhatsApp only. Parent BSUID for businesses with linked business + * portfolios. Omitted for standalone portfolios. + * + */ + parentBusinessScopedUserId?: string; + /** + * WhatsApp only. User's WhatsApp username (e.g. `@jane`). Not a + * stable identifier — users can change it. Useful for display, + * not recommended as an identity anchor. + * + */ + whatsappUsername?: string; + /** + * Instagram profile data for the sender. Only present for Instagram conversations. + */ + instagramProfile?: { + /** + * Whether the sender follows your Instagram business account + */ + isFollower?: boolean; + /** + * Whether your Instagram business account follows the sender + */ + isFollowing?: boolean; + /** + * The sender's follower count on Instagram + */ + followerCount?: number; + /** + * Whether the sender is a verified Instagram user + */ + isVerified?: boolean; }; }; + sentAt: string; + isRead: boolean; }; - /** - * Offer details. Required when topicType is OFFER. All fields are optional per Google's API, but at least one is recommended. - */ - offer?: { - /** - * Type of offer - */ - offerType?: 'OFFER' | 'BUY_ONE_GET_ONE'; - /** - * URL where the offer can be redeemed online - */ - redeemOnlineUrl?: string; - /** - * Terms and conditions for the offer - */ - termsConditions?: string; + conversation: { + id: string; + platformConversationId: string; + participantId?: string; + participantName?: string; + participantUsername?: string; + participantPicture?: string; + status: 'active' | 'archived'; + }; + account: { /** - * Coupon code for the offer + * Social account ID */ - couponCode?: string; + id: string; + platform: string; + username: string; + displayName?: string; }; -}; - -/** - * Post type. STANDARD is a regular update. EVENT requires the event object. OFFER requires the offer object. Defaults to STANDARD if omitted. - */ -export type topicType = 'STANDARD' | 'EVENT' | 'OFFER'; - -/** - * Button action type: LEARN_MORE, BOOK, ORDER, SHOP, SIGN_UP, CALL - */ -export type type3 = 'LEARN_MORE' | 'BOOK' | 'ORDER' | 'SHOP' | 'SIGN_UP' | 'CALL'; - -/** - * Type of offer - */ -export type offerType = 'OFFER' | 'BUY_ONE_GET_ONE'; - -/** - * The account context included in inbox webhook payloads. - */ -export type InboxWebhookAccount = { - /** - * Social account ID - */ - id: string; - platform: string; - username: string; - displayName?: string; -}; - -/** - * The conversation context included in inbox webhook payloads. - */ -export type InboxWebhookConversation = { - id: string; - platformConversationId: string; - participantId?: string; - participantName?: string; - participantUsername?: string; - participantPicture?: string; - status: 'active' | 'archived'; -}; - -export type status3 = 'active' | 'archived'; - -/** - * The message object included in inbox webhook payloads. - */ -export type InboxWebhookMessage = { - /** - * Internal message ID - */ - id: string; - /** - * Internal conversation ID - */ - conversationId: string; - platform: 'instagram' | 'facebook' | 'telegram' | 'whatsapp'; /** - * Platform's message ID - */ - platformMessageId: string; - direction: 'incoming' | 'outgoing'; - /** - * Message text content (retained on deleted messages for API consumers; Zernio dashboard UI hides this) + * Interactive message metadata (present when message is a quick reply tap, postback button tap, or inline keyboard callback) */ - text: (string) | null; - attachments: Array<{ + metadata?: { /** - * Attachment type (image, video, file, sticker, audio) + * Payload from a quick reply tap (Facebook/Instagram Messenger). */ - type: string; + quickReplyPayload?: string; /** - * Attachment URL (may expire for Meta platforms) + * Payload from a postback button tap (Facebook/Instagram Messenger). */ - url: string; + postbackPayload?: string; /** - * Additional attachment metadata + * Title of the tapped postback button (Facebook/Instagram Messenger). */ - payload?: { - [key: string]: unknown; - }; - }>; - sender: { + postbackTitle?: string; /** - * Sender's platform identifier. For WhatsApp this is the phone number - * (without leading `+`) when available, otherwise the `businessScopedUserId`. - * For other platforms, the platform's own user ID. - * + * Callback data from an inline keyboard button tap (Telegram). */ - id: string; - name?: string; - username?: string; - picture?: string; + callbackData?: string; /** - * WhatsApp only. Sender's phone number in E.164 format (with leading `+`). - * - * **Nullable during the BSUID rollout (April 2026+).** WhatsApp users - * who adopt a username can message businesses without exposing a phone - * number — this field is omitted for them. Match by `businessScopedUserId` - * instead. See `docs/whatsapp-bsuid-migration.md`. + * WhatsApp only. Which kind of interactive reply the user sent: + * `button_reply` (tap on an interactive button), `list_reply` (tap on a + * list row), or `nfm_reply` (a WhatsApp Flow submission). * */ - phoneNumber?: (string) | null; + interactiveType?: 'button_reply' | 'list_reply' | 'nfm_reply'; /** - * WhatsApp only. Business-scoped user ID (BSUID) — Meta's canonical - * identifier for a WhatsApp user within your business. Present when - * Meta includes it in the inbound payload (rollout in progress since - * early April 2026). **Recommended primary identity anchor** going - * forward; fall back to `phoneNumber` only when this field is absent. + * WhatsApp only. The `id` of the tapped button or list row, matching the + * `id` you supplied when the message was sent. Not set for Flow responses. * */ - businessScopedUserId?: string; + interactiveId?: string; /** - * WhatsApp only. Parent BSUID for businesses with linked business - * portfolios. Omitted for standalone portfolios. + * WhatsApp only. Payload attached to a tapped template button. Template + * buttons emit a plain `button` webhook (not an interactive reply), so + * `interactiveType` is empty while this field is populated. * */ - parentBusinessScopedUserId?: string; + buttonPayload?: string; /** - * WhatsApp only. User's WhatsApp username (e.g. `@jane`). Not a - * stable identifier — users can change it. Useful for display, not - * recommended as an identity anchor. + * WhatsApp only. Raw `nfm_reply.response_json` string returned by a + * Flow submission. Useful if you need the exact wire payload; for + * typed access use `flowResponseData` instead. * */ - whatsappUsername?: string; + flowResponseJson?: string; /** - * Instagram profile data. Only present for Instagram conversations. + * WhatsApp only. Parsed Flow response JSON. Populated when + * `flowResponseJson` is valid JSON; otherwise omitted. Keys and + * value types depend on the specific Flow that was submitted. + * */ - instagramProfile?: { - isFollower?: (boolean) | null; - isFollowing?: (boolean) | null; - followerCount?: (number) | null; - isVerified?: (boolean) | null; + flowResponseData?: { + [key: string]: unknown; }; - }; - sentAt: string; - isRead: boolean; -}; - -export type platform2 = 'instagram' | 'facebook' | 'telegram' | 'whatsapp'; - -export type direction = 'incoming' | 'outgoing'; - -/** - * Shared account-insights response envelope used by every platform-level - * analytics endpoint (/v1/analytics/{facebook|instagram|youtube|linkedin|tiktok}*). - * The name is historical - the shape was first shipped for Instagram and every - * new platform endpoint reuses it for response-shape consistency. The platform - * field echoes back which platform served the response. - * - */ -export type InstagramAccountInsightsResponse = { - success?: boolean; - /** - * The Zernio SocialAccount ID - */ - accountId?: string; - /** - * Platform that served this response. - */ - platform?: 'facebook' | 'instagram' | 'youtube' | 'linkedin' | 'tiktok'; - dateRange?: { - since?: string; - until?: string; - }; - metricType?: 'time_series' | 'total_value'; - /** - * Breakdown dimension used (only present when breakdown was requested) - */ - breakdown?: string; - /** - * Object keyed by metric name. For time_series: each metric has "total" (number) and "values" (array of {date, value}). - * For total_value: each metric has "total" (number) and optionally "breakdowns" (array of {dimension, value}). - * - */ - metrics?: { - [key: string]: { + /** + * Instagram only. Populated when an IG user replies to one of the + * account's stories (Meta `messaging_story_replies`). Mutually + * exclusive in practice with `isStoryMention`. + * + */ + storyReply?: { /** - * Sum or aggregate value for the metric + * The Instagram story ID the user replied to. */ - total?: number; + storyId: string; /** - * Daily values (only for time_series) + * Meta CDN URL for the story media. Expires approximately + * 24 hours after the story posted; consumers must fetch + * promptly or treat 404s as expected. + * */ - values?: Array<{ - date?: string; - value?: number; - }>; + storyUrl?: string; + }; + /** + * Instagram only. True when the message was generated by an IG + * user mentioning the account in their own story (`story_mention` + * attachment type). Mutually exclusive in practice with `storyReply`. + * + */ + isStoryMention?: boolean; + /** + * Ad-click attribution forwarded verbatim from Meta. Populated only on + * the FIRST inbound message after the click; absent on subsequent + * messages of the same conversation. + * + * The populated subset identifies the source platform: + * - `ctwa_clid` and `source_*` fields: WhatsApp CTWA + * (Click-to-WhatsApp). Attribution window is 7 days from click. + * Forward to Meta Conversions API for Business Messaging replay. + * - `ad_id` and `ads_context_data`: Facebook Messenger CTM + * (Click-to-Message) or Instagram CTD (Click-to-Direct). Use + * `ad_id` to attribute the conversation to a specific ad. + * + */ + referral?: { /** - * Breakdown values (only for total_value with breakdown) + * Meta's GCLID-equivalent click identifier. */ - breakdowns?: Array<{ - dimension?: string; - value?: number; - }>; + ctwa_clid?: string; + source_id?: string; + source_type?: string; + source_url?: string; + headline?: string; + body?: string; + media_type?: string; + image_url?: string; + video_url?: string; + thumbnail_url?: string; + /** + * Facebook Messenger CTM / Instagram CTD only. The Meta ad ID the + * user clicked to start the conversation. + * + */ + ad_id?: string; + /** + * Optional `ref` parameter passed through from the Meta ad + * creative. Facebook Messenger CTM / Instagram CTD only. + * + */ + ref?: string; + /** + * Meta-supplied source identifier (e.g. `ADS`). Facebook Messenger + * CTM / Instagram CTD only. + * + */ + source?: string; + /** + * Meta-supplied referral type (e.g. `OPEN_THREAD`). Facebook + * Messenger CTM / Instagram CTD only. + * + */ + type?: string; + /** + * Snapshot of the ad's public context at click time. Facebook + * Messenger CTM / Instagram CTD only. + * + */ + ads_context_data?: { + ad_title?: string; + photo_url?: string; + video_url?: string; + post_id?: string; + product_id?: string; + flow_id?: string; + }; }; }; - dataDelay?: string; + timestamp: string; }; /** - * Platform that served this response. + * Webhook payload for message sent events (fired when a message is sent via the API) */ -export type platform3 = 'facebook' | 'instagram' | 'youtube' | 'linkedin' | 'tiktok'; - -export type metricType = 'time_series' | 'total_value'; - -export type InstagramDemographicsResponse = { - success?: boolean; - /** - * The Zernio SocialAccount ID - */ - accountId?: string; - platform?: string; - metric?: 'follower_demographics' | 'engaged_audience_demographics'; - /** - * The timeframe used for demographic data - */ - timeframe?: 'this_week' | 'this_month'; +export type WebhookPayloadMessageSent = { /** - * Object keyed by breakdown dimension (age, city, country, gender) + * Stable webhook event ID */ - demographics?: { - [key: string]: Array<{ + id: string; + event: 'message.sent'; + message: { + /** + * Internal message ID + */ + id: string; + /** + * Internal conversation ID + */ + conversationId: string; + platform: 'instagram' | 'facebook' | 'telegram' | 'whatsapp'; + /** + * Platform's message ID + */ + platformMessageId: string; + direction: 'incoming' | 'outgoing'; + /** + * Message text content + */ + text: string; + attachments: Array<{ /** - * The dimension value (e.g., "25-34", "US", "M") + * Attachment type (image, video, file, sticker, audio) */ - dimension?: string; + type: string; /** - * Count of accounts in this dimension + * Attachment URL (may expire for Meta platforms) */ - value?: number; + url: string; + /** + * Additional attachment metadata + */ + payload?: { + [key: string]: unknown; + }; }>; + sender: { + id: string; + name?: string; + username?: string; + picture?: string; + }; + sentAt: string; + isRead: boolean; }; - note?: string; + conversation: { + id: string; + platformConversationId: string; + participantId?: string; + participantName?: string; + participantUsername?: string; + participantPicture?: string; + status: 'active' | 'archived'; + }; + account: { + /** + * Social account ID + */ + id: string; + platform: string; + username: string; + displayName?: string; + }; + timestamp: string; }; -export type metric = 'follower_demographics' | 'engaged_audience_demographics'; - -/** - * The timeframe used for demographic data - */ -export type timeframe = 'this_week' | 'this_month'; - /** - * Feed aspect ratio 0.8-1.91, carousels up to 10 items, stories require media (no captions). User tag coordinates 0.0-1.0 from top-left. Images over 8 MB and videos over platform limits are auto-compressed. + * Webhook payload for message.edited events. Fires when the sender + * edits a previously-sent message. Supported platforms: Instagram, + * Facebook Messenger, Telegram. The message object reflects the + * LATEST state; editHistory contains every prior version in order + * (oldest first), so the last entry is the version immediately before + * the current content. + * */ -export type InstagramPlatformData = { +export type WebhookPayloadMessageEdited = { + id: string; + event: 'message.edited'; + message: InboxWebhookMessage; /** - * Set to 'story' to publish as a Story. Default posts become Reels or feed depending on media. + * Prior versions of the message, oldest first. */ - contentType?: 'story'; - /** - * For Reels only. When true (default), the Reel appears on both the Reels tab and your main profile feed. Set to false to post to the Reels tab only. - */ - shareToFeed?: boolean; - /** - * Up to 3 Instagram usernames to invite as collaborators (feed/Reels only) - */ - collaborators?: Array<(string)>; - /** - * Optional first comment to add after the post is created (not applied to Stories) - */ - firstComment?: string; - /** - * Trial Reels configuration. Trial reels are shared to non-followers first and can later be graduated to regular reels manually or automatically based on performance. Only applies to Reels. - */ - trialParams?: { - /** - * MANUAL (graduate from Instagram app) or SS_PERFORMANCE (auto-graduate if performs well with non-followers) - */ - graduationStrategy?: 'MANUAL' | 'SS_PERFORMANCE'; - }; - /** - * Tag Instagram users in photos by username and position. Not supported for stories or videos. For carousels, use mediaIndex to target specific slides (defaults to 0). Tags on video items are silently skipped. - */ - userTags?: Array<{ - /** - * Instagram username (@ symbol is optional and will be removed automatically) - */ - username: string; - /** - * X coordinate position from left edge (0.0 = left, 0.5 = center, 1.0 = right) - */ - x: number; - /** - * Y coordinate position from top edge (0.0 = top, 0.5 = center, 1.0 = bottom) - */ - y: number; - /** - * Zero-based index of the carousel item to tag. Defaults to 0. Tags on video items or out-of-range indices are ignored. - */ - mediaIndex?: number; + editHistory: Array<{ + text: string; + attachments: Array<{ + type?: string; + url?: string; + payload?: { + [key: string]: unknown; + }; + }>; + editedAt: string; }>; /** - * Custom name for original audio in Reels. Replaces the default "Original Audio" label. Can only be set once. - */ - audioName?: string; - /** - * Millisecond offset from video start for the Reel cover frame. Ignored when instagramThumbnail or reelCover is provided. Defaults to 0. - */ - thumbOffset?: number; - /** - * Custom cover image URL for Instagram Reels (JPG or PNG, publicly accessible). Overrides thumbOffset when provided. Also accepted as reelCover (alias). + * Total number of edits applied to this message. */ - instagramThumbnail?: string; + editCount: number; /** - * Alias for instagramThumbnail. If both are provided, instagramThumbnail takes priority. + * When the most recent edit happened. */ - reelCover?: string; + editedAt: string; + conversation: InboxWebhookConversation; + account: InboxWebhookAccount; + timestamp: string; }; /** - * Set to 'story' to publish as a Story. Default posts become Reels or feed depending on media. - */ -export type contentType2 = 'story'; - -/** - * MANUAL (graduate from Instagram app) or SS_PERFORMANCE (auto-graduate if performs well with non-followers) + * Webhook payload for message.deleted events. Fires when the sender + * deletes (unsends) a message. Supported platforms: Instagram (incoming + * unsend) and WhatsApp (when the business deletes an outgoing message + * via the Cloud API). + * + * The message.text and message.attachments fields retain the content + * that existed before the delete. The Zernio dashboard UI does not show + * this content, but authorized API consumers may access it for + * moderation, compliance, or archival use cases. + * */ -export type graduationStrategy = 'MANUAL' | 'SS_PERFORMANCE'; +export type WebhookPayloadMessageDeleted = { + id: string; + event: 'message.deleted'; + message: InboxWebhookMessage; + deletedAt: string; + conversation: InboxWebhookConversation; + account: InboxWebhookAccount; + timestamp: string; +}; /** - * Response for DAILY aggregation (time series breakdown) + * Shared payload for message.delivered, message.read, and + * message.failed events. Fires when the platform reports a new + * delivery state for an outgoing message. + * + * Platform support: + * * message.delivered — WhatsApp, Facebook Messenger. + * * message.read — WhatsApp, Facebook Messenger, Instagram. + * * message.failed — WhatsApp only (other platforms don't expose + * per-message failure via webhook). + * */ -export type LinkedInAggregateAnalyticsDailyResponse = { - accountId?: string; - platform?: string; - accountType?: string; - username?: string; - aggregation?: 'DAILY'; - dateRange?: { - startDate?: string; - endDate?: string; - } | null; +export type WebhookPayloadMessageDeliveryStatus = { + id: string; + event: 'message.delivered' | 'message.read' | 'message.failed'; + message: InboxWebhookMessage; /** - * Daily breakdown of each metric as date/count pairs. Reach not available with DAILY aggregation. + * When the platform reported this status. */ - analytics?: { - impressions?: Array<{ - date?: string; - count?: number; - }>; - reactions?: Array<{ - date?: string; - count?: number; - }>; - comments?: Array<{ - date?: string; - count?: number; - }>; - shares?: Array<{ - date?: string; - count?: number; - }>; - /** - * Daily saves (personal accounts only) - */ - saves?: Array<{ - date?: string; - count?: number; - }>; - /** - * Daily sends via LinkedIn messaging (personal accounts only) - */ - sends?: Array<{ - date?: string; - count?: number; - }>; - }; + statusAt: string; /** - * Metrics that were skipped due to API limitations + * Populated only on message.failed. */ - skippedMetrics?: Array<(string)>; - note?: string; - lastUpdated?: string; + error?: { + code?: number; + title?: string; + message?: string; + }; + conversation: InboxWebhookConversation; + account: InboxWebhookAccount; + timestamp: string; }; -export type aggregation2 = 'DAILY'; - /** - * Response for TOTAL aggregation (lifetime totals) + * Webhook payload for the `ad.status_changed` event. Currently emitted + * only for Meta (`metaads`). + * + * Sourced from two Meta `ad_account` webhook fields: + * - `in_process_ad_objects` - the ad object finished processing and + * exited `IN_PROCESS`. `status.raw` carries Meta's `status_name`. + * - `with_issues_ad_objects` - the ad object entered `WITH_ISSUES`. + * `status.raw` is `WITH_ISSUES` and the `error` block is populated + * from Meta's `error_code` / `error_summary` / `error_message`. + * */ -export type LinkedInAggregateAnalyticsTotalResponse = { - accountId?: string; - platform?: string; - accountType?: string; - username?: string; - aggregation?: 'TOTAL'; - dateRange?: { - startDate?: string; - endDate?: string; - } | null; - analytics?: { +export type WebhookPayloadAdStatusChanged = { + /** + * Stable webhook event ID + */ + id: string; + event: 'ad.status_changed'; + /** + * The connected ad-platform account that owns the ad object. + */ + account: { /** - * Total impressions across all posts + * Internal Zernio account ID (same as used in /v1/accounts/{accountId}). */ - impressions?: number; + accountId: string; /** - * Unique members reached across all posts + * Internal Zernio profile ID this account belongs to. */ - reach?: number; + profileId: string; /** - * Total reactions across all posts + * Ad platform identifier. Currently always `metaads`. */ - reactions?: number; + platform: string; /** - * Total comments across all posts + * Display username of the connected ad-platform account. */ - comments?: number; + username: string; /** - * Total reshares across all posts + * Human-readable display name of the account, when available. */ - shares?: number; + displayName?: string; + }; + /** + * The ad-platform object the status change applies to. + */ + adObject: { /** - * Total times posts were saved (personal accounts only) + * Hierarchy level the status applies to. Mirrors Meta's `level`. Creative-level events are not forwarded. */ - saves?: number; + level: 'CAMPAIGN' | 'AD_SET' | 'AD'; /** - * Total times posts were sent via LinkedIn messaging (personal accounts only) + * Platform-native ID of the campaign / ad set / ad. For Meta this is + * the bare numeric ID (e.g. `120244894077860689`). + * */ - sends?: number; + platformId: string; /** - * Overall engagement rate as percentage + * Platform-native ad-account ID. For Meta this uses the `act_` + * shape. + * */ - engagementRate?: number; + platformAdAccountId: string; }; - note?: string; - lastUpdated?: string; -}; - -export type aggregation3 = 'TOTAL'; - -/** - * Up to 20 images, no multi-video. Single PDF supported (max 100MB). Link previews auto-generated when no media attached. Use organizationUrn for multi-org posting. Geo-restriction only works for organization pages (not personal profiles) and requires the targeted audience to exceed 300 followers. - * - */ -export type LinkedInPlatformData = { - /** - * Title displayed on LinkedIn document (PDF/carousel) posts. Required by LinkedIn for document posts. If omitted, falls back to the media item title, then the filename. - */ - documentTitle?: string; - /** - * Target LinkedIn Organization URN (e.g. "urn:li:organization:123456789"). If omitted, uses the default org. Use GET /v1/accounts/{id}/linkedin-organizations to list orgs. - */ - organizationUrn?: string; /** - * Optional first comment to add after the post is created + * Status info. Branch on `status.raw` to handle each transition. */ - firstComment?: string; + status: { + /** + * Platform-native status string, forwarded verbatim. For Meta + * this is `status_name` from `in_process_ad_objects` (e.g. + * `ACTIVE`, `PAUSED`, `PENDING_REVIEW`, `ARCHIVED`, `DELETED`, + * `DISAPPROVED`), or `WITH_ISSUES` when sourced from + * `with_issues_ad_objects`. Not constrained by an `enum` — Meta + * may add new values. + * + */ + raw: string; + }; /** - * Set to true to disable automatic link previews for URLs in the post content (default is false) + * Optional. Present on most `WITH_ISSUES` events, carrying the + * platform's error diagnostics. May be absent on some `WITH_ISSUES` + * events (Meta does not always include diagnostics). Always absent + * for any other `status.raw` value. Always null-check before reading. + * */ - disableLinkPreview?: boolean; - geoRestriction?: GeoRestriction; + error?: { + /** + * Platform-native error code, forwarded verbatim. For Meta this + * is `error_code` as a string. Use as the stable discriminator — + * `summary` and `message` are localized. + * + */ + code: string; + /** + * Short human-readable summary (Meta `error_summary`). Localized + * to the ad-account owner's Meta locale — display only, do not + * match on it. + * + */ + summary?: string; + /** + * Full human-readable error message (Meta `error_message`). + * Localized — display only. + * + */ + message?: string; + }; + /** + * ISO-8601 timestamp the webhook was produced. + */ + timestamp: string; }; /** - * Media referenced in posts. URLs must be publicly reachable over HTTPS. Use POST /v1/media/presign for uploads up to 5GB. Zernio auto-compresses images and videos that exceed platform limits (videos over 200 MB may not be compressed). + * Webhook payload for the `whatsapp.template.status_updated` event. + * Fired when Meta completes (re)review of a template attached to a + * connected WABA. Maps Meta's `message_template_status_update` field + * onto our event envelope. + * */ -export type MediaItem = { - type?: 'image' | 'video' | 'gif' | 'document'; - url?: string; - /** - * Optional title for the media item. Used as the document title for LinkedIn PDF/carousel posts. If omitted, falls back to the post title, then the filename. - */ - title?: string; - filename?: string; - /** - * Optional file size in bytes - */ - size?: number; - /** - * Optional MIME type (e.g. image/jpeg, video/mp4) - */ - mimeType?: string; - /** - * Optional custom thumbnail/cover image URL for videos. Supported for Facebook video posts, Facebook Reels, and regular video uploads. Max 10MB, JPG/PNG recommended. - */ - thumbnail?: string; +export type WebhookPayloadWhatsAppTemplateStatusUpdated = { /** - * Custom cover image URL for Instagram Reels. Can also be set via platformSpecificData.instagramThumbnail or platformSpecificData.reelCover. Resolution order: this field > platformSpecificData.instagramThumbnail > platformSpecificData.reelCover > platformSpecificData.thumbnailUrl (legacy). + * Stable webhook event ID */ - instagramThumbnail?: string; + id: string; + event: 'whatsapp.template.status_updated'; + account: { + accountId: string; + profileId: string; + platform: 'whatsapp'; + username: string; + displayName?: string; + }; + template: { + /** + * Meta's `message_template_id`, returned as a string. + */ + templateId: string; + /** + * Meta's `message_template_name`. + */ + name: string; + /** + * Meta's `message_template_language` (e.g. `en_US`). + */ + language: string; + /** + * New status. Forwarded verbatim from Meta's `event` field. + * `PENDING_DELETION` is the 24h-grace state after a delete + * request before the template is actually removed. + * + */ + status: 'APPROVED' | 'REJECTED' | 'PENDING' | 'PAUSED' | 'DISABLED' | 'IN_APPEAL' | 'PENDING_DELETION'; + /** + * Meta's free-form reason for the transition. `"NONE"` on + * approval; an explanation string on rejection. + * + */ + reason: string; + }; /** - * Internal flag indicating the image was resized for TikTok + * ISO-8601 timestamp the webhook was produced. */ - tiktokProcessed?: boolean; -}; - -export type type4 = 'image' | 'video' | 'gif' | 'document'; - -export type MediaUploadResponse = { - files?: Array; + timestamp: string; }; -export type Money = { - /** - * ISO 4217 currency code (e.g. USD, EUR) - */ - currencyCode: string; +/** + * Webhook payload for test deliveries + */ +export type WebhookPayloadTest = { /** - * Whole units of the amount + * Stable webhook event ID */ - units: string; + id: string; + event: 'webhook.test'; /** - * Nano units (10^-9) of the amount + * Human-readable test message */ - nanos?: number; -}; - -export type Pagination = { - page?: number; - limit?: number; - total?: number; - pages?: number; + message: string; + timestamp: string; }; /** - * Page size + * Country-level geo-restriction (allowlist). When set, the post is only visible to users in the specified countries. Supported on Facebook (feed posts, videos, reels), X/Twitter (media-level restriction), and LinkedIn (organization pages only, min 300 targeted followers). Ignored on unsupported platforms. Stories (Facebook, Instagram) do not support geo-restriction. + * */ -export type ParameterLimitParam = number; +export type GeoRestriction = { + /** + * ISO 3166-1 alpha-2 country codes (uppercase). Only users in these countries can see the post. Maximum 25 countries per post. Example: ["US", "CA", "GB", "ES"]. + * + */ + countries: Array; +}; /** - * Page number (1-based) + * Media referenced in posts. URLs must be publicly reachable over HTTPS. Use POST /v1/media/presign for uploads up to 5GB. Zernio auto-compresses images and videos that exceed platform limits (videos over 200 MB may not be compressed). */ -export type ParameterPageParam = number; - -export type PinterestPlatformData = { +export type MediaItem = { + type?: 'image' | 'video' | 'gif' | 'document'; + url?: string; /** - * Pin title. Defaults to first line of content or "Pin". Must be ≤ 100 characters. + * Optional title for the media item. Used as the document title for LinkedIn PDF/carousel posts. If omitted, falls back to the post title, then the filename. */ title?: string; + filename?: string; /** - * Target Pinterest board ID. If omitted, the first available board is used. - */ - boardId?: string; - /** - * Destination link (pin URL) - */ - link?: string; - /** - * Optional cover image for video pins + * Optional file size in bytes */ - coverImageUrl?: string; + size?: number; /** - * Optional key frame time in seconds for derived video cover + * Optional MIME type (e.g. image/jpeg, video/mp4) */ - coverImageKeyFrameTime?: number; -}; - -export type PlatformAnalytics = { - platform?: string; - status?: 'published' | 'failed'; + mimeType?: string; /** - * The native post ID on the platform (e.g. Instagram media ID, tweet ID) + * Optional custom thumbnail/cover image URL for videos. Supported for Facebook video posts, Facebook Reels, and regular video uploads. Max 10MB, JPG/PNG recommended. */ - platformPostId?: (string) | null; - accountId?: string; - accountUsername?: (string) | null; - analytics?: (PostAnalytics) | null; + thumbnail?: string; /** - * Sync state of analytics for this platform + * Custom cover image URL for Instagram Reels. Can also be set via platformSpecificData.instagramThumbnail or platformSpecificData.reelCover. Resolution order: this field > platformSpecificData.instagramThumbnail > platformSpecificData.reelCover > platformSpecificData.thumbnailUrl (legacy). */ - syncStatus?: 'synced' | 'pending' | 'unavailable'; - platformPostUrl?: (string) | null; + instagramThumbnail?: string; /** - * Error details when status is failed + * Internal flag indicating the image was resized for TikTok */ - errorMessage?: (string) | null; + tiktokProcessed?: boolean; }; -export type status4 = 'published' | 'failed'; - -/** - * Sync state of analytics for this platform - */ -export type syncStatus2 = 'synced' | 'pending' | 'unavailable'; - export type PlatformTarget = { /** * Supported values: twitter, threads, instagram, youtube, facebook, linkedin, pinterest, reddit, tiktok, bluesky, googlebusiness, telegram */ platform?: string; - accountId?: (string | SocialAccount); + accountId?: string | SocialAccount; /** * Platform-specific text override. When set, this content is used instead of the top-level post content for this platform. Useful for tailoring captions per platform (e.g. keeping tweets under 280 characters). */ @@ -2070,7 +1739,7 @@ export type PlatformTarget = { /** * Platform-specific overrides and options. */ - platformSpecificData?: (TwitterPlatformData | ThreadsPlatformData | FacebookPlatformData | InstagramPlatformData | LinkedInPlatformData | PinterestPlatformData | YouTubePlatformData | GoogleBusinessPlatformData | TikTokPlatformData | TelegramPlatformData | SnapchatPlatformData | RedditPlatformData | BlueskyPlatformData | DiscordPlatformData); + platformSpecificData?: TwitterPlatformData | ThreadsPlatformData | FacebookPlatformData | InstagramPlatformData | LinkedInPlatformData | PinterestPlatformData | YouTubePlatformData | GoogleBusinessPlatformData | TikTokPlatformData | TelegramPlatformData | SnapchatPlatformData | RedditPlatformData | BlueskyPlatformData | DiscordPlatformData; /** * Platform-specific status: pending, publishing, published, failed */ @@ -2101,19 +1770,9 @@ export type PlatformTarget = { errorSource?: 'user' | 'platform' | 'system'; }; -/** - * Error category for programmatic handling: auth_expired (token expired/revoked), user_content (wrong format/too long), user_abuse (rate limits/spam), account_issue (config problems), platform_rejected (policy violation), platform_error (5xx/maintenance), system_error (Zernio infra), unknown - */ -export type errorCategory = 'auth_expired' | 'user_content' | 'user_abuse' | 'account_issue' | 'platform_rejected' | 'platform_error' | 'system_error' | 'unknown'; - -/** - * Who caused the error: user (fix content/reconnect), platform (outage/API change), system (Zernio issue, rare) - */ -export type errorSource = 'user' | 'platform' | 'system'; - export type Post = { _id?: string; - userId?: (string | User); + userId?: string | User; /** * YouTube: title must be ≤ 100 characters. * @@ -2128,12 +1787,12 @@ export type Post = { /** * YouTube constraints: each tag max 100 chars, combined max 500 chars, duplicates removed. */ - tags?: Array<(string)>; - hashtags?: Array<(string)>; + tags?: Array; + hashtags?: Array; /** * Stored for reference only. This field does NOT automatically create @mentions when publishing. For LinkedIn @mentions, use the /v1/accounts/{accountId}/linkedin-mentions endpoint to resolve profile URLs to URNs, then embed the returned mentionFormat directly in the post content field. */ - mentions?: Array<(string)>; + mentions?: Array; visibility?: 'public' | 'private' | 'unlisted'; metadata?: { [key: string]: unknown; @@ -2155,173 +1814,18 @@ export type Post = { updatedAt?: string; }; -export type status5 = 'draft' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial'; - -export type visibility = 'public' | 'private' | 'unlisted'; - -export type PostAnalytics = { - impressions?: number; - reach?: number; - likes?: number; - comments?: number; - shares?: number; +/** + * Configure automatic post recycling (reposting at regular intervals). + * After the post is published, the system creates new scheduled copies at the + * specified interval until expiration conditions are met. Supports weekly or + * monthly intervals. Maximum 10 active recycling posts per account. + * YouTube and TikTok platforms are excluded from recycling. + * Content variations are recommended for Twitter and Pinterest to avoid duplicate flags. + * + */ +export type RecyclingConfig = { /** - * Number of saves/bookmarks (Instagram, Pinterest) - */ - saves?: number; - clicks?: number; - views?: number; - engagementRate?: number; - lastUpdated?: string; -}; - -export type PostCreateResponse = { - message?: string; - post?: Post; -}; - -export type PostDeleteResponse = { - message?: string; -}; - -export type PostGetResponse = { - post?: Post; -}; - -export type PostRetryResponse = { - message?: string; - post?: Post; -}; - -export type PostsListResponse = { - posts?: Array; - pagination?: Pagination; -}; - -export type PostUpdateResponse = { - message?: string; - post?: Post; -}; - -export type Profile = { - _id?: string; - userId?: string; - name?: string; - description?: string; - color?: string; - isDefault?: boolean; - /** - * Only present when includeOverLimit=true. Indicates if this profile exceeds the plan limit. - */ - isOverLimit?: boolean; - createdAt?: string; -}; - -export type ProfileCreateResponse = { - message?: string; - profile?: Profile; -}; - -export type ProfileDeleteResponse = { - message?: string; -}; - -export type ProfileGetResponse = { - profile?: Profile; -}; - -export type ProfilesListResponse = { - profiles?: Array; -}; - -export type ProfileUpdateResponse = { - message?: string; - profile?: Profile; -}; - -export type QueueDeleteResponse = { - success?: boolean; - deleted?: boolean; -}; - -export type QueueNextSlotResponse = { - profileId?: string; - nextSlot?: string; - timezone?: string; -}; - -export type QueuePreviewResponse = { - profileId?: string; - count?: number; - slots?: Array<(string)>; -}; - -export type QueueSchedule = { - /** - * Unique queue identifier - */ - _id?: string; - /** - * Profile ID this queue belongs to - */ - profileId?: string; - /** - * Queue name (e.g., "Morning Posts", "Evening Content") - */ - name?: string; - /** - * IANA timezone (e.g., America/New_York) - */ - timezone?: string; - slots?: Array; - /** - * Whether the queue is active - */ - active?: boolean; - /** - * Whether this is the default queue for the profile (used when no queueId specified) - */ - isDefault?: boolean; - createdAt?: string; - updatedAt?: string; -}; - -export type QueueSlot = { - /** - * Day of week (0=Sunday, 6=Saturday) - */ - dayOfWeek?: number; - /** - * Time in HH:mm format (24-hour) - */ - time?: string; -}; - -export type QueueSlotsResponse = { - exists?: boolean; - schedule?: QueueSchedule; - nextSlots?: Array<(string)>; -}; - -export type QueueUpdateResponse = { - success?: boolean; - schedule?: QueueSchedule; - nextSlots?: Array<(string)>; - reshuffledCount?: number; -}; - -/** - * Configure automatic post recycling (reposting at regular intervals). - * After the post is published, the system creates new scheduled copies at the - * specified interval until expiration conditions are met. Supports weekly or - * monthly intervals. Maximum 10 active recycling posts per account. - * YouTube and TikTok platforms are excluded from recycling. - * Content variations are recommended for Twitter and Pinterest to avoid duplicate flags. - * - */ -export type RecyclingConfig = { - /** - * Set to false to disable recycling on this post + * Set to false to disable recycling on this post */ enabled?: boolean; /** @@ -2353,14 +1857,9 @@ export type RecyclingConfig = { * customContent still overrides the base content per platform. * */ - contentVariations?: Array<(string)>; + contentVariations?: Array; }; -/** - * Interval unit for the gap. Defaults to 'month'. - */ -export type gapFreq = 'week' | 'month'; - /** * Current recycling configuration and state on a post */ @@ -2383,7 +1882,7 @@ export type RecyclingState = { /** * Content variations for recycled copies (if configured) */ - contentVariations?: Array<(string)>; + contentVariations?: Array; /** * Current position in the content variations rotation (read-only) */ @@ -2403,347 +1902,434 @@ export type RecyclingState = { }; /** - * Posts are either link (with URL/media), native video (via nativeVideo), or self (text-only). Use forceSelf to override. Subreddit defaults to the account's configured one. Some subreddits require a flair. + * X (Twitter) geo-restriction applies at the media level. Media in geo-restricted tweets will be hidden for users outside the specified countries; the tweet text itself remains visible globally. Requires media to be attached (ignored for text-only tweets). + * */ -export type RedditPlatformData = { - /** - * Target subreddit name (without "r/" prefix). Overrides the default. Use GET /v1/accounts/{id}/reddit-subreddits to list options. - */ - subreddit?: string; - /** - * Post title. Defaults to the first line of content, truncated to 300 characters. - */ - title?: string; - /** - * URL for link posts. If provided (and forceSelf is not true), creates a link post instead of a text post. - */ - url?: string; +export type TwitterPlatformData = { /** - * When true, creates a text/self post even when a URL or media is provided. + * ID of an existing tweet to reply to. The published tweet will appear as a reply in that tweet's thread. For threads, only the first tweet replies to the target; subsequent tweets chain normally. */ - forceSelf?: boolean; + replyToTweetId?: string; /** - * Flair ID for the post. Required by some subreddits. Use GET /v1/accounts/{id}/reddit-flairs?subreddit=name to list flairs. + * Controls who can reply to the tweet. "following" allows only people you follow, "mentionedUsers" allows only mentioned users, "subscribers" allows only subscribers, "verified" allows only verified users. Omit for default (everyone can reply). For threads, applies to the first tweet only. Cannot be combined with replyToTweetId. */ - flairId?: string; + replySettings?: 'following' | 'mentionedUsers' | 'subscribers' | 'verified'; /** - * Controls Reddit's native video upload flow. When true (default for video mediaItems), the video is uploaded to Reddit's CDN and submitted with kind=video so it renders as an embedded Reddit video player. Reddit transcodes server-side (1080p/30fps cap). Set to false to fall back to a legacy link post. If the subreddit blocks video posts, the upload falls back to a link post automatically. + * Complete sequence of tweets in a thread. The first item becomes the root tweet, subsequent items are chained as replies. When threadItems is provided, the top-level content field is used only for display and search purposes, it is NOT published. You must include your first tweet as threadItems[0]. * */ - nativeVideo?: boolean; + threadItems?: Array<{ + content?: string; + mediaItems?: Array; + }>; /** - * When true (and nativeVideo is active), submits the video as a silent videogif (kind=videogif). Use for short looping clips without audio. + * Create a poll with this tweet. Mutually exclusive with media attachments and threads. */ - videogif?: boolean; + poll?: { + /** + * Poll options (2-4 choices, max 25 characters each) + */ + options: Array; + /** + * Poll duration in minutes (5 min to 7 days) + */ + duration_minutes: number; + }; /** - * Optional poster/thumbnail image URL for native video posts. If omitted, the first frame of the video is extracted and used automatically. + * Enable long video uploads (over 140 seconds) using amplify_video media category. Requires the connected X account to have an active X Premium subscription. When true, videos are uploaded with the amplify_video category which supports longer durations (up to 10 minutes via API). When false or omitted, the standard tweet_video category is used (140 second limit). Note that not all Premium accounts have API long-video access, as X may require separate allowlisting. */ - videoPosterUrl?: string; + longVideo?: boolean; + geoRestriction?: GeoRestriction; }; /** - * A normalized Reddit post returned by the feed and search endpoints + * Up to 10 images per carousel (no videos). Videos must be H.264/AAC MP4, max 5 min. Images JPEG/PNG, max 8 MB. Use threadItems for reply chains. */ -export type RedditPost = { - /** - * Reddit post ID (without type prefix) - */ - id?: string; +export type ThreadsPlatformData = { /** - * Reddit fullname (e.g. t3_abc123) + * Topic tag for post categorization and discoverability on Threads. Must be 1-50 characters, cannot contain periods (.) or ampersands (&). Overrides auto-extraction from content hashtags when provided. */ - fullname?: string; - title?: string; - author?: string; - subreddit?: string; + topic_tag?: string; /** - * Post URL (may be a gallery URL + * Complete sequence of posts in a Threads thread. The first item becomes the root post, subsequent items are chained as replies. When threadItems is provided, the top-level content field is used only for display and search purposes, it is NOT published. You must include your first post as threadItems[0]. + * */ - url?: string; + threadItems?: Array<{ + content?: string; + mediaItems?: Array; + }>; +}; + +/** + * Feed posts support up to 10 images (no mixed video+image). Stories require single media (24h, no captions). Reels require single vertical video (9:16, 3-60s). Carousel posts (carouselCards) render a 2-5 card multi-link post, images only, mutually exclusive with story/reel. Geo-restriction is a hard visibility restriction: users outside the specified countries cannot see the post. Not supported for stories. + * + */ +export type FacebookPlatformData = { /** - * Full permalink to the Reddit post + * When true, creates the post as an unpublished draft visible in Facebook Publishing Tools instead of publishing immediately. Supported for feed posts (text, link, image, video) and reels. Not supported for stories. Drafts expire after ~30 days. */ - permalink?: string; + draft?: boolean; /** - * Self-post body text (empty string for link posts) + * Set to 'story' for Page Stories (24h ephemeral) or 'reel' for Reels (short vertical video). Defaults to feed post if omitted. */ - selftext?: string; + contentType?: 'story' | 'reel'; /** - * Unix timestamp of post creation + * Reel title (only for contentType=reel). Separate from the caption/content field. */ - createdUtc?: number; - score?: number; - numComments?: number; + title?: string; /** - * Whether the post is marked NSFW + * Optional first comment to post immediately after publishing (feed posts and reels, not stories). Skipped when draft is true. */ - over18?: boolean; - stickied?: boolean; + firstComment?: string; /** - * Link flair text if set + * Target Facebook Page ID for multi-page posting. If omitted, uses the default page. Use GET /v1/accounts/{id}/facebook-page to list pages. */ - flairText?: (string) | null; + pageId?: string; + geoRestriction?: GeoRestriction; /** - * Whether the post is a gallery with multiple images + * Renders the post as a multi-link carousel (organic Page post). When set, mediaItems must be provided with the same length and all items must be images (no videos). Each cards[i] adds the click-through link and headline for the image at mediaItems[i]. Mutually exclusive with contentType=story|reel. Facebook display truncates name at ~35 chars and description at ~30 chars; longer strings are accepted but get truncated on render. + * */ - isGallery?: boolean; + carouselCards?: Array<{ + /** + * Per-card click destination (required). + */ + link: string; + /** + * Per-card headline (optional, ~35-char display). + */ + name?: string; + /** + * Per-card subhead (optional, ~30-char display). + */ + description?: string; + }>; /** - * Individual image URLs for gallery posts (only present when isGallery is true) + * Optional top-level "See more" destination shown on the carousel end card. Defaults to the first card's link when omitted. Only used together with carouselCards. + * */ - galleryImages?: Array<(string)>; + carouselLink?: string; }; /** - * Review data shared by review.new and review.updated payloads. + * Feed aspect ratio 0.8-1.91, carousels up to 10 items, stories require media (no captions). User tag coordinates 0.0-1.0 from top-left. Images over 8 MB and videos over platform limits are auto-compressed. */ -export type ReviewWebhookReview = { +export type InstagramPlatformData = { /** - * Platform review ID (e.g. "accounts/123/locations/456/reviews/789" for Google Business). + * Set to 'story' to publish as a Story. Default posts become Reels or feed depending on media. */ - id: string; + contentType?: 'story'; /** - * Platform the review originated on. Currently Google Business Profile only. + * For Reels only. When true (default), the Reel appears on both the Reels tab and your main profile feed. Set to false to post to the Reels tab only. */ - platform: 'googlebusiness'; + shareToFeed?: boolean; /** - * Star rating the reviewer gave. + * Up to 3 Instagram usernames to invite as collaborators (feed/Reels only) */ - rating: number; + collaborators?: Array; /** - * Review text content. May be empty if the reviewer left only a rating. + * Optional first comment to add after the post is created (not applied to Stories) */ - text: string; - reviewer: { + firstComment?: string; + /** + * Trial Reels configuration. Trial reels are shared to non-followers first and can later be graduated to regular reels manually or automatically based on performance. Only applies to Reels. + */ + trialParams?: { /** - * Platform reviewer ID. Null when the platform does not expose it (common on Google Business anonymous reviews). + * MANUAL (graduate from Instagram app) or SS_PERFORMANCE (auto-graduate if performs well with non-followers) */ - id: (string) | null; - name: string; - profileImage: (string) | null; + graduationStrategy?: 'MANUAL' | 'SS_PERFORMANCE'; }; - createdAt: string; /** - * Whether the connected account has replied to this review. + * Tag Instagram users in photos by username and position. Not supported for stories or videos. For carousels, use mediaIndex to target specific slides (defaults to 0). Tags on video items are silently skipped. */ - hasReply: boolean; + userTags?: Array<{ + /** + * Instagram username (@ symbol is optional and will be removed automatically) + */ + username: string; + /** + * X coordinate position from left edge (0.0 = left, 0.5 = center, 1.0 = right) + */ + x: number; + /** + * Y coordinate position from top edge (0.0 = top, 0.5 = center, 1.0 = bottom) + */ + y: number; + /** + * Zero-based index of the carousel item to tag. Defaults to 0. Tags on video items or out-of-range indices are ignored. + */ + mediaIndex?: number; + }>; /** - * Present when hasReply is true. + * Custom name for original audio in Reels. Replaces the default "Original Audio" label. Can only be set once. */ - reply?: { - text: string; - createdAt: string; - }; -}; - -/** - * Platform the review originated on. Currently Google Business Profile only. - */ -export type platform4 = 'googlebusiness'; - -/** - * An ad account a tracking tag is shared with (Meta `shared_accounts` edge). - */ -export type SharedAdAccount = { + audioName?: string; /** - * Ad account id, in `act_` form. + * Millisecond offset from video start for the Reel cover frame. Ignored when instagramThumbnail or reelCover is provided. Defaults to 0. */ - id: string; - name?: string; + thumbOffset?: number; /** - * Business Manager id that owns the ad account + * Custom cover image URL for Instagram Reels (JPG or PNG, publicly accessible). Overrides thumbOffset when provided. Also accepted as reelCover (alias). */ - businessId?: string; -}; - -/** - * Requires a Public Profile. Single media item only. Content types: story (ephemeral 24h), saved_story (permanent, title max 45 chars), spotlight (video, max 160 chars). - */ -export type SnapchatPlatformData = { + instagramThumbnail?: string; /** - * Content type: story (ephemeral 24h, default), saved_story (permanent on Public Profile), spotlight (video feed) + * Alias for instagramThumbnail. If both are provided, instagramThumbnail takes priority. */ - contentType?: 'story' | 'saved_story' | 'spotlight'; + reelCover?: string; }; /** - * Content type: story (ephemeral 24h, default), saved_story (permanent on Public Profile), spotlight (video feed) + * Up to 20 images, no multi-video. Single PDF supported (max 100MB). Link previews auto-generated when no media attached. Use organizationUrn for multi-org posting. Geo-restriction only works for organization pages (not personal profiles) and requires the targeted audience to exceed 300 followers. + * */ -export type contentType3 = 'story' | 'saved_story' | 'spotlight'; - -export type SocialAccount = { - _id: string; - platform: 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'discord' | 'whatsapp' | 'linkedinads' | 'metaads' | 'pinterestads' | 'tiktokads' | 'xads' | 'googleads'; - profileId: (string | Profile); - username?: string; - displayName?: string; - /** - * URL to the account's profile picture on the platform. May be null if the platform does not provide one. - */ - profilePicture?: (string) | null; - /** - * Full profile URL for the connected account on its platform. - */ - profileUrl?: string; - isActive: boolean; - /** - * Follower count (only included if user has analytics add-on) - */ - followersCount?: number; +export type LinkedInPlatformData = { /** - * Last time follower count was updated (only included if user has analytics add-on) + * Title displayed on LinkedIn document (PDF/carousel) posts. Required by LinkedIn for document posts. If omitted, falls back to the media item title, then the filename. */ - followersLastUpdated?: string; + documentTitle?: string; /** - * Reference to the parent posting SocialAccount. Set for ads accounts that share - * or derive from a posting account's OAuth token. null for standalone ads (Google Ads) - * and all posting accounts. - * + * Target LinkedIn Organization URN (e.g. "urn:li:organization:123456789"). If omitted, uses the default org. Use GET /v1/accounts/{id}/linkedin-organizations to list orgs. */ - parentAccountId?: (string) | null; + organizationUrn?: string; /** - * Whether the user explicitly activated this account. false means the account was - * created as a side effect (e.g., posting account auto-created when user connected - * ads first). Posting UI and scheduler ignore accounts with enabled: false. - * + * Optional first comment to add after the post is created */ - enabled?: boolean; + firstComment?: string; /** - * Platform-specific metadata. Fields vary by platform. For WhatsApp accounts, includes: - * - qualityRating: Phone number quality rating from Meta (GREEN, YELLOW, RED, or UNKNOWN) - * - nameStatus: Display name review status (APPROVED, PENDING_REVIEW, DECLINED, or NONE). Messages cannot be sent until the display name is approved by Meta. - * - messagingLimitTier: Maximum unique business-initiated conversations per 24h rolling window (TIER_250, TIER_1K, TIER_10K, TIER_100K, or TIER_UNLIMITED). Scales automatically as quality rating improves. - * - verifiedName: Meta-verified business display name - * - displayPhoneNumber: Formatted phone number (e.g., "+1 555-123-4567") - * - wabaId: WhatsApp Business Account ID - * - phoneNumberId: Meta phone number ID - * + * Set to true to disable automatic link previews for URLs in the post content (default is false) */ - metadata?: { - [key: string]: unknown; - }; + disableLinkPreview?: boolean; + geoRestriction?: GeoRestriction; }; -export type platform5 = 'tiktok' | 'instagram' | 'facebook' | 'youtube' | 'linkedin' | 'twitter' | 'threads' | 'pinterest' | 'reddit' | 'bluesky' | 'googlebusiness' | 'telegram' | 'snapchat' | 'discord' | 'whatsapp' | 'linkedinads' | 'metaads' | 'pinterestads' | 'tiktokads' | 'xads' | 'googleads'; - -/** - * Text, images (up to 10), videos (up to 10), and mixed media albums. Captions up to 1024 chars for media, 4096 for text-only. - */ -export type TelegramPlatformData = { - /** - * Text formatting mode for the message (default is HTML) - */ - parseMode?: 'HTML' | 'Markdown' | 'MarkdownV2'; +export type PinterestPlatformData = { /** - * Disable link preview generation for URLs in the message + * Pin title. Defaults to first line of content or "Pin". Must be ≤ 100 characters. */ - disableWebPagePreview?: boolean; + title?: string; /** - * Send the message silently (users will receive notification without sound) + * Target Pinterest board ID. If omitted, the first available board is used. */ - disableNotification?: boolean; + boardId?: string; /** - * Protect message content from forwarding and saving + * Destination link (pin URL) */ - protectContent?: boolean; -}; - -/** - * Text formatting mode for the message (default is HTML) - */ -export type parseMode = 'HTML' | 'Markdown' | 'MarkdownV2'; - -/** - * Up to 10 images per carousel (no videos). Videos must be H.264/AAC MP4, max 5 min. Images JPEG/PNG, max 8 MB. Use threadItems for reply chains. - */ -export type ThreadsPlatformData = { + link?: string; /** - * Topic tag for post categorization and discoverability on Threads. Must be 1-50 characters, cannot contain periods (.) or ampersands (&). Overrides auto-extraction from content hashtags when provided. + * Optional cover image for video pins */ - topic_tag?: string; + coverImageUrl?: string; /** - * Complete sequence of posts in a Threads thread. The first item becomes the root post, subsequent items are chained as replies. When threadItems is provided, the top-level content field is used only for display and search purposes, it is NOT published. You must include your first post as threadItems[0]. - * + * Optional key frame time in seconds for derived video cover */ - threadItems?: Array<{ - content?: string; - mediaItems?: Array; - }>; + coverImageKeyFrameTime?: number; }; /** - * Photo carousels up to 35 images. Video titles up to 2200 chars, photo titles truncated to 90 chars. - * privacyLevel must match creator_info options. Both camelCase and snake_case accepted. - * - * Creator Inbox (draft mode): Set draft: true to send content to the TikTok Creator Inbox - * instead of publishing immediately. The creator receives an inbox notification and completes - * the post using TikTok's editing flow. This maps to TikTok's post_mode: "MEDIA_UPLOAD" internally. - * - * Important: The field publish_type is NOT supported. Use draft: true for Creator Inbox flow. - * - * Photo drafts use the /v2/post/publish/content/init/ endpoint with post_mode: "MEDIA_UPLOAD". - * Video drafts use the dedicated /v2/post/publish/inbox/video/init/ endpoint. - * - * When draft: true, the video.upload scope is required. When draft is false or omitted - * (direct post), the video.publish scope is required. For Creator Inbox, TikTok app version - * must be 31.8 or higher. - * + * Videos under 3 min auto-detected as Shorts. Custom thumbnails for regular videos only. Scheduled videos are uploaded immediately with the specified visibility. */ -export type TikTokPlatformData = { - /** - * When true, sends the post to the TikTok Creator Inbox as a draft instead of publishing - * immediately. The creator receives an inbox notification to complete posting via TikTok's - * editing flow. Maps to TikTok API post_mode: "MEDIA_UPLOAD" (photos) or the dedicated - * inbox endpoint (videos). When false or omitted, publishes directly via post_mode: "DIRECT_POST". - * Note: publish_type is not a supported field. Use this field instead. - * - */ - draft?: boolean; +export type YouTubePlatformData = { /** - * One of the values returned by the TikTok creator info API for the account + * Video title. Defaults to first line of content or "Untitled Video". Must be ≤ 100 characters. */ - privacyLevel?: string; + title?: string; /** - * Allow comments on the post + * Video visibility: public (default, anyone can watch), unlisted (link only), private (invite only) */ - allowComment?: boolean; + visibility?: 'public' | 'private' | 'unlisted'; /** - * Allow duets (required for video posts) + * COPPA compliance flag. Set true for child-directed content (restricts comments, notifications, ad targeting). Defaults to false. YouTube may block views if not explicitly set. */ - allowDuet?: boolean; + madeForKids?: boolean; /** - * Allow stitches (required for video posts) + * Optional first comment to post immediately after video upload. Up to 10,000 characters (YouTube's comment limit). */ - allowStitch?: boolean; + firstComment?: string; /** - * Type of commercial content disclosure + * AI-generated content disclosure. Set true if the video contains synthetic content that could be mistaken for real. YouTube may add a label. */ - commercialContentType?: 'none' | 'brand_organic' | 'brand_content'; + containsSyntheticMedia?: boolean; /** - * Whether the post promotes a brand partner + * YouTube video category ID. Defaults to 22 (People & Blogs). Common: 1 (Film), 2 (Autos), 10 (Music), 15 (Pets), 17 (Sports), 20 (Gaming), 23 (Comedy), 24 (Entertainment), 25 (News), 26 (Howto), 27 (Education), 28 (Science & Tech). */ - brandPartnerPromote?: boolean; + categoryId?: string; /** - * Whether the post is a brand organic post + * Optional YouTube playlist ID to add the video to after upload (e.g. 'PLxxxxxxxxxxxxx'). Use GET /v1/accounts/{id}/youtube-playlists to list available playlists. Works for both immediate and scheduled uploads. Quota cost: 50 YouTube API units per call. */ - isBrandOrganicPost?: boolean; + playlistId?: string; +}; + +/** + * Text and single image only (no videos). Supports STANDARD, EVENT, OFFER, and ALERT post types. Posts appear on GBP, Google Search, and Maps. Use locationId for multi-location posting. Schedule dates accept both ISO 8601 strings (e.g. '2026-04-15T09:00:00Z') and Google's native {year, month, day} objects. + */ +export type GoogleBusinessPlatformData = { /** - * User has confirmed they previewed the content + * Target GBP location ID (e.g. "locations/123456789"). If omitted, uses the default location. Use GET /v1/accounts/{id}/gmb-locations to list locations. */ - contentPreviewConfirmed?: boolean; + locationId?: string; /** - * User has given express consent for posting + * BCP 47 language code (e.g. "en", "de", "es"). Auto-detected if omitted. Set explicitly for short or mixed-language posts. */ - expressConsentGiven?: boolean; + languageCode?: string; /** - * Optional override. Defaults based on provided media items. + * Post type. STANDARD is a regular update. EVENT requires the event object. OFFER requires the offer object. Defaults to STANDARD if omitted. */ - mediaType?: 'video' | 'photo'; + topicType?: 'STANDARD' | 'EVENT' | 'OFFER'; /** - * Optional for video posts. Timestamp in milliseconds to select which frame to use as thumbnail (defaults to 1000ms/1 second). Ignored when videoCoverImageUrl is provided. + * Optional call-to-action button displayed on the post */ - videoCoverTimestampMs?: number; - /** - * Optional for video posts. URL of a custom thumbnail image (JPG, PNG, or WebP, max 20MB). The image is stitched as a single frame at the start of the video and used as the cover. Overrides videoCoverTimestampMs when provided. + callToAction?: { + /** + * Button action type: LEARN_MORE, BOOK, ORDER, SHOP, SIGN_UP, CALL + */ + type: 'LEARN_MORE' | 'BOOK' | 'ORDER' | 'SHOP' | 'SIGN_UP' | 'CALL'; + /** + * Destination URL for the CTA button (required when callToAction is provided) + */ + url: string; + }; + /** + * Event details. Required when topicType is EVENT. Google returns 400 if omitted for EVENT posts. + */ + event?: { + /** + * Event name (displayed as the event heading on Google Search and Maps) + */ + title: string; + /** + * Event date/time range. Uses Google's date format (NOT ISO 8601). + */ + schedule: { + /** + * Event start date as { year, month, day } + */ + startDate: { + year: number; + month: number; + day: number; + }; + /** + * Optional start time as { hours, minutes } in 24h format + */ + startTime?: { + hours?: number; + minutes?: number; + }; + /** + * Event end date as { year, month, day } + */ + endDate: { + year: number; + month: number; + day: number; + }; + /** + * Optional end time as { hours, minutes } in 24h format + */ + endTime?: { + hours?: number; + minutes?: number; + }; + }; + }; + /** + * Offer details. Required when topicType is OFFER. All fields are optional per Google's API, but at least one is recommended. + */ + offer?: { + /** + * Type of offer + */ + offerType?: 'OFFER' | 'BUY_ONE_GET_ONE'; + /** + * URL where the offer can be redeemed online + */ + redeemOnlineUrl?: string; + /** + * Terms and conditions for the offer + */ + termsConditions?: string; + /** + * Coupon code for the offer + */ + couponCode?: string; + }; +}; + +/** + * Photo carousels up to 35 images. Video titles up to 2200 chars, photo titles truncated to 90 chars. + * privacyLevel must match creator_info options. Both camelCase and snake_case accepted. + * + * Creator Inbox (draft mode): Set draft: true to send content to the TikTok Creator Inbox + * instead of publishing immediately. The creator receives an inbox notification and completes + * the post using TikTok's editing flow. This maps to TikTok's post_mode: "MEDIA_UPLOAD" internally. + * + * Important: The field publish_type is NOT supported. Use draft: true for Creator Inbox flow. + * + * Photo drafts use the /v2/post/publish/content/init/ endpoint with post_mode: "MEDIA_UPLOAD". + * Video drafts use the dedicated /v2/post/publish/inbox/video/init/ endpoint. + * + * When draft: true, the video.upload scope is required. When draft is false or omitted + * (direct post), the video.publish scope is required. For Creator Inbox, TikTok app version + * must be 31.8 or higher. + * + */ +export type TikTokPlatformData = { + /** + * When true, sends the post to the TikTok Creator Inbox as a draft instead of publishing + * immediately. The creator receives an inbox notification to complete posting via TikTok's + * editing flow. Maps to TikTok API post_mode: "MEDIA_UPLOAD" (photos) or the dedicated + * inbox endpoint (videos). When false or omitted, publishes directly via post_mode: "DIRECT_POST". + * Note: publish_type is not a supported field. Use this field instead. + * + */ + draft?: boolean; + /** + * One of the values returned by the TikTok creator info API for the account + */ + privacyLevel?: string; + /** + * Allow comments on the post + */ + allowComment?: boolean; + /** + * Allow duets (required for video posts) + */ + allowDuet?: boolean; + /** + * Allow stitches (required for video posts) + */ + allowStitch?: boolean; + /** + * Type of commercial content disclosure + */ + commercialContentType?: 'none' | 'brand_organic' | 'brand_content'; + /** + * Whether the post promotes a brand partner + */ + brandPartnerPromote?: boolean; + /** + * Whether the post is a brand organic post + */ + isBrandOrganicPost?: boolean; + /** + * User has confirmed they previewed the content + */ + contentPreviewConfirmed?: boolean; + /** + * User has given express consent for posting + */ + expressConsentGiven?: boolean; + /** + * Optional override. Defaults based on provided media items. + */ + mediaType?: 'video' | 'photo'; + /** + * Optional for video posts. Timestamp in milliseconds to select which frame to use as thumbnail (defaults to 1000ms/1 second). Ignored when videoCoverImageUrl is provided. + */ + videoCoverTimestampMs?: number; + /** + * Optional for video posts. URL of a custom thumbnail image (JPG, PNG, or WebP, max 20MB). The image is stitched as a single frame at the start of the video and used as the cover. Overrides videoCoverTimestampMs when provided. */ videoCoverImageUrl?: string; /** @@ -2765,1798 +2351,1944 @@ export type TikTokPlatformData = { }; /** - * Type of commercial content disclosure + * Text, images (up to 10), videos (up to 10), and mixed media albums. Captions up to 1024 chars for media, 4096 for text-only. */ -export type commercialContentType = 'none' | 'brand_organic' | 'brand_content'; +export type TelegramPlatformData = { + /** + * Text formatting mode for the message (default is HTML) + */ + parseMode?: 'HTML' | 'Markdown' | 'MarkdownV2'; + /** + * Disable link preview generation for URLs in the message + */ + disableWebPagePreview?: boolean; + /** + * Send the message silently (users will receive notification without sound) + */ + disableNotification?: boolean; + /** + * Protect message content from forwarding and saving + */ + protectContent?: boolean; +}; /** - * Optional override. Defaults based on provided media items. + * Requires a Public Profile. Single media item only. Content types: story (ephemeral 24h), saved_story (permanent, title max 45 chars), spotlight (video, max 160 chars). */ -export type mediaType2 = 'video' | 'photo'; +export type SnapchatPlatformData = { + /** + * Content type: story (ephemeral 24h, default), saved_story (permanent on Public Profile), spotlight (video feed) + */ + contentType?: 'story' | 'saved_story' | 'spotlight'; +}; /** - * A platform measurement tag — the thing you create, install on a - * website, send events to, and target ads against. On Meta this is a - * Pixel (`kind: pixel`). The shape is platform-neutral so other platforms - * (Pinterest Tag, LinkedIn Insight Tag, etc.) can be added without - * changing the contract; platform-specific fields are simply absent where - * a platform has no equivalent. Returned by `listTrackingTags`, - * `createTrackingTag`, `getTrackingTag`, and `updateTrackingTag`. - * + * Posts are either link (with URL/media), native video (via nativeVideo), or self (text-only). Use forceSelf to override. Subreddit defaults to the account's configured one. Some subreddits require a flair. */ -export type TrackingTag = { - /** - * Platform-native tag id. Meta: numeric pixel id, as a string. - */ - id: string; - name: string; - platform: 'metaads'; - /** - * Platform-native flavor of the tag (Meta: `pixel`). - */ - kind: 'pixel' | 'tag' | 'insight_tag'; +export type RedditPlatformData = { /** - * `inactive` when the platform reports the tag as broken/unavailable. + * Target subreddit name (without "r/" prefix). Overrides the default. Use GET /v1/accounts/{id}/reddit-subreddits to list options. */ - status: 'active' | 'inactive'; + subreddit?: string; /** - * The base-code `