@playcademy/sdk 0.10.1-beta.1 → 0.10.1-beta.2

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/index.js CHANGED
@@ -1149,6 +1149,17 @@ var TIMEBACK_ROUTES = {
1149
1149
  HEARTBEAT: "/integrations/timeback/heartbeat",
1150
1150
  ADVANCE_COURSE: "/integrations/timeback/advance-course"
1151
1151
  };
1152
+ var TIMEBACK_GAME_METRIC_DECIMAL_PLACES = {
1153
+ xp: 1,
1154
+ mastery: 0,
1155
+ score: 2
1156
+ };
1157
+ var TIMEBACK_GAME_METRIC_COMPARISON_TOLERANCE = {
1158
+ xp: 0.5 / 10 ** TIMEBACK_GAME_METRIC_DECIMAL_PLACES.xp,
1159
+ mastery: 0,
1160
+ time: 60,
1161
+ score: 0.5 / 10 ** TIMEBACK_GAME_METRIC_DECIMAL_PLACES.score
1162
+ };
1152
1163
  // src/core/cache/ttl-cache.ts
1153
1164
  function createTTLCache(options) {
1154
1165
  const cache = new Map;
@@ -3,7 +3,7 @@ import { TimebackGrade, TimebackSubject, TimebackCourseConfig, CourseConfig, Org
3
3
  export { QtiTestQuestionRef, QtiTestQuestionsResponse } from '@playcademy/types/timeback';
4
4
  import * as _playcademy_types from '@playcademy/types';
5
5
  import { GameManifest } from '@playcademy/types';
6
- export { AuthenticatedUser, DeveloperStatusEnumType, DeveloperStatusResponse, DeveloperStatusValue, GameActivityMetrics, GameCourseMetrics, GameLeaderboardEntry, GameManifest, GameMetricsProxyResponse, GameMetricsResponse, GameMetricsUnsupportedReason, GamePlatform, GameTimebackIntegration, GameType, GameUser, LeaderboardEntry, LeaderboardOptions, LeaderboardTimeframe, ManifestV1, ManifestV2, ManifestVersions, PopulateStudentResponse, UserEnrollment, UserInfo, UserOrganization, UserRank, UserRankResponse, UserRoleEnumType, UserScore, UserTimebackData } from '@playcademy/types';
6
+ export { AuthenticatedUser, DeveloperStatusEnumType, DeveloperStatusResponse, DeveloperStatusValue, GameCourseMetrics, GameLeaderboardEntry, GameManifest, GameMetricComparisonKind, GameMetricComparisonMetric, GameMetricComparisonRow, GameMetricComparisonRowStatus, GameMetricsProxyResponse, GameMetricsResponse, GameMetricsUnsupportedReason, GamePlatform, GameRunMetrics, GameRunMetricsComparison, GameRunMetricsComparisonStatus, GameRunMetricsComparisonSummary, GameTimebackIntegration, GameType, GameUser, LeaderboardEntry, LeaderboardOptions, LeaderboardTimeframe, ManifestV1, ManifestV2, ManifestVersions, PopulateStudentResponse, UserEnrollment, UserInfo, UserOrganization, UserRank, UserRankResponse, UserRoleEnumType, UserScore, UserTimebackData } from '@playcademy/types';
7
7
  import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
8
8
  import { z } from 'zod';
9
9
  import { DomainValidationRecords } from '@playcademy/types/game';
@@ -3035,6 +3035,10 @@ declare class PlaycademyInternalClient extends PlaycademyBaseClient {
3035
3035
  gameId: string;
3036
3036
  courseId?: string;
3037
3037
  }) => Promise<_playcademy_types.TimebackStudentOverviewResponse>;
3038
+ getGameMetrics: (timebackId: string, options: {
3039
+ gameId: string;
3040
+ runIds?: string[];
3041
+ }) => Promise<_playcademy_types.GameMetricsProxyResponse>;
3038
3042
  getStudentActivity: (timebackId: string, courseId: string, options: {
3039
3043
  gameId: string;
3040
3044
  limit?: number;
package/dist/internal.js CHANGED
@@ -1149,6 +1149,17 @@ var TIMEBACK_ROUTES = {
1149
1149
  HEARTBEAT: "/integrations/timeback/heartbeat",
1150
1150
  ADVANCE_COURSE: "/integrations/timeback/advance-course"
1151
1151
  };
1152
+ var TIMEBACK_GAME_METRIC_DECIMAL_PLACES = {
1153
+ xp: 1,
1154
+ mastery: 0,
1155
+ score: 2
1156
+ };
1157
+ var TIMEBACK_GAME_METRIC_COMPARISON_TOLERANCE = {
1158
+ xp: 0.5 / 10 ** TIMEBACK_GAME_METRIC_DECIMAL_PLACES.xp,
1159
+ mastery: 0,
1160
+ time: 60,
1161
+ score: 0.5 / 10 ** TIMEBACK_GAME_METRIC_DECIMAL_PLACES.score
1162
+ };
1152
1163
  // src/core/cache/ttl-cache.ts
1153
1164
  function createTTLCache(options) {
1154
1165
  const cache = new Map;
@@ -2634,6 +2645,14 @@ function createTimebackNamespace2(client) {
2634
2645
  }
2635
2646
  return client["request"](`/timeback/student-overview/${timebackId}?${params}`, "GET");
2636
2647
  },
2648
+ getGameMetrics: (timebackId, options) => {
2649
+ const params = new URLSearchParams;
2650
+ for (const runId of options.runIds ?? []) {
2651
+ params.append("runId", runId);
2652
+ }
2653
+ const query = params.toString();
2654
+ return client["request"](`/timeback/game-metrics/${options.gameId}/${timebackId}${query ? `?${query}` : ""}`, "GET");
2655
+ },
2637
2656
  getStudentActivity: (timebackId, courseId, options) => {
2638
2657
  const params = new URLSearchParams({ gameId: options.gameId });
2639
2658
  if (options.limit !== undefined) {
package/dist/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _playcademy_types from '@playcademy/types';
2
2
  import { GameManifest } from '@playcademy/types';
3
- export { AuthenticatedUser, DeveloperStatusEnumType, DeveloperStatusResponse, DeveloperStatusValue, GameActivityMetrics, GameCourseMetrics, GameLeaderboardEntry, GameManifest, GameMetricsProxyResponse, GameMetricsResponse, GameMetricsUnsupportedReason, GamePlatform, GameTimebackIntegration, GameType, GameUser, LeaderboardEntry, LeaderboardOptions, LeaderboardTimeframe, ManifestV1, ManifestV2, ManifestVersions, PopulateStudentResponse, UserEnrollment, UserInfo, UserOrganization, UserRank, UserRankResponse, UserRoleEnumType, UserScore, UserTimebackData } from '@playcademy/types';
3
+ export { AuthenticatedUser, DeveloperStatusEnumType, DeveloperStatusResponse, DeveloperStatusValue, GameCourseMetrics, GameLeaderboardEntry, GameManifest, GameMetricComparisonKind, GameMetricComparisonMetric, GameMetricComparisonRow, GameMetricComparisonRowStatus, GameMetricsProxyResponse, GameMetricsResponse, GameMetricsUnsupportedReason, GamePlatform, GameRunMetrics, GameRunMetricsComparison, GameRunMetricsComparisonStatus, GameRunMetricsComparisonSummary, GameTimebackIntegration, GameType, GameUser, LeaderboardEntry, LeaderboardOptions, LeaderboardTimeframe, ManifestV1, ManifestV2, ManifestVersions, PopulateStudentResponse, UserEnrollment, UserInfo, UserOrganization, UserRank, UserRankResponse, UserRoleEnumType, UserScore, UserTimebackData } from '@playcademy/types';
4
4
  import { TimebackCourseConfig, CourseConfig, OrganizationConfig, ComponentConfig, ResourceConfig, ComponentResourceConfig, TimebackGrade, TimebackSubject } from '@playcademy/types/timeback';
5
5
  export { QtiTestQuestionRef, QtiTestQuestionsResponse } from '@playcademy/types/timeback';
6
6
  import { TimebackUserRole, UserEnrollment, UserOrganization, UserInfo } from '@playcademy/types/user';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playcademy/sdk",
3
- "version": "0.10.1-beta.1",
3
+ "version": "0.10.1-beta.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {