@epic-web/workshop-utils 6.71.3 → 6.71.4
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/env.server.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ declare const schema: z.ZodPipe<z.ZodObject<{
|
|
|
10
10
|
EPICSHOP_GITHUB_REPO: z.ZodDefault<z.ZodString>;
|
|
11
11
|
EPICSHOP_GITHUB_ROOT: z.ZodDefault<z.ZodString>;
|
|
12
12
|
EPICSHOP_APP_VERSION: z.ZodOptional<z.ZodString>;
|
|
13
|
+
EPICSHOP_APP_COMMIT_SHA: z.ZodOptional<z.ZodString>;
|
|
13
14
|
EPICSHOP_PARENT_PORT: z.ZodOptional<z.ZodString>;
|
|
14
15
|
EPICSHOP_PARENT_TOKEN: z.ZodOptional<z.ZodString>;
|
|
15
16
|
EPICSHOP_APP_LOCATION: z.ZodOptional<z.ZodString>;
|
|
@@ -19,6 +20,7 @@ declare const schema: z.ZodPipe<z.ZodObject<{
|
|
|
19
20
|
SENTRY_ORG: z.ZodDefault<z.ZodString>;
|
|
20
21
|
SENTRY_PROJECT: z.ZodDefault<z.ZodString>;
|
|
21
22
|
SENTRY_PROJECT_ID: z.ZodDefault<z.ZodString>;
|
|
23
|
+
SENTRY_RELEASE: z.ZodOptional<z.ZodString>;
|
|
22
24
|
}, z.core.$strip>, z.ZodTransform<{
|
|
23
25
|
EPICSHOP_CONTEXT_CWD: string;
|
|
24
26
|
EPICSHOP_WORKSHOP_INSTANCE_ID: string;
|
|
@@ -32,9 +34,11 @@ declare const schema: z.ZodPipe<z.ZodObject<{
|
|
|
32
34
|
SENTRY_PROJECT: string;
|
|
33
35
|
SENTRY_PROJECT_ID: string;
|
|
34
36
|
EPICSHOP_APP_VERSION?: string | undefined;
|
|
37
|
+
EPICSHOP_APP_COMMIT_SHA?: string | undefined;
|
|
35
38
|
EPICSHOP_PARENT_PORT?: string | undefined;
|
|
36
39
|
EPICSHOP_PARENT_TOKEN?: string | undefined;
|
|
37
40
|
EPICSHOP_APP_LOCATION?: string | undefined;
|
|
41
|
+
SENTRY_RELEASE?: string | undefined;
|
|
38
42
|
}, {
|
|
39
43
|
EPICSHOP_CONTEXT_CWD: string;
|
|
40
44
|
EPICSHOP_WORKSHOP_INSTANCE_ID: string;
|
|
@@ -48,9 +52,11 @@ declare const schema: z.ZodPipe<z.ZodObject<{
|
|
|
48
52
|
SENTRY_PROJECT: string;
|
|
49
53
|
SENTRY_PROJECT_ID: string;
|
|
50
54
|
EPICSHOP_APP_VERSION?: string | undefined;
|
|
55
|
+
EPICSHOP_APP_COMMIT_SHA?: string | undefined;
|
|
51
56
|
EPICSHOP_PARENT_PORT?: string | undefined;
|
|
52
57
|
EPICSHOP_PARENT_TOKEN?: string | undefined;
|
|
53
58
|
EPICSHOP_APP_LOCATION?: string | undefined;
|
|
59
|
+
SENTRY_RELEASE?: string | undefined;
|
|
54
60
|
}>>;
|
|
55
61
|
declare global {
|
|
56
62
|
namespace NodeJS {
|
|
@@ -76,11 +82,13 @@ export declare function getEnv(): {
|
|
|
76
82
|
EPICSHOP_GITHUB_ROOT: string;
|
|
77
83
|
EPICSHOP_DEPLOYED: boolean;
|
|
78
84
|
EPICSHOP_APP_VERSION: string | undefined;
|
|
85
|
+
EPICSHOP_APP_COMMIT_SHA: string | undefined;
|
|
79
86
|
EPICSHOP_PARENT_PORT: string | undefined;
|
|
80
87
|
EPICSHOP_PARENT_TOKEN: string | undefined;
|
|
81
88
|
EPICSHOP_IS_PUBLISHED: boolean;
|
|
82
89
|
SENTRY_DSN: string;
|
|
83
90
|
SENTRY_PROJECT_ID: string;
|
|
91
|
+
SENTRY_RELEASE: string | undefined;
|
|
84
92
|
};
|
|
85
93
|
type ENV = ReturnType<typeof getEnv>;
|
|
86
94
|
declare global {
|
package/dist/env.server.js
CHANGED
|
@@ -16,6 +16,7 @@ const schema = z
|
|
|
16
16
|
EPICSHOP_GITHUB_REPO: z.string().default(''),
|
|
17
17
|
EPICSHOP_GITHUB_ROOT: z.string().default(''),
|
|
18
18
|
EPICSHOP_APP_VERSION: z.string().optional(),
|
|
19
|
+
EPICSHOP_APP_COMMIT_SHA: z.string().optional(),
|
|
19
20
|
EPICSHOP_PARENT_PORT: z.string().optional(),
|
|
20
21
|
EPICSHOP_PARENT_TOKEN: z.string().optional(),
|
|
21
22
|
EPICSHOP_APP_LOCATION: z.string().optional(),
|
|
@@ -30,6 +31,7 @@ const schema = z
|
|
|
30
31
|
SENTRY_ORG: z.string().default('kent-c-dodds-tech-llc'),
|
|
31
32
|
SENTRY_PROJECT: z.string().default('epicshop'),
|
|
32
33
|
SENTRY_PROJECT_ID: z.string().default('4509630082252800'),
|
|
34
|
+
SENTRY_RELEASE: z.string().optional(),
|
|
33
35
|
})
|
|
34
36
|
.transform(async (env) => {
|
|
35
37
|
if (env.EPICSHOP_CONTEXT_CWD === '') {
|
|
@@ -122,10 +124,12 @@ export function getEnv() {
|
|
|
122
124
|
EPICSHOP_DEPLOYED: process.env.EPICSHOP_DEPLOYED === 'true' ||
|
|
123
125
|
process.env.EPICSHOP_DEPLOYED === '1',
|
|
124
126
|
EPICSHOP_APP_VERSION: process.env.EPICSHOP_APP_VERSION,
|
|
127
|
+
EPICSHOP_APP_COMMIT_SHA: process.env.EPICSHOP_APP_COMMIT_SHA,
|
|
125
128
|
EPICSHOP_PARENT_PORT: process.env.EPICSHOP_PARENT_PORT,
|
|
126
129
|
EPICSHOP_PARENT_TOKEN: process.env.EPICSHOP_PARENT_TOKEN,
|
|
127
130
|
EPICSHOP_IS_PUBLISHED: process.env.EPICSHOP_IS_PUBLISHED === 'true',
|
|
128
131
|
SENTRY_DSN: process.env.SENTRY_DSN,
|
|
129
132
|
SENTRY_PROJECT_ID: process.env.SENTRY_PROJECT_ID,
|
|
133
|
+
SENTRY_RELEASE: process.env.SENTRY_RELEASE,
|
|
130
134
|
};
|
|
131
135
|
}
|
|
@@ -75,6 +75,7 @@ export declare function getOfflineVideoDownloadState(): OfflineVideoDownloadStat
|
|
|
75
75
|
export declare function getOfflineVideoSummary({ request, }?: {
|
|
76
76
|
request?: Request;
|
|
77
77
|
}): Promise<OfflineVideoSummary>;
|
|
78
|
+
export declare function getOfflineVideoPlaybackIds(): Promise<Array<string> | null>;
|
|
78
79
|
export declare function warmOfflineVideoSummary(): Promise<void>;
|
|
79
80
|
export declare function startOfflineVideoDownload({ request, }?: {
|
|
80
81
|
request?: Request;
|
|
@@ -563,6 +563,39 @@ export async function getOfflineVideoSummary({ request, } = {}) {
|
|
|
563
563
|
downloadState,
|
|
564
564
|
};
|
|
565
565
|
}
|
|
566
|
+
export async function getOfflineVideoPlaybackIds() {
|
|
567
|
+
try {
|
|
568
|
+
const workshop = getWorkshopIdentity();
|
|
569
|
+
const keyInfo = await getOfflineVideoKeyInfo({
|
|
570
|
+
userId: null,
|
|
571
|
+
allowUserIdUpdate: false,
|
|
572
|
+
});
|
|
573
|
+
if (!keyInfo)
|
|
574
|
+
return [];
|
|
575
|
+
const index = await readOfflineVideoIndex();
|
|
576
|
+
const playbackIds = [];
|
|
577
|
+
for (const [playbackId, entry] of Object.entries(index)) {
|
|
578
|
+
if (entry.status !== 'ready')
|
|
579
|
+
continue;
|
|
580
|
+
if (entry.keyId !== keyInfo.keyId)
|
|
581
|
+
continue;
|
|
582
|
+
if (entry.cryptoVersion !== keyInfo.config.version)
|
|
583
|
+
continue;
|
|
584
|
+
if (!hasWorkshop(entry, workshop.id))
|
|
585
|
+
continue;
|
|
586
|
+
if (typeof entry.size === 'number' && entry.size <= 0)
|
|
587
|
+
continue;
|
|
588
|
+
playbackIds.push(playbackId);
|
|
589
|
+
}
|
|
590
|
+
return playbackIds;
|
|
591
|
+
}
|
|
592
|
+
catch (error) {
|
|
593
|
+
log.warn('Failed to load offline video playback ids', {
|
|
594
|
+
error: formatDownloadError(error),
|
|
595
|
+
});
|
|
596
|
+
return null;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
566
599
|
export async function warmOfflineVideoSummary() {
|
|
567
600
|
await getWorkshopVideoCollection();
|
|
568
601
|
}
|