@rimori/client 2.5.6 → 2.5.7

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.
@@ -18,6 +18,10 @@ export interface Language {
18
18
  }
19
19
  export type UserRole = 'user' | 'plugin_moderator' | 'lang_moderator' | 'admin';
20
20
  export interface UserInfo {
21
+ /**
22
+ * The user's unique ID
23
+ */
24
+ user_id: string;
21
25
  skill_level_reading: LanguageLevel;
22
26
  skill_level_writing: LanguageLevel;
23
27
  skill_level_grammar: LanguageLevel;
@@ -38,6 +38,7 @@ export declare class SharedContentController {
38
38
  * @param params.customFields - Custom field values for AI-generated content (e.g., {topic_category: "history"})
39
39
  * @param params.skipDbSave - If true, don't save generated content to database
40
40
  * @param params.isPrivate - If true, content is guild-specific
41
+ * @param params.ignoreSkillLevel - If true, don't filter by skill level or add skill level guidance to AI instructions
41
42
  * @returns Existing or newly generated shared content item
42
43
  */
43
44
  getNew<T>(params: {
@@ -52,6 +53,7 @@ export declare class SharedContentController {
52
53
  tool?: ObjectTool;
53
54
  skipDbSave?: boolean;
54
55
  isPrivate?: boolean;
56
+ ignoreSkillLevel?: boolean;
55
57
  }): Promise<SharedContent<T>>;
56
58
  /**
57
59
  * Search for shared content by topic using RAG (semantic similarity).
@@ -116,6 +118,13 @@ export declare class SharedContentController {
116
118
  * @returns The shared content item
117
119
  */
118
120
  get<T = any>(tableName: string, contentId: string): Promise<SharedContent<T>>;
121
+ /**
122
+ * Fetch all shared content items.
123
+ * @param tableName - Name of the shared content table
124
+ * @param limit - Maximum number of results (default: 100)
125
+ * @returns Array of all shared content items
126
+ */
127
+ getAll<T = any>(tableName: string, limit?: number): Promise<SharedContent<T>[]>;
119
128
  /**
120
129
  * Create new shared content manually.
121
130
  * @param tableName - Name of the shared content table
@@ -26,6 +26,7 @@ export class SharedContentController {
26
26
  * @param params.customFields - Custom field values for AI-generated content (e.g., {topic_category: "history"})
27
27
  * @param params.skipDbSave - If true, don't save generated content to database
28
28
  * @param params.isPrivate - If true, content is guild-specific
29
+ * @param params.ignoreSkillLevel - If true, don't filter by skill level or add skill level guidance to AI instructions
29
30
  * @returns Existing or newly generated shared content item
30
31
  */
31
32
  getNew(params) {
@@ -44,6 +45,7 @@ export class SharedContentController {
44
45
  options: {
45
46
  skipDbSave: params.skipDbSave,
46
47
  isPrivate: params.isPrivate,
48
+ ignoreSkillLevel: params.ignoreSkillLevel,
47
49
  },
48
50
  }),
49
51
  });
@@ -246,6 +248,23 @@ export class SharedContentController {
246
248
  return data;
247
249
  });
248
250
  }
251
+ /**
252
+ * Fetch all shared content items.
253
+ * @param tableName - Name of the shared content table
254
+ * @param limit - Maximum number of results (default: 100)
255
+ * @returns Array of all shared content items
256
+ */
257
+ getAll(tableName_1) {
258
+ return __awaiter(this, arguments, void 0, function* (tableName, limit = 100) {
259
+ const fullTableName = this.getTableName(tableName);
260
+ const { data, error } = yield this.supabase.from(fullTableName).select('*').limit(limit);
261
+ if (error) {
262
+ console.error('Error fetching all shared content:', error);
263
+ throw new Error('Error fetching all shared content');
264
+ }
265
+ return (data || []);
266
+ });
267
+ }
249
268
  /**
250
269
  * Create new shared content manually.
251
270
  * @param tableName - Name of the shared content table
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rimori/client",
3
- "version": "2.5.6",
3
+ "version": "2.5.7",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": {