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:
80
ts_interfaces/data/admin.ts
Normal file
80
ts_interfaces/data/admin.ts
Normal file
@@ -0,0 +1,80 @@
|
||||
// ============================================================================
|
||||
// Admin Data Types
|
||||
// ============================================================================
|
||||
|
||||
import type { TAuthProviderStatus, TAuthProviderType } from './auth.ts';
|
||||
|
||||
export interface IOAuthConfig {
|
||||
clientId: string;
|
||||
clientSecretEncrypted: string;
|
||||
issuer: string;
|
||||
authorizationUrl?: string;
|
||||
tokenUrl?: string;
|
||||
userInfoUrl?: string;
|
||||
scopes: string[];
|
||||
callbackUrl: string;
|
||||
}
|
||||
|
||||
export interface ILdapConfig {
|
||||
serverUrl: string;
|
||||
bindDn: string;
|
||||
bindPasswordEncrypted: string;
|
||||
baseDn: string;
|
||||
userSearchFilter: string;
|
||||
tlsEnabled: boolean;
|
||||
tlsCaCert?: string;
|
||||
}
|
||||
|
||||
export interface IAttributeMapping {
|
||||
email: string;
|
||||
username: string;
|
||||
displayName: string;
|
||||
avatarUrl?: string;
|
||||
groups?: string;
|
||||
}
|
||||
|
||||
export interface IProvisioningSettings {
|
||||
jitEnabled: boolean;
|
||||
autoLinkByEmail: boolean;
|
||||
allowedEmailDomains?: string[];
|
||||
}
|
||||
|
||||
export interface IAuthProvider {
|
||||
id: string;
|
||||
name: string;
|
||||
displayName: string;
|
||||
type: TAuthProviderType;
|
||||
status: TAuthProviderStatus;
|
||||
priority: number;
|
||||
oauthConfig?: IOAuthConfig;
|
||||
ldapConfig?: ILdapConfig;
|
||||
attributeMapping: IAttributeMapping;
|
||||
provisioning: IProvisioningSettings;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
createdById: string;
|
||||
lastTestedAt?: string;
|
||||
lastTestResult?: 'success' | 'failure';
|
||||
lastTestError?: string;
|
||||
}
|
||||
|
||||
export interface IPlatformAuthSettings {
|
||||
localAuthEnabled: boolean;
|
||||
allowUserRegistration: boolean;
|
||||
sessionDurationMinutes: number;
|
||||
defaultProviderId?: string;
|
||||
}
|
||||
|
||||
export interface IPlatformSettings {
|
||||
id: string;
|
||||
auth: IPlatformAuthSettings;
|
||||
updatedAt: string;
|
||||
updatedById?: string;
|
||||
}
|
||||
|
||||
export interface IConnectionTestResult {
|
||||
success: boolean;
|
||||
latencyMs: number;
|
||||
serverInfo?: Record<string, unknown>;
|
||||
error?: string;
|
||||
}
|
||||
79
ts_interfaces/data/audit.ts
Normal file
79
ts_interfaces/data/audit.ts
Normal file
@@ -0,0 +1,79 @@
|
||||
// ============================================================================
|
||||
// Audit Data Types
|
||||
// ============================================================================
|
||||
|
||||
export type TAuditAction =
|
||||
| 'AUTH_LOGIN'
|
||||
| 'AUTH_LOGOUT'
|
||||
| 'AUTH_FAILED'
|
||||
| 'AUTH_MFA_ENABLED'
|
||||
| 'AUTH_MFA_DISABLED'
|
||||
| 'AUTH_PASSWORD_CHANGED'
|
||||
| 'AUTH_PASSWORD_RESET'
|
||||
| 'TOKEN_CREATED'
|
||||
| 'TOKEN_USED'
|
||||
| 'TOKEN_REVOKED'
|
||||
| 'TOKEN_EXPIRED'
|
||||
| 'USER_CREATED'
|
||||
| 'USER_UPDATED'
|
||||
| 'USER_DELETED'
|
||||
| 'USER_SUSPENDED'
|
||||
| 'USER_ACTIVATED'
|
||||
| 'ORG_CREATED'
|
||||
| 'ORG_UPDATED'
|
||||
| 'ORG_DELETED'
|
||||
| 'ORG_MEMBER_ADDED'
|
||||
| 'ORG_MEMBER_REMOVED'
|
||||
| 'ORG_MEMBER_ROLE_CHANGED'
|
||||
| 'TEAM_CREATED'
|
||||
| 'TEAM_UPDATED'
|
||||
| 'TEAM_DELETED'
|
||||
| 'TEAM_MEMBER_ADDED'
|
||||
| 'TEAM_MEMBER_REMOVED'
|
||||
| 'REPO_CREATED'
|
||||
| 'REPO_UPDATED'
|
||||
| 'REPO_DELETED'
|
||||
| 'REPO_VISIBILITY_CHANGED'
|
||||
| 'REPO_PERMISSION_GRANTED'
|
||||
| 'REPO_PERMISSION_REVOKED'
|
||||
| 'PACKAGE_PUSHED'
|
||||
| 'PACKAGE_PULLED'
|
||||
| 'PACKAGE_DELETED'
|
||||
| 'PACKAGE_DEPRECATED'
|
||||
| 'AUTH_PROVIDER_CREATED'
|
||||
| 'AUTH_PROVIDER_UPDATED'
|
||||
| 'AUTH_PROVIDER_DELETED'
|
||||
| 'AUTH_PROVIDER_TESTED'
|
||||
| 'PLATFORM_SETTINGS_UPDATED'
|
||||
| 'SECURITY_SCAN_COMPLETED'
|
||||
| 'SECURITY_VULNERABILITY_FOUND'
|
||||
| 'SECURITY_IP_BLOCKED'
|
||||
| 'SECURITY_RATE_LIMITED';
|
||||
|
||||
export type TAuditResourceType =
|
||||
| 'user'
|
||||
| 'organization'
|
||||
| 'team'
|
||||
| 'repository'
|
||||
| 'package'
|
||||
| 'api_token'
|
||||
| 'session'
|
||||
| 'auth_provider'
|
||||
| 'platform_settings'
|
||||
| 'system';
|
||||
|
||||
export interface IAuditEntry {
|
||||
id: string;
|
||||
actorId?: string;
|
||||
actorType: 'user' | 'api_token' | 'system' | 'anonymous';
|
||||
action: TAuditAction;
|
||||
resourceType: TAuditResourceType;
|
||||
resourceId?: string;
|
||||
resourceName?: string;
|
||||
organizationId?: string;
|
||||
repositoryId?: string;
|
||||
success: boolean;
|
||||
errorCode?: string;
|
||||
timestamp: string;
|
||||
metadata: Record<string, unknown>;
|
||||
}
|
||||
49
ts_interfaces/data/auth.ts
Normal file
49
ts_interfaces/data/auth.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
// ============================================================================
|
||||
// Auth Data Types
|
||||
// ============================================================================
|
||||
|
||||
export type TUserStatus = 'active' | 'suspended' | 'pending_verification';
|
||||
|
||||
export interface IIdentity {
|
||||
jwt: string;
|
||||
refreshJwt: string;
|
||||
userId: string;
|
||||
email: string;
|
||||
username: string;
|
||||
displayName: string;
|
||||
isSystemAdmin: boolean;
|
||||
expiresAt: number;
|
||||
sessionId: string;
|
||||
}
|
||||
|
||||
export interface IUser {
|
||||
id: string;
|
||||
email: string;
|
||||
username: string;
|
||||
displayName: string;
|
||||
avatarUrl?: string;
|
||||
isSystemAdmin: boolean;
|
||||
isActive: boolean;
|
||||
createdAt: string;
|
||||
lastLoginAt?: string;
|
||||
}
|
||||
|
||||
export interface ISession {
|
||||
id: string;
|
||||
userId: string;
|
||||
userAgent: string;
|
||||
ipAddress: string;
|
||||
isValid: boolean;
|
||||
lastActivityAt: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface IPublicAuthProvider {
|
||||
id: string;
|
||||
name: string;
|
||||
displayName: string;
|
||||
type: TAuthProviderType;
|
||||
}
|
||||
|
||||
export type TAuthProviderType = 'oidc' | 'ldap';
|
||||
export type TAuthProviderStatus = 'active' | 'disabled' | 'testing';
|
||||
7
ts_interfaces/data/index.ts
Normal file
7
ts_interfaces/data/index.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export * from './auth.ts';
|
||||
export * from './organization.ts';
|
||||
export * from './repository.ts';
|
||||
export * from './package.ts';
|
||||
export * from './token.ts';
|
||||
export * from './audit.ts';
|
||||
export * from './admin.ts';
|
||||
48
ts_interfaces/data/organization.ts
Normal file
48
ts_interfaces/data/organization.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
// ============================================================================
|
||||
// Organization Data Types
|
||||
// ============================================================================
|
||||
|
||||
export type TOrganizationPlan = 'free' | 'team' | 'enterprise';
|
||||
export type TOrganizationRole = 'owner' | 'admin' | 'member';
|
||||
|
||||
export interface IOrganization {
|
||||
id: string;
|
||||
name: string;
|
||||
displayName: string;
|
||||
description?: string;
|
||||
avatarUrl?: string;
|
||||
website?: string;
|
||||
isPublic: boolean;
|
||||
memberCount: number;
|
||||
plan: TOrganizationPlan;
|
||||
usedStorageBytes: number;
|
||||
storageQuotaBytes: number;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface IOrganizationDetail extends IOrganization {
|
||||
settings?: IOrganizationSettings;
|
||||
}
|
||||
|
||||
export interface IOrganizationSettings {
|
||||
requireMfa: boolean;
|
||||
allowPublicRepositories: boolean;
|
||||
defaultRepositoryVisibility: TRepositoryVisibility;
|
||||
allowedProtocols: TRegistryProtocol[];
|
||||
}
|
||||
|
||||
export interface IOrganizationMember {
|
||||
userId: string;
|
||||
role: TOrganizationRole;
|
||||
addedAt: string;
|
||||
user: {
|
||||
username: string;
|
||||
displayName: string;
|
||||
avatarUrl?: string;
|
||||
} | null;
|
||||
}
|
||||
|
||||
// Re-export types used by settings
|
||||
import type { TRepositoryVisibility } from './repository.ts';
|
||||
import type { TRegistryProtocol } from './package.ts';
|
||||
export type { TRegistryProtocol, TRepositoryVisibility };
|
||||
53
ts_interfaces/data/package.ts
Normal file
53
ts_interfaces/data/package.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
// ============================================================================
|
||||
// Package Data Types
|
||||
// ============================================================================
|
||||
|
||||
export type TRegistryProtocol =
|
||||
| 'oci'
|
||||
| 'npm'
|
||||
| 'maven'
|
||||
| 'cargo'
|
||||
| 'composer'
|
||||
| 'pypi'
|
||||
| 'rubygems';
|
||||
|
||||
export interface IPackage {
|
||||
id: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
protocol: TRegistryProtocol;
|
||||
organizationId: string;
|
||||
repositoryId: string;
|
||||
latestVersion?: string;
|
||||
isPrivate: boolean;
|
||||
downloadCount: number;
|
||||
starCount: number;
|
||||
storageBytes: number;
|
||||
updatedAt: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface IPackageDetail extends IPackage {
|
||||
distTags: Record<string, string>;
|
||||
versions: string[];
|
||||
}
|
||||
|
||||
export interface IPackageVersion {
|
||||
version: string;
|
||||
publishedAt: string;
|
||||
size: number;
|
||||
downloads: number;
|
||||
checksum?: {
|
||||
sha256?: string;
|
||||
sha512?: string;
|
||||
md5?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IPackageSearchParams {
|
||||
query?: string;
|
||||
protocol?: TRegistryProtocol;
|
||||
organizationId?: string;
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
}
|
||||
22
ts_interfaces/data/repository.ts
Normal file
22
ts_interfaces/data/repository.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
// ============================================================================
|
||||
// Repository Data Types
|
||||
// ============================================================================
|
||||
|
||||
import type { TRegistryProtocol } from './package.ts';
|
||||
|
||||
export type TRepositoryVisibility = 'public' | 'private' | 'internal';
|
||||
export type TRepositoryRole = 'admin' | 'maintainer' | 'developer' | 'reader';
|
||||
|
||||
export interface IRepository {
|
||||
id: string;
|
||||
organizationId: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
protocol: TRegistryProtocol;
|
||||
visibility: TRepositoryVisibility;
|
||||
isPublic: boolean;
|
||||
packageCount: number;
|
||||
storageBytes: number;
|
||||
downloadCount: number;
|
||||
createdAt: string;
|
||||
}
|
||||
33
ts_interfaces/data/token.ts
Normal file
33
ts_interfaces/data/token.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
// ============================================================================
|
||||
// Token Data Types
|
||||
// ============================================================================
|
||||
|
||||
import type { TRegistryProtocol } from './package.ts';
|
||||
|
||||
export type TTokenAction = 'read' | 'write' | 'delete' | '*';
|
||||
|
||||
export interface ITokenScope {
|
||||
protocol: TRegistryProtocol | '*';
|
||||
organizationId?: string;
|
||||
repositoryId?: string;
|
||||
actions: TTokenAction[];
|
||||
}
|
||||
|
||||
export interface IToken {
|
||||
id: string;
|
||||
name: string;
|
||||
tokenPrefix: string;
|
||||
protocols: TRegistryProtocol[];
|
||||
scopes: ITokenScope[];
|
||||
organizationId?: string;
|
||||
createdById?: string;
|
||||
expiresAt?: string;
|
||||
lastUsedAt?: string;
|
||||
usageCount: number;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface ITokenCreateResult extends IToken {
|
||||
token: string;
|
||||
warning: string;
|
||||
}
|
||||
5
ts_interfaces/index.ts
Normal file
5
ts_interfaces/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import * as plugins from './plugins.ts';
|
||||
import * as data from './data/index.ts';
|
||||
import * as requests from './requests/index.ts';
|
||||
|
||||
export { data, plugins, requests };
|
||||
3
ts_interfaces/plugins.ts
Normal file
3
ts_interfaces/plugins.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import * as typedrequestInterfaces from '@api.global/typedrequest-interfaces';
|
||||
|
||||
export { typedrequestInterfaces };
|
||||
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