From 152069394d3223efcbf582c164ad06db2fc9cde1 Mon Sep 17 00:00:00 2001 From: marle3003 <56543258+marle3003@users.noreply.github.com> Date: Mon, 16 Feb 2026 08:49:57 +0100 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74533=20[mokap?= =?UTF-8?q?i]=20Update=20typings=20to=20v0.34.0=20by=20@marle3003?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/mokapi/file.d.ts | 50 +++++++++++++++++++++++++++++ types/mokapi/index.d.ts | 52 ++++++++++++++++++++++++++----- types/mokapi/package.json | 2 +- types/mokapi/test/file-test.ts | 16 ++++++++++ types/mokapi/test/mokapi-tests.ts | 10 ++++++ 5 files changed, 122 insertions(+), 8 deletions(-) create mode 100644 types/mokapi/file.d.ts create mode 100644 types/mokapi/test/file-test.ts diff --git a/types/mokapi/file.d.ts b/types/mokapi/file.d.ts new file mode 100644 index 00000000000000..bda0820843825d --- /dev/null +++ b/types/mokapi/file.d.ts @@ -0,0 +1,50 @@ +/** + * Reads the contents of a file and returns it as a string. + * + * If the path is relative, it is resolved relative to the entry script file. + * + * @param path - Path to the file to read. + * @returns The contents of the file. + * + * @example + * export default function() { + * const data = read('data.json') + * console.log(data) + * } + */ +export function read(path: string): string; + +/** + * Writes a string to a file at the given path. + * + * If the path is relative, it is resolved relative to the entry script file. + * If the file does not exist, it will be created. + * If the file exists, it will be overwritten. + * + * @param path - Path to the file to write. + * @param s - The string content to write. + * + * @example + * export default function() { + * writeString('data.json', 'Hello World') + * } + */ +export function writeString(path: string, s: string): void; + +/** + * Appends a string to a file at the given path. + * + * If the path is relative, it is resolved relative to the entry script file. + * If the file does not exist, it will be created. + * If the file exists, the string will be appended. + * + * @param path - Path to the file to append to. + * @param s - The string content to append. + * + * @example + * export default function() { + * writeString('data.json', 'Hello') + * appendString('data.json', ' World') + * } + */ +export function appendString(path: string, s: string): void; diff --git a/types/mokapi/index.d.ts b/types/mokapi/index.d.ts index e768bd318d9659..6dd643bea6c88c 100644 --- a/types/mokapi/index.d.ts +++ b/types/mokapi/index.d.ts @@ -1,6 +1,6 @@ /** * Mokapi JavaScript API - * https://mokapi.io/docs/guides/welcome + * https://mokapi.io/docs/welcome */ import "./faker"; @@ -10,6 +10,7 @@ import "./mustache"; import "./yaml"; import "./encoding"; import "./mail"; +import "./file"; /** * Attaches an event handler for the given event. @@ -157,6 +158,9 @@ export interface HttpRequest { /** Object contains querystring parameters specified by OpenAPI querystring parameters. */ readonly querystring: any; + /** Name of the API, as defined in the OpenAPI `info.title` field */ + readonly api: string; + /** Path value specified by the OpenAPI path */ readonly key: string; @@ -183,6 +187,23 @@ export interface HttpResponse { /** Data will be encoded with the OpenAPI response definition. */ data: any; + + /** + * Rebuilds the entire HTTP response using the OpenAPI response definition for the given status code and content type + * @example + * import { on } from 'mokapi' + * + * export default function() { + * on('http', (request, response) => { + * if (request.path.petId === 10) { + * // Switch to a different OpenAPI response. + * response.rebuild(404, 'application/json') + * response.data.message = 'Pet not found' + * } + * }) + * } + */ + rebuild: (statusCode?: number, contentType?: string) => void; } /** @@ -421,10 +442,11 @@ export type DateLayout = | "RFC3339Nano"; /** - * EventArgs object contains additional arguments for an event handler. + * EventArgs provides optional configuration for an event handler. * https://mokapi.io/docs/javascript-api/mokapi/on * - * Use this to customize how the event appears in the dashboard or to control tracking. + * Use this object to control how the event is tracked, labeled, + * and ordered in the execution pipeline. * * @example * export default function() { @@ -438,16 +460,32 @@ export type DateLayout = */ export interface EventArgs { /** - * Adds or overrides existing tags used to label the event in dashboard + * Adds or overrides tags used to label this event in the dashboard. + * Tags can be used for filtering, grouping, or ownership attribution. */ tags?: { [key: string]: string }; /** - * Set to `true` to enable tracking of this event handler in the dashboard. - * Set to `false` to disable tracking. If omitted, Mokapi checks the response - * object to determine if the handler changed it, and tracks it accordingly. + * Controls whether this event handler is tracked in the dashboard. + * + * - true: always track this handler + * - false: never track this handler + * - undefined: Mokapi determines tracking automatically based on + * whether the response object was modified by the handler */ track?: boolean; + + /** + * Defines the execution order of the event handler. + * + * Handlers with higher priority values run first. + * Handlers with lower priority values run later. + * + * Use negative priorities (e.g. -1) to run a handler after + * the response has been fully populated by other handlers, + * such as for logging or recording purposes. + */ + priority?: number; } /** diff --git a/types/mokapi/package.json b/types/mokapi/package.json index 8cbbcb8a79e11d..0d9739dbd32640 100644 --- a/types/mokapi/package.json +++ b/types/mokapi/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/mokapi", - "version": "0.29.9999", + "version": "0.34.9999", "nonNpm": true, "nonNpmDescription": "Mokapi", "projects": [ diff --git a/types/mokapi/test/file-test.ts b/types/mokapi/test/file-test.ts new file mode 100644 index 00000000000000..95d633316aeebb --- /dev/null +++ b/types/mokapi/test/file-test.ts @@ -0,0 +1,16 @@ +import { appendString, read, writeString } from "mokapi/file"; + +// @ts-expect-error +read(123); +read("data.json"); +// @ts-expect-error +const i: number = read("data.json"); +const s: string = read("data.json"); + +writeString("data.txt", "Hello World"); +// @ts-expect-error +writeString("data.txt", 123); + +appendString("data.txt", "Hello Again"); +// @ts-expect-error +appendString("data.txt", 123); diff --git a/types/mokapi/test/mokapi-tests.ts b/types/mokapi/test/mokapi-tests.ts index aa5d31822101f3..fa557bd79ea5da 100644 --- a/types/mokapi/test/mokapi-tests.ts +++ b/types/mokapi/test/mokapi-tests.ts @@ -46,6 +46,9 @@ on("http", handler, ""); on("http", handler, {}); on("http", handler, { tags: { foo: "bar" } }); on("http", handler, { track: true }); +on("http", handler, { priority: 12 }); +// @ts-expect-error +on("http", handler, { priority: true }); on("http", async () => {}); on("http", (request) => { request.querystring; @@ -53,12 +56,19 @@ on("http", (request) => { on("http", (request, response) => { const s = request.toString(); const url = request.url.toString(); + const api: string = request.api; response.headers = { "Content-Type": "application/json", }; response.headers["Access-Control-Allow-Origin"] = "*"; response.headers["foo"] = { bar: 123 }; + + response.rebuild(200, "application/json"); + // @ts-expect-error + response.rebuild("200", "application/json"); + // @ts-expect-error + response.rebuild(200, {}); }); // @ts-expect-error From 111a435a88e2b060a659ca3d7a18afb55875339d Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Mon, 16 Feb 2026 08:24:36 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=A4=96=20Update=20CODEOWNERS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/CODEOWNERS | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 461c8ec94228e8..1f0ffd707376c8 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -328,7 +328,6 @@ /types/array.prototype.flat/ @kylejlin @ljharb /types/array.prototype.flatmap/ @hallettj @ljharb /types/arrive/ @vijaypemmaraju -/types/artillery/ @BendingBender /types/asana/ @tkqubo @tasyp @filipposarzana @szlori @apiology /types/asap/ @fpascutti /types/ascii-art/ @lukaselmer @@ -1349,6 +1348,7 @@ /types/d3-shape/v1/ @tomwanzek @gustavderdrache @borisyankov @denisname @Methuselah96 /types/d3-shape/v2/ @tomwanzek @gustavderdrache @borisyankov @denisname @Methuselah96 /types/d3-simple-slider/ @johnwalley +/types/d3-tile/ @NaciriMouad /types/d3-time/ @tomwanzek @gustavderdrache @borisyankov @denisname @Methuselah96 /types/d3-time/v1/ @tomwanzek @gustavderdrache @borisyankov @denisname @Methuselah96 /types/d3-time/v2/ @tomwanzek @gustavderdrache @borisyankov @denisname @Methuselah96 @@ -1855,7 +1855,6 @@ /types/eslint-plugin-jsx-a11y/ @eagerestwolf @ljharb /types/eslint-plugin-markdown/ @JounQin /types/eslint-plugin-mobx/ @MysteryBlokHed -/types/eslint-plugin-mocha/ @rhysd /types/eslint-plugin-prettier/ @ikatyang @JounQin /types/eslint-plugin-security/ @rhysd @porada /types/eslint-plugin-tailwindcss/ @eagerestwolf @@ -2087,7 +2086,6 @@ /types/fibjs/ @richardo2016 /types/field/ @aleung /types/figma/ @rudi-c -/types/file-entry-cache/ @peterblazejewicz /types/file-exists/ @BendingBender /types/file-fetch/ @tpluscode /types/file-loader/ @g-rath @@ -4696,7 +4694,6 @@ /types/mapbox__mapbox-gl-geocoder/ @Nosfit @dmytro-gokun /types/mapbox__mapbox-gl-traffic/ @niekvb /types/mapbox__mapbox-sdk/ @jeffbdye @mikeomeara1 @chachan @techieshark @rroohhh -/types/mapbox__point-geometry/ @webberig @HarelM /types/mapbox__polyline/ @Kern0 @mklopets /types/mapbox__rehype-prism/ @remcohaszing /types/mapbox__s3urls/ @sebastianvera @@ -4799,6 +4796,7 @@ /types/memory-fs/ @e-cloud /types/memory-pager/ @BendingBender /types/memory-usage/ @BendingBender +/types/memorystorage/ @Zephyr-Blessed /types/memorystream/ @bangbang93 @geniou /types/memwatch-next/ @cyrilschumacher /types/mercadopago/ @danieldspx @@ -7725,7 +7723,6 @@ /types/tape-async/ @ExE-Boss /types/tape-catch/ @ExE-Boss /types/tape-promise/ @ExE-Boss @ljharb -/types/tar/ @SomaticIT @connor4312 /types/tar-fs/ @Umoxfo @chriswiggins /types/tar-js/ @Narazaka /types/tar-stream/ @glicht @peterblazejewicz @kevin-lindsay-1 @screendriver @@ -8246,7 +8243,6 @@ /types/vue-scroll-up/ @slaweet /types/vue-select/ @silh @FloEdelmann /types/vue-splitpane/ @noonhorse -/types/vue-tel-input/ @suryadana /types/vue-template-es2015-compiler/ @iam-medvedev /types/vue-the-mask/ @domschmidt /types/vue2-datepicker/ @ChrisStornowski @@ -8467,6 +8463,7 @@ /types/wordpress__blocks/ @dsifford @sirreal @dmsnell @tomasztunik @sunyatasattva @bastolen @joshualip-plaudit /types/wordpress__customize-browser/ @marekdedic /types/wordpress__edit-post/ @dsifford +/types/wordpress__server-side-render/ @rafaucau /types/wordpress__viewport/ @dsifford /types/wordpress__wordcount/ @dsifford /types/words-to-time-converter/ @peterblazejewicz From 5a95ae32d77abe84331db52282db2b73aae0bfab Mon Sep 17 00:00:00 2001 From: hspiess-correctiv Date: Mon, 16 Feb 2026 10:09:47 +0100 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74509=20[@word?= =?UTF-8?q?press/block-editor]=20Add=20missing=20properties=20to=20InnerBl?= =?UTF-8?q?ocks=20Props=20by=20@hspiess-correctiv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/inner-blocks.d.ts | 18 ++++++++++++++++-- .../wordpress__block-editor-tests.tsx | 3 +++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/types/wordpress__block-editor/components/inner-blocks.d.ts b/types/wordpress__block-editor/components/inner-blocks.d.ts index ef6ebc3a0527ef..924ea98bdabd3a 100644 --- a/types/wordpress__block-editor/components/inner-blocks.d.ts +++ b/types/wordpress__block-editor/components/inner-blocks.d.ts @@ -1,4 +1,4 @@ -import { TemplateArray } from "@wordpress/blocks"; +import { BlockAttributes, TemplateArray } from "@wordpress/blocks"; import { ComponentType, JSX, ReactElement, Ref } from "react"; import { EditorTemplateLock } from "../"; @@ -7,7 +7,7 @@ import { Merged, Reserved } from "./use-block-props"; declare namespace InnerBlocks { interface Props { - allowedBlocks?: string[] | undefined; + allowedBlocks?: string[] | boolean | undefined; /** * A 'render prop' function that can be used to customize the block's appender. */ @@ -56,6 +56,20 @@ declare namespace InnerBlocks { * `prioritizedInserterBlocks` takes an array of the form {blockName}/{variationName}, where {variationName} is optional. */ prioritizedInserterBlocks?: string[] | undefined; + + /** + * Determines which block type should be inserted by default and any attributes that should be set by default when the block is inserted. + * Takes an object in the form of `{ name: blockname, attributes: {blockAttributes} }`. + */ + defaultBlock?: { + name: string; + attributes?: BlockAttributes; + } | undefined; + + /** + * Determines whether the default block should be inserted directly into the InnerBlocks area by the block appender. + */ + directInsert?: boolean | undefined; } } declare const InnerBlocks: { diff --git a/types/wordpress__block-editor/wordpress__block-editor-tests.tsx b/types/wordpress__block-editor/wordpress__block-editor-tests.tsx index b305effa0ed603..23100d4d0e1511 100644 --- a/types/wordpress__block-editor/wordpress__block-editor-tests.tsx +++ b/types/wordpress__block-editor/wordpress__block-editor-tests.tsx @@ -246,12 +246,15 @@ be.withFontSizes("fontSize")(() =>

Hello World

); // inner-blocks // ; +; ; ; ; ; ; ; +; +; // // inserter