@playcademy/sandbox 0.10.1-beta.5 → 0.10.1-beta.7
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/cli.js +46 -11
- package/dist/server.js +46 -11
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1128,7 +1128,7 @@ var package_default;
|
|
|
1128
1128
|
var init_package = __esm(() => {
|
|
1129
1129
|
package_default = {
|
|
1130
1130
|
name: "@playcademy/sandbox",
|
|
1131
|
-
version: "0.10.1-beta.
|
|
1131
|
+
version: "0.10.1-beta.7",
|
|
1132
1132
|
description: "Local development server for Playcademy game development",
|
|
1133
1133
|
type: "module",
|
|
1134
1134
|
exports: {
|
|
@@ -47590,7 +47590,7 @@ var init_emoji = __esm(() => {
|
|
|
47590
47590
|
function requestsBinding(binding) {
|
|
47591
47591
|
return binding === true || Array.isArray(binding) && binding.length > 0;
|
|
47592
47592
|
}
|
|
47593
|
-
var HttpUrlSchema, GameEmojiSchema, GamePermissionsSchema, GameMetadataRecordSchema, InsertGameSchema, UpdateGameSchema, InsertGameDeploymentSchema, InsertGameDeployJobSchema, InsertGameDeploymentStateSchema, UpsertGameMetadataSchema, PatchGameMetadataSchema, AddGameMemberSchema, UpdateGameMemberRoleSchema, AddGameDashboardUserSchema, VerifyGameDashboardLoginSchema, AcceptGameDashboardInviteSchema, AcceptGameDashboardResetSchema, ALLOWED_UPLOAD_EXTENSIONS, InitiateUploadSchema, AddCustomHostnameSchema, SetSecretsRequestSchema, SecretsDiffRequestSchema, SeedRequestSchema, SchemaInfoSchema, VerifyTokenSchema, KVSeedRequestSchema, DeployMigrationSchema, DeployDatabaseSchema, DatabaseResetDatabaseSchema, DatabaseResetRequestSchema, BaselineEvidenceSchema, DeployBaselineSchema, DeploymentStateBaselineSchema, MigrationRealignSchema, MigrationResolveSchema, DatabaseRestoreSchema, DeployBlockedReportSchema, DeployRequestSchema;
|
|
47593
|
+
var HttpUrlSchema, GameEmojiSchema, GamePermissionsSchema, GameMetadataRecordSchema, InsertGameSchema, UpdateGameSchema, InsertGameDeploymentSchema, InsertGameDeployJobSchema, InsertGameDeploymentStateSchema, UpsertGameMetadataSchema, PatchGameMetadataSchema, AddGameMemberSchema, UpdateGameMemberRoleSchema, AddGameDashboardUserSchema, VerifyGameDashboardLoginSchema, AcceptGameDashboardInviteSchema, AcceptGameDashboardResetSchema, ALLOWED_UPLOAD_EXTENSIONS, InitiateUploadSchema, AddCustomHostnameSchema, SetSecretsRequestSchema, SecretsDiffRequestSchema, SeedRequestSchema, SchemaInfoSchema, VerifyTokenSchema, KVSeedRequestSchema, DeployMigrationSchema, DeployDatabaseSchema, DatabaseResetDatabaseSchema, DatabaseResetRequestSchema, BaselineEvidenceSchema, DeployBaselineSchema, DeploySourceSchema, DeploymentStateBaselineSchema, MigrationRealignSchema, MigrationResolveSchema, DatabaseRestoreSchema, DeployBlockedReportSchema, DeployRequestSchema;
|
|
47594
47594
|
var init_schemas2 = __esm(() => {
|
|
47595
47595
|
init_drizzle_zod();
|
|
47596
47596
|
init_esm();
|
|
@@ -47836,6 +47836,19 @@ var init_schemas2 = __esm(() => {
|
|
|
47836
47836
|
message: "A baseline must claim something — migration history, a schema snapshot, or artifact hashes",
|
|
47837
47837
|
path: ["lastAppliedMigrationTag"]
|
|
47838
47838
|
});
|
|
47839
|
+
DeploySourceSchema = exports_external.object({
|
|
47840
|
+
repository: exports_external.string().url().nullable().transform((value) => {
|
|
47841
|
+
if (value === null) {
|
|
47842
|
+
return null;
|
|
47843
|
+
}
|
|
47844
|
+
const url = new URL(value);
|
|
47845
|
+
return url.username || url.password || url.search || url.hash ? null : value;
|
|
47846
|
+
}),
|
|
47847
|
+
commit: exports_external.string().regex(/^[0-9a-f]{40}$/, "commit must be a full 40-character lowercase SHA").nullable(),
|
|
47848
|
+
branch: exports_external.string().min(1).nullable(),
|
|
47849
|
+
dirty: exports_external.boolean(),
|
|
47850
|
+
externalBuild: exports_external.boolean().default(false)
|
|
47851
|
+
});
|
|
47839
47852
|
DeploymentStateBaselineSchema = exports_external.object({
|
|
47840
47853
|
lastAppliedMigrationTag: exports_external.string().min(1).optional(),
|
|
47841
47854
|
journal: exports_external.array(exports_external.object({
|
|
@@ -47907,6 +47920,7 @@ var init_schemas2 = __esm(() => {
|
|
|
47907
47920
|
buildHash: exports_external.string().min(1).optional(),
|
|
47908
47921
|
integrationsHash: exports_external.string().min(1).optional(),
|
|
47909
47922
|
pruneSecrets: exports_external.array(exports_external.string().min(1)).optional(),
|
|
47923
|
+
source: DeploySourceSchema.optional(),
|
|
47910
47924
|
metadata: exports_external.object({
|
|
47911
47925
|
displayName: exports_external.string().optional(),
|
|
47912
47926
|
description: exports_external.string().optional(),
|
|
@@ -94028,8 +94042,20 @@ function compareEnrollmentsByRecency(a, b) {
|
|
|
94028
94042
|
}
|
|
94029
94043
|
return (b.dateLastModified ?? "").localeCompare(a.dateLastModified ?? "");
|
|
94030
94044
|
}
|
|
94045
|
+
function resolvePrimaryAccountRole(roles2) {
|
|
94046
|
+
if (!roles2?.length) {
|
|
94047
|
+
return null;
|
|
94048
|
+
}
|
|
94049
|
+
return ACCOUNT_ROLE_PRECEDENCE.find((role) => roles2.some((entry) => entry.role === role)) ?? null;
|
|
94050
|
+
}
|
|
94051
|
+
var ACCOUNT_ROLE_PRECEDENCE;
|
|
94031
94052
|
var init_timeback_admin_util = __esm(() => {
|
|
94032
94053
|
init_errors2();
|
|
94054
|
+
ACCOUNT_ROLE_PRECEDENCE = [
|
|
94055
|
+
"administrator",
|
|
94056
|
+
"teacher",
|
|
94057
|
+
"student"
|
|
94058
|
+
];
|
|
94033
94059
|
});
|
|
94034
94060
|
|
|
94035
94061
|
// ../api-core/src/utils/timeback-discrepancy-queue.util.ts
|
|
@@ -98739,6 +98765,7 @@ class TimebackAdminService {
|
|
|
98739
98765
|
className: rosterEntry.class?.title || null,
|
|
98740
98766
|
name: name3,
|
|
98741
98767
|
email: rosterEntry.user?.email || null,
|
|
98768
|
+
primaryRole: resolvePrimaryAccountRole(rosterEntry.user?.roles),
|
|
98742
98769
|
analyticsUnavailable,
|
|
98743
98770
|
totalXp: summary?.totalXp ?? 0,
|
|
98744
98771
|
todayXp: summary?.todayXp ?? 0,
|
|
@@ -99702,15 +99729,22 @@ class TimebackAdminService {
|
|
|
99702
99729
|
});
|
|
99703
99730
|
pastEnrollmentsByStudent.set(studentId, list);
|
|
99704
99731
|
}
|
|
99705
|
-
const students = allUsers.
|
|
99732
|
+
const students = allUsers.flatMap((entry) => {
|
|
99733
|
+
const primaryRole = resolvePrimaryAccountRole(entry.roles);
|
|
99734
|
+
if (!entry.sourcedId || !primaryRole) {
|
|
99735
|
+
return [];
|
|
99736
|
+
}
|
|
99706
99737
|
const past = pastEnrollmentsByStudent.get(entry.sourcedId) ?? [];
|
|
99707
|
-
return
|
|
99708
|
-
|
|
99709
|
-
|
|
99710
|
-
|
|
99711
|
-
|
|
99712
|
-
|
|
99713
|
-
|
|
99738
|
+
return [
|
|
99739
|
+
{
|
|
99740
|
+
studentId: entry.sourcedId,
|
|
99741
|
+
name: `${entry.givenName || ""} ${entry.familyName || ""}`.trim() || "No name specified",
|
|
99742
|
+
email: entry.email || null,
|
|
99743
|
+
primaryRole,
|
|
99744
|
+
alreadyEnrolled: enrolledStudentIds.has(entry.sourcedId),
|
|
99745
|
+
...past.length > 0 ? { pastEnrollments: past } : {}
|
|
99746
|
+
}
|
|
99747
|
+
];
|
|
99714
99748
|
});
|
|
99715
99749
|
setAttribute("app.timeback.result_count", students.length);
|
|
99716
99750
|
return { students };
|
|
@@ -169226,7 +169260,8 @@ var init_deploy = __esm(async () => {
|
|
|
169226
169260
|
config: body2.config,
|
|
169227
169261
|
bindings: body2.bindings,
|
|
169228
169262
|
schema: body2.schema,
|
|
169229
|
-
metadata: body2.metadata
|
|
169263
|
+
metadata: body2.metadata,
|
|
169264
|
+
source: body2.source
|
|
169230
169265
|
},
|
|
169231
169266
|
events,
|
|
169232
169267
|
result: {
|
package/dist/server.js
CHANGED
|
@@ -1127,7 +1127,7 @@ var package_default;
|
|
|
1127
1127
|
var init_package = __esm(() => {
|
|
1128
1128
|
package_default = {
|
|
1129
1129
|
name: "@playcademy/sandbox",
|
|
1130
|
-
version: "0.10.1-beta.
|
|
1130
|
+
version: "0.10.1-beta.7",
|
|
1131
1131
|
description: "Local development server for Playcademy game development",
|
|
1132
1132
|
type: "module",
|
|
1133
1133
|
exports: {
|
|
@@ -47589,7 +47589,7 @@ var init_emoji = __esm(() => {
|
|
|
47589
47589
|
function requestsBinding(binding) {
|
|
47590
47590
|
return binding === true || Array.isArray(binding) && binding.length > 0;
|
|
47591
47591
|
}
|
|
47592
|
-
var HttpUrlSchema, GameEmojiSchema, GamePermissionsSchema, GameMetadataRecordSchema, InsertGameSchema, UpdateGameSchema, InsertGameDeploymentSchema, InsertGameDeployJobSchema, InsertGameDeploymentStateSchema, UpsertGameMetadataSchema, PatchGameMetadataSchema, AddGameMemberSchema, UpdateGameMemberRoleSchema, AddGameDashboardUserSchema, VerifyGameDashboardLoginSchema, AcceptGameDashboardInviteSchema, AcceptGameDashboardResetSchema, ALLOWED_UPLOAD_EXTENSIONS, InitiateUploadSchema, AddCustomHostnameSchema, SetSecretsRequestSchema, SecretsDiffRequestSchema, SeedRequestSchema, SchemaInfoSchema, VerifyTokenSchema, KVSeedRequestSchema, DeployMigrationSchema, DeployDatabaseSchema, DatabaseResetDatabaseSchema, DatabaseResetRequestSchema, BaselineEvidenceSchema, DeployBaselineSchema, DeploymentStateBaselineSchema, MigrationRealignSchema, MigrationResolveSchema, DatabaseRestoreSchema, DeployBlockedReportSchema, DeployRequestSchema;
|
|
47592
|
+
var HttpUrlSchema, GameEmojiSchema, GamePermissionsSchema, GameMetadataRecordSchema, InsertGameSchema, UpdateGameSchema, InsertGameDeploymentSchema, InsertGameDeployJobSchema, InsertGameDeploymentStateSchema, UpsertGameMetadataSchema, PatchGameMetadataSchema, AddGameMemberSchema, UpdateGameMemberRoleSchema, AddGameDashboardUserSchema, VerifyGameDashboardLoginSchema, AcceptGameDashboardInviteSchema, AcceptGameDashboardResetSchema, ALLOWED_UPLOAD_EXTENSIONS, InitiateUploadSchema, AddCustomHostnameSchema, SetSecretsRequestSchema, SecretsDiffRequestSchema, SeedRequestSchema, SchemaInfoSchema, VerifyTokenSchema, KVSeedRequestSchema, DeployMigrationSchema, DeployDatabaseSchema, DatabaseResetDatabaseSchema, DatabaseResetRequestSchema, BaselineEvidenceSchema, DeployBaselineSchema, DeploySourceSchema, DeploymentStateBaselineSchema, MigrationRealignSchema, MigrationResolveSchema, DatabaseRestoreSchema, DeployBlockedReportSchema, DeployRequestSchema;
|
|
47593
47593
|
var init_schemas2 = __esm(() => {
|
|
47594
47594
|
init_drizzle_zod();
|
|
47595
47595
|
init_esm();
|
|
@@ -47835,6 +47835,19 @@ var init_schemas2 = __esm(() => {
|
|
|
47835
47835
|
message: "A baseline must claim something — migration history, a schema snapshot, or artifact hashes",
|
|
47836
47836
|
path: ["lastAppliedMigrationTag"]
|
|
47837
47837
|
});
|
|
47838
|
+
DeploySourceSchema = exports_external.object({
|
|
47839
|
+
repository: exports_external.string().url().nullable().transform((value) => {
|
|
47840
|
+
if (value === null) {
|
|
47841
|
+
return null;
|
|
47842
|
+
}
|
|
47843
|
+
const url = new URL(value);
|
|
47844
|
+
return url.username || url.password || url.search || url.hash ? null : value;
|
|
47845
|
+
}),
|
|
47846
|
+
commit: exports_external.string().regex(/^[0-9a-f]{40}$/, "commit must be a full 40-character lowercase SHA").nullable(),
|
|
47847
|
+
branch: exports_external.string().min(1).nullable(),
|
|
47848
|
+
dirty: exports_external.boolean(),
|
|
47849
|
+
externalBuild: exports_external.boolean().default(false)
|
|
47850
|
+
});
|
|
47838
47851
|
DeploymentStateBaselineSchema = exports_external.object({
|
|
47839
47852
|
lastAppliedMigrationTag: exports_external.string().min(1).optional(),
|
|
47840
47853
|
journal: exports_external.array(exports_external.object({
|
|
@@ -47906,6 +47919,7 @@ var init_schemas2 = __esm(() => {
|
|
|
47906
47919
|
buildHash: exports_external.string().min(1).optional(),
|
|
47907
47920
|
integrationsHash: exports_external.string().min(1).optional(),
|
|
47908
47921
|
pruneSecrets: exports_external.array(exports_external.string().min(1)).optional(),
|
|
47922
|
+
source: DeploySourceSchema.optional(),
|
|
47909
47923
|
metadata: exports_external.object({
|
|
47910
47924
|
displayName: exports_external.string().optional(),
|
|
47911
47925
|
description: exports_external.string().optional(),
|
|
@@ -94027,8 +94041,20 @@ function compareEnrollmentsByRecency(a, b) {
|
|
|
94027
94041
|
}
|
|
94028
94042
|
return (b.dateLastModified ?? "").localeCompare(a.dateLastModified ?? "");
|
|
94029
94043
|
}
|
|
94044
|
+
function resolvePrimaryAccountRole(roles2) {
|
|
94045
|
+
if (!roles2?.length) {
|
|
94046
|
+
return null;
|
|
94047
|
+
}
|
|
94048
|
+
return ACCOUNT_ROLE_PRECEDENCE.find((role) => roles2.some((entry) => entry.role === role)) ?? null;
|
|
94049
|
+
}
|
|
94050
|
+
var ACCOUNT_ROLE_PRECEDENCE;
|
|
94030
94051
|
var init_timeback_admin_util = __esm(() => {
|
|
94031
94052
|
init_errors2();
|
|
94053
|
+
ACCOUNT_ROLE_PRECEDENCE = [
|
|
94054
|
+
"administrator",
|
|
94055
|
+
"teacher",
|
|
94056
|
+
"student"
|
|
94057
|
+
];
|
|
94032
94058
|
});
|
|
94033
94059
|
|
|
94034
94060
|
// ../api-core/src/utils/timeback-discrepancy-queue.util.ts
|
|
@@ -98738,6 +98764,7 @@ class TimebackAdminService {
|
|
|
98738
98764
|
className: rosterEntry.class?.title || null,
|
|
98739
98765
|
name: name3,
|
|
98740
98766
|
email: rosterEntry.user?.email || null,
|
|
98767
|
+
primaryRole: resolvePrimaryAccountRole(rosterEntry.user?.roles),
|
|
98741
98768
|
analyticsUnavailable,
|
|
98742
98769
|
totalXp: summary?.totalXp ?? 0,
|
|
98743
98770
|
todayXp: summary?.todayXp ?? 0,
|
|
@@ -99701,15 +99728,22 @@ class TimebackAdminService {
|
|
|
99701
99728
|
});
|
|
99702
99729
|
pastEnrollmentsByStudent.set(studentId, list);
|
|
99703
99730
|
}
|
|
99704
|
-
const students = allUsers.
|
|
99731
|
+
const students = allUsers.flatMap((entry) => {
|
|
99732
|
+
const primaryRole = resolvePrimaryAccountRole(entry.roles);
|
|
99733
|
+
if (!entry.sourcedId || !primaryRole) {
|
|
99734
|
+
return [];
|
|
99735
|
+
}
|
|
99705
99736
|
const past = pastEnrollmentsByStudent.get(entry.sourcedId) ?? [];
|
|
99706
|
-
return
|
|
99707
|
-
|
|
99708
|
-
|
|
99709
|
-
|
|
99710
|
-
|
|
99711
|
-
|
|
99712
|
-
|
|
99737
|
+
return [
|
|
99738
|
+
{
|
|
99739
|
+
studentId: entry.sourcedId,
|
|
99740
|
+
name: `${entry.givenName || ""} ${entry.familyName || ""}`.trim() || "No name specified",
|
|
99741
|
+
email: entry.email || null,
|
|
99742
|
+
primaryRole,
|
|
99743
|
+
alreadyEnrolled: enrolledStudentIds.has(entry.sourcedId),
|
|
99744
|
+
...past.length > 0 ? { pastEnrollments: past } : {}
|
|
99745
|
+
}
|
|
99746
|
+
];
|
|
99713
99747
|
});
|
|
99714
99748
|
setAttribute("app.timeback.result_count", students.length);
|
|
99715
99749
|
return { students };
|
|
@@ -169225,7 +169259,8 @@ var init_deploy = __esm(async () => {
|
|
|
169225
169259
|
config: body2.config,
|
|
169226
169260
|
bindings: body2.bindings,
|
|
169227
169261
|
schema: body2.schema,
|
|
169228
|
-
metadata: body2.metadata
|
|
169262
|
+
metadata: body2.metadata,
|
|
169263
|
+
source: body2.source
|
|
169229
169264
|
},
|
|
169230
169265
|
events,
|
|
169231
169266
|
result: {
|