@studyfetch/sdk 1.2.0 → 1.3.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/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/resources/v1/components.d.mts +239 -11
- package/resources/v1/components.d.mts.map +1 -1
- package/resources/v1/components.d.ts +239 -11
- package/resources/v1/components.d.ts.map +1 -1
- package/resources/v1/components.js +10 -29
- package/resources/v1/components.js.map +1 -1
- package/resources/v1/components.mjs +10 -29
- package/resources/v1/components.mjs.map +1 -1
- package/resources/v1/index.d.mts +2 -2
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +2 -2
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/materials/index.d.mts +2 -2
- package/resources/v1/materials/index.d.mts.map +1 -1
- package/resources/v1/materials/index.d.ts +2 -2
- package/resources/v1/materials/index.d.ts.map +1 -1
- package/resources/v1/materials/index.js.map +1 -1
- package/resources/v1/materials/index.mjs +1 -1
- package/resources/v1/materials/index.mjs.map +1 -1
- package/resources/v1/materials/materials.d.mts +192 -9
- package/resources/v1/materials/materials.d.mts.map +1 -1
- package/resources/v1/materials/materials.d.ts +192 -9
- package/resources/v1/materials/materials.d.ts.map +1 -1
- package/resources/v1/materials/materials.js +6 -17
- package/resources/v1/materials/materials.js.map +1 -1
- package/resources/v1/materials/materials.mjs +7 -18
- package/resources/v1/materials/materials.mjs.map +1 -1
- package/resources/v1/materials/upload.d.mts +133 -11
- package/resources/v1/materials/upload.d.mts.map +1 -1
- package/resources/v1/materials/upload.d.ts +133 -11
- package/resources/v1/materials/upload.d.ts.map +1 -1
- package/resources/v1/materials/upload.js +12 -14
- package/resources/v1/materials/upload.js.map +1 -1
- package/resources/v1/materials/upload.mjs +12 -14
- package/resources/v1/materials/upload.mjs.map +1 -1
- package/resources/v1/v1.d.mts +4 -4
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +4 -4
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs.map +1 -1
- package/src/resources/v1/components.ts +312 -34
- package/src/resources/v1/index.ts +8 -0
- package/src/resources/v1/materials/index.ts +10 -1
- package/src/resources/v1/materials/materials.ts +262 -21
- package/src/resources/v1/materials/upload.ts +175 -19
- package/src/resources/v1/v1.ts +16 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -12,7 +12,7 @@ export class Components extends APIResource {
|
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```ts
|
|
15
|
-
* await client.v1.components.create({
|
|
15
|
+
* const component = await client.v1.components.create({
|
|
16
16
|
* config: {},
|
|
17
17
|
* name: 'My Study Component',
|
|
18
18
|
* origin: 'chat',
|
|
@@ -20,12 +20,8 @@ export class Components extends APIResource {
|
|
|
20
20
|
* });
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
|
-
create(body: ComponentCreateParams, options?: RequestOptions): APIPromise<
|
|
24
|
-
return this._client.post('/api/v1/components', {
|
|
25
|
-
body,
|
|
26
|
-
...options,
|
|
27
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
28
|
-
});
|
|
23
|
+
create(body: ComponentCreateParams, options?: RequestOptions): APIPromise<ComponentCreateResponse> {
|
|
24
|
+
return this._client.post('/api/v1/components', { body, ...options });
|
|
29
25
|
}
|
|
30
26
|
|
|
31
27
|
/**
|
|
@@ -33,14 +29,11 @@ export class Components extends APIResource {
|
|
|
33
29
|
*
|
|
34
30
|
* @example
|
|
35
31
|
* ```ts
|
|
36
|
-
* await client.v1.components.retrieve('id');
|
|
32
|
+
* const component = await client.v1.components.retrieve('id');
|
|
37
33
|
* ```
|
|
38
34
|
*/
|
|
39
|
-
retrieve(id: string, options?: RequestOptions): APIPromise<
|
|
40
|
-
return this._client.get(path`/api/v1/components/${id}`,
|
|
41
|
-
...options,
|
|
42
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
43
|
-
});
|
|
35
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<ComponentRetrieveResponse> {
|
|
36
|
+
return this._client.get(path`/api/v1/components/${id}`, options);
|
|
44
37
|
}
|
|
45
38
|
|
|
46
39
|
/**
|
|
@@ -48,15 +41,15 @@ export class Components extends APIResource {
|
|
|
48
41
|
*
|
|
49
42
|
* @example
|
|
50
43
|
* ```ts
|
|
51
|
-
* await client.v1.components.update('id');
|
|
44
|
+
* const component = await client.v1.components.update('id');
|
|
52
45
|
* ```
|
|
53
46
|
*/
|
|
54
|
-
update(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
});
|
|
47
|
+
update(
|
|
48
|
+
id: string,
|
|
49
|
+
body: ComponentUpdateParams,
|
|
50
|
+
options?: RequestOptions,
|
|
51
|
+
): APIPromise<ComponentUpdateResponse> {
|
|
52
|
+
return this._client.patch(path`/api/v1/components/${id}`, { body, ...options });
|
|
60
53
|
}
|
|
61
54
|
|
|
62
55
|
/**
|
|
@@ -64,15 +57,14 @@ export class Components extends APIResource {
|
|
|
64
57
|
*
|
|
65
58
|
* @example
|
|
66
59
|
* ```ts
|
|
67
|
-
* await client.v1.components.list();
|
|
60
|
+
* const components = await client.v1.components.list();
|
|
68
61
|
* ```
|
|
69
62
|
*/
|
|
70
|
-
list(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
});
|
|
63
|
+
list(
|
|
64
|
+
query: ComponentListParams | null | undefined = {},
|
|
65
|
+
options?: RequestOptions,
|
|
66
|
+
): APIPromise<ComponentListResponse> {
|
|
67
|
+
return this._client.get('/api/v1/components', { query, ...options });
|
|
76
68
|
}
|
|
77
69
|
|
|
78
70
|
/**
|
|
@@ -121,15 +113,15 @@ export class Components extends APIResource {
|
|
|
121
113
|
*
|
|
122
114
|
* @example
|
|
123
115
|
* ```ts
|
|
124
|
-
* await client.v1.components.embed('id');
|
|
116
|
+
* const response = await client.v1.components.embed('id');
|
|
125
117
|
* ```
|
|
126
118
|
*/
|
|
127
|
-
embed(
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
});
|
|
119
|
+
embed(
|
|
120
|
+
id: string,
|
|
121
|
+
body: ComponentEmbedParams,
|
|
122
|
+
options?: RequestOptions,
|
|
123
|
+
): APIPromise<ComponentEmbedResponse> {
|
|
124
|
+
return this._client.post(path`/api/v1/components/${id}/embed`, { body, ...options });
|
|
133
125
|
}
|
|
134
126
|
|
|
135
127
|
/**
|
|
@@ -146,6 +138,287 @@ export class Components extends APIResource {
|
|
|
146
138
|
}
|
|
147
139
|
}
|
|
148
140
|
|
|
141
|
+
export interface ComponentCreateResponse {
|
|
142
|
+
/**
|
|
143
|
+
* Component ID (MongoDB ObjectId)
|
|
144
|
+
*/
|
|
145
|
+
_id: string;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Unique component identifier
|
|
149
|
+
*/
|
|
150
|
+
componentId: string;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Component configuration
|
|
154
|
+
*/
|
|
155
|
+
config: unknown;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Creation timestamp
|
|
159
|
+
*/
|
|
160
|
+
createdAt: string;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Component name
|
|
164
|
+
*/
|
|
165
|
+
name: string;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Organization ID
|
|
169
|
+
*/
|
|
170
|
+
organization: string;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Component status
|
|
174
|
+
*/
|
|
175
|
+
status: 'active' | 'inactive' | 'draft';
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Component type
|
|
179
|
+
*/
|
|
180
|
+
type: 'chat' | 'flashcards' | 'tests' | 'scenarios' | 'explainers' | 'audio-recap';
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Last update timestamp
|
|
184
|
+
*/
|
|
185
|
+
updatedAt: string;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Usage statistics
|
|
189
|
+
*/
|
|
190
|
+
usage: unknown;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Component description
|
|
194
|
+
*/
|
|
195
|
+
description?: string;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export interface ComponentRetrieveResponse {
|
|
199
|
+
/**
|
|
200
|
+
* Component ID (MongoDB ObjectId)
|
|
201
|
+
*/
|
|
202
|
+
_id: string;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Unique component identifier
|
|
206
|
+
*/
|
|
207
|
+
componentId: string;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Component configuration
|
|
211
|
+
*/
|
|
212
|
+
config: unknown;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Creation timestamp
|
|
216
|
+
*/
|
|
217
|
+
createdAt: string;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Component name
|
|
221
|
+
*/
|
|
222
|
+
name: string;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Organization ID
|
|
226
|
+
*/
|
|
227
|
+
organization: string;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Component status
|
|
231
|
+
*/
|
|
232
|
+
status: 'active' | 'inactive' | 'draft';
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Component type
|
|
236
|
+
*/
|
|
237
|
+
type: 'chat' | 'flashcards' | 'tests' | 'scenarios' | 'explainers' | 'audio-recap';
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Last update timestamp
|
|
241
|
+
*/
|
|
242
|
+
updatedAt: string;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Usage statistics
|
|
246
|
+
*/
|
|
247
|
+
usage: unknown;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Component description
|
|
251
|
+
*/
|
|
252
|
+
description?: string;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export interface ComponentUpdateResponse {
|
|
256
|
+
/**
|
|
257
|
+
* Component ID (MongoDB ObjectId)
|
|
258
|
+
*/
|
|
259
|
+
_id: string;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Unique component identifier
|
|
263
|
+
*/
|
|
264
|
+
componentId: string;
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Component configuration
|
|
268
|
+
*/
|
|
269
|
+
config: unknown;
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Creation timestamp
|
|
273
|
+
*/
|
|
274
|
+
createdAt: string;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Component name
|
|
278
|
+
*/
|
|
279
|
+
name: string;
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Organization ID
|
|
283
|
+
*/
|
|
284
|
+
organization: string;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Component status
|
|
288
|
+
*/
|
|
289
|
+
status: 'active' | 'inactive' | 'draft';
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Component type
|
|
293
|
+
*/
|
|
294
|
+
type: 'chat' | 'flashcards' | 'tests' | 'scenarios' | 'explainers' | 'audio-recap';
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Last update timestamp
|
|
298
|
+
*/
|
|
299
|
+
updatedAt: string;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Usage statistics
|
|
303
|
+
*/
|
|
304
|
+
usage: unknown;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Component description
|
|
308
|
+
*/
|
|
309
|
+
description?: string;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export type ComponentListResponse = Array<ComponentListResponse.ComponentListResponseItem>;
|
|
313
|
+
|
|
314
|
+
export namespace ComponentListResponse {
|
|
315
|
+
export interface ComponentListResponseItem {
|
|
316
|
+
/**
|
|
317
|
+
* Component ID (MongoDB ObjectId)
|
|
318
|
+
*/
|
|
319
|
+
_id: string;
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Unique component identifier
|
|
323
|
+
*/
|
|
324
|
+
componentId: string;
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Component configuration
|
|
328
|
+
*/
|
|
329
|
+
config: unknown;
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Creation timestamp
|
|
333
|
+
*/
|
|
334
|
+
createdAt: string;
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Component name
|
|
338
|
+
*/
|
|
339
|
+
name: string;
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Organization ID
|
|
343
|
+
*/
|
|
344
|
+
organization: string;
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Component status
|
|
348
|
+
*/
|
|
349
|
+
status: 'active' | 'inactive' | 'draft';
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Component type
|
|
353
|
+
*/
|
|
354
|
+
type: 'chat' | 'flashcards' | 'tests' | 'scenarios' | 'explainers' | 'audio-recap';
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Last update timestamp
|
|
358
|
+
*/
|
|
359
|
+
updatedAt: string;
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Usage statistics
|
|
363
|
+
*/
|
|
364
|
+
usage: unknown;
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Component description
|
|
368
|
+
*/
|
|
369
|
+
description?: string;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
export interface ComponentEmbedResponse {
|
|
374
|
+
/**
|
|
375
|
+
* JWT token for authentication
|
|
376
|
+
*/
|
|
377
|
+
token: string;
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Component ID
|
|
381
|
+
*/
|
|
382
|
+
componentId: string;
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Component type
|
|
386
|
+
*/
|
|
387
|
+
componentType: string;
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* The embed URL for iframe integration
|
|
391
|
+
*/
|
|
392
|
+
embedUrl: string;
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* Token expiration timestamp
|
|
396
|
+
*/
|
|
397
|
+
expiresAt: string;
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Embed options
|
|
401
|
+
*/
|
|
402
|
+
options: ComponentEmbedResponse.Options;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
export namespace ComponentEmbedResponse {
|
|
406
|
+
/**
|
|
407
|
+
* Embed options
|
|
408
|
+
*/
|
|
409
|
+
export interface Options {
|
|
410
|
+
/**
|
|
411
|
+
* Embed height
|
|
412
|
+
*/
|
|
413
|
+
height?: string;
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Embed width
|
|
417
|
+
*/
|
|
418
|
+
width?: string;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
149
422
|
export interface ComponentCreateParams {
|
|
150
423
|
/**
|
|
151
424
|
* Component-specific configuration
|
|
@@ -364,6 +637,11 @@ export namespace ComponentEmbedParams {
|
|
|
364
637
|
|
|
365
638
|
export declare namespace Components {
|
|
366
639
|
export {
|
|
640
|
+
type ComponentCreateResponse as ComponentCreateResponse,
|
|
641
|
+
type ComponentRetrieveResponse as ComponentRetrieveResponse,
|
|
642
|
+
type ComponentUpdateResponse as ComponentUpdateResponse,
|
|
643
|
+
type ComponentListResponse as ComponentListResponse,
|
|
644
|
+
type ComponentEmbedResponse as ComponentEmbedResponse,
|
|
367
645
|
type ComponentCreateParams as ComponentCreateParams,
|
|
368
646
|
type ComponentUpdateParams as ComponentUpdateParams,
|
|
369
647
|
type ComponentListParams as ComponentListParams,
|
|
@@ -22,6 +22,11 @@ export {
|
|
|
22
22
|
} from './chat/index';
|
|
23
23
|
export {
|
|
24
24
|
Components,
|
|
25
|
+
type ComponentCreateResponse,
|
|
26
|
+
type ComponentRetrieveResponse,
|
|
27
|
+
type ComponentUpdateResponse,
|
|
28
|
+
type ComponentListResponse,
|
|
29
|
+
type ComponentEmbedResponse,
|
|
25
30
|
type ComponentCreateParams,
|
|
26
31
|
type ComponentUpdateParams,
|
|
27
32
|
type ComponentListParams,
|
|
@@ -43,6 +48,9 @@ export {
|
|
|
43
48
|
export { Folders, type FolderCreateParams, type FolderUpdateParams, type FolderListParams } from './folders';
|
|
44
49
|
export {
|
|
45
50
|
Materials,
|
|
51
|
+
type MaterialCreateResponse,
|
|
52
|
+
type MaterialRetrieveResponse,
|
|
53
|
+
type MaterialListResponse,
|
|
46
54
|
type MaterialCreateParams,
|
|
47
55
|
type MaterialListParams,
|
|
48
56
|
type MaterialGetDownloadURLParams,
|
|
@@ -3,9 +3,18 @@
|
|
|
3
3
|
export { Bulk } from './bulk';
|
|
4
4
|
export {
|
|
5
5
|
Materials,
|
|
6
|
+
type MaterialCreateResponse,
|
|
7
|
+
type MaterialRetrieveResponse,
|
|
8
|
+
type MaterialListResponse,
|
|
6
9
|
type MaterialCreateParams,
|
|
7
10
|
type MaterialListParams,
|
|
8
11
|
type MaterialGetDownloadURLParams,
|
|
9
12
|
} from './materials';
|
|
10
13
|
export { Test } from './test';
|
|
11
|
-
export {
|
|
14
|
+
export {
|
|
15
|
+
Upload,
|
|
16
|
+
type UploadUploadFileResponse,
|
|
17
|
+
type UploadUploadFromURLResponse,
|
|
18
|
+
type UploadUploadFileParams,
|
|
19
|
+
type UploadUploadFromURLParams,
|
|
20
|
+
} from './upload';
|