Merge branch 'update/camelCase' of github.com:Start9Labs/start-os into rebase/feat/domains

This commit is contained in:
Matt Hill
2024-03-22 13:09:11 -06:00
30 changed files with 406 additions and 422 deletions

View File

@@ -27,16 +27,16 @@ import { unionSelectKey } from '@start9labs/start-sdk/cjs/sdk/lib/config/configT
export module Mock {
export const ServerUpdated: ServerStatusInfo = {
'current-backup': null,
'update-progress': null,
currentBackup: null,
updateProgress: null,
updated: true,
restarting: false,
'shutting-down': false,
shuttingDown: false,
}
export const MarketplaceEos: RR.GetMarketplaceEosRes = {
version: '0.3.5.1',
headline: 'Our biggest release ever.',
'release-notes': {
releaseNotes: {
'0.3.5.1': 'Some **Markdown** release _notes_ for 0.3.5.1',
'0.3.4.4': 'Some **Markdown** release _notes_ for 0.3.4.4',
'0.3.4.3': 'Some **Markdown** release _notes_ for 0.3.4.3',
@@ -62,19 +62,19 @@ export module Mock {
id: 'bitcoind',
title: 'Bitcoin Core',
version: '0.21.0',
'git-hash': 'abcdefgh',
gitHash: 'abcdefgh',
description: {
short: 'A Bitcoin full node by Bitcoin Core.',
long: 'Bitcoin is a decentralized consensus protocol and settlement network.',
},
replaces: ['banks', 'governments'],
'release-notes': 'Taproot, Schnorr, and more.',
releaseNotes: 'Taproot, Schnorr, and more.',
license: 'MIT',
'wrapper-repo': 'https://github.com/start9labs/bitcoind-wrapper',
'upstream-repo': 'https://github.com/bitcoin/bitcoin',
'support-site': 'https://bitcoin.org',
'marketing-site': 'https://bitcoin.org',
'donation-url': 'https://start9.com',
wrapperRepo: 'https://github.com/start9labs/bitcoind-wrapper',
upstreamRepo: 'https://github.com/bitcoin/bitcoin',
supportSite: 'https://bitcoin.org',
marketingSite: 'https://bitcoin.org',
donationUrl: 'https://start9.com',
alerts: {
install: 'Bitcoin can take over a week to sync.',
uninstall:
@@ -83,9 +83,9 @@ export module Mock {
start: 'Starting Bitcoin is good for your health.',
stop: null,
},
'os-version': '0.2.12',
osVersion: '0.2.12',
dependencies: {},
'has-config': true,
hasConfig: true,
}
export const MockManifestLnd: Manifest = {
@@ -96,13 +96,13 @@ export module Mock {
short: 'A bolt spec compliant client.',
long: 'More info about LND. More info about LND. More info about LND.',
},
'release-notes': 'Dual funded channels!',
releaseNotes: 'Dual funded channels!',
license: 'MIT',
'wrapper-repo': 'https://github.com/start9labs/lnd-wrapper',
'upstream-repo': 'https://github.com/lightningnetwork/lnd',
'support-site': 'https://lightning.engineering/',
'marketing-site': 'https://lightning.engineering/',
'donation-url': null,
wrapperRepo: 'https://github.com/start9labs/lnd-wrapper',
upstreamRepo: 'https://github.com/lightningnetwork/lnd',
supportSite: 'https://lightning.engineering/',
marketingSite: 'https://lightning.engineering/',
donationUrl: null,
alerts: {
install: null,
uninstall: null,
@@ -111,7 +111,7 @@ export module Mock {
start: 'Starting LND is good for your health.',
stop: null,
},
'os-version': '0.2.12',
osVersion: '0.2.12',
dependencies: {
bitcoind: {
description: 'LND needs bitcoin to live.',
@@ -123,25 +123,25 @@ export module Mock {
optional: true,
},
},
'has-config': true,
hasConfig: true,
}
export const MockManifestBitcoinProxy: Manifest = {
id: 'btc-rpc-proxy',
title: 'Bitcoin Proxy',
version: '0.2.2',
'git-hash': 'lmnopqrx',
gitHash: 'lmnopqrx',
description: {
short: 'A super charger for your Bitcoin node.',
long: 'More info about Bitcoin Proxy. More info about Bitcoin Proxy. More info about Bitcoin Proxy.',
},
'release-notes': 'Even better support for Bitcoin and wallets!',
releaseNotes: 'Even better support for Bitcoin and wallets!',
license: 'MIT',
'wrapper-repo': 'https://github.com/start9labs/btc-rpc-proxy-wrapper',
'upstream-repo': 'https://github.com/Kixunil/btc-rpc-proxy',
'support-site': '',
'marketing-site': '',
'donation-url': 'https://start9.com',
wrapperRepo: 'https://github.com/start9labs/btc-rpc-proxy-wrapper',
upstreamRepo: 'https://github.com/Kixunil/btc-rpc-proxy',
supportSite: '',
marketingSite: '',
donationUrl: 'https://start9.com',
alerts: {
install: 'Testing install alert',
uninstall: null,
@@ -149,14 +149,14 @@ export module Mock {
start: null,
stop: null,
},
'os-version': '0.2.12',
osVersion: '0.2.12',
dependencies: {
bitcoind: {
description: 'Bitcoin Proxy requires a Bitcoin node.',
optional: false,
},
},
'has-config': false,
hasConfig: false,
}
export const BitcoinDep: DependencyMetadata = {
@@ -189,8 +189,8 @@ export module Mock {
},
categories: ['bitcoin', 'cryptocurrency', 'featured'],
versions: ['0.19.0', '0.20.0', '0.21.0'],
'dependency-metadata': {},
'published-at': new Date().toISOString(),
dependencyMetadata: {},
publishedAt: new Date().toISOString(),
},
'0.20.0': {
icon: BTC_ICON,
@@ -202,8 +202,8 @@ export module Mock {
},
categories: ['bitcoin', 'cryptocurrency'],
versions: ['0.19.0', '0.20.0', '0.21.0'],
'dependency-metadata': {},
'published-at': new Date().toISOString(),
dependencyMetadata: {},
publishedAt: new Date().toISOString(),
},
'0.21.0': {
icon: BTC_ICON,
@@ -212,13 +212,13 @@ export module Mock {
manifest: {
...Mock.MockManifestBitcoind,
version: '0.21.0',
'release-notes':
releaseNotes:
'For a complete list of changes, please visit <a href="https://bitcoincore.org/en/releases/0.21.0/">https://bitcoincore.org/en/releases/0.21.0/</a><br /><ul><li>Taproot!</li><li>New RPCs</li><li>Experimental Descriptor Wallets</li></ul>',
},
categories: ['bitcoin', 'cryptocurrency'],
versions: ['0.19.0', '0.20.0', '0.21.0'],
'dependency-metadata': {},
'published-at': new Date().toISOString(),
dependencyMetadata: {},
publishedAt: new Date().toISOString(),
},
latest: {
icon: BTC_ICON,
@@ -227,13 +227,13 @@ export module Mock {
screenshots: ['one.png', 'two.png', 'three.png'],
manifest: {
...Mock.MockManifestBitcoind,
'release-notes':
releaseNotes:
'For a complete list of changes, please visit <a href="https://bitcoincore.org/en/releases/0.21.0/" target="_blank">https://bitcoincore.org/en/releases/0.21.0/</a><br />Or in [markdown](https://bitcoincore.org/en/releases/0.21.0/)<ul><li>Taproot!</li><li>New RPCs</li><li>Experimental Descriptor Wallets</li></ul>',
},
categories: ['bitcoin', 'cryptocurrency'],
versions: ['0.19.0', '0.20.0', '0.21.0'],
'dependency-metadata': {},
'published-at': new Date().toISOString(),
dependencyMetadata: {},
publishedAt: new Date().toISOString(),
},
},
lnd: {
@@ -244,15 +244,15 @@ export module Mock {
manifest: {
...Mock.MockManifestLnd,
version: '0.11.0',
'release-notes': 'release notes for LND 0.11.0',
releaseNotes: 'release notes for LND 0.11.0',
},
categories: ['bitcoin', 'lightning', 'cryptocurrency'],
versions: ['0.11.0', '0.11.1'],
'dependency-metadata': {
dependencyMetadata: {
bitcoind: BitcoinDep,
'btc-rpc-proxy': ProxyDep,
},
'published-at': new Date().toISOString(),
publishedAt: new Date().toISOString(),
},
'0.11.1': {
icon: LND_ICON,
@@ -261,15 +261,15 @@ export module Mock {
manifest: {
...Mock.MockManifestLnd,
version: '0.11.1',
'release-notes': 'release notes for LND 0.11.1',
releaseNotes: 'release notes for LND 0.11.1',
},
categories: ['bitcoin', 'lightning', 'cryptocurrency'],
versions: ['0.11.0', '0.11.1'],
'dependency-metadata': {
dependencyMetadata: {
bitcoind: BitcoinDep,
'btc-rpc-proxy': ProxyDep,
},
'published-at': new Date().toISOString(),
publishedAt: new Date().toISOString(),
},
latest: {
icon: LND_ICON,
@@ -278,11 +278,11 @@ export module Mock {
manifest: Mock.MockManifestLnd,
categories: ['bitcoin', 'lightning', 'cryptocurrency'],
versions: ['0.11.0', '0.11.1'],
'dependency-metadata': {
dependencyMetadata: {
bitcoind: BitcoinDep,
'btc-rpc-proxy': ProxyDep,
},
'published-at': new Date(new Date().valueOf() + 10).toISOString(),
publishedAt: new Date(new Date().valueOf() + 10).toISOString(),
},
},
'btc-rpc-proxy': {
@@ -293,10 +293,10 @@ export module Mock {
manifest: Mock.MockManifestBitcoinProxy,
categories: ['bitcoin'],
versions: ['0.2.2'],
'dependency-metadata': {
dependencyMetadata: {
bitcoind: BitcoinDep,
},
'published-at': new Date().toISOString(),
publishedAt: new Date().toISOString(),
},
},
}
@@ -307,8 +307,8 @@ export module Mock {
export const Notifications: ServerNotifications = [
{
id: 1,
'package-id': null,
'created-at': '2019-12-26T14:20:30.872Z',
packageId: null,
createdAt: '2019-12-26T14:20:30.872Z',
code: 1,
level: NotificationLevel.Success,
title: 'Backup Complete',
@@ -328,8 +328,8 @@ export module Mock {
},
{
id: 2,
'package-id': null,
'created-at': '2019-12-26T14:20:30.872Z',
packageId: null,
createdAt: '2019-12-26T14:20:30.872Z',
code: 2,
level: NotificationLevel.Warning,
title: 'SSH Key Added',
@@ -339,8 +339,8 @@ export module Mock {
},
{
id: 3,
'package-id': null,
'created-at': '2019-12-26T14:20:30.872Z',
packageId: null,
createdAt: '2019-12-26T14:20:30.872Z',
code: 3,
level: NotificationLevel.Info,
title: 'SSH Key Removed',
@@ -350,8 +350,8 @@ export module Mock {
},
{
id: 4,
'package-id': 'bitcoind',
'created-at': '2019-12-26T14:20:30.872Z',
packageId: 'bitcoind',
createdAt: '2019-12-26T14:20:30.872Z',
code: 4,
level: NotificationLevel.Error,
title: 'Service Crashed',
@@ -377,7 +377,7 @@ export module Mock {
},
},
memory: {
'percentage-used': {
percentageUsed: {
value: '30.7',
unit: '%',
},
@@ -393,29 +393,29 @@ export module Mock {
value: '8784.97',
unit: 'MiB',
},
'zram-total': {
zramTotal: {
value: '7992.00',
unit: 'MiB',
},
'zram-available': {
zramAvailable: {
value: '7882.50',
unit: 'MiB',
},
'zram-used': {
zramUsed: {
value: '109.50',
unit: 'MiB',
},
},
cpu: {
'percentage-used': {
percentageUsed: {
value: '8.4',
unit: '%',
},
'user-space': {
userSpace: {
value: '7.0',
unit: '%',
},
'kernel-space': {
kernelSpace: {
value: '1.4',
unit: '%',
},
@@ -441,7 +441,7 @@ export module Mock {
value: '992.59',
unit: 'GB',
},
'percentage-used': {
percentageUsed: {
value: '46.4',
unit: '%',
},
@@ -484,22 +484,22 @@ export module Mock {
current: 'b7b1a9cef4284f00af9e9dda6e676177',
sessions: {
c54ddd8107d6d7b9d8aed7: {
'last-active': '2021-07-14T20:49:17.774Z',
'user-agent': 'AppleWebKit/{WebKit Rev} (KHTML, like Gecko)',
lastActive: '2021-07-14T20:49:17.774Z',
userAgent: 'AppleWebKit/{WebKit Rev} (KHTML, like Gecko)',
metadata: {
platforms: ['iphone', 'mobileweb', 'mobile', 'ios'],
},
},
klndsfjhbwsajkdnaksj: {
'last-active': '2019-07-14T20:49:17.774Z',
'user-agent': 'AppleWebKit/{WebKit Rev} (KHTML, like Gecko)',
lastActive: '2019-07-14T20:49:17.774Z',
userAgent: 'AppleWebKit/{WebKit Rev} (KHTML, like Gecko)',
metadata: {
platforms: ['cli'],
},
},
b7b1a9cef4284f00af9e9dda6e676177: {
'last-active': '2021-06-14T20:49:17.774Z',
'user-agent':
lastActive: '2021-06-14T20:49:17.774Z',
userAgent:
'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0',
metadata: {
platforms: ['desktop'],
@@ -518,13 +518,13 @@ export module Mock {
export const SshKeys: RR.GetSSHKeysRes = [
{
'created-at': new Date().toISOString(),
createdAt: new Date().toISOString(),
alg: 'ed25519',
hostname: 'Matt Key',
fingerprint: '28:d2:7e:78:61:b4:bf:g2:de:24:15:96:4e:d4:15:53',
},
{
'created-at': new Date().toISOString(),
createdAt: new Date().toISOString(),
alg: 'ed25519',
hostname: 'Aiden Key',
fingerprint: '12:f8:7e:78:61:b4:bf:e2:de:24:15:96:4e:d4:72:53',
@@ -532,7 +532,7 @@ export module Mock {
]
export const SshKey: RR.AddSSHKeyRes = {
'created-at': new Date().toISOString(),
createdAt: new Date().toISOString(),
alg: 'ed25519',
hostname: 'Lucy Key',
fingerprint: '44:44:7e:78:61:b4:bf:g2:de:24:15:96:4e:d4:15:53',
@@ -546,7 +546,7 @@ export module Mock {
},
connected: 'Goosers',
country: 'US',
'available-wifi': [
availableWifi: [
{
ssid: 'Goosers a billion',
strength: 40,
@@ -566,7 +566,7 @@ export module Mock {
}
export const BackupTargets: RR.GetBackupTargetsRes = {
'unknown-disks': [
unknownDisks: [
{
logicalname: 'sbc4',
label: 'My Backup Drive',
@@ -574,6 +574,7 @@ export module Mock {
used: 100000000000,
model: 'T7',
vendor: 'Samsung',
startOs: null,
},
],
saved: [
@@ -585,13 +586,13 @@ export module Mock {
path: '/Desktop/embassy-backups',
username: 'TestUser',
mountable: false,
'embassy-os': {
startOs: {
version: '0.3.0',
full: true,
'password-hash':
passwordHash:
// password is asdfasdf
'$argon2d$v=19$m=1024,t=1,p=1$YXNkZmFzZGZhc2RmYXNkZg$Ceev1I901G6UwU+hY0sHrFZ56D+o+LNJ',
'wrapped-key': '',
wrappedKey: '',
},
},
{
@@ -601,7 +602,7 @@ export module Mock {
provider: 'dropbox',
path: '/Home/backups',
mountable: true,
'embassy-os': null,
startOs: null,
},
{
id: 'csgashbdjkasnd',
@@ -611,7 +612,7 @@ export module Mock {
path: '/Desktop/embassy-backups-2',
username: 'TestUser',
mountable: true,
'embassy-os': null,
startOs: null,
},
{
id: 'powjefhjbnwhdva',
@@ -625,13 +626,13 @@ export module Mock {
vendor: 'SSK',
mountable: true,
path: '/HomeFolder/Documents',
'embassy-os': {
startOs: {
version: '0.3.0',
full: true,
// password is asdfasdf
'password-hash':
passwordHash:
'$argon2d$v=19$m=1024,t=1,p=1$YXNkZmFzZGZhc2RmYXNkZg$Ceev1I901G6UwU+hY0sHrFZ56D+o+LNJ',
'wrapped-key': '',
wrappedKey: '',
},
},
],
@@ -694,17 +695,17 @@ export module Mock {
export const BackupInfo: RR.GetBackupInfoRes = {
version: '0.3.0',
timestamp: new Date().toISOString(),
'package-backups': {
packageBackups: {
bitcoind: {
title: 'Bitcoin Core',
version: '0.21.0',
'os-version': '0.3.0',
osVersion: '0.3.0',
timestamp: new Date().toISOString(),
},
'btc-rpc-proxy': {
title: 'Bitcoin Proxy',
version: '0.2.2',
'os-version': '0.3.0',
osVersion: '0.3.0',
timestamp: new Date().toISOString(),
},
},
@@ -1261,12 +1262,12 @@ export module Mock {
export const MockDependencyConfig = MockConfig
export const bitcoind: PackageDataEntry<InstalledState> = {
'state-info': {
stateInfo: {
state: PackageState.Installed,
manifest: MockManifestBitcoind,
},
icon: '/assets/img/service-icons/bitcoind.svg',
'last-backup': null,
lastBackup: null,
status: {
configured: true,
main: {
@@ -1274,10 +1275,10 @@ export module Mock {
started: new Date().toISOString(),
health: {},
},
'dependency-config-errors': {},
dependencyConfigErrors: {},
},
actions: {}, // @TODO need mocks
'service-interfaces': {
serviceInterfaces: {
ui: {
id: 'ui',
hasPrimary: false,
@@ -1493,30 +1494,29 @@ export module Mock {
},
},
},
'current-dependencies': {},
'dependency-info': {},
'marketplace-url': 'https://registry.start9.com/',
'developer-key': 'developer-key',
'has-config': true,
currentDependencies: {},
dependencyInfo: {},
marketplaceUrl: 'https://registry.start9.com/',
developerKey: 'developer-key',
outboundProxy: null,
}
export const bitcoinProxy: PackageDataEntry<InstalledState> = {
'state-info': {
stateInfo: {
state: PackageState.Installed,
manifest: MockManifestBitcoinProxy,
},
icon: '/assets/img/service-icons/btc-rpc-proxy.png',
'last-backup': null,
lastBackup: null,
status: {
configured: false,
main: {
status: PackageMainStatus.Stopped,
},
'dependency-config-errors': {},
dependencyConfigErrors: {},
},
actions: {},
'service-interfaces': {
serviceInterfaces: {
ui: {
id: 'ui',
hasPrimary: false,
@@ -1624,42 +1624,41 @@ export module Mock {
},
},
},
'current-dependencies': {
currentDependencies: {
bitcoind: {
versionRange: '>=26.0.0',
'health-checks': [],
healthChecks: [],
},
},
'dependency-info': {
dependencyInfo: {
bitcoind: {
title: Mock.MockManifestBitcoind.title,
icon: 'assets/img/service-icons/bitcoind.svg',
},
},
'marketplace-url': 'https://registry.start9.com/',
'developer-key': 'developer-key',
'has-config': true,
marketplaceUrl: 'https://registry.start9.com/',
developerKey: 'developer-key',
outboundProxy: null,
}
export const lnd: PackageDataEntry<InstalledState> = {
'state-info': {
stateInfo: {
state: PackageState.Installed,
manifest: MockManifestLnd,
},
icon: '/assets/img/service-icons/lnd.png',
'last-backup': null,
lastBackup: null,
status: {
configured: true,
main: {
status: PackageMainStatus.Stopped,
},
'dependency-config-errors': {
dependencyConfigErrors: {
'btc-rpc-proxy': 'Username not found',
},
},
actions: {},
'service-interfaces': {
serviceInterfaces: {
grpc: {
id: 'grpc',
hasPrimary: false,
@@ -1871,17 +1870,17 @@ export module Mock {
},
},
},
'current-dependencies': {
currentDependencies: {
bitcoind: {
versionRange: '>=26.0.0',
'health-checks': [],
healthChecks: [],
},
'btc-rpc-proxy': {
versionRange: '>2.0.0', // @TODO
'health-checks': [],
healthChecks: [],
},
},
'dependency-info': {
dependencyInfo: {
bitcoind: {
title: Mock.MockManifestBitcoind.title,
icon: 'assets/img/service-icons/bitcoind.svg',
@@ -1891,9 +1890,8 @@ export module Mock {
icon: 'assets/img/service-icons/btc-rpc-proxy.png',
},
},
'marketplace-url': 'https://registry.start9.com/',
'developer-key': 'developer-key',
'has-config': true,
marketplaceUrl: 'https://registry.start9.com/',
developerKey: 'developer-key',
outboundProxy: null,
}

View File

@@ -40,8 +40,8 @@ export module RR {
export type LogoutRes = null
export type ResetPasswordReq = {
'old-password': string
'new-password': string
oldPassword: string
newPassword: string
} // auth.reset-password
export type ResetPasswordRes = null
@@ -68,7 +68,7 @@ export module RR {
metrics: Metrics
}
export type UpdateServerReq = { 'marketplace-url': string } // server.update
export type UpdateServerReq = { marketplaceUrl: string } // server.update
export type UpdateServerRes = 'updating' | 'no-updates'
export type SetServerClearnetAddressReq = { domainInfo: DomainInfo | null } // server.set-clearnet
@@ -84,7 +84,7 @@ export module RR {
export type SystemRebuildRes = null
export type ResetTorReq = {
'wipe-state': boolean
wipeState: boolean
reason: string
} // net.tor.reset
export type ResetTorRes = null
@@ -186,7 +186,7 @@ export module RR {
connected: string | null
country: string | null
ethernet: boolean
'available-wifi': AvailableWifi[]
availableWifi: AvailableWifi[]
}
export type AddWifiReq = {
@@ -230,7 +230,7 @@ export module RR {
export type GetBackupTargetsReq = {} // backup.target.list
export type GetBackupTargetsRes = {
'unknown-disks': UnknownDisk[]
unknownDisks: UnknownDisk[]
saved: BackupTarget[]
}
@@ -276,9 +276,9 @@ export module RR {
export type CreateBackupJobReq = {
name: string
'target-id': string
targetId: string
cron: string
'package-ids': string[]
packageIds: string[]
now: boolean
} // backup.job.create
export type CreateBackupJobRes = BackupJob
@@ -297,10 +297,10 @@ export module RR {
export type DeleteBackupRunsReq = { ids: string[] } // backup.runs.delete
export type DeleteBackupRunsRes = null
export type GetBackupInfoReq = { 'target-id': string; password: string } // backup.target.info
export type GetBackupInfoReq = { targetId: string; password: string } // backup.target.info
export type GetBackupInfoRes = BackupInfo
export type CreateBackupReq = { 'target-id': string; 'package-ids': string[] } // backup.create
export type CreateBackupReq = { targetId: string; packageIds: string[] } // backup.create
export type CreateBackupRes = null
// package
@@ -316,9 +316,9 @@ export module RR {
export type InstallPackageReq = {
id: string
'version-spec'?: string
'version-priority'?: 'min' | 'max'
'marketplace-url': string
versionSpec?: string
versionPriority?: 'min' | 'max'
marketplaceUrl: string
} // package.install
export type InstallPackageRes = null
@@ -334,14 +334,15 @@ export module RR {
export type RestorePackagesReq = {
// package.backup.restore
ids: string[]
'target-id': string
targetId: string
oldPassword: string | null
password: string
}
export type RestorePackagesRes = null
export type ExecutePackageActionReq = {
id: string
'action-id': string
actionId: string
input?: object
} // package.action
export type ExecutePackageActionRes = ActionResponse
@@ -359,12 +360,12 @@ export module RR {
export type UninstallPackageRes = null
export type DryConfigureDependencyReq = {
'dependency-id': string
'dependent-id': string
dependencyId: string
dependentId: string
} // package.dependency.configure.dry
export type DryConfigureDependencyRes = {
'old-config': object
'new-config': object
oldConfig: object
newConfig: object
spec: InputSpec
}
@@ -389,10 +390,10 @@ export module RR {
// marketplace
export type GetMarketplaceInfoReq = { 'server-id': string }
export type GetMarketplaceInfoReq = { serverId: string }
export type GetMarketplaceInfoRes = StoreInfo
export type GetMarketplaceEosReq = { 'server-id': string }
export type GetMarketplaceEosReq = { serverId: string }
export type GetMarketplaceEosRes = MarketplaceEOS
export type GetMarketplacePackagesReq = {
@@ -401,7 +402,7 @@ export module RR {
category?: string
query?: string
page?: number
'per-page'?: number
perPage?: number
}
export type GetMarketplacePackagesRes = MarketplacePkg[]
@@ -412,7 +413,7 @@ export module RR {
export interface MarketplaceEOS {
version: string
headline: string
'release-notes': { [version: string]: string }
releaseNotes: { [version: string]: string }
}
export interface Breakages {
@@ -442,31 +443,31 @@ export interface Metrics {
}
memory: {
total: MetricData
'percentage-used': MetricData
percentageUsed: MetricData
used: MetricData
available: MetricData
'zram-total': MetricData
'zram-used': MetricData
'zram-available': MetricData
zramTotal: MetricData
zramUsed: MetricData
zramAvailable: MetricData
}
cpu: {
'percentage-used': MetricData
percentageUsed: MetricData
idle: MetricData
'user-space': MetricData
'kernel-space': MetricData
userSpace: MetricData
kernelSpace: MetricData
wait: MetricData
}
disk: {
capacity: MetricData
'percentage-used': MetricData
percentageUsed: MetricData
used: MetricData
available: MetricData
}
}
export interface Session {
'last-active': string
'user-agent': string
lastActive: string
userAgent: string
metadata: SessionMetadata
}
@@ -503,6 +504,7 @@ export interface UnknownDisk {
label: string | null
capacity: number
used: number | null
startOs: StartOSDiskInfo | null
}
export interface BaseBackupTarget {
@@ -511,7 +513,7 @@ export interface BaseBackupTarget {
name: string
mountable: boolean
path: string
'embassy-os': StartOSDiskInfo | null
startOs: StartOSDiskInfo | null
}
export interface DiskBackupTarget extends UnknownDisk, BaseBackupTarget {
@@ -543,13 +545,13 @@ export interface BackupJob {
name: string
target: BackupTarget
cron: string // '* * * * * *' https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules
'package-ids': string[]
packageIds: string[]
}
export interface BackupInfo {
version: string
timestamp: string
'package-backups': {
packageBackups: {
[id: string]: PackageBackupInfo
}
}
@@ -557,7 +559,7 @@ export interface BackupInfo {
export interface PackageBackupInfo {
title: string
version: string
'os-version': string
osVersion: string
timestamp: string
}
@@ -566,7 +568,7 @@ export interface ServerSpecs {
}
export interface SSHKey {
'created-at': string
createdAt: string
alg: string
hostname: string
fingerprint: string
@@ -576,8 +578,8 @@ export type ServerNotifications = ServerNotification<number>[]
export interface ServerNotification<T extends number> {
id: number
'package-id': string | null
'created-at': string
packageId: string | null
createdAt: string
code: T
level: NotificationLevel
title: string
@@ -596,8 +598,8 @@ export enum NotificationLevel {
export type NotificationData<T> = T extends 0
? null
: T extends 1
? BackupReport
: any
? BackupReport
: any
export interface BackupReport {
server: {

View File

@@ -175,7 +175,7 @@ export class LiveApiService extends ApiService {
async updateServer(url?: string): Promise<RR.UpdateServerRes> {
const params = {
'marketplace-url': url || this.config.marketplace.start9,
marketplaceUrl: url || this.config.marketplace.start9,
}
return this.rpcRequest({ method: 'server.update', params })
}
@@ -234,7 +234,7 @@ export class LiveApiService extends ApiService {
async getEos(): Promise<RR.GetMarketplaceEosRes> {
const { id } = await getServerInfo(this.patch)
const qp: RR.GetMarketplaceEosReq = { 'server-id': id }
const qp: RR.GetMarketplaceEosReq = { serverId: id }
return this.marketplaceProxy(
'/eos/v0/latest',

View File

@@ -232,8 +232,8 @@ export class MockApiService extends ApiService {
return {
entries,
'start-cursor': 'startCursor',
'end-cursor': 'endCursor',
startCursor: 'start-cursor',
endCursor: 'end-cursor',
}
}
@@ -245,8 +245,8 @@ export class MockApiService extends ApiService {
return {
entries,
'start-cursor': 'startCursor',
'end-cursor': 'endCursor',
startCursor: 'start-cursor',
endCursor: 'end-cursor',
}
}
@@ -256,8 +256,8 @@ export class MockApiService extends ApiService {
return {
entries,
'start-cursor': 'startCursor',
'end-cursor': 'endCursor',
startCursor: 'startCursor',
endCursor: 'end-cursor',
}
}
@@ -266,7 +266,7 @@ export class MockApiService extends ApiService {
): Promise<RR.FollowServerLogsRes> {
await pauseFor(2000)
return {
'start-cursor': 'start-cursor',
startCursor: 'start-cursor',
guid: '7251d5be-645f-4362-a51b-3a85be92b31e',
}
}
@@ -276,7 +276,7 @@ export class MockApiService extends ApiService {
): Promise<RR.FollowServerLogsRes> {
await pauseFor(2000)
return {
'start-cursor': 'start-cursor',
startCursor: 'start-cursor',
guid: '7251d5be-645f-4362-a51b-3a85be92b31e',
}
}
@@ -286,7 +286,7 @@ export class MockApiService extends ApiService {
): Promise<RR.FollowServerLogsRes> {
await pauseFor(2000)
return {
'start-cursor': 'start-cursor',
startCursor: 'start-cursor',
guid: '7251d5be-645f-4362-a51b-3a85be92b31e',
}
}
@@ -324,7 +324,7 @@ export class MockApiService extends ApiService {
const patch = [
{
op: PatchOp.REPLACE,
path: '/server-info/status-info/update-progress',
path: '/serverInfo/statusInfo/updateProgress',
value: initialProgress,
},
]
@@ -358,7 +358,7 @@ export class MockApiService extends ApiService {
const patch = [
{
op: PatchOp.REPLACE,
path: '/server-info/status-info/restarting',
path: '/serverInfo/statusInfo/restarting',
value: true,
},
]
@@ -368,7 +368,7 @@ export class MockApiService extends ApiService {
const patch2 = [
{
op: PatchOp.REPLACE,
path: '/server-info/status-info/restarting',
path: '/serverInfo/statusInfo/restarting',
value: false,
},
]
@@ -386,7 +386,7 @@ export class MockApiService extends ApiService {
const patch = [
{
op: PatchOp.REPLACE,
path: '/server-info/status-info/shutting-down',
path: '/serverInfo/statusInfo/shuttingDown',
value: true,
},
]
@@ -396,7 +396,7 @@ export class MockApiService extends ApiService {
const patch2 = [
{
op: PatchOp.REPLACE,
path: '/server-info/status-info/shutting-down',
path: '/serverInfo/statusInfo/shuttingDown',
value: false,
},
]
@@ -781,7 +781,7 @@ export class MockApiService extends ApiService {
path: path.replace(/\\/g, '/'),
username: 'mockusername',
mountable: true,
'embassy-os': null,
startOs: null,
}
}
@@ -816,7 +816,7 @@ export class MockApiService extends ApiService {
name: params.name,
target: Mock.BackupTargets.saved[0],
cron: params.cron,
'package-ids': params['package-ids'],
packageIds: params.packageIds,
}
}
@@ -860,13 +860,13 @@ export class MockApiService extends ApiService {
async createBackup(params: RR.CreateBackupReq): Promise<RR.CreateBackupRes> {
await pauseFor(2000)
const path = '/server-info/status-info/backup-progress'
const ids = params['package-ids']
const path = '/serverInfo/statusInfo/backupProgress'
const ids = params.packageIds
setTimeout(async () => {
for (let i = 0; i < ids.length; i++) {
const id = ids[i]
const appPath = `/package-data/${id}/status/main/status`
const appPath = `/packageData/${id}/status/main/status`
const appPatch = [
{
op: PatchOp.REPLACE,
@@ -952,8 +952,8 @@ export class MockApiService extends ApiService {
}
return {
entries,
'start-cursor': 'startCursor',
'end-cursor': 'endCursor',
startCursor: 'startCursor',
endCursor: 'end-cursor',
}
}
@@ -962,7 +962,7 @@ export class MockApiService extends ApiService {
): Promise<RR.FollowPackageLogsRes> {
await pauseFor(2000)
return {
'start-cursor': 'start-cursor',
startCursor: 'start-cursor',
guid: '7251d5be-645f-4362-a51b-3a85be92b31e',
}
}
@@ -976,17 +976,17 @@ export class MockApiService extends ApiService {
this.updateProgress(params.id)
}, 1000)
const manifest = Mock.LocalPkgs[params.id]['state-info'].manifest
const manifest = Mock.LocalPkgs[params.id].stateInfo.manifest
const patch: Operation<
PackageDataEntry<InstallingState | UpdatingState>
>[] = [
{
op: PatchOp.ADD,
path: `/package-data/${params.id}`,
path: `/packageData/${params.id}`,
value: {
...Mock.LocalPkgs[params.id],
'state-info': {
stateInfo: {
// if installing
state: PackageState.Installing,
@@ -995,8 +995,8 @@ export class MockApiService extends ApiService {
// manifest,
// both
'installing-info': {
'new-manifest': manifest,
installingInfo: {
newManifest: manifest,
progress: PROGRESS,
},
},
@@ -1032,7 +1032,7 @@ export class MockApiService extends ApiService {
const patch = [
{
op: PatchOp.REPLACE,
path: `/package-data/${params.id}/status/configured`,
path: `/packageData/${params.id}/status/configured`,
value: true,
},
]
@@ -1052,13 +1052,13 @@ export class MockApiService extends ApiService {
return {
op: PatchOp.ADD,
path: `/package-data/${id}`,
path: `/packageData/${id}`,
value: {
...Mock.LocalPkgs[id],
'state-info': {
stateInfo: {
state: PackageState.Restoring,
'installing-info': {
'new-manifest': Mock.LocalPkgs[id]['state-info'].manifest!,
installingInfo: {
newManifest: Mock.LocalPkgs[id].stateInfo.manifest!,
progress: PROGRESS,
},
},
@@ -1079,7 +1079,7 @@ export class MockApiService extends ApiService {
}
async startPackage(params: RR.StartPackageReq): Promise<RR.StartPackageRes> {
const path = `/package-data/${params.id}/status/main`
const path = `/packageData/${params.id}/status/main`
await pauseFor(2000)
@@ -1128,7 +1128,7 @@ export class MockApiService extends ApiService {
): Promise<RR.RestartPackageRes> {
// first enact stop
await pauseFor(2000)
const path = `/package-data/${params.id}/status/main`
const path = `/packageData/${params.id}/status/main`
setTimeout(async () => {
const patch2: Operation<any>[] = [
@@ -1204,7 +1204,7 @@ export class MockApiService extends ApiService {
async stopPackage(params: RR.StopPackageReq): Promise<RR.StopPackageRes> {
await pauseFor(2000)
const path = `/package-data/${params.id}/status/main`
const path = `/packageData/${params.id}/status/main`
setTimeout(() => {
const patch2 = [
@@ -1244,7 +1244,7 @@ export class MockApiService extends ApiService {
const patch2: RemoveOperation[] = [
{
op: PatchOp.REMOVE,
path: `/package-data/${params.id}`,
path: `/packageData/${params.id}`,
},
]
this.mockRevision(patch2)
@@ -1253,7 +1253,7 @@ export class MockApiService extends ApiService {
const patch = [
{
op: PatchOp.REPLACE,
path: `/package-data/${params.id}/state-info/state`,
path: `/packageData/${params.id}/stateInfo/state`,
value: PackageState.Removing,
},
]
@@ -1268,8 +1268,8 @@ export class MockApiService extends ApiService {
): Promise<RR.DryConfigureDependencyRes> {
await pauseFor(2000)
return {
'old-config': Mock.MockConfig,
'new-config': Mock.MockDependencyConfig,
oldConfig: Mock.MockConfig,
newConfig: Mock.MockDependencyConfig,
spec: await Mock.getInputSpec(),
}
}
@@ -1327,7 +1327,7 @@ export class MockApiService extends ApiService {
const patches: Operation<any>[] = [
{
op: PatchOp.REPLACE,
path: `/package-data/${id}/state-info/installing-info/progress/phases/${i}/progress`,
path: `/packageData/${id}/stateInfo/installingInfo/progress/phases/${i}/progress`,
value: true,
},
]
@@ -1340,7 +1340,7 @@ export class MockApiService extends ApiService {
patches.push({
op: PatchOp.REPLACE,
path: `/package-data/${id}/state-info/installing-info/progress/overall/done`,
path: `/packageData/${id}/stateInfo/installingInfo/progress/overall/done`,
value: progress.overall.done,
})
}
@@ -1357,7 +1357,7 @@ export class MockApiService extends ApiService {
const patches: Operation<any>[] = [
{
op: PatchOp.REPLACE,
path: `/package-data/${id}/state-info/installing-info/progress/phases/${i}/progress/done`,
path: `/packageData/${id}/stateInfo/installingInfo/progress/phases/${i}/progress/done`,
value: phase.progress.done,
},
]
@@ -1370,7 +1370,7 @@ export class MockApiService extends ApiService {
patches.push({
op: PatchOp.REPLACE,
path: `/package-data/${id}/state-info/installing-info/progress/overall/done`,
path: `/packageData/${id}/stateInfo/installingInfo/progress/overall/done`,
value: progress.overall.done,
})
}
@@ -1382,7 +1382,7 @@ export class MockApiService extends ApiService {
this.mockRevision([
{
op: PatchOp.REPLACE,
path: `/package-data/${id}/state-info/installing-info/progress/phases/${i}/progress`,
path: `/packageData/${id}/stateInfo/installingInfo/progress/phases/${i}/progress`,
value: true,
},
])
@@ -1395,7 +1395,7 @@ export class MockApiService extends ApiService {
this.mockRevision([
{
op: PatchOp.REPLACE,
path: `/package-data/${id}/state-info/installing-info/progress/overall`,
path: `/packageData/${id}/stateInfo/installingInfo/progress/overall`,
value: true,
},
])
@@ -1404,10 +1404,10 @@ export class MockApiService extends ApiService {
const patch2: Operation<StateInfo>[] = [
{
op: PatchOp.REPLACE,
path: `/package-data/${id}/state-info`,
path: `/packageData/${id}/stateInfo`,
value: {
state: PackageState.Installed,
manifest: Mock.LocalPkgs[id]['state-info'].manifest,
manifest: Mock.LocalPkgs[id].stateInfo.manifest,
},
},
]
@@ -1421,7 +1421,7 @@ export class MockApiService extends ApiService {
const patch0 = [
{
op: PatchOp.REPLACE,
path: `/server-info/status-info/update-progress/size`,
path: `/serverInfo/statusInfo/updateProgress/size`,
value: size,
},
]
@@ -1433,7 +1433,7 @@ export class MockApiService extends ApiService {
const patch = [
{
op: PatchOp.REPLACE,
path: `/server-info/status-info/update-progress/downloaded`,
path: `/serverInfo/statusInfo/updateProgress/downloaded`,
value: downloaded,
},
]
@@ -1443,7 +1443,7 @@ export class MockApiService extends ApiService {
const patch2 = [
{
op: PatchOp.REPLACE,
path: `/server-info/status-info/update-progress/downloaded`,
path: `/serverInfo/statusInfo/updateProgress/downloaded`,
value: size,
},
]
@@ -1453,12 +1453,12 @@ export class MockApiService extends ApiService {
const patch3: Operation<boolean>[] = [
{
op: PatchOp.REPLACE,
path: '/server-info/status-info/updated',
path: '/serverInfo/statusInfo/updated',
value: true,
},
{
op: PatchOp.REMOVE,
path: '/server-info/status-info/update-progress',
path: '/serverInfo/statusInfo/updateProgress',
},
]
this.mockRevision(patch3)
@@ -1467,7 +1467,7 @@ export class MockApiService extends ApiService {
const patch6 = [
{
op: PatchOp.REPLACE,
path: '/server-info/status-info',
path: '/serverInfo/statusInfo',
value: Mock.ServerUpdated,
},
]

View File

@@ -9,13 +9,13 @@ import { Mock } from './api.fixures'
export const mockPatchData: DataModel = {
ui: {
name: `Matt's Server`,
'ack-welcome': '1.0.0',
ackWelcome: '1.0.0',
theme: 'Dark',
desktop: ['lnd'],
widgets: [],
marketplace: {
'selected-url': 'https://registry.start9.com/',
'known-hosts': {
selectedUrl: 'https://registry.start9.com/',
knownHosts: {
'https://registry.start9.com/': {
name: 'Start9 Registry',
},
@@ -27,12 +27,12 @@ export const mockPatchData: DataModel = {
},
gaming: {
snake: {
'high-score': 0,
highScore: 0,
},
},
'ack-instructions': {},
ackInstructions: {},
},
'server-info': {
serverInfo: {
id: 'abcdefgh',
version: '0.3.5.1',
country: 'us',
@@ -116,22 +116,22 @@ export const mockPatchData: DataModel = {
},
outboundProxy: null,
},
'last-backup': new Date(new Date().valueOf() - 604800001).toISOString(),
lastBackup: new Date(new Date().valueOf() - 604800001).toISOString(),
unreadNotifications: {
count: 4,
recent: Mock.Notifications,
},
'eos-version-compat': '>=0.3.0 <=0.3.0.1',
'status-info': {
'current-backup': null,
eosVersionCompat: '>=0.3.0 <=0.3.0.1',
statusInfo: {
currentBackup: null,
updated: false,
'update-progress': null,
updateProgress: null,
restarting: false,
'shutting-down': false,
shuttingDown: false,
},
pubkey: 'npub1sg6plzptd64u62a878hep2kev88swjh3tw00gjsfl8f237lmu63q0uf63m',
'ca-fingerprint': 'SHA-256: 63 2B 11 99 44 40 17 DF 37 FC C3 DF 0F 3D 15',
'ntp-synced': false,
caFingerprint: 'SHA-256: 63 2B 11 99 44 40 17 DF 37 FC C3 DF 0F 3D 15',
ntpSynced: false,
smtp: {
server: '',
port: 587,
@@ -139,13 +139,13 @@ export const mockPatchData: DataModel = {
login: '',
password: '',
},
'password-hash':
passwordHash:
'$argon2d$v=19$m=1024,t=1,p=1$YXNkZmFzZGZhc2RmYXNkZg$Ceev1I901G6UwU+hY0sHrFZ56D+o+LNJ',
platform: 'x86_64-nonfree',
},
'package-data': {
packageData: {
bitcoind: {
'state-info': {
stateInfo: {
state: PackageState.Installed,
manifest: {
...Mock.MockManifestBitcoind,
@@ -153,7 +153,7 @@ export const mockPatchData: DataModel = {
},
},
icon: '/assets/img/service-icons/bitcoind.svg',
'last-backup': null,
lastBackup: null,
status: {
configured: true,
main: {
@@ -185,10 +185,10 @@ export const mockPatchData: DataModel = {
},
},
},
'dependency-config-errors': {},
dependencyConfigErrors: {},
},
actions: {}, // @TODO
'service-interfaces': {
serviceInterfaces: {
ui: {
id: 'ui',
hasPrimary: false,
@@ -404,15 +404,14 @@ export const mockPatchData: DataModel = {
},
},
},
'current-dependencies': {},
'dependency-info': {},
'marketplace-url': 'https://registry.start9.com/',
'developer-key': 'developer-key',
'has-config': true,
currentDependencies: {},
dependencyInfo: {},
marketplaceUrl: 'https://registry.start9.com/',
developerKey: 'developer-key',
outboundProxy: null,
},
lnd: {
'state-info': {
stateInfo: {
state: PackageState.Installed,
manifest: {
...Mock.MockManifestLnd,
@@ -420,18 +419,18 @@ export const mockPatchData: DataModel = {
},
},
icon: '/assets/img/service-icons/lnd.png',
'last-backup': null,
lastBackup: null,
status: {
configured: true,
main: {
status: PackageMainStatus.Stopped,
},
'dependency-config-errors': {
dependencyConfigErrors: {
'btc-rpc-proxy': 'This is a config unsatisfied error',
},
},
actions: {},
'service-interfaces': {
serviceInterfaces: {
grpc: {
id: 'grpc',
hasPrimary: false,
@@ -641,17 +640,17 @@ export const mockPatchData: DataModel = {
},
},
},
'current-dependencies': {
currentDependencies: {
bitcoind: {
versionRange: '>=26.0.0',
'health-checks': [],
healthChecks: [],
},
'btc-rpc-proxy': {
versionRange: '>2.0.0',
'health-checks': [],
healthChecks: [],
},
},
'dependency-info': {
dependencyInfo: {
bitcoind: {
title: 'Bitcoin Core',
icon: 'assets/img/service-icons/bitcoind.svg',
@@ -661,9 +660,8 @@ export const mockPatchData: DataModel = {
icon: 'assets/img/service-icons/btc-rpc-proxy.png',
},
},
'marketplace-url': 'https://registry.start9.com/',
'developer-key': 'developer-key',
'has-config': true,
marketplaceUrl: 'https://registry.start9.com/',
developerKey: 'developer-key',
outboundProxy: null,
},
},