diff --git a/package-lock.json b/package-lock.json index 98e84c9..331e672 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,11 +7,13 @@ "": { "name": "luzmo-getting-started-astro", "version": "0.0.1", + "license": "MIT", "dependencies": { "@astrojs/check": "^0.9.2", "@astrojs/netlify": "^5.5.0", "@astrojs/react": "^3.6.1", "@luzmo/nodejs-sdk": "^1.3.0", + "@luzmo/react-embed": "^5.1.2-beta.4", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "astro": "^4.0.6", @@ -1901,6 +1903,51 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@lit-labs/ssr-dom-shim": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@lit-labs/ssr-dom-shim/-/ssr-dom-shim-1.2.1.tgz", + "integrity": "sha512-wx4aBmgeGvFmOKucFKY+8VFJSYZxs9poN3SDNQFF6lT6NrQUnHiPB2PWz2sc4ieEcAaYYzN+1uWahEeTq2aRIQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@lit/react": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@lit/react/-/react-1.0.4.tgz", + "integrity": "sha512-6HBvk3AwF46z17fTkZp5F7/EdCJW9xqqQgYKr3sQGgoEJv0TKV1voWydG4UQQA2RWkoD4SHjy08snSpzyoyd0w==", + "license": "BSD-3-Clause", + "peerDependencies": { + "@types/react": "17 || 18" + } + }, + "node_modules/@lit/reactive-element": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-2.0.4.tgz", + "integrity": "sha512-GFn91inaUa2oHLak8awSIigYz0cU0Payr1rcFsrkf5OJ5eSPxElyZfKh0f2p9FsTiZWXQdWGJeXZICEfXXYSXQ==", + "license": "BSD-3-Clause", + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.2.0" + } + }, + "node_modules/@luzmo/dashboard-contents-types": { + "version": "0.1.89", + "resolved": "https://registry.npmjs.org/@luzmo/dashboard-contents-types/-/dashboard-contents-types-0.1.89.tgz", + "integrity": "sha512-bkGI5RMAYEI/Nw8yqqwfDEluD1+YijVhENCUai2iajIhISpnA83a71JBa1t503qw9e/vALO0MSEeccoCIi8ZlA==", + "dependencies": { + "leaflet": "1.9.4", + "tslib": "^2.3.0" + } + }, + "node_modules/@luzmo/embed": { + "version": "6.1.2-beta.3", + "resolved": "https://registry.npmjs.org/@luzmo/embed/-/embed-6.1.2-beta.3.tgz", + "integrity": "sha512-Y/vKfDrNmOINHNHz4elaioS+nGBFw/c53oRln7lGB+6xgvYtrOg8nN4UAe2k1u1GJ+y4yYWpNmqIRnsofOykQA==", + "dependencies": { + "@luzmo/dashboard-contents-types": "0.1.89", + "@luzmo/shared-embed": "5.1.2-beta.3", + "ajv": "^8.17.1", + "ajv-formats": "^3.0.1", + "lit": "3.1.2" + } + }, "node_modules/@luzmo/nodejs-sdk": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/@luzmo/nodejs-sdk/-/nodejs-sdk-1.3.0.tgz", @@ -1910,6 +1957,27 @@ "axios": "^1.7.2" } }, + "node_modules/@luzmo/react-embed": { + "version": "5.1.2-beta.4", + "resolved": "https://registry.npmjs.org/@luzmo/react-embed/-/react-embed-5.1.2-beta.4.tgz", + "integrity": "sha512-Hu/E7J/QQrZwpfGuJ9Ymrrf6AR/p6nlhU+mwJ9R33ZGWUZFXBHAX5UJwAPjBg3L5asF94RXaCVOw+rxAcm4FPw==", + "dependencies": { + "@lit/react": "1.0.4", + "@luzmo/embed": "6.1.2-beta.3" + }, + "peerDependencies": { + "react": "^16 || ^17 || ^18", + "react-dom": "^16 || ^17 || ^18" + } + }, + "node_modules/@luzmo/shared-embed": { + "version": "5.1.2-beta.3", + "resolved": "https://registry.npmjs.org/@luzmo/shared-embed/-/shared-embed-5.1.2-beta.3.tgz", + "integrity": "sha512-B/nx7KL98vmeykdyPFjlu0IP6ILRfJCoGu9rdqns0gz60UYTcUnHCgDpy98MFXMT7dLgzQj9DVTyhSy1yGTnTQ==", + "dependencies": { + "@luzmo/dashboard-contents-types": "0.1.89" + } + }, "node_modules/@mapbox/node-pre-gyp": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", @@ -2355,6 +2423,12 @@ "@types/react": "*" } }, + "node_modules/@types/trusted-types": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", + "license": "MIT" + }, "node_modules/@types/unist": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", @@ -2564,6 +2638,39 @@ "node": ">= 6.0.0" } }, + "node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, "node_modules/ansi-align": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", @@ -3700,6 +3807,12 @@ "node": ">=0.10.0" } }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" + }, "node_modules/fast-glob": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", @@ -3716,6 +3829,12 @@ "node": ">=8.6.0" } }, + "node_modules/fast-uri": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.3.tgz", + "integrity": "sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw==", + "license": "BSD-3-Clause" + }, "node_modules/fastq": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", @@ -4535,6 +4654,12 @@ "node": ">=4" } }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" + }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", @@ -4571,6 +4696,43 @@ "node": ">=6" } }, + "node_modules/leaflet": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.9.4.tgz", + "integrity": "sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA==", + "license": "BSD-2-Clause" + }, + "node_modules/lit": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lit/-/lit-3.1.2.tgz", + "integrity": "sha512-VZx5iAyMtX7CV4K8iTLdCkMaYZ7ipjJZ0JcSdJ0zIdGxxyurjIn7yuuSxNBD7QmjvcNJwr0JS4cAdAtsy7gZ6w==", + "license": "BSD-3-Clause", + "dependencies": { + "@lit/reactive-element": "^2.0.4", + "lit-element": "^4.0.4", + "lit-html": "^3.1.2" + } + }, + "node_modules/lit-element": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lit-element/-/lit-element-4.1.1.tgz", + "integrity": "sha512-HO9Tkkh34QkTeUmEdNYhMT8hzLid7YlMlATSi1q4q17HE5d9mrrEHJ/o8O2D0cMi182zK1F3v7x0PWFjrhXFew==", + "license": "BSD-3-Clause", + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.2.0", + "@lit/reactive-element": "^2.0.4", + "lit-html": "^3.2.0" + } + }, + "node_modules/lit-html": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-3.2.1.tgz", + "integrity": "sha512-qI/3lziaPMSKsrwlxH/xMgikhQ0EGOX2ICU73Bi/YHFvz2j/yMCIrw4+puF2IpQ4+upd3EWbvnHM9+PnJn48YA==", + "license": "BSD-3-Clause", + "dependencies": { + "@types/trusted-types": "^2.0.2" + } + }, "node_modules/load-yaml-file": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/load-yaml-file/-/load-yaml-file-0.2.0.tgz", @@ -6392,6 +6554,15 @@ "node": ">=0.10.0" } }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", @@ -6977,11 +7148,10 @@ } }, "node_modules/tslib": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", - "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", - "license": "0BSD", - "optional": true + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.3.tgz", + "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==", + "license": "0BSD" }, "node_modules/type-fest": { "version": "2.19.0", diff --git a/package.json b/package.json index e2f49ee..2abae44 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "@astrojs/netlify": "^5.5.0", "@astrojs/react": "^3.6.1", "@luzmo/nodejs-sdk": "^1.3.0", + "@luzmo/react-embed": "^5.1.2-beta.4", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "astro": "^4.0.6", diff --git a/src/components/luzmo-client-component.tsx b/src/components/luzmo-client-component.tsx index c22db43..a325306 100644 --- a/src/components/luzmo-client-component.tsx +++ b/src/components/luzmo-client-component.tsx @@ -1,10 +1,23 @@ +import { LuzmoAIChatComponent } from '@luzmo/react-embed'; + interface Props { authKey: string; authToken: string; } export default function LuzmoClientComponent({ authKey, authToken }: Props) { - console.log({ authKey, authToken }); - - return
Luzmo client component
; + return ( +
+ +
+ ); } diff --git a/src/pages/index.astro b/src/pages/index.astro index 19fa489..3cbbc00 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -16,7 +16,7 @@ const response = await client.create('authorization', { access: { datasets: [ { - id: '', + id: '6f18525f-7b4f-4726-bc20-ccc4665d3091', rights: 'use', }, ], @@ -35,6 +35,6 @@ const { id, token } = response; Astro - +