Refactor/sdk init (#2947)

* fixes for main

* refactor package initialization

* fixes from testing

* more fixes

* beta.21

* do not use instanceof

* closes #2921

* beta22

* allow disabling kiosk

* migration

* fix /etc/shadow

* actionRequest -> task

* beta.23
This commit is contained in:
Aiden McClelland
2025-05-21 10:24:37 -06:00
committed by GitHub
parent 46fd01c264
commit 44560c8da8
237 changed files with 1827 additions and 98800 deletions

View File

@@ -2232,9 +2232,9 @@ export namespace Mock {
storeExposedDependents: [],
registry: 'https://registry.start9.com/',
developerKey: 'developer-key',
requestedActions: {
tasks: {
'bitcoind-config': {
request: {
task: {
packageId: 'bitcoind',
actionId: 'config',
severity: 'critical',
@@ -2244,7 +2244,7 @@ export namespace Mock {
active: true,
},
'bitcoind-properties': {
request: {
task: {
packageId: 'bitcoind',
actionId: 'properties',
severity: 'important',
@@ -2297,7 +2297,7 @@ export namespace Mock {
storeExposedDependents: [],
registry: 'https://registry.start9.com/',
developerKey: 'developer-key',
requestedActions: {},
tasks: {},
}
export const lnd: PackageDataEntry<InstalledState> = {
@@ -2400,10 +2400,10 @@ export namespace Mock {
storeExposedDependents: [],
registry: 'https://registry.start9.com/',
developerKey: 'developer-key',
requestedActions: {
tasks: {
config: {
active: true,
request: {
task: {
packageId: 'lnd',
actionId: 'config',
severity: 'critical',
@@ -2412,7 +2412,7 @@ export namespace Mock {
},
connect: {
active: true,
request: {
task: {
packageId: 'lnd',
actionId: 'connect',
severity: 'important',
@@ -2421,7 +2421,7 @@ export namespace Mock {
},
'bitcoind/config': {
active: true,
request: {
task: {
packageId: 'bitcoind',
actionId: 'config',
severity: 'critical',
@@ -2437,7 +2437,7 @@ export namespace Mock {
},
'bitcoind/rpc': {
active: true,
request: {
task: {
packageId: 'bitcoind',
actionId: 'rpc',
severity: 'important',

View File

@@ -181,7 +181,7 @@ export const mockPatchData: DataModel = {
},
hostname: 'random-words',
pubkey: 'npub1sg6plzptd64u62a878hep2kev88swjh3tw00gjsfl8f237lmu63q0uf63m',
caFingerprint: 'SHA-256: 63 2B 11 99 44 40 17 DF 37 FC C3 DF 0F 3D 15',
caFingerprint: '63:2B:11:99:44:40:17:DF:37:FC:C3:DF:0F:3D:15',
ntpSynced: false,
smtp: {
server: '',
@@ -195,6 +195,7 @@ export const mockPatchData: DataModel = {
governor: 'performance',
ram: 8 * 1024 * 1024 * 1024,
devices: [],
kiosk: true,
},
packageData: {
bitcoind: {
@@ -455,9 +456,9 @@ export const mockPatchData: DataModel = {
storeExposedDependents: [],
registry: 'https://registry.start9.com/',
developerKey: 'developer-key',
requestedActions: {
tasks: {
// 'bitcoind-config': {
// request: {
// task: {
// packageId: 'bitcoind',
// actionId: 'config',
// severity: 'critical',
@@ -467,7 +468,7 @@ export const mockPatchData: DataModel = {
// active: true,
// },
'bitcoind-properties': {
request: {
task: {
packageId: 'bitcoind',
actionId: 'properties',
severity: 'important',
@@ -581,10 +582,10 @@ export const mockPatchData: DataModel = {
storeExposedDependents: [],
registry: 'https://registry.start9.com/',
developerKey: 'developer-key',
requestedActions: {
tasks: {
config: {
active: true,
request: {
task: {
packageId: 'lnd',
actionId: 'config',
severity: 'critical',
@@ -593,7 +594,7 @@ export const mockPatchData: DataModel = {
},
connect: {
active: true,
request: {
task: {
packageId: 'lnd',
actionId: 'connect',
severity: 'important',
@@ -602,7 +603,7 @@ export const mockPatchData: DataModel = {
},
'bitcoind/config': {
active: true,
request: {
task: {
packageId: 'bitcoind',
actionId: 'config',
severity: 'critical',
@@ -618,7 +619,7 @@ export const mockPatchData: DataModel = {
},
'bitcoind/rpc': {
active: true,
request: {
task: {
packageId: 'bitcoind',
actionId: 'rpc',
severity: 'important',

View File

@@ -103,11 +103,11 @@ export class DepErrorService {
// action required
if (
Object.values(pkg.requestedActions).some(
a =>
a.active &&
a.request.packageId === depId &&
a.request.severity === 'critical',
Object.values(pkg.tasks).some(
t =>
t.active &&
t.task.packageId === depId &&
t.task.severity === 'critical',
)
) {
return {

View File

@@ -29,11 +29,11 @@ export function renderPkgStatus(
}
export function getInstalledPrimaryStatus({
requestedActions,
tasks,
status,
}: T.PackageDataEntry): PrimaryStatus {
return Object.values(requestedActions).some(
r => r.active && r.request.severity === 'critical',
return Object.values(tasks).some(
t => t.active && t.task.severity === 'critical',
)
? 'actionRequired'
: status.main