Skip to content

Commit

Permalink
feat: using latest sdk
Browse files Browse the repository at this point in the history
- also switched to using values to get markdown content
  • Loading branch information
Benj0s committed Jun 10, 2024
1 parent 0b25941 commit 44353fe
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"homepage": "./",
"dependencies": {
"@amplience/content-studio-sdk": "^0.0.81",
"@amplience/content-studio-sdk": "0.1.1",
"@datadog/browser-rum": "^4.43.0",
"@dc-extension-rich-text/common": "0.1.0",
"@dc-extension-rich-text/language-json": "0.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { fetchEventSource } from "@microsoft/fetch-event-source";
import React from "react";
import { AIConfiguration } from "../AIPromptDialog";
import { track } from "../gainsight";
import { AmplienceContentStudio } from "@amplience/content-studio-sdk";
import { AmplienceContentStudio } from '@amplience/content-studio-sdk';

interface ChatModel {
name: string;
Expand Down Expand Up @@ -509,9 +509,8 @@ Do not converse with the user.
"https://app.amplience.net/content-studio",
});

const content = await studio.getContent();
const textFields = Object.keys(content.data)
.map((x) => content.data[x])
const { content } = await studio.getContent();
const textFields = Object.values(content)
.filter((x) => typeof x === "string") as string[];

if (textFields.length > 0) {
Expand Down
1 change: 1 addition & 0 deletions packages/extension/src/content-studio-sdk.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module '@amplience/content-studio-sdk'
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# yarn lockfile v1


"@amplience/content-studio-sdk@^0.0.81":
version "0.0.81"
resolved "https://npm.pkg.github.com/download/@amplience/content-studio-sdk/0.0.81/a4fe6e0826154082c6d957a81f41caf073fcdb36#a4fe6e0826154082c6d957a81f41caf073fcdb36"
integrity sha512-6tPfBiJSVqWeKtVyX8k4+EF4dI/1CN+sJnthvBnS5pWfk3w+9yELG1z7U4fvBw823skwR18mVHdy8+yH3XmPsA==
"@amplience/content-studio-sdk@0.1.1":
version "0.1.1"
resolved "https://npm.pkg.github.com/download/@amplience/content-studio-sdk/0.1.1/06a6a639351e94c82636775b1c1236d39136ddff#06a6a639351e94c82636775b1c1236d39136ddff"
integrity sha512-5I2fWK9sTm7ZhpBfMUZ3K3pRR7IdadR2DG9ZCWrZ7jM5QmVsj2lutlL4bLC1kZUCp7AUFxapBpoIE1bskJ3Nag==
dependencies:
message-event-channel "^1.1.0"

Expand Down Expand Up @@ -11164,7 +11164,7 @@ merge2@^1.2.3:

message-event-channel@^1.1.0:
version "1.1.0"
resolved "https://registry.npmjs.org/message-event-channel/-/message-event-channel-1.1.0.tgz"
resolved "https://registry.yarnpkg.com/message-event-channel/-/message-event-channel-1.1.0.tgz#8ff5798228432efd692f9f8fd3f749f35185c367"
integrity sha512-/6tBIQr8xmGiTkQZbLwiIxdsG21VcykYryk08cEdJdphEPYYCwi9ur/jSDfbQ6fY1urqo8TDZQ7dr7xJOrCqqw==
dependencies:
url-polyfill "^1.1.7"
Expand Down Expand Up @@ -16749,9 +16749,9 @@ url-parse@^1.4.3:
requires-port "^1.0.0"

url-polyfill@^1.1.7:
version "1.1.10"
resolved "https://registry.npmjs.org/url-polyfill/-/url-polyfill-1.1.10.tgz"
integrity sha512-vSaPpaRgBrf41+Uky1myiSh6gpcbw8FpwHYnEy0abxndojOBnIs+yh/49gKYFLtUMP9qoNWjn6j9aUVy23Ie2A==
version "1.1.12"
resolved "https://registry.yarnpkg.com/url-polyfill/-/url-polyfill-1.1.12.tgz#6cdaa17f6b022841b3aec0bf8dbd87ac0cd33331"
integrity sha512-mYFmBHCapZjtcNHW0MDq9967t+z4Dmg5CJ0KqysK3+ZbyoNOWQHksGCTWwDhxGXllkWlOc10Xfko6v4a3ucM6A==

url@^0.11.0:
version "0.11.0"
Expand Down

0 comments on commit 44353fe

Please sign in to comment.