mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-11-18 06:28:25 +01:00
Follow the yaak-web to yaak-wasm rename
Rebased onto main after #572 merged. The wasm crate moved to crates/yaak-wasm and crates-server/yaak-web is now the server, so the render_template export, the regenerated pkg/ and the proxy/server wording move with them.
This commit is contained in:
1 parent
85ba3e6852
commit
252b151fcb
7 files changed
+10
-10
No files matched your search
@@ -5,5 +5,5 @@ import { __wbg_set_wasm } from "./yaak_wasm_bg.js";
|
||||
__wbg_set_wasm(wasm);
|
||||
wasm.__wbindgen_start();
|
||||
export {
|
||||
blob_delete, blob_get, blob_put, boot, prepare_http_send, rpc
|
||||
blob_delete, blob_get, blob_put, boot, prepare_http_send, render_template, rpc
|
||||
} from "./yaak_wasm_bg.js";
|
||||
@@ -732,7 +732,7 @@ export function __wbindgen_cast_0000000000000002(arg0, arg1) {
|
||||
}
|
||||
export function __wbindgen_cast_0000000000000003(arg0, arg1) {
|
||||
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("IDBVersionChangeEvent")], shim_idx: 74, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
||||
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h20ab1db2d80221ce);
|
||||
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__he166673e9c1b4e95);
|
||||
return ret;
|
||||
}
|
||||
export function __wbindgen_cast_0000000000000004(arg0, arg1) {
|
||||
@@ -789,8 +789,8 @@ function wasm_bindgen__convert__closures_____invoke__ha1c2fa93df0107f3(arg0, arg
|
||||
}
|
||||
}
|
||||
|
||||
function wasm_bindgen__convert__closures_____invoke__h20ab1db2d80221ce(arg0, arg1, arg2) {
|
||||
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h20ab1db2d80221ce(arg0, arg1, arg2);
|
||||
function wasm_bindgen__convert__closures_____invoke__he166673e9c1b4e95(arg0, arg1, arg2) {
|
||||
const ret = wasm.wasm_bindgen__convert__closures_____invoke__he166673e9c1b4e95(arg0, arg1, arg2);
|
||||
if (ret[1]) {
|
||||
throw takeFromExternrefTable0(ret[0]);
|
||||
}
|
||||
|
||||
Binary file not shown.
+1
-1
@@ -19,7 +19,7 @@ export const rust_sqlite_wasm_realloc: (a: number, b: number) => number;
|
||||
export const sqlite3_os_end: () => number;
|
||||
export const sqlite3_os_init: () => number;
|
||||
export const wasm_bindgen__convert__closures_____invoke__ha1c2fa93df0107f3: (a: number, b: number, c: any) => [number, number];
|
||||
export const wasm_bindgen__convert__closures_____invoke__h20ab1db2d80221ce: (a: number, b: number, c: any) => [number, number];
|
||||
export const wasm_bindgen__convert__closures_____invoke__he166673e9c1b4e95: (a: number, b: number, c: any) => [number, number];
|
||||
export const wasm_bindgen__convert__closures_____invoke__h2cf3f4cce3b29948: (a: number, b: number, c: any, d: any) => void;
|
||||
export const wasm_bindgen__convert__closures_____invoke__ha7903b6e296dd8f4: (a: number, b: number, c: any) => void;
|
||||
export const wasm_bindgen__convert__closures_____invoke__ha1b480b83daa641f: (a: number, b: number) => void;
|
||||
|
||||
@@ -202,7 +202,7 @@ export class WorkerConnection {
|
||||
return this.request<T>((id) => ({ type: "prepare_http_send", id, payload }));
|
||||
}
|
||||
|
||||
/** See `render_template` in crates/yaak-web. */
|
||||
/** See `render_template` in crates/yaak-wasm. */
|
||||
renderTemplate(payload: unknown): Promise<string> {
|
||||
return this.request<string>((id) => ({ type: "render_template", id, payload }));
|
||||
}
|
||||
|
||||
@@ -10,6 +10,6 @@ export interface SandboxPluginBundle {
|
||||
|
||||
export const SANDBOX_PLUGINS: SandboxPluginBundle[] = [
|
||||
{ name: "template-function-timestamp", source: "\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// plugins/template-function-timestamp/src/index.ts\nvar index_exports = {};\n__export(index_exports, {\n calculateDatetime: () => calculateDatetime,\n formatDatetime: () => formatDatetime,\n plugin: () => plugin\n});\nmodule.exports = __toCommonJS(index_exports);\n\n// node_modules/date-fns/constants.js\nvar daysInYear = 365.2425;\nvar maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;\nvar minTime = -maxTime;\nvar millisecondsInWeek = 6048e5;\nvar millisecondsInDay = 864e5;\nvar millisecondsInMinute = 6e4;\nvar millisecondsInHour = 36e5;\nvar secondsInHour = 3600;\nvar secondsInDay = secondsInHour * 24;\nvar secondsInWeek = secondsInDay * 7;\nvar secondsInYear = secondsInDay * daysInYear;\nvar secondsInMonth = secondsInYear / 12;\nvar secondsInQuarter = secondsInMonth * 3;\nvar constructFromSymbol = /* @__PURE__ */ Symbol.for(\"constructDateFrom\");\n\n// node_modules/date-fns/constructFrom.js\nfunction constructFrom(date, value) {\n if (typeof date === \"function\") return date(value);\n if (date && typeof date === \"object\" && constructFromSymbol in date)\n return date[constructFromSymbol](value);\n if (date instanceof Date) return new date.constructor(value);\n return new Date(value);\n}\n\n// node_modules/date-fns/toDate.js\nfunction toDate(argument, context) {\n return constructFrom(context || argument, argument);\n}\n\n// node_modules/date-fns/addDays.js\nfunction addDays(date, amount, options) {\n const _date = toDate(date, options?.in);\n if (isNaN(amount)) return constructFrom(options?.in || date, NaN);\n if (!amount) return _date;\n _date.setDate(_date.getDate() + amount);\n return _date;\n}\n\n// node_modules/date-fns/addMonths.js\nfunction addMonths(date, amount, options) {\n const _date = toDate(date, options?.in);\n if (isNaN(amount)) return constructFrom(options?.in || date, NaN);\n if (!amount) {\n return _date;\n }\n const dayOfMonth = _date.getDate();\n const endOfDesiredMonth = constructFrom(options?.in || date, _date.getTime());\n endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);\n const daysInMonth = endOfDesiredMonth.getDate();\n if (dayOfMonth >= daysInMonth) {\n return endOfDesiredMonth;\n } else {\n _date.setFullYear(\n endOfDesiredMonth.getFullYear(),\n endOfDesiredMonth.getMonth(),\n dayOfMonth\n );\n return _date;\n }\n}\n\n// node_modules/date-fns/addMilliseconds.js\nfunction addMilliseconds(date, amount, options) {\n return constructFrom(options?.in || date, +toDate(date) + amount);\n}\n\n// node_modules/date-fns/addHours.js\nfunction addHours(date, amount, options) {\n return addMilliseconds(date, amount * millisecondsInHour, options);\n}\n\n// node_modules/date-fns/_lib/defaultOptions.js\nvar defaultOptions = {};\nfunction getDefaultOptions() {\n return defaultOptions;\n}\n\n// node_modules/date-fns/startOfWeek.js\nfunction startOfWeek(date, options) {\n const defaultOptions2 = getDefaultOptions();\n const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;\n const _date = toDate(date, options?.in);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// node_modules/date-fns/startOfISOWeek.js\nfunction startOfISOWeek(date, options) {\n return startOfWeek(date, { ...options, weekStartsOn: 1 });\n}\n\n// node_modules/date-fns/getISOWeekYear.js\nfunction getISOWeekYear(date, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear =
Line truncated
|
||||
{ name: "importer-curl", source: "\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// plugins/importer-curl/src/index.ts\nvar index_exports = {};\n__export(index_exports, {\n convertCurl: () => convertCurl,\n plugin: () => plugin\n});\nmodule.exports = __toCommonJS(index_exports);\n\n// node_modules/shlex/shlex.js\nvar Shlexer = class {\n constructor(string) {\n this.i = 0;\n this.string = string;\n this.whitespace = \" \t\\r\\n\";\n this.quotes = `'\"`;\n this.escapes = \"\\\\\";\n this.escapedQuotes = '\"';\n this.ansiCQuotes = true;\n this.localeQuotes = true;\n this.debug = false;\n }\n readChar() {\n return this.string.charAt(this.i++);\n }\n processEscapes(string, quote, isAnsiCQuote) {\n if (!isAnsiCQuote && !this.escapedQuotes.includes(quote)) {\n return string;\n }\n const anyEscape = \"[\" + this.escapes.replace(/(.)/g, \"\\\\$1\") + \"]\";\n if (!isAnsiCQuote && this.escapedQuotes.includes(quote)) {\n const re = new RegExp(\n anyEscape + \"(\" + anyEscape + \"|\\\\\" + quote + \")\",\n \"g\"\n );\n return string.replace(re, \"$1\");\n }\n if (isAnsiCQuote) {\n const patterns = {\n // Literal characters\n \"([\\\\\\\\'\\\"?])\": (x) => x,\n // Non-printable ASCII characters\n \"a\": () => \"\\x07\",\n \"b\": () => \"\\b\",\n \"e|E\": () => \"\\x1B\",\n \"f\": () => \"\\f\",\n \"n\": () => \"\\n\",\n \"r\": () => \"\\r\",\n \"t\": () => \"\t\",\n \"v\": () => \"\\v\",\n // Octal bytes\n \"([0-7]{1,3})\": (x) => String.fromCharCode(parseInt(x, 8)),\n // Hexadecimal bytes\n \"x([0-9a-fA-F]{1,2})\": (x) => String.fromCharCode(parseInt(x, 16)),\n // Unicode code units\n \"u([0-9a-fA-F]{1,4})\": (x) => String.fromCharCode(parseInt(x, 16)),\n \"U([0-9a-fA-F]{1,8})\": (x) => String.fromCharCode(parseInt(x, 16)),\n // Control characters\n // https://en.wikipedia.org/wiki/Control_character#How_control_characters_map_to_keyboards\n \"c(.)\": (x) => {\n if (x === \"?\") {\n return \"\\x7F\";\n } else if (x === \"@\") {\n return \"\\0\";\n } else {\n return String.fromCharCode(x.charCodeAt(0) & 31);\n }\n }\n };\n const re = new RegExp(\n anyEscape + \"(\" + Object.keys(patterns).join(\"|\") + \")\",\n \"g\"\n );\n return string.replace(re, function(m, p1) {\n for (const matched in patterns) {\n const mm = new RegExp(\"^\" + matched + \"$\").exec(p1);\n if (mm === null) {\n continue;\n }\n return patterns[matched].apply(null, mm.slice(1));\n }\n });\n }\n return void 0;\n }\n *[Symbol.iterator]() {\n let inQuote = false;\n let inDollarQuote = false;\n let escaped = false;\n let lastDollar = -2;\n let token;\n if (this.debug) {\n console.log(\"full input:\", \">\" + this.string + \"<\");\n }\n while (true) {\n const pos = this.i;\n const char = this.readChar();\n if (this.debug) {\n console.log(\n \"position:\",\n pos,\n \"input:\",\n \">\" + char + \"<\",\n \"accumulated:\",\n token,\n \"inQuote:\",\n inQuote,\n \"inDollarQuote:\",\n inDollarQuote,\n \"lastDollar:\",\n lastDollar,\n \"escaped:\",\n escaped\n );\n }\n if (char === \"\") {\n if (inQuote) {\n throw new Error(\"Got EOF while in a quoted string\");\n }\n if (escaped) {\n throw new Error(\"Got EOF while in an escape sequence\");\n }\n if (token !== void 0) {\n yield token;\n }\n return;\n }\n if (escaped) {\n if (char === \"\\n\") {\n } else if (inQuote) {\n token = (token || \"\") + escaped + char;\n } else {\n token = (token || \"\") + char;\n }\n escaped = false;\n continue;\n }\n if (this.escapes.includes(char)) {\n
Line truncated
|
||||
{ name: "importer-curl", source: "\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// plugins/importer-curl/src/index.ts\nvar index_exports = {};\n__export(index_exports, {\n convertCurl: () => convertCurl,\n plugin: () => plugin\n});\nmodule.exports = __toCommonJS(index_exports);\n\n// node_modules/shlex/shlex.js\nvar Shlexer = class {\n constructor(string) {\n this.i = 0;\n this.string = string;\n this.whitespace = \" \t\\r\\n\";\n this.quotes = `'\"`;\n this.escapes = \"\\\\\";\n this.escapedQuotes = '\"';\n this.ansiCQuotes = true;\n this.localeQuotes = true;\n this.debug = false;\n }\n readChar() {\n return this.string.charAt(this.i++);\n }\n processEscapes(string, quote, isAnsiCQuote) {\n if (!isAnsiCQuote && !this.escapedQuotes.includes(quote)) {\n return string;\n }\n const anyEscape = \"[\" + this.escapes.replace(/(.)/g, \"\\\\$1\") + \"]\";\n if (!isAnsiCQuote && this.escapedQuotes.includes(quote)) {\n const re = new RegExp(\n anyEscape + \"(\" + anyEscape + \"|\\\\\" + quote + \")\",\n \"g\"\n );\n return string.replace(re, \"$1\");\n }\n if (isAnsiCQuote) {\n const patterns = {\n // Literal characters\n \"([\\\\\\\\'\\\"?])\": (x) => x,\n // Non-printable ASCII characters\n \"a\": () => \"\\x07\",\n \"b\": () => \"\\b\",\n \"e|E\": () => \"\\x1B\",\n \"f\": () => \"\\f\",\n \"n\": () => \"\\n\",\n \"r\": () => \"\\r\",\n \"t\": () => \"\t\",\n \"v\": () => \"\\v\",\n // Octal bytes\n \"([0-7]{1,3})\": (x) => String.fromCharCode(parseInt(x, 8)),\n // Hexadecimal bytes\n \"x([0-9a-fA-F]{1,2})\": (x) => String.fromCharCode(parseInt(x, 16)),\n // Unicode code units\n \"u([0-9a-fA-F]{1,4})\": (x) => String.fromCharCode(parseInt(x, 16)),\n \"U([0-9a-fA-F]{1,8})\": (x) => String.fromCharCode(parseInt(x, 16)),\n // Control characters\n // https://en.wikipedia.org/wiki/Control_character#How_control_characters_map_to_keyboards\n \"c(.)\": (x) => {\n if (x === \"?\") {\n return \"\\x7F\";\n } else if (x === \"@\") {\n return \"\\0\";\n } else {\n return String.fromCharCode(x.charCodeAt(0) & 31);\n }\n }\n };\n const re = new RegExp(\n anyEscape + \"(\" + Object.keys(patterns).join(\"|\") + \")\",\n \"g\"\n );\n return string.replace(re, function(m, p1) {\n for (const matched in patterns) {\n const mm = new RegExp(\"^\" + matched + \"$\").exec(p1);\n if (mm === null) {\n continue;\n }\n return patterns[matched].apply(null, mm.slice(1));\n }\n });\n }\n return void 0;\n }\n *[Symbol.iterator]() {\n let inQuote = false;\n let inDollarQuote = false;\n let escaped = false;\n let lastDollar = -2;\n let token;\n if (this.debug) {\n console.log(\"full input:\", \">\" + this.string + \"<\");\n }\n while (true) {\n const pos = this.i;\n const char = this.readChar();\n if (this.debug) {\n console.log(\n \"position:\",\n pos,\n \"input:\",\n \">\" + char + \"<\",\n \"accumulated:\",\n token,\n \"inQuote:\",\n inQuote,\n \"inDollarQuote:\",\n inDollarQuote,\n \"lastDollar:\",\n lastDollar,\n \"escaped:\",\n escaped\n );\n }\n if (char === \"\") {\n if (inQuote) {\n throw new Error(\"Got EOF while in a quoted string\");\n }\n if (escaped) {\n throw new Error(\"Got EOF while in an escape sequence\");\n }\n if (token !== void 0) {\n yield token;\n }\n return;\n }\n if (escaped) {\n if (char === \"\\n\") {\n } else if (inQuote) {\n token = (token || \"\") + escaped + char;\n } else {\n token = (token || \"\") + char;\n }\n escaped = false;\n continue;\n }\n if (this.escapes.includes(char)) {\n
Line truncated
|
||||
{ name: "auth-bearer", source: "\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// plugins/auth-bearer/src/index.ts\nvar index_exports = {};\n__export(index_exports, {\n plugin: () => plugin\n});\nmodule.exports = __toCommonJS(index_exports);\nvar plugin = {\n authentication: {\n name: \"bearer\",\n label: \"Bearer Token\",\n shortLabel: \"Bearer\",\n args: [\n {\n type: \"text\",\n name: \"token\",\n label: \"Token\",\n optional: true,\n password: true\n },\n {\n type: \"text\",\n name: \"prefix\",\n label: \"Prefix\",\n optional: true,\n placeholder: \"\",\n defaultValue: \"Bearer\",\n description: 'The prefix to use for the Authorization header, which will be of the format \"<PREFIX> <TOKEN>\".'\n }\n ],\n async onApply(_ctx, { values }) {\n return { setHeaders: [generateAuthorizationHeader(values)] };\n }\n }\n};\nfunction generateAuthorizationHeader(values) {\n const token = String(values.token || \"\").trim();\n const prefix = String(values.prefix || \"\").trim();\n const value = `${prefix} ${token}`.trim();\n return { name: \"Authorization\", value };\n}\n" },
|
||||
];
|
||||
@@ -60,12 +60,12 @@ interface PreparedHttpSend {
|
||||
}
|
||||
|
||||
/**
|
||||
* The desktop applies auth to the sendable request; here the proxy builds that,
|
||||
* so the plugin's answer goes onto the model and the proxy folds it in. Same
|
||||
* The desktop applies auth to the sendable request; here the server builds that,
|
||||
* so the plugin's answer goes onto the model and the server folds it in. Same
|
||||
* bytes for a method that sets a header, which is every one that runs here.
|
||||
*
|
||||
* Not the same for one that *signs*, since the plugin sees the request before
|
||||
* the proxy assembles it. AWS SigV4 and OAuth 1.0 are refused rather than
|
||||
* the server assembles it. AWS SigV4 and OAuth 1.0 are refused rather than
|
||||
* mis-signed; see the sandbox README.
|
||||
*/
|
||||
async function applyAuthentication(
|
||||
|
||||
Reference in new issue
Block a user