diff --git a/apps/demo-react/package.json b/apps/demo-react/package.json index b6b354c..afdb7ef 100644 --- a/apps/demo-react/package.json +++ b/apps/demo-react/package.json @@ -13,7 +13,8 @@ "dependencies": { "react": "^18.3.1", "react-dom": "^18.3.1", - "@orama/react-components": "workspace:*" + "@orama/react-components": "workspace:*", + "@oramacloud/client": "^2.1.4" }, "devDependencies": { "@types/react": "^18.3.3", diff --git a/apps/storybook/package.json b/apps/storybook/package.json index fbb6378..a82c63c 100644 --- a/apps/storybook/package.json +++ b/apps/storybook/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@orama/wc-components": "workspace:*", - "@oramacloud/client": "1.3.15", + "@oramacloud/client": "^2.1.0", "@storybook/preview-api": "^8.2.9", "@storybook/web-components": "^8.2.3" }, diff --git a/apps/storybook/stories/config.ts b/apps/storybook/stories/config.ts index f566f7c..1d31e4b 100644 --- a/apps/storybook/stories/config.ts +++ b/apps/storybook/stories/config.ts @@ -6,15 +6,15 @@ export type DemoIndexConfig = Record const demoIndexes: DemoIndexConfig = { orama: { open: true, - index: { - api_key: 'LerNlbp6379jVKaPs4wt2nZT4MJZbU1J', - endpoint: 'https://cloud.orama.run/v1/indexes/docs-orama-b3f5xd', - }, - // Uncomment this line to use the OramaClient instance and comment the index prop - // clientInstance: new OramaClient({ + // index: { // api_key: 'LerNlbp6379jVKaPs4wt2nZT4MJZbU1J', // endpoint: 'https://cloud.orama.run/v1/indexes/docs-orama-b3f5xd', - // }), + // }, + // Uncomment this line to use the OramaClient instance and comment the index prop + clientInstance: new OramaClient({ + api_key: 'LerNlbp6379jVKaPs4wt2nZT4MJZbU1J', + endpoint: 'https://cloud.orama.run/v1/indexes/docs-orama-b3f5xd', + }), placeholder: 'What do you want to learn about Orama?', sourceBaseUrl: 'https://docs.orama.com', sourcesMap: { @@ -28,11 +28,6 @@ const demoIndexes: DemoIndexConfig = { description: 'content', section: 'category', }, - highlight: { - caseSensitive: false, - HTMLTag: 'b', - CSSClass: 'font-bold', - }, }, recipes: { open: true, diff --git a/apps/storybook/stories/public/orama-search-box.stories.tsx b/apps/storybook/stories/public/orama-search-box.stories.tsx index da01214..826d03a 100644 --- a/apps/storybook/stories/public/orama-search-box.stories.tsx +++ b/apps/storybook/stories/public/orama-search-box.stories.tsx @@ -77,9 +77,9 @@ const Template = ({ facetProperty, themeConfig, index, + clientInstance, sourceBaseUrl, sourcesMap, - highlight, resultMap, }) => { return html`
@@ -93,6 +93,7 @@ const Template = ({ .colorScheme=${colorScheme} .themeConfig=${themeConfig || preset.themeConfig} .index=${index || preset.index} + .clientInstance=${clientInstance || preset.clientInstance} .instance=${preset.instance} .suggestions=${suggestions || preset?.suggestions} .sourceBaseUrl=${sourceBaseUrl || preset?.sourceBaseUrl} @@ -119,6 +120,7 @@ const TemplateAsEmbed = ({ resultMap, themeConfig, index, + clientInstance, sourceBaseURL, suggestions, sourcesMap, @@ -132,6 +134,7 @@ const TemplateAsEmbed = ({ .colorScheme=${colorScheme} .themeConfig=${themeConfig || preset.themeConfig} .index=${index || preset.index} + .clientInstance=${clientInstance || preset.clientInstance} .instance=${preset.instance} .suggestions=${suggestions || preset?.suggestions} .sourceBaseUrl=${sourceBaseURL || preset?.sourceBaseUrl} diff --git a/packages/ui-stencil/package.json b/packages/ui-stencil/package.json index 5ff9c96..0d8ba04 100644 --- a/packages/ui-stencil/package.json +++ b/packages/ui-stencil/package.json @@ -26,7 +26,8 @@ "types": "dist/types/index.d.ts", "dependencies": { "@orama/highlight": "^0.1.6", - "@orama/orama": "^2.0.23", + "@orama/orama": "^3.0.0", + "@orama/switch": "^3.0.0", "@oramacloud/client": "^2.1.0", "@phosphor-icons/webcomponents": "^2.1.5", "@stencil/core": "^4.19.0", diff --git a/packages/ui-stencil/src/components.d.ts b/packages/ui-stencil/src/components.d.ts index 8aed7a1..ee95040 100644 --- a/packages/ui-stencil/src/components.d.ts +++ b/packages/ui-stencil/src/components.d.ts @@ -9,11 +9,11 @@ import { ButtonProps } from "./components/internal/orama-button/orama-button"; import { ChatMarkdownLinkHref, ChatMarkdownLinkTarget, ChatMarkdownLinkTitle, CloudIndexConfig, ColorScheme, Facet, OnAnswerGeneratedCallbackProps, OnAnswerSourceClickCallbackProps, OnChatMarkdownLinkClickedCallbackProps, OnSearchCompletedCallbackProps, OnSearchResultClickCallbackProps, ResultMap, SearchResult, SearchResultBySection, SourcesMap } from "./types/index"; import { TChatInteraction } from "./context/chatContext"; import { OramaClient } from "@oramacloud/client"; +import { AnyOrama, Orama, SearchParams } from "@orama/orama"; import { InputProps } from "./components/internal/orama-input/orama-input"; import { ModalStatus } from "./components/internal/orama-modal/orama-modal"; import { HighlightOptions } from "@orama/highlight"; import { TThemeOverrides } from "./config/theme"; -import { AnyOrama, Orama, SearchParams } from "@orama/orama"; import { TThemeOverrides as TThemeOverrides1 } from "./components.d"; import { SearchResultsProps } from "./components/internal/orama-search-results/orama-search-results"; import { TextProps } from "./components/internal/orama-text/orama-text"; @@ -21,11 +21,11 @@ export { ButtonProps } from "./components/internal/orama-button/orama-button"; export { ChatMarkdownLinkHref, ChatMarkdownLinkTarget, ChatMarkdownLinkTitle, CloudIndexConfig, ColorScheme, Facet, OnAnswerGeneratedCallbackProps, OnAnswerSourceClickCallbackProps, OnChatMarkdownLinkClickedCallbackProps, OnSearchCompletedCallbackProps, OnSearchResultClickCallbackProps, ResultMap, SearchResult, SearchResultBySection, SourcesMap } from "./types/index"; export { TChatInteraction } from "./context/chatContext"; export { OramaClient } from "@oramacloud/client"; +export { AnyOrama, Orama, SearchParams } from "@orama/orama"; export { InputProps } from "./components/internal/orama-input/orama-input"; export { ModalStatus } from "./components/internal/orama-modal/orama-modal"; export { HighlightOptions } from "@orama/highlight"; export { TThemeOverrides } from "./config/theme"; -export { AnyOrama, Orama, SearchParams } from "@orama/orama"; export { TThemeOverrides as TThemeOverrides1 } from "./components.d"; export { SearchResultsProps } from "./components/internal/orama-search-results/orama-search-results"; export { TextProps } from "./components/internal/orama-text/orama-text"; @@ -65,7 +65,7 @@ export namespace Components { "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; - "clientInstance"?: OramaClient; + "clientInstance"?: OramaClient | AnyOrama; "index"?: CloudIndexConfig; "linksRel"?: string; "linksTarget"?: string; @@ -149,7 +149,7 @@ export namespace Components { "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; "chatPlaceholder"?: string; - "clientInstance"?: OramaClient; + "clientInstance"?: OramaClient | AnyOrama; "colorScheme"?: ColorScheme; "disableChat"?: boolean; "facetProperty"?: string; @@ -623,7 +623,7 @@ declare namespace LocalJSX { "chatMarkdownLinkHref"?: ChatMarkdownLinkHref; "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; - "clientInstance"?: OramaClient; + "clientInstance"?: OramaClient | AnyOrama; "index"?: CloudIndexConfig; "linksRel"?: string; "linksTarget"?: string; @@ -725,7 +725,7 @@ declare namespace LocalJSX { "chatMarkdownLinkTarget"?: ChatMarkdownLinkTarget; "chatMarkdownLinkTitle"?: ChatMarkdownLinkTitle; "chatPlaceholder"?: string; - "clientInstance"?: OramaClient; + "clientInstance"?: OramaClient | AnyOrama; "colorScheme"?: ColorScheme; "disableChat"?: boolean; "facetProperty"?: string; diff --git a/packages/ui-stencil/src/components/orama-chat-box/orama-chat-box.tsx b/packages/ui-stencil/src/components/orama-chat-box/orama-chat-box.tsx index 13bd814..eea8377 100644 --- a/packages/ui-stencil/src/components/orama-chat-box/orama-chat-box.tsx +++ b/packages/ui-stencil/src/components/orama-chat-box/orama-chat-box.tsx @@ -14,6 +14,7 @@ import type { } from '@/types' import type { OramaClient } from '@oramacloud/client' import '@phosphor-icons/webcomponents/dist/icons/PhArrowClockwise.mjs' +import type { AnyOrama, Orama } from "@orama/orama" @Component({ tag: 'orama-chat-box', @@ -23,7 +24,7 @@ import '@phosphor-icons/webcomponents/dist/icons/PhArrowClockwise.mjs' export class ChatBox { @Element() el: HTMLElement @Prop() index?: CloudIndexConfig - @Prop() clientInstance?: OramaClient + @Prop() clientInstance?: OramaClient | AnyOrama @Prop() sourceBaseUrl?: string @Prop() linksTarget?: string @Prop() linksRel?: string @@ -36,7 +37,6 @@ export class ChatBox { @Prop() chatMarkdownLinkHref?: ChatMarkdownLinkHref @Prop() chatMarkdownLinkTarget?: ChatMarkdownLinkTarget - @State() oramaClient: OramaClient @State() componentID = generateRandomID('chat-box') /** @@ -66,9 +66,9 @@ export class ChatBox { startChatService() { validateCloudIndexConfig(this.el, this.index, this.clientInstance) - this.oramaClient = this.clientInstance || initOramaClient(this.index) + const oramaClient = this.clientInstance || initOramaClient(this.index) - chatContext.chatService = new ChatService(this.oramaClient) + chatContext.chatService = new ChatService(oramaClient) } render() { diff --git a/packages/ui-stencil/src/components/orama-chat-box/readme.md b/packages/ui-stencil/src/components/orama-chat-box/readme.md index 23a2982..a992c6c 100644 --- a/packages/ui-stencil/src/components/orama-chat-box/readme.md +++ b/packages/ui-stencil/src/components/orama-chat-box/readme.md @@ -1,27 +1,25 @@ # orama-chat-box - - ## Properties -| Property | Attribute | Description | Type | Default | -| ------------------------ | ----------------- | ----------- | ------------------------------------------------------------- | ----------- | -| `autoFocus` | `auto-focus` | | `boolean` | `true` | -| `chatMarkdownLinkHref` | -- | | `({ text, href }: { text: string; href: string; }) => string` | `undefined` | -| `chatMarkdownLinkTarget` | -- | | `({ text, href }: { text: string; href: string; }) => string` | `undefined` | -| `chatMarkdownLinkTitle` | -- | | `({ text, href }: { text: string; href: string; }) => string` | `undefined` | -| `clientInstance` | -- | | `OramaClient` | `undefined` | -| `index` | -- | | `{ api_key: string; endpoint: string; }` | `undefined` | -| `linksRel` | `links-rel` | | `string` | `undefined` | -| `linksTarget` | `links-target` | | `string` | `undefined` | -| `placeholder` | `placeholder` | | `string` | `undefined` | -| `sourceBaseUrl` | `source-base-url` | | `string` | `undefined` | -| `sourcesMap` | -- | | `{ title?: string; path?: string; description?: string; }` | `undefined` | -| `suggestions` | -- | | `string[]` | `undefined` | -| `systemPrompts` | -- | | `string[]` | `undefined` | +| Property | Attribute | Description | Type | Default | +| ------------------------ | ----------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- | +| `autoFocus` | `auto-focus` | | `boolean` | `true` | +| `chatMarkdownLinkHref` | -- | | `({ text, href }: { text: string; href: string; }) => string` | `undefined` | +| `chatMarkdownLinkTarget` | -- | | `({ text, href }: { text: string; href: string; }) => string` | `undefined` | +| `chatMarkdownLinkTitle` | -- | | `({ text, href }: { text: string; href: string; }) => string` | `undefined` | +| `clientInstance` | -- | | `FunctionComponents & Internals & ArrayCallbackComponents & OramaID & { plugins: OramaPlugin[]; } \| OramaClient` | `undefined` | +| `index` | -- | | `{ api_key: string; endpoint: string; }` | `undefined` | +| `linksRel` | `links-rel` | | `string` | `undefined` | +| `linksTarget` | `links-target` | | `string` | `undefined` | +| `placeholder` | `placeholder` | | `string` | `undefined` | +| `sourceBaseUrl` | `source-base-url` | | `string` | `undefined` | +| `sourcesMap` | -- | | `{ title?: string; path?: string; description?: string; }` | `undefined` | +| `suggestions` | -- | | `string[]` | `undefined` | +| `systemPrompts` | -- | | `string[]` | `undefined` | ## Events diff --git a/packages/ui-stencil/src/components/orama-search-box/orama-search-box.tsx b/packages/ui-stencil/src/components/orama-search-box/orama-search-box.tsx index 9582daf..027a728 100644 --- a/packages/ui-stencil/src/components/orama-search-box/orama-search-box.tsx +++ b/packages/ui-stencil/src/components/orama-search-box/orama-search-box.tsx @@ -25,6 +25,9 @@ import type { } from '@/types' import type { TThemeOverrides } from '@/config/theme' +// TODO: AI components should be lazyly loaded. In case of Disable AI flag, it should not be loaded at all +// https://linear.app/oramasearch/issue/ORM-1824/ai-components-should-be-lazyly-loaded-in-case-of-disable-ai-flag-they + @Component({ tag: 'orama-search-box', styleUrl: 'orama-search-box.scss', @@ -36,7 +39,7 @@ export class SearchBox { @Prop() themeConfig?: Partial @Prop() colorScheme?: ColorScheme = 'light' @Prop() index?: CloudIndexConfig - @Prop() clientInstance?: OramaClient + @Prop() clientInstance?: OramaClient | AnyOrama @Prop({ mutable: true }) open = false @Prop() facetProperty?: string @Prop() resultMap?: Partial = {} @@ -59,7 +62,6 @@ export class SearchBox { @Prop() chatMarkdownLinkHref?: ChatMarkdownLinkHref @Prop() chatMarkdownLinkTarget?: ChatMarkdownLinkTarget - @State() oramaClient: OramaClient @State() componentID = generateRandomID('search-box') @State() systemScheme: Omit = 'light' @State() windowWidth: number @@ -93,6 +95,7 @@ export class SearchBox { schemaQuery: MediaQueryList @Watch('index') + @Watch('clientInstance') indexChanged() { this.startServices() } @@ -171,10 +174,10 @@ export class SearchBox { startServices() { validateCloudIndexConfig(this.htmlElement, this.index, this.clientInstance) - this.oramaClient = this.clientInstance ? this.clientInstance : initOramaClient(this.index) + const oramaClient = this.clientInstance ? this.clientInstance : initOramaClient(this.index) - searchState.searchService = new SearchService(this.oramaClient) - chatContext.chatService = new ChatService(this.oramaClient) + searchState.searchService = new SearchService(oramaClient) + chatContext.chatService = new ChatService(oramaClient) } componentWillLoad() { diff --git a/packages/ui-stencil/src/components/orama-search-box/readme.md b/packages/ui-stencil/src/components/orama-search-box/readme.md index eacec9f..4dd6262 100644 --- a/packages/ui-stencil/src/components/orama-search-box/readme.md +++ b/packages/ui-stencil/src/components/orama-search-box/readme.md @@ -11,7 +11,7 @@ | `chatMarkdownLinkTarget` | -- | | `({ text, href }: { text: string; href: string; }) => string` | `undefined` | | `chatMarkdownLinkTitle` | -- | | `({ text, href }: { text: string; href: string; }) => string` | `undefined` | | `chatPlaceholder` | `chat-placeholder` | | `string` | `undefined` | -| `clientInstance` | -- | | `OramaClient` | `undefined` | +| `clientInstance` | -- | | `FunctionComponents & Internals & ArrayCallbackComponents & OramaID & { plugins: OramaPlugin[]; } \| OramaClient` | `undefined` | | `colorScheme` | `color-scheme` | | `"dark" \| "light" \| "system"` | `'light'` | | `disableChat` | `disable-chat` | | `boolean` | `false` | | `facetProperty` | `facet-property` | | `string` | `undefined` | diff --git a/packages/ui-stencil/src/services/ChatService.ts b/packages/ui-stencil/src/services/ChatService.ts index e0b6b73..da06370 100644 --- a/packages/ui-stencil/src/services/ChatService.ts +++ b/packages/ui-stencil/src/services/ChatService.ts @@ -1,14 +1,18 @@ -import type { OramaClient, AnswerSession, AskParams } from '@oramacloud/client' +import type { AskParams } from '@oramacloud/client' +import type { AnswerSession as OSSAnswerSession } from '@orama/orama' +import type { AnswerSession as CloudAnswerSession } from '@oramacloud/client' +import type { OramaSwitchClient } from '@orama/switch' +import { Switch } from '@orama/switch' import { OramaClientNotInitializedError } from '@/erros/OramaClientNotInitialized' import { chatContext, TAnswerStatus } from '@/context/chatContext' import type { OnAnswerGeneratedCallbackProps } from '@/types' export class ChatService { - oramaClient: OramaClient - answerSession: AnswerSession + oramaClient: Switch + answerSession: CloudAnswerSession | OSSAnswerSession - constructor(oramaClient: OramaClient) { - this.oramaClient = oramaClient + constructor(oramaClient: OramaSwitchClient) { + this.oramaClient = new Switch(oramaClient) } sendQuestion = ( @@ -45,6 +49,7 @@ export class ChatService { chatContext.interactions = normalizedState.map((interaction, index) => { const isLatest = state.length - 1 === index let answerStatus = TAnswerStatus.loading + let sources = [] if (interaction.aborted) { answerStatus = TAnswerStatus.aborted @@ -57,7 +62,15 @@ export class ChatService { } // biome-ignore lint/suspicious/noExplicitAny: Client should expose this type - const sources = (interaction.sources as any)?.map((source) => source.document) + /** + * we usually expected to receive interaction.sources as an array, but sometimes it comes as an object. + * need to check OSS Orama and fix it if it's a bug. + **/ + if (interaction.sources) { + sources = Array.isArray(interaction.sources) ? + (interaction.sources as any)?.map((source) => source.document) : + (interaction.sources.hits as any)?.map((source) => source.document) + } if (isLatest && answerStatus === TAnswerStatus.done) { callbacks?.onAnswerGeneratedCallback?.({ @@ -84,8 +97,8 @@ export class ChatService { }, }) - if (systemPrompts) { - this.answerSession.setSystemPromptConfiguration({ systemPrompts }) + if (this.oramaClient.clientType === 'cloud' && systemPrompts) { + (this.answerSession as CloudAnswerSession).setSystemPromptConfiguration({ systemPrompts }) } } diff --git a/packages/ui-stencil/src/services/SearchService.ts b/packages/ui-stencil/src/services/SearchService.ts index 88ab352..cbbff5b 100644 --- a/packages/ui-stencil/src/services/SearchService.ts +++ b/packages/ui-stencil/src/services/SearchService.ts @@ -1,6 +1,7 @@ -import type { OramaClient, ClientSearchParams } from '@oramacloud/client' +import type { ClientSearchParams } from '@oramacloud/client' import { OramaClientNotInitializedError } from '@/erros/OramaClientNotInitialized' import { searchState } from '@/context/searchContext' +import { Switch, type OramaSwitchClient } from '@orama/switch' import type { OnSearchCompletedCallbackProps, ResultMap, @@ -13,14 +14,15 @@ import type { const LIMIT_RESULTS = 10 // TODO: Orama Client should expose Result type -type OramaHit = { id: string; score: number; document: { title: string; description: string; path: string } } +// biome-ignore lint/suspicious/noExplicitAny: There is not way to type document as we only know what it is in runtime +type OramaHit = { id: string; score: number; document: any } export class SearchService { private abortController: AbortController - private oramaClient: OramaClient + private oramaClient: Switch - constructor(oramaClient: OramaClient) { - this.oramaClient = oramaClient + constructor(oramaClient: OramaSwitchClient) { + this.oramaClient = new Switch(oramaClient) this.abortController = new AbortController() } diff --git a/packages/ui-stencil/src/utils/utils.ts b/packages/ui-stencil/src/utils/utils.ts index 829cc85..3fdead5 100644 --- a/packages/ui-stencil/src/utils/utils.ts +++ b/packages/ui-stencil/src/utils/utils.ts @@ -1,4 +1,6 @@ import type { CloudIndexConfig } from '@/types' +import type { AnyOrama, Orama } from '@orama/orama' +import { Switch } from '@orama/switch' import { OramaClient } from '@oramacloud/client' /** @@ -72,7 +74,11 @@ export function getNonExplicitAttributes(element: HTMLElement, explicitProps: st }, {}) } -export function validateCloudIndexConfig(el: HTMLElement, index?: CloudIndexConfig, instance?: OramaClient): void { +export function validateCloudIndexConfig( + el: HTMLElement, + index?: CloudIndexConfig, + instance?: OramaClient | AnyOrama, +): void { const componentDetails = ` Component: ${el.tagName.toLowerCase()} Id: ${el.id} @@ -85,8 +91,10 @@ export function validateCloudIndexConfig(el: HTMLElement, index?: CloudIndexConf } if (instance && !index) { + const oramaInstance = new Switch(instance) + // TODO: maybe add a validate method to the client? - instance + oramaInstance .search({ term: 'test', }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 44555ef..dc3b1ac 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -111,6 +111,9 @@ importers: '@orama/react-components': specifier: workspace:* version: link:../../packages/ui-stencil-react + '@oramacloud/client': + specifier: ^2.1.4 + version: 2.1.4 react: specifier: ^18.3.1 version: 18.3.1 @@ -177,8 +180,8 @@ importers: specifier: workspace:* version: link:../../packages/ui-stencil '@oramacloud/client': - specifier: 1.3.15 - version: 1.3.15(encoding@0.1.13)(typescript@5.5.2) + specifier: ^2.1.0 + version: 2.1.4 '@storybook/preview-api': specifier: ^8.2.9 version: 8.2.9(storybook@8.2.4(@babel/preset-env@7.24.7(@babel/core@7.24.7))) @@ -282,11 +285,14 @@ importers: specifier: ^0.1.6 version: 0.1.6 '@orama/orama': - specifier: ^2.0.23 - version: 2.0.23 + specifier: ^3.0.0 + version: 3.0.1 + '@orama/switch': + specifier: ^3.0.0 + version: 3.0.2(@orama/orama@3.0.1)(@oramacloud/client@2.1.4) '@oramacloud/client': specifier: ^2.1.0 - version: 2.1.0 + version: 2.1.4 '@phosphor-icons/webcomponents': specifier: ^2.1.5 version: 2.1.5 @@ -2903,14 +2909,14 @@ packages: resolution: {integrity: sha512-18hl0MiCLmumODHjrLzSdTb1Ny3Dh8tn44jwgx0LksCdvVAsr3jQvfr+hwrE7bVkap0wPELb/dnuJjvupKxheQ==} engines: {node: '>= 16.0.0'} - '@oramacloud/client@1.3.15': - resolution: {integrity: sha512-QBgQrK0WA9pPzeVh/E6p44erwL0IJaHB3TrbEAsrduqbj38xY06jjpYsn//2fJt34jEnIBjOwPkjZ3OJEJlR4A==} - - '@oramacloud/client@2.1.0': - resolution: {integrity: sha512-P8vi8E3e/lkt9pVPbHkM7gK9l3/iB5BpQqpio0Ej3LMxNTv5SNsByThM+gMzfPsCsczva6WK6FN2wOtyzqVSfw==} + '@orama/switch@3.0.2': + resolution: {integrity: sha512-ui59rKC67rqF5rg6ncQhHCl11LDw4WZJfhsqJ2UHxxsh3S5F7LsT3a8/5MZDGKkFtj3IVqIRKF+pi0flMJxuTQ==} + peerDependencies: + '@orama/orama': 3.0.2 + '@oramacloud/client': ^2.1.1 - '@paralleldrive/cuid2@2.2.2': - resolution: {integrity: sha512-ZOBkgDwEdoYVlSeRbYYXs0S9MejQofiVYoTbKzy/6GQa39/q5tQU2IX46+shYnUkpEl3wc+J6wRlar7r2EK2xA==} + '@oramacloud/client@2.1.4': + resolution: {integrity: sha512-uNPFs4wq/iOPbggCwTkVNbIr64Vfd7ZS/h+cricXVnzXWocjDTfJ3wLL4lr0qiSu41g8z+eCAGBqJ30RO2O4AA==} '@phosphor-icons/webcomponents@2.1.5': resolution: {integrity: sha512-JcvQkZxvcX2jK+QCclm8+e8HXqtdFW9xV4/kk2aL9Y3dJA2oQVt+pzbv1orkumz3rfx4K9mn9fDoMr1He1yr7Q==} @@ -3802,9 +3808,6 @@ packages: '@types/minimatch@5.1.2': resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==} - '@types/node-fetch@2.6.11': - resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==} - '@types/node-forge@1.3.11': resolution: {integrity: sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ==} @@ -4197,10 +4200,6 @@ packages: resolution: {integrity: sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==} engines: {node: '>= 14'} - agentkeepalive@4.5.0: - resolution: {integrity: sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==} - engines: {node: '>= 8.0.0'} - aggregate-error@3.1.0: resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} engines: {node: '>=8'} @@ -5956,17 +5955,10 @@ packages: typescript: '>3.6.0' webpack: ^5.11.0 - form-data-encoder@1.7.2: - resolution: {integrity: sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==} - form-data@4.0.0: resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} engines: {node: '>= 6'} - formdata-node@4.4.1: - resolution: {integrity: sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==} - engines: {node: '>= 12.20'} - forwarded@0.2.0: resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} engines: {node: '>= 0.6'} @@ -6340,9 +6332,6 @@ packages: resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} engines: {node: '>=16.17.0'} - humanize-ms@1.2.1: - resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==} - hyperdyperid@1.2.0: resolution: {integrity: sha512-Y93lCzHYgGWdrJ66yIktxiaGULYc6oGiABxhcO5AufBeOyoIdZF7bIfLaOrbM0iGIOXQQgxxRrFEnb+Y6w1n4A==} engines: {node: '>=10.18'} @@ -7609,10 +7598,6 @@ packages: resolution: {integrity: sha512-tmPX422rYgofd4epzrNoOXiE8XFZYOcCq1vD7MAXCDO+O+zndlA2ztdKKMa+EeuBG5tHETpr4ml4RGgpqDCCAg==} engines: {node: '>= 0.10.5'} - node-domexception@1.0.0: - resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} - engines: {node: '>=10.5.0'} - node-fetch-native@1.6.4: resolution: {integrity: sha512-IhOigYzAKHd244OC0JIMIUrjzctirCmPkaIfhDeGcEETWof5zKYUW7e7MYvChGWh/4CJeXEgsRyGzuF334rOOQ==} @@ -7819,10 +7804,6 @@ packages: resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==} engines: {node: '>=12'} - openai@4.52.3: - resolution: {integrity: sha512-IyQLYKGYoEEkUCEm2frPzwHDJ3Ym663KtivnY6pWCzuoi6/HgSIMMxpcuTRS81GH6tiULPYGmTxIvzXdmPIWOw==} - hasBin: true - optionator@0.9.4: resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} @@ -10255,14 +10236,6 @@ packages: weak-lru-cache@1.2.2: resolution: {integrity: sha512-DEAoo25RfSYMuTGc9vPJzZcZullwIqRDSI9LOy+fkCJPi6hykCnfKaXTuPBDuXAUcqHXyOgFtHNp/kB2FjYHbw==} - web-streams-polyfill@3.3.3: - resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==} - engines: {node: '>= 8'} - - web-streams-polyfill@4.0.0-beta.3: - resolution: {integrity: sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==} - engines: {node: '>= 14'} - webidl-conversions@3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} @@ -13665,28 +13638,17 @@ snapshots: '@orama/orama@3.0.1': {} - '@oramacloud/client@1.3.15(encoding@0.1.13)(typescript@5.5.2)': + '@orama/switch@3.0.2(@orama/orama@3.0.1)(@oramacloud/client@2.1.4)': dependencies: - '@orama/orama': 2.0.23 - '@paralleldrive/cuid2': 2.2.2 - lodash: 4.17.21 - openai: 4.52.3(encoding@0.1.13) - react: 18.3.1 - vue: 3.4.30(typescript@5.5.2) - transitivePeerDependencies: - - encoding - - typescript + '@orama/orama': 3.0.1 + '@oramacloud/client': 2.1.4 - '@oramacloud/client@2.1.0': + '@oramacloud/client@2.1.4': dependencies: '@orama/cuid2': 2.2.3 '@orama/orama': 3.0.1 lodash: 4.17.21 - '@paralleldrive/cuid2@2.2.2': - dependencies: - '@noble/hashes': 1.4.0 - '@phosphor-icons/webcomponents@2.1.5': dependencies: lit: 3.1.4 @@ -14883,11 +14845,6 @@ snapshots: '@types/minimatch@5.1.2': {} - '@types/node-fetch@2.6.11': - dependencies: - '@types/node': 20.14.9 - form-data: 4.0.0 - '@types/node-forge@1.3.11': dependencies: '@types/node': 20.14.9 @@ -15397,10 +15354,6 @@ snapshots: transitivePeerDependencies: - supports-color - agentkeepalive@4.5.0: - dependencies: - humanize-ms: 1.2.1 - aggregate-error@3.1.0: dependencies: clean-stack: 2.2.0 @@ -17242,7 +17195,7 @@ snapshots: debug: 4.3.5 enhanced-resolve: 5.17.0 eslint: 9.5.0 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@9.5.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@9.5.0))(eslint@9.5.0) eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.5.2))(eslint-import-resolver-typescript@3.6.1)(eslint@9.5.0) fast-glob: 3.3.2 get-tsconfig: 4.7.5 @@ -17254,7 +17207,7 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.8.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@9.5.0): + eslint-module-utils@2.8.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@9.5.0))(eslint@9.5.0): dependencies: debug: 3.2.7 optionalDependencies: @@ -17279,7 +17232,7 @@ snapshots: doctrine: 2.1.0 eslint: 9.5.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@9.5.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@9.5.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@9.5.0))(eslint@9.5.0) hasown: 2.0.2 is-core-module: 2.14.0 is-glob: 4.0.3 @@ -17738,19 +17691,12 @@ snapshots: typescript: 5.5.2 webpack: 5.92.1(@swc/core@1.6.5(@swc/helpers@0.5.5))(esbuild@0.21.5) - form-data-encoder@1.7.2: {} - form-data@4.0.0: dependencies: asynckit: 0.4.0 combined-stream: 1.0.8 mime-types: 2.1.35 - formdata-node@4.4.1: - dependencies: - node-domexception: 1.0.0 - web-streams-polyfill: 4.0.0-beta.3 - forwarded@0.2.0: {} fraction.js@4.3.7: {} @@ -18225,10 +18171,6 @@ snapshots: human-signals@5.0.0: {} - humanize-ms@1.2.1: - dependencies: - ms: 2.1.3 - hyperdyperid@1.2.0: {} iconv-lite@0.4.24: @@ -19826,8 +19768,6 @@ snapshots: dependencies: minimatch: 3.1.2 - node-domexception@1.0.0: {} - node-fetch-native@1.6.4: {} node-fetch@2.7.0(encoding@0.1.13): @@ -20118,19 +20058,6 @@ snapshots: is-docker: 2.2.1 is-wsl: 2.2.0 - openai@4.52.3(encoding@0.1.13): - dependencies: - '@types/node': 18.19.39 - '@types/node-fetch': 2.6.11 - abort-controller: 3.0.0 - agentkeepalive: 4.5.0 - form-data-encoder: 1.7.2 - formdata-node: 4.4.1 - node-fetch: 2.7.0(encoding@0.1.13) - web-streams-polyfill: 3.3.3 - transitivePeerDependencies: - - encoding - optionator@0.9.4: dependencies: deep-is: 0.1.4 @@ -22927,10 +22854,6 @@ snapshots: weak-lru-cache@1.2.2: {} - web-streams-polyfill@3.3.3: {} - - web-streams-polyfill@4.0.0-beta.3: {} - webidl-conversions@3.0.1: {} webidl-conversions@4.0.2: {}