@wanasapps/zcrm-core
v0.1.0
Published
Reusable Zoho CRM V8 core services — OAuth2 auth, metadata extraction, standalone-function operations, and Deluge formatting/signature parsing — shared by Wanas Apps' Zoho CRM tooling (CLI + VS Code extension).
Readme
@wanasapps/zcrm-core
Reusable Zoho CRM V8 core services, shared by Wanas Apps'
Zoho tooling — the wanas-zcrm-extractor CLI and the Zoho CRM IDE Extension for VS Code.
It bundles the host-agnostic pieces:
authService— OAuth2 authorization-code + refresh flow with dependency-injection seams (configure({ credentials, store, logger, http }), asynchydrate(), a single-flight refresh mutex, and token revocation). No host assumptions.apiClient— Zoho V8 REST client with a global concurrency gate, automatic token refresh + rate-limit retries on reads, and a no-retry path (postNoRetry) for executing/mutating endpoints (so a function can't double-execute).crmMetadataService— the full org metadata extraction engine (extract(onProgress, outputDir, options)), writing the.zcrm/.store+crm/tree to an absoluteoutputDir.functionService— single standalone-function operations:getRemoteCode(read-only),pullOne,pushCode,createFunction,runTest/executeTest.delugeFormatter/delugeSignature— Deluge code formatting and signature parsing.
Install
npm install @wanasapps/zcrm-coreUsage
const { authService, crmMetadataService } = require('@wanasapps/zcrm-core');
// or import a specific module by subpath:
const apiClient = require('@wanasapps/zcrm-core/src/utils/apiClient');Inject your host's storage/credentials/logger before authenticating:
authService.configure({ credentials, store, logger });
await authService.hydrate();
await crmMetadataService.extract(onProgress, '/abs/path/to/workspace', { concurrency: 5 });