@timeback/webhooks 0.2.0 → 0.2.1-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-1dmdawx1.js → chunk-9a1sbh56.js} +68 -54
- package/dist/errors.d.ts +144 -1
- package/dist/errors.js +1 -1
- package/dist/index.d.ts +1072 -128
- package/dist/index.js +246 -77
- package/dist/public-types.d.ts +2 -170
- 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
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
resolveToProvider,
|
|
6
6
|
validateNonEmptyString,
|
|
7
7
|
validateWithSchema
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-9a1sbh56.js";
|
|
9
9
|
import"./chunk-6jf1natv.js";
|
|
10
10
|
|
|
11
11
|
// src/constants.ts
|
|
@@ -37,8 +37,19 @@ class Transport extends BaseTransport {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
// ../../types/
|
|
40
|
+
// ../../types/dist/zod/index.js
|
|
41
41
|
import { z } from "zod/v4";
|
|
42
|
+
import { z as z2 } from "zod/v4";
|
|
43
|
+
import { z as z3 } from "zod/v4";
|
|
44
|
+
import { z as z4 } from "zod/v4";
|
|
45
|
+
import { z as z5 } from "zod/v4";
|
|
46
|
+
import { z as z6 } from "zod/v4";
|
|
47
|
+
import { z as z7 } from "zod/v4";
|
|
48
|
+
import { z as z8 } from "zod/v4";
|
|
49
|
+
import { z as z9 } from "zod/v4";
|
|
50
|
+
import { z as z10 } from "zod/v4";
|
|
51
|
+
import { z as z11 } from "zod/v4";
|
|
52
|
+
import { z as z12 } from "zod/v4";
|
|
42
53
|
var IsoDateTimeRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/;
|
|
43
54
|
var IsoDateTimeString = z.string().min(1).regex(IsoDateTimeRegex, "must be a valid ISO 8601 datetime");
|
|
44
55
|
var IsoDateString = z.string().min(1).regex(/^\d{4}-\d{2}-\d{2}$/, "must be a valid ISO 8601 date (YYYY-MM-DD)");
|
|
@@ -55,7 +66,7 @@ var TimebackSubject = z.enum([
|
|
|
55
66
|
"None",
|
|
56
67
|
"Other"
|
|
57
68
|
]).meta({ id: "TimebackSubject", description: "Subject area" });
|
|
58
|
-
var
|
|
69
|
+
var NumericTimebackGrade = z.union([
|
|
59
70
|
z.literal(-1),
|
|
60
71
|
z.literal(0),
|
|
61
72
|
z.literal(1),
|
|
@@ -71,7 +82,39 @@ var TimebackGrade = z.union([
|
|
|
71
82
|
z.literal(11),
|
|
72
83
|
z.literal(12),
|
|
73
84
|
z.literal(13)
|
|
74
|
-
])
|
|
85
|
+
]);
|
|
86
|
+
var StringTimebackGrade = z.string().transform((value, ctx) => {
|
|
87
|
+
const raw = value.toLowerCase().trim().replaceAll("_", " ");
|
|
88
|
+
if (raw === "") {
|
|
89
|
+
ctx.addIssue({
|
|
90
|
+
code: "custom",
|
|
91
|
+
message: "must be a valid Timeback grade"
|
|
92
|
+
});
|
|
93
|
+
return z.NEVER;
|
|
94
|
+
}
|
|
95
|
+
const stripped = raw.replace(/\bgrade\b/g, "").replace(/(\d+)(st|nd|rd|th)\b/g, "$1").trim();
|
|
96
|
+
if (stripped === "pre-k" || stripped === "pk") {
|
|
97
|
+
return -1;
|
|
98
|
+
}
|
|
99
|
+
if (stripped === "k") {
|
|
100
|
+
return 0;
|
|
101
|
+
}
|
|
102
|
+
if (stripped === "middle school") {
|
|
103
|
+
return 7;
|
|
104
|
+
}
|
|
105
|
+
const normalized = stripped.replace(/\s+/g, "");
|
|
106
|
+
const withoutLeadingZeros = normalized.replace(/^0+/, "") || "0";
|
|
107
|
+
const parsed = Number(withoutLeadingZeros);
|
|
108
|
+
if (!Number.isInteger(parsed)) {
|
|
109
|
+
ctx.addIssue({
|
|
110
|
+
code: "custom",
|
|
111
|
+
message: "must be a valid Timeback grade"
|
|
112
|
+
});
|
|
113
|
+
return z.NEVER;
|
|
114
|
+
}
|
|
115
|
+
return parsed;
|
|
116
|
+
});
|
|
117
|
+
var TimebackGrade = z.union([z.number(), StringTimebackGrade]).pipe(NumericTimebackGrade).meta({
|
|
75
118
|
id: "TimebackGrade",
|
|
76
119
|
description: "Grade level (-1 = Pre-K, 0 = K, 1-12 = grades, 13 = AP)"
|
|
77
120
|
});
|
|
@@ -154,8 +197,6 @@ var IMSErrorResponse = z.object({
|
|
|
154
197
|
}))
|
|
155
198
|
}).optional()
|
|
156
199
|
});
|
|
157
|
-
// ../../types/src/zod/caliper.ts
|
|
158
|
-
import { z as z2 } from "zod/v4";
|
|
159
200
|
var CaliperIri = z2.union([z2.url(), z2.string().regex(/^urn:/, "Must be a URL or URN")]);
|
|
160
201
|
var TimebackUser = z2.object({
|
|
161
202
|
id: z2.url(),
|
|
@@ -360,8 +401,6 @@ var QuestionGradedInput = z2.object({
|
|
|
360
401
|
session: CaliperEntity.optional(),
|
|
361
402
|
extensions: z2.record(z2.string(), z2.unknown()).optional()
|
|
362
403
|
}).strict();
|
|
363
|
-
// ../../types/src/zod/webhooks.ts
|
|
364
|
-
import { z as z3 } from "zod/v4";
|
|
365
404
|
var WebhookCreateInput = z3.object({
|
|
366
405
|
name: NonEmptyString,
|
|
367
406
|
targetUrl: z3.url("targetUrl must be a valid URL"),
|
|
@@ -396,8 +435,6 @@ var WebhookFilterCreateInput = z3.object({
|
|
|
396
435
|
active: z3.boolean()
|
|
397
436
|
}).strict();
|
|
398
437
|
var WebhookFilterUpdateInput = WebhookFilterCreateInput;
|
|
399
|
-
// ../../types/src/zod/case.ts
|
|
400
|
-
import { z as z4 } from "zod/v4";
|
|
401
438
|
var UuidString = z4.string().uuid();
|
|
402
439
|
var InputNodeURISchema = z4.object({
|
|
403
440
|
title: NonEmptyString,
|
|
@@ -471,8 +508,6 @@ var CasePackageInput = z4.object({
|
|
|
471
508
|
CFDefinitions: CFDefinitionsSchema.optional(),
|
|
472
509
|
extensions: z4.unknown().optional()
|
|
473
510
|
});
|
|
474
|
-
// ../../types/src/zod/clr.ts
|
|
475
|
-
import { z as z5 } from "zod/v4";
|
|
476
511
|
var W3C_CREDENTIALS_CONTEXT = "https://www.w3.org/ns/credentials/v2";
|
|
477
512
|
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}"`);
|
|
478
513
|
var ClrImageSchema = z5.object({
|
|
@@ -572,8 +607,6 @@ var ClrCredentialInput = z5.object({
|
|
|
572
607
|
proof: z5.array(ClrProofSchema).optional(),
|
|
573
608
|
credentialSchema: z5.array(ClrCredentialSchemaSchema).optional()
|
|
574
609
|
});
|
|
575
|
-
// ../../types/src/zod/config.ts
|
|
576
|
-
import { z as z6 } from "zod/v4";
|
|
577
610
|
var CourseIds = z6.object({
|
|
578
611
|
staging: z6.string().meta({ description: "Course ID in staging environment" }).optional(),
|
|
579
612
|
production: z6.string().meta({ description: "Course ID in production environment" }).optional()
|
|
@@ -694,10 +727,7 @@ var TimebackConfig = z6.object({
|
|
|
694
727
|
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.",
|
|
695
728
|
path: ["courses"]
|
|
696
729
|
});
|
|
697
|
-
// ../../types/src/zod/edubridge.ts
|
|
698
|
-
import { z as z7 } from "zod/v4";
|
|
699
730
|
var EdubridgeDateString = z7.union([IsoDateTimeString, IsoDateString]);
|
|
700
|
-
var EdubridgeDateStringInput = EdubridgeDateString.transform((date) => date.includes("T") ? date : `${date}T00:00:00.000Z`);
|
|
701
731
|
var EduBridgeEnrollment = z7.object({
|
|
702
732
|
id: z7.string(),
|
|
703
733
|
role: z7.string(),
|
|
@@ -716,7 +746,9 @@ var EduBridgeEnrollment = z7.object({
|
|
|
716
746
|
school: z7.object({
|
|
717
747
|
id: z7.string(),
|
|
718
748
|
name: z7.string()
|
|
719
|
-
})
|
|
749
|
+
}),
|
|
750
|
+
testOutSupported: z7.boolean(),
|
|
751
|
+
testOutEligible: z7.boolean()
|
|
720
752
|
});
|
|
721
753
|
var SubjectMetrics = z7.object({
|
|
722
754
|
activityMetrics: z7.object({
|
|
@@ -785,22 +817,20 @@ var EdubridgeUsersListParams = z7.object({
|
|
|
785
817
|
orgSourcedIds: z7.array(NonEmptyString).optional()
|
|
786
818
|
});
|
|
787
819
|
var EdubridgeActivityParams = EmailOrStudentId.extend({
|
|
788
|
-
startDate:
|
|
789
|
-
endDate:
|
|
820
|
+
startDate: EdubridgeDateString,
|
|
821
|
+
endDate: EdubridgeDateString,
|
|
790
822
|
timezone: z7.string().optional()
|
|
791
823
|
});
|
|
792
824
|
var EdubridgeWeeklyFactsParams = EmailOrStudentId.extend({
|
|
793
|
-
weekDate:
|
|
825
|
+
weekDate: EdubridgeDateString,
|
|
794
826
|
timezone: z7.string().optional()
|
|
795
827
|
});
|
|
796
828
|
var EdubridgeEnrollmentFactsParams = z7.object({
|
|
797
829
|
enrollmentId: NonEmptyString,
|
|
798
|
-
startDate:
|
|
799
|
-
endDate:
|
|
830
|
+
startDate: EdubridgeDateString.optional(),
|
|
831
|
+
endDate: EdubridgeDateString.optional(),
|
|
800
832
|
timezone: z7.string().optional()
|
|
801
833
|
});
|
|
802
|
-
// ../../types/src/zod/masterytrack.ts
|
|
803
|
-
import { z as z8 } from "zod/v4";
|
|
804
834
|
var MasteryTrackAuthorizerInput = z8.object({
|
|
805
835
|
email: z8.email()
|
|
806
836
|
});
|
|
@@ -876,8 +906,6 @@ var MasteryTrackInvalidateAssignmentInput = z8.object({
|
|
|
876
906
|
});
|
|
877
907
|
}
|
|
878
908
|
});
|
|
879
|
-
// ../../types/src/zod/oneroster.ts
|
|
880
|
-
import { z as z9 } from "zod/v4";
|
|
881
909
|
var Status = z9.enum(["active", "tobedeleted"]);
|
|
882
910
|
var Metadata = z9.record(z9.string(), z9.unknown()).nullable().optional();
|
|
883
911
|
var Ref = z9.object({
|
|
@@ -885,7 +913,42 @@ var Ref = z9.object({
|
|
|
885
913
|
type: z9.string().optional(),
|
|
886
914
|
href: z9.string().optional()
|
|
887
915
|
}).strict();
|
|
916
|
+
var GuidRefType = z9.enum([
|
|
917
|
+
"academicSession",
|
|
918
|
+
"assessmentLineItem",
|
|
919
|
+
"category",
|
|
920
|
+
"class",
|
|
921
|
+
"course",
|
|
922
|
+
"demographics",
|
|
923
|
+
"enrollment",
|
|
924
|
+
"gradingPeriod",
|
|
925
|
+
"lineItem",
|
|
926
|
+
"org",
|
|
927
|
+
"resource",
|
|
928
|
+
"result",
|
|
929
|
+
"scoreScale",
|
|
930
|
+
"student",
|
|
931
|
+
"teacher",
|
|
932
|
+
"term",
|
|
933
|
+
"user",
|
|
934
|
+
"componentResource",
|
|
935
|
+
"courseComponent"
|
|
936
|
+
]);
|
|
937
|
+
var GuidRef = z9.object({
|
|
938
|
+
sourcedId: NonEmptyString,
|
|
939
|
+
type: GuidRefType,
|
|
940
|
+
href: z9.url()
|
|
941
|
+
}).strict();
|
|
888
942
|
var OneRosterDateString = z9.union([IsoDateString, IsoDateTimeString]).transform((date) => date.includes("T") ? date : `${date}T00:00:00Z`);
|
|
943
|
+
var LearningObjectiveResult = z9.object({
|
|
944
|
+
learningObjectiveId: z9.string(),
|
|
945
|
+
score: z9.number().optional(),
|
|
946
|
+
textScore: z9.string().optional()
|
|
947
|
+
});
|
|
948
|
+
var LearningObjectiveScoreSetSchema = z9.array(z9.object({
|
|
949
|
+
source: z9.string(),
|
|
950
|
+
learningObjectiveResults: z9.array(LearningObjectiveResult)
|
|
951
|
+
}));
|
|
889
952
|
var OneRosterUserRoleInput = z9.object({
|
|
890
953
|
roleType: z9.enum(["primary", "secondary"]),
|
|
891
954
|
role: OneRosterUserRole,
|
|
@@ -898,35 +961,46 @@ var OneRosterUserRoleInput = z9.object({
|
|
|
898
961
|
var OneRosterUserCreateInput = z9.object({
|
|
899
962
|
sourcedId: NonEmptyString.describe("sourcedId must be a non-empty string"),
|
|
900
963
|
status: Status.optional(),
|
|
901
|
-
enabledUser: z9.
|
|
964
|
+
enabledUser: z9.union([
|
|
965
|
+
z9.boolean(),
|
|
966
|
+
z9.enum(["true", "false"]).transform((value) => value === "true")
|
|
967
|
+
]),
|
|
902
968
|
givenName: NonEmptyString.describe("givenName must be a non-empty string"),
|
|
903
969
|
familyName: NonEmptyString.describe("familyName must be a non-empty string"),
|
|
904
|
-
middleName: NonEmptyString.optional(),
|
|
905
|
-
|
|
970
|
+
middleName: NonEmptyString.nullable().optional(),
|
|
971
|
+
preferredFirstName: NonEmptyString.nullable().optional(),
|
|
972
|
+
preferredMiddleName: NonEmptyString.nullable().optional(),
|
|
973
|
+
preferredLastName: NonEmptyString.nullable().optional(),
|
|
974
|
+
username: NonEmptyString.nullable().optional(),
|
|
906
975
|
email: z9.email(),
|
|
976
|
+
userMasterIdentifier: z9.string().nullable().optional(),
|
|
907
977
|
roles: z9.array(OneRosterUserRoleInput).min(1, "roles must include at least one role"),
|
|
908
978
|
userIds: z9.array(z9.object({
|
|
909
979
|
type: NonEmptyString,
|
|
910
980
|
identifier: NonEmptyString
|
|
911
981
|
}).strict()).optional(),
|
|
912
982
|
agents: z9.array(Ref).optional(),
|
|
983
|
+
primaryOrg: Ref.optional(),
|
|
913
984
|
grades: z9.array(TimebackGrade).optional(),
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
password: NonEmptyString.optional(),
|
|
985
|
+
sms: NonEmptyString.nullable().optional(),
|
|
986
|
+
phone: NonEmptyString.nullable().optional(),
|
|
987
|
+
pronouns: NonEmptyString.nullable().optional(),
|
|
988
|
+
password: NonEmptyString.nullable().optional(),
|
|
919
989
|
metadata: Metadata
|
|
920
990
|
}).strict();
|
|
921
991
|
var OneRosterCourseCreateInput = z9.object({
|
|
922
992
|
sourcedId: NonEmptyString.describe("sourcedId must be a non-empty string").optional(),
|
|
923
|
-
status: Status
|
|
993
|
+
status: Status,
|
|
924
994
|
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
925
995
|
org: Ref,
|
|
926
|
-
courseCode: NonEmptyString.optional(),
|
|
927
|
-
subjects: z9.array(TimebackSubject).optional(),
|
|
928
|
-
|
|
929
|
-
|
|
996
|
+
courseCode: NonEmptyString.nullable().optional(),
|
|
997
|
+
subjects: z9.array(TimebackSubject).nullable().optional(),
|
|
998
|
+
subjectCodes: z9.array(z9.string()).nullable().optional(),
|
|
999
|
+
grades: z9.array(TimebackGrade).nullable().optional(),
|
|
1000
|
+
level: NonEmptyString.nullable().optional(),
|
|
1001
|
+
academicSession: Ref.nullable().optional(),
|
|
1002
|
+
schoolYear: GuidRef.nullable().optional(),
|
|
1003
|
+
gradingScheme: NonEmptyString.nullable().optional(),
|
|
930
1004
|
metadata: Metadata
|
|
931
1005
|
}).strict();
|
|
932
1006
|
var OneRosterClassCreateInput = z9.object({
|
|
@@ -936,9 +1010,9 @@ var OneRosterClassCreateInput = z9.object({
|
|
|
936
1010
|
terms: z9.array(Ref).min(1, "terms must have at least one item"),
|
|
937
1011
|
course: Ref,
|
|
938
1012
|
org: Ref,
|
|
939
|
-
classCode: NonEmptyString.optional(),
|
|
1013
|
+
classCode: NonEmptyString.nullable().optional(),
|
|
940
1014
|
classType: z9.enum(["homeroom", "scheduled"]).optional(),
|
|
941
|
-
location: NonEmptyString.optional(),
|
|
1015
|
+
location: NonEmptyString.nullable().optional(),
|
|
942
1016
|
grades: z9.array(TimebackGrade).optional(),
|
|
943
1017
|
subjects: z9.array(TimebackSubject).optional(),
|
|
944
1018
|
subjectCodes: z9.array(NonEmptyString).optional(),
|
|
@@ -973,18 +1047,21 @@ var OneRosterLineItemCreateInput = z9.object({
|
|
|
973
1047
|
category: Ref,
|
|
974
1048
|
assignDate: OneRosterDateString,
|
|
975
1049
|
dueDate: OneRosterDateString,
|
|
976
|
-
status: Status,
|
|
977
|
-
description: z9.string().optional(),
|
|
1050
|
+
status: Status.optional(),
|
|
1051
|
+
description: z9.string().nullable().optional(),
|
|
978
1052
|
resultValueMin: z9.number().nullable().optional(),
|
|
979
1053
|
resultValueMax: z9.number().nullable().optional(),
|
|
980
|
-
|
|
1054
|
+
gradingPeriod: Ref.nullable().optional(),
|
|
1055
|
+
academicSession: Ref.nullable().optional(),
|
|
1056
|
+
scoreScale: Ref.nullable().optional(),
|
|
1057
|
+
learningObjectiveSet: LearningObjectiveSetSchema.nullable().optional(),
|
|
981
1058
|
metadata: Metadata
|
|
982
1059
|
}).strict();
|
|
983
1060
|
var OneRosterResultCreateInput = z9.object({
|
|
984
1061
|
sourcedId: NonEmptyString.optional(),
|
|
985
1062
|
lineItem: Ref,
|
|
986
1063
|
student: Ref,
|
|
987
|
-
class: Ref.optional(),
|
|
1064
|
+
class: Ref.nullable().optional(),
|
|
988
1065
|
scoreDate: OneRosterDateString,
|
|
989
1066
|
scoreStatus: z9.enum([
|
|
990
1067
|
"exempt",
|
|
@@ -996,14 +1073,20 @@ var OneRosterResultCreateInput = z9.object({
|
|
|
996
1073
|
score: z9.number().nullable().optional(),
|
|
997
1074
|
textScore: z9.string().nullable().optional(),
|
|
998
1075
|
status: Status,
|
|
1076
|
+
scoreScale: Ref.nullable().optional(),
|
|
999
1077
|
comment: z9.string().nullable().optional(),
|
|
1078
|
+
learningObjectiveSet: LearningObjectiveScoreSetSchema.nullable().optional(),
|
|
1079
|
+
inProgress: z9.string().optional(),
|
|
1080
|
+
incomplete: z9.string().optional(),
|
|
1081
|
+
late: z9.string().optional(),
|
|
1082
|
+
missing: z9.string().optional(),
|
|
1000
1083
|
metadata: Metadata
|
|
1001
1084
|
}).strict();
|
|
1002
1085
|
var OneRosterScoreScaleCreateInput = z9.object({
|
|
1003
1086
|
sourcedId: NonEmptyString.optional(),
|
|
1004
1087
|
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
1005
|
-
status: Status
|
|
1006
|
-
type:
|
|
1088
|
+
status: Status,
|
|
1089
|
+
type: NonEmptyString,
|
|
1007
1090
|
class: Ref,
|
|
1008
1091
|
course: Ref.nullable().optional(),
|
|
1009
1092
|
scoreScaleValue: z9.array(z9.object({
|
|
@@ -1012,13 +1095,11 @@ var OneRosterScoreScaleCreateInput = z9.object({
|
|
|
1012
1095
|
value: z9.string().optional(),
|
|
1013
1096
|
description: z9.string().optional()
|
|
1014
1097
|
}).strict()),
|
|
1015
|
-
minScore: z9.number().optional(),
|
|
1016
|
-
maxScore: z9.number().optional(),
|
|
1017
1098
|
metadata: Metadata
|
|
1018
1099
|
}).strict();
|
|
1019
1100
|
var OneRosterAssessmentLineItemCreateInput = z9.object({
|
|
1020
1101
|
sourcedId: NonEmptyString.optional(),
|
|
1021
|
-
status: Status
|
|
1102
|
+
status: Status,
|
|
1022
1103
|
dateLastModified: IsoDateTimeString.optional(),
|
|
1023
1104
|
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
1024
1105
|
description: z9.string().nullable().optional(),
|
|
@@ -1036,18 +1117,9 @@ var OneRosterAssessmentLineItemCreateInput = z9.object({
|
|
|
1036
1117
|
course: Ref.nullable().optional(),
|
|
1037
1118
|
metadata: Metadata
|
|
1038
1119
|
}).strict();
|
|
1039
|
-
var LearningObjectiveResult = z9.object({
|
|
1040
|
-
learningObjectiveId: z9.string(),
|
|
1041
|
-
score: z9.number().optional(),
|
|
1042
|
-
textScore: z9.string().optional()
|
|
1043
|
-
});
|
|
1044
|
-
var LearningObjectiveScoreSetSchema = z9.array(z9.object({
|
|
1045
|
-
source: z9.string(),
|
|
1046
|
-
learningObjectiveResults: z9.array(LearningObjectiveResult)
|
|
1047
|
-
}));
|
|
1048
1120
|
var OneRosterAssessmentResultCreateInput = z9.object({
|
|
1049
1121
|
sourcedId: NonEmptyString.optional(),
|
|
1050
|
-
status: Status
|
|
1122
|
+
status: Status,
|
|
1051
1123
|
dateLastModified: IsoDateTimeString.optional(),
|
|
1052
1124
|
metadata: Metadata,
|
|
1053
1125
|
assessmentLineItem: Ref,
|
|
@@ -1076,7 +1148,7 @@ var OneRosterOrgCreateInput = z9.object({
|
|
|
1076
1148
|
status: Status.optional(),
|
|
1077
1149
|
name: NonEmptyString.describe("name must be a non-empty string"),
|
|
1078
1150
|
type: OrganizationType,
|
|
1079
|
-
identifier:
|
|
1151
|
+
identifier: z9.string().nullish(),
|
|
1080
1152
|
parent: Ref.optional(),
|
|
1081
1153
|
metadata: Metadata
|
|
1082
1154
|
}).strict();
|
|
@@ -1084,8 +1156,8 @@ var OneRosterSchoolCreateInput = z9.object({
|
|
|
1084
1156
|
sourcedId: NonEmptyString.optional(),
|
|
1085
1157
|
status: Status.optional(),
|
|
1086
1158
|
name: NonEmptyString.describe("name must be a non-empty string"),
|
|
1087
|
-
type: z9.literal("school").
|
|
1088
|
-
identifier:
|
|
1159
|
+
type: z9.literal("school").default("school"),
|
|
1160
|
+
identifier: z9.string().nullish(),
|
|
1089
1161
|
parent: Ref.optional(),
|
|
1090
1162
|
metadata: Metadata
|
|
1091
1163
|
}).strict();
|
|
@@ -1103,11 +1175,13 @@ var OneRosterAcademicSessionCreateInput = z9.object({
|
|
|
1103
1175
|
metadata: Metadata
|
|
1104
1176
|
}).strict();
|
|
1105
1177
|
var OneRosterComponentResourceCreateInput = z9.object({
|
|
1106
|
-
sourcedId: NonEmptyString
|
|
1178
|
+
sourcedId: NonEmptyString,
|
|
1107
1179
|
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
1108
1180
|
courseComponent: Ref,
|
|
1109
1181
|
resource: Ref,
|
|
1110
1182
|
status: Status,
|
|
1183
|
+
sortOrder: z9.number().optional(),
|
|
1184
|
+
lessonType: LessonType.optional(),
|
|
1111
1185
|
metadata: Metadata
|
|
1112
1186
|
}).strict();
|
|
1113
1187
|
var OneRosterCourseComponentCreateInput = z9.object({
|
|
@@ -1115,8 +1189,17 @@ var OneRosterCourseComponentCreateInput = z9.object({
|
|
|
1115
1189
|
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
1116
1190
|
course: Ref,
|
|
1117
1191
|
status: Status,
|
|
1192
|
+
sortOrder: z9.number().optional(),
|
|
1193
|
+
parent: Ref.nullable().optional(),
|
|
1194
|
+
courseComponent: Ref.nullable().optional(),
|
|
1195
|
+
prerequisites: z9.array(z9.string()).nullable().optional(),
|
|
1196
|
+
prerequisiteCriteria: z9.string().nullable().optional(),
|
|
1197
|
+
unlockDate: OneRosterDateString.nullable().optional(),
|
|
1118
1198
|
metadata: Metadata
|
|
1119
|
-
}).strict()
|
|
1199
|
+
}).strict().transform(({ courseComponent, parent, ...rest }) => ({
|
|
1200
|
+
...rest,
|
|
1201
|
+
parent: parent === undefined ? courseComponent ?? undefined : parent
|
|
1202
|
+
}));
|
|
1120
1203
|
var OneRosterEnrollInput = z9.object({
|
|
1121
1204
|
sourcedId: NonEmptyString.describe("sourcedId must be a non-empty string"),
|
|
1122
1205
|
role: z9.enum(["student", "teacher"]),
|
|
@@ -1136,8 +1219,23 @@ var OneRosterCredentialInput = z9.object({
|
|
|
1136
1219
|
})
|
|
1137
1220
|
}).strict();
|
|
1138
1221
|
var OneRosterDemographicsCreateInput = z9.object({
|
|
1139
|
-
sourcedId: NonEmptyString.describe("sourcedId must be a non-empty string")
|
|
1140
|
-
|
|
1222
|
+
sourcedId: NonEmptyString.describe("sourcedId must be a non-empty string"),
|
|
1223
|
+
status: Status.optional(),
|
|
1224
|
+
metadata: Metadata,
|
|
1225
|
+
birthDate: z9.string().regex(/^\d{4}-\d{2}-\d{2}$/).nullable().optional(),
|
|
1226
|
+
sex: z9.enum(["male", "female"]).nullable().optional(),
|
|
1227
|
+
americanIndianOrAlaskaNative: StringBoolean.nullable().optional(),
|
|
1228
|
+
asian: StringBoolean.nullable().optional(),
|
|
1229
|
+
blackOrAfricanAmerican: StringBoolean.nullable().optional(),
|
|
1230
|
+
nativeHawaiianOrOtherPacificIslander: StringBoolean.nullable().optional(),
|
|
1231
|
+
white: StringBoolean.nullable().optional(),
|
|
1232
|
+
demographicRaceTwoOrMoreRaces: StringBoolean.nullable().optional(),
|
|
1233
|
+
hispanicOrLatinoEthnicity: StringBoolean.nullable().optional(),
|
|
1234
|
+
countryOfBirthCode: z9.string().nullable().optional(),
|
|
1235
|
+
stateOfBirthAbbreviation: z9.string().nullable().optional(),
|
|
1236
|
+
cityOfBirth: z9.string().nullable().optional(),
|
|
1237
|
+
publicSchoolResidenceStatus: z9.string().nullable().optional()
|
|
1238
|
+
}).strict();
|
|
1141
1239
|
var CommonResourceMetadataSchema = z9.object({
|
|
1142
1240
|
type: ResourceType,
|
|
1143
1241
|
subject: TimebackSubject.nullish(),
|
|
@@ -1207,16 +1305,63 @@ var ResourceMetadataSchema = z9.discriminatedUnion("type", [
|
|
|
1207
1305
|
CourseMaterialMetadataSchema,
|
|
1208
1306
|
AssessmentBankMetadataSchema
|
|
1209
1307
|
]);
|
|
1308
|
+
var ReservedResourceMetadataKeys = new Set([
|
|
1309
|
+
"type",
|
|
1310
|
+
"subject",
|
|
1311
|
+
"grades",
|
|
1312
|
+
"language",
|
|
1313
|
+
"xp",
|
|
1314
|
+
"url",
|
|
1315
|
+
"keywords",
|
|
1316
|
+
"learningObjectiveSet",
|
|
1317
|
+
"lessonType",
|
|
1318
|
+
"subType",
|
|
1319
|
+
"questionType",
|
|
1320
|
+
"difficulty",
|
|
1321
|
+
"format",
|
|
1322
|
+
"author",
|
|
1323
|
+
"pageCount",
|
|
1324
|
+
"duration",
|
|
1325
|
+
"speaker",
|
|
1326
|
+
"captionsAvailable",
|
|
1327
|
+
"launchUrl",
|
|
1328
|
+
"toolProvider",
|
|
1329
|
+
"instructionalMethod",
|
|
1330
|
+
"courseIdOnFail",
|
|
1331
|
+
"resolution",
|
|
1332
|
+
"resources"
|
|
1333
|
+
]);
|
|
1334
|
+
var UntypedResourceMetadataSchema = z9.record(z9.string(), z9.unknown()).superRefine((metadata, ctx) => {
|
|
1335
|
+
if ("fail_fast" in metadata) {
|
|
1336
|
+
const result = FastFailConfigSchema.safeParse(metadata.fail_fast);
|
|
1337
|
+
if (!result.success) {
|
|
1338
|
+
for (const issue of result.error.issues) {
|
|
1339
|
+
ctx.addIssue({
|
|
1340
|
+
...issue,
|
|
1341
|
+
path: ["fail_fast", ...issue.path]
|
|
1342
|
+
});
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
const reservedKeys = Object.keys(metadata).filter((key) => ReservedResourceMetadataKeys.has(key));
|
|
1347
|
+
if (reservedKeys.length === 0) {
|
|
1348
|
+
return;
|
|
1349
|
+
}
|
|
1350
|
+
ctx.addIssue({
|
|
1351
|
+
code: "custom",
|
|
1352
|
+
message: `metadata keys ${reservedKeys.map((key) => `\`${key}\``).join(", ")} require a valid \`type\` discriminator`
|
|
1353
|
+
});
|
|
1354
|
+
});
|
|
1210
1355
|
var OneRosterResourceCreateInput = z9.object({
|
|
1211
1356
|
sourcedId: NonEmptyString.optional(),
|
|
1212
1357
|
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
1213
1358
|
vendorResourceId: NonEmptyString.describe("vendorResourceId must be a non-empty string"),
|
|
1214
1359
|
roles: z9.array(z9.enum(["primary", "secondary"])).optional(),
|
|
1215
1360
|
importance: z9.enum(["primary", "secondary"]).optional(),
|
|
1216
|
-
vendorId:
|
|
1217
|
-
applicationId:
|
|
1361
|
+
vendorId: NonEmptyString.nullable().optional(),
|
|
1362
|
+
applicationId: NonEmptyString.nullable().optional(),
|
|
1218
1363
|
status: Status.optional(),
|
|
1219
|
-
metadata: ResourceMetadataSchema.nullable().optional()
|
|
1364
|
+
metadata: z9.union([ResourceMetadataSchema, UntypedResourceMetadataSchema]).nullable().optional()
|
|
1220
1365
|
}).strict();
|
|
1221
1366
|
var CourseStructureItem = z9.object({
|
|
1222
1367
|
url: NonEmptyString.describe("courseStructure.url must be a non-empty string"),
|
|
@@ -1241,8 +1386,6 @@ var OneRosterBulkResultItem = z9.object({
|
|
|
1241
1386
|
student: Ref
|
|
1242
1387
|
}).loose();
|
|
1243
1388
|
var OneRosterBulkResultsInput = z9.array(OneRosterBulkResultItem).min(1, "results must have at least one item");
|
|
1244
|
-
// ../../types/src/zod/powerpath.ts
|
|
1245
|
-
import { z as z10 } from "zod/v4";
|
|
1246
1389
|
var ToolProvider = z10.enum(["edulastic", "mastery-track"]);
|
|
1247
1390
|
var LessonTypeRequired = z10.enum([
|
|
1248
1391
|
"powerpath-100",
|
|
@@ -1511,11 +1654,21 @@ var PowerPathPlacementQueryParams = z10.object({
|
|
|
1511
1654
|
student: NonEmptyString,
|
|
1512
1655
|
subject: TimebackSubject
|
|
1513
1656
|
});
|
|
1657
|
+
var PowerPathMakeExternalStudentTestOutAssignmentInput = z10.object({
|
|
1658
|
+
oneRosterSourcedId: NonEmptyString,
|
|
1659
|
+
subject: NonEmptyString
|
|
1660
|
+
});
|
|
1661
|
+
var PowerPathRenderConfigUpsertInput = z10.object({
|
|
1662
|
+
courseIds: z10.array(NonEmptyString).min(1),
|
|
1663
|
+
rendererId: NonEmptyString,
|
|
1664
|
+
rendererUrl: z10.url(),
|
|
1665
|
+
rendererVersion: NonEmptyString.optional(),
|
|
1666
|
+
suppressFeedback: z10.boolean().optional(),
|
|
1667
|
+
suppressCorrectResponse: z10.boolean().optional()
|
|
1668
|
+
});
|
|
1514
1669
|
var PowerPathSyllabusQueryParams = z10.object({
|
|
1515
1670
|
status: z10.enum(["active", "tobedeleted"]).optional()
|
|
1516
1671
|
});
|
|
1517
|
-
// ../../types/src/zod/qti.ts
|
|
1518
|
-
import { z as z11 } from "zod/v4";
|
|
1519
1672
|
var QtiAssessmentItemType = z11.enum([
|
|
1520
1673
|
"choice",
|
|
1521
1674
|
"text-entry",
|
|
@@ -1775,6 +1928,22 @@ var QtiLessonFeedbackInput = z11.object({
|
|
|
1775
1928
|
lessonId: NonEmptyString,
|
|
1776
1929
|
humanApproved: z11.boolean().optional()
|
|
1777
1930
|
}).strict();
|
|
1931
|
+
var ReportingAuthMode = z12.enum(["creator_only", "same_org", "all_orgs"]);
|
|
1932
|
+
var ReportingSavedQueryId = z12.string().uuid();
|
|
1933
|
+
var ReportingUserEmail = z12.email();
|
|
1934
|
+
var ReportingQueryInput = z12.object({
|
|
1935
|
+
sql: NonEmptyString
|
|
1936
|
+
});
|
|
1937
|
+
var PersistReportingQueryInput = z12.object({
|
|
1938
|
+
endpointName: NonEmptyString,
|
|
1939
|
+
sql: NonEmptyString,
|
|
1940
|
+
authMode: ReportingAuthMode,
|
|
1941
|
+
description: NonEmptyString.optional()
|
|
1942
|
+
});
|
|
1943
|
+
var RemoveReportingQueryInput = z12.object({
|
|
1944
|
+
endpointId: ReportingSavedQueryId
|
|
1945
|
+
});
|
|
1946
|
+
|
|
1778
1947
|
// src/resources/webhooks.ts
|
|
1779
1948
|
class WebhooksResource {
|
|
1780
1949
|
transport;
|
|
@@ -1916,8 +2085,8 @@ function createWebhooksClient(registry = DEFAULT_PROVIDER_REGISTRY) {
|
|
|
1916
2085
|
_provider;
|
|
1917
2086
|
webhooks;
|
|
1918
2087
|
webhookFilters;
|
|
1919
|
-
constructor(
|
|
1920
|
-
const resolved = resolveToProvider2(
|
|
2088
|
+
constructor(config = {}) {
|
|
2089
|
+
const resolved = resolveToProvider2(config, registry);
|
|
1921
2090
|
if (resolved.mode === "transport") {
|
|
1922
2091
|
this.transport = resolved.transport;
|
|
1923
2092
|
log.info("Client initialized with custom transport");
|