Problem: the hexagonal refactor churns the backend tree for nine more phases; the UI delivery stack (web/ SPA, cmd/desktop Wails wrapper, compose/web image) must move to its own repo first so doc/layout rewrites land once on a backend-only tree. Change: - New repo git.hubris.network/dtoro/oikos-web (v0.33.0): web/, desktop/ (updateURL repointed to oikos-web releases), compose/, own CI (web + desktop jobs), own deploy script (CI-green gate, TOCTOU guard, version-tagged images, prune-to-3), own webhook receiver on :9798 + launchd unit, own compose project publishing the same 8091:80. - Cutover executed on mac-mini in order: oikos stack's web service stopped+removed, oikos-web project brought up on 8091; outer Caddy untouched (targets the published port) — serving + Authentik flow + /wails 404 quirk verified post-cutover. - Stripped from oikos: web/, cmd/desktop/, compose/web/, desktop CI workflow, ci.yml web job, Makefile ui/desktop/desktop-package/install targets, the compose web service, oikos-web from deploy.sh's fallback prune list; wails + go-keyring dropped from go.mod, vendor synced. - README / CONTRIBUTING / AGENTS.md / .agents dev+operations docs now point at the new repo; mbse + mascot design docs carry a path note. Risk: production SPA serving depends on the new pipeline now; rollback is versioned-image re-up of the old web service from a pre-split checkout (port 8091). Desktop builds installed before the split still check dtoro/oikos releases — one manual reinstall, noted in the oikos-web release notes. Verification: go vet, make test (race), make generate-check, golangci (no new findings; baseline down 400→365); post-cutover curls — localhost:8091 200, /wails/runtime.js 404, outer Caddy 302 Authentik.
131 lines
7.1 KiB
JavaScript
131 lines
7.1 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.decodeXMLStrict = exports.decodeHTML5Strict = exports.decodeHTML4Strict = exports.decodeHTML5 = exports.decodeHTML4 = exports.decodeHTMLAttribute = exports.decodeHTMLStrict = exports.decodeHTML = exports.decodeXML = exports.DecodingMode = exports.EntityDecoder = exports.encodeHTML5 = exports.encodeHTML4 = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.escapeText = exports.escapeAttribute = exports.escapeUTF8 = exports.encodeXML = exports.EncodingMode = exports.EntityLevel = void 0;
|
|
exports.decode = decode;
|
|
exports.decodeStrict = decodeStrict;
|
|
exports.encode = encode;
|
|
const decode_js_1 = require("./decode.js");
|
|
const encode_js_1 = require("./encode.js");
|
|
const escape_js_1 = require("./escape.js");
|
|
/** The level of entities to support. */
|
|
var EntityLevel;
|
|
(function (EntityLevel) {
|
|
/** Support only XML entities. */
|
|
EntityLevel[EntityLevel["XML"] = 0] = "XML";
|
|
/** Support HTML entities, which are a superset of XML entities. */
|
|
EntityLevel[EntityLevel["HTML"] = 1] = "HTML";
|
|
})(EntityLevel || (exports.EntityLevel = EntityLevel = {}));
|
|
var EncodingMode;
|
|
(function (EncodingMode) {
|
|
/**
|
|
* The output is UTF-8 encoded. Only characters that need escaping within
|
|
* XML will be escaped.
|
|
*/
|
|
EncodingMode[EncodingMode["UTF8"] = 0] = "UTF8";
|
|
/**
|
|
* The output consists only of ASCII characters. Characters that need
|
|
* escaping within HTML, and characters that aren't ASCII characters will
|
|
* be escaped.
|
|
*/
|
|
EncodingMode[EncodingMode["ASCII"] = 1] = "ASCII";
|
|
/**
|
|
* Encode all characters that have an equivalent entity, as well as all
|
|
* characters that are not ASCII characters.
|
|
*/
|
|
EncodingMode[EncodingMode["Extensive"] = 2] = "Extensive";
|
|
/**
|
|
* Encode all characters that have to be escaped in HTML attributes,
|
|
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
|
*/
|
|
EncodingMode[EncodingMode["Attribute"] = 3] = "Attribute";
|
|
/**
|
|
* Encode all characters that have to be escaped in HTML text,
|
|
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
|
*/
|
|
EncodingMode[EncodingMode["Text"] = 4] = "Text";
|
|
})(EncodingMode || (exports.EncodingMode = EncodingMode = {}));
|
|
/**
|
|
* Decodes a string with entities.
|
|
*
|
|
* @param input String to decode.
|
|
* @param options Decoding options.
|
|
*/
|
|
function decode(input, options = EntityLevel.XML) {
|
|
const level = typeof options === "number" ? options : options.level;
|
|
if (level === EntityLevel.HTML) {
|
|
const mode = typeof options === "object" ? options.mode : undefined;
|
|
return (0, decode_js_1.decodeHTML)(input, mode);
|
|
}
|
|
return (0, decode_js_1.decodeXML)(input);
|
|
}
|
|
/**
|
|
* Decodes a string with entities. Does not allow missing trailing semicolons for entities.
|
|
*
|
|
* @param input String to decode.
|
|
* @param options Decoding options.
|
|
* @deprecated Use `decode` with the `mode` set to `Strict`.
|
|
*/
|
|
function decodeStrict(input, options = EntityLevel.XML) {
|
|
var _a;
|
|
const normalizedOptions = typeof options === "number" ? { level: options } : options;
|
|
(_a = normalizedOptions.mode) !== null && _a !== void 0 ? _a : (normalizedOptions.mode = decode_js_1.DecodingMode.Strict);
|
|
return decode(input, normalizedOptions);
|
|
}
|
|
/**
|
|
* Encodes a string with entities.
|
|
*
|
|
* @param input String to encode.
|
|
* @param options Encoding options.
|
|
*/
|
|
function encode(input, options = EntityLevel.XML) {
|
|
const { mode = EncodingMode.Extensive, level = EntityLevel.XML } = typeof options === "number" ? { level: options } : options;
|
|
switch (mode) {
|
|
case EncodingMode.UTF8: {
|
|
return (0, escape_js_1.escapeUTF8)(input);
|
|
}
|
|
case EncodingMode.Attribute: {
|
|
return (0, escape_js_1.escapeAttribute)(input);
|
|
}
|
|
case EncodingMode.Text: {
|
|
return (0, escape_js_1.escapeText)(input);
|
|
}
|
|
case EncodingMode.ASCII: {
|
|
return level === EntityLevel.HTML
|
|
? (0, encode_js_1.encodeNonAsciiHTML)(input)
|
|
: (0, escape_js_1.encodeXML)(input);
|
|
}
|
|
// eslint-disable-next-line unicorn/no-useless-switch-case
|
|
case EncodingMode.Extensive:
|
|
default: {
|
|
return level === EntityLevel.HTML
|
|
? (0, encode_js_1.encodeHTML)(input)
|
|
: (0, escape_js_1.encodeXML)(input);
|
|
}
|
|
}
|
|
}
|
|
var escape_js_2 = require("./escape.js");
|
|
Object.defineProperty(exports, "encodeXML", { enumerable: true, get: function () { return escape_js_2.encodeXML; } });
|
|
Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return escape_js_2.escape; } });
|
|
Object.defineProperty(exports, "escapeUTF8", { enumerable: true, get: function () { return escape_js_2.escapeUTF8; } });
|
|
Object.defineProperty(exports, "escapeAttribute", { enumerable: true, get: function () { return escape_js_2.escapeAttribute; } });
|
|
Object.defineProperty(exports, "escapeText", { enumerable: true, get: function () { return escape_js_2.escapeText; } });
|
|
var encode_js_2 = require("./encode.js");
|
|
Object.defineProperty(exports, "encodeHTML", { enumerable: true, get: function () { return encode_js_2.encodeHTML; } });
|
|
Object.defineProperty(exports, "encodeNonAsciiHTML", { enumerable: true, get: function () { return encode_js_2.encodeNonAsciiHTML; } });
|
|
// Legacy aliases (deprecated)
|
|
Object.defineProperty(exports, "encodeHTML4", { enumerable: true, get: function () { return encode_js_2.encodeHTML; } });
|
|
Object.defineProperty(exports, "encodeHTML5", { enumerable: true, get: function () { return encode_js_2.encodeHTML; } });
|
|
var decode_js_2 = require("./decode.js");
|
|
Object.defineProperty(exports, "EntityDecoder", { enumerable: true, get: function () { return decode_js_2.EntityDecoder; } });
|
|
Object.defineProperty(exports, "DecodingMode", { enumerable: true, get: function () { return decode_js_2.DecodingMode; } });
|
|
Object.defineProperty(exports, "decodeXML", { enumerable: true, get: function () { return decode_js_2.decodeXML; } });
|
|
Object.defineProperty(exports, "decodeHTML", { enumerable: true, get: function () { return decode_js_2.decodeHTML; } });
|
|
Object.defineProperty(exports, "decodeHTMLStrict", { enumerable: true, get: function () { return decode_js_2.decodeHTMLStrict; } });
|
|
Object.defineProperty(exports, "decodeHTMLAttribute", { enumerable: true, get: function () { return decode_js_2.decodeHTMLAttribute; } });
|
|
// Legacy aliases (deprecated)
|
|
Object.defineProperty(exports, "decodeHTML4", { enumerable: true, get: function () { return decode_js_2.decodeHTML; } });
|
|
Object.defineProperty(exports, "decodeHTML5", { enumerable: true, get: function () { return decode_js_2.decodeHTML; } });
|
|
Object.defineProperty(exports, "decodeHTML4Strict", { enumerable: true, get: function () { return decode_js_2.decodeHTMLStrict; } });
|
|
Object.defineProperty(exports, "decodeHTML5Strict", { enumerable: true, get: function () { return decode_js_2.decodeHTMLStrict; } });
|
|
Object.defineProperty(exports, "decodeXMLStrict", { enumerable: true, get: function () { return decode_js_2.decodeXML; } });
|
|
//# sourceMappingURL=index.js.map
|