@studyfetch/sdk 1.42.0 → 1.45.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 +57 -0
- package/internal/to-file.d.mts +1 -1
- package/internal/to-file.d.ts +1 -1
- package/internal/to-file.js +1 -1
- package/internal/to-file.mjs +1 -1
- package/package.json +1 -1
- package/resources/v1/assignment-grader/assignment-grader.d.mts +12 -0
- package/resources/v1/assignment-grader/assignment-grader.d.mts.map +1 -1
- package/resources/v1/assignment-grader/assignment-grader.d.ts +12 -0
- package/resources/v1/assignment-grader/assignment-grader.d.ts.map +1 -1
- package/resources/v1/assignment-grader/assignment-grader.js.map +1 -1
- package/resources/v1/assignment-grader/assignment-grader.mjs.map +1 -1
- package/resources/v1/assignment-grader/rubric-templates.d.mts +8 -0
- package/resources/v1/assignment-grader/rubric-templates.d.mts.map +1 -1
- package/resources/v1/assignment-grader/rubric-templates.d.ts +8 -0
- package/resources/v1/assignment-grader/rubric-templates.d.ts.map +1 -1
- package/resources/v1/chat.d.mts +53 -1
- package/resources/v1/chat.d.mts.map +1 -1
- package/resources/v1/chat.d.ts +53 -1
- package/resources/v1/chat.d.ts.map +1 -1
- package/resources/v1/chat.js +30 -0
- package/resources/v1/chat.js.map +1 -1
- package/resources/v1/chat.mjs +30 -0
- package/resources/v1/chat.mjs.map +1 -1
- package/resources/v1/components.d.mts +37 -1
- package/resources/v1/components.d.mts.map +1 -1
- package/resources/v1/components.d.ts +37 -1
- package/resources/v1/components.d.ts.map +1 -1
- package/resources/v1/embed/context.d.mts +61 -0
- package/resources/v1/embed/context.d.mts.map +1 -0
- package/resources/v1/embed/context.d.ts +61 -0
- package/resources/v1/embed/context.d.ts.map +1 -0
- package/resources/v1/embed/context.js +61 -0
- package/resources/v1/embed/context.js.map +1 -0
- package/resources/v1/embed/context.mjs +57 -0
- package/resources/v1/embed/context.mjs.map +1 -0
- package/resources/v1/embed/embed.d.mts +4 -0
- package/resources/v1/embed/embed.d.mts.map +1 -1
- package/resources/v1/embed/embed.d.ts +4 -0
- package/resources/v1/embed/embed.d.ts.map +1 -1
- package/resources/v1/embed/embed.js +4 -0
- package/resources/v1/embed/embed.js.map +1 -1
- package/resources/v1/embed/embed.mjs +4 -0
- package/resources/v1/embed/embed.mjs.map +1 -1
- package/resources/v1/embed/index.d.mts +1 -0
- package/resources/v1/embed/index.d.mts.map +1 -1
- package/resources/v1/embed/index.d.ts +1 -0
- package/resources/v1/embed/index.d.ts.map +1 -1
- package/resources/v1/embed/index.js +3 -1
- package/resources/v1/embed/index.js.map +1 -1
- package/resources/v1/embed/index.mjs +1 -0
- package/resources/v1/embed/index.mjs.map +1 -1
- package/resources/v1/folders.d.mts +25 -1
- package/resources/v1/folders.d.mts.map +1 -1
- package/resources/v1/folders.d.ts +25 -1
- package/resources/v1/folders.d.ts.map +1 -1
- package/resources/v1/folders.js +11 -0
- package/resources/v1/folders.js.map +1 -1
- package/resources/v1/folders.mjs +11 -0
- package/resources/v1/folders.mjs.map +1 -1
- package/resources/v1/index.d.mts +5 -3
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +5 -3
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +5 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +2 -0
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/materials/index.d.mts +1 -1
- package/resources/v1/materials/index.d.mts.map +1 -1
- package/resources/v1/materials/index.d.ts +1 -1
- 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.map +1 -1
- package/resources/v1/materials/materials.d.mts +92 -1
- package/resources/v1/materials/materials.d.mts.map +1 -1
- package/resources/v1/materials/materials.d.ts +92 -1
- package/resources/v1/materials/materials.d.ts.map +1 -1
- package/resources/v1/materials/materials.js +25 -0
- package/resources/v1/materials/materials.js.map +1 -1
- package/resources/v1/materials/materials.mjs +25 -0
- package/resources/v1/materials/materials.mjs.map +1 -1
- package/resources/v1/materials/upload.d.mts +38 -4
- package/resources/v1/materials/upload.d.mts.map +1 -1
- package/resources/v1/materials/upload.d.ts +38 -4
- package/resources/v1/materials/upload.d.ts.map +1 -1
- package/resources/v1/materials/upload.js +20 -3
- package/resources/v1/materials/upload.js.map +1 -1
- package/resources/v1/materials/upload.mjs +19 -2
- package/resources/v1/materials/upload.mjs.map +1 -1
- package/resources/v1/pdf-generator/get.d.mts +65 -0
- package/resources/v1/pdf-generator/get.d.mts.map +1 -0
- package/resources/v1/pdf-generator/get.d.ts +65 -0
- package/resources/v1/pdf-generator/get.d.ts.map +1 -0
- package/resources/v1/pdf-generator/get.js +9 -0
- package/resources/v1/pdf-generator/get.js.map +1 -0
- package/resources/v1/pdf-generator/get.mjs +5 -0
- package/resources/v1/pdf-generator/get.mjs.map +1 -0
- package/resources/v1/pdf-generator/index.d.mts +3 -0
- package/resources/v1/pdf-generator/index.d.mts.map +1 -0
- package/resources/v1/pdf-generator/index.d.ts +3 -0
- package/resources/v1/pdf-generator/index.d.ts.map +1 -0
- package/resources/v1/pdf-generator/index.js +9 -0
- package/resources/v1/pdf-generator/index.js.map +1 -0
- package/resources/v1/pdf-generator/index.mjs +4 -0
- package/resources/v1/pdf-generator/index.mjs.map +1 -0
- package/resources/v1/pdf-generator/pdf-generator.d.mts +109 -0
- package/resources/v1/pdf-generator/pdf-generator.d.mts.map +1 -0
- package/resources/v1/pdf-generator/pdf-generator.d.ts +109 -0
- package/resources/v1/pdf-generator/pdf-generator.d.ts.map +1 -0
- package/resources/v1/pdf-generator/pdf-generator.js +70 -0
- package/resources/v1/pdf-generator/pdf-generator.js.map +1 -0
- package/resources/v1/pdf-generator/pdf-generator.mjs +65 -0
- package/resources/v1/pdf-generator/pdf-generator.mjs.map +1 -0
- package/resources/v1/pdf-generator.d.mts +2 -0
- package/resources/v1/pdf-generator.d.mts.map +1 -0
- package/resources/v1/pdf-generator.d.ts +2 -0
- package/resources/v1/pdf-generator.d.ts.map +1 -0
- package/resources/v1/pdf-generator.js +6 -0
- package/resources/v1/pdf-generator.js.map +1 -0
- package/resources/v1/pdf-generator.mjs +3 -0
- package/resources/v1/pdf-generator.mjs.map +1 -0
- package/resources/v1/performance-insights/conversations.d.mts +131 -0
- package/resources/v1/performance-insights/conversations.d.mts.map +1 -0
- package/resources/v1/performance-insights/conversations.d.ts +131 -0
- package/resources/v1/performance-insights/conversations.d.ts.map +1 -0
- package/resources/v1/performance-insights/conversations.js +131 -0
- package/resources/v1/performance-insights/conversations.js.map +1 -0
- package/resources/v1/performance-insights/conversations.mjs +127 -0
- package/resources/v1/performance-insights/conversations.mjs.map +1 -0
- package/resources/v1/performance-insights/index.d.mts +3 -0
- package/resources/v1/performance-insights/index.d.mts.map +1 -0
- package/resources/v1/performance-insights/index.d.ts +3 -0
- package/resources/v1/performance-insights/index.d.ts.map +1 -0
- package/resources/v1/performance-insights/index.js +9 -0
- package/resources/v1/performance-insights/index.js.map +1 -0
- package/resources/v1/performance-insights/index.mjs +4 -0
- package/resources/v1/performance-insights/index.mjs.map +1 -0
- package/resources/v1/performance-insights/performance-insights.d.mts +139 -0
- package/resources/v1/performance-insights/performance-insights.d.mts.map +1 -0
- package/resources/v1/performance-insights/performance-insights.d.ts +139 -0
- package/resources/v1/performance-insights/performance-insights.d.ts.map +1 -0
- package/resources/v1/performance-insights/performance-insights.js +55 -0
- package/resources/v1/performance-insights/performance-insights.js.map +1 -0
- package/resources/v1/performance-insights/performance-insights.mjs +50 -0
- package/resources/v1/performance-insights/performance-insights.mjs.map +1 -0
- package/resources/v1/performance-insights.d.mts +2 -0
- package/resources/v1/performance-insights.d.mts.map +1 -0
- package/resources/v1/performance-insights.d.ts +2 -0
- package/resources/v1/performance-insights.d.ts.map +1 -0
- package/resources/v1/performance-insights.js +6 -0
- package/resources/v1/performance-insights.js.map +1 -0
- package/resources/v1/performance-insights.mjs +3 -0
- package/resources/v1/performance-insights.mjs.map +1 -0
- package/resources/v1/usage.d.mts +8 -0
- package/resources/v1/usage.d.mts.map +1 -1
- package/resources/v1/usage.d.ts +8 -0
- package/resources/v1/usage.d.ts.map +1 -1
- package/resources/v1/v1.d.mts +14 -6
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +14 -6
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +8 -0
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +8 -0
- package/resources/v1/v1.mjs.map +1 -1
- package/src/internal/to-file.ts +1 -1
- package/src/resources/v1/assignment-grader/assignment-grader.ts +15 -0
- package/src/resources/v1/assignment-grader/rubric-templates.ts +10 -0
- package/src/resources/v1/chat.ts +81 -1
- package/src/resources/v1/components.ts +45 -1
- package/src/resources/v1/embed/context.ts +96 -0
- package/src/resources/v1/embed/embed.ts +11 -0
- package/src/resources/v1/embed/index.ts +6 -0
- package/src/resources/v1/folders.ts +35 -0
- package/src/resources/v1/index.ts +18 -1
- package/src/resources/v1/materials/index.ts +2 -0
- package/src/resources/v1/materials/materials.ts +117 -0
- package/src/resources/v1/materials/upload.ts +74 -7
- package/src/resources/v1/pdf-generator/get.ts +80 -0
- package/src/resources/v1/pdf-generator/index.ts +10 -0
- package/src/resources/v1/pdf-generator/pdf-generator.ts +147 -0
- package/src/resources/v1/pdf-generator.ts +3 -0
- package/src/resources/v1/performance-insights/conversations.ts +238 -0
- package/src/resources/v1/performance-insights/index.ts +17 -0
- package/src/resources/v1/performance-insights/performance-insights.ts +214 -0
- package/src/resources/v1/performance-insights.ts +3 -0
- package/src/resources/v1/usage.ts +10 -0
- package/src/resources/v1/v1.ts +49 -2
- 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
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../../../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
7
|
+
import { path } from '../../../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
export class Conversations extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* List Performance Insights conversations for the current user.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* await client.v1.performanceInsights.conversations.list();
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
list(params: ConversationListParams | null | undefined = {}, options?: RequestOptions): APIPromise<void> {
|
|
19
|
+
const { 'x-user-id': xUserID, 'x-group-ids': xGroupIDs, ...query } = params ?? {};
|
|
20
|
+
return this._client.get('/api/v1/performance-insights/sessions', {
|
|
21
|
+
query,
|
|
22
|
+
...options,
|
|
23
|
+
headers: buildHeaders([
|
|
24
|
+
{
|
|
25
|
+
Accept: '*/*',
|
|
26
|
+
...(xUserID != null ? { 'x-user-id': xUserID } : undefined),
|
|
27
|
+
...(xGroupIDs != null ? { 'x-group-ids': xGroupIDs } : undefined),
|
|
28
|
+
},
|
|
29
|
+
options?.headers,
|
|
30
|
+
]),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Create a new Performance Insights conversation.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* await client.v1.performanceInsights.conversations.create();
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
create(
|
|
43
|
+
params: ConversationCreateParams | null | undefined = {},
|
|
44
|
+
options?: RequestOptions,
|
|
45
|
+
): APIPromise<void> {
|
|
46
|
+
const { 'x-group-ids': xGroupIDs, ...body } = params ?? {};
|
|
47
|
+
return this._client.post('/api/v1/performance-insights/sessions/create', {
|
|
48
|
+
body,
|
|
49
|
+
...options,
|
|
50
|
+
headers: buildHeaders([
|
|
51
|
+
{ Accept: '*/*', ...(xGroupIDs != null ? { 'x-group-ids': xGroupIDs } : undefined) },
|
|
52
|
+
options?.headers,
|
|
53
|
+
]),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Retrieve a single conversation with its full message history.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* await client.v1.performanceInsights.conversations.retrieve('sessionId');
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
retrieve(
|
|
66
|
+
sessionID: string,
|
|
67
|
+
params: ConversationRetrieveParams | null | undefined = {},
|
|
68
|
+
options?: RequestOptions,
|
|
69
|
+
): APIPromise<void> {
|
|
70
|
+
const { 'x-group-ids': xGroupIDs } = params ?? {};
|
|
71
|
+
return this._client.get(path`/api/v1/performance-insights/session/${sessionID}`, {
|
|
72
|
+
...options,
|
|
73
|
+
headers: buildHeaders([
|
|
74
|
+
{ Accept: '*/*', ...(xGroupIDs != null ? { 'x-group-ids': xGroupIDs } : undefined) },
|
|
75
|
+
options?.headers,
|
|
76
|
+
]),
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Push messages to a conversation. Creates the conversation if it does not exist.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* await client.v1.performanceInsights.conversations.pushMessages('sessionId', {
|
|
86
|
+
* messages: [],
|
|
87
|
+
* });
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
pushMessages(
|
|
91
|
+
sessionID: string,
|
|
92
|
+
params: ConversationPushMessagesParams,
|
|
93
|
+
options?: RequestOptions,
|
|
94
|
+
): APIPromise<void> {
|
|
95
|
+
const { 'x-group-ids': xGroupIDs, ...body } = params;
|
|
96
|
+
return this._client.put(path`/api/v1/performance-insights/session/${sessionID}/messages`, {
|
|
97
|
+
body,
|
|
98
|
+
...options,
|
|
99
|
+
headers: buildHeaders([
|
|
100
|
+
{ Accept: '*/*', ...(xGroupIDs != null ? { 'x-group-ids': xGroupIDs } : undefined) },
|
|
101
|
+
options?.headers,
|
|
102
|
+
]),
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Rename a conversation.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```ts
|
|
111
|
+
* await client.v1.performanceInsights.conversations.rename('sessionId', {
|
|
112
|
+
* title: 'New title',
|
|
113
|
+
* });
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
rename(sessionID: string, params: ConversationRenameParams, options?: RequestOptions): APIPromise<void> {
|
|
117
|
+
const { 'x-group-ids': xGroupIDs, ...body } = params;
|
|
118
|
+
return this._client.patch(path`/api/v1/performance-insights/session/${sessionID}/title`, {
|
|
119
|
+
body,
|
|
120
|
+
...options,
|
|
121
|
+
headers: buildHeaders([
|
|
122
|
+
{ Accept: '*/*', ...(xGroupIDs != null ? { 'x-group-ids': xGroupIDs } : undefined) },
|
|
123
|
+
options?.headers,
|
|
124
|
+
]),
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Delete a conversation.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```ts
|
|
133
|
+
* await client.v1.performanceInsights.conversations.delete('sessionId');
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
delete(
|
|
137
|
+
sessionID: string,
|
|
138
|
+
params: ConversationDeleteParams | null | undefined = {},
|
|
139
|
+
options?: RequestOptions,
|
|
140
|
+
): APIPromise<void> {
|
|
141
|
+
const { 'x-group-ids': xGroupIDs } = params ?? {};
|
|
142
|
+
return this._client.delete(path`/api/v1/performance-insights/session/${sessionID}`, {
|
|
143
|
+
...options,
|
|
144
|
+
headers: buildHeaders([
|
|
145
|
+
{ Accept: '*/*', ...(xGroupIDs != null ? { 'x-group-ids': xGroupIDs } : undefined) },
|
|
146
|
+
options?.headers,
|
|
147
|
+
]),
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface ConversationListParams {
|
|
153
|
+
/**
|
|
154
|
+
* Query param: Maximum number of conversations to return (default 50)
|
|
155
|
+
*/
|
|
156
|
+
limit?: string;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Header param: Group IDs header (comma-separated) to scope sessions by group
|
|
160
|
+
*/
|
|
161
|
+
'x-group-ids'?: string;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Header param: User ID header (used when authenticating via API key)
|
|
165
|
+
*/
|
|
166
|
+
'x-user-id'?: string;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export interface ConversationCreateParams {
|
|
170
|
+
/**
|
|
171
|
+
* Body param: Custom session ID. Auto-generated if omitted.
|
|
172
|
+
*/
|
|
173
|
+
sessionId?: string;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Body param: Conversation title (default "New Chat")
|
|
177
|
+
*/
|
|
178
|
+
title?: string;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Header param: Group IDs header (comma-separated) to scope sessions by group
|
|
182
|
+
*/
|
|
183
|
+
'x-group-ids'?: string;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export interface ConversationRetrieveParams {
|
|
187
|
+
/**
|
|
188
|
+
* Header param: Group IDs header (comma-separated) to scope sessions by group
|
|
189
|
+
*/
|
|
190
|
+
'x-group-ids'?: string;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export interface ConversationPushMessagesParams {
|
|
194
|
+
/**
|
|
195
|
+
* Body param: Array of AI SDK UIMessage objects to persist
|
|
196
|
+
*/
|
|
197
|
+
messages: unknown;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Body param: Update the conversation title
|
|
201
|
+
*/
|
|
202
|
+
title?: string;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Header param: Group IDs header (comma-separated) to scope sessions by group
|
|
206
|
+
*/
|
|
207
|
+
'x-group-ids'?: string;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export interface ConversationRenameParams {
|
|
211
|
+
/**
|
|
212
|
+
* Body param: New conversation title
|
|
213
|
+
*/
|
|
214
|
+
title: string;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Header param: Group IDs header (comma-separated) to scope sessions by group
|
|
218
|
+
*/
|
|
219
|
+
'x-group-ids'?: string;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export interface ConversationDeleteParams {
|
|
223
|
+
/**
|
|
224
|
+
* Header param: Group IDs header (comma-separated) to scope sessions by group
|
|
225
|
+
*/
|
|
226
|
+
'x-group-ids'?: string;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export declare namespace Conversations {
|
|
230
|
+
export {
|
|
231
|
+
type ConversationListParams as ConversationListParams,
|
|
232
|
+
type ConversationCreateParams as ConversationCreateParams,
|
|
233
|
+
type ConversationRetrieveParams as ConversationRetrieveParams,
|
|
234
|
+
type ConversationPushMessagesParams as ConversationPushMessagesParams,
|
|
235
|
+
type ConversationRenameParams as ConversationRenameParams,
|
|
236
|
+
type ConversationDeleteParams as ConversationDeleteParams,
|
|
237
|
+
};
|
|
238
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
Conversations,
|
|
5
|
+
type ConversationListParams,
|
|
6
|
+
type ConversationCreateParams,
|
|
7
|
+
type ConversationRetrieveParams,
|
|
8
|
+
type ConversationPushMessagesParams,
|
|
9
|
+
type ConversationRenameParams,
|
|
10
|
+
type ConversationDeleteParams,
|
|
11
|
+
} from './conversations';
|
|
12
|
+
export {
|
|
13
|
+
PerformanceInsights,
|
|
14
|
+
type PerformanceInsightsGenerateEmbedResponse,
|
|
15
|
+
type PerformanceInsightsGenerateEmbedParams,
|
|
16
|
+
type PerformanceInsightsStreamParams,
|
|
17
|
+
} from './performance-insights';
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as ConversationsAPI from './conversations';
|
|
5
|
+
import {
|
|
6
|
+
ConversationCreateParams,
|
|
7
|
+
ConversationDeleteParams,
|
|
8
|
+
ConversationListParams,
|
|
9
|
+
ConversationPushMessagesParams,
|
|
10
|
+
ConversationRenameParams,
|
|
11
|
+
ConversationRetrieveParams,
|
|
12
|
+
Conversations,
|
|
13
|
+
} from './conversations';
|
|
14
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
15
|
+
import { buildHeaders } from '../../../internal/headers';
|
|
16
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
17
|
+
|
|
18
|
+
export class PerformanceInsights extends APIResource {
|
|
19
|
+
conversations: ConversationsAPI.Conversations = new ConversationsAPI.Conversations(this._client);
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Generate an embeddable URL and token for the Performance Insights dashboard.
|
|
23
|
+
* Requires a TrueLearn userContextJwt to authenticate data access.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const response = await client.v1.performanceInsights.generateEmbed({
|
|
28
|
+
* userContextJwt: 'userContextJwt',
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
generateEmbed(
|
|
33
|
+
body: PerformanceInsightsGenerateEmbedParams,
|
|
34
|
+
options?: RequestOptions,
|
|
35
|
+
): APIPromise<PerformanceInsightsGenerateEmbedResponse> {
|
|
36
|
+
return this._client.post('/api/v1/performance-insights/embed', { body, ...options });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Stream an AI-powered analytics response using server-sent events (SSE).
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* await client.v1.performanceInsights.stream();
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
stream(
|
|
48
|
+
params: PerformanceInsightsStreamParams | null | undefined = {},
|
|
49
|
+
options?: RequestOptions,
|
|
50
|
+
): APIPromise<void> {
|
|
51
|
+
const { 'x-embed-token': xEmbedToken, 'x-user-id': xUserID, ...body } = params ?? {};
|
|
52
|
+
return this._client.post('/api/v1/performance-insights/stream', {
|
|
53
|
+
body,
|
|
54
|
+
...options,
|
|
55
|
+
headers: buildHeaders([
|
|
56
|
+
{
|
|
57
|
+
Accept: '*/*',
|
|
58
|
+
...(xEmbedToken != null ? { 'x-embed-token': xEmbedToken } : undefined),
|
|
59
|
+
...(xUserID != null ? { 'x-user-id': xUserID } : undefined),
|
|
60
|
+
},
|
|
61
|
+
options?.headers,
|
|
62
|
+
]),
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface PerformanceInsightsGenerateEmbedResponse {
|
|
68
|
+
/**
|
|
69
|
+
* Full embed URL for iframe integration
|
|
70
|
+
*/
|
|
71
|
+
embedUrl: string;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* JWT embed token
|
|
75
|
+
*/
|
|
76
|
+
token: string;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Token expiration timestamp (1 hour from creation)
|
|
80
|
+
*/
|
|
81
|
+
expiresAt: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface PerformanceInsightsGenerateEmbedParams {
|
|
85
|
+
/**
|
|
86
|
+
* TrueLearn user context JWT for data access
|
|
87
|
+
*/
|
|
88
|
+
userContextJwt: string;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Show Python code execution details in the embed
|
|
92
|
+
*/
|
|
93
|
+
debug?: boolean;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Group IDs for access control
|
|
97
|
+
*/
|
|
98
|
+
groupIds?: Array<string>;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Embed height (e.g., "400px", "100vh")
|
|
102
|
+
*/
|
|
103
|
+
height?: string;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Swagger/OpenAPI JSON path appended to the API base URL. Scopes which endpoints
|
|
107
|
+
* the bot can discover. Defaults to swagger/v1/swagger.json when omitted.
|
|
108
|
+
*/
|
|
109
|
+
swaggerDocPath?: string;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* IANA timezone string for data analysis (e.g., "America/New_York"). Timestamps in
|
|
113
|
+
* reports will be shown in this timezone.
|
|
114
|
+
*/
|
|
115
|
+
timezone?: string;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* TrueLearn API origin (https). Defaults to QA when omitted.
|
|
119
|
+
*/
|
|
120
|
+
trueLearnApiBase?: string;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* TrueLearn OAuth token URL (must include connect/token path). Defaults to QA login
|
|
124
|
+
* when omitted.
|
|
125
|
+
*/
|
|
126
|
+
trueLearnTokenUrl?: string;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* User ID for tracking. If omitted, derived from userContextJwt hash.
|
|
130
|
+
*/
|
|
131
|
+
userId?: string;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Embed width (e.g., "100%", "600px")
|
|
135
|
+
*/
|
|
136
|
+
width?: string;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface PerformanceInsightsStreamParams {
|
|
140
|
+
/**
|
|
141
|
+
* Body param: Session / conversation ID (AI SDK uses "id")
|
|
142
|
+
*/
|
|
143
|
+
id?: string;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Body param: Component ID
|
|
147
|
+
*/
|
|
148
|
+
componentId?: string;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Body param: Additional context
|
|
152
|
+
*/
|
|
153
|
+
context?: unknown;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Body param: Group IDs for access control
|
|
157
|
+
*/
|
|
158
|
+
groupIds?: Array<string>;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Body param: Messages array for AI SDK format
|
|
162
|
+
*/
|
|
163
|
+
messages?: Array<string>;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Body param: Session ID
|
|
167
|
+
*/
|
|
168
|
+
sessionId?: string;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Body param: IANA timezone string for data analysis
|
|
172
|
+
*/
|
|
173
|
+
timezone?: string;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Body param: Trigger for AI SDK (what triggered the message)
|
|
177
|
+
*/
|
|
178
|
+
trigger?: string;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Body param: User ID
|
|
182
|
+
*/
|
|
183
|
+
userId?: string;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Header param: Embed token containing the TrueLearn userContextJwt
|
|
187
|
+
*/
|
|
188
|
+
'x-embed-token'?: string;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Header param: User ID header (used when authenticating via API key)
|
|
192
|
+
*/
|
|
193
|
+
'x-user-id'?: string;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
PerformanceInsights.Conversations = Conversations;
|
|
197
|
+
|
|
198
|
+
export declare namespace PerformanceInsights {
|
|
199
|
+
export {
|
|
200
|
+
type PerformanceInsightsGenerateEmbedResponse as PerformanceInsightsGenerateEmbedResponse,
|
|
201
|
+
type PerformanceInsightsGenerateEmbedParams as PerformanceInsightsGenerateEmbedParams,
|
|
202
|
+
type PerformanceInsightsStreamParams as PerformanceInsightsStreamParams,
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
export {
|
|
206
|
+
Conversations as Conversations,
|
|
207
|
+
type ConversationListParams as ConversationListParams,
|
|
208
|
+
type ConversationCreateParams as ConversationCreateParams,
|
|
209
|
+
type ConversationRetrieveParams as ConversationRetrieveParams,
|
|
210
|
+
type ConversationPushMessagesParams as ConversationPushMessagesParams,
|
|
211
|
+
type ConversationRenameParams as ConversationRenameParams,
|
|
212
|
+
type ConversationDeleteParams as ConversationDeleteParams,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
@@ -63,6 +63,11 @@ export class Usage extends APIResource {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
export interface UsageGetStatsParams {
|
|
66
|
+
/**
|
|
67
|
+
* Filter by component type
|
|
68
|
+
*/
|
|
69
|
+
componentType?: string;
|
|
70
|
+
|
|
66
71
|
/**
|
|
67
72
|
* End date for stats (ISO 8601)
|
|
68
73
|
*/
|
|
@@ -82,6 +87,11 @@ export interface UsageGetStatsParams {
|
|
|
82
87
|
* Filter by user ID
|
|
83
88
|
*/
|
|
84
89
|
userId?: string;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Filter by resource ID (component ID)
|
|
93
|
+
*/
|
|
94
|
+
resourceId?: string;
|
|
85
95
|
}
|
|
86
96
|
|
|
87
97
|
export interface UsageGetSummaryParams {
|
package/src/resources/v1/v1.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
4
|
import * as ChatAPI from './chat';
|
|
5
|
-
import { Chat, ChatStreamParams } from './chat';
|
|
5
|
+
import { Chat, ChatRetrieveFeedbackParams, ChatStreamParams } from './chat';
|
|
6
6
|
import * as ChatAnalyticsAPI from './chat-analytics';
|
|
7
7
|
import {
|
|
8
8
|
ChatAnalytics,
|
|
@@ -27,6 +27,8 @@ import * as FoldersAPI from './folders';
|
|
|
27
27
|
import {
|
|
28
28
|
FolderCreateParams,
|
|
29
29
|
FolderCreateResponse,
|
|
30
|
+
FolderGetByNameParams,
|
|
31
|
+
FolderGetByNameResponse,
|
|
30
32
|
FolderGetTreeResponse,
|
|
31
33
|
FolderListMaterialsParams,
|
|
32
34
|
FolderListMaterialsResponse,
|
|
@@ -66,6 +68,7 @@ import * as MaterialsAPI from './materials/materials';
|
|
|
66
68
|
import {
|
|
67
69
|
Content,
|
|
68
70
|
GeneratedMaterialResponse,
|
|
71
|
+
MaterialCancelJobResponse,
|
|
69
72
|
MaterialCreateAndProcessParams,
|
|
70
73
|
MaterialCreateBatchUploadURLsParams,
|
|
71
74
|
MaterialCreateBatchUploadURLsResponse,
|
|
@@ -75,6 +78,7 @@ import {
|
|
|
75
78
|
MaterialGetDebugInfoResponse,
|
|
76
79
|
MaterialGetDownloadURLParams,
|
|
77
80
|
MaterialGetDownloadURLResponse,
|
|
81
|
+
MaterialGetJobStatusResponse,
|
|
78
82
|
MaterialListParams,
|
|
79
83
|
MaterialListResponse,
|
|
80
84
|
MaterialMoveParams,
|
|
@@ -86,6 +90,21 @@ import {
|
|
|
86
90
|
Materials,
|
|
87
91
|
Reference,
|
|
88
92
|
} from './materials/materials';
|
|
93
|
+
import * as PdfGeneratorAPI from './pdf-generator/pdf-generator';
|
|
94
|
+
import {
|
|
95
|
+
PdfGenerator,
|
|
96
|
+
PdfGeneratorCreateParams,
|
|
97
|
+
PdfGeneratorCreateResponse,
|
|
98
|
+
PdfGeneratorDeleteResponse,
|
|
99
|
+
PdfGeneratorGetAllResponse,
|
|
100
|
+
} from './pdf-generator/pdf-generator';
|
|
101
|
+
import * as PerformanceInsightsAPI from './performance-insights/performance-insights';
|
|
102
|
+
import {
|
|
103
|
+
PerformanceInsights,
|
|
104
|
+
PerformanceInsightsGenerateEmbedParams,
|
|
105
|
+
PerformanceInsightsGenerateEmbedResponse,
|
|
106
|
+
PerformanceInsightsStreamParams,
|
|
107
|
+
} from './performance-insights/performance-insights';
|
|
89
108
|
import { APIPromise } from '../../core/api-promise';
|
|
90
109
|
import { buildHeaders } from '../../internal/headers';
|
|
91
110
|
import { RequestOptions } from '../../internal/request-options';
|
|
@@ -102,6 +121,9 @@ export class V1 extends APIResource {
|
|
|
102
121
|
this._client,
|
|
103
122
|
);
|
|
104
123
|
materials: MaterialsAPI.Materials = new MaterialsAPI.Materials(this._client);
|
|
124
|
+
pdfGenerator: PdfGeneratorAPI.PdfGenerator = new PdfGeneratorAPI.PdfGenerator(this._client);
|
|
125
|
+
performanceInsights: PerformanceInsightsAPI.PerformanceInsights =
|
|
126
|
+
new PerformanceInsightsAPI.PerformanceInsights(this._client);
|
|
105
127
|
|
|
106
128
|
/**
|
|
107
129
|
* Test MongoDB connection and get outbound IP
|
|
@@ -128,12 +150,15 @@ V1.Chat = Chat;
|
|
|
128
150
|
V1.ChatAnalytics = ChatAnalytics;
|
|
129
151
|
V1.AssignmentGrader = AssignmentGrader;
|
|
130
152
|
V1.Materials = Materials;
|
|
153
|
+
V1.PdfGenerator = PdfGenerator;
|
|
154
|
+
V1.PerformanceInsights = PerformanceInsights;
|
|
131
155
|
|
|
132
156
|
export declare namespace V1 {
|
|
133
157
|
export {
|
|
134
158
|
Folders as Folders,
|
|
135
159
|
type FolderMetadata as FolderMetadata,
|
|
136
160
|
type FolderCreateResponse as FolderCreateResponse,
|
|
161
|
+
type FolderGetByNameResponse as FolderGetByNameResponse,
|
|
137
162
|
type FolderRetrieveResponse as FolderRetrieveResponse,
|
|
138
163
|
type FolderUpdateResponse as FolderUpdateResponse,
|
|
139
164
|
type FolderListResponse as FolderListResponse,
|
|
@@ -141,6 +166,7 @@ export declare namespace V1 {
|
|
|
141
166
|
type FolderListMaterialsResponse as FolderListMaterialsResponse,
|
|
142
167
|
type FolderMoveResponse as FolderMoveResponse,
|
|
143
168
|
type FolderCreateParams as FolderCreateParams,
|
|
169
|
+
type FolderGetByNameParams as FolderGetByNameParams,
|
|
144
170
|
type FolderUpdateParams as FolderUpdateParams,
|
|
145
171
|
type FolderListParams as FolderListParams,
|
|
146
172
|
type FolderListMaterialsParams as FolderListMaterialsParams,
|
|
@@ -179,7 +205,11 @@ export declare namespace V1 {
|
|
|
179
205
|
type EmbedVerifyParams as EmbedVerifyParams,
|
|
180
206
|
};
|
|
181
207
|
|
|
182
|
-
export {
|
|
208
|
+
export {
|
|
209
|
+
Chat as Chat,
|
|
210
|
+
type ChatRetrieveFeedbackParams as ChatRetrieveFeedbackParams,
|
|
211
|
+
type ChatStreamParams as ChatStreamParams,
|
|
212
|
+
};
|
|
183
213
|
|
|
184
214
|
export {
|
|
185
215
|
ChatAnalytics as ChatAnalytics,
|
|
@@ -207,9 +237,11 @@ export declare namespace V1 {
|
|
|
207
237
|
type MaterialResponse as MaterialResponse,
|
|
208
238
|
type Reference as Reference,
|
|
209
239
|
type MaterialListResponse as MaterialListResponse,
|
|
240
|
+
type MaterialCancelJobResponse as MaterialCancelJobResponse,
|
|
210
241
|
type MaterialCreateBatchUploadURLsResponse as MaterialCreateBatchUploadURLsResponse,
|
|
211
242
|
type MaterialGetDebugInfoResponse as MaterialGetDebugInfoResponse,
|
|
212
243
|
type MaterialGetDownloadURLResponse as MaterialGetDownloadURLResponse,
|
|
244
|
+
type MaterialGetJobStatusResponse as MaterialGetJobStatusResponse,
|
|
213
245
|
type MaterialSearchResponse as MaterialSearchResponse,
|
|
214
246
|
type MaterialCreateParams as MaterialCreateParams,
|
|
215
247
|
type MaterialUpdateParams as MaterialUpdateParams,
|
|
@@ -223,4 +255,19 @@ export declare namespace V1 {
|
|
|
223
255
|
type MaterialRenameParams as MaterialRenameParams,
|
|
224
256
|
type MaterialSearchParams as MaterialSearchParams,
|
|
225
257
|
};
|
|
258
|
+
|
|
259
|
+
export {
|
|
260
|
+
PdfGenerator as PdfGenerator,
|
|
261
|
+
type PdfGeneratorCreateResponse as PdfGeneratorCreateResponse,
|
|
262
|
+
type PdfGeneratorDeleteResponse as PdfGeneratorDeleteResponse,
|
|
263
|
+
type PdfGeneratorGetAllResponse as PdfGeneratorGetAllResponse,
|
|
264
|
+
type PdfGeneratorCreateParams as PdfGeneratorCreateParams,
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
export {
|
|
268
|
+
PerformanceInsights as PerformanceInsights,
|
|
269
|
+
type PerformanceInsightsGenerateEmbedResponse as PerformanceInsightsGenerateEmbedResponse,
|
|
270
|
+
type PerformanceInsightsGenerateEmbedParams as PerformanceInsightsGenerateEmbedParams,
|
|
271
|
+
type PerformanceInsightsStreamParams as PerformanceInsightsStreamParams,
|
|
272
|
+
};
|
|
226
273
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '1.
|
|
1
|
+
export const VERSION = '1.45.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.45.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.45.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '1.
|
|
1
|
+
export const VERSION = '1.45.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|