UNPKG

@elsikora/nestjs-crud-automator

Version:

A library for automating the creation of CRUD operations in NestJS.

60 lines (57 loc) 2.35 kB
'use strict'; var tslib_es6 = require('../../../external/tslib/tslib.es6.js'); var cache_class$2 = require('./hook/permission/cache.class.js'); require('./hook/permission/resolver.class.js'); var cache_class = require('./iam/attachment/cache.class.js'); require('./iam/attachment/resolver.class.js'); var cache_class$1 = require('./iam/document/cache.class.js'); require('./iam/document/resolver.class.js'); require('./iam/document/validator.class.js'); require('./iam/engine.class.js'); require('./iam/query-planner.class.js'); var tokenRegistry_constant = require('../../../constant/class/authorization/token-registry.constant.js'); var common = require('@nestjs/common'); exports.ApiAuthorizationCacheInvalidationService = class ApiAuthorizationCacheInvalidationService { policyRegistry; iamAttachmentCache; iamDocumentCache; hookPermissionCache; constructor(policyRegistry, iamAttachmentCache, iamDocumentCache, hookPermissionCache) { this.policyRegistry = policyRegistry; this.iamAttachmentCache = iamAttachmentCache; this.iamDocumentCache = iamDocumentCache; this.hookPermissionCache = hookPermissionCache; } clearAll(entity) { this.clearPolicyCache(entity); this.clearIamCache(); this.clearHookPermissionCache(); } clearHookPermissionCache() { this.hookPermissionCache.clear(); } clearIamAttachmentCache() { this.iamAttachmentCache.clear(); } clearIamCache() { this.clearIamAttachmentCache(); this.clearIamDocumentCache(); } clearIamDocumentCache() { this.iamDocumentCache.clear(); } clearPolicyCache(entity) { this.policyRegistry.invalidateCache(entity); } invalidate(entity) { this.clearPolicyCache(entity); } }; exports.ApiAuthorizationCacheInvalidationService = tslib_es6.__decorate([ common.Injectable(), tslib_es6.__param(0, common.Inject(tokenRegistry_constant.AUTHORIZATION_POLICY_REGISTRY_TOKEN)), tslib_es6.__metadata("design:paramtypes", [Object, cache_class.ApiAuthorizationIamAttachmentCache, cache_class$1.ApiAuthorizationIamDocumentCache, cache_class$2.ApiAuthorizationHookPermissionCache]) ], exports.ApiAuthorizationCacheInvalidationService); //# sourceMappingURL=cache-invalidation.service.class.js.map