@timeback/webhooks 0.2.1-beta.20260313023436 → 0.2.1-beta.20260331191116
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.js +1 -1
- package/dist/index.js +233 -54
- package/package.json +1 -1
- 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
|
@@ -571,6 +571,13 @@ var BEYONDAI_PATHS = {
|
|
|
571
571
|
webhookFilterUpdate: "/webhook-filters/{id}",
|
|
572
572
|
webhookFilterDelete: "/webhook-filters/{id}",
|
|
573
573
|
webhookFiltersByWebhook: "/webhook-filters/webhook/{webhookId}"
|
|
574
|
+
},
|
|
575
|
+
reporting: {
|
|
576
|
+
mcp: "/mcp/reporting",
|
|
577
|
+
savedQueryExecute: "/reporting/saved-queries/{id}",
|
|
578
|
+
adminGroupCheck: "/mcp/admin/users/{email}/group",
|
|
579
|
+
adminGroupAdd: "/mcp/admin/users/{email}/group",
|
|
580
|
+
adminGroupRemove: "/mcp/admin/users/{email}/group"
|
|
574
581
|
}
|
|
575
582
|
};
|
|
576
583
|
var LEARNWITHAI_PATHS = {
|
|
@@ -587,6 +594,7 @@ var LEARNWITHAI_PATHS = {
|
|
|
587
594
|
resources: "/resources/1.0"
|
|
588
595
|
},
|
|
589
596
|
webhooks: null,
|
|
597
|
+
reporting: null,
|
|
590
598
|
edubridge: null,
|
|
591
599
|
powerpath: null,
|
|
592
600
|
clr: null,
|
|
@@ -615,6 +623,7 @@ function resolvePathProfiles(pathProfile, customPaths) {
|
|
|
615
623
|
caliper: customPaths?.caliper ?? basePaths.caliper,
|
|
616
624
|
oneroster: customPaths?.oneroster ?? basePaths.oneroster,
|
|
617
625
|
webhooks: customPaths?.webhooks ?? basePaths.webhooks,
|
|
626
|
+
reporting: customPaths?.reporting ?? basePaths.reporting,
|
|
618
627
|
edubridge: customPaths?.edubridge ?? basePaths.edubridge,
|
|
619
628
|
powerpath: customPaths?.powerpath ?? basePaths.powerpath,
|
|
620
629
|
clr: customPaths?.clr ?? basePaths.clr,
|
|
@@ -627,11 +636,11 @@ class TimebackProvider {
|
|
|
627
636
|
env;
|
|
628
637
|
auth;
|
|
629
638
|
timeout;
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
639
|
+
_endpoints;
|
|
640
|
+
_authUrl;
|
|
641
|
+
_tokenScope;
|
|
642
|
+
_pathProfiles;
|
|
643
|
+
_tokenManagers = new Map;
|
|
635
644
|
constructor(config) {
|
|
636
645
|
this.timeout = config.timeout ?? 30000;
|
|
637
646
|
if (isEnvConfig(config)) {
|
|
@@ -644,84 +653,89 @@ class TimebackProvider {
|
|
|
644
653
|
if (!platformEndpoints) {
|
|
645
654
|
throw new Error(`Unknown platform: ${platform}`);
|
|
646
655
|
}
|
|
647
|
-
this.
|
|
648
|
-
this.
|
|
649
|
-
this.
|
|
650
|
-
this.
|
|
656
|
+
this._authUrl = platformEndpoints.token[env];
|
|
657
|
+
this._tokenScope = platformEndpoints.tokenScope ?? undefined;
|
|
658
|
+
this._pathProfiles = PLATFORM_PATHS[platform] ?? BEYONDAI_PATHS;
|
|
659
|
+
this._endpoints = {
|
|
651
660
|
oneroster: {
|
|
652
661
|
baseUrl: platformEndpoints.api[env],
|
|
653
|
-
authUrl: this.
|
|
662
|
+
authUrl: this._authUrl
|
|
654
663
|
},
|
|
655
664
|
edubridge: {
|
|
656
665
|
baseUrl: platformEndpoints.api[env],
|
|
657
|
-
authUrl: this.
|
|
666
|
+
authUrl: this._authUrl
|
|
658
667
|
},
|
|
659
668
|
powerpath: {
|
|
660
669
|
baseUrl: platformEndpoints.api[env],
|
|
661
|
-
authUrl: this.
|
|
670
|
+
authUrl: this._authUrl
|
|
662
671
|
},
|
|
663
672
|
clr: {
|
|
664
673
|
baseUrl: platformEndpoints.api[env],
|
|
665
|
-
authUrl: this.
|
|
674
|
+
authUrl: this._authUrl
|
|
666
675
|
},
|
|
667
676
|
case: {
|
|
668
677
|
baseUrl: platformEndpoints.api[env],
|
|
669
|
-
authUrl: this.
|
|
678
|
+
authUrl: this._authUrl
|
|
670
679
|
},
|
|
671
680
|
caliper: {
|
|
672
681
|
baseUrl: platformEndpoints.caliper[env],
|
|
673
|
-
authUrl: this.
|
|
682
|
+
authUrl: this._authUrl
|
|
674
683
|
},
|
|
675
684
|
webhooks: {
|
|
676
685
|
baseUrl: platformEndpoints.caliper[env],
|
|
677
|
-
authUrl: this.
|
|
686
|
+
authUrl: this._authUrl
|
|
687
|
+
},
|
|
688
|
+
reporting: {
|
|
689
|
+
baseUrl: platformEndpoints.api[env],
|
|
690
|
+
authUrl: this._authUrl
|
|
678
691
|
},
|
|
679
692
|
qti: {
|
|
680
693
|
baseUrl: platformEndpoints.qti[env],
|
|
681
|
-
authUrl: this.
|
|
694
|
+
authUrl: this._authUrl
|
|
682
695
|
}
|
|
683
696
|
};
|
|
684
697
|
} else if (isExplicitConfig(config)) {
|
|
685
698
|
this.auth = config.auth;
|
|
686
|
-
this.
|
|
687
|
-
this.
|
|
688
|
-
this.
|
|
689
|
-
oneroster: { baseUrl: config.baseUrl, authUrl: this.
|
|
690
|
-
edubridge: { baseUrl: config.baseUrl, authUrl: this.
|
|
691
|
-
powerpath: { baseUrl: config.baseUrl, authUrl: this.
|
|
692
|
-
clr: { baseUrl: config.baseUrl, authUrl: this.
|
|
693
|
-
case: { baseUrl: config.baseUrl, authUrl: this.
|
|
694
|
-
caliper: { baseUrl: config.baseUrl, authUrl: this.
|
|
695
|
-
webhooks: { baseUrl: config.baseUrl, authUrl: this.
|
|
696
|
-
|
|
699
|
+
this._authUrl = config.authUrl;
|
|
700
|
+
this._pathProfiles = resolvePathProfiles(config.pathProfile, config.paths);
|
|
701
|
+
this._endpoints = {
|
|
702
|
+
oneroster: { baseUrl: config.baseUrl, authUrl: this._authUrl },
|
|
703
|
+
edubridge: { baseUrl: config.baseUrl, authUrl: this._authUrl },
|
|
704
|
+
powerpath: { baseUrl: config.baseUrl, authUrl: this._authUrl },
|
|
705
|
+
clr: { baseUrl: config.baseUrl, authUrl: this._authUrl },
|
|
706
|
+
case: { baseUrl: config.baseUrl, authUrl: this._authUrl },
|
|
707
|
+
caliper: { baseUrl: config.baseUrl, authUrl: this._authUrl },
|
|
708
|
+
webhooks: { baseUrl: config.baseUrl, authUrl: this._authUrl },
|
|
709
|
+
reporting: { baseUrl: config.baseUrl, authUrl: this._authUrl },
|
|
710
|
+
qti: { baseUrl: config.baseUrl, authUrl: this._authUrl }
|
|
697
711
|
};
|
|
698
712
|
} else if (isServicesConfig(config)) {
|
|
699
713
|
this.auth = config.auth;
|
|
700
|
-
this.
|
|
701
|
-
this.
|
|
702
|
-
this.
|
|
714
|
+
this._authUrl = config.authUrl;
|
|
715
|
+
this._pathProfiles = resolvePathProfiles(config.pathProfile, config.paths);
|
|
716
|
+
this._endpoints = {};
|
|
703
717
|
for (const [service, baseUrl] of Object.entries(config.services)) {
|
|
704
718
|
if (baseUrl) {
|
|
705
|
-
this.
|
|
719
|
+
this._endpoints[service] = {
|
|
706
720
|
baseUrl,
|
|
707
|
-
authUrl: this.
|
|
721
|
+
authUrl: this._authUrl
|
|
708
722
|
};
|
|
709
723
|
}
|
|
710
724
|
}
|
|
711
725
|
} else {
|
|
712
726
|
throw new Error("Invalid provider configuration");
|
|
713
727
|
}
|
|
714
|
-
for (const service of Object.keys(this.
|
|
715
|
-
if (this.
|
|
716
|
-
delete this.
|
|
728
|
+
for (const service of Object.keys(this._pathProfiles)) {
|
|
729
|
+
if (this._pathProfiles[service] === null) {
|
|
730
|
+
delete this._endpoints[service];
|
|
717
731
|
}
|
|
718
732
|
}
|
|
719
733
|
}
|
|
720
734
|
getEndpoint(service) {
|
|
721
|
-
const endpoint = this.
|
|
735
|
+
const endpoint = this._endpoints[service];
|
|
722
736
|
if (!endpoint) {
|
|
723
737
|
const pathKey = service;
|
|
724
|
-
if (pathKey in this.
|
|
738
|
+
if (pathKey in this._pathProfiles && this._pathProfiles[pathKey] === null) {
|
|
725
739
|
throw new Error(`Service "${service}" is not supported on ${this.platform ?? "this"} platform.`);
|
|
726
740
|
}
|
|
727
741
|
throw new Error(`Service "${service}" is not configured in this provider`);
|
|
@@ -729,13 +743,13 @@ class TimebackProvider {
|
|
|
729
743
|
return endpoint;
|
|
730
744
|
}
|
|
731
745
|
hasService(service) {
|
|
732
|
-
return service in this.
|
|
746
|
+
return service in this._endpoints;
|
|
733
747
|
}
|
|
734
748
|
getAvailableServices() {
|
|
735
|
-
return Object.keys(this.
|
|
749
|
+
return Object.keys(this._endpoints);
|
|
736
750
|
}
|
|
737
751
|
getTokenUrl() {
|
|
738
|
-
return this.
|
|
752
|
+
return this._authUrl;
|
|
739
753
|
}
|
|
740
754
|
getEndpointWithPaths(service) {
|
|
741
755
|
const endpoint = this.getEndpoint(service);
|
|
@@ -743,17 +757,17 @@ class TimebackProvider {
|
|
|
743
757
|
return { ...endpoint, paths };
|
|
744
758
|
}
|
|
745
759
|
getPaths() {
|
|
746
|
-
return this.
|
|
760
|
+
return this._pathProfiles;
|
|
747
761
|
}
|
|
748
762
|
getServicePaths(service) {
|
|
749
|
-
const paths = this.
|
|
763
|
+
const paths = this._pathProfiles[service];
|
|
750
764
|
if (!paths) {
|
|
751
765
|
throw new Error(`Service "${service}" is not supported on ${this.platform ?? "this"} platform.`);
|
|
752
766
|
}
|
|
753
767
|
return paths;
|
|
754
768
|
}
|
|
755
769
|
hasServiceSupport(service) {
|
|
756
|
-
return this.
|
|
770
|
+
return this._pathProfiles[service] !== null;
|
|
757
771
|
}
|
|
758
772
|
getTokenProvider(service) {
|
|
759
773
|
const endpoint = this.getEndpoint(service);
|
|
@@ -764,7 +778,7 @@ class TimebackProvider {
|
|
|
764
778
|
if (!this.auth) {
|
|
765
779
|
throw new Error(`Service "${service}" requires authentication but no credentials were provided`);
|
|
766
780
|
}
|
|
767
|
-
let manager = this.
|
|
781
|
+
let manager = this._tokenManagers.get(authUrl);
|
|
768
782
|
if (!manager) {
|
|
769
783
|
manager = new TokenManager({
|
|
770
784
|
tokenUrl: authUrl,
|
|
@@ -772,28 +786,28 @@ class TimebackProvider {
|
|
|
772
786
|
clientId: this.auth.clientId,
|
|
773
787
|
clientSecret: this.auth.clientSecret
|
|
774
788
|
},
|
|
775
|
-
scope: this.
|
|
789
|
+
scope: this._tokenScope
|
|
776
790
|
});
|
|
777
|
-
this.
|
|
791
|
+
this._tokenManagers.set(authUrl, manager);
|
|
778
792
|
}
|
|
779
793
|
return manager;
|
|
780
794
|
}
|
|
781
795
|
async checkAuth() {
|
|
782
|
-
if (!this.
|
|
796
|
+
if (!this._authUrl || !this.auth) {
|
|
783
797
|
throw new Error("No auth configured on this provider");
|
|
784
798
|
}
|
|
785
799
|
const startTime = Date.now();
|
|
786
|
-
let manager = this.
|
|
800
|
+
let manager = this._tokenManagers.get(this._authUrl);
|
|
787
801
|
if (!manager) {
|
|
788
802
|
manager = new TokenManager({
|
|
789
|
-
tokenUrl: this.
|
|
803
|
+
tokenUrl: this._authUrl,
|
|
790
804
|
credentials: {
|
|
791
805
|
clientId: this.auth.clientId,
|
|
792
806
|
clientSecret: this.auth.clientSecret
|
|
793
807
|
},
|
|
794
|
-
scope: this.
|
|
808
|
+
scope: this._tokenScope
|
|
795
809
|
});
|
|
796
|
-
this.
|
|
810
|
+
this._tokenManagers.set(this._authUrl, manager);
|
|
797
811
|
}
|
|
798
812
|
try {
|
|
799
813
|
await manager.getToken();
|
|
@@ -812,10 +826,10 @@ class TimebackProvider {
|
|
|
812
826
|
}
|
|
813
827
|
}
|
|
814
828
|
invalidateTokens() {
|
|
815
|
-
for (const manager of this.
|
|
829
|
+
for (const manager of this._tokenManagers.values()) {
|
|
816
830
|
manager.invalidate?.();
|
|
817
831
|
}
|
|
818
|
-
this.
|
|
832
|
+
this._tokenManagers.clear();
|
|
819
833
|
}
|
|
820
834
|
}
|
|
821
835
|
// ../../internal/client-infra/src/utils/utils.ts
|
package/dist/errors.js
CHANGED
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
|
|
@@ -55,7 +55,7 @@ var TimebackSubject = z.enum([
|
|
|
55
55
|
"None",
|
|
56
56
|
"Other"
|
|
57
57
|
]).meta({ id: "TimebackSubject", description: "Subject area" });
|
|
58
|
-
var
|
|
58
|
+
var NumericTimebackGrade = z.union([
|
|
59
59
|
z.literal(-1),
|
|
60
60
|
z.literal(0),
|
|
61
61
|
z.literal(1),
|
|
@@ -71,7 +71,39 @@ var TimebackGrade = z.union([
|
|
|
71
71
|
z.literal(11),
|
|
72
72
|
z.literal(12),
|
|
73
73
|
z.literal(13)
|
|
74
|
-
])
|
|
74
|
+
]);
|
|
75
|
+
var StringTimebackGrade = z.string().transform((value, ctx) => {
|
|
76
|
+
const raw = value.toLowerCase().trim().replaceAll("_", " ");
|
|
77
|
+
if (raw === "") {
|
|
78
|
+
ctx.addIssue({
|
|
79
|
+
code: "custom",
|
|
80
|
+
message: "must be a valid Timeback grade"
|
|
81
|
+
});
|
|
82
|
+
return z.NEVER;
|
|
83
|
+
}
|
|
84
|
+
const stripped = raw.replace(/\bgrade\b/g, "").replace(/(\d+)(st|nd|rd|th)\b/g, "$1").trim();
|
|
85
|
+
if (stripped === "pre-k" || stripped === "pk") {
|
|
86
|
+
return -1;
|
|
87
|
+
}
|
|
88
|
+
if (stripped === "k") {
|
|
89
|
+
return 0;
|
|
90
|
+
}
|
|
91
|
+
if (stripped === "middle school") {
|
|
92
|
+
return 7;
|
|
93
|
+
}
|
|
94
|
+
const normalized = stripped.replace(/\s+/g, "");
|
|
95
|
+
const withoutLeadingZeros = normalized.replace(/^0+/, "") || "0";
|
|
96
|
+
const parsed = Number(withoutLeadingZeros);
|
|
97
|
+
if (!Number.isInteger(parsed)) {
|
|
98
|
+
ctx.addIssue({
|
|
99
|
+
code: "custom",
|
|
100
|
+
message: "must be a valid Timeback grade"
|
|
101
|
+
});
|
|
102
|
+
return z.NEVER;
|
|
103
|
+
}
|
|
104
|
+
return parsed;
|
|
105
|
+
});
|
|
106
|
+
var TimebackGrade = z.union([z.number(), StringTimebackGrade]).pipe(NumericTimebackGrade).meta({
|
|
75
107
|
id: "TimebackGrade",
|
|
76
108
|
description: "Grade level (-1 = Pre-K, 0 = K, 1-12 = grades, 13 = AP)"
|
|
77
109
|
});
|
|
@@ -697,7 +729,6 @@ var TimebackConfig = z6.object({
|
|
|
697
729
|
// ../../types/src/zod/edubridge.ts
|
|
698
730
|
import { z as z7 } from "zod/v4";
|
|
699
731
|
var EdubridgeDateString = z7.union([IsoDateTimeString, IsoDateString]);
|
|
700
|
-
var EdubridgeDateStringInput = EdubridgeDateString.transform((date) => date.includes("T") ? date : `${date}T00:00:00.000Z`);
|
|
701
732
|
var EduBridgeEnrollment = z7.object({
|
|
702
733
|
id: z7.string(),
|
|
703
734
|
role: z7.string(),
|
|
@@ -716,7 +747,9 @@ var EduBridgeEnrollment = z7.object({
|
|
|
716
747
|
school: z7.object({
|
|
717
748
|
id: z7.string(),
|
|
718
749
|
name: z7.string()
|
|
719
|
-
})
|
|
750
|
+
}),
|
|
751
|
+
testOutSupported: z7.boolean(),
|
|
752
|
+
testOutEligible: z7.boolean()
|
|
720
753
|
});
|
|
721
754
|
var SubjectMetrics = z7.object({
|
|
722
755
|
activityMetrics: z7.object({
|
|
@@ -785,18 +818,18 @@ var EdubridgeUsersListParams = z7.object({
|
|
|
785
818
|
orgSourcedIds: z7.array(NonEmptyString).optional()
|
|
786
819
|
});
|
|
787
820
|
var EdubridgeActivityParams = EmailOrStudentId.extend({
|
|
788
|
-
startDate:
|
|
789
|
-
endDate:
|
|
821
|
+
startDate: EdubridgeDateString,
|
|
822
|
+
endDate: EdubridgeDateString,
|
|
790
823
|
timezone: z7.string().optional()
|
|
791
824
|
});
|
|
792
825
|
var EdubridgeWeeklyFactsParams = EmailOrStudentId.extend({
|
|
793
|
-
weekDate:
|
|
826
|
+
weekDate: EdubridgeDateString,
|
|
794
827
|
timezone: z7.string().optional()
|
|
795
828
|
});
|
|
796
829
|
var EdubridgeEnrollmentFactsParams = z7.object({
|
|
797
830
|
enrollmentId: NonEmptyString,
|
|
798
|
-
startDate:
|
|
799
|
-
endDate:
|
|
831
|
+
startDate: EdubridgeDateString.optional(),
|
|
832
|
+
endDate: EdubridgeDateString.optional(),
|
|
800
833
|
timezone: z7.string().optional()
|
|
801
834
|
});
|
|
802
835
|
// ../../types/src/zod/masterytrack.ts
|
|
@@ -885,7 +918,42 @@ var Ref = z9.object({
|
|
|
885
918
|
type: z9.string().optional(),
|
|
886
919
|
href: z9.string().optional()
|
|
887
920
|
}).strict();
|
|
921
|
+
var GuidRefType = z9.enum([
|
|
922
|
+
"academicSession",
|
|
923
|
+
"assessmentLineItem",
|
|
924
|
+
"category",
|
|
925
|
+
"class",
|
|
926
|
+
"course",
|
|
927
|
+
"demographics",
|
|
928
|
+
"enrollment",
|
|
929
|
+
"gradingPeriod",
|
|
930
|
+
"lineItem",
|
|
931
|
+
"org",
|
|
932
|
+
"resource",
|
|
933
|
+
"result",
|
|
934
|
+
"scoreScale",
|
|
935
|
+
"student",
|
|
936
|
+
"teacher",
|
|
937
|
+
"term",
|
|
938
|
+
"user",
|
|
939
|
+
"componentResource",
|
|
940
|
+
"courseComponent"
|
|
941
|
+
]);
|
|
942
|
+
var GuidRef = z9.object({
|
|
943
|
+
sourcedId: NonEmptyString,
|
|
944
|
+
type: GuidRefType,
|
|
945
|
+
href: z9.url()
|
|
946
|
+
}).strict();
|
|
888
947
|
var OneRosterDateString = z9.union([IsoDateString, IsoDateTimeString]).transform((date) => date.includes("T") ? date : `${date}T00:00:00Z`);
|
|
948
|
+
var LearningObjectiveResult = z9.object({
|
|
949
|
+
learningObjectiveId: z9.string(),
|
|
950
|
+
score: z9.number().optional(),
|
|
951
|
+
textScore: z9.string().optional()
|
|
952
|
+
});
|
|
953
|
+
var LearningObjectiveScoreSetSchema = z9.array(z9.object({
|
|
954
|
+
source: z9.string(),
|
|
955
|
+
learningObjectiveResults: z9.array(LearningObjectiveResult)
|
|
956
|
+
}));
|
|
889
957
|
var OneRosterUserRoleInput = z9.object({
|
|
890
958
|
roleType: z9.enum(["primary", "secondary"]),
|
|
891
959
|
role: OneRosterUserRole,
|
|
@@ -898,35 +966,46 @@ var OneRosterUserRoleInput = z9.object({
|
|
|
898
966
|
var OneRosterUserCreateInput = z9.object({
|
|
899
967
|
sourcedId: NonEmptyString.describe("sourcedId must be a non-empty string"),
|
|
900
968
|
status: Status.optional(),
|
|
901
|
-
enabledUser: z9.
|
|
969
|
+
enabledUser: z9.union([
|
|
970
|
+
z9.boolean(),
|
|
971
|
+
z9.enum(["true", "false"]).transform((value) => value === "true")
|
|
972
|
+
]),
|
|
902
973
|
givenName: NonEmptyString.describe("givenName must be a non-empty string"),
|
|
903
974
|
familyName: NonEmptyString.describe("familyName must be a non-empty string"),
|
|
904
|
-
middleName: NonEmptyString.optional(),
|
|
905
|
-
|
|
975
|
+
middleName: NonEmptyString.nullable().optional(),
|
|
976
|
+
preferredFirstName: NonEmptyString.nullable().optional(),
|
|
977
|
+
preferredMiddleName: NonEmptyString.nullable().optional(),
|
|
978
|
+
preferredLastName: NonEmptyString.nullable().optional(),
|
|
979
|
+
username: NonEmptyString.nullable().optional(),
|
|
906
980
|
email: z9.email(),
|
|
981
|
+
userMasterIdentifier: z9.string().nullable().optional(),
|
|
907
982
|
roles: z9.array(OneRosterUserRoleInput).min(1, "roles must include at least one role"),
|
|
908
983
|
userIds: z9.array(z9.object({
|
|
909
984
|
type: NonEmptyString,
|
|
910
985
|
identifier: NonEmptyString
|
|
911
986
|
}).strict()).optional(),
|
|
912
987
|
agents: z9.array(Ref).optional(),
|
|
988
|
+
primaryOrg: Ref.optional(),
|
|
913
989
|
grades: z9.array(TimebackGrade).optional(),
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
password: NonEmptyString.optional(),
|
|
990
|
+
sms: NonEmptyString.nullable().optional(),
|
|
991
|
+
phone: NonEmptyString.nullable().optional(),
|
|
992
|
+
pronouns: NonEmptyString.nullable().optional(),
|
|
993
|
+
password: NonEmptyString.nullable().optional(),
|
|
919
994
|
metadata: Metadata
|
|
920
995
|
}).strict();
|
|
921
996
|
var OneRosterCourseCreateInput = z9.object({
|
|
922
997
|
sourcedId: NonEmptyString.describe("sourcedId must be a non-empty string").optional(),
|
|
923
|
-
status: Status
|
|
998
|
+
status: Status,
|
|
924
999
|
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
925
1000
|
org: Ref,
|
|
926
|
-
courseCode: NonEmptyString.optional(),
|
|
927
|
-
subjects: z9.array(TimebackSubject).optional(),
|
|
928
|
-
|
|
929
|
-
|
|
1001
|
+
courseCode: NonEmptyString.nullable().optional(),
|
|
1002
|
+
subjects: z9.array(TimebackSubject).nullable().optional(),
|
|
1003
|
+
subjectCodes: z9.array(z9.string()).nullable().optional(),
|
|
1004
|
+
grades: z9.array(TimebackGrade).nullable().optional(),
|
|
1005
|
+
level: NonEmptyString.nullable().optional(),
|
|
1006
|
+
academicSession: Ref.nullable().optional(),
|
|
1007
|
+
schoolYear: GuidRef.nullable().optional(),
|
|
1008
|
+
gradingScheme: NonEmptyString.nullable().optional(),
|
|
930
1009
|
metadata: Metadata
|
|
931
1010
|
}).strict();
|
|
932
1011
|
var OneRosterClassCreateInput = z9.object({
|
|
@@ -936,9 +1015,9 @@ var OneRosterClassCreateInput = z9.object({
|
|
|
936
1015
|
terms: z9.array(Ref).min(1, "terms must have at least one item"),
|
|
937
1016
|
course: Ref,
|
|
938
1017
|
org: Ref,
|
|
939
|
-
classCode: NonEmptyString.optional(),
|
|
1018
|
+
classCode: NonEmptyString.nullable().optional(),
|
|
940
1019
|
classType: z9.enum(["homeroom", "scheduled"]).optional(),
|
|
941
|
-
location: NonEmptyString.optional(),
|
|
1020
|
+
location: NonEmptyString.nullable().optional(),
|
|
942
1021
|
grades: z9.array(TimebackGrade).optional(),
|
|
943
1022
|
subjects: z9.array(TimebackSubject).optional(),
|
|
944
1023
|
subjectCodes: z9.array(NonEmptyString).optional(),
|
|
@@ -973,18 +1052,21 @@ var OneRosterLineItemCreateInput = z9.object({
|
|
|
973
1052
|
category: Ref,
|
|
974
1053
|
assignDate: OneRosterDateString,
|
|
975
1054
|
dueDate: OneRosterDateString,
|
|
976
|
-
status: Status,
|
|
977
|
-
description: z9.string().optional(),
|
|
1055
|
+
status: Status.optional(),
|
|
1056
|
+
description: z9.string().nullable().optional(),
|
|
978
1057
|
resultValueMin: z9.number().nullable().optional(),
|
|
979
1058
|
resultValueMax: z9.number().nullable().optional(),
|
|
980
|
-
|
|
1059
|
+
gradingPeriod: Ref.nullable().optional(),
|
|
1060
|
+
academicSession: Ref.nullable().optional(),
|
|
1061
|
+
scoreScale: Ref.nullable().optional(),
|
|
1062
|
+
learningObjectiveSet: LearningObjectiveSetSchema.nullable().optional(),
|
|
981
1063
|
metadata: Metadata
|
|
982
1064
|
}).strict();
|
|
983
1065
|
var OneRosterResultCreateInput = z9.object({
|
|
984
1066
|
sourcedId: NonEmptyString.optional(),
|
|
985
1067
|
lineItem: Ref,
|
|
986
1068
|
student: Ref,
|
|
987
|
-
class: Ref.optional(),
|
|
1069
|
+
class: Ref.nullable().optional(),
|
|
988
1070
|
scoreDate: OneRosterDateString,
|
|
989
1071
|
scoreStatus: z9.enum([
|
|
990
1072
|
"exempt",
|
|
@@ -996,14 +1078,20 @@ var OneRosterResultCreateInput = z9.object({
|
|
|
996
1078
|
score: z9.number().nullable().optional(),
|
|
997
1079
|
textScore: z9.string().nullable().optional(),
|
|
998
1080
|
status: Status,
|
|
1081
|
+
scoreScale: Ref.nullable().optional(),
|
|
999
1082
|
comment: z9.string().nullable().optional(),
|
|
1083
|
+
learningObjectiveSet: LearningObjectiveScoreSetSchema.nullable().optional(),
|
|
1084
|
+
inProgress: z9.string().optional(),
|
|
1085
|
+
incomplete: z9.string().optional(),
|
|
1086
|
+
late: z9.string().optional(),
|
|
1087
|
+
missing: z9.string().optional(),
|
|
1000
1088
|
metadata: Metadata
|
|
1001
1089
|
}).strict();
|
|
1002
1090
|
var OneRosterScoreScaleCreateInput = z9.object({
|
|
1003
1091
|
sourcedId: NonEmptyString.optional(),
|
|
1004
1092
|
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
1005
|
-
status: Status
|
|
1006
|
-
type:
|
|
1093
|
+
status: Status,
|
|
1094
|
+
type: NonEmptyString,
|
|
1007
1095
|
class: Ref,
|
|
1008
1096
|
course: Ref.nullable().optional(),
|
|
1009
1097
|
scoreScaleValue: z9.array(z9.object({
|
|
@@ -1012,13 +1100,11 @@ var OneRosterScoreScaleCreateInput = z9.object({
|
|
|
1012
1100
|
value: z9.string().optional(),
|
|
1013
1101
|
description: z9.string().optional()
|
|
1014
1102
|
}).strict()),
|
|
1015
|
-
minScore: z9.number().optional(),
|
|
1016
|
-
maxScore: z9.number().optional(),
|
|
1017
1103
|
metadata: Metadata
|
|
1018
1104
|
}).strict();
|
|
1019
1105
|
var OneRosterAssessmentLineItemCreateInput = z9.object({
|
|
1020
1106
|
sourcedId: NonEmptyString.optional(),
|
|
1021
|
-
status: Status
|
|
1107
|
+
status: Status,
|
|
1022
1108
|
dateLastModified: IsoDateTimeString.optional(),
|
|
1023
1109
|
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
1024
1110
|
description: z9.string().nullable().optional(),
|
|
@@ -1036,18 +1122,9 @@ var OneRosterAssessmentLineItemCreateInput = z9.object({
|
|
|
1036
1122
|
course: Ref.nullable().optional(),
|
|
1037
1123
|
metadata: Metadata
|
|
1038
1124
|
}).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
1125
|
var OneRosterAssessmentResultCreateInput = z9.object({
|
|
1049
1126
|
sourcedId: NonEmptyString.optional(),
|
|
1050
|
-
status: Status
|
|
1127
|
+
status: Status,
|
|
1051
1128
|
dateLastModified: IsoDateTimeString.optional(),
|
|
1052
1129
|
metadata: Metadata,
|
|
1053
1130
|
assessmentLineItem: Ref,
|
|
@@ -1076,7 +1153,7 @@ var OneRosterOrgCreateInput = z9.object({
|
|
|
1076
1153
|
status: Status.optional(),
|
|
1077
1154
|
name: NonEmptyString.describe("name must be a non-empty string"),
|
|
1078
1155
|
type: OrganizationType,
|
|
1079
|
-
identifier:
|
|
1156
|
+
identifier: z9.string().nullish(),
|
|
1080
1157
|
parent: Ref.optional(),
|
|
1081
1158
|
metadata: Metadata
|
|
1082
1159
|
}).strict();
|
|
@@ -1084,8 +1161,8 @@ var OneRosterSchoolCreateInput = z9.object({
|
|
|
1084
1161
|
sourcedId: NonEmptyString.optional(),
|
|
1085
1162
|
status: Status.optional(),
|
|
1086
1163
|
name: NonEmptyString.describe("name must be a non-empty string"),
|
|
1087
|
-
type: z9.literal("school").
|
|
1088
|
-
identifier:
|
|
1164
|
+
type: z9.literal("school").default("school"),
|
|
1165
|
+
identifier: z9.string().nullish(),
|
|
1089
1166
|
parent: Ref.optional(),
|
|
1090
1167
|
metadata: Metadata
|
|
1091
1168
|
}).strict();
|
|
@@ -1103,11 +1180,13 @@ var OneRosterAcademicSessionCreateInput = z9.object({
|
|
|
1103
1180
|
metadata: Metadata
|
|
1104
1181
|
}).strict();
|
|
1105
1182
|
var OneRosterComponentResourceCreateInput = z9.object({
|
|
1106
|
-
sourcedId: NonEmptyString
|
|
1183
|
+
sourcedId: NonEmptyString,
|
|
1107
1184
|
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
1108
1185
|
courseComponent: Ref,
|
|
1109
1186
|
resource: Ref,
|
|
1110
1187
|
status: Status,
|
|
1188
|
+
sortOrder: z9.number().optional(),
|
|
1189
|
+
lessonType: LessonType.optional(),
|
|
1111
1190
|
metadata: Metadata
|
|
1112
1191
|
}).strict();
|
|
1113
1192
|
var OneRosterCourseComponentCreateInput = z9.object({
|
|
@@ -1115,8 +1194,17 @@ var OneRosterCourseComponentCreateInput = z9.object({
|
|
|
1115
1194
|
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
1116
1195
|
course: Ref,
|
|
1117
1196
|
status: Status,
|
|
1197
|
+
sortOrder: z9.number().optional(),
|
|
1198
|
+
parent: Ref.nullable().optional(),
|
|
1199
|
+
courseComponent: Ref.nullable().optional(),
|
|
1200
|
+
prerequisites: z9.array(z9.string()).nullable().optional(),
|
|
1201
|
+
prerequisiteCriteria: z9.string().nullable().optional(),
|
|
1202
|
+
unlockDate: OneRosterDateString.nullable().optional(),
|
|
1118
1203
|
metadata: Metadata
|
|
1119
|
-
}).strict()
|
|
1204
|
+
}).strict().transform(({ courseComponent, parent, ...rest }) => ({
|
|
1205
|
+
...rest,
|
|
1206
|
+
parent: parent === undefined ? courseComponent ?? undefined : parent
|
|
1207
|
+
}));
|
|
1120
1208
|
var OneRosterEnrollInput = z9.object({
|
|
1121
1209
|
sourcedId: NonEmptyString.describe("sourcedId must be a non-empty string"),
|
|
1122
1210
|
role: z9.enum(["student", "teacher"]),
|
|
@@ -1136,8 +1224,23 @@ var OneRosterCredentialInput = z9.object({
|
|
|
1136
1224
|
})
|
|
1137
1225
|
}).strict();
|
|
1138
1226
|
var OneRosterDemographicsCreateInput = z9.object({
|
|
1139
|
-
sourcedId: NonEmptyString.describe("sourcedId must be a non-empty string")
|
|
1140
|
-
|
|
1227
|
+
sourcedId: NonEmptyString.describe("sourcedId must be a non-empty string"),
|
|
1228
|
+
status: Status.optional(),
|
|
1229
|
+
metadata: Metadata,
|
|
1230
|
+
birthDate: z9.string().regex(/^\d{4}-\d{2}-\d{2}$/).nullable().optional(),
|
|
1231
|
+
sex: z9.enum(["male", "female"]).nullable().optional(),
|
|
1232
|
+
americanIndianOrAlaskaNative: StringBoolean.nullable().optional(),
|
|
1233
|
+
asian: StringBoolean.nullable().optional(),
|
|
1234
|
+
blackOrAfricanAmerican: StringBoolean.nullable().optional(),
|
|
1235
|
+
nativeHawaiianOrOtherPacificIslander: StringBoolean.nullable().optional(),
|
|
1236
|
+
white: StringBoolean.nullable().optional(),
|
|
1237
|
+
demographicRaceTwoOrMoreRaces: StringBoolean.nullable().optional(),
|
|
1238
|
+
hispanicOrLatinoEthnicity: StringBoolean.nullable().optional(),
|
|
1239
|
+
countryOfBirthCode: z9.string().nullable().optional(),
|
|
1240
|
+
stateOfBirthAbbreviation: z9.string().nullable().optional(),
|
|
1241
|
+
cityOfBirth: z9.string().nullable().optional(),
|
|
1242
|
+
publicSchoolResidenceStatus: z9.string().nullable().optional()
|
|
1243
|
+
}).strict();
|
|
1141
1244
|
var CommonResourceMetadataSchema = z9.object({
|
|
1142
1245
|
type: ResourceType,
|
|
1143
1246
|
subject: TimebackSubject.nullish(),
|
|
@@ -1207,16 +1310,63 @@ var ResourceMetadataSchema = z9.discriminatedUnion("type", [
|
|
|
1207
1310
|
CourseMaterialMetadataSchema,
|
|
1208
1311
|
AssessmentBankMetadataSchema
|
|
1209
1312
|
]);
|
|
1313
|
+
var ReservedResourceMetadataKeys = new Set([
|
|
1314
|
+
"type",
|
|
1315
|
+
"subject",
|
|
1316
|
+
"grades",
|
|
1317
|
+
"language",
|
|
1318
|
+
"xp",
|
|
1319
|
+
"url",
|
|
1320
|
+
"keywords",
|
|
1321
|
+
"learningObjectiveSet",
|
|
1322
|
+
"lessonType",
|
|
1323
|
+
"subType",
|
|
1324
|
+
"questionType",
|
|
1325
|
+
"difficulty",
|
|
1326
|
+
"format",
|
|
1327
|
+
"author",
|
|
1328
|
+
"pageCount",
|
|
1329
|
+
"duration",
|
|
1330
|
+
"speaker",
|
|
1331
|
+
"captionsAvailable",
|
|
1332
|
+
"launchUrl",
|
|
1333
|
+
"toolProvider",
|
|
1334
|
+
"instructionalMethod",
|
|
1335
|
+
"courseIdOnFail",
|
|
1336
|
+
"resolution",
|
|
1337
|
+
"resources"
|
|
1338
|
+
]);
|
|
1339
|
+
var UntypedResourceMetadataSchema = z9.record(z9.string(), z9.unknown()).superRefine((metadata, ctx) => {
|
|
1340
|
+
if ("fail_fast" in metadata) {
|
|
1341
|
+
const result = FastFailConfigSchema.safeParse(metadata.fail_fast);
|
|
1342
|
+
if (!result.success) {
|
|
1343
|
+
for (const issue of result.error.issues) {
|
|
1344
|
+
ctx.addIssue({
|
|
1345
|
+
...issue,
|
|
1346
|
+
path: ["fail_fast", ...issue.path]
|
|
1347
|
+
});
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
const reservedKeys = Object.keys(metadata).filter((key) => ReservedResourceMetadataKeys.has(key));
|
|
1352
|
+
if (reservedKeys.length === 0) {
|
|
1353
|
+
return;
|
|
1354
|
+
}
|
|
1355
|
+
ctx.addIssue({
|
|
1356
|
+
code: "custom",
|
|
1357
|
+
message: `metadata keys ${reservedKeys.map((key) => `\`${key}\``).join(", ")} require a valid \`type\` discriminator`
|
|
1358
|
+
});
|
|
1359
|
+
});
|
|
1210
1360
|
var OneRosterResourceCreateInput = z9.object({
|
|
1211
1361
|
sourcedId: NonEmptyString.optional(),
|
|
1212
1362
|
title: NonEmptyString.describe("title must be a non-empty string"),
|
|
1213
1363
|
vendorResourceId: NonEmptyString.describe("vendorResourceId must be a non-empty string"),
|
|
1214
1364
|
roles: z9.array(z9.enum(["primary", "secondary"])).optional(),
|
|
1215
1365
|
importance: z9.enum(["primary", "secondary"]).optional(),
|
|
1216
|
-
vendorId:
|
|
1217
|
-
applicationId:
|
|
1366
|
+
vendorId: NonEmptyString.nullable().optional(),
|
|
1367
|
+
applicationId: NonEmptyString.nullable().optional(),
|
|
1218
1368
|
status: Status.optional(),
|
|
1219
|
-
metadata: ResourceMetadataSchema.nullable().optional()
|
|
1369
|
+
metadata: z9.union([ResourceMetadataSchema, UntypedResourceMetadataSchema]).nullable().optional()
|
|
1220
1370
|
}).strict();
|
|
1221
1371
|
var CourseStructureItem = z9.object({
|
|
1222
1372
|
url: NonEmptyString.describe("courseStructure.url must be a non-empty string"),
|
|
@@ -1511,6 +1661,18 @@ var PowerPathPlacementQueryParams = z10.object({
|
|
|
1511
1661
|
student: NonEmptyString,
|
|
1512
1662
|
subject: TimebackSubject
|
|
1513
1663
|
});
|
|
1664
|
+
var PowerPathMakeExternalStudentTestOutAssignmentInput = z10.object({
|
|
1665
|
+
oneRosterSourcedId: NonEmptyString,
|
|
1666
|
+
subject: NonEmptyString
|
|
1667
|
+
});
|
|
1668
|
+
var PowerPathRenderConfigUpsertInput = z10.object({
|
|
1669
|
+
courseIds: z10.array(NonEmptyString).min(1),
|
|
1670
|
+
rendererId: NonEmptyString,
|
|
1671
|
+
rendererUrl: z10.url(),
|
|
1672
|
+
rendererVersion: NonEmptyString.optional(),
|
|
1673
|
+
suppressFeedback: z10.boolean().optional(),
|
|
1674
|
+
suppressCorrectResponse: z10.boolean().optional()
|
|
1675
|
+
});
|
|
1514
1676
|
var PowerPathSyllabusQueryParams = z10.object({
|
|
1515
1677
|
status: z10.enum(["active", "tobedeleted"]).optional()
|
|
1516
1678
|
});
|
|
@@ -1775,6 +1937,23 @@ var QtiLessonFeedbackInput = z11.object({
|
|
|
1775
1937
|
lessonId: NonEmptyString,
|
|
1776
1938
|
humanApproved: z11.boolean().optional()
|
|
1777
1939
|
}).strict();
|
|
1940
|
+
// ../../types/src/zod/reporting.ts
|
|
1941
|
+
import { z as z12 } from "zod/v4";
|
|
1942
|
+
var ReportingAuthMode = z12.enum(["creator_only", "same_org", "all_orgs"]);
|
|
1943
|
+
var ReportingSavedQueryId = z12.string().uuid();
|
|
1944
|
+
var ReportingUserEmail = z12.email();
|
|
1945
|
+
var ReportingQueryInput = z12.object({
|
|
1946
|
+
sql: NonEmptyString
|
|
1947
|
+
});
|
|
1948
|
+
var PersistReportingQueryInput = z12.object({
|
|
1949
|
+
endpointName: NonEmptyString,
|
|
1950
|
+
sql: NonEmptyString,
|
|
1951
|
+
authMode: ReportingAuthMode,
|
|
1952
|
+
description: NonEmptyString.optional()
|
|
1953
|
+
});
|
|
1954
|
+
var RemoveReportingQueryInput = z12.object({
|
|
1955
|
+
endpointId: ReportingSavedQueryId
|
|
1956
|
+
});
|
|
1778
1957
|
// src/resources/webhooks.ts
|
|
1779
1958
|
class WebhooksResource {
|
|
1780
1959
|
transport;
|
package/package.json
CHANGED
package/dist/errors.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACN,QAAQ,IAAI,aAAa,EACzB,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,eAAe,GACf,MAAM,iCAAiC,CAAA"}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAMH,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AAEhD,YAAY,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AACtD,YAAY,EAAE,oBAAoB,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC9F,YAAY,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAMtE,YAAY,EACX,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,wBAAwB,GACxB,MAAM,qBAAqB,CAAA;AAE5B,YAAY,EACX,OAAO,EACP,aAAa,EACb,UAAU,EACV,eAAe,GACf,MAAM,oCAAoC,CAAA;AAM3C,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"public-types.d.ts","sourceRoot":"","sources":["../src/public-types.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAA;AAElD,YAAY,EACX,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,wBAAwB,GACxB,MAAM,qBAAqB,CAAA"}
|