@easyedu/js-lsm-api 1.112.0 → 1.114.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 (38) hide show
  1. package/.openapi-generator/FILES +2 -0
  2. package/README.md +5 -3
  3. package/dist/apis/QuestionApi.d.ts +17 -2
  4. package/dist/apis/QuestionApi.js +41 -2
  5. package/dist/esm/apis/QuestionApi.d.ts +17 -2
  6. package/dist/esm/apis/QuestionApi.js +41 -2
  7. package/dist/esm/models/ChatFeatureUsage.d.ts +47 -0
  8. package/dist/esm/models/ChatFeatureUsage.js +55 -0
  9. package/dist/esm/models/GetChatUsage.d.ts +7 -0
  10. package/dist/esm/models/GetChatUsage.js +5 -0
  11. package/dist/esm/models/GetQuestion.d.ts +13 -1
  12. package/dist/esm/models/GetQuestion.js +5 -0
  13. package/dist/esm/models/PutQuestion.d.ts +6 -0
  14. package/dist/esm/models/PutQuestion.js +2 -0
  15. package/dist/esm/models/index.d.ts +1 -0
  16. package/dist/esm/models/index.js +1 -0
  17. package/dist/models/ChatFeatureUsage.d.ts +47 -0
  18. package/dist/models/ChatFeatureUsage.js +63 -0
  19. package/dist/models/GetChatUsage.d.ts +7 -0
  20. package/dist/models/GetChatUsage.js +5 -0
  21. package/dist/models/GetQuestion.d.ts +13 -1
  22. package/dist/models/GetQuestion.js +5 -0
  23. package/dist/models/PutQuestion.d.ts +6 -0
  24. package/dist/models/PutQuestion.js +2 -0
  25. package/dist/models/index.d.ts +1 -0
  26. package/dist/models/index.js +1 -0
  27. package/docs/ChatFeatureUsage.md +36 -0
  28. package/docs/GetChatUsage.md +2 -0
  29. package/docs/GetQuestion.md +4 -0
  30. package/docs/PutQuestion.md +2 -0
  31. package/docs/QuestionApi.md +70 -2
  32. package/package.json +1 -1
  33. package/src/apis/QuestionApi.ts +51 -2
  34. package/src/models/ChatFeatureUsage.ts +94 -0
  35. package/src/models/GetChatUsage.ts +16 -0
  36. package/src/models/GetQuestion.ts +17 -1
  37. package/src/models/PutQuestion.ts +8 -0
  38. package/src/models/index.ts +1 -0
@@ -21,6 +21,7 @@ exports.GetChatUsageToJSONTyped = GetChatUsageToJSONTyped;
21
21
  const ChatDailyUsage_1 = require("./ChatDailyUsage");
22
22
  const ChatModelUsage_1 = require("./ChatModelUsage");
23
23
  const ChatUsageTotals_1 = require("./ChatUsageTotals");
24
+ const ChatFeatureUsage_1 = require("./ChatFeatureUsage");
24
25
  /**
25
26
  * Check if a given object implements the GetChatUsage interface.
26
27
  */
@@ -35,6 +36,8 @@ function instanceOfGetChatUsage(value) {
35
36
  return false;
36
37
  if (!('modelUsage' in value) || value['modelUsage'] === undefined)
37
38
  return false;
39
+ if (!('featureUsage' in value) || value['featureUsage'] === undefined)
40
+ return false;
38
41
  return true;
39
42
  }
40
43
  function GetChatUsageFromJSON(json) {
@@ -50,6 +53,7 @@ function GetChatUsageFromJSONTyped(json, ignoreDiscriminator) {
50
53
  'totals': (0, ChatUsageTotals_1.ChatUsageTotalsFromJSON)(json['totals']),
51
54
  'daily': (json['daily'].map(ChatDailyUsage_1.ChatDailyUsageFromJSON)),
52
55
  'modelUsage': (json['model_usage'].map(ChatModelUsage_1.ChatModelUsageFromJSON)),
56
+ 'featureUsage': (json['feature_usage'].map(ChatFeatureUsage_1.ChatFeatureUsageFromJSON)),
53
57
  };
54
58
  }
55
59
  function GetChatUsageToJSON(json) {
@@ -65,5 +69,6 @@ function GetChatUsageToJSONTyped(value, ignoreDiscriminator = false) {
65
69
  'totals': (0, ChatUsageTotals_1.ChatUsageTotalsToJSON)(value['totals']),
66
70
  'daily': (value['daily'].map(ChatDailyUsage_1.ChatDailyUsageToJSON)),
67
71
  'model_usage': (value['modelUsage'].map(ChatModelUsage_1.ChatModelUsageToJSON)),
72
+ 'feature_usage': (value['featureUsage'].map(ChatFeatureUsage_1.ChatFeatureUsageToJSON)),
68
73
  };
69
74
  }
@@ -74,6 +74,18 @@ export interface GetQuestion {
74
74
  * @memberof GetQuestion
75
75
  */
76
76
  readonly versionNumber: number;
77
+ /**
78
+ * Whether this is the current editable version in the question history
79
+ * @type {boolean}
80
+ * @memberof GetQuestion
81
+ */
82
+ readonly isLatestVersion: boolean;
83
+ /**
84
+ * Optional note describing why this version was created
85
+ * @type {string}
86
+ * @memberof GetQuestion
87
+ */
88
+ versionCreatedReason?: string;
77
89
  /**
78
90
  * When the question was created
79
91
  * @type {Date}
@@ -130,4 +142,4 @@ export declare function instanceOfGetQuestion(value: object): value is GetQuesti
130
142
  export declare function GetQuestionFromJSON(json: any): GetQuestion;
131
143
  export declare function GetQuestionFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetQuestion;
132
144
  export declare function GetQuestionToJSON(json: any): GetQuestion;
133
- export declare function GetQuestionToJSONTyped(value?: Omit<GetQuestion, 'id' | 'version_number' | 'created_date' | 'updated_date' | 'created_by' | 'quiz_count' | 'quizzes'> | null, ignoreDiscriminator?: boolean): any;
145
+ export declare function GetQuestionToJSONTyped(value?: Omit<GetQuestion, 'id' | 'version_number' | 'is_latest_version' | 'created_date' | 'updated_date' | 'created_by' | 'quiz_count' | 'quizzes'> | null, ignoreDiscriminator?: boolean): any;
@@ -47,6 +47,8 @@ function instanceOfGetQuestion(value) {
47
47
  return false;
48
48
  if (!('versionNumber' in value) || value['versionNumber'] === undefined)
49
49
  return false;
50
+ if (!('isLatestVersion' in value) || value['isLatestVersion'] === undefined)
51
+ return false;
50
52
  if (!('createdDate' in value) || value['createdDate'] === undefined)
51
53
  return false;
52
54
  if (!('updatedDate' in value) || value['updatedDate'] === undefined)
@@ -70,6 +72,8 @@ function GetQuestionFromJSONTyped(json, ignoreDiscriminator) {
70
72
  'tags': json['tags'] == null ? undefined : (json['tags'].map(ContentLibraryTag_1.ContentLibraryTagFromJSON)),
71
73
  'version': json['version'] == null ? undefined : json['version'],
72
74
  'versionNumber': json['version_number'],
75
+ 'isLatestVersion': json['is_latest_version'],
76
+ 'versionCreatedReason': json['version_created_reason'] == null ? undefined : json['version_created_reason'],
73
77
  'createdDate': (new Date(json['created_date'])),
74
78
  'updatedDate': (new Date(json['updated_date'])),
75
79
  'createdBy': json['created_by'] == null ? undefined : json['created_by'],
@@ -93,6 +97,7 @@ function GetQuestionToJSONTyped(value, ignoreDiscriminator = false) {
93
97
  'explanation': (0, RichTextDocument_1.RichTextDocumentToJSON)(value['explanation']),
94
98
  'tags': value['tags'] == null ? undefined : (value['tags'].map(ContentLibraryTag_1.ContentLibraryTagToJSON)),
95
99
  'version': value['version'],
100
+ 'version_created_reason': value['versionCreatedReason'],
96
101
  'import_source': (0, QuestionImportSourceSummary_1.QuestionImportSourceSummaryToJSON)(value['importSource']),
97
102
  };
98
103
  }
@@ -59,6 +59,12 @@ export interface PutQuestion {
59
59
  * @memberof PutQuestion
60
60
  */
61
61
  version?: string;
62
+ /**
63
+ * Optional note describing the changes in the new version
64
+ * @type {string}
65
+ * @memberof PutQuestion
66
+ */
67
+ versionReason?: string;
62
68
  }
63
69
  /**
64
70
  * @export
@@ -53,6 +53,7 @@ function PutQuestionFromJSONTyped(json, ignoreDiscriminator) {
53
53
  'explanation': json['explanation'] == null ? undefined : (0, RichTextInput_1.RichTextInputFromJSON)(json['explanation']),
54
54
  'tags': json['tags'] == null ? undefined : json['tags'],
55
55
  'version': json['version'] == null ? undefined : json['version'],
56
+ 'versionReason': json['version_reason'] == null ? undefined : json['version_reason'],
56
57
  };
57
58
  }
58
59
  function PutQuestionToJSON(json) {
@@ -70,5 +71,6 @@ function PutQuestionToJSONTyped(value, ignoreDiscriminator = false) {
70
71
  'explanation': (0, RichTextInput_1.RichTextInputToJSON)(value['explanation']),
71
72
  'tags': value['tags'],
72
73
  'version': value['version'],
74
+ 'version_reason': value['versionReason'],
73
75
  };
74
76
  }
@@ -25,6 +25,7 @@ export * from './CertificateRenewalPolicy';
25
25
  export * from './CertificateTemplate';
26
26
  export * from './CertificateTemplateVersion';
27
27
  export * from './ChatDailyUsage';
28
+ export * from './ChatFeatureUsage';
28
29
  export * from './ChatModelUsage';
29
30
  export * from './ChatQuota';
30
31
  export * from './ChatQuotaExceeded';
@@ -43,6 +43,7 @@ __exportStar(require("./CertificateRenewalPolicy"), exports);
43
43
  __exportStar(require("./CertificateTemplate"), exports);
44
44
  __exportStar(require("./CertificateTemplateVersion"), exports);
45
45
  __exportStar(require("./ChatDailyUsage"), exports);
46
+ __exportStar(require("./ChatFeatureUsage"), exports);
46
47
  __exportStar(require("./ChatModelUsage"), exports);
47
48
  __exportStar(require("./ChatQuota"), exports);
48
49
  __exportStar(require("./ChatQuotaExceeded"), exports);
@@ -0,0 +1,36 @@
1
+
2
+ # ChatFeatureUsage
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `feature` | string
10
+ `usage` | [ChatUsageTotals](ChatUsageTotals.md)
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { ChatFeatureUsage } from '@easyedu/js-lsm-api'
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "feature": null,
20
+ "usage": null,
21
+ } satisfies ChatFeatureUsage
22
+
23
+ console.log(example)
24
+
25
+ // Convert the instance to a JSON string
26
+ const exampleJSON: string = JSON.stringify(example)
27
+ console.log(exampleJSON)
28
+
29
+ // Parse the JSON string back to an object
30
+ const exampleParsed = JSON.parse(exampleJSON) as ChatFeatureUsage
31
+ console.log(exampleParsed)
32
+ ```
33
+
34
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
35
+
36
+
@@ -11,6 +11,7 @@ Name | Type
11
11
  `totals` | [ChatUsageTotals](ChatUsageTotals.md)
12
12
  `daily` | [Array&lt;ChatDailyUsage&gt;](ChatDailyUsage.md)
13
13
  `modelUsage` | [Array&lt;ChatModelUsage&gt;](ChatModelUsage.md)
14
+ `featureUsage` | [Array&lt;ChatFeatureUsage&gt;](ChatFeatureUsage.md)
14
15
 
15
16
  ## Example
16
17
 
@@ -24,6 +25,7 @@ const example = {
24
25
  "totals": null,
25
26
  "daily": null,
26
27
  "modelUsage": null,
28
+ "featureUsage": null,
27
29
  } satisfies GetChatUsage
28
30
 
29
31
  console.log(example)
@@ -15,6 +15,8 @@ Name | Type
15
15
  `tags` | [Array&lt;ContentLibraryTag&gt;](ContentLibraryTag.md)
16
16
  `version` | string
17
17
  `versionNumber` | number
18
+ `isLatestVersion` | boolean
19
+ `versionCreatedReason` | string
18
20
  `createdDate` | Date
19
21
  `updatedDate` | Date
20
22
  `createdBy` | string
@@ -38,6 +40,8 @@ const example = {
38
40
  "tags": null,
39
41
  "version": null,
40
42
  "versionNumber": null,
43
+ "isLatestVersion": null,
44
+ "versionCreatedReason": null,
41
45
  "createdDate": null,
42
46
  "updatedDate": null,
43
47
  "createdBy": null,
@@ -13,6 +13,7 @@ Name | Type
13
13
  `explanation` | [RichTextInput](RichTextInput.md)
14
14
  `tags` | Array&lt;string&gt;
15
15
  `version` | string
16
+ `versionReason` | string
16
17
 
17
18
  ## Example
18
19
 
@@ -28,6 +29,7 @@ const example = {
28
29
  "explanation": null,
29
30
  "tags": null,
30
31
  "version": null,
32
+ "versionReason": null,
31
33
  } satisfies PutQuestion
32
34
 
33
35
  console.log(example)
@@ -7,8 +7,9 @@ All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com
7
7
  | [**deleteQuestion**](QuestionApi.md#deletequestion) | **DELETE** /questions/{questionId} | Delete a question by ID |
8
8
  | [**getQuestion**](QuestionApi.md#getquestion) | **GET** /questions/{questionId} | Get a question by ID |
9
9
  | [**getQuestionList**](QuestionApi.md#getquestionlist) | **GET** /questions | Get list of questions with filtering and pagination |
10
+ | [**getQuestionVersions**](QuestionApi.md#getquestionversions) | **GET** /questions/{questionId}/versions | Get all versions of a question |
10
11
  | [**postQuestion**](QuestionApi.md#postquestion) | **POST** /questions | Create a new question |
11
- | [**putQuestion**](QuestionApi.md#putquestion) | **PUT** /questions/{questionId} | Update a question by ID |
12
+ | [**putQuestion**](QuestionApi.md#putquestion) | **PUT** /questions/{questionId} | Create the next version of a question |
12
13
 
13
14
 
14
15
 
@@ -222,6 +223,72 @@ No authorization required
222
223
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
223
224
 
224
225
 
226
+ ## getQuestionVersions
227
+
228
+ > Array&lt;GetQuestion&gt; getQuestionVersions(questionId)
229
+
230
+ Get all versions of a question
231
+
232
+ ### Example
233
+
234
+ ```ts
235
+ import {
236
+ Configuration,
237
+ QuestionApi,
238
+ } from '@easyedu/js-lsm-api';
239
+ import type { GetQuestionVersionsRequest } from '@easyedu/js-lsm-api';
240
+
241
+ async function example() {
242
+ console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
243
+ const api = new QuestionApi();
244
+
245
+ const body = {
246
+ // string
247
+ questionId: questionId_example,
248
+ } satisfies GetQuestionVersionsRequest;
249
+
250
+ try {
251
+ const data = await api.getQuestionVersions(body);
252
+ console.log(data);
253
+ } catch (error) {
254
+ console.error(error);
255
+ }
256
+ }
257
+
258
+ // Run the test
259
+ example().catch(console.error);
260
+ ```
261
+
262
+ ### Parameters
263
+
264
+
265
+ | Name | Type | Description | Notes |
266
+ |------------- | ------------- | ------------- | -------------|
267
+ | **questionId** | `string` | | [Defaults to `undefined`] |
268
+
269
+ ### Return type
270
+
271
+ [**Array&lt;GetQuestion&gt;**](GetQuestion.md)
272
+
273
+ ### Authorization
274
+
275
+ No authorization required
276
+
277
+ ### HTTP request headers
278
+
279
+ - **Content-Type**: Not defined
280
+ - **Accept**: `application/json`
281
+
282
+
283
+ ### HTTP response details
284
+ | Status code | Description | Response headers |
285
+ |-------------|-------------|------------------|
286
+ | **200** | Question version history, newest first | - |
287
+ | **404** | question not found | - |
288
+
289
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
290
+
291
+
225
292
  ## postQuestion
226
293
 
227
294
  > GetQuestion postQuestion(postQuestion)
@@ -292,7 +359,7 @@ No authorization required
292
359
 
293
360
  > GetQuestion putQuestion(questionId, putQuestion)
294
361
 
295
- Update a question by ID
362
+ Create the next version of a question
296
363
 
297
364
  ### Example
298
365
 
@@ -354,6 +421,7 @@ No authorization required
354
421
  | **200** | update question response OK | - |
355
422
  | **404** | question not found | - |
356
423
  | **400** | update question response error | - |
424
+ | **409** | supplied question is a historical or stale version | - |
357
425
 
358
426
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
359
427
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyedu/js-lsm-api",
3
- "version": "1.112.0",
3
+ "version": "1.114.0",
4
4
  "description": "OpenAPI client for @easyedu/js-lsm-api",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -50,6 +50,10 @@ export interface GetQuestionListRequest {
50
50
  search?: string;
51
51
  }
52
52
 
53
+ export interface GetQuestionVersionsRequest {
54
+ questionId: string;
55
+ }
56
+
53
57
  export interface PostQuestionRequest {
54
58
  postQuestion: PostQuestion;
55
59
  }
@@ -210,6 +214,51 @@ export class QuestionApi extends runtime.BaseAPI {
210
214
  return await response.value();
211
215
  }
212
216
 
217
+ /**
218
+ * Creates request options for getQuestionVersions without sending the request
219
+ */
220
+ async getQuestionVersionsRequestOpts(requestParameters: GetQuestionVersionsRequest): Promise<runtime.RequestOpts> {
221
+ if (requestParameters['questionId'] == null) {
222
+ throw new runtime.RequiredError(
223
+ 'questionId',
224
+ 'Required parameter "questionId" was null or undefined when calling getQuestionVersions().'
225
+ );
226
+ }
227
+
228
+ const queryParameters: any = {};
229
+
230
+ const headerParameters: runtime.HTTPHeaders = {};
231
+
232
+
233
+ let urlPath = `/questions/{questionId}/versions`;
234
+ urlPath = urlPath.replace('{questionId}', encodeURIComponent(String(requestParameters['questionId'])));
235
+
236
+ return {
237
+ path: urlPath,
238
+ method: 'GET',
239
+ headers: headerParameters,
240
+ query: queryParameters,
241
+ };
242
+ }
243
+
244
+ /**
245
+ * Get all versions of a question
246
+ */
247
+ async getQuestionVersionsRaw(requestParameters: GetQuestionVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<GetQuestion>>> {
248
+ const requestOptions = await this.getQuestionVersionsRequestOpts(requestParameters);
249
+ const response = await this.request(requestOptions, initOverrides);
250
+
251
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(GetQuestionFromJSON));
252
+ }
253
+
254
+ /**
255
+ * Get all versions of a question
256
+ */
257
+ async getQuestionVersions(requestParameters: GetQuestionVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<GetQuestion>> {
258
+ const response = await this.getQuestionVersionsRaw(requestParameters, initOverrides);
259
+ return await response.value();
260
+ }
261
+
213
262
  /**
214
263
  * Creates request options for postQuestion without sending the request
215
264
  */
@@ -295,7 +344,7 @@ export class QuestionApi extends runtime.BaseAPI {
295
344
  }
296
345
 
297
346
  /**
298
- * Update a question by ID
347
+ * Create the next version of a question
299
348
  */
300
349
  async putQuestionRaw(requestParameters: PutQuestionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetQuestion>> {
301
350
  const requestOptions = await this.putQuestionRequestOpts(requestParameters);
@@ -305,7 +354,7 @@ export class QuestionApi extends runtime.BaseAPI {
305
354
  }
306
355
 
307
356
  /**
308
- * Update a question by ID
357
+ * Create the next version of a question
309
358
  */
310
359
  async putQuestion(requestParameters: PutQuestionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetQuestion> {
311
360
  const response = await this.putQuestionRaw(requestParameters, initOverrides);
@@ -0,0 +1,94 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * LMS API
5
+ * LMS API
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { ChatUsageTotals } from './ChatUsageTotals';
17
+ import {
18
+ ChatUsageTotalsFromJSON,
19
+ ChatUsageTotalsFromJSONTyped,
20
+ ChatUsageTotalsToJSON,
21
+ ChatUsageTotalsToJSONTyped,
22
+ } from './ChatUsageTotals';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface ChatFeatureUsage
28
+ */
29
+ export interface ChatFeatureUsage {
30
+ /**
31
+ *
32
+ * @type {ChatFeatureUsageFeatureEnum}
33
+ * @memberof ChatFeatureUsage
34
+ */
35
+ feature: ChatFeatureUsageFeatureEnum;
36
+ /**
37
+ *
38
+ * @type {ChatUsageTotals}
39
+ * @memberof ChatFeatureUsage
40
+ */
41
+ usage: ChatUsageTotals;
42
+ }
43
+
44
+
45
+ /**
46
+ * @export
47
+ */
48
+ export const ChatFeatureUsageFeatureEnum = {
49
+ Chat: 'chat',
50
+ QuestionImport: 'question_import'
51
+ } as const;
52
+ export type ChatFeatureUsageFeatureEnum = typeof ChatFeatureUsageFeatureEnum[keyof typeof ChatFeatureUsageFeatureEnum];
53
+
54
+
55
+ /**
56
+ * Check if a given object implements the ChatFeatureUsage interface.
57
+ */
58
+ export function instanceOfChatFeatureUsage(value: object): value is ChatFeatureUsage {
59
+ if (!('feature' in value) || value['feature'] === undefined) return false;
60
+ if (!('usage' in value) || value['usage'] === undefined) return false;
61
+ return true;
62
+ }
63
+
64
+ export function ChatFeatureUsageFromJSON(json: any): ChatFeatureUsage {
65
+ return ChatFeatureUsageFromJSONTyped(json, false);
66
+ }
67
+
68
+ export function ChatFeatureUsageFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChatFeatureUsage {
69
+ if (json == null) {
70
+ return json;
71
+ }
72
+ return {
73
+
74
+ 'feature': json['feature'],
75
+ 'usage': ChatUsageTotalsFromJSON(json['usage']),
76
+ };
77
+ }
78
+
79
+ export function ChatFeatureUsageToJSON(json: any): ChatFeatureUsage {
80
+ return ChatFeatureUsageToJSONTyped(json, false);
81
+ }
82
+
83
+ export function ChatFeatureUsageToJSONTyped(value?: ChatFeatureUsage | null, ignoreDiscriminator: boolean = false): any {
84
+ if (value == null) {
85
+ return value;
86
+ }
87
+
88
+ return {
89
+
90
+ 'feature': value['feature'],
91
+ 'usage': ChatUsageTotalsToJSON(value['usage']),
92
+ };
93
+ }
94
+
@@ -34,6 +34,13 @@ import {
34
34
  ChatUsageTotalsToJSON,
35
35
  ChatUsageTotalsToJSONTyped,
36
36
  } from './ChatUsageTotals';
37
+ import type { ChatFeatureUsage } from './ChatFeatureUsage';
38
+ import {
39
+ ChatFeatureUsageFromJSON,
40
+ ChatFeatureUsageFromJSONTyped,
41
+ ChatFeatureUsageToJSON,
42
+ ChatFeatureUsageToJSONTyped,
43
+ } from './ChatFeatureUsage';
37
44
 
38
45
  /**
39
46
  *
@@ -71,6 +78,12 @@ export interface GetChatUsage {
71
78
  * @memberof GetChatUsage
72
79
  */
73
80
  modelUsage: Array<ChatModelUsage>;
81
+ /**
82
+ *
83
+ * @type {Array<ChatFeatureUsage>}
84
+ * @memberof GetChatUsage
85
+ */
86
+ featureUsage: Array<ChatFeatureUsage>;
74
87
  }
75
88
 
76
89
  /**
@@ -82,6 +95,7 @@ export function instanceOfGetChatUsage(value: object): value is GetChatUsage {
82
95
  if (!('totals' in value) || value['totals'] === undefined) return false;
83
96
  if (!('daily' in value) || value['daily'] === undefined) return false;
84
97
  if (!('modelUsage' in value) || value['modelUsage'] === undefined) return false;
98
+ if (!('featureUsage' in value) || value['featureUsage'] === undefined) return false;
85
99
  return true;
86
100
  }
87
101
 
@@ -100,6 +114,7 @@ export function GetChatUsageFromJSONTyped(json: any, ignoreDiscriminator: boolea
100
114
  'totals': ChatUsageTotalsFromJSON(json['totals']),
101
115
  'daily': ((json['daily'] as Array<any>).map(ChatDailyUsageFromJSON)),
102
116
  'modelUsage': ((json['model_usage'] as Array<any>).map(ChatModelUsageFromJSON)),
117
+ 'featureUsage': ((json['feature_usage'] as Array<any>).map(ChatFeatureUsageFromJSON)),
103
118
  };
104
119
  }
105
120
 
@@ -119,6 +134,7 @@ export function GetChatUsageToJSONTyped(value?: GetChatUsage | null, ignoreDiscr
119
134
  'totals': ChatUsageTotalsToJSON(value['totals']),
120
135
  'daily': ((value['daily'] as Array<any>).map(ChatDailyUsageToJSON)),
121
136
  'model_usage': ((value['modelUsage'] as Array<any>).map(ChatModelUsageToJSON)),
137
+ 'feature_usage': ((value['featureUsage'] as Array<any>).map(ChatFeatureUsageToJSON)),
122
138
  };
123
139
  }
124
140
 
@@ -109,6 +109,18 @@ export interface GetQuestion {
109
109
  * @memberof GetQuestion
110
110
  */
111
111
  readonly versionNumber: number;
112
+ /**
113
+ * Whether this is the current editable version in the question history
114
+ * @type {boolean}
115
+ * @memberof GetQuestion
116
+ */
117
+ readonly isLatestVersion: boolean;
118
+ /**
119
+ * Optional note describing why this version was created
120
+ * @type {string}
121
+ * @memberof GetQuestion
122
+ */
123
+ versionCreatedReason?: string;
112
124
  /**
113
125
  * When the question was created
114
126
  * @type {Date}
@@ -170,6 +182,7 @@ export function instanceOfGetQuestion(value: object): value is GetQuestion {
170
182
  if (!('questionText' in value) || value['questionText'] === undefined) return false;
171
183
  if (!('questionType' in value) || value['questionType'] === undefined) return false;
172
184
  if (!('versionNumber' in value) || value['versionNumber'] === undefined) return false;
185
+ if (!('isLatestVersion' in value) || value['isLatestVersion'] === undefined) return false;
173
186
  if (!('createdDate' in value) || value['createdDate'] === undefined) return false;
174
187
  if (!('updatedDate' in value) || value['updatedDate'] === undefined) return false;
175
188
  return true;
@@ -194,6 +207,8 @@ export function GetQuestionFromJSONTyped(json: any, ignoreDiscriminator: boolean
194
207
  'tags': json['tags'] == null ? undefined : ((json['tags'] as Array<any>).map(ContentLibraryTagFromJSON)),
195
208
  'version': json['version'] == null ? undefined : json['version'],
196
209
  'versionNumber': json['version_number'],
210
+ 'isLatestVersion': json['is_latest_version'],
211
+ 'versionCreatedReason': json['version_created_reason'] == null ? undefined : json['version_created_reason'],
197
212
  'createdDate': (new Date(json['created_date'])),
198
213
  'updatedDate': (new Date(json['updated_date'])),
199
214
  'createdBy': json['created_by'] == null ? undefined : json['created_by'],
@@ -207,7 +222,7 @@ export function GetQuestionToJSON(json: any): GetQuestion {
207
222
  return GetQuestionToJSONTyped(json, false);
208
223
  }
209
224
 
210
- export function GetQuestionToJSONTyped(value?: Omit<GetQuestion, 'id'|'version_number'|'created_date'|'updated_date'|'created_by'|'quiz_count'|'quizzes'> | null, ignoreDiscriminator: boolean = false): any {
225
+ export function GetQuestionToJSONTyped(value?: Omit<GetQuestion, 'id'|'version_number'|'is_latest_version'|'created_date'|'updated_date'|'created_by'|'quiz_count'|'quizzes'> | null, ignoreDiscriminator: boolean = false): any {
211
226
  if (value == null) {
212
227
  return value;
213
228
  }
@@ -221,6 +236,7 @@ export function GetQuestionToJSONTyped(value?: Omit<GetQuestion, 'id'|'version_n
221
236
  'explanation': RichTextDocumentToJSON(value['explanation']),
222
237
  'tags': value['tags'] == null ? undefined : ((value['tags'] as Array<any>).map(ContentLibraryTagToJSON)),
223
238
  'version': value['version'],
239
+ 'version_created_reason': value['versionCreatedReason'],
224
240
  'import_source': QuestionImportSourceSummaryToJSON(value['importSource']),
225
241
  };
226
242
  }
@@ -76,6 +76,12 @@ export interface PutQuestion {
76
76
  * @memberof PutQuestion
77
77
  */
78
78
  version?: string;
79
+ /**
80
+ * Optional note describing the changes in the new version
81
+ * @type {string}
82
+ * @memberof PutQuestion
83
+ */
84
+ versionReason?: string;
79
85
  }
80
86
 
81
87
 
@@ -117,6 +123,7 @@ export function PutQuestionFromJSONTyped(json: any, ignoreDiscriminator: boolean
117
123
  'explanation': json['explanation'] == null ? undefined : RichTextInputFromJSON(json['explanation']),
118
124
  'tags': json['tags'] == null ? undefined : json['tags'],
119
125
  'version': json['version'] == null ? undefined : json['version'],
126
+ 'versionReason': json['version_reason'] == null ? undefined : json['version_reason'],
120
127
  };
121
128
  }
122
129
 
@@ -138,6 +145,7 @@ export function PutQuestionToJSONTyped(value?: PutQuestion | null, ignoreDiscrim
138
145
  'explanation': RichTextInputToJSON(value['explanation']),
139
146
  'tags': value['tags'],
140
147
  'version': value['version'],
148
+ 'version_reason': value['versionReason'],
141
149
  };
142
150
  }
143
151
 
@@ -27,6 +27,7 @@ export * from './CertificateRenewalPolicy';
27
27
  export * from './CertificateTemplate';
28
28
  export * from './CertificateTemplateVersion';
29
29
  export * from './ChatDailyUsage';
30
+ export * from './ChatFeatureUsage';
30
31
  export * from './ChatModelUsage';
31
32
  export * from './ChatQuota';
32
33
  export * from './ChatQuotaExceeded';