2026-04-02 15:44:36 +00:00
|
|
|
import * as plugins from '../plugins.js';
|
|
|
|
|
import type * as authInterfaces from '../data/auth.js';
|
2026-04-05 00:37:37 +00:00
|
|
|
import type { ITargetProfile, ITargetProfileTarget } from '../data/target-profile.js';
|
2026-04-02 15:44:36 +00:00
|
|
|
|
|
|
|
|
// ============================================================================
|
2026-04-05 00:37:37 +00:00
|
|
|
// Target Profile Endpoints (target-side: what can be accessed)
|
2026-04-02 15:44:36 +00:00
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
|
|
/**
|
2026-04-05 00:37:37 +00:00
|
|
|
* Get all target profiles.
|
2026-04-02 15:44:36 +00:00
|
|
|
*/
|
2026-04-05 00:37:37 +00:00
|
|
|
export interface IReq_GetTargetProfiles extends plugins.typedrequestInterfaces.implementsTR<
|
2026-04-02 15:44:36 +00:00
|
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
2026-04-05 00:37:37 +00:00
|
|
|
IReq_GetTargetProfiles
|
2026-04-02 15:44:36 +00:00
|
|
|
> {
|
2026-04-05 00:37:37 +00:00
|
|
|
method: 'getTargetProfiles';
|
2026-04-02 15:44:36 +00:00
|
|
|
request: {
|
|
|
|
|
identity?: authInterfaces.IIdentity;
|
|
|
|
|
apiToken?: string;
|
|
|
|
|
};
|
|
|
|
|
response: {
|
2026-04-05 00:37:37 +00:00
|
|
|
profiles: ITargetProfile[];
|
2026-04-02 15:44:36 +00:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2026-04-05 00:37:37 +00:00
|
|
|
* Get a single target profile by ID.
|
2026-04-02 15:44:36 +00:00
|
|
|
*/
|
2026-04-05 00:37:37 +00:00
|
|
|
export interface IReq_GetTargetProfile extends plugins.typedrequestInterfaces.implementsTR<
|
2026-04-02 15:44:36 +00:00
|
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
2026-04-05 00:37:37 +00:00
|
|
|
IReq_GetTargetProfile
|
2026-04-02 15:44:36 +00:00
|
|
|
> {
|
2026-04-05 00:37:37 +00:00
|
|
|
method: 'getTargetProfile';
|
2026-04-02 15:44:36 +00:00
|
|
|
request: {
|
|
|
|
|
identity?: authInterfaces.IIdentity;
|
|
|
|
|
apiToken?: string;
|
|
|
|
|
id: string;
|
|
|
|
|
};
|
|
|
|
|
response: {
|
2026-04-05 00:37:37 +00:00
|
|
|
profile: ITargetProfile | null;
|
2026-04-02 15:44:36 +00:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2026-04-05 00:37:37 +00:00
|
|
|
* Create a new target profile.
|
2026-04-02 15:44:36 +00:00
|
|
|
*/
|
2026-04-05 00:37:37 +00:00
|
|
|
export interface IReq_CreateTargetProfile extends plugins.typedrequestInterfaces.implementsTR<
|
2026-04-02 15:44:36 +00:00
|
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
2026-04-05 00:37:37 +00:00
|
|
|
IReq_CreateTargetProfile
|
2026-04-02 15:44:36 +00:00
|
|
|
> {
|
2026-04-05 00:37:37 +00:00
|
|
|
method: 'createTargetProfile';
|
2026-04-02 15:44:36 +00:00
|
|
|
request: {
|
|
|
|
|
identity?: authInterfaces.IIdentity;
|
|
|
|
|
apiToken?: string;
|
|
|
|
|
name: string;
|
|
|
|
|
description?: string;
|
2026-04-05 00:37:37 +00:00
|
|
|
domains?: string[];
|
|
|
|
|
targets?: ITargetProfileTarget[];
|
|
|
|
|
routeRefs?: string[];
|
2026-04-02 15:44:36 +00:00
|
|
|
};
|
|
|
|
|
response: {
|
|
|
|
|
success: boolean;
|
|
|
|
|
id?: string;
|
|
|
|
|
message?: string;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2026-04-05 00:37:37 +00:00
|
|
|
* Update a target profile.
|
2026-04-02 15:44:36 +00:00
|
|
|
*/
|
2026-04-05 00:37:37 +00:00
|
|
|
export interface IReq_UpdateTargetProfile extends plugins.typedrequestInterfaces.implementsTR<
|
2026-04-02 15:44:36 +00:00
|
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
2026-04-05 00:37:37 +00:00
|
|
|
IReq_UpdateTargetProfile
|
2026-04-02 15:44:36 +00:00
|
|
|
> {
|
2026-04-05 00:37:37 +00:00
|
|
|
method: 'updateTargetProfile';
|
2026-04-02 15:44:36 +00:00
|
|
|
request: {
|
|
|
|
|
identity?: authInterfaces.IIdentity;
|
|
|
|
|
apiToken?: string;
|
|
|
|
|
id: string;
|
|
|
|
|
name?: string;
|
|
|
|
|
description?: string;
|
2026-04-05 00:37:37 +00:00
|
|
|
domains?: string[];
|
|
|
|
|
targets?: ITargetProfileTarget[];
|
|
|
|
|
routeRefs?: string[];
|
2026-04-02 15:44:36 +00:00
|
|
|
};
|
|
|
|
|
response: {
|
|
|
|
|
success: boolean;
|
|
|
|
|
message?: string;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2026-04-05 00:37:37 +00:00
|
|
|
* Delete a target profile.
|
2026-04-02 15:44:36 +00:00
|
|
|
*/
|
2026-04-05 00:37:37 +00:00
|
|
|
export interface IReq_DeleteTargetProfile extends plugins.typedrequestInterfaces.implementsTR<
|
2026-04-02 15:44:36 +00:00
|
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
2026-04-05 00:37:37 +00:00
|
|
|
IReq_DeleteTargetProfile
|
2026-04-02 15:44:36 +00:00
|
|
|
> {
|
2026-04-05 00:37:37 +00:00
|
|
|
method: 'deleteTargetProfile';
|
2026-04-02 15:44:36 +00:00
|
|
|
request: {
|
|
|
|
|
identity?: authInterfaces.IIdentity;
|
|
|
|
|
apiToken?: string;
|
|
|
|
|
id: string;
|
|
|
|
|
force?: boolean;
|
|
|
|
|
};
|
|
|
|
|
response: {
|
|
|
|
|
success: boolean;
|
|
|
|
|
message?: string;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2026-04-05 00:37:37 +00:00
|
|
|
* Get which VPN clients reference a target profile.
|
2026-04-02 15:44:36 +00:00
|
|
|
*/
|
2026-04-05 00:37:37 +00:00
|
|
|
export interface IReq_GetTargetProfileUsage extends plugins.typedrequestInterfaces.implementsTR<
|
2026-04-02 15:44:36 +00:00
|
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
2026-04-05 00:37:37 +00:00
|
|
|
IReq_GetTargetProfileUsage
|
2026-04-02 15:44:36 +00:00
|
|
|
> {
|
2026-04-05 00:37:37 +00:00
|
|
|
method: 'getTargetProfileUsage';
|
2026-04-02 15:44:36 +00:00
|
|
|
request: {
|
|
|
|
|
identity?: authInterfaces.IIdentity;
|
|
|
|
|
apiToken?: string;
|
|
|
|
|
id: string;
|
|
|
|
|
};
|
|
|
|
|
response: {
|
2026-04-05 00:37:37 +00:00
|
|
|
clients: Array<{ clientId: string; description?: string }>;
|
2026-04-02 15:44:36 +00:00
|
|
|
};
|
|
|
|
|
}
|