feat(opsserver,web): replace the Angular UI and REST management layer with a TypedRequest-based ops server and bundled web frontend
This commit is contained in:
137
ts_interfaces/requests/admin.ts
Normal file
137
ts_interfaces/requests/admin.ts
Normal file
@@ -0,0 +1,137 @@
|
||||
import * as plugins from '../plugins.ts';
|
||||
import * as data from '../data/index.ts';
|
||||
|
||||
// ============================================================================
|
||||
// Admin Requests
|
||||
// ============================================================================
|
||||
|
||||
export interface IReq_GetAdminProviders extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetAdminProviders
|
||||
> {
|
||||
method: 'getAdminProviders';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
};
|
||||
response: {
|
||||
providers: data.IAuthProvider[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_CreateAdminProvider extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_CreateAdminProvider
|
||||
> {
|
||||
method: 'createAdminProvider';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
name: string;
|
||||
displayName: string;
|
||||
type: data.TAuthProviderType;
|
||||
oauthConfig?: data.IOAuthConfig;
|
||||
ldapConfig?: data.ILdapConfig;
|
||||
attributeMapping?: data.IAttributeMapping;
|
||||
provisioning?: data.IProvisioningSettings;
|
||||
};
|
||||
response: {
|
||||
provider: data.IAuthProvider;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_GetAdminProvider extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetAdminProvider
|
||||
> {
|
||||
method: 'getAdminProvider';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
providerId: string;
|
||||
};
|
||||
response: {
|
||||
provider: data.IAuthProvider;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_UpdateAdminProvider extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_UpdateAdminProvider
|
||||
> {
|
||||
method: 'updateAdminProvider';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
providerId: string;
|
||||
displayName?: string;
|
||||
status?: data.TAuthProviderStatus;
|
||||
priority?: number;
|
||||
oauthConfig?: Partial<data.IOAuthConfig>;
|
||||
ldapConfig?: Partial<data.ILdapConfig>;
|
||||
attributeMapping?: Partial<data.IAttributeMapping>;
|
||||
provisioning?: Partial<data.IProvisioningSettings>;
|
||||
};
|
||||
response: {
|
||||
provider: data.IAuthProvider;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_DeleteAdminProvider extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_DeleteAdminProvider
|
||||
> {
|
||||
method: 'deleteAdminProvider';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
providerId: string;
|
||||
};
|
||||
response: {
|
||||
message: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_TestAdminProvider extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_TestAdminProvider
|
||||
> {
|
||||
method: 'testAdminProvider';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
providerId: string;
|
||||
};
|
||||
response: {
|
||||
result: data.IConnectionTestResult;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_GetPlatformSettings extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetPlatformSettings
|
||||
> {
|
||||
method: 'getPlatformSettings';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
};
|
||||
response: {
|
||||
settings: data.IPlatformSettings;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_UpdatePlatformSettings extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_UpdatePlatformSettings
|
||||
> {
|
||||
method: 'updatePlatformSettings';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
auth?: Partial<data.IPlatformAuthSettings>;
|
||||
};
|
||||
response: {
|
||||
settings: data.IPlatformSettings;
|
||||
};
|
||||
}
|
||||
33
ts_interfaces/requests/audit.ts
Normal file
33
ts_interfaces/requests/audit.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import * as plugins from '../plugins.ts';
|
||||
import * as data from '../data/index.ts';
|
||||
|
||||
// ============================================================================
|
||||
// Audit Requests
|
||||
// ============================================================================
|
||||
|
||||
export interface IReq_QueryAudit extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_QueryAudit
|
||||
> {
|
||||
method: 'queryAudit';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
organizationId?: string;
|
||||
repositoryId?: string;
|
||||
resourceType?: data.TAuditResourceType;
|
||||
actions?: data.TAuditAction[];
|
||||
success?: boolean;
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
actorId?: string;
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
};
|
||||
response: {
|
||||
logs: data.IAuditEntry[];
|
||||
total: number;
|
||||
limit: number;
|
||||
offset: number;
|
||||
};
|
||||
}
|
||||
82
ts_interfaces/requests/auth.ts
Normal file
82
ts_interfaces/requests/auth.ts
Normal file
@@ -0,0 +1,82 @@
|
||||
import * as plugins from '../plugins.ts';
|
||||
import * as data from '../data/index.ts';
|
||||
|
||||
// ============================================================================
|
||||
// Auth Requests
|
||||
// ============================================================================
|
||||
|
||||
export interface IReq_Login extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_Login
|
||||
> {
|
||||
method: 'login';
|
||||
request: {
|
||||
email: string;
|
||||
password: string;
|
||||
};
|
||||
response: {
|
||||
identity?: data.IIdentity;
|
||||
user?: data.IUser;
|
||||
errorCode?: string;
|
||||
errorMessage?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_RefreshToken extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_RefreshToken
|
||||
> {
|
||||
method: 'refreshToken';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
};
|
||||
response: {
|
||||
identity: data.IIdentity;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_Logout extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_Logout
|
||||
> {
|
||||
method: 'logout';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
sessionId?: string;
|
||||
all?: boolean;
|
||||
};
|
||||
response: {
|
||||
message: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_GetMe extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetMe
|
||||
> {
|
||||
method: 'getMe';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
};
|
||||
response: {
|
||||
user: data.IUser;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_GetAuthProviders extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetAuthProviders
|
||||
> {
|
||||
method: 'getAuthProviders';
|
||||
request: {};
|
||||
response: {
|
||||
providers: data.IPublicAuthProvider[];
|
||||
localAuthEnabled: boolean;
|
||||
defaultProviderId?: string;
|
||||
};
|
||||
}
|
||||
9
ts_interfaces/requests/index.ts
Normal file
9
ts_interfaces/requests/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export * from './auth.ts';
|
||||
export * from './oauth.ts';
|
||||
export * from './organizations.ts';
|
||||
export * from './repositories.ts';
|
||||
export * from './packages.ts';
|
||||
export * from './tokens.ts';
|
||||
export * from './audit.ts';
|
||||
export * from './admin.ts';
|
||||
export * from './users.ts';
|
||||
61
ts_interfaces/requests/oauth.ts
Normal file
61
ts_interfaces/requests/oauth.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
import * as plugins from '../plugins.ts';
|
||||
import * as data from '../data/index.ts';
|
||||
|
||||
// ============================================================================
|
||||
// OAuth / External Auth Requests
|
||||
// ============================================================================
|
||||
|
||||
export interface IReq_OAuthAuthorize extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_OAuthAuthorize
|
||||
> {
|
||||
method: 'oauthAuthorize';
|
||||
request: {
|
||||
providerId: string;
|
||||
returnUrl?: string;
|
||||
};
|
||||
response: {
|
||||
redirectUrl: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_OAuthCallback extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_OAuthCallback
|
||||
> {
|
||||
method: 'oauthCallback';
|
||||
request: {
|
||||
providerId: string;
|
||||
code: string;
|
||||
state: string;
|
||||
};
|
||||
response: {
|
||||
identity?: data.IIdentity;
|
||||
user?: data.IUser;
|
||||
isNewUser?: boolean;
|
||||
errorCode?: string;
|
||||
errorMessage?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_LdapLogin extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_LdapLogin
|
||||
> {
|
||||
method: 'ldapLogin';
|
||||
request: {
|
||||
providerId: string;
|
||||
username: string;
|
||||
password: string;
|
||||
};
|
||||
response: {
|
||||
identity?: data.IIdentity;
|
||||
user?: data.IUser;
|
||||
isNewUser?: boolean;
|
||||
errorCode?: string;
|
||||
errorMessage?: string;
|
||||
};
|
||||
}
|
||||
161
ts_interfaces/requests/organizations.ts
Normal file
161
ts_interfaces/requests/organizations.ts
Normal file
@@ -0,0 +1,161 @@
|
||||
import * as plugins from '../plugins.ts';
|
||||
import * as data from '../data/index.ts';
|
||||
|
||||
// ============================================================================
|
||||
// Organization Requests
|
||||
// ============================================================================
|
||||
|
||||
export interface IReq_GetOrganizations extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetOrganizations
|
||||
> {
|
||||
method: 'getOrganizations';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
};
|
||||
response: {
|
||||
organizations: data.IOrganization[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_GetOrganization extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetOrganization
|
||||
> {
|
||||
method: 'getOrganization';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
organizationId: string;
|
||||
};
|
||||
response: {
|
||||
organization: data.IOrganizationDetail;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_CreateOrganization extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_CreateOrganization
|
||||
> {
|
||||
method: 'createOrganization';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
name: string;
|
||||
displayName?: string;
|
||||
description?: string;
|
||||
isPublic?: boolean;
|
||||
};
|
||||
response: {
|
||||
organization: data.IOrganization;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_UpdateOrganization extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_UpdateOrganization
|
||||
> {
|
||||
method: 'updateOrganization';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
organizationId: string;
|
||||
displayName?: string;
|
||||
description?: string;
|
||||
avatarUrl?: string;
|
||||
website?: string;
|
||||
isPublic?: boolean;
|
||||
settings?: Partial<data.IOrganizationSettings>;
|
||||
};
|
||||
response: {
|
||||
organization: data.IOrganization;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_DeleteOrganization extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_DeleteOrganization
|
||||
> {
|
||||
method: 'deleteOrganization';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
organizationId: string;
|
||||
};
|
||||
response: {
|
||||
message: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_GetOrganizationMembers extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetOrganizationMembers
|
||||
> {
|
||||
method: 'getOrganizationMembers';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
organizationId: string;
|
||||
};
|
||||
response: {
|
||||
members: data.IOrganizationMember[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_AddOrganizationMember extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_AddOrganizationMember
|
||||
> {
|
||||
method: 'addOrganizationMember';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
organizationId: string;
|
||||
userId: string;
|
||||
role: data.TOrganizationRole;
|
||||
};
|
||||
response: {
|
||||
member: {
|
||||
userId: string;
|
||||
role: data.TOrganizationRole;
|
||||
addedAt: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_UpdateOrganizationMember extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_UpdateOrganizationMember
|
||||
> {
|
||||
method: 'updateOrganizationMember';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
organizationId: string;
|
||||
userId: string;
|
||||
role: data.TOrganizationRole;
|
||||
};
|
||||
response: {
|
||||
member: {
|
||||
userId: string;
|
||||
role: data.TOrganizationRole;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_RemoveOrganizationMember extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_RemoveOrganizationMember
|
||||
> {
|
||||
method: 'removeOrganizationMember';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
organizationId: string;
|
||||
userId: string;
|
||||
};
|
||||
response: {
|
||||
message: string;
|
||||
};
|
||||
}
|
||||
92
ts_interfaces/requests/packages.ts
Normal file
92
ts_interfaces/requests/packages.ts
Normal file
@@ -0,0 +1,92 @@
|
||||
import * as plugins from '../plugins.ts';
|
||||
import * as data from '../data/index.ts';
|
||||
|
||||
// ============================================================================
|
||||
// Package Requests
|
||||
// ============================================================================
|
||||
|
||||
export interface IReq_SearchPackages extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_SearchPackages
|
||||
> {
|
||||
method: 'searchPackages';
|
||||
request: {
|
||||
identity?: data.IIdentity;
|
||||
query?: string;
|
||||
protocol?: data.TRegistryProtocol;
|
||||
organizationId?: string;
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
};
|
||||
response: {
|
||||
packages: data.IPackage[];
|
||||
total: number;
|
||||
limit: number;
|
||||
offset: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_GetPackage extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetPackage
|
||||
> {
|
||||
method: 'getPackage';
|
||||
request: {
|
||||
identity?: data.IIdentity;
|
||||
packageId: string;
|
||||
};
|
||||
response: {
|
||||
package: data.IPackageDetail;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_GetPackageVersions extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetPackageVersions
|
||||
> {
|
||||
method: 'getPackageVersions';
|
||||
request: {
|
||||
identity?: data.IIdentity;
|
||||
packageId: string;
|
||||
};
|
||||
response: {
|
||||
packageId: string;
|
||||
packageName: string;
|
||||
distTags: Record<string, string>;
|
||||
versions: data.IPackageVersion[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_DeletePackage extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_DeletePackage
|
||||
> {
|
||||
method: 'deletePackage';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
packageId: string;
|
||||
};
|
||||
response: {
|
||||
message: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_DeletePackageVersion extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_DeletePackageVersion
|
||||
> {
|
||||
method: 'deletePackageVersion';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
packageId: string;
|
||||
version: string;
|
||||
};
|
||||
response: {
|
||||
message: string;
|
||||
};
|
||||
}
|
||||
87
ts_interfaces/requests/repositories.ts
Normal file
87
ts_interfaces/requests/repositories.ts
Normal file
@@ -0,0 +1,87 @@
|
||||
import * as plugins from '../plugins.ts';
|
||||
import * as data from '../data/index.ts';
|
||||
|
||||
// ============================================================================
|
||||
// Repository Requests
|
||||
// ============================================================================
|
||||
|
||||
export interface IReq_GetRepositories extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetRepositories
|
||||
> {
|
||||
method: 'getRepositories';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
organizationId: string;
|
||||
};
|
||||
response: {
|
||||
repositories: data.IRepository[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_GetRepository extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetRepository
|
||||
> {
|
||||
method: 'getRepository';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
repositoryId: string;
|
||||
};
|
||||
response: {
|
||||
repository: data.IRepository;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_CreateRepository extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_CreateRepository
|
||||
> {
|
||||
method: 'createRepository';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
organizationId: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
protocol?: data.TRegistryProtocol;
|
||||
visibility?: data.TRepositoryVisibility;
|
||||
};
|
||||
response: {
|
||||
repository: data.IRepository;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_UpdateRepository extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_UpdateRepository
|
||||
> {
|
||||
method: 'updateRepository';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
repositoryId: string;
|
||||
description?: string;
|
||||
visibility?: data.TRepositoryVisibility;
|
||||
};
|
||||
response: {
|
||||
repository: data.IRepository;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_DeleteRepository extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_DeleteRepository
|
||||
> {
|
||||
method: 'deleteRepository';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
repositoryId: string;
|
||||
};
|
||||
response: {
|
||||
message: string;
|
||||
};
|
||||
}
|
||||
55
ts_interfaces/requests/tokens.ts
Normal file
55
ts_interfaces/requests/tokens.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import * as plugins from '../plugins.ts';
|
||||
import * as data from '../data/index.ts';
|
||||
|
||||
// ============================================================================
|
||||
// Token Requests
|
||||
// ============================================================================
|
||||
|
||||
export interface IReq_GetTokens extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetTokens
|
||||
> {
|
||||
method: 'getTokens';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
organizationId?: string;
|
||||
};
|
||||
response: {
|
||||
tokens: data.IToken[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_CreateToken extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_CreateToken
|
||||
> {
|
||||
method: 'createToken';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
name: string;
|
||||
organizationId?: string;
|
||||
protocols: data.TRegistryProtocol[];
|
||||
scopes: data.ITokenScope[];
|
||||
expiresInDays?: number;
|
||||
};
|
||||
response: {
|
||||
token: data.ITokenCreateResult;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_RevokeToken extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_RevokeToken
|
||||
> {
|
||||
method: 'revokeToken';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
tokenId: string;
|
||||
};
|
||||
response: {
|
||||
message: string;
|
||||
};
|
||||
}
|
||||
115
ts_interfaces/requests/users.ts
Normal file
115
ts_interfaces/requests/users.ts
Normal file
@@ -0,0 +1,115 @@
|
||||
import * as plugins from '../plugins.ts';
|
||||
import * as data from '../data/index.ts';
|
||||
|
||||
// ============================================================================
|
||||
// User Requests
|
||||
// ============================================================================
|
||||
|
||||
export interface IReq_GetUsers extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetUsers
|
||||
> {
|
||||
method: 'getUsers';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
};
|
||||
response: {
|
||||
users: data.IUser[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_GetUser extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetUser
|
||||
> {
|
||||
method: 'getUser';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
userId: string;
|
||||
};
|
||||
response: {
|
||||
user: data.IUser;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_UpdateUser extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_UpdateUser
|
||||
> {
|
||||
method: 'updateUser';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
userId: string;
|
||||
displayName?: string;
|
||||
avatarUrl?: string;
|
||||
password?: string;
|
||||
isActive?: boolean;
|
||||
isSystemAdmin?: boolean;
|
||||
};
|
||||
response: {
|
||||
user: data.IUser;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_GetUserSessions extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetUserSessions
|
||||
> {
|
||||
method: 'getUserSessions';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
};
|
||||
response: {
|
||||
sessions: data.ISession[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_RevokeSession extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_RevokeSession
|
||||
> {
|
||||
method: 'revokeSession';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
sessionId: string;
|
||||
};
|
||||
response: {
|
||||
message: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_ChangePassword extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_ChangePassword
|
||||
> {
|
||||
method: 'changePassword';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
currentPassword: string;
|
||||
newPassword: string;
|
||||
};
|
||||
response: {
|
||||
message: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_DeleteAccount extends
|
||||
plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_DeleteAccount
|
||||
> {
|
||||
method: 'deleteAccount';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
password: string;
|
||||
};
|
||||
response: {
|
||||
message: string;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user