@dereekb/zoho 13.0.6 → 13.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +2164 -231
- package/index.esm.js +2143 -232
- package/nestjs/LICENSE +21 -0
- package/nestjs/README.md +11 -0
- package/nestjs/docs/configuration.md +165 -0
- package/nestjs/docs/crm-getting-started.md +296 -0
- package/nestjs/index.cjs.js +653 -5
- package/nestjs/index.esm.js +647 -7
- package/nestjs/package.json +3 -3
- package/nestjs/src/lib/crm/crm.api.d.ts +46 -0
- package/nestjs/src/lib/crm/crm.config.d.ts +16 -1
- package/nestjs/src/lib/crm/crm.module.d.ts +77 -8
- package/nestjs/src/lib/index.d.ts +2 -0
- package/nestjs/src/lib/recruit/recruit.api.d.ts +50 -0
- package/nestjs/src/lib/recruit/recruit.config.d.ts +16 -1
- package/nestjs/src/lib/recruit/recruit.module.d.ts +77 -8
- package/nestjs/src/lib/sign/index.d.ts +3 -0
- package/nestjs/src/lib/sign/sign.api.d.ts +54 -0
- package/nestjs/src/lib/sign/sign.config.d.ts +10 -0
- package/nestjs/src/lib/sign/sign.module.d.ts +94 -0
- package/package.json +2 -2
- package/src/lib/accounts/accounts.api.d.ts +149 -3
- package/src/lib/accounts/accounts.factory.d.ts +73 -6
- package/src/lib/crm/crm.api.d.ts +599 -62
- package/src/lib/crm/crm.api.notes.d.ts +46 -3
- package/src/lib/crm/crm.api.tags.d.ts +65 -2
- package/src/lib/crm/crm.config.d.ts +30 -0
- package/src/lib/crm/crm.criteria.d.ts +60 -3
- package/src/lib/crm/crm.error.api.d.ts +42 -0
- package/src/lib/crm/crm.factory.d.ts +39 -3
- package/src/lib/crm/crm.notes.d.ts +36 -0
- package/src/lib/crm/crm.tags.d.ts +3 -0
- package/src/lib/index.d.ts +1 -0
- package/src/lib/recruit/recruit.api.candidates.d.ts +44 -3
- package/src/lib/recruit/recruit.api.d.ts +719 -57
- package/src/lib/recruit/recruit.api.notes.d.ts +140 -0
- package/src/lib/recruit/recruit.api.tags.d.ts +122 -14
- package/src/lib/recruit/recruit.config.d.ts +30 -0
- package/src/lib/recruit/recruit.criteria.d.ts +55 -3
- package/src/lib/recruit/recruit.error.api.d.ts +39 -0
- package/src/lib/recruit/recruit.factory.d.ts +39 -3
- package/src/lib/recruit/recruit.notes.d.ts +21 -0
- package/src/lib/recruit/recruit.tags.d.ts +3 -0
- package/src/lib/shared/criteria.d.ts +95 -11
- package/src/lib/shared/criteria.util.d.ts +19 -4
- package/src/lib/sign/index.d.ts +6 -0
- package/src/lib/sign/sign.api.d.ts +397 -0
- package/src/lib/sign/sign.api.page.d.ts +109 -0
- package/src/lib/sign/sign.config.d.ts +24 -0
- package/src/lib/sign/sign.d.ts +225 -0
- package/src/lib/sign/sign.error.api.d.ts +7 -0
- package/src/lib/sign/sign.factory.d.ts +58 -0
- package/src/lib/zoho.api.page.d.ts +41 -10
- package/src/lib/zoho.config.d.ts +24 -9
- package/src/lib/zoho.limit.d.ts +41 -9
- package/src/lib/zoho.type.d.ts +24 -8
package/nestjs/index.cjs.js
CHANGED
|
@@ -416,26 +416,349 @@ exports.ZohoAccountsApi = __decorate([
|
|
|
416
416
|
], exports.ZohoAccountsApi);
|
|
417
417
|
|
|
418
418
|
/**
|
|
419
|
-
*
|
|
419
|
+
* Abstract configuration class for the NestJS Zoho CRM service.
|
|
420
|
+
*
|
|
421
|
+
* Used as a DI token so that applications can provide their own config values
|
|
422
|
+
* while keeping the expected shape consistent.
|
|
423
|
+
*/
|
|
424
|
+
class ZohoCrmServiceConfig {
|
|
425
|
+
/**
|
|
426
|
+
* Zoho CRM API connection settings (endpoint URL, etc.).
|
|
427
|
+
*/
|
|
428
|
+
zohoCrm;
|
|
429
|
+
/**
|
|
430
|
+
* Optional factory-level overrides applied when creating the underlying CRM client.
|
|
431
|
+
*/
|
|
432
|
+
factoryConfig;
|
|
433
|
+
/**
|
|
434
|
+
* Validates that the required Zoho CRM connection fields are present and well-formed.
|
|
435
|
+
*/
|
|
436
|
+
static assertValidConfig(config) {
|
|
437
|
+
assertValidZohoConfig(config.zohoCrm);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* NestJS injectable service that wraps the Zoho CRM API.
|
|
443
|
+
*
|
|
444
|
+
* Provides convenient accessor getters for all CRM operations, each bound
|
|
445
|
+
* to the authenticated CRM context created during construction.
|
|
446
|
+
*/
|
|
447
|
+
exports.ZohoCrmApi = class ZohoCrmApi {
|
|
448
|
+
config;
|
|
449
|
+
zohoAccountsApi;
|
|
450
|
+
/**
|
|
451
|
+
* Underlying Zoho CRM client instance, initialized from the injected config and accounts context.
|
|
452
|
+
*/
|
|
453
|
+
zohoCrm;
|
|
454
|
+
/**
|
|
455
|
+
* The authenticated CRM context used by all operation accessors.
|
|
456
|
+
*/
|
|
457
|
+
get crmContext() {
|
|
458
|
+
return this.zohoCrm.crmContext;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Rate limiter shared across all CRM requests to respect Zoho API quotas.
|
|
462
|
+
*/
|
|
463
|
+
get zohoRateLimiter() {
|
|
464
|
+
return this.zohoCrm.crmContext.zohoRateLimiter;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Initializes the CRM client by combining the service config with the
|
|
468
|
+
* accounts context for OAuth token management.
|
|
469
|
+
*/
|
|
470
|
+
constructor(config, zohoAccountsApi) {
|
|
471
|
+
this.config = config;
|
|
472
|
+
this.zohoAccountsApi = zohoAccountsApi;
|
|
473
|
+
this.zohoCrm = zoho.zohoCrmFactory({
|
|
474
|
+
...config.factoryConfig,
|
|
475
|
+
accountsContext: zohoAccountsApi.accountsContext
|
|
476
|
+
})(config.zohoCrm);
|
|
477
|
+
}
|
|
478
|
+
// MARK: Accessors
|
|
479
|
+
/** Configured pass-through for {@link zohoCrmInsertRecord}. */
|
|
480
|
+
get insertRecord() {
|
|
481
|
+
return zoho.zohoCrmInsertRecord(this.crmContext);
|
|
482
|
+
}
|
|
483
|
+
/** Configured pass-through for {@link zohoCrmUpsertRecord}. */
|
|
484
|
+
get upsertRecord() {
|
|
485
|
+
return zoho.zohoCrmUpsertRecord(this.crmContext);
|
|
486
|
+
}
|
|
487
|
+
/** Configured pass-through for {@link zohoCrmUpdateRecord}. */
|
|
488
|
+
get updateRecord() {
|
|
489
|
+
return zoho.zohoCrmUpdateRecord(this.crmContext);
|
|
490
|
+
}
|
|
491
|
+
/** Configured pass-through for {@link zohoCrmDeleteRecord}. */
|
|
492
|
+
get deleteRecord() {
|
|
493
|
+
return zoho.zohoCrmDeleteRecord(this.crmContext);
|
|
494
|
+
}
|
|
495
|
+
/** Configured pass-through for {@link zohoCrmGetRecordById}. */
|
|
496
|
+
get getRecordById() {
|
|
497
|
+
return zoho.zohoCrmGetRecordById(this.crmContext);
|
|
498
|
+
}
|
|
499
|
+
/** Configured pass-through for {@link zohoCrmGetRecords}. */
|
|
500
|
+
get getRecords() {
|
|
501
|
+
return zoho.zohoCrmGetRecords(this.crmContext);
|
|
502
|
+
}
|
|
503
|
+
/** Configured pass-through for {@link zohoCrmSearchRecords}. */
|
|
504
|
+
get searchRecords() {
|
|
505
|
+
return zoho.zohoCrmSearchRecords(this.crmContext);
|
|
506
|
+
}
|
|
507
|
+
/** Configured pass-through for {@link zohoCrmSearchRecordsPageFactory}. */
|
|
508
|
+
get searchRecordsPageFactory() {
|
|
509
|
+
return zoho.zohoCrmSearchRecordsPageFactory(this.crmContext);
|
|
510
|
+
}
|
|
511
|
+
/** Configured pass-through for {@link zohoCrmGetRelatedRecordsFunctionFactory}. */
|
|
512
|
+
get getRelatedRecordsFunctionFactory() {
|
|
513
|
+
return zoho.zohoCrmGetRelatedRecordsFunctionFactory(this.crmContext);
|
|
514
|
+
}
|
|
515
|
+
/** Configured pass-through for {@link zohoCrmGetEmailsForRecord}. */
|
|
516
|
+
get getEmailsForRecord() {
|
|
517
|
+
return zoho.zohoCrmGetEmailsForRecord(this.crmContext);
|
|
518
|
+
}
|
|
519
|
+
/** Configured pass-through for {@link zohoCrmGetEmailsForRecordPageFactory}. */
|
|
520
|
+
get getEmailsForRecordPageFactory() {
|
|
521
|
+
return zoho.zohoCrmGetEmailsForRecordPageFactory(this.crmContext);
|
|
522
|
+
}
|
|
523
|
+
/** Configured pass-through for {@link zohoCrmGetAttachmentsForRecord}. */
|
|
524
|
+
get getAttachmentsForRecord() {
|
|
525
|
+
return zoho.zohoCrmGetAttachmentsForRecord(this.crmContext);
|
|
526
|
+
}
|
|
527
|
+
/** Configured pass-through for {@link zohoCrmGetAttachmentsForRecordPageFactory}. */
|
|
528
|
+
get getAttachmentsForRecordPageFactory() {
|
|
529
|
+
return zoho.zohoCrmGetAttachmentsForRecordPageFactory(this.crmContext);
|
|
530
|
+
}
|
|
531
|
+
/** Configured pass-through for {@link zohoCrmUploadAttachmentForRecord}. */
|
|
532
|
+
get uploadAttachmentForRecord() {
|
|
533
|
+
return zoho.zohoCrmUploadAttachmentForRecord(this.crmContext);
|
|
534
|
+
}
|
|
535
|
+
/** Configured pass-through for {@link zohoCrmDownloadAttachmentForRecord}. */
|
|
536
|
+
get downloadAttachmentForRecord() {
|
|
537
|
+
return zoho.zohoCrmDownloadAttachmentForRecord(this.crmContext);
|
|
538
|
+
}
|
|
539
|
+
/** Configured pass-through for {@link zohoCrmDeleteAttachmentFromRecord}. */
|
|
540
|
+
get deleteAttachmentFromRecord() {
|
|
541
|
+
return zoho.zohoCrmDeleteAttachmentFromRecord(this.crmContext);
|
|
542
|
+
}
|
|
543
|
+
/** Configured pass-through for {@link zohoCrmCreateNotes}. */
|
|
544
|
+
get createNotes() {
|
|
545
|
+
return zoho.zohoCrmCreateNotes(this.crmContext);
|
|
546
|
+
}
|
|
547
|
+
/** Configured pass-through for {@link zohoCrmDeleteNotes}. */
|
|
548
|
+
get deleteNotes() {
|
|
549
|
+
return zoho.zohoCrmDeleteNotes(this.crmContext);
|
|
550
|
+
}
|
|
551
|
+
/** Configured pass-through for {@link zohoCrmCreateNotesForRecord}. */
|
|
552
|
+
get createNotesForRecord() {
|
|
553
|
+
return zoho.zohoCrmCreateNotesForRecord(this.crmContext);
|
|
554
|
+
}
|
|
555
|
+
/** Configured pass-through for {@link zohoCrmGetNotesForRecord}. */
|
|
556
|
+
get getNotesForRecord() {
|
|
557
|
+
return zoho.zohoCrmGetNotesForRecord(this.crmContext);
|
|
558
|
+
}
|
|
559
|
+
/** Configured pass-through for {@link zohoCrmGetNotesForRecordPageFactory}. */
|
|
560
|
+
get getNotesForRecordPageFactory() {
|
|
561
|
+
return zoho.zohoCrmGetNotesForRecordPageFactory(this.crmContext);
|
|
562
|
+
}
|
|
563
|
+
/** Configured pass-through for {@link zohoCrmExecuteRestApiFunction}. */
|
|
564
|
+
get executeRestApiFunction() {
|
|
565
|
+
return zoho.zohoCrmExecuteRestApiFunction(this.crmContext);
|
|
566
|
+
}
|
|
567
|
+
/** Configured pass-through for {@link zohoCrmCreateTagsForModule}. */
|
|
568
|
+
get createTagsForModule() {
|
|
569
|
+
return zoho.zohoCrmCreateTagsForModule(this.crmContext);
|
|
570
|
+
}
|
|
571
|
+
/** Configured pass-through for {@link zohoCrmDeleteTag}. */
|
|
572
|
+
get deleteTag() {
|
|
573
|
+
return zoho.zohoCrmDeleteTag(this.crmContext);
|
|
574
|
+
}
|
|
575
|
+
/** Configured pass-through for {@link zohoCrmGetTagsForModule}. */
|
|
576
|
+
get getTagsForModule() {
|
|
577
|
+
return zoho.zohoCrmGetTagsForModule(this.crmContext);
|
|
578
|
+
}
|
|
579
|
+
/** Configured pass-through for {@link zohoCrmAddTagsToRecords}. */
|
|
580
|
+
get addTagsToRecords() {
|
|
581
|
+
return zoho.zohoCrmAddTagsToRecords(this.crmContext);
|
|
582
|
+
}
|
|
583
|
+
/** Configured pass-through for {@link zohoCrmRemoveTagsFromRecords}. */
|
|
584
|
+
get removeTagsFromRecords() {
|
|
585
|
+
return zoho.zohoCrmRemoveTagsFromRecords(this.crmContext);
|
|
586
|
+
}
|
|
587
|
+
};
|
|
588
|
+
exports.ZohoCrmApi = __decorate([
|
|
589
|
+
common.Injectable(),
|
|
590
|
+
__param(0, common.Inject(ZohoCrmServiceConfig)),
|
|
591
|
+
__param(1, common.Inject(exports.ZohoAccountsApi)),
|
|
592
|
+
__metadata("design:paramtypes", [ZohoCrmServiceConfig,
|
|
593
|
+
exports.ZohoAccountsApi])
|
|
594
|
+
], exports.ZohoCrmApi);
|
|
595
|
+
|
|
596
|
+
// MARK: Provider Factories
|
|
597
|
+
/**
|
|
598
|
+
* Reads Zoho CRM connection settings from the NestJS ConfigService
|
|
599
|
+
* and returns a validated service config.
|
|
600
|
+
*
|
|
601
|
+
* Resolves the API URL via environment variables following the naming convention
|
|
602
|
+
* `ZOHO_CRM_API_URL` (service-specific) or `ZOHO_API_URL` (shared fallback).
|
|
603
|
+
*
|
|
604
|
+
* @param configService - NestJS config service populated with Zoho environment variables
|
|
605
|
+
* @returns Validated Zoho CRM service configuration
|
|
606
|
+
* @throws {Error} If required config values (e.g. API URL) are missing
|
|
607
|
+
*
|
|
608
|
+
* @example
|
|
609
|
+
* ```typescript
|
|
610
|
+
* {
|
|
611
|
+
* provide: ZohoCrmServiceConfig,
|
|
612
|
+
* inject: [ConfigService],
|
|
613
|
+
* useFactory: zohoCrmServiceConfigFactory
|
|
614
|
+
* }
|
|
615
|
+
* ```
|
|
616
|
+
*/
|
|
617
|
+
function zohoCrmServiceConfigFactory(configService) {
|
|
618
|
+
const getFromConfigService = zohoConfigServiceReaderFunction(zoho.ZOHO_CRM_SERVICE_NAME, configService);
|
|
619
|
+
const config = {
|
|
620
|
+
zohoCrm: {
|
|
621
|
+
apiUrl: getFromConfigService(ZOHO_API_URL_CONFIG_KEY)
|
|
622
|
+
}
|
|
623
|
+
};
|
|
624
|
+
ZohoCrmServiceConfig.assertValidConfig(config);
|
|
625
|
+
return config;
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* Reads Zoho Accounts (OAuth) settings scoped to the CRM service from
|
|
629
|
+
* the NestJS ConfigService and returns an accounts service config.
|
|
630
|
+
*
|
|
631
|
+
* @param configService - NestJS config service populated with Zoho OAuth environment variables
|
|
632
|
+
* @returns Zoho Accounts service config scoped to the CRM service access token
|
|
633
|
+
*
|
|
634
|
+
* @example
|
|
635
|
+
* ```typescript
|
|
636
|
+
* {
|
|
637
|
+
* provide: ZohoAccountsServiceConfig,
|
|
638
|
+
* inject: [ConfigService],
|
|
639
|
+
* useFactory: zohoCrmAccountServiceConfigFactory
|
|
640
|
+
* }
|
|
641
|
+
* ```
|
|
642
|
+
*/
|
|
643
|
+
function zohoCrmAccountServiceConfigFactory(configService) {
|
|
644
|
+
return zohoAccountsServiceConfigFromConfigService({
|
|
645
|
+
configService,
|
|
646
|
+
serviceAccessTokenKey: zoho.ZOHO_CRM_SERVICE_NAME
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* Generates NestJS {@link ModuleMetadata} that wires up the full Zoho CRM stack
|
|
651
|
+
* (config, accounts, and API service) so consuming modules only need a single import.
|
|
652
|
+
*
|
|
653
|
+
* The generated module requires the following dependencies in order to initialize properly:
|
|
654
|
+
* - {@link ZohoAccountsAccessTokenCacheService}
|
|
655
|
+
*
|
|
656
|
+
* Use the `dependencyModule` config option to import a module that exports those dependencies.
|
|
657
|
+
*
|
|
658
|
+
* The returned metadata registers {@link ZohoCrmServiceConfig}, {@link ZohoCrmApi},
|
|
659
|
+
* {@link ZohoAccountsServiceConfig}, and {@link ZohoAccountsApi} as providers, and
|
|
660
|
+
* exports {@link ZohoCrmApi} by default. Additional imports, exports, and providers
|
|
661
|
+
* from the config are merged in.
|
|
662
|
+
*
|
|
663
|
+
* @param config - Module configuration with optional dependency module and extra metadata
|
|
664
|
+
* @returns Complete NestJS module metadata ready to pass to `@Module()`
|
|
665
|
+
*
|
|
666
|
+
* @example
|
|
667
|
+
* ```typescript
|
|
668
|
+
* const cacheService = fileZohoAccountsAccessTokenCacheService();
|
|
669
|
+
*
|
|
670
|
+
* @Module({
|
|
671
|
+
* providers: [
|
|
672
|
+
* {
|
|
673
|
+
* provide: ZohoAccountsAccessTokenCacheService,
|
|
674
|
+
* useValue: cacheService
|
|
675
|
+
* }
|
|
676
|
+
* ],
|
|
677
|
+
* exports: [ZohoAccountsAccessTokenCacheService]
|
|
678
|
+
* })
|
|
679
|
+
* export class ZohoCrmDependencyModule {}
|
|
680
|
+
*
|
|
681
|
+
* @Module(appZohoCrmModuleMetadata({ dependencyModule: ZohoCrmDependencyModule }))
|
|
682
|
+
* export class AppZohoCrmModule {}
|
|
683
|
+
* ```
|
|
684
|
+
*/
|
|
685
|
+
function appZohoCrmModuleMetadata(config$1) {
|
|
686
|
+
const { dependencyModule, imports, exports: exports$1, providers } = config$1;
|
|
687
|
+
const dependencyModuleImport = dependencyModule ? [dependencyModule] : [];
|
|
688
|
+
return {
|
|
689
|
+
imports: [config.ConfigModule, ...dependencyModuleImport, ...(imports ?? [])],
|
|
690
|
+
exports: [exports.ZohoCrmApi, ...(exports$1 ?? [])],
|
|
691
|
+
providers: [
|
|
692
|
+
{
|
|
693
|
+
provide: ZohoCrmServiceConfig,
|
|
694
|
+
inject: [config.ConfigService],
|
|
695
|
+
useFactory: zohoCrmServiceConfigFactory
|
|
696
|
+
},
|
|
697
|
+
exports.ZohoCrmApi,
|
|
698
|
+
// Accounts
|
|
699
|
+
{
|
|
700
|
+
provide: ZohoAccountsServiceConfig,
|
|
701
|
+
inject: [config.ConfigService],
|
|
702
|
+
useFactory: zohoCrmAccountServiceConfigFactory
|
|
703
|
+
},
|
|
704
|
+
exports.ZohoAccountsApi,
|
|
705
|
+
...(providers ?? [])
|
|
706
|
+
]
|
|
707
|
+
};
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* Abstract configuration class for the NestJS Zoho Recruit service.
|
|
712
|
+
*
|
|
713
|
+
* Used as a DI token so that applications can provide their own config values
|
|
714
|
+
* while keeping the expected shape consistent.
|
|
420
715
|
*/
|
|
421
716
|
class ZohoRecruitServiceConfig {
|
|
717
|
+
/**
|
|
718
|
+
* Zoho Recruit API connection settings (endpoint URL, etc.).
|
|
719
|
+
*/
|
|
422
720
|
zohoRecruit;
|
|
721
|
+
/**
|
|
722
|
+
* Optional factory-level overrides applied when creating the underlying Recruit client.
|
|
723
|
+
*/
|
|
423
724
|
factoryConfig;
|
|
725
|
+
/**
|
|
726
|
+
* Validates that the required Zoho Recruit connection fields are present and well-formed.
|
|
727
|
+
*/
|
|
424
728
|
static assertValidConfig(config) {
|
|
425
729
|
assertValidZohoConfig(config.zohoRecruit);
|
|
426
730
|
}
|
|
427
731
|
}
|
|
428
732
|
|
|
733
|
+
/**
|
|
734
|
+
* NestJS injectable service that wraps the Zoho Recruit API.
|
|
735
|
+
*
|
|
736
|
+
* Provides convenient accessor getters for all Recruit operations, each bound
|
|
737
|
+
* to the authenticated Recruit context created during construction.
|
|
738
|
+
*/
|
|
429
739
|
exports.ZohoRecruitApi = class ZohoRecruitApi {
|
|
430
740
|
config;
|
|
431
741
|
zohoAccountsApi;
|
|
742
|
+
/**
|
|
743
|
+
* Underlying Zoho Recruit client instance, initialized from the injected config and accounts context.
|
|
744
|
+
*/
|
|
432
745
|
zohoRecruit;
|
|
746
|
+
/**
|
|
747
|
+
* The authenticated Recruit context used by all operation accessors.
|
|
748
|
+
*/
|
|
433
749
|
get recruitContext() {
|
|
434
750
|
return this.zohoRecruit.recruitContext;
|
|
435
751
|
}
|
|
752
|
+
/**
|
|
753
|
+
* Rate limiter shared across all Recruit requests to respect Zoho API quotas.
|
|
754
|
+
*/
|
|
436
755
|
get zohoRateLimiter() {
|
|
437
756
|
return this.zohoRecruit.recruitContext.zohoRateLimiter;
|
|
438
757
|
}
|
|
758
|
+
/**
|
|
759
|
+
* Initializes the Recruit client by combining the service config with the
|
|
760
|
+
* accounts context for OAuth token management.
|
|
761
|
+
*/
|
|
439
762
|
constructor(config, zohoAccountsApi) {
|
|
440
763
|
this.config = config;
|
|
441
764
|
this.zohoAccountsApi = zohoAccountsApi;
|
|
@@ -445,96 +768,127 @@ exports.ZohoRecruitApi = class ZohoRecruitApi {
|
|
|
445
768
|
})(config.zohoRecruit);
|
|
446
769
|
}
|
|
447
770
|
// MARK: Accessors
|
|
771
|
+
/** Configured pass-through for {@link zohoRecruitInsertRecord}. */
|
|
448
772
|
get insertRecord() {
|
|
449
773
|
return zoho.zohoRecruitInsertRecord(this.recruitContext);
|
|
450
774
|
}
|
|
775
|
+
/** Configured pass-through for {@link zohoRecruitUpsertRecord}. */
|
|
451
776
|
get upsertRecord() {
|
|
452
777
|
return zoho.zohoRecruitUpsertRecord(this.recruitContext);
|
|
453
778
|
}
|
|
779
|
+
/** Configured pass-through for {@link zohoRecruitUpdateRecord}. */
|
|
454
780
|
get updateRecord() {
|
|
455
781
|
return zoho.zohoRecruitUpdateRecord(this.recruitContext);
|
|
456
782
|
}
|
|
783
|
+
/** Configured pass-through for {@link zohoRecruitDeleteRecord}. */
|
|
457
784
|
get deleteRecord() {
|
|
458
785
|
return zoho.zohoRecruitDeleteRecord(this.recruitContext);
|
|
459
786
|
}
|
|
787
|
+
/** Configured pass-through for {@link zohoRecruitGetRecordById}. */
|
|
460
788
|
get getRecordById() {
|
|
461
789
|
return zoho.zohoRecruitGetRecordById(this.recruitContext);
|
|
462
790
|
}
|
|
791
|
+
/** Configured pass-through for {@link zohoRecruitGetRecords}. */
|
|
463
792
|
get getRecords() {
|
|
464
793
|
return zoho.zohoRecruitGetRecords(this.recruitContext);
|
|
465
794
|
}
|
|
795
|
+
/** Configured pass-through for {@link zohoRecruitSearchRecords}. */
|
|
466
796
|
get searchRecords() {
|
|
467
797
|
return zoho.zohoRecruitSearchRecords(this.recruitContext);
|
|
468
798
|
}
|
|
799
|
+
/** Configured pass-through for {@link zohoRecruitSearchRecordsPageFactory}. */
|
|
469
800
|
get searchRecordsPageFactory() {
|
|
470
801
|
return zoho.zohoRecruitSearchRecordsPageFactory(this.recruitContext);
|
|
471
802
|
}
|
|
803
|
+
/** Configured pass-through for {@link zohoRecruitGetRelatedRecordsFunctionFactory}. */
|
|
472
804
|
get getRelatedRecordsFunctionFactory() {
|
|
473
805
|
return zoho.zohoRecruitGetRelatedRecordsFunctionFactory(this.recruitContext);
|
|
474
806
|
}
|
|
807
|
+
/** Configured pass-through for {@link zohoRecruitGetEmailsForRecord}. */
|
|
475
808
|
get getEmailsForRecord() {
|
|
476
809
|
return zoho.zohoRecruitGetEmailsForRecord(this.recruitContext);
|
|
477
810
|
}
|
|
811
|
+
/** Configured pass-through for {@link zohoRecruitGetEmailsForRecordPageFactory}. */
|
|
478
812
|
get getEmailsForRecordPageFactory() {
|
|
479
813
|
return zoho.zohoRecruitGetEmailsForRecordPageFactory(this.recruitContext);
|
|
480
814
|
}
|
|
815
|
+
/** Configured pass-through for {@link zohoRecruitGetAttachmentsForRecord}. */
|
|
481
816
|
get getAttachmentsForRecord() {
|
|
482
817
|
return zoho.zohoRecruitGetAttachmentsForRecord(this.recruitContext);
|
|
483
818
|
}
|
|
819
|
+
/** Configured pass-through for {@link zohoRecruitGetAttachmentsForRecordPageFactory}. */
|
|
484
820
|
get getAttachmentsForRecordPageFactory() {
|
|
485
821
|
return zoho.zohoRecruitGetAttachmentsForRecordPageFactory(this.recruitContext);
|
|
486
822
|
}
|
|
823
|
+
/** Configured pass-through for {@link zohoRecruitUploadAttachmentForRecord}. */
|
|
487
824
|
get uploadAttachmentForRecord() {
|
|
488
825
|
return zoho.zohoRecruitUploadAttachmentForRecord(this.recruitContext);
|
|
489
826
|
}
|
|
827
|
+
/** Configured pass-through for {@link zohoRecruitDownloadAttachmentForRecord}. */
|
|
490
828
|
get downloadAttachmentForRecord() {
|
|
491
829
|
return zoho.zohoRecruitDownloadAttachmentForRecord(this.recruitContext);
|
|
492
830
|
}
|
|
831
|
+
/** Configured pass-through for {@link zohoRecruitDeleteAttachmentFromRecord}. */
|
|
493
832
|
get deleteAttachmentFromRecord() {
|
|
494
833
|
return zoho.zohoRecruitDeleteAttachmentFromRecord(this.recruitContext);
|
|
495
834
|
}
|
|
835
|
+
/** Configured pass-through for {@link zohoRecruitCreateNotes}. */
|
|
496
836
|
get createNotes() {
|
|
497
837
|
return zoho.zohoRecruitCreateNotes(this.recruitContext);
|
|
498
838
|
}
|
|
839
|
+
/** Configured pass-through for {@link zohoRecruitDeleteNotes}. */
|
|
499
840
|
get deleteNotes() {
|
|
500
841
|
return zoho.zohoRecruitDeleteNotes(this.recruitContext);
|
|
501
842
|
}
|
|
843
|
+
/** Configured pass-through for {@link zohoRecruitCreateNotesForRecord}. */
|
|
502
844
|
get createNotesForRecord() {
|
|
503
845
|
return zoho.zohoRecruitCreateNotesForRecord(this.recruitContext);
|
|
504
846
|
}
|
|
847
|
+
/** Configured pass-through for {@link zohoRecruitGetNotesForRecord}. */
|
|
505
848
|
get getNotesForRecord() {
|
|
506
849
|
return zoho.zohoRecruitGetNotesForRecord(this.recruitContext);
|
|
507
850
|
}
|
|
851
|
+
/** Configured pass-through for {@link zohoRecruitGetNotesForRecordPageFactory}. */
|
|
508
852
|
get getNotesForRecordPageFactory() {
|
|
509
853
|
return zoho.zohoRecruitGetNotesForRecordPageFactory(this.recruitContext);
|
|
510
854
|
}
|
|
855
|
+
/** Configured pass-through for {@link zohoRecruitExecuteRestApiFunction}. */
|
|
511
856
|
get executeRestApiFunction() {
|
|
512
857
|
return zoho.zohoRecruitExecuteRestApiFunction(this.recruitContext);
|
|
513
858
|
}
|
|
859
|
+
/** Configured pass-through for {@link zohoRecruitAssociateCandidateRecordsWithJobOpenings}. */
|
|
514
860
|
get associateCandidateRecordsWithJobOpenings() {
|
|
515
861
|
return zoho.zohoRecruitAssociateCandidateRecordsWithJobOpenings(this.recruitContext);
|
|
516
862
|
}
|
|
863
|
+
/** Configured pass-through for {@link zohoRecruitSearchCandidateAssociatedJobOpeningRecords}. */
|
|
517
864
|
get searchCandidateAssociatedJobOpeningRecords() {
|
|
518
865
|
return zoho.zohoRecruitSearchCandidateAssociatedJobOpeningRecords(this.recruitContext);
|
|
519
866
|
}
|
|
867
|
+
/** Configured pass-through for {@link zohoRecruitSearchCandidateAssociatedJobOpeningRecordsPageFactory}. */
|
|
520
868
|
get searchCandidateAssociatedJobOpeningRecordsPageFactory() {
|
|
521
869
|
return zoho.zohoRecruitSearchCandidateAssociatedJobOpeningRecordsPageFactory(this.recruitContext);
|
|
522
870
|
}
|
|
871
|
+
/** Configured pass-through for {@link zohoRecruitSearchJobOpeningAssociatedCandidateRecords}. */
|
|
523
872
|
get searchJobOpeningAssociatedCandidateRecords() {
|
|
524
873
|
return zoho.zohoRecruitSearchJobOpeningAssociatedCandidateRecords(this.recruitContext);
|
|
525
874
|
}
|
|
875
|
+
/** Configured pass-through for {@link zohoRecruitSearchJobOpeningAssociatedCandidateRecordsPageFactory}. */
|
|
526
876
|
get searchJobOpeningAssociatedCandidateRecordsPageFactory() {
|
|
527
877
|
return zoho.zohoRecruitSearchJobOpeningAssociatedCandidateRecordsPageFactory(this.recruitContext);
|
|
528
878
|
}
|
|
879
|
+
/** Configured pass-through for {@link zohoRecruitCreateTagsForModule}. */
|
|
529
880
|
get createTagsForModule() {
|
|
530
881
|
return zoho.zohoRecruitCreateTagsForModule(this.recruitContext);
|
|
531
882
|
}
|
|
883
|
+
/** Configured pass-through for {@link zohoRecruitGetTagsForModule}. */
|
|
532
884
|
get getTagsForModule() {
|
|
533
885
|
return zoho.zohoRecruitGetTagsForModule(this.recruitContext);
|
|
534
886
|
}
|
|
887
|
+
/** Configured pass-through for {@link zohoRecruitAddTagsToRecords}. */
|
|
535
888
|
get addTagsToRecords() {
|
|
536
889
|
return zoho.zohoRecruitAddTagsToRecords(this.recruitContext);
|
|
537
890
|
}
|
|
891
|
+
/** Configured pass-through for {@link zohoRecruitRemoveTagsFromRecords}. */
|
|
538
892
|
get removeTagsFromRecords() {
|
|
539
893
|
return zoho.zohoRecruitRemoveTagsFromRecords(this.recruitContext);
|
|
540
894
|
}
|
|
@@ -548,6 +902,26 @@ exports.ZohoRecruitApi = __decorate([
|
|
|
548
902
|
], exports.ZohoRecruitApi);
|
|
549
903
|
|
|
550
904
|
// MARK: Provider Factories
|
|
905
|
+
/**
|
|
906
|
+
* Reads Zoho Recruit connection settings from the NestJS ConfigService
|
|
907
|
+
* and returns a validated service config.
|
|
908
|
+
*
|
|
909
|
+
* Resolves the API URL via environment variables following the naming convention
|
|
910
|
+
* `ZOHO_RECRUIT_API_URL` (service-specific) or `ZOHO_API_URL` (shared fallback).
|
|
911
|
+
*
|
|
912
|
+
* @param configService - NestJS config service populated with Zoho environment variables
|
|
913
|
+
* @returns Validated Zoho Recruit service configuration
|
|
914
|
+
* @throws {Error} If required config values (e.g. API URL) are missing
|
|
915
|
+
*
|
|
916
|
+
* @example
|
|
917
|
+
* ```typescript
|
|
918
|
+
* {
|
|
919
|
+
* provide: ZohoRecruitServiceConfig,
|
|
920
|
+
* inject: [ConfigService],
|
|
921
|
+
* useFactory: zohoRecruitServiceConfigFactory
|
|
922
|
+
* }
|
|
923
|
+
* ```
|
|
924
|
+
*/
|
|
551
925
|
function zohoRecruitServiceConfigFactory(configService) {
|
|
552
926
|
const getFromConfigService = zohoConfigServiceReaderFunction(zoho.ZOHO_RECRUIT_SERVICE_NAME, configService);
|
|
553
927
|
const config = {
|
|
@@ -558,6 +932,22 @@ function zohoRecruitServiceConfigFactory(configService) {
|
|
|
558
932
|
ZohoRecruitServiceConfig.assertValidConfig(config);
|
|
559
933
|
return config;
|
|
560
934
|
}
|
|
935
|
+
/**
|
|
936
|
+
* Reads Zoho Accounts (OAuth) settings scoped to the Recruit service from
|
|
937
|
+
* the NestJS ConfigService and returns an accounts service config.
|
|
938
|
+
*
|
|
939
|
+
* @param configService - NestJS config service populated with Zoho OAuth environment variables
|
|
940
|
+
* @returns Zoho Accounts service config scoped to the Recruit service access token
|
|
941
|
+
*
|
|
942
|
+
* @example
|
|
943
|
+
* ```typescript
|
|
944
|
+
* {
|
|
945
|
+
* provide: ZohoAccountsServiceConfig,
|
|
946
|
+
* inject: [ConfigService],
|
|
947
|
+
* useFactory: zohoRecruitAccountServiceConfigFactory
|
|
948
|
+
* }
|
|
949
|
+
* ```
|
|
950
|
+
*/
|
|
561
951
|
function zohoRecruitAccountServiceConfigFactory(configService) {
|
|
562
952
|
return zohoAccountsServiceConfigFromConfigService({
|
|
563
953
|
configService,
|
|
@@ -565,11 +955,40 @@ function zohoRecruitAccountServiceConfigFactory(configService) {
|
|
|
565
955
|
});
|
|
566
956
|
}
|
|
567
957
|
/**
|
|
568
|
-
*
|
|
958
|
+
* Generates NestJS {@link ModuleMetadata} that wires up the full Zoho Recruit stack
|
|
959
|
+
* (config, accounts, and API service) so consuming modules only need a single import.
|
|
569
960
|
*
|
|
570
|
-
*
|
|
571
|
-
* @
|
|
572
|
-
*
|
|
961
|
+
* The generated module requires the following dependencies in order to initialize properly:
|
|
962
|
+
* - {@link ZohoAccountsAccessTokenCacheService}
|
|
963
|
+
*
|
|
964
|
+
* Use the `dependencyModule` config option to import a module that exports those dependencies.
|
|
965
|
+
*
|
|
966
|
+
* The returned metadata registers {@link ZohoRecruitServiceConfig}, {@link ZohoRecruitApi},
|
|
967
|
+
* {@link ZohoAccountsServiceConfig}, and {@link ZohoAccountsApi} as providers, and
|
|
968
|
+
* exports {@link ZohoRecruitApi} by default. Additional imports, exports, and providers
|
|
969
|
+
* from the config are merged in.
|
|
970
|
+
*
|
|
971
|
+
* @param config - Module configuration with optional dependency module and extra metadata
|
|
972
|
+
* @returns Complete NestJS module metadata ready to pass to `@Module()`
|
|
973
|
+
*
|
|
974
|
+
* @example
|
|
975
|
+
* ```typescript
|
|
976
|
+
* const cacheService = fileZohoAccountsAccessTokenCacheService();
|
|
977
|
+
*
|
|
978
|
+
* @Module({
|
|
979
|
+
* providers: [
|
|
980
|
+
* {
|
|
981
|
+
* provide: ZohoAccountsAccessTokenCacheService,
|
|
982
|
+
* useValue: cacheService
|
|
983
|
+
* }
|
|
984
|
+
* ],
|
|
985
|
+
* exports: [ZohoAccountsAccessTokenCacheService]
|
|
986
|
+
* })
|
|
987
|
+
* export class ZohoRecruitDependencyModule {}
|
|
988
|
+
*
|
|
989
|
+
* @Module(appZohoRecruitModuleMetadata({ dependencyModule: ZohoRecruitDependencyModule }))
|
|
990
|
+
* export class AppZohoRecruitModule {}
|
|
991
|
+
* ```
|
|
573
992
|
*/
|
|
574
993
|
function appZohoRecruitModuleMetadata(config$1) {
|
|
575
994
|
const { dependencyModule, imports, exports: exports$1, providers } = config$1;
|
|
@@ -596,11 +1015,236 @@ function appZohoRecruitModuleMetadata(config$1) {
|
|
|
596
1015
|
};
|
|
597
1016
|
}
|
|
598
1017
|
|
|
1018
|
+
/**
|
|
1019
|
+
* Configuration for ZohoSignService
|
|
1020
|
+
*/
|
|
1021
|
+
class ZohoSignServiceConfig {
|
|
1022
|
+
zohoSign;
|
|
1023
|
+
factoryConfig;
|
|
1024
|
+
static assertValidConfig(config) {
|
|
1025
|
+
assertValidZohoConfig(config.zohoSign);
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
/**
|
|
1030
|
+
* NestJS injectable service that wraps the Zoho Sign API.
|
|
1031
|
+
*
|
|
1032
|
+
* Provides convenient accessor getters for all Sign operations, each bound
|
|
1033
|
+
* to the authenticated Sign context created during construction.
|
|
1034
|
+
*/
|
|
1035
|
+
exports.ZohoSignApi = class ZohoSignApi {
|
|
1036
|
+
config;
|
|
1037
|
+
zohoAccountsApi;
|
|
1038
|
+
/**
|
|
1039
|
+
* Underlying Zoho Sign client instance, initialized from the injected config and accounts context.
|
|
1040
|
+
*/
|
|
1041
|
+
zohoSign;
|
|
1042
|
+
/**
|
|
1043
|
+
* The authenticated Sign context used by all operation accessors.
|
|
1044
|
+
*/
|
|
1045
|
+
get signContext() {
|
|
1046
|
+
return this.zohoSign.signContext;
|
|
1047
|
+
}
|
|
1048
|
+
/**
|
|
1049
|
+
* Rate limiter shared across all Sign requests to respect Zoho API quotas.
|
|
1050
|
+
*/
|
|
1051
|
+
get zohoRateLimiter() {
|
|
1052
|
+
return this.zohoSign.signContext.zohoRateLimiter;
|
|
1053
|
+
}
|
|
1054
|
+
/**
|
|
1055
|
+
* Initializes the Sign client by combining the service config with the
|
|
1056
|
+
* accounts context for OAuth token management.
|
|
1057
|
+
*/
|
|
1058
|
+
constructor(config, zohoAccountsApi) {
|
|
1059
|
+
this.config = config;
|
|
1060
|
+
this.zohoAccountsApi = zohoAccountsApi;
|
|
1061
|
+
this.zohoSign = zoho.zohoSignFactory({
|
|
1062
|
+
...config.factoryConfig,
|
|
1063
|
+
accountsContext: zohoAccountsApi.accountsContext
|
|
1064
|
+
})(config.zohoSign);
|
|
1065
|
+
}
|
|
1066
|
+
// MARK: Accessors
|
|
1067
|
+
/** Configured pass-through for {@link zohoSignGetDocument}. */
|
|
1068
|
+
get getDocument() {
|
|
1069
|
+
return zoho.zohoSignGetDocument(this.signContext);
|
|
1070
|
+
}
|
|
1071
|
+
/** Configured pass-through for {@link zohoSignGetDocuments}. */
|
|
1072
|
+
get getDocuments() {
|
|
1073
|
+
return zoho.zohoSignGetDocuments(this.signContext);
|
|
1074
|
+
}
|
|
1075
|
+
/** Configured pass-through for {@link zohoSignGetDocumentsPageFactory}. */
|
|
1076
|
+
get getDocumentsPageFactory() {
|
|
1077
|
+
return zoho.zohoSignGetDocumentsPageFactory(this.signContext);
|
|
1078
|
+
}
|
|
1079
|
+
/** Configured pass-through for {@link zohoSignGetDocumentFormData}. */
|
|
1080
|
+
get getDocumentFormData() {
|
|
1081
|
+
return zoho.zohoSignGetDocumentFormData(this.signContext);
|
|
1082
|
+
}
|
|
1083
|
+
/** Configured pass-through for {@link zohoSignRetrieveFieldTypes}. */
|
|
1084
|
+
get retrieveFieldTypes() {
|
|
1085
|
+
return zoho.zohoSignRetrieveFieldTypes(this.signContext);
|
|
1086
|
+
}
|
|
1087
|
+
/** Configured pass-through for {@link zohoSignDownloadPdf}. */
|
|
1088
|
+
get downloadPdf() {
|
|
1089
|
+
return zoho.zohoSignDownloadPdf(this.signContext);
|
|
1090
|
+
}
|
|
1091
|
+
/** Configured pass-through for {@link zohoSignDownloadCompletionCertificate}. */
|
|
1092
|
+
get downloadCompletionCertificate() {
|
|
1093
|
+
return zoho.zohoSignDownloadCompletionCertificate(this.signContext);
|
|
1094
|
+
}
|
|
1095
|
+
/** Configured pass-through for {@link zohoSignCreateDocument}. */
|
|
1096
|
+
get createDocument() {
|
|
1097
|
+
return zoho.zohoSignCreateDocument(this.signContext);
|
|
1098
|
+
}
|
|
1099
|
+
/** Configured pass-through for {@link zohoSignUpdateDocument}. */
|
|
1100
|
+
get updateDocument() {
|
|
1101
|
+
return zoho.zohoSignUpdateDocument(this.signContext);
|
|
1102
|
+
}
|
|
1103
|
+
/** Configured pass-through for {@link zohoSignSendDocumentForSignature}. */
|
|
1104
|
+
get sendDocumentForSignature() {
|
|
1105
|
+
return zoho.zohoSignSendDocumentForSignature(this.signContext);
|
|
1106
|
+
}
|
|
1107
|
+
/** Configured pass-through for {@link zohoSignExtendDocument}. */
|
|
1108
|
+
get extendDocument() {
|
|
1109
|
+
return zoho.zohoSignExtendDocument(this.signContext);
|
|
1110
|
+
}
|
|
1111
|
+
/** Configured pass-through for {@link zohoSignDeleteDocument}. */
|
|
1112
|
+
get deleteDocument() {
|
|
1113
|
+
return zoho.zohoSignDeleteDocument(this.signContext);
|
|
1114
|
+
}
|
|
1115
|
+
};
|
|
1116
|
+
exports.ZohoSignApi = __decorate([
|
|
1117
|
+
common.Injectable(),
|
|
1118
|
+
__param(0, common.Inject(ZohoSignServiceConfig)),
|
|
1119
|
+
__param(1, common.Inject(exports.ZohoAccountsApi)),
|
|
1120
|
+
__metadata("design:paramtypes", [ZohoSignServiceConfig,
|
|
1121
|
+
exports.ZohoAccountsApi])
|
|
1122
|
+
], exports.ZohoSignApi);
|
|
1123
|
+
|
|
1124
|
+
// MARK: Provider Factories
|
|
1125
|
+
/**
|
|
1126
|
+
* Reads Zoho Sign connection settings from the NestJS ConfigService
|
|
1127
|
+
* and returns a validated service config.
|
|
1128
|
+
*
|
|
1129
|
+
* Resolves the API URL via environment variables following the naming convention
|
|
1130
|
+
* `ZOHO_SIGN_API_URL` (service-specific) or `ZOHO_API_URL` (shared fallback).
|
|
1131
|
+
*
|
|
1132
|
+
* @param configService - NestJS config service populated with Zoho environment variables
|
|
1133
|
+
* @returns Validated Zoho Sign service configuration
|
|
1134
|
+
* @throws {Error} If required config values (e.g. API URL) are missing
|
|
1135
|
+
*
|
|
1136
|
+
* @example
|
|
1137
|
+
* ```typescript
|
|
1138
|
+
* // Typically used as a NestJS factory provider:
|
|
1139
|
+
* {
|
|
1140
|
+
* provide: ZohoSignServiceConfig,
|
|
1141
|
+
* inject: [ConfigService],
|
|
1142
|
+
* useFactory: zohoSignServiceConfigFactory
|
|
1143
|
+
* }
|
|
1144
|
+
* ```
|
|
1145
|
+
*/
|
|
1146
|
+
function zohoSignServiceConfigFactory(configService) {
|
|
1147
|
+
const getFromConfigService = zohoConfigServiceReaderFunction(zoho.ZOHO_SIGN_SERVICE_NAME, configService);
|
|
1148
|
+
const config = {
|
|
1149
|
+
zohoSign: {
|
|
1150
|
+
apiUrl: getFromConfigService(ZOHO_API_URL_CONFIG_KEY)
|
|
1151
|
+
}
|
|
1152
|
+
};
|
|
1153
|
+
ZohoSignServiceConfig.assertValidConfig(config);
|
|
1154
|
+
return config;
|
|
1155
|
+
}
|
|
1156
|
+
/**
|
|
1157
|
+
* Reads Zoho Accounts (OAuth) settings scoped to the Sign service from
|
|
1158
|
+
* the NestJS ConfigService and returns an accounts service config.
|
|
1159
|
+
*
|
|
1160
|
+
* @param configService - NestJS config service populated with Zoho OAuth environment variables
|
|
1161
|
+
* @returns Zoho Accounts service config scoped to the Sign service access token
|
|
1162
|
+
*
|
|
1163
|
+
* @example
|
|
1164
|
+
* ```typescript
|
|
1165
|
+
* {
|
|
1166
|
+
* provide: ZohoAccountsServiceConfig,
|
|
1167
|
+
* inject: [ConfigService],
|
|
1168
|
+
* useFactory: zohoSignAccountServiceConfigFactory
|
|
1169
|
+
* }
|
|
1170
|
+
* ```
|
|
1171
|
+
*/
|
|
1172
|
+
function zohoSignAccountServiceConfigFactory(configService) {
|
|
1173
|
+
return zohoAccountsServiceConfigFromConfigService({
|
|
1174
|
+
configService,
|
|
1175
|
+
serviceAccessTokenKey: zoho.ZOHO_SIGN_SERVICE_NAME
|
|
1176
|
+
});
|
|
1177
|
+
}
|
|
1178
|
+
/**
|
|
1179
|
+
* Generates NestJS {@link ModuleMetadata} that wires up the full Zoho Sign stack
|
|
1180
|
+
* (config, accounts, and API service) so consuming modules only need a single import.
|
|
1181
|
+
*
|
|
1182
|
+
* The generated module requires the following dependencies in order to initialize properly:
|
|
1183
|
+
* - {@link ZohoAccountsAccessTokenCacheService}
|
|
1184
|
+
*
|
|
1185
|
+
* Use the `dependencyModule` config option to import a module that exports those dependencies.
|
|
1186
|
+
*
|
|
1187
|
+
* The returned metadata registers {@link ZohoSignServiceConfig}, {@link ZohoSignApi},
|
|
1188
|
+
* {@link ZohoAccountsServiceConfig}, and {@link ZohoAccountsApi} as providers, and
|
|
1189
|
+
* exports {@link ZohoSignApi} by default. Additional imports, exports, and providers
|
|
1190
|
+
* from the config are merged in.
|
|
1191
|
+
*
|
|
1192
|
+
* @param config - Module configuration with optional dependency module and extra metadata
|
|
1193
|
+
* @returns Complete NestJS module metadata ready to pass to `@Module()`
|
|
1194
|
+
*
|
|
1195
|
+
* @example
|
|
1196
|
+
* ```typescript
|
|
1197
|
+
* const cacheService = fileZohoAccountsAccessTokenCacheService();
|
|
1198
|
+
*
|
|
1199
|
+
* @Module({
|
|
1200
|
+
* providers: [
|
|
1201
|
+
* {
|
|
1202
|
+
* provide: ZohoAccountsAccessTokenCacheService,
|
|
1203
|
+
* useValue: cacheService
|
|
1204
|
+
* }
|
|
1205
|
+
* ],
|
|
1206
|
+
* exports: [ZohoAccountsAccessTokenCacheService]
|
|
1207
|
+
* })
|
|
1208
|
+
* export class ZohoSignDependencyModule {}
|
|
1209
|
+
*
|
|
1210
|
+
* @Module(appZohoSignModuleMetadata({ dependencyModule: ZohoSignDependencyModule }))
|
|
1211
|
+
* export class AppZohoSignModule {}
|
|
1212
|
+
* ```
|
|
1213
|
+
*/
|
|
1214
|
+
function appZohoSignModuleMetadata(config$1) {
|
|
1215
|
+
const { dependencyModule, imports, exports: exports$1, providers } = config$1;
|
|
1216
|
+
const dependencyModuleImport = dependencyModule ? [dependencyModule] : [];
|
|
1217
|
+
return {
|
|
1218
|
+
imports: [config.ConfigModule, ...dependencyModuleImport, ...(imports ?? [])],
|
|
1219
|
+
exports: [exports.ZohoSignApi, ...(exports$1 ?? [])],
|
|
1220
|
+
providers: [
|
|
1221
|
+
{
|
|
1222
|
+
provide: ZohoSignServiceConfig,
|
|
1223
|
+
inject: [config.ConfigService],
|
|
1224
|
+
useFactory: zohoSignServiceConfigFactory
|
|
1225
|
+
},
|
|
1226
|
+
exports.ZohoSignApi,
|
|
1227
|
+
// Accounts
|
|
1228
|
+
{
|
|
1229
|
+
provide: ZohoAccountsServiceConfig,
|
|
1230
|
+
inject: [config.ConfigService],
|
|
1231
|
+
useFactory: zohoSignAccountServiceConfigFactory
|
|
1232
|
+
},
|
|
1233
|
+
exports.ZohoAccountsApi,
|
|
1234
|
+
...(providers ?? [])
|
|
1235
|
+
]
|
|
1236
|
+
};
|
|
1237
|
+
}
|
|
1238
|
+
|
|
599
1239
|
exports.DEFAULT_FILE_ZOHO_ACCOUNTS_ACCESS_TOKEN_CACHE_SERVICE_PATH = DEFAULT_FILE_ZOHO_ACCOUNTS_ACCESS_TOKEN_CACHE_SERVICE_PATH;
|
|
600
1240
|
exports.ZOHO_API_URL_CONFIG_KEY = ZOHO_API_URL_CONFIG_KEY;
|
|
601
1241
|
exports.ZohoAccountsServiceConfig = ZohoAccountsServiceConfig;
|
|
1242
|
+
exports.ZohoCrmServiceConfig = ZohoCrmServiceConfig;
|
|
602
1243
|
exports.ZohoRecruitServiceConfig = ZohoRecruitServiceConfig;
|
|
1244
|
+
exports.ZohoSignServiceConfig = ZohoSignServiceConfig;
|
|
1245
|
+
exports.appZohoCrmModuleMetadata = appZohoCrmModuleMetadata;
|
|
603
1246
|
exports.appZohoRecruitModuleMetadata = appZohoRecruitModuleMetadata;
|
|
1247
|
+
exports.appZohoSignModuleMetadata = appZohoSignModuleMetadata;
|
|
604
1248
|
exports.assertValidZohoConfig = assertValidZohoConfig;
|
|
605
1249
|
exports.fileZohoAccountsAccessTokenCacheService = fileZohoAccountsAccessTokenCacheService;
|
|
606
1250
|
exports.logMergeZohoAccountsAccessTokenCacheServiceErrorFunction = logMergeZohoAccountsAccessTokenCacheServiceErrorFunction;
|
|
@@ -609,5 +1253,9 @@ exports.mergeZohoAccountsAccessTokenCacheServices = mergeZohoAccountsAccessToken
|
|
|
609
1253
|
exports.readZohoConfigFromConfigService = readZohoConfigFromConfigService;
|
|
610
1254
|
exports.zohoAccountsServiceConfigFromConfigService = zohoAccountsServiceConfigFromConfigService;
|
|
611
1255
|
exports.zohoConfigServiceReaderFunction = zohoConfigServiceReaderFunction;
|
|
1256
|
+
exports.zohoCrmAccountServiceConfigFactory = zohoCrmAccountServiceConfigFactory;
|
|
1257
|
+
exports.zohoCrmServiceConfigFactory = zohoCrmServiceConfigFactory;
|
|
612
1258
|
exports.zohoRecruitAccountServiceConfigFactory = zohoRecruitAccountServiceConfigFactory;
|
|
613
1259
|
exports.zohoRecruitServiceConfigFactory = zohoRecruitServiceConfigFactory;
|
|
1260
|
+
exports.zohoSignAccountServiceConfigFactory = zohoSignAccountServiceConfigFactory;
|
|
1261
|
+
exports.zohoSignServiceConfigFactory = zohoSignServiceConfigFactory;
|