@playcademy/sdk 0.6.1-beta.4 → 0.6.1-beta.6
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.d.ts +18 -18
- package/dist/index.js +28 -5
- package/dist/internal.d.ts +172 -504
- package/dist/internal.js +28 -5
- package/dist/server/edge.d.ts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/types.d.ts +326 -326
- package/package.json +6 -1
package/dist/internal.js
CHANGED
|
@@ -321,7 +321,7 @@ function formatJSONSingleLine(level, message, context, scope) {
|
|
|
321
321
|
...context && Object.keys(context).length > 0 && { context }
|
|
322
322
|
};
|
|
323
323
|
const consoleMethod = getConsoleMethod(level);
|
|
324
|
-
consoleMethod(
|
|
324
|
+
consoleMethod(safeJSONStringify(logEntry));
|
|
325
325
|
}
|
|
326
326
|
function formatJSONPretty(level, message, context, scope) {
|
|
327
327
|
const timestamp = new Date().toISOString();
|
|
@@ -333,7 +333,30 @@ function formatJSONPretty(level, message, context, scope) {
|
|
|
333
333
|
...context && Object.keys(context).length > 0 && { context }
|
|
334
334
|
};
|
|
335
335
|
const consoleMethod = getConsoleMethod(level);
|
|
336
|
-
consoleMethod(
|
|
336
|
+
consoleMethod(safeJSONStringify(logEntry, 2));
|
|
337
|
+
}
|
|
338
|
+
function safeJSONStringify(value, space) {
|
|
339
|
+
const seen = new WeakSet;
|
|
340
|
+
try {
|
|
341
|
+
return JSON.stringify(value, (_key, currentValue) => {
|
|
342
|
+
if (typeof currentValue === "bigint") {
|
|
343
|
+
return currentValue.toString();
|
|
344
|
+
}
|
|
345
|
+
if (typeof currentValue === "object" && currentValue !== null) {
|
|
346
|
+
if (seen.has(currentValue)) {
|
|
347
|
+
return "[Circular]";
|
|
348
|
+
}
|
|
349
|
+
seen.add(currentValue);
|
|
350
|
+
}
|
|
351
|
+
return currentValue;
|
|
352
|
+
}, space);
|
|
353
|
+
} catch {
|
|
354
|
+
return JSON.stringify({
|
|
355
|
+
timestamp: new Date().toISOString(),
|
|
356
|
+
level: "ERROR",
|
|
357
|
+
message: "[Logger] Failed to serialize log entry"
|
|
358
|
+
});
|
|
359
|
+
}
|
|
337
360
|
}
|
|
338
361
|
function getConsoleMethod(level) {
|
|
339
362
|
switch (level) {
|
|
@@ -1005,7 +1028,7 @@ function createAssetsNamespace(client) {
|
|
|
1005
1028
|
fetch: fetchAsset,
|
|
1006
1029
|
json: async (path) => {
|
|
1007
1030
|
const response = await fetchAsset(path);
|
|
1008
|
-
return response.json();
|
|
1031
|
+
return await response.json();
|
|
1009
1032
|
},
|
|
1010
1033
|
blob: async (path) => {
|
|
1011
1034
|
const response = await fetchAsset(path);
|
|
@@ -1297,10 +1320,10 @@ var ACHIEVEMENT_DEFINITIONS = [
|
|
|
1297
1320
|
var TypeScriptPackages = {
|
|
1298
1321
|
tsc: "tsc",
|
|
1299
1322
|
nativePreview: "@typescript/native-preview",
|
|
1300
|
-
|
|
1323
|
+
nativePreviewBeta: "@typescript/native-preview@beta"
|
|
1301
1324
|
};
|
|
1302
1325
|
var TYPESCRIPT_RUNNER = {
|
|
1303
|
-
package: TypeScriptPackages.
|
|
1326
|
+
package: TypeScriptPackages.nativePreviewBeta,
|
|
1304
1327
|
bin: "tsgo"
|
|
1305
1328
|
};
|
|
1306
1329
|
// ../constants/src/overworld.ts
|
package/dist/server/edge.d.ts
CHANGED
|
@@ -634,10 +634,10 @@ declare class PlaycademyClient {
|
|
|
634
634
|
timeback: {
|
|
635
635
|
endActivity: (studentId: string, payload: EndActivityPayload) => Promise<EndActivityResponse>;
|
|
636
636
|
getStudentXp: (studentId: string, options?: {
|
|
637
|
-
grade?: number
|
|
638
|
-
subject?: string
|
|
639
|
-
include?: (
|
|
640
|
-
}
|
|
637
|
+
grade?: number;
|
|
638
|
+
subject?: string;
|
|
639
|
+
include?: ('perCourse' | 'today')[];
|
|
640
|
+
}) => Promise<StudentXpResponse>;
|
|
641
641
|
};
|
|
642
642
|
}
|
|
643
643
|
|
package/dist/server.d.ts
CHANGED
|
@@ -634,10 +634,10 @@ declare class PlaycademyClient$1 {
|
|
|
634
634
|
timeback: {
|
|
635
635
|
endActivity: (studentId: string, payload: EndActivityPayload) => Promise<EndActivityResponse>;
|
|
636
636
|
getStudentXp: (studentId: string, options?: {
|
|
637
|
-
grade?: number
|
|
638
|
-
subject?: string
|
|
639
|
-
include?: (
|
|
640
|
-
}
|
|
637
|
+
grade?: number;
|
|
638
|
+
subject?: string;
|
|
639
|
+
include?: ('perCourse' | 'today')[];
|
|
640
|
+
}) => Promise<StudentXpResponse>;
|
|
641
641
|
};
|
|
642
642
|
}
|
|
643
643
|
|