@playcademy/sdk 0.3.6-beta.1 → 0.3.6-beta.3
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/internal.d.ts +116 -0
- package/dist/internal.js +32 -0
- package/package.json +1 -1
package/dist/internal.d.ts
CHANGED
|
@@ -872,6 +872,106 @@ interface EndActivityResponse {
|
|
|
872
872
|
scoreStatus?: string;
|
|
873
873
|
inProgress?: string;
|
|
874
874
|
}
|
|
875
|
+
interface TimebackRosterStudent {
|
|
876
|
+
studentId: string;
|
|
877
|
+
enrollmentId: string | null;
|
|
878
|
+
classId: string | null;
|
|
879
|
+
className: string | null;
|
|
880
|
+
name: string;
|
|
881
|
+
email: string | null;
|
|
882
|
+
analyticsUnavailable: boolean;
|
|
883
|
+
totalXp: number;
|
|
884
|
+
todayXp: number;
|
|
885
|
+
activeTimeSeconds: number;
|
|
886
|
+
masteredUnits: number;
|
|
887
|
+
masterableUnits?: number;
|
|
888
|
+
pctCompleteApp?: number;
|
|
889
|
+
}
|
|
890
|
+
interface TimebackRosterResponse {
|
|
891
|
+
gameId: string;
|
|
892
|
+
courseId: string;
|
|
893
|
+
students: TimebackRosterStudent[];
|
|
894
|
+
}
|
|
895
|
+
interface TimebackStudentHistoryPoint {
|
|
896
|
+
date: string;
|
|
897
|
+
xpEarned: number;
|
|
898
|
+
activeTimeSeconds: number;
|
|
899
|
+
masteredUnits: number;
|
|
900
|
+
}
|
|
901
|
+
type CourseCompletionStatus = 'none' | 'complete' | 'incomplete';
|
|
902
|
+
interface TimebackStudentCourseOverview {
|
|
903
|
+
courseId: string;
|
|
904
|
+
title: string;
|
|
905
|
+
grade: number;
|
|
906
|
+
subject: string;
|
|
907
|
+
enrollmentId: string | null;
|
|
908
|
+
analyticsUnavailable: boolean;
|
|
909
|
+
totalXp: number;
|
|
910
|
+
todayXp: number;
|
|
911
|
+
activeTimeSeconds: number;
|
|
912
|
+
masteredUnits: number;
|
|
913
|
+
masterableUnits?: number;
|
|
914
|
+
pctCompleteApp?: number;
|
|
915
|
+
completionStatus: CourseCompletionStatus;
|
|
916
|
+
history: TimebackStudentHistoryPoint[];
|
|
917
|
+
}
|
|
918
|
+
type TimebackRecentActivityKind = 'activity' | 'time-spent' | 'remediation-xp' | 'remediation-time' | 'remediation-mastery' | 'course-completed' | 'course-resumed';
|
|
919
|
+
interface TimebackRecentActivity {
|
|
920
|
+
id: string;
|
|
921
|
+
kind: TimebackRecentActivityKind;
|
|
922
|
+
occurredAt: string;
|
|
923
|
+
courseId: string;
|
|
924
|
+
title: string;
|
|
925
|
+
activityId?: string;
|
|
926
|
+
appName?: string;
|
|
927
|
+
reason?: string;
|
|
928
|
+
score?: number;
|
|
929
|
+
xpDelta?: number;
|
|
930
|
+
timeDeltaSeconds?: number;
|
|
931
|
+
masteredUnitsDelta?: number;
|
|
932
|
+
}
|
|
933
|
+
interface TimebackStudentOverviewResponse {
|
|
934
|
+
student: {
|
|
935
|
+
studentId: string;
|
|
936
|
+
name: string;
|
|
937
|
+
email: string | null;
|
|
938
|
+
};
|
|
939
|
+
courses: TimebackStudentCourseOverview[];
|
|
940
|
+
}
|
|
941
|
+
interface TimebackStudentActivityResponse {
|
|
942
|
+
activities: TimebackRecentActivity[];
|
|
943
|
+
hasMore: boolean;
|
|
944
|
+
}
|
|
945
|
+
interface GrantTimebackXpRequest {
|
|
946
|
+
gameId: string;
|
|
947
|
+
courseId: string;
|
|
948
|
+
studentId: string;
|
|
949
|
+
xp: number;
|
|
950
|
+
reason: string;
|
|
951
|
+
}
|
|
952
|
+
interface AdjustTimebackTimeRequest {
|
|
953
|
+
gameId: string;
|
|
954
|
+
courseId: string;
|
|
955
|
+
studentId: string;
|
|
956
|
+
seconds: number;
|
|
957
|
+
reason: string;
|
|
958
|
+
}
|
|
959
|
+
interface AdjustTimebackMasteryRequest {
|
|
960
|
+
gameId: string;
|
|
961
|
+
courseId: string;
|
|
962
|
+
studentId: string;
|
|
963
|
+
units: number;
|
|
964
|
+
reason: string;
|
|
965
|
+
}
|
|
966
|
+
interface ToggleCourseCompletionRequest {
|
|
967
|
+
gameId: string;
|
|
968
|
+
courseId: string;
|
|
969
|
+
studentId: string;
|
|
970
|
+
action: 'complete' | 'resume';
|
|
971
|
+
}
|
|
972
|
+
interface TimebackAdminMutationResponse {
|
|
973
|
+
status: 'ok';
|
|
974
|
+
}
|
|
875
975
|
|
|
876
976
|
/**
|
|
877
977
|
* Inventory & Shop Types
|
|
@@ -7660,6 +7760,22 @@ declare class PlaycademyInternalClient extends PlaycademyBaseClient {
|
|
|
7660
7760
|
get: (timebackId: string, options?: TTLCacheConfig | undefined) => Promise<PlatformTimebackUserContext>;
|
|
7661
7761
|
clearCache: (timebackId?: string | undefined) => void;
|
|
7662
7762
|
};
|
|
7763
|
+
admin: {
|
|
7764
|
+
getRoster: (gameId: string, courseId: string) => Promise<TimebackRosterResponse>;
|
|
7765
|
+
getStudentOverview: (timebackId: string, options: {
|
|
7766
|
+
gameId: string;
|
|
7767
|
+
courseId?: string | undefined;
|
|
7768
|
+
}) => Promise<TimebackStudentOverviewResponse>;
|
|
7769
|
+
getStudentActivity: (timebackId: string, courseId: string, options: {
|
|
7770
|
+
gameId: string;
|
|
7771
|
+
limit?: number | undefined;
|
|
7772
|
+
offset?: number | undefined;
|
|
7773
|
+
}) => Promise<TimebackStudentActivityResponse>;
|
|
7774
|
+
grantXp: (request: GrantTimebackXpRequest) => Promise<TimebackAdminMutationResponse>;
|
|
7775
|
+
adjustTime: (request: AdjustTimebackTimeRequest) => Promise<TimebackAdminMutationResponse>;
|
|
7776
|
+
adjustMastery: (request: AdjustTimebackMasteryRequest) => Promise<TimebackAdminMutationResponse>;
|
|
7777
|
+
toggleCompletion: (request: ToggleCourseCompletionRequest) => Promise<TimebackAdminMutationResponse>;
|
|
7778
|
+
};
|
|
7663
7779
|
};
|
|
7664
7780
|
/** Auto-initializes a PlaycademyInternalClient with context from the environment */
|
|
7665
7781
|
static init: typeof init;
|
package/dist/internal.js
CHANGED
|
@@ -2766,6 +2766,38 @@ function createTimebackNamespace2(client) {
|
|
|
2766
2766
|
clearCache: (timebackId) => {
|
|
2767
2767
|
studentCache.clear(timebackId);
|
|
2768
2768
|
}
|
|
2769
|
+
},
|
|
2770
|
+
admin: {
|
|
2771
|
+
getRoster: (gameId, courseId) => client["request"](`/timeback/roster/${gameId}/${courseId}`, "GET"),
|
|
2772
|
+
getStudentOverview: (timebackId, options) => {
|
|
2773
|
+
const params = new URLSearchParams({ gameId: options.gameId });
|
|
2774
|
+
if (options.courseId) {
|
|
2775
|
+
params.set("courseId", options.courseId);
|
|
2776
|
+
}
|
|
2777
|
+
return client["request"](`/timeback/student-overview/${timebackId}?${params}`, "GET");
|
|
2778
|
+
},
|
|
2779
|
+
getStudentActivity: (timebackId, courseId, options) => {
|
|
2780
|
+
const params = new URLSearchParams({ gameId: options.gameId });
|
|
2781
|
+
if (options.limit !== undefined) {
|
|
2782
|
+
params.set("limit", String(options.limit));
|
|
2783
|
+
}
|
|
2784
|
+
if (options.offset !== undefined) {
|
|
2785
|
+
params.set("offset", String(options.offset));
|
|
2786
|
+
}
|
|
2787
|
+
return client["request"](`/timeback/student-activity/${timebackId}/${courseId}?${params}`, "GET");
|
|
2788
|
+
},
|
|
2789
|
+
grantXp: (request2) => client["request"]("/timeback/grant-xp", "POST", {
|
|
2790
|
+
body: request2
|
|
2791
|
+
}),
|
|
2792
|
+
adjustTime: (request2) => client["request"]("/timeback/adjust-time", "POST", {
|
|
2793
|
+
body: request2
|
|
2794
|
+
}),
|
|
2795
|
+
adjustMastery: (request2) => client["request"]("/timeback/adjust-mastery", "POST", {
|
|
2796
|
+
body: request2
|
|
2797
|
+
}),
|
|
2798
|
+
toggleCompletion: (request2) => client["request"]("/timeback/toggle-completion", "POST", {
|
|
2799
|
+
body: request2
|
|
2800
|
+
})
|
|
2769
2801
|
}
|
|
2770
2802
|
};
|
|
2771
2803
|
}
|