@playcademy/sdk 0.16.1-beta.8 → 0.17.0

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.
@@ -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 { ELevel } from '@playcademy/types/timeback';
4
+ export { AssessmentAttemptSnapshot, AssessmentFlow, AssessmentItemSubmission, AssessmentResponseUpdate, AssessmentResponseValue, AssessmentResponses, AssessmentSaveResult, AssessmentScore, AssessmentStandardRef, AssessmentSubmitResult, ConventionalAssessmentAttemptSnapshot, ConventionalAssessmentSubmitResult, DiagnosticAssessmentItemReceipt, DiagnosticAssessmentSubmitResult, DiagnosticRoutingSnapshot, DiagnosticRoutingTrackSnapshot, ELevel, PlatformRoutedDiagnosticAttemptSnapshot, PlatformRoutedDiagnosticSelectionContext, PlayableAssessment, PlayableAssessmentChoice, PlayableAssessmentGraphic, PlayableAssessmentHotspot, PlayableAssessmentInteraction, PlayableAssessmentItem, PlayableContentNode, SaveAssessmentInput, 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';
@@ -2977,6 +2977,15 @@ type EmbedActivity = EmbedActivityCompleted | EmbedActivityAbandoned | EmbedActi
2977
2977
  /** The child called `endActivity()` and its report was relayed. */
2978
2978
  interface EmbedActivityCompleted {
2979
2979
  status: 'completed';
2980
+ /**
2981
+ * The platform run this completion records under. One run ends in at
2982
+ * most one completion (the server dedupes on it), and a resumed launch
2983
+ * keeps the interrupted run's id — so this doubles as the completion's
2984
+ * attempt identity: feed it to whatever consumes the result and drop
2985
+ * anything you have seen before. Absent only for pure UX embeds
2986
+ * (launched without `timeback`), which record nothing.
2987
+ */
2988
+ runId?: string;
2980
2989
  /** Correct answers, from the child's report. */
2981
2990
  correct: number;
2982
2991
  /** Total questions, from the child's report. */
@@ -3005,6 +3014,12 @@ interface EmbedActivityCompleted {
3005
3014
  */
3006
3015
  interface EmbedActivityAbandoned {
3007
3016
  status: 'abandoned';
3017
+ /**
3018
+ * The platform run the launch was recording under, when one had
3019
+ * opened. Absent when the child never started an activity or the
3020
+ * launch was a pure UX embed.
3021
+ */
3022
+ runId?: string;
3008
3023
  timing: EmbedSessionTiming;
3009
3024
  /**
3010
3025
  * The final resume envelope, when the child checkpointed during the
@@ -3026,6 +3041,13 @@ interface EmbedActivityFailed {
3026
3041
  interface EmbedSession {
3027
3042
  /** The mounted child iframe. Useful for focus management. */
3028
3043
  readonly iframe: HTMLIFrameElement;
3044
+ /**
3045
+ * The platform run this launch records under, or null before the run
3046
+ * opens (the child's first activity) and for pure UX embeds. Stable
3047
+ * once set; also echoed on the finished record, which is where most
3048
+ * callers should read it.
3049
+ */
3050
+ readonly runId: string | null;
3029
3051
  /**
3030
3052
  * The latest resume envelope, live during play; null until the child
3031
3053
  * first checkpoints. Read it on your own cadence to persist
@@ -3467,6 +3489,19 @@ interface DashboardThemeConfig {
3467
3489
  /** Secondary/accent color as a hex string, e.g. '#ffd166' */
3468
3490
  secondary?: string;
3469
3491
  }
3492
+ /**
3493
+ * Child-catalog contract generation (see @playcademy/sdk/contracts).
3494
+ * The extractor is a repo-local script (run with the CLI's runtime) that
3495
+ * prints `{ generatedFrom, deliveries }` as JSON on stdout; the CLI
3496
+ * validates, stamps the contract fields, and writes
3497
+ * `.playcademy/catalog.json` deterministically. The document carries no
3498
+ * app identity — consuming repos assign the namespace key from sync
3499
+ * provenance.
3500
+ */
3501
+ interface CatalogConfig {
3502
+ /** Path to the extractor script, relative to the config file. */
3503
+ extractor: string;
3504
+ }
3470
3505
  /**
3471
3506
  * Unified Playcademy configuration
3472
3507
  * Used for playcademy.config.{js,json}
@@ -3499,6 +3534,8 @@ interface PlaycademyConfig {
3499
3534
  dashboard?: DashboardConfig | boolean;
3500
3535
  /** Integrations (database, custom routes, external services) */
3501
3536
  integrations?: IntegrationsConfig;
3537
+ /** Child-catalog contract generation (`playcademy catalog`) */
3538
+ catalog?: CatalogConfig;
3502
3539
  }
3503
3540
 
3504
3541
  /**
@@ -3622,6 +3659,11 @@ interface QtiLibraryQueryOptions {
3622
3659
  page?: number;
3623
3660
  limit?: number;
3624
3661
  }
3662
+ interface ReviewMappingUpdateResult {
3663
+ itemCount: number;
3664
+ standardCount: number;
3665
+ sourceFingerprint: string;
3666
+ }
3625
3667
 
3626
3668
  /**
3627
3669
  * Internal Playcademy SDK client with all namespaces.
@@ -3983,14 +4025,20 @@ declare class PlaycademyInternalClient extends PlaycademyBaseClient {
3983
4025
  assessments: {
3984
4026
  list: (gameId: string, courseId: string) => Promise<_playcademy_types.AssessmentSummary[]>;
3985
4027
  create: (gameId: string, courseId: string, data: {
4028
+ assessmentKey: string;
3986
4029
  title: string;
3987
- purpose: _playcademy_types.AssessmentPurpose;
4030
+ purpose: Exclude<_playcademy_types.AssessmentPurpose, 'diagnostic'>;
4031
+ standard?: _playcademy_types.AssessmentStandardRef;
3988
4032
  }) => Promise<_playcademy_types.AssessmentRow>;
4033
+ attachExisting: (gameId: string, courseId: string, manifest: _playcademy_types.AssessmentAssociationImportManifest) => Promise<_playcademy_types.AssessmentAssociationImportResponse>;
3989
4034
  update: (gameId: string, courseId: string, testIdentifier: string, data: {
3990
4035
  title?: string;
3991
4036
  purpose?: _playcademy_types.AssessmentPurpose;
4037
+ standard?: _playcademy_types.AssessmentStandardRef;
4038
+ diagnostic?: _playcademy_types.DiagnosticAssessmentDefinitionInput | null;
3992
4039
  status?: _playcademy_types.AssessmentStatus;
3993
4040
  }) => Promise<_playcademy_types.AssessmentRow>;
4041
+ updateReviewMapping: (gameId: string, courseId: string, testIdentifier: string) => Promise<ReviewMappingUpdateResult>;
3994
4042
  reorder: (gameId: string, courseId: string, purpose: _playcademy_types.AssessmentPurpose, testIdentifiers: string[]) => Promise<{
3995
4043
  success: boolean;
3996
4044
  }>;
@@ -3998,7 +4046,12 @@ declare class PlaycademyInternalClient extends PlaycademyBaseClient {
3998
4046
  action: 'discarded' | 'archived';
3999
4047
  }>;
4000
4048
  listTestLibrary: (gameId: string, courseId: string, options?: QtiLibraryQueryOptions) => Promise<_playcademy_types.QtiAssessmentTestListResponse>;
4001
- copy: (gameId: string, courseId: string, testIdentifier: string, purpose: _playcademy_types.AssessmentPurpose) => Promise<_playcademy_types.AssessmentRow>;
4049
+ copy: (gameId: string, courseId: string, data: {
4050
+ testIdentifier: string;
4051
+ assessmentKey: string;
4052
+ purpose: Exclude<_playcademy_types.AssessmentPurpose, 'diagnostic'>;
4053
+ standard?: _playcademy_types.AssessmentStandardRef;
4054
+ }) => Promise<_playcademy_types.AssessmentRow>;
4002
4055
  listQuestions: (gameId: string, courseId: string, testIdentifier: string) => Promise<_playcademy_types.QtiTestQuestionsResponse>;
4003
4056
  listQuestionLibrary: (gameId: string, courseId: string, options?: QtiLibraryQueryOptions) => Promise<_playcademy_types.QtiAssessmentItemListResponse>;
4004
4057
  createQuestion: (gameId: string, courseId: string, testIdentifier: string, data: _playcademy_types.QtiQuestionCreateInput) => Promise<_playcademy_types.QtiTestQuestionRef>;
@@ -4014,6 +4067,9 @@ declare class PlaycademyInternalClient extends PlaycademyBaseClient {
4014
4067
  success: boolean;
4015
4068
  }>;
4016
4069
  };
4070
+ assessmentAssets: {
4071
+ upload: (body: Uint8Array, sha256: string) => Promise<_playcademy_types.AssessmentAssetUploadResponse>;
4072
+ };
4017
4073
  };
4018
4074
  /** Auto-initializes a PlaycademyInternalClient with context from the environment */
4019
4075
  static init: typeof init;