hyperframes 0.8.119 → 0.8.121
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/{add-LVDM5BBO.js → add-CGDIT7CT.js} +14 -14
- package/dist/{animatedGifPrep-RH5AEVNX.js → animatedGifPrep-KPT5VB5Q.js} +5 -5
- package/dist/{asset-PA7XD3CI.js → asset-6ZAZIWA7.js} +2 -2
- package/dist/{assetCataloger-QX37JS5D.js → assetCataloger-FWWCXIEX.js} +2 -2
- package/dist/{auth-SQIHPP3J.js → auth-W4WZ5KT2.js} +4 -4
- package/dist/{autoUpdate-JCG27FBW.js → autoUpdate-2KRUUCM2.js} +2 -2
- package/dist/{backgroundChecks-U7JCBAWI.js → backgroundChecks-M7YRL5G3.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{batchRender-BBBUJETN.js → batchRender-2HXYPO62.js} +3 -3
- package/dist/{beats-6BSMZTE6.js → beats-KXLHRYXV.js} +13 -13
- package/dist/{benchmark-WOZCECBF.js → benchmark-TZRC6JEE.js} +11 -11
- package/dist/{browser-KNPH25NJ.js → browser-KFCZEHSG.js} +8 -8
- package/dist/{bundleWithLocalizedFonts-I4RJWHKR.js → bundleWithLocalizedFonts-3RRACCEV.js} +2 -2
- package/dist/{capture-4WXKXCCV.js → capture-3L7VTWDG.js} +8 -8
- package/dist/{capture-PZQOA465.js → capture-N25LJPGM.js} +2 -2
- package/dist/{catalog-OXCKYFHY.js → catalog-OJK3RAMA.js} +14 -14
- package/dist/{check-N4QDDW6N.js → check-DUQ2OHRX.js} +33 -33
- package/dist/{checkBrowser-D3L4OXTQ.js → checkBrowser-XHNFT3DB.js} +30 -30
- package/dist/{chunk-P6UJ22SS.js → chunk-2C6UJPQS.js} +1 -1
- package/dist/{chunk-TOOQJPUJ.js → chunk-2CGUG4XK.js} +5 -5
- package/dist/{chunk-2FJPEXII.js → chunk-2LWWIDPZ.js} +1 -1
- package/dist/{chunk-KWABBJYI.js → chunk-2XV3S6TA.js} +2 -2
- package/dist/{chunk-HNOJAFT2.js → chunk-3DCZIHXE.js} +21 -21
- package/dist/{chunk-WJP3UOB3.js → chunk-3WXWL7AY.js} +1 -1
- package/dist/{chunk-Y44PIZOH.js → chunk-44EFU366.js} +11 -11
- package/dist/{chunk-523Q6JDM.js → chunk-4JC7LDBQ.js} +2 -2
- package/dist/{chunk-OLFFCC2D.js → chunk-5OS5XIWZ.js} +1 -1
- package/dist/{chunk-KK7VGMEF.js → chunk-5PTKFXAS.js} +11 -11
- package/dist/{chunk-M6LKSPER.js → chunk-6WIWCYD5.js} +3 -3
- package/dist/{chunk-V5T6IA7D.js → chunk-6Z4E4GBX.js} +1 -1
- package/dist/{chunk-FRIRP3DN.js → chunk-7VXU7E5S.js} +1 -1
- package/dist/{chunk-KFKEMNSW.js → chunk-AA4KEZGW.js} +3 -3
- package/dist/{chunk-U7AMFQ6G.js → chunk-BN5KOC5O.js} +1 -1
- package/dist/{chunk-GVJMAHXQ.js → chunk-DISNXEWU.js} +2 -2
- package/dist/{chunk-7UXUVWOY.js → chunk-E5XIJTMU.js} +1 -1
- package/dist/{chunk-SUIF4D5H.js → chunk-GF4MOYGU.js} +8 -8
- package/dist/{chunk-5IABQ7OX.js → chunk-GPGWCFIA.js} +1 -1
- package/dist/{chunk-DNXD7TOA.js → chunk-I465DBM6.js} +27 -12
- package/dist/chunk-IGLEPPTN.js +24 -0
- package/dist/{chunk-MYSYOQPV.js → chunk-IVLJE3VX.js} +2 -2
- package/dist/{chunk-4PTKEI2C.js → chunk-JACPHNUK.js} +1 -1
- package/dist/{chunk-MVWXSRY6.js → chunk-JH556Q42.js} +69 -21
- package/dist/{chunk-BKQXLO55.js → chunk-JREV7WVY.js} +1 -1
- package/dist/{chunk-V2VNJNX6.js → chunk-JWGYWJ5F.js} +1 -1
- package/dist/{chunk-AMSNSTLK.js → chunk-JWHQKTVG.js} +3 -3
- package/dist/{chunk-FNX7RJIJ.js → chunk-KYDM3W7A.js} +2 -2
- package/dist/{chunk-U3CILSBM.js → chunk-LZN67SFR.js} +1 -1
- package/dist/{chunk-IUBZ3DSO.js → chunk-MNMD6XLG.js} +2 -2
- package/dist/{chunk-CDTPNYO3.js → chunk-NPHNGWJH.js} +3 -3
- package/dist/{chunk-EEXM24SY.js → chunk-OWPHLEDI.js} +5 -5
- package/dist/chunk-PATLRNZA.js +3541 -0
- package/dist/{chunk-2WKWEB4T.js → chunk-RCNDZEBU.js} +1 -1
- package/dist/{chunk-KNXXZ73S.js → chunk-RYSHGEZL.js} +4 -4
- package/dist/{chunk-OI3IIR2X.js → chunk-S6Y2LOTE.js} +1 -1
- package/dist/chunk-SHB5VDMH.js +51 -0
- package/dist/{chunk-OWMGDQBZ.js → chunk-SJ64QY5Z.js} +1 -1
- package/dist/{chunk-OV62R47Q.js → chunk-VU4KRDRL.js} +1 -1
- package/dist/{chunk-6Q3Q7HGA.js → chunk-WBRDOH4A.js} +1 -1
- package/dist/{chunk-3NXDJSD5.js → chunk-WG4IZWEH.js} +2 -2
- package/dist/{chunk-LHU6KXWL.js → chunk-WW7V2GQJ.js} +1 -1
- package/dist/{chunk-2MMAA5I3.js → chunk-XLG5C3XA.js} +1 -1
- package/dist/{chunk-RLYTIMTS.js → chunk-Y6W4DVPS.js} +4 -37
- package/dist/{chunk-BZKDN6BU.js → chunk-YE5UC4XH.js} +7 -7
- package/dist/{chunk-ZTU5PYQJ.js → chunk-YJMQLWG4.js} +36 -23
- package/dist/{chunk-PPTHGZTG.js → chunk-ZBMQOBQK.js} +1 -1
- package/dist/{chunk-RZAXPDIT.js → chunk-ZTZ7NCJT.js} +1 -1
- package/dist/{chunk-RMDKZTSI.js → chunk-ZUVO6Q5Q.js} +2 -2
- package/dist/{clean-VWT7OZEN.js → clean-NH5JTTXP.js} +17 -17
- package/dist/cli.js +52 -70
- package/dist/{cloud-BB7SW4DX.js → cloud-QKM43VWA.js} +4 -4
- package/dist/{cloudrun-OQLPEWGP.js → cloudrun-JQCGTNFP.js} +3 -3
- package/dist/{compare-3Z4BPHIZ.js → compare-2ZOO6GRL.js} +29 -29
- package/dist/{compiler-GPUSYMA6.js → compiler-WNWCQTI6.js} +2 -2
- package/dist/{component-6H2NIATV.js → component-Q5AECWP4.js} +3 -3
- package/dist/{compositions-I357YMW6.js → compositions-KEMPAOSU.js} +10 -10
- package/dist/{delete-YJQPGNJJ.js → delete-TWGIIVHU.js} +6 -5
- package/dist/{deterministicFonts-O7BTFDJU.js → deterministicFonts-ITMUXWD2.js} +2 -2
- package/dist/{dist-NP53GO3N.js → dist-JGUAVYZS.js} +2 -2
- package/dist/{doctor-NP34O2SX.js → doctor-COVUXJ2H.js} +9 -9
- package/dist/dotEnv-AI4SYVTX.js +39 -0
- package/dist/{events-T4KFU5HZ.js → events-6K4KG2RC.js} +8 -8
- package/dist/{events-NV6CNGUD.js → events-PNRVEJOH.js} +7 -7
- package/dist/{feedback-DKHIGKC4.js → feedback-YACZS7R7.js} +41 -17
- package/dist/{figma-ALVXXDIQ.js → figma-LEEL7JF7.js} +3 -3
- package/dist/fontLocalizeCli.js +9 -9
- package/dist/{get-CKKP6UBL.js → get-FX23HBPC.js} +6 -5
- package/dist/{gpuPolicy-WWBLJO6C.js → gpuPolicy-TCSAVM2S.js} +5 -5
- package/dist/{grade-compare-7POS3AY6.js → grade-compare-ENNPIMZX.js} +25 -25
- package/dist/{help-KGRXGCVJ.js → help-HNY5LMYR.js} +1 -1
- package/dist/{history-JLXPVI2L.js → history-325KQTJM.js} +17 -17
- package/dist/hyperframe-runtime.js +54 -54
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +54 -54
- package/dist/hyperframes-player.global.js +1 -1
- package/dist/{info-QA5UAYFS.js → info-GKPHG3QO.js} +10 -10
- package/dist/{init-7SM4AD76.js → init-UYF6SWL7.js} +21 -21
- package/dist/{inspect-ANJ2CRLP.js → inspect-A6DZG7KU.js} +26 -26
- package/dist/{installer-EUT2OZTH.js → installer-EY3AB44Q.js} +4 -4
- package/dist/{keyframes-H2ZUI3DC.js → keyframes-P62TMLKQ.js} +11 -11
- package/dist/{lambda-HZ2ZKLVH.js → lambda-HWU6V36S.js} +4 -4
- package/dist/{layout-EDDKQ67V.js → layout-GWF2HD5Z.js} +26 -26
- package/dist/{lint-SVXOETDR.js → lint-OBGOECOL.js} +13 -13
- package/dist/{list-YRBK24UM.js → list-ZOUMRWXQ.js} +6 -5
- package/dist/{login-VE7VGBOA.js → login-4H6ZVI6D.js} +6 -6
- package/dist/{logout-HJQT42RL.js → logout-Q654A3SI.js} +2 -2
- package/dist/{media-treatment-ZQOBGLJQ.js → media-treatment-GRBN3MG5.js} +13 -13
- package/dist/{models-GVMX5TFG.js → models-YFTLSJEG.js} +8 -8
- package/dist/{motionShot-2Z6LRHEV.js → motionShot-7VLC2ULG.js} +10 -10
- package/dist/{normalize-audio-QHMZWNNH.js → normalize-audio-SLBARKVY.js} +13 -13
- package/dist/{pipeline-HYULUMEV.js → pipeline-WRNKPJZH.js} +5 -5
- package/dist/{play-EYXIIZHG.js → play-PDEXRHV6.js} +28 -28
- package/dist/{preflight-KJHZ46FX.js → preflight-6TUK6Z7A.js} +6 -6
- package/dist/{present-YQ2BRUNH.js → present-UXWOO2YL.js} +18 -18
- package/dist/{preview-QMAPLY2S.js → preview-CWHCNYYZ.js} +26 -26
- package/dist/{producer-FS442D4D.js → producer-WDTJSNXK.js} +1 -1
- package/dist/{projectConfig-A4DXJF4P.js → projectConfig-DBP5POAQ.js} +6 -6
- package/dist/{publication-QY2H23JU.js → publication-SUAGUL5G.js} +2 -2
- package/dist/{publish-PCT6JM4B.js → publish-CDKO6FSQ.js} +39 -33
- package/dist/{refresh-IK6LUV5Z.js → refresh-K24ETHMA.js} +2 -2
- package/dist/{remove-background-O2J7EVEN.js → remove-background-QFMDODZ4.js} +6 -6
- package/dist/{render-6QXPYNLY.js → render-BYD7ZASF.js} +27 -27
- package/dist/{render-QUQJP5PP.js → render-NRNF56OV.js} +3 -3
- package/dist/{render-HYA6UBZD.js → render-XTI7E22A.js} +20 -19
- package/dist/{render-batch-OS4UEZA4.js → render-batch-L2AIXYA3.js} +3 -3
- package/dist/{renderCancellation-RWWLGOOD.js → renderCancellation-XR3W2AQT.js} +5 -5
- package/dist/{resolver-IM46W362.js → resolver-RYPIAEGU.js} +4 -4
- package/dist/{sherpa-COBFACPG.js → sherpa-MXQ34FFS.js} +8 -8
- package/dist/skills/media-use/audio/scripts/lib/heygen.mjs +23 -6
- package/dist/skills/media-use/audio/scripts/lib/heygen.test.mjs +42 -2
- package/dist/{skills-CT7TY7SZ.js → skills-MZQUKPEY.js} +10 -10
- package/dist/{skillsUpdateCheck-AWHTVNPB.js → skillsUpdateCheck-B5F5UR7U.js} +3 -3
- package/dist/{snapshot-C4PYM7G5.js → snapshot-HPBNWSSK.js} +31 -31
- package/dist/{src-QOQJLFDK.js → src-BS6B2UWS.js} +4 -4
- package/dist/{src-GGDAYPPK.js → src-RNEWLAP6.js} +8 -8
- package/dist/{staticProjectServer-RBGIJQMY.js → staticProjectServer-B44OD7QD.js} +13 -13
- package/dist/{status-FCLZF4FT.js → status-RYS52BAQ.js} +7 -7
- package/dist/studio/assets/{hyperframes-player-7Icl2uVN.js → hyperframes-player-GkN9yzzq.js} +1 -1
- package/dist/studio/assets/{index-7YcUqkoh.js → index-BpKhiuzT.js} +1 -1
- package/dist/studio/assets/{index-Dc8FEIEU.js → index-ByV72rWx.js} +1 -1
- package/dist/studio/assets/{index-DOO2cYhl.js → index-CyFqMHGS.js} +174 -174
- package/dist/studio/index.d.ts +5 -1
- package/dist/studio/index.html +1 -1
- package/dist/studio/index.js +72 -87
- package/dist/studio/index.js.map +1 -1
- package/dist/{studio-api-Y67F5TPC.js → studio-api-YCS6DZMR.js} +7 -7
- package/dist/{studioServer-SCAZGVUQ.js → studioServer-AEXETXZ2.js} +39 -39
- package/dist/{system-QUFWS7NN.js → system-TD2HPCOA.js} +5 -5
- package/dist/{telemetry-JJJQWUA3.js → telemetry-7KDXFPTK.js} +8 -8
- package/dist/{timeline-BEWRG3QA.js → timeline-P4IMRDIN.js} +17 -17
- package/dist/{tokens-GAZXBXWG.js → tokens-HKYWL774.js} +2 -2
- package/dist/{transcribe-UJUYNNEH.js → transcribe-2E4QY24M.js} +6 -6
- package/dist/{transcribe-ZCFEAIAW.js → transcribe-UIQMMHXI.js} +11 -11
- package/dist/{updateCheck-H5DKTWUO.js → updateCheck-KWLMTR35.js} +2 -2
- package/dist/{upgrade-RUBSQNRS.js → upgrade-E4TMMCGK.js} +2 -2
- package/dist/{urlDownloader-5FUUYAOT.js → urlDownloader-P2EJDWLH.js} +4 -4
- package/dist/{validate-5R3OJEGF.js → validate-IX47WBNJ.js} +15 -15
- package/dist/{video-RTC4AXZB.js → video-56EQZA6M.js} +5 -5
- package/package.json +1 -1
- package/dist/chunk-SHLFJFPM.js +0 -3541
- package/dist/{chunk-AIYKVE4Y.js → chunk-2GKO3X7F.js} +3 -3
|
@@ -51,6 +51,16 @@ var ErrRefreshFailed = (detail) => new AuthError(
|
|
|
51
51
|
detail ? `Failed to refresh OAuth tokens: ${detail}` : "Failed to refresh OAuth tokens",
|
|
52
52
|
"Run `hyperframes auth login` to re-authenticate."
|
|
53
53
|
);
|
|
54
|
+
var ErrLoginExpired = () => new AuthError(
|
|
55
|
+
"LOGIN_EXPIRED",
|
|
56
|
+
"Your HeyGen login expired",
|
|
57
|
+
"Run `hyperframes auth login` to sign in again."
|
|
58
|
+
);
|
|
59
|
+
var ErrLoginChanged = () => new AuthError(
|
|
60
|
+
"LOGIN_CHANGED",
|
|
61
|
+
"Your HeyGen login changed while this command ran",
|
|
62
|
+
"Run the command again."
|
|
63
|
+
);
|
|
54
64
|
var ErrDeviceAuthFailed = (detail) => new AuthError(
|
|
55
65
|
"DEVICE_AUTH_FAILED",
|
|
56
66
|
`Device authorization failed: ${detail}`,
|
|
@@ -461,14 +471,12 @@ async function resolveCredential(opts = {}) {
|
|
|
461
471
|
const { credentials, source } = await readStore();
|
|
462
472
|
if (source === "absent") throw ErrNotConfigured();
|
|
463
473
|
const fileSource = source === "file_legacy" ? "file_legacy" : "file_json";
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
if (oauth) return oauth;
|
|
467
|
-
}
|
|
474
|
+
const oauth = credentials.oauth ? pickOAuth(credentials.oauth, now, fileSource) : null;
|
|
475
|
+
if (oauth) return oauth;
|
|
468
476
|
if (credentials.api_key) {
|
|
469
477
|
return { type: "api_key", key: credentials.api_key, source: fileSource };
|
|
470
478
|
}
|
|
471
|
-
throw ErrNotConfigured();
|
|
479
|
+
throw credentials.oauth ? ErrLoginExpired() : ErrNotConfigured();
|
|
472
480
|
}
|
|
473
481
|
async function tryResolveCredential(opts = {}) {
|
|
474
482
|
try {
|
|
@@ -482,7 +490,7 @@ async function tryResolveCredential(opts = {}) {
|
|
|
482
490
|
}
|
|
483
491
|
function pickOAuth(tokens, now, source) {
|
|
484
492
|
const expiresAt = parseDate(tokens.expires_at);
|
|
485
|
-
const expired = expiresAt
|
|
493
|
+
const expired = isTokenExpired(expiresAt, now);
|
|
486
494
|
if (expired && !tokens.refresh_token) return null;
|
|
487
495
|
const out = {
|
|
488
496
|
type: "oauth",
|
|
@@ -495,6 +503,9 @@ function pickOAuth(tokens, now, source) {
|
|
|
495
503
|
if (tokens.scope) out.scope = tokens.scope;
|
|
496
504
|
return out;
|
|
497
505
|
}
|
|
506
|
+
function isTokenExpired(expiresAt, now) {
|
|
507
|
+
return expiresAt !== void 0 && expiresAt.getTime() - EXPIRY_SKEW_MS < now.getTime();
|
|
508
|
+
}
|
|
498
509
|
function parseDate(s) {
|
|
499
510
|
if (!s) return void 0;
|
|
500
511
|
const d = new Date(s);
|
|
@@ -736,7 +747,7 @@ async function startAuthorizationCodeFlow(opts = {}) {
|
|
|
736
747
|
verifier: pkce.verifier,
|
|
737
748
|
fetchImpl: opts.fetchImpl
|
|
738
749
|
});
|
|
739
|
-
await persistOAuth(tokens
|
|
750
|
+
await persistOAuth(tokens);
|
|
740
751
|
return { tokens };
|
|
741
752
|
}
|
|
742
753
|
async function startDeviceAuthorizationFlow(opts = {}) {
|
|
@@ -884,7 +895,7 @@ async function refreshTokens(refresh_token, opts = {}) {
|
|
|
884
895
|
}
|
|
885
896
|
const payload = await readJsonOrThrow(res);
|
|
886
897
|
const tokens = parseTokenResponse(payload);
|
|
887
|
-
await persistOAuth(tokens, {
|
|
898
|
+
await persistOAuth(tokens, { refreshed: refresh_token });
|
|
888
899
|
return tokens;
|
|
889
900
|
}
|
|
890
901
|
async function revokeTokens(token, opts = {}) {
|
|
@@ -1009,15 +1020,18 @@ function numericField(obj, key) {
|
|
|
1009
1020
|
}
|
|
1010
1021
|
return void 0;
|
|
1011
1022
|
}
|
|
1012
|
-
async function persistOAuth(tokens, opts) {
|
|
1023
|
+
async function persistOAuth(tokens, opts = {}) {
|
|
1013
1024
|
let existing = {};
|
|
1014
1025
|
try {
|
|
1015
1026
|
const { credentials } = await readStore();
|
|
1016
1027
|
existing = credentials;
|
|
1017
|
-
} catch {
|
|
1018
|
-
|
|
1028
|
+
} catch (err) {
|
|
1029
|
+
if (opts.refreshed !== void 0) throw err;
|
|
1030
|
+
}
|
|
1031
|
+
if (opts.refreshed !== void 0 && existing.oauth?.refresh_token !== opts.refreshed) {
|
|
1032
|
+
throw ErrLoginChanged();
|
|
1019
1033
|
}
|
|
1020
|
-
const oauth = opts.
|
|
1034
|
+
const oauth = opts.refreshed !== void 0 ? { ...existing.oauth, ...tokens } : { ...tokens };
|
|
1021
1035
|
await writeStore({ ...existing, oauth });
|
|
1022
1036
|
}
|
|
1023
1037
|
async function persistVerifiedOAuthSession(tokens, user) {
|
|
@@ -1190,6 +1204,7 @@ export {
|
|
|
1190
1204
|
isHeaderSafe,
|
|
1191
1205
|
resolveCredential,
|
|
1192
1206
|
tryResolveCredential,
|
|
1207
|
+
isTokenExpired,
|
|
1193
1208
|
assertOAuthConfiguredOrExit,
|
|
1194
1209
|
startAuthorizationCodeFlow,
|
|
1195
1210
|
startDeviceAuthorizationFlow,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createRequire as __hf_createRequire } from "node:module";
|
|
2
|
+
import { fileURLToPath as __hf_fileURLToPath } from "node:url";
|
|
3
|
+
import { dirname as __hf_dirname } from "node:path";
|
|
4
|
+
var require = __hf_createRequire(import.meta.url);
|
|
5
|
+
var __filename = __hf_fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = __hf_dirname(__filename);
|
|
7
|
+
|
|
8
|
+
// src/utils/feedbackSource.ts
|
|
9
|
+
var SOURCES = ["person", "agent"];
|
|
10
|
+
function parseFeedbackSource(raw) {
|
|
11
|
+
if (raw === void 0) return void 0;
|
|
12
|
+
const source = raw.trim();
|
|
13
|
+
return SOURCES.includes(source) ? source : null;
|
|
14
|
+
}
|
|
15
|
+
var FEEDBACK_EMAIL_ENV = "HYPERFRAMES_FEEDBACK_EMAIL";
|
|
16
|
+
function feedbackEmail(env = process.env) {
|
|
17
|
+
return env[FEEDBACK_EMAIL_ENV]?.trim() || void 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
parseFeedbackSource,
|
|
22
|
+
FEEDBACK_EMAIL_ENV,
|
|
23
|
+
feedbackEmail
|
|
24
|
+
};
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
typeDirPath,
|
|
21
21
|
updateRecord,
|
|
22
22
|
withFigmaErrors
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-2LWWIDPZ.js";
|
|
24
24
|
import {
|
|
25
25
|
defineCommand
|
|
26
26
|
} from "./chunk-S3S4TGEH.js";
|
|
@@ -221,7 +221,7 @@ var asset_default = defineCommand({
|
|
|
221
221
|
rendered > 0 ? `(${results.length} nodes, ${rendered} rendered in 1 figma request)` : `(${results.length} nodes, all reused from cache \u2014 no figma request)`
|
|
222
222
|
);
|
|
223
223
|
}
|
|
224
|
-
const { trackFigmaImport } = await import("./telemetry-
|
|
224
|
+
const { trackFigmaImport } = await import("./telemetry-7KDXFPTK.js");
|
|
225
225
|
trackFigmaImport({
|
|
226
226
|
phase: "asset",
|
|
227
227
|
reused: results.every((r) => r.reused),
|
|
@@ -4,10 +4,15 @@ import { dirname as __hf_dirname } from "node:path";
|
|
|
4
4
|
var require = __hf_createRequire(import.meta.url);
|
|
5
5
|
var __filename = __hf_fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
refreshIfNeeded
|
|
9
|
+
} from "./chunk-SHB5VDMH.js";
|
|
7
10
|
import {
|
|
8
11
|
buildAuthHeaders,
|
|
12
|
+
isAuthError,
|
|
13
|
+
isTokenExpired,
|
|
9
14
|
tryResolveCredential
|
|
10
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-I465DBM6.js";
|
|
11
16
|
import {
|
|
12
17
|
CSS_URL_RE,
|
|
13
18
|
isNonRelativeUrl,
|
|
@@ -191,6 +196,36 @@ function getUploadHeaders(data, uploadUrl, contentType, archiveByteLength) {
|
|
|
191
196
|
async function readJson(response) {
|
|
192
197
|
return response.clone().json().catch(() => null);
|
|
193
198
|
}
|
|
199
|
+
var CredentialRejectedError = class extends Error {
|
|
200
|
+
};
|
|
201
|
+
async function metadataRequestError(response, fallback) {
|
|
202
|
+
const message = await readErrorMessage(response, fallback);
|
|
203
|
+
return response.status === 401 ? new CredentialRejectedError(message) : new Error(message);
|
|
204
|
+
}
|
|
205
|
+
var LOGIN_EXPIRED = "Your login expired. Run hyperframes auth login, then publish again.";
|
|
206
|
+
var LOGIN_CHANGED = "Your login changed during publish. Run publish again.";
|
|
207
|
+
var API_KEY_ENV_VAR = { env: "HEYGEN_API_KEY", env_alias: "HYPERFRAMES_API_KEY" };
|
|
208
|
+
function rejectedCredentialMessage(credential) {
|
|
209
|
+
if (credential.type === "api_key" && (credential.source === "env" || credential.source === "env_alias")) {
|
|
210
|
+
return `${API_KEY_ENV_VAR[credential.source]} was rejected. Fix or unset it, then publish again.`;
|
|
211
|
+
}
|
|
212
|
+
return LOGIN_EXPIRED;
|
|
213
|
+
}
|
|
214
|
+
async function resolvePublishCredential(checked) {
|
|
215
|
+
try {
|
|
216
|
+
const credential = checked === void 0 ? await tryResolveCredential() : checked;
|
|
217
|
+
if (!credential) return null;
|
|
218
|
+
const expired = credential.type === "oauth" && isTokenExpired(credential.expires_at, /* @__PURE__ */ new Date());
|
|
219
|
+
if (expired && !credential.refresh_token) throw new Error(LOGIN_EXPIRED);
|
|
220
|
+
return await refreshIfNeeded(expired ? { ...credential, refreshable: true } : credential);
|
|
221
|
+
} catch (error) {
|
|
222
|
+
if (isAuthError(error) && (error.code === "REFRESH_FAILED" || error.code === "LOGIN_EXPIRED")) {
|
|
223
|
+
throw new Error(LOGIN_EXPIRED);
|
|
224
|
+
}
|
|
225
|
+
if (isAuthError(error) && error.code === "LOGIN_CHANGED") throw new Error(LOGIN_CHANGED);
|
|
226
|
+
throw error;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
194
229
|
async function readErrorMessage(response, fallback) {
|
|
195
230
|
const contentType = response.headers.get("content-type") || "";
|
|
196
231
|
if (contentType.includes("application/json")) {
|
|
@@ -477,7 +512,7 @@ async function publishProjectArchiveDirect(apiBaseUrl, title, archive, isPublic,
|
|
|
477
512
|
const payload = await readJson(response);
|
|
478
513
|
const publishedProject = parsePublishedProjectResponse(payload);
|
|
479
514
|
if (!response.ok || !publishedProject) {
|
|
480
|
-
throw
|
|
515
|
+
throw await metadataRequestError(response, "Failed to publish project");
|
|
481
516
|
}
|
|
482
517
|
return publishedProject;
|
|
483
518
|
}
|
|
@@ -526,7 +561,7 @@ async function publishProjectArchiveStaged(apiBaseUrl, title, archive, isPublic,
|
|
|
526
561
|
const uploadPayload = await readJson(uploadResponse);
|
|
527
562
|
const stagedUpload = parseStagedUploadResponse(uploadPayload, archive.buffer.byteLength);
|
|
528
563
|
if (!uploadResponse.ok || !stagedUpload) {
|
|
529
|
-
throw
|
|
564
|
+
throw await metadataRequestError(uploadResponse, "Failed to prepare project upload");
|
|
530
565
|
}
|
|
531
566
|
await uploadArchiveToPresignedUrl(stagedUpload, archive);
|
|
532
567
|
const completeResponse = await fetchForPublish(
|
|
@@ -551,7 +586,7 @@ async function publishProjectArchiveStaged(apiBaseUrl, title, archive, isPublic,
|
|
|
551
586
|
const completePayload = await readJson(completeResponse);
|
|
552
587
|
const publishedProject = parsePublishedProjectResponse(completePayload);
|
|
553
588
|
if (!completeResponse.ok || !publishedProject) {
|
|
554
|
-
throw
|
|
589
|
+
throw await metadataRequestError(completeResponse, "Failed to publish project");
|
|
555
590
|
}
|
|
556
591
|
return publishedProject;
|
|
557
592
|
}
|
|
@@ -560,27 +595,38 @@ async function publishProjectArchive(projectDir, opts = {}) {
|
|
|
560
595
|
const title = basename(projectDir);
|
|
561
596
|
const archive = opts.archive ?? createPublishArchive(projectDir);
|
|
562
597
|
const apiBaseUrl = getPublishApiBaseUrl();
|
|
563
|
-
const credential = await
|
|
598
|
+
const credential = await resolvePublishCredential(opts.credential);
|
|
564
599
|
const authHeaders = credential ? buildAuthHeaders(credential) : {};
|
|
565
600
|
const projectId = credential ? opts.projectId : void 0;
|
|
566
601
|
const spaceId = credential ? opts.spaceId : void 0;
|
|
567
602
|
const metadataHeaders = spaceId ? { ...authHeaders, "x-space-id": spaceId } : authHeaders;
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
603
|
+
let result;
|
|
604
|
+
try {
|
|
605
|
+
result = await publishProjectArchiveStaged(
|
|
606
|
+
apiBaseUrl,
|
|
607
|
+
title,
|
|
608
|
+
archive,
|
|
609
|
+
isPublic,
|
|
610
|
+
metadataHeaders,
|
|
611
|
+
projectId
|
|
612
|
+
) ?? await publishProjectArchiveDirect(
|
|
613
|
+
apiBaseUrl,
|
|
614
|
+
title,
|
|
615
|
+
archive,
|
|
616
|
+
isPublic,
|
|
617
|
+
metadataHeaders,
|
|
618
|
+
projectId
|
|
619
|
+
);
|
|
620
|
+
if (credential?.type === "oauth" && !result.claimed) {
|
|
621
|
+
throw new CredentialRejectedError("unclaimed publish");
|
|
622
|
+
}
|
|
623
|
+
} catch (error) {
|
|
624
|
+
if (error instanceof CredentialRejectedError && credential) {
|
|
625
|
+
throw new Error(rejectedCredentialMessage(credential));
|
|
626
|
+
}
|
|
627
|
+
throw error;
|
|
628
|
+
}
|
|
629
|
+
if (result.claimed) {
|
|
584
630
|
writeProjectLink(projectDir, { projectId: result.projectId, url: result.url });
|
|
585
631
|
}
|
|
586
632
|
return result;
|
|
@@ -591,6 +637,8 @@ export {
|
|
|
591
637
|
ensureProjectId,
|
|
592
638
|
readTeamProject,
|
|
593
639
|
writeTeamProject,
|
|
640
|
+
API_KEY_ENV_VAR,
|
|
641
|
+
resolvePublishCredential,
|
|
594
642
|
rewriteHtmlAttributes,
|
|
595
643
|
buildPublishFileMap,
|
|
596
644
|
zipPublishFileMap,
|
|
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
getMimeType,
|
|
9
9
|
injectMediaCodecMapIntoHtml
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-YJMQLWG4.js";
|
|
11
11
|
import {
|
|
12
12
|
PROXY_VARIANT_CONFIG,
|
|
13
13
|
ProxyCapacityError,
|
|
@@ -18,10 +18,10 @@ import {
|
|
|
18
18
|
recordProxyRequest,
|
|
19
19
|
resolveProxy,
|
|
20
20
|
resolveProxyVariantRequest
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-SJ64QY5Z.js";
|
|
22
22
|
import {
|
|
23
23
|
resolveAutoProxy
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-3WXWL7AY.js";
|
|
25
25
|
|
|
26
26
|
// src/utils/staticProjectServer.ts
|
|
27
27
|
import { createServer } from "http";
|
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
DEFAULT_REGISTRY_URL,
|
|
9
9
|
fetchItemFile,
|
|
10
10
|
validRegistryItem
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ZBMQOBQK.js";
|
|
12
12
|
import {
|
|
13
13
|
publishRegistryFile,
|
|
14
14
|
registryTargetPath
|
|
15
15
|
} from "./chunk-GMECXFAN.js";
|
|
16
16
|
import {
|
|
17
17
|
validateVariables
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-RCNDZEBU.js";
|
|
19
19
|
import {
|
|
20
20
|
realProjectRoot
|
|
21
21
|
} from "./chunk-OFQWTKPW.js";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
renderFrameIdForRenderId,
|
|
23
23
|
resolveAuthoredTimingWindow,
|
|
24
24
|
toFps
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-RCNDZEBU.js";
|
|
26
26
|
import {
|
|
27
27
|
AUDIO_GROUP_RENDER_ID_ATTR,
|
|
28
28
|
COLOR_GRADING_SOURCE_HIDDEN_ATTR,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
shiftRateLane,
|
|
53
53
|
sourceTimeAt,
|
|
54
54
|
timeAtSourceTime
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-PATLRNZA.js";
|
|
56
56
|
import {
|
|
57
57
|
chromeMajorCeiling,
|
|
58
58
|
exceedsChromeCeiling
|
|
@@ -8,16 +8,16 @@ import {
|
|
|
8
8
|
flush,
|
|
9
9
|
shouldTrack,
|
|
10
10
|
trackEvent
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-6WIWCYD5.js";
|
|
12
12
|
import {
|
|
13
13
|
getPowerState
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-BN5KOC5O.js";
|
|
15
15
|
import {
|
|
16
16
|
CliRuntimeError
|
|
17
17
|
} from "./chunk-PBN6GBJE.js";
|
|
18
18
|
import {
|
|
19
19
|
redactTelemetryString
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-RCNDZEBU.js";
|
|
21
21
|
import {
|
|
22
22
|
readConfig
|
|
23
23
|
} from "./chunk-XUXGIA7H.js";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from "./chunk-5ETJX6WM.js";
|
|
17
17
|
import {
|
|
18
18
|
runEnvironmentChecks
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-VU4KRDRL.js";
|
|
20
20
|
import {
|
|
21
21
|
c
|
|
22
22
|
} from "./chunk-ZTZA4UWZ.js";
|
|
@@ -25,24 +25,24 @@ import {
|
|
|
25
25
|
getFreeDiskMb,
|
|
26
26
|
getShmSizeMb,
|
|
27
27
|
getSystemMeta
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-BN5KOC5O.js";
|
|
29
29
|
import {
|
|
30
30
|
defineCommand
|
|
31
31
|
} from "./chunk-S3S4TGEH.js";
|
|
32
32
|
import {
|
|
33
33
|
resolveExtractCacheDir
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-MNMD6XLG.js";
|
|
35
35
|
import {
|
|
36
36
|
getUpdateMeta,
|
|
37
37
|
withMeta
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-7VXU7E5S.js";
|
|
39
39
|
import {
|
|
40
40
|
CONFIG_PATH,
|
|
41
41
|
withFileLock
|
|
42
42
|
} from "./chunk-XUXGIA7H.js";
|
|
43
43
|
import {
|
|
44
44
|
VERSION
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-WG4IZWEH.js";
|
|
46
46
|
import {
|
|
47
47
|
normalizeErrorMessage
|
|
48
48
|
} from "./chunk-KNU5COPB.js";
|