mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
Chore/unexport api ts (#2585)
* don't export api params * import from SDK instead of BE --------- Co-authored-by: Aiden McClelland <me@drbonez.dev>
This commit is contained in:
@@ -1,13 +1,8 @@
|
||||
import { DOCUMENT } from '@angular/common'
|
||||
import { Inject, Injectable } from '@angular/core'
|
||||
import { WorkspaceConfig } from '@start9labs/shared'
|
||||
import { types } from '@start9labs/start-sdk'
|
||||
import { PackageDataEntry } from 'src/app/services/patch-db/data-model'
|
||||
import { PackageState } from '../../../../../../core/startos/bindings/PackageState'
|
||||
import { MainStatus } from '../../../../../../core/startos/bindings/MainStatus'
|
||||
import { ExportedOnionHostname } from '../../../../../../core/startos/bindings/ExportedOnionHostname'
|
||||
import { ExportedIpHostname } from '../../../../../../core/startos/bindings/ExportedIpHostname'
|
||||
import { ExportedHostnameInfo } from '../../../../../../core/startos/bindings/ExportedHostnameInfo'
|
||||
import { T } from '@start9labs/start-sdk'
|
||||
import { PackageDataEntry } from './patch-db/data-model'
|
||||
|
||||
const {
|
||||
gitHash,
|
||||
@@ -55,8 +50,8 @@ export class ConfigService {
|
||||
}
|
||||
|
||||
isLaunchable(
|
||||
state: PackageState['state'],
|
||||
status: MainStatus['status'],
|
||||
state: T.PackageState['state'],
|
||||
status: T.MainStatus['status'],
|
||||
): boolean {
|
||||
return state === 'installed' && status === 'running'
|
||||
}
|
||||
@@ -76,13 +71,13 @@ export class ConfigService {
|
||||
|
||||
if (host.kind === 'multi') {
|
||||
const onionHostname = host.hostnames.find(h => h.kind === 'onion')
|
||||
?.hostname as ExportedOnionHostname
|
||||
?.hostname as T.ExportedOnionHostname
|
||||
|
||||
if (this.isTor() && onionHostname) {
|
||||
url.hostname = onionHostname.value
|
||||
} else {
|
||||
const ipHostname = host.hostnames.find(h => h.kind === 'ip')
|
||||
?.hostname as ExportedIpHostname
|
||||
?.hostname as T.ExportedIpHostname
|
||||
|
||||
if (!ipHostname) return ''
|
||||
|
||||
@@ -91,16 +86,16 @@ export class ConfigService {
|
||||
}
|
||||
} else {
|
||||
throw new Error('unimplemented')
|
||||
const hostname = {} as ExportedHostnameInfo // host.hostname
|
||||
// const hostname = {} as T.ExportedHostnameInfo // host.hostname
|
||||
|
||||
if (!hostname) return ''
|
||||
// if (!hostname) return ''
|
||||
|
||||
if (this.isTor() && hostname.kind === 'onion') {
|
||||
url.hostname = (hostname.hostname as ExportedOnionHostname).value
|
||||
} else {
|
||||
url.hostname = this.hostname
|
||||
url.port = String(hostname.hostname.sslPort || hostname.hostname.port)
|
||||
}
|
||||
// if (this.isTor() && hostname.kind === 'onion') {
|
||||
// url.hostname = (hostname.hostname as T.ExportedOnionHostname).value
|
||||
// } else {
|
||||
// url.hostname = this.hostname
|
||||
// url.port = String(hostname.hostname.sslPort || hostname.hostname.port)
|
||||
// }
|
||||
}
|
||||
|
||||
return url.href
|
||||
|
||||
Reference in New Issue
Block a user