mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
Merge branch 'update/camelCase' of github.com:Start9Labs/start-os into rebase/feat/domains
This commit is contained in:
@@ -38,7 +38,7 @@ import { ClientStorageService } from './client-storage.service'
|
||||
@Injectable()
|
||||
export class MarketplaceService implements AbstractMarketplaceService {
|
||||
private readonly knownHosts$: Observable<StoreIdentity[]> = this.patch
|
||||
.watch$('ui', 'marketplace', 'known-hosts')
|
||||
.watch$('ui', 'marketplace', 'knownHosts')
|
||||
.pipe(
|
||||
map(hosts => {
|
||||
const { start9, community } = this.config.marketplace
|
||||
@@ -72,8 +72,8 @@ export class MarketplaceService implements AbstractMarketplaceService {
|
||||
private readonly selectedHost$: Observable<StoreIdentity> = this.patch
|
||||
.watch$('ui', 'marketplace')
|
||||
.pipe(
|
||||
distinctUntilKeyChanged('selected-url'),
|
||||
map(({ 'selected-url': url, 'known-hosts': hosts }) =>
|
||||
distinctUntilKeyChanged('selectedUrl'),
|
||||
map(({ selectedUrl: url, knownHosts: hosts }) =>
|
||||
toStoreIdentity(url, hosts[url]),
|
||||
),
|
||||
shareReplay({ bufferSize: 1, refCount: true }),
|
||||
@@ -196,9 +196,9 @@ export class MarketplaceService implements AbstractMarketplaceService {
|
||||
): Observable<MarketplacePkg> {
|
||||
return this.patch.watch$('ui', 'marketplace').pipe(
|
||||
switchMap(uiMarketplace => {
|
||||
const url = optionalUrl || uiMarketplace['selected-url']
|
||||
const url = optionalUrl || uiMarketplace.selectedUrl
|
||||
|
||||
if (version !== '*' || !uiMarketplace['known-hosts'][url]) {
|
||||
if (version !== '*' || !uiMarketplace.knownHosts[url]) {
|
||||
return this.fetchPackage$(id, version, url)
|
||||
}
|
||||
|
||||
@@ -231,18 +231,18 @@ export class MarketplaceService implements AbstractMarketplaceService {
|
||||
): Promise<void> {
|
||||
const params: RR.InstallPackageReq = {
|
||||
id,
|
||||
'version-spec': `=${version}`,
|
||||
'marketplace-url': url,
|
||||
versionSpec: `=${version}`,
|
||||
marketplaceUrl: url,
|
||||
}
|
||||
|
||||
await this.api.installPackage(params)
|
||||
}
|
||||
|
||||
fetchInfo$(url: string): Observable<StoreInfo> {
|
||||
return this.patch.watch$('server-info').pipe(
|
||||
return this.patch.watch$('serverInfo').pipe(
|
||||
take(1),
|
||||
switchMap(serverInfo => {
|
||||
const qp: RR.GetMarketplaceInfoReq = { 'server-id': serverInfo.id }
|
||||
const qp: RR.GetMarketplaceInfoReq = { serverId: serverInfo.id }
|
||||
return this.api.marketplaceProxy<RR.GetMarketplaceInfoRes>(
|
||||
'/package/v0/info',
|
||||
qp,
|
||||
@@ -301,7 +301,7 @@ export class MarketplaceService implements AbstractMarketplaceService {
|
||||
const qp: RR.GetMarketplacePackagesReq = {
|
||||
...params,
|
||||
page: 1,
|
||||
'per-page': 100,
|
||||
perPage: 100,
|
||||
}
|
||||
if (qp.ids) qp.ids = JSON.stringify(qp.ids)
|
||||
|
||||
@@ -331,7 +331,7 @@ export class MarketplaceService implements AbstractMarketplaceService {
|
||||
): Promise<void> {
|
||||
if (oldName !== newName) {
|
||||
this.api.setDbValue<string>(
|
||||
['marketplace', 'known-hosts', url, 'name'],
|
||||
['marketplace', 'knownHosts', url, 'name'],
|
||||
newName,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user