mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 16:00:07 +00:00
* fix(studio-server): reject cross-origin state-changing requests Non-GET routes in createStudioApi answer 403 unless the shared sameOriginPost predicate (lifted into studio-server's ./request-identity subpath) accepts the request: the Host must be a server identity, a present Sec-Fetch-Site must be same-origin, and a present Origin must match the effective host and scheme. Hosts behind Codespaces or tunnels allow their public name with HYPERFRAMES_PREVIEW_ALLOWED_HOSTS, read by `hyperframes preview` and the Studio dev server. Squashed from #6128 (42574a7,110a300,89011e1,41c6626,27193bb) onto current main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): the preview server answers only the hosts it is reached by Every route of `hyperframes preview` (the forwarded studio API, the SSE stream, /__hyperframes_config and the Studio page) now answers only loopback names, the HYPERFRAMES_PREVIEW_HOST bind, or a host listed in HYPERFRAMES_PREVIEW_ALLOWED_HOSTS, the same list the write guard uses. Only the Host header counts here, since a page can set X-Forwarded-Host on its own requests and a read carries no Origin to compare it with. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Dextheking1 <Dextheking1@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
225 lines
7.4 KiB
JSON
225 lines
7.4 KiB
JSON
{
|
|
"name": "@hyperframes/studio-server",
|
|
"version": "0.9.29",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/heygen-com/hyperframes",
|
|
"directory": "packages/studio-server"
|
|
},
|
|
"files": [
|
|
"dist",
|
|
"README.md"
|
|
],
|
|
"type": "module",
|
|
"main": "./src/index.ts",
|
|
"types": "./src/index.ts",
|
|
"exports": {
|
|
".": {
|
|
"bun": "./src/index.ts",
|
|
"node": "./dist/index.js",
|
|
"import": "./src/index.ts",
|
|
"types": "./src/index.ts"
|
|
},
|
|
"./package.json": "./package.json",
|
|
"./screenshot-clip": {
|
|
"bun": "./src/helpers/screenshotClip.ts",
|
|
"node": "./dist/helpers/screenshotClip.js",
|
|
"import": "./src/helpers/screenshotClip.ts",
|
|
"types": "./src/helpers/screenshotClip.ts"
|
|
},
|
|
"./safe-path": {
|
|
"bun": "./src/helpers/safePath.ts",
|
|
"node": "./dist/helpers/safePath.js",
|
|
"import": "./src/helpers/safePath.ts",
|
|
"types": "./src/helpers/safePath.ts"
|
|
},
|
|
"./request-identity": {
|
|
"bun": "./src/helpers/requestIdentity.ts",
|
|
"node": "./dist/helpers/requestIdentity.js",
|
|
"import": "./src/helpers/requestIdentity.ts",
|
|
"types": "./src/helpers/requestIdentity.ts"
|
|
},
|
|
"./hf-ids": {
|
|
"bun": "./src/helpers/hfIdPersist.ts",
|
|
"node": "./dist/helpers/hfIdPersist.js",
|
|
"import": "./src/helpers/hfIdPersist.ts",
|
|
"types": "./src/helpers/hfIdPersist.ts"
|
|
},
|
|
"./history": {
|
|
"bun": "./src/history/index.ts",
|
|
"node": "./dist/history/index.js",
|
|
"import": "./src/history/index.ts",
|
|
"types": "./src/history/index.ts"
|
|
},
|
|
"./manual-edits-render-script": {
|
|
"bun": "./src/helpers/manualEditsRenderScript.ts",
|
|
"node": "./dist/helpers/manualEditsRenderScript.js",
|
|
"import": "./src/helpers/manualEditsRenderScript.ts",
|
|
"types": "./src/helpers/manualEditsRenderScript.ts"
|
|
},
|
|
"./studio-motion-render-script": {
|
|
"bun": "./src/helpers/studioMotionRenderScript.ts",
|
|
"node": "./dist/helpers/studioMotionRenderScript.js",
|
|
"import": "./src/helpers/studioMotionRenderScript.ts",
|
|
"types": "./src/helpers/studioMotionRenderScript.ts"
|
|
},
|
|
"./draft-markers": {
|
|
"bun": "./src/helpers/draftMarkers.ts",
|
|
"node": "./dist/helpers/draftMarkers.js",
|
|
"import": "./src/helpers/draftMarkers.ts",
|
|
"types": "./src/helpers/draftMarkers.ts"
|
|
},
|
|
"./finite-mutation": {
|
|
"bun": "./src/helpers/finiteMutation.ts",
|
|
"node": "./dist/helpers/finiteMutation.js",
|
|
"import": "./src/helpers/finiteMutation.ts",
|
|
"types": "./src/helpers/finiteMutation.ts"
|
|
},
|
|
"./source-mutation": {
|
|
"bun": "./src/helpers/sourceMutation.ts",
|
|
"node": "./dist/helpers/sourceMutation.js",
|
|
"import": "./src/helpers/sourceMutation.ts",
|
|
"types": "./src/helpers/sourceMutation.ts"
|
|
},
|
|
"./media-codec-map": {
|
|
"bun": "./src/helpers/mediaCodecMap.ts",
|
|
"node": "./dist/helpers/mediaCodecMap.js",
|
|
"import": "./src/helpers/mediaCodecMap.ts",
|
|
"types": "./src/helpers/mediaCodecMap.ts"
|
|
},
|
|
"./proxy-transcoder": {
|
|
"bun": "./src/helpers/proxyTranscoder.ts",
|
|
"node": "./dist/helpers/proxyTranscoder.js",
|
|
"import": "./src/helpers/proxyTranscoder.ts",
|
|
"types": "./src/helpers/proxyTranscoder.ts"
|
|
},
|
|
"./loudness": {
|
|
"bun": "./src/helpers/loudness.ts",
|
|
"node": "./dist/helpers/loudness.js",
|
|
"import": "./src/helpers/loudness.ts",
|
|
"types": "./src/helpers/loudness.ts"
|
|
},
|
|
"./media-proxy-preview": {
|
|
"bun": "./src/helpers/mediaProxyPreview.ts",
|
|
"node": "./dist/helpers/mediaProxyPreview.js",
|
|
"import": "./src/helpers/mediaProxyPreview.ts",
|
|
"types": "./src/helpers/mediaProxyPreview.ts"
|
|
},
|
|
"./encoder-options": {
|
|
"bun": "./src/helpers/encoderOptions.ts",
|
|
"node": "./dist/helpers/encoderOptions.js",
|
|
"import": "./src/helpers/encoderOptions.ts",
|
|
"types": "./src/helpers/encoderOptions.ts"
|
|
},
|
|
"./media-range": {
|
|
"bun": "./src/helpers/mediaRange.ts",
|
|
"node": "./dist/helpers/mediaRange.js",
|
|
"import": "./src/helpers/mediaRange.ts",
|
|
"types": "./src/helpers/mediaRange.ts"
|
|
}
|
|
},
|
|
"publishConfig": {
|
|
"access": "public",
|
|
"exports": {
|
|
".": {
|
|
"import": "./dist/index.js",
|
|
"types": "./dist/index.d.ts"
|
|
},
|
|
"./package.json": "./package.json",
|
|
"./screenshot-clip": {
|
|
"import": "./dist/helpers/screenshotClip.js",
|
|
"types": "./dist/helpers/screenshotClip.d.ts"
|
|
},
|
|
"./safe-path": {
|
|
"import": "./dist/helpers/safePath.js",
|
|
"types": "./dist/helpers/safePath.d.ts"
|
|
},
|
|
"./request-identity": {
|
|
"import": "./dist/helpers/requestIdentity.js",
|
|
"types": "./dist/helpers/requestIdentity.d.ts"
|
|
},
|
|
"./hf-ids": {
|
|
"import": "./dist/helpers/hfIdPersist.js",
|
|
"types": "./dist/helpers/hfIdPersist.d.ts"
|
|
},
|
|
"./history": {
|
|
"import": "./dist/history/index.js",
|
|
"types": "./dist/history/index.d.ts"
|
|
},
|
|
"./manual-edits-render-script": {
|
|
"import": "./dist/helpers/manualEditsRenderScript.js",
|
|
"types": "./dist/helpers/manualEditsRenderScript.d.ts"
|
|
},
|
|
"./studio-motion-render-script": {
|
|
"import": "./dist/helpers/studioMotionRenderScript.js",
|
|
"types": "./dist/helpers/studioMotionRenderScript.d.ts"
|
|
},
|
|
"./draft-markers": {
|
|
"import": "./dist/helpers/draftMarkers.js",
|
|
"types": "./dist/helpers/draftMarkers.d.ts"
|
|
},
|
|
"./finite-mutation": {
|
|
"import": "./dist/helpers/finiteMutation.js",
|
|
"types": "./dist/helpers/finiteMutation.d.ts"
|
|
},
|
|
"./source-mutation": {
|
|
"import": "./dist/helpers/sourceMutation.js",
|
|
"types": "./dist/helpers/sourceMutation.d.ts"
|
|
},
|
|
"./media-codec-map": {
|
|
"import": "./dist/helpers/mediaCodecMap.js",
|
|
"types": "./dist/helpers/mediaCodecMap.d.ts"
|
|
},
|
|
"./proxy-transcoder": {
|
|
"import": "./dist/helpers/proxyTranscoder.js",
|
|
"types": "./dist/helpers/proxyTranscoder.d.ts"
|
|
},
|
|
"./loudness": {
|
|
"import": "./dist/helpers/loudness.js",
|
|
"types": "./dist/helpers/loudness.d.ts"
|
|
},
|
|
"./media-proxy-preview": {
|
|
"import": "./dist/helpers/mediaProxyPreview.js",
|
|
"types": "./dist/helpers/mediaProxyPreview.d.ts"
|
|
},
|
|
"./encoder-options": {
|
|
"import": "./dist/helpers/encoderOptions.js",
|
|
"types": "./dist/helpers/encoderOptions.d.ts"
|
|
},
|
|
"./media-range": {
|
|
"import": "./dist/helpers/mediaRange.js",
|
|
"types": "./dist/helpers/mediaRange.d.ts"
|
|
}
|
|
},
|
|
"main": "./dist/index.js",
|
|
"types": "./dist/index.d.ts"
|
|
},
|
|
"scripts": {
|
|
"build": "tsup",
|
|
"test": "vitest run",
|
|
"test:acorn-writer": "bun scripts/run-acorn-writer-tests.ts",
|
|
"test:watch": "vitest",
|
|
"typecheck": "tsc --noEmit",
|
|
"report:gsap-writers": "bun src/routes/gsapMutationCapabilities.report.ts",
|
|
"prepublishOnly": "echo skip"
|
|
},
|
|
"dependencies": {
|
|
"@hyperframes/core": "workspace:*",
|
|
"@hyperframes/parsers": "workspace:*",
|
|
"hono": "^4.0.0",
|
|
"linkedom": "^0.18.12",
|
|
"postcss": "^8.5.8",
|
|
"postcss-selector-parser": "^7.1.2"
|
|
},
|
|
"devDependencies": {
|
|
"@types/node": "^25.0.10",
|
|
"tsup": "^8.0.0",
|
|
"tsx": "^4.21.0",
|
|
"typescript": "^5.0.0",
|
|
"vitest": "^4.1.11"
|
|
},
|
|
"optionalDependencies": {
|
|
"sharp": "^0.35.0"
|
|
}
|
|
}
|