Initial commit
This commit is contained in:
12
shared/modules/remote/api.ts
Normal file
12
shared/modules/remote/api.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { defineEndpoints } from '../types.js'
|
||||
|
||||
export const REMOTE_ENDPOINTS = defineEndpoints({
|
||||
getConfig: { path: '/config', method: 'GET' },
|
||||
saveConfig: { path: '/config', method: 'POST' },
|
||||
getScreenshot: { path: '/screenshot', method: 'GET' },
|
||||
saveScreenshot: { path: '/screenshot', method: 'POST' },
|
||||
getData: { path: '/data', method: 'GET' },
|
||||
saveData: { path: '/data', method: 'POST' },
|
||||
})
|
||||
|
||||
export type RemoteEndpoints = typeof REMOTE_ENDPOINTS
|
||||
16
shared/modules/remote/index.ts
Normal file
16
shared/modules/remote/index.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { defineApiModule } from '../types.js'
|
||||
import { REMOTE_ENDPOINTS } from './api.js'
|
||||
|
||||
export * from './types.js'
|
||||
export * from './api.js'
|
||||
|
||||
export const REMOTE_MODULE = defineApiModule({
|
||||
id: 'remote',
|
||||
name: '远程',
|
||||
basePath: '/remote',
|
||||
order: 25,
|
||||
version: '1.0.0',
|
||||
endpoints: REMOTE_ENDPOINTS,
|
||||
})
|
||||
|
||||
export type { RemoteEndpoints } from './api.js'
|
||||
11
shared/modules/remote/types.ts
Normal file
11
shared/modules/remote/types.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export interface RemoteDevice {
|
||||
id: string
|
||||
deviceName: string
|
||||
serverHost: string
|
||||
desktopPort: number
|
||||
gitPort: number
|
||||
}
|
||||
|
||||
export interface RemoteConfig {
|
||||
devices: RemoteDevice[]
|
||||
}
|
||||
Reference in New Issue
Block a user