mirror of
https://github.com/kunkunsh/kunkun.git
synced 2025-04-03 22:26:43 +00:00
Remove supabase (#263)
* remove supabase package * upgrade valibot * removed supabase package Migration not complete yet * update submodule * fixed some supabase errors * Add new fields to extension models - Added `id` field to `ExtPublish` - Expanded `DBExtension` with multiple new properties: - `api_version`, `author_id`, `created_at`, - `downloads`, `icon`, `identifier`, - `long_description`, `name`, - `readme`, `short_description`, - and `tarball_size` * Refactor: clean up unused Supabase imports - Removed commented-out Supabase imports from various files to streamline the codebase. - Updated `created_at` type in `ExtPublish` model from `date` to `string` for consistency. * update icon enum to union * fix type errors after removing supabase * format * more types fixed * feat: enhance command handling and update SDK version
This commit is contained in:
parent
9fe51f6260
commit
48e2e47f96
@ -11,11 +11,9 @@
|
||||
"jarvis",
|
||||
"form-view",
|
||||
"@kksh/desktop",
|
||||
"@kksh/supabase",
|
||||
"@kksh/utils",
|
||||
"@kksh/extension",
|
||||
"@kksh/schema",
|
||||
"@kksh/supabase",
|
||||
"@kksh/ui"
|
||||
]
|
||||
}
|
||||
|
@ -31,7 +31,7 @@
|
||||
"debug": "^4.4.0",
|
||||
"fs-extra": "^11.2.0",
|
||||
"inquirer": "^10.1.2",
|
||||
"valibot": "^1.0.0-rc.4"
|
||||
"valibot": "^1.0.0"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
|
@ -27,7 +27,7 @@
|
||||
"commander": "^12.1.0",
|
||||
"fs-extra": "^11.2.0",
|
||||
"handlebars": "^4.7.8",
|
||||
"valibot": "^1.0.0-rc.4"
|
||||
"valibot": "^1.0.0"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
|
13
apps/desktop/dev.ts
Normal file
13
apps/desktop/dev.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import { IconType } from "@kksh/api/models"
|
||||
import { getExtensionsLatestPublishByIdentifier } from "@kksh/sdk"
|
||||
|
||||
const latestPublish = await getExtensionsLatestPublishByIdentifier({
|
||||
path: {
|
||||
identifier: "RAG1"
|
||||
}
|
||||
})
|
||||
console.log(latestPublish)
|
||||
// latestPublish
|
||||
|
||||
// console.log(typeof IconEnum.Iconify)
|
||||
console.log(IconType.options)
|
@ -18,7 +18,6 @@
|
||||
"@formkit/auto-animate": "^0.8.2",
|
||||
"@inlang/paraglide-sveltekit": "0.16.0",
|
||||
"@kksh/extension": "workspace:*",
|
||||
"@kksh/supabase": "workspace:*",
|
||||
"@kksh/svelte5": "^0.1.15",
|
||||
"@kksh/ui": "workspace:*",
|
||||
"@kksh/utils": "workspace:*",
|
||||
|
@ -12,7 +12,7 @@ import { onQuickLinkSelect } from "./quick-links"
|
||||
|
||||
const onExtCmdSelect: OnExtCmdSelect = (
|
||||
ext: ExtPackageJsonExtra,
|
||||
cmd: CustomUiCmd | TemplateUiCmd,
|
||||
cmd: CustomUiCmd | TemplateUiCmd | HeadlessCmd,
|
||||
{ isDev, hmr }: { isDev: boolean; hmr: boolean }
|
||||
) => {
|
||||
switch (cmd.type) {
|
||||
|
@ -3,16 +3,16 @@
|
||||
* It's designed to allow all components to access a shared state.
|
||||
* With context, we can avoid prop drilling, and avoid using stores which makes components hard to encapsulate.
|
||||
*/
|
||||
import type { AppConfig } from "@/types/appConfig"
|
||||
import type { AppConfigState } from "@kksh/types"
|
||||
import { getContext, setContext } from "svelte"
|
||||
import type { Writable } from "svelte/store"
|
||||
|
||||
export const APP_CONFIG_CONTEXT_KEY = Symbol("appConfig")
|
||||
|
||||
export function getAppConfigContext(): Writable<AppConfig> {
|
||||
export function getAppConfigContext(): Writable<AppConfigState> {
|
||||
return getContext(APP_CONFIG_CONTEXT_KEY)
|
||||
}
|
||||
|
||||
export function setAppConfigContext(appConfig: Writable<AppConfig>) {
|
||||
export function setAppConfigContext(appConfig: Writable<AppConfigState>) {
|
||||
setContext(APP_CONFIG_CONTEXT_KEY, appConfig)
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { AppState } from "@/types/appState"
|
||||
import type { AppState } from "@kksh/types"
|
||||
import { getContext, setContext } from "svelte"
|
||||
import type { Writable } from "svelte/store"
|
||||
|
||||
|
@ -7,7 +7,7 @@ import Fuse from "fuse.js"
|
||||
import { derived, get, writable } from "svelte/store"
|
||||
import { appState } from "./appState"
|
||||
|
||||
export const fuse = new Fuse<AppInfo>([], {
|
||||
const fuse = new Fuse<AppInfo>([], {
|
||||
includeScore: true,
|
||||
threshold: 0.2,
|
||||
keys: ["name"]
|
||||
|
@ -6,7 +6,7 @@ import Fuse from "fuse.js"
|
||||
import { derived, get, writable, type Writable } from "svelte/store"
|
||||
import { appState } from "./appState"
|
||||
|
||||
export const fuse = new Fuse<QuickLink>([], {
|
||||
const fuse = new Fuse<QuickLink>([], {
|
||||
includeScore: true,
|
||||
threshold: 0.2,
|
||||
keys: ["name"]
|
||||
|
@ -1,19 +1,13 @@
|
||||
import { SupabaseAPI } from "@kksh/supabase/api"
|
||||
import type { Database } from "@kksh/supabase/types"
|
||||
import * as sb from "@supabase/supabase-js"
|
||||
import { SUPABASE_ANON_KEY, SUPABASE_URL } from "./constants"
|
||||
|
||||
// export const supabase = createSB(SUPABASE_URL, SUPABASE_ANON_KEY)
|
||||
export const supabase: sb.SupabaseClient<Database> = sb.createClient<Database>(
|
||||
SUPABASE_URL,
|
||||
SUPABASE_ANON_KEY,
|
||||
{
|
||||
auth: {
|
||||
flowType: "pkce"
|
||||
}
|
||||
export const supabase: sb.SupabaseClient = sb.createClient(SUPABASE_URL, SUPABASE_ANON_KEY, {
|
||||
auth: {
|
||||
flowType: "pkce"
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
export const storage = supabase.storage
|
||||
export const supabaseExtensionsStorage = supabase.storage.from("extensions")
|
||||
export const supabaseAPI = new SupabaseAPI(supabase)
|
||||
// export const supabaseAPI = new SupabaseAPI(supabase)
|
||||
|
@ -1,8 +1,7 @@
|
||||
import { extensions } from "@/stores"
|
||||
import { supabaseAPI } from "@/supabase"
|
||||
import { isCompatible } from "@kksh/api"
|
||||
import type { ExtPackageJsonExtra } from "@kksh/api/models"
|
||||
import { greaterThan } from "@std/semver"
|
||||
import { getExtensionsLatestPublishByIdentifier } from "@kksh/sdk"
|
||||
import { relaunch } from "@tauri-apps/plugin-process"
|
||||
import { check } from "@tauri-apps/plugin-updater"
|
||||
import { gt } from "semver"
|
||||
@ -32,11 +31,22 @@ export async function checkSingleExtensionUpdate(
|
||||
installedExt: ExtPackageJsonExtra,
|
||||
autoupgrade: boolean
|
||||
) {
|
||||
const { data: sbExt, error } = await supabaseAPI.getLatestExtPublish(
|
||||
installedExt.kunkun.identifier
|
||||
)
|
||||
const {
|
||||
data: sbExt,
|
||||
error,
|
||||
response
|
||||
} = await getExtensionsLatestPublishByIdentifier({
|
||||
path: {
|
||||
identifier: "RAG"
|
||||
}
|
||||
})
|
||||
// const { data: sbExt, error } = await supabaseAPI.getLatestExtPublish(
|
||||
// installedExt.kunkun.identifier
|
||||
// )
|
||||
if (error) {
|
||||
return toast.error(`Failed to check update for ${installedExt.kunkun.identifier}: ${error}`)
|
||||
return toast.error(
|
||||
`Failed to check update for ${installedExt.kunkun.identifier}: ${error} (${response.status})`
|
||||
)
|
||||
}
|
||||
|
||||
if (!sbExt) {
|
||||
@ -49,10 +59,7 @@ export async function checkSingleExtensionUpdate(
|
||||
) {
|
||||
if (autoupgrade) {
|
||||
await extensions
|
||||
.upgradeStoreExtension(
|
||||
sbExt.identifier,
|
||||
supabaseAPI.translateExtensionFilePathToUrl(sbExt.tarball_path)
|
||||
)
|
||||
.upgradeStoreExtension(sbExt.identifier, sbExt.tarball_path)
|
||||
.then(() => {
|
||||
toast.success(`${sbExt.name} upgraded`, {
|
||||
description: `From ${installedExt.version} to ${sbExt.version}`
|
||||
|
@ -2,14 +2,13 @@
|
||||
import { getExtensionsFolder } from "@/constants"
|
||||
import { appState, extensions } from "@/stores"
|
||||
import { keys } from "@/stores/keys"
|
||||
import { supabaseAPI } from "@/supabase"
|
||||
import { goBackOnEscapeClearSearchTerm, goHomeOnEscapeClearSearchTerm } from "@/utils/key"
|
||||
import { goBack, goHome } from "@/utils/route"
|
||||
import { Action as ActionSchema } from "@kksh/api/models"
|
||||
import { Action as ActionSchema, ExtensionStoreListItem, ExtPublish } from "@kksh/api/models"
|
||||
import { Action } from "@kksh/api/ui"
|
||||
import { SBExt } from "@kksh/supabase/models"
|
||||
import type { ExtPublishMetadata } from "@kksh/supabase/models"
|
||||
import { type Tables } from "@kksh/supabase/types"
|
||||
import {
|
||||
getExtensionsLatestPublishByIdentifier,
|
||||
postExtensionsIncrementDownloads
|
||||
} from "@kksh/sdk"
|
||||
import { Button, Command } from "@kksh/svelte5"
|
||||
import { Constants } from "@kksh/ui"
|
||||
import { ExtListItem } from "@kksh/ui/extension"
|
||||
@ -71,51 +70,57 @@
|
||||
}
|
||||
})
|
||||
|
||||
function onExtItemSelected(ext: SBExt) {
|
||||
function onExtItemSelected(ext: ExtensionStoreListItem) {
|
||||
goto(`./store/${ext.identifier}`)
|
||||
}
|
||||
|
||||
async function onExtItemUpgrade(ext: SBExt) {
|
||||
const res = await supabaseAPI.getLatestExtPublish(ext.identifier)
|
||||
if (res.error)
|
||||
async function onExtItemUpgrade(ext: ExtensionStoreListItem) {
|
||||
const { data, error, response } = await getExtensionsLatestPublishByIdentifier({
|
||||
path: {
|
||||
identifier: ext.identifier
|
||||
}
|
||||
})
|
||||
if (error)
|
||||
return toast.error("Fail to get latest extension", {
|
||||
description: res.error.message
|
||||
description: error.error
|
||||
})
|
||||
const tarballUrl = res.data.tarball_path.startsWith("http")
|
||||
? res.data.tarball_path
|
||||
: supabaseAPI.translateExtensionFilePathToUrl(res.data.tarball_path)
|
||||
const installExtras = await getInstallExtras(
|
||||
res.data as Tables<"ext_publish"> & { metadata: ExtPublishMetadata }
|
||||
)
|
||||
const installExtras = await getInstallExtras(data?.metadata)
|
||||
return extensions
|
||||
.upgradeStoreExtension(ext.identifier, tarballUrl, installExtras)
|
||||
.upgradeStoreExtension(ext.identifier, data.tarball_path, installExtras)
|
||||
.then((newExt) => {
|
||||
toast.success(`${ext.name} Upgraded to ${newExt.version}`)
|
||||
})
|
||||
}
|
||||
|
||||
async function onExtItemInstall(ext: SBExt) {
|
||||
const res = await supabaseAPI.getLatestExtPublish(ext.identifier)
|
||||
if (res.error)
|
||||
async function onExtItemInstall(ext: ExtensionStoreListItem) {
|
||||
const { data, error, response } = await getExtensionsLatestPublishByIdentifier({
|
||||
path: {
|
||||
identifier: ext.identifier
|
||||
}
|
||||
})
|
||||
if (error)
|
||||
return toast.error("Fail to get latest extension", {
|
||||
description: res.error.message
|
||||
description: error.error
|
||||
})
|
||||
|
||||
const tarballUrl = res.data.tarball_path.startsWith("http")
|
||||
? res.data.tarball_path
|
||||
: supabaseAPI.translateExtensionFilePathToUrl(res.data.tarball_path)
|
||||
const installExtras = await getInstallExtras(
|
||||
res.data as Tables<"ext_publish"> & { metadata: ExtPublishMetadata }
|
||||
)
|
||||
const installExtras = await getInstallExtras(data?.metadata)
|
||||
const installDir = await getExtensionsFolder()
|
||||
return extensions
|
||||
.installFromTarballUrl(tarballUrl, installDir, installExtras)
|
||||
.installFromTarballUrl(data.tarball_path, installDir, installExtras)
|
||||
.then(() => toast.success(`Plugin ${ext.name} Installed`))
|
||||
.then(() =>
|
||||
supabaseAPI.incrementDownloads({
|
||||
identifier: ext.identifier,
|
||||
version: ext.version
|
||||
postExtensionsIncrementDownloads({
|
||||
body: {
|
||||
identifier: ext.identifier,
|
||||
version: ext.version
|
||||
}
|
||||
})
|
||||
.then(({ error }) => {
|
||||
if (error) {
|
||||
console.error(error)
|
||||
}
|
||||
})
|
||||
.catch(console.error)
|
||||
)
|
||||
}
|
||||
|
||||
@ -159,7 +164,7 @@
|
||||
})
|
||||
</script>
|
||||
|
||||
<svelte:window on:keydown={onkeydown} />
|
||||
<svelte:window {onkeydown} />
|
||||
{#snippet leftSlot()}
|
||||
<Button
|
||||
variant="outline"
|
||||
|
@ -1,43 +1,39 @@
|
||||
import { appConfig, appState, extensions, installedStoreExts } from "@/stores"
|
||||
import { supabaseAPI } from "@/supabase"
|
||||
import type { ExtPackageJsonExtra } from "@kksh/api/models"
|
||||
import { goHome } from "@/utils/route"
|
||||
// import { supabaseAPI } from "@/supabase"
|
||||
import type { ExtensionStoreListItem, ExtPackageJsonExtra } from "@kksh/api/models"
|
||||
import { isExtPathInDev, isUpgradable } from "@kksh/extension"
|
||||
import { SBExt } from "@kksh/supabase/models"
|
||||
import { sleep } from "@kksh/utils"
|
||||
import { error } from "@sveltejs/kit"
|
||||
import { getExtensionsStoreList } from "@kksh/sdk"
|
||||
import { toast } from "svelte-sonner"
|
||||
import { derived, get, type Readable } from "svelte/store"
|
||||
import type { PageLoad } from "./$types"
|
||||
|
||||
export const load: PageLoad = (): Promise<{
|
||||
storeExtList: SBExt[]
|
||||
storeExtList: ExtensionStoreListItem[]
|
||||
installedStoreExts: Readable<ExtPackageJsonExtra[]>
|
||||
installedExtsMap: Readable<Record<string, string>>
|
||||
upgradableExpsMap: Readable<Record<string, boolean>>
|
||||
}> => {
|
||||
appState.setFullScreenLoading(true)
|
||||
return supabaseAPI
|
||||
.getExtList()
|
||||
.then(async (storeExtList) => {
|
||||
// map identifier to extItem
|
||||
return getExtensionsStoreList()
|
||||
.then(({ data: storeExtList, error, response }) => {
|
||||
storeExtList = storeExtList ?? []
|
||||
if (error) {
|
||||
toast.error(`Failed to load extension store: ${error} (${response.status})`)
|
||||
goHome()
|
||||
}
|
||||
const storeExtsMap = Object.fromEntries(storeExtList.map((ext) => [ext.identifier, ext]))
|
||||
// const _appConfig = get(appConfig)
|
||||
// const installedStoreExts = derived(extensions, ($extensions) => {
|
||||
// if (!_appConfig.extensionPath) return []
|
||||
// return $extensions.filter((ext) => !isExtPathInDev(_appConfig.extensionPath!, ext.extPath))
|
||||
// })
|
||||
// map installed extension identifier to version
|
||||
const installedExtsMap = derived(installedStoreExts, ($exts) =>
|
||||
Object.fromEntries($exts.map((ext) => [ext.kunkun.identifier, ext.version]))
|
||||
)
|
||||
const upgradableExpsMap = derived(installedStoreExts, ($exts) =>
|
||||
Object.fromEntries(
|
||||
$exts.map((ext) => {
|
||||
const dbExt: SBExt | undefined = storeExtsMap[ext.kunkun.identifier]
|
||||
const dbExt: ExtensionStoreListItem | undefined = storeExtsMap[ext.kunkun.identifier]
|
||||
return [ext.kunkun.identifier, dbExt ? isUpgradable(dbExt, ext.version) : false]
|
||||
})
|
||||
)
|
||||
)
|
||||
|
||||
return {
|
||||
storeExtList,
|
||||
installedStoreExts,
|
||||
|
@ -2,11 +2,8 @@
|
||||
import { getExtensionsFolder } from "@/constants.js"
|
||||
import { i18n } from "@/i18n.js"
|
||||
import { extensions, installedStoreExts } from "@/stores/extensions.js"
|
||||
import { supabaseAPI } from "@/supabase"
|
||||
import { goBack } from "@/utils/route.js"
|
||||
import { ExtPackageJson } from "@kksh/api/models"
|
||||
import { ExtPublishMetadata } from "@kksh/supabase/models"
|
||||
import type { Tables } from "@kksh/supabase/types"
|
||||
import { DBExtension, ExtensionStoreListItem, ExtPackageJson, ExtPublish } from "@kksh/api/models"
|
||||
import { postExtensionsIncrementDownloads } from "@kksh/sdk"
|
||||
import { Button } from "@kksh/svelte5"
|
||||
import { cn } from "@kksh/svelte5/utils"
|
||||
import { Constants } from "@kksh/ui"
|
||||
@ -22,10 +19,8 @@
|
||||
import { getInstallExtras } from "./helper"
|
||||
|
||||
const { data } = $props()
|
||||
const extPublish: Tables<"ext_publish"> & { metadata: ExtPublishMetadata } = $derived(
|
||||
data.extPublish
|
||||
)
|
||||
const ext: Tables<"extensions"> = $derived(data.ext)
|
||||
const extPublish = $derived(data.extPublish)
|
||||
const ext = $derived(data.ext)
|
||||
const manifest = $derived(data.manifest)
|
||||
const installedExt = storeDerived(installedStoreExts, ($e) => {
|
||||
return $e.find((e) => e.kunkun.identifier === extPublish.identifier)
|
||||
@ -77,28 +72,29 @@
|
||||
}, 500)
|
||||
})
|
||||
|
||||
const demoImages = $derived(
|
||||
extPublish.demo_images.map((src) =>
|
||||
src.startsWith("http") ? src : supabaseAPI.translateExtensionFilePathToUrl(src)
|
||||
)
|
||||
)
|
||||
const demoImages = $derived(extPublish.demo_images)
|
||||
|
||||
async function onInstallSelected() {
|
||||
loading.install = true
|
||||
const tarballUrl = extPublish.tarball_path.startsWith("http")
|
||||
? extPublish.tarball_path
|
||||
: supabaseAPI.translateExtensionFilePathToUrl(extPublish.tarball_path)
|
||||
const installExtras = await getInstallExtras(extPublish)
|
||||
const installExtras = await getInstallExtras(extPublish.metadata)
|
||||
const installDir = await getExtensionsFolder()
|
||||
return extensions
|
||||
.installFromTarballUrl(tarballUrl, installDir, installExtras)
|
||||
.installFromTarballUrl(extPublish.tarball_path, installDir, installExtras)
|
||||
.then(() => toast.success(`Plugin ${extPublish.name} Installed`))
|
||||
.then((loadedExt) => {
|
||||
info(`Successfully installed ${extPublish.name}`)
|
||||
supabaseAPI.incrementDownloads({
|
||||
identifier: extPublish.identifier,
|
||||
version: extPublish.version
|
||||
postExtensionsIncrementDownloads({
|
||||
body: {
|
||||
identifier: extPublish.identifier,
|
||||
version: extPublish.version
|
||||
}
|
||||
})
|
||||
.then(({ error }) => {
|
||||
if (error) {
|
||||
console.error(error)
|
||||
}
|
||||
})
|
||||
.catch(console.error)
|
||||
showBtn.install = false
|
||||
showBtn.uninstall = true
|
||||
})
|
||||
@ -113,9 +109,8 @@
|
||||
|
||||
function onUpgradeSelected() {
|
||||
loading.upgrade = true
|
||||
const tarballUrl = supabaseAPI.translateExtensionFilePathToUrl(extPublish.tarball_path)
|
||||
return extensions
|
||||
.upgradeStoreExtension(extPublish.identifier, tarballUrl)
|
||||
.upgradeStoreExtension(extPublish.identifier, extPublish.tarball_path)
|
||||
.then((newExt) => {
|
||||
toast.success(
|
||||
`${extPublish.name} Upgraded from ${$installedExt?.version} to ${newExt.version}`
|
||||
|
@ -1,54 +1,52 @@
|
||||
import { appState, extensions } from "@/stores"
|
||||
import { supabaseAPI } from "@/supabase"
|
||||
import { KunkunExtManifest, type ExtPackageJsonExtra } from "@kksh/api/models"
|
||||
import { ExtPublishMetadata } from "@kksh/supabase/models"
|
||||
import type { Tables } from "@kksh/supabase/types"
|
||||
import { sleep } from "@kksh/utils"
|
||||
import { appState } from "@/stores"
|
||||
import { DBExtension, ExtPublish, KunkunExtManifest } from "@kksh/api/models"
|
||||
import { getExtensionsByIdentifier, getExtensionsLatestPublishByIdentifier } from "@kksh/sdk"
|
||||
import { error } from "@sveltejs/kit"
|
||||
import { toast } from "svelte-sonner"
|
||||
import * as v from "valibot"
|
||||
import type { PageLoad } from "./$types"
|
||||
|
||||
export const load: PageLoad = ({
|
||||
params
|
||||
}): Promise<{
|
||||
extPublish: Tables<"ext_publish"> & { metadata: ExtPublishMetadata }
|
||||
ext: Tables<"extensions">
|
||||
extPublish: ExtPublish
|
||||
ext: DBExtension
|
||||
manifest: KunkunExtManifest
|
||||
params: {
|
||||
identifier: string
|
||||
}
|
||||
}> => {
|
||||
appState.setFullScreenLoading(true)
|
||||
return supabaseAPI
|
||||
.getLatestExtPublish(params.identifier)
|
||||
.then(async ({ error: dbError, data: extPublish }) => {
|
||||
const metadataParse = v.safeParse(ExtPublishMetadata, extPublish?.metadata ?? {})
|
||||
if (dbError) {
|
||||
return error(400, {
|
||||
message: dbError.message
|
||||
return getExtensionsLatestPublishByIdentifier({
|
||||
path: {
|
||||
identifier: params.identifier
|
||||
}
|
||||
})
|
||||
.then(async ({ data: extPublish, error: err, response }) => {
|
||||
if (err || !extPublish) {
|
||||
return error(response.status, {
|
||||
message: "Failed to get extension publish"
|
||||
})
|
||||
}
|
||||
const metadata = metadataParse.success ? metadataParse.output : {}
|
||||
const parseManifest = v.safeParse(KunkunExtManifest, extPublish.manifest)
|
||||
if (!parseManifest.success) {
|
||||
const errMsg = "Invalid extension manifest, you may need to upgrade your app."
|
||||
toast.error(errMsg)
|
||||
throw error(400, errMsg)
|
||||
}
|
||||
|
||||
const { data: ext, error: extError } = await supabaseAPI.getExtension(params.identifier)
|
||||
if (extError) {
|
||||
return error(400, {
|
||||
message: extError.message
|
||||
const {
|
||||
data: ext,
|
||||
error: extError,
|
||||
response: extRes
|
||||
} = await getExtensionsByIdentifier({
|
||||
path: {
|
||||
identifier: params.identifier
|
||||
}
|
||||
})
|
||||
if (extError || !ext) {
|
||||
console.error(extError)
|
||||
return error(extRes.status, {
|
||||
message: extError.error || "Failed to get extension"
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
extPublish: { ...extPublish, metadata },
|
||||
extPublish: v.parse(ExtPublish, extPublish),
|
||||
ext,
|
||||
params,
|
||||
manifest: parseManifest.output
|
||||
manifest: v.parse(KunkunExtManifest, extPublish.manifest),
|
||||
params
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
|
@ -1,15 +1,15 @@
|
||||
import type { ExtPublishMetadata } from "@kksh/supabase/models"
|
||||
import type { Tables } from "@kksh/supabase/types"
|
||||
import type { ExtPublishMetadata } from "@kunkunapi/src/models"
|
||||
|
||||
export async function getInstallExtras(
|
||||
ext: Tables<"ext_publish"> & { metadata?: ExtPublishMetadata }
|
||||
): Promise<{ overwritePackageJson?: string }> {
|
||||
export async function getInstallExtras(extMetadata?: {
|
||||
sourceType?: string
|
||||
source?: string
|
||||
}): Promise<{ overwritePackageJson?: string }> {
|
||||
const extras: { overwritePackageJson?: string } = {}
|
||||
if (ext.metadata?.sourceType) {
|
||||
if (ext.metadata?.sourceType === "jsr") {
|
||||
if (ext.metadata?.source) {
|
||||
if (extMetadata?.sourceType) {
|
||||
if (extMetadata?.sourceType === "jsr") {
|
||||
if (extMetadata?.source) {
|
||||
try {
|
||||
const res = await fetch(`${ext.metadata.source}/package.json`)
|
||||
const res = await fetch(`${extMetadata.source}/package.json`)
|
||||
const pkgJsonContent = await res.text()
|
||||
extras.overwritePackageJson = pkgJsonContent
|
||||
} catch (error) {
|
||||
|
@ -9,7 +9,8 @@
|
||||
"skipLibCheck": true,
|
||||
"sourceMap": true,
|
||||
"strict": true,
|
||||
"moduleResolution": "bundler"
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true
|
||||
},
|
||||
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
|
||||
// except $lib which is handled by https://kit.svelte.dev/docs/configuration#files
|
||||
|
@ -28,7 +28,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@changesets/cli": "^2.28.1",
|
||||
"@hey-api/client-fetch": "^0.8.3",
|
||||
"@iconify/svelte": "^4.2.0",
|
||||
"@kksh/sdk": "^0.0.3",
|
||||
"@supabase/supabase-js": "^2.49.1",
|
||||
"@tauri-apps/api": "^2.3.0",
|
||||
"@tauri-apps/cli": "^2.3.1",
|
||||
@ -48,7 +50,7 @@
|
||||
"tauri-plugin-keyring-api": "workspace:*",
|
||||
"tauri-plugin-network-api": "workspace:*",
|
||||
"tauri-plugin-system-info-api": "workspace:*",
|
||||
"valibot": "^1.0.0-rc.4",
|
||||
"valibot": "^1.0.0",
|
||||
"zod": "^3.24.2"
|
||||
},
|
||||
"workspaces": [
|
||||
|
@ -75,7 +75,7 @@
|
||||
"tauri-plugin-network-api": "2.0.5",
|
||||
"tauri-plugin-shellx-api": "^2.0.16",
|
||||
"tauri-plugin-system-info-api": "2.0.8",
|
||||
"valibot": "^1.0.0-rc.4"
|
||||
"valibot": "^1.0.0"
|
||||
},
|
||||
"files": [
|
||||
"src",
|
||||
|
@ -1,91 +1,78 @@
|
||||
import {
|
||||
any,
|
||||
array,
|
||||
boolean,
|
||||
date,
|
||||
enum_,
|
||||
function_,
|
||||
nullable,
|
||||
number,
|
||||
object,
|
||||
optional,
|
||||
record,
|
||||
string,
|
||||
type InferOutput
|
||||
} from "valibot"
|
||||
import * as v from "valibot"
|
||||
import { Icon } from "./icon"
|
||||
|
||||
/**
|
||||
* Map window label to extension
|
||||
*/
|
||||
export const ExtensionLabelMap = record(
|
||||
string("Window label"),
|
||||
object({
|
||||
path: string("Path to the extension"),
|
||||
processes: array(number()),
|
||||
dist: optional(nullable(string()))
|
||||
export const ExtensionLabelMap = v.record(
|
||||
v.string("Window label"),
|
||||
v.object({
|
||||
path: v.string("Path to the extension"),
|
||||
processes: v.array(v.number()),
|
||||
dist: v.optional(v.nullable(v.string()))
|
||||
})
|
||||
)
|
||||
export type ExtensionLabelMap = InferOutput<typeof ExtensionLabelMap>
|
||||
export type ExtensionLabelMap = v.InferOutput<typeof ExtensionLabelMap>
|
||||
|
||||
export const Ext = object({
|
||||
extId: number(),
|
||||
identifier: string(),
|
||||
version: string(),
|
||||
enabled: boolean(),
|
||||
installed_at: string(),
|
||||
path: nullable(string()),
|
||||
data: nullable(any())
|
||||
export const Ext = v.object({
|
||||
extId: v.number(),
|
||||
identifier: v.string(),
|
||||
version: v.string(),
|
||||
enabled: v.boolean(),
|
||||
installed_at: v.string(),
|
||||
path: v.optional(v.nullable(v.string())),
|
||||
data: v.optional(v.any())
|
||||
})
|
||||
export type Ext = InferOutput<typeof Ext>
|
||||
export type Ext = v.InferOutput<typeof Ext>
|
||||
|
||||
export enum CmdTypeEnum {
|
||||
HeadlessWorker = "headless_worker",
|
||||
Builtin = "builtin",
|
||||
System = "system",
|
||||
UiWorker = "ui_worker",
|
||||
UiIframe = "ui_iframe",
|
||||
QuickLink = "quick_link",
|
||||
Remote = "remote"
|
||||
export const CmdTypeEnum = {
|
||||
HeadlessWorker: "headless_worker",
|
||||
Builtin: "builtin",
|
||||
System: "system",
|
||||
UiWorker: "ui_worker",
|
||||
UiIframe: "ui_iframe",
|
||||
QuickLink: "quick_link",
|
||||
Remote: "remote"
|
||||
}
|
||||
|
||||
export const CmdType = enum_(CmdTypeEnum)
|
||||
export type CmdType = InferOutput<typeof CmdType>
|
||||
export const ExtCmd = object({
|
||||
cmdId: number(),
|
||||
extId: number(),
|
||||
name: string(),
|
||||
export const CmdType = v.picklist(Object.values(CmdTypeEnum))
|
||||
|
||||
export type CmdType = v.InferOutput<typeof CmdType>
|
||||
export const ExtCmd = v.object({
|
||||
cmdId: v.number(),
|
||||
extId: v.number(),
|
||||
name: v.string(),
|
||||
type: CmdType,
|
||||
data: string(),
|
||||
alias: nullable(optional(string())),
|
||||
hotkey: nullable(optional(string())),
|
||||
enabled: boolean()
|
||||
data: v.string(),
|
||||
alias: v.optional(v.nullable(v.string())),
|
||||
hotkey: v.optional(v.nullable(v.string())),
|
||||
enabled: v.boolean()
|
||||
})
|
||||
export type ExtCmd = InferOutput<typeof ExtCmd>
|
||||
export type ExtCmd = v.InferOutput<typeof ExtCmd>
|
||||
|
||||
export const QuickLinkCmd = object({
|
||||
export const QuickLinkCmd = v.object({
|
||||
...ExtCmd.entries,
|
||||
data: object({ link: string(), icon: Icon })
|
||||
data: v.object({ link: v.string(), icon: Icon })
|
||||
})
|
||||
export type QuickLinkCmd = InferOutput<typeof QuickLinkCmd>
|
||||
export type QuickLinkCmd = v.InferOutput<typeof QuickLinkCmd>
|
||||
|
||||
export const ExtData = object({
|
||||
dataId: number(),
|
||||
extId: number(),
|
||||
dataType: string(),
|
||||
data: optional(string()),
|
||||
searchText: optional(string()),
|
||||
createdAt: date(),
|
||||
updatedAt: date()
|
||||
export const ExtData = v.object({
|
||||
dataId: v.number(),
|
||||
extId: v.number(),
|
||||
dataType: v.string(),
|
||||
data: v.optional(v.string()),
|
||||
searchText: v.optional(v.string()),
|
||||
createdAt: v.date(),
|
||||
updatedAt: v.date()
|
||||
})
|
||||
export type ExtData = InferOutput<typeof ExtData>
|
||||
export type ExtData = v.InferOutput<typeof ExtData>
|
||||
|
||||
export const SysCommand = object({
|
||||
name: string(),
|
||||
value: string(),
|
||||
icon: nullable(Icon),
|
||||
keywords: nullable(array(string())),
|
||||
function: function_(),
|
||||
confirmRequired: boolean()
|
||||
export const SysCommand = v.object({
|
||||
name: v.string(),
|
||||
value: v.string(),
|
||||
icon: v.optional(v.nullable(Icon)),
|
||||
keywords: v.optional(v.nullable(v.array(v.string()))),
|
||||
function: v.function_(),
|
||||
confirmRequired: v.boolean()
|
||||
})
|
||||
export type SysCommand = InferOutput<typeof SysCommand>
|
||||
export type SysCommand = v.InferOutput<typeof SysCommand>
|
||||
|
@ -4,14 +4,21 @@ import { NodeName, NodeNameEnum } from "./constants"
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* Icon */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
export enum IconEnum {
|
||||
Iconify = "iconify",
|
||||
RemoteUrl = "remote-url",
|
||||
Svg = "svg",
|
||||
Base64PNG = "base64-png",
|
||||
Text = "text"
|
||||
// export enum IconEnum {
|
||||
// Iconify = "iconify",
|
||||
// RemoteUrl = "remote-url",
|
||||
// Svg = "svg",
|
||||
// Base64PNG = "base64-png",
|
||||
// Text = "text"
|
||||
// }
|
||||
export const IconEnum = {
|
||||
Iconify: "iconify",
|
||||
RemoteUrl: "remote-url",
|
||||
Svg: "svg",
|
||||
Base64PNG: "base64-png",
|
||||
Text: "text"
|
||||
}
|
||||
export const IconType = v.enum_(IconEnum)
|
||||
export const IconType = v.picklist(Object.values(IconEnum))
|
||||
export type IconType = v.InferOutput<typeof IconType>
|
||||
|
||||
export type Icon = {
|
||||
|
@ -13,3 +13,4 @@ export { Markdown as MarkdownSchema } from "../ui/template/schema/markdown"
|
||||
export * as ListSchema from "../ui/template/schema/list"
|
||||
export * as FormSchema from "../ui/template/schema/form"
|
||||
export * from "./file-transfer"
|
||||
export * from "./server"
|
||||
|
@ -1,4 +1,3 @@
|
||||
import { FsPermissionSchema } from "tauri-api-adapter/permissions"
|
||||
import * as v from "valibot"
|
||||
import {
|
||||
AllKunkunPermission,
|
||||
@ -8,29 +7,29 @@ import {
|
||||
OpenPermissionScopedSchema,
|
||||
ShellPermissionScopedSchema
|
||||
} from "../permissions"
|
||||
import { CmdType } from "./extension"
|
||||
import { CmdType, CmdTypeEnum } from "./extension"
|
||||
import { BaseIcon as Icon } from "./icon"
|
||||
|
||||
export enum OSPlatformEnum {
|
||||
linux = "linux",
|
||||
macos = "macos",
|
||||
windows = "windows"
|
||||
export const OSPlatformEnum = {
|
||||
linux: "linux",
|
||||
macos: "macos",
|
||||
windows: "windows"
|
||||
}
|
||||
|
||||
export const OSPlatform = v.enum_(OSPlatformEnum)
|
||||
export const OSPlatform = v.picklist(Object.values(OSPlatformEnum))
|
||||
export type OSPlatform = v.InferOutput<typeof OSPlatform>
|
||||
const allPlatforms = Object.values(OSPlatformEnum)
|
||||
export const TriggerCmd = v.object({
|
||||
type: v.union([v.literal("text"), v.literal("regex")]),
|
||||
value: v.string()
|
||||
})
|
||||
export type TriggerCmd = v.InferOutput<typeof TriggerCmd>
|
||||
export enum TitleBarStyleEnum {
|
||||
"visible" = "visible",
|
||||
"transparent" = "transparent",
|
||||
"overlay" = "overlay"
|
||||
export const TitleBarStyleEnum = {
|
||||
visible: "visible",
|
||||
transparent: "transparent",
|
||||
overlay: "overlay"
|
||||
}
|
||||
export const TitleBarStyle = v.enum_(TitleBarStyleEnum)
|
||||
export type TitleBarStyle = v.InferOutput<typeof TitleBarStyle>
|
||||
export const TitleBarStyle = v.picklist(Object.values(TitleBarStyleEnum))
|
||||
// JS new WebViewWindow only accepts lowercase, while manifest loaded from Rust is capitalized. I run toLowerCase() on the value before passing it to the WebViewWindow.
|
||||
// This lowercase title bar style schema is used to validate and set the type so TypeScript won't complaint
|
||||
// export const TitleBarStyleAllLower = z.enum(["visible", "transparent", "overlay"]);
|
||||
@ -71,37 +70,33 @@ export const WindowConfig = v.object({
|
||||
export type WindowConfig = v.InferOutput<typeof WindowConfig>
|
||||
export const BaseCmd = v.object({
|
||||
main: v.string("HTML file to load, e.g. dist/index.html"),
|
||||
description: v.optional(v.nullable(v.string("Description of the Command"), ""), ""),
|
||||
description: v.optional(v.nullable(v.string("Description of the Command"), "")),
|
||||
name: v.string("Name of the command"),
|
||||
cmds: v.array(TriggerCmd, "Commands to trigger the UI"),
|
||||
icon: v.optional(Icon),
|
||||
platforms: v.optional(
|
||||
v.nullable(
|
||||
v.array(OSPlatform, "Platforms available on. Leave empty for all platforms."),
|
||||
allPlatforms
|
||||
),
|
||||
allPlatforms
|
||||
v.array(OSPlatform, "Platforms available on. Leave empty for all platforms.")
|
||||
)
|
||||
})
|
||||
export const CustomUiCmd = v.object({
|
||||
...BaseCmd.entries,
|
||||
type: v.optional(CmdType, CmdType.enum.UiIframe),
|
||||
dist: v.string("Dist folder to load, e.g. dist, build, out"),
|
||||
devMain: v.string(
|
||||
"URL to load in development to support live reload, e.g. http://localhost:5173/"
|
||||
),
|
||||
window: v.optional(v.nullable(WindowConfig))
|
||||
window: v.optional(v.nullable(WindowConfig)),
|
||||
type: v.optional(CmdType, CmdTypeEnum.UiIframe)
|
||||
})
|
||||
export type CustomUiCmd = v.InferOutput<typeof CustomUiCmd>
|
||||
|
||||
export const TemplateUiCmd = v.object({
|
||||
...BaseCmd.entries,
|
||||
type: v.optional(CmdType, CmdType.enum.UiWorker),
|
||||
type: v.optional(CmdType, CmdTypeEnum.UiWorker),
|
||||
window: v.optional(v.nullable(WindowConfig))
|
||||
})
|
||||
export const HeadlessCmd = v.object({
|
||||
...BaseCmd.entries,
|
||||
type: v.optional(CmdType, CmdType.enum.HeadlessWorker)
|
||||
type: v.optional(CmdType, CmdTypeEnum.HeadlessWorker)
|
||||
})
|
||||
export type HeadlessCmd = v.InferOutput<typeof HeadlessCmd>
|
||||
export type TemplateUiCmd = v.InferOutput<typeof TemplateUiCmd>
|
||||
|
91
packages/api/src/models/server.ts
Normal file
91
packages/api/src/models/server.ts
Normal file
@ -0,0 +1,91 @@
|
||||
import * as v from "valibot"
|
||||
import { BaseIcon } from "./icon"
|
||||
import { ExtPackageJson, KunkunExtManifest } from "./manifest"
|
||||
|
||||
export const ExtPublishSourceTypeEnum = {
|
||||
jsr: "jsr",
|
||||
npm: "npm"
|
||||
}
|
||||
|
||||
export const ExtPublishMetadata = v.object({
|
||||
source: v.optional(v.string("Source of the extension (e.g. url to package)")),
|
||||
sourceType: v.optional(v.picklist(Object.values(ExtPublishSourceTypeEnum))),
|
||||
rekorLogIndex: v.optional(v.string("Rekor log index of the extension")),
|
||||
git: v.optional(
|
||||
v.object({
|
||||
githubActionInvocationId: v.string("GitHub action invocation ID"),
|
||||
repo: v.string("GitHub repo of the extension"),
|
||||
owner: v.string("GitHub owner of the extension"),
|
||||
commit: v.string("Commit hash of the extension"),
|
||||
workflowPath: v.string("Workflow path of the extension"),
|
||||
repoNodeId: v.optional(
|
||||
v.string("GitHub repo node ID of the extension (a string, not the number id)")
|
||||
)
|
||||
})
|
||||
)
|
||||
})
|
||||
export type ExtPublishMetadata = v.InferOutput<typeof ExtPublishMetadata>
|
||||
|
||||
/***
|
||||
* Correspond to `extensions` table in supabase, missing a few fields
|
||||
*/
|
||||
export const ExtensionStoreListItem = v.object({
|
||||
identifier: v.string(),
|
||||
name: v.string(),
|
||||
created_at: v.string(),
|
||||
downloads: v.number(),
|
||||
author_id: v.string(),
|
||||
short_description: v.string(),
|
||||
long_description: v.string(),
|
||||
version: v.string(),
|
||||
api_version: v.optional(v.string()),
|
||||
icon: BaseIcon
|
||||
})
|
||||
|
||||
export type ExtensionStoreListItem = v.InferOutput<typeof ExtensionStoreListItem>
|
||||
|
||||
export const PublishStateEnum = {
|
||||
public: "public",
|
||||
pending: "pending",
|
||||
under_review: "under_review",
|
||||
private: "private"
|
||||
}
|
||||
export const ExtensionPublishState = v.picklist(Object.values(PublishStateEnum))
|
||||
|
||||
export const ExtPublish = v.object({
|
||||
id: v.number(),
|
||||
name: v.string(),
|
||||
tarball_path: v.string(),
|
||||
created_at: v.string(),
|
||||
version: v.string(),
|
||||
manifest: KunkunExtManifest,
|
||||
shasum: v.string(),
|
||||
tarball_size: v.number(),
|
||||
unpacked_size: v.nullable(v.number()),
|
||||
cmd_count: v.number(),
|
||||
identifier: v.string(),
|
||||
downloads: v.number(),
|
||||
demo_images: v.array(v.string()),
|
||||
api_version: v.nullable(v.string()),
|
||||
extension_state: ExtensionPublishState,
|
||||
package_json: ExtPackageJson,
|
||||
metadata: ExtPublishMetadata,
|
||||
readme: v.nullable(v.string())
|
||||
})
|
||||
export type ExtPublish = v.InferOutput<typeof ExtPublish>
|
||||
|
||||
export const DBExtension = v.object({
|
||||
api_version: v.string(),
|
||||
author_id: v.string(),
|
||||
created_at: v.string(),
|
||||
downloads: v.number(),
|
||||
icon: BaseIcon,
|
||||
identifier: v.string(),
|
||||
long_description: v.nullable(v.string()),
|
||||
name: v.string(),
|
||||
readme: v.nullable(v.string()),
|
||||
short_description: v.string(),
|
||||
tarball_size: v.nullable(v.number()),
|
||||
version: v.string()
|
||||
})
|
||||
export type DBExtension = v.InferOutput<typeof DBExtension>
|
@ -11,15 +11,15 @@
|
||||
"./install": "./src/install.ts"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bun": "latest"
|
||||
"@types/bun": "latest",
|
||||
"@types/semver": "^7.5.8"
|
||||
},
|
||||
"dependencies": {
|
||||
"@kksh/api": "workspace:*",
|
||||
"@kksh/supabase": "workspace:*",
|
||||
"@std/semver": "npm:@jsr/std__semver@^1.0.3",
|
||||
"@std/semver": "npm:@jsr/std__semver@^1.0.4",
|
||||
"@tauri-apps/plugin-upload": "^2.2.1",
|
||||
"semver": "^7.7.1",
|
||||
"uuid": "^11.0.3"
|
||||
"uuid": "^11.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "^5.0.0"
|
||||
|
@ -4,8 +4,7 @@
|
||||
*/
|
||||
import { isCompatible } from "@kksh/api"
|
||||
import { copy_dir_all, db, decompressTarball } from "@kksh/api/commands"
|
||||
import type { ExtPackageJsonExtra } from "@kksh/api/models"
|
||||
import { SBExt } from "@kksh/supabase/models"
|
||||
import type { ExtensionStoreListItem, ExtPackageJsonExtra } from "@kksh/api/models"
|
||||
import { greaterThan, parse as parseSemver } from "@std/semver"
|
||||
import * as path from "@tauri-apps/api/path"
|
||||
import * as dialog from "@tauri-apps/plugin-dialog"
|
||||
@ -193,7 +192,7 @@ export async function uninstallExtensionByPath(extPath: string) {
|
||||
return fs.remove(extPath, { recursive: true }).then(() => db.deleteExtensionByPath(extPath))
|
||||
}
|
||||
|
||||
export function isUpgradable(dbExt: SBExt, installedExtVersion: string) {
|
||||
export function isUpgradable(dbExt: ExtensionStoreListItem, installedExtVersion: string) {
|
||||
const upgradable =
|
||||
greaterThan(parseSemver(dbExt.version), parseSemver(installedExtVersion)) && dbExt.api_version
|
||||
? isCompatible(dbExt.api_version)
|
||||
|
@ -1,4 +1,5 @@
|
||||
import type { WindowConfig } from "@kksh/api/models"
|
||||
import type { TitleBarStyle, WindowConfig } from "@kksh/api/models"
|
||||
import { TitleBarStyleEnum } from "@kksh/api/models"
|
||||
import { WebviewWindow } from "@tauri-apps/api/webviewWindow"
|
||||
|
||||
export function launchNewExtWindow(windowLabel: string, url: string, windowConfig?: WindowConfig) {
|
||||
@ -26,7 +27,8 @@ export function launchNewExtWindow(windowLabel: string, url: string, windowConfi
|
||||
skipTaskbar: windowConfig?.skipTaskbar ?? undefined,
|
||||
shadow: windowConfig?.shadow ?? undefined,
|
||||
// theme: windowConfig?.theme ?? undefined,
|
||||
titleBarStyle: windowConfig?.titleBarStyle ?? undefined,
|
||||
titleBarStyle:
|
||||
(windowConfig?.titleBarStyle as keyof typeof TitleBarStyleEnum | undefined) ?? undefined,
|
||||
hiddenTitle: windowConfig?.hiddenTitle ?? undefined,
|
||||
tabbingIdentifier: windowConfig?.tabbingIdentifier ?? undefined,
|
||||
maximizable: windowConfig?.maximizable ?? undefined,
|
||||
|
@ -15,17 +15,15 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bun": "latest",
|
||||
"@kksh/supabase": "workspace:*",
|
||||
"@supabase/supabase-js": "^2.48.0",
|
||||
"@valibot/to-json-schema": "1.0.0-beta.4"
|
||||
"@valibot/to-json-schema": "1.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@kksh/supabase": "workspace:*",
|
||||
"typescript": "^5.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.583.0",
|
||||
"@kksh/api": "workspace:*",
|
||||
"valibot": "^1.0.0-rc.4"
|
||||
"valibot": "^1.0.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,10 @@
|
||||
import { ExtPackageJson } from "@kksh/api/models"
|
||||
import { type Database } from "@kksh/supabase/types"
|
||||
import { createClient } from "@supabase/supabase-js"
|
||||
import { parse, string } from "valibot"
|
||||
import * as v from "valibot"
|
||||
import { getJsonSchema } from "../src"
|
||||
|
||||
const supabase = createClient<Database>(
|
||||
const supabase = createClient(
|
||||
parse(string(), process.env.SUPABASE_URL),
|
||||
parse(string(), process.env.SUPABASE_SERVICE_ROLE_KEY)
|
||||
)
|
||||
|
175
packages/supabase/.gitignore
vendored
175
packages/supabase/.gitignore
vendored
@ -1,175 +0,0 @@
|
||||
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
|
||||
|
||||
# Logs
|
||||
|
||||
logs
|
||||
_.log
|
||||
npm-debug.log_
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
.pnpm-debug.log*
|
||||
|
||||
# Caches
|
||||
|
||||
.cache
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
|
||||
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
|
||||
|
||||
# Runtime data
|
||||
|
||||
pids
|
||||
_.pid
|
||||
_.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
|
||||
coverage
|
||||
*.lcov
|
||||
|
||||
# nyc test coverage
|
||||
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# Snowpack dependency directory (https://snowpack.dev/)
|
||||
|
||||
web_modules/
|
||||
|
||||
# TypeScript cache
|
||||
|
||||
*.tsbuildinfo
|
||||
|
||||
# Optional npm cache directory
|
||||
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
|
||||
.eslintcache
|
||||
|
||||
# Optional stylelint cache
|
||||
|
||||
.stylelintcache
|
||||
|
||||
# Microbundle cache
|
||||
|
||||
.rpt2_cache/
|
||||
.rts2_cache_cjs/
|
||||
.rts2_cache_es/
|
||||
.rts2_cache_umd/
|
||||
|
||||
# Optional REPL history
|
||||
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variable files
|
||||
|
||||
.env
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
.env.local
|
||||
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
|
||||
.parcel-cache
|
||||
|
||||
# Next.js build output
|
||||
|
||||
.next
|
||||
out
|
||||
|
||||
# Nuxt.js build / generate output
|
||||
|
||||
.nuxt
|
||||
dist
|
||||
|
||||
# Gatsby files
|
||||
|
||||
# Comment in the public line in if your project uses Gatsby and not Next.js
|
||||
|
||||
# https://nextjs.org/blog/next-9-1#public-directory-support
|
||||
|
||||
# public
|
||||
|
||||
# vuepress build output
|
||||
|
||||
.vuepress/dist
|
||||
|
||||
# vuepress v2.x temp and cache directory
|
||||
|
||||
.temp
|
||||
|
||||
# Docusaurus cache and generated files
|
||||
|
||||
.docusaurus
|
||||
|
||||
# Serverless directories
|
||||
|
||||
.serverless/
|
||||
|
||||
# FuseBox cache
|
||||
|
||||
.fusebox/
|
||||
|
||||
# DynamoDB Local files
|
||||
|
||||
.dynamodb/
|
||||
|
||||
# TernJS port file
|
||||
|
||||
.tern-port
|
||||
|
||||
# Stores VSCode versions used for testing VSCode extensions
|
||||
|
||||
.vscode-test
|
||||
|
||||
# yarn v2
|
||||
|
||||
.yarn/cache
|
||||
.yarn/unplugged
|
||||
.yarn/build-state.yml
|
||||
.yarn/install-state.gz
|
||||
.pnp.*
|
||||
|
||||
# IntelliJ based IDEs
|
||||
.idea
|
||||
|
||||
# Finder (MacOS) folder config
|
||||
.DS_Store
|
@ -1,4 +0,0 @@
|
||||
```bash
|
||||
export PROJECT_REF=qzehioyfmxlgkeuujwlh
|
||||
npx supabase gen types --lang=typescript --project-id $PROJECT_REF --schema public > ./src/database.types.ts
|
||||
```
|
@ -1,24 +0,0 @@
|
||||
{
|
||||
"name": "@kksh/supabase",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"prepare": "bun setup.ts"
|
||||
},
|
||||
"exports": {
|
||||
".": "./src/index.ts",
|
||||
"./api": "./src/api.ts",
|
||||
"./models": "./src/models.ts",
|
||||
"./types": "./src/database.types.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@kksh/api": "workspace:*",
|
||||
"@supabase/ssr": "^0.5.2",
|
||||
"@supabase/supabase-js": "^2.48.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bun": "latest"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "^5.0.0"
|
||||
}
|
||||
}
|
@ -1,107 +0,0 @@
|
||||
import type { PostgrestSingleResponse, SupabaseClient } from "@supabase/supabase-js"
|
||||
import * as v from "valibot"
|
||||
import type { Database, Tables } from "./database.types"
|
||||
import { SBExt } from "./models"
|
||||
|
||||
export class SupabaseAPI {
|
||||
constructor(private supabase: SupabaseClient<Database>) {}
|
||||
async getExtList(): Promise<SBExt[]> {
|
||||
const res = await this.supabase
|
||||
.from("extensions")
|
||||
.select(
|
||||
"identifier, version, api_version, name, downloads, short_description, long_description, icon, created_at"
|
||||
)
|
||||
.order("downloads", { ascending: false })
|
||||
.select()
|
||||
const dbExts: Tables<"extensions">[] = res.data ?? []
|
||||
return dbExts
|
||||
.map((x) => {
|
||||
const parsedNode = v.safeParse(SBExt, x)
|
||||
if (!parsedNode.success) {
|
||||
console.error(`Fail to parse extension`, x)
|
||||
console.warn(parsedNode.issues)
|
||||
console.error(v.flatten(parsedNode.issues))
|
||||
}
|
||||
return parsedNode.success ? v.parse(SBExt, parsedNode.output) : null
|
||||
})
|
||||
.filter((x) => x !== null)
|
||||
}
|
||||
|
||||
async getLatestExtPublish(
|
||||
identifier: string
|
||||
): Promise<PostgrestSingleResponse<Tables<"ext_publish">>> {
|
||||
return this.supabase
|
||||
.from("ext_publish")
|
||||
.select(
|
||||
"created_at, name, version, manifest, shasum, size, tarball_path, cmd_count, identifier, downloads, demo_images, api_version, metadata"
|
||||
)
|
||||
.order("created_at", { ascending: false })
|
||||
.eq("identifier", identifier)
|
||||
.select()
|
||||
.limit(1)
|
||||
.single()
|
||||
}
|
||||
|
||||
getExtension(identifier: string) {
|
||||
return this.supabase
|
||||
.from("extensions")
|
||||
.select("*")
|
||||
.eq("identifier", identifier)
|
||||
.limit(1)
|
||||
.single()
|
||||
}
|
||||
|
||||
async incrementDownloads({
|
||||
identifier,
|
||||
version
|
||||
}: {
|
||||
identifier: string
|
||||
version: string
|
||||
}): Promise<{ downloads: number }> {
|
||||
return this.supabase.functions
|
||||
.invoke("increment-downloads", {
|
||||
body: { identifier, version }
|
||||
})
|
||||
.then(({ data, error }) => {
|
||||
if (error) {
|
||||
throw error
|
||||
}
|
||||
const parsed = v.safeParse(
|
||||
v.object({
|
||||
downloads: v.number()
|
||||
}),
|
||||
data
|
||||
)
|
||||
if (!parsed.success) {
|
||||
throw new Error("Fail to parse increment downloads response")
|
||||
}
|
||||
return parsed.output
|
||||
})
|
||||
}
|
||||
|
||||
async publishExtFromJSR(payload: {
|
||||
scope: string
|
||||
version: string
|
||||
name: string
|
||||
}): Promise<void> {
|
||||
return this.supabase.functions
|
||||
.invoke("publish-jsr-ext", {
|
||||
body: payload
|
||||
})
|
||||
.then(async ({ data, error }) => {
|
||||
if (data && data.isValid) {
|
||||
return
|
||||
}
|
||||
if (error?.name === "FunctionsHttpError") {
|
||||
const errorMessage = await error.context.json()
|
||||
throw new Error(errorMessage.error)
|
||||
} else {
|
||||
throw new Error(`Unknown error: ${error?.message}`)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
translateExtensionFilePathToUrl(tarballPath: string): string {
|
||||
return this.supabase.storage.from("extensions").getPublicUrl(tarballPath).data.publicUrl
|
||||
}
|
||||
}
|
@ -1,335 +0,0 @@
|
||||
export type Json = string | number | boolean | null | { [key: string]: Json | undefined } | Json[]
|
||||
|
||||
export type Database = {
|
||||
public: {
|
||||
Tables: {
|
||||
cache: {
|
||||
Row: {
|
||||
created_at: string
|
||||
data: Json | null
|
||||
expiry_date: string | null
|
||||
id: number
|
||||
key: string
|
||||
}
|
||||
Insert: {
|
||||
created_at?: string
|
||||
data?: Json | null
|
||||
expiry_date?: string | null
|
||||
id?: number
|
||||
key: string
|
||||
}
|
||||
Update: {
|
||||
created_at?: string
|
||||
data?: Json | null
|
||||
expiry_date?: string | null
|
||||
id?: number
|
||||
key?: string
|
||||
}
|
||||
Relationships: []
|
||||
}
|
||||
events: {
|
||||
Row: {
|
||||
created_at: string
|
||||
data: Json | null
|
||||
event_type: Database["public"]["Enums"]["event_type"]
|
||||
id: number
|
||||
ip: string
|
||||
}
|
||||
Insert: {
|
||||
created_at?: string
|
||||
data?: Json | null
|
||||
event_type: Database["public"]["Enums"]["event_type"]
|
||||
id?: number
|
||||
ip: string
|
||||
}
|
||||
Update: {
|
||||
created_at?: string
|
||||
data?: Json | null
|
||||
event_type?: Database["public"]["Enums"]["event_type"]
|
||||
id?: number
|
||||
ip?: string
|
||||
}
|
||||
Relationships: []
|
||||
}
|
||||
ext_images: {
|
||||
Row: {
|
||||
created_at: string
|
||||
image_path: string
|
||||
sha512: string
|
||||
}
|
||||
Insert: {
|
||||
created_at?: string
|
||||
image_path: string
|
||||
sha512: string
|
||||
}
|
||||
Update: {
|
||||
created_at?: string
|
||||
image_path?: string
|
||||
sha512?: string
|
||||
}
|
||||
Relationships: []
|
||||
}
|
||||
ext_publish: {
|
||||
Row: {
|
||||
api_version: string | null
|
||||
cmd_count: number
|
||||
created_at: string
|
||||
demo_images: string[]
|
||||
downloads: number
|
||||
extension_state: Database["public"]["Enums"]["extension_state"]
|
||||
id: number
|
||||
identifier: string
|
||||
manifest: Json
|
||||
metadata: Json | null
|
||||
name: string
|
||||
package_json: Json | null
|
||||
readme: string | null
|
||||
shasum: string
|
||||
tarball_path: string
|
||||
tarball_size: number
|
||||
unpacked_size: number | null
|
||||
version: string
|
||||
}
|
||||
Insert: {
|
||||
api_version?: string | null
|
||||
cmd_count: number
|
||||
created_at?: string
|
||||
demo_images: string[]
|
||||
downloads: number
|
||||
extension_state?: Database["public"]["Enums"]["extension_state"]
|
||||
id?: number
|
||||
identifier: string
|
||||
manifest: Json
|
||||
metadata?: Json | null
|
||||
name: string
|
||||
package_json?: Json | null
|
||||
readme?: string | null
|
||||
shasum: string
|
||||
tarball_path: string
|
||||
tarball_size: number
|
||||
unpacked_size?: number | null
|
||||
version: string
|
||||
}
|
||||
Update: {
|
||||
api_version?: string | null
|
||||
cmd_count?: number
|
||||
created_at?: string
|
||||
demo_images?: string[]
|
||||
downloads?: number
|
||||
extension_state?: Database["public"]["Enums"]["extension_state"]
|
||||
id?: number
|
||||
identifier?: string
|
||||
manifest?: Json
|
||||
metadata?: Json | null
|
||||
name?: string
|
||||
package_json?: Json | null
|
||||
readme?: string | null
|
||||
shasum?: string
|
||||
tarball_path?: string
|
||||
tarball_size?: number
|
||||
unpacked_size?: number | null
|
||||
version?: string
|
||||
}
|
||||
Relationships: [
|
||||
{
|
||||
foreignKeyName: "ext_publish_identifier_fkey"
|
||||
columns: ["identifier"]
|
||||
isOneToOne: false
|
||||
referencedRelation: "extensions"
|
||||
referencedColumns: ["identifier"]
|
||||
}
|
||||
]
|
||||
}
|
||||
extensions: {
|
||||
Row: {
|
||||
api_version: string
|
||||
author_id: string | null
|
||||
created_at: string
|
||||
downloads: number
|
||||
icon: Json | null
|
||||
identifier: string
|
||||
long_description: string | null
|
||||
name: string
|
||||
readme: string | null
|
||||
short_description: string
|
||||
tarball_size: number | null
|
||||
version: string
|
||||
}
|
||||
Insert: {
|
||||
api_version: string
|
||||
author_id?: string | null
|
||||
created_at?: string
|
||||
downloads: number
|
||||
icon?: Json | null
|
||||
identifier: string
|
||||
long_description?: string | null
|
||||
name: string
|
||||
readme?: string | null
|
||||
short_description: string
|
||||
tarball_size?: number | null
|
||||
version: string
|
||||
}
|
||||
Update: {
|
||||
api_version?: string
|
||||
author_id?: string | null
|
||||
created_at?: string
|
||||
downloads?: number
|
||||
icon?: Json | null
|
||||
identifier?: string
|
||||
long_description?: string | null
|
||||
name?: string
|
||||
readme?: string | null
|
||||
short_description?: string
|
||||
tarball_size?: number | null
|
||||
version?: string
|
||||
}
|
||||
Relationships: []
|
||||
}
|
||||
stargazers: {
|
||||
Row: {
|
||||
created_at: string
|
||||
id: number
|
||||
star_date: string
|
||||
username: string
|
||||
}
|
||||
Insert: {
|
||||
created_at?: string
|
||||
id?: number
|
||||
star_date: string
|
||||
username: string
|
||||
}
|
||||
Update: {
|
||||
created_at?: string
|
||||
id?: number
|
||||
star_date?: string
|
||||
username?: string
|
||||
}
|
||||
Relationships: []
|
||||
}
|
||||
}
|
||||
Views: {
|
||||
[_ in never]: never
|
||||
}
|
||||
Functions: {
|
||||
get_aggregated_downloads: {
|
||||
Args: Record<PropertyKey, never>
|
||||
Returns: {
|
||||
identifier: string
|
||||
total_downloads: number
|
||||
}[]
|
||||
}
|
||||
get_aggregated_downloads_with_details: {
|
||||
Args: Record<PropertyKey, never>
|
||||
Returns: {
|
||||
identifier: string
|
||||
total_downloads: number
|
||||
name: string
|
||||
short_description: string
|
||||
}[]
|
||||
}
|
||||
increment_downloads: {
|
||||
Args: {
|
||||
t_identifier: string
|
||||
t_version: string
|
||||
}
|
||||
Returns: number
|
||||
}
|
||||
}
|
||||
Enums: {
|
||||
event_type: "download" | "updater" | "schema" | "nightly_schema"
|
||||
extension_state: "public" | "pending" | "under_review" | "private"
|
||||
}
|
||||
CompositeTypes: {
|
||||
[_ in never]: never
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type PublicSchema = Database[Extract<keyof Database, "public">]
|
||||
|
||||
export type Tables<
|
||||
PublicTableNameOrOptions extends
|
||||
| keyof (PublicSchema["Tables"] & PublicSchema["Views"])
|
||||
| { schema: keyof Database },
|
||||
TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
|
||||
? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
|
||||
Database[PublicTableNameOrOptions["schema"]]["Views"])
|
||||
: never = never
|
||||
> = PublicTableNameOrOptions extends { schema: keyof Database }
|
||||
? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
|
||||
Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
|
||||
Row: infer R
|
||||
}
|
||||
? R
|
||||
: never
|
||||
: PublicTableNameOrOptions extends keyof (PublicSchema["Tables"] & PublicSchema["Views"])
|
||||
? (PublicSchema["Tables"] & PublicSchema["Views"])[PublicTableNameOrOptions] extends {
|
||||
Row: infer R
|
||||
}
|
||||
? R
|
||||
: never
|
||||
: never
|
||||
|
||||
export type TablesInsert<
|
||||
PublicTableNameOrOptions extends keyof PublicSchema["Tables"] | { schema: keyof Database },
|
||||
TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
|
||||
? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
|
||||
: never = never
|
||||
> = PublicTableNameOrOptions extends { schema: keyof Database }
|
||||
? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
|
||||
Insert: infer I
|
||||
}
|
||||
? I
|
||||
: never
|
||||
: PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
|
||||
? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
|
||||
Insert: infer I
|
||||
}
|
||||
? I
|
||||
: never
|
||||
: never
|
||||
|
||||
export type TablesUpdate<
|
||||
PublicTableNameOrOptions extends keyof PublicSchema["Tables"] | { schema: keyof Database },
|
||||
TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
|
||||
? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
|
||||
: never = never
|
||||
> = PublicTableNameOrOptions extends { schema: keyof Database }
|
||||
? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
|
||||
Update: infer U
|
||||
}
|
||||
? U
|
||||
: never
|
||||
: PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
|
||||
? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
|
||||
Update: infer U
|
||||
}
|
||||
? U
|
||||
: never
|
||||
: never
|
||||
|
||||
export type Enums<
|
||||
PublicEnumNameOrOptions extends keyof PublicSchema["Enums"] | { schema: keyof Database },
|
||||
EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
|
||||
? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"]
|
||||
: never = never
|
||||
> = PublicEnumNameOrOptions extends { schema: keyof Database }
|
||||
? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
|
||||
: PublicEnumNameOrOptions extends keyof PublicSchema["Enums"]
|
||||
? PublicSchema["Enums"][PublicEnumNameOrOptions]
|
||||
: never
|
||||
|
||||
export type CompositeTypes<
|
||||
PublicCompositeTypeNameOrOptions extends
|
||||
| keyof PublicSchema["CompositeTypes"]
|
||||
| { schema: keyof Database },
|
||||
CompositeTypeName extends PublicCompositeTypeNameOrOptions extends {
|
||||
schema: keyof Database
|
||||
}
|
||||
? keyof Database[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"]
|
||||
: never = never
|
||||
> = PublicCompositeTypeNameOrOptions extends { schema: keyof Database }
|
||||
? Database[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName]
|
||||
: PublicCompositeTypeNameOrOptions extends keyof PublicSchema["CompositeTypes"]
|
||||
? PublicSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions]
|
||||
: never
|
@ -1,10 +0,0 @@
|
||||
import { createClient } from "@supabase/supabase-js"
|
||||
import type { Database } from "./database.types"
|
||||
|
||||
// export function createSB(supabaseUrl: string, supabaseAnonKey: string) {
|
||||
// return createClient<Database>(supabaseUrl, supabaseAnonKey, {
|
||||
// auth: {
|
||||
// flowType: "pkce"
|
||||
// }
|
||||
// })
|
||||
// }
|
@ -1,47 +0,0 @@
|
||||
/**
|
||||
* @module @kksh/supabase/models
|
||||
* This module contains some models for supabase database that cannot be code generated, such as JSON fields.
|
||||
*/
|
||||
import { Icon } from "@kksh/api/models"
|
||||
import * as v from "valibot"
|
||||
|
||||
export enum ExtPublishSourceTypeEnum {
|
||||
jsr = "jsr",
|
||||
npm = "npm"
|
||||
}
|
||||
|
||||
export const ExtPublishMetadata = v.object({
|
||||
source: v.optional(v.string("Source of the extension (e.g. url to package)")),
|
||||
sourceType: v.optional(v.enum(ExtPublishSourceTypeEnum)),
|
||||
rekorLogIndex: v.optional(v.string("Rekor log index of the extension")),
|
||||
git: v.optional(
|
||||
v.object({
|
||||
githubActionInvocationId: v.string("GitHub action invocation ID"),
|
||||
repo: v.string("GitHub repo of the extension"),
|
||||
owner: v.string("GitHub owner of the extension"),
|
||||
commit: v.string("Commit hash of the extension"),
|
||||
workflowPath: v.string("Workflow path of the extension"),
|
||||
repoNodeId: v.optional(
|
||||
v.string("GitHub repo node ID of the extension (a string, not the number id)")
|
||||
)
|
||||
})
|
||||
)
|
||||
})
|
||||
export type ExtPublishMetadata = v.InferOutput<typeof ExtPublishMetadata>
|
||||
|
||||
/***
|
||||
* Correspond to `extensions` table in supabase
|
||||
*/
|
||||
export const SBExt = v.object({
|
||||
identifier: v.string(),
|
||||
name: v.string(),
|
||||
created_at: v.string(),
|
||||
downloads: v.number(),
|
||||
short_description: v.string(),
|
||||
long_description: v.string(),
|
||||
version: v.string(),
|
||||
api_version: v.optional(v.string()),
|
||||
icon: Icon
|
||||
})
|
||||
|
||||
export type SBExt = v.InferOutput<typeof SBExt>
|
@ -1,27 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
// Enable latest features
|
||||
"lib": ["ESNext", "DOM"],
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleDetection": "force",
|
||||
"jsx": "react-jsx",
|
||||
"allowJs": true,
|
||||
|
||||
// Bundler mode
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"noEmit": true,
|
||||
|
||||
// Best practices
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
|
||||
// Some stricter flags (disabled by default)
|
||||
"noUnusedLocals": false,
|
||||
"noUnusedParameters": false,
|
||||
"noPropertyAccessFromIndexSignature": false
|
||||
}
|
||||
}
|
@ -6,7 +6,6 @@
|
||||
"prepare": "bun setup.ts"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@kksh/supabase": "workspace:*",
|
||||
"@supabase/supabase-js": "^2.48.0",
|
||||
"@kksh/ci": "workspace:*",
|
||||
"@types/bun": "latest"
|
||||
|
@ -1,12 +1,11 @@
|
||||
import { writeFileSync } from "fs"
|
||||
import { type Database } from "@kksh/supabase/types"
|
||||
import { createClient } from "@supabase/supabase-js"
|
||||
|
||||
if (!process.env.SUPABASE_URL || !process.env.SUPABASE_ANON_KEY) {
|
||||
throw new Error("SUPABASE_URL and SUPABASE_ANON_KEY must be set")
|
||||
}
|
||||
|
||||
const supabase = createClient<Database>(process.env.SUPABASE_URL, process.env.SUPABASE_ANON_KEY)
|
||||
const supabase = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_ANON_KEY)
|
||||
|
||||
const { data, error } = await supabase.storage.from("pub").download("server_public_key.pem")
|
||||
if (error) {
|
||||
|
@ -11,8 +11,6 @@
|
||||
"@kksh/desktop": ["./apps/desktop"],
|
||||
"@kksh/ci/*": ["./packages/ci/*"],
|
||||
"@kksh/ci": ["./packages/ci"],
|
||||
"@kksh/supabase/*": ["./packages/supabase/*"],
|
||||
"@kksh/supabase": ["./packages/supabase"],
|
||||
"@kksh/schema/*": ["./packages/schema/*"],
|
||||
"@kksh/schema": ["./packages/schema"]
|
||||
}
|
||||
|
@ -78,7 +78,6 @@
|
||||
"@formkit/auto-animate": "^0.8.2",
|
||||
"@inlang/paraglide-sveltekit": "^0.15.5",
|
||||
"@internationalized/date": "^3.7.0",
|
||||
"@kksh/supabase": "workspace:*",
|
||||
"@shikijs/langs": "^2.3.2",
|
||||
"@shikijs/rehype": "^3.2.1",
|
||||
"@shikijs/themes": "^2.3.2",
|
||||
@ -99,6 +98,6 @@
|
||||
"svelte-exmarkdown": "^4.0.3",
|
||||
"svelte-inspect-value": "^0.3.0",
|
||||
"svelte-motion": "^0.12.2",
|
||||
"valibot": "^1.0.0-rc.4"
|
||||
"valibot": "^1.0.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
<script lang="ts">
|
||||
import { IconEnum, OSPlatformEnum } from "@kksh/api/models"
|
||||
import { IconEnum, OSPlatform, OSPlatformEnum } from "@kksh/api/models"
|
||||
import { IconMultiplexer } from "@kksh/ui"
|
||||
|
||||
const { platforms }: { platforms: OSPlatformEnum[] } = $props()
|
||||
const { platforms }: { platforms: OSPlatform[] } = $props()
|
||||
</script>
|
||||
|
||||
<div class="flex gap-2">
|
||||
|
@ -1,7 +1,6 @@
|
||||
<script lang="ts">
|
||||
import Icon from "@iconify/svelte"
|
||||
import { ExtData, Icon as TIcon } from "@kksh/api/models"
|
||||
import { SBExt } from "@kksh/supabase/models"
|
||||
import { ExtData, ExtensionStoreListItem, Icon as TIcon } from "@kksh/api/models"
|
||||
import { Button, Command } from "@kksh/svelte5"
|
||||
import { Constants, IconMultiplexer } from "@kksh/ui"
|
||||
import { cn, humanReadableNumber } from "@kksh/ui/utils"
|
||||
@ -19,7 +18,7 @@
|
||||
class: className
|
||||
}: {
|
||||
class?: string
|
||||
ext: SBExt
|
||||
ext: ExtensionStoreListItem
|
||||
installedVersion?: string
|
||||
onSelect: () => void
|
||||
onUpgrade: () => void
|
||||
|
@ -1,20 +1,20 @@
|
||||
<script lang="ts">
|
||||
import { IconEnum, type KunkunExtManifest } from "@kksh/api/models"
|
||||
import { IconEnum, PermissionUnion, type KunkunExtManifest } from "@kksh/api/models"
|
||||
import { permissionDescriptions } from "@kksh/api/permissions"
|
||||
import { HoverCard, ScrollArea } from "@kksh/svelte5"
|
||||
import { IconMultiplexer, Shiki } from "@kksh/ui"
|
||||
|
||||
const {
|
||||
manifest,
|
||||
permissions,
|
||||
class: className
|
||||
}: {
|
||||
manifest: KunkunExtManifest
|
||||
permissions?: PermissionUnion[]
|
||||
class?: string
|
||||
} = $props()
|
||||
</script>
|
||||
|
||||
<ul class={className}>
|
||||
{#each manifest?.permissions || [] as perm}
|
||||
{#each permissions || [] as perm}
|
||||
<li class="flex h-8 items-center gap-2">
|
||||
<span class="font-mono text-sm">{typeof perm === "string" ? perm : perm.permission}</span>
|
||||
<HoverCard.Root>
|
||||
|
@ -1,9 +1,14 @@
|
||||
<script lang="ts">
|
||||
import autoAnimate from "@formkit/auto-animate"
|
||||
import Icon from "@iconify/svelte"
|
||||
import { ExtPackageJson, IconEnum, KunkunExtManifest } from "@kksh/api/models"
|
||||
import { ExtPublishMetadata, ExtPublishSourceTypeEnum } from "@kksh/supabase/models"
|
||||
import { type Tables } from "@kksh/supabase/types"
|
||||
import {
|
||||
ExtPackageJson,
|
||||
ExtPublish,
|
||||
ExtPublishMetadata,
|
||||
ExtPublishSourceTypeEnum,
|
||||
IconEnum,
|
||||
KunkunExtManifest
|
||||
} from "@kksh/api/models"
|
||||
import { Badge, Button, ScrollArea, Separator, Tooltip } from "@kksh/svelte5"
|
||||
import { Constants, IconMultiplexer } from "@kksh/ui"
|
||||
import { cn } from "@kksh/ui/utils"
|
||||
@ -36,8 +41,12 @@
|
||||
loading,
|
||||
imageDialogOpen = $bindable(false)
|
||||
}: {
|
||||
extPublish: Tables<"ext_publish">
|
||||
ext: Tables<"extensions">
|
||||
extPublish: ExtPublish
|
||||
// extPublish: GetExtensionsLatestPublishByIdentifierResponse
|
||||
ext: {
|
||||
author_id: string
|
||||
downloads: number
|
||||
}
|
||||
author?: {
|
||||
id: string
|
||||
name: string
|
||||
@ -248,7 +257,7 @@
|
||||
|
||||
<Separator class="my-3" />
|
||||
<h2 class="text-lg font-bold">Security and Privacy</h2>
|
||||
<PermissionInspector {manifest} />
|
||||
<PermissionInspector permissions={manifest.permissions} />
|
||||
<Separator class="my-3" />
|
||||
<h2 class="text-lg font-bold">Description</h2>
|
||||
|
||||
@ -270,7 +279,7 @@
|
||||
<span class="text-dm">{cmd.name}</span>
|
||||
<h2 class="text-xs">{cmd.description}</h2>
|
||||
</div>
|
||||
<PlatformsIcons platforms={cmd.platforms} />
|
||||
<PlatformsIcons platforms={cmd.platforms ?? []} />
|
||||
</div>
|
||||
<Separator class="my-3" />
|
||||
</li>
|
||||
|
230
pnpm-lock.yaml
generated
230
pnpm-lock.yaml
generated
@ -11,9 +11,15 @@ importers:
|
||||
'@changesets/cli':
|
||||
specifier: ^2.28.1
|
||||
version: 2.28.1
|
||||
'@hey-api/client-fetch':
|
||||
specifier: ^0.8.3
|
||||
version: 0.8.3
|
||||
'@iconify/svelte':
|
||||
specifier: ^4.2.0
|
||||
version: 4.2.0(svelte@5.20.5)
|
||||
'@kksh/sdk':
|
||||
specifier: ^0.0.3
|
||||
version: 0.0.3(@hey-api/client-fetch@0.8.3)(typescript@5.7.3)
|
||||
'@supabase/supabase-js':
|
||||
specifier: ^2.49.1
|
||||
version: 2.49.1
|
||||
@ -72,8 +78,8 @@ importers:
|
||||
specifier: workspace:*
|
||||
version: link:vendors/tauri-plugin-system-info
|
||||
valibot:
|
||||
specifier: ^1.0.0-rc.4
|
||||
version: 1.0.0-rc.4(typescript@5.7.3)
|
||||
specifier: ^1.0.0
|
||||
version: 1.0.0(typescript@5.7.3)
|
||||
zod:
|
||||
specifier: ^3.24.2
|
||||
version: 3.24.2
|
||||
@ -139,12 +145,12 @@ importers:
|
||||
specifier: ^5.7.2
|
||||
version: 5.7.3
|
||||
valibot:
|
||||
specifier: ^1.0.0-rc.4
|
||||
version: 1.0.0-rc.4(typescript@5.7.3)
|
||||
specifier: ^1.0.0
|
||||
version: 1.0.0(typescript@5.7.3)
|
||||
devDependencies:
|
||||
'@types/bun':
|
||||
specifier: latest
|
||||
version: 1.2.5
|
||||
version: 1.2.6
|
||||
'@types/debug':
|
||||
specifier: ^4.1.12
|
||||
version: 4.1.12
|
||||
@ -179,12 +185,12 @@ importers:
|
||||
specifier: ^5.0.0
|
||||
version: 5.7.3
|
||||
valibot:
|
||||
specifier: ^1.0.0-rc.4
|
||||
version: 1.0.0-rc.4(typescript@5.7.3)
|
||||
specifier: ^1.0.0
|
||||
version: 1.0.0(typescript@5.7.3)
|
||||
devDependencies:
|
||||
'@types/bun':
|
||||
specifier: latest
|
||||
version: 1.2.5
|
||||
version: 1.2.6
|
||||
'@types/fs-extra':
|
||||
specifier: ^11.0.4
|
||||
version: 11.0.4
|
||||
@ -209,9 +215,6 @@ importers:
|
||||
'@kksh/extension':
|
||||
specifier: workspace:*
|
||||
version: link:../../packages/extension
|
||||
'@kksh/supabase':
|
||||
specifier: workspace:*
|
||||
version: link:../../packages/supabase
|
||||
'@kksh/svelte5':
|
||||
specifier: ^0.1.15
|
||||
version: 0.1.15(lucide-svelte@0.474.0(svelte@5.20.5))(svelte-sonner@0.3.28(svelte@5.20.5))(svelte@5.20.5)(sveltekit-superforms@2.23.1(@sveltejs/kit@2.17.3(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.20.5)(vite@6.2.0(@types/node@22.13.1)(jiti@2.4.0)(terser@5.36.0)(yaml@2.6.1)))(svelte@5.20.5)(vite@6.2.0(@types/node@22.13.1)(jiti@2.4.0)(terser@5.36.0)(yaml@2.6.1)))(@types/json-schema@7.0.15)(svelte@5.20.5)(typescript@5.6.3))(typescript@5.6.3)
|
||||
@ -326,7 +329,7 @@ importers:
|
||||
version: 2.3.1
|
||||
'@types/bun':
|
||||
specifier: latest
|
||||
version: 1.2.5
|
||||
version: 1.2.6
|
||||
'@types/semver':
|
||||
specifier: ^7.5.8
|
||||
version: 7.5.8
|
||||
@ -472,12 +475,12 @@ importers:
|
||||
specifier: 2.0.8
|
||||
version: 2.0.8(typescript@5.7.2)
|
||||
valibot:
|
||||
specifier: ^1.0.0-rc.4
|
||||
version: 1.0.0-rc.4(typescript@5.7.2)
|
||||
specifier: ^1.0.0
|
||||
version: 1.0.0(typescript@5.7.2)
|
||||
devDependencies:
|
||||
'@types/bun':
|
||||
specifier: latest
|
||||
version: 1.2.5
|
||||
version: 1.2.6
|
||||
'@types/lodash':
|
||||
specifier: ^4.17.14
|
||||
version: 4.17.14
|
||||
@ -517,7 +520,7 @@ importers:
|
||||
version: link:../typescript-config
|
||||
'@types/bun':
|
||||
specifier: latest
|
||||
version: 1.2.5
|
||||
version: 1.2.6
|
||||
|
||||
packages/config-eslint:
|
||||
dependencies:
|
||||
@ -542,11 +545,8 @@ importers:
|
||||
'@kksh/api':
|
||||
specifier: workspace:*
|
||||
version: link:../api
|
||||
'@kksh/supabase':
|
||||
specifier: workspace:*
|
||||
version: link:../supabase
|
||||
'@std/semver':
|
||||
specifier: npm:@jsr/std__semver@^1.0.3
|
||||
specifier: npm:@jsr/std__semver@^1.0.4
|
||||
version: '@jsr/std__semver@1.0.3'
|
||||
'@tauri-apps/plugin-upload':
|
||||
specifier: ^2.2.1
|
||||
@ -558,12 +558,15 @@ importers:
|
||||
specifier: ^5.0.0
|
||||
version: 5.5.4
|
||||
uuid:
|
||||
specifier: ^11.0.3
|
||||
version: 11.0.3
|
||||
specifier: ^11.1.0
|
||||
version: 11.1.0
|
||||
devDependencies:
|
||||
'@types/bun':
|
||||
specifier: latest
|
||||
version: 1.2.5
|
||||
version: 1.2.6
|
||||
'@types/semver':
|
||||
specifier: ^7.5.8
|
||||
version: 7.5.8
|
||||
|
||||
packages/extensions/demo-worker-template-ext:
|
||||
dependencies:
|
||||
@ -591,7 +594,7 @@ importers:
|
||||
version: 11.1.6(rollup@4.34.2)(tslib@2.8.1)(typescript@5.7.3)
|
||||
'@types/bun':
|
||||
specifier: latest
|
||||
version: 1.2.5
|
||||
version: 1.2.6
|
||||
rollup-plugin-visualizer:
|
||||
specifier: ^5.12.0
|
||||
version: 5.12.0(rollup@4.34.2)
|
||||
@ -698,7 +701,7 @@ importers:
|
||||
devDependencies:
|
||||
'@types/bun':
|
||||
specifier: latest
|
||||
version: 1.2.5
|
||||
version: 1.2.6
|
||||
|
||||
packages/grpc:
|
||||
dependencies:
|
||||
@ -717,7 +720,7 @@ importers:
|
||||
version: 0.7.13
|
||||
'@types/bun':
|
||||
specifier: latest
|
||||
version: 1.2.5
|
||||
version: 1.2.6
|
||||
'@types/google-protobuf':
|
||||
specifier: ^3.15.12
|
||||
version: 3.15.12
|
||||
@ -745,7 +748,7 @@ importers:
|
||||
devDependencies:
|
||||
'@types/bun':
|
||||
specifier: latest
|
||||
version: 1.2.5
|
||||
version: 1.2.6
|
||||
verify-package-export:
|
||||
specifier: ^0.0.3
|
||||
version: 0.0.3(typescript@5.7.3)
|
||||
@ -762,40 +765,18 @@ importers:
|
||||
specifier: ^5.0.0
|
||||
version: 5.7.3
|
||||
valibot:
|
||||
specifier: ^1.0.0-rc.4
|
||||
version: 1.0.0-rc.4(typescript@5.7.3)
|
||||
specifier: ^1.0.0
|
||||
version: 1.0.0(typescript@5.7.3)
|
||||
devDependencies:
|
||||
'@kksh/supabase':
|
||||
specifier: workspace:*
|
||||
version: link:../supabase
|
||||
'@supabase/supabase-js':
|
||||
specifier: ^2.48.0
|
||||
version: 2.48.0
|
||||
'@types/bun':
|
||||
specifier: latest
|
||||
version: 1.2.5
|
||||
version: 1.2.6
|
||||
'@valibot/to-json-schema':
|
||||
specifier: 1.0.0-beta.4
|
||||
version: 1.0.0-beta.4(valibot@1.0.0-rc.4(typescript@5.7.3))
|
||||
|
||||
packages/supabase:
|
||||
dependencies:
|
||||
'@kksh/api':
|
||||
specifier: workspace:*
|
||||
version: link:../api
|
||||
'@supabase/ssr':
|
||||
specifier: ^0.5.2
|
||||
version: 0.5.2(@supabase/supabase-js@2.48.0)
|
||||
'@supabase/supabase-js':
|
||||
specifier: ^2.48.0
|
||||
version: 2.48.0
|
||||
typescript:
|
||||
specifier: ^5.0.0
|
||||
version: 5.5.4
|
||||
devDependencies:
|
||||
'@types/bun':
|
||||
specifier: latest
|
||||
version: 1.2.5
|
||||
specifier: 1.0.0
|
||||
version: 1.0.0(valibot@1.0.0(typescript@5.7.3))
|
||||
|
||||
packages/svelte-animation:
|
||||
dependencies:
|
||||
@ -805,7 +786,7 @@ importers:
|
||||
devDependencies:
|
||||
'@types/bun':
|
||||
specifier: latest
|
||||
version: 1.2.5
|
||||
version: 1.2.6
|
||||
|
||||
packages/tauri-plugins/jarvis:
|
||||
dependencies:
|
||||
@ -816,15 +797,12 @@ importers:
|
||||
'@kksh/ci':
|
||||
specifier: workspace:*
|
||||
version: link:../../ci
|
||||
'@kksh/supabase':
|
||||
specifier: workspace:*
|
||||
version: link:../../supabase
|
||||
'@supabase/supabase-js':
|
||||
specifier: ^2.48.0
|
||||
version: 2.48.0
|
||||
'@types/bun':
|
||||
specifier: latest
|
||||
version: 1.2.5
|
||||
version: 1.2.6
|
||||
|
||||
packages/templates/template-ext-headless:
|
||||
dependencies:
|
||||
@ -843,7 +821,7 @@ importers:
|
||||
devDependencies:
|
||||
'@types/bun':
|
||||
specifier: latest
|
||||
version: 1.2.5
|
||||
version: 1.2.6
|
||||
|
||||
packages/templates/template-ext-next:
|
||||
dependencies:
|
||||
@ -1195,7 +1173,7 @@ importers:
|
||||
devDependencies:
|
||||
'@types/bun':
|
||||
specifier: latest
|
||||
version: 1.2.5
|
||||
version: 1.2.6
|
||||
|
||||
packages/types:
|
||||
dependencies:
|
||||
@ -1205,7 +1183,7 @@ importers:
|
||||
devDependencies:
|
||||
'@types/bun':
|
||||
specifier: latest
|
||||
version: 1.2.5
|
||||
version: 1.2.6
|
||||
|
||||
packages/typescript-config: {}
|
||||
|
||||
@ -1220,9 +1198,6 @@ importers:
|
||||
'@internationalized/date':
|
||||
specifier: ^3.7.0
|
||||
version: 3.7.0
|
||||
'@kksh/supabase':
|
||||
specifier: workspace:*
|
||||
version: link:../supabase
|
||||
'@shikijs/langs':
|
||||
specifier: ^2.3.2
|
||||
version: 2.3.2
|
||||
@ -1287,8 +1262,8 @@ importers:
|
||||
specifier: ^0.12.2
|
||||
version: 0.12.2(svelte@5.20.5)
|
||||
valibot:
|
||||
specifier: ^1.0.0-rc.4
|
||||
version: 1.0.0-rc.4(typescript@5.7.3)
|
||||
specifier: ^1.0.0
|
||||
version: 1.0.0(typescript@5.7.3)
|
||||
devDependencies:
|
||||
'@eslint/js':
|
||||
specifier: ^9.18.0
|
||||
@ -1304,7 +1279,7 @@ importers:
|
||||
version: 0.1.15(lucide-svelte@0.471.0(svelte@5.20.5))(svelte-sonner@0.3.28(svelte@5.20.5))(svelte@5.20.5)(sveltekit-superforms@2.22.1(@sveltejs/kit@2.17.3(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.20.5)(vite@6.2.0(@types/node@22.13.1)(jiti@2.4.0)(terser@5.36.0)(yaml@2.6.1)))(svelte@5.20.5)(vite@6.2.0(@types/node@22.13.1)(jiti@2.4.0)(terser@5.36.0)(yaml@2.6.1)))(@types/json-schema@7.0.15)(svelte@5.20.5)(typescript@5.7.3))(typescript@5.7.3)
|
||||
'@types/bun':
|
||||
specifier: latest
|
||||
version: 1.2.5
|
||||
version: 1.2.6
|
||||
'@typescript-eslint/eslint-plugin':
|
||||
specifier: ^8.20.0
|
||||
version: 8.20.0(@typescript-eslint/parser@8.20.0(eslint@9.21.0(jiti@2.4.0))(typescript@5.7.3))(eslint@9.21.0(jiti@2.4.0))(typescript@5.7.3)
|
||||
@ -1386,7 +1361,7 @@ importers:
|
||||
devDependencies:
|
||||
'@types/bun':
|
||||
specifier: latest
|
||||
version: 1.2.5
|
||||
version: 1.2.6
|
||||
|
||||
vendors/tauri-plugin-keyring:
|
||||
dependencies:
|
||||
@ -1416,8 +1391,8 @@ importers:
|
||||
specifier: ^2.1.1
|
||||
version: 2.1.1
|
||||
valibot:
|
||||
specifier: ^1.0.0-beta.10
|
||||
version: 1.0.0-beta.10(typescript@5.6.3)
|
||||
specifier: ^1.0.0
|
||||
version: 1.0.0(typescript@5.6.3)
|
||||
devDependencies:
|
||||
'@rollup/plugin-typescript':
|
||||
specifier: ^12.1.2
|
||||
@ -1442,7 +1417,7 @@ importers:
|
||||
version: 2.2.0
|
||||
valibot:
|
||||
specifier: ^1.0.0-beta.10
|
||||
version: 1.0.0-beta.10(typescript@5.7.2)
|
||||
version: 1.0.0(typescript@5.7.2)
|
||||
devDependencies:
|
||||
'@rollup/plugin-typescript':
|
||||
specifier: ^12.1.2
|
||||
@ -1482,8 +1457,8 @@ importers:
|
||||
specifier: ^5.3.3
|
||||
version: 5.6.3
|
||||
valibot:
|
||||
specifier: 1.0.0-beta.9
|
||||
version: 1.0.0-beta.9(typescript@5.6.3)
|
||||
specifier: 1.0.0
|
||||
version: 1.0.0(typescript@5.6.3)
|
||||
|
||||
packages:
|
||||
|
||||
@ -2659,6 +2634,9 @@ packages:
|
||||
'@hey-api/client-fetch@0.6.0':
|
||||
resolution: {integrity: sha512-FlhFsVeH8RxJe/nq8xUzxNbiOpe+GadxlD2pfvDyOyLdCTU4o/LRv46ZVWstaW7DgF4nxhI328chy3+AulwVXw==}
|
||||
|
||||
'@hey-api/client-fetch@0.8.3':
|
||||
resolution: {integrity: sha512-EBVa8wwUMyBSeQ32PtCz6u5bFQZIMAufvwCT1ZtpjqT3caJQEza4NokbGU50q1ZVrMsM5Ot6GuDNJOF3TMo26Q==}
|
||||
|
||||
'@hookform/resolvers@3.9.1':
|
||||
resolution: {integrity: sha512-ud2HqmGBM0P0IABqoskKWI6PEf6ZDDBZkFqe2Vnl+mTHCEHzr3ISjjZyCwTjC/qpL25JC9aIDkloQejvMeq0ug==}
|
||||
peerDependencies:
|
||||
@ -3018,6 +2996,12 @@ packages:
|
||||
react: ^18.2.0
|
||||
react-dom: ^18.2.0
|
||||
|
||||
'@kksh/sdk@0.0.3':
|
||||
resolution: {integrity: sha512-he5/VSiIfEuXQlGWGxoIurrq/wbddbvZiHbKIGAFTS1DljCHjnAjEajueCkz9M3sbn+WGylS8VSVAFSCWdCfPg==}
|
||||
peerDependencies:
|
||||
'@hey-api/client-fetch': ^0.8.3
|
||||
typescript: ^5
|
||||
|
||||
'@kksh/svelte5@0.1.15':
|
||||
resolution: {integrity: sha512-Cr/gSWsnRtQIQLpQAkGBODujWn5g4LlhDp865skRV95tkrOuAwbbWGjG5+oWx1fK+fiDu+rhe2UCqw61SW2B/Q==}
|
||||
peerDependencies:
|
||||
@ -4981,11 +4965,6 @@ packages:
|
||||
'@supabase/realtime-js@2.11.2':
|
||||
resolution: {integrity: sha512-u/XeuL2Y0QEhXSoIPZZwR6wMXgB+RQbJzG9VErA3VghVt7uRfSVsjeqd7m5GhX3JR6dM/WRmLbVR8URpDWG4+w==}
|
||||
|
||||
'@supabase/ssr@0.5.2':
|
||||
resolution: {integrity: sha512-n3plRhr2Bs8Xun1o4S3k1CDv17iH5QY9YcoEvXX3bxV1/5XSasA0mNXYycFmADIdtdE6BG9MRjP5CGIs8qxC8A==}
|
||||
peerDependencies:
|
||||
'@supabase/supabase-js': ^2.43.4
|
||||
|
||||
'@supabase/storage-js@2.7.1':
|
||||
resolution: {integrity: sha512-asYHcyDR1fKqrMpytAS1zjyEfvxuOIp1CIXX7ji4lHHcJKqyk+sLl/Vxgm4sN6u8zvuUtae9e4kDxQP2qrwWBA==}
|
||||
|
||||
@ -5363,8 +5342,8 @@ packages:
|
||||
'@types/btoa-lite@1.0.2':
|
||||
resolution: {integrity: sha512-ZYbcE2x7yrvNFJiU7xJGrpF/ihpkM7zKgw8bha3LNJSesvTtUNxbpzaT7WXBIryf6jovisrxTBvymxMeLLj1Mg==}
|
||||
|
||||
'@types/bun@1.2.5':
|
||||
resolution: {integrity: sha512-w2OZTzrZTVtbnJew1pdFmgV99H0/L+Pvw+z1P67HaR18MHOzYnTYOi6qzErhK8HyT+DB782ADVPPE92Xu2/Opg==}
|
||||
'@types/bun@1.2.6':
|
||||
resolution: {integrity: sha512-fY9CAmTdJH1Llx7rugB0FpgWK2RKuHCs3g2cFDYXUutIy1QGiPQxKkGY8owhfZ4MXWNfxwIbQLChgH5gDsY7vw==}
|
||||
|
||||
'@types/cookie@0.6.0':
|
||||
resolution: {integrity: sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==}
|
||||
@ -5880,10 +5859,10 @@ packages:
|
||||
'@unovis/ts': 1.4.4
|
||||
vue: ^3
|
||||
|
||||
'@valibot/to-json-schema@1.0.0-beta.4':
|
||||
resolution: {integrity: sha512-wXBdCyoqec+NLCl5ihitXzZXD4JAjPK3+HfskSXzfhiNFvKje0A/v1LygqKidUgIbaJtREmq/poJGbaS/0MKuQ==}
|
||||
'@valibot/to-json-schema@1.0.0':
|
||||
resolution: {integrity: sha512-/9crJgPptVsGCL6X+JPDQyaJwkalSZ/52WuF8DiRUxJgcmpNdzYRfZ+gqMEP8W3CTVfuMWPqqvIgfwJ97f9Etw==}
|
||||
peerDependencies:
|
||||
valibot: ^1.0.0 || ^1.0.0-beta.5 || ^1.0.0-rc
|
||||
valibot: ^1.0.0
|
||||
|
||||
'@vee-validate/zod@4.14.7':
|
||||
resolution: {integrity: sha512-UD0Tfyz1cKKd7BinnUztqKL+oeMjg/T4ZEguN/uZV4DsR9z7gdrD0lOuOU7aVl9UpVK6NM7MhDka35Lj7b/DTw==}
|
||||
@ -6430,8 +6409,8 @@ packages:
|
||||
buffer@6.0.3:
|
||||
resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==}
|
||||
|
||||
bun-types@1.2.5:
|
||||
resolution: {integrity: sha512-3oO6LVGGRRKI4kHINx5PIdIgnLRb7l/SprhzqXapmoYkFl5m4j6EvALvbDVuuBFaamB46Ap6HCUxIXNLCGy+tg==}
|
||||
bun-types@1.2.6:
|
||||
resolution: {integrity: sha512-FbCKyr5KDiPULUzN/nm5oqQs9nXCHD8dVc64BArxJadCvbNzAI6lUWGh9fSJZWeDIRD38ikceBU8Kj/Uh+53oQ==}
|
||||
|
||||
bundle-name@4.1.0:
|
||||
resolution: {integrity: sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==}
|
||||
@ -6740,10 +6719,6 @@ packages:
|
||||
resolution: {integrity: sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==}
|
||||
engines: {node: '>= 0.6'}
|
||||
|
||||
cookie@0.7.2:
|
||||
resolution: {integrity: sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==}
|
||||
engines: {node: '>= 0.6'}
|
||||
|
||||
cookies@0.9.1:
|
||||
resolution: {integrity: sha512-TG2hpqe4ELx54QER/S3HQ9SRVnQnGBtKUz5bLQWtYAQ+o6GpgMs6sYUvaiJjVxb+UXwhRhAEP3m7LbsIZ77Hmw==}
|
||||
engines: {node: '>= 0.8'}
|
||||
@ -11943,8 +11918,8 @@ packages:
|
||||
typescript:
|
||||
optional: true
|
||||
|
||||
valibot@1.0.0-beta.10:
|
||||
resolution: {integrity: sha512-nmo3nxvXRrxwDYZznK3aTgYv7ZA/SUZJ/s+pLY4Tqsex/fgwZ9XrrQ14jjozjUaeduQ9PhXHE2Xx1uMb0HePYw==}
|
||||
valibot@1.0.0:
|
||||
resolution: {integrity: sha512-1Hc0ihzWxBar6NGeZv7fPLY0QuxFMyxwYR2sF1Blu7Wq7EnremwY2W02tit2ij2VJT8HcSkHAQqmFfl77f73Yw==}
|
||||
peerDependencies:
|
||||
typescript: '>=5'
|
||||
peerDependenciesMeta:
|
||||
@ -11959,22 +11934,6 @@ packages:
|
||||
typescript:
|
||||
optional: true
|
||||
|
||||
valibot@1.0.0-beta.9:
|
||||
resolution: {integrity: sha512-yEX8gMAZ2R1yI2uwOO4NCtVnJQx36zn3vD0omzzj9FhcoblvPukENIiRZXKZwCnqSeV80bMm8wNiGhQ0S8fiww==}
|
||||
peerDependencies:
|
||||
typescript: '>=5'
|
||||
peerDependenciesMeta:
|
||||
typescript:
|
||||
optional: true
|
||||
|
||||
valibot@1.0.0-rc.4:
|
||||
resolution: {integrity: sha512-VRaChgFv7Ab0P54AMLu7+GqoexdTPQ54Plj59X9qV0AFozI3j9CGH43skg+TqgMpXnrW8jxlJ2TTHAtAD3t4qA==}
|
||||
peerDependencies:
|
||||
typescript: '>=5'
|
||||
peerDependenciesMeta:
|
||||
typescript:
|
||||
optional: true
|
||||
|
||||
validate-npm-package-name@5.0.1:
|
||||
resolution: {integrity: sha512-OljLrQ9SQdOUqTaQxqL5dEfZWrXExyyWsozYlAWFawPVNuD83igl7uJD2RTkNMbniIYgt8l81eCJGIdQF7avLQ==}
|
||||
engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
|
||||
@ -13981,6 +13940,8 @@ snapshots:
|
||||
|
||||
'@hey-api/client-fetch@0.6.0': {}
|
||||
|
||||
'@hey-api/client-fetch@0.8.3': {}
|
||||
|
||||
'@hookform/resolvers@3.9.1(react-hook-form@7.53.2(react@18.3.1))':
|
||||
dependencies:
|
||||
react-hook-form: 7.53.2(react@18.3.1)
|
||||
@ -14648,6 +14609,11 @@ snapshots:
|
||||
- '@types/react-dom'
|
||||
- tailwindcss
|
||||
|
||||
'@kksh/sdk@0.0.3(@hey-api/client-fetch@0.8.3)(typescript@5.7.3)':
|
||||
dependencies:
|
||||
'@hey-api/client-fetch': 0.8.3
|
||||
typescript: 5.7.3
|
||||
|
||||
'@kksh/svelte5@0.1.15(lucide-svelte@0.469.0(svelte@5.16.6))(svelte-sonner@0.3.28(svelte@5.16.6))(svelte@5.16.6)(sveltekit-superforms@2.23.1(@sveltejs/kit@2.15.2(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.16.6)(vite@6.0.7(@types/node@22.13.1)(jiti@2.4.0)(terser@5.36.0)(yaml@2.6.1)))(svelte@5.16.6)(vite@6.0.7(@types/node@22.13.1)(jiti@2.4.0)(terser@5.36.0)(yaml@2.6.1)))(@types/json-schema@7.0.15)(svelte@5.16.6)(typescript@5.7.2))(typescript@5.7.2)':
|
||||
dependencies:
|
||||
'@tanstack/table-core': 8.21.2
|
||||
@ -17047,12 +17013,6 @@ snapshots:
|
||||
- bufferutil
|
||||
- utf-8-validate
|
||||
|
||||
'@supabase/ssr@0.5.2(@supabase/supabase-js@2.48.0)':
|
||||
dependencies:
|
||||
'@supabase/supabase-js': 2.48.0
|
||||
'@types/cookie': 0.6.0
|
||||
cookie: 0.7.2
|
||||
|
||||
'@supabase/storage-js@2.7.1':
|
||||
dependencies:
|
||||
'@supabase/node-fetch': 2.6.15
|
||||
@ -17498,9 +17458,9 @@ snapshots:
|
||||
|
||||
'@types/btoa-lite@1.0.2': {}
|
||||
|
||||
'@types/bun@1.2.5':
|
||||
'@types/bun@1.2.6':
|
||||
dependencies:
|
||||
bun-types: 1.2.5
|
||||
bun-types: 1.2.6
|
||||
|
||||
'@types/cookie@0.6.0': {}
|
||||
|
||||
@ -18278,9 +18238,9 @@ snapshots:
|
||||
'@unovis/ts': 1.4.4
|
||||
vue: 3.5.13(typescript@5.6.3)
|
||||
|
||||
'@valibot/to-json-schema@1.0.0-beta.4(valibot@1.0.0-rc.4(typescript@5.7.3))':
|
||||
'@valibot/to-json-schema@1.0.0(valibot@1.0.0(typescript@5.7.3))':
|
||||
dependencies:
|
||||
valibot: 1.0.0-rc.4(typescript@5.7.3)
|
||||
valibot: 1.0.0(typescript@5.7.3)
|
||||
|
||||
'@vee-validate/zod@4.14.7(vue@3.5.13(typescript@5.6.3))':
|
||||
dependencies:
|
||||
@ -19042,7 +19002,7 @@ snapshots:
|
||||
base64-js: 1.5.1
|
||||
ieee754: 1.2.1
|
||||
|
||||
bun-types@1.2.5:
|
||||
bun-types@1.2.6:
|
||||
dependencies:
|
||||
'@types/node': 22.13.1
|
||||
'@types/ws': 8.5.14
|
||||
@ -19321,8 +19281,6 @@ snapshots:
|
||||
|
||||
cookie@0.6.0: {}
|
||||
|
||||
cookie@0.7.2: {}
|
||||
|
||||
cookies@0.9.1:
|
||||
dependencies:
|
||||
depd: 2.0.0
|
||||
@ -24860,7 +24818,7 @@ snapshots:
|
||||
joi: 17.13.3
|
||||
json-schema-to-ts: 3.1.1
|
||||
superstruct: 2.0.2
|
||||
valibot: 1.0.0-rc.4(typescript@5.7.3)
|
||||
valibot: 1.0.0(typescript@5.7.3)
|
||||
yup: 1.6.1
|
||||
zod: 3.24.1
|
||||
zod-to-json-schema: 3.24.1(zod@3.24.1)
|
||||
@ -25104,7 +25062,7 @@ snapshots:
|
||||
tauri-plugin-system-info-api: 2.0.10(typescript@5.7.2)
|
||||
tsc-alias: 1.8.10
|
||||
typescript: 5.7.2
|
||||
valibot: 1.0.0-rc.4(typescript@5.7.2)
|
||||
valibot: 1.0.0(typescript@5.7.2)
|
||||
transitivePeerDependencies:
|
||||
- bufferutil
|
||||
- utf-8-validate
|
||||
@ -25160,14 +25118,14 @@ snapshots:
|
||||
tauri-plugin-network-api@2.0.5(typescript@5.7.2):
|
||||
dependencies:
|
||||
'@tauri-apps/api': 2.3.0
|
||||
valibot: 1.0.0-rc.4(typescript@5.7.2)
|
||||
valibot: 1.0.0(typescript@5.7.2)
|
||||
transitivePeerDependencies:
|
||||
- typescript
|
||||
|
||||
tauri-plugin-network-api@2.0.5(typescript@5.7.3):
|
||||
dependencies:
|
||||
'@tauri-apps/api': 2.3.0
|
||||
valibot: 1.0.0-rc.4(typescript@5.7.3)
|
||||
valibot: 1.0.0(typescript@5.7.3)
|
||||
transitivePeerDependencies:
|
||||
- typescript
|
||||
|
||||
@ -25184,7 +25142,7 @@ snapshots:
|
||||
tauri-plugin-system-info-api@2.0.10(typescript@5.7.2):
|
||||
dependencies:
|
||||
'@tauri-apps/api': 2.3.0
|
||||
valibot: 1.0.0-rc.4(typescript@5.7.2)
|
||||
valibot: 1.0.0(typescript@5.7.2)
|
||||
transitivePeerDependencies:
|
||||
- typescript
|
||||
|
||||
@ -25774,14 +25732,18 @@ snapshots:
|
||||
optionalDependencies:
|
||||
typescript: 5.7.3
|
||||
|
||||
valibot@1.0.0-beta.10(typescript@5.6.3):
|
||||
valibot@1.0.0(typescript@5.6.3):
|
||||
optionalDependencies:
|
||||
typescript: 5.6.3
|
||||
|
||||
valibot@1.0.0-beta.10(typescript@5.7.2):
|
||||
valibot@1.0.0(typescript@5.7.2):
|
||||
optionalDependencies:
|
||||
typescript: 5.7.2
|
||||
|
||||
valibot@1.0.0(typescript@5.7.3):
|
||||
optionalDependencies:
|
||||
typescript: 5.7.3
|
||||
|
||||
valibot@1.0.0-beta.11(typescript@5.6.3):
|
||||
optionalDependencies:
|
||||
typescript: 5.6.3
|
||||
@ -25795,18 +25757,6 @@ snapshots:
|
||||
optionalDependencies:
|
||||
typescript: 5.7.3
|
||||
|
||||
valibot@1.0.0-beta.9(typescript@5.6.3):
|
||||
optionalDependencies:
|
||||
typescript: 5.6.3
|
||||
|
||||
valibot@1.0.0-rc.4(typescript@5.7.2):
|
||||
optionalDependencies:
|
||||
typescript: 5.7.2
|
||||
|
||||
valibot@1.0.0-rc.4(typescript@5.7.3):
|
||||
optionalDependencies:
|
||||
typescript: 5.7.3
|
||||
|
||||
validate-npm-package-name@5.0.1: {}
|
||||
|
||||
validator@13.12.0:
|
||||
|
2
vendors/tauri-plugin-network
vendored
2
vendors/tauri-plugin-network
vendored
@ -1 +1 @@
|
||||
Subproject commit d7e55fbe23ddd2bd947c1d0a46c34edb2698e00c
|
||||
Subproject commit dee36a97918089f698ab060152de6d13f627aa59
|
2
vendors/tauri-plugin-user-input
vendored
2
vendors/tauri-plugin-user-input
vendored
@ -1 +1 @@
|
||||
Subproject commit f62f393efad652dec9ec9c4c065aba637538a3ac
|
||||
Subproject commit 54399d9c196a79488560a546da055ec46ef9a55e
|
Loading…
x
Reference in New Issue
Block a user