shelfware 0.0.1 → 0.1.1
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/.output/nitro.json +15 -0
- package/.output/public/_nuxt/6IstVYrV.js +1 -0
- package/.output/public/_nuxt/9C5WUlLE.js +36 -0
- package/.output/public/_nuxt/BDNMzG2s.js +1 -0
- package/.output/public/_nuxt/BW3xJdEx.js +1 -0
- package/.output/public/_nuxt/BXXtFil5.js +1 -0
- package/.output/public/_nuxt/BZuUK3cr.js +1 -0
- package/.output/public/_nuxt/BeLyMmd4.js +1 -0
- package/.output/public/_nuxt/C_VgD9ZI.js +3 -0
- package/.output/public/_nuxt/DB5Vxbte.js +2 -0
- package/.output/public/_nuxt/DMg0j7gv.js +14 -0
- package/.output/public/_nuxt/builds/latest.json +1 -0
- package/.output/public/_nuxt/builds/meta/e0d2b6a3-3a30-44b7-8c79-a56f66400005.json +1 -0
- package/.output/public/_nuxt/entry.b3_DJTEt.css +2 -0
- package/.output/public/_nuxt/error-404.CHsn7XF-.css +1 -0
- package/.output/public/_nuxt/error-500.Bawx2bLr.css +1 -0
- package/.output/server/chunks/_/api-handler.mjs +44 -0
- package/.output/server/chunks/_/batch.mjs +27 -0
- package/.output/server/chunks/_/catalog.mjs +1115 -0
- package/.output/server/chunks/_/detail.mjs +16 -0
- package/.output/server/chunks/_/error-500.mjs +19 -0
- package/.output/server/chunks/_/quarantine.mjs +159 -0
- package/.output/server/chunks/nitro/nitro.mjs +5399 -0
- package/.output/server/chunks/routes/api/_..._.mjs +16 -0
- package/.output/server/chunks/routes/api/health.get.mjs +13 -0
- package/.output/server/chunks/routes/api/skills/_id/file.get.mjs +25 -0
- package/.output/server/chunks/routes/api/skills/_id_.get.mjs +25 -0
- package/.output/server/chunks/routes/api/skills/_id_.put.mjs +74 -0
- package/.output/server/chunks/routes/api/skills/delete.post.mjs +48 -0
- package/.output/server/chunks/routes/api/skills/quarantine.post.mjs +26 -0
- package/.output/server/chunks/routes/api/skills/restore.post.mjs +26 -0
- package/.output/server/chunks/routes/api/skills.get.mjs +41 -0
- package/.output/server/chunks/routes/renderer.mjs +341 -0
- package/.output/server/chunks/virtual/_virtual_spa-template.mjs +3 -0
- package/.output/server/chunks/virtual/precomputed.mjs +3 -0
- package/.output/server/index.mjs +9 -0
- package/.output/server/node_modules/@babel/parser/lib/index.js +14611 -0
- package/.output/server/node_modules/@babel/parser/package.json +50 -0
- package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +6801 -0
- package/.output/server/node_modules/@vue/compiler-core/package.json +58 -0
- package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +692 -0
- package/.output/server/node_modules/@vue/compiler-dom/package.json +57 -0
- package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1420 -0
- package/.output/server/node_modules/@vue/compiler-ssr/package.json +34 -0
- package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +1903 -0
- package/.output/server/node_modules/@vue/reactivity/package.json +55 -0
- package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +6980 -0
- package/.output/server/node_modules/@vue/runtime-core/package.json +52 -0
- package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +1867 -0
- package/.output/server/node_modules/@vue/runtime-dom/package.json +60 -0
- package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +904 -0
- package/.output/server/node_modules/@vue/server-renderer/package.json +53 -0
- package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +636 -0
- package/.output/server/node_modules/@vue/shared/package.json +47 -0
- package/.output/server/node_modules/devalue/index.js +17 -0
- package/.output/server/node_modules/devalue/package.json +39 -0
- package/.output/server/node_modules/devalue/src/base64.js +60 -0
- package/.output/server/node_modules/devalue/src/constants.js +12 -0
- package/.output/server/node_modules/devalue/src/operations.js +193 -0
- package/.output/server/node_modules/devalue/src/parse.js +274 -0
- package/.output/server/node_modules/devalue/src/stringify.js +428 -0
- package/.output/server/node_modules/devalue/src/uneval.js +606 -0
- package/.output/server/node_modules/devalue/src/utils.js +185 -0
- package/.output/server/node_modules/entities/dist/commonjs/decode-codepoint.js +77 -0
- package/.output/server/node_modules/entities/dist/commonjs/decode.js +568 -0
- package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-html.js +7 -0
- package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +7 -0
- package/.output/server/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js +21 -0
- package/.output/server/node_modules/entities/dist/commonjs/internal/decode-shared.js +31 -0
- package/.output/server/node_modules/entities/dist/commonjs/package.json +3 -0
- package/.output/server/node_modules/entities/package.json +120 -0
- package/.output/server/node_modules/estree-walker/dist/umd/estree-walker.js +344 -0
- package/.output/server/node_modules/estree-walker/package.json +37 -0
- package/.output/server/node_modules/hookable/dist/index.mjs +257 -0
- package/.output/server/node_modules/hookable/package.json +53 -0
- package/.output/server/node_modules/nostics/dist/formatters/ansi.mjs +19 -0
- package/.output/server/node_modules/nostics/dist/index.mjs +187 -0
- package/.output/server/node_modules/nostics/package.json +125 -0
- package/.output/server/node_modules/source-map-js/lib/array-set.js +121 -0
- package/.output/server/node_modules/source-map-js/lib/base64-vlq.js +140 -0
- package/.output/server/node_modules/source-map-js/lib/base64.js +67 -0
- package/.output/server/node_modules/source-map-js/lib/binary-search.js +111 -0
- package/.output/server/node_modules/source-map-js/lib/mapping-list.js +79 -0
- package/.output/server/node_modules/source-map-js/lib/quick-sort.js +132 -0
- package/.output/server/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
- package/.output/server/node_modules/source-map-js/lib/source-map-generator.js +444 -0
- package/.output/server/node_modules/source-map-js/lib/source-node.js +413 -0
- package/.output/server/node_modules/source-map-js/lib/util.js +594 -0
- package/.output/server/node_modules/source-map-js/package.json +71 -0
- package/.output/server/node_modules/source-map-js/source-map.js +8 -0
- package/.output/server/node_modules/ufo/dist/index.mjs +645 -0
- package/.output/server/node_modules/ufo/package.json +48 -0
- package/.output/server/node_modules/unhead/dist/client.mjs +22 -0
- package/.output/server/node_modules/unhead/dist/legacy.mjs +33 -0
- package/.output/server/node_modules/unhead/dist/minify.mjs +183 -0
- package/.output/server/node_modules/unhead/dist/parser.mjs +518 -0
- package/.output/server/node_modules/unhead/dist/plugins.mjs +720 -0
- package/.output/server/node_modules/unhead/dist/server.mjs +99 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.-hZVKou0.mjs +400 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.BEmVMkeA.mjs +673 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.BGFxPGPQ.mjs +47 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.BQWSw36o.mjs +192 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.Bf_fPVYA.mjs +6 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.Bjbp1C8D.mjs +224 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.Bm4Y6XQI.mjs +17 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.C5Bksi2B.mjs +49 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.CGPOfp5O.mjs +32 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.CHEy9ana.mjs +7 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.D7HkBzZn.mjs +59 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.Dssd7L5I.mjs +196 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.jEy9BmRq.mjs +264 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.oZ7pkTV1.mjs +19 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.tQnRaXfX.mjs +240 -0
- package/.output/server/node_modules/unhead/dist/stream/client.mjs +33 -0
- package/.output/server/node_modules/unhead/dist/stream/iife.mjs +2 -0
- package/.output/server/node_modules/unhead/dist/stream/server.mjs +445 -0
- package/.output/server/node_modules/unhead/dist/utils.mjs +7 -0
- package/.output/server/node_modules/unhead/package.json +179 -0
- package/.output/server/node_modules/vue/dist/vue.cjs.js +80 -0
- package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +66 -0
- package/.output/server/node_modules/vue/index.js +7 -0
- package/.output/server/node_modules/vue/index.mjs +1 -0
- package/.output/server/node_modules/vue/package.json +112 -0
- package/.output/server/node_modules/vue/server-renderer/index.mjs +1 -0
- package/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +278 -0
- package/.output/server/node_modules/vue-bundle-renderer/package.json +54 -0
- package/.output/server/node_modules/yaml/dist/compose/compose-collection.js +90 -0
- package/.output/server/node_modules/yaml/dist/compose/compose-doc.js +45 -0
- package/.output/server/node_modules/yaml/dist/compose/compose-node.js +112 -0
- package/.output/server/node_modules/yaml/dist/compose/compose-scalar.js +88 -0
- package/.output/server/node_modules/yaml/dist/compose/composer.js +224 -0
- package/.output/server/node_modules/yaml/dist/compose/resolve-block-map.js +117 -0
- package/.output/server/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
- package/.output/server/node_modules/yaml/dist/compose/resolve-block-seq.js +51 -0
- package/.output/server/node_modules/yaml/dist/compose/resolve-end.js +39 -0
- package/.output/server/node_modules/yaml/dist/compose/resolve-flow-collection.js +209 -0
- package/.output/server/node_modules/yaml/dist/compose/resolve-flow-scalar.js +227 -0
- package/.output/server/node_modules/yaml/dist/compose/resolve-props.js +148 -0
- package/.output/server/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
- package/.output/server/node_modules/yaml/dist/compose/util-empty-scalar-position.js +28 -0
- package/.output/server/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
- package/.output/server/node_modules/yaml/dist/compose/util-map-includes.js +15 -0
- package/.output/server/node_modules/yaml/dist/doc/Document.js +337 -0
- package/.output/server/node_modules/yaml/dist/doc/anchors.js +76 -0
- package/.output/server/node_modules/yaml/dist/doc/applyReviver.js +57 -0
- package/.output/server/node_modules/yaml/dist/doc/createNode.js +90 -0
- package/.output/server/node_modules/yaml/dist/doc/directives.js +178 -0
- package/.output/server/node_modules/yaml/dist/errors.js +62 -0
- package/.output/server/node_modules/yaml/dist/index.js +50 -0
- package/.output/server/node_modules/yaml/dist/log.js +19 -0
- package/.output/server/node_modules/yaml/dist/nodes/Alias.js +118 -0
- package/.output/server/node_modules/yaml/dist/nodes/Collection.js +151 -0
- package/.output/server/node_modules/yaml/dist/nodes/Node.js +40 -0
- package/.output/server/node_modules/yaml/dist/nodes/Pair.js +39 -0
- package/.output/server/node_modules/yaml/dist/nodes/Scalar.js +27 -0
- package/.output/server/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
- package/.output/server/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
- package/.output/server/node_modules/yaml/dist/nodes/addPairToJSMap.js +65 -0
- package/.output/server/node_modules/yaml/dist/nodes/identity.js +53 -0
- package/.output/server/node_modules/yaml/dist/nodes/toJS.js +39 -0
- package/.output/server/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
- package/.output/server/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
- package/.output/server/node_modules/yaml/dist/parse/cst-visit.js +99 -0
- package/.output/server/node_modules/yaml/dist/parse/cst.js +112 -0
- package/.output/server/node_modules/yaml/dist/parse/lexer.js +723 -0
- package/.output/server/node_modules/yaml/dist/parse/line-counter.js +41 -0
- package/.output/server/node_modules/yaml/dist/parse/parser.js +980 -0
- package/.output/server/node_modules/yaml/dist/public-api.js +107 -0
- package/.output/server/node_modules/yaml/dist/schema/Schema.js +39 -0
- package/.output/server/node_modules/yaml/dist/schema/common/map.js +19 -0
- package/.output/server/node_modules/yaml/dist/schema/common/null.js +17 -0
- package/.output/server/node_modules/yaml/dist/schema/common/seq.js +19 -0
- package/.output/server/node_modules/yaml/dist/schema/common/string.js +16 -0
- package/.output/server/node_modules/yaml/dist/schema/core/bool.js +21 -0
- package/.output/server/node_modules/yaml/dist/schema/core/float.js +47 -0
- package/.output/server/node_modules/yaml/dist/schema/core/int.js +42 -0
- package/.output/server/node_modules/yaml/dist/schema/core/schema.js +25 -0
- package/.output/server/node_modules/yaml/dist/schema/json/schema.js +64 -0
- package/.output/server/node_modules/yaml/dist/schema/tags.js +99 -0
- package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/binary.js +70 -0
- package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
- package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
- package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
- package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/merge.js +71 -0
- package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
- package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
- package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/schema.js +41 -0
- package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
- package/.output/server/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
- package/.output/server/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
- package/.output/server/node_modules/yaml/dist/stringify/stringify.js +132 -0
- package/.output/server/node_modules/yaml/dist/stringify/stringifyCollection.js +155 -0
- package/.output/server/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
- package/.output/server/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
- package/.output/server/node_modules/yaml/dist/stringify/stringifyNumber.js +27 -0
- package/.output/server/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
- package/.output/server/node_modules/yaml/dist/stringify/stringifyString.js +338 -0
- package/.output/server/node_modules/yaml/dist/visit.js +236 -0
- package/.output/server/node_modules/yaml/package.json +97 -0
- package/.output/server/package.json +28 -0
- package/LICENSE +21 -0
- package/README.md +57 -1
- package/bin/launch.mjs +216 -0
- package/bin/shelfware.mjs +11 -0
- package/package.json +64 -5
- package/cli.mjs +0 -3
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { d as defineApiHandler, f as fail } from '../../_/api-handler.mjs';
|
|
2
|
+
import '../../nitro/nitro.mjs';
|
|
3
|
+
import 'node:http';
|
|
4
|
+
import 'node:https';
|
|
5
|
+
import 'node:events';
|
|
6
|
+
import 'node:buffer';
|
|
7
|
+
import 'node:fs';
|
|
8
|
+
import 'node:path';
|
|
9
|
+
import 'node:crypto';
|
|
10
|
+
import 'node:url';
|
|
11
|
+
|
|
12
|
+
const _____ = defineApiHandler(() => {
|
|
13
|
+
throw fail(404, "Not found");
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export { _____ as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { d as defineEventHandler } from '../../nitro/nitro.mjs';
|
|
2
|
+
import 'node:http';
|
|
3
|
+
import 'node:https';
|
|
4
|
+
import 'node:events';
|
|
5
|
+
import 'node:buffer';
|
|
6
|
+
import 'node:fs';
|
|
7
|
+
import 'node:path';
|
|
8
|
+
import 'node:crypto';
|
|
9
|
+
import 'node:url';
|
|
10
|
+
|
|
11
|
+
const health_get = defineEventHandler(() => ({ ok: true }));
|
|
12
|
+
|
|
13
|
+
export { health_get as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { g as getQuery, a as getRouterParam } from '../../../../nitro/nitro.mjs';
|
|
2
|
+
import { d as defineApiHandler, f as fail } from '../../../../_/api-handler.mjs';
|
|
3
|
+
import { g as getIndex, d as readSkillFile } from '../../../../_/catalog.mjs';
|
|
4
|
+
import 'node:http';
|
|
5
|
+
import 'node:https';
|
|
6
|
+
import 'node:events';
|
|
7
|
+
import 'node:buffer';
|
|
8
|
+
import 'node:fs';
|
|
9
|
+
import 'node:path';
|
|
10
|
+
import 'node:crypto';
|
|
11
|
+
import 'node:url';
|
|
12
|
+
import 'node:os';
|
|
13
|
+
import 'yaml';
|
|
14
|
+
|
|
15
|
+
const file_get = defineApiHandler((event) => {
|
|
16
|
+
var _a;
|
|
17
|
+
const rel = String(getQuery(event).path || "");
|
|
18
|
+
if (!rel) throw fail(400, "Missing path");
|
|
19
|
+
const id = (_a = getRouterParam(event, "id")) != null ? _a : "";
|
|
20
|
+
const summary = getIndex().byId.get(id);
|
|
21
|
+
if (!summary) throw fail(404, "Skill not in the cabinet");
|
|
22
|
+
return readSkillFile(summary, rel);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export { file_get as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { a as getRouterParam } from '../../../nitro/nitro.mjs';
|
|
2
|
+
import { d as defineApiHandler, f as fail } from '../../../_/api-handler.mjs';
|
|
3
|
+
import { g as getIndex } from '../../../_/catalog.mjs';
|
|
4
|
+
import { s as skillDetailFor } from '../../../_/detail.mjs';
|
|
5
|
+
import 'node:http';
|
|
6
|
+
import 'node:https';
|
|
7
|
+
import 'node:events';
|
|
8
|
+
import 'node:buffer';
|
|
9
|
+
import 'node:fs';
|
|
10
|
+
import 'node:path';
|
|
11
|
+
import 'node:crypto';
|
|
12
|
+
import 'node:url';
|
|
13
|
+
import 'node:os';
|
|
14
|
+
import 'yaml';
|
|
15
|
+
import '../../../_/quarantine.mjs';
|
|
16
|
+
|
|
17
|
+
const _id__get = defineApiHandler((event) => {
|
|
18
|
+
var _a;
|
|
19
|
+
const id = (_a = getRouterParam(event, "id")) != null ? _a : "";
|
|
20
|
+
const summary = getIndex().byId.get(id);
|
|
21
|
+
if (!summary) throw fail(404, "Skill not in the cabinet");
|
|
22
|
+
return skillDetailFor(summary);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export { _id__get as default };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { a as getRouterParam, r as readBody } from '../../../nitro/nitro.mjs';
|
|
2
|
+
import { f as fail, d as defineApiHandler } from '../../../_/api-handler.mjs';
|
|
3
|
+
import { a as assertSkillTarget, r as realPath, c as contained, h as homeOf, g as getIndex, i as invalidate } from '../../../_/catalog.mjs';
|
|
4
|
+
import { s as skillDetailFor } from '../../../_/detail.mjs';
|
|
5
|
+
import nodeCrypto from 'node:crypto';
|
|
6
|
+
import fs from 'node:fs';
|
|
7
|
+
import 'node:http';
|
|
8
|
+
import 'node:https';
|
|
9
|
+
import 'node:events';
|
|
10
|
+
import 'node:buffer';
|
|
11
|
+
import 'node:path';
|
|
12
|
+
import 'node:url';
|
|
13
|
+
import 'node:os';
|
|
14
|
+
import 'yaml';
|
|
15
|
+
import '../../../_/quarantine.mjs';
|
|
16
|
+
|
|
17
|
+
function sha256(data) {
|
|
18
|
+
return nodeCrypto.createHash("sha256").update(typeof data === "string" ? Buffer.from(data, "utf8") : data).digest("hex");
|
|
19
|
+
}
|
|
20
|
+
function saveSkillSource(summary, input, roots, opts) {
|
|
21
|
+
if (summary.physicality === "broken") throw fail(400, "Nothing to edit: the link target is gone");
|
|
22
|
+
assertSkillTarget(summary, roots, "edit", opts);
|
|
23
|
+
const target = realPath(summary.skillFile);
|
|
24
|
+
if (!summary.file) {
|
|
25
|
+
const dir = realPath(summary.path);
|
|
26
|
+
if (target === dir || !contained(target, dir)) throw fail(400, "Skill file escapes its directory");
|
|
27
|
+
}
|
|
28
|
+
if (!contained(target, realPath(homeOf(opts)))) throw fail(400, "Skill file escapes the home directory");
|
|
29
|
+
let current;
|
|
30
|
+
let mode;
|
|
31
|
+
try {
|
|
32
|
+
const st = fs.statSync(target);
|
|
33
|
+
mode = st.mode & 4095;
|
|
34
|
+
current = fs.readFileSync(target);
|
|
35
|
+
} catch {
|
|
36
|
+
throw fail(404, "Skill file not found");
|
|
37
|
+
}
|
|
38
|
+
const currentHash = sha256(current);
|
|
39
|
+
if (currentHash !== input.baseHash) {
|
|
40
|
+
throw fail(409, "File changed on disk since it was loaded", { currentHash });
|
|
41
|
+
}
|
|
42
|
+
const tmp = `${target}.${process.pid}.tmp`;
|
|
43
|
+
try {
|
|
44
|
+
fs.writeFileSync(tmp, input.source, { encoding: "utf8", mode });
|
|
45
|
+
fs.chmodSync(tmp, mode);
|
|
46
|
+
fs.renameSync(tmp, target);
|
|
47
|
+
} catch (err) {
|
|
48
|
+
try {
|
|
49
|
+
fs.rmSync(tmp, { force: true });
|
|
50
|
+
} catch {
|
|
51
|
+
}
|
|
52
|
+
throw err;
|
|
53
|
+
}
|
|
54
|
+
return { path: target, contentHash: sha256(input.source) };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const _id__put = defineApiHandler(async (event) => {
|
|
58
|
+
var _a;
|
|
59
|
+
const id = (_a = getRouterParam(event, "id")) != null ? _a : "";
|
|
60
|
+
const body = await readBody(event);
|
|
61
|
+
if (typeof (body == null ? void 0 : body.source) !== "string" || typeof (body == null ? void 0 : body.baseHash) !== "string") {
|
|
62
|
+
throw fail(400, "Expected { source, baseHash }");
|
|
63
|
+
}
|
|
64
|
+
const index = getIndex({ force: true });
|
|
65
|
+
const summary = index.byId.get(id);
|
|
66
|
+
if (!summary) throw fail(404, "Skill not in the cabinet");
|
|
67
|
+
saveSkillSource(summary, { source: body.source, baseHash: body.baseHash }, index.roots);
|
|
68
|
+
invalidate();
|
|
69
|
+
const fresh = getIndex({ force: true }).byId.get(id);
|
|
70
|
+
if (!fresh) throw fail(500, "Skill vanished after save");
|
|
71
|
+
return skillDetailFor(fresh);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
export { _id__put as default };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { r as readBody } from '../../../nitro/nitro.mjs';
|
|
2
|
+
import { d as defineApiHandler, f as fail } from '../../../_/api-handler.mjs';
|
|
3
|
+
import { i as idsFrom, e as errorMessage } from '../../../_/batch.mjs';
|
|
4
|
+
import { g as getIndex, e as assertDeletable, f as deleteSkillDir, i as invalidate } from '../../../_/catalog.mjs';
|
|
5
|
+
import { f as forgetQuarantinePath } from '../../../_/quarantine.mjs';
|
|
6
|
+
import 'node:http';
|
|
7
|
+
import 'node:https';
|
|
8
|
+
import 'node:events';
|
|
9
|
+
import 'node:buffer';
|
|
10
|
+
import 'node:fs';
|
|
11
|
+
import 'node:path';
|
|
12
|
+
import 'node:crypto';
|
|
13
|
+
import 'node:url';
|
|
14
|
+
import 'node:os';
|
|
15
|
+
import 'yaml';
|
|
16
|
+
|
|
17
|
+
const delete_post = defineApiHandler(async (event) => {
|
|
18
|
+
const body = await readBody(event);
|
|
19
|
+
const ids = idsFrom(body);
|
|
20
|
+
if (!ids.length) throw fail(400, "No cards selected");
|
|
21
|
+
const force = (body == null ? void 0 : body.force) === true;
|
|
22
|
+
const index = getIndex({ force: true });
|
|
23
|
+
const deleted = [];
|
|
24
|
+
const errors = [];
|
|
25
|
+
for (const id of ids) {
|
|
26
|
+
const summary = index.byId.get(id);
|
|
27
|
+
if (!summary) {
|
|
28
|
+
errors.push({ id, error: "Skill not in the cabinet" });
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (!summary.quarantined && !force) {
|
|
32
|
+
errors.push({ id, path: summary.path, error: "Not quarantined; pass force to delete a live card" });
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
try {
|
|
36
|
+
const target = assertDeletable(summary, index.roots);
|
|
37
|
+
deleteSkillDir(target);
|
|
38
|
+
forgetQuarantinePath(target);
|
|
39
|
+
deleted.push({ id, path: target, name: summary.name });
|
|
40
|
+
} catch (err) {
|
|
41
|
+
errors.push({ id, error: errorMessage(err), path: summary.path });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
invalidate();
|
|
45
|
+
return { deleted, errors };
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export { delete_post as default };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { r as readBody } from '../../../nitro/nitro.mjs';
|
|
2
|
+
import { d as defineApiHandler, f as fail } from '../../../_/api-handler.mjs';
|
|
3
|
+
import { i as idsFrom, r as runOnIds } from '../../../_/batch.mjs';
|
|
4
|
+
import { g as getIndex, i as invalidate } from '../../../_/catalog.mjs';
|
|
5
|
+
import { a as quarantineSkill } from '../../../_/quarantine.mjs';
|
|
6
|
+
import 'node:http';
|
|
7
|
+
import 'node:https';
|
|
8
|
+
import 'node:events';
|
|
9
|
+
import 'node:buffer';
|
|
10
|
+
import 'node:fs';
|
|
11
|
+
import 'node:path';
|
|
12
|
+
import 'node:crypto';
|
|
13
|
+
import 'node:url';
|
|
14
|
+
import 'node:os';
|
|
15
|
+
import 'yaml';
|
|
16
|
+
|
|
17
|
+
const quarantine_post = defineApiHandler(async (event) => {
|
|
18
|
+
const ids = idsFrom(await readBody(event));
|
|
19
|
+
if (!ids.length) throw fail(400, "No cards selected");
|
|
20
|
+
const index = getIndex({ force: true });
|
|
21
|
+
const { done, errors } = runOnIds(ids, index, (summary, roots) => quarantineSkill(summary, roots));
|
|
22
|
+
invalidate();
|
|
23
|
+
return { quarantined: done, errors };
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export { quarantine_post as default };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { r as readBody } from '../../../nitro/nitro.mjs';
|
|
2
|
+
import { d as defineApiHandler, f as fail } from '../../../_/api-handler.mjs';
|
|
3
|
+
import { i as idsFrom, r as runOnIds } from '../../../_/batch.mjs';
|
|
4
|
+
import { g as getIndex, i as invalidate } from '../../../_/catalog.mjs';
|
|
5
|
+
import { r as restoreSkill } from '../../../_/quarantine.mjs';
|
|
6
|
+
import 'node:http';
|
|
7
|
+
import 'node:https';
|
|
8
|
+
import 'node:events';
|
|
9
|
+
import 'node:buffer';
|
|
10
|
+
import 'node:fs';
|
|
11
|
+
import 'node:path';
|
|
12
|
+
import 'node:crypto';
|
|
13
|
+
import 'node:url';
|
|
14
|
+
import 'node:os';
|
|
15
|
+
import 'yaml';
|
|
16
|
+
|
|
17
|
+
const restore_post = defineApiHandler(async (event) => {
|
|
18
|
+
const ids = idsFrom(await readBody(event));
|
|
19
|
+
if (!ids.length) throw fail(400, "No cards selected");
|
|
20
|
+
const index = getIndex({ force: true });
|
|
21
|
+
const { done, errors } = runOnIds(ids, index, (summary, roots) => restoreSkill(summary, roots));
|
|
22
|
+
invalidate();
|
|
23
|
+
return { restored: done, errors };
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export { restore_post as default };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { g as getQuery } from '../../nitro/nitro.mjs';
|
|
2
|
+
import { d as defineApiHandler } from '../../_/api-handler.mjs';
|
|
3
|
+
import { g as getIndex, t as toCatalogSkill, q as quarantineRoot, s as scannedAt, h as homeOf } from '../../_/catalog.mjs';
|
|
4
|
+
import 'node:http';
|
|
5
|
+
import 'node:https';
|
|
6
|
+
import 'node:events';
|
|
7
|
+
import 'node:buffer';
|
|
8
|
+
import 'node:fs';
|
|
9
|
+
import 'node:path';
|
|
10
|
+
import 'node:crypto';
|
|
11
|
+
import 'node:url';
|
|
12
|
+
import 'node:os';
|
|
13
|
+
import 'yaml';
|
|
14
|
+
|
|
15
|
+
const skills_get = defineApiHandler((event) => {
|
|
16
|
+
const force = getQuery(event).refresh === "1";
|
|
17
|
+
const index = getIndex({ force });
|
|
18
|
+
const live = index.skills.filter((skill) => !skill.quarantined);
|
|
19
|
+
const scopes = [];
|
|
20
|
+
const byScope = /* @__PURE__ */ new Map();
|
|
21
|
+
for (const skill of live) {
|
|
22
|
+
let scope = byScope.get(skill.scopeId);
|
|
23
|
+
if (!scope) {
|
|
24
|
+
scope = { id: skill.scopeId, label: skill.scopeLabel, kind: skill.kind, count: 0 };
|
|
25
|
+
byScope.set(skill.scopeId, scope);
|
|
26
|
+
scopes.push(scope);
|
|
27
|
+
}
|
|
28
|
+
scope.count += 1;
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
home: homeOf(),
|
|
32
|
+
scannedAt: scannedAt(),
|
|
33
|
+
quarantineRoot: quarantineRoot(),
|
|
34
|
+
total: live.length,
|
|
35
|
+
census: index.census,
|
|
36
|
+
scopes,
|
|
37
|
+
skills: index.skills.map(toCatalogSkill)
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export { skills_get as default };
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import { u as useRuntimeConfig, e as encodePath, j as joinRelativeURL, b as defineRenderHandler, g as getQuery, c as createError, f as destr, h as getRouteRules, k as relative, l as joinURL, m as getResponseStatusText, n as getResponseStatus, o as useNitroApp } from '../nitro/nitro.mjs';
|
|
2
|
+
import { createHead as createHead$1, propsToString, renderSSRHead } from 'unhead/server';
|
|
3
|
+
import { isRef, toValue } from 'vue';
|
|
4
|
+
import { DeprecationsPlugin } from 'unhead/legacy';
|
|
5
|
+
import { PromisesPlugin, TemplateParamsPlugin, AliasSortingPlugin } from 'unhead/plugins';
|
|
6
|
+
import { createRenderer, getRequestDependencies, getPreloadLinks, getPrefetchLinks } from 'vue-bundle-renderer/runtime';
|
|
7
|
+
import { stringify, uneval } from 'devalue';
|
|
8
|
+
import 'node:http';
|
|
9
|
+
import 'node:https';
|
|
10
|
+
import 'node:events';
|
|
11
|
+
import 'node:buffer';
|
|
12
|
+
import 'node:fs';
|
|
13
|
+
import 'node:path';
|
|
14
|
+
import 'node:crypto';
|
|
15
|
+
import 'node:url';
|
|
16
|
+
|
|
17
|
+
const NUXT_RUNTIME_PAYLOAD_EXTRACTION = false;
|
|
18
|
+
const NUXT_SSR_STREAMING = false;
|
|
19
|
+
|
|
20
|
+
const headSymbol = "usehead";
|
|
21
|
+
// @__NO_SIDE_EFFECTS__
|
|
22
|
+
function vueInstall(head) {
|
|
23
|
+
const plugin = {
|
|
24
|
+
install(app) {
|
|
25
|
+
app.config.globalProperties.$unhead = head;
|
|
26
|
+
app.config.globalProperties.$head = head;
|
|
27
|
+
app.provide(headSymbol, head);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
return plugin.install;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const VueResolver = /* @__PURE__ */ Object.assign(
|
|
34
|
+
(_, value) => isRef(value) ? toValue(value) : value,
|
|
35
|
+
// identity for plain non-reactive values, so the SSR default init entry
|
|
36
|
+
// keeps its precomputed fast path (see unhead/server createHead)
|
|
37
|
+
{ _static: true }
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
// @__NO_SIDE_EFFECTS__
|
|
41
|
+
function createHead(options = {}) {
|
|
42
|
+
const head = createHead$1({
|
|
43
|
+
...options,
|
|
44
|
+
propResolvers: [VueResolver]
|
|
45
|
+
});
|
|
46
|
+
head.install = vueInstall(head);
|
|
47
|
+
return head;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const legacyPlugins = [DeprecationsPlugin, PromisesPlugin, TemplateParamsPlugin, AliasSortingPlugin];
|
|
51
|
+
|
|
52
|
+
const unheadOptions = {
|
|
53
|
+
disableDefaults: true,
|
|
54
|
+
plugins: legacyPlugins,
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
function encodeEventPath(path) {
|
|
58
|
+
const queryIndex = path.indexOf("?");
|
|
59
|
+
if (queryIndex === -1) return encodePath(path);
|
|
60
|
+
return encodePath(path.slice(0, queryIndex)) + path.slice(queryIndex);
|
|
61
|
+
}
|
|
62
|
+
function createSSRContext(event) {
|
|
63
|
+
const url = encodeEventPath(event.path);
|
|
64
|
+
const ssrContext = {
|
|
65
|
+
url,
|
|
66
|
+
event,
|
|
67
|
+
runtimeConfig: useRuntimeConfig(event),
|
|
68
|
+
noSSR: true,
|
|
69
|
+
head: createHead(unheadOptions),
|
|
70
|
+
error: false,
|
|
71
|
+
nuxt: void 0,
|
|
72
|
+
payload: {},
|
|
73
|
+
["~payloadReducers"]: Object.create(null),
|
|
74
|
+
modules: /* @__PURE__ */ new Set()
|
|
75
|
+
};
|
|
76
|
+
return ssrContext;
|
|
77
|
+
}
|
|
78
|
+
function setSSRError(ssrContext, error) {
|
|
79
|
+
ssrContext.error = true;
|
|
80
|
+
ssrContext.payload = { error };
|
|
81
|
+
ssrContext.url = error.url;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function buildAssetsDir() {
|
|
85
|
+
return useRuntimeConfig().app.buildAssetsDir;
|
|
86
|
+
}
|
|
87
|
+
function buildAssetsURL(...path) {
|
|
88
|
+
return joinRelativeURL(publicAssetsURL(), buildAssetsDir(), ...path);
|
|
89
|
+
}
|
|
90
|
+
function publicAssetsURL(...path) {
|
|
91
|
+
const app = useRuntimeConfig().app;
|
|
92
|
+
const publicBase = app.cdnURL || app.baseURL;
|
|
93
|
+
return path.length ? joinRelativeURL(publicBase, ...path) : publicBase;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
//#region src/runtime/utils/renderer/cache.ts
|
|
97
|
+
function lazyCachedFunction(fn) {
|
|
98
|
+
let res = null;
|
|
99
|
+
return () => {
|
|
100
|
+
if (res === null) res = fn().catch((err) => {
|
|
101
|
+
res = null;
|
|
102
|
+
throw err;
|
|
103
|
+
});
|
|
104
|
+
return res;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const appHead = {"meta":[{"name":"viewport","content":"width=device-width, initial-scale=1"},{"charset":"utf-8"}],"link":[],"style":[],"script":[],"noscript":[],"title":"shelfware"};
|
|
109
|
+
|
|
110
|
+
const appRootTag = "div";
|
|
111
|
+
|
|
112
|
+
const appRootAttrs = {"id":"__nuxt","class":"isolate"};
|
|
113
|
+
|
|
114
|
+
const appTeleportTag = "div";
|
|
115
|
+
|
|
116
|
+
const appTeleportAttrs = {"id":"teleports"};
|
|
117
|
+
|
|
118
|
+
const appSpaLoaderTag = "div";
|
|
119
|
+
|
|
120
|
+
const appSpaLoaderAttrs = {"id":"__nuxt-loader"};
|
|
121
|
+
|
|
122
|
+
const appId = "nuxt-app";
|
|
123
|
+
|
|
124
|
+
//#region src/runtime/utils/renderer/build-files.ts
|
|
125
|
+
globalThis.__buildAssetsURL = buildAssetsURL;
|
|
126
|
+
globalThis.__publicAssetsURL = publicAssetsURL;
|
|
127
|
+
const APP_ROOT_OPEN_TAG = `<${appRootTag}${propsToString(appRootAttrs)}>`;
|
|
128
|
+
const APP_ROOT_CLOSE_TAG = `</${appRootTag}>`;
|
|
129
|
+
const getPrecomputedDependencies = () => import('../virtual/precomputed.mjs').then((r) => "default" in r ? r.default : r).then((r) => typeof r === "function" ? r() : r);
|
|
130
|
+
const getSPARenderer = lazyCachedFunction(async () => {
|
|
131
|
+
const precomputed = await getPrecomputedDependencies();
|
|
132
|
+
const spaTemplate = await import('../virtual/_virtual_spa-template.mjs').then((r) => r.template).catch(() => "").then((r) => {
|
|
133
|
+
{
|
|
134
|
+
const APP_SPA_LOADER_OPEN_TAG = `<${appSpaLoaderTag}${propsToString(appSpaLoaderAttrs)}>`;
|
|
135
|
+
const APP_SPA_LOADER_CLOSE_TAG = `</${appSpaLoaderTag}>`;
|
|
136
|
+
return APP_ROOT_OPEN_TAG + APP_ROOT_CLOSE_TAG + (r ? APP_SPA_LOADER_OPEN_TAG + r + APP_SPA_LOADER_CLOSE_TAG : "");
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
const renderer = createRenderer(() => () => {}, {
|
|
140
|
+
precomputed,
|
|
141
|
+
manifest: void 0,
|
|
142
|
+
renderToString: () => spaTemplate,
|
|
143
|
+
buildAssetsURL
|
|
144
|
+
});
|
|
145
|
+
const result = await renderer.renderToString({});
|
|
146
|
+
const renderToString = (ssrContext) => {
|
|
147
|
+
const config = useRuntimeConfig(ssrContext.event);
|
|
148
|
+
ssrContext.modules ||= /* @__PURE__ */ new Set();
|
|
149
|
+
ssrContext.payload.serverRendered = false;
|
|
150
|
+
ssrContext.config = {
|
|
151
|
+
public: config.public,
|
|
152
|
+
app: config.app
|
|
153
|
+
};
|
|
154
|
+
return Promise.resolve(result);
|
|
155
|
+
};
|
|
156
|
+
return {
|
|
157
|
+
rendererContext: renderer.rendererContext,
|
|
158
|
+
renderToString
|
|
159
|
+
};
|
|
160
|
+
});
|
|
161
|
+
function getRenderer(ssrContext) {
|
|
162
|
+
return getSPARenderer() ;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function renderPayloadJsonScript(opts) {
|
|
166
|
+
const payload = {
|
|
167
|
+
"type": "application/json",
|
|
168
|
+
"innerHTML": opts.data ? encodeForwardSlashes(stringify(opts.data, opts.ssrContext["~payloadReducers"])) : "",
|
|
169
|
+
"data-nuxt-data": appId,
|
|
170
|
+
"data-ssr": false
|
|
171
|
+
};
|
|
172
|
+
payload.id = "__NUXT_DATA__";
|
|
173
|
+
if (opts.src) payload["data-src"] = opts.src;
|
|
174
|
+
const config = uneval(opts.ssrContext.config);
|
|
175
|
+
return [payload, { innerHTML: `window.__NUXT__={};window.__NUXT__.config=${config}` }];
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Encode forward slashes as unicode escape sequences to prevent
|
|
179
|
+
* Google from treating them as internal links and trying to crawl them.
|
|
180
|
+
* @see https://github.com/nuxt/nuxt/issues/24175
|
|
181
|
+
*/
|
|
182
|
+
function encodeForwardSlashes(str) {
|
|
183
|
+
return str.replaceAll("/", "\\u002F");
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const renderSSRHeadOptions = {"omitLineBreaks":true};
|
|
187
|
+
|
|
188
|
+
const entryFileName = "9C5WUlLE.js";
|
|
189
|
+
|
|
190
|
+
//#region src/runtime/handlers/renderer.ts
|
|
191
|
+
globalThis.__buildAssetsURL = buildAssetsURL;
|
|
192
|
+
globalThis.__publicAssetsURL = publicAssetsURL;
|
|
193
|
+
const HAS_APP_TELEPORTS = !!(appTeleportAttrs.id);
|
|
194
|
+
const APP_TELEPORT_OPEN_TAG = HAS_APP_TELEPORTS ? `<${appTeleportTag}${propsToString(appTeleportAttrs)}>` : "";
|
|
195
|
+
const APP_TELEPORT_CLOSE_TAG = HAS_APP_TELEPORTS ? `</${appTeleportTag}>` : "";
|
|
196
|
+
let entryPath;
|
|
197
|
+
const handler = defineRenderHandler((event) => {
|
|
198
|
+
const ssrError = event.path.startsWith("/__nuxt_error") ? getQuery(event) : null;
|
|
199
|
+
if (ssrError && !("__unenv__" in event.node.req)) throw createError({
|
|
200
|
+
status: 404,
|
|
201
|
+
statusText: "Page Not Found: /__nuxt_error",
|
|
202
|
+
message: "Page Not Found: /__nuxt_error"
|
|
203
|
+
});
|
|
204
|
+
return renderRoute(event, ssrError);
|
|
205
|
+
});
|
|
206
|
+
async function renderRoute(event, ssrError) {
|
|
207
|
+
const nitroApp = useNitroApp();
|
|
208
|
+
const ssrContext = createSSRContext(event);
|
|
209
|
+
ssrContext.head.push(appHead);
|
|
210
|
+
if (ssrError) {
|
|
211
|
+
const status = ssrError.status || ssrError.statusCode;
|
|
212
|
+
if (status) ssrError.status = ssrError.statusCode = Number.parseInt(status);
|
|
213
|
+
if (typeof ssrError.data === "string") try {
|
|
214
|
+
ssrError.data = destr(ssrError.data);
|
|
215
|
+
} catch {}
|
|
216
|
+
setSSRError(ssrContext, ssrError);
|
|
217
|
+
}
|
|
218
|
+
const routeOptions = getRouteRules(event);
|
|
219
|
+
if (routeOptions.ssr === false) ssrContext.noSSR = true;
|
|
220
|
+
!ssrContext.noSSR && (NUXT_RUNTIME_PAYLOAD_EXTRACTION);
|
|
221
|
+
const renderer = await getRenderer();
|
|
222
|
+
const canStream = NUXT_SSR_STREAMING;
|
|
223
|
+
const renderRouteContext = {
|
|
224
|
+
canStream,
|
|
225
|
+
prefersStream: false
|
|
226
|
+
};
|
|
227
|
+
await nitroApp.hooks.callHook("render:route", renderRouteContext, { event });
|
|
228
|
+
const _rendered = await (renderer.renderToString(ssrContext)).catch(async (error) => {
|
|
229
|
+
if ((ssrContext["~renderResponse"] || ssrContext._renderResponse) && error.message === "skipping render") return {};
|
|
230
|
+
const _err = !ssrError && ssrContext.payload?.error || error;
|
|
231
|
+
await ssrContext.nuxt?.hooks.callHook("app:error", _err);
|
|
232
|
+
throw _err;
|
|
233
|
+
});
|
|
234
|
+
const inlinedStyles = [];
|
|
235
|
+
await ssrContext.nuxt?.hooks.callHook("app:rendered", {
|
|
236
|
+
ssrContext,
|
|
237
|
+
renderResult: _rendered
|
|
238
|
+
});
|
|
239
|
+
if (ssrContext["~renderResponse"] || ssrContext._renderResponse) return ssrContext["~renderResponse"] || ssrContext._renderResponse;
|
|
240
|
+
if (ssrContext.payload?.error && !ssrError) throw ssrContext.payload.error;
|
|
241
|
+
const NO_SCRIPTS = routeOptions.noScripts;
|
|
242
|
+
const { styles, scripts } = getRequestDependencies(ssrContext, renderer.rendererContext);
|
|
243
|
+
if (!NO_SCRIPTS) {
|
|
244
|
+
let path = entryPath;
|
|
245
|
+
if (!path) {
|
|
246
|
+
path = buildAssetsURL(entryFileName);
|
|
247
|
+
if (ssrContext.runtimeConfig.app.cdnURL || /^(?:\/|\.+\/)/.test(path)) entryPath = path;
|
|
248
|
+
else {
|
|
249
|
+
path = relative(event.path.replace(/\/[^/]+$/, "/"), joinURL("/", path));
|
|
250
|
+
if (!/^(?:\/|\.+\/)/.test(path)) path = `./${path}`;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
ssrContext.head.push({ script: [{
|
|
254
|
+
type: "importmap",
|
|
255
|
+
innerHTML: { imports: { "#entry": path } }
|
|
256
|
+
}] });
|
|
257
|
+
}
|
|
258
|
+
if (inlinedStyles.length) ssrContext.head.push({ style: inlinedStyles });
|
|
259
|
+
const link = [];
|
|
260
|
+
for (const resource of Object.values(styles)) {
|
|
261
|
+
link.push({
|
|
262
|
+
rel: "stylesheet",
|
|
263
|
+
href: renderer.rendererContext.buildAssetsURL(resource.file),
|
|
264
|
+
crossorigin: ""
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
if (link.length) ssrContext.head.push({ link });
|
|
268
|
+
if (!NO_SCRIPTS) {
|
|
269
|
+
const dependencyOptions = ssrContext["~lazyHydratedModules"]?.size ? { exclude: ssrContext["~lazyHydratedModules"] } : void 0;
|
|
270
|
+
const excludeHrefs = new Set(link.map((l) => l.href));
|
|
271
|
+
for (const id of ssrContext["~neverHydratedModules"] ?? []) {
|
|
272
|
+
const file = renderer.rendererContext.manifest?.[id]?.file;
|
|
273
|
+
if (file) excludeHrefs.add(renderer.rendererContext.buildAssetsURL(file));
|
|
274
|
+
}
|
|
275
|
+
const hints = [];
|
|
276
|
+
for (const l of getPreloadLinks(ssrContext, renderer.rendererContext, dependencyOptions)) if (!excludeHrefs.has(l.href)) hints.push(l);
|
|
277
|
+
for (const l of getPrefetchLinks(ssrContext, renderer.rendererContext, dependencyOptions)) if (!excludeHrefs.has(l.href)) hints.push(l);
|
|
278
|
+
ssrContext.head.push({ link: hints });
|
|
279
|
+
ssrContext.head.push({ script: renderPayloadJsonScript({
|
|
280
|
+
ssrContext,
|
|
281
|
+
data: stripInlineOnlyPayloadFields(ssrContext.payload)
|
|
282
|
+
}) }, {
|
|
283
|
+
tagPosition: "bodyClose",
|
|
284
|
+
tagPriority: "high"
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
if (!routeOptions.noScripts) {
|
|
288
|
+
const tagPosition = "head";
|
|
289
|
+
ssrContext.head.push({ script: Object.values(scripts).map((resource) => ({
|
|
290
|
+
type: resource.module ? "module" : null,
|
|
291
|
+
src: renderer.rendererContext.buildAssetsURL(resource.file),
|
|
292
|
+
defer: resource.module ? null : true,
|
|
293
|
+
tagPosition,
|
|
294
|
+
crossorigin: ""
|
|
295
|
+
})) });
|
|
296
|
+
}
|
|
297
|
+
const { headTags, bodyTags, bodyTagsOpen, htmlAttrs, bodyAttrs } = renderSSRHead(ssrContext.head, renderSSRHeadOptions);
|
|
298
|
+
const htmlContext = {
|
|
299
|
+
htmlAttrs: htmlAttrs ? [htmlAttrs] : [],
|
|
300
|
+
head: normalizeChunks([headTags]),
|
|
301
|
+
bodyAttrs: bodyAttrs ? [bodyAttrs] : [],
|
|
302
|
+
bodyPrepend: normalizeChunks([bodyTagsOpen, ssrContext.teleports?.body]),
|
|
303
|
+
body: [_rendered.html, APP_TELEPORT_OPEN_TAG + (HAS_APP_TELEPORTS ? joinTags([ssrContext.teleports?.[`#${appTeleportAttrs.id}`]]) : "") + APP_TELEPORT_CLOSE_TAG],
|
|
304
|
+
bodyAppend: [bodyTags]
|
|
305
|
+
};
|
|
306
|
+
await nitroApp.hooks.callHook("render:html", htmlContext, { event });
|
|
307
|
+
return {
|
|
308
|
+
body: renderHTMLDocument(htmlContext),
|
|
309
|
+
statusCode: getResponseStatus(event),
|
|
310
|
+
statusMessage: getResponseStatusText(event),
|
|
311
|
+
headers: {
|
|
312
|
+
"content-type": "text/html;charset=utf-8",
|
|
313
|
+
"x-powered-by": "Nuxt"
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
function normalizeChunks(chunks) {
|
|
318
|
+
const result = [];
|
|
319
|
+
for (const _chunk of chunks) {
|
|
320
|
+
const chunk = _chunk?.trim();
|
|
321
|
+
if (chunk) result.push(chunk);
|
|
322
|
+
}
|
|
323
|
+
return result;
|
|
324
|
+
}
|
|
325
|
+
function joinTags(tags) {
|
|
326
|
+
return tags.join("");
|
|
327
|
+
}
|
|
328
|
+
function joinAttrs(chunks) {
|
|
329
|
+
if (chunks.length === 0) return "";
|
|
330
|
+
return " " + chunks.join(" ");
|
|
331
|
+
}
|
|
332
|
+
function renderHTMLDocument(html) {
|
|
333
|
+
return `<!DOCTYPE html><html${joinAttrs(html.htmlAttrs)}><head>${joinTags(html.head)}</head><body${joinAttrs(html.bodyAttrs)}>${joinTags(html.bodyPrepend)}${joinTags(html.body)}${joinTags(html.bodyAppend)}</body></html>`;
|
|
334
|
+
}
|
|
335
|
+
function stripInlineOnlyPayloadFields(payload) {
|
|
336
|
+
if (!payload.prefetchLinks) return payload;
|
|
337
|
+
const { prefetchLinks: _, ...rest } = payload;
|
|
338
|
+
return rest;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export { handler as default };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const client_precomputed = ((h,j,k,m,o,q,u,x,z,A)=>({dependencies:{"_C_VgD9ZI.js":{scripts:{},styles:{},preload:{"_C_VgD9ZI.js":h={resourceType:"script",module:true,prefetch:true,preload:true,file:"C_VgD9ZI.js",name:"nuxt"}},prefetch:{}},"_BW3xJdEx.js":{scripts:{},styles:{},preload:{"_BW3xJdEx.js":j={resourceType:"script",module:true,prefetch:true,preload:true,file:"BW3xJdEx.js",name:"defu"}},prefetch:{}},"_DB5Vxbte.js":{scripts:{},styles:{},preload:{"_DB5Vxbte.js":k={resourceType:"script",module:true,prefetch:true,preload:true,file:"DB5Vxbte.js",name:"ready",imports:["_C_VgD9ZI.js","_BW3xJdEx.js"]},"_C_VgD9ZI.js":h,"_BW3xJdEx.js":j},prefetch:{}},"_BXXtFil5.js":{scripts:{},styles:{},preload:{"_BXXtFil5.js":m={resourceType:"script",module:true,prefetch:true,preload:true,file:"BXXtFil5.js",name:"config",imports:["_C_VgD9ZI.js","_BW3xJdEx.js"]},"_C_VgD9ZI.js":h,"_BW3xJdEx.js":j},prefetch:{}},"../node_modules/.pnpm/nuxt@4.5.2_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_7873c345affe15219d14831c3a4018df/node_modules/nuxt/dist/app/entry.js":{scripts:{"../node_modules/.pnpm/nuxt@4.5.2_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_7873c345affe15219d14831c3a4018df/node_modules/nuxt/dist/app/entry.js":q={resourceType:"script",module:true,prefetch:true,preload:true,file:"9C5WUlLE.js",name:"entry",src:"../node_modules/.pnpm/nuxt@4.5.2_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_7873c345affe15219d14831c3a4018df/node_modules/nuxt/dist/app/entry.js",isEntry:true,imports:["_C_VgD9ZI.js","_DB5Vxbte.js","_BW3xJdEx.js","_BXXtFil5.js"],dynamicImports:o=["../node_modules/.pnpm/nuxt@4.5.2_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_7873c345affe15219d14831c3a4018df/node_modules/nuxt/dist/app/entry.js","../node_modules/.pnpm/nuxt@4.5.2_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_7873c345affe15219d14831c3a4018df/node_modules/nuxt/dist/app/components/error-404.vue","../node_modules/.pnpm/nuxt@4.5.2_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_7873c345affe15219d14831c3a4018df/node_modules/nuxt/dist/app/components/error-500.vue"],css:["entry.b3_DJTEt.css"]}},styles:{"entry.b3_DJTEt.css":u={file:"entry.b3_DJTEt.css",resourceType:"style",prefetch:true,preload:true}},preload:{"../node_modules/.pnpm/nuxt@4.5.2_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_7873c345affe15219d14831c3a4018df/node_modules/nuxt/dist/app/entry.js":q,"entry.b3_DJTEt.css":u,"_C_VgD9ZI.js":h,"_DB5Vxbte.js":k,"_BW3xJdEx.js":j,"_BXXtFil5.js":m},prefetch:{"entry.b3_DJTEt.css":u}},"_BDNMzG2s.js":{scripts:{},styles:{},preload:{"_BDNMzG2s.js":x={resourceType:"script",module:true,prefetch:true,preload:true,file:"BDNMzG2s.js",name:"_plugin-vue_export-helper"}},prefetch:{}},"../node_modules/.pnpm/nuxt@4.5.2_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_7873c345affe15219d14831c3a4018df/node_modules/nuxt/dist/app/components/error-404.vue":{scripts:{},styles:{"error-404.CHsn7XF-.css":z={file:"error-404.CHsn7XF-.css",resourceType:"style",prefetch:true,preload:true},"entry.b3_DJTEt.css":u},preload:{"../node_modules/.pnpm/nuxt@4.5.2_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_7873c345affe15219d14831c3a4018df/node_modules/nuxt/dist/app/components/error-404.vue":{resourceType:"script",module:true,prefetch:true,preload:true,file:"6IstVYrV.js",name:"error-404",src:"../node_modules/.pnpm/nuxt@4.5.2_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_7873c345affe15219d14831c3a4018df/node_modules/nuxt/dist/app/components/error-404.vue",isDynamicEntry:true,imports:["_C_VgD9ZI.js","../node_modules/.pnpm/nuxt@4.5.2_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_7873c345affe15219d14831c3a4018df/node_modules/nuxt/dist/app/entry.js","_BDNMzG2s.js"],css:["error-404.CHsn7XF-.css"]},"error-404.CHsn7XF-.css":z,"_C_VgD9ZI.js":h,"../node_modules/.pnpm/nuxt@4.5.2_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_7873c345affe15219d14831c3a4018df/node_modules/nuxt/dist/app/entry.js":q,"entry.b3_DJTEt.css":u,"_DB5Vxbte.js":k,"_BW3xJdEx.js":j,"_BXXtFil5.js":m,"_BDNMzG2s.js":x},prefetch:{"error-404.CHsn7XF-.css":z,"entry.b3_DJTEt.css":u}},"error-404.CHsn7XF-.css":{scripts:{},styles:{},preload:{"error-404.CHsn7XF-.css":z},prefetch:{}},"../node_modules/.pnpm/nuxt@4.5.2_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_7873c345affe15219d14831c3a4018df/node_modules/nuxt/dist/app/components/error-500.vue":{scripts:{},styles:{"error-500.Bawx2bLr.css":A={file:"error-500.Bawx2bLr.css",resourceType:"style",prefetch:true,preload:true},"entry.b3_DJTEt.css":u},preload:{"../node_modules/.pnpm/nuxt@4.5.2_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_7873c345affe15219d14831c3a4018df/node_modules/nuxt/dist/app/components/error-500.vue":{resourceType:"script",module:true,prefetch:true,preload:true,file:"BZuUK3cr.js",name:"error-500",src:"../node_modules/.pnpm/nuxt@4.5.2_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_7873c345affe15219d14831c3a4018df/node_modules/nuxt/dist/app/components/error-500.vue",isDynamicEntry:true,imports:["_C_VgD9ZI.js","../node_modules/.pnpm/nuxt@4.5.2_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_7873c345affe15219d14831c3a4018df/node_modules/nuxt/dist/app/entry.js","_BDNMzG2s.js"],css:["error-500.Bawx2bLr.css"]},"error-500.Bawx2bLr.css":A,"_C_VgD9ZI.js":h,"../node_modules/.pnpm/nuxt@4.5.2_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_7873c345affe15219d14831c3a4018df/node_modules/nuxt/dist/app/entry.js":q,"entry.b3_DJTEt.css":u,"_DB5Vxbte.js":k,"_BW3xJdEx.js":j,"_BXXtFil5.js":m,"_BDNMzG2s.js":x},prefetch:{"error-500.Bawx2bLr.css":A,"entry.b3_DJTEt.css":u}},"error-500.Bawx2bLr.css":{scripts:{},styles:{},preload:{"error-500.Bawx2bLr.css":A},prefetch:{}},"entry.b3_DJTEt.css":{scripts:{},styles:{},preload:{"entry.b3_DJTEt.css":u},prefetch:{}},"pages/index.vue":{scripts:{},styles:{"entry.b3_DJTEt.css":u},preload:{"pages/index.vue":{resourceType:"script",module:true,prefetch:true,preload:true,file:"BeLyMmd4.js",name:"pages",src:"pages/index.vue",isDynamicEntry:true,imports:["_C_VgD9ZI.js","../node_modules/.pnpm/nuxt@4.5.2_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_7873c345affe15219d14831c3a4018df/node_modules/nuxt/dist/app/entry.js","_BDNMzG2s.js"]},"_C_VgD9ZI.js":h,"../node_modules/.pnpm/nuxt@4.5.2_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_7873c345affe15219d14831c3a4018df/node_modules/nuxt/dist/app/entry.js":q,"entry.b3_DJTEt.css":u,"_DB5Vxbte.js":k,"_BW3xJdEx.js":j,"_BXXtFil5.js":m,"_BDNMzG2s.js":x},prefetch:{"entry.b3_DJTEt.css":u}},"pages/skills/[id].vue":{scripts:{},styles:{"entry.b3_DJTEt.css":u},preload:{"pages/skills/[id].vue":{resourceType:"script",module:true,prefetch:true,preload:true,file:"DMg0j7gv.js",name:"_id_",src:"pages/skills/[id].vue",isDynamicEntry:true,imports:["_C_VgD9ZI.js","_DB5Vxbte.js","_BXXtFil5.js","../node_modules/.pnpm/nuxt@4.5.2_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_7873c345affe15219d14831c3a4018df/node_modules/nuxt/dist/app/entry.js"]},"_C_VgD9ZI.js":h,"_DB5Vxbte.js":k,"_BW3xJdEx.js":j,"_BXXtFil5.js":m,"../node_modules/.pnpm/nuxt@4.5.2_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_7873c345affe15219d14831c3a4018df/node_modules/nuxt/dist/app/entry.js":q,"entry.b3_DJTEt.css":u},prefetch:{"entry.b3_DJTEt.css":u}}},entrypoints:["../node_modules/.pnpm/nuxt@4.5.2_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_7873c345affe15219d14831c3a4018df/node_modules/nuxt/dist/app/entry.js"],modules:{"../node_modules/.pnpm/nuxt@4.5.2_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_7873c345affe15219d14831c3a4018df/node_modules/nuxt/dist/app/components/error-404.vue":{file:"6IstVYrV.js",resourceType:"script",mimeType:void 0,module:true},"error-404.CHsn7XF-.css":{file:"error-404.CHsn7XF-.css",resourceType:"style",mimeType:void 0,module:void 0},"../node_modules/.pnpm/nuxt@4.5.2_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_7873c345affe15219d14831c3a4018df/node_modules/nuxt/dist/app/components/error-500.vue":{file:"BZuUK3cr.js",resourceType:"script",mimeType:void 0,module:true},"error-500.Bawx2bLr.css":{file:"error-500.Bawx2bLr.css",resourceType:"style",mimeType:void 0,module:void 0},"../node_modules/.pnpm/nuxt@4.5.2_@babel+plugin-syntax-jsx@7.29.7_@babel+core@7.29.7__@babel+plugin-syntax-typ_7873c345affe15219d14831c3a4018df/node_modules/nuxt/dist/app/entry.js":{file:"9C5WUlLE.js",resourceType:"script",mimeType:void 0,module:true,dynamicImports:o},"entry.b3_DJTEt.css":{file:"entry.b3_DJTEt.css",resourceType:"style",mimeType:void 0,module:void 0},"_BDNMzG2s.js":{file:"BDNMzG2s.js",resourceType:"script",mimeType:void 0,module:true},"_BW3xJdEx.js":{file:"BW3xJdEx.js",resourceType:"script",mimeType:void 0,module:true},"_BXXtFil5.js":{file:"BXXtFil5.js",resourceType:"script",mimeType:void 0,module:true},"_C_VgD9ZI.js":{file:"C_VgD9ZI.js",resourceType:"script",mimeType:void 0,module:true},"_DB5Vxbte.js":{file:"DB5Vxbte.js",resourceType:"script",mimeType:void 0,module:true},"pages/index.vue":{file:"BeLyMmd4.js",resourceType:"script",mimeType:void 0,module:true},"pages/skills/[id].vue":{file:"DMg0j7gv.js",resourceType:"script",mimeType:void 0,module:true}}}))();
|
|
2
|
+
|
|
3
|
+
export { client_precomputed as default };
|