@timeback/core 0.2.1 → 0.2.2-beta.20260320221119

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/dist/index.js CHANGED
@@ -85,7 +85,7 @@ import {
85
85
  WebhookFilterCreateInput,
86
86
  WebhookFilterUpdateInput,
87
87
  WebhookUpdateInput
88
- } from "./chunk-aw1d6bdn.js";
88
+ } from "./chunk-2mkbbgd8.js";
89
89
  import {
90
90
  ApiError,
91
91
  BaseTransport,
@@ -96,6 +96,7 @@ import {
96
96
  PLATFORM_ENDPOINTS,
97
97
  PLATFORM_LEARNWITH_AI,
98
98
  Paginator,
99
+ TimebackProvider,
99
100
  UnauthorizedError,
100
101
  ValidationError,
101
102
  createInputValidationError,
@@ -111,7 +112,7 @@ import {
111
112
  validateUuid,
112
113
  validateWithSchema,
113
114
  whereToFilter
114
- } from "./chunk-2z9zawsc.js";
115
+ } from "./chunk-bjb7ngh9.js";
115
116
  import {
116
117
  CALIPER_DATA_VERSION,
117
118
  CALIPER_ENV_VARS,
@@ -1531,6 +1532,19 @@ class ScoreScalesResource extends BaseResource {
1531
1532
  }
1532
1533
  }
1533
1534
  // ../oneroster/src/resources/resources/resources.ts
1535
+ function normalizeResourceFromApi(resource) {
1536
+ if (!resource.metadata) {
1537
+ return resource;
1538
+ }
1539
+ return {
1540
+ ...resource,
1541
+ metadata: {
1542
+ ...resource.metadata,
1543
+ grades: parseGrades(resource.metadata.grades)
1544
+ }
1545
+ };
1546
+ }
1547
+
1534
1548
  class ScopedResourceResource {
1535
1549
  transport;
1536
1550
  basePath;
@@ -1543,7 +1557,7 @@ class ScopedResourceResource {
1543
1557
  }
1544
1558
  async get() {
1545
1559
  const response = await this.transport.request(this.basePath);
1546
- return response.resource;
1560
+ return normalizeResourceFromApi(response.resource);
1547
1561
  }
1548
1562
  exists() {
1549
1563
  return this.transport.exists(this.basePath);
@@ -1581,6 +1595,9 @@ class ResourcesResourceImpl extends BaseResource {
1581
1595
  get updateSchema() {
1582
1596
  return OneRosterResourceCreateInput.partial();
1583
1597
  }
1598
+ transform(resource) {
1599
+ return normalizeResourceFromApi(resource);
1600
+ }
1584
1601
  }
1585
1602
  function createResourcesResource(transport) {
1586
1603
  const impl = new ResourcesResourceImpl(transport);
@@ -1632,7 +1649,7 @@ class ScopedUserResource {
1632
1649
  return this.streamResources(params).toArray();
1633
1650
  }
1634
1651
  streamResources(params) {
1635
- return new Paginator3(this.transport, `${this.transport.paths.resources}/resources/users/${this.userId}/resources`, params, "resources");
1652
+ return new Paginator3(this.transport, `${this.transport.paths.resources}/resources/users/${this.userId}/resources`, params, "resources", normalizeResourceFromApi);
1636
1653
  }
1637
1654
  classes(params) {
1638
1655
  return this.streamClasses(params).toArray();
@@ -2117,7 +2134,7 @@ class ScopedClassResource {
2117
2134
  return this.streamResources(params).toArray();
2118
2135
  }
2119
2136
  streamResources(params) {
2120
- return new Paginator3(this.transport, `${this.transport.paths.resources}/resources/classes/${this.classId}/resources`, params, "resources");
2137
+ return new Paginator3(this.transport, `${this.transport.paths.resources}/resources/classes/${this.classId}/resources`, params, "resources", normalizeResourceFromApi);
2121
2138
  }
2122
2139
  student(studentId) {
2123
2140
  return new ScopedClassStudentResource(this.transport, this.classId, studentId);
@@ -2221,7 +2238,7 @@ class ScopedCourseResource {
2221
2238
  return this.streamResources(params).toArray();
2222
2239
  }
2223
2240
  streamResources(params) {
2224
- return new Paginator3(this.transport, `${this.transport.paths.resources}/resources/courses/${this.courseId}/resources`, params, "resources");
2241
+ return new Paginator3(this.transport, `${this.transport.paths.resources}/resources/courses/${this.courseId}/resources`, params, "resources", normalizeResourceFromApi);
2225
2242
  }
2226
2243
  }
2227
2244
 
@@ -4277,6 +4294,7 @@ export {
4277
4294
  getServiceUrlsForEnv,
4278
4295
  ValidationError,
4279
4296
  UnauthorizedError,
4297
+ TimebackProvider,
4280
4298
  TimebackManager,
4281
4299
  TimebackClient,
4282
4300
  NotFoundError,
package/dist/qti.d.ts CHANGED
@@ -1,11 +1 @@
1
- /**
2
- * QTI XML parsing utilities, re-exported from `@timeback/qti/parse`.
3
- *
4
- * @example
5
- * ```typescript
6
- * import { parseQtiXml, extractPrompt } from '@timeback/core/qti'
7
- * ```
8
- */
9
- export { extractChoices, extractCorrectResponse, extractFeedback, extractInteractionAttributes, extractModalFeedback, extractPrompt, extractResponseDeclaration, parseQtiXml, } from '@timeback/qti/parse';
10
- export type { ParsedQtiItem, QtiChoice, QtiInlineFeedback, QtiInteractionAttributes, QtiModalFeedback, QtiResponseDeclaration, } from '@timeback/qti/parse';
11
- //# sourceMappingURL=qti.d.ts.map
1
+ export { ParsedQtiItem, QtiChoice, QtiInlineFeedback, QtiInteractionAttributes, QtiModalFeedback, QtiResponseDeclaration, extractChoices, extractCorrectResponse, extractFeedback, extractInteractionAttributes, extractModalFeedback, extractPrompt, extractResponseDeclaration, parseQtiXml } from '@timeback/qti/parse';