@iblai/mcp 1.0.0
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 +199 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +130 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/data-layer.d.ts +8 -0
- package/dist/resources/data-layer.d.ts.map +1 -0
- package/dist/resources/data-layer.js +181 -0
- package/dist/resources/data-layer.js.map +1 -0
- package/dist/resources/guides-layout.d.ts +8 -0
- package/dist/resources/guides-layout.d.ts.map +1 -0
- package/dist/resources/guides-layout.js +235 -0
- package/dist/resources/guides-layout.js.map +1 -0
- package/dist/resources/guides-rbac.d.ts +8 -0
- package/dist/resources/guides-rbac.d.ts.map +1 -0
- package/dist/resources/guides-rbac.js +231 -0
- package/dist/resources/guides-rbac.js.map +1 -0
- package/dist/resources/guides-theme.d.ts +8 -0
- package/dist/resources/guides-theme.d.ts.map +1 -0
- package/dist/resources/guides-theme.js +183 -0
- package/dist/resources/guides-theme.js.map +1 -0
- package/dist/resources/index.d.ts +17 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +18 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/packages-overview.d.ts +8 -0
- package/dist/resources/packages-overview.d.ts.map +1 -0
- package/dist/resources/packages-overview.js +53 -0
- package/dist/resources/packages-overview.js.map +1 -0
- package/dist/resources/web-containers.d.ts +8 -0
- package/dist/resources/web-containers.d.ts.map +1 -0
- package/dist/resources/web-containers.js +122 -0
- package/dist/resources/web-containers.js.map +1 -0
- package/dist/resources/web-utils.d.ts +8 -0
- package/dist/resources/web-utils.d.ts.map +1 -0
- package/dist/resources/web-utils.js +210 -0
- package/dist/resources/web-utils.js.map +1 -0
- package/dist/tools/api-query-info.d.ts +16 -0
- package/dist/tools/api-query-info.d.ts.map +1 -0
- package/dist/tools/api-query-info.js +2398 -0
- package/dist/tools/api-query-info.js.map +1 -0
- package/dist/tools/component-info.d.ts +16 -0
- package/dist/tools/component-info.d.ts.map +1 -0
- package/dist/tools/component-info.js +1323 -0
- package/dist/tools/component-info.js.map +1 -0
- package/dist/tools/hook-info.d.ts +16 -0
- package/dist/tools/hook-info.d.ts.map +1 -0
- package/dist/tools/hook-info.js +1988 -0
- package/dist/tools/hook-info.js.map +1 -0
- package/dist/tools/index.d.ts +68 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +14 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/page-template.d.ts +28 -0
- package/dist/tools/page-template.d.ts.map +1 -0
- package/dist/tools/page-template.js +198 -0
- package/dist/tools/page-template.js.map +1 -0
- package/dist/tools/provider-setup.d.ts +24 -0
- package/dist/tools/provider-setup.d.ts.map +1 -0
- package/dist/tools/provider-setup.js +213 -0
- package/dist/tools/provider-setup.js.map +1 -0
- package/package.json +28 -0
|
@@ -0,0 +1,2398 @@
|
|
|
1
|
+
export const apiQueryInfoTool = {
|
|
2
|
+
name: 'get_api_query_info',
|
|
3
|
+
description: 'Get information about a specific RTK Query API endpoint',
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: 'object',
|
|
6
|
+
properties: {
|
|
7
|
+
queryName: {
|
|
8
|
+
type: 'string',
|
|
9
|
+
description: 'Name of the query hook (e.g., useGetMentorsQuery, useGetUserMetadataQuery)',
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
required: ['queryName'],
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
const queries = {
|
|
16
|
+
// ============================================================================
|
|
17
|
+
// MENTOR API ENDPOINTS
|
|
18
|
+
// ============================================================================
|
|
19
|
+
useGetMentorsQuery: `# useGetMentorsQuery
|
|
20
|
+
|
|
21
|
+
**Package**: \`@iblai/data-layer\`
|
|
22
|
+
**File**: \`packages/data-layer/src/features/mentor/api-slice.ts\`
|
|
23
|
+
**Feature**: Mentor Management
|
|
24
|
+
|
|
25
|
+
\`\`\`typescript
|
|
26
|
+
import { useGetMentorsQuery } from '@iblai/data-layer';
|
|
27
|
+
|
|
28
|
+
const { data, isLoading, error, refetch, isFetching } = useGetMentorsQuery({
|
|
29
|
+
org: string, // Tenant key (required)
|
|
30
|
+
page?: number, // Page number (default: 1)
|
|
31
|
+
pageSize?: number, // Items per page (default: 10)
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// Response type
|
|
35
|
+
interface MentorsResponse {
|
|
36
|
+
count: number;
|
|
37
|
+
results: Mentor[];
|
|
38
|
+
next: string | null;
|
|
39
|
+
previous: string | null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface Mentor {
|
|
43
|
+
id: number;
|
|
44
|
+
unique_id: string;
|
|
45
|
+
name: string;
|
|
46
|
+
description: string;
|
|
47
|
+
profile_image: string;
|
|
48
|
+
visibility: 'public' | 'private' | 'unlisted';
|
|
49
|
+
is_featured: boolean;
|
|
50
|
+
created_at: string;
|
|
51
|
+
updated_at: string;
|
|
52
|
+
}
|
|
53
|
+
\`\`\`
|
|
54
|
+
|
|
55
|
+
**Cache Tags**: \`['Mentors']\``,
|
|
56
|
+
useGetMentorDetailsQuery: `# useGetMentorDetailsQuery
|
|
57
|
+
|
|
58
|
+
**Package**: \`@iblai/data-layer\`
|
|
59
|
+
**File**: \`packages/data-layer/src/features/mentor/api-slice.ts\`
|
|
60
|
+
**Feature**: Mentor Management
|
|
61
|
+
|
|
62
|
+
\`\`\`typescript
|
|
63
|
+
import { useGetMentorDetailsQuery } from '@iblai/data-layer';
|
|
64
|
+
|
|
65
|
+
const { data: mentor, isLoading, error } = useGetMentorDetailsQuery({
|
|
66
|
+
org: string, // Tenant key
|
|
67
|
+
mentorId: string, // Mentor unique ID
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// Returns full mentor object with:
|
|
71
|
+
// - Basic info (name, description, profile_image)
|
|
72
|
+
// - LLM configuration (llm_provider, llm_name)
|
|
73
|
+
// - Tools configuration
|
|
74
|
+
// - Prompt settings
|
|
75
|
+
// - Visibility and access settings
|
|
76
|
+
\`\`\`
|
|
77
|
+
|
|
78
|
+
**Cache Tags**: \`['MentorDetails', mentorId]\``,
|
|
79
|
+
useGetMentorSettingsQuery: `# useGetMentorSettingsQuery
|
|
80
|
+
|
|
81
|
+
**Package**: \`@iblai/data-layer\`
|
|
82
|
+
**File**: \`packages/data-layer/src/features/mentor/api-slice.ts\`
|
|
83
|
+
**Feature**: Mentor Management
|
|
84
|
+
|
|
85
|
+
Fetches mentor settings for **authenticated users**.
|
|
86
|
+
|
|
87
|
+
\`\`\`typescript
|
|
88
|
+
import { useGetMentorSettingsQuery } from '@iblai/data-layer';
|
|
89
|
+
|
|
90
|
+
const { data: settings, isLoading } = useGetMentorSettingsQuery({
|
|
91
|
+
org: string, // Tenant key
|
|
92
|
+
mentorId: string, // Mentor unique ID
|
|
93
|
+
username: string, // Current authenticated user
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
// settings contains:
|
|
97
|
+
interface MentorSettings {
|
|
98
|
+
profile_image: string;
|
|
99
|
+
mentor_name: string;
|
|
100
|
+
greeting_method: 'proactive' | 'passive';
|
|
101
|
+
proactive_response: string;
|
|
102
|
+
llm_provider: string;
|
|
103
|
+
llm_name: string;
|
|
104
|
+
mentor_unique_id: string;
|
|
105
|
+
mentor_visibility: string;
|
|
106
|
+
enable_guided_prompts: boolean;
|
|
107
|
+
mentor_slug: string;
|
|
108
|
+
safety_disclaimer: string;
|
|
109
|
+
mentor_tools: ToolConfig[];
|
|
110
|
+
allow_anonymous: boolean;
|
|
111
|
+
}
|
|
112
|
+
\`\`\``,
|
|
113
|
+
useGetMentorPublicSettingsQuery: `# useGetMentorPublicSettingsQuery
|
|
114
|
+
|
|
115
|
+
**Package**: \`@iblai/data-layer\`
|
|
116
|
+
**File**: \`packages/data-layer/src/features/mentor/api-slice.ts\`
|
|
117
|
+
**Feature**: Mentor Management
|
|
118
|
+
|
|
119
|
+
Fetches mentor settings for **anonymous/unauthenticated users**.
|
|
120
|
+
|
|
121
|
+
\`\`\`typescript
|
|
122
|
+
import { useGetMentorPublicSettingsQuery } from '@iblai/data-layer';
|
|
123
|
+
|
|
124
|
+
const { data: settings, isLoading } = useGetMentorPublicSettingsQuery({
|
|
125
|
+
org: string, // Tenant key
|
|
126
|
+
mentorId: string, // Mentor unique ID
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
// Returns limited public-safe mentor settings
|
|
130
|
+
// Used when allowAnonymous is enabled
|
|
131
|
+
\`\`\``,
|
|
132
|
+
useCreateMentorMutation: `# useCreateMentorMutation
|
|
133
|
+
|
|
134
|
+
**Package**: \`@iblai/data-layer\`
|
|
135
|
+
**File**: \`packages/data-layer/src/features/mentor/api-slice.ts\`
|
|
136
|
+
**Feature**: Mentor Management
|
|
137
|
+
|
|
138
|
+
\`\`\`typescript
|
|
139
|
+
import { useCreateMentorMutation } from '@iblai/data-layer';
|
|
140
|
+
|
|
141
|
+
const [createMentor, { isLoading, error, isSuccess }] = useCreateMentorMutation();
|
|
142
|
+
|
|
143
|
+
const newMentor = await createMentor({
|
|
144
|
+
org: string, // Tenant key (required)
|
|
145
|
+
name: string, // Mentor name (required)
|
|
146
|
+
description?: string, // Mentor description
|
|
147
|
+
llm_provider?: string, // e.g., 'openai', 'anthropic'
|
|
148
|
+
llm_name?: string, // e.g., 'gpt-4', 'claude-3-opus'
|
|
149
|
+
system_prompt?: string, // Custom system prompt
|
|
150
|
+
visibility?: 'public' | 'private' | 'unlisted',
|
|
151
|
+
profile_image?: string, // URL or base64
|
|
152
|
+
}).unwrap();
|
|
153
|
+
\`\`\`
|
|
154
|
+
|
|
155
|
+
**Invalidates Cache Tags**: \`['Mentors']\``,
|
|
156
|
+
useEditMentorMutation: `# useEditMentorMutation
|
|
157
|
+
|
|
158
|
+
**Package**: \`@iblai/data-layer\`
|
|
159
|
+
**File**: \`packages/data-layer/src/features/mentor/api-slice.ts\`
|
|
160
|
+
**Feature**: Mentor Management
|
|
161
|
+
|
|
162
|
+
\`\`\`typescript
|
|
163
|
+
import { useEditMentorMutation } from '@iblai/data-layer';
|
|
164
|
+
|
|
165
|
+
const [editMentor, { isLoading }] = useEditMentorMutation();
|
|
166
|
+
|
|
167
|
+
await editMentor({
|
|
168
|
+
org: string, // Tenant key
|
|
169
|
+
mentorId: string, // Mentor unique ID
|
|
170
|
+
name?: string,
|
|
171
|
+
description?: string,
|
|
172
|
+
llm_provider?: string,
|
|
173
|
+
llm_name?: string,
|
|
174
|
+
system_prompt?: string,
|
|
175
|
+
visibility?: 'public' | 'private' | 'unlisted',
|
|
176
|
+
profile_image?: string,
|
|
177
|
+
// ... any other mentor fields
|
|
178
|
+
}).unwrap();
|
|
179
|
+
\`\`\`
|
|
180
|
+
|
|
181
|
+
**Invalidates Cache Tags**: \`['Mentors', 'MentorDetails']\``,
|
|
182
|
+
useDeleteMentorMutation: `# useDeleteMentorMutation
|
|
183
|
+
|
|
184
|
+
**Package**: \`@iblai/data-layer\`
|
|
185
|
+
**File**: \`packages/data-layer/src/features/mentor/api-slice.ts\`
|
|
186
|
+
**Feature**: Mentor Management
|
|
187
|
+
|
|
188
|
+
\`\`\`typescript
|
|
189
|
+
import { useDeleteMentorMutation } from '@iblai/data-layer';
|
|
190
|
+
|
|
191
|
+
const [deleteMentor, { isLoading }] = useDeleteMentorMutation();
|
|
192
|
+
|
|
193
|
+
await deleteMentor({
|
|
194
|
+
org: string, // Tenant key
|
|
195
|
+
mentorId: string, // Mentor unique ID
|
|
196
|
+
}).unwrap();
|
|
197
|
+
\`\`\`
|
|
198
|
+
|
|
199
|
+
**Invalidates Cache Tags**: \`['Mentors']\`
|
|
200
|
+
**Warning**: This permanently deletes the mentor and all associated data.`,
|
|
201
|
+
useForkMentorMutation: `# useForkMentorMutation
|
|
202
|
+
|
|
203
|
+
**Package**: \`@iblai/data-layer\`
|
|
204
|
+
**File**: \`packages/data-layer/src/features/mentor/api-slice.ts\`
|
|
205
|
+
**Feature**: Mentor Management
|
|
206
|
+
|
|
207
|
+
Creates a copy of an existing mentor with a new unique ID.
|
|
208
|
+
|
|
209
|
+
\`\`\`typescript
|
|
210
|
+
import { useForkMentorMutation } from '@iblai/data-layer';
|
|
211
|
+
|
|
212
|
+
const [forkMentor, { isLoading }] = useForkMentorMutation();
|
|
213
|
+
|
|
214
|
+
const newMentor = await forkMentor({
|
|
215
|
+
org: string, // Tenant key
|
|
216
|
+
mentorId: string, // Source mentor ID
|
|
217
|
+
name?: string, // Optional new name (defaults to "Copy of {original}")
|
|
218
|
+
}).unwrap();
|
|
219
|
+
\`\`\`
|
|
220
|
+
|
|
221
|
+
**Invalidates Cache Tags**: \`['Mentors']\``,
|
|
222
|
+
useStarMentorMutation: `# useStarMentorMutation
|
|
223
|
+
|
|
224
|
+
**Package**: \`@iblai/data-layer\`
|
|
225
|
+
**File**: \`packages/data-layer/src/features/mentor/api-slice.ts\`
|
|
226
|
+
**Feature**: Mentor Favorites
|
|
227
|
+
|
|
228
|
+
\`\`\`typescript
|
|
229
|
+
import { useStarMentorMutation } from '@iblai/data-layer';
|
|
230
|
+
|
|
231
|
+
const [starMentor, { isLoading }] = useStarMentorMutation();
|
|
232
|
+
|
|
233
|
+
await starMentor({
|
|
234
|
+
org: string, // Tenant key
|
|
235
|
+
mentorId: string, // Mentor unique ID
|
|
236
|
+
}).unwrap();
|
|
237
|
+
\`\`\`
|
|
238
|
+
|
|
239
|
+
**Invalidates Cache Tags**: \`['StarredMentors']\``,
|
|
240
|
+
useUnstarMentorMutation: `# useUnstarMentorMutation
|
|
241
|
+
|
|
242
|
+
**Package**: \`@iblai/data-layer\`
|
|
243
|
+
**File**: \`packages/data-layer/src/features/mentor/api-slice.ts\`
|
|
244
|
+
**Feature**: Mentor Favorites
|
|
245
|
+
|
|
246
|
+
\`\`\`typescript
|
|
247
|
+
import { useUnstarMentorMutation } from '@iblai/data-layer';
|
|
248
|
+
|
|
249
|
+
const [unstarMentor, { isLoading }] = useUnstarMentorMutation();
|
|
250
|
+
|
|
251
|
+
await unstarMentor({
|
|
252
|
+
org: string, // Tenant key
|
|
253
|
+
mentorId: string, // Mentor unique ID
|
|
254
|
+
}).unwrap();
|
|
255
|
+
\`\`\`
|
|
256
|
+
|
|
257
|
+
**Invalidates Cache Tags**: \`['StarredMentors']\``,
|
|
258
|
+
useStarredMentorsQuery: `# useStarredMentorsQuery
|
|
259
|
+
|
|
260
|
+
**Package**: \`@iblai/data-layer\`
|
|
261
|
+
**File**: \`packages/data-layer/src/features/mentor/api-slice.ts\`
|
|
262
|
+
**Feature**: Mentor Favorites
|
|
263
|
+
|
|
264
|
+
\`\`\`typescript
|
|
265
|
+
import { useStarredMentorsQuery } from '@iblai/data-layer';
|
|
266
|
+
|
|
267
|
+
const { data: starredMentors, isLoading } = useStarredMentorsQuery({
|
|
268
|
+
org: string, // Tenant key
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
// Returns array of starred mentor IDs
|
|
272
|
+
// Used to highlight favorites in mentor list
|
|
273
|
+
\`\`\`
|
|
274
|
+
|
|
275
|
+
**Cache Tags**: \`['StarredMentors']\``,
|
|
276
|
+
useGetRecentlyAccessedMentorsQuery: `# useGetRecentlyAccessedMentorsQuery
|
|
277
|
+
|
|
278
|
+
**Package**: \`@iblai/data-layer\`
|
|
279
|
+
**File**: \`packages/data-layer/src/features/mentor/api-slice.ts\`
|
|
280
|
+
**Feature**: Mentor History
|
|
281
|
+
|
|
282
|
+
\`\`\`typescript
|
|
283
|
+
import { useGetRecentlyAccessedMentorsQuery } from '@iblai/data-layer';
|
|
284
|
+
|
|
285
|
+
const { data: recentMentors, isLoading } = useGetRecentlyAccessedMentorsQuery({
|
|
286
|
+
org: string, // Tenant key
|
|
287
|
+
limit?: number, // Number of mentors (default: 5)
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
// Returns array of recently accessed mentors
|
|
291
|
+
// Used for quick access in sidebar/navigation
|
|
292
|
+
\`\`\``,
|
|
293
|
+
useGetFreeUsageCountQuery: `# useGetFreeUsageCountQuery
|
|
294
|
+
|
|
295
|
+
**Package**: \`@iblai/data-layer\`
|
|
296
|
+
**File**: \`packages/data-layer/src/features/mentor/api-slice.ts\`
|
|
297
|
+
**Feature**: Subscription/Billing
|
|
298
|
+
|
|
299
|
+
\`\`\`typescript
|
|
300
|
+
import { useGetFreeUsageCountQuery } from '@iblai/data-layer';
|
|
301
|
+
|
|
302
|
+
const { data, isLoading } = useGetFreeUsageCountQuery({
|
|
303
|
+
org: string, // Tenant key
|
|
304
|
+
mentorId: string, // Mentor unique ID
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
// Response
|
|
308
|
+
interface FreeUsageCount {
|
|
309
|
+
remaining_count: number; // Messages remaining in free tier
|
|
310
|
+
total_count: number; // Total free messages allowed
|
|
311
|
+
reset_date?: string; // When count resets (if applicable)
|
|
312
|
+
}
|
|
313
|
+
\`\`\`
|
|
314
|
+
|
|
315
|
+
**Used for**: Trial banners, usage limits, subscription prompts`,
|
|
316
|
+
useSeedMentorsMutation: `# useSeedMentorsMutation
|
|
317
|
+
|
|
318
|
+
**Package**: \`@iblai/data-layer\`
|
|
319
|
+
**File**: \`packages/data-layer/src/features/mentor/api-slice.ts\`
|
|
320
|
+
**Feature**: Tenant Setup
|
|
321
|
+
|
|
322
|
+
Seeds default/template mentors for a new tenant (admin only).
|
|
323
|
+
|
|
324
|
+
\`\`\`typescript
|
|
325
|
+
import { useSeedMentorsMutation } from '@iblai/data-layer';
|
|
326
|
+
|
|
327
|
+
const [seedMentors, { isLoading }] = useSeedMentorsMutation();
|
|
328
|
+
|
|
329
|
+
await seedMentors({
|
|
330
|
+
org: string, // Tenant key
|
|
331
|
+
}).unwrap();
|
|
332
|
+
\`\`\`
|
|
333
|
+
|
|
334
|
+
**Requires**: Admin permissions
|
|
335
|
+
**Invalidates Cache Tags**: \`['Mentors']\``,
|
|
336
|
+
useGetModerationLogsQuery: `# useGetModerationLogsQuery
|
|
337
|
+
|
|
338
|
+
**Package**: \`@iblai/data-layer\`
|
|
339
|
+
**File**: \`packages/data-layer/src/features/mentor/api-slice.ts\`
|
|
340
|
+
**Feature**: Moderation
|
|
341
|
+
|
|
342
|
+
\`\`\`typescript
|
|
343
|
+
import { useGetModerationLogsQuery } from '@iblai/data-layer';
|
|
344
|
+
|
|
345
|
+
const { data: logs, isLoading } = useGetModerationLogsQuery({
|
|
346
|
+
org: string, // Tenant key
|
|
347
|
+
mentorId: string, // Mentor unique ID
|
|
348
|
+
page?: number,
|
|
349
|
+
pageSize?: number,
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
// Returns moderation logs for content flagging
|
|
353
|
+
\`\`\``,
|
|
354
|
+
useUpdateMentorVisibilityStatusMutation: `# useUpdateMentorVisibilityStatusMutation
|
|
355
|
+
|
|
356
|
+
**Package**: \`@iblai/data-layer\`
|
|
357
|
+
**File**: \`packages/data-layer/src/features/mentor/api-slice.ts\`
|
|
358
|
+
**Feature**: Mentor Management
|
|
359
|
+
|
|
360
|
+
\`\`\`typescript
|
|
361
|
+
import { useUpdateMentorVisibilityStatusMutation } from '@iblai/data-layer';
|
|
362
|
+
|
|
363
|
+
const [updateVisibility, { isLoading }] = useUpdateMentorVisibilityStatusMutation();
|
|
364
|
+
|
|
365
|
+
await updateVisibility({
|
|
366
|
+
org: string,
|
|
367
|
+
mentorId: string,
|
|
368
|
+
visibility: 'public' | 'private' | 'unlisted',
|
|
369
|
+
}).unwrap();
|
|
370
|
+
\`\`\``,
|
|
371
|
+
// ============================================================================
|
|
372
|
+
// SHAREABLE LINKS API ENDPOINTS
|
|
373
|
+
// ============================================================================
|
|
374
|
+
useCreateShareableLinkMutation: `# useCreateShareableLinkMutation
|
|
375
|
+
|
|
376
|
+
**Package**: \`@iblai/data-layer\`
|
|
377
|
+
**File**: \`packages/data-layer/src/features/mentor/api-slice.ts\`
|
|
378
|
+
**Feature**: Mentor Sharing
|
|
379
|
+
|
|
380
|
+
\`\`\`typescript
|
|
381
|
+
import { useCreateShareableLinkMutation } from '@iblai/data-layer';
|
|
382
|
+
|
|
383
|
+
const [createLink, { isLoading }] = useCreateShareableLinkMutation();
|
|
384
|
+
|
|
385
|
+
const { link, token } = await createLink({
|
|
386
|
+
org: string, // Tenant key
|
|
387
|
+
mentorId: string, // Mentor unique ID
|
|
388
|
+
expiresAt?: string, // ISO date for expiration
|
|
389
|
+
}).unwrap();
|
|
390
|
+
|
|
391
|
+
// link - Full shareable URL
|
|
392
|
+
// token - Token for the link
|
|
393
|
+
\`\`\``,
|
|
394
|
+
useUpdateShareableLinkMutation: `# useUpdateShareableLinkMutation
|
|
395
|
+
|
|
396
|
+
**Package**: \`@iblai/data-layer\`
|
|
397
|
+
**File**: \`packages/data-layer/src/features/mentor/api-slice.ts\`
|
|
398
|
+
**Feature**: Mentor Sharing
|
|
399
|
+
|
|
400
|
+
\`\`\`typescript
|
|
401
|
+
import { useUpdateShareableLinkMutation } from '@iblai/data-layer';
|
|
402
|
+
|
|
403
|
+
const [updateLink, { isLoading }] = useUpdateShareableLinkMutation();
|
|
404
|
+
|
|
405
|
+
await updateLink({
|
|
406
|
+
org: string,
|
|
407
|
+
mentorId: string,
|
|
408
|
+
token: string,
|
|
409
|
+
expiresAt?: string, // New expiration date
|
|
410
|
+
}).unwrap();
|
|
411
|
+
\`\`\``,
|
|
412
|
+
useRevokeShareableLinkMutation: `# useRevokeShareableLinkMutation
|
|
413
|
+
|
|
414
|
+
**Package**: \`@iblai/data-layer\`
|
|
415
|
+
**File**: \`packages/data-layer/src/features/mentor/api-slice.ts\`
|
|
416
|
+
**Feature**: Mentor Sharing
|
|
417
|
+
|
|
418
|
+
\`\`\`typescript
|
|
419
|
+
import { useRevokeShareableLinkMutation } from '@iblai/data-layer';
|
|
420
|
+
|
|
421
|
+
const [revokeLink, { isLoading }] = useRevokeShareableLinkMutation();
|
|
422
|
+
|
|
423
|
+
await revokeLink({
|
|
424
|
+
org: string,
|
|
425
|
+
mentorId: string,
|
|
426
|
+
token: string,
|
|
427
|
+
}).unwrap();
|
|
428
|
+
\`\`\``,
|
|
429
|
+
// ============================================================================
|
|
430
|
+
// USER API ENDPOINTS
|
|
431
|
+
// ============================================================================
|
|
432
|
+
useGetUserMetadataQuery: `# useGetUserMetadataQuery
|
|
433
|
+
|
|
434
|
+
**Package**: \`@iblai/data-layer\`
|
|
435
|
+
**File**: \`packages/data-layer/src/features/user/api-slice.ts\`
|
|
436
|
+
**Feature**: User Profile
|
|
437
|
+
|
|
438
|
+
\`\`\`typescript
|
|
439
|
+
import { useGetUserMetadataQuery } from '@iblai/data-layer';
|
|
440
|
+
|
|
441
|
+
const { data: user, isLoading, error } = useGetUserMetadataQuery({
|
|
442
|
+
params: { username: string },
|
|
443
|
+
});
|
|
444
|
+
|
|
445
|
+
// Response type
|
|
446
|
+
interface UserProfile {
|
|
447
|
+
username: string;
|
|
448
|
+
name: string;
|
|
449
|
+
email: string;
|
|
450
|
+
about: string;
|
|
451
|
+
title: string;
|
|
452
|
+
profile_image: string;
|
|
453
|
+
social_links: {
|
|
454
|
+
twitter?: string;
|
|
455
|
+
linkedin?: string;
|
|
456
|
+
github?: string;
|
|
457
|
+
};
|
|
458
|
+
public_metadata: {
|
|
459
|
+
bio: string;
|
|
460
|
+
language: string;
|
|
461
|
+
};
|
|
462
|
+
enable_sidebar_ai_mentor_display: boolean;
|
|
463
|
+
enable_skills_leaderboard_display: boolean;
|
|
464
|
+
date_joined: string;
|
|
465
|
+
}
|
|
466
|
+
\`\`\`
|
|
467
|
+
|
|
468
|
+
**Cache Tags**: \`['UserMetadata', username]\``,
|
|
469
|
+
useUpdateUserMetadataMutation: `# useUpdateUserMetadataMutation
|
|
470
|
+
|
|
471
|
+
**Package**: \`@iblai/data-layer\`
|
|
472
|
+
**File**: \`packages/data-layer/src/features/user/api-slice.ts\`
|
|
473
|
+
**Feature**: User Profile
|
|
474
|
+
|
|
475
|
+
\`\`\`typescript
|
|
476
|
+
import { useUpdateUserMetadataMutation } from '@iblai/data-layer';
|
|
477
|
+
|
|
478
|
+
const [updateUser, { isLoading }] = useUpdateUserMetadataMutation();
|
|
479
|
+
|
|
480
|
+
await updateUser({
|
|
481
|
+
username: string,
|
|
482
|
+
name?: string,
|
|
483
|
+
about?: string,
|
|
484
|
+
title?: string,
|
|
485
|
+
social_links?: Record<string, string>,
|
|
486
|
+
public_metadata?: {
|
|
487
|
+
bio?: string;
|
|
488
|
+
language?: string;
|
|
489
|
+
},
|
|
490
|
+
}).unwrap();
|
|
491
|
+
\`\`\`
|
|
492
|
+
|
|
493
|
+
**Invalidates Cache Tags**: \`['UserMetadata']\``,
|
|
494
|
+
useUpdateUserAccountMutation: `# useUpdateUserAccountMutation
|
|
495
|
+
|
|
496
|
+
**Package**: \`@iblai/data-layer\`
|
|
497
|
+
**File**: \`packages/data-layer/src/features/user/api-slice.ts\`
|
|
498
|
+
**Feature**: User Account
|
|
499
|
+
|
|
500
|
+
\`\`\`typescript
|
|
501
|
+
import { useUpdateUserAccountMutation } from '@iblai/data-layer';
|
|
502
|
+
|
|
503
|
+
const [updateAccount, { isLoading }] = useUpdateUserAccountMutation();
|
|
504
|
+
|
|
505
|
+
await updateAccount({
|
|
506
|
+
username: string,
|
|
507
|
+
email?: string,
|
|
508
|
+
// Other account-level settings
|
|
509
|
+
}).unwrap();
|
|
510
|
+
\`\`\``,
|
|
511
|
+
useResetPasswordMutation: `# useResetPasswordMutation
|
|
512
|
+
|
|
513
|
+
**Package**: \`@iblai/data-layer\`
|
|
514
|
+
**File**: \`packages/data-layer/src/features/user/api-slice.ts\`
|
|
515
|
+
**Feature**: Authentication
|
|
516
|
+
|
|
517
|
+
\`\`\`typescript
|
|
518
|
+
import { useResetPasswordMutation } from '@iblai/data-layer';
|
|
519
|
+
|
|
520
|
+
const [resetPassword, { isLoading, isSuccess }] = useResetPasswordMutation();
|
|
521
|
+
|
|
522
|
+
await resetPassword({
|
|
523
|
+
email: string,
|
|
524
|
+
}).unwrap();
|
|
525
|
+
|
|
526
|
+
// Sends password reset email to user
|
|
527
|
+
\`\`\``,
|
|
528
|
+
useUploadProfileImageMutation: `# useUploadProfileImageMutation
|
|
529
|
+
|
|
530
|
+
**Package**: \`@iblai/data-layer\`
|
|
531
|
+
**File**: \`packages/data-layer/src/features/user/api-slice.ts\`
|
|
532
|
+
**Feature**: User Profile
|
|
533
|
+
|
|
534
|
+
\`\`\`typescript
|
|
535
|
+
import { useUploadProfileImageMutation } from '@iblai/data-layer';
|
|
536
|
+
|
|
537
|
+
const [uploadImage, { isLoading }] = useUploadProfileImageMutation();
|
|
538
|
+
|
|
539
|
+
const { url } = await uploadImage({
|
|
540
|
+
username: string,
|
|
541
|
+
file: File, // Image file
|
|
542
|
+
}).unwrap();
|
|
543
|
+
|
|
544
|
+
// url - New profile image URL
|
|
545
|
+
\`\`\`
|
|
546
|
+
|
|
547
|
+
**Invalidates Cache Tags**: \`['UserMetadata']\``,
|
|
548
|
+
useRemoveProfileImageMutation: `# useRemoveProfileImageMutation
|
|
549
|
+
|
|
550
|
+
**Package**: \`@iblai/data-layer\`
|
|
551
|
+
**File**: \`packages/data-layer/src/features/user/api-slice.ts\`
|
|
552
|
+
**Feature**: User Profile
|
|
553
|
+
|
|
554
|
+
\`\`\`typescript
|
|
555
|
+
import { useRemoveProfileImageMutation } from '@iblai/data-layer';
|
|
556
|
+
|
|
557
|
+
const [removeImage, { isLoading }] = useRemoveProfileImageMutation();
|
|
558
|
+
|
|
559
|
+
await removeImage({
|
|
560
|
+
username: string,
|
|
561
|
+
}).unwrap();
|
|
562
|
+
\`\`\`
|
|
563
|
+
|
|
564
|
+
**Invalidates Cache Tags**: \`['UserMetadata']\``,
|
|
565
|
+
useUpdateUserRoleMutation: `# useUpdateUserRoleMutation
|
|
566
|
+
|
|
567
|
+
**Package**: \`@iblai/data-layer\`
|
|
568
|
+
**File**: \`packages/data-layer/src/features/user/api-slice.ts\`
|
|
569
|
+
**Feature**: User Management
|
|
570
|
+
|
|
571
|
+
\`\`\`typescript
|
|
572
|
+
import { useUpdateUserRoleMutation } from '@iblai/data-layer';
|
|
573
|
+
|
|
574
|
+
const [updateRole, { isLoading }] = useUpdateUserRoleMutation();
|
|
575
|
+
|
|
576
|
+
await updateRole({
|
|
577
|
+
username: string,
|
|
578
|
+
role: 'admin' | 'instructor' | 'learner',
|
|
579
|
+
}).unwrap();
|
|
580
|
+
\`\`\``,
|
|
581
|
+
// ============================================================================
|
|
582
|
+
// PLATFORM API ENDPOINTS
|
|
583
|
+
// ============================================================================
|
|
584
|
+
useGetPlatformUsersQuery: `# useGetPlatformUsersQuery
|
|
585
|
+
|
|
586
|
+
**Package**: \`@iblai/data-layer\`
|
|
587
|
+
**File**: \`packages/data-layer/src/features/platform/api-slice.ts\`
|
|
588
|
+
**Feature**: Platform Administration
|
|
589
|
+
|
|
590
|
+
\`\`\`typescript
|
|
591
|
+
import { useGetPlatformUsersQuery } from '@iblai/data-layer';
|
|
592
|
+
|
|
593
|
+
const { data, isLoading, error } = useGetPlatformUsersQuery({
|
|
594
|
+
platformKey: string, // Tenant key
|
|
595
|
+
page?: number, // Page number (default: 1)
|
|
596
|
+
pageSize?: number, // Items per page (default: 20)
|
|
597
|
+
search?: string, // Search by name/email
|
|
598
|
+
includeUserPolicies?: boolean, // Include user policies
|
|
599
|
+
role?: string, // Filter by role
|
|
600
|
+
});
|
|
601
|
+
|
|
602
|
+
// Response type
|
|
603
|
+
interface PlatformUsersListResponse {
|
|
604
|
+
count: number;
|
|
605
|
+
results: PlatformUser[];
|
|
606
|
+
allowed_policies?: string[]; // Available policies if includeUserPolicies=true
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
interface PlatformUser {
|
|
610
|
+
id: number;
|
|
611
|
+
username: string;
|
|
612
|
+
email: string;
|
|
613
|
+
name: string;
|
|
614
|
+
role: string;
|
|
615
|
+
policies: string[];
|
|
616
|
+
is_active: boolean;
|
|
617
|
+
date_joined: string;
|
|
618
|
+
}
|
|
619
|
+
\`\`\`
|
|
620
|
+
|
|
621
|
+
**Cache Tags**: \`['PlatformUsers']\``,
|
|
622
|
+
usePlatformUserGroupsQuery: `# usePlatformUserGroupsQuery
|
|
623
|
+
|
|
624
|
+
**Package**: \`@iblai/data-layer\`
|
|
625
|
+
**File**: \`packages/data-layer/src/features/platform/api-slice.ts\`
|
|
626
|
+
**Feature**: Team Management
|
|
627
|
+
|
|
628
|
+
\`\`\`typescript
|
|
629
|
+
import { usePlatformUserGroupsQuery } from '@iblai/data-layer';
|
|
630
|
+
|
|
631
|
+
const { data: groups, isLoading } = usePlatformUserGroupsQuery({
|
|
632
|
+
platformKey: string,
|
|
633
|
+
includeUsers?: boolean, // Include users in each group
|
|
634
|
+
withPermissions?: boolean, // Include permission info
|
|
635
|
+
});
|
|
636
|
+
|
|
637
|
+
// Response type
|
|
638
|
+
interface PlatformUserGroup {
|
|
639
|
+
id: number;
|
|
640
|
+
name: string;
|
|
641
|
+
description: string;
|
|
642
|
+
is_internal: boolean;
|
|
643
|
+
user_count?: number;
|
|
644
|
+
users?: PlatformUserGroupUser[];
|
|
645
|
+
}
|
|
646
|
+
\`\`\`
|
|
647
|
+
|
|
648
|
+
**Cache Tags**: \`['PlatformUserGroups']\``,
|
|
649
|
+
useGetPlatformUserGroupDetailsQuery: `# useGetPlatformUserGroupDetailsQuery
|
|
650
|
+
|
|
651
|
+
**Package**: \`@iblai/data-layer\`
|
|
652
|
+
**File**: \`packages/data-layer/src/features/platform/api-slice.ts\`
|
|
653
|
+
**Feature**: Team Management
|
|
654
|
+
|
|
655
|
+
\`\`\`typescript
|
|
656
|
+
import { useGetPlatformUserGroupDetailsQuery } from '@iblai/data-layer';
|
|
657
|
+
|
|
658
|
+
const { data: group, isLoading } = useGetPlatformUserGroupDetailsQuery({
|
|
659
|
+
id: number, // Group ID
|
|
660
|
+
platformKey: string, // Tenant key
|
|
661
|
+
});
|
|
662
|
+
|
|
663
|
+
// Response type
|
|
664
|
+
interface PlatformUserGroupDetailsResponse {
|
|
665
|
+
id: number;
|
|
666
|
+
name: string;
|
|
667
|
+
description: string;
|
|
668
|
+
is_internal?: boolean;
|
|
669
|
+
users: PlatformUserGroupUser[];
|
|
670
|
+
permissions?: string[];
|
|
671
|
+
}
|
|
672
|
+
\`\`\``,
|
|
673
|
+
useCreatePlatformUserGroupMutation: `# useCreatePlatformUserGroupMutation
|
|
674
|
+
|
|
675
|
+
**Package**: \`@iblai/data-layer\`
|
|
676
|
+
**File**: \`packages/data-layer/src/features/platform/api-slice.ts\`
|
|
677
|
+
**Feature**: Team Management
|
|
678
|
+
|
|
679
|
+
\`\`\`typescript
|
|
680
|
+
import { useCreatePlatformUserGroupMutation } from '@iblai/data-layer';
|
|
681
|
+
|
|
682
|
+
const [createGroup, { isLoading }] = useCreatePlatformUserGroupMutation();
|
|
683
|
+
|
|
684
|
+
const newGroup = await createGroup({
|
|
685
|
+
platformKey: string,
|
|
686
|
+
name: string,
|
|
687
|
+
description?: string,
|
|
688
|
+
}).unwrap();
|
|
689
|
+
\`\`\`
|
|
690
|
+
|
|
691
|
+
**Invalidates Cache Tags**: \`['PlatformUserGroups']\``,
|
|
692
|
+
useUpdatePlatformUserGroupMutation: `# useUpdatePlatformUserGroupMutation
|
|
693
|
+
|
|
694
|
+
**Package**: \`@iblai/data-layer\`
|
|
695
|
+
**File**: \`packages/data-layer/src/features/platform/api-slice.ts\`
|
|
696
|
+
**Feature**: Team Management
|
|
697
|
+
|
|
698
|
+
\`\`\`typescript
|
|
699
|
+
import { useUpdatePlatformUserGroupMutation } from '@iblai/data-layer';
|
|
700
|
+
|
|
701
|
+
const [updateGroup, { isLoading }] = useUpdatePlatformUserGroupMutation();
|
|
702
|
+
|
|
703
|
+
await updateGroup({
|
|
704
|
+
id: number,
|
|
705
|
+
platformKey: string,
|
|
706
|
+
name?: string,
|
|
707
|
+
description?: string,
|
|
708
|
+
}).unwrap();
|
|
709
|
+
\`\`\`
|
|
710
|
+
|
|
711
|
+
**Invalidates Cache Tags**: \`['PlatformUserGroups']\``,
|
|
712
|
+
useDeletePlatformUserGroupMutation: `# useDeletePlatformUserGroupMutation
|
|
713
|
+
|
|
714
|
+
**Package**: \`@iblai/data-layer\`
|
|
715
|
+
**File**: \`packages/data-layer/src/features/platform/api-slice.ts\`
|
|
716
|
+
**Feature**: Team Management
|
|
717
|
+
|
|
718
|
+
\`\`\`typescript
|
|
719
|
+
import { useDeletePlatformUserGroupMutation } from '@iblai/data-layer';
|
|
720
|
+
|
|
721
|
+
const [deleteGroup, { isLoading }] = useDeletePlatformUserGroupMutation();
|
|
722
|
+
|
|
723
|
+
await deleteGroup({
|
|
724
|
+
id: number,
|
|
725
|
+
platformKey: string,
|
|
726
|
+
}).unwrap();
|
|
727
|
+
\`\`\`
|
|
728
|
+
|
|
729
|
+
**Invalidates Cache Tags**: \`['PlatformUserGroups']\``,
|
|
730
|
+
useInviteUserMutation: `# useInviteUserMutation
|
|
731
|
+
|
|
732
|
+
**Package**: \`@iblai/data-layer\`
|
|
733
|
+
**File**: \`packages/data-layer/src/features/platform/api-slice.ts\`
|
|
734
|
+
**Feature**: User Invitations
|
|
735
|
+
|
|
736
|
+
\`\`\`typescript
|
|
737
|
+
import { useInviteUserMutation } from '@iblai/data-layer';
|
|
738
|
+
|
|
739
|
+
const [inviteUser, { isLoading, isSuccess }] = useInviteUserMutation();
|
|
740
|
+
|
|
741
|
+
await inviteUser({
|
|
742
|
+
email: string, // User's email
|
|
743
|
+
platform_key: string, // Tenant key
|
|
744
|
+
redirect_to: string, // URL after accepting invite
|
|
745
|
+
source: string, // Invite source identifier
|
|
746
|
+
role?: string, // Initial role
|
|
747
|
+
}).unwrap();
|
|
748
|
+
\`\`\`
|
|
749
|
+
|
|
750
|
+
**Sends invitation email to user**`,
|
|
751
|
+
useUpdatePlatformUserRoleWithPoliciesMutation: `# useUpdatePlatformUserRoleWithPoliciesMutation
|
|
752
|
+
|
|
753
|
+
**Package**: \`@iblai/data-layer\`
|
|
754
|
+
**File**: \`packages/data-layer/src/features/platform/api-slice.ts\`
|
|
755
|
+
**Feature**: Platform Administration
|
|
756
|
+
|
|
757
|
+
\`\`\`typescript
|
|
758
|
+
import { useUpdatePlatformUserRoleWithPoliciesMutation } from '@iblai/data-layer';
|
|
759
|
+
|
|
760
|
+
const [updateRole, { isLoading }] = useUpdatePlatformUserRoleWithPoliciesMutation();
|
|
761
|
+
|
|
762
|
+
await updateRole({
|
|
763
|
+
platformKey: string,
|
|
764
|
+
userId: string,
|
|
765
|
+
role: 'admin' | 'instructor' | 'learner',
|
|
766
|
+
policies: string[], // Array of policy identifiers
|
|
767
|
+
}).unwrap();
|
|
768
|
+
\`\`\`
|
|
769
|
+
|
|
770
|
+
**Invalidates Cache Tags**: \`['PlatformUsers']\``,
|
|
771
|
+
usePlatformInvitationsQuery: `# usePlatformInvitationsQuery
|
|
772
|
+
|
|
773
|
+
**Package**: \`@iblai/data-layer\`
|
|
774
|
+
**File**: \`packages/data-layer/src/features/platform/api-slice.ts\`
|
|
775
|
+
**Feature**: User Invitations
|
|
776
|
+
|
|
777
|
+
\`\`\`typescript
|
|
778
|
+
import { usePlatformInvitationsQuery } from '@iblai/data-layer';
|
|
779
|
+
|
|
780
|
+
const { data: invitations, isLoading } = usePlatformInvitationsQuery({
|
|
781
|
+
platformKey: string,
|
|
782
|
+
status?: 'pending' | 'accepted' | 'expired',
|
|
783
|
+
});
|
|
784
|
+
|
|
785
|
+
// Returns list of platform invitations
|
|
786
|
+
\`\`\``,
|
|
787
|
+
useUsersGradesPassedQuery: `# useUsersGradesPassedQuery
|
|
788
|
+
|
|
789
|
+
**Package**: \`@iblai/data-layer\`
|
|
790
|
+
**File**: \`packages/data-layer/src/features/platform/api-slice.ts\`
|
|
791
|
+
**Feature**: Learning Analytics
|
|
792
|
+
|
|
793
|
+
\`\`\`typescript
|
|
794
|
+
import { useUsersGradesPassedQuery } from '@iblai/data-layer';
|
|
795
|
+
|
|
796
|
+
const { data, isLoading } = useUsersGradesPassedQuery({
|
|
797
|
+
platformKey: string,
|
|
798
|
+
courseId?: string,
|
|
799
|
+
});
|
|
800
|
+
|
|
801
|
+
// Returns users with passing grades
|
|
802
|
+
\`\`\``,
|
|
803
|
+
// ============================================================================
|
|
804
|
+
// TENANT API ENDPOINTS
|
|
805
|
+
// ============================================================================
|
|
806
|
+
useGetTenantMetadataQuery: `# useGetTenantMetadataQuery
|
|
807
|
+
|
|
808
|
+
**Package**: \`@iblai/data-layer\`
|
|
809
|
+
**File**: \`packages/data-layer/src/features/tenant/api-slice.ts\`
|
|
810
|
+
**Feature**: Tenant Configuration
|
|
811
|
+
|
|
812
|
+
\`\`\`typescript
|
|
813
|
+
import { useGetTenantMetadataQuery } from '@iblai/data-layer';
|
|
814
|
+
|
|
815
|
+
const { data: metadata, isLoading } = useGetTenantMetadataQuery({
|
|
816
|
+
org: string, // Tenant key
|
|
817
|
+
});
|
|
818
|
+
|
|
819
|
+
// Response includes:
|
|
820
|
+
interface TenantMetadata {
|
|
821
|
+
// Branding
|
|
822
|
+
name: string;
|
|
823
|
+
logo_url: string;
|
|
824
|
+
primary_color: string;
|
|
825
|
+
secondary_color: string;
|
|
826
|
+
|
|
827
|
+
// Feature flags
|
|
828
|
+
enable_mentor_ai: boolean;
|
|
829
|
+
enable_skills_leaderboard: boolean;
|
|
830
|
+
enable_rbac: boolean;
|
|
831
|
+
enable_custom_domain: boolean;
|
|
832
|
+
|
|
833
|
+
// Configuration
|
|
834
|
+
allowed_llm_providers: string[];
|
|
835
|
+
default_llm_provider: string;
|
|
836
|
+
default_llm_name: string;
|
|
837
|
+
|
|
838
|
+
// Custom domain
|
|
839
|
+
custom_domain?: string;
|
|
840
|
+
}
|
|
841
|
+
\`\`\`
|
|
842
|
+
|
|
843
|
+
**Cache Tags**: \`['TenantMetadata', org]\``,
|
|
844
|
+
useUpdateTenantMetadataMutation: `# useUpdateTenantMetadataMutation
|
|
845
|
+
|
|
846
|
+
**Package**: \`@iblai/data-layer\`
|
|
847
|
+
**File**: \`packages/data-layer/src/features/tenant/api-slice.ts\`
|
|
848
|
+
**Feature**: Tenant Configuration
|
|
849
|
+
|
|
850
|
+
\`\`\`typescript
|
|
851
|
+
import { useUpdateTenantMetadataMutation } from '@iblai/data-layer';
|
|
852
|
+
|
|
853
|
+
const [updateMetadata, { isLoading }] = useUpdateTenantMetadataMutation();
|
|
854
|
+
|
|
855
|
+
await updateMetadata({
|
|
856
|
+
org: string,
|
|
857
|
+
name?: string,
|
|
858
|
+
logo_url?: string,
|
|
859
|
+
primary_color?: string,
|
|
860
|
+
// ... any metadata fields
|
|
861
|
+
}).unwrap();
|
|
862
|
+
\`\`\`
|
|
863
|
+
|
|
864
|
+
**Invalidates Cache Tags**: \`['TenantMetadata']\`
|
|
865
|
+
**Requires**: Admin permissions`,
|
|
866
|
+
useGetUserTenantsQuery: `# useGetUserTenantsQuery
|
|
867
|
+
|
|
868
|
+
**Package**: \`@iblai/data-layer\`
|
|
869
|
+
**File**: \`packages/data-layer/src/features/tenant/api-slice.ts\`
|
|
870
|
+
**Feature**: Multi-tenancy
|
|
871
|
+
|
|
872
|
+
\`\`\`typescript
|
|
873
|
+
import { useGetUserTenantsQuery } from '@iblai/data-layer';
|
|
874
|
+
|
|
875
|
+
const { data: tenants, isLoading } = useGetUserTenantsQuery();
|
|
876
|
+
|
|
877
|
+
// Response type
|
|
878
|
+
interface Tenant {
|
|
879
|
+
key: string;
|
|
880
|
+
name: string;
|
|
881
|
+
logo_url: string;
|
|
882
|
+
role: string;
|
|
883
|
+
is_advertising: boolean;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
// Returns array of tenants user can access
|
|
887
|
+
// Used for tenant switcher
|
|
888
|
+
\`\`\``,
|
|
889
|
+
// ============================================================================
|
|
890
|
+
// RBAC / CORE API ENDPOINTS
|
|
891
|
+
// ============================================================================
|
|
892
|
+
useGetRbacGroupsQuery: `# useGetRbacGroupsQuery
|
|
893
|
+
|
|
894
|
+
**Package**: \`@iblai/data-layer\`
|
|
895
|
+
**File**: \`packages/data-layer/src/features/core/api-slice.ts\`
|
|
896
|
+
**Feature**: RBAC (Role-Based Access Control)
|
|
897
|
+
|
|
898
|
+
\`\`\`typescript
|
|
899
|
+
import { useGetRbacGroupsQuery } from '@iblai/data-layer';
|
|
900
|
+
|
|
901
|
+
const { data: groups, isLoading } = useGetRbacGroupsQuery({
|
|
902
|
+
platformKey: string,
|
|
903
|
+
});
|
|
904
|
+
|
|
905
|
+
// Response type
|
|
906
|
+
interface RbacGroup {
|
|
907
|
+
id: number;
|
|
908
|
+
name: string;
|
|
909
|
+
permissions: string[];
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
// Returns array of RBAC groups with their permissions
|
|
913
|
+
\`\`\``,
|
|
914
|
+
useGetRbacPermissionsQuery: `# useGetRbacPermissionsQuery
|
|
915
|
+
|
|
916
|
+
**Package**: \`@iblai/data-layer\`
|
|
917
|
+
**File**: \`packages/data-layer/src/features/core/api-slice.ts\`
|
|
918
|
+
**Feature**: RBAC (Role-Based Access Control)
|
|
919
|
+
|
|
920
|
+
\`\`\`typescript
|
|
921
|
+
import { useGetRbacPermissionsQuery } from '@iblai/data-layer';
|
|
922
|
+
|
|
923
|
+
const { data: permissions, isLoading } = useGetRbacPermissionsQuery({
|
|
924
|
+
platformKey: string,
|
|
925
|
+
});
|
|
926
|
+
|
|
927
|
+
// Returns user's RBAC permissions
|
|
928
|
+
// Used with WithPermissions HOC for conditional rendering
|
|
929
|
+
\`\`\``,
|
|
930
|
+
useGetRedirectTokenQuery: `# useGetRedirectTokenQuery
|
|
931
|
+
|
|
932
|
+
**Package**: \`@iblai/data-layer\`
|
|
933
|
+
**File**: \`packages/data-layer/src/features/core/api-slice.ts\`
|
|
934
|
+
**Feature**: Authentication
|
|
935
|
+
|
|
936
|
+
\`\`\`typescript
|
|
937
|
+
import { useGetRedirectTokenQuery } from '@iblai/data-layer';
|
|
938
|
+
|
|
939
|
+
const { data, isLoading } = useGetRedirectTokenQuery({
|
|
940
|
+
platformKey: string,
|
|
941
|
+
});
|
|
942
|
+
|
|
943
|
+
// Returns token for cross-app redirects
|
|
944
|
+
\`\`\``,
|
|
945
|
+
useGetPlatformInfoQuery: `# useGetPlatformInfoQuery
|
|
946
|
+
|
|
947
|
+
**Package**: \`@iblai/data-layer\`
|
|
948
|
+
**File**: \`packages/data-layer/src/features/core/api-slice.ts\`
|
|
949
|
+
**Feature**: Platform Info
|
|
950
|
+
|
|
951
|
+
\`\`\`typescript
|
|
952
|
+
import { useGetPlatformInfoQuery } from '@iblai/data-layer';
|
|
953
|
+
|
|
954
|
+
const { data: info, isLoading } = useGetPlatformInfoQuery({
|
|
955
|
+
platformKey: string,
|
|
956
|
+
});
|
|
957
|
+
|
|
958
|
+
// Returns platform configuration and status
|
|
959
|
+
\`\`\``,
|
|
960
|
+
useGetUserStatusQuery: `# useGetUserStatusQuery
|
|
961
|
+
|
|
962
|
+
**Package**: \`@iblai/data-layer\`
|
|
963
|
+
**File**: \`packages/data-layer/src/features/core/api-slice.ts\`
|
|
964
|
+
**Feature**: User Status
|
|
965
|
+
|
|
966
|
+
\`\`\`typescript
|
|
967
|
+
import { useGetUserStatusQuery } from '@iblai/data-layer';
|
|
968
|
+
|
|
969
|
+
const { data: status, isLoading } = useGetUserStatusQuery({
|
|
970
|
+
platformKey: string,
|
|
971
|
+
});
|
|
972
|
+
|
|
973
|
+
// Returns user's status on the platform
|
|
974
|
+
\`\`\``,
|
|
975
|
+
useGetStudentMentorCreationStatusQuery: `# useGetStudentMentorCreationStatusQuery
|
|
976
|
+
|
|
977
|
+
**Package**: \`@iblai/data-layer\`
|
|
978
|
+
**File**: \`packages/data-layer/src/features/core/api-slice.ts\`
|
|
979
|
+
**Feature**: Mentor Creation
|
|
980
|
+
|
|
981
|
+
\`\`\`typescript
|
|
982
|
+
import { useGetStudentMentorCreationStatusQuery } from '@iblai/data-layer';
|
|
983
|
+
|
|
984
|
+
const { data, isLoading } = useGetStudentMentorCreationStatusQuery({
|
|
985
|
+
platformKey: string,
|
|
986
|
+
});
|
|
987
|
+
|
|
988
|
+
// Returns whether student can create mentors
|
|
989
|
+
\`\`\``,
|
|
990
|
+
// ============================================================================
|
|
991
|
+
// MEMORY API ENDPOINTS
|
|
992
|
+
// ============================================================================
|
|
993
|
+
useGetMemoriesQuery: `# useGetMemoriesQuery
|
|
994
|
+
|
|
995
|
+
**Package**: \`@iblai/data-layer\`
|
|
996
|
+
**File**: \`packages/data-layer/src/features/memory/api-slice.ts\`
|
|
997
|
+
**Feature**: Mentor Memory/RAG
|
|
998
|
+
|
|
999
|
+
\`\`\`typescript
|
|
1000
|
+
import { useGetMemoriesQuery } from '@iblai/data-layer';
|
|
1001
|
+
|
|
1002
|
+
const { data: memories, isLoading } = useGetMemoriesQuery({
|
|
1003
|
+
org: string,
|
|
1004
|
+
mentorId: string,
|
|
1005
|
+
page?: number,
|
|
1006
|
+
pageSize?: number,
|
|
1007
|
+
category?: string,
|
|
1008
|
+
});
|
|
1009
|
+
|
|
1010
|
+
// Response type
|
|
1011
|
+
interface MemoriesFetchResponse {
|
|
1012
|
+
count: number;
|
|
1013
|
+
results: Memory[];
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
interface Memory {
|
|
1017
|
+
id: string;
|
|
1018
|
+
content: string;
|
|
1019
|
+
category: string;
|
|
1020
|
+
created_at: string;
|
|
1021
|
+
updated_at: string;
|
|
1022
|
+
}
|
|
1023
|
+
\`\`\``,
|
|
1024
|
+
useGetMemoryCategoriesQuery: `# useGetMemoryCategoriesQuery
|
|
1025
|
+
|
|
1026
|
+
**Package**: \`@iblai/data-layer\`
|
|
1027
|
+
**File**: \`packages/data-layer/src/features/memory/api-slice.ts\`
|
|
1028
|
+
**Feature**: Mentor Memory/RAG
|
|
1029
|
+
|
|
1030
|
+
\`\`\`typescript
|
|
1031
|
+
import { useGetMemoryCategoriesQuery } from '@iblai/data-layer';
|
|
1032
|
+
|
|
1033
|
+
const { data: categories, isLoading } = useGetMemoryCategoriesQuery({
|
|
1034
|
+
org: string,
|
|
1035
|
+
mentorId: string,
|
|
1036
|
+
});
|
|
1037
|
+
|
|
1038
|
+
// Returns array of available memory categories
|
|
1039
|
+
\`\`\``,
|
|
1040
|
+
useCreateMemoryMutation: `# useCreateMemoryMutation
|
|
1041
|
+
|
|
1042
|
+
**Package**: \`@iblai/data-layer\`
|
|
1043
|
+
**File**: \`packages/data-layer/src/features/memory/api-slice.ts\`
|
|
1044
|
+
**Feature**: Mentor Memory/RAG
|
|
1045
|
+
|
|
1046
|
+
\`\`\`typescript
|
|
1047
|
+
import { useCreateMemoryMutation } from '@iblai/data-layer';
|
|
1048
|
+
|
|
1049
|
+
const [createMemory, { isLoading }] = useCreateMemoryMutation();
|
|
1050
|
+
|
|
1051
|
+
const newMemory = await createMemory({
|
|
1052
|
+
org: string,
|
|
1053
|
+
mentorId: string,
|
|
1054
|
+
content: string,
|
|
1055
|
+
category?: string,
|
|
1056
|
+
}).unwrap();
|
|
1057
|
+
\`\`\``,
|
|
1058
|
+
useUpdateMemoryEntryMutation: `# useUpdateMemoryEntryMutation
|
|
1059
|
+
|
|
1060
|
+
**Package**: \`@iblai/data-layer\`
|
|
1061
|
+
**File**: \`packages/data-layer/src/features/memory/api-slice.ts\`
|
|
1062
|
+
**Feature**: Mentor Memory/RAG
|
|
1063
|
+
|
|
1064
|
+
\`\`\`typescript
|
|
1065
|
+
import { useUpdateMemoryEntryMutation } from '@iblai/data-layer';
|
|
1066
|
+
|
|
1067
|
+
const [updateMemory, { isLoading }] = useUpdateMemoryEntryMutation();
|
|
1068
|
+
|
|
1069
|
+
await updateMemory({
|
|
1070
|
+
org: string,
|
|
1071
|
+
mentorId: string,
|
|
1072
|
+
memoryId: string,
|
|
1073
|
+
content?: string,
|
|
1074
|
+
category?: string,
|
|
1075
|
+
}).unwrap();
|
|
1076
|
+
\`\`\``,
|
|
1077
|
+
useDeleteMemoryMutation: `# useDeleteMemoryMutation
|
|
1078
|
+
|
|
1079
|
+
**Package**: \`@iblai/data-layer\`
|
|
1080
|
+
**File**: \`packages/data-layer/src/features/memory/api-slice.ts\`
|
|
1081
|
+
**Feature**: Mentor Memory/RAG
|
|
1082
|
+
|
|
1083
|
+
\`\`\`typescript
|
|
1084
|
+
import { useDeleteMemoryMutation } from '@iblai/data-layer';
|
|
1085
|
+
|
|
1086
|
+
const [deleteMemory, { isLoading }] = useDeleteMemoryMutation();
|
|
1087
|
+
|
|
1088
|
+
await deleteMemory({
|
|
1089
|
+
org: string,
|
|
1090
|
+
mentorId: string,
|
|
1091
|
+
memoryId: string,
|
|
1092
|
+
}).unwrap();
|
|
1093
|
+
\`\`\``,
|
|
1094
|
+
useGetMentorUserSettingsQuery: `# useGetMentorUserSettingsQuery
|
|
1095
|
+
|
|
1096
|
+
**Package**: \`@iblai/data-layer\`
|
|
1097
|
+
**File**: \`packages/data-layer/src/features/memory/api-slice.ts\`
|
|
1098
|
+
**Feature**: User Preferences
|
|
1099
|
+
|
|
1100
|
+
\`\`\`typescript
|
|
1101
|
+
import { useGetMentorUserSettingsQuery } from '@iblai/data-layer';
|
|
1102
|
+
|
|
1103
|
+
const { data: settings, isLoading } = useGetMentorUserSettingsQuery({
|
|
1104
|
+
org: string,
|
|
1105
|
+
mentorId: string,
|
|
1106
|
+
});
|
|
1107
|
+
|
|
1108
|
+
// Returns user-specific settings for a mentor
|
|
1109
|
+
\`\`\``,
|
|
1110
|
+
useUpdateMentorUserSettingsMutation: `# useUpdateMentorUserSettingsMutation
|
|
1111
|
+
|
|
1112
|
+
**Package**: \`@iblai/data-layer\`
|
|
1113
|
+
**File**: \`packages/data-layer/src/features/memory/api-slice.ts\`
|
|
1114
|
+
**Feature**: User Preferences
|
|
1115
|
+
|
|
1116
|
+
\`\`\`typescript
|
|
1117
|
+
import { useUpdateMentorUserSettingsMutation } from '@iblai/data-layer';
|
|
1118
|
+
|
|
1119
|
+
const [updateSettings, { isLoading }] = useUpdateMentorUserSettingsMutation();
|
|
1120
|
+
|
|
1121
|
+
await updateSettings({
|
|
1122
|
+
org: string,
|
|
1123
|
+
mentorId: string,
|
|
1124
|
+
// User preference fields
|
|
1125
|
+
}).unwrap();
|
|
1126
|
+
\`\`\``,
|
|
1127
|
+
useGetMemoryFiltersQuery: `# useGetMemoryFiltersQuery
|
|
1128
|
+
|
|
1129
|
+
**Package**: \`@iblai/data-layer\`
|
|
1130
|
+
**File**: \`packages/data-layer/src/features/memory/api-slice.ts\`
|
|
1131
|
+
**Feature**: Mentor Memory/RAG
|
|
1132
|
+
|
|
1133
|
+
\`\`\`typescript
|
|
1134
|
+
import { useGetMemoryFiltersQuery } from '@iblai/data-layer';
|
|
1135
|
+
|
|
1136
|
+
const { data: filters, isLoading } = useGetMemoryFiltersQuery({
|
|
1137
|
+
org: string,
|
|
1138
|
+
mentorId: string,
|
|
1139
|
+
});
|
|
1140
|
+
|
|
1141
|
+
// Returns available filters for memory search
|
|
1142
|
+
\`\`\``,
|
|
1143
|
+
useGetFilteredMemoriesQuery: `# useGetFilteredMemoriesQuery
|
|
1144
|
+
|
|
1145
|
+
**Package**: \`@iblai/data-layer\`
|
|
1146
|
+
**File**: \`packages/data-layer/src/features/memory/api-slice.ts\`
|
|
1147
|
+
**Feature**: Mentor Memory/RAG
|
|
1148
|
+
|
|
1149
|
+
\`\`\`typescript
|
|
1150
|
+
import { useGetFilteredMemoriesQuery } from '@iblai/data-layer';
|
|
1151
|
+
|
|
1152
|
+
const { data: memories, isLoading } = useGetFilteredMemoriesQuery({
|
|
1153
|
+
org: string,
|
|
1154
|
+
mentorId: string,
|
|
1155
|
+
filters: FilterParams,
|
|
1156
|
+
});
|
|
1157
|
+
|
|
1158
|
+
// Returns filtered memories based on criteria
|
|
1159
|
+
\`\`\``,
|
|
1160
|
+
// ============================================================================
|
|
1161
|
+
// MCP API ENDPOINTS
|
|
1162
|
+
// ============================================================================
|
|
1163
|
+
useGetMCPServersQuery: `# useGetMCPServersQuery
|
|
1164
|
+
|
|
1165
|
+
**Package**: \`@iblai/data-layer\`
|
|
1166
|
+
**File**: \`packages/data-layer/src/features/mcp/api-slice.ts\`
|
|
1167
|
+
**Feature**: Model Context Protocol
|
|
1168
|
+
|
|
1169
|
+
\`\`\`typescript
|
|
1170
|
+
import { useGetMCPServersQuery } from '@iblai/data-layer';
|
|
1171
|
+
|
|
1172
|
+
const { data: servers, isLoading } = useGetMCPServersQuery({
|
|
1173
|
+
org: string,
|
|
1174
|
+
mentorId?: string, // Filter by mentor
|
|
1175
|
+
});
|
|
1176
|
+
|
|
1177
|
+
// Response type
|
|
1178
|
+
interface MCPServer {
|
|
1179
|
+
id: string;
|
|
1180
|
+
name: string;
|
|
1181
|
+
url: string;
|
|
1182
|
+
status: 'active' | 'inactive';
|
|
1183
|
+
tools: string[];
|
|
1184
|
+
}
|
|
1185
|
+
\`\`\``,
|
|
1186
|
+
useCreateMCPServerMutation: `# useCreateMCPServerMutation
|
|
1187
|
+
|
|
1188
|
+
**Package**: \`@iblai/data-layer\`
|
|
1189
|
+
**File**: \`packages/data-layer/src/features/mcp/api-slice.ts\`
|
|
1190
|
+
**Feature**: Model Context Protocol
|
|
1191
|
+
|
|
1192
|
+
\`\`\`typescript
|
|
1193
|
+
import { useCreateMCPServerMutation } from '@iblai/data-layer';
|
|
1194
|
+
|
|
1195
|
+
const [createServer, { isLoading }] = useCreateMCPServerMutation();
|
|
1196
|
+
|
|
1197
|
+
const server = await createServer({
|
|
1198
|
+
org: string,
|
|
1199
|
+
mentorId?: string,
|
|
1200
|
+
name: string,
|
|
1201
|
+
url: string,
|
|
1202
|
+
// Server configuration
|
|
1203
|
+
}).unwrap();
|
|
1204
|
+
\`\`\``,
|
|
1205
|
+
useUpdateMCPServerMutation: `# useUpdateMCPServerMutation
|
|
1206
|
+
|
|
1207
|
+
**Package**: \`@iblai/data-layer\`
|
|
1208
|
+
**File**: \`packages/data-layer/src/features/mcp/api-slice.ts\`
|
|
1209
|
+
**Feature**: Model Context Protocol
|
|
1210
|
+
|
|
1211
|
+
\`\`\`typescript
|
|
1212
|
+
import { useUpdateMCPServerMutation } from '@iblai/data-layer';
|
|
1213
|
+
|
|
1214
|
+
const [updateServer, { isLoading }] = useUpdateMCPServerMutation();
|
|
1215
|
+
|
|
1216
|
+
await updateServer({
|
|
1217
|
+
org: string,
|
|
1218
|
+
serverId: string,
|
|
1219
|
+
name?: string,
|
|
1220
|
+
url?: string,
|
|
1221
|
+
}).unwrap();
|
|
1222
|
+
\`\`\``,
|
|
1223
|
+
useDeleteMCPServerMutation: `# useDeleteMCPServerMutation
|
|
1224
|
+
|
|
1225
|
+
**Package**: \`@iblai/data-layer\`
|
|
1226
|
+
**File**: \`packages/data-layer/src/features/mcp/api-slice.ts\`
|
|
1227
|
+
**Feature**: Model Context Protocol
|
|
1228
|
+
|
|
1229
|
+
\`\`\`typescript
|
|
1230
|
+
import { useDeleteMCPServerMutation } from '@iblai/data-layer';
|
|
1231
|
+
|
|
1232
|
+
const [deleteServer, { isLoading }] = useDeleteMCPServerMutation();
|
|
1233
|
+
|
|
1234
|
+
await deleteServer({
|
|
1235
|
+
org: string,
|
|
1236
|
+
serverId: string,
|
|
1237
|
+
}).unwrap();
|
|
1238
|
+
\`\`\``,
|
|
1239
|
+
useGetOAuthServicesQuery: `# useGetOAuthServicesQuery
|
|
1240
|
+
|
|
1241
|
+
**Package**: \`@iblai/data-layer\`
|
|
1242
|
+
**File**: \`packages/data-layer/src/features/mcp/api-slice.ts\`
|
|
1243
|
+
**Feature**: OAuth Integration
|
|
1244
|
+
|
|
1245
|
+
\`\`\`typescript
|
|
1246
|
+
import { useGetOAuthServicesQuery } from '@iblai/data-layer';
|
|
1247
|
+
|
|
1248
|
+
const { data: services, isLoading } = useGetOAuthServicesQuery({
|
|
1249
|
+
org: string,
|
|
1250
|
+
});
|
|
1251
|
+
|
|
1252
|
+
// Returns available OAuth services for MCP integration
|
|
1253
|
+
\`\`\``,
|
|
1254
|
+
useGetConnectedServicesQuery: `# useGetConnectedServicesQuery
|
|
1255
|
+
|
|
1256
|
+
**Package**: \`@iblai/data-layer\`
|
|
1257
|
+
**File**: \`packages/data-layer/src/features/mcp/api-slice.ts\`
|
|
1258
|
+
**Feature**: OAuth Integration
|
|
1259
|
+
|
|
1260
|
+
\`\`\`typescript
|
|
1261
|
+
import { useGetConnectedServicesQuery } from '@iblai/data-layer';
|
|
1262
|
+
|
|
1263
|
+
const { data: connected, isLoading } = useGetConnectedServicesQuery({
|
|
1264
|
+
org: string,
|
|
1265
|
+
});
|
|
1266
|
+
|
|
1267
|
+
// Returns user's connected OAuth services
|
|
1268
|
+
\`\`\``,
|
|
1269
|
+
useStartOAuthFlowMutation: `# useStartOAuthFlowMutation
|
|
1270
|
+
|
|
1271
|
+
**Package**: \`@iblai/data-layer\`
|
|
1272
|
+
**File**: \`packages/data-layer/src/features/mcp/api-slice.ts\`
|
|
1273
|
+
**Feature**: OAuth Integration
|
|
1274
|
+
|
|
1275
|
+
\`\`\`typescript
|
|
1276
|
+
import { useStartOAuthFlowMutation } from '@iblai/data-layer';
|
|
1277
|
+
|
|
1278
|
+
const [startOAuth, { isLoading }] = useStartOAuthFlowMutation();
|
|
1279
|
+
|
|
1280
|
+
const { authUrl } = await startOAuth({
|
|
1281
|
+
org: string,
|
|
1282
|
+
serviceId: string,
|
|
1283
|
+
redirectUri: string,
|
|
1284
|
+
}).unwrap();
|
|
1285
|
+
|
|
1286
|
+
// Redirect user to authUrl to complete OAuth
|
|
1287
|
+
window.location.href = authUrl;
|
|
1288
|
+
\`\`\``,
|
|
1289
|
+
useCreateMCPServerConnectionMutation: `# useCreateMCPServerConnectionMutation
|
|
1290
|
+
|
|
1291
|
+
**Package**: \`@iblai/data-layer\`
|
|
1292
|
+
**File**: \`packages/data-layer/src/features/mcp/api-slice.ts\`
|
|
1293
|
+
**Feature**: Model Context Protocol
|
|
1294
|
+
|
|
1295
|
+
\`\`\`typescript
|
|
1296
|
+
import { useCreateMCPServerConnectionMutation } from '@iblai/data-layer';
|
|
1297
|
+
|
|
1298
|
+
const [createConnection, { isLoading }] = useCreateMCPServerConnectionMutation();
|
|
1299
|
+
|
|
1300
|
+
await createConnection({
|
|
1301
|
+
org: string,
|
|
1302
|
+
serverId: string,
|
|
1303
|
+
mentorId: string,
|
|
1304
|
+
}).unwrap();
|
|
1305
|
+
\`\`\``,
|
|
1306
|
+
useDisconnectServiceMutation: `# useDisconnectServiceMutation
|
|
1307
|
+
|
|
1308
|
+
**Package**: \`@iblai/data-layer\`
|
|
1309
|
+
**File**: \`packages/data-layer/src/features/mcp/api-slice.ts\`
|
|
1310
|
+
**Feature**: OAuth Integration
|
|
1311
|
+
|
|
1312
|
+
\`\`\`typescript
|
|
1313
|
+
import { useDisconnectServiceMutation } from '@iblai/data-layer';
|
|
1314
|
+
|
|
1315
|
+
const [disconnect, { isLoading }] = useDisconnectServiceMutation();
|
|
1316
|
+
|
|
1317
|
+
await disconnect({
|
|
1318
|
+
org: string,
|
|
1319
|
+
serviceId: string,
|
|
1320
|
+
}).unwrap();
|
|
1321
|
+
\`\`\``,
|
|
1322
|
+
// ============================================================================
|
|
1323
|
+
// NOTIFICATIONS API ENDPOINTS
|
|
1324
|
+
// ============================================================================
|
|
1325
|
+
useGetNotificationsQuery: `# useGetNotificationsQuery
|
|
1326
|
+
|
|
1327
|
+
**Package**: \`@iblai/data-layer\`
|
|
1328
|
+
**File**: \`packages/data-layer/src/features/notifications/api-slice.ts\`
|
|
1329
|
+
**Feature**: Notifications
|
|
1330
|
+
|
|
1331
|
+
\`\`\`typescript
|
|
1332
|
+
import { useGetNotificationsQuery } from '@iblai/data-layer';
|
|
1333
|
+
|
|
1334
|
+
const { data: notifications, isLoading, refetch } = useGetNotificationsQuery({
|
|
1335
|
+
page?: number,
|
|
1336
|
+
pageSize?: number,
|
|
1337
|
+
});
|
|
1338
|
+
|
|
1339
|
+
// Response type
|
|
1340
|
+
interface NotificationsResponse {
|
|
1341
|
+
count: number;
|
|
1342
|
+
results: Notification[];
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
interface Notification {
|
|
1346
|
+
id: string;
|
|
1347
|
+
title: string;
|
|
1348
|
+
message: string;
|
|
1349
|
+
type: string;
|
|
1350
|
+
is_read: boolean;
|
|
1351
|
+
created_at: string;
|
|
1352
|
+
action_url?: string;
|
|
1353
|
+
}
|
|
1354
|
+
\`\`\``,
|
|
1355
|
+
useGetNotificationsCountQuery: `# useGetNotificationsCountQuery
|
|
1356
|
+
|
|
1357
|
+
**Package**: \`@iblai/data-layer\`
|
|
1358
|
+
**File**: \`packages/data-layer/src/features/notifications/api-slice.ts\`
|
|
1359
|
+
**Feature**: Notifications
|
|
1360
|
+
|
|
1361
|
+
\`\`\`typescript
|
|
1362
|
+
import { useGetNotificationsCountQuery } from '@iblai/data-layer';
|
|
1363
|
+
|
|
1364
|
+
const { data, isLoading } = useGetNotificationsCountQuery();
|
|
1365
|
+
|
|
1366
|
+
// data.count - number of unread notifications
|
|
1367
|
+
// Used for notification badge
|
|
1368
|
+
\`\`\``,
|
|
1369
|
+
useMarkAllAsReadMutation: `# useMarkAllAsReadMutation
|
|
1370
|
+
|
|
1371
|
+
**Package**: \`@iblai/data-layer\`
|
|
1372
|
+
**File**: \`packages/data-layer/src/features/notifications/api-slice.ts\`
|
|
1373
|
+
**Feature**: Notifications
|
|
1374
|
+
|
|
1375
|
+
\`\`\`typescript
|
|
1376
|
+
import { useMarkAllAsReadMutation } from '@iblai/data-layer';
|
|
1377
|
+
|
|
1378
|
+
const [markAllRead, { isLoading }] = useMarkAllAsReadMutation();
|
|
1379
|
+
|
|
1380
|
+
await markAllRead().unwrap();
|
|
1381
|
+
|
|
1382
|
+
// Marks all notifications as read
|
|
1383
|
+
\`\`\``,
|
|
1384
|
+
useGetNotificationContextQuery: `# useGetNotificationContextQuery
|
|
1385
|
+
|
|
1386
|
+
**Package**: \`@iblai/data-layer\`
|
|
1387
|
+
**File**: \`packages/data-layer/src/features/notifications/api-slice.ts\`
|
|
1388
|
+
**Feature**: Notification Builder
|
|
1389
|
+
|
|
1390
|
+
\`\`\`typescript
|
|
1391
|
+
import { useGetNotificationContextQuery } from '@iblai/data-layer';
|
|
1392
|
+
|
|
1393
|
+
const { data: context, isLoading } = useGetNotificationContextQuery({
|
|
1394
|
+
org: string,
|
|
1395
|
+
});
|
|
1396
|
+
|
|
1397
|
+
// Returns context for notification builder
|
|
1398
|
+
\`\`\``,
|
|
1399
|
+
useCreateNotificationPreviewMutation: `# useCreateNotificationPreviewMutation
|
|
1400
|
+
|
|
1401
|
+
**Package**: \`@iblai/data-layer\`
|
|
1402
|
+
**File**: \`packages/data-layer/src/features/notifications/api-slice.ts\`
|
|
1403
|
+
**Feature**: Notification Builder
|
|
1404
|
+
|
|
1405
|
+
\`\`\`typescript
|
|
1406
|
+
import { useCreateNotificationPreviewMutation } from '@iblai/data-layer';
|
|
1407
|
+
|
|
1408
|
+
const [createPreview, { isLoading }] = useCreateNotificationPreviewMutation();
|
|
1409
|
+
|
|
1410
|
+
const preview = await createPreview({
|
|
1411
|
+
title: string,
|
|
1412
|
+
message: string,
|
|
1413
|
+
type: string,
|
|
1414
|
+
}).unwrap();
|
|
1415
|
+
\`\`\``,
|
|
1416
|
+
useSendNotificationMutation: `# useSendNotificationMutation
|
|
1417
|
+
|
|
1418
|
+
**Package**: \`@iblai/data-layer\`
|
|
1419
|
+
**File**: \`packages/data-layer/src/features/notifications/api-slice.ts\`
|
|
1420
|
+
**Feature**: Notifications
|
|
1421
|
+
|
|
1422
|
+
\`\`\`typescript
|
|
1423
|
+
import { useSendNotificationMutation } from '@iblai/data-layer';
|
|
1424
|
+
|
|
1425
|
+
const [sendNotification, { isLoading, isSuccess }] = useSendNotificationMutation();
|
|
1426
|
+
|
|
1427
|
+
await sendNotification({
|
|
1428
|
+
title: string,
|
|
1429
|
+
message: string,
|
|
1430
|
+
recipients: string[], // Array of user IDs
|
|
1431
|
+
type?: string,
|
|
1432
|
+
action_url?: string,
|
|
1433
|
+
}).unwrap();
|
|
1434
|
+
\`\`\``,
|
|
1435
|
+
// ============================================================================
|
|
1436
|
+
// CHAT API ENDPOINTS
|
|
1437
|
+
// ============================================================================
|
|
1438
|
+
usePinnedMessagesQuery: `# usePinnedMessagesQuery
|
|
1439
|
+
|
|
1440
|
+
**Package**: \`@iblai/data-layer\`
|
|
1441
|
+
**File**: \`packages/data-layer/src/features/chat/api-slice.ts\`
|
|
1442
|
+
**Feature**: Chat
|
|
1443
|
+
|
|
1444
|
+
\`\`\`typescript
|
|
1445
|
+
import { usePinnedMessagesQuery } from '@iblai/data-layer';
|
|
1446
|
+
|
|
1447
|
+
const { data: pinnedMessages, isLoading } = usePinnedMessagesQuery({
|
|
1448
|
+
org: string,
|
|
1449
|
+
mentorId: string,
|
|
1450
|
+
sessionId: string,
|
|
1451
|
+
});
|
|
1452
|
+
|
|
1453
|
+
// Returns array of pinned messages in session
|
|
1454
|
+
\`\`\``,
|
|
1455
|
+
useUpdateMessageFeedbackMutation: `# useUpdateMessageFeedbackMutation
|
|
1456
|
+
|
|
1457
|
+
**Package**: \`@iblai/data-layer\`
|
|
1458
|
+
**File**: \`packages/data-layer/src/features/chat/api-slice.ts\`
|
|
1459
|
+
**Feature**: Chat
|
|
1460
|
+
|
|
1461
|
+
\`\`\`typescript
|
|
1462
|
+
import { useUpdateMessageFeedbackMutation } from '@iblai/data-layer';
|
|
1463
|
+
|
|
1464
|
+
const [updateFeedback, { isLoading }] = useUpdateMessageFeedbackMutation();
|
|
1465
|
+
|
|
1466
|
+
await updateFeedback({
|
|
1467
|
+
org: string,
|
|
1468
|
+
mentorId: string,
|
|
1469
|
+
messageId: string,
|
|
1470
|
+
feedback: 'positive' | 'negative' | null,
|
|
1471
|
+
}).unwrap();
|
|
1472
|
+
\`\`\``,
|
|
1473
|
+
useAudioToTextMutation: `# useAudioToTextMutation
|
|
1474
|
+
|
|
1475
|
+
**Package**: \`@iblai/data-layer\`
|
|
1476
|
+
**File**: \`packages/data-layer/src/features/chat/api-slice.ts\`
|
|
1477
|
+
**Feature**: Chat (Speech-to-Text)
|
|
1478
|
+
|
|
1479
|
+
\`\`\`typescript
|
|
1480
|
+
import { useAudioToTextMutation } from '@iblai/data-layer';
|
|
1481
|
+
|
|
1482
|
+
const [convertAudio, { isLoading }] = useAudioToTextMutation();
|
|
1483
|
+
|
|
1484
|
+
const { text } = await convertAudio({
|
|
1485
|
+
audio: Blob, // Audio blob from recording
|
|
1486
|
+
format?: string, // 'webm', 'mp3', etc.
|
|
1487
|
+
}).unwrap();
|
|
1488
|
+
\`\`\``,
|
|
1489
|
+
// ============================================================================
|
|
1490
|
+
// CHAT HISTORY API ENDPOINTS
|
|
1491
|
+
// ============================================================================
|
|
1492
|
+
useGetChatHistoryQuery: `# useGetChatHistoryQuery
|
|
1493
|
+
|
|
1494
|
+
**Package**: \`@iblai/data-layer\`
|
|
1495
|
+
**File**: \`packages/data-layer/src/features/chat-history/api-slice.ts\`
|
|
1496
|
+
**Feature**: Chat History
|
|
1497
|
+
|
|
1498
|
+
\`\`\`typescript
|
|
1499
|
+
import { useGetChatHistoryQuery } from '@iblai/data-layer';
|
|
1500
|
+
|
|
1501
|
+
const { data: history, isLoading } = useGetChatHistoryQuery({
|
|
1502
|
+
org: string,
|
|
1503
|
+
mentorId: string,
|
|
1504
|
+
sessionId: string,
|
|
1505
|
+
});
|
|
1506
|
+
|
|
1507
|
+
// Returns array of messages in the session
|
|
1508
|
+
\`\`\``,
|
|
1509
|
+
useGetSessionsQuery: `# useGetSessionsQuery
|
|
1510
|
+
|
|
1511
|
+
**Package**: \`@iblai/data-layer\`
|
|
1512
|
+
**File**: \`packages/data-layer/src/features/chat-history/api-slice.ts\`
|
|
1513
|
+
**Feature**: Chat History
|
|
1514
|
+
|
|
1515
|
+
\`\`\`typescript
|
|
1516
|
+
import { useGetSessionsQuery } from '@iblai/data-layer';
|
|
1517
|
+
|
|
1518
|
+
const { data: sessions, isLoading } = useGetSessionsQuery({
|
|
1519
|
+
org: string,
|
|
1520
|
+
mentorId: string,
|
|
1521
|
+
});
|
|
1522
|
+
|
|
1523
|
+
// Returns array of session IDs with metadata
|
|
1524
|
+
interface ChatSession {
|
|
1525
|
+
session_id: string;
|
|
1526
|
+
created_at: string;
|
|
1527
|
+
updated_at: string;
|
|
1528
|
+
message_count: number;
|
|
1529
|
+
preview: string; // First message preview
|
|
1530
|
+
}
|
|
1531
|
+
\`\`\``,
|
|
1532
|
+
// ============================================================================
|
|
1533
|
+
// SKILLS API ENDPOINTS
|
|
1534
|
+
// ============================================================================
|
|
1535
|
+
useGetReportedSkillsQuery: `# useGetReportedSkillsQuery
|
|
1536
|
+
|
|
1537
|
+
**Package**: \`@iblai/data-layer\`
|
|
1538
|
+
**File**: \`packages/data-layer/src/features/skills/api-slice.ts\`
|
|
1539
|
+
**Feature**: Skills Tracking
|
|
1540
|
+
|
|
1541
|
+
\`\`\`typescript
|
|
1542
|
+
import { useGetReportedSkillsQuery } from '@iblai/data-layer';
|
|
1543
|
+
|
|
1544
|
+
const { data: skills, isLoading } = useGetReportedSkillsQuery({
|
|
1545
|
+
org: string,
|
|
1546
|
+
username: string,
|
|
1547
|
+
});
|
|
1548
|
+
|
|
1549
|
+
// Returns user's self-reported skills with proficiency levels
|
|
1550
|
+
\`\`\``,
|
|
1551
|
+
useGetDesiredSkillsQuery: `# useGetDesiredSkillsQuery
|
|
1552
|
+
|
|
1553
|
+
**Package**: \`@iblai/data-layer\`
|
|
1554
|
+
**File**: \`packages/data-layer/src/features/skills/api-slice.ts\`
|
|
1555
|
+
**Feature**: Skills Tracking
|
|
1556
|
+
|
|
1557
|
+
\`\`\`typescript
|
|
1558
|
+
import { useGetDesiredSkillsQuery } from '@iblai/data-layer';
|
|
1559
|
+
|
|
1560
|
+
const { data: skills, isLoading } = useGetDesiredSkillsQuery({
|
|
1561
|
+
org: string,
|
|
1562
|
+
username: string,
|
|
1563
|
+
});
|
|
1564
|
+
|
|
1565
|
+
// Returns skills user wants to learn
|
|
1566
|
+
\`\`\``,
|
|
1567
|
+
useGetSkillsPointsPercentileQuery: `# useGetSkillsPointsPercentileQuery
|
|
1568
|
+
|
|
1569
|
+
**Package**: \`@iblai/data-layer\`
|
|
1570
|
+
**File**: \`packages/data-layer/src/features/skills/api-slice.ts\`
|
|
1571
|
+
**Feature**: Skills Leaderboard
|
|
1572
|
+
|
|
1573
|
+
\`\`\`typescript
|
|
1574
|
+
import { useGetSkillsPointsPercentileQuery } from '@iblai/data-layer';
|
|
1575
|
+
|
|
1576
|
+
const { data, isLoading } = useGetSkillsPointsPercentileQuery({
|
|
1577
|
+
org: string,
|
|
1578
|
+
username: string,
|
|
1579
|
+
});
|
|
1580
|
+
|
|
1581
|
+
// data.percentile - user's ranking (0-100)
|
|
1582
|
+
// data.points - total skills points earned
|
|
1583
|
+
\`\`\``,
|
|
1584
|
+
useGetUserEarnedSkillsQuery: `# useGetUserEarnedSkillsQuery
|
|
1585
|
+
|
|
1586
|
+
**Package**: \`@iblai/data-layer\`
|
|
1587
|
+
**File**: \`packages/data-layer/src/features/skills/api-slice.ts\`
|
|
1588
|
+
**Feature**: Skills Tracking
|
|
1589
|
+
|
|
1590
|
+
\`\`\`typescript
|
|
1591
|
+
import { useGetUserEarnedSkillsQuery } from '@iblai/data-layer';
|
|
1592
|
+
|
|
1593
|
+
const { data: skills, isLoading } = useGetUserEarnedSkillsQuery({
|
|
1594
|
+
org: string,
|
|
1595
|
+
username: string,
|
|
1596
|
+
});
|
|
1597
|
+
|
|
1598
|
+
// Returns skills earned through courses/pathways
|
|
1599
|
+
\`\`\``,
|
|
1600
|
+
// ============================================================================
|
|
1601
|
+
// CATALOG API ENDPOINTS
|
|
1602
|
+
// ============================================================================
|
|
1603
|
+
useGetUserReportedSkillsQuery: `# useGetUserReportedSkillsQuery
|
|
1604
|
+
|
|
1605
|
+
**Package**: \`@iblai/data-layer\`
|
|
1606
|
+
**File**: \`packages/data-layer/src/features/catalog/api-slice.ts\`
|
|
1607
|
+
**Feature**: Skills Catalog
|
|
1608
|
+
|
|
1609
|
+
\`\`\`typescript
|
|
1610
|
+
import { useGetUserReportedSkillsQuery } from '@iblai/data-layer';
|
|
1611
|
+
|
|
1612
|
+
const { data: skills, isLoading } = useGetUserReportedSkillsQuery({
|
|
1613
|
+
org: string,
|
|
1614
|
+
username: string,
|
|
1615
|
+
});
|
|
1616
|
+
\`\`\``,
|
|
1617
|
+
useGetUserDesiredSkillsQuery: `# useGetUserDesiredSkillsQuery
|
|
1618
|
+
|
|
1619
|
+
**Package**: \`@iblai/data-layer\`
|
|
1620
|
+
**File**: \`packages/data-layer/src/features/catalog/api-slice.ts\`
|
|
1621
|
+
**Feature**: Skills Catalog
|
|
1622
|
+
|
|
1623
|
+
\`\`\`typescript
|
|
1624
|
+
import { useGetUserDesiredSkillsQuery } from '@iblai/data-layer';
|
|
1625
|
+
|
|
1626
|
+
const { data: skills, isLoading } = useGetUserDesiredSkillsQuery({
|
|
1627
|
+
org: string,
|
|
1628
|
+
username: string,
|
|
1629
|
+
});
|
|
1630
|
+
\`\`\``,
|
|
1631
|
+
useGetUserSkillsPointsQuery: `# useGetUserSkillsPointsQuery
|
|
1632
|
+
|
|
1633
|
+
**Package**: \`@iblai/data-layer\`
|
|
1634
|
+
**File**: \`packages/data-layer/src/features/catalog/api-slice.ts\`
|
|
1635
|
+
**Feature**: Skills Points
|
|
1636
|
+
|
|
1637
|
+
\`\`\`typescript
|
|
1638
|
+
import { useGetUserSkillsPointsQuery } from '@iblai/data-layer';
|
|
1639
|
+
|
|
1640
|
+
const { data, isLoading } = useGetUserSkillsPointsQuery({
|
|
1641
|
+
org: string,
|
|
1642
|
+
username: string,
|
|
1643
|
+
});
|
|
1644
|
+
|
|
1645
|
+
// Returns user's skills points breakdown
|
|
1646
|
+
\`\`\``,
|
|
1647
|
+
useGetUserAssignedPathwaysQuery: `# useGetUserAssignedPathwaysQuery
|
|
1648
|
+
|
|
1649
|
+
**Package**: \`@iblai/data-layer\`
|
|
1650
|
+
**File**: \`packages/data-layer/src/features/catalog/api-slice.ts\`
|
|
1651
|
+
**Feature**: Learning Pathways
|
|
1652
|
+
|
|
1653
|
+
\`\`\`typescript
|
|
1654
|
+
import { useGetUserAssignedPathwaysQuery } from '@iblai/data-layer';
|
|
1655
|
+
|
|
1656
|
+
const { data: pathways, isLoading } = useGetUserAssignedPathwaysQuery({
|
|
1657
|
+
org: string,
|
|
1658
|
+
username: string,
|
|
1659
|
+
});
|
|
1660
|
+
|
|
1661
|
+
// Returns pathways assigned to user
|
|
1662
|
+
\`\`\``,
|
|
1663
|
+
useGetUserEnrolledPathwaysQuery: `# useGetUserEnrolledPathwaysQuery
|
|
1664
|
+
|
|
1665
|
+
**Package**: \`@iblai/data-layer\`
|
|
1666
|
+
**File**: \`packages/data-layer/src/features/catalog/api-slice.ts\`
|
|
1667
|
+
**Feature**: Learning Pathways
|
|
1668
|
+
|
|
1669
|
+
\`\`\`typescript
|
|
1670
|
+
import { useGetUserEnrolledPathwaysQuery } from '@iblai/data-layer';
|
|
1671
|
+
|
|
1672
|
+
const { data: pathways, isLoading } = useGetUserEnrolledPathwaysQuery({
|
|
1673
|
+
org: string,
|
|
1674
|
+
username: string,
|
|
1675
|
+
});
|
|
1676
|
+
|
|
1677
|
+
// Returns pathways user is enrolled in with progress
|
|
1678
|
+
\`\`\``,
|
|
1679
|
+
useGetCatalogRolesQuery: `# useGetCatalogRolesQuery
|
|
1680
|
+
|
|
1681
|
+
**Package**: \`@iblai/data-layer\`
|
|
1682
|
+
**File**: \`packages/data-layer/src/features/catalog/api-slice.ts\`
|
|
1683
|
+
**Feature**: Catalog
|
|
1684
|
+
|
|
1685
|
+
\`\`\`typescript
|
|
1686
|
+
import { useGetCatalogRolesQuery } from '@iblai/data-layer';
|
|
1687
|
+
|
|
1688
|
+
const { data: roles, isLoading } = useGetCatalogRolesQuery({
|
|
1689
|
+
org: string,
|
|
1690
|
+
});
|
|
1691
|
+
|
|
1692
|
+
// Returns available catalog roles
|
|
1693
|
+
\`\`\``,
|
|
1694
|
+
useGetUserEnrolledProgramsQuery: `# useGetUserEnrolledProgramsQuery
|
|
1695
|
+
|
|
1696
|
+
**Package**: \`@iblai/data-layer\`
|
|
1697
|
+
**File**: \`packages/data-layer/src/features/catalog/api-slice.ts\`
|
|
1698
|
+
**Feature**: Programs
|
|
1699
|
+
|
|
1700
|
+
\`\`\`typescript
|
|
1701
|
+
import { useGetUserEnrolledProgramsQuery } from '@iblai/data-layer';
|
|
1702
|
+
|
|
1703
|
+
const { data: programs, isLoading } = useGetUserEnrolledProgramsQuery({
|
|
1704
|
+
org: string,
|
|
1705
|
+
username: string,
|
|
1706
|
+
});
|
|
1707
|
+
|
|
1708
|
+
// Returns programs user is enrolled in with progress
|
|
1709
|
+
\`\`\``,
|
|
1710
|
+
// ============================================================================
|
|
1711
|
+
// SEARCH API ENDPOINTS
|
|
1712
|
+
// ============================================================================
|
|
1713
|
+
useGetPersonnalizedSearchQuery: `# useGetPersonnalizedSearchQuery
|
|
1714
|
+
|
|
1715
|
+
**Package**: \`@iblai/data-layer\`
|
|
1716
|
+
**File**: \`packages/data-layer/src/features/search/api-slice.ts\`
|
|
1717
|
+
**Feature**: Search
|
|
1718
|
+
|
|
1719
|
+
\`\`\`typescript
|
|
1720
|
+
import { useGetPersonnalizedSearchQuery } from '@iblai/data-layer';
|
|
1721
|
+
|
|
1722
|
+
const { data: results, isLoading } = useGetPersonnalizedSearchQuery({
|
|
1723
|
+
org: string,
|
|
1724
|
+
query: string,
|
|
1725
|
+
type?: 'mentor' | 'course' | 'all',
|
|
1726
|
+
});
|
|
1727
|
+
|
|
1728
|
+
// Returns personalized search results
|
|
1729
|
+
\`\`\``,
|
|
1730
|
+
useGetCatalogSearchQuery: `# useGetCatalogSearchQuery
|
|
1731
|
+
|
|
1732
|
+
**Package**: \`@iblai/data-layer\`
|
|
1733
|
+
**File**: \`packages/data-layer/src/features/search/api-slice.ts\`
|
|
1734
|
+
**Feature**: Search
|
|
1735
|
+
|
|
1736
|
+
\`\`\`typescript
|
|
1737
|
+
import { useGetCatalogSearchQuery } from '@iblai/data-layer';
|
|
1738
|
+
|
|
1739
|
+
const { data: results, isLoading } = useGetCatalogSearchQuery({
|
|
1740
|
+
org: string,
|
|
1741
|
+
query: string,
|
|
1742
|
+
});
|
|
1743
|
+
|
|
1744
|
+
// Returns catalog search results (courses, pathways, programs)
|
|
1745
|
+
\`\`\``,
|
|
1746
|
+
useGetAiSearchMentorsQuery: `# useGetAiSearchMentorsQuery
|
|
1747
|
+
|
|
1748
|
+
**Package**: \`@iblai/data-layer\`
|
|
1749
|
+
**File**: \`packages/data-layer/src/features/search/ai-search-api-slice.ts\`
|
|
1750
|
+
**Feature**: AI Search
|
|
1751
|
+
|
|
1752
|
+
\`\`\`typescript
|
|
1753
|
+
import { useGetAiSearchMentorsQuery } from '@iblai/data-layer';
|
|
1754
|
+
|
|
1755
|
+
const { data: mentors, isLoading } = useGetAiSearchMentorsQuery({
|
|
1756
|
+
org: string,
|
|
1757
|
+
query: string,
|
|
1758
|
+
});
|
|
1759
|
+
|
|
1760
|
+
// Returns AI-ranked mentor recommendations
|
|
1761
|
+
\`\`\``,
|
|
1762
|
+
useGetRecommendationsAiSearchQuery: `# useGetRecommendationsAiSearchQuery
|
|
1763
|
+
|
|
1764
|
+
**Package**: \`@iblai/data-layer\`
|
|
1765
|
+
**File**: \`packages/data-layer/src/features/search/ai-search-api-slice.ts\`
|
|
1766
|
+
**Feature**: AI Recommendations
|
|
1767
|
+
|
|
1768
|
+
\`\`\`typescript
|
|
1769
|
+
import { useGetRecommendationsAiSearchQuery } from '@iblai/data-layer';
|
|
1770
|
+
|
|
1771
|
+
const { data: recommendations, isLoading } = useGetRecommendationsAiSearchQuery({
|
|
1772
|
+
org: string,
|
|
1773
|
+
userId?: string,
|
|
1774
|
+
});
|
|
1775
|
+
|
|
1776
|
+
// Returns AI-powered personalized recommendations
|
|
1777
|
+
\`\`\``,
|
|
1778
|
+
useGetRecommendedPromptsListQuery: `# useGetRecommendedPromptsListQuery
|
|
1779
|
+
|
|
1780
|
+
**Package**: \`@iblai/data-layer\`
|
|
1781
|
+
**File**: \`packages/data-layer/src/features/search/ai-search-api-slice.ts\`
|
|
1782
|
+
**Feature**: Guided Prompts
|
|
1783
|
+
|
|
1784
|
+
\`\`\`typescript
|
|
1785
|
+
import { useGetRecommendedPromptsListQuery } from '@iblai/data-layer';
|
|
1786
|
+
|
|
1787
|
+
const { data: prompts, isLoading } = useGetRecommendedPromptsListQuery({
|
|
1788
|
+
org: string,
|
|
1789
|
+
mentorId: string,
|
|
1790
|
+
});
|
|
1791
|
+
|
|
1792
|
+
// Returns recommended prompts for mentor
|
|
1793
|
+
\`\`\``,
|
|
1794
|
+
useCreateRecommendedPromptMutation: `# useCreateRecommendedPromptMutation
|
|
1795
|
+
|
|
1796
|
+
**Package**: \`@iblai/data-layer\`
|
|
1797
|
+
**File**: \`packages/data-layer/src/features/search/ai-search-api-slice.ts\`
|
|
1798
|
+
**Feature**: Guided Prompts
|
|
1799
|
+
|
|
1800
|
+
\`\`\`typescript
|
|
1801
|
+
import { useCreateRecommendedPromptMutation } from '@iblai/data-layer';
|
|
1802
|
+
|
|
1803
|
+
const [createPrompt, { isLoading }] = useCreateRecommendedPromptMutation();
|
|
1804
|
+
|
|
1805
|
+
await createPrompt({
|
|
1806
|
+
org: string,
|
|
1807
|
+
mentorId: string,
|
|
1808
|
+
prompt: string,
|
|
1809
|
+
}).unwrap();
|
|
1810
|
+
\`\`\``,
|
|
1811
|
+
useUpdateRecommendedPromptMutation: `# useUpdateRecommendedPromptMutation
|
|
1812
|
+
|
|
1813
|
+
**Package**: \`@iblai/data-layer\`
|
|
1814
|
+
**File**: \`packages/data-layer/src/features/search/ai-search-api-slice.ts\`
|
|
1815
|
+
**Feature**: Guided Prompts
|
|
1816
|
+
|
|
1817
|
+
\`\`\`typescript
|
|
1818
|
+
import { useUpdateRecommendedPromptMutation } from '@iblai/data-layer';
|
|
1819
|
+
|
|
1820
|
+
const [updatePrompt, { isLoading }] = useUpdateRecommendedPromptMutation();
|
|
1821
|
+
|
|
1822
|
+
await updatePrompt({
|
|
1823
|
+
org: string,
|
|
1824
|
+
mentorId: string,
|
|
1825
|
+
promptId: string,
|
|
1826
|
+
prompt: string,
|
|
1827
|
+
}).unwrap();
|
|
1828
|
+
\`\`\``,
|
|
1829
|
+
useDeleteRecommendedPromptMutation: `# useDeleteRecommendedPromptMutation
|
|
1830
|
+
|
|
1831
|
+
**Package**: \`@iblai/data-layer\`
|
|
1832
|
+
**File**: \`packages/data-layer/src/features/search/ai-search-api-slice.ts\`
|
|
1833
|
+
**Feature**: Guided Prompts
|
|
1834
|
+
|
|
1835
|
+
\`\`\`typescript
|
|
1836
|
+
import { useDeleteRecommendedPromptMutation } from '@iblai/data-layer';
|
|
1837
|
+
|
|
1838
|
+
const [deletePrompt, { isLoading }] = useDeleteRecommendedPromptMutation();
|
|
1839
|
+
|
|
1840
|
+
await deletePrompt({
|
|
1841
|
+
org: string,
|
|
1842
|
+
mentorId: string,
|
|
1843
|
+
promptId: string,
|
|
1844
|
+
}).unwrap();
|
|
1845
|
+
\`\`\``,
|
|
1846
|
+
// ============================================================================
|
|
1847
|
+
// PROJECTS API ENDPOINTS
|
|
1848
|
+
// ============================================================================
|
|
1849
|
+
useGetUserProjectsQuery: `# useGetUserProjectsQuery
|
|
1850
|
+
|
|
1851
|
+
**Package**: \`@iblai/data-layer\`
|
|
1852
|
+
**File**: \`packages/data-layer/src/features/projects/api-slice.ts\`
|
|
1853
|
+
**Feature**: Projects
|
|
1854
|
+
|
|
1855
|
+
\`\`\`typescript
|
|
1856
|
+
import { useGetUserProjectsQuery } from '@iblai/data-layer';
|
|
1857
|
+
|
|
1858
|
+
const { data: projects, isLoading } = useGetUserProjectsQuery({
|
|
1859
|
+
org: string,
|
|
1860
|
+
username: string,
|
|
1861
|
+
});
|
|
1862
|
+
|
|
1863
|
+
// Returns user's projects
|
|
1864
|
+
\`\`\``,
|
|
1865
|
+
useGetUserProjectDetailsQuery: `# useGetUserProjectDetailsQuery
|
|
1866
|
+
|
|
1867
|
+
**Package**: \`@iblai/data-layer\`
|
|
1868
|
+
**File**: \`packages/data-layer/src/features/projects/api-slice.ts\`
|
|
1869
|
+
**Feature**: Projects
|
|
1870
|
+
|
|
1871
|
+
\`\`\`typescript
|
|
1872
|
+
import { useGetUserProjectDetailsQuery } from '@iblai/data-layer';
|
|
1873
|
+
|
|
1874
|
+
const { data: project, isLoading } = useGetUserProjectDetailsQuery({
|
|
1875
|
+
org: string,
|
|
1876
|
+
projectId: string,
|
|
1877
|
+
});
|
|
1878
|
+
|
|
1879
|
+
// Returns project details
|
|
1880
|
+
\`\`\``,
|
|
1881
|
+
useCreateUserProjectMutation: `# useCreateUserProjectMutation
|
|
1882
|
+
|
|
1883
|
+
**Package**: \`@iblai/data-layer\`
|
|
1884
|
+
**File**: \`packages/data-layer/src/features/projects/api-slice.ts\`
|
|
1885
|
+
**Feature**: Projects
|
|
1886
|
+
|
|
1887
|
+
\`\`\`typescript
|
|
1888
|
+
import { useCreateUserProjectMutation } from '@iblai/data-layer';
|
|
1889
|
+
|
|
1890
|
+
const [createProject, { isLoading }] = useCreateUserProjectMutation();
|
|
1891
|
+
|
|
1892
|
+
const project = await createProject({
|
|
1893
|
+
org: string,
|
|
1894
|
+
name: string,
|
|
1895
|
+
description?: string,
|
|
1896
|
+
}).unwrap();
|
|
1897
|
+
\`\`\``,
|
|
1898
|
+
useUpdateUserProjectMutation: `# useUpdateUserProjectMutation
|
|
1899
|
+
|
|
1900
|
+
**Package**: \`@iblai/data-layer\`
|
|
1901
|
+
**File**: \`packages/data-layer/src/features/projects/api-slice.ts\`
|
|
1902
|
+
**Feature**: Projects
|
|
1903
|
+
|
|
1904
|
+
\`\`\`typescript
|
|
1905
|
+
import { useUpdateUserProjectMutation } from '@iblai/data-layer';
|
|
1906
|
+
|
|
1907
|
+
const [updateProject, { isLoading }] = useUpdateUserProjectMutation();
|
|
1908
|
+
|
|
1909
|
+
await updateProject({
|
|
1910
|
+
org: string,
|
|
1911
|
+
projectId: string,
|
|
1912
|
+
name?: string,
|
|
1913
|
+
description?: string,
|
|
1914
|
+
}).unwrap();
|
|
1915
|
+
\`\`\``,
|
|
1916
|
+
useDeleteUserProjectMutation: `# useDeleteUserProjectMutation
|
|
1917
|
+
|
|
1918
|
+
**Package**: \`@iblai/data-layer\`
|
|
1919
|
+
**File**: \`packages/data-layer/src/features/projects/api-slice.ts\`
|
|
1920
|
+
**Feature**: Projects
|
|
1921
|
+
|
|
1922
|
+
\`\`\`typescript
|
|
1923
|
+
import { useDeleteUserProjectMutation } from '@iblai/data-layer';
|
|
1924
|
+
|
|
1925
|
+
const [deleteProject, { isLoading }] = useDeleteUserProjectMutation();
|
|
1926
|
+
|
|
1927
|
+
await deleteProject({
|
|
1928
|
+
org: string,
|
|
1929
|
+
projectId: string,
|
|
1930
|
+
}).unwrap();
|
|
1931
|
+
\`\`\``,
|
|
1932
|
+
// ============================================================================
|
|
1933
|
+
// AUTH API ENDPOINTS
|
|
1934
|
+
// ============================================================================
|
|
1935
|
+
useExchangeAppleTokenMutation: `# useExchangeAppleTokenMutation
|
|
1936
|
+
|
|
1937
|
+
**Package**: \`@iblai/data-layer\`
|
|
1938
|
+
**File**: \`packages/data-layer/src/features/auth/api-slice.ts\`
|
|
1939
|
+
**Feature**: Authentication (Apple Sign-In)
|
|
1940
|
+
|
|
1941
|
+
\`\`\`typescript
|
|
1942
|
+
import { useExchangeAppleTokenMutation } from '@iblai/data-layer';
|
|
1943
|
+
|
|
1944
|
+
const [exchangeToken, { isLoading }] = useExchangeAppleTokenMutation();
|
|
1945
|
+
|
|
1946
|
+
const { access_token, refresh_token, user } = await exchangeToken({
|
|
1947
|
+
identityToken: string, // From Apple
|
|
1948
|
+
authorizationCode: string, // From Apple
|
|
1949
|
+
}).unwrap();
|
|
1950
|
+
\`\`\``,
|
|
1951
|
+
useRefreshJwtTokenMutation: `# useRefreshJwtTokenMutation
|
|
1952
|
+
|
|
1953
|
+
**Package**: \`@iblai/data-layer\`
|
|
1954
|
+
**File**: \`packages/data-layer/src/features/auth/api-slice.ts\`
|
|
1955
|
+
**Feature**: Authentication
|
|
1956
|
+
|
|
1957
|
+
\`\`\`typescript
|
|
1958
|
+
import { useRefreshJwtTokenMutation } from '@iblai/data-layer';
|
|
1959
|
+
|
|
1960
|
+
const [refreshToken, { isLoading }] = useRefreshJwtTokenMutation();
|
|
1961
|
+
|
|
1962
|
+
const { access_token } = await refreshToken({
|
|
1963
|
+
refresh_token: string,
|
|
1964
|
+
}).unwrap();
|
|
1965
|
+
\`\`\``,
|
|
1966
|
+
useGetMfeContextQuery: `# useGetMfeContextQuery
|
|
1967
|
+
|
|
1968
|
+
**Package**: \`@iblai/data-layer\`
|
|
1969
|
+
**File**: \`packages/data-layer/src/features/auth/api-slice.ts\`
|
|
1970
|
+
**Feature**: Micro Frontend
|
|
1971
|
+
|
|
1972
|
+
\`\`\`typescript
|
|
1973
|
+
import { useGetMfeContextQuery } from '@iblai/data-layer';
|
|
1974
|
+
|
|
1975
|
+
const { data: context, isLoading } = useGetMfeContextQuery({
|
|
1976
|
+
appId: string,
|
|
1977
|
+
});
|
|
1978
|
+
|
|
1979
|
+
// Returns MFE context for embedded apps
|
|
1980
|
+
\`\`\``,
|
|
1981
|
+
useGetAppTokenQuery: `# useGetAppTokenQuery
|
|
1982
|
+
|
|
1983
|
+
**Package**: \`@iblai/data-layer\`
|
|
1984
|
+
**File**: \`packages/data-layer/src/features/auth/api-slice.ts\`
|
|
1985
|
+
**Feature**: Authentication
|
|
1986
|
+
|
|
1987
|
+
\`\`\`typescript
|
|
1988
|
+
import { useGetAppTokenQuery } from '@iblai/data-layer';
|
|
1989
|
+
|
|
1990
|
+
const { data, isLoading } = useGetAppTokenQuery({
|
|
1991
|
+
appId: string,
|
|
1992
|
+
});
|
|
1993
|
+
|
|
1994
|
+
// Returns app-specific token
|
|
1995
|
+
\`\`\``,
|
|
1996
|
+
// ============================================================================
|
|
1997
|
+
// BILLING/STRIPE API ENDPOINTS
|
|
1998
|
+
// ============================================================================
|
|
1999
|
+
useGetBillingInfoQuery: `# useGetBillingInfoQuery
|
|
2000
|
+
|
|
2001
|
+
**Package**: \`@iblai/data-layer\`
|
|
2002
|
+
**File**: \`packages/data-layer/src/features/billing/api-slice.ts\`
|
|
2003
|
+
**Feature**: Billing
|
|
2004
|
+
|
|
2005
|
+
\`\`\`typescript
|
|
2006
|
+
import { useGetBillingInfoQuery } from '@iblai/data-layer';
|
|
2007
|
+
|
|
2008
|
+
const { data: billing, isLoading } = useGetBillingInfoQuery({
|
|
2009
|
+
org: string,
|
|
2010
|
+
});
|
|
2011
|
+
|
|
2012
|
+
// Returns billing and subscription information
|
|
2013
|
+
\`\`\``,
|
|
2014
|
+
useCreateCheckoutSessionMutation: `# useCreateCheckoutSessionMutation
|
|
2015
|
+
|
|
2016
|
+
**Package**: \`@iblai/data-layer\`
|
|
2017
|
+
**File**: \`packages/data-layer/src/features/stripe/api-slice.ts\`
|
|
2018
|
+
**Feature**: Stripe Payments
|
|
2019
|
+
|
|
2020
|
+
\`\`\`typescript
|
|
2021
|
+
import { useCreateCheckoutSessionMutation } from '@iblai/data-layer';
|
|
2022
|
+
|
|
2023
|
+
const [createSession, { isLoading }] = useCreateCheckoutSessionMutation();
|
|
2024
|
+
|
|
2025
|
+
const { sessionUrl } = await createSession({
|
|
2026
|
+
org: string,
|
|
2027
|
+
priceId: string,
|
|
2028
|
+
successUrl: string,
|
|
2029
|
+
cancelUrl: string,
|
|
2030
|
+
}).unwrap();
|
|
2031
|
+
|
|
2032
|
+
// Redirect to Stripe checkout
|
|
2033
|
+
window.location.href = sessionUrl;
|
|
2034
|
+
\`\`\``,
|
|
2035
|
+
useCreatePortalSessionMutation: `# useCreatePortalSessionMutation
|
|
2036
|
+
|
|
2037
|
+
**Package**: \`@iblai/data-layer\`
|
|
2038
|
+
**File**: \`packages/data-layer/src/features/stripe/api-slice.ts\`
|
|
2039
|
+
**Feature**: Stripe Billing Portal
|
|
2040
|
+
|
|
2041
|
+
\`\`\`typescript
|
|
2042
|
+
import { useCreatePortalSessionMutation } from '@iblai/data-layer';
|
|
2043
|
+
|
|
2044
|
+
const [createPortal, { isLoading }] = useCreatePortalSessionMutation();
|
|
2045
|
+
|
|
2046
|
+
const { portalUrl } = await createPortal({
|
|
2047
|
+
org: string,
|
|
2048
|
+
returnUrl: string,
|
|
2049
|
+
}).unwrap();
|
|
2050
|
+
|
|
2051
|
+
// Redirect to Stripe billing portal
|
|
2052
|
+
window.location.href = portalUrl;
|
|
2053
|
+
\`\`\``,
|
|
2054
|
+
// ============================================================================
|
|
2055
|
+
// TRAINING DOCUMENTS API ENDPOINTS
|
|
2056
|
+
// ============================================================================
|
|
2057
|
+
useGetTrainingDocumentsQuery: `# useGetTrainingDocumentsQuery
|
|
2058
|
+
|
|
2059
|
+
**Package**: \`@iblai/data-layer\`
|
|
2060
|
+
**File**: \`packages/data-layer/src/features/training-documents/api-slice.ts\`
|
|
2061
|
+
**Feature**: Mentor Training
|
|
2062
|
+
|
|
2063
|
+
\`\`\`typescript
|
|
2064
|
+
import { useGetTrainingDocumentsQuery } from '@iblai/data-layer';
|
|
2065
|
+
|
|
2066
|
+
const { data: documents, isLoading } = useGetTrainingDocumentsQuery({
|
|
2067
|
+
org: string,
|
|
2068
|
+
mentorId: string,
|
|
2069
|
+
});
|
|
2070
|
+
|
|
2071
|
+
// Response type
|
|
2072
|
+
interface TrainingDocument {
|
|
2073
|
+
id: string;
|
|
2074
|
+
name: string;
|
|
2075
|
+
file_type: string;
|
|
2076
|
+
file_size: number;
|
|
2077
|
+
status: 'processing' | 'ready' | 'error';
|
|
2078
|
+
created_at: string;
|
|
2079
|
+
}
|
|
2080
|
+
\`\`\``,
|
|
2081
|
+
useUploadTrainingDocumentMutation: `# useUploadTrainingDocumentMutation
|
|
2082
|
+
|
|
2083
|
+
**Package**: \`@iblai/data-layer\`
|
|
2084
|
+
**File**: \`packages/data-layer/src/features/training-documents/api-slice.ts\`
|
|
2085
|
+
**Feature**: Mentor Training
|
|
2086
|
+
|
|
2087
|
+
\`\`\`typescript
|
|
2088
|
+
import { useUploadTrainingDocumentMutation } from '@iblai/data-layer';
|
|
2089
|
+
|
|
2090
|
+
const [uploadDocument, { isLoading }] = useUploadTrainingDocumentMutation();
|
|
2091
|
+
|
|
2092
|
+
const doc = await uploadDocument({
|
|
2093
|
+
org: string,
|
|
2094
|
+
mentorId: string,
|
|
2095
|
+
file: File,
|
|
2096
|
+
name?: string,
|
|
2097
|
+
}).unwrap();
|
|
2098
|
+
\`\`\``,
|
|
2099
|
+
useDeleteTrainingDocumentMutation: `# useDeleteTrainingDocumentMutation
|
|
2100
|
+
|
|
2101
|
+
**Package**: \`@iblai/data-layer\`
|
|
2102
|
+
**File**: \`packages/data-layer/src/features/training-documents/api-slice.ts\`
|
|
2103
|
+
**Feature**: Mentor Training
|
|
2104
|
+
|
|
2105
|
+
\`\`\`typescript
|
|
2106
|
+
import { useDeleteTrainingDocumentMutation } from '@iblai/data-layer';
|
|
2107
|
+
|
|
2108
|
+
const [deleteDocument, { isLoading }] = useDeleteTrainingDocumentMutation();
|
|
2109
|
+
|
|
2110
|
+
await deleteDocument({
|
|
2111
|
+
org: string,
|
|
2112
|
+
mentorId: string,
|
|
2113
|
+
documentId: string,
|
|
2114
|
+
}).unwrap();
|
|
2115
|
+
\`\`\``,
|
|
2116
|
+
// ============================================================================
|
|
2117
|
+
// CREDENTIALS API ENDPOINTS
|
|
2118
|
+
// ============================================================================
|
|
2119
|
+
useGetUserCredentialsQuery: `# useGetUserCredentialsQuery
|
|
2120
|
+
|
|
2121
|
+
**Package**: \`@iblai/data-layer\`
|
|
2122
|
+
**File**: \`packages/data-layer/src/features/credentials/api-slice.ts\`
|
|
2123
|
+
**Feature**: Credentials
|
|
2124
|
+
|
|
2125
|
+
\`\`\`typescript
|
|
2126
|
+
import { useGetUserCredentialsQuery } from '@iblai/data-layer';
|
|
2127
|
+
|
|
2128
|
+
const { data: credentials, isLoading } = useGetUserCredentialsQuery({
|
|
2129
|
+
org: string,
|
|
2130
|
+
username: string,
|
|
2131
|
+
});
|
|
2132
|
+
|
|
2133
|
+
// Returns user's earned credentials
|
|
2134
|
+
\`\`\``,
|
|
2135
|
+
useGetIntegrationCredentialsQuery: `# useGetIntegrationCredentialsQuery
|
|
2136
|
+
|
|
2137
|
+
**Package**: \`@iblai/data-layer\`
|
|
2138
|
+
**File**: \`packages/data-layer/src/features/credentials/api-slice.ts\`
|
|
2139
|
+
**Feature**: Integrations
|
|
2140
|
+
|
|
2141
|
+
\`\`\`typescript
|
|
2142
|
+
import { useGetIntegrationCredentialsQuery } from '@iblai/data-layer';
|
|
2143
|
+
|
|
2144
|
+
const { data: credentials, isLoading } = useGetIntegrationCredentialsQuery({
|
|
2145
|
+
org: string,
|
|
2146
|
+
});
|
|
2147
|
+
|
|
2148
|
+
// Returns integration credentials for third-party services
|
|
2149
|
+
\`\`\``,
|
|
2150
|
+
useGetOAuthCredentialsQuery: `# useGetOAuthCredentialsQuery
|
|
2151
|
+
|
|
2152
|
+
**Package**: \`@iblai/data-layer\`
|
|
2153
|
+
**File**: \`packages/data-layer/src/features/credentials/api-slice.ts\`
|
|
2154
|
+
**Feature**: OAuth
|
|
2155
|
+
|
|
2156
|
+
\`\`\`typescript
|
|
2157
|
+
import { useGetOAuthCredentialsQuery } from '@iblai/data-layer';
|
|
2158
|
+
|
|
2159
|
+
const { data: credentials, isLoading } = useGetOAuthCredentialsQuery({
|
|
2160
|
+
org: string,
|
|
2161
|
+
});
|
|
2162
|
+
|
|
2163
|
+
// Returns OAuth credentials configuration
|
|
2164
|
+
\`\`\``,
|
|
2165
|
+
// ============================================================================
|
|
2166
|
+
// LLM API ENDPOINTS
|
|
2167
|
+
// ============================================================================
|
|
2168
|
+
useGetLLMProvidersQuery: `# useGetLLMProvidersQuery
|
|
2169
|
+
|
|
2170
|
+
**Package**: \`@iblai/data-layer\`
|
|
2171
|
+
**File**: \`packages/data-layer/src/features/llms/api-slice.ts\`
|
|
2172
|
+
**Feature**: LLM Configuration
|
|
2173
|
+
|
|
2174
|
+
\`\`\`typescript
|
|
2175
|
+
import { useGetLLMProvidersQuery } from '@iblai/data-layer';
|
|
2176
|
+
|
|
2177
|
+
const { data: providers, isLoading } = useGetLLMProvidersQuery({
|
|
2178
|
+
org: string,
|
|
2179
|
+
});
|
|
2180
|
+
|
|
2181
|
+
// Returns available LLM providers (OpenAI, Anthropic, etc.)
|
|
2182
|
+
\`\`\``,
|
|
2183
|
+
useGetLLMModelsQuery: `# useGetLLMModelsQuery
|
|
2184
|
+
|
|
2185
|
+
**Package**: \`@iblai/data-layer\`
|
|
2186
|
+
**File**: \`packages/data-layer/src/features/llms/api-slice.ts\`
|
|
2187
|
+
**Feature**: LLM Configuration
|
|
2188
|
+
|
|
2189
|
+
\`\`\`typescript
|
|
2190
|
+
import { useGetLLMModelsQuery } from '@iblai/data-layer';
|
|
2191
|
+
|
|
2192
|
+
const { data: models, isLoading } = useGetLLMModelsQuery({
|
|
2193
|
+
org: string,
|
|
2194
|
+
provider?: string, // Filter by provider
|
|
2195
|
+
});
|
|
2196
|
+
|
|
2197
|
+
// Returns available LLM models
|
|
2198
|
+
\`\`\``,
|
|
2199
|
+
// ============================================================================
|
|
2200
|
+
// CHAT FILES API ENDPOINTS
|
|
2201
|
+
// ============================================================================
|
|
2202
|
+
useGetChatFilesQuery: `# useGetChatFilesQuery
|
|
2203
|
+
|
|
2204
|
+
**Package**: \`@iblai/data-layer\`
|
|
2205
|
+
**File**: \`packages/data-layer/src/features/chat-files/api-slice.ts\`
|
|
2206
|
+
**Feature**: Chat Files
|
|
2207
|
+
|
|
2208
|
+
\`\`\`typescript
|
|
2209
|
+
import { useGetChatFilesQuery } from '@iblai/data-layer';
|
|
2210
|
+
|
|
2211
|
+
const { data: files, isLoading } = useGetChatFilesQuery({
|
|
2212
|
+
org: string,
|
|
2213
|
+
mentorId: string,
|
|
2214
|
+
sessionId: string,
|
|
2215
|
+
});
|
|
2216
|
+
|
|
2217
|
+
// Returns files uploaded in chat session
|
|
2218
|
+
\`\`\``,
|
|
2219
|
+
useUploadChatFileMutation: `# useUploadChatFileMutation
|
|
2220
|
+
|
|
2221
|
+
**Package**: \`@iblai/data-layer\`
|
|
2222
|
+
**File**: \`packages/data-layer/src/features/chat-files/api-slice.ts\`
|
|
2223
|
+
**Feature**: Chat Files
|
|
2224
|
+
|
|
2225
|
+
\`\`\`typescript
|
|
2226
|
+
import { useUploadChatFileMutation } from '@iblai/data-layer';
|
|
2227
|
+
|
|
2228
|
+
const [uploadFile, { isLoading }] = useUploadChatFileMutation();
|
|
2229
|
+
|
|
2230
|
+
const fileRef = await uploadFile({
|
|
2231
|
+
org: string,
|
|
2232
|
+
mentorId: string,
|
|
2233
|
+
sessionId: string,
|
|
2234
|
+
file: File,
|
|
2235
|
+
}).unwrap();
|
|
2236
|
+
\`\`\``,
|
|
2237
|
+
};
|
|
2238
|
+
export function getApiQueryInfo(queryName) {
|
|
2239
|
+
const info = queries[queryName];
|
|
2240
|
+
if (!info) {
|
|
2241
|
+
return `Query "${queryName}" not found.
|
|
2242
|
+
|
|
2243
|
+
## Available API Queries by Feature
|
|
2244
|
+
|
|
2245
|
+
**Mentor Management:**
|
|
2246
|
+
- useGetMentorsQuery - List mentors with pagination
|
|
2247
|
+
- useGetMentorDetailsQuery - Single mentor details
|
|
2248
|
+
- useGetMentorSettingsQuery - Mentor settings (authenticated)
|
|
2249
|
+
- useGetMentorPublicSettingsQuery - Mentor settings (public)
|
|
2250
|
+
- useCreateMentorMutation - Create mentor
|
|
2251
|
+
- useEditMentorMutation - Update mentor
|
|
2252
|
+
- useDeleteMentorMutation - Delete mentor
|
|
2253
|
+
- useForkMentorMutation - Copy/fork mentor
|
|
2254
|
+
- useStarMentorMutation - Star mentor
|
|
2255
|
+
- useUnstarMentorMutation - Unstar mentor
|
|
2256
|
+
- useStarredMentorsQuery - Get starred mentors
|
|
2257
|
+
- useGetRecentlyAccessedMentorsQuery - Recent mentors
|
|
2258
|
+
- useGetFreeUsageCountQuery - Free usage count
|
|
2259
|
+
- useSeedMentorsMutation - Seed default mentors
|
|
2260
|
+
- useGetModerationLogsQuery - Moderation logs
|
|
2261
|
+
- useUpdateMentorVisibilityStatusMutation - Update visibility
|
|
2262
|
+
|
|
2263
|
+
**Shareable Links:**
|
|
2264
|
+
- useCreateShareableLinkMutation - Create share link
|
|
2265
|
+
- useUpdateShareableLinkMutation - Update share link
|
|
2266
|
+
- useRevokeShareableLinkMutation - Revoke share link
|
|
2267
|
+
|
|
2268
|
+
**User Management:**
|
|
2269
|
+
- useGetUserMetadataQuery - User profile
|
|
2270
|
+
- useUpdateUserMetadataMutation - Update profile
|
|
2271
|
+
- useUpdateUserAccountMutation - Update account
|
|
2272
|
+
- useResetPasswordMutation - Password reset
|
|
2273
|
+
- useUploadProfileImageMutation - Upload avatar
|
|
2274
|
+
- useRemoveProfileImageMutation - Remove avatar
|
|
2275
|
+
- useUpdateUserRoleMutation - Update role
|
|
2276
|
+
|
|
2277
|
+
**Platform Administration:**
|
|
2278
|
+
- useGetPlatformUsersQuery - Platform users
|
|
2279
|
+
- usePlatformUserGroupsQuery - User groups
|
|
2280
|
+
- useGetPlatformUserGroupDetailsQuery - Group details
|
|
2281
|
+
- useCreatePlatformUserGroupMutation - Create group
|
|
2282
|
+
- useUpdatePlatformUserGroupMutation - Update group
|
|
2283
|
+
- useDeletePlatformUserGroupMutation - Delete group
|
|
2284
|
+
- useInviteUserMutation - Invite user
|
|
2285
|
+
- useUpdatePlatformUserRoleWithPoliciesMutation - Update role
|
|
2286
|
+
- usePlatformInvitationsQuery - List invitations
|
|
2287
|
+
- useUsersGradesPassedQuery - Passing grades
|
|
2288
|
+
|
|
2289
|
+
**Tenant Configuration:**
|
|
2290
|
+
- useGetTenantMetadataQuery - Tenant metadata
|
|
2291
|
+
- useUpdateTenantMetadataMutation - Update metadata
|
|
2292
|
+
- useGetUserTenantsQuery - User's tenants
|
|
2293
|
+
|
|
2294
|
+
**RBAC:**
|
|
2295
|
+
- useGetRbacGroupsQuery - RBAC groups
|
|
2296
|
+
- useGetRbacPermissionsQuery - User permissions
|
|
2297
|
+
|
|
2298
|
+
**Memory/RAG:**
|
|
2299
|
+
- useGetMemoriesQuery - List memories
|
|
2300
|
+
- useGetMemoryCategoriesQuery - Memory categories
|
|
2301
|
+
- useCreateMemoryMutation - Create memory
|
|
2302
|
+
- useUpdateMemoryEntryMutation - Update memory
|
|
2303
|
+
- useDeleteMemoryMutation - Delete memory
|
|
2304
|
+
- useGetMentorUserSettingsQuery - User settings
|
|
2305
|
+
- useUpdateMentorUserSettingsMutation - Update settings
|
|
2306
|
+
- useGetMemoryFiltersQuery - Memory filters
|
|
2307
|
+
- useGetFilteredMemoriesQuery - Filtered memories
|
|
2308
|
+
|
|
2309
|
+
**MCP (Model Context Protocol):**
|
|
2310
|
+
- useGetMCPServersQuery - MCP servers
|
|
2311
|
+
- useCreateMCPServerMutation - Create server
|
|
2312
|
+
- useUpdateMCPServerMutation - Update server
|
|
2313
|
+
- useDeleteMCPServerMutation - Delete server
|
|
2314
|
+
- useGetOAuthServicesQuery - OAuth services
|
|
2315
|
+
- useGetConnectedServicesQuery - Connected services
|
|
2316
|
+
- useStartOAuthFlowMutation - Start OAuth
|
|
2317
|
+
- useCreateMCPServerConnectionMutation - Connect to server
|
|
2318
|
+
- useDisconnectServiceMutation - Disconnect service
|
|
2319
|
+
|
|
2320
|
+
**Notifications:**
|
|
2321
|
+
- useGetNotificationsQuery - List notifications
|
|
2322
|
+
- useGetNotificationsCountQuery - Unread count
|
|
2323
|
+
- useMarkAllAsReadMutation - Mark all read
|
|
2324
|
+
- useGetNotificationContextQuery - Builder context
|
|
2325
|
+
- useCreateNotificationPreviewMutation - Preview
|
|
2326
|
+
- useSendNotificationMutation - Send notification
|
|
2327
|
+
|
|
2328
|
+
**Chat:**
|
|
2329
|
+
- usePinnedMessagesQuery - Pinned messages
|
|
2330
|
+
- useUpdateMessageFeedbackMutation - Message feedback
|
|
2331
|
+
- useAudioToTextMutation - Speech to text
|
|
2332
|
+
- useGetChatHistoryQuery - Chat history
|
|
2333
|
+
- useGetSessionsQuery - Chat sessions
|
|
2334
|
+
|
|
2335
|
+
**Skills:**
|
|
2336
|
+
- useGetReportedSkillsQuery - Reported skills
|
|
2337
|
+
- useGetDesiredSkillsQuery - Desired skills
|
|
2338
|
+
- useGetSkillsPointsPercentileQuery - Percentile
|
|
2339
|
+
- useGetUserEarnedSkillsQuery - Earned skills
|
|
2340
|
+
|
|
2341
|
+
**Catalog:**
|
|
2342
|
+
- useGetUserReportedSkillsQuery - User skills
|
|
2343
|
+
- useGetUserDesiredSkillsQuery - Desired skills
|
|
2344
|
+
- useGetUserSkillsPointsQuery - Skills points
|
|
2345
|
+
- useGetUserAssignedPathwaysQuery - Assigned pathways
|
|
2346
|
+
- useGetUserEnrolledPathwaysQuery - Enrolled pathways
|
|
2347
|
+
- useGetCatalogRolesQuery - Catalog roles
|
|
2348
|
+
- useGetUserEnrolledProgramsQuery - Enrolled programs
|
|
2349
|
+
|
|
2350
|
+
**Search:**
|
|
2351
|
+
- useGetPersonnalizedSearchQuery - Personalized search
|
|
2352
|
+
- useGetCatalogSearchQuery - Catalog search
|
|
2353
|
+
- useGetAiSearchMentorsQuery - AI mentor search
|
|
2354
|
+
- useGetRecommendationsAiSearchQuery - AI recommendations
|
|
2355
|
+
- useGetRecommendedPromptsListQuery - Recommended prompts
|
|
2356
|
+
- useCreateRecommendedPromptMutation - Create prompt
|
|
2357
|
+
- useUpdateRecommendedPromptMutation - Update prompt
|
|
2358
|
+
- useDeleteRecommendedPromptMutation - Delete prompt
|
|
2359
|
+
|
|
2360
|
+
**Projects:**
|
|
2361
|
+
- useGetUserProjectsQuery - User projects
|
|
2362
|
+
- useGetUserProjectDetailsQuery - Project details
|
|
2363
|
+
- useCreateUserProjectMutation - Create project
|
|
2364
|
+
- useUpdateUserProjectMutation - Update project
|
|
2365
|
+
- useDeleteUserProjectMutation - Delete project
|
|
2366
|
+
|
|
2367
|
+
**Authentication:**
|
|
2368
|
+
- useExchangeAppleTokenMutation - Apple Sign-In
|
|
2369
|
+
- useRefreshJwtTokenMutation - Refresh JWT
|
|
2370
|
+
- useGetMfeContextQuery - MFE context
|
|
2371
|
+
- useGetAppTokenQuery - App token
|
|
2372
|
+
|
|
2373
|
+
**Billing:**
|
|
2374
|
+
- useGetBillingInfoQuery - Billing info
|
|
2375
|
+
- useCreateCheckoutSessionMutation - Stripe checkout
|
|
2376
|
+
- useCreatePortalSessionMutation - Billing portal
|
|
2377
|
+
|
|
2378
|
+
**Training Documents:**
|
|
2379
|
+
- useGetTrainingDocumentsQuery - Training docs
|
|
2380
|
+
- useUploadTrainingDocumentMutation - Upload doc
|
|
2381
|
+
- useDeleteTrainingDocumentMutation - Delete doc
|
|
2382
|
+
|
|
2383
|
+
**Credentials:**
|
|
2384
|
+
- useGetUserCredentialsQuery - User credentials
|
|
2385
|
+
- useGetIntegrationCredentialsQuery - Integration creds
|
|
2386
|
+
- useGetOAuthCredentialsQuery - OAuth creds
|
|
2387
|
+
|
|
2388
|
+
**LLM Configuration:**
|
|
2389
|
+
- useGetLLMProvidersQuery - LLM providers
|
|
2390
|
+
- useGetLLMModelsQuery - LLM models
|
|
2391
|
+
|
|
2392
|
+
**Chat Files:**
|
|
2393
|
+
- useGetChatFilesQuery - Chat files
|
|
2394
|
+
- useUploadChatFileMutation - Upload file`;
|
|
2395
|
+
}
|
|
2396
|
+
return info;
|
|
2397
|
+
}
|
|
2398
|
+
//# sourceMappingURL=api-query-info.js.map
|