module federation
This commit is contained in:
23
web/@mf-types/index.d.ts
vendored
Normal file
23
web/@mf-types/index.d.ts
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
import type { PackageType as PackageType_0,RemoteKeys as RemoteKeys_0 } from './kms/apis.d.ts';
|
||||
declare module "@module-federation/runtime" {
|
||||
type RemoteKeys = RemoteKeys_0;
|
||||
type PackageType<T, Y=any> = T extends RemoteKeys_0 ? PackageType_0<T> :
|
||||
Y ;
|
||||
export function loadRemote<T extends RemoteKeys,Y>(packageName: T): Promise<PackageType<T, Y>>;
|
||||
export function loadRemote<T extends string,Y>(packageName: T): Promise<PackageType<T, Y>>;
|
||||
}
|
||||
declare module "@module-federation/enhanced/runtime" {
|
||||
type RemoteKeys = RemoteKeys_0;
|
||||
type PackageType<T, Y=any> = T extends RemoteKeys_0 ? PackageType_0<T> :
|
||||
Y ;
|
||||
export function loadRemote<T extends RemoteKeys,Y>(packageName: T): Promise<PackageType<T, Y>>;
|
||||
export function loadRemote<T extends string,Y>(packageName: T): Promise<PackageType<T, Y>>;
|
||||
}
|
||||
declare module "@module-federation/runtime-tools" {
|
||||
type RemoteKeys = RemoteKeys_0;
|
||||
type PackageType<T, Y=any> = T extends RemoteKeys_0 ? PackageType_0<T> :
|
||||
Y ;
|
||||
export function loadRemote<T extends RemoteKeys,Y>(packageName: T): Promise<PackageType<T, Y>>;
|
||||
export function loadRemote<T extends string,Y>(packageName: T): Promise<PackageType<T, Y>>;
|
||||
}
|
||||
|
||||
2
web/@mf-types/kms/App.d.ts
vendored
Normal file
2
web/@mf-types/kms/App.d.ts
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
export * from './compiled-types/federated/KMSApp';
|
||||
export { default } from './compiled-types/federated/KMSApp';
|
||||
2
web/@mf-types/kms/SearchProvider.d.ts
vendored
Normal file
2
web/@mf-types/kms/SearchProvider.d.ts
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
export * from './compiled-types/federated/SearchProvider';
|
||||
export { default } from './compiled-types/federated/SearchProvider';
|
||||
3
web/@mf-types/kms/apis.d.ts
vendored
Normal file
3
web/@mf-types/kms/apis.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
|
||||
export type RemoteKeys = 'kms/App' | 'kms/SearchProvider';
|
||||
type PackageType<T> = T extends 'kms/SearchProvider' ? typeof import('kms/SearchProvider') :T extends 'kms/App' ? typeof import('kms/App') :any;
|
||||
3
web/@mf-types/kms/compiled-types/components/Applications.d.ts
vendored
Normal file
3
web/@mf-types/kms/compiled-types/components/Applications.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import React from 'react';
|
||||
declare const Applications: React.FC;
|
||||
export default Applications;
|
||||
3
web/@mf-types/kms/compiled-types/components/Audit.d.ts
vendored
Normal file
3
web/@mf-types/kms/compiled-types/components/Audit.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import React from 'react';
|
||||
declare const Audit: React.FC;
|
||||
export default Audit;
|
||||
3
web/@mf-types/kms/compiled-types/components/Dashboard.d.ts
vendored
Normal file
3
web/@mf-types/kms/compiled-types/components/Dashboard.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import React from 'react';
|
||||
declare const Dashboard: React.FC;
|
||||
export default Dashboard;
|
||||
3
web/@mf-types/kms/compiled-types/components/Login.d.ts
vendored
Normal file
3
web/@mf-types/kms/compiled-types/components/Login.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import React from 'react';
|
||||
declare const Login: React.FC;
|
||||
export default Login;
|
||||
3
web/@mf-types/kms/compiled-types/components/TokenTester.d.ts
vendored
Normal file
3
web/@mf-types/kms/compiled-types/components/TokenTester.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import React from 'react';
|
||||
declare const TokenTester: React.FC;
|
||||
export default TokenTester;
|
||||
3
web/@mf-types/kms/compiled-types/components/TokenTesterCallback.d.ts
vendored
Normal file
3
web/@mf-types/kms/compiled-types/components/TokenTesterCallback.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import React from 'react';
|
||||
declare const TokenTesterCallback: React.FC;
|
||||
export default TokenTesterCallback;
|
||||
3
web/@mf-types/kms/compiled-types/components/Tokens.d.ts
vendored
Normal file
3
web/@mf-types/kms/compiled-types/components/Tokens.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import React from 'react';
|
||||
declare const Tokens: React.FC;
|
||||
export default Tokens;
|
||||
3
web/@mf-types/kms/compiled-types/components/Users.d.ts
vendored
Normal file
3
web/@mf-types/kms/compiled-types/components/Users.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import React from 'react';
|
||||
declare const Users: React.FC;
|
||||
export default Users;
|
||||
17
web/@mf-types/kms/compiled-types/contexts/AuthContext.d.ts
vendored
Normal file
17
web/@mf-types/kms/compiled-types/contexts/AuthContext.d.ts
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
import React, { ReactNode } from 'react';
|
||||
interface User {
|
||||
email: string;
|
||||
permissions: string[];
|
||||
}
|
||||
interface AuthContextType {
|
||||
user: User | null;
|
||||
login: (email: string) => Promise<boolean>;
|
||||
logout: () => void;
|
||||
loading: boolean;
|
||||
}
|
||||
export declare const useAuth: () => AuthContextType;
|
||||
interface AuthProviderProps {
|
||||
children: ReactNode;
|
||||
}
|
||||
export declare const AuthProvider: React.FC<AuthProviderProps>;
|
||||
export {};
|
||||
3
web/@mf-types/kms/compiled-types/federated/KMSApp.d.ts
vendored
Normal file
3
web/@mf-types/kms/compiled-types/federated/KMSApp.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import React from 'react';
|
||||
declare const KMSApp: React.FC;
|
||||
export default KMSApp;
|
||||
9
web/@mf-types/kms/compiled-types/federated/SearchProvider.d.ts
vendored
Normal file
9
web/@mf-types/kms/compiled-types/federated/SearchProvider.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
interface SearchResult {
|
||||
id: string;
|
||||
title: string;
|
||||
description?: string;
|
||||
appId: string;
|
||||
action?: () => void;
|
||||
}
|
||||
export declare const kmsSearchProvider: (query: string) => Promise<SearchResult[]>;
|
||||
export default kmsSearchProvider;
|
||||
152
web/@mf-types/kms/compiled-types/services/apiService.d.ts
vendored
Normal file
152
web/@mf-types/kms/compiled-types/services/apiService.d.ts
vendored
Normal file
@ -0,0 +1,152 @@
|
||||
export interface Application {
|
||||
app_id: string;
|
||||
app_link: string;
|
||||
type: string[];
|
||||
callback_url: string;
|
||||
hmac_key: string;
|
||||
token_prefix?: string;
|
||||
token_renewal_duration: number;
|
||||
max_token_duration: number;
|
||||
owner: {
|
||||
type: string;
|
||||
name: string;
|
||||
owner: string;
|
||||
};
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
export interface StaticToken {
|
||||
id: string;
|
||||
app_id: string;
|
||||
owner: {
|
||||
type: string;
|
||||
name: string;
|
||||
owner: string;
|
||||
};
|
||||
type: string;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
export interface CreateApplicationRequest {
|
||||
app_id: string;
|
||||
app_link: string;
|
||||
type: string[];
|
||||
callback_url: string;
|
||||
token_prefix?: string;
|
||||
token_renewal_duration: string;
|
||||
max_token_duration: string;
|
||||
owner: {
|
||||
type: string;
|
||||
name: string;
|
||||
owner: string;
|
||||
};
|
||||
}
|
||||
export interface CreateTokenRequest {
|
||||
owner: {
|
||||
type: string;
|
||||
name: string;
|
||||
owner: string;
|
||||
};
|
||||
permissions: string[];
|
||||
}
|
||||
export interface CreateTokenResponse {
|
||||
id: string;
|
||||
token: string;
|
||||
permissions: string[];
|
||||
created_at: string;
|
||||
}
|
||||
export interface PaginatedResponse<T> {
|
||||
data: T[];
|
||||
limit: number;
|
||||
offset: number;
|
||||
count: number;
|
||||
}
|
||||
export interface VerifyRequest {
|
||||
app_id: string;
|
||||
user_id?: string;
|
||||
token: string;
|
||||
permissions?: string[];
|
||||
}
|
||||
export interface VerifyResponse {
|
||||
valid: boolean;
|
||||
permitted: boolean;
|
||||
user_id?: string;
|
||||
permissions: string[];
|
||||
permission_results?: Record<string, boolean>;
|
||||
expires_at?: string;
|
||||
max_valid_at?: string;
|
||||
token_type: string;
|
||||
claims?: Record<string, string>;
|
||||
error?: string;
|
||||
}
|
||||
export interface AuditEvent {
|
||||
id: string;
|
||||
type: string;
|
||||
status: string;
|
||||
timestamp: string;
|
||||
actor_id?: string;
|
||||
actor_ip?: string;
|
||||
user_agent?: string;
|
||||
resource_id?: string;
|
||||
resource_type?: string;
|
||||
action: string;
|
||||
description: string;
|
||||
details?: Record<string, any>;
|
||||
request_id?: string;
|
||||
session_id?: string;
|
||||
}
|
||||
export interface AuditQueryParams {
|
||||
event_types?: string[];
|
||||
statuses?: string[];
|
||||
actor_id?: string;
|
||||
resource_id?: string;
|
||||
resource_type?: string;
|
||||
start_time?: string;
|
||||
end_time?: string;
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
order_by?: string;
|
||||
order_desc?: boolean;
|
||||
}
|
||||
export interface AuditResponse {
|
||||
events: AuditEvent[];
|
||||
total: number;
|
||||
limit: number;
|
||||
offset: number;
|
||||
}
|
||||
export interface AuditStats {
|
||||
total_events: number;
|
||||
by_type: Record<string, number>;
|
||||
by_severity: Record<string, number>;
|
||||
by_status: Record<string, number>;
|
||||
by_time?: Record<string, number>;
|
||||
}
|
||||
export interface AuditStatsParams {
|
||||
event_types?: string[];
|
||||
start_time?: string;
|
||||
end_time?: string;
|
||||
group_by?: string;
|
||||
}
|
||||
declare class ApiService {
|
||||
private api;
|
||||
private baseURL;
|
||||
constructor();
|
||||
healthCheck(): Promise<any>;
|
||||
readinessCheck(): Promise<any>;
|
||||
getApplications(limit?: number, offset?: number): Promise<PaginatedResponse<Application>>;
|
||||
getApplication(appId: string): Promise<Application>;
|
||||
createApplication(data: CreateApplicationRequest): Promise<Application>;
|
||||
updateApplication(appId: string, data: Partial<CreateApplicationRequest>): Promise<Application>;
|
||||
deleteApplication(appId: string): Promise<void>;
|
||||
getTokensForApplication(appId: string, limit?: number, offset?: number): Promise<PaginatedResponse<StaticToken>>;
|
||||
createToken(appId: string, data: CreateTokenRequest): Promise<CreateTokenResponse>;
|
||||
deleteToken(tokenId: string): Promise<void>;
|
||||
verifyToken(data: VerifyRequest): Promise<VerifyResponse>;
|
||||
login(appId: string, permissions: string[], redirectUri?: string, tokenDelivery?: string): Promise<any>;
|
||||
renewToken(appId: string, userId: string, token: string): Promise<any>;
|
||||
getAuditEvents(params?: AuditQueryParams): Promise<AuditResponse>;
|
||||
getAuditEvent(eventId: string): Promise<AuditEvent>;
|
||||
getAuditStats(params?: AuditStatsParams): Promise<AuditStats>;
|
||||
}
|
||||
export declare const apiService: ApiService;
|
||||
export {};
|
||||
Reference in New Issue
Block a user