initial
This commit is contained in:
11
ts_interfaces/data/connection.ts
Normal file
11
ts_interfaces/data/connection.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export type TProviderType = 'gitea' | 'gitlab';
|
||||
|
||||
export interface IProviderConnection {
|
||||
id: string;
|
||||
name: string;
|
||||
providerType: TProviderType;
|
||||
baseUrl: string;
|
||||
token: string;
|
||||
createdAt: number;
|
||||
status: 'connected' | 'disconnected' | 'error';
|
||||
}
|
||||
10
ts_interfaces/data/group.ts
Normal file
10
ts_interfaces/data/group.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export interface IGroup {
|
||||
id: string;
|
||||
name: string;
|
||||
fullPath: string;
|
||||
description: string;
|
||||
webUrl: string;
|
||||
connectionId: string;
|
||||
visibility: string;
|
||||
projectCount: number;
|
||||
}
|
||||
7
ts_interfaces/data/identity.ts
Normal file
7
ts_interfaces/data/identity.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export interface IIdentity {
|
||||
jwt: string;
|
||||
userId: string;
|
||||
username: string;
|
||||
expiresAt: number;
|
||||
role: 'admin' | 'user';
|
||||
}
|
||||
6
ts_interfaces/data/index.ts
Normal file
6
ts_interfaces/data/index.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export * from './identity.ts';
|
||||
export * from './connection.ts';
|
||||
export * from './project.ts';
|
||||
export * from './group.ts';
|
||||
export * from './secret.ts';
|
||||
export * from './pipeline.ts';
|
||||
32
ts_interfaces/data/pipeline.ts
Normal file
32
ts_interfaces/data/pipeline.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
export type TPipelineStatus =
|
||||
| 'pending'
|
||||
| 'running'
|
||||
| 'success'
|
||||
| 'failed'
|
||||
| 'canceled'
|
||||
| 'skipped'
|
||||
| 'waiting'
|
||||
| 'manual';
|
||||
|
||||
export interface IPipeline {
|
||||
id: string;
|
||||
projectId: string;
|
||||
projectName: string;
|
||||
connectionId: string;
|
||||
status: TPipelineStatus;
|
||||
ref: string;
|
||||
sha: string;
|
||||
webUrl: string;
|
||||
duration: number;
|
||||
createdAt: string;
|
||||
source: string;
|
||||
}
|
||||
|
||||
export interface IPipelineJob {
|
||||
id: string;
|
||||
pipelineId: string;
|
||||
name: string;
|
||||
stage: string;
|
||||
status: TPipelineStatus;
|
||||
duration: number;
|
||||
}
|
||||
12
ts_interfaces/data/project.ts
Normal file
12
ts_interfaces/data/project.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
export interface IProject {
|
||||
id: string;
|
||||
name: string;
|
||||
fullPath: string;
|
||||
description: string;
|
||||
defaultBranch: string;
|
||||
webUrl: string;
|
||||
connectionId: string;
|
||||
visibility: string;
|
||||
topics: string[];
|
||||
lastActivity: string;
|
||||
}
|
||||
10
ts_interfaces/data/secret.ts
Normal file
10
ts_interfaces/data/secret.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export interface ISecret {
|
||||
key: string;
|
||||
value: string;
|
||||
protected: boolean;
|
||||
masked: boolean;
|
||||
scope: 'project' | 'group';
|
||||
scopeId: string;
|
||||
connectionId: string;
|
||||
environment: string;
|
||||
}
|
||||
9
ts_interfaces/index.ts
Normal file
9
ts_interfaces/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export * from './plugins.ts';
|
||||
|
||||
// Data types
|
||||
import * as data from './data/index.ts';
|
||||
export { data };
|
||||
|
||||
// Request interfaces
|
||||
import * as requests from './requests/index.ts';
|
||||
export { requests };
|
||||
6
ts_interfaces/plugins.ts
Normal file
6
ts_interfaces/plugins.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
// @apiglobal scope
|
||||
import * as typedrequestInterfaces from '@api.global/typedrequest-interfaces';
|
||||
|
||||
export {
|
||||
typedrequestInterfaces,
|
||||
};
|
||||
43
ts_interfaces/requests/admin.ts
Normal file
43
ts_interfaces/requests/admin.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import * as plugins from '../plugins.ts';
|
||||
import * as data from '../data/index.ts';
|
||||
|
||||
export interface IReq_AdminLogin extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_AdminLogin
|
||||
> {
|
||||
method: 'adminLogin';
|
||||
request: {
|
||||
username: string;
|
||||
password: string;
|
||||
};
|
||||
response: {
|
||||
identity?: data.IIdentity;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_AdminLogout extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_AdminLogout
|
||||
> {
|
||||
method: 'adminLogout';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
};
|
||||
response: {
|
||||
ok: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_VerifyIdentity extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_VerifyIdentity
|
||||
> {
|
||||
method: 'verifyIdentity';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
};
|
||||
response: {
|
||||
valid: boolean;
|
||||
identity?: data.IIdentity;
|
||||
};
|
||||
}
|
||||
78
ts_interfaces/requests/connections.ts
Normal file
78
ts_interfaces/requests/connections.ts
Normal file
@@ -0,0 +1,78 @@
|
||||
import * as plugins from '../plugins.ts';
|
||||
import * as data from '../data/index.ts';
|
||||
|
||||
export interface IReq_GetConnections extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetConnections
|
||||
> {
|
||||
method: 'getConnections';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
};
|
||||
response: {
|
||||
connections: data.IProviderConnection[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_CreateConnection extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_CreateConnection
|
||||
> {
|
||||
method: 'createConnection';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
name: string;
|
||||
providerType: data.TProviderType;
|
||||
baseUrl: string;
|
||||
token: string;
|
||||
};
|
||||
response: {
|
||||
connection: data.IProviderConnection;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_UpdateConnection extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_UpdateConnection
|
||||
> {
|
||||
method: 'updateConnection';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
connectionId: string;
|
||||
name?: string;
|
||||
baseUrl?: string;
|
||||
token?: string;
|
||||
};
|
||||
response: {
|
||||
connection: data.IProviderConnection;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_TestConnection extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_TestConnection
|
||||
> {
|
||||
method: 'testConnection';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
connectionId: string;
|
||||
};
|
||||
response: {
|
||||
ok: boolean;
|
||||
error?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_DeleteConnection extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_DeleteConnection
|
||||
> {
|
||||
method: 'deleteConnection';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
connectionId: string;
|
||||
};
|
||||
response: {
|
||||
ok: boolean;
|
||||
};
|
||||
}
|
||||
18
ts_interfaces/requests/groups.ts
Normal file
18
ts_interfaces/requests/groups.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import * as plugins from '../plugins.ts';
|
||||
import * as data from '../data/index.ts';
|
||||
|
||||
export interface IReq_GetGroups extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetGroups
|
||||
> {
|
||||
method: 'getGroups';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
connectionId: string;
|
||||
search?: string;
|
||||
page?: number;
|
||||
};
|
||||
response: {
|
||||
groups: data.IGroup[];
|
||||
};
|
||||
}
|
||||
7
ts_interfaces/requests/index.ts
Normal file
7
ts_interfaces/requests/index.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export * from './admin.ts';
|
||||
export * from './connections.ts';
|
||||
export * from './projects.ts';
|
||||
export * from './groups.ts';
|
||||
export * from './secrets.ts';
|
||||
export * from './pipelines.ts';
|
||||
export * from './logs.ts';
|
||||
18
ts_interfaces/requests/logs.ts
Normal file
18
ts_interfaces/requests/logs.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import * as plugins from '../plugins.ts';
|
||||
import * as data from '../data/index.ts';
|
||||
|
||||
export interface IReq_GetJobLog extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetJobLog
|
||||
> {
|
||||
method: 'getJobLog';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
connectionId: string;
|
||||
projectId: string;
|
||||
jobId: string;
|
||||
};
|
||||
response: {
|
||||
log: string;
|
||||
};
|
||||
}
|
||||
66
ts_interfaces/requests/pipelines.ts
Normal file
66
ts_interfaces/requests/pipelines.ts
Normal file
@@ -0,0 +1,66 @@
|
||||
import * as plugins from '../plugins.ts';
|
||||
import * as data from '../data/index.ts';
|
||||
|
||||
export interface IReq_GetPipelines extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetPipelines
|
||||
> {
|
||||
method: 'getPipelines';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
connectionId: string;
|
||||
projectId: string;
|
||||
page?: number;
|
||||
};
|
||||
response: {
|
||||
pipelines: data.IPipeline[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_GetPipelineJobs extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetPipelineJobs
|
||||
> {
|
||||
method: 'getPipelineJobs';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
connectionId: string;
|
||||
projectId: string;
|
||||
pipelineId: string;
|
||||
};
|
||||
response: {
|
||||
jobs: data.IPipelineJob[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_RetryPipeline extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_RetryPipeline
|
||||
> {
|
||||
method: 'retryPipeline';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
connectionId: string;
|
||||
projectId: string;
|
||||
pipelineId: string;
|
||||
};
|
||||
response: {
|
||||
ok: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_CancelPipeline extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_CancelPipeline
|
||||
> {
|
||||
method: 'cancelPipeline';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
connectionId: string;
|
||||
projectId: string;
|
||||
pipelineId: string;
|
||||
};
|
||||
response: {
|
||||
ok: boolean;
|
||||
};
|
||||
}
|
||||
18
ts_interfaces/requests/projects.ts
Normal file
18
ts_interfaces/requests/projects.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import * as plugins from '../plugins.ts';
|
||||
import * as data from '../data/index.ts';
|
||||
|
||||
export interface IReq_GetProjects extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetProjects
|
||||
> {
|
||||
method: 'getProjects';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
connectionId: string;
|
||||
search?: string;
|
||||
page?: number;
|
||||
};
|
||||
response: {
|
||||
projects: data.IProject[];
|
||||
};
|
||||
}
|
||||
77
ts_interfaces/requests/secrets.ts
Normal file
77
ts_interfaces/requests/secrets.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
import * as plugins from '../plugins.ts';
|
||||
import * as data from '../data/index.ts';
|
||||
|
||||
export interface IReq_GetSecrets extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_GetSecrets
|
||||
> {
|
||||
method: 'getSecrets';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
connectionId: string;
|
||||
scope: 'project' | 'group';
|
||||
scopeId: string;
|
||||
};
|
||||
response: {
|
||||
secrets: data.ISecret[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_CreateSecret extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_CreateSecret
|
||||
> {
|
||||
method: 'createSecret';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
connectionId: string;
|
||||
scope: 'project' | 'group';
|
||||
scopeId: string;
|
||||
key: string;
|
||||
value: string;
|
||||
protected?: boolean;
|
||||
masked?: boolean;
|
||||
environment?: string;
|
||||
};
|
||||
response: {
|
||||
secret: data.ISecret;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_UpdateSecret extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_UpdateSecret
|
||||
> {
|
||||
method: 'updateSecret';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
connectionId: string;
|
||||
scope: 'project' | 'group';
|
||||
scopeId: string;
|
||||
key: string;
|
||||
value: string;
|
||||
protected?: boolean;
|
||||
masked?: boolean;
|
||||
environment?: string;
|
||||
};
|
||||
response: {
|
||||
secret: data.ISecret;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IReq_DeleteSecret extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IReq_DeleteSecret
|
||||
> {
|
||||
method: 'deleteSecret';
|
||||
request: {
|
||||
identity: data.IIdentity;
|
||||
connectionId: string;
|
||||
scope: 'project' | 'group';
|
||||
scopeId: string;
|
||||
key: string;
|
||||
};
|
||||
response: {
|
||||
ok: boolean;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user