@flusys/nestjs-iam 5.1.2 → 5.1.3

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.
@@ -44,13 +44,7 @@ function _ts_param(paramIndex, decorator) {
44
44
  decorator(target, key, paramIndex);
45
45
  };
46
46
  }
47
- let ActionService = class ActionService extends _classes.RequestScopedApiService {
48
- resolveEntity() {
49
- return _actionentity.Action;
50
- }
51
- getDataSourceProvider() {
52
- return this.dataSourceProvider;
53
- }
47
+ let ActionService = class ActionService extends _classes.ApiService {
54
48
  // Query Customization
55
49
  async getSelectQuery(query, _user, select) {
56
50
  if (!select?.length) {
@@ -115,7 +109,7 @@ let ActionService = class ActionService extends _classes.RequestScopedApiService
115
109
  }
116
110
  }
117
111
  /** Get actions available for permission assignment (filtered by company whitelist) */ async getActionsForPermission(user) {
118
- await this.ensureRepositoryInitialized();
112
+ await this.ensureDataSourceRepository();
119
113
  this.requireUser(user, 'getActionsForPermission');
120
114
  let whereClause = {};
121
115
  if (this.iamConfigService.isCompanyFeatureEnabled() && user.companyId) {
@@ -134,7 +128,7 @@ let ActionService = class ActionService extends _classes.RequestScopedApiService
134
128
  return actions.map((action)=>this.convertEntityToResponseDto(action, false));
135
129
  }
136
130
  /** Get actions in hierarchical tree structure */ async getActionTree(user, search, isActive, withDeleted = false) {
137
- await this.ensureRepositoryInitialized();
131
+ await this.ensureDataSourceRepository();
138
132
  this.requireUser(user, 'getActionTree');
139
133
  const query = this.repository.createQueryBuilder('action');
140
134
  if (!withDeleted) {
@@ -183,8 +177,8 @@ let ActionService = class ActionService extends _classes.RequestScopedApiService
183
177
  return rootNodes;
184
178
  }
185
179
  constructor(cacheManager, utilsService, iamConfigService, dataSourceProvider, permissionService){
186
- super('action', null, cacheManager, utilsService, ActionService.name, true, 'iam'), _define_property(this, "cacheManager", void 0), _define_property(this, "utilsService", void 0), _define_property(this, "iamConfigService", void 0), _define_property(this, "dataSourceProvider", void 0), _define_property(this, "permissionService", void 0), // Custom Methods
187
- _define_property(this, "actionSelectFields", void 0), this.cacheManager = cacheManager, this.utilsService = utilsService, this.iamConfigService = iamConfigService, this.dataSourceProvider = dataSourceProvider, this.permissionService = permissionService, this.actionSelectFields = [
180
+ super('action', cacheManager, utilsService, ActionService.name, true, 'iam', _actionentity.Action, dataSourceProvider), _define_property(this, "cacheManager", void 0), _define_property(this, "utilsService", void 0), _define_property(this, "iamConfigService", void 0), _define_property(this, "permissionService", void 0), // Custom Methods
181
+ _define_property(this, "actionSelectFields", void 0), this.cacheManager = cacheManager, this.utilsService = utilsService, this.iamConfigService = iamConfigService, this.permissionService = permissionService, this.actionSelectFields = [
188
182
  'id',
189
183
  'code',
190
184
  'name',
@@ -9,7 +9,6 @@ Object.defineProperty(exports, "IAMDataSourceService", {
9
9
  }
10
10
  });
11
11
  const _modules = require("@flusys/nestjs-shared/modules");
12
- const _constants = require("@flusys/nestjs-shared/constants");
13
12
  const _common = require("@nestjs/common");
14
13
  const _core = require("@nestjs/core");
15
14
  const _express = require("express");
@@ -84,7 +83,6 @@ function _ts_param(paramIndex, decorator) {
84
83
  };
85
84
  }
86
85
  let IAMDataSourceService = class IAMDataSourceService extends _modules.MultiTenantDataSourceService {
87
- // Factory Methods
88
86
  static buildParentOptions(options) {
89
87
  return {
90
88
  bootstrapAppConfig: options.bootstrapAppConfig,
@@ -93,80 +91,26 @@ let IAMDataSourceService = class IAMDataSourceService extends _modules.MultiTena
93
91
  tenants: options.config?.tenants
94
92
  };
95
93
  }
96
- // Feature Flags
97
94
  getEnableCompanyFeatureForTenant(tenant) {
98
95
  return tenant?.enableCompanyFeature ?? this.configService.isCompanyFeatureEnabled();
99
96
  }
100
97
  getEnableCompanyFeatureForCurrentTenant() {
101
98
  return this.getEnableCompanyFeatureForTenant(this.getCurrentTenant() ?? undefined);
102
99
  }
103
- // Entity Management
104
100
  async getIAMEntities() {
105
101
  const { getIAMEntitiesByConfig } = await Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("../entities")));
106
102
  const enableCompanyFeature = this.getEnableCompanyFeatureForCurrentTenant();
107
103
  const permissionMode = _helpers.PermissionModeHelper.toString(this.configService.getPermissionMode());
108
104
  return getIAMEntitiesByConfig(enableCompanyFeature, permissionMode);
109
105
  }
110
- // Overrides
111
106
  async createDataSourceFromConfig(config) {
112
107
  const entities = await this.getIAMEntities();
113
108
  return await super.createDataSourceFromConfig(config, entities);
114
109
  }
115
- async getSingleDataSource() {
116
- if (!IAMDataSourceService.singleDataSource) {
117
- if (IAMDataSourceService.singleConnectionLock) {
118
- return IAMDataSourceService.singleConnectionLock;
119
- }
120
- const lockPromise = (async ()=>{
121
- const config = this.getDefaultDatabaseConfig();
122
- if (!config) {
123
- throw new _common.InternalServerErrorException({
124
- message: 'Default database config is not available',
125
- messageKey: _constants.SYSTEM_MESSAGES.DATABASE_CONFIG_NOT_AVAILABLE
126
- });
127
- }
128
- const ds = await this.createDataSourceFromConfig(config);
129
- IAMDataSourceService.singleDataSource = ds;
130
- IAMDataSourceService.initialized = true;
131
- return ds;
132
- })();
133
- IAMDataSourceService.singleConnectionLock = lockPromise;
134
- try {
135
- return await lockPromise;
136
- } finally{
137
- IAMDataSourceService.singleConnectionLock = null;
138
- }
139
- }
140
- return IAMDataSourceService.singleDataSource;
141
- }
142
- async getOrCreateTenantConnection(tenant) {
143
- // Return existing initialized connection from IAM-specific cache
144
- const existing = IAMDataSourceService.tenantConnections.get(tenant.id);
145
- if (existing?.isInitialized) {
146
- return existing;
147
- }
148
- // If another request is creating this tenant's connection, wait for it
149
- const pendingConnection = IAMDataSourceService.connectionLocks.get(tenant.id);
150
- if (pendingConnection) {
151
- return pendingConnection;
152
- }
153
- // Create connection with lock to prevent race conditions
154
- const config = this.buildTenantDatabaseConfig(tenant);
155
- const connectionPromise = this.createDataSourceFromConfig(config);
156
- IAMDataSourceService.connectionLocks.set(tenant.id, connectionPromise);
157
- try {
158
- const dataSource = await connectionPromise;
159
- IAMDataSourceService.tenantConnections.set(tenant.id, dataSource);
160
- return dataSource;
161
- } finally{
162
- IAMDataSourceService.connectionLocks.delete(tenant.id);
163
- }
164
- }
165
110
  constructor(configService, request){
166
111
  super(IAMDataSourceService.buildParentOptions(configService.getOptions()), request), _define_property(this, "configService", void 0), this.configService = configService;
167
112
  }
168
113
  };
169
- // Override parent's static properties to have IAM-specific cache
170
114
  _define_property(IAMDataSourceService, "tenantConnections", new Map());
171
115
  _define_property(IAMDataSourceService, "singleDataSource", null);
172
116
  _define_property(IAMDataSourceService, "tenantsRegistry", new Map());
@@ -43,13 +43,10 @@ function _ts_param(paramIndex, decorator) {
43
43
  decorator(target, key, paramIndex);
44
44
  };
45
45
  }
46
- let RoleService = class RoleService extends _classes.RequestScopedApiService {
46
+ let RoleService = class RoleService extends _classes.ApiService {
47
47
  resolveEntity() {
48
48
  return this.iamConfigService.isCompanyFeatureEnabled() ? _rolewithcompanyentity.RoleWithCompany : _roleentity.Role;
49
49
  }
50
- getDataSourceProvider() {
51
- return this.dataSourceProvider;
52
- }
53
50
  // Entity Conversion
54
51
  async convertSingleDtoToEntity(dto, user) {
55
52
  const entity = await super.convertSingleDtoToEntity(dto, user);
@@ -121,7 +118,7 @@ let RoleService = class RoleService extends _classes.RequestScopedApiService {
121
118
  };
122
119
  }
123
120
  constructor(cacheManager, utilsService, iamConfigService, dataSourceProvider){
124
- super('role', null, cacheManager, utilsService, RoleService.name, true, 'iam'), _define_property(this, "cacheManager", void 0), _define_property(this, "utilsService", void 0), _define_property(this, "iamConfigService", void 0), _define_property(this, "dataSourceProvider", void 0), this.cacheManager = cacheManager, this.utilsService = utilsService, this.iamConfigService = iamConfigService, this.dataSourceProvider = dataSourceProvider;
121
+ super('role', cacheManager, utilsService, RoleService.name, true, 'iam', undefined, dataSourceProvider), _define_property(this, "cacheManager", void 0), _define_property(this, "utilsService", void 0), _define_property(this, "iamConfigService", void 0), this.cacheManager = cacheManager, this.utilsService = utilsService, this.iamConfigService = iamConfigService;
125
122
  }
126
123
  };
127
124
  RoleService = _ts_decorate([
@@ -25,7 +25,7 @@ function _ts_param(paramIndex, decorator) {
25
25
  decorator(target, key, paramIndex);
26
26
  };
27
27
  }
28
- import { HybridCache, RequestScopedApiService } from '@flusys/nestjs-shared/classes';
28
+ import { HybridCache, ApiService } from '@flusys/nestjs-shared/classes';
29
29
  import { UtilsService } from '@flusys/nestjs-shared/modules';
30
30
  import { BadRequestException, Inject, Injectable, Scope } from '@nestjs/common';
31
31
  import { In } from 'typeorm';
@@ -34,13 +34,7 @@ import { Action } from '../entities/action.entity';
34
34
  import { IAMConfigService } from './iam-config.service';
35
35
  import { IAMDataSourceService } from './iam-datasource.service';
36
36
  import { PermissionService } from './permission.service';
37
- export class ActionService extends RequestScopedApiService {
38
- resolveEntity() {
39
- return Action;
40
- }
41
- getDataSourceProvider() {
42
- return this.dataSourceProvider;
43
- }
37
+ export class ActionService extends ApiService {
44
38
  // Query Customization
45
39
  async getSelectQuery(query, _user, select) {
46
40
  if (!select?.length) {
@@ -105,7 +99,7 @@ export class ActionService extends RequestScopedApiService {
105
99
  }
106
100
  }
107
101
  /** Get actions available for permission assignment (filtered by company whitelist) */ async getActionsForPermission(user) {
108
- await this.ensureRepositoryInitialized();
102
+ await this.ensureDataSourceRepository();
109
103
  this.requireUser(user, 'getActionsForPermission');
110
104
  let whereClause = {};
111
105
  if (this.iamConfigService.isCompanyFeatureEnabled() && user.companyId) {
@@ -124,7 +118,7 @@ export class ActionService extends RequestScopedApiService {
124
118
  return actions.map((action)=>this.convertEntityToResponseDto(action, false));
125
119
  }
126
120
  /** Get actions in hierarchical tree structure */ async getActionTree(user, search, isActive, withDeleted = false) {
127
- await this.ensureRepositoryInitialized();
121
+ await this.ensureDataSourceRepository();
128
122
  this.requireUser(user, 'getActionTree');
129
123
  const query = this.repository.createQueryBuilder('action');
130
124
  if (!withDeleted) {
@@ -173,8 +167,8 @@ export class ActionService extends RequestScopedApiService {
173
167
  return rootNodes;
174
168
  }
175
169
  constructor(cacheManager, utilsService, iamConfigService, dataSourceProvider, permissionService){
176
- super('action', null, cacheManager, utilsService, ActionService.name, true, 'iam'), _define_property(this, "cacheManager", void 0), _define_property(this, "utilsService", void 0), _define_property(this, "iamConfigService", void 0), _define_property(this, "dataSourceProvider", void 0), _define_property(this, "permissionService", void 0), // Custom Methods
177
- _define_property(this, "actionSelectFields", void 0), this.cacheManager = cacheManager, this.utilsService = utilsService, this.iamConfigService = iamConfigService, this.dataSourceProvider = dataSourceProvider, this.permissionService = permissionService, this.actionSelectFields = [
170
+ super('action', cacheManager, utilsService, ActionService.name, true, 'iam', Action, dataSourceProvider), _define_property(this, "cacheManager", void 0), _define_property(this, "utilsService", void 0), _define_property(this, "iamConfigService", void 0), _define_property(this, "permissionService", void 0), // Custom Methods
171
+ _define_property(this, "actionSelectFields", void 0), this.cacheManager = cacheManager, this.utilsService = utilsService, this.iamConfigService = iamConfigService, this.permissionService = permissionService, this.actionSelectFields = [
178
172
  'id',
179
173
  'code',
180
174
  'name',
@@ -26,14 +26,12 @@ function _ts_param(paramIndex, decorator) {
26
26
  };
27
27
  }
28
28
  import { MultiTenantDataSourceService } from '@flusys/nestjs-shared/modules';
29
- import { SYSTEM_MESSAGES } from '@flusys/nestjs-shared/constants';
30
- import { Inject, Injectable, InternalServerErrorException, Optional, Scope } from '@nestjs/common';
29
+ import { Inject, Injectable, Optional, Scope } from '@nestjs/common';
31
30
  import { REQUEST } from '@nestjs/core';
32
31
  import { Request } from 'express';
33
32
  import { PermissionModeHelper } from '../helpers';
34
33
  import { IAMConfigService } from './iam-config.service';
35
34
  export class IAMDataSourceService extends MultiTenantDataSourceService {
36
- // Factory Methods
37
35
  static buildParentOptions(options) {
38
36
  return {
39
37
  bootstrapAppConfig: options.bootstrapAppConfig,
@@ -42,80 +40,26 @@ export class IAMDataSourceService extends MultiTenantDataSourceService {
42
40
  tenants: options.config?.tenants
43
41
  };
44
42
  }
45
- // Feature Flags
46
43
  getEnableCompanyFeatureForTenant(tenant) {
47
44
  return tenant?.enableCompanyFeature ?? this.configService.isCompanyFeatureEnabled();
48
45
  }
49
46
  getEnableCompanyFeatureForCurrentTenant() {
50
47
  return this.getEnableCompanyFeatureForTenant(this.getCurrentTenant() ?? undefined);
51
48
  }
52
- // Entity Management
53
49
  async getIAMEntities() {
54
50
  const { getIAMEntitiesByConfig } = await import('../entities');
55
51
  const enableCompanyFeature = this.getEnableCompanyFeatureForCurrentTenant();
56
52
  const permissionMode = PermissionModeHelper.toString(this.configService.getPermissionMode());
57
53
  return getIAMEntitiesByConfig(enableCompanyFeature, permissionMode);
58
54
  }
59
- // Overrides
60
55
  async createDataSourceFromConfig(config) {
61
56
  const entities = await this.getIAMEntities();
62
57
  return await super.createDataSourceFromConfig(config, entities);
63
58
  }
64
- async getSingleDataSource() {
65
- if (!IAMDataSourceService.singleDataSource) {
66
- if (IAMDataSourceService.singleConnectionLock) {
67
- return IAMDataSourceService.singleConnectionLock;
68
- }
69
- const lockPromise = (async ()=>{
70
- const config = this.getDefaultDatabaseConfig();
71
- if (!config) {
72
- throw new InternalServerErrorException({
73
- message: 'Default database config is not available',
74
- messageKey: SYSTEM_MESSAGES.DATABASE_CONFIG_NOT_AVAILABLE
75
- });
76
- }
77
- const ds = await this.createDataSourceFromConfig(config);
78
- IAMDataSourceService.singleDataSource = ds;
79
- IAMDataSourceService.initialized = true;
80
- return ds;
81
- })();
82
- IAMDataSourceService.singleConnectionLock = lockPromise;
83
- try {
84
- return await lockPromise;
85
- } finally{
86
- IAMDataSourceService.singleConnectionLock = null;
87
- }
88
- }
89
- return IAMDataSourceService.singleDataSource;
90
- }
91
- async getOrCreateTenantConnection(tenant) {
92
- // Return existing initialized connection from IAM-specific cache
93
- const existing = IAMDataSourceService.tenantConnections.get(tenant.id);
94
- if (existing?.isInitialized) {
95
- return existing;
96
- }
97
- // If another request is creating this tenant's connection, wait for it
98
- const pendingConnection = IAMDataSourceService.connectionLocks.get(tenant.id);
99
- if (pendingConnection) {
100
- return pendingConnection;
101
- }
102
- // Create connection with lock to prevent race conditions
103
- const config = this.buildTenantDatabaseConfig(tenant);
104
- const connectionPromise = this.createDataSourceFromConfig(config);
105
- IAMDataSourceService.connectionLocks.set(tenant.id, connectionPromise);
106
- try {
107
- const dataSource = await connectionPromise;
108
- IAMDataSourceService.tenantConnections.set(tenant.id, dataSource);
109
- return dataSource;
110
- } finally{
111
- IAMDataSourceService.connectionLocks.delete(tenant.id);
112
- }
113
- }
114
59
  constructor(configService, request){
115
60
  super(IAMDataSourceService.buildParentOptions(configService.getOptions()), request), _define_property(this, "configService", void 0), this.configService = configService;
116
61
  }
117
62
  }
118
- // Override parent's static properties to have IAM-specific cache
119
63
  _define_property(IAMDataSourceService, "tenantConnections", new Map());
120
64
  _define_property(IAMDataSourceService, "singleDataSource", null);
121
65
  _define_property(IAMDataSourceService, "tenantsRegistry", new Map());
@@ -25,7 +25,7 @@ function _ts_param(paramIndex, decorator) {
25
25
  decorator(target, key, paramIndex);
26
26
  };
27
27
  }
28
- import { HybridCache, RequestScopedApiService } from '@flusys/nestjs-shared/classes';
28
+ import { HybridCache, ApiService } from '@flusys/nestjs-shared/classes';
29
29
  import { UtilsService } from '@flusys/nestjs-shared/modules';
30
30
  import { applyCompanyFilter } from '@flusys/nestjs-shared/utils';
31
31
  import { Inject, Injectable, Scope } from '@nestjs/common';
@@ -33,13 +33,10 @@ import { RoleWithCompany } from '../entities/role-with-company.entity';
33
33
  import { Role } from '../entities/role.entity';
34
34
  import { IAMConfigService } from './iam-config.service';
35
35
  import { IAMDataSourceService } from './iam-datasource.service';
36
- export class RoleService extends RequestScopedApiService {
36
+ export class RoleService extends ApiService {
37
37
  resolveEntity() {
38
38
  return this.iamConfigService.isCompanyFeatureEnabled() ? RoleWithCompany : Role;
39
39
  }
40
- getDataSourceProvider() {
41
- return this.dataSourceProvider;
42
- }
43
40
  // Entity Conversion
44
41
  async convertSingleDtoToEntity(dto, user) {
45
42
  const entity = await super.convertSingleDtoToEntity(dto, user);
@@ -111,7 +108,7 @@ export class RoleService extends RequestScopedApiService {
111
108
  };
112
109
  }
113
110
  constructor(cacheManager, utilsService, iamConfigService, dataSourceProvider){
114
- super('role', null, cacheManager, utilsService, RoleService.name, true, 'iam'), _define_property(this, "cacheManager", void 0), _define_property(this, "utilsService", void 0), _define_property(this, "iamConfigService", void 0), _define_property(this, "dataSourceProvider", void 0), this.cacheManager = cacheManager, this.utilsService = utilsService, this.iamConfigService = iamConfigService, this.dataSourceProvider = dataSourceProvider;
111
+ super('role', cacheManager, utilsService, RoleService.name, true, 'iam', undefined, dataSourceProvider), _define_property(this, "cacheManager", void 0), _define_property(this, "utilsService", void 0), _define_property(this, "iamConfigService", void 0), this.cacheManager = cacheManager, this.utilsService = utilsService, this.iamConfigService = iamConfigService;
115
112
  }
116
113
  }
117
114
  RoleService = _ts_decorate([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flusys/nestjs-iam",
3
- "version": "5.1.2",
3
+ "version": "5.1.3",
4
4
  "description": "Identity and Access Management (IAM) module for NestJS applications",
5
5
  "main": "cjs/index.js",
6
6
  "module": "fesm/index.js",
@@ -79,18 +79,18 @@
79
79
  }
80
80
  },
81
81
  "peerDependencies": {
82
- "@nestjs/common": "^10.0.0 || ^11.0.0",
83
- "@nestjs/config": "^3.0.0 || ^4.0.0",
84
- "@nestjs/core": "^10.0.0 || ^11.0.0",
85
- "@nestjs/swagger": "^7.0.0 || ^11.0.0",
86
- "@nestjs/typeorm": "^10.0.0 || ^11.0.0",
87
- "class-transformer": "^0.5.0",
88
- "class-validator": "^0.14.0",
82
+ "@nestjs/common": "^11.0.0",
83
+ "@nestjs/config": "^4.0.0",
84
+ "@nestjs/core": "^11.0.0",
85
+ "@nestjs/swagger": "^11.0.0",
86
+ "@nestjs/typeorm": "^11.0.0",
87
+ "class-transformer": "^0.5.1",
88
+ "class-validator": "^0.14.0 || ^0.15.0",
89
89
  "typeorm": "^0.3.0",
90
- "express": "^4.18.0"
90
+ "express": "^4.18.0 || ^5.0.0"
91
91
  },
92
92
  "dependencies": {
93
- "@flusys/nestjs-core": "5.1.2",
94
- "@flusys/nestjs-shared": "5.1.2"
93
+ "@flusys/nestjs-core": "5.1.3",
94
+ "@flusys/nestjs-shared": "5.1.3"
95
95
  }
96
96
  }
@@ -1,22 +1,19 @@
1
- import { HybridCache, RequestScopedApiService } from '@flusys/nestjs-shared/classes';
1
+ import { HybridCache, ApiService } from '@flusys/nestjs-shared/classes';
2
2
  import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
3
3
  import { UtilsService } from '@flusys/nestjs-shared/modules';
4
- import { EntityTarget, SelectQueryBuilder } from 'typeorm';
4
+ import { SelectQueryBuilder } from 'typeorm';
5
5
  import { CreateActionDto, UpdateActionDto } from '../dtos/action.dto';
6
6
  import { ActionBase } from '../entities/action-base.entity';
7
7
  import { IAction, IActionTree } from '../interfaces/action.interface';
8
8
  import { IAMConfigService } from './iam-config.service';
9
9
  import { IAMDataSourceService } from './iam-datasource.service';
10
10
  import { PermissionService } from './permission.service';
11
- export declare class ActionService extends RequestScopedApiService<CreateActionDto, UpdateActionDto, IAction, ActionBase> {
11
+ export declare class ActionService extends ApiService<CreateActionDto, UpdateActionDto, IAction, ActionBase> {
12
12
  protected cacheManager: HybridCache;
13
13
  protected utilsService: UtilsService;
14
14
  private readonly iamConfigService;
15
- private readonly dataSourceProvider;
16
15
  private readonly permissionService;
17
16
  constructor(cacheManager: HybridCache, utilsService: UtilsService, iamConfigService: IAMConfigService, dataSourceProvider: IAMDataSourceService, permissionService: PermissionService);
18
- protected resolveEntity(): EntityTarget<ActionBase>;
19
- protected getDataSourceProvider(): IAMDataSourceService;
20
17
  getSelectQuery(query: SelectQueryBuilder<ActionBase>, _user: ILoggedUserInfo | null, select?: string[]): Promise<{
21
18
  query: SelectQueryBuilder<ActionBase>;
22
19
  isRaw: boolean;
@@ -17,6 +17,4 @@ export declare class IAMDataSourceService extends MultiTenantDataSourceService {
17
17
  getEnableCompanyFeatureForCurrentTenant(): boolean;
18
18
  getIAMEntities(): Promise<any[]>;
19
19
  protected createDataSourceFromConfig(config: IDatabaseConfig): Promise<DataSource>;
20
- protected getSingleDataSource(): Promise<DataSource>;
21
- protected getOrCreateTenantConnection(tenant: ITenantDatabaseConfig): Promise<DataSource>;
22
20
  }
@@ -1,4 +1,4 @@
1
- import { HybridCache, RequestScopedApiService } from '@flusys/nestjs-shared/classes';
1
+ import { HybridCache, ApiService } from '@flusys/nestjs-shared/classes';
2
2
  import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
3
3
  import { UtilsService } from '@flusys/nestjs-shared/modules';
4
4
  import { EntityTarget, SelectQueryBuilder } from 'typeorm';
@@ -7,14 +7,12 @@ import { RoleBase } from '../entities/role-base.entity';
7
7
  import { IRole } from '../interfaces/role.interface';
8
8
  import { IAMConfigService } from './iam-config.service';
9
9
  import { IAMDataSourceService } from './iam-datasource.service';
10
- export declare class RoleService extends RequestScopedApiService<CreateRoleDto, UpdateRoleDto, IRole, RoleBase> {
10
+ export declare class RoleService extends ApiService<CreateRoleDto, UpdateRoleDto, IRole, RoleBase> {
11
11
  protected cacheManager: HybridCache;
12
12
  protected utilsService: UtilsService;
13
13
  private readonly iamConfigService;
14
- private readonly dataSourceProvider;
15
14
  constructor(cacheManager: HybridCache, utilsService: UtilsService, iamConfigService: IAMConfigService, dataSourceProvider: IAMDataSourceService);
16
15
  protected resolveEntity(): EntityTarget<RoleBase>;
17
- protected getDataSourceProvider(): IAMDataSourceService;
18
16
  convertSingleDtoToEntity(dto: CreateRoleDto | UpdateRoleDto, user: ILoggedUserInfo | null): Promise<RoleBase>;
19
17
  getSelectQuery(query: SelectQueryBuilder<RoleBase>, _user: ILoggedUserInfo | null, select?: string[]): Promise<{
20
18
  query: SelectQueryBuilder<RoleBase>;