{"_id":"@banana.inc/zoho-desk-nodejs-sdk","_rev":"6-e4239d74c865d4aca53f21d7705201e4","name":"@banana.inc/zoho-desk-nodejs-sdk","dist-tags":{"latest":"1.1.3"},"versions":{"0.1.0":{"name":"@banana.inc/zoho-desk-nodejs-sdk","version":"0.1.0","keywords":["zoho","desk","sdk","api","helpdesk","typescript"],"license":"MIT","_id":"@banana.inc/zoho-desk-nodejs-sdk@0.1.0","maintainers":[{"name":"dragonxsx","email":"dragon.sunshine@gmail.com"}],"homepage":"https://github.com/dragonxsx/zoho-desk-nodejs-sdk#readme","bugs":{"url":"https://github.com/dragonxsx/zoho-desk-nodejs-sdk/issues"},"dist":{"shasum":"1bce176fd52229db778d5d0a940699260f5f6f72","tarball":"https://registry.npmjs.org/@banana.inc/zoho-desk-nodejs-sdk/-/zoho-desk-nodejs-sdk-0.1.0.tgz","fileCount":3888,"integrity":"sha512-+K/DNkUwLWqVzCLup3kqhOzLYTLu7R5BH+tVgW4dQEW3IDpV2H8e3rawsh1L6Pkx2E9Z2O+9rtO1CcbxR825pQ==","signatures":[{"sig":"MEQCIDWerB0Tgi1L47C40Svtiy7IdX8k/E2GQ9B0SUgfUqX4AiBEWCLeU0yOGmpV/MER9BZ7binP2iqUJ4EHBlMdbCchDg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@banana.inc%2fzoho-desk-nodejs-sdk@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":24335830},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"8881436739a666330c3bdff76105ee9312bdf302","scripts":{"lint":"tsc --noEmit","test":"vitest run","build":"tsc","generate":"bash scripts/pull-and-generate.sh","bundle-oas":"tsx scripts/bundle-oas.ts","test:watch":"vitest","prepublishOnly":"npm run build && npm test","generate-facade":"tsx scripts/generate-facade.ts"},"_npmUser":{"name":"dragonxsx","email":"dragon.sunshine@gmail.com"},"repository":{"url":"git+https://github.com/dragonxsx/zoho-desk-nodejs-sdk.git","type":"git"},"_npmVersion":"10.8.2","description":"Zoho Desk Node.js SDK with OAuth 2.0, multi-data-center support, and token persistence","directories":{},"_nodeVersion":"20.20.0","dependencies":{"undici":"^6.0.0","winston":"^3.11.0","@microsoft/kiota-abstractions":"^1.0.0-preview.100","@microsoft/kiota-http-fetchlibrary":"^1.0.0-preview.100","@microsoft/kiota-serialization-form":"^1.0.0-preview.100","@microsoft/kiota-serialization-json":"^1.0.0-preview.100","@microsoft/kiota-serialization-text":"^1.0.0-preview.100","@microsoft/kiota-serialization-multipart":"^1.0.0-preview.100"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.0.0","vitest":"^1.0.0","typescript":"^5.4.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/zoho-desk-nodejs-sdk_0.1.0_1773343586977_0.38729762323510486","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@banana.inc/zoho-desk-nodejs-sdk","version":"1.0.0","keywords":["zoho","desk","sdk","api","helpdesk","typescript"],"license":"MIT","_id":"@banana.inc/zoho-desk-nodejs-sdk@1.0.0","maintainers":[{"name":"dragonxsx","email":"dragon.sunshine@gmail.com"}],"homepage":"https://github.com/dragonxsx/zoho-desk-nodejs-sdk#readme","bugs":{"url":"https://github.com/dragonxsx/zoho-desk-nodejs-sdk/issues"},"dist":{"shasum":"359e2fb593d4ee28c3955d052974fd75f223f161","tarball":"https://registry.npmjs.org/@banana.inc/zoho-desk-nodejs-sdk/-/zoho-desk-nodejs-sdk-1.0.0.tgz","fileCount":3888,"integrity":"sha512-lwO9pOcLIP1NZ5/qHoihIGH3YkBriCngC1RV7bGpvPOAA9mcF2L3y6pGe8C0DSaShVRL3iUo3wSCgCeeNlS0OQ==","signatures":[{"sig":"MEUCICxfBHXvl07glgM5VXoPIvpFfNsM5eN10iGe01/ej18zAiEA4ShS4hWhSyFTy5NAZrYHJOo1b/gTtnOc278T6TAlbHI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@banana.inc%2fzoho-desk-nodejs-sdk@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":24341972},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"7edd92903aea72422c21c881a7f11c231e3bcb25","scripts":{"lint":"tsc --noEmit","test":"vitest run","build":"tsc","generate":"bash scripts/pull-and-generate.sh","bundle-oas":"tsx scripts/bundle-oas.ts","test:watch":"vitest","prepublishOnly":"npm run build && npm test","generate-facade":"tsx scripts/generate-facade.ts"},"_npmUser":{"name":"dragonxsx","email":"dragon.sunshine@gmail.com"},"repository":{"url":"git+https://github.com/dragonxsx/zoho-desk-nodejs-sdk.git","type":"git"},"_npmVersion":"10.8.2","description":"Zoho Desk Node.js SDK with OAuth 2.0, multi-data-center support, and token persistence","directories":{},"_nodeVersion":"20.20.0","dependencies":{"undici":"^6.0.0","winston":"^3.11.0","@microsoft/kiota-abstractions":"^1.0.0-preview.100","@microsoft/kiota-http-fetchlibrary":"^1.0.0-preview.100","@microsoft/kiota-serialization-form":"^1.0.0-preview.100","@microsoft/kiota-serialization-json":"^1.0.0-preview.100","@microsoft/kiota-serialization-text":"^1.0.0-preview.100","@microsoft/kiota-serialization-multipart":"^1.0.0-preview.100"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.0.0","vitest":"^1.0.0","typescript":"^5.4.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/zoho-desk-nodejs-sdk_1.0.0_1773360174376_0.8716981815547544","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@banana.inc/zoho-desk-nodejs-sdk","version":"1.1.0","keywords":["zoho","desk","sdk","api","helpdesk","typescript"],"license":"MIT","_id":"@banana.inc/zoho-desk-nodejs-sdk@1.1.0","maintainers":[{"name":"dragonxsx","email":"dragon.sunshine@gmail.com"}],"homepage":"https://github.com/dragonxsx/zoho-desk-nodejs-sdk#readme","bugs":{"url":"https://github.com/dragonxsx/zoho-desk-nodejs-sdk/issues"},"dist":{"shasum":"fd31843686f60f8c42c1b908b34f8670898fc68a","tarball":"https://registry.npmjs.org/@banana.inc/zoho-desk-nodejs-sdk/-/zoho-desk-nodejs-sdk-1.1.0.tgz","fileCount":3891,"integrity":"sha512-IHWphP8E1n6NZ2skJ38RbB67EQKyvyAl5H9jM/FvTlqlBPb3bScS2lOK00W1gGnS3iyZw3wFRdrdZghgAREqXA==","signatures":[{"sig":"MEUCIGdOawzPF6KZu799JGb4VuXXnv+I+64hvPWYxbGJLYUYAiEA4/dbDATc9xg4TOYxhxFmbGQVAQ0p1+hPNYhLfD9sUWo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@banana.inc%2fzoho-desk-nodejs-sdk@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":24350596},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"086abcc1ef03d5ca1ded08ebf49b556d87e237bd","scripts":{"lint":"tsc --noEmit","test":"vitest run","build":"tsc","generate":"bash scripts/pull-and-generate.sh","bundle-oas":"tsx scripts/bundle-oas.ts","test:watch":"vitest","prepublishOnly":"npm run build && npm test","generate-facade":"tsx scripts/generate-facade.ts"},"_npmUser":{"name":"dragonxsx","email":"dragon.sunshine@gmail.com"},"repository":{"url":"git+https://github.com/dragonxsx/zoho-desk-nodejs-sdk.git","type":"git"},"_npmVersion":"10.8.2","description":"Zoho Desk Node.js SDK with OAuth 2.0, multi-data-center support, and token persistence","directories":{},"_nodeVersion":"20.20.1","dependencies":{"undici":"^6.0.0","winston":"^3.11.0","@microsoft/kiota-abstractions":"^1.0.0-preview.100","@microsoft/kiota-http-fetchlibrary":"^1.0.0-preview.100","@microsoft/kiota-serialization-form":"^1.0.0-preview.100","@microsoft/kiota-serialization-json":"^1.0.0-preview.100","@microsoft/kiota-serialization-text":"^1.0.0-preview.100","@microsoft/kiota-serialization-multipart":"^1.0.0-preview.100"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.0.0","vitest":"^1.0.0","typescript":"^5.4.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/zoho-desk-nodejs-sdk_1.1.0_1773483406386_0.8837533646006857","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@banana.inc/zoho-desk-nodejs-sdk","version":"1.1.1","keywords":["zoho","desk","sdk","api","helpdesk","typescript"],"license":"MIT","_id":"@banana.inc/zoho-desk-nodejs-sdk@1.1.1","maintainers":[{"name":"dragonxsx","email":"dragon.sunshine@gmail.com"}],"homepage":"https://github.com/dragonxsx/zoho-desk-nodejs-sdk#readme","bugs":{"url":"https://github.com/dragonxsx/zoho-desk-nodejs-sdk/issues"},"dist":{"shasum":"a1fc0cdf0b0066b9c53f3e1b9ba00b1bfe20acef","tarball":"https://registry.npmjs.org/@banana.inc/zoho-desk-nodejs-sdk/-/zoho-desk-nodejs-sdk-1.1.1.tgz","fileCount":3906,"integrity":"sha512-l2iK26SNVZCvYiCZ5ci3wk66gttY4yg8Q05YKqvkZWFcsDdVdec2lJGn9tFVaExw3yYTJX3uIdr67cBrgQddIQ==","signatures":[{"sig":"MEUCIESvM+hhBe22n3tTKJkPqv3L9HBfRNOuEB9zey9nQEDXAiEAv0t1ubfnBaW952/V1Etkqe7pcgF3rDhz47c7wXaaBF0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@banana.inc%2fzoho-desk-nodejs-sdk@1.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":24382380},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"1e61a48bfb4216ae4892d753b4599ab56de97e9d","scripts":{"lint":"tsc --noEmit","test":"vitest run","build":"tsc","generate":"bash scripts/pull-and-generate.sh","bundle-oas":"tsx scripts/bundle-oas.ts","test:watch":"vitest","prepublishOnly":"npm run build && npm test","generate-facade":"tsx scripts/generate-facade.ts"},"_npmUser":{"name":"dragonxsx","email":"dragon.sunshine@gmail.com"},"repository":{"url":"git+https://github.com/dragonxsx/zoho-desk-nodejs-sdk.git","type":"git"},"_npmVersion":"10.8.2","description":"Zoho Desk Node.js SDK with OAuth 2.0, multi-data-center support, and token persistence","directories":{},"_nodeVersion":"20.20.1","dependencies":{"undici":"^6.0.0","winston":"^3.11.0","@microsoft/kiota-abstractions":"^1.0.0-preview.100","@microsoft/kiota-http-fetchlibrary":"^1.0.0-preview.100","@microsoft/kiota-serialization-form":"^1.0.0-preview.100","@microsoft/kiota-serialization-json":"^1.0.0-preview.100","@microsoft/kiota-serialization-text":"^1.0.0-preview.100","@microsoft/kiota-serialization-multipart":"^1.0.0-preview.100"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.0.0","vitest":"^1.0.0","typescript":"^5.4.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/zoho-desk-nodejs-sdk_1.1.1_1773572019054_0.9816554649070826","host":"s3://npm-registry-packages-npm-production"}},"1.1.2":{"name":"@banana.inc/zoho-desk-nodejs-sdk","version":"1.1.2","keywords":["zoho","desk","sdk","api","helpdesk","typescript"],"license":"MIT","_id":"@banana.inc/zoho-desk-nodejs-sdk@1.1.2","maintainers":[{"name":"dragonxsx","email":"dragon.sunshine@gmail.com"}],"homepage":"https://github.com/dragonxsx/zoho-desk-nodejs-sdk#readme","bugs":{"url":"https://github.com/dragonxsx/zoho-desk-nodejs-sdk/issues"},"dist":{"shasum":"c9c0c0ed015b058b0e2f51e9b635c2ddb92e1d9a","tarball":"https://registry.npmjs.org/@banana.inc/zoho-desk-nodejs-sdk/-/zoho-desk-nodejs-sdk-1.1.2.tgz","fileCount":3906,"integrity":"sha512-lHawIF+jVuqs3iSO98YdytObH5tNnGLcKPpfWGkxD6BezJlk1QYJNgquWoI30sY8XO/Jwcd4Qih/0l19AMfffw==","signatures":[{"sig":"MEQCIBN0261J3H9Hv9UwJ3oVuAUH/Tbkn0n1FGAIJmId/Ao4AiAJGJTuag+X6wtjhDeddjEaRWx6huMPbEzeHrpNFCJ1RA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@banana.inc%2fzoho-desk-nodejs-sdk@1.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":24382313},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"b259ac63b29b49ca934f9a2da962f8f7308c20be","scripts":{"lint":"tsc --noEmit","test":"vitest run","build":"tsc","generate":"bash scripts/pull-and-generate.sh","bundle-oas":"tsx scripts/bundle-oas.ts","test:watch":"vitest","prepublishOnly":"npm run build && npm test","generate-facade":"tsx scripts/generate-facade.ts"},"_npmUser":{"name":"dragonxsx","email":"dragon.sunshine@gmail.com"},"repository":{"url":"git+https://github.com/dragonxsx/zoho-desk-nodejs-sdk.git","type":"git"},"_npmVersion":"10.8.2","description":"Zoho Desk Node.js SDK with OAuth 2.0, multi-data-center support, and token persistence","directories":{},"_nodeVersion":"20.20.0","dependencies":{"undici":"^6.0.0","winston":"^3.11.0","@microsoft/kiota-abstractions":"^1.0.0-preview.100","@microsoft/kiota-http-fetchlibrary":"^1.0.0-preview.100","@microsoft/kiota-serialization-form":"^1.0.0-preview.100","@microsoft/kiota-serialization-json":"^1.0.0-preview.100","@microsoft/kiota-serialization-text":"^1.0.0-preview.100","@microsoft/kiota-serialization-multipart":"^1.0.0-preview.100"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.0.0","vitest":"^1.0.0","typescript":"^5.4.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/zoho-desk-nodejs-sdk_1.1.2_1773589102063_0.3717336961599762","host":"s3://npm-registry-packages-npm-production"}},"1.1.3":{"name":"@banana.inc/zoho-desk-nodejs-sdk","version":"1.1.3","description":"Zoho Desk Node.js SDK with OAuth 2.0, multi-data-center support, and token persistence","main":"./dist/index.js","types":"./dist/index.d.ts","type":"module","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"scripts":{"build":"tsc","test":"vitest run","test:watch":"vitest","generate":"bash scripts/pull-and-generate.sh","bundle-oas":"tsx scripts/bundle-oas.ts","generate-facade":"tsx scripts/generate-facade.ts","lint":"tsc --noEmit","prepublishOnly":"npm run build && npm test"},"engines":{"node":">=18.0.0"},"keywords":["zoho","desk","sdk","api","helpdesk","typescript"],"license":"MIT","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"repository":{"type":"git","url":"git+https://github.com/dragonxsx/zoho-desk-nodejs-sdk.git"},"homepage":"https://github.com/dragonxsx/zoho-desk-nodejs-sdk#readme","bugs":{"url":"https://github.com/dragonxsx/zoho-desk-nodejs-sdk/issues"},"dependencies":{"@microsoft/kiota-abstractions":"^1.0.0-preview.100","@microsoft/kiota-http-fetchlibrary":"^1.0.0-preview.100","@microsoft/kiota-serialization-json":"^1.0.0-preview.100","@microsoft/kiota-serialization-text":"^1.0.0-preview.100","@microsoft/kiota-serialization-form":"^1.0.0-preview.100","@microsoft/kiota-serialization-multipart":"^1.0.0-preview.100","winston":"^3.11.0","undici":"^6.0.0"},"devDependencies":{"typescript":"^5.4.0","@types/node":"^20.0.0","tsx":"^4.0.0","vitest":"^1.0.0"},"_id":"@banana.inc/zoho-desk-nodejs-sdk@1.1.3","gitHead":"a68f47bfd6aa7e064ca9297a9e20dec1c90da8ae","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-xWNSbyAT/mmS1iV5W0qZmA9jZZ5PqqszUfBjBFwmWR3tI5BAYyy89nP5wPD8g5oicx2EcxybK281rjZn32kj7g==","shasum":"6ea0bb8bd9a6ffaa374a9b7a4bf78f34dcc51207","tarball":"https://registry.npmjs.org/@banana.inc/zoho-desk-nodejs-sdk/-/zoho-desk-nodejs-sdk-1.1.3.tgz","fileCount":3906,"unpackedSize":24387386,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@banana.inc%2fzoho-desk-nodejs-sdk@1.1.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAVmEsk7YvnXx3utM6Lg3sLOJgxUasdFBoOVpgGHPd4dAiEAghUKHFMwNE7v4U69v408ImFSJ/hJASAoQd/E/y/SYec="}]},"_npmUser":{"name":"dragonxsx","email":"dragon.sunshine@gmail.com"},"directories":{},"maintainers":[{"name":"dragonxsx","email":"dragon.sunshine@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/zoho-desk-nodejs-sdk_1.1.3_1775655370664_0.34327159209863356"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-12T19:26:26.852Z","modified":"2026-04-08T13:36:11.356Z","0.1.0":"2026-03-12T19:26:27.348Z","1.0.0":"2026-03-13T00:02:54.644Z","1.1.0":"2026-03-14T10:16:46.618Z","1.1.1":"2026-03-15T10:53:39.260Z","1.1.2":"2026-03-15T15:38:22.334Z","1.1.3":"2026-04-08T13:36:11.068Z"},"bugs":{"url":"https://github.com/dragonxsx/zoho-desk-nodejs-sdk/issues"},"license":"MIT","homepage":"https://github.com/dragonxsx/zoho-desk-nodejs-sdk#readme","keywords":["zoho","desk","sdk","api","helpdesk","typescript"],"repository":{"type":"git","url":"git+https://github.com/dragonxsx/zoho-desk-nodejs-sdk.git"},"description":"Zoho Desk Node.js SDK with OAuth 2.0, multi-data-center support, and token persistence","maintainers":[{"name":"dragonxsx","email":"dragon.sunshine@gmail.com"}],"readme":"# @banana.inc/zoho-desk-nodejs-sdk\n\n[![npm version](https://img.shields.io/npm/v/@banana.inc/zoho-desk-nodejs-sdk)](https://www.npmjs.com/package/@banana.inc/zoho-desk-nodejs-sdk)\n[![Node.js](https://img.shields.io/badge/node-%3E%3D18-brightgreen)](https://nodejs.org)\n[![TypeScript](https://img.shields.io/badge/TypeScript-strict-blue)](https://www.typescriptlang.org)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\nA comprehensive, type-safe TypeScript SDK for the [Zoho Desk API](https://desk.zoho.com/DeskAPIDocument) with OAuth 2.0, multi-data-center support, and token persistence.\n\n## Philosophy\n\nThis SDK is built on four core principles:\n\n- **Spec-driven** — API clients are auto-generated from [Zoho's official OpenAPI specs](https://github.com/zoho/zohodesk-oas) using [Microsoft Kiota](https://learn.microsoft.com/en-us/openapi/kiota/overview). Every endpoint, model, and parameter stays in sync with the source of truth. No hand-written API wrappers to maintain or fall out of date.\n\n- **Type-safe by default** — Strict TypeScript throughout. Builder patterns for fluent, discoverable configuration. Full autocompletion and compile-time validation so issues surface in your editor, not at runtime.\n\n- **Batteries-included but extensible** — Ships with sensible defaults (file-based token store, configurable logging, proxy support) while keeping every component pluggable. Swap in your own token store, adjust SDK behavior, or route through a corporate proxy — all through clean interfaces.\n\n- **Modern ESM stack** — ESM-only with ES2022 target and NodeNext module resolution. No CommonJS baggage, no dual-package hazards. Designed for the Node.js ecosystem as it is today.\n\n## Features\n\n- **126 API modules** auto-generated from official Zoho Desk OpenAPI specs\n- **OAuth 2.0** with 7 grant types: refresh token, authorization code, client credentials, device code, implicit, direct access token, and stored token\n- **PKCE support** (RFC 7636) for secure public client flows\n- **Authorization URL builder** for constructing OAuth consent screens\n- **Device authorization flow** for headless/IoT devices\n- **Automatic token refresh** with 5-second expiry buffer\n- **7-region data center support** — US, EU, IN, AU, CA, CN, JP\n- **Pluggable token persistence** with built-in CSV file store\n- **Structured error handling** with `ZohoApiError` and `SDKException`\n- **Automatic retry** with configurable max retries and delay\n- **HTTP proxy support** via undici ProxyAgent\n- **Configurable logging** powered by Winston\n- **Lazy-loaded API clients** for minimal startup overhead\n- **TypeScript strict mode** with full declaration maps\n\n## Installation\n\n```bash\nnpm install @banana.inc/zoho-desk-nodejs-sdk\n```\n\nRequires **Node.js >= 18**. This package is ESM-only (`\"type\": \"module\"`).\n\n## Quick Start\n\n```typescript\nimport {\n  InitializeBuilder,\n  OAuthBuilder,\n  USDataCenter,\n  FileStore,\n  createDeskClient,\n} from \"@banana.inc/zoho-desk-nodejs-sdk\";\n\n// 1. Build the OAuth token\nconst token = new OAuthBuilder()\n  .clientId(\"your-client-id\")\n  .clientSecret(\"your-client-secret\")\n  .refreshToken(\"your-refresh-token\")\n  .build();\n\n// 2. Initialize the SDK\nawait new InitializeBuilder()\n  .environment(USDataCenter.PRODUCTION())\n  .token(token)\n  .store(new FileStore(\"./tokens.csv\"))\n  .initialize();\n\n// 3. Create the client and call APIs\nconst client = createDeskClient();\nconst tickets = await client.tickets.get();\n```\n\n## Authentication\n\nThe SDK supports seven OAuth grant types through `OAuthBuilder`:\n\n### Refresh Token\n\nFor server-side applications with long-lived access.\n\n```typescript\nconst token = new OAuthBuilder()\n  .clientId(\"your-client-id\")\n  .clientSecret(\"your-client-secret\")\n  .refreshToken(\"your-refresh-token\")\n  .build();\n```\n\n### Grant Token (Authorization Code)\n\nFor exchanging a one-time authorization code for tokens.\n\n```typescript\nconst token = new OAuthBuilder()\n  .clientId(\"your-client-id\")\n  .clientSecret(\"your-client-secret\")\n  .grantToken(\"your-grant-token\")\n  .redirectURL(\"https://your-app.com/callback\")\n  .build();\n```\n\n### Direct Access Token\n\nFor quick testing or short-lived scripts where you already have an access token.\n\n```typescript\nconst token = new OAuthBuilder()\n  .accessToken(\"your-access-token\")\n  .build();\n```\n\n### Client Credentials\n\nFor server-to-server applications without user context.\n\n```typescript\nconst token = new OAuthBuilder()\n  .clientId(\"your-client-id\")\n  .clientSecret(\"your-client-secret\")\n  .scope(\"Desk.tickets.ALL\")\n  .orgId(\"your-org-id\")\n  .clientCredentials()\n  .build();\n```\n\n### Stored Token by ID\n\nFor resuming a previously persisted token session.\n\n```typescript\nconst token = new OAuthBuilder()\n  .id(\"stored-token-id\")\n  .build();\n```\n\n### Authorization URL Builder\n\nBuild OAuth authorization URLs for redirecting users to the Zoho consent screen.\n\n```typescript\nimport { AuthorizationUrlBuilder, USDataCenter } from \"@banana.inc/zoho-desk-nodejs-sdk\";\n\nconst authUrl = new AuthorizationUrlBuilder()\n  .clientId(\"your-client-id\")\n  .scope(\"Desk.tickets.ALL\")\n  .redirectUri(\"https://your-app.com/callback\")\n  .responseType(\"code\")     // \"code\" (default) or \"token\" for implicit flow\n  .accessType(\"offline\")    // \"offline\" (default) or \"online\"\n  .state(\"csrf-token\")      // optional CSRF protection\n  .prompt(\"consent\")        // optional\n  .build(USDataCenter.PRODUCTION());\n```\n\n### PKCE (Proof Key for Code Exchange)\n\nSecure authorization code flows for public clients (RFC 7636).\n\n```typescript\nimport {\n  generatePKCEPair,\n  AuthorizationUrlBuilder,\n  OAuthBuilder,\n  USDataCenter,\n} from \"@banana.inc/zoho-desk-nodejs-sdk\";\n\n// Generate a PKCE pair\nconst pkce = await generatePKCEPair();\n\n// Include in authorization URL\nconst authUrl = new AuthorizationUrlBuilder()\n  .clientId(\"your-client-id\")\n  .scope(\"Desk.tickets.ALL\")\n  .redirectUri(\"https://your-app.com/callback\")\n  .pkce(pkce)\n  .build(USDataCenter.PRODUCTION());\n\n// Exchange the code with the verifier\nconst token = new OAuthBuilder()\n  .clientId(\"your-client-id\")\n  .clientSecret(\"your-client-secret\")\n  .grantToken(\"authorization-code-from-callback\")\n  .redirectURL(\"https://your-app.com/callback\")\n  .codeVerifier(pkce.codeVerifier)\n  .build();\n```\n\n### Device Authorization (Device Flow)\n\nFor devices without a browser (IoT, CLI tools, smart TVs).\n\n```typescript\nimport {\n  requestDeviceCode,\n  pollForDeviceToken,\n  USDataCenter,\n} from \"@banana.inc/zoho-desk-nodejs-sdk\";\n\n// Step 1: Request a device code\nconst deviceCode = await requestDeviceCode(\n  USDataCenter.PRODUCTION(),\n  \"your-client-id\",\n  \"Desk.tickets.ALL\",\n);\n\n// Step 2: Show the user where to authorize\nconsole.log(`Visit ${deviceCode.verification_url} and enter code: ${deviceCode.user_code}`);\n\n// Step 3: Poll until the user authorizes (supports cancellation)\nconst controller = new AbortController();\nconst token = await pollForDeviceToken(\n  USDataCenter.PRODUCTION(),\n  deviceCode,\n  {\n    clientId: \"your-client-id\",\n    clientSecret: \"your-client-secret\",\n    signal: controller.signal,\n    onPoll: (status) => console.log(`Status: ${status}`),\n  },\n);\n```\n\n### Implicit Flow\n\nParse tokens from URL fragments after an implicit OAuth redirect.\n\n```typescript\nimport { parseImplicitFragment } from \"@banana.inc/zoho-desk-nodejs-sdk\";\n\n// Build the authorization URL with responseType(\"token\") first,\n// then parse the redirect fragment:\nconst fragment = \"access_token=1000.abc...&expires_in=3600&token_type=Bearer\";\nconst token = parseImplicitFragment(fragment);\n```\n\n## Data Centers\n\nThe SDK supports all 7 Zoho Desk data center regions:\n\n| Region | Class | Production Environment |\n|--------|-------|----------------------|\n| US | `USDataCenter` | `USDataCenter.PRODUCTION()` |\n| EU | `EUDataCenter` | `EUDataCenter.PRODUCTION()` |\n| IN | `INDataCenter` | `INDataCenter.PRODUCTION()` |\n| AU | `AUDataCenter` | `AUDataCenter.PRODUCTION()` |\n| CA | `CADataCenter` | `CADataCenter.PRODUCTION()` |\n| CN | `CNDataCenter` | `CNDataCenter.PRODUCTION()` |\n| JP | `JPDataCenter` | `JPDataCenter.PRODUCTION()` |\n\n## Configuration\n\n### SDK Config\n\nCustomize SDK behavior with `SDKConfigBuilder`:\n\n```typescript\nimport { SDKConfigBuilder } from \"@banana.inc/zoho-desk-nodejs-sdk\";\n\nconst config = new SDKConfigBuilder()\n  .autoRefreshFields(true)\n  .pickListValidation(true)\n  .timeout(30000)    // request timeout in ms\n  .maxRetries(5)     // 0–10, default 3\n  .retryDelay(10)    // seconds, 0–180, default 3\n  .build();\n\nawait new InitializeBuilder()\n  .environment(USDataCenter.PRODUCTION())\n  .token(token)\n  .SDKConfig(config)\n  .initialize();\n```\n\n### Logging\n\nEnable Winston-based logging with `LogBuilder`:\n\n```typescript\nimport { LogBuilder, Levels } from \"@banana.inc/zoho-desk-nodejs-sdk\";\n\nconst logger = new LogBuilder()\n  .level(Levels.INFO)\n  .filePath(\"./sdk.log\")\n  .build();\n\nawait new InitializeBuilder()\n  .environment(USDataCenter.PRODUCTION())\n  .token(token)\n  .logger(logger)\n  .initialize();\n```\n\nAvailable levels: `INFO`, `DEBUG`, `WARN`, `VERBOSE`, `ERROR`, `SILLY`, `OFF`\n\n### HTTP Proxy\n\nRoute requests through a proxy with `ProxyBuilder`:\n\n```typescript\nimport { ProxyBuilder } from \"@banana.inc/zoho-desk-nodejs-sdk\";\n\nconst proxy = new ProxyBuilder()\n  .host(\"proxy.example.com\")\n  .port(8080)\n  .user(\"proxy-user\")       // optional\n  .password(\"proxy-pass\")   // optional\n  .build();\n\nawait new InitializeBuilder()\n  .environment(USDataCenter.PRODUCTION())\n  .token(token)\n  .requestProxy(proxy)\n  .initialize();\n```\n\n### Token Persistence\n\nThe SDK persists tokens via the `TokenStore` interface. The built-in `FileStore` saves tokens to a CSV file:\n\n```typescript\nimport { FileStore } from \"@banana.inc/zoho-desk-nodejs-sdk\";\n\nconst store = new FileStore(\"./zoho_desk_tokens.csv\");\n```\n\nTo implement a custom store (e.g., database-backed), implement the `TokenStore` interface:\n\n```typescript\nimport type { TokenStore, Token } from \"@banana.inc/zoho-desk-nodejs-sdk\";\n\nclass DatabaseStore implements TokenStore {\n  async findToken(token: Token): Promise<Token | null> { /* ... */ }\n  async findTokenById(id: string): Promise<Token | null> { /* ... */ }\n  async saveToken(token: Token): Promise<void> { /* ... */ }\n  async deleteToken(id: string): Promise<void> { /* ... */ }\n  async getTokens(): Promise<Token[]> { /* ... */ }\n  async deleteTokens(): Promise<void> { /* ... */ }\n}\n```\n\n## Error Handling\n\nThe SDK provides two structured error types:\n\n### ZohoApiError\n\nThrown when the Zoho Desk API returns a non-2xx response. Contains the HTTP status, Zoho error code, response body, and request URL.\n\n```typescript\nimport { ZohoApiError } from \"@banana.inc/zoho-desk-nodejs-sdk\";\n\ntry {\n  const tickets = await client.tickets.get();\n} catch (err) {\n  if (err instanceof ZohoApiError) {\n    console.log(err.responseStatusCode); // e.g. 403\n    console.log(err.errorCode);          // e.g. \"INVALID_OAUTH\"\n    console.log(err.message);            // Human-readable message\n    console.log(err.requestUrl);         // The URL that was called\n    console.log(err.responseBody);       // Full parsed JSON body\n  }\n}\n```\n\n### SDKException\n\nThrown for SDK-level errors (invalid configuration, missing parameters, etc.).\n\n```typescript\nimport { SDKException } from \"@banana.inc/zoho-desk-nodejs-sdk\";\n\ntry {\n  await new InitializeBuilder().initialize();\n} catch (err) {\n  if (err instanceof SDKException) {\n    console.log(err.code);    // e.g. \"MANDATORY_VALUE_ERROR\"\n    console.log(err.message);\n    console.log(err.details); // Optional structured details\n    console.log(err.cause);   // Optional root cause Error\n  }\n}\n```\n\n## Code Generation Pipeline\n\nThe SDK's 126 API modules are generated from Zoho's official OpenAPI specifications through a four-stage pipeline:\n\n```\nPull OAS specs ──> Bundle per module ──> Kiota generate ──> Generate facade\n```\n\n1. **Pull** — Clones the latest OpenAPI specs from [`zoho/zohodesk-oas`](https://github.com/zoho/zohodesk-oas)\n2. **Bundle** — Creates self-contained spec bundles per API module with a manifest\n3. **Generate** — Runs Microsoft Kiota (via Docker) to produce TypeScript clients for each module\n4. **Facade** — Scans all generated clients and produces a unified `ZohoDeskClient` with lazy-loaded getters\n\nTo regenerate:\n\n```bash\nnpm run generate\n```\n\n> **Note:** Files under `src/generated/` and `src/client/zoho-desk-client.ts` are auto-generated. Do not edit them by hand.\n\n## License\n\n[MIT](LICENSE)\n","readmeFilename":"README.md"}