@timeback/powerpath 0.2.1 → 0.2.2-beta.20260331190459
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-5a9p0re1.js → chunk-setst1c6.js} +56 -56
- package/dist/errors.d.ts +144 -1
- package/dist/errors.js +1 -1
- package/dist/index.d.ts +1349 -1004
- package/dist/index.js +216 -78
- package/dist/public-types.d.ts +2 -1184
- package/dist/public-types.js +1 -0
- package/package.json +2 -2
- package/dist/errors.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/public-types.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
resolveToProvider,
|
|
9
9
|
validateNonEmptyString,
|
|
10
10
|
validateWithSchema
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-setst1c6.js";
|
|
12
12
|
import"./chunk-6jf1natv.js";
|
|
13
13
|
|
|
14
14
|
// src/constants.ts
|
|
@@ -45,8 +45,19 @@ class Transport extends BaseTransport {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
// ../../types/
|
|
48
|
+
// ../../types/dist/zod/index.js
|
|
49
49
|
import { z } from "zod/v4";
|
|
50
|
+
import { z as z2 } from "zod/v4";
|
|
51
|
+
import { z as z3 } from "zod/v4";
|
|
52
|
+
import { z as z4 } from "zod/v4";
|
|
53
|
+
import { z as z5 } from "zod/v4";
|
|
54
|
+
import { z as z6 } from "zod/v4";
|
|
55
|
+
import { z as z7 } from "zod/v4";
|
|
56
|
+
import { z as z8 } from "zod/v4";
|
|
57
|
+
import { z as z9 } from "zod/v4";
|
|
58
|
+
import { z as z10 } from "zod/v4";
|
|
59
|
+
import { z as z11 } from "zod/v4";
|
|
60
|
+
import { z as z12 } from "zod/v4";
|
|
50
61
|
var IsoDateTimeRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/;
|
|
51
62
|
var IsoDateTimeString = z.string().min(1).regex(IsoDateTimeRegex, "must be a valid ISO 8601 datetime");
|
|
52
63
|
var IsoDateString = z.string().min(1).regex(/^\d{4}-\d{2}-\d{2}$/, "must be a valid ISO 8601 date (YYYY-MM-DD)");
|
|
@@ -63,7 +74,7 @@ var TimebackSubject = z.enum([
|
|
|
63
74
|
"None",
|
|
64
75
|
"Other"
|
|
65
76
|
]).meta({ id: "TimebackSubject", description: "Subject area" });
|
|
66
|
-
var
|
|
77
|
+
var NumericTimebackGrade = z.union([
|
|
67
78
|
z.literal(-1),
|
|
68
79
|
z.literal(0),
|
|
69
80
|
z.literal(1),
|
|
@@ -79,7 +90,39 @@ var TimebackGrade = z.union([
|
|
|
79
90
|
z.literal(11),
|
|
80
91
|
z.literal(12),
|
|
81
92
|
z.literal(13)
|
|
82
|
-
])
|
|
93
|
+
]);
|
|
94
|
+
var StringTimebackGrade = z.string().transform((value, ctx) => {
|
|
95
|
+
const raw = value.toLowerCase().trim().replaceAll("_", " ");
|
|
96
|
+
if (raw === "") {
|
|
97
|
+
ctx.addIssue({
|
|
98
|
+
code: "custom",
|
|
99
|
+
message: "must be a valid Timeback grade"
|
|
100
|
+
});
|
|
101
|
+
return z.NEVER;
|
|
102
|
+
}
|
|
103
|
+
const stripped = raw.replace(/\bgrade\b/g, "").replace(/(\d+)(st|nd|rd|th)\b/g, "$1").trim();
|
|
104
|
+
if (stripped === "pre-k" || stripped === "pk") {
|
|
105
|
+
return -1;
|
|
106
|
+
}
|
|
107
|
+
if (stripped === "k") {
|
|
108
|
+
return 0;
|
|
109
|
+
}
|
|
110
|
+
if (stripped === "middle school") {
|
|
111
|
+
return 7;
|
|
112
|
+
}
|
|
113
|
+
const normalized = stripped.replace(/\s+/g, "");
|
|
114
|
+
const withoutLeadingZeros = normalized.replace(/^0+/, "") || "0";
|
|
115
|
+
const parsed = Number(withoutLeadingZeros);
|
|
116
|
+
if (!Number.isInteger(parsed)) {
|
|
117
|
+
ctx.addIssue({
|
|
118
|
+
code: "custom",
|
|
119
|
+
message: "must be a valid Timeback grade"
|
|
120
|
+
});
|
|
121
|
+
return z.NEVER;
|
|
122
|
+
}
|
|
123
|
+
return parsed;
|
|
124
|
+
});
|
|
125
|
+
var TimebackGrade = z.union([z.number(), StringTimebackGrade]).pipe(NumericTimebackGrade).meta({
|
|
83
126
|
id: "TimebackGrade",
|
|
84
127
|
description: "Grade level (-1 = Pre-K, 0 = K, 1-12 = grades, 13 = AP)"
|
|
85
128
|
});
|
|
@@ -162,8 +205,6 @@ var IMSErrorResponse = z.object({
|
|
|
162
205
|
}))
|
|
163
206
|
}).optional()
|
|
164
207
|
});
|
|
165
|
-
// ../../types/src/zod/caliper.ts
|
|
166
|
-
import { z as z2 } from "zod/v4";
|
|
167
208
|
var CaliperIri = z2.union([z2.url(), z2.string().regex(/^urn:/, "Must be a URL or URN")]);
|
|
168
209
|
var TimebackUser = z2.object({
|
|
169
210
|
id: z2.url(),
|
|
@@ -368,8 +409,6 @@ var QuestionGradedInput = z2.object({
|
|
|
368
409
|
session: CaliperEntity.optional(),
|
|
369
410
|
extensions: z2.record(z2.string(), z2.unknown()).optional()
|
|
370
411
|
}).strict();
|
|
371
|
-
// ../../types/src/zod/webhooks.ts
|
|
372
|
-
import { z as z3 } from "zod/v4";
|
|
373
412
|
var WebhookCreateInput = z3.object({
|
|
374
413
|
name: NonEmptyString,
|
|
375
414
|
targetUrl: z3.url("targetUrl must be a valid URL"),
|
|
@@ -402,8 +441,6 @@ var WebhookFilterCreateInput = z3.object({
|
|
|
402
441
|
filterOperator: WebhookFilterOperation,
|
|
403
442
|
active: z3.boolean()
|
|
404
443
|
}).strict();
|
|
405
|
-
// ../../types/src/zod/case.ts
|
|
406
|
-
import { z as z4 } from "zod/v4";
|
|
407
444
|
var UuidString = z4.string().uuid();
|
|
408
445
|
var InputNodeURISchema = z4.object({
|
|
409
446
|
title: NonEmptyString,
|
|
@@ -477,8 +514,6 @@ var CasePackageInput = z4.object({
|
|
|
477
514
|
CFDefinitions: CFDefinitionsSchema.optional(),
|
|
478
515
|
extensions: z4.unknown().optional()
|
|
479
516
|
});
|
|
480
|
-
// ../../types/src/zod/clr.ts
|
|
481
|
-
import { z as z5 } from "zod/v4";
|
|
482
517
|
var W3C_CREDENTIALS_CONTEXT = "https://www.w3.org/ns/credentials/v2";
|
|
483
518
|
var ClrContextArray = z5.array(z5.url()).min(3, "@context must include W3C, CLR, and OB context URLs").refine((arr) => arr[0] === W3C_CREDENTIALS_CONTEXT, `First @context entry must be "${W3C_CREDENTIALS_CONTEXT}"`);
|
|
484
519
|
var ClrImageSchema = z5.object({
|
|
@@ -578,8 +613,6 @@ var ClrCredentialInput = z5.object({
|
|
|
578
613
|
proof: z5.array(ClrProofSchema).optional(),
|
|
579
614
|
credentialSchema: z5.array(ClrCredentialSchemaSchema).optional()
|
|
580
615
|
});
|
|
581
|
-
// ../../types/src/zod/config.ts
|
|
582
|
-
import { z as z6 } from "zod/v4";
|
|
583
616
|
var CourseIds = z6.object({
|
|
584
617
|
staging: z6.string().meta({ description: "Course ID in staging environment" }).optional(),
|
|
585
618
|
production: z6.string().meta({ description: "Course ID in production environment" }).optional()
|
|
@@ -700,10 +733,7 @@ var TimebackConfig = z6.object({
|
|
|
700
733
|
message: "Each course must have an effective sensor. Either set `sensor` explicitly (top-level or per-course), or provide a `launchUrl` so sensor can be derived from its origin.",
|
|
701
734
|
path: ["courses"]
|
|
702
735
|
});
|
|
703
|
-
// ../../types/src/zod/edubridge.ts
|
|
704
|
-
import { z as z7 } from "zod/v4";
|
|
705
736
|
var EdubridgeDateString = z7.union([IsoDateTimeString, IsoDateString]);
|
|
706
|
-
var EdubridgeDateStringInput = EdubridgeDateString.transform((date) => date.includes("T") ? date : `${date}T00:00:00.000Z`);
|
|
707
737
|
var EduBridgeEnrollment = z7.object({
|
|
708
738
|
id: z7.string(),
|
|
709
739
|
role: z7.string(),
|
|
@@ -793,22 +823,20 @@ var EdubridgeUsersListParams = z7.object({
|
|
|
793
823
|
orgSourcedIds: z7.array(NonEmptyString).optional()
|
|
794
824
|
});
|
|
795
825
|
var EdubridgeActivityParams = EmailOrStudentId.extend({
|
|
796
|
-
startDate:
|
|
797
|
-
endDate:
|
|
826
|
+
startDate: EdubridgeDateString,
|
|
827
|
+
endDate: EdubridgeDateString,
|
|
798
828
|
timezone: z7.string().optional()
|
|
799
829
|
});
|
|
800
830
|
var EdubridgeWeeklyFactsParams = EmailOrStudentId.extend({
|
|
801
|
-
weekDate:
|
|
831
|
+
weekDate: EdubridgeDateString,
|
|
802
832
|
timezone: z7.string().optional()
|
|
803
833
|
});
|
|
804
834
|
var EdubridgeEnrollmentFactsParams = z7.object({
|
|
805
835
|
enrollmentId: NonEmptyString,
|
|
806
|
-
startDate:
|
|
807
|
-
endDate:
|
|
836
|
+
startDate: EdubridgeDateString.optional(),
|
|
837
|
+
endDate: EdubridgeDateString.optional(),
|
|
808
838
|
timezone: z7.string().optional()
|
|
809
839
|
});
|
|
810
|
-
// ../../types/src/zod/masterytrack.ts
|
|
811
|
-
import { z as z8 } from "zod/v4";
|
|
812
840
|
var MasteryTrackAuthorizerInput = z8.object({
|
|
813
841
|
email: z8.email()
|
|
814
842
|
});
|
|
@@ -884,8 +912,6 @@ var MasteryTrackInvalidateAssignmentInput = z8.object({
|
|
|
884
912
|
});
|
|
885
913
|
}
|
|
886
914
|
});
|
|
887
|
-
// ../../types/src/zod/oneroster.ts
|
|
888
|
-
import { z as z9 } from "zod/v4";
|
|
889
915
|
var Status = z9.enum(["active", "tobedeleted"]);
|
|
890
916
|
var Metadata = z9.record(z9.string(), z9.unknown()).nullable().optional();
|
|
891
917
|
var Ref = z9.object({
|
|
@@ -893,7 +919,42 @@ var Ref = z9.object({
|
|
|
893
919
|
type: z9.string().optional(),
|
|
894
920
|
href: z9.string().optional()
|
|
895
921
|
}).strict();
|
|
922
|
+
var GuidRefType = z9.enum([
|
|
923
|
+
"academicSession",
|
|
924
|
+
"assessmentLineItem",
|
|
925
|
+
"category",
|
|
926
|
+
"class",
|
|
927
|
+
"course",
|
|
928
|
+
"demographics",
|
|
929
|
+
"enrollment",
|
|
930
|
+
"gradingPeriod",
|
|
931
|
+
"lineItem",
|
|
932
|
+
"org",
|
|
933
|
+
"resource",
|
|
934
|
+
"result",
|
|
935
|
+
"scoreScale",
|
|
936
|
+
"student",
|
|
937
|
+
"teacher",
|
|
938
|
+
"term",
|
|
939
|
+
"user",
|
|
940
|
+
"componentResource",
|
|
941
|
+
"courseComponent"
|
|
942
|
+
]);
|
|
943
|
+
var GuidRef = z9.object({
|
|
944
|
+
sourcedId: NonEmptyString,
|
|
945
|
+
type: GuidRefType,
|
|
946
|
+
href: z9.url()
|
|
947
|
+
}).strict();
|
|
896
948
|
var OneRosterDateString = z9.union([IsoDateString, IsoDateTimeString]).transform((date) => date.includes("T") ? date : `${date}T00:00:00Z`);
|
|
949
|
+
var LearningObjectiveResult = z9.object({
|
|
950
|
+
learningObjectiveId: z9.string(),
|
|
951
|
+
score: z9.number().optional(),
|
|
952
|
+
textScore: z9.string().optional()
|
|
953
|
+
});
|
|
954
|
+
var LearningObjectiveScoreSetSchema = z9.array(z9.object({
|
|
955
|
+
source: z9.string(),
|
|
956
|
+
learningObjectiveResults: z9.array(LearningObjectiveResult)
|
|
957
|
+
}));
|
|
897
958
|
var OneRosterUserRoleInput = z9.object({
|
|
898
959
|
roleType: z9.enum(["primary", "secondary"]),
|
|
899
960
|
role: OneRosterUserRole,
|
|
@@ -906,35 +967,46 @@ var OneRosterUserRoleInput = z9.object({
|
|
|
906
967
|
var OneRosterUserCreateInput = z9.object({
|
|
907
968
|
sourcedId: NonEmptyString.describe("sourcedId must be a non-empty string"),
|
|
908
969
|
status: Status.optional(),
|
|
909
|
-
enabledUser: z9.
|
|
970
|
+
enabledUser: z9.union([
|
|
971
|
+
z9.boolean(),
|
|
972
|
+
z9.enum(["true", "false"]).transform((value) => value === "true")
|
|
973
|
+
]),
|
|
910
974
|
givenName: NonEmptyString.describe("givenName must be a non-empty string"),
|
|
911
975
|
familyName: NonEmptyString.describe("familyName must be a non-empty string"),
|
|
912
|
-
middleName: NonEmptyString.optional(),
|
|
913
|
-
|
|
976
|
+
middleName: NonEmptyString.nullable().optional(),
|
|
977
|
+
preferredFirstName: NonEmptyString.nullable().optional(),
|
|
978
|
+
preferredMiddleName: NonEmptyString.nullable().optional(),
|
|
979
|
+
preferredLastName: NonEmptyString.nullable().optional(),
|
|
980
|
+
username: NonEmptyString.nullable().optional(),
|
|
914
981
|
email: z9.email(),
|
|
982
|
+
userMasterIdentifier: z9.string().nullable().optional(),
|
|
915
983
|
roles: z9.array(OneRosterUserRoleInput).min(1, "roles must include at least one role"),
|
|
916
984
|
userIds: z9.array(z9.object({
|
|
917
985
|
type: NonEmptyString,
|
|
918
986
|
identifier: NonEmptyString
|
|
919
987
|
}).strict()).optional(),
|
|
920
988
|
agents: z9.array(Ref).optional(),
|
|
989
|
+
primaryOrg: Ref.optional(),
|
|
921
990
|
grades: z9.array(TimebackGrade).optional(),
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
password: NonEmptyString.optional(),
|
|
991
|
+
sms: NonEmptyString.nullable().optional(),
|
|
992
|
+
phone: NonEmptyString.nullable().optional(),
|
|
993
|
+
pronouns: NonEmptyString.nullable().optional(),
|
|
994
|
+
password: NonEmptyString.nullable().optional(),
|
|
927
995
|
metadata: Metadata
|
|
928
996
|
}).strict();
|
|
929
997
|
var OneRosterCourseCreateInput = z9.object({
|
|
930
998
|
sourcedId: NonEmptyString.describe("sourcedId must be a non-empty string").optional(),
|
|
931
|
-
status: Status
|
|
999
|
+
status: Status,
|
|
932
1000
|
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
933
1001
|
org: Ref,
|
|
934
|
-
courseCode: NonEmptyString.optional(),
|
|
935
|
-
subjects: z9.array(TimebackSubject).optional(),
|
|
936
|
-
|
|
937
|
-
|
|
1002
|
+
courseCode: NonEmptyString.nullable().optional(),
|
|
1003
|
+
subjects: z9.array(TimebackSubject).nullable().optional(),
|
|
1004
|
+
subjectCodes: z9.array(z9.string()).nullable().optional(),
|
|
1005
|
+
grades: z9.array(TimebackGrade).nullable().optional(),
|
|
1006
|
+
level: NonEmptyString.nullable().optional(),
|
|
1007
|
+
academicSession: Ref.nullable().optional(),
|
|
1008
|
+
schoolYear: GuidRef.nullable().optional(),
|
|
1009
|
+
gradingScheme: NonEmptyString.nullable().optional(),
|
|
938
1010
|
metadata: Metadata
|
|
939
1011
|
}).strict();
|
|
940
1012
|
var OneRosterClassCreateInput = z9.object({
|
|
@@ -944,9 +1016,9 @@ var OneRosterClassCreateInput = z9.object({
|
|
|
944
1016
|
terms: z9.array(Ref).min(1, "terms must have at least one item"),
|
|
945
1017
|
course: Ref,
|
|
946
1018
|
org: Ref,
|
|
947
|
-
classCode: NonEmptyString.optional(),
|
|
1019
|
+
classCode: NonEmptyString.nullable().optional(),
|
|
948
1020
|
classType: z9.enum(["homeroom", "scheduled"]).optional(),
|
|
949
|
-
location: NonEmptyString.optional(),
|
|
1021
|
+
location: NonEmptyString.nullable().optional(),
|
|
950
1022
|
grades: z9.array(TimebackGrade).optional(),
|
|
951
1023
|
subjects: z9.array(TimebackSubject).optional(),
|
|
952
1024
|
subjectCodes: z9.array(NonEmptyString).optional(),
|
|
@@ -981,18 +1053,21 @@ var OneRosterLineItemCreateInput = z9.object({
|
|
|
981
1053
|
category: Ref,
|
|
982
1054
|
assignDate: OneRosterDateString,
|
|
983
1055
|
dueDate: OneRosterDateString,
|
|
984
|
-
status: Status,
|
|
985
|
-
description: z9.string().optional(),
|
|
1056
|
+
status: Status.optional(),
|
|
1057
|
+
description: z9.string().nullable().optional(),
|
|
986
1058
|
resultValueMin: z9.number().nullable().optional(),
|
|
987
1059
|
resultValueMax: z9.number().nullable().optional(),
|
|
988
|
-
|
|
1060
|
+
gradingPeriod: Ref.nullable().optional(),
|
|
1061
|
+
academicSession: Ref.nullable().optional(),
|
|
1062
|
+
scoreScale: Ref.nullable().optional(),
|
|
1063
|
+
learningObjectiveSet: LearningObjectiveSetSchema.nullable().optional(),
|
|
989
1064
|
metadata: Metadata
|
|
990
1065
|
}).strict();
|
|
991
1066
|
var OneRosterResultCreateInput = z9.object({
|
|
992
1067
|
sourcedId: NonEmptyString.optional(),
|
|
993
1068
|
lineItem: Ref,
|
|
994
1069
|
student: Ref,
|
|
995
|
-
class: Ref.optional(),
|
|
1070
|
+
class: Ref.nullable().optional(),
|
|
996
1071
|
scoreDate: OneRosterDateString,
|
|
997
1072
|
scoreStatus: z9.enum([
|
|
998
1073
|
"exempt",
|
|
@@ -1004,14 +1079,20 @@ var OneRosterResultCreateInput = z9.object({
|
|
|
1004
1079
|
score: z9.number().nullable().optional(),
|
|
1005
1080
|
textScore: z9.string().nullable().optional(),
|
|
1006
1081
|
status: Status,
|
|
1082
|
+
scoreScale: Ref.nullable().optional(),
|
|
1007
1083
|
comment: z9.string().nullable().optional(),
|
|
1084
|
+
learningObjectiveSet: LearningObjectiveScoreSetSchema.nullable().optional(),
|
|
1085
|
+
inProgress: z9.string().optional(),
|
|
1086
|
+
incomplete: z9.string().optional(),
|
|
1087
|
+
late: z9.string().optional(),
|
|
1088
|
+
missing: z9.string().optional(),
|
|
1008
1089
|
metadata: Metadata
|
|
1009
1090
|
}).strict();
|
|
1010
1091
|
var OneRosterScoreScaleCreateInput = z9.object({
|
|
1011
1092
|
sourcedId: NonEmptyString.optional(),
|
|
1012
1093
|
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
1013
|
-
status: Status
|
|
1014
|
-
type:
|
|
1094
|
+
status: Status,
|
|
1095
|
+
type: NonEmptyString,
|
|
1015
1096
|
class: Ref,
|
|
1016
1097
|
course: Ref.nullable().optional(),
|
|
1017
1098
|
scoreScaleValue: z9.array(z9.object({
|
|
@@ -1020,13 +1101,11 @@ var OneRosterScoreScaleCreateInput = z9.object({
|
|
|
1020
1101
|
value: z9.string().optional(),
|
|
1021
1102
|
description: z9.string().optional()
|
|
1022
1103
|
}).strict()),
|
|
1023
|
-
minScore: z9.number().optional(),
|
|
1024
|
-
maxScore: z9.number().optional(),
|
|
1025
1104
|
metadata: Metadata
|
|
1026
1105
|
}).strict();
|
|
1027
1106
|
var OneRosterAssessmentLineItemCreateInput = z9.object({
|
|
1028
1107
|
sourcedId: NonEmptyString.optional(),
|
|
1029
|
-
status: Status
|
|
1108
|
+
status: Status,
|
|
1030
1109
|
dateLastModified: IsoDateTimeString.optional(),
|
|
1031
1110
|
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
1032
1111
|
description: z9.string().nullable().optional(),
|
|
@@ -1044,18 +1123,9 @@ var OneRosterAssessmentLineItemCreateInput = z9.object({
|
|
|
1044
1123
|
course: Ref.nullable().optional(),
|
|
1045
1124
|
metadata: Metadata
|
|
1046
1125
|
}).strict();
|
|
1047
|
-
var LearningObjectiveResult = z9.object({
|
|
1048
|
-
learningObjectiveId: z9.string(),
|
|
1049
|
-
score: z9.number().optional(),
|
|
1050
|
-
textScore: z9.string().optional()
|
|
1051
|
-
});
|
|
1052
|
-
var LearningObjectiveScoreSetSchema = z9.array(z9.object({
|
|
1053
|
-
source: z9.string(),
|
|
1054
|
-
learningObjectiveResults: z9.array(LearningObjectiveResult)
|
|
1055
|
-
}));
|
|
1056
1126
|
var OneRosterAssessmentResultCreateInput = z9.object({
|
|
1057
1127
|
sourcedId: NonEmptyString.optional(),
|
|
1058
|
-
status: Status
|
|
1128
|
+
status: Status,
|
|
1059
1129
|
dateLastModified: IsoDateTimeString.optional(),
|
|
1060
1130
|
metadata: Metadata,
|
|
1061
1131
|
assessmentLineItem: Ref,
|
|
@@ -1084,7 +1154,7 @@ var OneRosterOrgCreateInput = z9.object({
|
|
|
1084
1154
|
status: Status.optional(),
|
|
1085
1155
|
name: NonEmptyString.describe("name must be a non-empty string"),
|
|
1086
1156
|
type: OrganizationType,
|
|
1087
|
-
identifier:
|
|
1157
|
+
identifier: z9.string().nullish(),
|
|
1088
1158
|
parent: Ref.optional(),
|
|
1089
1159
|
metadata: Metadata
|
|
1090
1160
|
}).strict();
|
|
@@ -1092,8 +1162,8 @@ var OneRosterSchoolCreateInput = z9.object({
|
|
|
1092
1162
|
sourcedId: NonEmptyString.optional(),
|
|
1093
1163
|
status: Status.optional(),
|
|
1094
1164
|
name: NonEmptyString.describe("name must be a non-empty string"),
|
|
1095
|
-
type: z9.literal("school").
|
|
1096
|
-
identifier:
|
|
1165
|
+
type: z9.literal("school").default("school"),
|
|
1166
|
+
identifier: z9.string().nullish(),
|
|
1097
1167
|
parent: Ref.optional(),
|
|
1098
1168
|
metadata: Metadata
|
|
1099
1169
|
}).strict();
|
|
@@ -1111,11 +1181,13 @@ var OneRosterAcademicSessionCreateInput = z9.object({
|
|
|
1111
1181
|
metadata: Metadata
|
|
1112
1182
|
}).strict();
|
|
1113
1183
|
var OneRosterComponentResourceCreateInput = z9.object({
|
|
1114
|
-
sourcedId: NonEmptyString
|
|
1184
|
+
sourcedId: NonEmptyString,
|
|
1115
1185
|
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
1116
1186
|
courseComponent: Ref,
|
|
1117
1187
|
resource: Ref,
|
|
1118
1188
|
status: Status,
|
|
1189
|
+
sortOrder: z9.number().optional(),
|
|
1190
|
+
lessonType: LessonType.optional(),
|
|
1119
1191
|
metadata: Metadata
|
|
1120
1192
|
}).strict();
|
|
1121
1193
|
var OneRosterCourseComponentCreateInput = z9.object({
|
|
@@ -1123,8 +1195,17 @@ var OneRosterCourseComponentCreateInput = z9.object({
|
|
|
1123
1195
|
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
1124
1196
|
course: Ref,
|
|
1125
1197
|
status: Status,
|
|
1198
|
+
sortOrder: z9.number().optional(),
|
|
1199
|
+
parent: Ref.nullable().optional(),
|
|
1200
|
+
courseComponent: Ref.nullable().optional(),
|
|
1201
|
+
prerequisites: z9.array(z9.string()).nullable().optional(),
|
|
1202
|
+
prerequisiteCriteria: z9.string().nullable().optional(),
|
|
1203
|
+
unlockDate: OneRosterDateString.nullable().optional(),
|
|
1126
1204
|
metadata: Metadata
|
|
1127
|
-
}).strict()
|
|
1205
|
+
}).strict().transform(({ courseComponent, parent, ...rest }) => ({
|
|
1206
|
+
...rest,
|
|
1207
|
+
parent: parent === undefined ? courseComponent ?? undefined : parent
|
|
1208
|
+
}));
|
|
1128
1209
|
var OneRosterEnrollInput = z9.object({
|
|
1129
1210
|
sourcedId: NonEmptyString.describe("sourcedId must be a non-empty string"),
|
|
1130
1211
|
role: z9.enum(["student", "teacher"]),
|
|
@@ -1144,8 +1225,23 @@ var OneRosterCredentialInput = z9.object({
|
|
|
1144
1225
|
})
|
|
1145
1226
|
}).strict();
|
|
1146
1227
|
var OneRosterDemographicsCreateInput = z9.object({
|
|
1147
|
-
sourcedId: NonEmptyString.describe("sourcedId must be a non-empty string")
|
|
1148
|
-
|
|
1228
|
+
sourcedId: NonEmptyString.describe("sourcedId must be a non-empty string"),
|
|
1229
|
+
status: Status.optional(),
|
|
1230
|
+
metadata: Metadata,
|
|
1231
|
+
birthDate: z9.string().regex(/^\d{4}-\d{2}-\d{2}$/).nullable().optional(),
|
|
1232
|
+
sex: z9.enum(["male", "female"]).nullable().optional(),
|
|
1233
|
+
americanIndianOrAlaskaNative: StringBoolean.nullable().optional(),
|
|
1234
|
+
asian: StringBoolean.nullable().optional(),
|
|
1235
|
+
blackOrAfricanAmerican: StringBoolean.nullable().optional(),
|
|
1236
|
+
nativeHawaiianOrOtherPacificIslander: StringBoolean.nullable().optional(),
|
|
1237
|
+
white: StringBoolean.nullable().optional(),
|
|
1238
|
+
demographicRaceTwoOrMoreRaces: StringBoolean.nullable().optional(),
|
|
1239
|
+
hispanicOrLatinoEthnicity: StringBoolean.nullable().optional(),
|
|
1240
|
+
countryOfBirthCode: z9.string().nullable().optional(),
|
|
1241
|
+
stateOfBirthAbbreviation: z9.string().nullable().optional(),
|
|
1242
|
+
cityOfBirth: z9.string().nullable().optional(),
|
|
1243
|
+
publicSchoolResidenceStatus: z9.string().nullable().optional()
|
|
1244
|
+
}).strict();
|
|
1149
1245
|
var CommonResourceMetadataSchema = z9.object({
|
|
1150
1246
|
type: ResourceType,
|
|
1151
1247
|
subject: TimebackSubject.nullish(),
|
|
@@ -1215,16 +1311,63 @@ var ResourceMetadataSchema = z9.discriminatedUnion("type", [
|
|
|
1215
1311
|
CourseMaterialMetadataSchema,
|
|
1216
1312
|
AssessmentBankMetadataSchema
|
|
1217
1313
|
]);
|
|
1314
|
+
var ReservedResourceMetadataKeys = new Set([
|
|
1315
|
+
"type",
|
|
1316
|
+
"subject",
|
|
1317
|
+
"grades",
|
|
1318
|
+
"language",
|
|
1319
|
+
"xp",
|
|
1320
|
+
"url",
|
|
1321
|
+
"keywords",
|
|
1322
|
+
"learningObjectiveSet",
|
|
1323
|
+
"lessonType",
|
|
1324
|
+
"subType",
|
|
1325
|
+
"questionType",
|
|
1326
|
+
"difficulty",
|
|
1327
|
+
"format",
|
|
1328
|
+
"author",
|
|
1329
|
+
"pageCount",
|
|
1330
|
+
"duration",
|
|
1331
|
+
"speaker",
|
|
1332
|
+
"captionsAvailable",
|
|
1333
|
+
"launchUrl",
|
|
1334
|
+
"toolProvider",
|
|
1335
|
+
"instructionalMethod",
|
|
1336
|
+
"courseIdOnFail",
|
|
1337
|
+
"resolution",
|
|
1338
|
+
"resources"
|
|
1339
|
+
]);
|
|
1340
|
+
var UntypedResourceMetadataSchema = z9.record(z9.string(), z9.unknown()).superRefine((metadata, ctx) => {
|
|
1341
|
+
if ("fail_fast" in metadata) {
|
|
1342
|
+
const result = FastFailConfigSchema.safeParse(metadata.fail_fast);
|
|
1343
|
+
if (!result.success) {
|
|
1344
|
+
for (const issue of result.error.issues) {
|
|
1345
|
+
ctx.addIssue({
|
|
1346
|
+
...issue,
|
|
1347
|
+
path: ["fail_fast", ...issue.path]
|
|
1348
|
+
});
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
const reservedKeys = Object.keys(metadata).filter((key) => ReservedResourceMetadataKeys.has(key));
|
|
1353
|
+
if (reservedKeys.length === 0) {
|
|
1354
|
+
return;
|
|
1355
|
+
}
|
|
1356
|
+
ctx.addIssue({
|
|
1357
|
+
code: "custom",
|
|
1358
|
+
message: `metadata keys ${reservedKeys.map((key) => `\`${key}\``).join(", ")} require a valid \`type\` discriminator`
|
|
1359
|
+
});
|
|
1360
|
+
});
|
|
1218
1361
|
var OneRosterResourceCreateInput = z9.object({
|
|
1219
1362
|
sourcedId: NonEmptyString.optional(),
|
|
1220
1363
|
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
1221
1364
|
vendorResourceId: NonEmptyString.describe("vendorResourceId must be a non-empty string"),
|
|
1222
1365
|
roles: z9.array(z9.enum(["primary", "secondary"])).optional(),
|
|
1223
1366
|
importance: z9.enum(["primary", "secondary"]).optional(),
|
|
1224
|
-
vendorId:
|
|
1225
|
-
applicationId:
|
|
1367
|
+
vendorId: NonEmptyString.nullable().optional(),
|
|
1368
|
+
applicationId: NonEmptyString.nullable().optional(),
|
|
1226
1369
|
status: Status.optional(),
|
|
1227
|
-
metadata: ResourceMetadataSchema.nullable().optional()
|
|
1370
|
+
metadata: z9.union([ResourceMetadataSchema, UntypedResourceMetadataSchema]).nullable().optional()
|
|
1228
1371
|
}).strict();
|
|
1229
1372
|
var CourseStructureItem = z9.object({
|
|
1230
1373
|
url: NonEmptyString.describe("courseStructure.url must be a non-empty string"),
|
|
@@ -1249,8 +1392,6 @@ var OneRosterBulkResultItem = z9.object({
|
|
|
1249
1392
|
student: Ref
|
|
1250
1393
|
}).loose();
|
|
1251
1394
|
var OneRosterBulkResultsInput = z9.array(OneRosterBulkResultItem).min(1, "results must have at least one item");
|
|
1252
|
-
// ../../types/src/zod/powerpath.ts
|
|
1253
|
-
import { z as z10 } from "zod/v4";
|
|
1254
1395
|
var ToolProvider = z10.enum(["edulastic", "mastery-track"]);
|
|
1255
1396
|
var LessonTypeRequired = z10.enum([
|
|
1256
1397
|
"powerpath-100",
|
|
@@ -1536,8 +1677,6 @@ var PowerPathRenderConfigUpsertInput = z10.object({
|
|
|
1536
1677
|
var PowerPathSyllabusQueryParams = z10.object({
|
|
1537
1678
|
status: z10.enum(["active", "tobedeleted"]).optional()
|
|
1538
1679
|
});
|
|
1539
|
-
// ../../types/src/zod/qti.ts
|
|
1540
|
-
import { z as z11 } from "zod/v4";
|
|
1541
1680
|
var QtiAssessmentItemType = z11.enum([
|
|
1542
1681
|
"choice",
|
|
1543
1682
|
"text-entry",
|
|
@@ -1797,8 +1936,6 @@ var QtiLessonFeedbackInput = z11.object({
|
|
|
1797
1936
|
lessonId: NonEmptyString,
|
|
1798
1937
|
humanApproved: z11.boolean().optional()
|
|
1799
1938
|
}).strict();
|
|
1800
|
-
// ../../types/src/zod/reporting.ts
|
|
1801
|
-
import { z as z12 } from "zod/v4";
|
|
1802
1939
|
var ReportingAuthMode = z12.enum(["creator_only", "same_org", "all_orgs"]);
|
|
1803
1940
|
var ReportingSavedQueryId = z12.string().uuid();
|
|
1804
1941
|
var ReportingUserEmail = z12.email();
|
|
@@ -1814,6 +1951,7 @@ var PersistReportingQueryInput = z12.object({
|
|
|
1814
1951
|
var RemoveReportingQueryInput = z12.object({
|
|
1815
1952
|
endpointId: ReportingSavedQueryId
|
|
1816
1953
|
});
|
|
1954
|
+
|
|
1817
1955
|
// src/resources/assessment.ts
|
|
1818
1956
|
class AssessmentResource {
|
|
1819
1957
|
transport;
|
|
@@ -2208,8 +2346,8 @@ function createPowerPathClient(registry = DEFAULT_PROVIDER_REGISTRY) {
|
|
|
2208
2346
|
syllabus;
|
|
2209
2347
|
testAssignments;
|
|
2210
2348
|
testOut;
|
|
2211
|
-
constructor(
|
|
2212
|
-
const resolved = resolveToProvider2(
|
|
2349
|
+
constructor(config = {}) {
|
|
2350
|
+
const resolved = resolveToProvider2(config, registry);
|
|
2213
2351
|
if (resolved.mode === "transport") {
|
|
2214
2352
|
this.transport = resolved.transport;
|
|
2215
2353
|
log.info("Client initialized with custom transport");
|