@@ -2,6 +2,7 @@ import type { Auth } from '@keeper-security/keeperapi'
22import type { InMemoryStorage } from '../storage/InMemoryStorage'
33import { ConfigManager } from './config/ConfigManager'
44import { GatewayManager } from './gateway/GatewayManager'
5+ import { RotationManager } from './rotation/RotationManager'
56import type {
67 FormatPamConfigurationsTableOptions ,
78 FormattedPamConfigurationsTable ,
@@ -30,16 +31,39 @@ import type {
3031 SetGatewayMaxInstancesInput ,
3132 SetGatewayMaxInstancesResult ,
3233} from './gateway/gatewayTypes'
34+ import type {
35+ FormatRotationSchedulesTableOptions ,
36+ FormattedRotationSchedulesTable ,
37+ GetRotationInfoInput ,
38+ ListRotationSchedulesOptions ,
39+ ListRotationSchedulesResult ,
40+ RenderRotationSchedulesAsciiTableOptions ,
41+ RotationInfoResult ,
42+ EditRotationInput ,
43+ EditRotationResult ,
44+ } from './rotation/rotationTypes'
45+ import type {
46+ ListRotationScriptsOptions ,
47+ ListRotationScriptsResult ,
48+ AddRotationScriptInput ,
49+ AddRotationScriptResult ,
50+ EditRotationScriptInput ,
51+ EditRotationScriptResult ,
52+ DeleteRotationScriptInput ,
53+ DeleteRotationScriptResult ,
54+ } from './rotation/rotationScriptTypes'
3355
3456export type AuthProvider = ( ) => Auth
3557
3658export class PamManager {
3759 private readonly gatewayManager : GatewayManager
3860 private readonly configManager : ConfigManager
61+ private readonly rotationManager : RotationManager
3962
4063 constructor ( storage : InMemoryStorage , authProvider : AuthProvider ) {
4164 this . gatewayManager = new GatewayManager ( storage , authProvider )
4265 this . configManager = new ConfigManager ( storage , authProvider )
66+ this . rotationManager = new RotationManager ( storage , authProvider )
4367 }
4468
4569 public getGatewayManager ( ) : GatewayManager {
@@ -50,6 +74,10 @@ export class PamManager {
5074 return this . configManager
5175 }
5276
77+ public getRotationManager ( ) : RotationManager {
78+ return this . rotationManager
79+ }
80+
5381 public async listGateways ( options : ListGatewaysOptions = { } ) : Promise < ListGatewaysResult > {
5482 return this . gatewayManager . listGateways ( options )
5583 }
@@ -135,4 +163,87 @@ export class PamManager {
135163 ) : string {
136164 return this . configManager . formatPamConfigurationsOutput ( result , options )
137165 }
166+
167+ public async listRotationSchedules ( options : ListRotationSchedulesOptions = { } ) : Promise < ListRotationSchedulesResult > {
168+ return this . rotationManager . listRotationSchedules ( options )
169+ }
170+
171+ public formatRotationSchedulesTable (
172+ result : ListRotationSchedulesResult ,
173+ options : FormatRotationSchedulesTableOptions = { }
174+ ) : FormattedRotationSchedulesTable {
175+ return this . rotationManager . formatRotationSchedulesTable ( result , options )
176+ }
177+
178+ public renderRotationSchedulesAsciiTable (
179+ table : FormattedRotationSchedulesTable ,
180+ options : RenderRotationSchedulesAsciiTableOptions = { }
181+ ) : string {
182+ return this . rotationManager . renderRotationSchedulesAsciiTable ( table , options )
183+ }
184+
185+ public formatRotationSchedulesJson (
186+ result : ListRotationSchedulesResult ,
187+ options : ListRotationSchedulesOptions = { }
188+ ) : string {
189+ return this . rotationManager . formatRotationSchedulesJson ( result , options )
190+ }
191+
192+ public formatRotationSchedulesOutput (
193+ result : ListRotationSchedulesResult ,
194+ options : ListRotationSchedulesOptions = { }
195+ ) : string {
196+ return this . rotationManager . formatRotationSchedulesOutput ( result , options )
197+ }
198+
199+ public async getRotationInfo ( input : GetRotationInfoInput ) : Promise < RotationInfoResult > {
200+ return this . rotationManager . getRotationInfo ( input )
201+ }
202+
203+ public formatRotationInfoJson ( result : RotationInfoResult ) : string {
204+ return this . rotationManager . formatRotationInfoJson ( result )
205+ }
206+
207+ public formatRotationInfoOutput (
208+ result : RotationInfoResult ,
209+ options : Pick < GetRotationInfoInput , 'format' > = { }
210+ ) : string {
211+ return this . rotationManager . formatRotationInfoOutput ( result , options )
212+ }
213+
214+ public async editRotation ( input : EditRotationInput ) : Promise < EditRotationResult > {
215+ return this . rotationManager . editRotation ( input )
216+ }
217+
218+ public async listRotationScripts (
219+ options : ListRotationScriptsOptions = { }
220+ ) : Promise < ListRotationScriptsResult > {
221+ return this . rotationManager . listRotationScripts ( options )
222+ }
223+
224+ public formatRotationScriptsTable ( result : ListRotationScriptsResult ) : string [ ] [ ] {
225+ return this . rotationManager . formatRotationScriptsTable ( result )
226+ }
227+
228+ public formatRotationScriptsJson ( result : ListRotationScriptsResult ) : string {
229+ return this . rotationManager . formatRotationScriptsJson ( result )
230+ }
231+
232+ public async addRotationScript (
233+ input : AddRotationScriptInput
234+ ) : Promise < AddRotationScriptResult > {
235+ return this . rotationManager . addRotationScript ( input )
236+ }
237+
238+ public async editRotationScript (
239+ input : EditRotationScriptInput
240+ ) : Promise < EditRotationScriptResult > {
241+ return this . rotationManager . editRotationScript ( input )
242+ }
243+
244+ public async deleteRotationScript (
245+ input : DeleteRotationScriptInput
246+ ) : Promise < DeleteRotationScriptResult > {
247+ return this . rotationManager . deleteRotationScript ( input )
248+ }
138249}
0 commit comments