@studyfetch/sdk 1.9.0 → 1.11.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.
Files changed (69) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/package.json +1 -1
  3. package/resources/v1/components.d.mts +425 -6
  4. package/resources/v1/components.d.mts.map +1 -1
  5. package/resources/v1/components.d.ts +425 -6
  6. package/resources/v1/components.d.ts.map +1 -1
  7. package/resources/v1/components.js +1 -1
  8. package/resources/v1/components.mjs +1 -1
  9. package/resources/v1/explainers.d.mts +116 -5
  10. package/resources/v1/explainers.d.mts.map +1 -1
  11. package/resources/v1/explainers.d.ts +116 -5
  12. package/resources/v1/explainers.d.ts.map +1 -1
  13. package/resources/v1/explainers.js +14 -6
  14. package/resources/v1/explainers.js.map +1 -1
  15. package/resources/v1/explainers.mjs +14 -6
  16. package/resources/v1/explainers.mjs.map +1 -1
  17. package/resources/v1/index.d.mts +1 -1
  18. package/resources/v1/index.d.mts.map +1 -1
  19. package/resources/v1/index.d.ts +1 -1
  20. package/resources/v1/index.d.ts.map +1 -1
  21. package/resources/v1/index.js.map +1 -1
  22. package/resources/v1/index.mjs +1 -1
  23. package/resources/v1/index.mjs.map +1 -1
  24. package/resources/v1/scenarios/component.d.mts +51 -3
  25. package/resources/v1/scenarios/component.d.mts.map +1 -1
  26. package/resources/v1/scenarios/component.d.ts +51 -3
  27. package/resources/v1/scenarios/component.d.ts.map +1 -1
  28. package/resources/v1/scenarios/component.js +4 -4
  29. package/resources/v1/scenarios/component.js.map +1 -1
  30. package/resources/v1/scenarios/component.mjs +4 -4
  31. package/resources/v1/scenarios/component.mjs.map +1 -1
  32. package/resources/v1/scenarios/index.d.mts +1 -1
  33. package/resources/v1/scenarios/index.d.mts.map +1 -1
  34. package/resources/v1/scenarios/index.d.ts +1 -1
  35. package/resources/v1/scenarios/index.d.ts.map +1 -1
  36. package/resources/v1/scenarios/index.js.map +1 -1
  37. package/resources/v1/scenarios/index.mjs +1 -1
  38. package/resources/v1/scenarios/index.mjs.map +1 -1
  39. package/resources/v1/scenarios/scenarios.d.mts +123 -9
  40. package/resources/v1/scenarios/scenarios.d.mts.map +1 -1
  41. package/resources/v1/scenarios/scenarios.d.ts +123 -9
  42. package/resources/v1/scenarios/scenarios.d.ts.map +1 -1
  43. package/resources/v1/scenarios/scenarios.js +19 -10
  44. package/resources/v1/scenarios/scenarios.js.map +1 -1
  45. package/resources/v1/scenarios/scenarios.mjs +19 -10
  46. package/resources/v1/scenarios/scenarios.mjs.map +1 -1
  47. package/resources/v1/v1.d.mts +2 -2
  48. package/resources/v1/v1.d.mts.map +1 -1
  49. package/resources/v1/v1.d.ts +2 -2
  50. package/resources/v1/v1.d.ts.map +1 -1
  51. package/resources/v1/v1.js.map +1 -1
  52. package/resources/v1/v1.mjs +1 -1
  53. package/resources/v1/v1.mjs.map +1 -1
  54. package/src/resources/v1/components.ts +562 -6
  55. package/src/resources/v1/explainers.ts +141 -8
  56. package/src/resources/v1/index.ts +6 -1
  57. package/src/resources/v1/scenarios/component.ts +63 -5
  58. package/src/resources/v1/scenarios/index.ts +6 -1
  59. package/src/resources/v1/scenarios/scenarios.ts +150 -12
  60. package/src/resources/v1/v1.ts +7 -1
  61. package/src/version.ts +1 -1
  62. package/version.d.mts +1 -1
  63. package/version.d.mts.map +1 -1
  64. package/version.d.ts +1 -1
  65. package/version.d.ts.map +1 -1
  66. package/version.js +1 -1
  67. package/version.js.map +1 -1
  68. package/version.mjs +1 -1
  69. package/version.mjs.map +1 -1
@@ -11,7 +11,13 @@ export class Explainers extends APIResource {
11
11
  *
12
12
  * @example
13
13
  * ```ts
14
- * await client.v1.explainers.create();
14
+ * await client.v1.explainers.create({
15
+ * componentId: 'componentId',
16
+ * folderIds: ['string'],
17
+ * materialIds: ['string'],
18
+ * targetLength: 15,
19
+ * title: 'title',
20
+ * });
15
21
  * ```
16
22
  */
17
23
  create(body: ExplainerCreateParams, options?: RequestOptions): APIPromise<void> {
@@ -23,27 +29,154 @@ export class Explainers extends APIResource {
23
29
  }
24
30
 
25
31
  /**
26
- * Handle webhook events
32
+ * Handle explainer video webhook events
27
33
  *
28
34
  * @example
29
35
  * ```ts
30
- * await client.v1.explainers.handleWebhook({ body: 'body' });
36
+ * await client.v1.explainers.handleWebhook({
37
+ * event: 'video.completed',
38
+ * video: { id: 'id' },
39
+ * });
31
40
  * ```
32
41
  */
33
- handleWebhook(params: ExplainerHandleWebhookParams, options?: RequestOptions): APIPromise<void> {
34
- const { body } = params;
42
+ handleWebhook(body: ExplainerHandleWebhookParams, options?: RequestOptions): APIPromise<void> {
35
43
  return this._client.post('/api/v1/explainers/webhook', {
36
- body: body,
44
+ body,
37
45
  ...options,
38
46
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
39
47
  });
40
48
  }
41
49
  }
42
50
 
43
- export interface ExplainerCreateParams {}
51
+ export interface ExplainerCreateParams {
52
+ /**
53
+ * Component ID
54
+ */
55
+ componentId: string;
56
+
57
+ /**
58
+ * Folder IDs to include
59
+ */
60
+ folderIds: Array<string>;
61
+
62
+ /**
63
+ * Material IDs to include
64
+ */
65
+ materialIds: Array<string>;
66
+
67
+ /**
68
+ * Target video length in seconds
69
+ */
70
+ targetLength: number;
71
+
72
+ /**
73
+ * Title for the explainer video
74
+ */
75
+ title: string;
76
+
77
+ /**
78
+ * Enable image search for visuals
79
+ */
80
+ imageSearch?: boolean;
81
+
82
+ /**
83
+ * AI model to use
84
+ */
85
+ model?: string;
86
+
87
+ /**
88
+ * Video style
89
+ */
90
+ style?: string;
91
+
92
+ /**
93
+ * User ID
94
+ */
95
+ userId?: string;
96
+
97
+ /**
98
+ * Create vertical video format (9:16)
99
+ */
100
+ verticalVideo?: boolean;
101
+
102
+ /**
103
+ * Enable web search for additional content
104
+ */
105
+ webSearch?: boolean;
106
+ }
44
107
 
45
108
  export interface ExplainerHandleWebhookParams {
46
- body: string;
109
+ /**
110
+ * Webhook event type
111
+ */
112
+ event: 'video.completed' | 'video.progress' | 'video.failed';
113
+
114
+ /**
115
+ * Video data
116
+ */
117
+ video: ExplainerHandleWebhookParams.Video;
118
+ }
119
+
120
+ export namespace ExplainerHandleWebhookParams {
121
+ /**
122
+ * Video data
123
+ */
124
+ export interface Video {
125
+ /**
126
+ * Video ID
127
+ */
128
+ id: string;
129
+
130
+ /**
131
+ * Image sources
132
+ */
133
+ imageSources?: unknown;
134
+
135
+ /**
136
+ * Progress percentage
137
+ */
138
+ progress?: number;
139
+
140
+ /**
141
+ * Video sections
142
+ */
143
+ sections?: Array<string>;
144
+
145
+ /**
146
+ * Stream ID
147
+ */
148
+ streamId?: string;
149
+
150
+ /**
151
+ * Stream URL
152
+ */
153
+ streamUrl?: string;
154
+
155
+ /**
156
+ * Thumbnail URL
157
+ */
158
+ thumbnailUrl?: string;
159
+
160
+ /**
161
+ * Video transcript
162
+ */
163
+ transcript?: string;
164
+
165
+ /**
166
+ * Video URL
167
+ */
168
+ videoUrl?: string;
169
+
170
+ /**
171
+ * Web search results
172
+ */
173
+ webSearchResults?: unknown;
174
+
175
+ /**
176
+ * Web search sources
177
+ */
178
+ webSearchSources?: unknown;
179
+ }
47
180
  }
48
181
 
49
182
  export declare namespace Explainers {
@@ -49,7 +49,12 @@ export {
49
49
  type MaterialGetDownloadURLParams,
50
50
  } from './materials/index';
51
51
  export { Organizations } from './organizations/index';
52
- export { Scenarios, type ScenarioCreateParams, type ScenarioUpdateParams } from './scenarios/index';
52
+ export {
53
+ Scenarios,
54
+ type ScenarioCreateParams,
55
+ type ScenarioUpdateParams,
56
+ type ScenarioSubmitParams,
57
+ } from './scenarios/index';
53
58
  export {
54
59
  Tests,
55
60
  type TestCreateParams,
@@ -28,14 +28,14 @@ export class Component extends APIResource {
28
28
  * @example
29
29
  * ```ts
30
30
  * await client.v1.scenarios.component.update('componentId', {
31
- * body: 'body',
31
+ * body_componentId: 'componentId',
32
+ * name: 'name',
32
33
  * });
33
34
  * ```
34
35
  */
35
- update(componentID: string, params: ComponentUpdateParams, options?: RequestOptions): APIPromise<void> {
36
- const { body } = params;
36
+ update(componentID: string, body: ComponentUpdateParams, options?: RequestOptions): APIPromise<void> {
37
37
  return this._client.put(path`/api/v1/scenarios/component/${componentID}`, {
38
- body: body,
38
+ body,
39
39
  ...options,
40
40
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
41
41
  });
@@ -58,7 +58,65 @@ export class Component extends APIResource {
58
58
  }
59
59
 
60
60
  export interface ComponentUpdateParams {
61
- body: string;
61
+ /**
62
+ * Associated component ID
63
+ */
64
+ body_componentId: string;
65
+
66
+ /**
67
+ * Scenario name
68
+ */
69
+ name: string;
70
+
71
+ /**
72
+ * Scenario characters
73
+ */
74
+ characters?: Array<unknown>;
75
+
76
+ /**
77
+ * Scenario context
78
+ */
79
+ context?: string;
80
+
81
+ /**
82
+ * Scenario description
83
+ */
84
+ description?: string;
85
+
86
+ /**
87
+ * Prompt for final answer
88
+ */
89
+ finalAnswerPrompt?: string;
90
+
91
+ /**
92
+ * Interaction format
93
+ */
94
+ format?: string;
95
+
96
+ /**
97
+ * Scenario goal
98
+ */
99
+ goal?: string;
100
+
101
+ /**
102
+ * Character ID for greeting
103
+ */
104
+ greetingCharacterId?: string;
105
+
106
+ /**
107
+ * Greeting message
108
+ */
109
+ greetingMessage?: string;
110
+
111
+ /**
112
+ * Whether scenario requires a final answer
113
+ */
114
+ requiresFinalAnswer?: boolean;
115
+
116
+ /**
117
+ * Available tools
118
+ */
119
+ tools?: Array<unknown>;
62
120
  }
63
121
 
64
122
  export declare namespace Component {
@@ -1,6 +1,11 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  export { Component, type ComponentUpdateParams } from './component';
4
- export { Scenarios, type ScenarioCreateParams, type ScenarioUpdateParams } from './scenarios';
4
+ export {
5
+ Scenarios,
6
+ type ScenarioCreateParams,
7
+ type ScenarioUpdateParams,
8
+ type ScenarioSubmitParams,
9
+ } from './scenarios';
5
10
  export { Sessions } from './sessions';
6
11
  export { Submissions } from './submissions/index';
@@ -22,13 +22,15 @@ export class Scenarios extends APIResource {
22
22
  *
23
23
  * @example
24
24
  * ```ts
25
- * await client.v1.scenarios.create({ body: 'body' });
25
+ * await client.v1.scenarios.create({
26
+ * componentId: 'componentId',
27
+ * name: 'name',
28
+ * });
26
29
  * ```
27
30
  */
28
- create(params: ScenarioCreateParams, options?: RequestOptions): APIPromise<void> {
29
- const { body } = params;
31
+ create(body: ScenarioCreateParams, options?: RequestOptions): APIPromise<void> {
30
32
  return this._client.post('/api/v1/scenarios', {
31
- body: body,
33
+ body,
32
34
  ...options,
33
35
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
34
36
  });
@@ -54,13 +56,15 @@ export class Scenarios extends APIResource {
54
56
  *
55
57
  * @example
56
58
  * ```ts
57
- * await client.v1.scenarios.update('id', { body: 'body' });
59
+ * await client.v1.scenarios.update('id', {
60
+ * componentId: 'componentId',
61
+ * name: 'name',
62
+ * });
58
63
  * ```
59
64
  */
60
- update(id: string, params: ScenarioUpdateParams, options?: RequestOptions): APIPromise<void> {
61
- const { body } = params;
65
+ update(id: string, body: ScenarioUpdateParams, options?: RequestOptions): APIPromise<void> {
62
66
  return this._client.put(path`/api/v1/scenarios/${id}`, {
63
- body: body,
67
+ body,
64
68
  ...options,
65
69
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
66
70
  });
@@ -110,13 +114,18 @@ export class Scenarios extends APIResource {
110
114
  }
111
115
 
112
116
  /**
117
+ * Submit scenario answer
118
+ *
113
119
  * @example
114
120
  * ```ts
115
- * await client.v1.scenarios.submit('id');
121
+ * await client.v1.scenarios.submit('id', {
122
+ * conversationHistory: [{}],
123
+ * });
116
124
  * ```
117
125
  */
118
- submit(id: string, options?: RequestOptions): APIPromise<void> {
126
+ submit(id: string, body: ScenarioSubmitParams, options?: RequestOptions): APIPromise<void> {
119
127
  return this._client.post(path`/api/v1/scenarios/${id}/submit`, {
128
+ body,
120
129
  ...options,
121
130
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
122
131
  });
@@ -124,11 +133,139 @@ export class Scenarios extends APIResource {
124
133
  }
125
134
 
126
135
  export interface ScenarioCreateParams {
127
- body: string;
136
+ /**
137
+ * Associated component ID
138
+ */
139
+ componentId: string;
140
+
141
+ /**
142
+ * Scenario name
143
+ */
144
+ name: string;
145
+
146
+ /**
147
+ * Scenario characters
148
+ */
149
+ characters?: Array<unknown>;
150
+
151
+ /**
152
+ * Scenario context
153
+ */
154
+ context?: string;
155
+
156
+ /**
157
+ * Scenario description
158
+ */
159
+ description?: string;
160
+
161
+ /**
162
+ * Prompt for final answer
163
+ */
164
+ finalAnswerPrompt?: string;
165
+
166
+ /**
167
+ * Interaction format
168
+ */
169
+ format?: string;
170
+
171
+ /**
172
+ * Scenario goal
173
+ */
174
+ goal?: string;
175
+
176
+ /**
177
+ * Character ID for greeting
178
+ */
179
+ greetingCharacterId?: string;
180
+
181
+ /**
182
+ * Greeting message
183
+ */
184
+ greetingMessage?: string;
185
+
186
+ /**
187
+ * Whether scenario requires a final answer
188
+ */
189
+ requiresFinalAnswer?: boolean;
190
+
191
+ /**
192
+ * Available tools
193
+ */
194
+ tools?: Array<unknown>;
128
195
  }
129
196
 
130
197
  export interface ScenarioUpdateParams {
131
- body: string;
198
+ /**
199
+ * Associated component ID
200
+ */
201
+ componentId: string;
202
+
203
+ /**
204
+ * Scenario name
205
+ */
206
+ name: string;
207
+
208
+ /**
209
+ * Scenario characters
210
+ */
211
+ characters?: Array<unknown>;
212
+
213
+ /**
214
+ * Scenario context
215
+ */
216
+ context?: string;
217
+
218
+ /**
219
+ * Scenario description
220
+ */
221
+ description?: string;
222
+
223
+ /**
224
+ * Prompt for final answer
225
+ */
226
+ finalAnswerPrompt?: string;
227
+
228
+ /**
229
+ * Interaction format
230
+ */
231
+ format?: string;
232
+
233
+ /**
234
+ * Scenario goal
235
+ */
236
+ goal?: string;
237
+
238
+ /**
239
+ * Character ID for greeting
240
+ */
241
+ greetingCharacterId?: string;
242
+
243
+ /**
244
+ * Greeting message
245
+ */
246
+ greetingMessage?: string;
247
+
248
+ /**
249
+ * Whether scenario requires a final answer
250
+ */
251
+ requiresFinalAnswer?: boolean;
252
+
253
+ /**
254
+ * Available tools
255
+ */
256
+ tools?: Array<unknown>;
257
+ }
258
+
259
+ export interface ScenarioSubmitParams {
260
+ /**
261
+ * Conversation history
262
+ */
263
+ conversationHistory: Array<unknown>;
264
+
265
+ /**
266
+ * Final answer for the scenario
267
+ */
268
+ finalAnswer?: string;
132
269
  }
133
270
 
134
271
  Scenarios.Component = Component;
@@ -139,6 +276,7 @@ export declare namespace Scenarios {
139
276
  export {
140
277
  type ScenarioCreateParams as ScenarioCreateParams,
141
278
  type ScenarioUpdateParams as ScenarioUpdateParams,
279
+ type ScenarioSubmitParams as ScenarioSubmitParams,
142
280
  };
143
281
 
144
282
  export { Component as Component, type ComponentUpdateParams as ComponentUpdateParams };
@@ -59,7 +59,12 @@ import {
59
59
  import * as OrganizationsAPI from './organizations/organizations';
60
60
  import { Organizations } from './organizations/organizations';
61
61
  import * as ScenariosAPI from './scenarios/scenarios';
62
- import { ScenarioCreateParams, ScenarioUpdateParams, Scenarios } from './scenarios/scenarios';
62
+ import {
63
+ ScenarioCreateParams,
64
+ ScenarioSubmitParams,
65
+ ScenarioUpdateParams,
66
+ Scenarios,
67
+ } from './scenarios/scenarios';
63
68
  import * as TestsAPI from './tests/tests';
64
69
  import {
65
70
  TestCreateParams,
@@ -190,6 +195,7 @@ export declare namespace V1 {
190
195
  Scenarios as Scenarios,
191
196
  type ScenarioCreateParams as ScenarioCreateParams,
192
197
  type ScenarioUpdateParams as ScenarioUpdateParams,
198
+ type ScenarioSubmitParams as ScenarioSubmitParams,
193
199
  };
194
200
 
195
201
  export {
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.9.0'; // x-release-please-version
1
+ export const VERSION = '1.11.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.9.0";
1
+ export declare const VERSION = "1.11.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.mts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.9.0";
1
+ export declare const VERSION = "1.11.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '1.9.0'; // x-release-please-version
4
+ exports.VERSION = '1.11.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,QAAQ,CAAC,CAAC,2BAA2B"}
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.9.0'; // x-release-please-version
1
+ export const VERSION = '1.11.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map
package/version.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,2BAA2B"}