@playcademy/sdk 0.17.1-beta.1 → 0.17.1-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/index.js +10 -1
- package/dist/internal.d.ts +5 -13
- package/dist/internal.js +11 -5
- package/dist/server/edge.js +1 -1
- package/dist/server.js +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3290,6 +3290,15 @@ function createTimebackNamespace(client) {
|
|
|
3290
3290
|
if (!Number.isFinite(input.xpAwarded) || input.xpAwarded < 0) {
|
|
3291
3291
|
throw new Error("xpAwarded must be a finite, non-negative number");
|
|
3292
3292
|
}
|
|
3293
|
+
if (input.masteredUnits !== undefined && input.masteredUnitsAbsolute !== undefined) {
|
|
3294
|
+
throw new Error("Provide either masteredUnits or masteredUnitsAbsolute, not both");
|
|
3295
|
+
}
|
|
3296
|
+
if (input.masteredUnits !== undefined && !Number.isFinite(input.masteredUnits)) {
|
|
3297
|
+
throw new Error("masteredUnits must be a finite number");
|
|
3298
|
+
}
|
|
3299
|
+
if (input.masteredUnitsAbsolute !== undefined && !Number.isInteger(input.masteredUnitsAbsolute)) {
|
|
3300
|
+
throw new Error("masteredUnitsAbsolute must be an integer");
|
|
3301
|
+
}
|
|
3293
3302
|
return client["requestGameBackend"](`${ASSESSMENTS_ROUTE}/${encodeURIComponent(attemptId)}/finalize`, "POST", input, undefined, { retryPolicy: ASSESSMENT_SUBMIT_RETRY_POLICY });
|
|
3294
3303
|
}
|
|
3295
3304
|
},
|
|
@@ -3697,7 +3706,7 @@ async function request({
|
|
|
3697
3706
|
return rawText && rawText.length > 0 ? rawText : undefined;
|
|
3698
3707
|
}
|
|
3699
3708
|
// src/version.ts
|
|
3700
|
-
var SDK_VERSION = "0.17.1-beta.
|
|
3709
|
+
var SDK_VERSION = "0.17.1-beta.3";
|
|
3701
3710
|
|
|
3702
3711
|
// src/clients/base.ts
|
|
3703
3712
|
class PlaycademyBaseClient {
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SchemaInfo } from '@playcademy/cloudflare';
|
|
2
2
|
import { GamePermission, AUTH_PROVIDER_IDS } from '@playcademy/constants';
|
|
3
3
|
import { TimebackGrade, TimebackSubject, ELevel, HeartbeatRequest, EndActivityRequest, EndActivityScoreData, EndActivityResponse, TimebackCourseConfig, CourseConfig, OrganizationConfig, ComponentConfig, ResourceConfig, ComponentResourceConfig } from '@playcademy/types/timeback';
|
|
4
|
-
export { AssessmentAttemptSnapshot, AssessmentFinalizeResult, AssessmentFlow, AssessmentItemSubmission, AssessmentResponseUpdate, AssessmentResponseValue, AssessmentResponses, AssessmentSaveResult, AssessmentScore, AssessmentStandardRef, AssessmentSubmitResult, ConventionalAssessmentAttemptSnapshot, ConventionalAssessmentSubmitResult, DiagnosticAssessmentItemReceipt, DiagnosticAssessmentSubmitResult, DiagnosticRoutingSnapshot, DiagnosticRoutingTrackSnapshot, ELevel, FinalizeAssessmentInput, PlatformRoutedDiagnosticAttemptSnapshot, PlatformRoutedDiagnosticSelectionContext, PlayableAssessment, PlayableAssessmentAttemptSnapshot, PlayableAssessmentChoice, PlayableAssessmentGraphic, PlayableAssessmentHotspot, PlayableAssessmentInteraction, PlayableAssessmentItem, PlayableContentNode, SaveAssessmentInput, SettledAssessmentAttemptSnapshot, StartAssessmentInput, StartDiagnosticAssessmentInput, SubmitAssessmentInput, SubmitAssessmentItemInput, SubmitAssessmentItemResult, SubmitDiagnosticAssessmentItemInput, SubmitDiagnosticAssessmentItemResult } from '@playcademy/types/timeback';
|
|
4
|
+
export { AssessmentAttemptSnapshot, AssessmentAwardRecord, AssessmentFinalizeResult, AssessmentFlow, AssessmentItemSubmission, AssessmentMasteryAward, AssessmentResponseUpdate, AssessmentResponseValue, AssessmentResponses, AssessmentSaveResult, AssessmentScore, AssessmentStandardRef, AssessmentSubmitResult, ConventionalAssessmentAttemptSnapshot, ConventionalAssessmentSubmitResult, DiagnosticAssessmentItemReceipt, DiagnosticAssessmentSubmitResult, DiagnosticRoutingSnapshot, DiagnosticRoutingTrackSnapshot, ELevel, FinalizeAssessmentInput, PlatformRoutedDiagnosticAttemptSnapshot, PlatformRoutedDiagnosticSelectionContext, PlayableAssessment, PlayableAssessmentAttemptSnapshot, PlayableAssessmentChoice, PlayableAssessmentGraphic, PlayableAssessmentHotspot, PlayableAssessmentInteraction, PlayableAssessmentItem, PlayableContentNode, SaveAssessmentInput, SettledAssessmentAttemptSnapshot, StartAssessmentInput, StartDiagnosticAssessmentInput, SubmitAssessmentInput, SubmitAssessmentItemInput, SubmitAssessmentItemResult, SubmitDiagnosticAssessmentItemInput, SubmitDiagnosticAssessmentItemResult } from '@playcademy/types/timeback';
|
|
5
5
|
import * as _playcademy_types from '@playcademy/types';
|
|
6
6
|
import { GameManifest, LocalDayContext } from '@playcademy/types';
|
|
7
7
|
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, LocalDayContext, LocalDaySource, ManifestV1, ManifestV2, ManifestVersions, PopulateStudentResponse, UserEnrollment, UserInfo, UserOrganization, UserRank, UserRankResponse, UserRoleEnumType, UserScore, UserTimebackData } from '@playcademy/types';
|
|
@@ -3659,11 +3659,6 @@ interface QtiLibraryQueryOptions {
|
|
|
3659
3659
|
page?: number;
|
|
3660
3660
|
limit?: number;
|
|
3661
3661
|
}
|
|
3662
|
-
interface ReviewMappingUpdateResult {
|
|
3663
|
-
itemCount: number;
|
|
3664
|
-
standardCount: number;
|
|
3665
|
-
sourceFingerprint: string;
|
|
3666
|
-
}
|
|
3667
3662
|
|
|
3668
3663
|
/**
|
|
3669
3664
|
* Internal Playcademy SDK client with all namespaces.
|
|
@@ -4027,21 +4022,18 @@ declare class PlaycademyInternalClient extends PlaycademyBaseClient {
|
|
|
4027
4022
|
create: (gameId: string, courseId: string, data: {
|
|
4028
4023
|
assessmentKey: string;
|
|
4029
4024
|
title: string;
|
|
4030
|
-
purpose: Exclude<_playcademy_types.AssessmentPurpose, 'diagnostic'>;
|
|
4025
|
+
purpose: Exclude<_playcademy_types.AssessmentPurpose, 'diagnostic' | 'review'>;
|
|
4031
4026
|
standard?: _playcademy_types.AssessmentStandardRef;
|
|
4032
4027
|
}) => Promise<_playcademy_types.AssessmentRow>;
|
|
4033
4028
|
attachExisting: (gameId: string, courseId: string, manifest: _playcademy_types.AssessmentAssociationImportManifest) => Promise<_playcademy_types.AssessmentAssociationImportResponse>;
|
|
4034
4029
|
update: (gameId: string, courseId: string, testIdentifier: string, data: {
|
|
4035
4030
|
title?: string;
|
|
4036
|
-
purpose?: _playcademy_types.AssessmentPurpose
|
|
4031
|
+
purpose?: Exclude<_playcademy_types.AssessmentPurpose, 'review'>;
|
|
4037
4032
|
standard?: _playcademy_types.AssessmentStandardRef;
|
|
4038
4033
|
diagnostic?: _playcademy_types.DiagnosticAssessmentDefinitionInput | null;
|
|
4039
4034
|
status?: _playcademy_types.AssessmentStatus;
|
|
4040
4035
|
}) => Promise<_playcademy_types.AssessmentRow>;
|
|
4041
|
-
|
|
4042
|
-
reorder: (gameId: string, courseId: string, purpose: _playcademy_types.AssessmentPurpose, testIdentifiers: string[]) => Promise<{
|
|
4043
|
-
success: boolean;
|
|
4044
|
-
}>;
|
|
4036
|
+
syncReviewBank: (gameId: string, courseId: string) => Promise<_playcademy_types.ReviewBankSynchronizationResult>;
|
|
4045
4037
|
remove: (gameId: string, courseId: string, testIdentifier: string) => Promise<{
|
|
4046
4038
|
action: 'discarded' | 'archived';
|
|
4047
4039
|
}>;
|
|
@@ -4049,7 +4041,7 @@ declare class PlaycademyInternalClient extends PlaycademyBaseClient {
|
|
|
4049
4041
|
copy: (gameId: string, courseId: string, data: {
|
|
4050
4042
|
testIdentifier: string;
|
|
4051
4043
|
assessmentKey: string;
|
|
4052
|
-
purpose: Exclude<_playcademy_types.AssessmentPurpose, 'diagnostic'>;
|
|
4044
|
+
purpose: Exclude<_playcademy_types.AssessmentPurpose, 'diagnostic' | 'review'>;
|
|
4053
4045
|
standard?: _playcademy_types.AssessmentStandardRef;
|
|
4054
4046
|
}) => Promise<_playcademy_types.AssessmentRow>;
|
|
4055
4047
|
listQuestions: (gameId: string, courseId: string, testIdentifier: string) => Promise<_playcademy_types.QtiTestQuestionsResponse>;
|
package/dist/internal.js
CHANGED
|
@@ -3290,6 +3290,15 @@ function createTimebackNamespace(client) {
|
|
|
3290
3290
|
if (!Number.isFinite(input.xpAwarded) || input.xpAwarded < 0) {
|
|
3291
3291
|
throw new Error("xpAwarded must be a finite, non-negative number");
|
|
3292
3292
|
}
|
|
3293
|
+
if (input.masteredUnits !== undefined && input.masteredUnitsAbsolute !== undefined) {
|
|
3294
|
+
throw new Error("Provide either masteredUnits or masteredUnitsAbsolute, not both");
|
|
3295
|
+
}
|
|
3296
|
+
if (input.masteredUnits !== undefined && !Number.isFinite(input.masteredUnits)) {
|
|
3297
|
+
throw new Error("masteredUnits must be a finite number");
|
|
3298
|
+
}
|
|
3299
|
+
if (input.masteredUnitsAbsolute !== undefined && !Number.isInteger(input.masteredUnitsAbsolute)) {
|
|
3300
|
+
throw new Error("masteredUnitsAbsolute must be an integer");
|
|
3301
|
+
}
|
|
3293
3302
|
return client["requestGameBackend"](`${ASSESSMENTS_ROUTE}/${encodeURIComponent(attemptId)}/finalize`, "POST", input, undefined, { retryPolicy: ASSESSMENT_SUBMIT_RETRY_POLICY });
|
|
3294
3303
|
}
|
|
3295
3304
|
},
|
|
@@ -4152,10 +4161,7 @@ function createAssessmentNamespace(client) {
|
|
|
4152
4161
|
update: (gameId, courseId, testIdentifier, data) => client["request"](assessmentPath(gameId, courseId, testIdentifier), "PATCH", {
|
|
4153
4162
|
body: data
|
|
4154
4163
|
}),
|
|
4155
|
-
|
|
4156
|
-
reorder: (gameId, courseId, purpose, testIdentifiers) => client["request"](assessmentPath(gameId, courseId, "order"), "PUT", {
|
|
4157
|
-
body: { purpose, testIdentifiers }
|
|
4158
|
-
}),
|
|
4164
|
+
syncReviewBank: (gameId, courseId) => client["request"](assessmentPath(gameId, courseId, "review-bank"), "POST"),
|
|
4159
4165
|
remove: (gameId, courseId, testIdentifier) => client["request"](assessmentPath(gameId, courseId, testIdentifier), "DELETE"),
|
|
4160
4166
|
listTestLibrary: (gameId, courseId, options = {}) => client["request"](`${assessmentPath(gameId, courseId, "test-library")}${buildQtiLibraryQueryString(options)}`, "GET"),
|
|
4161
4167
|
copy: (gameId, courseId, data) => client["request"](assessmentPath(gameId, courseId, "copies"), "POST", {
|
|
@@ -4592,7 +4598,7 @@ async function request({
|
|
|
4592
4598
|
return rawText && rawText.length > 0 ? rawText : undefined;
|
|
4593
4599
|
}
|
|
4594
4600
|
// src/version.ts
|
|
4595
|
-
var SDK_VERSION = "0.17.1-beta.
|
|
4601
|
+
var SDK_VERSION = "0.17.1-beta.3";
|
|
4596
4602
|
|
|
4597
4603
|
// src/clients/base.ts
|
|
4598
4604
|
class PlaycademyBaseClient {
|
package/dist/server/edge.js
CHANGED
package/dist/server.js
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as _playcademy_types from '@playcademy/types';
|
|
|
2
2
|
import { GameManifest, LocalDayContext } from '@playcademy/types';
|
|
3
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, LocalDayContext, LocalDaySource, 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, ELevel, EndActivityRequest, HeartbeatRequest, EndActivityScoreData, EndActivityResponse } from '@playcademy/types/timeback';
|
|
5
|
-
export { AssessmentAttemptSnapshot, AssessmentFinalizeResult, AssessmentFlow, AssessmentItemSubmission, AssessmentResponseUpdate, AssessmentResponseValue, AssessmentResponses, AssessmentSaveResult, AssessmentScore, AssessmentStandardRef, AssessmentSubmitResult, ConventionalAssessmentAttemptSnapshot, ConventionalAssessmentSubmitResult, DiagnosticAssessmentItemReceipt, DiagnosticAssessmentSubmitResult, DiagnosticRoutingSnapshot, DiagnosticRoutingTrackSnapshot, ELevel, FinalizeAssessmentInput, PlatformRoutedDiagnosticAttemptSnapshot, PlatformRoutedDiagnosticSelectionContext, PlayableAssessment, PlayableAssessmentAttemptSnapshot, PlayableAssessmentChoice, PlayableAssessmentGraphic, PlayableAssessmentHotspot, PlayableAssessmentInteraction, PlayableAssessmentItem, PlayableContentNode, SaveAssessmentInput, SettledAssessmentAttemptSnapshot, StartAssessmentInput, StartDiagnosticAssessmentInput, SubmitAssessmentInput, SubmitAssessmentItemInput, SubmitAssessmentItemResult, SubmitDiagnosticAssessmentItemInput, SubmitDiagnosticAssessmentItemResult } from '@playcademy/types/timeback';
|
|
5
|
+
export { AssessmentAttemptSnapshot, AssessmentAwardRecord, AssessmentFinalizeResult, AssessmentFlow, AssessmentItemSubmission, AssessmentMasteryAward, AssessmentResponseUpdate, AssessmentResponseValue, AssessmentResponses, AssessmentSaveResult, AssessmentScore, AssessmentStandardRef, AssessmentSubmitResult, ConventionalAssessmentAttemptSnapshot, ConventionalAssessmentSubmitResult, DiagnosticAssessmentItemReceipt, DiagnosticAssessmentSubmitResult, DiagnosticRoutingSnapshot, DiagnosticRoutingTrackSnapshot, ELevel, FinalizeAssessmentInput, PlatformRoutedDiagnosticAttemptSnapshot, PlatformRoutedDiagnosticSelectionContext, PlayableAssessment, PlayableAssessmentAttemptSnapshot, PlayableAssessmentChoice, PlayableAssessmentGraphic, PlayableAssessmentHotspot, PlayableAssessmentInteraction, PlayableAssessmentItem, PlayableContentNode, SaveAssessmentInput, SettledAssessmentAttemptSnapshot, StartAssessmentInput, StartDiagnosticAssessmentInput, SubmitAssessmentInput, SubmitAssessmentItemInput, SubmitAssessmentItemResult, SubmitDiagnosticAssessmentItemInput, SubmitDiagnosticAssessmentItemResult } from '@playcademy/types/timeback';
|
|
6
6
|
import { TimebackUserRole, UserEnrollment, UserOrganization, UserInfo } from '@playcademy/types/user';
|
|
7
7
|
import { GamePermission, AUTH_PROVIDER_IDS } from '@playcademy/constants';
|
|
8
8
|
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|