@timeback/caliper 0.1.7-beta.20260309185602 → 0.2.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/dist/{chunk-xkrn9zda.js → chunk-m7qcd4j8.js} +14 -6
- package/dist/{chunk-9wzc4pgh.js → chunk-mr61jp0f.js} +2 -1
- package/dist/constants.d.ts +4 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/errors.js +1 -1
- package/dist/factory.d.ts.map +1 -1
- package/dist/index.d.ts +348 -109
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +473 -335
- package/dist/lib/event-factories.d.ts +68 -2
- package/dist/lib/event-factories.d.ts.map +1 -1
- package/dist/lib/index.d.ts +3 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/lwai-event-transformer.d.ts.map +1 -1
- package/dist/public-types.d.ts +110 -13
- package/dist/public-types.d.ts.map +1 -1
- package/dist/public-types.js +1 -1
- package/dist/resources/events.d.ts +75 -3
- package/dist/resources/events.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9,20 +9,153 @@ import {
|
|
|
9
9
|
validateNonEmptyString,
|
|
10
10
|
validateOffsetListParams,
|
|
11
11
|
validateWithSchema
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-m7qcd4j8.js";
|
|
13
13
|
import {
|
|
14
14
|
CALIPER_DATA_VERSION,
|
|
15
|
-
CALIPER_ENV_VARS
|
|
16
|
-
|
|
15
|
+
CALIPER_ENV_VARS,
|
|
16
|
+
QUESTION_RESULT_SCORE_TYPE
|
|
17
|
+
} from "./chunk-mr61jp0f.js";
|
|
17
18
|
import"./chunk-6jf1natv.js";
|
|
18
19
|
|
|
19
|
-
// src/
|
|
20
|
-
|
|
21
|
-
return resolveToProvider(config, CALIPER_ENV_VARS, registry);
|
|
22
|
-
}
|
|
20
|
+
// src/utils.ts
|
|
21
|
+
var log = createScopedLogger("caliper");
|
|
23
22
|
|
|
23
|
+
// src/lib/transport.ts
|
|
24
|
+
class Transport extends BaseTransport {
|
|
25
|
+
paths;
|
|
26
|
+
constructor(config) {
|
|
27
|
+
super({ config, logger: log });
|
|
28
|
+
this.paths = config.paths;
|
|
29
|
+
}
|
|
30
|
+
async requestPaginated(path, options = {}) {
|
|
31
|
+
const response = await this.request(path, options);
|
|
32
|
+
const { events, pagination } = response;
|
|
33
|
+
const offset = options.params?.offset ?? 0;
|
|
34
|
+
const hasMore = offset + events.length < pagination.total;
|
|
35
|
+
return {
|
|
36
|
+
data: events,
|
|
37
|
+
hasMore,
|
|
38
|
+
total: pagination.total
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
// src/lib/pagination.ts
|
|
43
|
+
class Paginator2 extends Paginator {
|
|
44
|
+
constructor(transport, path, params = {}) {
|
|
45
|
+
validateOffsetListParams(params);
|
|
46
|
+
const { max, ...requestParams } = params;
|
|
47
|
+
super({
|
|
48
|
+
fetcher: (p, opts) => transport.requestPaginated(p, opts),
|
|
49
|
+
path,
|
|
50
|
+
params: requestParams,
|
|
51
|
+
max,
|
|
52
|
+
logger: log
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// src/lib/event-factories.ts
|
|
57
|
+
function createActivityEvent(input) {
|
|
58
|
+
const eventId = input.id ?? `urn:uuid:${crypto.randomUUID()}`;
|
|
59
|
+
const metricsId = input.metricsId ?? `urn:uuid:${crypto.randomUUID()}`;
|
|
60
|
+
return {
|
|
61
|
+
"@context": CALIPER_DATA_VERSION,
|
|
62
|
+
id: eventId,
|
|
63
|
+
type: "ActivityEvent",
|
|
64
|
+
action: "Completed",
|
|
65
|
+
actor: input.actor,
|
|
66
|
+
object: input.object,
|
|
67
|
+
eventTime: input.eventTime ?? new Date().toISOString(),
|
|
68
|
+
profile: "TimebackProfile",
|
|
69
|
+
generated: {
|
|
70
|
+
id: metricsId,
|
|
71
|
+
type: "TimebackActivityMetricsCollection",
|
|
72
|
+
items: input.metrics,
|
|
73
|
+
...input.attempt === undefined ? {} : { attempt: input.attempt },
|
|
74
|
+
...input.generatedExtensions ? { extensions: input.generatedExtensions } : {}
|
|
75
|
+
},
|
|
76
|
+
extensions: input.extensions,
|
|
77
|
+
...input.edApp === undefined ? {} : { edApp: input.edApp },
|
|
78
|
+
...input.session === undefined ? {} : { session: input.session }
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function createTimeSpentEvent(input) {
|
|
82
|
+
const eventId = input.id ?? `urn:uuid:${crypto.randomUUID()}`;
|
|
83
|
+
const metricsId = input.metricsId ?? `urn:uuid:${crypto.randomUUID()}`;
|
|
84
|
+
return {
|
|
85
|
+
"@context": CALIPER_DATA_VERSION,
|
|
86
|
+
id: eventId,
|
|
87
|
+
type: "TimeSpentEvent",
|
|
88
|
+
action: "SpentTime",
|
|
89
|
+
actor: input.actor,
|
|
90
|
+
object: input.object,
|
|
91
|
+
eventTime: input.eventTime ?? new Date().toISOString(),
|
|
92
|
+
profile: "TimebackProfile",
|
|
93
|
+
generated: {
|
|
94
|
+
id: metricsId,
|
|
95
|
+
type: "TimebackTimeSpentMetricsCollection",
|
|
96
|
+
items: input.metrics
|
|
97
|
+
},
|
|
98
|
+
extensions: input.extensions,
|
|
99
|
+
...input.edApp === undefined ? {} : { edApp: input.edApp },
|
|
100
|
+
...input.session === undefined ? {} : { session: input.session }
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function createQuestionSeenEvent(input) {
|
|
104
|
+
return {
|
|
105
|
+
"@context": CALIPER_DATA_VERSION,
|
|
106
|
+
id: input.id ?? `urn:uuid:${crypto.randomUUID()}`,
|
|
107
|
+
type: "AssessmentItemEvent",
|
|
108
|
+
action: "Started",
|
|
109
|
+
profile: "AssessmentProfile",
|
|
110
|
+
actor: input.actor,
|
|
111
|
+
object: { ...input.object, type: "AssessmentItem" },
|
|
112
|
+
eventTime: input.eventTime ?? new Date().toISOString(),
|
|
113
|
+
edApp: input.edApp,
|
|
114
|
+
...input.session === undefined ? {} : { session: input.session },
|
|
115
|
+
...input.extensions === undefined ? {} : { extensions: input.extensions }
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
function createQuestionAnsweredEvent(input) {
|
|
119
|
+
return {
|
|
120
|
+
"@context": CALIPER_DATA_VERSION,
|
|
121
|
+
id: input.id ?? `urn:uuid:${crypto.randomUUID()}`,
|
|
122
|
+
type: "AssessmentItemEvent",
|
|
123
|
+
action: "Completed",
|
|
124
|
+
profile: "AssessmentProfile",
|
|
125
|
+
actor: input.actor,
|
|
126
|
+
object: { ...input.object, type: "AssessmentItem" },
|
|
127
|
+
eventTime: input.eventTime ?? new Date().toISOString(),
|
|
128
|
+
edApp: input.edApp,
|
|
129
|
+
...input.generated === undefined ? {} : { generated: { ...input.generated, type: "Response" } },
|
|
130
|
+
...input.session === undefined ? {} : { session: input.session },
|
|
131
|
+
...input.extensions === undefined ? {} : { extensions: input.extensions }
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
function createQuestionGradedEvent(input) {
|
|
135
|
+
const { id: scoreId, ...scoreRest } = input.generated;
|
|
136
|
+
return {
|
|
137
|
+
"@context": CALIPER_DATA_VERSION,
|
|
138
|
+
id: input.id ?? `urn:uuid:${crypto.randomUUID()}`,
|
|
139
|
+
type: "GradeEvent",
|
|
140
|
+
action: "Graded",
|
|
141
|
+
profile: "GradingProfile",
|
|
142
|
+
actor: input.actor,
|
|
143
|
+
object: input.object,
|
|
144
|
+
eventTime: input.eventTime ?? new Date().toISOString(),
|
|
145
|
+
edApp: input.edApp,
|
|
146
|
+
generated: {
|
|
147
|
+
...scoreRest,
|
|
148
|
+
id: scoreId ?? `urn:uuid:${crypto.randomUUID()}`,
|
|
149
|
+
type: "Score",
|
|
150
|
+
scoreType: QUESTION_RESULT_SCORE_TYPE
|
|
151
|
+
},
|
|
152
|
+
...input.session === undefined ? {} : { session: input.session },
|
|
153
|
+
...input.extensions === undefined ? {} : { extensions: input.extensions }
|
|
154
|
+
};
|
|
155
|
+
}
|
|
24
156
|
// src/lib/lwai-event-transformer.ts
|
|
25
157
|
var CALIPER_CONTEXT = "http://purl.imsglobal.org/ctx/caliper/v1p2";
|
|
158
|
+
var SESSION_AUTO_ATTACH = "urn:tag:auto-attach";
|
|
26
159
|
var CALIPER_TYPE = {
|
|
27
160
|
PERSON: "Person",
|
|
28
161
|
ASSIGNABLE_DIGITAL_RESOURCE: "AssignableDigitalResource",
|
|
@@ -57,7 +190,7 @@ function transformEvent(event) {
|
|
|
57
190
|
if (transformed.profile === "TimebackProfile") {
|
|
58
191
|
transformed.profile = "AggregationProfile";
|
|
59
192
|
}
|
|
60
|
-
if (isDict(transformed.actor)) {
|
|
193
|
+
if (isDict(transformed.actor) && transformed.actor.type === "TimebackUser") {
|
|
61
194
|
transformed.actor = transformActor(transformed.actor);
|
|
62
195
|
}
|
|
63
196
|
if (isDict(transformed.object)) {
|
|
@@ -71,6 +204,9 @@ function transformEvent(event) {
|
|
|
71
204
|
transformed.generated = transformTimeSpentMetrics(transformed.generated);
|
|
72
205
|
}
|
|
73
206
|
}
|
|
207
|
+
if (!transformed.session) {
|
|
208
|
+
transformed.session = SESSION_AUTO_ATTACH;
|
|
209
|
+
}
|
|
74
210
|
return transformed;
|
|
75
211
|
}
|
|
76
212
|
function transformActor(actor) {
|
|
@@ -140,28 +276,9 @@ function transformTimeSpentMetrics(collection) {
|
|
|
140
276
|
function isDict(value) {
|
|
141
277
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
142
278
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
// src/lib/transport.ts
|
|
148
|
-
class Transport extends BaseTransport {
|
|
149
|
-
paths;
|
|
150
|
-
constructor(config) {
|
|
151
|
-
super({ config, logger: log });
|
|
152
|
-
this.paths = config.paths;
|
|
153
|
-
}
|
|
154
|
-
async requestPaginated(path, options = {}) {
|
|
155
|
-
const response = await this.request(path, options);
|
|
156
|
-
const { events, pagination } = response;
|
|
157
|
-
const offset = options.params?.offset ?? 0;
|
|
158
|
-
const hasMore = offset + events.length < pagination.total;
|
|
159
|
-
return {
|
|
160
|
-
data: events,
|
|
161
|
-
hasMore,
|
|
162
|
-
total: pagination.total
|
|
163
|
-
};
|
|
164
|
-
}
|
|
279
|
+
// src/lib/resolve.ts
|
|
280
|
+
function resolveToProvider2(config, registry = DEFAULT_PROVIDER_REGISTRY) {
|
|
281
|
+
return resolveToProvider(config, CALIPER_ENV_VARS, registry);
|
|
165
282
|
}
|
|
166
283
|
|
|
167
284
|
// ../../types/src/zod/primitives.ts
|
|
@@ -169,6 +286,7 @@ import { z } from "zod/v4";
|
|
|
169
286
|
var IsoDateTimeRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/;
|
|
170
287
|
var IsoDateTimeString = z.string().min(1).regex(IsoDateTimeRegex, "must be a valid ISO 8601 datetime");
|
|
171
288
|
var IsoDateString = z.string().min(1).regex(/^\d{4}-\d{2}-\d{2}$/, "must be a valid ISO 8601 date (YYYY-MM-DD)");
|
|
289
|
+
var NonEmptyString = z.string().trim().min(1);
|
|
172
290
|
var TimebackSubject = z.enum([
|
|
173
291
|
"Reading",
|
|
174
292
|
"Language",
|
|
@@ -282,6 +400,7 @@ var IMSErrorResponse = z.object({
|
|
|
282
400
|
});
|
|
283
401
|
// ../../types/src/zod/caliper.ts
|
|
284
402
|
import { z as z2 } from "zod/v4";
|
|
403
|
+
var CaliperIri = z2.union([z2.url(), z2.string().regex(/^urn:/, "Must be a URL or URN")]);
|
|
285
404
|
var TimebackUser = z2.object({
|
|
286
405
|
id: z2.url(),
|
|
287
406
|
type: z2.literal("TimebackUser"),
|
|
@@ -391,11 +510,10 @@ var CaliperProfile = z2.enum([
|
|
|
391
510
|
]);
|
|
392
511
|
var CaliperEntity = z2.union([z2.string(), z2.record(z2.string(), z2.unknown())]);
|
|
393
512
|
var CaliperActor = z2.object({
|
|
394
|
-
id:
|
|
513
|
+
id: CaliperIri,
|
|
395
514
|
type: z2.string(),
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
}).loose()
|
|
515
|
+
name: z2.string().optional(),
|
|
516
|
+
extensions: z2.record(z2.string(), z2.unknown()).optional()
|
|
399
517
|
}).strict();
|
|
400
518
|
var CaliperEvent = z2.object({
|
|
401
519
|
"@context": z2.string().optional(),
|
|
@@ -417,30 +535,81 @@ var CaliperEvent = z2.object({
|
|
|
417
535
|
extensions: z2.record(z2.string(), z2.unknown()).optional()
|
|
418
536
|
}).strict();
|
|
419
537
|
var CaliperEnvelopeInput = z2.object({
|
|
420
|
-
sensor:
|
|
538
|
+
sensor: NonEmptyString,
|
|
421
539
|
sendTime: IsoDateTimeString,
|
|
422
540
|
dataVersion: z2.literal("http://purl.imsglobal.org/ctx/caliper/v1p2"),
|
|
423
541
|
data: z2.array(CaliperEvent).min(1, "data must contain at least one event")
|
|
424
542
|
});
|
|
425
543
|
var CaliperSendEventsInput = z2.object({
|
|
426
|
-
sensor:
|
|
544
|
+
sensor: NonEmptyString,
|
|
427
545
|
events: z2.array(CaliperEvent).min(1, "events must contain at least one event")
|
|
428
546
|
});
|
|
429
547
|
var CaliperListEventsParams = z2.object({
|
|
430
548
|
limit: z2.number().int().positive().optional(),
|
|
431
549
|
offset: z2.number().int().min(0).optional(),
|
|
432
|
-
sensor:
|
|
550
|
+
sensor: NonEmptyString.optional(),
|
|
433
551
|
startDate: IsoDateTimeString.optional(),
|
|
434
552
|
endDate: IsoDateTimeString.optional(),
|
|
435
|
-
actorId:
|
|
553
|
+
actorId: NonEmptyString.optional(),
|
|
436
554
|
actorEmail: z2.email().optional()
|
|
437
555
|
}).strict();
|
|
556
|
+
var AssessmentItemObject = z2.object({
|
|
557
|
+
id: z2.string(),
|
|
558
|
+
name: z2.string().optional(),
|
|
559
|
+
isPartOf: CaliperEntity.optional(),
|
|
560
|
+
extensions: z2.record(z2.string(), z2.unknown()).optional()
|
|
561
|
+
});
|
|
562
|
+
var ResponseGenerated = z2.object({
|
|
563
|
+
id: z2.string(),
|
|
564
|
+
attempt: z2.union([z2.string(), z2.record(z2.string(), z2.unknown())]).optional(),
|
|
565
|
+
startedAtTime: IsoDateTimeString.optional(),
|
|
566
|
+
endedAtTime: IsoDateTimeString.optional(),
|
|
567
|
+
duration: z2.string().optional(),
|
|
568
|
+
extensions: z2.record(z2.string(), z2.unknown()).optional()
|
|
569
|
+
});
|
|
570
|
+
var ScoreGenerated = z2.object({
|
|
571
|
+
id: z2.string().optional(),
|
|
572
|
+
scoreGiven: z2.number(),
|
|
573
|
+
maxScore: z2.number().optional(),
|
|
574
|
+
attempt: z2.union([z2.string(), z2.record(z2.string(), z2.unknown())]).optional(),
|
|
575
|
+
comment: z2.string().optional(),
|
|
576
|
+
extensions: z2.record(z2.string(), z2.unknown()).optional()
|
|
577
|
+
});
|
|
578
|
+
var QuestionSeenInput = z2.object({
|
|
579
|
+
actor: z2.union([z2.string(), CaliperActor, TimebackUser]),
|
|
580
|
+
object: AssessmentItemObject,
|
|
581
|
+
edApp: CaliperEntity,
|
|
582
|
+
id: z2.string().optional(),
|
|
583
|
+
eventTime: IsoDateTimeString.optional(),
|
|
584
|
+
session: CaliperEntity.optional(),
|
|
585
|
+
extensions: z2.record(z2.string(), z2.unknown()).optional()
|
|
586
|
+
}).strict();
|
|
587
|
+
var QuestionAnsweredInput = z2.object({
|
|
588
|
+
actor: z2.union([z2.string(), CaliperActor, TimebackUser]),
|
|
589
|
+
object: AssessmentItemObject,
|
|
590
|
+
edApp: CaliperEntity,
|
|
591
|
+
generated: ResponseGenerated.optional(),
|
|
592
|
+
id: z2.string().optional(),
|
|
593
|
+
eventTime: IsoDateTimeString.optional(),
|
|
594
|
+
session: CaliperEntity.optional(),
|
|
595
|
+
extensions: z2.record(z2.string(), z2.unknown()).optional()
|
|
596
|
+
}).strict();
|
|
597
|
+
var QuestionGradedInput = z2.object({
|
|
598
|
+
actor: z2.union([z2.string(), CaliperActor, TimebackUser]),
|
|
599
|
+
object: z2.string(),
|
|
600
|
+
generated: ScoreGenerated,
|
|
601
|
+
edApp: CaliperEntity,
|
|
602
|
+
id: z2.string().optional(),
|
|
603
|
+
eventTime: IsoDateTimeString.optional(),
|
|
604
|
+
session: CaliperEntity.optional(),
|
|
605
|
+
extensions: z2.record(z2.string(), z2.unknown()).optional()
|
|
606
|
+
}).strict();
|
|
438
607
|
// ../../types/src/zod/webhooks.ts
|
|
439
608
|
import { z as z3 } from "zod/v4";
|
|
440
609
|
var WebhookCreateInput = z3.object({
|
|
441
|
-
name:
|
|
610
|
+
name: NonEmptyString,
|
|
442
611
|
targetUrl: z3.url("targetUrl must be a valid URL"),
|
|
443
|
-
secret:
|
|
612
|
+
secret: NonEmptyString,
|
|
444
613
|
active: z3.boolean(),
|
|
445
614
|
sensor: z3.string().nullable().optional(),
|
|
446
615
|
description: z3.string().nullable().optional()
|
|
@@ -462,16 +631,15 @@ var WebhookFilterOperation = z3.enum([
|
|
|
462
631
|
"regexp"
|
|
463
632
|
]);
|
|
464
633
|
var WebhookFilterCreateInput = z3.object({
|
|
465
|
-
webhookId:
|
|
466
|
-
filterKey:
|
|
467
|
-
filterValue:
|
|
634
|
+
webhookId: NonEmptyString,
|
|
635
|
+
filterKey: NonEmptyString,
|
|
636
|
+
filterValue: NonEmptyString,
|
|
468
637
|
filterType: WebhookFilterType,
|
|
469
638
|
filterOperator: WebhookFilterOperation,
|
|
470
639
|
active: z3.boolean()
|
|
471
640
|
}).strict();
|
|
472
641
|
// ../../types/src/zod/case.ts
|
|
473
642
|
import { z as z4 } from "zod/v4";
|
|
474
|
-
var NonEmptyString = z4.string().trim().min(1);
|
|
475
643
|
var UuidString = z4.string().uuid();
|
|
476
644
|
var InputNodeURISchema = z4.object({
|
|
477
645
|
title: NonEmptyString,
|
|
@@ -565,15 +733,15 @@ var ClrProfileSchema = z5.object({
|
|
|
565
733
|
email: z5.string().email().optional()
|
|
566
734
|
});
|
|
567
735
|
var ClrProofSchema = z5.object({
|
|
568
|
-
type:
|
|
569
|
-
proofPurpose:
|
|
570
|
-
verificationMethod:
|
|
736
|
+
type: NonEmptyString,
|
|
737
|
+
proofPurpose: NonEmptyString,
|
|
738
|
+
verificationMethod: NonEmptyString,
|
|
571
739
|
created: z5.iso.datetime(),
|
|
572
|
-
proofValue:
|
|
740
|
+
proofValue: NonEmptyString,
|
|
573
741
|
cryptosuite: z5.string().optional()
|
|
574
742
|
});
|
|
575
743
|
var ClrCredentialSchemaSchema = z5.object({
|
|
576
|
-
id:
|
|
744
|
+
id: NonEmptyString,
|
|
577
745
|
type: z5.literal("1EdTechJsonSchemaValidator2019")
|
|
578
746
|
});
|
|
579
747
|
var AchievementCriteriaSchema = z5.object({
|
|
@@ -583,8 +751,8 @@ var AchievementCriteriaSchema = z5.object({
|
|
|
583
751
|
var AchievementSchema = z5.object({
|
|
584
752
|
id: z5.url(),
|
|
585
753
|
type: z5.array(z5.string()).min(1).refine((arr) => arr.includes("Achievement"), 'type must include "Achievement"'),
|
|
586
|
-
name:
|
|
587
|
-
description:
|
|
754
|
+
name: NonEmptyString,
|
|
755
|
+
description: NonEmptyString,
|
|
588
756
|
criteria: AchievementCriteriaSchema,
|
|
589
757
|
image: ClrImageSchema.optional(),
|
|
590
758
|
achievementType: z5.string().optional(),
|
|
@@ -592,8 +760,8 @@ var AchievementSchema = z5.object({
|
|
|
592
760
|
});
|
|
593
761
|
var IdentityObjectSchema = z5.object({
|
|
594
762
|
type: z5.literal("IdentityObject"),
|
|
595
|
-
identityHash:
|
|
596
|
-
identityType:
|
|
763
|
+
identityHash: NonEmptyString,
|
|
764
|
+
identityType: NonEmptyString,
|
|
597
765
|
hashed: z5.boolean(),
|
|
598
766
|
salt: z5.string().optional()
|
|
599
767
|
});
|
|
@@ -638,7 +806,7 @@ var ClrCredentialInput = z5.object({
|
|
|
638
806
|
id: z5.url(),
|
|
639
807
|
type: z5.array(z5.string()).min(1).refine((arr) => arr.includes("VerifiableCredential") && arr.includes("ClrCredential"), 'type must include "VerifiableCredential" and "ClrCredential"'),
|
|
640
808
|
issuer: ClrProfileSchema,
|
|
641
|
-
name:
|
|
809
|
+
name: NonEmptyString,
|
|
642
810
|
description: z5.string().optional(),
|
|
643
811
|
validFrom: z5.iso.datetime(),
|
|
644
812
|
validUntil: z5.iso.datetime().optional(),
|
|
@@ -771,6 +939,7 @@ var TimebackConfig = z6.object({
|
|
|
771
939
|
// ../../types/src/zod/edubridge.ts
|
|
772
940
|
import { z as z7 } from "zod/v4";
|
|
773
941
|
var EdubridgeDateString = z7.union([IsoDateTimeString, IsoDateString]);
|
|
942
|
+
var EdubridgeDateStringInput = EdubridgeDateString.transform((date) => date.includes("T") ? date : `${date}T00:00:00.000Z`);
|
|
774
943
|
var EduBridgeEnrollment = z7.object({
|
|
775
944
|
id: z7.string(),
|
|
776
945
|
role: z7.string(),
|
|
@@ -814,10 +983,9 @@ var EduBridgeEnrollmentAnalyticsResponse = z7.object({
|
|
|
814
983
|
facts: EduBridgeAnalyticsFacts,
|
|
815
984
|
factsByApp: z7.unknown()
|
|
816
985
|
});
|
|
817
|
-
var NonEmptyString2 = z7.string().trim().min(1);
|
|
818
986
|
var EmailOrStudentId = z7.object({
|
|
819
987
|
email: z7.email().optional(),
|
|
820
|
-
studentId:
|
|
988
|
+
studentId: NonEmptyString.optional()
|
|
821
989
|
}).superRefine((value, ctx) => {
|
|
822
990
|
if (!value.email && !value.studentId) {
|
|
823
991
|
ctx.addIssue({
|
|
@@ -833,16 +1001,16 @@ var EmailOrStudentId = z7.object({
|
|
|
833
1001
|
}
|
|
834
1002
|
});
|
|
835
1003
|
var SubjectTrackInput = z7.object({
|
|
836
|
-
subject:
|
|
837
|
-
grade:
|
|
838
|
-
courseId:
|
|
839
|
-
orgSourcedId:
|
|
1004
|
+
subject: NonEmptyString,
|
|
1005
|
+
grade: NonEmptyString,
|
|
1006
|
+
courseId: NonEmptyString,
|
|
1007
|
+
orgSourcedId: NonEmptyString.optional()
|
|
840
1008
|
});
|
|
841
1009
|
var EdubridgeListEnrollmentsParams = z7.object({
|
|
842
|
-
userId:
|
|
1010
|
+
userId: NonEmptyString
|
|
843
1011
|
});
|
|
844
1012
|
var EdubridgeEnrollOptions = z7.object({
|
|
845
|
-
sourcedId:
|
|
1013
|
+
sourcedId: NonEmptyString.optional(),
|
|
846
1014
|
role: EnrollmentRole.optional(),
|
|
847
1015
|
beginDate: IsoDateTimeString.optional(),
|
|
848
1016
|
metadata: z7.record(z7.string(), z7.unknown()).optional()
|
|
@@ -856,43 +1024,42 @@ var EdubridgeUsersListParams = z7.object({
|
|
|
856
1024
|
filter: z7.string().optional(),
|
|
857
1025
|
search: z7.string().optional(),
|
|
858
1026
|
roles: z7.array(OneRosterUserRole).min(1),
|
|
859
|
-
orgSourcedIds: z7.array(
|
|
1027
|
+
orgSourcedIds: z7.array(NonEmptyString).optional()
|
|
860
1028
|
});
|
|
861
1029
|
var EdubridgeActivityParams = EmailOrStudentId.extend({
|
|
862
|
-
startDate:
|
|
863
|
-
endDate:
|
|
1030
|
+
startDate: EdubridgeDateStringInput,
|
|
1031
|
+
endDate: EdubridgeDateStringInput,
|
|
864
1032
|
timezone: z7.string().optional()
|
|
865
1033
|
});
|
|
866
1034
|
var EdubridgeWeeklyFactsParams = EmailOrStudentId.extend({
|
|
867
|
-
weekDate:
|
|
1035
|
+
weekDate: EdubridgeDateStringInput,
|
|
868
1036
|
timezone: z7.string().optional()
|
|
869
1037
|
});
|
|
870
1038
|
var EdubridgeEnrollmentFactsParams = z7.object({
|
|
871
|
-
enrollmentId:
|
|
872
|
-
startDate:
|
|
873
|
-
endDate:
|
|
1039
|
+
enrollmentId: NonEmptyString,
|
|
1040
|
+
startDate: EdubridgeDateStringInput.optional(),
|
|
1041
|
+
endDate: EdubridgeDateStringInput.optional(),
|
|
874
1042
|
timezone: z7.string().optional()
|
|
875
1043
|
});
|
|
876
1044
|
// ../../types/src/zod/masterytrack.ts
|
|
877
1045
|
import { z as z8 } from "zod/v4";
|
|
878
|
-
var NonEmptyString3 = z8.string().trim().min(1);
|
|
879
1046
|
var MasteryTrackAuthorizerInput = z8.object({
|
|
880
1047
|
email: z8.email()
|
|
881
1048
|
});
|
|
882
1049
|
var MasteryTrackInventorySearchParams = z8.object({
|
|
883
|
-
name:
|
|
884
|
-
timeback_id:
|
|
885
|
-
grade:
|
|
886
|
-
subject:
|
|
1050
|
+
name: NonEmptyString.optional(),
|
|
1051
|
+
timeback_id: NonEmptyString.optional(),
|
|
1052
|
+
grade: NonEmptyString.optional(),
|
|
1053
|
+
subject: NonEmptyString.optional(),
|
|
887
1054
|
all: z8.boolean().optional()
|
|
888
1055
|
});
|
|
889
1056
|
var MasteryTrackAssignmentInput = z8.object({
|
|
890
1057
|
student_email: z8.email(),
|
|
891
|
-
timeback_id:
|
|
892
|
-
subject:
|
|
1058
|
+
timeback_id: NonEmptyString.optional(),
|
|
1059
|
+
subject: NonEmptyString.optional(),
|
|
893
1060
|
grade_rank: z8.number().int().min(0).max(12).optional(),
|
|
894
|
-
assessment_line_item_sourced_id:
|
|
895
|
-
assessment_result_sourced_id:
|
|
1061
|
+
assessment_line_item_sourced_id: NonEmptyString.optional(),
|
|
1062
|
+
assessment_result_sourced_id: NonEmptyString.optional()
|
|
896
1063
|
}).superRefine((value, ctx) => {
|
|
897
1064
|
const hasTimebackId = !!value.timeback_id;
|
|
898
1065
|
const hasSubject = !!value.subject;
|
|
@@ -929,8 +1096,8 @@ var MasteryTrackAssignmentInput = z8.object({
|
|
|
929
1096
|
var MasteryTrackInvalidateAssignmentInput = z8.object({
|
|
930
1097
|
student_email: z8.email(),
|
|
931
1098
|
assignment_id: z8.number().int().positive().optional(),
|
|
932
|
-
timeback_id:
|
|
933
|
-
subject:
|
|
1099
|
+
timeback_id: NonEmptyString.optional(),
|
|
1100
|
+
subject: NonEmptyString.optional(),
|
|
934
1101
|
grade_rank: z8.number().int().min(0).max(12).optional()
|
|
935
1102
|
}).superRefine((value, ctx) => {
|
|
936
1103
|
const byAssignment = value.assignment_id !== undefined;
|
|
@@ -953,15 +1120,14 @@ var MasteryTrackInvalidateAssignmentInput = z8.object({
|
|
|
953
1120
|
});
|
|
954
1121
|
// ../../types/src/zod/oneroster.ts
|
|
955
1122
|
import { z as z9 } from "zod/v4";
|
|
956
|
-
var NonEmptyString4 = z9.string().min(1);
|
|
957
1123
|
var Status = z9.enum(["active", "tobedeleted"]);
|
|
958
1124
|
var Metadata = z9.record(z9.string(), z9.unknown()).nullable().optional();
|
|
959
1125
|
var Ref = z9.object({
|
|
960
|
-
sourcedId:
|
|
1126
|
+
sourcedId: NonEmptyString,
|
|
961
1127
|
type: z9.string().optional(),
|
|
962
1128
|
href: z9.string().optional()
|
|
963
1129
|
}).strict();
|
|
964
|
-
var OneRosterDateString = z9.union([IsoDateString, IsoDateTimeString]);
|
|
1130
|
+
var OneRosterDateString = z9.union([IsoDateString, IsoDateTimeString]).transform((date) => date.includes("T") ? date : `${date}T00:00:00Z`);
|
|
965
1131
|
var OneRosterUserRoleInput = z9.object({
|
|
966
1132
|
roleType: z9.enum(["primary", "secondary"]),
|
|
967
1133
|
role: OneRosterUserRole,
|
|
@@ -972,58 +1138,58 @@ var OneRosterUserRoleInput = z9.object({
|
|
|
972
1138
|
endDate: OneRosterDateString.optional()
|
|
973
1139
|
}).strict();
|
|
974
1140
|
var OneRosterUserCreateInput = z9.object({
|
|
975
|
-
sourcedId:
|
|
1141
|
+
sourcedId: NonEmptyString.describe("sourcedId must be a non-empty string"),
|
|
976
1142
|
status: Status.optional(),
|
|
977
1143
|
enabledUser: z9.boolean(),
|
|
978
|
-
givenName:
|
|
979
|
-
familyName:
|
|
980
|
-
middleName:
|
|
981
|
-
username:
|
|
1144
|
+
givenName: NonEmptyString.describe("givenName must be a non-empty string"),
|
|
1145
|
+
familyName: NonEmptyString.describe("familyName must be a non-empty string"),
|
|
1146
|
+
middleName: NonEmptyString.optional(),
|
|
1147
|
+
username: NonEmptyString.optional(),
|
|
982
1148
|
email: z9.email(),
|
|
983
1149
|
roles: z9.array(OneRosterUserRoleInput).min(1, "roles must include at least one role"),
|
|
984
1150
|
userIds: z9.array(z9.object({
|
|
985
|
-
type:
|
|
986
|
-
identifier:
|
|
1151
|
+
type: NonEmptyString,
|
|
1152
|
+
identifier: NonEmptyString
|
|
987
1153
|
}).strict()).optional(),
|
|
988
1154
|
agents: z9.array(Ref).optional(),
|
|
989
1155
|
grades: z9.array(TimebackGrade).optional(),
|
|
990
|
-
identifier:
|
|
991
|
-
sms:
|
|
992
|
-
phone:
|
|
993
|
-
pronouns:
|
|
994
|
-
password:
|
|
1156
|
+
identifier: NonEmptyString.optional(),
|
|
1157
|
+
sms: NonEmptyString.optional(),
|
|
1158
|
+
phone: NonEmptyString.optional(),
|
|
1159
|
+
pronouns: NonEmptyString.optional(),
|
|
1160
|
+
password: NonEmptyString.optional(),
|
|
995
1161
|
metadata: Metadata
|
|
996
1162
|
}).strict();
|
|
997
1163
|
var OneRosterCourseCreateInput = z9.object({
|
|
998
|
-
sourcedId:
|
|
1164
|
+
sourcedId: NonEmptyString.describe("sourcedId must be a non-empty string").optional(),
|
|
999
1165
|
status: Status.optional(),
|
|
1000
|
-
title:
|
|
1166
|
+
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
1001
1167
|
org: Ref,
|
|
1002
|
-
courseCode:
|
|
1168
|
+
courseCode: NonEmptyString.optional(),
|
|
1003
1169
|
subjects: z9.array(TimebackSubject).optional(),
|
|
1004
1170
|
grades: z9.array(TimebackGrade).optional(),
|
|
1005
|
-
level:
|
|
1171
|
+
level: NonEmptyString.optional(),
|
|
1006
1172
|
metadata: Metadata
|
|
1007
1173
|
}).strict();
|
|
1008
1174
|
var OneRosterClassCreateInput = z9.object({
|
|
1009
|
-
sourcedId:
|
|
1175
|
+
sourcedId: NonEmptyString.describe("sourcedId must be a non-empty string").optional(),
|
|
1010
1176
|
status: Status.optional(),
|
|
1011
|
-
title:
|
|
1177
|
+
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
1012
1178
|
terms: z9.array(Ref).min(1, "terms must have at least one item"),
|
|
1013
1179
|
course: Ref,
|
|
1014
1180
|
org: Ref,
|
|
1015
|
-
classCode:
|
|
1181
|
+
classCode: NonEmptyString.optional(),
|
|
1016
1182
|
classType: z9.enum(["homeroom", "scheduled"]).optional(),
|
|
1017
|
-
location:
|
|
1183
|
+
location: NonEmptyString.optional(),
|
|
1018
1184
|
grades: z9.array(TimebackGrade).optional(),
|
|
1019
1185
|
subjects: z9.array(TimebackSubject).optional(),
|
|
1020
|
-
subjectCodes: z9.array(
|
|
1021
|
-
periods: z9.array(
|
|
1186
|
+
subjectCodes: z9.array(NonEmptyString).optional(),
|
|
1187
|
+
periods: z9.array(NonEmptyString).optional(),
|
|
1022
1188
|
metadata: Metadata
|
|
1023
1189
|
}).strict();
|
|
1024
1190
|
var StringBoolean = z9.enum(["true", "false"]);
|
|
1025
1191
|
var OneRosterEnrollmentCreateInput = z9.object({
|
|
1026
|
-
sourcedId:
|
|
1192
|
+
sourcedId: NonEmptyString.describe("sourcedId must be a non-empty string").optional(),
|
|
1027
1193
|
status: Status.optional(),
|
|
1028
1194
|
user: Ref,
|
|
1029
1195
|
class: Ref,
|
|
@@ -1035,20 +1201,20 @@ var OneRosterEnrollmentCreateInput = z9.object({
|
|
|
1035
1201
|
metadata: Metadata
|
|
1036
1202
|
}).strict();
|
|
1037
1203
|
var OneRosterCategoryCreateInput = z9.object({
|
|
1038
|
-
sourcedId:
|
|
1039
|
-
title:
|
|
1204
|
+
sourcedId: NonEmptyString.optional(),
|
|
1205
|
+
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
1040
1206
|
status: Status,
|
|
1041
1207
|
weight: z9.number().nullable().optional(),
|
|
1042
1208
|
metadata: Metadata
|
|
1043
1209
|
}).strict();
|
|
1044
1210
|
var OneRosterLineItemCreateInput = z9.object({
|
|
1045
|
-
sourcedId:
|
|
1046
|
-
title:
|
|
1211
|
+
sourcedId: NonEmptyString.optional(),
|
|
1212
|
+
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
1047
1213
|
class: Ref,
|
|
1048
1214
|
school: Ref,
|
|
1049
1215
|
category: Ref,
|
|
1050
|
-
assignDate:
|
|
1051
|
-
dueDate:
|
|
1216
|
+
assignDate: OneRosterDateString,
|
|
1217
|
+
dueDate: OneRosterDateString,
|
|
1052
1218
|
status: Status,
|
|
1053
1219
|
description: z9.string().optional(),
|
|
1054
1220
|
resultValueMin: z9.number().nullable().optional(),
|
|
@@ -1057,11 +1223,11 @@ var OneRosterLineItemCreateInput = z9.object({
|
|
|
1057
1223
|
metadata: Metadata
|
|
1058
1224
|
}).strict();
|
|
1059
1225
|
var OneRosterResultCreateInput = z9.object({
|
|
1060
|
-
sourcedId:
|
|
1226
|
+
sourcedId: NonEmptyString.optional(),
|
|
1061
1227
|
lineItem: Ref,
|
|
1062
1228
|
student: Ref,
|
|
1063
1229
|
class: Ref.optional(),
|
|
1064
|
-
scoreDate:
|
|
1230
|
+
scoreDate: OneRosterDateString,
|
|
1065
1231
|
scoreStatus: z9.enum([
|
|
1066
1232
|
"exempt",
|
|
1067
1233
|
"fully graded",
|
|
@@ -1076,15 +1242,15 @@ var OneRosterResultCreateInput = z9.object({
|
|
|
1076
1242
|
metadata: Metadata
|
|
1077
1243
|
}).strict();
|
|
1078
1244
|
var OneRosterScoreScaleCreateInput = z9.object({
|
|
1079
|
-
sourcedId:
|
|
1080
|
-
title:
|
|
1245
|
+
sourcedId: NonEmptyString.optional(),
|
|
1246
|
+
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
1081
1247
|
status: Status.optional(),
|
|
1082
1248
|
type: z9.string(),
|
|
1083
1249
|
class: Ref,
|
|
1084
1250
|
course: Ref.nullable().optional(),
|
|
1085
1251
|
scoreScaleValue: z9.array(z9.object({
|
|
1086
|
-
itemValueLHS:
|
|
1087
|
-
itemValueRHS:
|
|
1252
|
+
itemValueLHS: NonEmptyString,
|
|
1253
|
+
itemValueRHS: NonEmptyString,
|
|
1088
1254
|
value: z9.string().optional(),
|
|
1089
1255
|
description: z9.string().optional()
|
|
1090
1256
|
}).strict()),
|
|
@@ -1093,10 +1259,10 @@ var OneRosterScoreScaleCreateInput = z9.object({
|
|
|
1093
1259
|
metadata: Metadata
|
|
1094
1260
|
}).strict();
|
|
1095
1261
|
var OneRosterAssessmentLineItemCreateInput = z9.object({
|
|
1096
|
-
sourcedId:
|
|
1262
|
+
sourcedId: NonEmptyString.optional(),
|
|
1097
1263
|
status: Status.optional(),
|
|
1098
1264
|
dateLastModified: IsoDateTimeString.optional(),
|
|
1099
|
-
title:
|
|
1265
|
+
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
1100
1266
|
description: z9.string().nullable().optional(),
|
|
1101
1267
|
class: Ref.nullable().optional(),
|
|
1102
1268
|
parentAssessmentLineItem: Ref.nullable().optional(),
|
|
@@ -1122,7 +1288,7 @@ var LearningObjectiveScoreSetSchema = z9.array(z9.object({
|
|
|
1122
1288
|
learningObjectiveResults: z9.array(LearningObjectiveResult)
|
|
1123
1289
|
}));
|
|
1124
1290
|
var OneRosterAssessmentResultCreateInput = z9.object({
|
|
1125
|
-
sourcedId:
|
|
1291
|
+
sourcedId: NonEmptyString.optional(),
|
|
1126
1292
|
status: Status.optional(),
|
|
1127
1293
|
dateLastModified: IsoDateTimeString.optional(),
|
|
1128
1294
|
metadata: Metadata,
|
|
@@ -1130,7 +1296,7 @@ var OneRosterAssessmentResultCreateInput = z9.object({
|
|
|
1130
1296
|
student: Ref,
|
|
1131
1297
|
score: z9.number().nullable().optional(),
|
|
1132
1298
|
textScore: z9.string().nullable().optional(),
|
|
1133
|
-
scoreDate:
|
|
1299
|
+
scoreDate: OneRosterDateString,
|
|
1134
1300
|
scoreScale: Ref.nullable().optional(),
|
|
1135
1301
|
scorePercentile: z9.number().nullable().optional(),
|
|
1136
1302
|
scoreStatus: z9.enum([
|
|
@@ -1148,53 +1314,53 @@ var OneRosterAssessmentResultCreateInput = z9.object({
|
|
|
1148
1314
|
missing: z9.string().nullable().optional()
|
|
1149
1315
|
}).strict();
|
|
1150
1316
|
var OneRosterOrgCreateInput = z9.object({
|
|
1151
|
-
sourcedId:
|
|
1317
|
+
sourcedId: NonEmptyString.optional(),
|
|
1152
1318
|
status: Status.optional(),
|
|
1153
|
-
name:
|
|
1319
|
+
name: NonEmptyString.describe("name must be a non-empty string"),
|
|
1154
1320
|
type: OrganizationType,
|
|
1155
|
-
identifier:
|
|
1321
|
+
identifier: NonEmptyString.optional(),
|
|
1156
1322
|
parent: Ref.optional(),
|
|
1157
1323
|
metadata: Metadata
|
|
1158
1324
|
}).strict();
|
|
1159
1325
|
var OneRosterSchoolCreateInput = z9.object({
|
|
1160
|
-
sourcedId:
|
|
1326
|
+
sourcedId: NonEmptyString.optional(),
|
|
1161
1327
|
status: Status.optional(),
|
|
1162
|
-
name:
|
|
1328
|
+
name: NonEmptyString.describe("name must be a non-empty string"),
|
|
1163
1329
|
type: z9.literal("school").optional(),
|
|
1164
|
-
identifier:
|
|
1330
|
+
identifier: NonEmptyString.optional(),
|
|
1165
1331
|
parent: Ref.optional(),
|
|
1166
1332
|
metadata: Metadata
|
|
1167
1333
|
}).strict();
|
|
1168
1334
|
var OneRosterAcademicSessionCreateInput = z9.object({
|
|
1169
|
-
sourcedId:
|
|
1335
|
+
sourcedId: NonEmptyString.describe("sourcedId must be a non-empty string"),
|
|
1170
1336
|
status: Status,
|
|
1171
|
-
title:
|
|
1337
|
+
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
1172
1338
|
startDate: OneRosterDateString,
|
|
1173
1339
|
endDate: OneRosterDateString,
|
|
1174
1340
|
type: z9.enum(["gradingPeriod", "semester", "schoolYear", "term"]),
|
|
1175
|
-
schoolYear:
|
|
1341
|
+
schoolYear: NonEmptyString.describe("schoolYear must be a non-empty string"),
|
|
1176
1342
|
org: Ref,
|
|
1177
1343
|
parent: Ref.optional(),
|
|
1178
1344
|
children: z9.array(Ref).optional(),
|
|
1179
1345
|
metadata: Metadata
|
|
1180
1346
|
}).strict();
|
|
1181
1347
|
var OneRosterComponentResourceCreateInput = z9.object({
|
|
1182
|
-
sourcedId:
|
|
1183
|
-
title:
|
|
1348
|
+
sourcedId: NonEmptyString.optional(),
|
|
1349
|
+
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
1184
1350
|
courseComponent: Ref,
|
|
1185
1351
|
resource: Ref,
|
|
1186
1352
|
status: Status,
|
|
1187
1353
|
metadata: Metadata
|
|
1188
1354
|
}).strict();
|
|
1189
1355
|
var OneRosterCourseComponentCreateInput = z9.object({
|
|
1190
|
-
sourcedId:
|
|
1191
|
-
title:
|
|
1356
|
+
sourcedId: NonEmptyString.optional(),
|
|
1357
|
+
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
1192
1358
|
course: Ref,
|
|
1193
1359
|
status: Status,
|
|
1194
1360
|
metadata: Metadata
|
|
1195
1361
|
}).strict();
|
|
1196
1362
|
var OneRosterEnrollInput = z9.object({
|
|
1197
|
-
sourcedId:
|
|
1363
|
+
sourcedId: NonEmptyString.describe("sourcedId must be a non-empty string"),
|
|
1198
1364
|
role: z9.enum(["student", "teacher"]),
|
|
1199
1365
|
primary: StringBoolean.optional(),
|
|
1200
1366
|
beginDate: IsoDateString.optional(),
|
|
@@ -1202,17 +1368,17 @@ var OneRosterEnrollInput = z9.object({
|
|
|
1202
1368
|
metadata: Metadata
|
|
1203
1369
|
}).strict();
|
|
1204
1370
|
var OneRosterAgentInput = z9.object({
|
|
1205
|
-
agentSourcedId:
|
|
1371
|
+
agentSourcedId: NonEmptyString.describe("agentSourcedId must be a non-empty string")
|
|
1206
1372
|
}).strict();
|
|
1207
1373
|
var OneRosterCredentialInput = z9.object({
|
|
1208
|
-
applicationName:
|
|
1374
|
+
applicationName: NonEmptyString.describe("applicationName must be a non-empty string"),
|
|
1209
1375
|
credentials: z9.object({
|
|
1210
|
-
username:
|
|
1211
|
-
password:
|
|
1376
|
+
username: NonEmptyString.describe("username must be a non-empty string"),
|
|
1377
|
+
password: NonEmptyString.describe("password must be a non-empty string")
|
|
1212
1378
|
})
|
|
1213
1379
|
}).strict();
|
|
1214
1380
|
var OneRosterDemographicsCreateInput = z9.object({
|
|
1215
|
-
sourcedId:
|
|
1381
|
+
sourcedId: NonEmptyString.describe("sourcedId must be a non-empty string")
|
|
1216
1382
|
}).loose();
|
|
1217
1383
|
var CommonResourceMetadataSchema = z9.object({
|
|
1218
1384
|
type: ResourceType,
|
|
@@ -1284,9 +1450,9 @@ var ResourceMetadataSchema = z9.discriminatedUnion("type", [
|
|
|
1284
1450
|
AssessmentBankMetadataSchema
|
|
1285
1451
|
]);
|
|
1286
1452
|
var OneRosterResourceCreateInput = z9.object({
|
|
1287
|
-
sourcedId:
|
|
1288
|
-
title:
|
|
1289
|
-
vendorResourceId:
|
|
1453
|
+
sourcedId: NonEmptyString.optional(),
|
|
1454
|
+
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
1455
|
+
vendorResourceId: NonEmptyString.describe("vendorResourceId must be a non-empty string"),
|
|
1290
1456
|
roles: z9.array(z9.enum(["primary", "secondary"])).optional(),
|
|
1291
1457
|
importance: z9.enum(["primary", "secondary"]).optional(),
|
|
1292
1458
|
vendorId: z9.string().optional(),
|
|
@@ -1295,18 +1461,18 @@ var OneRosterResourceCreateInput = z9.object({
|
|
|
1295
1461
|
metadata: ResourceMetadataSchema.nullable().optional()
|
|
1296
1462
|
}).strict();
|
|
1297
1463
|
var CourseStructureItem = z9.object({
|
|
1298
|
-
url:
|
|
1299
|
-
skillCode:
|
|
1300
|
-
lessonCode:
|
|
1301
|
-
title:
|
|
1302
|
-
"unit-title":
|
|
1303
|
-
status:
|
|
1464
|
+
url: NonEmptyString.describe("courseStructure.url must be a non-empty string"),
|
|
1465
|
+
skillCode: NonEmptyString.describe("courseStructure.skillCode must be a non-empty string"),
|
|
1466
|
+
lessonCode: NonEmptyString.describe("courseStructure.lessonCode must be a non-empty string"),
|
|
1467
|
+
title: NonEmptyString.describe("courseStructure.title must be a non-empty string"),
|
|
1468
|
+
"unit-title": NonEmptyString.describe("courseStructure.unit-title must be a non-empty string"),
|
|
1469
|
+
status: NonEmptyString.describe("courseStructure.status must be a non-empty string"),
|
|
1304
1470
|
xp: z9.number()
|
|
1305
1471
|
}).loose();
|
|
1306
1472
|
var OneRosterCourseStructureInput = z9.object({
|
|
1307
1473
|
course: z9.object({
|
|
1308
|
-
sourcedId:
|
|
1309
|
-
title:
|
|
1474
|
+
sourcedId: NonEmptyString.describe("course.sourcedId must be a non-empty string").optional(),
|
|
1475
|
+
title: NonEmptyString.describe("course.title must be a non-empty string"),
|
|
1310
1476
|
org: Ref,
|
|
1311
1477
|
status: Status,
|
|
1312
1478
|
metadata: Metadata
|
|
@@ -1319,7 +1485,6 @@ var OneRosterBulkResultItem = z9.object({
|
|
|
1319
1485
|
var OneRosterBulkResultsInput = z9.array(OneRosterBulkResultItem).min(1, "results must have at least one item");
|
|
1320
1486
|
// ../../types/src/zod/powerpath.ts
|
|
1321
1487
|
import { z as z10 } from "zod/v4";
|
|
1322
|
-
var NonEmptyString5 = z10.string().trim().min(1);
|
|
1323
1488
|
var ToolProvider = z10.enum(["edulastic", "mastery-track"]);
|
|
1324
1489
|
var LessonTypeRequired = z10.enum([
|
|
1325
1490
|
"powerpath-100",
|
|
@@ -1332,14 +1497,14 @@ var LessonTypeRequired = z10.enum([
|
|
|
1332
1497
|
var GradeArray = z10.array(TimebackGrade);
|
|
1333
1498
|
var ResourceMetadata = z10.record(z10.string(), z10.unknown()).optional();
|
|
1334
1499
|
var ExternalTestBase = z10.object({
|
|
1335
|
-
courseId:
|
|
1336
|
-
lessonTitle:
|
|
1337
|
-
launchUrl:
|
|
1500
|
+
courseId: NonEmptyString,
|
|
1501
|
+
lessonTitle: NonEmptyString.optional(),
|
|
1502
|
+
launchUrl: NonEmptyString.optional(),
|
|
1338
1503
|
toolProvider: ToolProvider,
|
|
1339
|
-
unitTitle:
|
|
1340
|
-
courseComponentSourcedId:
|
|
1341
|
-
vendorId:
|
|
1342
|
-
description:
|
|
1504
|
+
unitTitle: NonEmptyString.optional(),
|
|
1505
|
+
courseComponentSourcedId: NonEmptyString.optional(),
|
|
1506
|
+
vendorId: NonEmptyString.optional(),
|
|
1507
|
+
description: NonEmptyString.optional(),
|
|
1343
1508
|
resourceMetadata: ResourceMetadata.nullable().optional(),
|
|
1344
1509
|
grades: GradeArray
|
|
1345
1510
|
});
|
|
@@ -1349,26 +1514,26 @@ var ExternalTestOut = ExternalTestBase.extend({
|
|
|
1349
1514
|
});
|
|
1350
1515
|
var ExternalPlacement = ExternalTestBase.extend({
|
|
1351
1516
|
lessonType: z10.literal("placement"),
|
|
1352
|
-
courseIdOnFail:
|
|
1517
|
+
courseIdOnFail: NonEmptyString.nullable().optional(),
|
|
1353
1518
|
xp: z10.number().optional()
|
|
1354
1519
|
});
|
|
1355
1520
|
var InternalTestBase = z10.object({
|
|
1356
|
-
courseId:
|
|
1521
|
+
courseId: NonEmptyString,
|
|
1357
1522
|
lessonType: LessonTypeRequired,
|
|
1358
|
-
lessonTitle:
|
|
1359
|
-
unitTitle:
|
|
1360
|
-
courseComponentSourcedId:
|
|
1523
|
+
lessonTitle: NonEmptyString.optional(),
|
|
1524
|
+
unitTitle: NonEmptyString.optional(),
|
|
1525
|
+
courseComponentSourcedId: NonEmptyString.optional(),
|
|
1361
1526
|
resourceMetadata: ResourceMetadata.nullable().optional(),
|
|
1362
1527
|
xp: z10.number().optional(),
|
|
1363
1528
|
grades: GradeArray.optional(),
|
|
1364
|
-
courseIdOnFail:
|
|
1529
|
+
courseIdOnFail: NonEmptyString.nullable().optional()
|
|
1365
1530
|
});
|
|
1366
1531
|
var PowerPathCreateInternalTestInput = z10.discriminatedUnion("testType", [
|
|
1367
1532
|
InternalTestBase.extend({
|
|
1368
1533
|
testType: z10.literal("qti"),
|
|
1369
1534
|
qti: z10.object({
|
|
1370
1535
|
url: z10.url(),
|
|
1371
|
-
title:
|
|
1536
|
+
title: NonEmptyString.optional(),
|
|
1372
1537
|
metadata: z10.record(z10.string(), z10.unknown()).optional()
|
|
1373
1538
|
})
|
|
1374
1539
|
}),
|
|
@@ -1377,28 +1542,28 @@ var PowerPathCreateInternalTestInput = z10.discriminatedUnion("testType", [
|
|
|
1377
1542
|
assessmentBank: z10.object({
|
|
1378
1543
|
resources: z10.array(z10.object({
|
|
1379
1544
|
url: z10.url(),
|
|
1380
|
-
title:
|
|
1545
|
+
title: NonEmptyString.optional(),
|
|
1381
1546
|
metadata: z10.record(z10.string(), z10.unknown()).optional()
|
|
1382
1547
|
})).min(1)
|
|
1383
1548
|
})
|
|
1384
1549
|
})
|
|
1385
1550
|
]);
|
|
1386
1551
|
var PowerPathCreateNewAttemptInput = z10.object({
|
|
1387
|
-
student:
|
|
1388
|
-
lesson:
|
|
1552
|
+
student: NonEmptyString,
|
|
1553
|
+
lesson: NonEmptyString
|
|
1389
1554
|
});
|
|
1390
1555
|
var PowerPathFinalStudentAssessmentResponseInput = z10.object({
|
|
1391
|
-
student:
|
|
1392
|
-
lesson:
|
|
1556
|
+
student: NonEmptyString,
|
|
1557
|
+
lesson: NonEmptyString
|
|
1393
1558
|
});
|
|
1394
1559
|
var PowerPathLessonPlansCreateInput = z10.object({
|
|
1395
|
-
courseId:
|
|
1396
|
-
userId:
|
|
1397
|
-
classId:
|
|
1560
|
+
courseId: NonEmptyString,
|
|
1561
|
+
userId: NonEmptyString,
|
|
1562
|
+
classId: NonEmptyString.optional()
|
|
1398
1563
|
});
|
|
1399
1564
|
var LessonPlanTarget = z10.object({
|
|
1400
1565
|
type: z10.enum(["component", "resource"]),
|
|
1401
|
-
id:
|
|
1566
|
+
id: NonEmptyString
|
|
1402
1567
|
});
|
|
1403
1568
|
var PowerPathLessonPlanOperationInput = z10.union([
|
|
1404
1569
|
z10.object({
|
|
@@ -1411,8 +1576,8 @@ var PowerPathLessonPlanOperationInput = z10.union([
|
|
|
1411
1576
|
z10.object({
|
|
1412
1577
|
type: z10.literal("add-custom-resource"),
|
|
1413
1578
|
payload: z10.object({
|
|
1414
|
-
resource_id:
|
|
1415
|
-
parent_component_id:
|
|
1579
|
+
resource_id: NonEmptyString,
|
|
1580
|
+
parent_component_id: NonEmptyString,
|
|
1416
1581
|
skipped: z10.boolean().optional()
|
|
1417
1582
|
})
|
|
1418
1583
|
}),
|
|
@@ -1420,14 +1585,14 @@ var PowerPathLessonPlanOperationInput = z10.union([
|
|
|
1420
1585
|
type: z10.literal("move-item-before"),
|
|
1421
1586
|
payload: z10.object({
|
|
1422
1587
|
target: LessonPlanTarget,
|
|
1423
|
-
reference_id:
|
|
1588
|
+
reference_id: NonEmptyString
|
|
1424
1589
|
})
|
|
1425
1590
|
}),
|
|
1426
1591
|
z10.object({
|
|
1427
1592
|
type: z10.literal("move-item-after"),
|
|
1428
1593
|
payload: z10.object({
|
|
1429
1594
|
target: LessonPlanTarget,
|
|
1430
|
-
reference_id:
|
|
1595
|
+
reference_id: NonEmptyString
|
|
1431
1596
|
})
|
|
1432
1597
|
}),
|
|
1433
1598
|
z10.object({
|
|
@@ -1446,107 +1611,107 @@ var PowerPathLessonPlanOperationInput = z10.union([
|
|
|
1446
1611
|
type: z10.literal("change-item-parent"),
|
|
1447
1612
|
payload: z10.object({
|
|
1448
1613
|
target: LessonPlanTarget,
|
|
1449
|
-
new_parent_id:
|
|
1614
|
+
new_parent_id: NonEmptyString,
|
|
1450
1615
|
position: z10.enum(["start", "end"]).optional()
|
|
1451
1616
|
})
|
|
1452
1617
|
})
|
|
1453
1618
|
]);
|
|
1454
1619
|
var PowerPathLessonPlanOperationsInput = z10.object({
|
|
1455
1620
|
operation: PowerPathLessonPlanOperationInput,
|
|
1456
|
-
reason:
|
|
1621
|
+
reason: NonEmptyString.optional()
|
|
1457
1622
|
});
|
|
1458
1623
|
var PowerPathLessonPlanUpdateStudentItemResponseInput = z10.object({
|
|
1459
|
-
studentId:
|
|
1460
|
-
componentResourceId:
|
|
1624
|
+
studentId: NonEmptyString,
|
|
1625
|
+
componentResourceId: NonEmptyString,
|
|
1461
1626
|
result: z10.object({
|
|
1462
1627
|
status: z10.enum(["active", "tobedeleted"]),
|
|
1463
1628
|
metadata: z10.record(z10.string(), z10.unknown()).optional(),
|
|
1464
1629
|
score: z10.number().optional(),
|
|
1465
|
-
textScore:
|
|
1630
|
+
textScore: NonEmptyString.optional(),
|
|
1466
1631
|
scoreDate: z10.string().datetime(),
|
|
1467
1632
|
scorePercentile: z10.number().optional(),
|
|
1468
1633
|
scoreStatus: ScoreStatus,
|
|
1469
|
-
comment:
|
|
1634
|
+
comment: NonEmptyString.optional(),
|
|
1470
1635
|
learningObjectiveSet: z10.array(z10.object({
|
|
1471
|
-
source:
|
|
1636
|
+
source: NonEmptyString,
|
|
1472
1637
|
learningObjectiveResults: z10.array(z10.object({
|
|
1473
|
-
learningObjectiveId:
|
|
1638
|
+
learningObjectiveId: NonEmptyString,
|
|
1474
1639
|
score: z10.number().optional(),
|
|
1475
|
-
textScore:
|
|
1640
|
+
textScore: NonEmptyString.optional()
|
|
1476
1641
|
}))
|
|
1477
1642
|
})).optional(),
|
|
1478
|
-
inProgress:
|
|
1479
|
-
incomplete:
|
|
1480
|
-
late:
|
|
1481
|
-
missing:
|
|
1643
|
+
inProgress: NonEmptyString.optional(),
|
|
1644
|
+
incomplete: NonEmptyString.optional(),
|
|
1645
|
+
late: NonEmptyString.optional(),
|
|
1646
|
+
missing: NonEmptyString.optional()
|
|
1482
1647
|
})
|
|
1483
1648
|
});
|
|
1484
1649
|
var PowerPathMakeExternalTestAssignmentInput = z10.object({
|
|
1485
|
-
student:
|
|
1486
|
-
lesson:
|
|
1487
|
-
applicationName:
|
|
1488
|
-
testId:
|
|
1650
|
+
student: NonEmptyString,
|
|
1651
|
+
lesson: NonEmptyString,
|
|
1652
|
+
applicationName: NonEmptyString.optional(),
|
|
1653
|
+
testId: NonEmptyString.optional(),
|
|
1489
1654
|
skipCourseEnrollment: z10.boolean().optional()
|
|
1490
1655
|
});
|
|
1491
1656
|
var PowerPathPlacementResetUserPlacementInput = z10.object({
|
|
1492
|
-
student:
|
|
1657
|
+
student: NonEmptyString,
|
|
1493
1658
|
subject: TimebackSubject
|
|
1494
1659
|
});
|
|
1495
1660
|
var PowerPathResetAttemptInput = z10.object({
|
|
1496
|
-
student:
|
|
1497
|
-
lesson:
|
|
1661
|
+
student: NonEmptyString,
|
|
1662
|
+
lesson: NonEmptyString
|
|
1498
1663
|
});
|
|
1499
1664
|
var PowerPathScreeningResetSessionInput = z10.object({
|
|
1500
|
-
userId:
|
|
1665
|
+
userId: NonEmptyString
|
|
1501
1666
|
});
|
|
1502
1667
|
var PowerPathScreeningAssignTestInput = z10.object({
|
|
1503
|
-
userId:
|
|
1668
|
+
userId: NonEmptyString,
|
|
1504
1669
|
subject: z10.enum(["Math", "Reading", "Language", "Science"])
|
|
1505
1670
|
});
|
|
1506
1671
|
var PowerPathTestAssignmentsCreateInput = z10.object({
|
|
1507
|
-
student:
|
|
1672
|
+
student: NonEmptyString,
|
|
1508
1673
|
subject: TimebackSubject,
|
|
1509
1674
|
grade: TimebackGrade,
|
|
1510
|
-
testName:
|
|
1675
|
+
testName: NonEmptyString.optional()
|
|
1511
1676
|
});
|
|
1512
1677
|
var PowerPathTestAssignmentsUpdateInput = z10.object({
|
|
1513
|
-
testName:
|
|
1678
|
+
testName: NonEmptyString
|
|
1514
1679
|
});
|
|
1515
1680
|
var PowerPathTestAssignmentItemInput = z10.object({
|
|
1516
|
-
student:
|
|
1681
|
+
student: NonEmptyString,
|
|
1517
1682
|
subject: TimebackSubject,
|
|
1518
1683
|
grade: TimebackGrade,
|
|
1519
|
-
testName:
|
|
1684
|
+
testName: NonEmptyString.optional()
|
|
1520
1685
|
});
|
|
1521
1686
|
var PowerPathTestAssignmentsBulkInput = z10.object({
|
|
1522
1687
|
items: z10.array(PowerPathTestAssignmentItemInput)
|
|
1523
1688
|
});
|
|
1524
1689
|
var PowerPathTestAssignmentsImportInput = z10.object({
|
|
1525
1690
|
spreadsheetUrl: z10.url(),
|
|
1526
|
-
sheet:
|
|
1691
|
+
sheet: NonEmptyString
|
|
1527
1692
|
});
|
|
1528
1693
|
var PowerPathTestAssignmentsListParams = z10.object({
|
|
1529
|
-
student:
|
|
1694
|
+
student: NonEmptyString,
|
|
1530
1695
|
status: z10.enum(["assigned", "in_progress", "completed", "failed", "expired", "cancelled"]).optional(),
|
|
1531
|
-
subject:
|
|
1696
|
+
subject: NonEmptyString.optional(),
|
|
1532
1697
|
grade: TimebackGrade.optional(),
|
|
1533
1698
|
limit: z10.number().int().positive().max(3000).optional(),
|
|
1534
1699
|
offset: z10.number().int().nonnegative().optional()
|
|
1535
1700
|
});
|
|
1536
1701
|
var PowerPathTestAssignmentsAdminParams = z10.object({
|
|
1537
|
-
student:
|
|
1702
|
+
student: NonEmptyString.optional(),
|
|
1538
1703
|
status: z10.enum(["assigned", "in_progress", "completed", "failed", "expired", "cancelled"]).optional(),
|
|
1539
|
-
subject:
|
|
1704
|
+
subject: NonEmptyString.optional(),
|
|
1540
1705
|
grade: TimebackGrade.optional(),
|
|
1541
1706
|
limit: z10.number().int().positive().max(3000).optional(),
|
|
1542
1707
|
offset: z10.number().int().nonnegative().optional()
|
|
1543
1708
|
});
|
|
1544
1709
|
var PowerPathUpdateStudentQuestionResponseInput = z10.object({
|
|
1545
|
-
student:
|
|
1546
|
-
question:
|
|
1547
|
-
response: z10.union([
|
|
1548
|
-
responses: z10.record(z10.string(), z10.union([
|
|
1549
|
-
lesson:
|
|
1710
|
+
student: NonEmptyString,
|
|
1711
|
+
question: NonEmptyString,
|
|
1712
|
+
response: z10.union([NonEmptyString, z10.array(NonEmptyString)]).optional(),
|
|
1713
|
+
responses: z10.record(z10.string(), z10.union([NonEmptyString, z10.array(NonEmptyString)])).optional(),
|
|
1714
|
+
lesson: NonEmptyString,
|
|
1550
1715
|
rendererOutcomes: z10.object({
|
|
1551
1716
|
score: z10.number(),
|
|
1552
1717
|
maxScore: z10.number().min(0),
|
|
@@ -1563,29 +1728,29 @@ var PowerPathUpdateStudentQuestionResponseInput = z10.object({
|
|
|
1563
1728
|
return data;
|
|
1564
1729
|
});
|
|
1565
1730
|
var PowerPathGetAssessmentProgressParams = z10.object({
|
|
1566
|
-
student:
|
|
1567
|
-
lesson:
|
|
1731
|
+
student: NonEmptyString,
|
|
1732
|
+
lesson: NonEmptyString,
|
|
1568
1733
|
attempt: z10.number().int().positive().optional()
|
|
1569
1734
|
});
|
|
1570
1735
|
var PowerPathGetNextQuestionParams = z10.object({
|
|
1571
|
-
student:
|
|
1572
|
-
lesson:
|
|
1736
|
+
student: NonEmptyString,
|
|
1737
|
+
lesson: NonEmptyString
|
|
1573
1738
|
});
|
|
1574
1739
|
var PowerPathGetAttemptsParams = z10.object({
|
|
1575
|
-
student:
|
|
1576
|
-
lesson:
|
|
1740
|
+
student: NonEmptyString,
|
|
1741
|
+
lesson: NonEmptyString
|
|
1577
1742
|
});
|
|
1578
1743
|
var PowerPathTestOutParams = z10.object({
|
|
1579
|
-
student:
|
|
1580
|
-
course:
|
|
1744
|
+
student: NonEmptyString,
|
|
1745
|
+
course: NonEmptyString
|
|
1581
1746
|
});
|
|
1582
1747
|
var PowerPathImportExternalTestAssignmentResultsParams = z10.object({
|
|
1583
|
-
student:
|
|
1584
|
-
lesson:
|
|
1585
|
-
applicationName:
|
|
1748
|
+
student: NonEmptyString,
|
|
1749
|
+
lesson: NonEmptyString,
|
|
1750
|
+
applicationName: NonEmptyString.optional()
|
|
1586
1751
|
});
|
|
1587
1752
|
var PowerPathPlacementQueryParams = z10.object({
|
|
1588
|
-
student:
|
|
1753
|
+
student: NonEmptyString,
|
|
1589
1754
|
subject: TimebackSubject
|
|
1590
1755
|
});
|
|
1591
1756
|
var PowerPathSyllabusQueryParams = z10.object({
|
|
@@ -1636,18 +1801,18 @@ var QtiCorrectResponse = z11.object({
|
|
|
1636
1801
|
value: z11.array(z11.string())
|
|
1637
1802
|
}).strict();
|
|
1638
1803
|
var QtiResponseDeclaration = z11.object({
|
|
1639
|
-
identifier:
|
|
1804
|
+
identifier: NonEmptyString,
|
|
1640
1805
|
cardinality: QtiCardinality,
|
|
1641
1806
|
baseType: QtiBaseType.optional(),
|
|
1642
1807
|
correctResponse: QtiCorrectResponse
|
|
1643
1808
|
}).strict();
|
|
1644
1809
|
var QtiOutcomeDeclaration = z11.object({
|
|
1645
|
-
identifier:
|
|
1810
|
+
identifier: NonEmptyString,
|
|
1646
1811
|
cardinality: QtiCardinality,
|
|
1647
1812
|
baseType: QtiBaseType.optional()
|
|
1648
1813
|
}).strict();
|
|
1649
1814
|
var QtiTestOutcomeDeclaration = z11.object({
|
|
1650
|
-
identifier:
|
|
1815
|
+
identifier: NonEmptyString,
|
|
1651
1816
|
cardinality: QtiCardinality.optional(),
|
|
1652
1817
|
baseType: QtiBaseType,
|
|
1653
1818
|
normalMaximum: z11.number().optional(),
|
|
@@ -1657,19 +1822,19 @@ var QtiTestOutcomeDeclaration = z11.object({
|
|
|
1657
1822
|
}).strict().optional()
|
|
1658
1823
|
}).strict();
|
|
1659
1824
|
var QtiInlineFeedback = z11.object({
|
|
1660
|
-
outcomeIdentifier:
|
|
1661
|
-
variableIdentifier:
|
|
1825
|
+
outcomeIdentifier: NonEmptyString,
|
|
1826
|
+
variableIdentifier: NonEmptyString
|
|
1662
1827
|
}).strict();
|
|
1663
1828
|
var QtiResponseProcessing = z11.object({
|
|
1664
1829
|
templateType: z11.enum(["match_correct", "map_response"]),
|
|
1665
|
-
responseDeclarationIdentifier:
|
|
1666
|
-
outcomeIdentifier:
|
|
1667
|
-
correctResponseIdentifier:
|
|
1668
|
-
incorrectResponseIdentifier:
|
|
1830
|
+
responseDeclarationIdentifier: NonEmptyString,
|
|
1831
|
+
outcomeIdentifier: NonEmptyString,
|
|
1832
|
+
correctResponseIdentifier: NonEmptyString,
|
|
1833
|
+
incorrectResponseIdentifier: NonEmptyString,
|
|
1669
1834
|
inlineFeedback: QtiInlineFeedback.optional()
|
|
1670
1835
|
}).strict();
|
|
1671
1836
|
var QtiLearningObjectiveSet = z11.object({
|
|
1672
|
-
source:
|
|
1837
|
+
source: NonEmptyString,
|
|
1673
1838
|
learningObjectiveIds: z11.array(z11.string())
|
|
1674
1839
|
}).strict();
|
|
1675
1840
|
var QtiItemMetadata = z11.object({
|
|
@@ -1679,32 +1844,32 @@ var QtiItemMetadata = z11.object({
|
|
|
1679
1844
|
learningObjectiveSet: z11.array(QtiLearningObjectiveSet).optional()
|
|
1680
1845
|
}).loose();
|
|
1681
1846
|
var QtiModalFeedback = z11.object({
|
|
1682
|
-
outcomeIdentifier:
|
|
1683
|
-
identifier:
|
|
1847
|
+
outcomeIdentifier: NonEmptyString,
|
|
1848
|
+
identifier: NonEmptyString,
|
|
1684
1849
|
showHide: QtiShowHide,
|
|
1685
1850
|
content: z11.string(),
|
|
1686
1851
|
title: z11.string()
|
|
1687
1852
|
}).strict();
|
|
1688
1853
|
var QtiFeedbackInline = z11.object({
|
|
1689
|
-
outcomeIdentifier:
|
|
1690
|
-
identifier:
|
|
1854
|
+
outcomeIdentifier: NonEmptyString,
|
|
1855
|
+
identifier: NonEmptyString,
|
|
1691
1856
|
showHide: QtiShowHide,
|
|
1692
1857
|
content: z11.string(),
|
|
1693
1858
|
class: z11.array(z11.string())
|
|
1694
1859
|
}).strict();
|
|
1695
1860
|
var QtiFeedbackBlock = z11.object({
|
|
1696
|
-
outcomeIdentifier:
|
|
1697
|
-
identifier:
|
|
1861
|
+
outcomeIdentifier: NonEmptyString,
|
|
1862
|
+
identifier: NonEmptyString,
|
|
1698
1863
|
showHide: QtiShowHide,
|
|
1699
1864
|
content: z11.string(),
|
|
1700
1865
|
class: z11.array(z11.string())
|
|
1701
1866
|
}).strict();
|
|
1702
1867
|
var QtiStylesheet = z11.object({
|
|
1703
|
-
href:
|
|
1704
|
-
type:
|
|
1868
|
+
href: NonEmptyString,
|
|
1869
|
+
type: NonEmptyString
|
|
1705
1870
|
}).strict();
|
|
1706
1871
|
var QtiCatalogInfo = z11.object({
|
|
1707
|
-
id:
|
|
1872
|
+
id: NonEmptyString,
|
|
1708
1873
|
support: z11.string(),
|
|
1709
1874
|
content: z11.string()
|
|
1710
1875
|
}).strict();
|
|
@@ -1716,12 +1881,12 @@ var QtiPaginationParams = z11.object({
|
|
|
1716
1881
|
}).strict();
|
|
1717
1882
|
var QtiAssessmentItemXmlCreateInput = z11.object({
|
|
1718
1883
|
format: z11.string().pipe(z11.literal("xml")),
|
|
1719
|
-
xml:
|
|
1884
|
+
xml: NonEmptyString,
|
|
1720
1885
|
metadata: QtiItemMetadata.optional()
|
|
1721
1886
|
}).strict();
|
|
1722
1887
|
var QtiAssessmentItemJsonCreateInput = z11.object({
|
|
1723
|
-
identifier:
|
|
1724
|
-
title:
|
|
1888
|
+
identifier: NonEmptyString,
|
|
1889
|
+
title: NonEmptyString,
|
|
1725
1890
|
type: QtiAssessmentItemType,
|
|
1726
1891
|
qtiVersion: z11.string().optional(),
|
|
1727
1892
|
timeDependent: z11.boolean().optional(),
|
|
@@ -1739,8 +1904,8 @@ var QtiAssessmentItemCreateInput = z11.union([
|
|
|
1739
1904
|
QtiAssessmentItemJsonCreateInput
|
|
1740
1905
|
]);
|
|
1741
1906
|
var QtiAssessmentItemUpdateInput = z11.object({
|
|
1742
|
-
identifier:
|
|
1743
|
-
title:
|
|
1907
|
+
identifier: NonEmptyString.optional(),
|
|
1908
|
+
title: NonEmptyString,
|
|
1744
1909
|
type: QtiAssessmentItemType,
|
|
1745
1910
|
qtiVersion: z11.string().optional(),
|
|
1746
1911
|
timeDependent: z11.boolean().optional(),
|
|
@@ -1756,17 +1921,17 @@ var QtiAssessmentItemUpdateInput = z11.object({
|
|
|
1756
1921
|
content: z11.record(z11.string(), z11.unknown())
|
|
1757
1922
|
}).strict();
|
|
1758
1923
|
var QtiAssessmentItemProcessResponseInput = z11.object({
|
|
1759
|
-
identifier:
|
|
1924
|
+
identifier: NonEmptyString,
|
|
1760
1925
|
response: z11.union([z11.string(), z11.array(z11.string())])
|
|
1761
1926
|
}).strict();
|
|
1762
1927
|
var QtiAssessmentItemRef = z11.object({
|
|
1763
|
-
identifier:
|
|
1764
|
-
href:
|
|
1928
|
+
identifier: NonEmptyString,
|
|
1929
|
+
href: NonEmptyString,
|
|
1765
1930
|
sequence: z11.number().int().positive().optional()
|
|
1766
1931
|
}).strict();
|
|
1767
1932
|
var QtiAssessmentSection = z11.object({
|
|
1768
|
-
identifier:
|
|
1769
|
-
title:
|
|
1933
|
+
identifier: NonEmptyString,
|
|
1934
|
+
title: NonEmptyString,
|
|
1770
1935
|
visible: z11.boolean(),
|
|
1771
1936
|
required: z11.boolean().optional(),
|
|
1772
1937
|
fixed: z11.boolean().optional(),
|
|
@@ -1774,7 +1939,7 @@ var QtiAssessmentSection = z11.object({
|
|
|
1774
1939
|
"qti-assessment-item-ref": z11.array(QtiAssessmentItemRef).optional()
|
|
1775
1940
|
}).strict();
|
|
1776
1941
|
var QtiTestPart = z11.object({
|
|
1777
|
-
identifier:
|
|
1942
|
+
identifier: NonEmptyString,
|
|
1778
1943
|
navigationMode: z11.string().pipe(QtiNavigationMode),
|
|
1779
1944
|
submissionMode: z11.string().pipe(QtiSubmissionMode),
|
|
1780
1945
|
"qti-assessment-section": z11.array(QtiAssessmentSection)
|
|
@@ -1786,8 +1951,8 @@ var QtiAssessmentTestMetadataUpdateInput = z11.object({
|
|
|
1786
1951
|
metadata: z11.record(z11.string(), z11.unknown()).optional()
|
|
1787
1952
|
}).strict();
|
|
1788
1953
|
var QtiAssessmentTestCreateInput = z11.object({
|
|
1789
|
-
identifier:
|
|
1790
|
-
title:
|
|
1954
|
+
identifier: NonEmptyString,
|
|
1955
|
+
title: NonEmptyString,
|
|
1791
1956
|
qtiVersion: z11.string().optional(),
|
|
1792
1957
|
toolName: z11.string().optional(),
|
|
1793
1958
|
toolVersion: z11.string().optional(),
|
|
@@ -1799,8 +1964,8 @@ var QtiAssessmentTestCreateInput = z11.object({
|
|
|
1799
1964
|
"qti-outcome-declaration": z11.array(QtiTestOutcomeDeclaration).optional()
|
|
1800
1965
|
}).strict();
|
|
1801
1966
|
var QtiAssessmentTestUpdateInput = z11.object({
|
|
1802
|
-
identifier:
|
|
1803
|
-
title:
|
|
1967
|
+
identifier: NonEmptyString.optional(),
|
|
1968
|
+
title: NonEmptyString,
|
|
1804
1969
|
qtiVersion: z11.string().optional(),
|
|
1805
1970
|
toolName: z11.string().optional(),
|
|
1806
1971
|
toolVersion: z11.string().optional(),
|
|
@@ -1812,8 +1977,8 @@ var QtiAssessmentTestUpdateInput = z11.object({
|
|
|
1812
1977
|
"qti-outcome-declaration": z11.array(QtiTestOutcomeDeclaration).optional()
|
|
1813
1978
|
}).strict();
|
|
1814
1979
|
var QtiStimulusCreateInput = z11.object({
|
|
1815
|
-
identifier:
|
|
1816
|
-
title:
|
|
1980
|
+
identifier: NonEmptyString,
|
|
1981
|
+
title: NonEmptyString,
|
|
1817
1982
|
label: z11.string().optional(),
|
|
1818
1983
|
language: z11.string().optional(),
|
|
1819
1984
|
stylesheet: QtiStylesheet.optional(),
|
|
@@ -1824,8 +1989,8 @@ var QtiStimulusCreateInput = z11.object({
|
|
|
1824
1989
|
metadata: z11.record(z11.string(), z11.unknown()).optional()
|
|
1825
1990
|
}).strict();
|
|
1826
1991
|
var QtiStimulusUpdateInput = z11.object({
|
|
1827
|
-
identifier:
|
|
1828
|
-
title:
|
|
1992
|
+
identifier: NonEmptyString.optional(),
|
|
1993
|
+
title: NonEmptyString,
|
|
1829
1994
|
label: z11.string().optional(),
|
|
1830
1995
|
language: z11.string().optional(),
|
|
1831
1996
|
stylesheet: QtiStylesheet.optional(),
|
|
@@ -1847,74 +2012,11 @@ var QtiValidateBatchInput = z11.object({
|
|
|
1847
2012
|
}).strict();
|
|
1848
2013
|
var QtiLessonFeedbackInput = z11.object({
|
|
1849
2014
|
questionId: z11.string().optional(),
|
|
1850
|
-
userId:
|
|
1851
|
-
feedback:
|
|
1852
|
-
lessonId:
|
|
2015
|
+
userId: NonEmptyString,
|
|
2016
|
+
feedback: NonEmptyString,
|
|
2017
|
+
lessonId: NonEmptyString,
|
|
1853
2018
|
humanApproved: z11.boolean().optional()
|
|
1854
2019
|
}).strict();
|
|
1855
|
-
// src/lib/event-factories.ts
|
|
1856
|
-
function createActivityEvent(input) {
|
|
1857
|
-
const eventId = input.id ?? `urn:uuid:${crypto.randomUUID()}`;
|
|
1858
|
-
const metricsId = input.metricsId ?? `urn:uuid:${crypto.randomUUID()}`;
|
|
1859
|
-
return {
|
|
1860
|
-
"@context": CALIPER_DATA_VERSION,
|
|
1861
|
-
id: eventId,
|
|
1862
|
-
type: "ActivityEvent",
|
|
1863
|
-
action: "Completed",
|
|
1864
|
-
actor: input.actor,
|
|
1865
|
-
object: input.object,
|
|
1866
|
-
eventTime: input.eventTime ?? new Date().toISOString(),
|
|
1867
|
-
profile: "TimebackProfile",
|
|
1868
|
-
generated: {
|
|
1869
|
-
id: metricsId,
|
|
1870
|
-
type: "TimebackActivityMetricsCollection",
|
|
1871
|
-
items: input.metrics,
|
|
1872
|
-
...input.attempt === undefined ? {} : { attempt: input.attempt },
|
|
1873
|
-
...input.generatedExtensions ? { extensions: input.generatedExtensions } : {}
|
|
1874
|
-
},
|
|
1875
|
-
extensions: input.extensions,
|
|
1876
|
-
...input.edApp === undefined ? {} : { edApp: input.edApp },
|
|
1877
|
-
...input.session === undefined ? {} : { session: input.session }
|
|
1878
|
-
};
|
|
1879
|
-
}
|
|
1880
|
-
function createTimeSpentEvent(input) {
|
|
1881
|
-
const eventId = input.id ?? `urn:uuid:${crypto.randomUUID()}`;
|
|
1882
|
-
const metricsId = input.metricsId ?? `urn:uuid:${crypto.randomUUID()}`;
|
|
1883
|
-
return {
|
|
1884
|
-
"@context": CALIPER_DATA_VERSION,
|
|
1885
|
-
id: eventId,
|
|
1886
|
-
type: "TimeSpentEvent",
|
|
1887
|
-
action: "SpentTime",
|
|
1888
|
-
actor: input.actor,
|
|
1889
|
-
object: input.object,
|
|
1890
|
-
eventTime: input.eventTime ?? new Date().toISOString(),
|
|
1891
|
-
profile: "TimebackProfile",
|
|
1892
|
-
generated: {
|
|
1893
|
-
id: metricsId,
|
|
1894
|
-
type: "TimebackTimeSpentMetricsCollection",
|
|
1895
|
-
items: input.metrics
|
|
1896
|
-
},
|
|
1897
|
-
extensions: input.extensions,
|
|
1898
|
-
...input.edApp === undefined ? {} : { edApp: input.edApp },
|
|
1899
|
-
...input.session === undefined ? {} : { session: input.session }
|
|
1900
|
-
};
|
|
1901
|
-
}
|
|
1902
|
-
|
|
1903
|
-
// src/lib/pagination.ts
|
|
1904
|
-
class Paginator2 extends Paginator {
|
|
1905
|
-
constructor(transport, path, params = {}) {
|
|
1906
|
-
validateOffsetListParams(params);
|
|
1907
|
-
const { max, ...requestParams } = params;
|
|
1908
|
-
super({
|
|
1909
|
-
fetcher: (p, opts) => transport.requestPaginated(p, opts),
|
|
1910
|
-
path,
|
|
1911
|
-
params: requestParams,
|
|
1912
|
-
max,
|
|
1913
|
-
logger: log
|
|
1914
|
-
});
|
|
1915
|
-
}
|
|
1916
|
-
}
|
|
1917
|
-
|
|
1918
2020
|
// src/resources/events.ts
|
|
1919
2021
|
class EventsResource {
|
|
1920
2022
|
transport;
|
|
@@ -1941,8 +2043,9 @@ class EventsResource {
|
|
|
1941
2043
|
});
|
|
1942
2044
|
const body = this.eventTransformer ? this.eventTransformer.transformEnvelope(envelope) : envelope;
|
|
1943
2045
|
const response = await this.transport.request(this.transport.paths.send, { method: "POST", body });
|
|
1944
|
-
|
|
1945
|
-
|
|
2046
|
+
const jobId = response?.jobId;
|
|
2047
|
+
log.debug("Events sent", { jobId: jobId ?? "(none)" });
|
|
2048
|
+
return { jobId };
|
|
1946
2049
|
}
|
|
1947
2050
|
async validate(envelope) {
|
|
1948
2051
|
const validatePath = this.transport.paths.validate;
|
|
@@ -2055,6 +2158,37 @@ class EventsResource {
|
|
|
2055
2158
|
});
|
|
2056
2159
|
return this.send(sensor, [event]);
|
|
2057
2160
|
}
|
|
2161
|
+
sendQuestionSeen(sensor, input) {
|
|
2162
|
+
validateWithSchema(QuestionSeenInput, input, "question seen event");
|
|
2163
|
+
const event = createQuestionSeenEvent(input);
|
|
2164
|
+
log.debug("Sending AssessmentItemEvent.Started", {
|
|
2165
|
+
eventId: event.id,
|
|
2166
|
+
actor: input.actor,
|
|
2167
|
+
object: input.object.id
|
|
2168
|
+
});
|
|
2169
|
+
return this.send(sensor, [event]);
|
|
2170
|
+
}
|
|
2171
|
+
sendQuestionAnswered(sensor, input) {
|
|
2172
|
+
validateWithSchema(QuestionAnsweredInput, input, "question answered event");
|
|
2173
|
+
const event = createQuestionAnsweredEvent(input);
|
|
2174
|
+
log.debug("Sending AssessmentItemEvent.Completed", {
|
|
2175
|
+
eventId: event.id,
|
|
2176
|
+
actor: input.actor,
|
|
2177
|
+
object: input.object.id
|
|
2178
|
+
});
|
|
2179
|
+
return this.send(sensor, [event]);
|
|
2180
|
+
}
|
|
2181
|
+
sendQuestionGraded(sensor, input) {
|
|
2182
|
+
validateWithSchema(QuestionGradedInput, input, "question graded event");
|
|
2183
|
+
const event = createQuestionGradedEvent(input);
|
|
2184
|
+
log.debug("Sending GradeEvent.Graded", {
|
|
2185
|
+
eventId: event.id,
|
|
2186
|
+
actor: input.actor,
|
|
2187
|
+
object: input.object,
|
|
2188
|
+
scoreGiven: input.generated.scoreGiven
|
|
2189
|
+
});
|
|
2190
|
+
return this.send(sensor, [event]);
|
|
2191
|
+
}
|
|
2058
2192
|
}
|
|
2059
2193
|
// src/resources/jobs.ts
|
|
2060
2194
|
class JobsResource {
|
|
@@ -2170,9 +2304,13 @@ function createCaliperClient(registry = DEFAULT_PROVIDER_REGISTRY) {
|
|
|
2170
2304
|
var CaliperClient = createCaliperClient();
|
|
2171
2305
|
export {
|
|
2172
2306
|
createTimeSpentEvent,
|
|
2307
|
+
createQuestionSeenEvent,
|
|
2308
|
+
createQuestionGradedEvent,
|
|
2309
|
+
createQuestionAnsweredEvent,
|
|
2173
2310
|
createCaliperClient,
|
|
2174
2311
|
createActivityEvent,
|
|
2175
2312
|
Transport,
|
|
2313
|
+
QUESTION_RESULT_SCORE_TYPE,
|
|
2176
2314
|
CaliperClient,
|
|
2177
2315
|
CALIPER_DATA_VERSION
|
|
2178
2316
|
};
|