-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
299 changed files
with
730 additions
and
673 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { type Resolvable } from "deco/engine/core/resolver.ts"; | ||
import { type fjp } from "./deps.ts"; | ||
|
||
export interface Pagination<T> { | ||
data: T[]; | ||
page: number; | ||
pageSize: number; | ||
total: number; | ||
} | ||
|
||
export interface PatchState { | ||
type: "patch-state"; | ||
payload: fjp.Operation[]; | ||
revision: string; | ||
} | ||
|
||
export interface FetchState { | ||
type: "fetch-state"; | ||
} | ||
|
||
export interface StatePatched { | ||
type: "state-patched"; | ||
payload: fjp.Operation[]; | ||
revision: string; | ||
// Maybe add data and user info in here | ||
metadata?: unknown; | ||
} | ||
|
||
export interface StateFetched { | ||
type: "state-fetched"; | ||
payload: State; | ||
} | ||
|
||
export interface OperationFailed { | ||
type: "operation-failed"; | ||
code: "UNAUTHORIZED" | "INTERNAL_SERVER_ERROR"; | ||
reason: string; | ||
} | ||
|
||
export type Acked<T> = T & { ack: string }; | ||
|
||
export interface State { | ||
decofile: Record<string, Resolvable>; | ||
revision: string; | ||
} | ||
|
||
export type Commands = PatchState | FetchState; | ||
export type Events = StatePatched | StateFetched | OperationFailed; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
import type { App, AppContext as AC } from "@deco/deco"; | ||
import { | ||
AppManifest, | ||
asResolved, | ||
AvailableActions, | ||
AvailableLoaders, | ||
isDeferred, | ||
} from "@deco/deco"; | ||
import { isAwaitable } from "@deco/deco/utils"; | ||
import AWS from "https://esm.sh/[email protected]"; | ||
import { asResolved, isDeferred } from "deco/engine/core/resolver.ts"; | ||
import { isAwaitable } from "deco/engine/core/utils.ts"; | ||
import type { App, AppContext as AC } from "deco/mod.ts"; | ||
import { AvailableActions, AvailableLoaders } from "deco/utils/invoke.types.ts"; | ||
import { AppManifest } from "deco/types.ts"; | ||
import { deferred } from "std/async/deferred.ts"; | ||
import openai, { | ||
Props as OpenAIProps, | ||
State as OpenAIState, | ||
} from "../openai/mod.ts"; | ||
import { Secret } from "../website/loaders/secret.ts"; | ||
import { Assistant } from "./deps.ts"; | ||
import manifest, { Manifest } from "./manifest.gen.ts"; | ||
import { Secret } from "../website/loaders/secret.ts"; | ||
import { PreviewContainer } from "../utils/preview.tsx"; | ||
|
||
export type GPTModel = | ||
|
@@ -160,7 +157,7 @@ export default function App( | |
...openAIApp.state, | ||
assistants: (state.assistants ?? []).filter(Boolean).reduce( | ||
(acc, assistant) => { | ||
const assistantDeferred = Promise.withResolvers<AIAssistant>(); | ||
const assistantDeferred = deferred<AIAssistant>(); | ||
if (isDeferred<AIAssistant>(assistant)) { | ||
const aiAssistant = assistant(); | ||
if (isAwaitable(aiAssistant)) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { proxy } from "@deco/deco/web"; | ||
import { proxy } from "deco/clients/withManifest.ts"; | ||
import { Manifest } from "./manifest.gen.ts"; | ||
|
||
export const invoke = proxy<Manifest>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import type { App, AppContext as AC } from "@deco/deco"; | ||
import type { App, AppContext as AC } from "deco/mod.ts"; | ||
import algolia from "https://esm.sh/[email protected]"; | ||
import { createFetchRequester } from "npm:@algolia/[email protected]"; | ||
import { Markdown } from "../decohub/components/Markdown.tsx"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { SectionProps } from "@deco/deco"; | ||
import { useScriptAsDataURI } from "@deco/deco/hooks"; | ||
import { SectionProps } from "deco/blocks/section.ts"; | ||
import { useScriptAsDataURI } from "deco/hooks/useScript.ts"; | ||
import insights from "npm:[email protected]"; | ||
import { | ||
AddToCartEvent, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import type { Author } from "../types.ts"; | ||
import { Author } from "../types.ts"; | ||
|
||
/** | ||
* @title Author | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import type { BlogPost } from "../types.ts"; | ||
import { BlogPost } from "../types.ts"; | ||
|
||
/** | ||
* @title Blogpost | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import type { Category } from "../types.ts"; | ||
import { Category } from "../types.ts"; | ||
|
||
/** | ||
* @title Category | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.