131 lines
2.8 KiB
TypeScript
131 lines
2.8 KiB
TypeScript
import * as plugins from '../loint-reception.plugins.js';
|
|
import * as data from '../data/index.js';
|
|
|
|
/**
|
|
* Check if the current user is a global admin
|
|
*/
|
|
export interface IReq_CheckGlobalAdmin
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
IReq_CheckGlobalAdmin
|
|
> {
|
|
method: 'checkGlobalAdmin';
|
|
request: {
|
|
jwt: string;
|
|
};
|
|
response: {
|
|
isGlobalAdmin: boolean;
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Get all global apps with statistics (admin only)
|
|
*/
|
|
export interface IReq_GetGlobalAppStats
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
IReq_GetGlobalAppStats
|
|
> {
|
|
method: 'getGlobalAppStats';
|
|
request: {
|
|
jwt: string;
|
|
};
|
|
response: {
|
|
apps: Array<{
|
|
app: data.IGlobalApp;
|
|
connectionCount: number;
|
|
}>;
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Create a new global app (admin only)
|
|
*/
|
|
export interface IReq_CreateGlobalApp
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
IReq_CreateGlobalApp
|
|
> {
|
|
method: 'createGlobalApp';
|
|
request: {
|
|
jwt: string;
|
|
name: string;
|
|
description: string;
|
|
logoUrl: string;
|
|
appUrl: string;
|
|
category: string;
|
|
redirectUris: string[];
|
|
allowedScopes: string[];
|
|
};
|
|
response: {
|
|
app: data.IGlobalApp;
|
|
clientSecret: string; // Only shown once on creation
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Update an existing global app (admin only)
|
|
*/
|
|
export interface IReq_UpdateGlobalApp
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
IReq_UpdateGlobalApp
|
|
> {
|
|
method: 'updateGlobalApp';
|
|
request: {
|
|
jwt: string;
|
|
appId: string;
|
|
updates: {
|
|
name?: string;
|
|
description?: string;
|
|
logoUrl?: string;
|
|
appUrl?: string;
|
|
category?: string;
|
|
isActive?: boolean;
|
|
redirectUris?: string[];
|
|
allowedScopes?: string[];
|
|
};
|
|
};
|
|
response: {
|
|
app: data.IGlobalApp;
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Delete a global app (admin only)
|
|
*/
|
|
export interface IReq_DeleteGlobalApp
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
IReq_DeleteGlobalApp
|
|
> {
|
|
method: 'deleteGlobalApp';
|
|
request: {
|
|
jwt: string;
|
|
appId: string;
|
|
};
|
|
response: {
|
|
success: boolean;
|
|
disconnectedOrganizations: number;
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Regenerate OAuth credentials for a global app (admin only)
|
|
*/
|
|
export interface IReq_RegenerateAppCredentials
|
|
extends plugins.typedRequestInterfaces.implementsTR<
|
|
plugins.typedRequestInterfaces.ITypedRequest,
|
|
IReq_RegenerateAppCredentials
|
|
> {
|
|
method: 'regenerateAppCredentials';
|
|
request: {
|
|
jwt: string;
|
|
appId: string;
|
|
};
|
|
response: {
|
|
clientId: string;
|
|
clientSecret: string; // Only shown once
|
|
};
|
|
}
|