wp-typia 0.20.0 → 0.20.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.
@@ -1,16 +1,18 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../wp-typia-project-tools/src/runtime/cli-add-block.ts", "../../wp-typia-project-tools/src/runtime/cli-add-block-config.ts", "../../wp-typia-project-tools/src/runtime/cli-add-block-legacy-validator.ts", "../../wp-typia-project-tools/src/runtime/cli-add-workspace.ts", "../../wp-typia-project-tools/src/runtime/cli-add-workspace-assets.ts", "../../wp-typia-project-tools/src/runtime/cli-add-workspace-rest.ts", "../../wp-typia-project-tools/src/runtime/rest-resource-artifacts.ts"],
3
+ "sources": ["../../wp-typia-project-tools/src/runtime/cli-add-block.ts", "../../wp-typia-project-tools/src/runtime/cli-add-block-config.ts", "../../wp-typia-project-tools/src/runtime/cli-add-block-legacy-validator.ts", "../../wp-typia-project-tools/src/runtime/cli-add-workspace.ts", "../../wp-typia-project-tools/src/runtime/cli-add-workspace-assets.ts", "../../wp-typia-project-tools/src/runtime/cli-add-workspace-rest.ts", "../../wp-typia-project-tools/src/runtime/cli-add-workspace-rest-anchors.ts", "../../wp-typia-project-tools/src/runtime/rest-resource-artifacts.ts", "../../wp-typia-project-tools/src/runtime/cli-add-workspace-rest-source-emitters.ts"],
4
4
  "sourcesContent": [
5
5
  "import fs from \"node:fs\";\nimport { promises as fsp } from \"node:fs\";\nimport path from \"node:path\";\n\nimport {\n\tsyncBlockMetadata,\n} from \"@wp-typia/block-runtime/metadata-core\";\n\nimport {\n\tensureMigrationDirectories,\n\tparseMigrationConfig,\n\twriteInitialMigrationScaffold,\n\twriteMigrationConfig,\n} from \"./migration-project.js\";\nimport {\n\tsyncPersistenceRestArtifacts,\n} from \"./persistence-rest-artifacts.js\";\nimport { snapshotProjectVersion } from \"./migrations.js\";\nimport { getDefaultAnswers, scaffoldProject } from \"./scaffold.js\";\nimport type { ScaffoldTemplateVariables } from \"./scaffold.js\";\nimport {\n\tcopyInterpolatedDirectory,\n\tlistInterpolatedDirectoryOutputs,\n} from \"./template-render.js\";\nimport type { MigrationBlockConfig } from \"./migration-types.js\";\nimport {\n\tappendWorkspaceInventoryEntries,\n} from \"./workspace-inventory.js\";\nimport { createManagedTempRoot } from \"./temp-roots.js\";\nimport {\n\tresolveWorkspaceProject,\n} from \"./workspace-project.js\";\nimport {\n\tADD_BLOCK_TEMPLATE_IDS,\n\ttype AddBlockTemplateId,\n\tbuildWorkspacePhpPrefix,\n\tisAddBlockTemplateId,\n\tpatchFile,\n\treadOptionalFile,\n\ttype RunAddBlockCommandOptions,\n\trollbackWorkspaceMutation,\n\ttype WorkspaceMutationSnapshot,\n\tsnapshotWorkspaceFiles,\n} from \"./cli-add-shared.js\";\nimport {\n\tresolveNonEmptyNormalizedBlockSlug,\n} from \"./scaffold-identifiers.js\";\nimport {\n\tbuildConfigEntries,\n\tbuildMigrationBlocks,\n\tbuildServerTemplateRoot,\n} from \"./cli-add-block-config.js\";\nimport {\n\tCOMPOUND_SHARED_SUPPORT_FILES,\n\tcollectLegacyCompoundValidatorPaths,\n\tensureBlockConfigCanAddRestManifests,\n\tensureCompoundWorkspaceSupportFiles,\n} from \"./cli-add-block-legacy-validator.js\";\nimport {\n\tparseTemplateLocator,\n\tresolveTemplateSeed,\n} from \"./template-source.js\";\nimport {\n\tresolveExternalTemplateLayers,\n} from \"./template-layers.js\";\nimport {\n\tformatInstallCommand,\n} from \"./package-managers.js\";\nimport { parseCompoundInnerBlocksPreset } from \"./compound-inner-blocks.js\";\nimport {\n\tresolveOptionalInteractiveExternalLayerId,\n} from \"./external-layer-selection.js\";\nimport { parseAlternateRenderTargets } from \"./alternate-render-targets.js\";\nimport {\n\tassertExternalLayerCompositionOptions,\n\tnormalizeOptionalCliString,\n\tresolveLocalCliPathOption,\n} from \"./cli-validation.js\";\n\nconst COLLECTION_IMPORT_LINE = \"import '../../collection';\";\n// This is a lightweight preflight heuristic for the common install layouts:\n// node_modules for npm/pnpm/bun/yarn-classic and Yarn PnP marker files.\n// It intentionally favors fast user guidance over exhaustive detection, so\n// stale node_modules or hoisted installs outside the workspace root can still\n// fall through to deeper resolver errors.\nconst WORKSPACE_INSTALL_MARKERS = [\"node_modules\", \".pnp.cjs\", \".pnp.loader.mjs\"] as const;\n\nasync function ensureCollectionImport(filePath: string): Promise<void> {\n\tawait patchFile(filePath, (source) => {\n\t\tif (source.includes(COLLECTION_IMPORT_LINE)) {\n\t\t\treturn source;\n\t\t}\n\t\tif (source.includes(\"import metadata from './block-metadata';\")) {\n\t\t\treturn source.replace(\n\t\t\t\t\"import metadata from './block-metadata';\",\n\t\t\t\t`${COLLECTION_IMPORT_LINE}\\nimport metadata from './block-metadata';`,\n\t\t\t);\n\t\t}\n\t\tif (source.includes(\"import metadata from './block.json';\")) {\n\t\t\treturn source.replace(\n\t\t\t\t\"import metadata from './block.json';\",\n\t\t\t\t`${COLLECTION_IMPORT_LINE}\\nimport metadata from './block.json';`,\n\t\t\t);\n\t\t}\n\t\treturn `${COLLECTION_IMPORT_LINE}\\n${source}`;\n\t});\n}\n\nasync function copyTempDirectory(sourceDir: string, targetDir: string): Promise<void> {\n\tawait fsp.mkdir(path.dirname(targetDir), { recursive: true });\n\tawait fsp.cp(sourceDir, targetDir, { recursive: true });\n}\n\nasync function addCollectionImportsForTemplate(\n\tprojectDir: string,\n\ttemplateId: AddBlockTemplateId,\n\tvariables: ScaffoldTemplateVariables,\n): Promise<void> {\n\tif (templateId === \"compound\") {\n\t\tawait ensureCollectionImport(\n\t\t\tpath.join(projectDir, \"src\", \"blocks\", variables.slugKebabCase, \"index.tsx\"),\n\t\t);\n\t\tawait ensureCollectionImport(\n\t\t\tpath.join(projectDir, \"src\", \"blocks\", `${variables.slugKebabCase}-item`, \"index.tsx\"),\n\t\t);\n\t\treturn;\n\t}\n\n\tawait ensureCollectionImport(\n\t\tpath.join(projectDir, \"src\", \"blocks\", variables.slugKebabCase, \"index.tsx\"),\n\t);\n}\n\nasync function appendBlockConfigEntries(\n\tprojectDir: string,\n\tentries: string[],\n\tneedsRestManifestImport: boolean,\n): Promise<void> {\n\tawait appendWorkspaceInventoryEntries(projectDir, {\n\t\tblockEntries: entries,\n\t\ttransformSource: needsRestManifestImport ? ensureBlockConfigCanAddRestManifests : undefined,\n\t});\n}\n\nasync function renderWorkspacePersistenceServerModule(\n\tprojectDir: string,\n\tvariables: ScaffoldTemplateVariables,\n): Promise<void> {\n\tconst targetDir = path.join(projectDir, \"src\", \"blocks\", variables.slugKebabCase);\n\tconst templateDir = buildServerTemplateRoot(variables.persistencePolicy);\n\tawait copyInterpolatedDirectory(templateDir, targetDir, variables);\n}\n\nfunction hasInstalledWorkspaceDependencies(projectDir: string): boolean {\n\treturn WORKSPACE_INSTALL_MARKERS.some((marker) =>\n\t\tfs.existsSync(path.join(projectDir, marker)),\n\t);\n}\n\nfunction assertWorkspaceDependenciesInstalled(workspace: {\n\tpackageManager: \"bun\" | \"npm\" | \"pnpm\" | \"yarn\";\n\tprojectDir: string;\n}): void {\n\tif (hasInstalledWorkspaceDependencies(workspace.projectDir)) {\n\t\treturn;\n\t}\n\n\tthrow new Error(\n\t\t`Workspace dependencies have not been installed yet. Run \\`${formatInstallCommand(workspace.packageManager)}\\` from the workspace root before using \\`wp-typia add block ...\\`.`,\n\t);\n}\n\n\nasync function copyScaffoldedBlockSlice(\n\tprojectDir: string,\n\ttemplateId: AddBlockTemplateId,\n\ttempProjectDir: string,\n\tvariables: ScaffoldTemplateVariables,\n\tlegacyValidatorPaths: readonly string[] = [],\n): Promise<void> {\n\tif (templateId === \"compound\") {\n\t\tawait ensureCompoundWorkspaceSupportFiles(\n\t\t\tprojectDir,\n\t\t\ttempProjectDir,\n\t\t\tlegacyValidatorPaths,\n\t\t);\n\t\tawait copyTempDirectory(\n\t\t\tpath.join(tempProjectDir, \"src\", \"blocks\", variables.slugKebabCase),\n\t\t\tpath.join(projectDir, \"src\", \"blocks\", variables.slugKebabCase),\n\t\t);\n\t\tawait copyTempDirectory(\n\t\t\tpath.join(tempProjectDir, \"src\", \"blocks\", `${variables.slugKebabCase}-item`),\n\t\t\tpath.join(projectDir, \"src\", \"blocks\", `${variables.slugKebabCase}-item`),\n\t\t);\n\t\tif (variables.compoundPersistenceEnabled === \"true\") {\n\t\t\tawait renderWorkspacePersistenceServerModule(projectDir, variables);\n\t\t}\n\t\treturn;\n\t}\n\n\tawait copyTempDirectory(\n\t\tpath.join(tempProjectDir, \"src\"),\n\t\tpath.join(projectDir, \"src\", \"blocks\", variables.slugKebabCase),\n\t);\n\n\tif (templateId === \"persistence\") {\n\t\tawait renderWorkspacePersistenceServerModule(projectDir, variables);\n\t}\n}\n\nfunction isSupportedAddBlockLayerOutput(options: {\n\trelativePath: string;\n\ttemplateId: AddBlockTemplateId;\n\tvariables: ScaffoldTemplateVariables;\n}): boolean {\n\tconst { relativePath, templateId, variables } = options;\n\tif (templateId === \"compound\") {\n\t\treturn (\n\t\t\trelativePath === \"src/hooks.ts\" ||\n\t\t\trelativePath === \"src/validator-toolkit.ts\" ||\n\t\t\trelativePath.startsWith(`src/blocks/${variables.slugKebabCase}/`) ||\n\t\t\trelativePath.startsWith(`src/blocks/${variables.slugKebabCase}-item/`)\n\t\t);\n\t}\n\n\treturn relativePath.startsWith(\"src/\");\n}\n\nasync function assertAddBlockSupportsExternalLayerOutputs(options: {\n\tcallerCwd: string;\n\texternalLayerId?: string;\n\texternalLayerSource?: string;\n\ttemplateId: AddBlockTemplateId;\n\tvariables: ScaffoldTemplateVariables;\n}): Promise<void> {\n\tconst {\n\t\tcallerCwd,\n\t\texternalLayerId,\n\t\texternalLayerSource,\n\t\ttemplateId,\n\t\tvariables,\n\t} = options;\n\tif (!externalLayerSource) {\n\t\treturn;\n\t}\n\n\tconst layerSeed = await resolveTemplateSeed(\n\t\tparseTemplateLocator(externalLayerSource),\n\t\tcallerCwd,\n\t);\n\ttry {\n\t\tconst resolvedLayers = await resolveExternalTemplateLayers({\n\t\t\texternalLayerId,\n\t\t\tsourceRoot: layerSeed.rootDir,\n\t\t});\n\n\t\tfor (const entry of resolvedLayers.entries) {\n\t\t\tif (entry.kind !== \"external\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tfor (const relativePath of await listInterpolatedDirectoryOutputs(\n\t\t\t\tentry.dir,\n\t\t\t\tvariables,\n\t\t\t)) {\n\t\t\t\tif (\n\t\t\t\t\tisSupportedAddBlockLayerOutput({\n\t\t\t\t\t\trelativePath,\n\t\t\t\t\t\ttemplateId,\n\t\t\t\t\t\tvariables,\n\t\t\t\t\t})\n\t\t\t\t) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`External layer \"${entry.id}\" writes workspace-level output \"${relativePath}\", which \\`wp-typia add block\\` cannot merge safely. Restrict the layer to block-local files or scaffold it through \\`wp-typia create\\` instead.`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tawait layerSeed.cleanup?.();\n\t}\n}\n\nfunction collectWorkspaceBlockPaths(\n\tprojectDir: string,\n\ttemplateId: AddBlockTemplateId,\n\tvariables: ScaffoldTemplateVariables,\n): string[] {\n\tif (templateId === \"compound\") {\n\t\treturn [\n\t\t\tpath.join(projectDir, \"src\", \"blocks\", variables.slugKebabCase),\n\t\t\tpath.join(projectDir, \"src\", \"blocks\", `${variables.slugKebabCase}-item`),\n\t\t];\n\t}\n\n\treturn [path.join(projectDir, \"src\", \"blocks\", variables.slugKebabCase)];\n}\n\nfunction assertBlockTargetsDoNotExist(\n\tprojectDir: string,\n\ttemplateId: AddBlockTemplateId,\n\tvariables: ScaffoldTemplateVariables,\n): void {\n\tfor (const targetPath of collectWorkspaceBlockPaths(projectDir, templateId, variables)) {\n\t\tif (fs.existsSync(targetPath)) {\n\t\t\tthrow new Error(\n\t\t\t\t`A block already exists at ${path.relative(projectDir, targetPath)}. Choose a different name.`,\n\t\t\t);\n\t\t}\n\t}\n}\n\nasync function updateWorkspaceMigrationConfigIfPresent(\n\tprojectDir: string,\n\tnewBlocks: MigrationBlockConfig[],\n): Promise<void> {\n\tconst configPath = path.join(projectDir, \"src\", \"migrations\", \"config.ts\");\n\tif (!fs.existsSync(configPath)) {\n\t\treturn;\n\t}\n\n\tconst configSource = await fsp.readFile(configPath, \"utf8\");\n\tconst config = parseMigrationConfig(configSource);\n\tconst existingBlocks = Array.isArray(config.blocks) ? config.blocks : [];\n\tconst nextBlocks = [\n\t\t...existingBlocks,\n\t\t...newBlocks.filter(\n\t\t\t(block) => !existingBlocks.some((existing) => existing.key === block.key),\n\t\t),\n\t];\n\n\twriteMigrationConfig(projectDir, {\n\t\t...config,\n\t\tblocks: nextBlocks,\n\t});\n\n\tsnapshotProjectVersion(projectDir, config.currentMigrationVersion, {\n\t\tskipConfigUpdate: true,\n\t});\n}\n\nasync function syncWorkspaceBlockMetadata(\n\tprojectDir: string,\n\tslug: string,\n\tsourceTypeName: string,\n\ttypesFile: string,\n): Promise<void> {\n\tawait syncBlockMetadata(\n\t\t{\n\t\t\tblockJsonFile: path.join(\"src\", \"blocks\", slug, \"block.json\"),\n\t\t\tjsonSchemaFile: path.join(\"src\", \"blocks\", slug, \"typia.schema.json\"),\n\t\t\tmanifestFile: path.join(\"src\", \"blocks\", slug, \"typia.manifest.json\"),\n\t\t\topenApiFile: path.join(\"src\", \"blocks\", slug, \"typia.openapi.json\"),\n\t\t\tprojectRoot: projectDir,\n\t\t\tsourceTypeName,\n\t\t\ttypesFile,\n\t\t},\n\t);\n}\n\nasync function syncWorkspacePersistenceArtifacts(\n\tprojectDir: string,\n\tvariables: ScaffoldTemplateVariables,\n): Promise<void> {\n\tawait syncPersistenceRestArtifacts({\n\t\tapiTypesFile: path.join(\"src\", \"blocks\", variables.slugKebabCase, \"api-types.ts\"),\n\t\toutputDir: path.join(\"src\", \"blocks\", variables.slugKebabCase),\n\t\tprojectDir,\n\t\tvariables,\n\t});\n}\n\nasync function syncWorkspaceAddedBlockArtifacts(\n\tprojectDir: string,\n\ttemplateId: AddBlockTemplateId,\n\tvariables: ScaffoldTemplateVariables,\n): Promise<void> {\n\tawait syncWorkspaceBlockMetadata(\n\t\tprojectDir,\n\t\tvariables.slugKebabCase,\n\t\t`${variables.pascalCase}Attributes`,\n\t\tpath.join(\"src\", \"blocks\", variables.slugKebabCase, \"types.ts\"),\n\t);\n\n\tif (templateId === \"compound\") {\n\t\tawait syncWorkspaceBlockMetadata(\n\t\t\tprojectDir,\n\t\t\t`${variables.slugKebabCase}-item`,\n\t\t\t`${variables.pascalCase}ItemAttributes`,\n\t\t\tpath.join(\"src\", \"blocks\", `${variables.slugKebabCase}-item`, \"types.ts\"),\n\t\t);\n\t}\n\n\tif (\n\t\ttemplateId === \"persistence\" ||\n\t\t(templateId === \"compound\" && variables.compoundPersistenceEnabled === \"true\")\n\t) {\n\t\tawait syncWorkspacePersistenceArtifacts(projectDir, variables);\n\t}\n}\n\nfunction assertPersistenceFlagsAllowed(\n\ttemplateId: AddBlockTemplateId,\n\toptions: Pick<\n\t\tRunAddBlockCommandOptions,\n\t\t\"alternateRenderTargets\" | \"dataStorageMode\" | \"persistencePolicy\"\n\t>,\n): void {\n\tconst hasPersistenceFlags =\n\t\ttypeof options.alternateRenderTargets === \"string\" ||\n\t\ttypeof options.dataStorageMode === \"string\" ||\n\t\ttypeof options.persistencePolicy === \"string\";\n\n\tif (!hasPersistenceFlags) {\n\t\treturn;\n\t}\n\n\tif (templateId === \"persistence\" || templateId === \"compound\") {\n\t\tparseAlternateRenderTargets(options.alternateRenderTargets);\n\t\tif (\n\t\t\ttypeof options.dataStorageMode === \"string\" &&\n\t\t\toptions.dataStorageMode !== \"custom-table\" &&\n\t\t\toptions.dataStorageMode !== \"post-meta\"\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t`Unsupported data storage mode \"${options.dataStorageMode}\". Expected one of: post-meta, custom-table.`,\n\t\t\t);\n\t\t}\n\t\tif (\n\t\t\ttypeof options.persistencePolicy === \"string\" &&\n\t\t\toptions.persistencePolicy !== \"authenticated\" &&\n\t\t\toptions.persistencePolicy !== \"public\"\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t`Unsupported persistence policy \"${options.persistencePolicy}\". Expected one of: authenticated, public.`,\n\t\t\t);\n\t\t}\n\t\tif (\n\t\t\ttemplateId === \"compound\" &&\n\t\t\ttypeof options.alternateRenderTargets === \"string\" &&\n\t\t\t!options.dataStorageMode &&\n\t\t\t!options.persistencePolicy\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t\"`--alternate-render-targets` on `wp-typia add block --template compound` requires the persistence-enabled server render path. Add `--data-storage <post-meta|custom-table>` or `--persistence-policy <authenticated|public>` first.\",\n\t\t\t);\n\t\t}\n\t\treturn;\n\t}\n\n\tthrow new Error(\n\t\t`--data-storage, --persistence-policy, and --alternate-render-targets are supported only for \\`wp-typia add block --template persistence\\` or persistence-enabled \\`--template compound\\`.`,\n\t);\n}\n\nfunction assertCompoundInnerBlocksPresetAllowed(\n\ttemplateId: AddBlockTemplateId,\n\tinnerBlocksPreset?: string,\n): void {\n\tif (!innerBlocksPreset) {\n\t\treturn;\n\t}\n\n\tif (templateId !== \"compound\") {\n\t\tthrow new Error(\n\t\t\t\"`--inner-blocks-preset` is supported only for `wp-typia add block --template compound`.\",\n\t\t);\n\t}\n\n\tparseCompoundInnerBlocksPreset(innerBlocksPreset);\n}\n\n/**\n * Seeds an empty official workspace migration project before any blocks are added.\n *\n * @param projectDir Absolute path to the workspace root that will own the\n * migration config and generated scaffold files.\n * @param currentMigrationVersion Initial migration label to record as the\n * current version in the seeded workspace.\n */\nexport async function seedWorkspaceMigrationProject(\n\tprojectDir: string,\n\tcurrentMigrationVersion: string,\n): Promise<void> {\n\twriteMigrationConfig(projectDir, {\n\t\tblocks: [],\n\t\tcurrentMigrationVersion,\n\t\tsnapshotDir: \"src/migrations/versions\",\n\t\tsupportedMigrationVersions: [currentMigrationVersion],\n\t});\n\tensureMigrationDirectories(projectDir, []);\n\twriteInitialMigrationScaffold(projectDir, currentMigrationVersion, []);\n}\n\n/**\n * Adds one built-in block slice to an official workspace project.\n *\n * @param options Command options for the built-in workspace block scaffold flow.\n * @param options.blockName Human-entered block name that will be normalized\n * into the generated workspace block slug.\n * @param options.cwd Working directory used to resolve the nearest official\n * workspace. Defaults to `process.cwd()`.\n * @param options.dataStorageMode Optional storage mode for persistence-capable\n * templates.\n * @param options.innerBlocksPreset Optional compound-only InnerBlocks preset\n * (`freeform`, `ordered`, `horizontal`, or `locked-structure`) that controls\n * the generated authoring defaults for nested compound containers.\n * @param options.persistencePolicy Optional persistence policy for\n * persistence-capable templates.\n * @param options.templateId Built-in block family to scaffold. Defaults to\n * `\"basic\"`.\n * @returns A promise that resolves with the created block slugs, the owning\n * project directory, and the resolved template id after workspace mutation\n * succeeds.\n * @throws {Error} When the template id is unknown, persistence flags are used\n * with unsupported templates, the command runs outside an official workspace,\n * workspace dependencies have not been installed yet, or target block paths\n * already exist.\n */\nexport async function runAddBlockCommand({\n\talternateRenderTargets,\n\tblockName,\n\tcwd = process.cwd(),\n\tdataStorageMode,\n\texternalLayerId,\n\texternalLayerSource,\n\tinnerBlocksPreset,\n\tpersistencePolicy,\n\tselectExternalLayerId,\n\ttemplateId = \"basic\",\n}: RunAddBlockCommandOptions): Promise<{\n\tblockSlugs: string[];\n\tprojectDir: string;\n\ttemplateId: AddBlockTemplateId;\n\twarnings: string[];\n}> {\n\tif (templateId === \"query-loop\") {\n\t\tthrow new Error(\n\t\t\t\"`wp-typia add block --template query-loop` is not supported. Query Loop is a create-time `core/query` variation scaffold, so use `wp-typia create <project-dir> --template query-loop` instead.\",\n\t\t);\n\t}\n\tif (!isAddBlockTemplateId(templateId)) {\n\t\tthrow new Error(\n\t\t\t`Unknown add-block template \"${templateId}\". Expected one of: ${ADD_BLOCK_TEMPLATE_IDS.join(\", \")}`,\n\t\t);\n\t}\n\tconst resolvedTemplateId = templateId;\n\n\tassertPersistenceFlagsAllowed(resolvedTemplateId, {\n\t\talternateRenderTargets,\n\t\tdataStorageMode,\n\t\tpersistencePolicy,\n\t});\n\tassertCompoundInnerBlocksPresetAllowed(\n\t\tresolvedTemplateId,\n\t\tinnerBlocksPreset,\n\t);\n\tconst resolvedInnerBlocksPreset =\n\t\tparseCompoundInnerBlocksPreset(innerBlocksPreset);\n\n\tconst workspace = resolveWorkspaceProject(cwd);\n\tassertWorkspaceDependenciesInstalled(workspace);\n\tconst normalizedExternalLayerId = normalizeOptionalCliString(externalLayerId);\n\tconst normalizedExternalLayerSource = resolveLocalCliPathOption({\n\t\tcwd,\n\t\tlabel: \"--external-layer-source\",\n\t\tvalue: externalLayerSource,\n\t});\n\tassertExternalLayerCompositionOptions({\n\t\texternalLayerId: normalizedExternalLayerId,\n\t\texternalLayerSource: normalizedExternalLayerSource,\n\t});\n\tconst resolvedExternalLayerSelection =\n\t\tawait resolveOptionalInteractiveExternalLayerId({\n\t\tcallerCwd: cwd,\n\t\texternalLayerId: normalizedExternalLayerId,\n\t\texternalLayerSource: normalizedExternalLayerSource,\n\t\tselectExternalLayerId,\n\t});\n\tlet tempRoot = \"\";\n\tlet cleanupTempRoot: (() => Promise<void>) | undefined;\n\n\ttry {\n\t\tconst normalizedSlug = resolveNonEmptyNormalizedBlockSlug({\n\t\t\tinput: blockName,\n\t\t\tlabel: \"Block name\",\n\t\t\tusage: \"wp-typia add block <name> --template <family>\",\n\t\t});\n\n\t\tconst defaults = getDefaultAnswers(normalizedSlug, resolvedTemplateId);\n\t\t({\n\t\t\tpath: tempRoot,\n\t\t\tcleanup: cleanupTempRoot,\n\t\t} = await createManagedTempRoot(\"wp-typia-add-block-\"));\n\t\tconst tempProjectDir = path.join(tempRoot, normalizedSlug);\n\t\tconst blockConfigPath = path.join(workspace.projectDir, \"scripts\", \"block-config.ts\");\n\t\tconst migrationConfigPath = path.join(workspace.projectDir, \"src\", \"migrations\", \"config.ts\");\n\t\tconst blockPhpPrefix = buildWorkspacePhpPrefix(\n\t\t\tworkspace.workspace.phpPrefix,\n\t\t\tnormalizedSlug,\n\t\t);\n\t\tconst migrationConfigSource = await readOptionalFile(migrationConfigPath);\n\t\tconst migrationConfig =\n\t\t\tmigrationConfigSource === null ? null : parseMigrationConfig(migrationConfigSource);\n\t\tconst compoundSupportPaths =\n\t\t\tresolvedTemplateId === \"compound\"\n\t\t\t\t? COMPOUND_SHARED_SUPPORT_FILES.map((fileName) =>\n\t\t\t\t\t\tpath.join(workspace.projectDir, \"src\", fileName),\n\t\t\t\t\t)\n\t\t\t\t: [];\n\t\tconst legacyCompoundValidatorPaths =\n\t\t\tresolvedTemplateId === \"compound\"\n\t\t\t\t? await collectLegacyCompoundValidatorPaths(workspace.projectDir)\n\t\t\t\t: [];\n\t\tconst result = await (async () => {\n\t\t\tconst scaffoldResult = await scaffoldProject({\n\t\t\t\talternateRenderTargets,\n\t\t\t\tanswers: {\n\t\t\t\t\t...defaults,\n\t\t\t\t\tauthor: workspace.author,\n\t\t\t\t\tcompoundInnerBlocksPreset: resolvedInnerBlocksPreset,\n\t\t\t\t\tnamespace: workspace.workspace.namespace,\n\t\t\t\t\tphpPrefix: blockPhpPrefix,\n\t\t\t\t\tslug: normalizedSlug,\n\t\t\t\t\ttextDomain: workspace.workspace.textDomain,\n\t\t\t\t\ttitle: defaults.title,\n\t\t\t\t},\n\t\t\t\tcwd: workspace.projectDir,\n\t\t\t\tdataStorageMode: dataStorageMode as \"custom-table\" | \"post-meta\" | undefined,\n\t\t\t\texternalLayerId:\n\t\t\t\t\tresolvedExternalLayerSelection.externalLayerId,\n\t\t\t\texternalLayerSource:\n\t\t\t\t\tresolvedExternalLayerSelection.externalLayerSource,\n\t\t\t\texternalLayerSourceLabel: normalizedExternalLayerSource,\n\t\t\t\tnoInstall: true,\n\t\t\t\tpackageManager: workspace.packageManager,\n\t\t\t\tpersistencePolicy:\n\t\t\t\t\tpersistencePolicy as \"authenticated\" | \"public\" | undefined,\n\t\t\t\tprojectDir: tempProjectDir,\n\t\t\t\ttemplateId: resolvedTemplateId,\n\t\t\t});\n\t\t\tawait assertAddBlockSupportsExternalLayerOutputs({\n\t\t\t\tcallerCwd: cwd,\n\t\t\t\texternalLayerId:\n\t\t\t\t\tresolvedExternalLayerSelection.externalLayerId,\n\t\t\t\texternalLayerSource:\n\t\t\t\t\tresolvedExternalLayerSelection.externalLayerSource,\n\t\t\t\ttemplateId: resolvedTemplateId,\n\t\t\t\tvariables: scaffoldResult.variables,\n\t\t\t});\n\t\t\treturn scaffoldResult;\n\t\t})();\n\t\tassertBlockTargetsDoNotExist(workspace.projectDir, resolvedTemplateId, result.variables);\n\t\tconst mutationSnapshot: WorkspaceMutationSnapshot = {\n\t\t\tfileSources: await snapshotWorkspaceFiles([\n\t\t\t\tblockConfigPath,\n\t\t\t\tmigrationConfigPath,\n\t\t\t\t...compoundSupportPaths,\n\t\t\t\t...legacyCompoundValidatorPaths,\n\t\t\t]),\n\t\t\tsnapshotDirs:\n\t\t\t\tmigrationConfig === null\n\t\t\t\t\t? []\n\t\t\t\t\t: buildMigrationBlocks(resolvedTemplateId, result.variables).map((block) =>\n\t\t\t\t\t\tpath.join(\n\t\t\t\t\t\t\tworkspace.projectDir,\n\t\t\t\t\t\t\t...migrationConfig.snapshotDir.split(\"/\"),\n\t\t\t\t\t\t\tmigrationConfig.currentMigrationVersion,\n\t\t\t\t\t\t\tblock.key,\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\ttargetPaths: collectWorkspaceBlockPaths(\n\t\t\t\tworkspace.projectDir,\n\t\t\t\tresolvedTemplateId,\n\t\t\t\tresult.variables,\n\t\t\t),\n\t\t};\n\n\t\ttry {\n\t\t\tawait copyScaffoldedBlockSlice(\n\t\t\t\tworkspace.projectDir,\n\t\t\t\tresolvedTemplateId,\n\t\t\t\ttempProjectDir,\n\t\t\t\tresult.variables,\n\t\t\t\tlegacyCompoundValidatorPaths,\n\t\t\t);\n\t\t\tawait addCollectionImportsForTemplate(\n\t\t\t\tworkspace.projectDir,\n\t\t\t\tresolvedTemplateId,\n\t\t\t\tresult.variables,\n\t\t\t);\n\t\t\tawait appendBlockConfigEntries(\n\t\t\t\tworkspace.projectDir,\n\t\t\t\tbuildConfigEntries(resolvedTemplateId, result.variables),\n\t\t\t\tresolvedTemplateId === \"persistence\" ||\n\t\t\t\t\t(resolvedTemplateId === \"compound\" &&\n\t\t\t\t\t\tresult.variables.compoundPersistenceEnabled === \"true\"),\n\t\t\t);\n\t\t\tawait syncWorkspaceAddedBlockArtifacts(\n\t\t\t\tworkspace.projectDir,\n\t\t\t\tresolvedTemplateId,\n\t\t\t\tresult.variables,\n\t\t\t);\n\t\t\tawait updateWorkspaceMigrationConfigIfPresent(\n\t\t\t\tworkspace.projectDir,\n\t\t\t\tbuildMigrationBlocks(resolvedTemplateId, result.variables),\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tblockSlugs: collectWorkspaceBlockPaths(\n\t\t\t\t\tworkspace.projectDir,\n\t\t\t\t\tresolvedTemplateId,\n\t\t\t\t\tresult.variables,\n\t\t\t\t).map((targetPath) => path.basename(targetPath)),\n\t\t\t\tprojectDir: workspace.projectDir,\n\t\t\t\ttemplateId: resolvedTemplateId,\n\t\t\t\twarnings: result.warnings,\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tawait rollbackWorkspaceMutation(mutationSnapshot);\n\t\t\tthrow error;\n\t\t}\n\t} finally {\n\t\ttry {\n\t\t\tawait resolvedExternalLayerSelection.cleanup?.();\n\t\t} finally {\n\t\t\tawait cleanupTempRoot?.();\n\t\t}\n\t}\n}\n",
6
6
  "import path from \"node:path\";\n\nimport {\n\tSHARED_WORKSPACE_TEMPLATE_ROOT,\n} from \"./template-registry.js\";\nimport type { MigrationBlockConfig } from \"./migration-types.js\";\nimport type { ScaffoldTemplateVariables } from \"./scaffold.js\";\nimport {\n\ttype AddBlockTemplateId,\n\tquoteTsString,\n} from \"./cli-add-shared.js\";\n\nexport function buildServerTemplateRoot(\n\tpersistencePolicy: string | undefined,\n): string {\n\treturn path.join(\n\t\tSHARED_WORKSPACE_TEMPLATE_ROOT,\n\t\tpersistencePolicy === \"public\" ? \"persistence-public\" : \"persistence-auth\",\n\t);\n}\n\nfunction buildSingleBlockConfigEntry(\n\tvariables: ScaffoldTemplateVariables,\n): string {\n\treturn [\n\t\t\"\\t{\",\n\t\t`\\t\\tslug: ${quoteTsString(variables.slugKebabCase)},`,\n\t\t`\\t\\tattributeTypeName: ${quoteTsString(`${variables.pascalCase}Attributes`)},`,\n\t\t`\\t\\ttypesFile: ${quoteTsString(`src/blocks/${variables.slugKebabCase}/types.ts`)},`,\n\t\t\"\\t},\",\n\t].join(\"\\n\");\n}\n\nfunction buildPersistenceBlockConfigEntry(\n\tvariables: ScaffoldTemplateVariables,\n): string {\n\treturn [\n\t\t\"\\t{\",\n\t\t`\\t\\tapiTypesFile: ${quoteTsString(`src/blocks/${variables.slugKebabCase}/api-types.ts`)},`,\n\t\t`\\t\\tattributeTypeName: ${quoteTsString(`${variables.pascalCase}Attributes`)},`,\n\t\t\"\\t\\trestManifest: defineEndpointManifest( {\",\n\t\t\"\\t\\t\\tcontracts: {\",\n\t\t\"\\t\\t\\t\\t'bootstrap-query': {\",\n\t\t`\\t\\t\\t\\t\\tsourceTypeName: ${quoteTsString(`${variables.pascalCase}BootstrapQuery`)},`,\n\t\t\"\\t\\t\\t\\t},\",\n\t\t\"\\t\\t\\t\\t'bootstrap-response': {\",\n\t\t`\\t\\t\\t\\t\\tsourceTypeName: ${quoteTsString(`${variables.pascalCase}BootstrapResponse`)},`,\n\t\t\"\\t\\t\\t\\t},\",\n\t\t\"\\t\\t\\t\\t'state-query': {\",\n\t\t`\\t\\t\\t\\t\\tsourceTypeName: ${quoteTsString(`${variables.pascalCase}StateQuery`)},`,\n\t\t\"\\t\\t\\t\\t},\",\n\t\t\"\\t\\t\\t\\t'state-response': {\",\n\t\t`\\t\\t\\t\\t\\tsourceTypeName: ${quoteTsString(`${variables.pascalCase}StateResponse`)},`,\n\t\t\"\\t\\t\\t\\t},\",\n\t\t\"\\t\\t\\t\\t'write-state-request': {\",\n\t\t`\\t\\t\\t\\t\\tsourceTypeName: ${quoteTsString(`${variables.pascalCase}WriteStateRequest`)},`,\n\t\t\"\\t\\t\\t\\t},\",\n\t\t\"\\t\\t\\t},\",\n\t\t\"\\t\\t\\tendpoints: [\",\n\t\t\"\\t\\t\\t\\t{\",\n\t\t\"\\t\\t\\t\\t\\tauth: 'public',\",\n\t\t\"\\t\\t\\t\\t\\tmethod: 'GET',\",\n\t\t`\\t\\t\\t\\t\\toperationId: ${quoteTsString(`get${variables.pascalCase}State`)},`,\n\t\t`\\t\\t\\t\\t\\tpath: ${quoteTsString(`/${variables.namespace}/v1/${variables.slugKebabCase}/state`)},`,\n\t\t\"\\t\\t\\t\\t\\tqueryContract: 'state-query',\",\n\t\t\"\\t\\t\\t\\t\\tresponseContract: 'state-response',\",\n\t\t`\\t\\t\\t\\t\\tsummary: 'Read the current persisted state.',`,\n\t\t`\\t\\t\\t\\t\\ttags: [ ${quoteTsString(variables.title)} ],`,\n\t\t\"\\t\\t\\t\\t},\",\n\t\t\"\\t\\t\\t\\t{\",\n\t\t`\\t\\t\\t\\t\\tauth: ${quoteTsString(variables.restWriteAuthIntent)},`,\n\t\t\"\\t\\t\\t\\t\\tbodyContract: 'write-state-request',\",\n\t\t\"\\t\\t\\t\\t\\tmethod: 'POST',\",\n\t\t`\\t\\t\\t\\t\\toperationId: ${quoteTsString(`write${variables.pascalCase}State`)},`,\n\t\t`\\t\\t\\t\\t\\tpath: ${quoteTsString(`/${variables.namespace}/v1/${variables.slugKebabCase}/state`)},`,\n\t\t\"\\t\\t\\t\\t\\tresponseContract: 'state-response',\",\n\t\t`\\t\\t\\t\\t\\tsummary: 'Write the current persisted state.',`,\n\t\t`\\t\\t\\t\\t\\ttags: [ ${quoteTsString(variables.title)} ],`,\n\t\t\"\\t\\t\\t\\t\\twordpressAuth: {\",\n\t\t`\\t\\t\\t\\t\\t\\tmechanism: ${quoteTsString(variables.restWriteAuthMechanism)},`,\n\t\t\"\\t\\t\\t\\t\\t},\",\n\t\t\"\\t\\t\\t\\t},\",\n\t\t\"\\t\\t\\t\\t{\",\n\t\t\"\\t\\t\\t\\t\\tauth: 'public',\",\n\t\t\"\\t\\t\\t\\t\\tmethod: 'GET',\",\n\t\t`\\t\\t\\t\\t\\toperationId: ${quoteTsString(`get${variables.pascalCase}Bootstrap`)},`,\n\t\t`\\t\\t\\t\\t\\tpath: ${quoteTsString(`/${variables.namespace}/v1/${variables.slugKebabCase}/bootstrap`)},`,\n\t\t\"\\t\\t\\t\\t\\tqueryContract: 'bootstrap-query',\",\n\t\t\"\\t\\t\\t\\t\\tresponseContract: 'bootstrap-response',\",\n\t\t`\\t\\t\\t\\t\\tsummary: 'Read fresh session bootstrap state for the current viewer.',`,\n\t\t`\\t\\t\\t\\t\\ttags: [ ${quoteTsString(variables.title)} ],`,\n\t\t\"\\t\\t\\t\\t},\",\n\t\t\"\\t\\t\\t],\",\n\t\t\"\\t\\t\\tinfo: {\",\n\t\t`\\t\\t\\t\\ttitle: ${quoteTsString(`${variables.title} REST API`)},`,\n\t\t\"\\t\\t\\t\\tversion: '1.0.0',\",\n\t\t\"\\t\\t\\t},\",\n\t\t\"\\t\\t} ),\",\n\t\t`\\t\\topenApiFile: ${quoteTsString(`src/blocks/${variables.slugKebabCase}/api.openapi.json`)},`,\n\t\t`\\t\\tslug: ${quoteTsString(variables.slugKebabCase)},`,\n\t\t`\\t\\ttypesFile: ${quoteTsString(`src/blocks/${variables.slugKebabCase}/types.ts`)},`,\n\t\t\"\\t},\",\n\t].join(\"\\n\");\n}\n\nfunction buildCompoundChildConfigEntry(\n\tvariables: ScaffoldTemplateVariables,\n): string {\n\treturn [\n\t\t\"\\t{\",\n\t\t`\\t\\tslug: ${quoteTsString(`${variables.slugKebabCase}-item`)},`,\n\t\t`\\t\\tattributeTypeName: ${quoteTsString(`${variables.pascalCase}ItemAttributes`)},`,\n\t\t`\\t\\ttypesFile: ${quoteTsString(`src/blocks/${variables.slugKebabCase}-item/types.ts`)},`,\n\t\t\"\\t},\",\n\t].join(\"\\n\");\n}\n\nexport function buildConfigEntries(\n\ttemplateId: AddBlockTemplateId,\n\tvariables: ScaffoldTemplateVariables,\n): string[] {\n\tif (templateId === \"basic\" || templateId === \"interactivity\") {\n\t\treturn [buildSingleBlockConfigEntry(variables)];\n\t}\n\n\tif (templateId === \"persistence\") {\n\t\treturn [buildPersistenceBlockConfigEntry(variables)];\n\t}\n\n\tif (variables.compoundPersistenceEnabled === \"true\") {\n\t\treturn [\n\t\t\tbuildPersistenceBlockConfigEntry(variables),\n\t\t\tbuildCompoundChildConfigEntry(variables),\n\t\t];\n\t}\n\n\treturn [\n\t\tbuildSingleBlockConfigEntry(variables),\n\t\tbuildCompoundChildConfigEntry(variables),\n\t];\n}\n\nexport function buildMigrationBlocks(\n\ttemplateId: AddBlockTemplateId,\n\tvariables: ScaffoldTemplateVariables,\n): MigrationBlockConfig[] {\n\tif (templateId === \"compound\") {\n\t\treturn [\n\t\t\t{\n\t\t\t\tblockJsonFile: `src/blocks/${variables.slugKebabCase}/block.json`,\n\t\t\t\tblockName: `${variables.namespace}/${variables.slugKebabCase}`,\n\t\t\t\tkey: variables.slugKebabCase,\n\t\t\t\tmanifestFile: `src/blocks/${variables.slugKebabCase}/typia.manifest.json`,\n\t\t\t\tsaveFile: `src/blocks/${variables.slugKebabCase}/save.tsx`,\n\t\t\t\ttypesFile: `src/blocks/${variables.slugKebabCase}/types.ts`,\n\t\t\t},\n\t\t\t{\n\t\t\t\tblockJsonFile: `src/blocks/${variables.slugKebabCase}-item/block.json`,\n\t\t\t\tblockName: `${variables.namespace}/${variables.slugKebabCase}-item`,\n\t\t\t\tkey: `${variables.slugKebabCase}-item`,\n\t\t\t\tmanifestFile: `src/blocks/${variables.slugKebabCase}-item/typia.manifest.json`,\n\t\t\t\tsaveFile: `src/blocks/${variables.slugKebabCase}-item/save.tsx`,\n\t\t\t\ttypesFile: `src/blocks/${variables.slugKebabCase}-item/types.ts`,\n\t\t\t},\n\t\t];\n\t}\n\n\treturn [\n\t\t{\n\t\t\tblockJsonFile: `src/blocks/${variables.slugKebabCase}/block.json`,\n\t\t\tblockName: `${variables.namespace}/${variables.slugKebabCase}`,\n\t\t\tkey: variables.slugKebabCase,\n\t\t\tmanifestFile: `src/blocks/${variables.slugKebabCase}/typia.manifest.json`,\n\t\t\tsaveFile: `src/blocks/${variables.slugKebabCase}/save.tsx`,\n\t\t\ttypesFile: `src/blocks/${variables.slugKebabCase}/types.ts`,\n\t\t},\n\t];\n}\n",
7
7
  "import fs from \"node:fs\";\nimport { promises as fsp } from \"node:fs\";\nimport path from \"node:path\";\n\nimport { readOptionalFile } from \"./cli-add-shared.js\";\n\nexport const COMPOUND_SHARED_SUPPORT_FILES = [\n\t\"hooks.ts\",\n\t\"validator-toolkit.ts\",\n] as const;\nconst LEGACY_ASSERT_PATTERN = /assert:\\s*typia\\.createAssert</u;\nconst LEGACY_MANIFEST_PATTERN = /\\r?\\n[ \\t]*manifest:\\s*currentManifest,/u;\nconst LEGACY_VALIDATOR_MANIFEST_IMPORT_PATTERN =\n\t/^[\\uFEFF \\t]*import\\s+currentManifest\\s+from\\s*[\"']\\.\\/typia\\.manifest\\.json[\"'];?$/u;\nconst LEGACY_TOOLKIT_CALL_PATTERN =\n\t/createTemplateValidatorToolkit<\\s*(?<typeName>[A-Za-z0-9_]+)\\s*>\\s*\\(\\s*\\{/u;\nconst LEGACY_VALIDATOR_TOOLKIT_IMPORT_PATTERN =\n\t/from\\s*[\"']\\.\\.\\/\\.\\.\\/validator-toolkit[\"']/u;\nconst TYPIA_IMPORT_PATTERN =\n\t/^[\\uFEFF \\t]*import\\s+typia\\s+from\\s*[\"']typia[\"'];?/mu;\nconst COMPATIBLE_COMPOUND_TOOLKIT_PATTERNS = [\n\t/interface\\s+TemplateValidatorFunctions\\s*<\\s*T\\s+extends\\s+object\\s*>\\s*\\{/u,\n\t/\\bassert\\s*:\\s*ScaffoldValidatorToolkitOptions\\s*<\\s*T\\s*>\\s*\\[\\s*[\"']assert[\"']\\s*\\]/u,\n\t/\\bclone\\s*:\\s*ScaffoldValidatorToolkitOptions\\s*<\\s*T\\s*>\\s*\\[\\s*[\"']clone[\"']\\s*\\]/u,\n\t/\\bis\\s*:\\s*ScaffoldValidatorToolkitOptions\\s*<\\s*T\\s*>\\s*\\[\\s*[\"']is[\"']\\s*\\]/u,\n\t/\\bprune\\s*:\\s*ScaffoldValidatorToolkitOptions\\s*<\\s*T\\s*>\\s*\\[\\s*[\"']prune[\"']\\s*\\]/u,\n\t/\\brandom\\s*:\\s*ScaffoldValidatorToolkitOptions\\s*<\\s*T\\s*>\\s*\\[\\s*[\"']random[\"']\\s*\\]/u,\n\t/\\bvalidate\\s*:\\s*ScaffoldValidatorToolkitOptions\\s*<\\s*T\\s*>\\s*\\[\\s*[\"']validate[\"']\\s*\\]/u,\n\t/createTemplateValidatorToolkit\\s*<\\s*T\\s+extends\\s+object\\s*>\\s*\\(\\s*\\{/u,\n] as const;\n\nconst REST_MANIFEST_IMPORT_PATTERN =\n\t/import\\s*\\{[^}]*\\bdefineEndpointManifest\\b[^}]*\\}\\s*from\\s*[\"']@wp-typia\\/block-runtime\\/metadata-core[\"'];?/m;\n\nexport function ensureBlockConfigCanAddRestManifests(source: string): string {\n\tconst importLine =\n\t\t\"import { defineEndpointManifest } from '@wp-typia/block-runtime/metadata-core';\";\n\tif (REST_MANIFEST_IMPORT_PATTERN.test(source)) {\n\t\treturn source;\n\t}\n\treturn `${importLine}\\n\\n${source}`;\n}\n\nfunction shouldRefreshCompoundValidatorToolkit(source: string | null): boolean {\n\treturn (\n\t\tsource === null ||\n\t\t!COMPATIBLE_COMPOUND_TOOLKIT_PATTERNS.every((pattern) =>\n\t\t\tpattern.test(source),\n\t\t)\n\t);\n}\n\nfunction isLegacyCompoundValidatorSource(source: string | null): source is string {\n\treturn (\n\t\ttypeof source === \"string\" &&\n\t\tLEGACY_VALIDATOR_TOOLKIT_IMPORT_PATTERN.test(source) &&\n\t\t!LEGACY_ASSERT_PATTERN.test(source)\n\t);\n}\n\nfunction hasTypiaImport(source: string): boolean {\n\treturn TYPIA_IMPORT_PATTERN.test(source.replace(/\\/\\*[\\s\\S]*?\\*\\//gu, \"\"));\n}\n\nfunction replaceFirstNonCommentLine(\n\tsource: string,\n\tpattern: RegExp,\n\treplacement: string,\n): string {\n\tconst lineEnding = source.includes(\"\\r\\n\") ? \"\\r\\n\" : \"\\n\";\n\tconst lines = source.split(/\\r?\\n/);\n\tlet inBlockComment = false;\n\n\tfor (let index = 0; index < lines.length; index += 1) {\n\t\tconst line = lines[index] ?? \"\";\n\t\tconst trimmed = line.trimStart();\n\n\t\tif (inBlockComment) {\n\t\t\tif (trimmed.includes(\"*/\")) {\n\t\t\t\tinBlockComment = false;\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (trimmed.startsWith(\"//\")) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (trimmed.startsWith(\"/*\")) {\n\t\t\tif (!trimmed.includes(\"*/\")) {\n\t\t\t\tinBlockComment = true;\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!pattern.test(line)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tlines[index] = replacement;\n\t\treturn lines.join(lineEnding);\n\t}\n\n\treturn source;\n}\n\nfunction upgradeLegacyCompoundValidatorSource(source: string): string {\n\tconst typeNameMatch = source.match(LEGACY_TOOLKIT_CALL_PATTERN);\n\tconst typeName = typeNameMatch?.groups?.typeName;\n\tif (!typeName) {\n\t\tthrow new Error(\n\t\t\t\"Unable to upgrade a legacy compound validator without a generated type import.\",\n\t\t);\n\t}\n\n\tlet nextSource = source;\n\tif (!hasTypiaImport(nextSource)) {\n\t\tnextSource = `import typia from 'typia';\\n${nextSource}`;\n\t}\n\n\tnextSource = replaceFirstNonCommentLine(\n\t\tnextSource,\n\t\tLEGACY_VALIDATOR_MANIFEST_IMPORT_PATTERN,\n\t\t\"import currentManifest from './manifest-defaults-document';\",\n\t);\n\n\tnextSource = nextSource.replace(\n\t\tLEGACY_TOOLKIT_CALL_PATTERN,\n\t\t[\n\t\t\t`createTemplateValidatorToolkit< ${typeName} >( {`,\n\t\t\t`\\tassert: typia.createAssert< ${typeName} >(),`,\n\t\t\t`\\tclone: typia.misc.createClone< ${typeName} >() as (`,\n\t\t\t`\\t\\tvalue: ${typeName},`,\n\t\t\t`\\t) => ${typeName},`,\n\t\t\t`\\tis: typia.createIs< ${typeName} >(),`,\n\t\t].join(\"\\n\") + \"\\n\",\n\t);\n\n\tconst replacedManifest = nextSource.replace(\n\t\tLEGACY_MANIFEST_PATTERN,\n\t\t[\n\t\t\t\"\",\n\t\t\t\"\\tmanifest: currentManifest,\",\n\t\t\t`\\tprune: typia.misc.createPrune< ${typeName} >(),`,\n\t\t\t`\\trandom: typia.createRandom< ${typeName} >() as (`,\n\t\t\t\"\\t\\t...args: unknown[]\",\n\t\t\t`\\t) => ${typeName},`,\n\t\t\t`\\tvalidate: typia.createValidate< ${typeName} >(),`,\n\t\t].join(\"\\n\"),\n\t);\n\tif (replacedManifest === nextSource) {\n\t\tthrow new Error(\n\t\t\t\"Unable to upgrade legacy compound validator: manifest anchor not found.\",\n\t\t);\n\t}\n\n\treturn replacedManifest;\n}\n\nfunction renderLegacyManifestDefaultsWrapperSource(): string {\n\treturn [\n\t\t\"import rawCurrentManifest from './typia.manifest.json';\",\n\t\t\"import { defineManifestDefaultsDocument } from '@wp-typia/block-runtime/defaults';\",\n\t\t\"\",\n\t\t\"const currentManifest = defineManifestDefaultsDocument( rawCurrentManifest );\",\n\t\t\"\",\n\t\t\"export default currentManifest;\",\n\t\t\"\",\n\t].join(\"\\n\");\n}\n\nasync function ensureLegacyCompoundValidatorManifestDefaultsWrapper(\n\tvalidatorPath: string,\n): Promise<void> {\n\tconst validatorDir = path.dirname(validatorPath);\n\tconst wrapperPath = path.join(validatorDir, \"manifest-defaults-document.ts\");\n\tconst manifestPath = path.join(validatorDir, \"typia.manifest.json\");\n\tif (fs.existsSync(wrapperPath) || !fs.existsSync(manifestPath)) {\n\t\treturn;\n\t}\n\n\tawait fsp.writeFile(\n\t\twrapperPath,\n\t\trenderLegacyManifestDefaultsWrapperSource(),\n\t\t\"utf8\",\n\t);\n}\n\nexport async function collectLegacyCompoundValidatorPaths(\n\tprojectDir: string,\n): Promise<string[]> {\n\tconst blocksDir = path.join(projectDir, \"src\", \"blocks\");\n\tif (!fs.existsSync(blocksDir)) {\n\t\treturn [];\n\t}\n\n\tconst blockEntries = await fsp.readdir(blocksDir, { withFileTypes: true });\n\tconst validatorPaths = await Promise.all(\n\t\tblockEntries\n\t\t\t.filter((entry) => entry.isDirectory())\n\t\t\t.map(async (entry) => {\n\t\t\t\tconst validatorPath = path.join(blocksDir, entry.name, \"validators.ts\");\n\t\t\t\tconst validatorSource = await readOptionalFile(validatorPath);\n\t\t\t\treturn isLegacyCompoundValidatorSource(validatorSource)\n\t\t\t\t\t? validatorPath\n\t\t\t\t\t: null;\n\t\t\t}),\n\t);\n\n\treturn validatorPaths.filter(\n\t\t(validatorPath): validatorPath is string => validatorPath !== null,\n\t);\n}\n\nexport async function ensureCompoundWorkspaceSupportFiles(\n\tprojectDir: string,\n\ttempProjectDir: string,\n\tlegacyValidatorPaths: readonly string[],\n): Promise<void> {\n\tfor (const fileName of COMPOUND_SHARED_SUPPORT_FILES) {\n\t\tconst sourcePath = path.join(tempProjectDir, \"src\", fileName);\n\t\tif (!fs.existsSync(sourcePath)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst targetPath = path.join(projectDir, \"src\", fileName);\n\t\tconst currentSource = await readOptionalFile(targetPath);\n\t\tif (\n\t\t\tfileName === \"validator-toolkit.ts\"\n\t\t\t\t? shouldRefreshCompoundValidatorToolkit(currentSource)\n\t\t\t\t: currentSource === null\n\t\t) {\n\t\t\tawait fsp.mkdir(path.dirname(targetPath), { recursive: true });\n\t\t\tawait fsp.copyFile(sourcePath, targetPath);\n\t\t}\n\t}\n\n\tfor (const validatorPath of legacyValidatorPaths) {\n\t\tconst currentSource = await readOptionalFile(validatorPath);\n\t\tif (!isLegacyCompoundValidatorSource(currentSource)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tawait ensureLegacyCompoundValidatorManifestDefaultsWrapper(validatorPath);\n\t\tawait fsp.writeFile(\n\t\t\tvalidatorPath,\n\t\t\tupgradeLegacyCompoundValidatorSource(currentSource),\n\t\t\t\"utf8\",\n\t\t);\n\t}\n}\n",
8
8
  "import fs from \"node:fs\";\nimport { promises as fsp } from \"node:fs\";\nimport path from \"node:path\";\n\nimport type { HookedBlockPositionId } from \"./hooked-blocks.js\";\nimport { resolveWorkspaceProject } from \"./workspace-project.js\";\nimport { appendWorkspaceInventoryEntries, readWorkspaceInventory } from \"./workspace-inventory.js\";\nimport { toKebabCase, toTitleCase } from \"./string-case.js\";\nimport {\n\tassertValidGeneratedSlug,\n\tassertValidHookAnchor,\n\tassertValidHookedBlockPosition,\n\tassertVariationDoesNotExist,\n\tgetMutableBlockHooks,\n\tnormalizeBlockSlug,\n\tpatchFile,\n\tquoteTsString,\n\treadWorkspaceBlockJson,\n\tresolveWorkspaceBlock,\n\trollbackWorkspaceMutation,\n\ttype RunAddHookedBlockCommandOptions,\n\ttype RunAddVariationCommandOptions,\n\ttype WorkspaceMutationSnapshot,\n\tsnapshotWorkspaceFiles,\n} from \"./cli-add-shared.js\";\n\nconst VARIATIONS_IMPORT_LINE = \"import { registerWorkspaceVariations } from './variations';\";\nconst VARIATIONS_CALL_LINE = \"registerWorkspaceVariations();\";\n\nfunction buildVariationConfigEntry(blockSlug: string, variationSlug: string): string {\n\treturn [\n\t\t\"\\t{\",\n\t\t`\\t\\tblock: ${quoteTsString(blockSlug)},`,\n\t\t`\\t\\tfile: ${quoteTsString(`src/blocks/${blockSlug}/variations/${variationSlug}.ts`)},`,\n\t\t`\\t\\tslug: ${quoteTsString(variationSlug)},`,\n\t\t\"\\t},\",\n\t].join(\"\\n\");\n}\n\nfunction buildVariationConstName(variationSlug: string): string {\n\tconst identifierSegments = toKebabCase(variationSlug)\n\t\t.split(\"-\")\n\t\t.filter(Boolean);\n\n\treturn `workspaceVariation_${identifierSegments.join(\"_\")}`;\n}\n\nfunction getVariationConstBindings(\n\tvariationSlugs: string[],\n): Array<{ constName: string; variationSlug: string }> {\n\tconst seenConstNames = new Map<string, string>();\n\n\treturn variationSlugs.map((variationSlug) => {\n\t\tconst constName = buildVariationConstName(variationSlug);\n\t\tconst previousSlug = seenConstNames.get(constName);\n\n\t\tif (previousSlug && previousSlug !== variationSlug) {\n\t\t\tthrow new Error(\n\t\t\t\t`Variation slugs \"${previousSlug}\" and \"${variationSlug}\" generate the same registry identifier \"${constName}\". Rename one of the variations.`,\n\t\t\t);\n\t\t}\n\n\t\tseenConstNames.set(constName, variationSlug);\n\t\treturn { constName, variationSlug };\n\t});\n}\n\nfunction buildVariationSource(variationSlug: string, textDomain: string): string {\n\tconst variationTitle = toTitleCase(variationSlug);\n\tconst variationConstName = buildVariationConstName(variationSlug);\n\n\treturn `import type { BlockVariation } from '@wp-typia/block-types/blocks/registration';\nimport { __ } from '@wordpress/i18n';\n\nexport const ${variationConstName} = {\n\\tname: ${quoteTsString(variationSlug)},\n\\ttitle: __( ${quoteTsString(variationTitle)}, ${quoteTsString(textDomain)} ),\n\\tdescription: __(\n\\t\\t${quoteTsString(`A starter variation for ${variationTitle}.`)},\n\\t\\t${quoteTsString(textDomain)},\n\\t),\n\\tattributes: {},\n\\tscope: ['inserter'],\n} satisfies BlockVariation;\n`;\n}\n\nfunction buildVariationIndexSource(variationSlugs: string[]): string {\n\tconst variationBindings = getVariationConstBindings(variationSlugs);\n\tconst importLines = variationBindings\n\t\t.map(({ constName, variationSlug }) => {\n\t\t\treturn `import { ${constName} } from './${variationSlug}';`;\n\t\t})\n\t\t.join(\"\\n\");\n\tconst variationConstNames = variationBindings\n\t\t.map(({ constName }) => constName)\n\t\t.join(\",\\n\\t\\t\");\n\n\treturn `import { registerBlockVariation } from '@wordpress/blocks';\nimport metadata from '../block.json';\n${importLines ? `\\n${importLines}` : \"\"}\n\nconst WORKSPACE_VARIATIONS = [\n\\t${variationConstNames}\n\\t// wp-typia add variation entries\n];\n\nexport function registerWorkspaceVariations() {\n\\tfor (const variation of WORKSPACE_VARIATIONS) {\n\\t\\tregisterBlockVariation(metadata.name, variation);\n\\t}\n}\n`;\n}\n\nasync function ensureVariationRegistrationHook(blockIndexPath: string): Promise<void> {\n\tawait patchFile(blockIndexPath, (source) => {\n\t\tlet nextSource = source;\n\n\t\tif (!nextSource.includes(VARIATIONS_IMPORT_LINE)) {\n\t\t\tnextSource = `${VARIATIONS_IMPORT_LINE}\\n${nextSource}`;\n\t\t}\n\n\t\tif (!nextSource.includes(VARIATIONS_CALL_LINE)) {\n\t\t\tconst callInsertionPatterns = [\n\t\t\t\t/(registerBlockType<[\\s\\S]*?\\);\\s*)/u,\n\t\t\t\t/(registerBlockType\\([\\s\\S]*?\\);\\s*)/u,\n\t\t\t];\n\t\t\tlet inserted = false;\n\n\t\t\tfor (const pattern of callInsertionPatterns) {\n\t\t\t\tconst candidate = nextSource.replace(\n\t\t\t\t\tpattern,\n\t\t\t\t\t(match) => `${match}\\n${VARIATIONS_CALL_LINE}\\n`,\n\t\t\t\t);\n\t\t\t\tif (candidate !== nextSource) {\n\t\t\t\t\tnextSource = candidate;\n\t\t\t\t\tinserted = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!inserted) {\n\t\t\t\tnextSource = `${nextSource.trimEnd()}\\n\\n${VARIATIONS_CALL_LINE}\\n`;\n\t\t\t}\n\t\t}\n\n\t\tif (!nextSource.includes(VARIATIONS_CALL_LINE)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Unable to inject ${VARIATIONS_CALL_LINE} into ${path.basename(blockIndexPath)}.`,\n\t\t\t);\n\t\t}\n\n\t\treturn nextSource;\n\t});\n}\n\nasync function writeVariationRegistry(\n\tprojectDir: string,\n\tblockSlug: string,\n\tvariationSlug: string,\n): Promise<void> {\n\tconst variationsDir = path.join(projectDir, \"src\", \"blocks\", blockSlug, \"variations\");\n\tconst variationsIndexPath = path.join(variationsDir, \"index.ts\");\n\tawait fsp.mkdir(variationsDir, { recursive: true });\n\n\tconst existingVariationSlugs = fs\n\t\t.readdirSync(variationsDir)\n\t\t.filter((entry) => entry.endsWith(\".ts\") && entry !== \"index.ts\")\n\t\t.map((entry) => entry.replace(/\\.ts$/u, \"\"));\n\tconst nextVariationSlugs = Array.from(new Set([...existingVariationSlugs, variationSlug])).sort();\n\tawait fsp.writeFile(\n\t\tvariationsIndexPath,\n\t\tbuildVariationIndexSource(nextVariationSlugs),\n\t\t\"utf8\",\n\t);\n}\n\n/**\n * Re-export focused workspace asset scaffold commands from the companion\n * `cli-add-workspace-assets` module.\n */\nexport {\n\trunAddEditorPluginCommand,\n\trunAddBindingSourceCommand,\n\trunAddPatternCommand,\n} from \"./cli-add-workspace-assets.js\";\n/**\n * Re-export the plugin-level REST resource scaffold workflow from the focused\n * rest-resource runtime helper module.\n */\nexport { runAddRestResourceCommand } from \"./cli-add-workspace-rest.js\";\n\n/**\n * Add one variation entry to an existing workspace block.\n *\n * @param options Command options for the variation scaffold workflow.\n * @param options.blockName Target workspace block slug that will own the variation.\n * @param options.cwd Working directory used to resolve the nearest official workspace.\n * Defaults to `process.cwd()`.\n * @param options.variationName Human-entered variation name that will be normalized\n * and validated before files are written.\n * @returns A promise that resolves with the normalized `blockSlug`,\n * `variationSlug`, and owning `projectDir` after the variation files and\n * inventory entry have been written successfully.\n * @throws {Error} When the command is run outside an official workspace, when\n * the target block is unknown, when the variation slug is invalid, or when a\n * conflicting file or inventory entry already exists.\n */\nexport async function runAddVariationCommand({\n\tblockName,\n\tcwd = process.cwd(),\n\tvariationName,\n}: RunAddVariationCommandOptions): Promise<{\n\tblockSlug: string;\n\tprojectDir: string;\n\tvariationSlug: string;\n}> {\n\tconst workspace = resolveWorkspaceProject(cwd);\n\tconst blockSlug = normalizeBlockSlug(blockName);\n\tconst variationSlug = assertValidGeneratedSlug(\n\t\t\"Variation name\",\n\t\tnormalizeBlockSlug(variationName),\n\t\t\"wp-typia add variation <name> --block <block-slug>\",\n\t);\n\n\tconst inventory = readWorkspaceInventory(workspace.projectDir);\n\tresolveWorkspaceBlock(inventory, blockSlug);\n\tassertVariationDoesNotExist(workspace.projectDir, blockSlug, variationSlug, inventory);\n\n\tconst blockConfigPath = path.join(workspace.projectDir, \"scripts\", \"block-config.ts\");\n\tconst blockIndexPath = path.join(workspace.projectDir, \"src\", \"blocks\", blockSlug, \"index.tsx\");\n\tconst variationsDir = path.join(workspace.projectDir, \"src\", \"blocks\", blockSlug, \"variations\");\n\tconst variationFilePath = path.join(variationsDir, `${variationSlug}.ts`);\n\tconst variationsIndexPath = path.join(variationsDir, \"index.ts\");\n\tconst mutationSnapshot: WorkspaceMutationSnapshot = {\n\t\tfileSources: await snapshotWorkspaceFiles([\n\t\t\tblockConfigPath,\n\t\t\tblockIndexPath,\n\t\t\tvariationsIndexPath,\n\t\t]),\n\t\tsnapshotDirs: [],\n\t\ttargetPaths: [variationFilePath],\n\t};\n\n\ttry {\n\t\tawait fsp.mkdir(variationsDir, { recursive: true });\n\t\tawait fsp.writeFile(\n\t\t\tvariationFilePath,\n\t\t\tbuildVariationSource(variationSlug, workspace.workspace.textDomain),\n\t\t\t\"utf8\",\n\t\t);\n\t\tawait writeVariationRegistry(workspace.projectDir, blockSlug, variationSlug);\n\t\tawait ensureVariationRegistrationHook(blockIndexPath);\n\t\tawait appendWorkspaceInventoryEntries(workspace.projectDir, {\n\t\t\tvariationEntries: [buildVariationConfigEntry(blockSlug, variationSlug)],\n\t\t});\n\n\t\treturn {\n\t\t\tblockSlug,\n\t\t\tprojectDir: workspace.projectDir,\n\t\t\tvariationSlug,\n\t\t};\n\t} catch (error) {\n\t\tawait rollbackWorkspaceMutation(mutationSnapshot);\n\t\tthrow error;\n\t}\n}\n\n/**\n * Add one `blockHooks` entry to an existing official workspace block.\n *\n * @param options Command options for the hooked-block workflow.\n * @param options.anchorBlockName Full block name that will anchor the insertion.\n * @param options.blockName Existing workspace block slug to patch.\n * @param options.cwd Working directory used to resolve the nearest official workspace.\n * Defaults to `process.cwd()`.\n * @param options.position Hook position to store in `block.json`.\n * @returns A promise that resolves with the normalized target block slug, anchor\n * block name, position, and owning project directory after `block.json` is written.\n * @throws {Error} When the command is run outside an official workspace, when\n * the target block is unknown, when required flags are missing, or when the\n * block already defines a hook for the requested anchor.\n */\nexport async function runAddHookedBlockCommand({\n\tanchorBlockName,\n\tblockName,\n\tcwd = process.cwd(),\n\tposition,\n}: RunAddHookedBlockCommandOptions): Promise<{\n\tanchorBlockName: string;\n\tblockSlug: string;\n\tposition: HookedBlockPositionId;\n\tprojectDir: string;\n}> {\n\tconst workspace = resolveWorkspaceProject(cwd);\n\tconst blockSlug = normalizeBlockSlug(blockName);\n\tconst inventory = readWorkspaceInventory(workspace.projectDir);\n\tresolveWorkspaceBlock(inventory, blockSlug);\n\n\tconst resolvedAnchorBlockName = assertValidHookAnchor(anchorBlockName);\n\tconst resolvedPosition = assertValidHookedBlockPosition(position);\n\tconst selfHookAnchor = `${workspace.workspace.namespace}/${blockSlug}`;\n\tif (resolvedAnchorBlockName === selfHookAnchor) {\n\t\tthrow new Error(\n\t\t\t\"`wp-typia add hooked-block` cannot hook a block relative to its own block name.\",\n\t\t);\n\t}\n\tconst { blockJson, blockJsonPath } = readWorkspaceBlockJson(workspace.projectDir, blockSlug);\n\tconst blockJsonRelativePath = path.relative(workspace.projectDir, blockJsonPath);\n\tconst blockHooks = getMutableBlockHooks(blockJson, blockJsonRelativePath);\n\n\tif (Object.prototype.hasOwnProperty.call(blockHooks, resolvedAnchorBlockName)) {\n\t\tthrow new Error(\n\t\t\t`${blockJsonRelativePath} already defines a blockHooks entry for \"${resolvedAnchorBlockName}\".`,\n\t\t);\n\t}\n\n\tconst mutationSnapshot: WorkspaceMutationSnapshot = {\n\t\tfileSources: await snapshotWorkspaceFiles([blockJsonPath]),\n\t\tsnapshotDirs: [],\n\t\ttargetPaths: [],\n\t};\n\n\ttry {\n\t\tblockHooks[resolvedAnchorBlockName] = resolvedPosition;\n\t\tawait fsp.writeFile(blockJsonPath, JSON.stringify(blockJson, null, \"\\t\"), \"utf8\");\n\n\t\treturn {\n\t\t\tanchorBlockName: resolvedAnchorBlockName,\n\t\t\tblockSlug,\n\t\t\tposition: resolvedPosition,\n\t\t\tprojectDir: workspace.projectDir,\n\t\t};\n\t} catch (error) {\n\t\tawait rollbackWorkspaceMutation(mutationSnapshot);\n\t\tthrow error;\n\t}\n}\n",
9
9
  "import fs from \"node:fs\";\nimport { promises as fsp } from \"node:fs\";\nimport path from \"node:path\";\n\nimport {\n\tresolveWorkspaceProject,\n\ttype WorkspaceProject,\n} from \"./workspace-project.js\";\nimport { readWorkspaceInventory, appendWorkspaceInventoryEntries } from \"./workspace-inventory.js\";\nimport { toTitleCase } from \"./string-case.js\";\nimport {\n\tassertBindingSourceDoesNotExist,\n\tassertEditorPluginDoesNotExist,\n\tassertPatternDoesNotExist,\n\tassertValidEditorPluginSlot,\n\tassertValidGeneratedSlug,\n\tgetWorkspaceBootstrapPath,\n\tnormalizeBlockSlug,\n\tpatchFile,\n\tquoteTsString,\n\trollbackWorkspaceMutation,\n\ttype RunAddBindingSourceCommandOptions,\n\ttype RunAddEditorPluginCommandOptions,\n\ttype RunAddPatternCommandOptions,\n\ttype WorkspaceMutationSnapshot,\n\tsnapshotWorkspaceFiles,\n} from \"./cli-add-shared.js\";\n\nconst PATTERN_BOOTSTRAP_CATEGORY = \"register_block_pattern_category\";\nconst BINDING_SOURCE_SERVER_GLOB = \"/src/bindings/*/server.php\";\nconst BINDING_SOURCE_EDITOR_SCRIPT = \"build/bindings/index.js\";\nconst BINDING_SOURCE_EDITOR_ASSET = \"build/bindings/index.asset.php\";\nconst EDITOR_PLUGIN_EDITOR_SCRIPT = \"build/editor-plugins/index.js\";\nconst EDITOR_PLUGIN_EDITOR_ASSET = \"build/editor-plugins/index.asset.php\";\nconst EDITOR_PLUGIN_EDITOR_STYLE = \"build/editor-plugins/style-index.css\";\nconst EDITOR_PLUGIN_EDITOR_STYLE_RTL = \"build/editor-plugins/style-index-rtl.css\";\n\nfunction escapeRegex(value: string): string {\n\treturn value.replace(/[.*+?^${}()|[\\]\\\\]/gu, \"\\\\$&\");\n}\n\nfunction quotePhpString(value: string): string {\n\treturn `'${value.replace(/\\\\/gu, \"\\\\\\\\\").replace(/'/gu, \"\\\\'\")}'`;\n}\n\nfunction findPhpFunctionRange(\n\tsource: string,\n\tfunctionName: string,\n): {\n\tend: number;\n\tstart: number;\n} | null {\n\tconst signaturePattern = new RegExp(`function\\\\s+${escapeRegex(functionName)}\\\\s*\\\\(`, \"u\");\n\tconst signatureMatch = signaturePattern.exec(source);\n\tif (!signatureMatch || signatureMatch.index === undefined) {\n\t\treturn null;\n\t}\n\n\tconst functionStart = signatureMatch.index;\n\tconst openBraceIndex = source.indexOf(\"{\", functionStart);\n\tif (openBraceIndex === -1) {\n\t\treturn null;\n\t}\n\n\tlet depth = 0;\n\tfor (let index = openBraceIndex; index < source.length; index += 1) {\n\t\tconst character = source[index];\n\t\tif (character === \"{\") {\n\t\t\tdepth += 1;\n\t\t\tcontinue;\n\t\t}\n\t\tif (character !== \"}\") {\n\t\t\tcontinue;\n\t\t}\n\t\tdepth -= 1;\n\t\tif (depth === 0) {\n\t\t\tlet functionEnd = index + 1;\n\t\t\twhile (functionEnd < source.length && /[\\r\\n]/u.test(source[functionEnd] ?? \"\")) {\n\t\t\t\tfunctionEnd += 1;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tend: functionEnd,\n\t\t\t\tstart: functionStart,\n\t\t\t};\n\t\t}\n\t}\n\n\treturn null;\n}\n\nfunction replacePhpFunctionDefinition(\n\tsource: string,\n\tfunctionName: string,\n\treplacement: string,\n): string | null {\n\tconst functionRange = findPhpFunctionRange(source, functionName);\n\tif (!functionRange) {\n\t\treturn null;\n\t}\n\n\treturn [\n\t\tsource.slice(0, functionRange.start),\n\t\treplacement,\n\t\tsource.slice(functionRange.end),\n\t].join(\"\");\n}\n\nfunction buildPatternConfigEntry(patternSlug: string): string {\n\treturn [\n\t\t\"\\t{\",\n\t\t`\\t\\tfile: ${quoteTsString(`src/patterns/${patternSlug}.php`)},`,\n\t\t`\\t\\tslug: ${quoteTsString(patternSlug)},`,\n\t\t\"\\t},\",\n\t].join(\"\\n\");\n}\n\nfunction buildBindingSourceConfigEntry(bindingSourceSlug: string): string {\n\treturn [\n\t\t\"\\t{\",\n\t\t`\\t\\teditorFile: ${quoteTsString(`src/bindings/${bindingSourceSlug}/editor.ts`)},`,\n\t\t`\\t\\tserverFile: ${quoteTsString(`src/bindings/${bindingSourceSlug}/server.php`)},`,\n\t\t`\\t\\tslug: ${quoteTsString(bindingSourceSlug)},`,\n\t\t\"\\t},\",\n\t].join(\"\\n\");\n}\n\nfunction buildEditorPluginConfigEntry(\n\teditorPluginSlug: string,\n\tslot: string,\n): string {\n\treturn [\n\t\t\"\\t{\",\n\t\t`\\t\\tfile: ${quoteTsString(`src/editor-plugins/${editorPluginSlug}/index.tsx`)},`,\n\t\t`\\t\\tslug: ${quoteTsString(editorPluginSlug)},`,\n\t\t`\\t\\tslot: ${quoteTsString(slot)},`,\n\t\t\"\\t},\",\n\t].join(\"\\n\");\n}\n\nfunction toPascalCaseFromSlug(slug: string): string {\n\treturn normalizeBlockSlug(slug)\n\t\t.split(\"-\")\n\t\t.filter(Boolean)\n\t\t.map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))\n\t\t.join(\"\");\n}\n\nfunction buildPatternSource(\n\tpatternSlug: string,\n\tnamespace: string,\n\ttextDomain: string,\n): string {\n\tconst patternTitle = toTitleCase(patternSlug);\n\n\treturn `<?php\nif ( ! defined( 'ABSPATH' ) ) {\n\\treturn;\n}\n\nregister_block_pattern(\n\\t'${namespace}/${patternSlug}',\n\\tarray(\n\\t\\t'title' => __( ${JSON.stringify(patternTitle)}, '${textDomain}' ),\n\\t\\t'description' => __( ${JSON.stringify(`A starter pattern for ${patternTitle}.`)}, '${textDomain}' ),\n\\t\\t'categories' => array( '${namespace}' ),\n\\t\\t'content' => '<!-- wp:paragraph --><p>' . esc_html__( 'Describe this pattern here.', '${textDomain}' ) . '</p><!-- /wp:paragraph -->',\n\\t)\n);\n`;\n}\n\nfunction buildBindingSourceServerSource(\n\tbindingSourceSlug: string,\n\tphpPrefix: string,\n\tnamespace: string,\n\ttextDomain: string,\n): string {\n\tconst bindingSourceTitle = toTitleCase(bindingSourceSlug);\n\tconst bindingSourcePhpId = bindingSourceSlug.replace(/-/g, \"_\");\n\tconst bindingSourceValueFunctionName = `${phpPrefix}_${bindingSourcePhpId}_binding_source_values`;\n\tconst bindingSourceResolveFunctionName = `${phpPrefix}_${bindingSourcePhpId}_resolve_binding_source_value`;\n\tconst starterValue = `${bindingSourceTitle} starter value`;\n\n\treturn `<?php\nif ( ! defined( 'ABSPATH' ) ) {\n\\treturn;\n}\n\nif ( ! function_exists( 'register_block_bindings_source' ) ) {\n\\treturn;\n}\n\nif ( ! function_exists( '${bindingSourceValueFunctionName}' ) ) {\n\\tfunction ${bindingSourceValueFunctionName}() : array {\n\\t\\treturn array(\n\\t\\t\\t${quotePhpString(bindingSourceSlug)} => ${quotePhpString(starterValue)},\n\\t\\t);\n\\t}\n}\n\nif ( ! function_exists( '${bindingSourceResolveFunctionName}' ) ) {\n\\tfunction ${bindingSourceResolveFunctionName}( array $source_args ) : string {\n\\t\\t$field = isset( $source_args['field'] ) && is_string( $source_args['field'] )\n\\t\\t\\t? $source_args['field']\n\\t\\t\\t: '${bindingSourceSlug}';\n\\t\\t$binding_source_values = ${bindingSourceValueFunctionName}();\n\\t\\t$value = $binding_source_values[ $field ] ?? '';\n\n\\t\\treturn is_string( $value ) ? $value : '';\n\\t}\n}\n\nregister_block_bindings_source(\n\\t${quotePhpString(`${namespace}/${bindingSourceSlug}`)},\n\\tarray(\n\\t\\t'label' => __( ${quotePhpString(bindingSourceTitle)}, ${quotePhpString(textDomain)} ),\n\\t\\t'get_value_callback' => ${quotePhpString(bindingSourceResolveFunctionName)},\n\\t)\n);\n`;\n}\n\nfunction buildBindingSourceEditorSource(\n\tbindingSourceSlug: string,\n\tnamespace: string,\n\ttextDomain: string,\n): string {\n\tconst bindingSourceTitle = toTitleCase(bindingSourceSlug);\n\tconst starterValue = `${bindingSourceTitle} starter value`;\n\n\treturn `import { registerBlockBindingsSource } from '@wordpress/blocks';\nimport { __ } from '@wordpress/i18n';\n\ninterface BindingSourceRegistration {\n\\targs?: {\n\\t\\tfield?: string;\n\\t};\n}\n\nconst BINDING_SOURCE_VALUES: Record<string, string> = {\n\\t${quoteTsString(bindingSourceSlug)}: ${quoteTsString(starterValue)},\n};\n\nfunction resolveBindingSourceValue( field: string ): string {\n\\treturn BINDING_SOURCE_VALUES[ field ] ?? '';\n}\n\nregisterBlockBindingsSource( {\n\\tname: ${quoteTsString(`${namespace}/${bindingSourceSlug}`)},\n\\tlabel: __( ${quoteTsString(bindingSourceTitle)}, ${quoteTsString(textDomain)} ),\n\\tgetFieldsList() {\n\\t\\treturn [\n\\t\\t\\t{\n\\t\\t\\t\\tlabel: __( ${quoteTsString(bindingSourceTitle)}, ${quoteTsString(textDomain)} ),\n\\t\\t\\t\\ttype: 'string',\n\\t\\t\\t\\targs: {\n\\t\\t\\t\\t\\tfield: ${quoteTsString(bindingSourceSlug)},\n\\t\\t\\t\\t},\n\\t\\t\\t},\n\\t\\t];\n\\t},\n\\tgetValues( { bindings } ) {\n\\t\\tconst values: Record<string, string> = {};\n\\t\\tfor ( const [ attributeName, binding ] of Object.entries(\n\\t\\t\\tbindings as Record<string, BindingSourceRegistration>\n\\t\\t) ) {\n\\t\\t\\tconst field =\n\\t\\t\\t\\ttypeof binding?.args?.field === 'string'\n\\t\\t\\t\\t\\t? binding.args.field\n\\t\\t\\t\\t\\t: ${quoteTsString(bindingSourceSlug)};\n\\t\\t\\tvalues[ attributeName ] = resolveBindingSourceValue( field );\n\\t\\t}\n\\t\\treturn values;\n\\t},\n} );\n`;\n}\n\nfunction buildEditorPluginTypesSource(editorPluginSlug: string): string {\n\tconst typeName = `${toPascalCaseFromSlug(editorPluginSlug)}SidebarModel`;\n\n\treturn `export interface ${typeName} {\n\\tprimaryActionLabel: string;\n\\tsummary: string;\n}\n`;\n}\n\nfunction buildEditorPluginDataSource(\n\teditorPluginSlug: string,\n\tslot: string,\n): string {\n\tconst typeName = `${toPascalCaseFromSlug(editorPluginSlug)}SidebarModel`;\n\tconst pluginTitle = toTitleCase(editorPluginSlug);\n\tconst modelFactoryName = `get${toPascalCaseFromSlug(editorPluginSlug)}SidebarModel`;\n\tconst enabledFactoryName = `is${toPascalCaseFromSlug(editorPluginSlug)}Enabled`;\n\n\treturn `import type { ${typeName} } from './types';\n\nexport const EDITOR_PLUGIN_SLOT = ${quoteTsString(slot)} as const;\nexport const REQUIRED_CAPABILITY = 'edit_posts' as const;\n\nconst DEFAULT_SIDEBAR_MODEL: ${typeName} = {\n\\tprimaryActionLabel: ${quoteTsString(`Review ${pluginTitle}`)},\n\\tsummary: ${quoteTsString(`Replace this summary with your ${pluginTitle} workflow state.`)},\n};\n\nexport function ${modelFactoryName}(): ${typeName} {\n\\treturn DEFAULT_SIDEBAR_MODEL;\n}\n\nexport function ${enabledFactoryName}(): boolean {\n\\treturn true;\n}\n`;\n}\n\nfunction buildEditorPluginSidebarSource(\n\teditorPluginSlug: string,\n\ttextDomain: string,\n): string {\n\tconst pascalName = toPascalCaseFromSlug(editorPluginSlug);\n\tconst modelFactoryName = `get${pascalName}SidebarModel`;\n\tconst enabledFactoryName = `is${pascalName}Enabled`;\n\tconst componentName = `${pascalName}Sidebar`;\n\n\treturn `import { Button, PanelBody } from '@wordpress/components';\nimport { PluginSidebar, PluginSidebarMoreMenuItem } from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\n\nimport { ${modelFactoryName}, ${enabledFactoryName} } from './data';\nimport './style.scss';\n\nexport interface ${componentName}Props {\n\\tpluginName: string;\n\\ttitle: string;\n}\n\nexport function ${componentName}( {\n\\tpluginName,\n\\ttitle,\n}: ${componentName}Props ) {\n\\tif ( ! ${enabledFactoryName}() ) {\n\\t\\treturn null;\n\\t}\n\n\\tconst sidebarModel = ${modelFactoryName}();\n\n\\treturn (\n\\t\\t<>\n\\t\\t\\t<PluginSidebarMoreMenuItem target={ pluginName }>\n\\t\\t\\t\\t{ title }\n\\t\\t\\t</PluginSidebarMoreMenuItem>\n\\t\\t\\t<PluginSidebar name={ pluginName } title={ title }>\n\\t\\t\\t\\t<div className=\"wp-typia-editor-plugin-shell\">\n\\t\\t\\t\\t\\t<PanelBody\n\\t\\t\\t\\t\\t\\tinitialOpen\n\\t\\t\\t\\t\\t\\ttitle={ __( 'Document workflow', ${quoteTsString(textDomain)} ) }\n\\t\\t\\t\\t\\t>\n\\t\\t\\t\\t\\t\\t<p>{ sidebarModel.summary }</p>\n\\t\\t\\t\\t\\t\\t<Button variant=\"secondary\">\n\\t\\t\\t\\t\\t\\t\\t{ sidebarModel.primaryActionLabel }\n\\t\\t\\t\\t\\t\\t</Button>\n\\t\\t\\t\\t\\t</PanelBody>\n\\t\\t\\t\\t</div>\n\\t\\t\\t</PluginSidebar>\n\\t\\t</>\n\\t);\n}\n`;\n}\n\nfunction buildEditorPluginEntrySource(\n\teditorPluginSlug: string,\n\tnamespace: string,\n\ttextDomain: string,\n): string {\n\tconst pascalName = toPascalCaseFromSlug(editorPluginSlug);\n\tconst componentName = `${pascalName}Sidebar`;\n\tconst pluginName = `${namespace}-${editorPluginSlug}`;\n\tconst pluginTitle = toTitleCase(editorPluginSlug);\n\n\treturn `import { registerPlugin } from '@wordpress/plugins';\nimport { __ } from '@wordpress/i18n';\n\nimport { REQUIRED_CAPABILITY } from './data';\nimport { ${componentName} } from './Sidebar';\n\nconst EDITOR_PLUGIN_NAME = ${quoteTsString(pluginName)};\nconst EDITOR_PLUGIN_TITLE = __( ${quoteTsString(pluginTitle)}, ${quoteTsString(textDomain)} );\n\nregisterPlugin( EDITOR_PLUGIN_NAME, {\n\\ticon: 'admin-generic',\n\\trender: () => (\n\\t\\t<${componentName}\n\\t\\t\\tpluginName={ EDITOR_PLUGIN_NAME }\n\\t\\t\\ttitle={ EDITOR_PLUGIN_TITLE }\n\\t\\t/>\n\\t),\n} );\n\nexport { REQUIRED_CAPABILITY };\n`;\n}\n\nfunction buildEditorPluginStyleSource(): string {\n\treturn `.wp-typia-editor-plugin-shell {\n\\tpadding: 16px;\n}\n\n.wp-typia-editor-plugin-shell p {\n\\tmargin: 0 0 12px;\n}\n`;\n}\n\nfunction buildBindingSourceIndexSource(bindingSourceSlugs: string[]): string {\n\tconst importLines = bindingSourceSlugs\n\t\t.map((bindingSourceSlug) => `import './${bindingSourceSlug}/editor';`)\n\t\t.join(\"\\n\");\n\n\treturn `${importLines}${importLines ? \"\\n\\n\" : \"\"}// wp-typia add binding-source entries\\n`;\n}\n\nfunction buildEditorPluginRegistrySource(editorPluginSlugs: string[]): string {\n\tconst importLines = editorPluginSlugs\n\t\t.map((editorPluginSlug) => `import './${editorPluginSlug}';`)\n\t\t.join(\"\\n\");\n\n\treturn `${importLines}${importLines ? \"\\n\\n\" : \"\"}// wp-typia add editor-plugin entries\\n`;\n}\n\nasync function ensurePatternBootstrapAnchors(workspace: WorkspaceProject): Promise<void> {\n\tconst workspaceBaseName = workspace.packageName.split(\"/\").pop() ?? workspace.packageName;\n\tconst bootstrapPath = getWorkspaceBootstrapPath(workspace);\n\tawait patchFile(bootstrapPath, (source) => {\n\t\tlet nextSource = source;\n\t\tconst patternCategoryFunctionName = `${workspace.workspace.phpPrefix}_register_pattern_category`;\n\t\tconst patternRegistrationFunctionName = `${workspace.workspace.phpPrefix}_register_patterns`;\n\t\tconst patternCategoryHook = `add_action( 'init', '${patternCategoryFunctionName}' );`;\n\t\tconst patternRegistrationHook = `add_action( 'init', '${patternRegistrationFunctionName}', 20 );`;\n\t\tconst patternFunctions = `\n\nfunction ${patternCategoryFunctionName}() {\n\\tif ( function_exists( 'register_block_pattern_category' ) ) {\n\\t\\tregister_block_pattern_category(\n\\t\\t\\t'${workspace.workspace.namespace}',\n\\t\\t\\tarray(\n\\t\\t\\t\\t'label' => __( ${JSON.stringify(`${toTitleCase(workspaceBaseName)} Patterns`)}, '${workspace.workspace.textDomain}' ),\n\\t\\t\\t)\n\\t\\t);\n\\t}\n}\n\nfunction ${patternRegistrationFunctionName}() {\n\\tforeach ( glob( __DIR__ . '/src/patterns/*.php' ) ?: array() as $pattern_module ) {\n\\t\\trequire $pattern_module;\n\\t}\n}\n`;\n\n\t\tif (!nextSource.includes(PATTERN_BOOTSTRAP_CATEGORY)) {\n\t\t\tconst insertionAnchors = [\n\t\t\t\t/add_action\\(\\s*[\"']init[\"']\\s*,\\s*[\"'][^\"']+_load_textdomain[\"']\\s*\\);\\s*\\n/u,\n\t\t\t\t/\\?>\\s*$/u,\n\t\t\t];\n\t\t\tlet inserted = false;\n\n\t\t\tfor (const anchor of insertionAnchors) {\n\t\t\t\tconst candidate = nextSource.replace(anchor, (match) => `${patternFunctions}\\n${match}`);\n\t\t\t\tif (candidate !== nextSource) {\n\t\t\t\t\tnextSource = candidate;\n\t\t\t\t\tinserted = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!inserted) {\n\t\t\t\tnextSource = `${nextSource.trimEnd()}\\n${patternFunctions}\\n`;\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\t!nextSource.includes(patternCategoryFunctionName) ||\n\t\t\t!nextSource.includes(patternRegistrationFunctionName)\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t`Unable to inject pattern bootstrap functions into ${path.basename(bootstrapPath)}.`,\n\t\t\t);\n\t\t}\n\n\t\tif (!nextSource.includes(patternCategoryHook)) {\n\t\t\tnextSource = `${nextSource.trimEnd()}\\n${patternCategoryHook}\\n`;\n\t\t}\n\t\tif (!nextSource.includes(patternRegistrationHook)) {\n\t\t\tnextSource = `${nextSource.trimEnd()}\\n${patternRegistrationHook}\\n`;\n\t\t}\n\n\t\treturn nextSource;\n\t});\n}\n\nasync function ensureBindingSourceBootstrapAnchors(workspace: WorkspaceProject): Promise<void> {\n\tconst bootstrapPath = getWorkspaceBootstrapPath(workspace);\n\n\tawait patchFile(bootstrapPath, (source) => {\n\t\tlet nextSource = source;\n\t\tconst workspaceBaseName = workspace.packageName.split(\"/\").pop() ?? workspace.packageName;\n\t\tconst bindingRegistrationFunctionName = `${workspace.workspace.phpPrefix}_register_binding_sources`;\n\t\tconst bindingEditorEnqueueFunctionName = `${workspace.workspace.phpPrefix}_enqueue_binding_sources_editor`;\n\t\tconst bindingRegistrationHook = `add_action( 'init', '${bindingRegistrationFunctionName}', 20 );`;\n\t\tconst bindingEditorEnqueueHook = `add_action( 'enqueue_block_editor_assets', '${bindingEditorEnqueueFunctionName}' );`;\n\t\tconst bindingRegistrationFunction = `\n\nfunction ${bindingRegistrationFunctionName}() {\n\\tforeach ( glob( __DIR__ . '${BINDING_SOURCE_SERVER_GLOB}' ) ?: array() as $binding_source_module ) {\n\\t\\trequire_once $binding_source_module;\n\\t}\n}\n`;\n\n\t\tconst bindingEditorEnqueueFunction = `\n\nfunction ${bindingEditorEnqueueFunctionName}() {\n\\t$script_path = __DIR__ . '/${BINDING_SOURCE_EDITOR_SCRIPT}';\n\\t$asset_path = __DIR__ . '/${BINDING_SOURCE_EDITOR_ASSET}';\n\n\\tif ( ! file_exists( $script_path ) || ! file_exists( $asset_path ) ) {\n\\t\\treturn;\n\\t}\n\n\\t$asset = require $asset_path;\n\\tif ( ! is_array( $asset ) ) {\n\\t\\t$asset = array();\n\\t}\n\n\\twp_enqueue_script(\n\\t\\t'${workspaceBaseName}-binding-sources',\n\\t\\tplugins_url( '${BINDING_SOURCE_EDITOR_SCRIPT}', __FILE__ ),\n\\t\\tisset( $asset['dependencies'] ) && is_array( $asset['dependencies'] ) ? $asset['dependencies'] : array(),\n\\t\\tisset( $asset['version'] ) ? $asset['version'] : filemtime( $script_path ),\n\\t\\ttrue\n\\t);\n}\n`;\n\n\t\tconst insertionAnchors = [\n\t\t\t/add_action\\(\\s*[\"']init[\"']\\s*,\\s*[\"'][^\"']+_load_textdomain[\"']\\s*\\);\\s*\\n/u,\n\t\t\t/\\?>\\s*$/u,\n\t\t];\n\t\tconst hasPhpFunctionDefinition = (functionName: string): boolean =>\n\t\t\tnew RegExp(`function\\\\s+${escapeRegex(functionName)}\\\\s*\\\\(`, \"u\").test(nextSource);\n\t\tconst insertPhpSnippet = (snippet: string): void => {\n\t\t\tfor (const anchor of insertionAnchors) {\n\t\t\t\tconst candidate = nextSource.replace(anchor, (match) => `${snippet}\\n${match}`);\n\t\t\t\tif (candidate !== nextSource) {\n\t\t\t\t\tnextSource = candidate;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tnextSource = `${nextSource.trimEnd()}\\n${snippet}\\n`;\n\t\t};\n\t\tconst appendPhpSnippet = (snippet: string): void => {\n\t\t\tconst closingTagPattern = /\\?>\\s*$/u;\n\t\t\tif (closingTagPattern.test(nextSource)) {\n\t\t\t\tnextSource = nextSource.replace(closingTagPattern, `${snippet}\\n?>`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tnextSource = `${nextSource.trimEnd()}\\n${snippet}\\n`;\n\t\t};\n\n\t\tif (!hasPhpFunctionDefinition(bindingRegistrationFunctionName)) {\n\t\t\tinsertPhpSnippet(bindingRegistrationFunction);\n\t\t}\n\t\tif (!hasPhpFunctionDefinition(bindingEditorEnqueueFunctionName)) {\n\t\t\tinsertPhpSnippet(bindingEditorEnqueueFunction);\n\t\t}\n\n\t\tif (!nextSource.includes(bindingRegistrationHook)) {\n\t\t\tappendPhpSnippet(bindingRegistrationHook);\n\t\t}\n\t\tif (!nextSource.includes(bindingEditorEnqueueHook)) {\n\t\t\tappendPhpSnippet(bindingEditorEnqueueHook);\n\t\t}\n\n\t\treturn nextSource;\n\t});\n}\n\nasync function ensureEditorPluginBootstrapAnchors(workspace: WorkspaceProject): Promise<void> {\n\tconst bootstrapPath = getWorkspaceBootstrapPath(workspace);\n\n\tawait patchFile(bootstrapPath, (source) => {\n\t\tlet nextSource = source;\n\t\tconst workspaceBaseName = workspace.packageName.split(\"/\").pop() ?? workspace.packageName;\n\t\tconst enqueueFunctionName = `${workspace.workspace.phpPrefix}_enqueue_editor_plugins_editor`;\n\t\tconst enqueueHook = `add_action( 'enqueue_block_editor_assets', '${enqueueFunctionName}' );`;\n\t\tconst enqueueFunction = `\n\nfunction ${enqueueFunctionName}() {\n\\t$script_path = __DIR__ . '/${EDITOR_PLUGIN_EDITOR_SCRIPT}';\n\\t$asset_path = __DIR__ . '/${EDITOR_PLUGIN_EDITOR_ASSET}';\n\\t$style_path = __DIR__ . '/${EDITOR_PLUGIN_EDITOR_STYLE}';\n\\t$style_rtl_path = __DIR__ . '/${EDITOR_PLUGIN_EDITOR_STYLE_RTL}';\n\n\\tif ( ! file_exists( $script_path ) || ! file_exists( $asset_path ) ) {\n\\t\\treturn;\n\\t}\n\n\\t$asset = require $asset_path;\n\\tif ( ! is_array( $asset ) ) {\n\\t\\t$asset = array();\n\\t}\n\n\\twp_enqueue_script(\n\\t\\t'${workspaceBaseName}-editor-plugins',\n\\t\\tplugins_url( '${EDITOR_PLUGIN_EDITOR_SCRIPT}', __FILE__ ),\n\\t\\tisset( $asset['dependencies'] ) && is_array( $asset['dependencies'] ) ? $asset['dependencies'] : array(),\n\\t\\tisset( $asset['version'] ) ? $asset['version'] : filemtime( $script_path ),\n\\t\\ttrue\n\\t);\n\n\\tif ( file_exists( $style_path ) ) {\n\\t\\twp_enqueue_style(\n\\t\\t\\t'${workspaceBaseName}-editor-plugins',\n\\t\\t\\tplugins_url( '${EDITOR_PLUGIN_EDITOR_STYLE}', __FILE__ ),\n\\t\\t\\tarray(),\n\\t\\t\\tisset( $asset['version'] ) ? $asset['version'] : filemtime( $style_path )\n\\t\\t);\n\\t\\tif ( file_exists( $style_rtl_path ) ) {\n\\t\\t\\twp_style_add_data( '${workspaceBaseName}-editor-plugins', 'rtl', 'replace' );\n\\t\\t}\n\\t}\n}\n`;\n\n\t\tconst insertionAnchors = [\n\t\t\t/add_action\\(\\s*[\"']init[\"']\\s*,\\s*[\"'][^\"']+_load_textdomain[\"']\\s*\\);\\s*\\n/u,\n\t\t\t/\\?>\\s*$/u,\n\t\t];\n\t\tconst hasPhpFunctionDefinition = (functionName: string): boolean =>\n\t\t\tnew RegExp(`function\\\\s+${escapeRegex(functionName)}\\\\s*\\\\(`, \"u\").test(nextSource);\n\t\tconst insertPhpSnippet = (snippet: string): void => {\n\t\t\tfor (const anchor of insertionAnchors) {\n\t\t\t\tconst candidate = nextSource.replace(anchor, (match) => `${snippet}\\n${match}`);\n\t\t\t\tif (candidate !== nextSource) {\n\t\t\t\t\tnextSource = candidate;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tnextSource = `${nextSource.trimEnd()}\\n${snippet}\\n`;\n\t\t};\n\t\tconst appendPhpSnippet = (snippet: string): void => {\n\t\t\tconst closingTagPattern = /\\?>\\s*$/u;\n\t\t\tif (closingTagPattern.test(nextSource)) {\n\t\t\t\tnextSource = nextSource.replace(closingTagPattern, `${snippet}\\n?>`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tnextSource = `${nextSource.trimEnd()}\\n${snippet}\\n`;\n\t\t};\n\n\t\tif (!hasPhpFunctionDefinition(enqueueFunctionName)) {\n\t\t\tinsertPhpSnippet(enqueueFunction);\n\t\t} else {\n\t\t\tconst requiredReferences = [\n\t\t\t\tEDITOR_PLUGIN_EDITOR_SCRIPT,\n\t\t\t\tEDITOR_PLUGIN_EDITOR_ASSET,\n\t\t\t\tEDITOR_PLUGIN_EDITOR_STYLE,\n\t\t\t\tEDITOR_PLUGIN_EDITOR_STYLE_RTL,\n\t\t\t\t\"wp_style_add_data\",\n\t\t\t];\n\t\t\tconst functionRange = findPhpFunctionRange(nextSource, enqueueFunctionName);\n\t\t\tconst functionSource = functionRange\n\t\t\t\t? nextSource.slice(functionRange.start, functionRange.end)\n\t\t\t\t: \"\";\n\t\t\tconst missingReferences = requiredReferences.filter(\n\t\t\t\t(reference) => !functionSource.includes(reference),\n\t\t\t);\n\t\t\tif (missingReferences.length > 0) {\n\t\t\t\tconst replacedSource = replacePhpFunctionDefinition(\n\t\t\t\t\tnextSource,\n\t\t\t\t\tenqueueFunctionName,\n\t\t\t\t\tenqueueFunction,\n\t\t\t\t);\n\t\t\t\tif (!replacedSource) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Unable to repair ${path.basename(bootstrapPath)} for ${enqueueFunctionName}.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tnextSource = replacedSource;\n\t\t\t}\n\t\t}\n\n\t\tif (!nextSource.includes(enqueueHook)) {\n\t\t\tappendPhpSnippet(enqueueHook);\n\t\t}\n\n\t\treturn nextSource;\n\t});\n}\n\nasync function ensureEditorPluginBuildScriptAnchors(workspace: WorkspaceProject): Promise<void> {\n\tconst buildScriptPath = path.join(workspace.projectDir, \"scripts\", \"build-workspace.mjs\");\n\n\tawait patchFile(buildScriptPath, (source) => {\n\t\tif (/['\"]src\\/editor-plugins\\/index\\.(?:ts|js)['\"]/u.test(source)) {\n\t\t\treturn source;\n\t\t}\n\n\t\tconst legacySharedEntriesPattern =\n\t\t\t/\\[\\s*['\"]src\\/bindings\\/index\\.ts['\"]\\s*,\\s*['\"]src\\/bindings\\/index\\.js['\"]\\s*(?:,\\s*)?\\]/u;\n\t\tconst nextSource = source.replace(\n\t\t\tlegacySharedEntriesPattern,\n\t\t\t`[\n\\t\\t'src/bindings/index.ts',\n\\t\\t'src/bindings/index.js',\n\\t\\t'src/editor-plugins/index.ts',\n\\t\\t'src/editor-plugins/index.js',\n\\t]`,\n\t\t);\n\n\t\tif (nextSource === source) {\n\t\t\tthrow new Error(\n\t\t\t\t`Unable to update ${path.relative(workspace.projectDir, buildScriptPath)} for editor plugin shared entries.`,\n\t\t\t);\n\t\t}\n\n\t\treturn nextSource;\n\t});\n}\n\nasync function ensureEditorPluginWebpackAnchors(workspace: WorkspaceProject): Promise<void> {\n\tconst webpackConfigPath = path.join(workspace.projectDir, \"webpack.config.js\");\n\n\tawait patchFile(webpackConfigPath, (source) => {\n\t\tif (/['\"]editor-plugins\\/index['\"]/u.test(source)) {\n\t\t\treturn source;\n\t\t}\n\n\t\tconst legacySharedEntriesBlockPattern =\n\t\t\t/for\\s*\\(\\s*const\\s+relativePath\\s+of\\s+\\[\\s*['\"]src\\/bindings\\/index\\.ts['\"]\\s*,\\s*['\"]src\\/bindings\\/index\\.js['\"]\\s*(?:,\\s*)?\\]\\s*\\)\\s*\\{[\\s\\S]*?entries\\.push\\(\\s*\\[\\s*['\"]bindings\\/index['\"]\\s*,\\s*entryPath\\s*\\]\\s*\\);\\s*break;\\s*\\}/u;\n\t\tconst nextSharedEntriesBlock = `\\tfor ( const [ entryName, candidates ] of [\\n\\t\\t[\\n\\t\\t\\t'bindings/index',\\n\\t\\t\\t[ 'src/bindings/index.ts', 'src/bindings/index.js' ],\\n\\t\\t],\\n\\t\\t[\\n\\t\\t\\t'editor-plugins/index',\\n\\t\\t\\t[ 'src/editor-plugins/index.ts', 'src/editor-plugins/index.js' ],\\n\\t\\t],\\n\\t] ) {\\n\\t\\tfor ( const relativePath of candidates ) {\\n\\t\\t\\tconst entryPath = path.resolve( process.cwd(), relativePath );\\n\\t\\t\\tif ( ! fs.existsSync( entryPath ) ) {\\n\\t\\t\\t\\tcontinue;\\n\\t\\t\\t}\\n\\n\\t\\t\\tentries.push( [ entryName, entryPath ] );\\n\\t\\t\\tbreak;\\n\\t\\t}\\n\\t}`;\n\t\tconst nextSource = source.replace(\n\t\t\tlegacySharedEntriesBlockPattern,\n\t\t\tnextSharedEntriesBlock,\n\t\t);\n\n\t\tif (nextSource === source) {\n\t\t\tthrow new Error(\n\t\t\t\t`Unable to update ${path.relative(workspace.projectDir, webpackConfigPath)} for editor plugin shared entries.`,\n\t\t\t);\n\t\t}\n\n\t\treturn nextSource;\n\t});\n}\n\nfunction resolveBindingSourceRegistryPath(projectDir: string): string {\n\tconst bindingsDir = path.join(projectDir, \"src\", \"bindings\");\n\treturn [path.join(bindingsDir, \"index.ts\"), path.join(bindingsDir, \"index.js\")].find(\n\t\t(candidatePath) => fs.existsSync(candidatePath),\n\t) ?? path.join(bindingsDir, \"index.ts\");\n}\n\nasync function writeBindingSourceRegistry(\n\tprojectDir: string,\n\tbindingSourceSlug: string,\n): Promise<void> {\n\tconst bindingsDir = path.join(projectDir, \"src\", \"bindings\");\n\tconst bindingsIndexPath = resolveBindingSourceRegistryPath(projectDir);\n\tawait fsp.mkdir(bindingsDir, { recursive: true });\n\n\tconst existingBindingSourceSlugs = fs\n\t\t.readdirSync(bindingsDir, { withFileTypes: true })\n\t\t.filter((entry) => entry.isDirectory())\n\t\t.map((entry) => entry.name);\n\tconst nextBindingSourceSlugs = Array.from(\n\t\tnew Set([...existingBindingSourceSlugs, bindingSourceSlug]),\n\t).sort();\n\tawait fsp.writeFile(\n\t\tbindingsIndexPath,\n\t\tbuildBindingSourceIndexSource(nextBindingSourceSlugs),\n\t\t\"utf8\",\n\t);\n}\n\nfunction resolveEditorPluginRegistryPath(projectDir: string): string {\n\tconst editorPluginsDir = path.join(projectDir, \"src\", \"editor-plugins\");\n\treturn [\n\t\tpath.join(editorPluginsDir, \"index.ts\"),\n\t\tpath.join(editorPluginsDir, \"index.js\"),\n\t].find((candidatePath) => fs.existsSync(candidatePath)) ?? path.join(editorPluginsDir, \"index.ts\");\n}\n\nfunction readEditorPluginRegistrySlugs(registryPath: string): string[] {\n\tif (!fs.existsSync(registryPath)) {\n\t\treturn [];\n\t}\n\n\tconst source = fs.readFileSync(registryPath, \"utf8\");\n\treturn Array.from(\n\t\tsource.matchAll(\n\t\t\t/^\\s*import\\s+['\"]\\.\\/([^/'\"]+)(?:\\/index(?:\\.[cm]?[jt]sx?)?)?['\"];?\\s*$/gmu,\n\t\t),\n\t).map((match) => match[1]);\n}\n\nasync function writeEditorPluginRegistry(\n\tprojectDir: string,\n\teditorPluginSlug: string,\n): Promise<void> {\n\tconst editorPluginsDir = path.join(projectDir, \"src\", \"editor-plugins\");\n\tconst registryPath = resolveEditorPluginRegistryPath(projectDir);\n\tawait fsp.mkdir(editorPluginsDir, { recursive: true });\n\n\tconst existingEditorPluginSlugs = readWorkspaceInventory(projectDir).editorPlugins.map((entry) =>\n\t\tentry.slug,\n\t);\n\tconst existingRegistrySlugs = readEditorPluginRegistrySlugs(registryPath);\n\tconst nextEditorPluginSlugs = Array.from(\n\t\tnew Set([...existingEditorPluginSlugs, ...existingRegistrySlugs, editorPluginSlug]),\n\t).sort();\n\tawait fsp.writeFile(\n\t\tregistryPath,\n\t\tbuildEditorPluginRegistrySource(nextEditorPluginSlugs),\n\t\t\"utf8\",\n\t);\n}\n\n/**\n * Add one document-level editor plugin scaffold to an official workspace project.\n *\n * @param options Command options for the editor-plugin scaffold workflow.\n * @param options.cwd Working directory used to resolve the nearest official workspace.\n * Defaults to `process.cwd()`.\n * @param options.editorPluginName Human-entered editor-plugin name that will be\n * normalized and validated before files are written.\n * @param options.slot Optional editor plugin shell slot. Defaults to `PluginSidebar`.\n * @returns A promise that resolves with the normalized `editorPluginSlug`, chosen\n * `slot`, and owning `projectDir` after the scaffold files and inventory entry\n * are written successfully.\n * @throws {Error} When the command is run outside an official workspace, when the\n * slug or slot is invalid, or when a conflicting file or inventory entry exists.\n */\nexport async function runAddEditorPluginCommand({\n\tcwd = process.cwd(),\n\teditorPluginName,\n\tslot,\n}: RunAddEditorPluginCommandOptions): Promise<{\n\teditorPluginSlug: string;\n\tprojectDir: string;\n\tslot: string;\n}> {\n\tconst workspace = resolveWorkspaceProject(cwd);\n\tconst editorPluginSlug = assertValidGeneratedSlug(\n\t\t\"Editor plugin name\",\n\t\tnormalizeBlockSlug(editorPluginName),\n\t\t\"wp-typia add editor-plugin <name> [--slot <PluginSidebar>]\",\n\t);\n\tconst resolvedSlot = assertValidEditorPluginSlot(slot);\n\n\tconst inventory = readWorkspaceInventory(workspace.projectDir);\n\tassertEditorPluginDoesNotExist(workspace.projectDir, editorPluginSlug, inventory);\n\n\tconst blockConfigPath = path.join(workspace.projectDir, \"scripts\", \"block-config.ts\");\n\tconst bootstrapPath = getWorkspaceBootstrapPath(workspace);\n\tconst buildScriptPath = path.join(workspace.projectDir, \"scripts\", \"build-workspace.mjs\");\n\tconst editorPluginsIndexPath = resolveEditorPluginRegistryPath(workspace.projectDir);\n\tconst webpackConfigPath = path.join(workspace.projectDir, \"webpack.config.js\");\n\tconst editorPluginDir = path.join(\n\t\tworkspace.projectDir,\n\t\t\"src\",\n\t\t\"editor-plugins\",\n\t\teditorPluginSlug,\n\t);\n\tconst entryFilePath = path.join(editorPluginDir, \"index.tsx\");\n\tconst sidebarFilePath = path.join(editorPluginDir, \"Sidebar.tsx\");\n\tconst dataFilePath = path.join(editorPluginDir, \"data.ts\");\n\tconst typesFilePath = path.join(editorPluginDir, \"types.ts\");\n\tconst styleFilePath = path.join(editorPluginDir, \"style.scss\");\n\tconst mutationSnapshot: WorkspaceMutationSnapshot = {\n\t\tfileSources: await snapshotWorkspaceFiles([\n\t\t\tblockConfigPath,\n\t\t\tbootstrapPath,\n\t\t\tbuildScriptPath,\n\t\t\teditorPluginsIndexPath,\n\t\t\twebpackConfigPath,\n\t\t]),\n\t\tsnapshotDirs: [],\n\t\ttargetPaths: [editorPluginDir],\n\t};\n\n\ttry {\n\t\tawait fsp.mkdir(editorPluginDir, { recursive: true });\n\t\tawait ensureEditorPluginBootstrapAnchors(workspace);\n\t\tawait ensureEditorPluginBuildScriptAnchors(workspace);\n\t\tawait ensureEditorPluginWebpackAnchors(workspace);\n\t\tawait fsp.writeFile(\n\t\t\tentryFilePath,\n\t\t\tbuildEditorPluginEntrySource(\n\t\t\t\teditorPluginSlug,\n\t\t\t\tworkspace.workspace.namespace,\n\t\t\t\tworkspace.workspace.textDomain,\n\t\t\t),\n\t\t\t\"utf8\",\n\t\t);\n\t\tawait fsp.writeFile(\n\t\t\tsidebarFilePath,\n\t\t\tbuildEditorPluginSidebarSource(\n\t\t\t\teditorPluginSlug,\n\t\t\t\tworkspace.workspace.textDomain,\n\t\t\t),\n\t\t\t\"utf8\",\n\t\t);\n\t\tawait fsp.writeFile(\n\t\t\tdataFilePath,\n\t\t\tbuildEditorPluginDataSource(editorPluginSlug, resolvedSlot),\n\t\t\t\"utf8\",\n\t\t);\n\t\tawait fsp.writeFile(\n\t\t\ttypesFilePath,\n\t\t\tbuildEditorPluginTypesSource(editorPluginSlug),\n\t\t\t\"utf8\",\n\t\t);\n\t\tawait fsp.writeFile(styleFilePath, buildEditorPluginStyleSource(), \"utf8\");\n\t\tawait writeEditorPluginRegistry(workspace.projectDir, editorPluginSlug);\n\t\tawait appendWorkspaceInventoryEntries(workspace.projectDir, {\n\t\t\teditorPluginEntries: [\n\t\t\t\tbuildEditorPluginConfigEntry(editorPluginSlug, resolvedSlot),\n\t\t\t],\n\t\t});\n\n\t\treturn {\n\t\t\teditorPluginSlug,\n\t\t\tprojectDir: workspace.projectDir,\n\t\t\tslot: resolvedSlot,\n\t\t};\n\t} catch (error) {\n\t\tawait rollbackWorkspaceMutation(mutationSnapshot);\n\t\tthrow error;\n\t}\n}\n\n/**\n * Add one PHP block pattern shell to an official workspace project.\n *\n * @param options Command options for the pattern scaffold workflow.\n * @param options.cwd Working directory used to resolve the nearest official workspace.\n * Defaults to `process.cwd()`.\n * @param options.patternName Human-entered pattern name that will be normalized\n * and validated before files are written.\n * @returns A promise that resolves with the normalized `patternSlug` and\n * owning `projectDir` after the pattern file and inventory entry have been\n * written successfully.\n * @throws {Error} When the command is run outside an official workspace, when\n * the pattern slug is invalid, or when a conflicting file or inventory entry\n * already exists.\n */\nexport async function runAddPatternCommand({\n\tcwd = process.cwd(),\n\tpatternName,\n}: RunAddPatternCommandOptions): Promise<{\n\tpatternSlug: string;\n\tprojectDir: string;\n}> {\n\tconst workspace = resolveWorkspaceProject(cwd);\n\tconst patternSlug = assertValidGeneratedSlug(\n\t\t\"Pattern name\",\n\t\tnormalizeBlockSlug(patternName),\n\t\t\"wp-typia add pattern <name>\",\n\t);\n\n\tconst inventory = readWorkspaceInventory(workspace.projectDir);\n\tassertPatternDoesNotExist(workspace.projectDir, patternSlug, inventory);\n\n\tconst blockConfigPath = path.join(workspace.projectDir, \"scripts\", \"block-config.ts\");\n\tconst bootstrapPath = getWorkspaceBootstrapPath(workspace);\n\tconst patternFilePath = path.join(workspace.projectDir, \"src\", \"patterns\", `${patternSlug}.php`);\n\tconst mutationSnapshot: WorkspaceMutationSnapshot = {\n\t\tfileSources: await snapshotWorkspaceFiles([blockConfigPath, bootstrapPath]),\n\t\tsnapshotDirs: [],\n\t\ttargetPaths: [patternFilePath],\n\t};\n\n\ttry {\n\t\tawait fsp.mkdir(path.dirname(patternFilePath), { recursive: true });\n\t\tawait ensurePatternBootstrapAnchors(workspace);\n\t\tawait fsp.writeFile(\n\t\t\tpatternFilePath,\n\t\t\tbuildPatternSource(\n\t\t\t\tpatternSlug,\n\t\t\t\tworkspace.workspace.namespace,\n\t\t\t\tworkspace.workspace.textDomain,\n\t\t\t),\n\t\t\t\"utf8\",\n\t\t);\n\t\tawait appendWorkspaceInventoryEntries(workspace.projectDir, {\n\t\t\tpatternEntries: [buildPatternConfigEntry(patternSlug)],\n\t\t});\n\n\t\treturn {\n\t\t\tpatternSlug,\n\t\t\tprojectDir: workspace.projectDir,\n\t\t};\n\t} catch (error) {\n\t\tawait rollbackWorkspaceMutation(mutationSnapshot);\n\t\tthrow error;\n\t}\n}\n\n/**\n * Add one block binding source scaffold to an official workspace project.\n *\n * @param options Command options for the binding-source scaffold workflow.\n * @param options.bindingSourceName Human-entered binding source name that will\n * be normalized and validated before files are written.\n * @param options.cwd Working directory used to resolve the nearest official\n * workspace. Defaults to `process.cwd()`.\n * @returns A promise that resolves with the normalized `bindingSourceSlug` and\n * owning `projectDir` after the server/editor files and inventory entry have\n * been written successfully.\n * @throws {Error} When the command is run outside an official workspace, when\n * the slug is invalid, or when a conflicting file or inventory entry exists.\n */\nexport async function runAddBindingSourceCommand({\n\tbindingSourceName,\n\tcwd = process.cwd(),\n}: RunAddBindingSourceCommandOptions): Promise<{\n\tbindingSourceSlug: string;\n\tprojectDir: string;\n}> {\n\tconst workspace = resolveWorkspaceProject(cwd);\n\tconst bindingSourceSlug = assertValidGeneratedSlug(\n\t\t\"Binding source name\",\n\t\tnormalizeBlockSlug(bindingSourceName),\n\t\t\"wp-typia add binding-source <name>\",\n\t);\n\n\tconst inventory = readWorkspaceInventory(workspace.projectDir);\n\tassertBindingSourceDoesNotExist(workspace.projectDir, bindingSourceSlug, inventory);\n\n\tconst blockConfigPath = path.join(workspace.projectDir, \"scripts\", \"block-config.ts\");\n\tconst bootstrapPath = getWorkspaceBootstrapPath(workspace);\n\tconst bindingsIndexPath = resolveBindingSourceRegistryPath(workspace.projectDir);\n\tconst bindingSourceDir = path.join(workspace.projectDir, \"src\", \"bindings\", bindingSourceSlug);\n\tconst serverFilePath = path.join(bindingSourceDir, \"server.php\");\n\tconst editorFilePath = path.join(bindingSourceDir, \"editor.ts\");\n\tconst mutationSnapshot: WorkspaceMutationSnapshot = {\n\t\tfileSources: await snapshotWorkspaceFiles([blockConfigPath, bootstrapPath, bindingsIndexPath]),\n\t\tsnapshotDirs: [],\n\t\ttargetPaths: [bindingSourceDir],\n\t};\n\n\ttry {\n\t\tawait fsp.mkdir(bindingSourceDir, { recursive: true });\n\t\tawait ensureBindingSourceBootstrapAnchors(workspace);\n\t\tawait fsp.writeFile(\n\t\t\tserverFilePath,\n\t\t\tbuildBindingSourceServerSource(\n\t\t\t\tbindingSourceSlug,\n\t\t\t\tworkspace.workspace.phpPrefix,\n\t\t\t\tworkspace.workspace.namespace,\n\t\t\t\tworkspace.workspace.textDomain,\n\t\t\t),\n\t\t\t\"utf8\",\n\t\t);\n\t\tawait fsp.writeFile(\n\t\t\teditorFilePath,\n\t\t\tbuildBindingSourceEditorSource(\n\t\t\t\tbindingSourceSlug,\n\t\t\t\tworkspace.workspace.namespace,\n\t\t\t\tworkspace.workspace.textDomain,\n\t\t\t),\n\t\t\t\"utf8\",\n\t\t);\n\t\tawait writeBindingSourceRegistry(workspace.projectDir, bindingSourceSlug);\n\t\tawait appendWorkspaceInventoryEntries(workspace.projectDir, {\n\t\t\tbindingSourceEntries: [buildBindingSourceConfigEntry(bindingSourceSlug)],\n\t\t});\n\n\t\treturn {\n\t\t\tbindingSourceSlug,\n\t\t\tprojectDir: workspace.projectDir,\n\t\t};\n\t} catch (error) {\n\t\tawait rollbackWorkspaceMutation(mutationSnapshot);\n\t\tthrow error;\n\t}\n}\n",
10
- "import fs from \"node:fs\";\nimport { promises as fsp } from \"node:fs\";\nimport path from \"node:path\";\n\nimport { ensureBlockConfigCanAddRestManifests } from \"./cli-add-block-legacy-validator.js\";\nimport {\n\tassertRestResourceDoesNotExist,\n\tassertValidGeneratedSlug,\n\tassertValidRestResourceMethods,\n\tgetWorkspaceBootstrapPath,\n\tnormalizeBlockSlug,\n\tpatchFile,\n\tquoteTsString,\n\tresolveRestResourceNamespace,\n\trollbackWorkspaceMutation,\n\ttype RestResourceMethodId,\n\ttype RunAddRestResourceCommandOptions,\n\ttype WorkspaceMutationSnapshot,\n\tsnapshotWorkspaceFiles,\n} from \"./cli-add-shared.js\";\nimport { buildRestResourceEndpointManifest, syncRestResourceArtifacts } from \"./rest-resource-artifacts.js\";\nimport { toTitleCase } from \"./string-case.js\";\nimport {\n\tappendWorkspaceInventoryEntries,\n\treadWorkspaceInventory,\n} from \"./workspace-inventory.js\";\nimport {\n\tresolveWorkspaceProject,\n\ttype WorkspaceProject,\n} from \"./workspace-project.js\";\n\nconst REST_RESOURCE_SERVER_GLOB = \"/inc/rest/*.php\";\n\nfunction escapeRegex(value: string): string {\n\treturn value.replace(/[.*+?^${}()|[\\]\\\\]/gu, \"\\\\$&\");\n}\n\nfunction quotePhpString(value: string): string {\n\treturn `'${value.replace(/\\\\/gu, \"\\\\\\\\\").replace(/'/gu, \"\\\\'\")}'`;\n}\n\nfunction toPascalCaseFromSlug(slug: string): string {\n\treturn normalizeBlockSlug(slug)\n\t\t.split(\"-\")\n\t\t.filter(Boolean)\n\t\t.map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))\n\t\t.join(\"\");\n}\n\nfunction indentMultiline(source: string, prefix: string): string {\n\treturn source\n\t\t.split(\"\\n\")\n\t\t.map((line) => `${prefix}${line}`)\n\t\t.join(\"\\n\");\n}\n\nfunction buildRestResourceConfigEntry(\n\trestResourceSlug: string,\n\tnamespace: string,\n\tmethods: RestResourceMethodId[],\n): string {\n\tconst pascalCase = toPascalCaseFromSlug(restResourceSlug);\n\tconst title = toTitleCase(restResourceSlug);\n\tconst manifest = buildRestResourceEndpointManifest(\n\t\t{\n\t\t\tnamespace,\n\t\t\tpascalCase,\n\t\t\tslugKebabCase: restResourceSlug,\n\t\t\ttitle,\n\t\t},\n\t\tmethods,\n\t);\n\n\treturn [\n\t\t\"\\t{\",\n\t\t`\\t\\tapiFile: ${quoteTsString(`src/rest/${restResourceSlug}/api.ts`)},`,\n\t\t`\\t\\tclientFile: ${quoteTsString(`src/rest/${restResourceSlug}/api-client.ts`)},`,\n\t\t`\\t\\tdataFile: ${quoteTsString(`src/rest/${restResourceSlug}/data.ts`)},`,\n\t\t`\\t\\tmethods: [ ${methods.map((method) => quoteTsString(method)).join(\", \")} ],`,\n\t\t`\\t\\tnamespace: ${quoteTsString(namespace)},`,\n\t\t`\\t\\topenApiFile: ${quoteTsString(`src/rest/${restResourceSlug}/api.openapi.json`)},`,\n\t\t`\\t\\tphpFile: ${quoteTsString(`inc/rest/${restResourceSlug}.php`)},`,\n\t\t\"\\t\\trestManifest: defineEndpointManifest(\",\n\t\tindentMultiline(JSON.stringify(manifest, null, \"\\t\"), \"\\t\\t\\t\"),\n\t\t\"\\t\\t),\",\n\t\t`\\t\\tslug: ${quoteTsString(restResourceSlug)},`,\n\t\t`\\t\\ttypesFile: ${quoteTsString(`src/rest/${restResourceSlug}/api-types.ts`)},`,\n\t\t`\\t\\tvalidatorsFile: ${quoteTsString(`src/rest/${restResourceSlug}/api-validators.ts`)},`,\n\t\t\"\\t},\",\n\t].join(\"\\n\");\n}\n\nfunction buildRestResourceTypesSource(\n\trestResourceSlug: string,\n\tmethods: RestResourceMethodId[],\n): string {\n\tconst pascalCase = toPascalCaseFromSlug(restResourceSlug);\n\tconst lines = [\n\t\t\"import { tags } from 'typia';\",\n\t\t\"\",\n\t\t`export type ${pascalCase}Status = 'draft' | 'published';`,\n\t\t\"\",\n\t\t`export interface ${pascalCase}Record {`,\n\t\t\"\\tid: number & tags.Type< 'uint32' >;\",\n\t\t\"\\ttitle: string & tags.MinLength< 1 > & tags.MaxLength< 120 >;\",\n\t\t\"\\tcontent?: string & tags.MaxLength< 2000 >;\",\n\t\t`\\tstatus: ${pascalCase}Status;`,\n\t\t\"\\tupdatedAt: string;\",\n\t\t\"}\",\n\t];\n\n\tif (methods.includes(\"list\")) {\n\t\tlines.push(\n\t\t\t\"\",\n\t\t\t`export interface ${pascalCase}ListQuery {`,\n\t\t\t\"\\tpage?: number & tags.Type< 'uint32' > & tags.Minimum< 1 > & tags.Default< 1 >;\",\n\t\t\t\"\\tperPage?: number & tags.Type< 'uint32' > & tags.Minimum< 1 > & tags.Maximum< 50 > & tags.Default< 10 >;\",\n\t\t\t\"\\tsearch?: string & tags.MaxLength< 120 >;\",\n\t\t\t\"}\",\n\t\t\t\"\",\n\t\t\t`export interface ${pascalCase}ListResponse {`,\n\t\t\t`\\titems: ${pascalCase}Record[];`,\n\t\t\t\"\\tpage: number & tags.Type< 'uint32' >;\",\n\t\t\t\"\\tperPage: number & tags.Type< 'uint32' >;\",\n\t\t\t\"\\ttotal: number & tags.Type< 'uint32' >;\",\n\t\t\t\"}\",\n\t\t);\n\t}\n\n\tif (methods.includes(\"read\")) {\n\t\tlines.push(\n\t\t\t\"\",\n\t\t\t`export interface ${pascalCase}ReadQuery {`,\n\t\t\t\"\\tid: number & tags.Type< 'uint32' >;\",\n\t\t\t\"}\",\n\t\t\t\"\",\n\t\t\t`export type ${pascalCase}ReadResponse = ${pascalCase}Record;`,\n\t\t);\n\t}\n\n\tif (methods.includes(\"create\")) {\n\t\tlines.push(\n\t\t\t\"\",\n\t\t\t`export interface ${pascalCase}CreateRequest {`,\n\t\t\t\"\\ttitle: string & tags.MinLength< 1 > & tags.MaxLength< 120 >;\",\n\t\t\t\"\\tcontent?: string & tags.MaxLength< 2000 >;\",\n\t\t\t`\\tstatus?: ${pascalCase}Status;`,\n\t\t\t\"}\",\n\t\t\t\"\",\n\t\t\t`export type ${pascalCase}CreateResponse = ${pascalCase}Record;`,\n\t\t);\n\t}\n\n\tif (methods.includes(\"update\")) {\n\t\tlines.push(\n\t\t\t\"\",\n\t\t\t`export interface ${pascalCase}UpdateQuery {`,\n\t\t\t\"\\tid: number & tags.Type< 'uint32' >;\",\n\t\t\t\"}\",\n\t\t\t\"\",\n\t\t\t`export interface ${pascalCase}UpdateRequest {`,\n\t\t\t\"\\ttitle?: string & tags.MinLength< 1 > & tags.MaxLength< 120 >;\",\n\t\t\t\"\\tcontent?: string & tags.MaxLength< 2000 >;\",\n\t\t\t`\\tstatus?: ${pascalCase}Status;`,\n\t\t\t\"}\",\n\t\t\t\"\",\n\t\t\t`export type ${pascalCase}UpdateResponse = ${pascalCase}Record;`,\n\t\t);\n\t}\n\n\tif (methods.includes(\"delete\")) {\n\t\tlines.push(\n\t\t\t\"\",\n\t\t\t`export interface ${pascalCase}DeleteQuery {`,\n\t\t\t\"\\tid: number & tags.Type< 'uint32' >;\",\n\t\t\t\"}\",\n\t\t\t\"\",\n\t\t\t`export interface ${pascalCase}DeleteResponse {`,\n\t\t\t\"\\tdeleted: true;\",\n\t\t\t\"\\tid: number & tags.Type< 'uint32' >;\",\n\t\t\t\"}\",\n\t\t);\n\t}\n\n\treturn `${lines.join(\"\\n\")}\\n`;\n}\n\nfunction buildRestResourceValidatorsSource(\n\trestResourceSlug: string,\n\tmethods: RestResourceMethodId[],\n): string {\n\tconst pascalCase = toPascalCaseFromSlug(restResourceSlug);\n\tconst importedTypes = new Set<string>();\n\tconst validatorDeclarations: string[] = [];\n\tconst validatorEntries: string[] = [];\n\n\tconst addValidator = (\n\t\tpropertyName: string,\n\t\ttypeName: string,\n\t\tvalidateIdentifier: string,\n\t) => {\n\t\timportedTypes.add(typeName);\n\t\tvalidatorDeclarations.push(\n\t\t\t`const ${validateIdentifier} = typia.createValidate< ${typeName} >();`,\n\t\t);\n\t\tvalidatorEntries.push(\n\t\t\t`\\t${propertyName}: ( input: unknown ) => toValidationResult< ${typeName} >( ${validateIdentifier}( input ) ),`,\n\t\t);\n\t};\n\n\tif (methods.includes(\"list\")) {\n\t\taddValidator(\"listQuery\", `${pascalCase}ListQuery`, \"validateListQuery\");\n\t\taddValidator(\"listResponse\", `${pascalCase}ListResponse`, \"validateListResponse\");\n\t}\n\tif (methods.includes(\"read\")) {\n\t\taddValidator(\"readQuery\", `${pascalCase}ReadQuery`, \"validateReadQuery\");\n\t\taddValidator(\"readResponse\", `${pascalCase}ReadResponse`, \"validateReadResponse\");\n\t}\n\tif (methods.includes(\"create\")) {\n\t\taddValidator(\"createRequest\", `${pascalCase}CreateRequest`, \"validateCreateRequest\");\n\t\taddValidator(\"createResponse\", `${pascalCase}CreateResponse`, \"validateCreateResponse\");\n\t}\n\tif (methods.includes(\"update\")) {\n\t\taddValidator(\"updateQuery\", `${pascalCase}UpdateQuery`, \"validateUpdateQuery\");\n\t\taddValidator(\"updateRequest\", `${pascalCase}UpdateRequest`, \"validateUpdateRequest\");\n\t\taddValidator(\"updateResponse\", `${pascalCase}UpdateResponse`, \"validateUpdateResponse\");\n\t}\n\tif (methods.includes(\"delete\")) {\n\t\taddValidator(\"deleteQuery\", `${pascalCase}DeleteQuery`, \"validateDeleteQuery\");\n\t\taddValidator(\"deleteResponse\", `${pascalCase}DeleteResponse`, \"validateDeleteResponse\");\n\t}\n\n\treturn `import typia from 'typia';\n\nimport { toValidationResult } from '@wp-typia/rest';\nimport type {\n\\t${Array.from(importedTypes).sort().join(\",\\n\\t\")},\n} from './api-types';\n\n${validatorDeclarations.join(\"\\n\")}\n\nexport const apiValidators = {\n${validatorEntries.join(\"\\n\")}\n};\n`;\n}\n\nfunction buildRestResourceApiSource(\n\trestResourceSlug: string,\n\tmethods: RestResourceMethodId[],\n): string {\n\tconst pascalCase = toPascalCaseFromSlug(restResourceSlug);\n\tconst typeImports = new Set<string>();\n\tconst clientEndpointImports: string[] = [];\n\tconst exportedBindings: string[] = [];\n\tconst writeMethods = methods.filter((method) =>\n\t\t[\"create\", \"update\", \"delete\"].includes(method),\n\t);\n\n\tif (methods.includes(\"list\")) {\n\t\ttypeImports.add(`${pascalCase}ListQuery`);\n\t\tclientEndpointImports.push(`list${pascalCase}ResourcesEndpoint`);\n\t\texportedBindings.push(`export const restResourceListEndpoint = {\n\\t...list${pascalCase}ResourcesEndpoint,\n\\tbuildRequestOptions: () => ( {\n\\t\\turl: resolveRestRouteUrl( list${pascalCase}ResourcesEndpoint.path ),\n\\t} ),\n};\n\nexport function listResource( request: ${pascalCase}ListQuery ) {\n\\treturn callEndpoint( restResourceListEndpoint, request );\n}`);\n\t}\n\n\tif (methods.includes(\"read\")) {\n\t\ttypeImports.add(`${pascalCase}ReadQuery`);\n\t\tclientEndpointImports.push(`read${pascalCase}ResourceEndpoint`);\n\t\texportedBindings.push(`export const restResourceReadEndpoint = {\n\\t...read${pascalCase}ResourceEndpoint,\n\\tbuildRequestOptions: () => ( {\n\\t\\turl: resolveRestRouteUrl( read${pascalCase}ResourceEndpoint.path ),\n\\t} ),\n};\n\nexport function readResource( request: ${pascalCase}ReadQuery ) {\n\\treturn callEndpoint( restResourceReadEndpoint, request );\n}`);\n\t}\n\n\tif (methods.includes(\"create\")) {\n\t\ttypeImports.add(`${pascalCase}CreateRequest`);\n\t\tclientEndpointImports.push(`create${pascalCase}ResourceEndpoint`);\n\t\texportedBindings.push(`export const restResourceCreateEndpoint = {\n\\t...create${pascalCase}ResourceEndpoint,\n\\tbuildRequestOptions: () => {\n\\t\\tconst nonce = resolveRestNonce();\n\\t\\treturn {\n\\t\\t\\theaders: nonce\n\\t\\t\\t\\t? {\n\\t\\t\\t\\t\\t'X-WP-Nonce': nonce,\n\\t\\t\\t\\t}\n\\t\\t\\t\\t: undefined,\n\\t\\t\\turl: resolveRestRouteUrl( create${pascalCase}ResourceEndpoint.path ),\n\\t\\t};\n\\t},\n};\n\nexport function createResource( request: ${pascalCase}CreateRequest ) {\n\\treturn callEndpoint( restResourceCreateEndpoint, request );\n}`);\n\t}\n\n\tif (methods.includes(\"update\")) {\n\t\ttypeImports.add(`${pascalCase}UpdateQuery`);\n\t\ttypeImports.add(`${pascalCase}UpdateRequest`);\n\t\tclientEndpointImports.push(`update${pascalCase}ResourceEndpoint`);\n\t\texportedBindings.push(`export const restResourceUpdateEndpoint = {\n\\t...update${pascalCase}ResourceEndpoint,\n\\tbuildRequestOptions: () => {\n\\t\\tconst nonce = resolveRestNonce();\n\\t\\treturn {\n\\t\\t\\theaders: nonce\n\\t\\t\\t\\t? {\n\\t\\t\\t\\t\\t'X-WP-Nonce': nonce,\n\\t\\t\\t\\t}\n\\t\\t\\t\\t: undefined,\n\\t\\t\\turl: resolveRestRouteUrl( update${pascalCase}ResourceEndpoint.path ),\n\\t\\t};\n\\t},\n};\n\nexport function updateResource( request: {\n\\tbody: ${pascalCase}UpdateRequest;\n\\tquery: ${pascalCase}UpdateQuery;\n} ) {\n\\treturn callEndpoint( restResourceUpdateEndpoint, request );\n}`);\n\t}\n\n\tif (methods.includes(\"delete\")) {\n\t\ttypeImports.add(`${pascalCase}DeleteQuery`);\n\t\tclientEndpointImports.push(`delete${pascalCase}ResourceEndpoint`);\n\t\texportedBindings.push(`export const restResourceDeleteEndpoint = {\n\\t...delete${pascalCase}ResourceEndpoint,\n\\tbuildRequestOptions: () => {\n\\t\\tconst nonce = resolveRestNonce();\n\\t\\treturn {\n\\t\\t\\theaders: nonce\n\\t\\t\\t\\t? {\n\\t\\t\\t\\t\\t'X-WP-Nonce': nonce,\n\\t\\t\\t\\t}\n\\t\\t\\t\\t: undefined,\n\\t\\t\\turl: resolveRestRouteUrl( delete${pascalCase}ResourceEndpoint.path ),\n\\t\\t};\n\\t},\n};\n\nexport function deleteResource( request: ${pascalCase}DeleteQuery ) {\n\\treturn callEndpoint( restResourceDeleteEndpoint, request );\n}`);\n\t}\n\n\treturn `import {\n\\tcallEndpoint,\n\\tresolveRestRouteUrl,\n} from '@wp-typia/rest';\n\nimport type {\n\\t${Array.from(typeImports).sort().join(\",\\n\\t\")},\n} from './api-types';\nimport {\n\\t${clientEndpointImports.sort().join(\",\\n\\t\")},\n} from './api-client';\n${writeMethods.length > 0\n\t? `\nfunction resolveRestNonce( fallback?: string ): string | undefined {\n\\tif ( typeof fallback === 'string' && fallback.length > 0 ) {\n\\t\\treturn fallback;\n\\t}\n\n\\tif ( typeof window === 'undefined' ) {\n\\t\\treturn undefined;\n\\t}\n\n\\tconst wpApiSettings = (\n\\t\\twindow as typeof window & {\n\\t\\t\\twpApiSettings?: { nonce?: string };\n\\t\\t}\n\\t).wpApiSettings;\n\n\\treturn typeof wpApiSettings?.nonce === 'string' &&\n\\t\\twpApiSettings.nonce.length > 0\n\\t\\t? wpApiSettings.nonce\n\\t\\t: undefined;\n}\n`\n\t: \"\"}\n${exportedBindings.join(\"\\n\\n\")}\n`;\n}\n\nfunction buildRestResourceDataSource(\n\trestResourceSlug: string,\n\tmethods: RestResourceMethodId[],\n): string {\n\tconst pascalCase = toPascalCaseFromSlug(restResourceSlug);\n\tconst typeImports = new Set<string>();\n\tconst endpointImports: string[] = [];\n\tconst exportedBindings: string[] = [];\n\n\tif (methods.includes(\"list\")) {\n\t\ttypeImports.add(`${pascalCase}ListQuery`);\n\t\ttypeImports.add(`${pascalCase}ListResponse`);\n\t\tendpointImports.push(\"restResourceListEndpoint\");\n\t\texportedBindings.push(`export type Use${pascalCase}ListQueryOptions<\n\\tSelected = ${pascalCase}ListResponse,\n> = UseEndpointQueryOptions<\n\\t${pascalCase}ListQuery,\n\\t${pascalCase}ListResponse,\n\\tSelected\n>;\n\nexport function use${pascalCase}ListQuery<\n\\tSelected = ${pascalCase}ListResponse,\n>(\n\\trequest: ${pascalCase}ListQuery,\n\\toptions: Use${pascalCase}ListQueryOptions< Selected > = {}\n) {\n\\treturn useEndpointQuery( restResourceListEndpoint, request, options );\n}`);\n\t}\n\n\tif (methods.includes(\"read\")) {\n\t\ttypeImports.add(`${pascalCase}ReadQuery`);\n\t\ttypeImports.add(`${pascalCase}ReadResponse`);\n\t\tendpointImports.push(\"restResourceReadEndpoint\");\n\t\texportedBindings.push(`export type Use${pascalCase}ReadQueryOptions<\n\\tSelected = ${pascalCase}ReadResponse,\n> = UseEndpointQueryOptions<\n\\t${pascalCase}ReadQuery,\n\\t${pascalCase}ReadResponse,\n\\tSelected\n>;\n\nexport function use${pascalCase}ReadQuery<\n\\tSelected = ${pascalCase}ReadResponse,\n>(\n\\trequest: ${pascalCase}ReadQuery,\n\\toptions: Use${pascalCase}ReadQueryOptions< Selected > = {}\n) {\n\\treturn useEndpointQuery( restResourceReadEndpoint, request, options );\n}`);\n\t}\n\n\tif (methods.includes(\"create\")) {\n\t\ttypeImports.add(`${pascalCase}CreateRequest`);\n\t\ttypeImports.add(`${pascalCase}CreateResponse`);\n\t\tendpointImports.push(\"restResourceCreateEndpoint\");\n\t\texportedBindings.push(`export type UseCreate${pascalCase}ResourceMutationOptions = UseEndpointMutationOptions<\n\\t${pascalCase}CreateRequest,\n\\t${pascalCase}CreateResponse,\n\\tunknown\n>;\n\nexport function useCreate${pascalCase}ResourceMutation(\n\\toptions: UseCreate${pascalCase}ResourceMutationOptions = {}\n) {\n\\treturn useEndpointMutation( restResourceCreateEndpoint, options );\n}`);\n\t}\n\n\tif (methods.includes(\"update\")) {\n\t\ttypeImports.add(`${pascalCase}UpdateQuery`);\n\t\ttypeImports.add(`${pascalCase}UpdateRequest`);\n\t\ttypeImports.add(`${pascalCase}UpdateResponse`);\n\t\tendpointImports.push(\"restResourceUpdateEndpoint\");\n\t\texportedBindings.push(`export type UseUpdate${pascalCase}ResourceMutationOptions = UseEndpointMutationOptions<\n\\t{\n\\t\\tbody: ${pascalCase}UpdateRequest;\n\\t\\tquery: ${pascalCase}UpdateQuery;\n\\t},\n\\t${pascalCase}UpdateResponse,\n\\tunknown\n>;\n\nexport function useUpdate${pascalCase}ResourceMutation(\n\\toptions: UseUpdate${pascalCase}ResourceMutationOptions = {}\n) {\n\\treturn useEndpointMutation( restResourceUpdateEndpoint, options );\n}`);\n\t}\n\n\tif (methods.includes(\"delete\")) {\n\t\ttypeImports.add(`${pascalCase}DeleteQuery`);\n\t\ttypeImports.add(`${pascalCase}DeleteResponse`);\n\t\tendpointImports.push(\"restResourceDeleteEndpoint\");\n\t\texportedBindings.push(`export type UseDelete${pascalCase}ResourceMutationOptions = UseEndpointMutationOptions<\n\\t${pascalCase}DeleteQuery,\n\\t${pascalCase}DeleteResponse,\n\\tunknown\n>;\n\nexport function useDelete${pascalCase}ResourceMutation(\n\\toptions: UseDelete${pascalCase}ResourceMutationOptions = {}\n) {\n\\treturn useEndpointMutation( restResourceDeleteEndpoint, options );\n}`);\n\t}\n\n\treturn `import {\n\\tuseEndpointMutation,\n\\tuseEndpointQuery,\n\\ttype UseEndpointMutationOptions,\n\\ttype UseEndpointQueryOptions,\n} from '@wp-typia/rest/react';\n\nimport type {\n\\t${Array.from(typeImports).sort().join(\",\\n\\t\")},\n} from './api-types';\nimport {\n\\t${endpointImports.sort().join(\",\\n\\t\")},\n} from './api';\n\n${exportedBindings.join(\"\\n\\n\")}\n`;\n}\n\nfunction buildRestResourceRouteRegistrations(\n\trestResourceSlug: string,\n\tmethods: RestResourceMethodId[],\n\tfunctions: {\n\t\tcanWriteFunctionName: string;\n\t\tcreateHandlerName: string;\n\t\tdeleteHandlerName: string;\n\t\tlistHandlerName: string;\n\t\treadHandlerName: string;\n\t\tupdateHandlerName: string;\n\t},\n): string {\n\tconst collectionRoutes: string[] = [];\n\tconst itemRoutes: string[] = [];\n\n\tif (methods.includes(\"list\")) {\n\t\tcollectionRoutes.push(`\\t\\tarray(\n\\t\\t\\t'methods' => WP_REST_Server::READABLE,\n\\t\\t\\t'callback' => '${functions.listHandlerName}',\n\\t\\t\\t'permission_callback' => '__return_true',\n\\t\\t)`);\n\t}\n\tif (methods.includes(\"create\")) {\n\t\tcollectionRoutes.push(`\\t\\tarray(\n\\t\\t\\t'methods' => WP_REST_Server::CREATABLE,\n\\t\\t\\t'callback' => '${functions.createHandlerName}',\n\\t\\t\\t'permission_callback' => '${functions.canWriteFunctionName}',\n\\t\\t)`);\n\t}\n\tif (methods.includes(\"read\")) {\n\t\titemRoutes.push(`\\t\\tarray(\n\\t\\t\\t'methods' => WP_REST_Server::READABLE,\n\\t\\t\\t'callback' => '${functions.readHandlerName}',\n\\t\\t\\t'permission_callback' => '__return_true',\n\\t\\t)`);\n\t}\n\tif (methods.includes(\"update\")) {\n\t\titemRoutes.push(`\\t\\tarray(\n\\t\\t\\t'methods' => WP_REST_Server::EDITABLE,\n\\t\\t\\t'callback' => '${functions.updateHandlerName}',\n\\t\\t\\t'permission_callback' => '${functions.canWriteFunctionName}',\n\\t\\t)`);\n\t}\n\tif (methods.includes(\"delete\")) {\n\t\titemRoutes.push(`\\t\\tarray(\n\\t\\t\\t'methods' => WP_REST_Server::DELETABLE,\n\\t\\t\\t'callback' => '${functions.deleteHandlerName}',\n\\t\\t\\t'permission_callback' => '${functions.canWriteFunctionName}',\n\\t\\t)`);\n\t}\n\n\tconst registrations: string[] = [];\n\tif (collectionRoutes.length > 0) {\n\t\tregistrations.push(`\\tregister_rest_route(\n\\t\\t$namespace,\n\\t\\t'/${restResourceSlug}',\n\\t\\tarray(\n${collectionRoutes.join(\",\\n\")}\n\\t\\t)\n\\t);`);\n\t}\n\tif (itemRoutes.length > 0) {\n\t\tregistrations.push(`\\tregister_rest_route(\n\\t\\t$namespace,\n\\t\\t'/${restResourceSlug}/item',\n\\t\\tarray(\n${itemRoutes.join(\",\\n\")}\n\\t\\t)\n\\t);`);\n\t}\n\n\treturn registrations.join(\"\\n\\n\");\n}\n\nfunction buildRestResourcePhpSource(\n\trestResourceSlug: string,\n\tnamespace: string,\n\tphpPrefix: string,\n\ttextDomain: string,\n\tmethods: RestResourceMethodId[],\n): string {\n\tconst restResourceTitle = toTitleCase(restResourceSlug);\n\tconst restResourcePhpId = restResourceSlug.replace(/-/g, \"_\");\n\tconst canWriteFunctionName = `${phpPrefix}_${restResourcePhpId}_can_manage_rest_resource`;\n\tconst getItemsFunctionName = `${phpPrefix}_${restResourcePhpId}_get_rest_resource_items`;\n\tconst loadSchemaFunctionName = `${phpPrefix}_${restResourcePhpId}_load_rest_resource_schema`;\n\tconst normalizeSchemaFunctionName = `${phpPrefix}_${restResourcePhpId}_sanitize_rest_resource_schema`;\n\tconst validatePayloadFunctionName = `${phpPrefix}_${restResourcePhpId}_validate_rest_resource_payload`;\n\tconst normalizeItemFunctionName = `${phpPrefix}_${restResourcePhpId}_normalize_rest_resource_item`;\n\tconst saveItemsFunctionName = `${phpPrefix}_${restResourcePhpId}_save_rest_resource_items`;\n\tconst getOptionNameFunctionName = `${phpPrefix}_${restResourcePhpId}_get_rest_resource_option_name`;\n\tconst listHandlerName = `${phpPrefix}_${restResourcePhpId}_handle_list_rest_resource`;\n\tconst readHandlerName = `${phpPrefix}_${restResourcePhpId}_handle_read_rest_resource`;\n\tconst createHandlerName = `${phpPrefix}_${restResourcePhpId}_handle_create_rest_resource`;\n\tconst updateHandlerName = `${phpPrefix}_${restResourcePhpId}_handle_update_rest_resource`;\n\tconst deleteHandlerName = `${phpPrefix}_${restResourcePhpId}_handle_delete_rest_resource`;\n\tconst registerRoutesFunctionName = `${phpPrefix}_${restResourcePhpId}_register_rest_routes`;\n\tconst routeRegistrations = buildRestResourceRouteRegistrations(restResourceSlug, methods, {\n\t\tcanWriteFunctionName,\n\t\tcreateHandlerName,\n\t\tdeleteHandlerName,\n\t\tlistHandlerName,\n\t\treadHandlerName,\n\t\tupdateHandlerName,\n\t});\n\n\treturn `<?php\nif ( ! defined( 'ABSPATH' ) ) {\n\\treturn;\n}\n\nif ( ! function_exists( '${getOptionNameFunctionName}' ) ) {\n\\tfunction ${getOptionNameFunctionName}() {\n\\t\\treturn ${quotePhpString(`${phpPrefix}_${restResourcePhpId}_rest_resource_items`)};\n\\t}\n}\n\nif ( ! function_exists( '${normalizeItemFunctionName}' ) ) {\n\\tfunction ${normalizeItemFunctionName}( array $item ) {\n\\t\\treturn array(\n\\t\\t\\t'id' => isset( $item['id'] ) ? (int) $item['id'] : 0,\n\\t\\t\\t'title' => isset( $item['title'] ) ? (string) $item['title'] : '',\n\\t\\t\\t'content' => isset( $item['content'] ) ? (string) $item['content'] : '',\n\\t\\t\\t'status' => isset( $item['status'] ) && 'published' === $item['status'] ? 'published' : 'draft',\n\\t\\t\\t'updatedAt' => isset( $item['updatedAt'] ) ? (string) $item['updatedAt'] : gmdate( 'c' ),\n\\t\\t);\n\\t}\n}\n\nif ( ! function_exists( '${getItemsFunctionName}' ) ) {\n\\tfunction ${getItemsFunctionName}() {\n\\t\\t$seed_items = array(\n\\t\\t\\tarray(\n\\t\\t\\t\\t'id' => 1,\n\\t\\t\\t\\t'title' => ${quotePhpString(`${restResourceTitle} Starter`)},\n\\t\\t\\t\\t'content' => ${quotePhpString(`Replace this seeded ${restResourceTitle.toLowerCase()} content with your plugin data source.`)},\n\\t\\t\\t\\t'status' => 'draft',\n\\t\\t\\t\\t'updatedAt' => '2026-01-01T00:00:00Z',\n\\t\\t\\t),\n\\t\\t);\n\\t\\t$items = get_option( ${getOptionNameFunctionName}(), $seed_items );\n\n\\t\\tif ( ! is_array( $items ) ) {\n\\t\\t\\t$items = $seed_items;\n\\t\\t}\n\n\\t\\treturn array_values(\n\\t\\t\\tarray_map(\n\\t\\t\\t\\t'${normalizeItemFunctionName}',\n\\t\\t\\t\\tarray_filter(\n\\t\\t\\t\\t\\t$items,\n\\t\\t\\t\\t\\t'is_array'\n\\t\\t\\t\\t)\n\\t\\t\\t)\n\\t\\t);\n\\t}\n}\n\nif ( ! function_exists( '${saveItemsFunctionName}' ) ) {\n\\tfunction ${saveItemsFunctionName}( array $items ) {\n\\t\\tupdate_option(\n\\t\\t\\t${getOptionNameFunctionName}(),\n\\t\\t\\tarray_values(\n\\t\\t\\t\\tarray_map(\n\\t\\t\\t\\t\\t'${normalizeItemFunctionName}',\n\\t\\t\\t\\t\\t$items\n\\t\\t\\t\\t)\n\\t\\t\\t),\n\\t\\t\\tfalse\n\\t\\t);\n\\t}\n}\n\nif ( ! function_exists( '${loadSchemaFunctionName}' ) ) {\n\\tfunction ${loadSchemaFunctionName}( $schema_name ) {\n\\t\\t$project_root = dirname( __DIR__, 2 );\n\\t\\t$schema_path = $project_root . '/src/rest/${restResourceSlug}/api-schemas/' . $schema_name . '.schema.json';\n\\t\\tif ( ! file_exists( $schema_path ) ) {\n\\t\\t\\treturn null;\n\\t\\t}\n\n\\t\\t$decoded = json_decode( file_get_contents( $schema_path ), true );\n\\t\\treturn is_array( $decoded ) ? $decoded : null;\n\\t}\n}\n\nif ( ! function_exists( '${normalizeSchemaFunctionName}' ) ) {\n\\tfunction ${normalizeSchemaFunctionName}( $schema ) {\n\\t\\tif ( ! is_array( $schema ) ) {\n\\t\\t\\treturn $schema;\n\\t\\t}\n\n\\t\\tunset( $schema['$schema'], $schema['title'] );\n\n\\t\\tif ( isset( $schema['properties'] ) && is_array( $schema['properties'] ) ) {\n\\t\\t\\tforeach ( $schema['properties'] as $key => $property_schema ) {\n\\t\\t\\t\\t$schema['properties'][ $key ] = ${normalizeSchemaFunctionName}( $property_schema );\n\\t\\t\\t}\n\\t\\t}\n\n\\t\\tif ( isset( $schema['items'] ) && is_array( $schema['items'] ) ) {\n\\t\\t\\t$schema['items'] = ${normalizeSchemaFunctionName}( $schema['items'] );\n\\t\\t}\n\n\\t\\treturn $schema;\n\\t}\n}\n\nif ( ! function_exists( '${validatePayloadFunctionName}' ) ) {\n\\tfunction ${validatePayloadFunctionName}( $value, $schema_name, $param_name ) {\n\\t\\t$schema = ${loadSchemaFunctionName}( $schema_name );\n\\t\\tif ( ! is_array( $schema ) ) {\n\\t\\t\\treturn new WP_Error( 'missing_schema', 'Missing REST schema.', array( 'status' => 500 ) );\n\\t\\t}\n\n\\t\\t$rest_schema = ${normalizeSchemaFunctionName}( $schema );\n\\t\\t$validation = rest_validate_value_from_schema( $value, $rest_schema, $param_name );\n\\t\\tif ( is_wp_error( $validation ) ) {\n\\t\\t\\treturn $validation;\n\\t\\t}\n\n\\t\\treturn rest_sanitize_value_from_schema( $value, $rest_schema, $param_name );\n\\t}\n}\n\nif ( ! function_exists( '${canWriteFunctionName}' ) ) {\n\\tfunction ${canWriteFunctionName}() {\n\\t\\treturn current_user_can( 'edit_posts' );\n\\t}\n}\n\nif ( ! function_exists( '${listHandlerName}' ) ) {\n\\tfunction ${listHandlerName}( WP_REST_Request $request ) {\n\\t\\t$payload_input = array();\n\\t\\t$page = $request->get_param( 'page' );\n\\t\\t$per_page = $request->get_param( 'perPage' );\n\\t\\t$search = $request->get_param( 'search' );\n\n\\t\\tif ( null !== $page ) {\n\\t\\t\\t$payload_input['page'] = $page;\n\\t\\t}\n\\t\\tif ( null !== $per_page ) {\n\\t\\t\\t$payload_input['perPage'] = $per_page;\n\\t\\t}\n\\t\\tif ( null !== $search ) {\n\\t\\t\\t$payload_input['search'] = $search;\n\\t\\t}\n\n\\t\\t$payload = ${validatePayloadFunctionName}(\n\\t\\t\\t$payload_input,\n\\t\\t\\t'list-query',\n\\t\\t\\t'query'\n\\t\\t);\n\n\\t\\tif ( is_wp_error( $payload ) ) {\n\\t\\t\\treturn $payload;\n\\t\\t}\n\n\\t\\t$page = isset( $payload['page'] ) ? max( 1, (int) $payload['page'] ) : 1;\n\\t\\t$per_page = isset( $payload['perPage'] ) ? min( 50, max( 1, (int) $payload['perPage'] ) ) : 10;\n\\t\\t$search = isset( $payload['search'] ) ? strtolower( (string) $payload['search'] ) : '';\n\\t\\t$items = ${getItemsFunctionName}();\n\n\\t\\tif ( '' !== $search ) {\n\\t\\t\\t$items = array_values(\n\\t\\t\\t\\tarray_filter(\n\\t\\t\\t\\t\\t$items,\n\\t\\t\\t\\t\\tstatic function ( $item ) use ( $search ) {\n\\t\\t\\t\\t\\t\\treturn false !== strpos( strtolower( (string) ( $item['title'] ?? '' ) ), $search ) ||\n\\t\\t\\t\\t\\t\\t\\tfalse !== strpos( strtolower( (string) ( $item['content'] ?? '' ) ), $search );\n\\t\\t\\t\\t\\t}\n\\t\\t\\t\\t)\n\\t\\t\\t);\n\\t\\t}\n\n\\t\\t$total = count( $items );\n\\t\\t$items = array_slice( $items, ( $page - 1 ) * $per_page, $per_page );\n\n\\t\\treturn rest_ensure_response(\n\\t\\t\\tarray(\n\\t\\t\\t\\t'items' => $items,\n\\t\\t\\t\\t'page' => $page,\n\\t\\t\\t\\t'perPage' => $per_page,\n\\t\\t\\t\\t'total' => $total,\n\\t\\t\\t)\n\\t\\t);\n\\t}\n}\n\nif ( ! function_exists( '${readHandlerName}' ) ) {\n\\tfunction ${readHandlerName}( WP_REST_Request $request ) {\n\\t\\t$payload = ${validatePayloadFunctionName}(\n\\t\\t\\tarray(\n\\t\\t\\t\\t'id' => $request->get_param( 'id' ),\n\\t\\t\\t),\n\\t\\t\\t'read-query',\n\\t\\t\\t'query'\n\\t\\t);\n\n\\t\\tif ( is_wp_error( $payload ) ) {\n\\t\\t\\treturn $payload;\n\\t\\t}\n\n\\t\\tforeach ( ${getItemsFunctionName}() as $item ) {\n\\t\\t\\tif ( (int) $item['id'] === (int) $payload['id'] ) {\n\\t\\t\\t\\treturn rest_ensure_response( $item );\n\\t\\t\\t}\n\\t\\t}\n\n\\t\\treturn new WP_Error( 'rest_not_found', 'Resource not found.', array( 'status' => 404 ) );\n\\t}\n}\n\nif ( ! function_exists( '${createHandlerName}' ) ) {\n\\tfunction ${createHandlerName}( WP_REST_Request $request ) {\n\\t\\t$payload = ${validatePayloadFunctionName}( $request->get_json_params(), 'create-request', 'body' );\n\\t\\tif ( is_wp_error( $payload ) ) {\n\\t\\t\\treturn $payload;\n\\t\\t}\n\n\\t\\t$items = ${getItemsFunctionName}();\n\\t\\t$next_id = 1;\n\\t\\tforeach ( $items as $item ) {\n\\t\\t\\t$next_id = max( $next_id, (int) $item['id'] + 1 );\n\\t\\t}\n\n\\t\\t$record = ${normalizeItemFunctionName}(\n\\t\\t\\tarray(\n\\t\\t\\t\\t'id' => $next_id,\n\\t\\t\\t\\t'title' => (string) $payload['title'],\n\\t\\t\\t\\t'content' => isset( $payload['content'] ) ? (string) $payload['content'] : '',\n\\t\\t\\t\\t'status' => isset( $payload['status'] ) ? (string) $payload['status'] : 'draft',\n\\t\\t\\t\\t'updatedAt' => gmdate( 'c' ),\n\\t\\t\\t)\n\\t\\t);\n\n\\t\\t$items[] = $record;\n\\t\\t${saveItemsFunctionName}( $items );\n\n\\t\\treturn rest_ensure_response( $record );\n\\t}\n}\n\nif ( ! function_exists( '${updateHandlerName}' ) ) {\n\\tfunction ${updateHandlerName}( WP_REST_Request $request ) {\n\\t\\t$query = ${validatePayloadFunctionName}(\n\\t\\t\\tarray(\n\\t\\t\\t\\t'id' => $request->get_param( 'id' ),\n\\t\\t\\t),\n\\t\\t\\t'update-query',\n\\t\\t\\t'query'\n\\t\\t);\n\\t\\tif ( is_wp_error( $query ) ) {\n\\t\\t\\treturn $query;\n\\t\\t}\n\n\\t\\t$payload = ${validatePayloadFunctionName}( $request->get_json_params(), 'update-request', 'body' );\n\\t\\tif ( is_wp_error( $payload ) ) {\n\\t\\t\\treturn $payload;\n\\t\\t}\n\n\\t\\t$items = ${getItemsFunctionName}();\n\\t\\tforeach ( $items as $index => $item ) {\n\\t\\t\\tif ( (int) $item['id'] !== (int) $query['id'] ) {\n\\t\\t\\t\\tcontinue;\n\\t\\t\\t}\n\n\\t\\t\\t$items[ $index ] = ${normalizeItemFunctionName}(\n\\t\\t\\t\\tarray(\n\\t\\t\\t\\t\\t'id' => $item['id'],\n\\t\\t\\t\\t\\t'title' => isset( $payload['title'] ) ? (string) $payload['title'] : (string) $item['title'],\n\\t\\t\\t\\t\\t'content' => array_key_exists( 'content', $payload ) ? (string) $payload['content'] : (string) $item['content'],\n\\t\\t\\t\\t\\t'status' => isset( $payload['status'] ) ? (string) $payload['status'] : (string) $item['status'],\n\\t\\t\\t\\t\\t'updatedAt' => gmdate( 'c' ),\n\\t\\t\\t\\t)\n\\t\\t\\t);\n\n\\t\\t\\t${saveItemsFunctionName}( $items );\n\\t\\t\\treturn rest_ensure_response( $items[ $index ] );\n\\t\\t}\n\n\\t\\treturn new WP_Error( 'rest_not_found', 'Resource not found.', array( 'status' => 404 ) );\n\\t}\n}\n\nif ( ! function_exists( '${deleteHandlerName}' ) ) {\n\\tfunction ${deleteHandlerName}( WP_REST_Request $request ) {\n\\t\\t$query = ${validatePayloadFunctionName}(\n\\t\\t\\tarray(\n\\t\\t\\t\\t'id' => $request->get_param( 'id' ),\n\\t\\t\\t),\n\\t\\t\\t'delete-query',\n\\t\\t\\t'query'\n\\t\\t);\n\\t\\tif ( is_wp_error( $query ) ) {\n\\t\\t\\treturn $query;\n\\t\\t}\n\n\\t\\t$items = ${getItemsFunctionName}();\n\\t\\t$filtered = array_values(\n\\t\\t\\tarray_filter(\n\\t\\t\\t\\t$items,\n\\t\\t\\t\\tstatic function ( $item ) use ( $query ) {\n\\t\\t\\t\\t\\treturn (int) $item['id'] !== (int) $query['id'];\n\\t\\t\\t\\t}\n\\t\\t\\t)\n\\t\\t);\n\\t\\t$was_deleted = count( $filtered ) !== count( $items );\n\n\\t\\tif ( ! $was_deleted ) {\n\\t\\t\\treturn new WP_Error( 'rest_not_found', 'Resource not found.', array( 'status' => 404 ) );\n\\t\\t}\n\n\\t\\t${saveItemsFunctionName}( $filtered );\n\n\\t\\treturn rest_ensure_response(\n\\t\\t\\tarray(\n\\t\\t\\t\\t'deleted' => true,\n\\t\\t\\t\\t'id' => (int) $query['id'],\n\\t\\t\\t)\n\\t\\t);\n\\t}\n}\n\nif ( ! function_exists( '${registerRoutesFunctionName}' ) ) {\n\\tfunction ${registerRoutesFunctionName}() {\n\\t\\t$namespace = ${quotePhpString(namespace)};\n\n${routeRegistrations}\n\\t}\n}\n\nadd_action( 'rest_api_init', '${registerRoutesFunctionName}' );\n`;\n}\n\nasync function ensureRestResourceBootstrapAnchors(workspace: WorkspaceProject): Promise<void> {\n\tconst bootstrapPath = getWorkspaceBootstrapPath(workspace);\n\n\tawait patchFile(bootstrapPath, (source) => {\n\t\tlet nextSource = source;\n\t\tconst registerFunctionName = `${workspace.workspace.phpPrefix}_register_rest_resources`;\n\t\tconst registerHook = `add_action( 'init', '${registerFunctionName}', 20 );`;\n\t\tconst registerFunction = `\n\nfunction ${registerFunctionName}() {\n\\tforeach ( glob( __DIR__ . '${REST_RESOURCE_SERVER_GLOB}' ) ?: array() as $rest_resource_module ) {\n\\t\\trequire_once $rest_resource_module;\n\\t}\n}\n`;\n\t\tconst insertionAnchors = [\n\t\t\t/add_action\\(\\s*[\"']init[\"']\\s*,\\s*[\"'][^\"']+_load_textdomain[\"']\\s*\\);\\s*\\n/u,\n\t\t\t/\\?>\\s*$/u,\n\t\t];\n\t\tconst hasPhpFunctionDefinition = (functionName: string): boolean =>\n\t\t\tnew RegExp(`function\\\\s+${escapeRegex(functionName)}\\\\s*\\\\(`, \"u\").test(nextSource);\n\t\tconst insertPhpSnippet = (snippet: string): void => {\n\t\t\tfor (const anchor of insertionAnchors) {\n\t\t\t\tconst candidate = nextSource.replace(anchor, (match) => `${snippet}\\n${match}`);\n\t\t\t\tif (candidate !== nextSource) {\n\t\t\t\t\tnextSource = candidate;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tnextSource = `${nextSource.trimEnd()}\\n${snippet}\\n`;\n\t\t};\n\t\tconst appendPhpSnippet = (snippet: string): void => {\n\t\t\tconst closingTagPattern = /\\?>\\s*$/u;\n\t\t\tif (closingTagPattern.test(nextSource)) {\n\t\t\t\tnextSource = nextSource.replace(closingTagPattern, `${snippet}\\n?>`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tnextSource = `${nextSource.trimEnd()}\\n${snippet}\\n`;\n\t\t};\n\n\t\tif (!hasPhpFunctionDefinition(registerFunctionName)) {\n\t\t\tinsertPhpSnippet(registerFunction);\n\t\t} else if (!nextSource.includes(REST_RESOURCE_SERVER_GLOB)) {\n\t\t\tthrow new Error(\n\t\t\t\t[\n\t\t\t\t\t`Unable to patch ${path.basename(bootstrapPath)} in ensureRestResourceBootstrapAnchors.`,\n\t\t\t\t\t`The existing ${registerFunctionName}() definition does not include ${REST_RESOURCE_SERVER_GLOB}.`,\n\t\t\t\t\t\"Restore the generated bootstrap shape or wire the REST resource loader manually before retrying.\",\n\t\t\t\t].join(\" \"),\n\t\t\t);\n\t\t}\n\n\t\tif (!nextSource.includes(registerHook)) {\n\t\t\tappendPhpSnippet(registerHook);\n\t\t}\n\n\t\treturn nextSource;\n\t});\n}\n\nfunction assertSyncRestAnchor(\n\tnextSource: string,\n\ttarget: string,\n\tanchorDescription: string,\n\thasAnchor: boolean,\n\tsyncRestScriptPath: string,\n): void {\n\tif (!nextSource.includes(target) && !hasAnchor) {\n\t\tthrow new Error(\n\t\t\t[\n\t\t\t\t`ensureRestResourceSyncScriptAnchors could not patch ${path.basename(syncRestScriptPath)}.`,\n\t\t\t\t`Missing expected ${anchorDescription} anchor in scripts/sync-rest-contracts.ts.`,\n\t\t\t\t\"Restore the generated template or add the REST_RESOURCES wiring manually before retrying.\",\n\t\t\t].join(\" \"),\n\t\t);\n\t}\n}\n\nfunction replaceRequiredSyncRestSource(\n\tnextSource: string,\n\ttarget: string,\n\tanchor: string | RegExp,\n\treplacement: string,\n\tanchorDescription: string,\n\tsyncRestScriptPath: string,\n): string {\n\tif (nextSource.includes(target)) {\n\t\treturn nextSource;\n\t}\n\n\tconst hasAnchor =\n\t\ttypeof anchor === \"string\" ? nextSource.includes(anchor) : anchor.test(nextSource);\n\tassertSyncRestAnchor(\n\t\tnextSource,\n\t\ttarget,\n\t\tanchorDescription,\n\t\thasAnchor,\n\t\tsyncRestScriptPath,\n\t);\n\n\treturn nextSource.replace(anchor, replacement);\n}\n\nasync function ensureRestResourceSyncScriptAnchors(workspace: WorkspaceProject): Promise<void> {\n\tconst syncRestScriptPath = path.join(workspace.projectDir, \"scripts\", \"sync-rest-contracts.ts\");\n\n\tawait patchFile(syncRestScriptPath, (source) => {\n\t\tlet nextSource = source;\n\t\tconst importAnchor = \"import { BLOCKS, type WorkspaceBlockConfig } from './block-config';\";\n\t\tconst helperInsertionAnchor = \"async function assertTypeArtifactsCurrent\";\n\t\tconst restBlocksAnchor = \"const restBlocks = BLOCKS.filter( isRestEnabledBlock );\";\n\t\tconst noResourcesPattern = /if \\( restBlocks.length === 0 \\) \\{[\\s\\S]*?\\n\\t\\treturn;\\n\\t\\}/u;\n\t\tconst consoleLogPattern = /\\n\\tconsole\\.log\\(\\n\\t\\toptions\\.check/u;\n\n\t\tnextSource = replaceRequiredSyncRestSource(\n\t\t\tnextSource,\n\t\t\t\"REST_RESOURCES\",\n\t\t\timportAnchor,\n\t\t\t[\n\t\t\t\t\"import {\",\n\t\t\t\t\"\\tBLOCKS,\",\n\t\t\t\t\"\\tREST_RESOURCES,\",\n\t\t\t\t\"\\ttype WorkspaceBlockConfig,\",\n\t\t\t\t\"\\ttype WorkspaceRestResourceConfig,\",\n\t\t\t\t\"} from './block-config';\",\n\t\t\t].join(\"\\n\"),\n\t\t\t\"BLOCKS import\",\n\t\t\tsyncRestScriptPath,\n\t\t);\n\n\t\tnextSource = replaceRequiredSyncRestSource(\n\t\t\tnextSource,\n\t\t\t\"function isWorkspaceRestResource(\",\n\t\t\thelperInsertionAnchor,\n\t\t\t[\n\t\t\t\t\"function isWorkspaceRestResource(\",\n\t\t\t\t\"\\tresource: WorkspaceRestResourceConfig\",\n\t\t\t\t\"): resource is WorkspaceRestResourceConfig & {\",\n\t\t\t\t\"\\tclientFile: string;\",\n\t\t\t\t\"\\topenApiFile: string;\",\n\t\t\t\t\"\\trestManifest: NonNullable< WorkspaceRestResourceConfig[ 'restManifest' ] >;\",\n\t\t\t\t\"\\ttypesFile: string;\",\n\t\t\t\t\"\\tvalidatorsFile: string;\",\n\t\t\t\t\"} {\",\n\t\t\t\t\"\\treturn (\",\n\t\t\t\t\"\\t\\ttypeof resource.clientFile === 'string' &&\",\n\t\t\t\t\"\\t\\ttypeof resource.openApiFile === 'string' &&\",\n\t\t\t\t\"\\t\\ttypeof resource.typesFile === 'string' &&\",\n\t\t\t\t\"\\t\\ttypeof resource.validatorsFile === 'string' &&\",\n\t\t\t\t\"\\t\\ttypeof resource.restManifest === 'object' &&\",\n\t\t\t\t\"\\t\\tresource.restManifest !== null\",\n\t\t\t\t\"\\t);\",\n\t\t\t\t\"}\",\n\t\t\t\t\"\",\n\t\t\t\t\"async function assertTypeArtifactsCurrent\",\n\t\t\t].join(\"\\n\"),\n\t\t\t\"type artifact assertion helper\",\n\t\t\tsyncRestScriptPath,\n\t\t);\n\n\t\tnextSource = replaceRequiredSyncRestSource(\n\t\t\tnextSource,\n\t\t\t\"const restResources = REST_RESOURCES.filter( isWorkspaceRestResource );\",\n\t\t\trestBlocksAnchor,\n\t\t\t[\n\t\t\t\t\"const restBlocks = BLOCKS.filter( isRestEnabledBlock );\",\n\t\t\t\t\"const restResources = REST_RESOURCES.filter( isWorkspaceRestResource );\",\n\t\t\t].join(\"\\n\"),\n\t\t\t\"restBlocks filter\",\n\t\t\tsyncRestScriptPath,\n\t\t);\n\n\t\tnextSource = replaceRequiredSyncRestSource(\n\t\t\tnextSource,\n\t\t\t\"restBlocks.length === 0 && restResources.length === 0\",\n\t\t\tnoResourcesPattern,\n\t\t\t[\n\t\t\t\t\"if ( restBlocks.length === 0 && restResources.length === 0 ) {\",\n\t\t\t\t\"\\t\\tconsole.log(\",\n\t\t\t\t\"\\t\\t\\toptions.check\",\n\t\t\t\t\"\\t\\t\\t\\t? 'ℹ️ No REST-enabled workspace blocks or plugin-level REST resources are registered yet. `sync-rest --check` is already clean.'\",\n\t\t\t\t\"\\t\\t\\t\\t: 'ℹ️ No REST-enabled workspace blocks or plugin-level REST resources are registered yet.'\",\n\t\t\t\t\"\\t\\t);\",\n\t\t\t\t\"\\t\\treturn;\",\n\t\t\t\t\"\\t}\",\n\t\t\t].join(\"\\n\"),\n\t\t\t\"no-resources guard\",\n\t\t\tsyncRestScriptPath,\n\t\t);\n\n\t\tnextSource = replaceRequiredSyncRestSource(\n\t\t\tnextSource,\n\t\t\t\"for ( const resource of restResources ) {\",\n\t\t\tconsoleLogPattern,\n\t\t\t[\n\t\t\t\t\"\",\n\t\t\t\t\"\\tfor ( const resource of restResources ) {\",\n\t\t\t\t\"\\t\\tconst contracts = resource.restManifest.contracts;\",\n\t\t\t\t\"\",\n\t\t\t\t\"\\t\\tfor ( const [ baseName, contract ] of Object.entries( contracts ) ) {\",\n\t\t\t\t\"\\t\\t\\tawait syncTypeSchemas(\",\n\t\t\t\t\"\\t\\t\\t\\t{\",\n\t\t\t\t\"\\t\\t\\t\\t\\tjsonSchemaFile: path.join(\",\n\t\t\t\t\"\\t\\t\\t\\t\\t\\tpath.dirname( resource.typesFile ),\",\n\t\t\t\t\"\\t\\t\\t\\t\\t\\t'api-schemas',\",\n\t\t\t\t\"\\t\\t\\t\\t\\t\\t`${ baseName }.schema.json`\",\n\t\t\t\t\"\\t\\t\\t\\t\\t),\",\n\t\t\t\t\"\\t\\t\\t\\t\\topenApiFile: path.join(\",\n\t\t\t\t\"\\t\\t\\t\\t\\t\\tpath.dirname( resource.typesFile ),\",\n\t\t\t\t\"\\t\\t\\t\\t\\t\\t'api-schemas',\",\n\t\t\t\t\"\\t\\t\\t\\t\\t\\t`${ baseName }.openapi.json`\",\n\t\t\t\t\"\\t\\t\\t\\t\\t),\",\n\t\t\t\t\"\\t\\t\\t\\t\\tsourceTypeName: contract.sourceTypeName,\",\n\t\t\t\t\"\\t\\t\\t\\t\\ttypesFile: resource.typesFile,\",\n\t\t\t\t\"\\t\\t\\t\\t},\",\n\t\t\t\t\"\\t\\t\\t\\t{\",\n\t\t\t\t\"\\t\\t\\t\\t\\tcheck: options.check,\",\n\t\t\t\t\"\\t\\t\\t\\t}\",\n\t\t\t\t\"\\t\\t\\t);\",\n\t\t\t\t\"\\t\\t}\",\n\t\t\t\t\"\",\n\t\t\t\t\"\\t\\tawait syncRestOpenApi(\",\n\t\t\t\t\"\\t\\t\\t{\",\n\t\t\t\t\"\\t\\t\\t\\tmanifest: resource.restManifest,\",\n\t\t\t\t\"\\t\\t\\t\\topenApiFile: resource.openApiFile,\",\n\t\t\t\t\"\\t\\t\\t\\ttypesFile: resource.typesFile,\",\n\t\t\t\t\"\\t\\t\\t},\",\n\t\t\t\t\"\\t\\t\\t{\",\n\t\t\t\t\"\\t\\t\\t\\tcheck: options.check,\",\n\t\t\t\t\"\\t\\t\\t}\",\n\t\t\t\t\"\\t\\t);\",\n\t\t\t\t\"\",\n\t\t\t\t\"\\t\\tawait syncEndpointClient(\",\n\t\t\t\t\"\\t\\t\\t{\",\n\t\t\t\t\"\\t\\t\\t\\tclientFile: resource.clientFile,\",\n\t\t\t\t\"\\t\\t\\t\\tmanifest: resource.restManifest,\",\n\t\t\t\t\"\\t\\t\\t\\ttypesFile: resource.typesFile,\",\n\t\t\t\t\"\\t\\t\\t\\tvalidatorsFile: resource.validatorsFile,\",\n\t\t\t\t\"\\t\\t\\t},\",\n\t\t\t\t\"\\t\\t\\t{\",\n\t\t\t\t\"\\t\\t\\t\\tcheck: options.check,\",\n\t\t\t\t\"\\t\\t\\t}\",\n\t\t\t\t\"\\t\\t);\",\n\t\t\t\t\"\\t}\",\n\t\t\t\t\"\",\n\t\t\t\t\"\\tconsole.log(\",\n\t\t\t\t\"\\t\\toptions.check\",\n\t\t\t].join(\"\\n\"),\n\t\t\t\"success log insertion point\",\n\t\t\tsyncRestScriptPath,\n\t\t);\n\n\t\tnextSource = nextSource.replace(\n\t\t\t\"✅ REST contract schemas, portable API clients, and endpoint-aware OpenAPI documents are already up to date with the TypeScript types!\",\n\t\t\t\"✅ REST contract schemas, portable API clients, and endpoint-aware OpenAPI documents are already up to date for workspace blocks and plugin-level resources!\",\n\t\t);\n\t\tnextSource = nextSource.replace(\n\t\t\t\"✅ REST contract schemas, portable API clients, and endpoint-aware OpenAPI documents generated from TypeScript types!\",\n\t\t\t\"✅ REST contract schemas, portable API clients, and endpoint-aware OpenAPI documents generated for workspace blocks and plugin-level resources!\",\n\t\t);\n\n\t\treturn nextSource;\n\t});\n}\n\n/**\n * Scaffold a workspace-level REST resource and synchronize its generated\n * TypeScript and PHP artifacts.\n *\n * @param options Command options for the REST resource scaffold workflow.\n * @returns Resolved scaffold metadata for the created REST resource.\n */\nexport async function runAddRestResourceCommand({\n\tcwd = process.cwd(),\n\tmethods,\n\tnamespace,\n\trestResourceName,\n}: RunAddRestResourceCommandOptions): Promise<{\n\tmethods: RestResourceMethodId[];\n\tnamespace: string;\n\tprojectDir: string;\n\trestResourceSlug: string;\n}> {\n\tconst workspace = resolveWorkspaceProject(cwd);\n\tconst restResourceSlug = assertValidGeneratedSlug(\n\t\t\"REST resource name\",\n\t\tnormalizeBlockSlug(restResourceName),\n\t\t\"wp-typia add rest-resource <name> [--namespace <vendor/v1>] [--methods <list,read,create>]\",\n\t);\n\tconst resolvedMethods = assertValidRestResourceMethods(methods);\n\tconst resolvedNamespace = resolveRestResourceNamespace(\n\t\tworkspace.workspace.namespace,\n\t\tnamespace,\n\t);\n\n\tconst inventory = readWorkspaceInventory(workspace.projectDir);\n\tassertRestResourceDoesNotExist(workspace.projectDir, restResourceSlug, inventory);\n\n\tconst blockConfigPath = path.join(workspace.projectDir, \"scripts\", \"block-config.ts\");\n\tconst bootstrapPath = getWorkspaceBootstrapPath(workspace);\n\tconst syncRestScriptPath = path.join(workspace.projectDir, \"scripts\", \"sync-rest-contracts.ts\");\n\tconst restResourceDir = path.join(workspace.projectDir, \"src\", \"rest\", restResourceSlug);\n\tconst typesFilePath = path.join(restResourceDir, \"api-types.ts\");\n\tconst validatorsFilePath = path.join(restResourceDir, \"api-validators.ts\");\n\tconst apiFilePath = path.join(restResourceDir, \"api.ts\");\n\tconst dataFilePath = path.join(restResourceDir, \"data.ts\");\n\tconst clientFilePath = path.join(restResourceDir, \"api-client.ts\");\n\tconst phpFilePath = path.join(workspace.projectDir, \"inc\", \"rest\", `${restResourceSlug}.php`);\n\tconst mutationSnapshot: WorkspaceMutationSnapshot = {\n\t\tfileSources: await snapshotWorkspaceFiles([\n\t\t\tblockConfigPath,\n\t\t\tbootstrapPath,\n\t\t\tsyncRestScriptPath,\n\t\t]),\n\t\tsnapshotDirs: [],\n\t\ttargetPaths: [restResourceDir, phpFilePath],\n\t};\n\n\ttry {\n\t\tawait fsp.mkdir(restResourceDir, { recursive: true });\n\t\tawait fsp.mkdir(path.dirname(phpFilePath), { recursive: true });\n\t\tawait ensureRestResourceBootstrapAnchors(workspace);\n\t\tawait ensureRestResourceSyncScriptAnchors(workspace);\n\t\tawait fsp.writeFile(\n\t\t\ttypesFilePath,\n\t\t\tbuildRestResourceTypesSource(restResourceSlug, resolvedMethods),\n\t\t\t\"utf8\",\n\t\t);\n\t\tawait fsp.writeFile(\n\t\t\tvalidatorsFilePath,\n\t\t\tbuildRestResourceValidatorsSource(restResourceSlug, resolvedMethods),\n\t\t\t\"utf8\",\n\t\t);\n\t\tawait fsp.writeFile(\n\t\t\tapiFilePath,\n\t\t\tbuildRestResourceApiSource(restResourceSlug, resolvedMethods),\n\t\t\t\"utf8\",\n\t\t);\n\t\tawait fsp.writeFile(\n\t\t\tdataFilePath,\n\t\t\tbuildRestResourceDataSource(restResourceSlug, resolvedMethods),\n\t\t\t\"utf8\",\n\t\t);\n\t\tawait fsp.writeFile(\n\t\t\tphpFilePath,\n\t\t\tbuildRestResourcePhpSource(\n\t\t\t\trestResourceSlug,\n\t\t\t\tresolvedNamespace,\n\t\t\t\tworkspace.workspace.phpPrefix,\n\t\t\t\tworkspace.workspace.textDomain,\n\t\t\t\tresolvedMethods,\n\t\t\t),\n\t\t\t\"utf8\",\n\t\t);\n\t\tawait syncRestResourceArtifacts({\n\t\t\tclientFile: `src/rest/${restResourceSlug}/api-client.ts`,\n\t\t\tmethods: resolvedMethods,\n\t\t\toutputDir: restResourceDir,\n\t\t\tprojectDir: workspace.projectDir,\n\t\t\ttypesFile: `src/rest/${restResourceSlug}/api-types.ts`,\n\t\t\tvalidatorsFile: `src/rest/${restResourceSlug}/api-validators.ts`,\n\t\t\tvariables: {\n\t\t\t\tnamespace: resolvedNamespace,\n\t\t\t\tpascalCase: toPascalCaseFromSlug(restResourceSlug),\n\t\t\t\tslugKebabCase: restResourceSlug,\n\t\t\t\ttitle: toTitleCase(restResourceSlug),\n\t\t\t},\n\t\t});\n\t\tawait appendWorkspaceInventoryEntries(workspace.projectDir, {\n\t\t\trestResourceEntries: [\n\t\t\t\tbuildRestResourceConfigEntry(\n\t\t\t\t\trestResourceSlug,\n\t\t\t\t\tresolvedNamespace,\n\t\t\t\t\tresolvedMethods,\n\t\t\t\t),\n\t\t\t],\n\t\t\ttransformSource: ensureBlockConfigCanAddRestManifests,\n\t\t});\n\n\t\treturn {\n\t\t\tmethods: resolvedMethods,\n\t\t\tnamespace: resolvedNamespace,\n\t\t\tprojectDir: workspace.projectDir,\n\t\t\trestResourceSlug,\n\t\t};\n\t} catch (error) {\n\t\tawait rollbackWorkspaceMutation(mutationSnapshot);\n\t\tthrow error;\n\t}\n}\n",
11
- "import path from \"node:path\";\n\nimport {\n\tdefineEndpointManifest,\n\tsyncEndpointClient,\n\tsyncRestOpenApi,\n\tsyncTypeSchemas,\n} from \"@wp-typia/block-runtime/metadata-core\";\n\nimport type { RestResourceMethodId } from \"./cli-add-shared.js\";\n\ninterface RestResourceTemplateVariablesLike {\n\tnamespace: string;\n\tpascalCase: string;\n\tslugKebabCase: string;\n\ttitle: string;\n}\n\ninterface SyncRestResourceArtifactsOptions {\n\tclientFile: string;\n\tmethods: RestResourceMethodId[];\n\toutputDir: string;\n\tprojectDir: string;\n\ttypesFile: string;\n\tvalidatorsFile: string;\n\tvariables: RestResourceTemplateVariablesLike;\n}\n\ntype RestResourceEndpointDefinition = Parameters<\n\ttypeof defineEndpointManifest\n>[0][\"endpoints\"][number];\n\n/**\n * Build the endpoint manifest for a workspace-level REST resource scaffold.\n *\n * @param variables Template naming data used for contract names, routes, and OpenAPI info.\n * @param methods Enabled REST methods for the generated resource.\n * @returns Endpoint manifest consumed by schema, OpenAPI, and client generators.\n */\nexport function buildRestResourceEndpointManifest(\n\tvariables: RestResourceTemplateVariablesLike,\n\tmethods: RestResourceMethodId[],\n) {\n\tconst basePath = `/${variables.namespace}/${variables.slugKebabCase}`;\n\tconst itemPath = `${basePath}/item`;\n\tconst contracts: Record<string, { sourceTypeName: string }> = {};\n\tconst endpoints: RestResourceEndpointDefinition[] = [];\n\n\tif (methods.includes(\"list\")) {\n\t\tcontracts[\"list-query\"] = {\n\t\t\tsourceTypeName: `${variables.pascalCase}ListQuery`,\n\t\t};\n\t\tcontracts[\"list-response\"] = {\n\t\t\tsourceTypeName: `${variables.pascalCase}ListResponse`,\n\t\t};\n\t\tendpoints.push({\n\t\t\tauth: \"public\",\n\t\t\tmethod: \"GET\",\n\t\t\toperationId: `list${variables.pascalCase}Resources`,\n\t\t\tpath: basePath,\n\t\t\tqueryContract: \"list-query\",\n\t\t\tresponseContract: \"list-response\",\n\t\t\tsummary: `List ${variables.title} resources.`,\n\t\t\ttags: [variables.title],\n\t\t});\n\t}\n\n\tif (methods.includes(\"read\")) {\n\t\tcontracts[\"read-query\"] = {\n\t\t\tsourceTypeName: `${variables.pascalCase}ReadQuery`,\n\t\t};\n\t\tcontracts[\"read-response\"] = {\n\t\t\tsourceTypeName: `${variables.pascalCase}ReadResponse`,\n\t\t};\n\t\tendpoints.push({\n\t\t\tauth: \"public\",\n\t\t\tmethod: \"GET\",\n\t\t\toperationId: `read${variables.pascalCase}Resource`,\n\t\t\tpath: itemPath,\n\t\t\tqueryContract: \"read-query\",\n\t\t\tresponseContract: \"read-response\",\n\t\t\tsummary: `Read one ${variables.title} resource.`,\n\t\t\ttags: [variables.title],\n\t\t});\n\t}\n\n\tif (methods.includes(\"create\")) {\n\t\tcontracts[\"create-request\"] = {\n\t\t\tsourceTypeName: `${variables.pascalCase}CreateRequest`,\n\t\t};\n\t\tcontracts[\"create-response\"] = {\n\t\t\tsourceTypeName: `${variables.pascalCase}CreateResponse`,\n\t\t};\n\t\tendpoints.push({\n\t\t\tauth: \"authenticated\",\n\t\t\tbodyContract: \"create-request\",\n\t\t\tmethod: \"POST\",\n\t\t\toperationId: `create${variables.pascalCase}Resource`,\n\t\t\tpath: basePath,\n\t\t\tresponseContract: \"create-response\",\n\t\t\tsummary: `Create one ${variables.title} resource.`,\n\t\t\ttags: [variables.title],\n\t\t\twordpressAuth: {\n\t\t\t\tmechanism: \"rest-nonce\",\n\t\t\t},\n\t\t});\n\t}\n\n\tif (methods.includes(\"update\")) {\n\t\tcontracts[\"update-query\"] = {\n\t\t\tsourceTypeName: `${variables.pascalCase}UpdateQuery`,\n\t\t};\n\t\tcontracts[\"update-request\"] = {\n\t\t\tsourceTypeName: `${variables.pascalCase}UpdateRequest`,\n\t\t};\n\t\tcontracts[\"update-response\"] = {\n\t\t\tsourceTypeName: `${variables.pascalCase}UpdateResponse`,\n\t\t};\n\t\tendpoints.push({\n\t\t\tauth: \"authenticated\",\n\t\t\tbodyContract: \"update-request\",\n\t\t\tmethod: \"POST\",\n\t\t\toperationId: `update${variables.pascalCase}Resource`,\n\t\t\tpath: itemPath,\n\t\t\tqueryContract: \"update-query\",\n\t\t\tresponseContract: \"update-response\",\n\t\t\tsummary: `Update one ${variables.title} resource.`,\n\t\t\ttags: [variables.title],\n\t\t\twordpressAuth: {\n\t\t\t\tmechanism: \"rest-nonce\",\n\t\t\t},\n\t\t});\n\t}\n\n\tif (methods.includes(\"delete\")) {\n\t\tcontracts[\"delete-query\"] = {\n\t\t\tsourceTypeName: `${variables.pascalCase}DeleteQuery`,\n\t\t};\n\t\tcontracts[\"delete-response\"] = {\n\t\t\tsourceTypeName: `${variables.pascalCase}DeleteResponse`,\n\t\t};\n\t\tendpoints.push({\n\t\t\tauth: \"authenticated\",\n\t\t\tmethod: \"DELETE\",\n\t\t\toperationId: `delete${variables.pascalCase}Resource`,\n\t\t\tpath: itemPath,\n\t\t\tqueryContract: \"delete-query\",\n\t\t\tresponseContract: \"delete-response\",\n\t\t\tsummary: `Delete one ${variables.title} resource.`,\n\t\t\ttags: [variables.title],\n\t\t\twordpressAuth: {\n\t\t\t\tmechanism: \"rest-nonce\",\n\t\t\t},\n\t\t});\n\t}\n\n\treturn defineEndpointManifest({\n\t\tcontracts,\n\t\tendpoints,\n\t\tinfo: {\n\t\t\ttitle: `${variables.title} REST API`,\n\t\t\tversion: \"1.0.0\",\n\t\t},\n\t});\n}\n\n/**\n * Synchronize generated schemas, OpenAPI output, and endpoint client code for\n * a workspace-level REST resource scaffold.\n *\n * @param options Resource file paths, enabled methods, and naming variables.\n * @returns A promise that resolves after every generated REST artifact has been refreshed.\n */\nexport async function syncRestResourceArtifacts({\n\tclientFile,\n\tmethods,\n\toutputDir,\n\tprojectDir,\n\ttypesFile,\n\tvalidatorsFile,\n\tvariables,\n}: SyncRestResourceArtifactsOptions): Promise<void> {\n\tconst manifest = buildRestResourceEndpointManifest(variables, methods);\n\n\tfor (const [baseName, contract] of Object.entries(manifest.contracts) as Array<\n\t\t[string, { sourceTypeName: string }]\n\t>) {\n\t\tawait syncTypeSchemas(\n\t\t\t{\n\t\t\t\tjsonSchemaFile: path.join(outputDir, \"api-schemas\", `${baseName}.schema.json`),\n\t\t\t\topenApiFile: path.join(outputDir, \"api-schemas\", `${baseName}.openapi.json`),\n\t\t\t\tprojectRoot: projectDir,\n\t\t\t\tsourceTypeName: contract.sourceTypeName,\n\t\t\t\ttypesFile,\n\t\t\t},\n\t\t);\n\t}\n\n\tawait syncRestOpenApi(\n\t\t{\n\t\t\tmanifest,\n\t\t\topenApiFile: path.join(outputDir, \"api.openapi.json\"),\n\t\t\tprojectRoot: projectDir,\n\t\t\ttypesFile,\n\t\t},\n\t);\n\n\tawait syncEndpointClient(\n\t\t{\n\t\t\tclientFile,\n\t\t\tmanifest,\n\t\t\tprojectRoot: projectDir,\n\t\t\ttypesFile,\n\t\t\tvalidatorsFile,\n\t\t},\n\t);\n}\n"
10
+ "import { promises as fsp } from \"node:fs\";\nimport path from \"node:path\";\n\nimport { ensureBlockConfigCanAddRestManifests } from \"./cli-add-block-legacy-validator.js\";\nimport {\n\tassertRestResourceDoesNotExist,\n\tassertValidGeneratedSlug,\n\tassertValidRestResourceMethods,\n\tgetWorkspaceBootstrapPath,\n\tnormalizeBlockSlug,\n\tresolveRestResourceNamespace,\n\trollbackWorkspaceMutation,\n\ttype RestResourceMethodId,\n\ttype RunAddRestResourceCommandOptions,\n\ttype WorkspaceMutationSnapshot,\n\tsnapshotWorkspaceFiles,\n} from \"./cli-add-shared.js\";\nimport {\n\tensureRestResourceBootstrapAnchors,\n\tensureRestResourceSyncScriptAnchors,\n} from \"./cli-add-workspace-rest-anchors.js\";\nimport {\n\tbuildRestResourceApiSource,\n\tbuildRestResourceConfigEntry,\n\tbuildRestResourceDataSource,\n\tbuildRestResourceTypesSource,\n\tbuildRestResourceValidatorsSource,\n\ttoPascalCaseFromSlug,\n} from \"./cli-add-workspace-rest-source-emitters.js\";\nimport { syncRestResourceArtifacts } from \"./rest-resource-artifacts.js\";\nimport { toTitleCase } from \"./string-case.js\";\nimport {\n\tappendWorkspaceInventoryEntries,\n\treadWorkspaceInventory,\n} from \"./workspace-inventory.js\";\nimport { resolveWorkspaceProject } from \"./workspace-project.js\";\n\nfunction quotePhpString(value: string): string {\n\treturn `'${value.replace(/\\\\/gu, \"\\\\\\\\\").replace(/'/gu, \"\\\\'\")}'`;\n}\n\nfunction buildRestResourceRouteRegistrations(\n\trestResourceSlug: string,\n\tmethods: RestResourceMethodId[],\n\tfunctions: {\n\t\tcanWriteFunctionName: string;\n\t\tcreateHandlerName: string;\n\t\tdeleteHandlerName: string;\n\t\tlistHandlerName: string;\n\t\treadHandlerName: string;\n\t\tupdateHandlerName: string;\n\t},\n): string {\n\tconst collectionRoutes: string[] = [];\n\tconst itemRoutes: string[] = [];\n\n\tif (methods.includes(\"list\")) {\n\t\tcollectionRoutes.push(`\\t\\tarray(\n\\t\\t\\t'methods' => WP_REST_Server::READABLE,\n\\t\\t\\t'callback' => '${functions.listHandlerName}',\n\\t\\t\\t'permission_callback' => '__return_true',\n\\t\\t)`);\n\t}\n\tif (methods.includes(\"create\")) {\n\t\tcollectionRoutes.push(`\\t\\tarray(\n\\t\\t\\t'methods' => WP_REST_Server::CREATABLE,\n\\t\\t\\t'callback' => '${functions.createHandlerName}',\n\\t\\t\\t'permission_callback' => '${functions.canWriteFunctionName}',\n\\t\\t)`);\n\t}\n\tif (methods.includes(\"read\")) {\n\t\titemRoutes.push(`\\t\\tarray(\n\\t\\t\\t'methods' => WP_REST_Server::READABLE,\n\\t\\t\\t'callback' => '${functions.readHandlerName}',\n\\t\\t\\t'permission_callback' => '__return_true',\n\\t\\t)`);\n\t}\n\tif (methods.includes(\"update\")) {\n\t\titemRoutes.push(`\\t\\tarray(\n\\t\\t\\t'methods' => WP_REST_Server::EDITABLE,\n\\t\\t\\t'callback' => '${functions.updateHandlerName}',\n\\t\\t\\t'permission_callback' => '${functions.canWriteFunctionName}',\n\\t\\t)`);\n\t}\n\tif (methods.includes(\"delete\")) {\n\t\titemRoutes.push(`\\t\\tarray(\n\\t\\t\\t'methods' => WP_REST_Server::DELETABLE,\n\\t\\t\\t'callback' => '${functions.deleteHandlerName}',\n\\t\\t\\t'permission_callback' => '${functions.canWriteFunctionName}',\n\\t\\t)`);\n\t}\n\n\tconst registrations: string[] = [];\n\tif (collectionRoutes.length > 0) {\n\t\tregistrations.push(`\\tregister_rest_route(\n\\t\\t$namespace,\n\\t\\t'/${restResourceSlug}',\n\\t\\tarray(\n${collectionRoutes.join(\",\\n\")}\n\\t\\t)\n\\t);`);\n\t}\n\tif (itemRoutes.length > 0) {\n\t\tregistrations.push(`\\tregister_rest_route(\n\\t\\t$namespace,\n\\t\\t'/${restResourceSlug}/item',\n\\t\\tarray(\n${itemRoutes.join(\",\\n\")}\n\\t\\t)\n\\t);`);\n\t}\n\n\treturn registrations.join(\"\\n\\n\");\n}\n\nfunction buildRestResourcePhpSource(\n\trestResourceSlug: string,\n\tnamespace: string,\n\tphpPrefix: string,\n\ttextDomain: string,\n\tmethods: RestResourceMethodId[],\n): string {\n\tconst restResourceTitle = toTitleCase(restResourceSlug);\n\tconst restResourcePhpId = restResourceSlug.replace(/-/g, \"_\");\n\tconst canWriteFunctionName = `${phpPrefix}_${restResourcePhpId}_can_manage_rest_resource`;\n\tconst getItemsFunctionName = `${phpPrefix}_${restResourcePhpId}_get_rest_resource_items`;\n\tconst loadSchemaFunctionName = `${phpPrefix}_${restResourcePhpId}_load_rest_resource_schema`;\n\tconst normalizeSchemaFunctionName = `${phpPrefix}_${restResourcePhpId}_sanitize_rest_resource_schema`;\n\tconst validatePayloadFunctionName = `${phpPrefix}_${restResourcePhpId}_validate_rest_resource_payload`;\n\tconst normalizeItemFunctionName = `${phpPrefix}_${restResourcePhpId}_normalize_rest_resource_item`;\n\tconst saveItemsFunctionName = `${phpPrefix}_${restResourcePhpId}_save_rest_resource_items`;\n\tconst getOptionNameFunctionName = `${phpPrefix}_${restResourcePhpId}_get_rest_resource_option_name`;\n\tconst listHandlerName = `${phpPrefix}_${restResourcePhpId}_handle_list_rest_resource`;\n\tconst readHandlerName = `${phpPrefix}_${restResourcePhpId}_handle_read_rest_resource`;\n\tconst createHandlerName = `${phpPrefix}_${restResourcePhpId}_handle_create_rest_resource`;\n\tconst updateHandlerName = `${phpPrefix}_${restResourcePhpId}_handle_update_rest_resource`;\n\tconst deleteHandlerName = `${phpPrefix}_${restResourcePhpId}_handle_delete_rest_resource`;\n\tconst registerRoutesFunctionName = `${phpPrefix}_${restResourcePhpId}_register_rest_routes`;\n\tconst routeRegistrations = buildRestResourceRouteRegistrations(restResourceSlug, methods, {\n\t\tcanWriteFunctionName,\n\t\tcreateHandlerName,\n\t\tdeleteHandlerName,\n\t\tlistHandlerName,\n\t\treadHandlerName,\n\t\tupdateHandlerName,\n\t});\n\n\treturn `<?php\nif ( ! defined( 'ABSPATH' ) ) {\n\\treturn;\n}\n\nif ( ! function_exists( '${getOptionNameFunctionName}' ) ) {\n\\tfunction ${getOptionNameFunctionName}() {\n\\t\\treturn ${quotePhpString(`${phpPrefix}_${restResourcePhpId}_rest_resource_items`)};\n\\t}\n}\n\nif ( ! function_exists( '${normalizeItemFunctionName}' ) ) {\n\\tfunction ${normalizeItemFunctionName}( array $item ) {\n\\t\\treturn array(\n\\t\\t\\t'id' => isset( $item['id'] ) ? (int) $item['id'] : 0,\n\\t\\t\\t'title' => isset( $item['title'] ) ? (string) $item['title'] : '',\n\\t\\t\\t'content' => isset( $item['content'] ) ? (string) $item['content'] : '',\n\\t\\t\\t'status' => isset( $item['status'] ) && 'published' === $item['status'] ? 'published' : 'draft',\n\\t\\t\\t'updatedAt' => isset( $item['updatedAt'] ) ? (string) $item['updatedAt'] : gmdate( 'c' ),\n\\t\\t);\n\\t}\n}\n\nif ( ! function_exists( '${getItemsFunctionName}' ) ) {\n\\tfunction ${getItemsFunctionName}() {\n\\t\\t$seed_items = array(\n\\t\\t\\tarray(\n\\t\\t\\t\\t'id' => 1,\n\\t\\t\\t\\t'title' => ${quotePhpString(`${restResourceTitle} Starter`)},\n\\t\\t\\t\\t'content' => ${quotePhpString(`Replace this seeded ${restResourceTitle.toLowerCase()} content with your plugin data source.`)},\n\\t\\t\\t\\t'status' => 'draft',\n\\t\\t\\t\\t'updatedAt' => '2026-01-01T00:00:00Z',\n\\t\\t\\t),\n\\t\\t);\n\\t\\t$items = get_option( ${getOptionNameFunctionName}(), $seed_items );\n\n\\t\\tif ( ! is_array( $items ) ) {\n\\t\\t\\t$items = $seed_items;\n\\t\\t}\n\n\\t\\treturn array_values(\n\\t\\t\\tarray_map(\n\\t\\t\\t\\t'${normalizeItemFunctionName}',\n\\t\\t\\t\\tarray_filter(\n\\t\\t\\t\\t\\t$items,\n\\t\\t\\t\\t\\t'is_array'\n\\t\\t\\t\\t)\n\\t\\t\\t)\n\\t\\t);\n\\t}\n}\n\nif ( ! function_exists( '${saveItemsFunctionName}' ) ) {\n\\tfunction ${saveItemsFunctionName}( array $items ) {\n\\t\\tupdate_option(\n\\t\\t\\t${getOptionNameFunctionName}(),\n\\t\\t\\tarray_values(\n\\t\\t\\t\\tarray_map(\n\\t\\t\\t\\t\\t'${normalizeItemFunctionName}',\n\\t\\t\\t\\t\\t$items\n\\t\\t\\t\\t)\n\\t\\t\\t),\n\\t\\t\\tfalse\n\\t\\t);\n\\t}\n}\n\nif ( ! function_exists( '${loadSchemaFunctionName}' ) ) {\n\\tfunction ${loadSchemaFunctionName}( $schema_name ) {\n\\t\\t$project_root = dirname( __DIR__, 2 );\n\\t\\t$schema_path = $project_root . '/src/rest/${restResourceSlug}/api-schemas/' . $schema_name . '.schema.json';\n\\t\\tif ( ! file_exists( $schema_path ) ) {\n\\t\\t\\treturn null;\n\\t\\t}\n\n\\t\\t$decoded = json_decode( file_get_contents( $schema_path ), true );\n\\t\\treturn is_array( $decoded ) ? $decoded : null;\n\\t}\n}\n\nif ( ! function_exists( '${normalizeSchemaFunctionName}' ) ) {\n\\tfunction ${normalizeSchemaFunctionName}( $schema ) {\n\\t\\tif ( ! is_array( $schema ) ) {\n\\t\\t\\treturn $schema;\n\\t\\t}\n\n\\t\\tunset( $schema['$schema'], $schema['title'] );\n\n\\t\\tif ( isset( $schema['properties'] ) && is_array( $schema['properties'] ) ) {\n\\t\\t\\tforeach ( $schema['properties'] as $key => $property_schema ) {\n\\t\\t\\t\\t$schema['properties'][ $key ] = ${normalizeSchemaFunctionName}( $property_schema );\n\\t\\t\\t}\n\\t\\t}\n\n\\t\\tif ( isset( $schema['items'] ) && is_array( $schema['items'] ) ) {\n\\t\\t\\t$schema['items'] = ${normalizeSchemaFunctionName}( $schema['items'] );\n\\t\\t}\n\n\\t\\treturn $schema;\n\\t}\n}\n\nif ( ! function_exists( '${validatePayloadFunctionName}' ) ) {\n\\tfunction ${validatePayloadFunctionName}( $value, $schema_name, $param_name ) {\n\\t\\t$schema = ${loadSchemaFunctionName}( $schema_name );\n\\t\\tif ( ! is_array( $schema ) ) {\n\\t\\t\\treturn new WP_Error( 'missing_schema', 'Missing REST schema.', array( 'status' => 500 ) );\n\\t\\t}\n\n\\t\\t$rest_schema = ${normalizeSchemaFunctionName}( $schema );\n\\t\\t$validation = rest_validate_value_from_schema( $value, $rest_schema, $param_name );\n\\t\\tif ( is_wp_error( $validation ) ) {\n\\t\\t\\treturn $validation;\n\\t\\t}\n\n\\t\\treturn rest_sanitize_value_from_schema( $value, $rest_schema, $param_name );\n\\t}\n}\n\nif ( ! function_exists( '${canWriteFunctionName}' ) ) {\n\\tfunction ${canWriteFunctionName}() {\n\\t\\treturn current_user_can( 'edit_posts' );\n\\t}\n}\n\nif ( ! function_exists( '${listHandlerName}' ) ) {\n\\tfunction ${listHandlerName}( WP_REST_Request $request ) {\n\\t\\t$payload_input = array();\n\\t\\t$page = $request->get_param( 'page' );\n\\t\\t$per_page = $request->get_param( 'perPage' );\n\\t\\t$search = $request->get_param( 'search' );\n\n\\t\\tif ( null !== $page ) {\n\\t\\t\\t$payload_input['page'] = $page;\n\\t\\t}\n\\t\\tif ( null !== $per_page ) {\n\\t\\t\\t$payload_input['perPage'] = $per_page;\n\\t\\t}\n\\t\\tif ( null !== $search ) {\n\\t\\t\\t$payload_input['search'] = $search;\n\\t\\t}\n\n\\t\\t$payload = ${validatePayloadFunctionName}(\n\\t\\t\\t$payload_input,\n\\t\\t\\t'list-query',\n\\t\\t\\t'query'\n\\t\\t);\n\n\\t\\tif ( is_wp_error( $payload ) ) {\n\\t\\t\\treturn $payload;\n\\t\\t}\n\n\\t\\t$page = isset( $payload['page'] ) ? max( 1, (int) $payload['page'] ) : 1;\n\\t\\t$per_page = isset( $payload['perPage'] ) ? min( 50, max( 1, (int) $payload['perPage'] ) ) : 10;\n\\t\\t$search = isset( $payload['search'] ) ? strtolower( (string) $payload['search'] ) : '';\n\\t\\t$items = ${getItemsFunctionName}();\n\n\\t\\tif ( '' !== $search ) {\n\\t\\t\\t$items = array_values(\n\\t\\t\\t\\tarray_filter(\n\\t\\t\\t\\t\\t$items,\n\\t\\t\\t\\t\\tstatic function ( $item ) use ( $search ) {\n\\t\\t\\t\\t\\t\\treturn false !== strpos( strtolower( (string) ( $item['title'] ?? '' ) ), $search ) ||\n\\t\\t\\t\\t\\t\\t\\tfalse !== strpos( strtolower( (string) ( $item['content'] ?? '' ) ), $search );\n\\t\\t\\t\\t\\t}\n\\t\\t\\t\\t)\n\\t\\t\\t);\n\\t\\t}\n\n\\t\\t$total = count( $items );\n\\t\\t$items = array_slice( $items, ( $page - 1 ) * $per_page, $per_page );\n\n\\t\\treturn rest_ensure_response(\n\\t\\t\\tarray(\n\\t\\t\\t\\t'items' => $items,\n\\t\\t\\t\\t'page' => $page,\n\\t\\t\\t\\t'perPage' => $per_page,\n\\t\\t\\t\\t'total' => $total,\n\\t\\t\\t)\n\\t\\t);\n\\t}\n}\n\nif ( ! function_exists( '${readHandlerName}' ) ) {\n\\tfunction ${readHandlerName}( WP_REST_Request $request ) {\n\\t\\t$payload = ${validatePayloadFunctionName}(\n\\t\\t\\tarray(\n\\t\\t\\t\\t'id' => $request->get_param( 'id' ),\n\\t\\t\\t),\n\\t\\t\\t'read-query',\n\\t\\t\\t'query'\n\\t\\t);\n\n\\t\\tif ( is_wp_error( $payload ) ) {\n\\t\\t\\treturn $payload;\n\\t\\t}\n\n\\t\\tforeach ( ${getItemsFunctionName}() as $item ) {\n\\t\\t\\tif ( (int) $item['id'] === (int) $payload['id'] ) {\n\\t\\t\\t\\treturn rest_ensure_response( $item );\n\\t\\t\\t}\n\\t\\t}\n\n\\t\\treturn new WP_Error( 'rest_not_found', 'Resource not found.', array( 'status' => 404 ) );\n\\t}\n}\n\nif ( ! function_exists( '${createHandlerName}' ) ) {\n\\tfunction ${createHandlerName}( WP_REST_Request $request ) {\n\\t\\t$payload = ${validatePayloadFunctionName}( $request->get_json_params(), 'create-request', 'body' );\n\\t\\tif ( is_wp_error( $payload ) ) {\n\\t\\t\\treturn $payload;\n\\t\\t}\n\n\\t\\t$items = ${getItemsFunctionName}();\n\\t\\t$next_id = 1;\n\\t\\tforeach ( $items as $item ) {\n\\t\\t\\t$next_id = max( $next_id, (int) $item['id'] + 1 );\n\\t\\t}\n\n\\t\\t$record = ${normalizeItemFunctionName}(\n\\t\\t\\tarray(\n\\t\\t\\t\\t'id' => $next_id,\n\\t\\t\\t\\t'title' => (string) $payload['title'],\n\\t\\t\\t\\t'content' => isset( $payload['content'] ) ? (string) $payload['content'] : '',\n\\t\\t\\t\\t'status' => isset( $payload['status'] ) ? (string) $payload['status'] : 'draft',\n\\t\\t\\t\\t'updatedAt' => gmdate( 'c' ),\n\\t\\t\\t)\n\\t\\t);\n\n\\t\\t$items[] = $record;\n\\t\\t${saveItemsFunctionName}( $items );\n\n\\t\\treturn rest_ensure_response( $record );\n\\t}\n}\n\nif ( ! function_exists( '${updateHandlerName}' ) ) {\n\\tfunction ${updateHandlerName}( WP_REST_Request $request ) {\n\\t\\t$query = ${validatePayloadFunctionName}(\n\\t\\t\\tarray(\n\\t\\t\\t\\t'id' => $request->get_param( 'id' ),\n\\t\\t\\t),\n\\t\\t\\t'update-query',\n\\t\\t\\t'query'\n\\t\\t);\n\\t\\tif ( is_wp_error( $query ) ) {\n\\t\\t\\treturn $query;\n\\t\\t}\n\n\\t\\t$payload = ${validatePayloadFunctionName}( $request->get_json_params(), 'update-request', 'body' );\n\\t\\tif ( is_wp_error( $payload ) ) {\n\\t\\t\\treturn $payload;\n\\t\\t}\n\n\\t\\t$items = ${getItemsFunctionName}();\n\\t\\tforeach ( $items as $index => $item ) {\n\\t\\t\\tif ( (int) $item['id'] !== (int) $query['id'] ) {\n\\t\\t\\t\\tcontinue;\n\\t\\t\\t}\n\n\\t\\t\\t$items[ $index ] = ${normalizeItemFunctionName}(\n\\t\\t\\t\\tarray(\n\\t\\t\\t\\t\\t'id' => $item['id'],\n\\t\\t\\t\\t\\t'title' => isset( $payload['title'] ) ? (string) $payload['title'] : (string) $item['title'],\n\\t\\t\\t\\t\\t'content' => array_key_exists( 'content', $payload ) ? (string) $payload['content'] : (string) $item['content'],\n\\t\\t\\t\\t\\t'status' => isset( $payload['status'] ) ? (string) $payload['status'] : (string) $item['status'],\n\\t\\t\\t\\t\\t'updatedAt' => gmdate( 'c' ),\n\\t\\t\\t\\t)\n\\t\\t\\t);\n\n\\t\\t\\t${saveItemsFunctionName}( $items );\n\\t\\t\\treturn rest_ensure_response( $items[ $index ] );\n\\t\\t}\n\n\\t\\treturn new WP_Error( 'rest_not_found', 'Resource not found.', array( 'status' => 404 ) );\n\\t}\n}\n\nif ( ! function_exists( '${deleteHandlerName}' ) ) {\n\\tfunction ${deleteHandlerName}( WP_REST_Request $request ) {\n\\t\\t$query = ${validatePayloadFunctionName}(\n\\t\\t\\tarray(\n\\t\\t\\t\\t'id' => $request->get_param( 'id' ),\n\\t\\t\\t),\n\\t\\t\\t'delete-query',\n\\t\\t\\t'query'\n\\t\\t);\n\\t\\tif ( is_wp_error( $query ) ) {\n\\t\\t\\treturn $query;\n\\t\\t}\n\n\\t\\t$items = ${getItemsFunctionName}();\n\\t\\t$filtered = array_values(\n\\t\\t\\tarray_filter(\n\\t\\t\\t\\t$items,\n\\t\\t\\t\\tstatic function ( $item ) use ( $query ) {\n\\t\\t\\t\\t\\treturn (int) $item['id'] !== (int) $query['id'];\n\\t\\t\\t\\t}\n\\t\\t\\t)\n\\t\\t);\n\\t\\t$was_deleted = count( $filtered ) !== count( $items );\n\n\\t\\tif ( ! $was_deleted ) {\n\\t\\t\\treturn new WP_Error( 'rest_not_found', 'Resource not found.', array( 'status' => 404 ) );\n\\t\\t}\n\n\\t\\t${saveItemsFunctionName}( $filtered );\n\n\\t\\treturn rest_ensure_response(\n\\t\\t\\tarray(\n\\t\\t\\t\\t'deleted' => true,\n\\t\\t\\t\\t'id' => (int) $query['id'],\n\\t\\t\\t)\n\\t\\t);\n\\t}\n}\n\nif ( ! function_exists( '${registerRoutesFunctionName}' ) ) {\n\\tfunction ${registerRoutesFunctionName}() {\n\\t\\t$namespace = ${quotePhpString(namespace)};\n\n${routeRegistrations}\n\\t}\n}\n\nadd_action( 'rest_api_init', '${registerRoutesFunctionName}' );\n`;\n}\n\n/**\n * Scaffold a workspace-level REST resource and synchronize its generated\n * TypeScript and PHP artifacts.\n *\n * @param options Command options for the REST resource scaffold workflow.\n * @returns Resolved scaffold metadata for the created REST resource.\n */\nexport async function runAddRestResourceCommand({\n\tcwd = process.cwd(),\n\tmethods,\n\tnamespace,\n\trestResourceName,\n}: RunAddRestResourceCommandOptions): Promise<{\n\tmethods: RestResourceMethodId[];\n\tnamespace: string;\n\tprojectDir: string;\n\trestResourceSlug: string;\n}> {\n\tconst workspace = resolveWorkspaceProject(cwd);\n\tconst restResourceSlug = assertValidGeneratedSlug(\n\t\t\"REST resource name\",\n\t\tnormalizeBlockSlug(restResourceName),\n\t\t\"wp-typia add rest-resource <name> [--namespace <vendor/v1>] [--methods <list,read,create>]\",\n\t);\n\tconst resolvedMethods = assertValidRestResourceMethods(methods);\n\tconst resolvedNamespace = resolveRestResourceNamespace(\n\t\tworkspace.workspace.namespace,\n\t\tnamespace,\n\t);\n\n\tconst inventory = readWorkspaceInventory(workspace.projectDir);\n\tassertRestResourceDoesNotExist(workspace.projectDir, restResourceSlug, inventory);\n\n\tconst blockConfigPath = path.join(workspace.projectDir, \"scripts\", \"block-config.ts\");\n\tconst bootstrapPath = getWorkspaceBootstrapPath(workspace);\n\tconst syncRestScriptPath = path.join(workspace.projectDir, \"scripts\", \"sync-rest-contracts.ts\");\n\tconst restResourceDir = path.join(workspace.projectDir, \"src\", \"rest\", restResourceSlug);\n\tconst typesFilePath = path.join(restResourceDir, \"api-types.ts\");\n\tconst validatorsFilePath = path.join(restResourceDir, \"api-validators.ts\");\n\tconst apiFilePath = path.join(restResourceDir, \"api.ts\");\n\tconst dataFilePath = path.join(restResourceDir, \"data.ts\");\n\tconst clientFilePath = path.join(restResourceDir, \"api-client.ts\");\n\tconst phpFilePath = path.join(workspace.projectDir, \"inc\", \"rest\", `${restResourceSlug}.php`);\n\tconst mutationSnapshot: WorkspaceMutationSnapshot = {\n\t\tfileSources: await snapshotWorkspaceFiles([\n\t\t\tblockConfigPath,\n\t\t\tbootstrapPath,\n\t\t\tsyncRestScriptPath,\n\t\t]),\n\t\tsnapshotDirs: [],\n\t\ttargetPaths: [restResourceDir, phpFilePath],\n\t};\n\n\ttry {\n\t\tawait fsp.mkdir(restResourceDir, { recursive: true });\n\t\tawait fsp.mkdir(path.dirname(phpFilePath), { recursive: true });\n\t\tawait ensureRestResourceBootstrapAnchors(workspace);\n\t\tawait ensureRestResourceSyncScriptAnchors(workspace);\n\t\tawait fsp.writeFile(\n\t\t\ttypesFilePath,\n\t\t\tbuildRestResourceTypesSource(restResourceSlug, resolvedMethods),\n\t\t\t\"utf8\",\n\t\t);\n\t\tawait fsp.writeFile(\n\t\t\tvalidatorsFilePath,\n\t\t\tbuildRestResourceValidatorsSource(restResourceSlug, resolvedMethods),\n\t\t\t\"utf8\",\n\t\t);\n\t\tawait fsp.writeFile(\n\t\t\tapiFilePath,\n\t\t\tbuildRestResourceApiSource(restResourceSlug, resolvedMethods),\n\t\t\t\"utf8\",\n\t\t);\n\t\tawait fsp.writeFile(\n\t\t\tdataFilePath,\n\t\t\tbuildRestResourceDataSource(restResourceSlug, resolvedMethods),\n\t\t\t\"utf8\",\n\t\t);\n\t\tawait fsp.writeFile(\n\t\t\tphpFilePath,\n\t\t\tbuildRestResourcePhpSource(\n\t\t\t\trestResourceSlug,\n\t\t\t\tresolvedNamespace,\n\t\t\t\tworkspace.workspace.phpPrefix,\n\t\t\t\tworkspace.workspace.textDomain,\n\t\t\t\tresolvedMethods,\n\t\t\t),\n\t\t\t\"utf8\",\n\t\t);\n\t\tawait syncRestResourceArtifacts({\n\t\t\tclientFile: `src/rest/${restResourceSlug}/api-client.ts`,\n\t\t\tmethods: resolvedMethods,\n\t\t\toutputDir: restResourceDir,\n\t\t\tprojectDir: workspace.projectDir,\n\t\t\ttypesFile: `src/rest/${restResourceSlug}/api-types.ts`,\n\t\t\tvalidatorsFile: `src/rest/${restResourceSlug}/api-validators.ts`,\n\t\t\tvariables: {\n\t\t\t\tnamespace: resolvedNamespace,\n\t\t\t\tpascalCase: toPascalCaseFromSlug(restResourceSlug),\n\t\t\t\tslugKebabCase: restResourceSlug,\n\t\t\t\ttitle: toTitleCase(restResourceSlug),\n\t\t\t},\n\t\t});\n\t\tawait appendWorkspaceInventoryEntries(workspace.projectDir, {\n\t\t\trestResourceEntries: [\n\t\t\t\tbuildRestResourceConfigEntry(\n\t\t\t\t\trestResourceSlug,\n\t\t\t\t\tresolvedNamespace,\n\t\t\t\t\tresolvedMethods,\n\t\t\t\t),\n\t\t\t],\n\t\t\ttransformSource: ensureBlockConfigCanAddRestManifests,\n\t\t});\n\n\t\treturn {\n\t\t\tmethods: resolvedMethods,\n\t\t\tnamespace: resolvedNamespace,\n\t\t\tprojectDir: workspace.projectDir,\n\t\t\trestResourceSlug,\n\t\t};\n\t} catch (error) {\n\t\tawait rollbackWorkspaceMutation(mutationSnapshot);\n\t\tthrow error;\n\t}\n}\n",
11
+ "import path from \"node:path\";\n\nimport {\n\tgetWorkspaceBootstrapPath,\n\tpatchFile,\n} from \"./cli-add-shared.js\";\nimport type { WorkspaceProject } from \"./workspace-project.js\";\n\nconst REST_RESOURCE_SERVER_GLOB = \"/inc/rest/*.php\";\n\nfunction escapeRegex(value: string): string {\n\treturn value.replace(/[.*+?^${}()|[\\]\\\\]/gu, \"\\\\$&\");\n}\n\nexport async function ensureRestResourceBootstrapAnchors(\n\tworkspace: WorkspaceProject,\n): Promise<void> {\n\tconst bootstrapPath = getWorkspaceBootstrapPath(workspace);\n\n\tawait patchFile(bootstrapPath, (source) => {\n\t\tlet nextSource = source;\n\t\tconst registerFunctionName = `${workspace.workspace.phpPrefix}_register_rest_resources`;\n\t\tconst registerHook = `add_action( 'init', '${registerFunctionName}', 20 );`;\n\t\tconst registerFunction = `\n\nfunction ${registerFunctionName}() {\n\\tforeach ( glob( __DIR__ . '${REST_RESOURCE_SERVER_GLOB}' ) ?: array() as $rest_resource_module ) {\n\\t\\trequire_once $rest_resource_module;\n\\t}\n}\n`;\n\t\tconst insertionAnchors = [\n\t\t\t/add_action\\(\\s*[\"']init[\"']\\s*,\\s*[\"'][^\"']+_load_textdomain[\"']\\s*\\);\\s*\\n/u,\n\t\t\t/\\?>\\s*$/u,\n\t\t];\n\t\tconst hasPhpFunctionDefinition = (functionName: string): boolean =>\n\t\t\tnew RegExp(`function\\\\s+${escapeRegex(functionName)}\\\\s*\\\\(`, \"u\").test(nextSource);\n\t\tconst insertPhpSnippet = (snippet: string): void => {\n\t\t\tfor (const anchor of insertionAnchors) {\n\t\t\t\tconst candidate = nextSource.replace(anchor, (match) => `${snippet}\\n${match}`);\n\t\t\t\tif (candidate !== nextSource) {\n\t\t\t\t\tnextSource = candidate;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tnextSource = `${nextSource.trimEnd()}\\n${snippet}\\n`;\n\t\t};\n\t\tconst appendPhpSnippet = (snippet: string): void => {\n\t\t\tconst closingTagPattern = /\\?>\\s*$/u;\n\t\t\tif (closingTagPattern.test(nextSource)) {\n\t\t\t\tnextSource = nextSource.replace(closingTagPattern, `${snippet}\\n?>`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tnextSource = `${nextSource.trimEnd()}\\n${snippet}\\n`;\n\t\t};\n\n\t\tif (!hasPhpFunctionDefinition(registerFunctionName)) {\n\t\t\tinsertPhpSnippet(registerFunction);\n\t\t} else if (!nextSource.includes(REST_RESOURCE_SERVER_GLOB)) {\n\t\t\tthrow new Error(\n\t\t\t\t[\n\t\t\t\t\t`Unable to patch ${path.basename(bootstrapPath)} in ensureRestResourceBootstrapAnchors.`,\n\t\t\t\t\t`The existing ${registerFunctionName}() definition does not include ${REST_RESOURCE_SERVER_GLOB}.`,\n\t\t\t\t\t\"Restore the generated bootstrap shape or wire the REST resource loader manually before retrying.\",\n\t\t\t\t].join(\" \"),\n\t\t\t);\n\t\t}\n\n\t\tif (!nextSource.includes(registerHook)) {\n\t\t\tappendPhpSnippet(registerHook);\n\t\t}\n\n\t\treturn nextSource;\n\t});\n}\n\nfunction assertSyncRestAnchor(\n\tnextSource: string,\n\ttarget: string,\n\tanchorDescription: string,\n\thasAnchor: boolean,\n\tsyncRestScriptPath: string,\n): void {\n\tif (!nextSource.includes(target) && !hasAnchor) {\n\t\tthrow new Error(\n\t\t\t[\n\t\t\t\t`ensureRestResourceSyncScriptAnchors could not patch ${path.basename(syncRestScriptPath)}.`,\n\t\t\t\t`Missing expected ${anchorDescription} anchor in scripts/sync-rest-contracts.ts.`,\n\t\t\t\t\"Restore the generated template or add the REST_RESOURCES wiring manually before retrying.\",\n\t\t\t].join(\" \"),\n\t\t);\n\t}\n}\n\nfunction replaceRequiredSyncRestSource(\n\tnextSource: string,\n\ttarget: string,\n\tanchor: string | RegExp,\n\treplacement: string,\n\tanchorDescription: string,\n\tsyncRestScriptPath: string,\n): string {\n\tif (nextSource.includes(target)) {\n\t\treturn nextSource;\n\t}\n\n\tconst hasAnchor =\n\t\ttypeof anchor === \"string\" ? nextSource.includes(anchor) : anchor.test(nextSource);\n\tassertSyncRestAnchor(\n\t\tnextSource,\n\t\ttarget,\n\t\tanchorDescription,\n\t\thasAnchor,\n\t\tsyncRestScriptPath,\n\t);\n\n\treturn nextSource.replace(anchor, replacement);\n}\n\nexport async function ensureRestResourceSyncScriptAnchors(\n\tworkspace: WorkspaceProject,\n): Promise<void> {\n\tconst syncRestScriptPath = path.join(workspace.projectDir, \"scripts\", \"sync-rest-contracts.ts\");\n\n\tawait patchFile(syncRestScriptPath, (source) => {\n\t\tlet nextSource = source;\n\t\tconst importAnchor = \"import { BLOCKS, type WorkspaceBlockConfig } from './block-config';\";\n\t\tconst helperInsertionAnchor = \"async function assertTypeArtifactsCurrent\";\n\t\tconst restBlocksAnchor = \"const restBlocks = BLOCKS.filter( isRestEnabledBlock );\";\n\t\tconst noResourcesPattern = /if \\( restBlocks.length === 0 \\) \\{[\\s\\S]*?\\n\\t\\treturn;\\n\\t\\}/u;\n\t\tconst consoleLogPattern = /\\n\\tconsole\\.log\\(\\n\\t\\toptions\\.check/u;\n\n\t\tnextSource = replaceRequiredSyncRestSource(\n\t\t\tnextSource,\n\t\t\t\"REST_RESOURCES\",\n\t\t\timportAnchor,\n\t\t\t[\n\t\t\t\t\"import {\",\n\t\t\t\t\"\\tBLOCKS,\",\n\t\t\t\t\"\\tREST_RESOURCES,\",\n\t\t\t\t\"\\ttype WorkspaceBlockConfig,\",\n\t\t\t\t\"\\ttype WorkspaceRestResourceConfig,\",\n\t\t\t\t\"} from './block-config';\",\n\t\t\t].join(\"\\n\"),\n\t\t\t\"BLOCKS import\",\n\t\t\tsyncRestScriptPath,\n\t\t);\n\n\t\tnextSource = replaceRequiredSyncRestSource(\n\t\t\tnextSource,\n\t\t\t\"function isWorkspaceRestResource(\",\n\t\t\thelperInsertionAnchor,\n\t\t\t[\n\t\t\t\t\"function isWorkspaceRestResource(\",\n\t\t\t\t\"\\tresource: WorkspaceRestResourceConfig\",\n\t\t\t\t\"): resource is WorkspaceRestResourceConfig & {\",\n\t\t\t\t\"\\tclientFile: string;\",\n\t\t\t\t\"\\topenApiFile: string;\",\n\t\t\t\t\"\\trestManifest: NonNullable< WorkspaceRestResourceConfig[ 'restManifest' ] >;\",\n\t\t\t\t\"\\ttypesFile: string;\",\n\t\t\t\t\"\\tvalidatorsFile: string;\",\n\t\t\t\t\"} {\",\n\t\t\t\t\"\\treturn (\",\n\t\t\t\t\"\\t\\ttypeof resource.clientFile === 'string' &&\",\n\t\t\t\t\"\\t\\ttypeof resource.openApiFile === 'string' &&\",\n\t\t\t\t\"\\t\\ttypeof resource.typesFile === 'string' &&\",\n\t\t\t\t\"\\t\\ttypeof resource.validatorsFile === 'string' &&\",\n\t\t\t\t\"\\t\\ttypeof resource.restManifest === 'object' &&\",\n\t\t\t\t\"\\t\\tresource.restManifest !== null\",\n\t\t\t\t\"\\t);\",\n\t\t\t\t\"}\",\n\t\t\t\t\"\",\n\t\t\t\t\"async function assertTypeArtifactsCurrent\",\n\t\t\t].join(\"\\n\"),\n\t\t\t\"type artifact assertion helper\",\n\t\t\tsyncRestScriptPath,\n\t\t);\n\n\t\tnextSource = replaceRequiredSyncRestSource(\n\t\t\tnextSource,\n\t\t\t\"const restResources = REST_RESOURCES.filter( isWorkspaceRestResource );\",\n\t\t\trestBlocksAnchor,\n\t\t\t[\n\t\t\t\t\"const restBlocks = BLOCKS.filter( isRestEnabledBlock );\",\n\t\t\t\t\"const restResources = REST_RESOURCES.filter( isWorkspaceRestResource );\",\n\t\t\t].join(\"\\n\"),\n\t\t\t\"restBlocks filter\",\n\t\t\tsyncRestScriptPath,\n\t\t);\n\n\t\tnextSource = replaceRequiredSyncRestSource(\n\t\t\tnextSource,\n\t\t\t\"restBlocks.length === 0 && restResources.length === 0\",\n\t\t\tnoResourcesPattern,\n\t\t\t[\n\t\t\t\t\"if ( restBlocks.length === 0 && restResources.length === 0 ) {\",\n\t\t\t\t\"\\t\\tconsole.log(\",\n\t\t\t\t\"\\t\\t\\toptions.check\",\n\t\t\t\t\"\\t\\t\\t\\t? 'ℹ️ No REST-enabled workspace blocks or plugin-level REST resources are registered yet. `sync-rest --check` is already clean.'\",\n\t\t\t\t\"\\t\\t\\t\\t: 'ℹ️ No REST-enabled workspace blocks or plugin-level REST resources are registered yet.'\",\n\t\t\t\t\"\\t\\t);\",\n\t\t\t\t\"\\t\\treturn;\",\n\t\t\t\t\"\\t}\",\n\t\t\t].join(\"\\n\"),\n\t\t\t\"no-resources guard\",\n\t\t\tsyncRestScriptPath,\n\t\t);\n\n\t\tnextSource = replaceRequiredSyncRestSource(\n\t\t\tnextSource,\n\t\t\t\"for ( const resource of restResources ) {\",\n\t\t\tconsoleLogPattern,\n\t\t\t[\n\t\t\t\t\"\",\n\t\t\t\t\"\\tfor ( const resource of restResources ) {\",\n\t\t\t\t\"\\t\\tconst contracts = resource.restManifest.contracts;\",\n\t\t\t\t\"\",\n\t\t\t\t\"\\t\\tfor ( const [ baseName, contract ] of Object.entries( contracts ) ) {\",\n\t\t\t\t\"\\t\\t\\tawait syncTypeSchemas(\",\n\t\t\t\t\"\\t\\t\\t\\t{\",\n\t\t\t\t\"\\t\\t\\t\\t\\tjsonSchemaFile: path.join(\",\n\t\t\t\t\"\\t\\t\\t\\t\\t\\tpath.dirname( resource.typesFile ),\",\n\t\t\t\t\"\\t\\t\\t\\t\\t\\t'api-schemas',\",\n\t\t\t\t\"\\t\\t\\t\\t\\t\\t`${ baseName }.schema.json`\",\n\t\t\t\t\"\\t\\t\\t\\t\\t),\",\n\t\t\t\t\"\\t\\t\\t\\t\\topenApiFile: path.join(\",\n\t\t\t\t\"\\t\\t\\t\\t\\t\\tpath.dirname( resource.typesFile ),\",\n\t\t\t\t\"\\t\\t\\t\\t\\t\\t'api-schemas',\",\n\t\t\t\t\"\\t\\t\\t\\t\\t\\t`${ baseName }.openapi.json`\",\n\t\t\t\t\"\\t\\t\\t\\t\\t),\",\n\t\t\t\t\"\\t\\t\\t\\t\\tsourceTypeName: contract.sourceTypeName,\",\n\t\t\t\t\"\\t\\t\\t\\t\\ttypesFile: resource.typesFile,\",\n\t\t\t\t\"\\t\\t\\t\\t},\",\n\t\t\t\t\"\\t\\t\\t\\t{\",\n\t\t\t\t\"\\t\\t\\t\\t\\tcheck: options.check,\",\n\t\t\t\t\"\\t\\t\\t\\t}\",\n\t\t\t\t\"\\t\\t\\t);\",\n\t\t\t\t\"\\t\\t}\",\n\t\t\t\t\"\",\n\t\t\t\t\"\\t\\tawait syncRestOpenApi(\",\n\t\t\t\t\"\\t\\t\\t{\",\n\t\t\t\t\"\\t\\t\\t\\tmanifest: resource.restManifest,\",\n\t\t\t\t\"\\t\\t\\t\\topenApiFile: resource.openApiFile,\",\n\t\t\t\t\"\\t\\t\\t\\ttypesFile: resource.typesFile,\",\n\t\t\t\t\"\\t\\t\\t},\",\n\t\t\t\t\"\\t\\t\\t{\",\n\t\t\t\t\"\\t\\t\\t\\tcheck: options.check,\",\n\t\t\t\t\"\\t\\t\\t}\",\n\t\t\t\t\"\\t\\t);\",\n\t\t\t\t\"\",\n\t\t\t\t\"\\t\\tawait syncEndpointClient(\",\n\t\t\t\t\"\\t\\t\\t{\",\n\t\t\t\t\"\\t\\t\\t\\tclientFile: resource.clientFile,\",\n\t\t\t\t\"\\t\\t\\t\\tmanifest: resource.restManifest,\",\n\t\t\t\t\"\\t\\t\\t\\ttypesFile: resource.typesFile,\",\n\t\t\t\t\"\\t\\t\\t\\tvalidatorsFile: resource.validatorsFile,\",\n\t\t\t\t\"\\t\\t\\t},\",\n\t\t\t\t\"\\t\\t\\t{\",\n\t\t\t\t\"\\t\\t\\t\\tcheck: options.check,\",\n\t\t\t\t\"\\t\\t\\t}\",\n\t\t\t\t\"\\t\\t);\",\n\t\t\t\t\"\\t}\",\n\t\t\t\t\"\",\n\t\t\t\t\"\\tconsole.log(\",\n\t\t\t\t\"\\t\\toptions.check\",\n\t\t\t].join(\"\\n\"),\n\t\t\t\"success log insertion point\",\n\t\t\tsyncRestScriptPath,\n\t\t);\n\n\t\tnextSource = nextSource.replace(\n\t\t\t\"✅ REST contract schemas, portable API clients, and endpoint-aware OpenAPI documents are already up to date with the TypeScript types!\",\n\t\t\t\"✅ REST contract schemas, portable API clients, and endpoint-aware OpenAPI documents are already up to date for workspace blocks and plugin-level resources!\",\n\t\t);\n\t\tnextSource = nextSource.replace(\n\t\t\t\"✅ REST contract schemas, portable API clients, and endpoint-aware OpenAPI documents generated from TypeScript types!\",\n\t\t\t\"✅ REST contract schemas, portable API clients, and endpoint-aware OpenAPI documents generated for workspace blocks and plugin-level resources!\",\n\t\t);\n\n\t\treturn nextSource;\n\t});\n}\n",
12
+ "import path from \"node:path\";\n\nimport {\n\tdefineEndpointManifest,\n\tsyncEndpointClient,\n\tsyncRestOpenApi,\n\tsyncTypeSchemas,\n} from \"@wp-typia/block-runtime/metadata-core\";\n\nimport type { RestResourceMethodId } from \"./cli-add-shared.js\";\n\ninterface RestResourceTemplateVariablesLike {\n\tnamespace: string;\n\tpascalCase: string;\n\tslugKebabCase: string;\n\ttitle: string;\n}\n\ninterface SyncRestResourceArtifactsOptions {\n\tclientFile: string;\n\tmethods: RestResourceMethodId[];\n\toutputDir: string;\n\tprojectDir: string;\n\ttypesFile: string;\n\tvalidatorsFile: string;\n\tvariables: RestResourceTemplateVariablesLike;\n}\n\ntype RestResourceEndpointDefinition = Parameters<\n\ttypeof defineEndpointManifest\n>[0][\"endpoints\"][number];\n\n/**\n * Build the endpoint manifest for a workspace-level REST resource scaffold.\n *\n * @param variables Template naming data used for contract names, routes, and OpenAPI info.\n * @param methods Enabled REST methods for the generated resource.\n * @returns Endpoint manifest consumed by schema, OpenAPI, and client generators.\n */\nexport function buildRestResourceEndpointManifest(\n\tvariables: RestResourceTemplateVariablesLike,\n\tmethods: RestResourceMethodId[],\n) {\n\tconst basePath = `/${variables.namespace}/${variables.slugKebabCase}`;\n\tconst itemPath = `${basePath}/item`;\n\tconst contracts: Record<string, { sourceTypeName: string }> = {};\n\tconst endpoints: RestResourceEndpointDefinition[] = [];\n\n\tif (methods.includes(\"list\")) {\n\t\tcontracts[\"list-query\"] = {\n\t\t\tsourceTypeName: `${variables.pascalCase}ListQuery`,\n\t\t};\n\t\tcontracts[\"list-response\"] = {\n\t\t\tsourceTypeName: `${variables.pascalCase}ListResponse`,\n\t\t};\n\t\tendpoints.push({\n\t\t\tauth: \"public\",\n\t\t\tmethod: \"GET\",\n\t\t\toperationId: `list${variables.pascalCase}Resources`,\n\t\t\tpath: basePath,\n\t\t\tqueryContract: \"list-query\",\n\t\t\tresponseContract: \"list-response\",\n\t\t\tsummary: `List ${variables.title} resources.`,\n\t\t\ttags: [variables.title],\n\t\t});\n\t}\n\n\tif (methods.includes(\"read\")) {\n\t\tcontracts[\"read-query\"] = {\n\t\t\tsourceTypeName: `${variables.pascalCase}ReadQuery`,\n\t\t};\n\t\tcontracts[\"read-response\"] = {\n\t\t\tsourceTypeName: `${variables.pascalCase}ReadResponse`,\n\t\t};\n\t\tendpoints.push({\n\t\t\tauth: \"public\",\n\t\t\tmethod: \"GET\",\n\t\t\toperationId: `read${variables.pascalCase}Resource`,\n\t\t\tpath: itemPath,\n\t\t\tqueryContract: \"read-query\",\n\t\t\tresponseContract: \"read-response\",\n\t\t\tsummary: `Read one ${variables.title} resource.`,\n\t\t\ttags: [variables.title],\n\t\t});\n\t}\n\n\tif (methods.includes(\"create\")) {\n\t\tcontracts[\"create-request\"] = {\n\t\t\tsourceTypeName: `${variables.pascalCase}CreateRequest`,\n\t\t};\n\t\tcontracts[\"create-response\"] = {\n\t\t\tsourceTypeName: `${variables.pascalCase}CreateResponse`,\n\t\t};\n\t\tendpoints.push({\n\t\t\tauth: \"authenticated\",\n\t\t\tbodyContract: \"create-request\",\n\t\t\tmethod: \"POST\",\n\t\t\toperationId: `create${variables.pascalCase}Resource`,\n\t\t\tpath: basePath,\n\t\t\tresponseContract: \"create-response\",\n\t\t\tsummary: `Create one ${variables.title} resource.`,\n\t\t\ttags: [variables.title],\n\t\t\twordpressAuth: {\n\t\t\t\tmechanism: \"rest-nonce\",\n\t\t\t},\n\t\t});\n\t}\n\n\tif (methods.includes(\"update\")) {\n\t\tcontracts[\"update-query\"] = {\n\t\t\tsourceTypeName: `${variables.pascalCase}UpdateQuery`,\n\t\t};\n\t\tcontracts[\"update-request\"] = {\n\t\t\tsourceTypeName: `${variables.pascalCase}UpdateRequest`,\n\t\t};\n\t\tcontracts[\"update-response\"] = {\n\t\t\tsourceTypeName: `${variables.pascalCase}UpdateResponse`,\n\t\t};\n\t\tendpoints.push({\n\t\t\tauth: \"authenticated\",\n\t\t\tbodyContract: \"update-request\",\n\t\t\tmethod: \"POST\",\n\t\t\toperationId: `update${variables.pascalCase}Resource`,\n\t\t\tpath: itemPath,\n\t\t\tqueryContract: \"update-query\",\n\t\t\tresponseContract: \"update-response\",\n\t\t\tsummary: `Update one ${variables.title} resource.`,\n\t\t\ttags: [variables.title],\n\t\t\twordpressAuth: {\n\t\t\t\tmechanism: \"rest-nonce\",\n\t\t\t},\n\t\t});\n\t}\n\n\tif (methods.includes(\"delete\")) {\n\t\tcontracts[\"delete-query\"] = {\n\t\t\tsourceTypeName: `${variables.pascalCase}DeleteQuery`,\n\t\t};\n\t\tcontracts[\"delete-response\"] = {\n\t\t\tsourceTypeName: `${variables.pascalCase}DeleteResponse`,\n\t\t};\n\t\tendpoints.push({\n\t\t\tauth: \"authenticated\",\n\t\t\tmethod: \"DELETE\",\n\t\t\toperationId: `delete${variables.pascalCase}Resource`,\n\t\t\tpath: itemPath,\n\t\t\tqueryContract: \"delete-query\",\n\t\t\tresponseContract: \"delete-response\",\n\t\t\tsummary: `Delete one ${variables.title} resource.`,\n\t\t\ttags: [variables.title],\n\t\t\twordpressAuth: {\n\t\t\t\tmechanism: \"rest-nonce\",\n\t\t\t},\n\t\t});\n\t}\n\n\treturn defineEndpointManifest({\n\t\tcontracts,\n\t\tendpoints,\n\t\tinfo: {\n\t\t\ttitle: `${variables.title} REST API`,\n\t\t\tversion: \"1.0.0\",\n\t\t},\n\t});\n}\n\n/**\n * Synchronize generated schemas, OpenAPI output, and endpoint client code for\n * a workspace-level REST resource scaffold.\n *\n * @param options Resource file paths, enabled methods, and naming variables.\n * @returns A promise that resolves after every generated REST artifact has been refreshed.\n */\nexport async function syncRestResourceArtifacts({\n\tclientFile,\n\tmethods,\n\toutputDir,\n\tprojectDir,\n\ttypesFile,\n\tvalidatorsFile,\n\tvariables,\n}: SyncRestResourceArtifactsOptions): Promise<void> {\n\tconst manifest = buildRestResourceEndpointManifest(variables, methods);\n\n\tfor (const [baseName, contract] of Object.entries(manifest.contracts) as Array<\n\t\t[string, { sourceTypeName: string }]\n\t>) {\n\t\tawait syncTypeSchemas(\n\t\t\t{\n\t\t\t\tjsonSchemaFile: path.join(outputDir, \"api-schemas\", `${baseName}.schema.json`),\n\t\t\t\topenApiFile: path.join(outputDir, \"api-schemas\", `${baseName}.openapi.json`),\n\t\t\t\tprojectRoot: projectDir,\n\t\t\t\tsourceTypeName: contract.sourceTypeName,\n\t\t\t\ttypesFile,\n\t\t\t},\n\t\t);\n\t}\n\n\tawait syncRestOpenApi(\n\t\t{\n\t\t\tmanifest,\n\t\t\topenApiFile: path.join(outputDir, \"api.openapi.json\"),\n\t\t\tprojectRoot: projectDir,\n\t\t\ttypesFile,\n\t\t},\n\t);\n\n\tawait syncEndpointClient(\n\t\t{\n\t\t\tclientFile,\n\t\t\tmanifest,\n\t\t\tprojectRoot: projectDir,\n\t\t\ttypesFile,\n\t\t\tvalidatorsFile,\n\t\t},\n\t);\n}\n",
13
+ "import {\n\tnormalizeBlockSlug,\n\tquoteTsString,\n\ttype RestResourceMethodId,\n} from \"./cli-add-shared.js\";\nimport { buildRestResourceEndpointManifest } from \"./rest-resource-artifacts.js\";\nimport { toTitleCase } from \"./string-case.js\";\n\nexport function toPascalCaseFromSlug(slug: string): string {\n\treturn normalizeBlockSlug(slug)\n\t\t.split(\"-\")\n\t\t.filter(Boolean)\n\t\t.map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))\n\t\t.join(\"\");\n}\n\nfunction indentMultiline(source: string, prefix: string): string {\n\treturn source\n\t\t.split(\"\\n\")\n\t\t.map((line) => `${prefix}${line}`)\n\t\t.join(\"\\n\");\n}\n\nexport function buildRestResourceConfigEntry(\n\trestResourceSlug: string,\n\tnamespace: string,\n\tmethods: RestResourceMethodId[],\n): string {\n\tconst pascalCase = toPascalCaseFromSlug(restResourceSlug);\n\tconst title = toTitleCase(restResourceSlug);\n\tconst manifest = buildRestResourceEndpointManifest(\n\t\t{\n\t\t\tnamespace,\n\t\t\tpascalCase,\n\t\t\tslugKebabCase: restResourceSlug,\n\t\t\ttitle,\n\t\t},\n\t\tmethods,\n\t);\n\n\treturn [\n\t\t\"\\t{\",\n\t\t`\\t\\tapiFile: ${quoteTsString(`src/rest/${restResourceSlug}/api.ts`)},`,\n\t\t`\\t\\tclientFile: ${quoteTsString(`src/rest/${restResourceSlug}/api-client.ts`)},`,\n\t\t`\\t\\tdataFile: ${quoteTsString(`src/rest/${restResourceSlug}/data.ts`)},`,\n\t\t`\\t\\tmethods: [ ${methods.map((method) => quoteTsString(method)).join(\", \")} ],`,\n\t\t`\\t\\tnamespace: ${quoteTsString(namespace)},`,\n\t\t`\\t\\topenApiFile: ${quoteTsString(`src/rest/${restResourceSlug}/api.openapi.json`)},`,\n\t\t`\\t\\tphpFile: ${quoteTsString(`inc/rest/${restResourceSlug}.php`)},`,\n\t\t\"\\t\\trestManifest: defineEndpointManifest(\",\n\t\tindentMultiline(JSON.stringify(manifest, null, \"\\t\"), \"\\t\\t\\t\"),\n\t\t\"\\t\\t),\",\n\t\t`\\t\\tslug: ${quoteTsString(restResourceSlug)},`,\n\t\t`\\t\\ttypesFile: ${quoteTsString(`src/rest/${restResourceSlug}/api-types.ts`)},`,\n\t\t`\\t\\tvalidatorsFile: ${quoteTsString(`src/rest/${restResourceSlug}/api-validators.ts`)},`,\n\t\t\"\\t},\",\n\t].join(\"\\n\");\n}\n\nexport function buildRestResourceTypesSource(\n\trestResourceSlug: string,\n\tmethods: RestResourceMethodId[],\n): string {\n\tconst pascalCase = toPascalCaseFromSlug(restResourceSlug);\n\tconst lines = [\n\t\t\"import { tags } from 'typia';\",\n\t\t\"\",\n\t\t`export type ${pascalCase}Status = 'draft' | 'published';`,\n\t\t\"\",\n\t\t`export interface ${pascalCase}Record {`,\n\t\t\"\\tid: number & tags.Type< 'uint32' >;\",\n\t\t\"\\ttitle: string & tags.MinLength< 1 > & tags.MaxLength< 120 >;\",\n\t\t\"\\tcontent?: string & tags.MaxLength< 2000 >;\",\n\t\t`\\tstatus: ${pascalCase}Status;`,\n\t\t\"\\tupdatedAt: string;\",\n\t\t\"}\",\n\t];\n\n\tif (methods.includes(\"list\")) {\n\t\tlines.push(\n\t\t\t\"\",\n\t\t\t`export interface ${pascalCase}ListQuery {`,\n\t\t\t\"\\tpage?: number & tags.Type< 'uint32' > & tags.Minimum< 1 > & tags.Default< 1 >;\",\n\t\t\t\"\\tperPage?: number & tags.Type< 'uint32' > & tags.Minimum< 1 > & tags.Maximum< 50 > & tags.Default< 10 >;\",\n\t\t\t\"\\tsearch?: string & tags.MaxLength< 120 >;\",\n\t\t\t\"}\",\n\t\t\t\"\",\n\t\t\t`export interface ${pascalCase}ListResponse {`,\n\t\t\t`\\titems: ${pascalCase}Record[];`,\n\t\t\t\"\\tpage: number & tags.Type< 'uint32' >;\",\n\t\t\t\"\\tperPage: number & tags.Type< 'uint32' >;\",\n\t\t\t\"\\ttotal: number & tags.Type< 'uint32' >;\",\n\t\t\t\"}\",\n\t\t);\n\t}\n\n\tif (methods.includes(\"read\")) {\n\t\tlines.push(\n\t\t\t\"\",\n\t\t\t`export interface ${pascalCase}ReadQuery {`,\n\t\t\t\"\\tid: number & tags.Type< 'uint32' >;\",\n\t\t\t\"}\",\n\t\t\t\"\",\n\t\t\t`export type ${pascalCase}ReadResponse = ${pascalCase}Record;`,\n\t\t);\n\t}\n\n\tif (methods.includes(\"create\")) {\n\t\tlines.push(\n\t\t\t\"\",\n\t\t\t`export interface ${pascalCase}CreateRequest {`,\n\t\t\t\"\\ttitle: string & tags.MinLength< 1 > & tags.MaxLength< 120 >;\",\n\t\t\t\"\\tcontent?: string & tags.MaxLength< 2000 >;\",\n\t\t\t`\\tstatus?: ${pascalCase}Status;`,\n\t\t\t\"}\",\n\t\t\t\"\",\n\t\t\t`export type ${pascalCase}CreateResponse = ${pascalCase}Record;`,\n\t\t);\n\t}\n\n\tif (methods.includes(\"update\")) {\n\t\tlines.push(\n\t\t\t\"\",\n\t\t\t`export interface ${pascalCase}UpdateQuery {`,\n\t\t\t\"\\tid: number & tags.Type< 'uint32' >;\",\n\t\t\t\"}\",\n\t\t\t\"\",\n\t\t\t`export interface ${pascalCase}UpdateRequest {`,\n\t\t\t\"\\ttitle?: string & tags.MinLength< 1 > & tags.MaxLength< 120 >;\",\n\t\t\t\"\\tcontent?: string & tags.MaxLength< 2000 >;\",\n\t\t\t`\\tstatus?: ${pascalCase}Status;`,\n\t\t\t\"}\",\n\t\t\t\"\",\n\t\t\t`export type ${pascalCase}UpdateResponse = ${pascalCase}Record;`,\n\t\t);\n\t}\n\n\tif (methods.includes(\"delete\")) {\n\t\tlines.push(\n\t\t\t\"\",\n\t\t\t`export interface ${pascalCase}DeleteQuery {`,\n\t\t\t\"\\tid: number & tags.Type< 'uint32' >;\",\n\t\t\t\"}\",\n\t\t\t\"\",\n\t\t\t`export interface ${pascalCase}DeleteResponse {`,\n\t\t\t\"\\tdeleted: true;\",\n\t\t\t\"\\tid: number & tags.Type< 'uint32' >;\",\n\t\t\t\"}\",\n\t\t);\n\t}\n\n\treturn `${lines.join(\"\\n\")}\\n`;\n}\n\nexport function buildRestResourceValidatorsSource(\n\trestResourceSlug: string,\n\tmethods: RestResourceMethodId[],\n): string {\n\tconst pascalCase = toPascalCaseFromSlug(restResourceSlug);\n\tconst importedTypes = new Set<string>();\n\tconst validatorDeclarations: string[] = [];\n\tconst validatorEntries: string[] = [];\n\n\tconst addValidator = (\n\t\tpropertyName: string,\n\t\ttypeName: string,\n\t\tvalidateIdentifier: string,\n\t) => {\n\t\timportedTypes.add(typeName);\n\t\tvalidatorDeclarations.push(\n\t\t\t`const ${validateIdentifier} = typia.createValidate< ${typeName} >();`,\n\t\t);\n\t\tvalidatorEntries.push(\n\t\t\t`\\t${propertyName}: ( input: unknown ) => toValidationResult< ${typeName} >( ${validateIdentifier}( input ) ),`,\n\t\t);\n\t};\n\n\tif (methods.includes(\"list\")) {\n\t\taddValidator(\"listQuery\", `${pascalCase}ListQuery`, \"validateListQuery\");\n\t\taddValidator(\"listResponse\", `${pascalCase}ListResponse`, \"validateListResponse\");\n\t}\n\tif (methods.includes(\"read\")) {\n\t\taddValidator(\"readQuery\", `${pascalCase}ReadQuery`, \"validateReadQuery\");\n\t\taddValidator(\"readResponse\", `${pascalCase}ReadResponse`, \"validateReadResponse\");\n\t}\n\tif (methods.includes(\"create\")) {\n\t\taddValidator(\"createRequest\", `${pascalCase}CreateRequest`, \"validateCreateRequest\");\n\t\taddValidator(\"createResponse\", `${pascalCase}CreateResponse`, \"validateCreateResponse\");\n\t}\n\tif (methods.includes(\"update\")) {\n\t\taddValidator(\"updateQuery\", `${pascalCase}UpdateQuery`, \"validateUpdateQuery\");\n\t\taddValidator(\"updateRequest\", `${pascalCase}UpdateRequest`, \"validateUpdateRequest\");\n\t\taddValidator(\"updateResponse\", `${pascalCase}UpdateResponse`, \"validateUpdateResponse\");\n\t}\n\tif (methods.includes(\"delete\")) {\n\t\taddValidator(\"deleteQuery\", `${pascalCase}DeleteQuery`, \"validateDeleteQuery\");\n\t\taddValidator(\"deleteResponse\", `${pascalCase}DeleteResponse`, \"validateDeleteResponse\");\n\t}\n\n\treturn `import typia from 'typia';\n\nimport { toValidationResult } from '@wp-typia/rest';\nimport type {\n\\t${Array.from(importedTypes).sort().join(\",\\n\\t\")},\n} from './api-types';\n\n${validatorDeclarations.join(\"\\n\")}\n\nexport const apiValidators = {\n${validatorEntries.join(\"\\n\")}\n};\n`;\n}\n\nexport function buildRestResourceApiSource(\n\trestResourceSlug: string,\n\tmethods: RestResourceMethodId[],\n): string {\n\tconst pascalCase = toPascalCaseFromSlug(restResourceSlug);\n\tconst typeImports = new Set<string>();\n\tconst clientEndpointImports: string[] = [];\n\tconst exportedBindings: string[] = [];\n\tconst writeMethods = methods.filter((method) =>\n\t\t[\"create\", \"update\", \"delete\"].includes(method),\n\t);\n\n\tif (methods.includes(\"list\")) {\n\t\ttypeImports.add(`${pascalCase}ListQuery`);\n\t\tclientEndpointImports.push(`list${pascalCase}ResourcesEndpoint`);\n\t\texportedBindings.push(`export const restResourceListEndpoint = {\n\\t...list${pascalCase}ResourcesEndpoint,\n\\tbuildRequestOptions: () => ( {\n\\t\\turl: resolveRestRouteUrl( list${pascalCase}ResourcesEndpoint.path ),\n\\t} ),\n};\n\nexport function listResource( request: ${pascalCase}ListQuery ) {\n\\treturn callEndpoint( restResourceListEndpoint, request );\n}`);\n\t}\n\n\tif (methods.includes(\"read\")) {\n\t\ttypeImports.add(`${pascalCase}ReadQuery`);\n\t\tclientEndpointImports.push(`read${pascalCase}ResourceEndpoint`);\n\t\texportedBindings.push(`export const restResourceReadEndpoint = {\n\\t...read${pascalCase}ResourceEndpoint,\n\\tbuildRequestOptions: () => ( {\n\\t\\turl: resolveRestRouteUrl( read${pascalCase}ResourceEndpoint.path ),\n\\t} ),\n};\n\nexport function readResource( request: ${pascalCase}ReadQuery ) {\n\\treturn callEndpoint( restResourceReadEndpoint, request );\n}`);\n\t}\n\n\tif (methods.includes(\"create\")) {\n\t\ttypeImports.add(`${pascalCase}CreateRequest`);\n\t\tclientEndpointImports.push(`create${pascalCase}ResourceEndpoint`);\n\t\texportedBindings.push(`export const restResourceCreateEndpoint = {\n\\t...create${pascalCase}ResourceEndpoint,\n\\tbuildRequestOptions: () => {\n\\t\\tconst nonce = resolveRestNonce();\n\\t\\treturn {\n\\t\\t\\theaders: nonce\n\\t\\t\\t\\t? {\n\\t\\t\\t\\t\\t'X-WP-Nonce': nonce,\n\\t\\t\\t\\t}\n\\t\\t\\t\\t: undefined,\n\\t\\t\\turl: resolveRestRouteUrl( create${pascalCase}ResourceEndpoint.path ),\n\\t\\t};\n\\t},\n};\n\nexport function createResource( request: ${pascalCase}CreateRequest ) {\n\\treturn callEndpoint( restResourceCreateEndpoint, request );\n}`);\n\t}\n\n\tif (methods.includes(\"update\")) {\n\t\ttypeImports.add(`${pascalCase}UpdateQuery`);\n\t\ttypeImports.add(`${pascalCase}UpdateRequest`);\n\t\tclientEndpointImports.push(`update${pascalCase}ResourceEndpoint`);\n\t\texportedBindings.push(`export const restResourceUpdateEndpoint = {\n\\t...update${pascalCase}ResourceEndpoint,\n\\tbuildRequestOptions: () => {\n\\t\\tconst nonce = resolveRestNonce();\n\\t\\treturn {\n\\t\\t\\theaders: nonce\n\\t\\t\\t\\t? {\n\\t\\t\\t\\t\\t'X-WP-Nonce': nonce,\n\\t\\t\\t\\t}\n\\t\\t\\t\\t: undefined,\n\\t\\t\\turl: resolveRestRouteUrl( update${pascalCase}ResourceEndpoint.path ),\n\\t\\t};\n\\t},\n};\n\nexport function updateResource( request: {\n\\tbody: ${pascalCase}UpdateRequest;\n\\tquery: ${pascalCase}UpdateQuery;\n} ) {\n\\treturn callEndpoint( restResourceUpdateEndpoint, request );\n}`);\n\t}\n\n\tif (methods.includes(\"delete\")) {\n\t\ttypeImports.add(`${pascalCase}DeleteQuery`);\n\t\tclientEndpointImports.push(`delete${pascalCase}ResourceEndpoint`);\n\t\texportedBindings.push(`export const restResourceDeleteEndpoint = {\n\\t...delete${pascalCase}ResourceEndpoint,\n\\tbuildRequestOptions: () => {\n\\t\\tconst nonce = resolveRestNonce();\n\\t\\treturn {\n\\t\\t\\theaders: nonce\n\\t\\t\\t\\t? {\n\\t\\t\\t\\t\\t'X-WP-Nonce': nonce,\n\\t\\t\\t\\t}\n\\t\\t\\t\\t: undefined,\n\\t\\t\\turl: resolveRestRouteUrl( delete${pascalCase}ResourceEndpoint.path ),\n\\t\\t};\n\\t},\n};\n\nexport function deleteResource( request: ${pascalCase}DeleteQuery ) {\n\\treturn callEndpoint( restResourceDeleteEndpoint, request );\n}`);\n\t}\n\n\tconst resolveRestNonceSource =\n\t\twriteMethods.length > 0\n\t\t\t? `function resolveRestNonce( fallback?: string ): string | undefined {\n\\tif ( typeof fallback === 'string' && fallback.length > 0 ) {\n\\t\\treturn fallback;\n\\t}\n\n\\tif ( typeof window === 'undefined' ) {\n\\t\\treturn undefined;\n\\t}\n\n\\tconst wpApiSettings = (\n\\t\\twindow as typeof window & {\n\\t\\t\\twpApiSettings?: { nonce?: string };\n\\t\\t}\n\\t).wpApiSettings;\n\n\\treturn typeof wpApiSettings?.nonce === 'string' &&\n\\t\\twpApiSettings.nonce.length > 0\n\\t\\t? wpApiSettings.nonce\n\\t\\t: undefined;\n}\n\n`\n\t\t\t: \"\";\n\n\treturn `import {\n\\tcallEndpoint,\n\\tresolveRestRouteUrl,\n} from '@wp-typia/rest';\n\nimport type {\n\\t${Array.from(typeImports).sort().join(\",\\n\\t\")},\n} from './api-types';\nimport {\n\\t${clientEndpointImports.sort().join(\",\\n\\t\")},\n} from './api-client';\n${resolveRestNonceSource}\n${exportedBindings.join(\"\\n\\n\")}\n`;\n}\n\nexport function buildRestResourceDataSource(\n\trestResourceSlug: string,\n\tmethods: RestResourceMethodId[],\n): string {\n\tconst pascalCase = toPascalCaseFromSlug(restResourceSlug);\n\tconst typeImports = new Set<string>();\n\tconst endpointImports: string[] = [];\n\tconst exportedBindings: string[] = [];\n\n\tif (methods.includes(\"list\")) {\n\t\ttypeImports.add(`${pascalCase}ListQuery`);\n\t\ttypeImports.add(`${pascalCase}ListResponse`);\n\t\tendpointImports.push(\"restResourceListEndpoint\");\n\t\texportedBindings.push(`export type Use${pascalCase}ListQueryOptions<\n\\tSelected = ${pascalCase}ListResponse,\n> = UseEndpointQueryOptions<\n\\t${pascalCase}ListQuery,\n\\t${pascalCase}ListResponse,\n\\tSelected\n>;\n\nexport function use${pascalCase}ListQuery<\n\\tSelected = ${pascalCase}ListResponse,\n>(\n\\trequest: ${pascalCase}ListQuery,\n\\toptions: Use${pascalCase}ListQueryOptions< Selected > = {}\n) {\n\\treturn useEndpointQuery( restResourceListEndpoint, request, options );\n}`);\n\t}\n\n\tif (methods.includes(\"read\")) {\n\t\ttypeImports.add(`${pascalCase}ReadQuery`);\n\t\ttypeImports.add(`${pascalCase}ReadResponse`);\n\t\tendpointImports.push(\"restResourceReadEndpoint\");\n\t\texportedBindings.push(`export type Use${pascalCase}ReadQueryOptions<\n\\tSelected = ${pascalCase}ReadResponse,\n> = UseEndpointQueryOptions<\n\\t${pascalCase}ReadQuery,\n\\t${pascalCase}ReadResponse,\n\\tSelected\n>;\n\nexport function use${pascalCase}ReadQuery<\n\\tSelected = ${pascalCase}ReadResponse,\n>(\n\\trequest: ${pascalCase}ReadQuery,\n\\toptions: Use${pascalCase}ReadQueryOptions< Selected > = {}\n) {\n\\treturn useEndpointQuery( restResourceReadEndpoint, request, options );\n}`);\n\t}\n\n\tif (methods.includes(\"create\")) {\n\t\ttypeImports.add(`${pascalCase}CreateRequest`);\n\t\ttypeImports.add(`${pascalCase}CreateResponse`);\n\t\tendpointImports.push(\"restResourceCreateEndpoint\");\n\t\texportedBindings.push(`export type UseCreate${pascalCase}ResourceMutationOptions = UseEndpointMutationOptions<\n\\t${pascalCase}CreateRequest,\n\\t${pascalCase}CreateResponse,\n\\tunknown\n>;\n\nexport function useCreate${pascalCase}ResourceMutation(\n\\toptions: UseCreate${pascalCase}ResourceMutationOptions = {}\n) {\n\\treturn useEndpointMutation( restResourceCreateEndpoint, options );\n}`);\n\t}\n\n\tif (methods.includes(\"update\")) {\n\t\ttypeImports.add(`${pascalCase}UpdateQuery`);\n\t\ttypeImports.add(`${pascalCase}UpdateRequest`);\n\t\ttypeImports.add(`${pascalCase}UpdateResponse`);\n\t\tendpointImports.push(\"restResourceUpdateEndpoint\");\n\t\texportedBindings.push(`export type UseUpdate${pascalCase}ResourceMutationOptions = UseEndpointMutationOptions<\n\\t{\n\\t\\tbody: ${pascalCase}UpdateRequest;\n\\t\\tquery: ${pascalCase}UpdateQuery;\n\\t},\n\\t${pascalCase}UpdateResponse,\n\\tunknown\n>;\n\nexport function useUpdate${pascalCase}ResourceMutation(\n\\toptions: UseUpdate${pascalCase}ResourceMutationOptions = {}\n) {\n\\treturn useEndpointMutation( restResourceUpdateEndpoint, options );\n}`);\n\t}\n\n\tif (methods.includes(\"delete\")) {\n\t\ttypeImports.add(`${pascalCase}DeleteQuery`);\n\t\ttypeImports.add(`${pascalCase}DeleteResponse`);\n\t\tendpointImports.push(\"restResourceDeleteEndpoint\");\n\t\texportedBindings.push(`export type UseDelete${pascalCase}ResourceMutationOptions = UseEndpointMutationOptions<\n\\t${pascalCase}DeleteQuery,\n\\t${pascalCase}DeleteResponse,\n\\tunknown\n>;\n\nexport function useDelete${pascalCase}ResourceMutation(\n\\toptions: UseDelete${pascalCase}ResourceMutationOptions = {}\n) {\n\\treturn useEndpointMutation( restResourceDeleteEndpoint, options );\n}`);\n\t}\n\n\treturn `import {\n\\tuseEndpointMutation,\n\\tuseEndpointQuery,\n\\ttype UseEndpointMutationOptions,\n\\ttype UseEndpointQueryOptions,\n} from '@wp-typia/rest/react';\n\nimport type {\n\\t${Array.from(typeImports).sort().join(\",\\n\\t\")},\n} from './api-types';\nimport {\n\\t${endpointImports.sort().join(\",\\n\\t\")},\n} from './api';\n\n${exportedBindings.join(\"\\n\\n\")}\n`;\n}\n"
12
14
  ],
13
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA,qBAAS;AACT;AAEA;AAAA;AAAA;;;ACJA;AAYO,SAAS,uBAAuB,CACtC,mBACS;AAAA,EACT,OAAO,KAAK,KACX,gCACA,sBAAsB,WAAW,uBAAuB,kBACzD;AAAA;AAGD,SAAS,2BAA2B,CACnC,WACS;AAAA,EACT,OAAO;AAAA,IACN;AAAA,IACA,WA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AA,CAAI,GACX,iBACA,kBACD;AAAA,IAEA,aAAa,8BACZ,YACA,qCACA,uBACA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,EAAE,KAAK;AAAA,CAAI,GACX,kCACA,kBACD;AAAA,IAEA,aAAa,8BACZ,YACA,2EACA,kBACA;AAAA,MACC;AAAA,MACA;AAAA,IACD,EAAE,KAAK;AAAA,CAAI,GACX,qBACA,kBACD;AAAA,IAEA,aAAa,8BACZ,YACA,yDACA,oBACA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,EAAE,KAAK;AAAA,CAAI,GACX,sBACA,kBACD;AAAA,IAEA,aAAa,8BACZ,YACA,6CACA,mBACA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA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;AAAA,MACA;AAAA,IACD,EAAE,KAAK;AAAA,CAAI,GACX,iBACA,kBACD;AAAA,IAEA,aAAa,8BACZ,YACA,qCACA,uBACA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,EAAE,KAAK;AAAA,CAAI,GACX,kCACA,kBACD;AAAA,IAEA,aAAa,8BACZ,YACA,2EACA,kBACA;AAAA,MACC;AAAA,MACA;AAAA,IACD,EAAE,KAAK;AAAA,CAAI,GACX,qBACA,kBACD;AAAA,IAEA,aAAa,8BACZ,YACA,yDACA,oBACA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,EAAE,KAAK;AAAA,CAAI,GACX,sBACA,kBACD;AAAA,IAEA,aAAa,8BACZ,YACA,6CACA,mBACA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;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