Feat/community marketplace (#1790)

* add community marketplace

* Update embassy-mock-api.service.ts

* expect ui/marketplace to be undefined

* possible undefined from getpackage

* fix marketplace pages

* rework marketplace infrastructure

* fix bugs

Co-authored-by: Lucy C <12953208+elvece@users.noreply.github.com>
This commit is contained in:
Matt Hill
2022-10-06 17:27:17 -06:00
committed by Aiden McClelland
parent e2db3d84d8
commit 9998ed177b
55 changed files with 754 additions and 879 deletions

View File

@@ -1,12 +0,0 @@
import { PatchDB } from 'patch-db-client'
import {
DataModel,
UIMarketplaceData,
} from 'src/app/services/patch-db/data-model'
import { firstValueFrom, map } from 'rxjs'
export function getMarketplace(
patch: PatchDB<DataModel>,
): Promise<UIMarketplaceData> {
return firstValueFrom(patch.watch$('ui', 'marketplace'))
}

View File

@@ -3,16 +3,16 @@ import {
DataModel,
PackageDataEntry,
} from 'src/app/services/patch-db/data-model'
import { filter, firstValueFrom } from 'rxjs'
import { firstValueFrom } from 'rxjs'
export function getPackage(
export async function getPackage(
patch: PatchDB<DataModel>,
id: string,
): Promise<PackageDataEntry | undefined> {
return firstValueFrom(patch.watch$('package-data', id))
}
export function getAllPackages(
export async function getAllPackages(
patch: PatchDB<DataModel>,
): Promise<Record<string, PackageDataEntry>> {
return firstValueFrom(patch.watch$('package-data'))

View File

@@ -2,6 +2,8 @@ import { PatchDB } from 'patch-db-client'
import { DataModel, ServerInfo } from 'src/app/services/patch-db/data-model'
import { firstValueFrom } from 'rxjs'
export function getServerInfo(patch: PatchDB<DataModel>): Promise<ServerInfo> {
export async function getServerInfo(
patch: PatchDB<DataModel>,
): Promise<ServerInfo> {
return firstValueFrom(patch.watch$('server-info'))
}