mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
fix types
This commit is contained in:
committed by
Aiden McClelland
parent
178391e7b2
commit
6556fcc531
11793
frontend/package-lock.json
generated
11793
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -74,7 +74,7 @@
|
|||||||
"patch-db-client": "file: ../../../patch-db/client",
|
"patch-db-client": "file: ../../../patch-db/client",
|
||||||
"pbkdf2": "^3.1.2",
|
"pbkdf2": "^3.1.2",
|
||||||
"rxjs": "^7.5.6",
|
"rxjs": "^7.5.6",
|
||||||
"start-sdk": "^0.4.0-lib0.alpha3",
|
"start-sdk": "^0.4.0-lib0.alpha6",
|
||||||
"swiper": "^8.2.4",
|
"swiper": "^8.2.4",
|
||||||
"ts-matches": "^5.2.1",
|
"ts-matches": "^5.2.1",
|
||||||
"tslib": "^2.3.0",
|
"tslib": "^2.3.0",
|
||||||
@@ -92,12 +92,12 @@
|
|||||||
"@types/js-yaml": "^4.0.5",
|
"@types/js-yaml": "^4.0.5",
|
||||||
"@types/marked": "^4.0.3",
|
"@types/marked": "^4.0.3",
|
||||||
"@types/mustache": "^4.1.2",
|
"@types/mustache": "^4.1.2",
|
||||||
"@types/node": "^16.9.1",
|
"@types/node": "^18.15.0",
|
||||||
"@types/node-jose": "^1.1.10",
|
"@types/node-jose": "^1.1.10",
|
||||||
"@types/pbkdf2": "^3.1.0",
|
"@types/pbkdf2": "^3.1.0",
|
||||||
"@types/uuid": "^8.3.1",
|
"@types/uuid": "^8.3.1",
|
||||||
"husky": "^4.3.8",
|
"husky": "^4.3.8",
|
||||||
"lint-staged": "^12.3.7",
|
"lint-staged": "^13.2.0",
|
||||||
"ng-packagr": "^14.1.0",
|
"ng-packagr": "^14.1.0",
|
||||||
"node-html-parser": "^5.3.3",
|
"node-html-parser": "^5.3.3",
|
||||||
"prettier": "^2.6.1",
|
"prettier": "^2.6.1",
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
ModalController,
|
ModalController,
|
||||||
} from '@ionic/angular'
|
} from '@ionic/angular'
|
||||||
import { GenericFormPage } from 'src/app/modals/generic-form/generic-form.page'
|
import { GenericFormPage } from 'src/app/modals/generic-form/generic-form.page'
|
||||||
import { ConfigSpec } from 'start-sdk/types/config-types'
|
import { InputSpec } from 'start-sdk/types/config-types'
|
||||||
import { ApiService } from 'src/app/services/api/embassy-api.service'
|
import { ApiService } from 'src/app/services/api/embassy-api.service'
|
||||||
import { ErrorToastService } from '@start9labs/shared'
|
import { ErrorToastService } from '@start9labs/shared'
|
||||||
import { MappedBackupTarget } from 'src/app/types/mapped-backup-target'
|
import { MappedBackupTarget } from 'src/app/types/mapped-backup-target'
|
||||||
@@ -274,7 +274,7 @@ export class BackupDrivesStatusComponent {
|
|||||||
@Input() hasValidBackup!: boolean
|
@Input() hasValidBackup!: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
const CifsSpec: ConfigSpec = {
|
const CifsSpec: InputSpec = {
|
||||||
hostname: {
|
hostname: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
name: 'Hostname',
|
name: 'Hostname',
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import {
|
|||||||
import { FormArray, UntypedFormArray, UntypedFormGroup } from '@angular/forms'
|
import { FormArray, UntypedFormArray, UntypedFormGroup } from '@angular/forms'
|
||||||
import { AlertButton, AlertController, ModalController } from '@ionic/angular'
|
import { AlertButton, AlertController, ModalController } from '@ionic/angular'
|
||||||
import {
|
import {
|
||||||
ConfigSpec,
|
InputSpec,
|
||||||
ListValueSpecOf,
|
ListValueSpecOf,
|
||||||
ValueSpec,
|
ValueSpec,
|
||||||
ValueSpecBoolean,
|
ValueSpecBoolean,
|
||||||
@@ -37,7 +37,7 @@ interface Config {
|
|||||||
styleUrls: ['./form-object.component.scss'],
|
styleUrls: ['./form-object.component.scss'],
|
||||||
})
|
})
|
||||||
export class FormObjectComponent {
|
export class FormObjectComponent {
|
||||||
@Input() objectSpec!: ConfigSpec
|
@Input() objectSpec!: InputSpec
|
||||||
@Input() formGroup!: UntypedFormGroup
|
@Input() formGroup!: UntypedFormGroup
|
||||||
@Input() current?: Config
|
@Input() current?: Config
|
||||||
@Input() original?: Config
|
@Input() original?: Config
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
isObject,
|
isObject,
|
||||||
} from '@start9labs/shared'
|
} from '@start9labs/shared'
|
||||||
import { DependentInfo } from 'src/app/types/dependent-info'
|
import { DependentInfo } from 'src/app/types/dependent-info'
|
||||||
import { ConfigSpec } from 'start-sdk/types/config-types'
|
import { InputSpec } from 'start-sdk/types/config-types'
|
||||||
import {
|
import {
|
||||||
DataModel,
|
DataModel,
|
||||||
PackageDataEntry,
|
PackageDataEntry,
|
||||||
@@ -42,7 +42,7 @@ export class AppConfigPage {
|
|||||||
pkg!: PackageDataEntry
|
pkg!: PackageDataEntry
|
||||||
loadingText = ''
|
loadingText = ''
|
||||||
|
|
||||||
configSpec?: ConfigSpec
|
configSpec?: InputSpec
|
||||||
configForm?: UntypedFormGroup
|
configForm?: UntypedFormGroup
|
||||||
|
|
||||||
original?: object // only if existing config
|
original?: object // only if existing config
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
convertValuesRecursive,
|
convertValuesRecursive,
|
||||||
FormService,
|
FormService,
|
||||||
} from 'src/app/services/form.service'
|
} from 'src/app/services/form.service'
|
||||||
import { ConfigSpec } from 'start-sdk/types/config-types'
|
import { InputSpec } from 'start-sdk/types/config-types'
|
||||||
|
|
||||||
export interface ActionButton {
|
export interface ActionButton {
|
||||||
text: string
|
text: string
|
||||||
@@ -20,7 +20,7 @@ export interface ActionButton {
|
|||||||
})
|
})
|
||||||
export class GenericFormPage {
|
export class GenericFormPage {
|
||||||
@Input() title!: string
|
@Input() title!: string
|
||||||
@Input() spec!: ConfigSpec
|
@Input() spec!: InputSpec
|
||||||
@Input() buttons!: ActionButton[]
|
@Input() buttons!: ActionButton[]
|
||||||
@Input() initialValue: object = {}
|
@Input() initialValue: object = {}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
} from 'src/app/modals/generic-input/generic-input.component'
|
} from 'src/app/modals/generic-input/generic-input.component'
|
||||||
import { PatchDB } from 'patch-db-client'
|
import { PatchDB } from 'patch-db-client'
|
||||||
import { ApiService } from 'src/app/services/api/embassy-api.service'
|
import { ApiService } from 'src/app/services/api/embassy-api.service'
|
||||||
import { ConfigSpec } from 'start-sdk/types/config-types'
|
import { InputSpec } from 'start-sdk/types/config-types'
|
||||||
import * as yaml from 'js-yaml'
|
import * as yaml from 'js-yaml'
|
||||||
import { v4 } from 'uuid'
|
import { v4 } from 'uuid'
|
||||||
import { DataModel, DevData } from 'src/app/services/patch-db/data-model'
|
import { DataModel, DevData } from 'src/app/services/patch-db/data-model'
|
||||||
@@ -217,7 +217,7 @@ export class DeveloperListPage {
|
|||||||
|
|
||||||
const SAMPLE_INSTUCTIONS = `# Create Instructions using Markdown! :)`
|
const SAMPLE_INSTUCTIONS = `# Create Instructions using Markdown! :)`
|
||||||
|
|
||||||
const SAMPLE_CONFIG: ConfigSpec = {
|
const SAMPLE_CONFIG: InputSpec = {
|
||||||
'sample-string': {
|
'sample-string': {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
name: 'Example String Input',
|
name: 'Example String Input',
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { ConfigSpec } from 'start-sdk/types/config-types'
|
import { InputSpec } from 'start-sdk/types/config-types'
|
||||||
import { DevProjectData } from 'src/app/services/patch-db/data-model'
|
import { DevProjectData } from 'src/app/services/patch-db/data-model'
|
||||||
|
|
||||||
export type BasicInfo = {
|
export type BasicInfo = {
|
||||||
@@ -17,7 +17,7 @@ export type BasicInfo = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getBasicInfoSpec(devData: DevProjectData): ConfigSpec {
|
export function getBasicInfoSpec(devData: DevProjectData): InputSpec {
|
||||||
const basicInfo = devData['basic-info']
|
const basicInfo = devData['basic-info']
|
||||||
return {
|
return {
|
||||||
id: {
|
id: {
|
||||||
|
|||||||
@@ -1191,7 +1191,7 @@ export module Mock {
|
|||||||
},
|
},
|
||||||
} as any // @TODO why is this necessary?
|
} as any // @TODO why is this necessary?
|
||||||
|
|
||||||
export const ConfigSpec: RR.GetPackageConfigRes['spec'] = {
|
export const InputSpec: RR.GetPackageConfigRes['spec'] = {
|
||||||
bitcoin: {
|
bitcoin: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
name: 'Bitcoin Settings',
|
name: 'Bitcoin Settings',
|
||||||
@@ -1327,7 +1327,7 @@ export module Mock {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
// the outer spec here, at the list level, says that what's inside (the inner spec) pertains to its inner elements.
|
// the outer spec here, at the list level, says that what's inside (the inner spec) pertains to its inner elements.
|
||||||
// it just so happens that ValueSpecObject's have the field { spec: ConfigSpec }
|
// it just so happens that ValueSpecObject's have the field { spec: InputSpec }
|
||||||
// see 'union-list' below for a different example.
|
// see 'union-list' below for a different example.
|
||||||
spec: {
|
spec: {
|
||||||
'unique-by': 'last-name',
|
'unique-by': 'last-name',
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Dump, Revision } from 'patch-db-client'
|
import { Dump, Revision } from 'patch-db-client'
|
||||||
import { MarketplacePkg, StoreInfo } from '@start9labs/marketplace'
|
import { MarketplacePkg, StoreInfo } from '@start9labs/marketplace'
|
||||||
import { PackagePropertiesVersioned } from 'src/app/util/properties.util'
|
import { PackagePropertiesVersioned } from 'src/app/util/properties.util'
|
||||||
import { ConfigSpec } from 'start-sdk/types/config-types'
|
import { InputSpec } from 'start-sdk/types/config-types'
|
||||||
import {
|
import {
|
||||||
DataModel,
|
DataModel,
|
||||||
DependencyError,
|
DependencyError,
|
||||||
@@ -204,7 +204,7 @@ export module RR {
|
|||||||
export type DryUpdatePackageRes = Breakages
|
export type DryUpdatePackageRes = Breakages
|
||||||
|
|
||||||
export type GetPackageConfigReq = { id: string } // package.config.get
|
export type GetPackageConfigReq = { id: string } // package.config.get
|
||||||
export type GetPackageConfigRes = { spec: ConfigSpec; config: object }
|
export type GetPackageConfigRes = { spec: InputSpec; config: object }
|
||||||
|
|
||||||
export type DrySetPackageConfigReq = { id: string; config: object } // package.config.set.dry
|
export type DrySetPackageConfigReq = { id: string; config: object } // package.config.set.dry
|
||||||
export type DrySetPackageConfigRes = Breakages
|
export type DrySetPackageConfigRes = Breakages
|
||||||
@@ -247,7 +247,7 @@ export module RR {
|
|||||||
export type DryConfigureDependencyRes = {
|
export type DryConfigureDependencyRes = {
|
||||||
'old-config': object
|
'old-config': object
|
||||||
'new-config': object
|
'new-config': object
|
||||||
spec: ConfigSpec
|
spec: InputSpec
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SideloadPackageReq = {
|
export type SideloadPackageReq = {
|
||||||
|
|||||||
@@ -665,7 +665,7 @@ export class MockApiService extends ApiService {
|
|||||||
await pauseFor(2000)
|
await pauseFor(2000)
|
||||||
return {
|
return {
|
||||||
config: Mock.MockConfig,
|
config: Mock.MockConfig,
|
||||||
spec: Mock.ConfigSpec,
|
spec: Mock.InputSpec,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -900,7 +900,7 @@ export class MockApiService extends ApiService {
|
|||||||
return {
|
return {
|
||||||
'old-config': Mock.MockConfig,
|
'old-config': Mock.MockConfig,
|
||||||
'new-config': Mock.MockDependencyConfig,
|
'new-config': Mock.MockDependencyConfig,
|
||||||
spec: Mock.ConfigSpec,
|
spec: Mock.InputSpec,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
Validators,
|
Validators,
|
||||||
} from '@angular/forms'
|
} from '@angular/forms'
|
||||||
import {
|
import {
|
||||||
ConfigSpec,
|
InputSpec,
|
||||||
isValueSpecListOf,
|
isValueSpecListOf,
|
||||||
ListValueSpecNumber,
|
ListValueSpecNumber,
|
||||||
ListValueSpecObject,
|
ListValueSpecObject,
|
||||||
@@ -34,7 +34,7 @@ export class FormService {
|
|||||||
constructor(private readonly formBuilder: UntypedFormBuilder) {}
|
constructor(private readonly formBuilder: UntypedFormBuilder) {}
|
||||||
|
|
||||||
createForm(
|
createForm(
|
||||||
spec: ConfigSpec,
|
spec: InputSpec,
|
||||||
current: { [key: string]: any } = {},
|
current: { [key: string]: any } = {},
|
||||||
): UntypedFormGroup {
|
): UntypedFormGroup {
|
||||||
return this.getFormGroup(spec, [], current)
|
return this.getFormGroup(spec, [], current)
|
||||||
@@ -80,7 +80,7 @@ export class FormService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private getFormGroup(
|
private getFormGroup(
|
||||||
config: ConfigSpec,
|
config: InputSpec,
|
||||||
validators: ValidatorFn[] = [],
|
validators: ValidatorFn[] = [],
|
||||||
current?: { [key: string]: any } | null,
|
current?: { [key: string]: any } | null,
|
||||||
): UntypedFormGroup {
|
): UntypedFormGroup {
|
||||||
@@ -450,7 +450,7 @@ function uniqueByMessageWrapper(
|
|||||||
spec: ListValueSpecObject | ListValueSpecUnion,
|
spec: ListValueSpecObject | ListValueSpecUnion,
|
||||||
obj: Record<string, string>,
|
obj: Record<string, string>,
|
||||||
) {
|
) {
|
||||||
let configSpec: ConfigSpec
|
let configSpec: InputSpec
|
||||||
if (isUnion(spec)) {
|
if (isUnion(spec)) {
|
||||||
const tagId = spec.tag.id
|
const tagId = spec.tag.id
|
||||||
configSpec = {
|
configSpec = {
|
||||||
@@ -469,7 +469,7 @@ function uniqueByMessageWrapper(
|
|||||||
|
|
||||||
function uniqueByMessage(
|
function uniqueByMessage(
|
||||||
uniqueBy: UniqueBy,
|
uniqueBy: UniqueBy,
|
||||||
configSpec: ConfigSpec,
|
configSpec: InputSpec,
|
||||||
outermost = true,
|
outermost = true,
|
||||||
): string {
|
): string {
|
||||||
let joinFunc
|
let joinFunc
|
||||||
@@ -510,7 +510,7 @@ function isUnion(spec: any): spec is ListValueSpecUnion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function convertValuesRecursive(
|
export function convertValuesRecursive(
|
||||||
configSpec: ConfigSpec,
|
configSpec: InputSpec,
|
||||||
group: UntypedFormGroup,
|
group: UntypedFormGroup,
|
||||||
) {
|
) {
|
||||||
Object.entries(configSpec).forEach(([key, valueSpec]) => {
|
Object.entries(configSpec).forEach(([key, valueSpec]) => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { ConfigSpec } from 'start-sdk/types/config-types'
|
import { InputSpec } from 'start-sdk/types/config-types'
|
||||||
import { Url } from '@start9labs/shared'
|
import { Url } from '@start9labs/shared'
|
||||||
import { MarketplaceManifest } from '@start9labs/marketplace'
|
import { MarketplaceManifest } from '@start9labs/marketplace'
|
||||||
import { BasicInfo } from 'src/app/pages/developer-routes/developer-menu/form-info'
|
import { BasicInfo } from 'src/app/pages/developer-routes/developer-menu/form-info'
|
||||||
@@ -264,7 +264,7 @@ export interface Action {
|
|||||||
warning: string | null
|
warning: string | null
|
||||||
implementation: ActionImpl
|
implementation: ActionImpl
|
||||||
'allowed-statuses': (PackageMainStatus.Stopped | PackageMainStatus.Running)[]
|
'allowed-statuses': (PackageMainStatus.Stopped | PackageMainStatus.Running)[]
|
||||||
'input-spec': ConfigSpec | null
|
'input-spec': InputSpec | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Status {
|
export interface Status {
|
||||||
|
|||||||
Reference in New Issue
Block a user