@rimori/client 1.1.4 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -67,6 +67,24 @@ export default {
|
|
|
67
67
|
}
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
+
### Vite Configuration
|
|
71
|
+
|
|
72
|
+
Add the following to your `vite.config.ts`:
|
|
73
|
+
|
|
74
|
+
```javascript
|
|
75
|
+
import { defineConfig } from 'vite'
|
|
76
|
+
import react from '@vitejs/plugin-react'
|
|
77
|
+
|
|
78
|
+
export default defineConfig({
|
|
79
|
+
plugins: [react()],
|
|
80
|
+
base: './', // Set base path for proper asset loading
|
|
81
|
+
build: {
|
|
82
|
+
outDir: 'dist',
|
|
83
|
+
assetsDir: 'assets'
|
|
84
|
+
}
|
|
85
|
+
})
|
|
86
|
+
```
|
|
87
|
+
|
|
70
88
|
## Core API - usePlugin Hook
|
|
71
89
|
|
|
72
90
|
The `usePlugin()` hook is the main interface for accessing Rimori platform features:
|
|
@@ -558,6 +576,7 @@ community.sharedContent.getList<T>(contentType: string, filter?: SharedContentFi
|
|
|
558
576
|
community.sharedContent.getNew<T>(contentType: string, instructions: SharedContentObjectRequest, filter?: SharedContentFilter, privateTopic?: boolean): Promise<BasicAssignment<T>>
|
|
559
577
|
community.sharedContent.create<T>(content: SharedContent<T>): Promise<BasicAssignment<T>>
|
|
560
578
|
community.sharedContent.update<T>(id: string, content: Partial<SharedContent<T>>): Promise<BasicAssignment<T>>
|
|
579
|
+
community.sharedContent.delete(id: string): Promise<BasicAssignment<any>>
|
|
561
580
|
community.sharedContent.complete(contentType: string, assignmentId: string): Promise<void>
|
|
562
581
|
```
|
|
563
582
|
|
|
@@ -859,7 +878,7 @@ interface MyPluginData extends SharedContent<any> {
|
|
|
859
878
|
|
|
860
879
|
The SharedContent has this type definition:
|
|
861
880
|
|
|
862
|
-
|
|
881
|
+
```
|
|
863
882
|
export interface SharedContent<T> {
|
|
864
883
|
/** The type/category of the content (e.g. 'grammar_exercises', 'flashcards', etc.) */
|
|
865
884
|
contentType: string;
|
|
@@ -996,4 +1015,3 @@ export default App;
|
|
|
996
1015
|
|
|
997
1016
|
## License
|
|
998
1017
|
|
|
999
|
-
MIT License - see LICENSE file for details.
|
|
@@ -17,7 +17,13 @@ export class StandaloneClient {
|
|
|
17
17
|
static getInstance() {
|
|
18
18
|
return __awaiter(this, void 0, void 0, function* () {
|
|
19
19
|
if (!StandaloneClient.instance) {
|
|
20
|
-
const config = yield fetch("http://localhost:3000/config.json").then(res => res.json())
|
|
20
|
+
const config = yield fetch("http://localhost:3000/config.json").then(res => res.json()).catch(err => {
|
|
21
|
+
console.error("Error fetching config.json", err);
|
|
22
|
+
return {
|
|
23
|
+
SUPABASE_URL: "https://pheptqdoqsdnadgoihvr.supabase.co",
|
|
24
|
+
SUPABASE_ANON_KEY: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InBoZXB0cWRvcXNkbmFkZ29paHZyIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MzE2OTY2ODcsImV4cCI6MjA0NzI3MjY4N30.4GPFAXTF8685FaXISdAPNCIM-H3RGLo8GbyhQpu1mP0",
|
|
25
|
+
};
|
|
26
|
+
});
|
|
21
27
|
StandaloneClient.instance = new StandaloneClient({ url: config.SUPABASE_URL, key: config.SUPABASE_ANON_KEY });
|
|
22
28
|
}
|
|
23
29
|
return StandaloneClient.instance;
|
package/package.json
CHANGED
|
@@ -18,7 +18,13 @@ export class StandaloneClient {
|
|
|
18
18
|
|
|
19
19
|
public static async getInstance(): Promise<StandaloneClient> {
|
|
20
20
|
if (!StandaloneClient.instance) {
|
|
21
|
-
const config = await fetch("http://localhost:3000/config.json").then(res => res.json())
|
|
21
|
+
const config = await fetch("http://localhost:3000/config.json").then(res => res.json()).catch(err => {
|
|
22
|
+
console.error("Error fetching config.json", err);
|
|
23
|
+
return {
|
|
24
|
+
SUPABASE_URL: "https://pheptqdoqsdnadgoihvr.supabase.co",
|
|
25
|
+
SUPABASE_ANON_KEY: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InBoZXB0cWRvcXNkbmFkZ29paHZyIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MzE2OTY2ODcsImV4cCI6MjA0NzI3MjY4N30.4GPFAXTF8685FaXISdAPNCIM-H3RGLo8GbyhQpu1mP0",
|
|
26
|
+
}
|
|
27
|
+
});
|
|
22
28
|
StandaloneClient.instance = new StandaloneClient({ url: config.SUPABASE_URL, key: config.SUPABASE_ANON_KEY });
|
|
23
29
|
}
|
|
24
30
|
return StandaloneClient.instance;
|