@epic-web/workshop-utils 6.63.0 → 6.64.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.
- package/dist/apps.server.d.ts +706 -3500
- package/dist/cache.server.d.ts +45 -99
- package/dist/cache.server.js +8 -5
- package/dist/config.server.d.ts +41 -272
- package/dist/config.server.js +22 -12
- package/dist/db.server.d.ts +37 -344
- package/dist/db.server.js +27 -7
- package/dist/env.server.d.ts +8 -36
- package/dist/epic-api.server.d.ts +18 -72
- package/dist/notifications.server.d.ts +10 -34
- package/dist/offline-video-crypto.server.d.ts +2 -2
- package/dist/process-manager.server.d.ts +1 -1
- package/dist/workshops.server.d.ts +1 -5
- package/package.json +81 -52
package/dist/cache.server.d.ts
CHANGED
|
@@ -12,6 +12,11 @@ export declare function epicCacheReporter<Value>({ formatDuration, performance,
|
|
|
12
12
|
performance?: Pick<typeof Date, 'now'>;
|
|
13
13
|
}): CreateReporter<Value>;
|
|
14
14
|
export declare const solutionAppCache: C.Cache<{
|
|
15
|
+
name: string;
|
|
16
|
+
title: string;
|
|
17
|
+
dirName: string;
|
|
18
|
+
fullPath: string;
|
|
19
|
+
relativePath: string;
|
|
15
20
|
test: {
|
|
16
21
|
type: "browser";
|
|
17
22
|
pathname: string;
|
|
@@ -22,33 +27,33 @@ export declare const solutionAppCache: C.Cache<{
|
|
|
22
27
|
} | {
|
|
23
28
|
type: "none";
|
|
24
29
|
};
|
|
25
|
-
type: "solution";
|
|
26
|
-
title: string;
|
|
27
|
-
name: string;
|
|
28
|
-
fullPath: string;
|
|
29
30
|
dev: {
|
|
30
31
|
type: "browser";
|
|
31
32
|
pathname: string;
|
|
32
33
|
} | {
|
|
33
34
|
type: "script";
|
|
34
|
-
initialRoute: string;
|
|
35
35
|
portNumber: number;
|
|
36
|
+
initialRoute: string;
|
|
36
37
|
} | {
|
|
37
38
|
type: "export";
|
|
38
39
|
pathname: string;
|
|
39
40
|
} | {
|
|
40
41
|
type: "none";
|
|
41
42
|
};
|
|
42
|
-
dirName: string;
|
|
43
|
-
relativePath: string;
|
|
44
43
|
stackBlitzUrl: string | null;
|
|
45
44
|
exerciseNumber: number;
|
|
46
45
|
stepNumber: number;
|
|
46
|
+
type: "solution";
|
|
47
47
|
problemName: string | null;
|
|
48
48
|
instructionsCode?: string | undefined;
|
|
49
49
|
epicVideoEmbeds?: string[] | undefined;
|
|
50
50
|
}>;
|
|
51
51
|
export declare const problemAppCache: C.Cache<{
|
|
52
|
+
name: string;
|
|
53
|
+
title: string;
|
|
54
|
+
dirName: string;
|
|
55
|
+
fullPath: string;
|
|
56
|
+
relativePath: string;
|
|
52
57
|
test: {
|
|
53
58
|
type: "browser";
|
|
54
59
|
pathname: string;
|
|
@@ -59,33 +64,33 @@ export declare const problemAppCache: C.Cache<{
|
|
|
59
64
|
} | {
|
|
60
65
|
type: "none";
|
|
61
66
|
};
|
|
62
|
-
type: "problem";
|
|
63
|
-
title: string;
|
|
64
|
-
name: string;
|
|
65
|
-
fullPath: string;
|
|
66
67
|
dev: {
|
|
67
68
|
type: "browser";
|
|
68
69
|
pathname: string;
|
|
69
70
|
} | {
|
|
70
71
|
type: "script";
|
|
71
|
-
initialRoute: string;
|
|
72
72
|
portNumber: number;
|
|
73
|
+
initialRoute: string;
|
|
73
74
|
} | {
|
|
74
75
|
type: "export";
|
|
75
76
|
pathname: string;
|
|
76
77
|
} | {
|
|
77
78
|
type: "none";
|
|
78
79
|
};
|
|
79
|
-
dirName: string;
|
|
80
|
-
relativePath: string;
|
|
81
80
|
stackBlitzUrl: string | null;
|
|
82
81
|
exerciseNumber: number;
|
|
83
82
|
stepNumber: number;
|
|
83
|
+
type: "problem";
|
|
84
84
|
solutionName: string | null;
|
|
85
85
|
instructionsCode?: string | undefined;
|
|
86
86
|
epicVideoEmbeds?: string[] | undefined;
|
|
87
87
|
}>;
|
|
88
88
|
export declare const extraAppCache: C.Cache<{
|
|
89
|
+
name: string;
|
|
90
|
+
title: string;
|
|
91
|
+
dirName: string;
|
|
92
|
+
fullPath: string;
|
|
93
|
+
relativePath: string;
|
|
89
94
|
test: {
|
|
90
95
|
type: "browser";
|
|
91
96
|
pathname: string;
|
|
@@ -96,30 +101,30 @@ export declare const extraAppCache: C.Cache<{
|
|
|
96
101
|
} | {
|
|
97
102
|
type: "none";
|
|
98
103
|
};
|
|
99
|
-
type: "extra";
|
|
100
|
-
title: string;
|
|
101
|
-
name: string;
|
|
102
|
-
fullPath: string;
|
|
103
104
|
dev: {
|
|
104
105
|
type: "browser";
|
|
105
106
|
pathname: string;
|
|
106
107
|
} | {
|
|
107
108
|
type: "script";
|
|
108
|
-
initialRoute: string;
|
|
109
109
|
portNumber: number;
|
|
110
|
+
initialRoute: string;
|
|
110
111
|
} | {
|
|
111
112
|
type: "export";
|
|
112
113
|
pathname: string;
|
|
113
114
|
} | {
|
|
114
115
|
type: "none";
|
|
115
116
|
};
|
|
116
|
-
dirName: string;
|
|
117
|
-
relativePath: string;
|
|
118
117
|
stackBlitzUrl: string | null;
|
|
118
|
+
type: "extra";
|
|
119
119
|
instructionsCode?: string | undefined;
|
|
120
120
|
epicVideoEmbeds?: string[] | undefined;
|
|
121
121
|
}>;
|
|
122
122
|
export declare const playgroundAppCache: C.Cache<{
|
|
123
|
+
name: string;
|
|
124
|
+
title: string;
|
|
125
|
+
dirName: string;
|
|
126
|
+
fullPath: string;
|
|
127
|
+
relativePath: string;
|
|
123
128
|
test: {
|
|
124
129
|
type: "browser";
|
|
125
130
|
pathname: string;
|
|
@@ -130,26 +135,21 @@ export declare const playgroundAppCache: C.Cache<{
|
|
|
130
135
|
} | {
|
|
131
136
|
type: "none";
|
|
132
137
|
};
|
|
133
|
-
type: "playground";
|
|
134
|
-
title: string;
|
|
135
|
-
name: string;
|
|
136
|
-
fullPath: string;
|
|
137
138
|
dev: {
|
|
138
139
|
type: "browser";
|
|
139
140
|
pathname: string;
|
|
140
141
|
} | {
|
|
141
142
|
type: "script";
|
|
142
|
-
initialRoute: string;
|
|
143
143
|
portNumber: number;
|
|
144
|
+
initialRoute: string;
|
|
144
145
|
} | {
|
|
145
146
|
type: "export";
|
|
146
147
|
pathname: string;
|
|
147
148
|
} | {
|
|
148
149
|
type: "none";
|
|
149
150
|
};
|
|
150
|
-
dirName: string;
|
|
151
|
-
relativePath: string;
|
|
152
151
|
stackBlitzUrl: string | null;
|
|
152
|
+
type: "playground";
|
|
153
153
|
appName: string;
|
|
154
154
|
isUpToDate: boolean;
|
|
155
155
|
instructionsCode?: string | undefined;
|
|
@@ -217,10 +217,10 @@ export declare const checkForUpdatesCache: {
|
|
|
217
217
|
export declare const notificationsCache: {
|
|
218
218
|
name: string;
|
|
219
219
|
set: (key: string, value: C.CacheEntry<{
|
|
220
|
+
id: string;
|
|
221
|
+
title: string;
|
|
220
222
|
message: string;
|
|
221
223
|
type: "info" | "warning" | "danger";
|
|
222
|
-
title: string;
|
|
223
|
-
id: string;
|
|
224
224
|
expiresAt: Date | null;
|
|
225
225
|
link?: string | undefined;
|
|
226
226
|
products?: {
|
|
@@ -228,10 +228,10 @@ export declare const notificationsCache: {
|
|
|
228
228
|
slug?: string | undefined;
|
|
229
229
|
}[] | undefined;
|
|
230
230
|
}[]>) => C.CacheEntry<{
|
|
231
|
+
id: string;
|
|
232
|
+
title: string;
|
|
231
233
|
message: string;
|
|
232
234
|
type: "info" | "warning" | "danger";
|
|
233
|
-
title: string;
|
|
234
|
-
id: string;
|
|
235
235
|
expiresAt: Date | null;
|
|
236
236
|
link?: string | undefined;
|
|
237
237
|
products?: {
|
|
@@ -240,10 +240,10 @@ export declare const notificationsCache: {
|
|
|
240
240
|
}[] | undefined;
|
|
241
241
|
}[]>;
|
|
242
242
|
get: (key: string) => C.CacheEntry<{
|
|
243
|
+
id: string;
|
|
244
|
+
title: string;
|
|
243
245
|
message: string;
|
|
244
246
|
type: "info" | "warning" | "danger";
|
|
245
|
-
title: string;
|
|
246
|
-
id: string;
|
|
247
247
|
expiresAt: Date | null;
|
|
248
248
|
link?: string | undefined;
|
|
249
249
|
products?: {
|
|
@@ -263,7 +263,7 @@ export declare const discordCache: C.Cache<unknown>;
|
|
|
263
263
|
export declare const epicApiCache: C.Cache<unknown>;
|
|
264
264
|
export declare function makeGlobalFsCache<CacheEntryType>(name: string): C.Cache<CacheEntryType>;
|
|
265
265
|
export declare const githubCache: C.Cache<unknown>;
|
|
266
|
-
export declare const WorkshopCacheSchema: z.
|
|
266
|
+
export declare const WorkshopCacheSchema: z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
267
267
|
key: z.ZodString;
|
|
268
268
|
entry: z.ZodObject<{
|
|
269
269
|
value: z.ZodUnknown;
|
|
@@ -271,81 +271,27 @@ export declare const WorkshopCacheSchema: z.ZodEffects<z.ZodRecord<z.ZodString,
|
|
|
271
271
|
createdTime: z.ZodNumber;
|
|
272
272
|
ttl: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
273
273
|
swr: z.ZodOptional<z.ZodNumber>;
|
|
274
|
-
},
|
|
275
|
-
|
|
276
|
-
ttl?: number | null | undefined;
|
|
277
|
-
swr?: number | undefined;
|
|
278
|
-
}, {
|
|
279
|
-
createdTime: number;
|
|
280
|
-
ttl?: number | null | undefined;
|
|
281
|
-
swr?: number | undefined;
|
|
282
|
-
}>;
|
|
283
|
-
}, "strip", z.ZodTypeAny, {
|
|
284
|
-
metadata: {
|
|
285
|
-
createdTime: number;
|
|
286
|
-
ttl?: number | null | undefined;
|
|
287
|
-
swr?: number | undefined;
|
|
288
|
-
};
|
|
289
|
-
value?: unknown;
|
|
290
|
-
}, {
|
|
291
|
-
metadata: {
|
|
292
|
-
createdTime: number;
|
|
293
|
-
ttl?: number | null | undefined;
|
|
294
|
-
swr?: number | undefined;
|
|
295
|
-
};
|
|
296
|
-
value?: unknown;
|
|
297
|
-
}>;
|
|
274
|
+
}, z.core.$strip>;
|
|
275
|
+
}, z.core.$strip>;
|
|
298
276
|
size: z.ZodOptional<z.ZodNumber>;
|
|
299
277
|
filepath: z.ZodOptional<z.ZodString>;
|
|
300
|
-
},
|
|
301
|
-
key: string;
|
|
302
|
-
entry: {
|
|
303
|
-
metadata: {
|
|
304
|
-
createdTime: number;
|
|
305
|
-
ttl?: number | null | undefined;
|
|
306
|
-
swr?: number | undefined;
|
|
307
|
-
};
|
|
308
|
-
value?: unknown;
|
|
309
|
-
};
|
|
310
|
-
size?: number | undefined;
|
|
311
|
-
filepath?: string | undefined;
|
|
312
|
-
}, {
|
|
313
|
-
key: string;
|
|
314
|
-
entry: {
|
|
315
|
-
metadata: {
|
|
316
|
-
createdTime: number;
|
|
317
|
-
ttl?: number | null | undefined;
|
|
318
|
-
swr?: number | undefined;
|
|
319
|
-
};
|
|
320
|
-
value?: unknown;
|
|
321
|
-
};
|
|
322
|
-
size?: number | undefined;
|
|
323
|
-
filepath?: string | undefined;
|
|
324
|
-
}>, z.ZodObject<{
|
|
278
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
325
279
|
error: z.ZodString;
|
|
326
280
|
size: z.ZodNumber;
|
|
327
281
|
skipped: z.ZodLiteral<true>;
|
|
328
|
-
},
|
|
329
|
-
size: number;
|
|
330
|
-
error: string;
|
|
331
|
-
skipped: true;
|
|
332
|
-
}, {
|
|
333
|
-
size: number;
|
|
334
|
-
error: string;
|
|
335
|
-
skipped: true;
|
|
336
|
-
}>]>>>>, {
|
|
282
|
+
}, z.core.$strip>]>>>>, z.ZodTransform<{
|
|
337
283
|
workshopId: string;
|
|
338
284
|
caches: Array<{
|
|
339
285
|
name: string;
|
|
340
286
|
entries: Array<{
|
|
341
287
|
key: string;
|
|
342
288
|
entry: {
|
|
289
|
+
value: unknown;
|
|
343
290
|
metadata: {
|
|
344
291
|
createdTime: number;
|
|
345
292
|
ttl?: number | null | undefined;
|
|
346
293
|
swr?: number | undefined;
|
|
347
294
|
};
|
|
348
|
-
value?: unknown;
|
|
349
295
|
};
|
|
350
296
|
size?: number | undefined;
|
|
351
297
|
filepath?: string | undefined;
|
|
@@ -362,20 +308,20 @@ export declare const WorkshopCacheSchema: z.ZodEffects<z.ZodRecord<z.ZodString,
|
|
|
362
308
|
}[], Record<string, Record<string, Record<string, {
|
|
363
309
|
key: string;
|
|
364
310
|
entry: {
|
|
311
|
+
value: unknown;
|
|
365
312
|
metadata: {
|
|
366
313
|
createdTime: number;
|
|
367
314
|
ttl?: number | null | undefined;
|
|
368
315
|
swr?: number | undefined;
|
|
369
316
|
};
|
|
370
|
-
value?: unknown;
|
|
371
317
|
};
|
|
372
318
|
size?: number | undefined;
|
|
373
319
|
filepath?: string | undefined;
|
|
374
320
|
} | {
|
|
375
|
-
size: number;
|
|
376
321
|
error: string;
|
|
322
|
+
size: number;
|
|
377
323
|
skipped: true;
|
|
378
|
-
}
|
|
324
|
+
}>>>>>;
|
|
379
325
|
export declare function getAllWorkshopCaches(): Promise<{
|
|
380
326
|
workshopId: string;
|
|
381
327
|
caches: Array<{
|
|
@@ -383,12 +329,12 @@ export declare function getAllWorkshopCaches(): Promise<{
|
|
|
383
329
|
entries: Array<{
|
|
384
330
|
key: string;
|
|
385
331
|
entry: {
|
|
332
|
+
value: unknown;
|
|
386
333
|
metadata: {
|
|
387
334
|
createdTime: number;
|
|
388
335
|
ttl?: number | null | undefined;
|
|
389
336
|
swr?: number | undefined;
|
|
390
337
|
};
|
|
391
|
-
value?: unknown;
|
|
392
338
|
};
|
|
393
339
|
size?: number | undefined;
|
|
394
340
|
filepath?: string | undefined;
|
|
@@ -411,12 +357,12 @@ export declare function getGlobalCaches(): Promise<{
|
|
|
411
357
|
entries: Array<{
|
|
412
358
|
key: string;
|
|
413
359
|
entry: {
|
|
360
|
+
value: unknown;
|
|
414
361
|
metadata: {
|
|
415
362
|
createdTime: number;
|
|
416
363
|
ttl?: number | null | undefined;
|
|
417
364
|
swr?: number | undefined;
|
|
418
365
|
};
|
|
419
|
-
value?: unknown;
|
|
420
366
|
};
|
|
421
367
|
size?: number | undefined;
|
|
422
368
|
filepath?: string | undefined;
|
package/dist/cache.server.js
CHANGED
|
@@ -348,8 +348,14 @@ const SkippedFileSchema = z.object({
|
|
|
348
348
|
});
|
|
349
349
|
// Combined schema that can handle both cache entries and skipped files
|
|
350
350
|
const CacheFileSchema = z.union([CacheEntrySchema, SkippedFileSchema]);
|
|
351
|
+
const isSkippedFile = (value) => {
|
|
352
|
+
return (typeof value === 'object' &&
|
|
353
|
+
value !== null &&
|
|
354
|
+
'skipped' in value &&
|
|
355
|
+
value.skipped === true);
|
|
356
|
+
};
|
|
351
357
|
export const WorkshopCacheSchema = z
|
|
352
|
-
.record(z.record(z.record(CacheFileSchema)))
|
|
358
|
+
.record(z.string(), z.record(z.string(), z.record(z.string(), CacheFileSchema)))
|
|
353
359
|
.transform((workshopCaches) => {
|
|
354
360
|
const cachesArray = [];
|
|
355
361
|
for (const [workshopId, caches] of Object.entries(workshopCaches)) {
|
|
@@ -358,10 +364,7 @@ export const WorkshopCacheSchema = z
|
|
|
358
364
|
const entries = [];
|
|
359
365
|
const skippedFiles = [];
|
|
360
366
|
for (const [key, value] of Object.entries(entriesObj)) {
|
|
361
|
-
if (value
|
|
362
|
-
typeof value === 'object' &&
|
|
363
|
-
'skipped' in value &&
|
|
364
|
-
value.skipped) {
|
|
367
|
+
if (isSkippedFile(value)) {
|
|
365
368
|
// This is a skipped file
|
|
366
369
|
skippedFiles.push({
|
|
367
370
|
filename: key,
|