Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for Session & Refresh token in management api client #1019

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/management/__generated/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ import {
LogsManager,
OrganizationsManager,
PromptsManager,
RefreshTokensManager,
ResourceServersManager,
RolesManager,
RulesManager,
RulesConfigsManager,
SessionsManager,
StatsManager,
TenantsManager,
TicketsManager,
Expand Down Expand Up @@ -59,10 +61,12 @@ export abstract class ManagementClientBase {
public readonly logs = new LogsManager(this.configuration);
public readonly organizations = new OrganizationsManager(this.configuration);
public readonly prompts = new PromptsManager(this.configuration);
public readonly refreshTokens = new RefreshTokensManager(this.configuration);
public readonly resourceServers = new ResourceServersManager(this.configuration);
public readonly roles = new RolesManager(this.configuration);
public readonly rules = new RulesManager(this.configuration);
public readonly rulesConfigs = new RulesConfigsManager(this.configuration);
public readonly sessions = new SessionsManager(this.configuration);
public readonly stats = new StatsManager(this.configuration);
public readonly tenants = new TenantsManager(this.configuration);
public readonly tickets = new TicketsManager(this.configuration);
Expand Down
2 changes: 2 additions & 0 deletions src/management/__generated/managers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ export * from './log-streams-manager.js';
export * from './logs-manager.js';
export * from './organizations-manager.js';
export * from './prompts-manager.js';
export * from './refresh-tokens-manager.js';
export * from './resource-servers-manager.js';
export * from './roles-manager.js';
export * from './rules-manager.js';
export * from './rules-configs-manager.js';
export * from './sessions-manager.js';
export * from './stats-manager.js';
export * from './tenants-manager.js';
export * from './tickets-manager.js';
Expand Down
66 changes: 66 additions & 0 deletions src/management/__generated/managers/refresh-tokens-manager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import * as runtime from '../../../lib/runtime.js';
import type { InitOverride, ApiResponse } from '../../../lib/runtime.js';
import type {
GetRefreshToken200Response,
DeleteRefreshTokenRequest,
GetRefreshTokenRequest,
} from '../models/index.js';

const { BaseAPI } = runtime;

/**
*
*/
export class RefreshTokensManager extends BaseAPI {
/**
* Delete a refresh token by its ID.
* Delete a refresh tokens
*
* @throws {RequiredError}
*/
async delete(
requestParameters: DeleteRefreshTokenRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<void>> {
runtime.validateRequiredRequestParams(requestParameters, ['id']);

const response = await this.request(
{
path: `/refresh-tokens/{id}`.replace(
'{id}',
encodeURIComponent(String(requestParameters.id))
),
method: 'DELETE',
},
initOverrides
);

return runtime.VoidApiResponse.fromResponse(response);
}

/**
* Retrieve refresh token information.
* Get a refresh token
*
* @throws {RequiredError}
*/
async get(
requestParameters: GetRefreshTokenRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<GetRefreshToken200Response>> {
runtime.validateRequiredRequestParams(requestParameters, ['id']);

const response = await this.request(
{
path: `/refresh-tokens/{id}`.replace(
'{id}',
encodeURIComponent(String(requestParameters.id))
),
method: 'GET',
},
initOverrides
);

return runtime.JSONApiResponse.fromResponse(response);
}
}
60 changes: 60 additions & 0 deletions src/management/__generated/managers/sessions-manager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import * as runtime from '../../../lib/runtime.js';
import type { InitOverride, ApiResponse } from '../../../lib/runtime.js';
import type {
GetSession200Response,
DeleteSessionRequest,
GetSessionRequest,
} from '../models/index.js';

const { BaseAPI } = runtime;

/**
*
*/
export class SessionsManager extends BaseAPI {
/**
* Delete a session by ID.
* Delete session
*
* @throws {RequiredError}
*/
async delete(
requestParameters: DeleteSessionRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<void>> {
runtime.validateRequiredRequestParams(requestParameters, ['id']);

const response = await this.request(
{
path: `/sessions/{id}`.replace('{id}', encodeURIComponent(String(requestParameters.id))),
method: 'DELETE',
},
initOverrides
);

return runtime.VoidApiResponse.fromResponse(response);
}

/**
* Retrieve session information.
* Get session
*
* @throws {RequiredError}
*/
async get(
requestParameters: GetSessionRequest,
initOverrides?: InitOverride
): Promise<ApiResponse<GetSession200Response>> {
runtime.validateRequiredRequestParams(requestParameters, ['id']);

const response = await this.request(
{
path: `/sessions/{id}`.replace('{id}', encodeURIComponent(String(requestParameters.id))),
method: 'GET',
},
initOverrides
);

return runtime.JSONApiResponse.fromResponse(response);
}
}
Loading
Loading