@powerhousedao/codegen 6.2.0-dev.3 → 6.2.0-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{file-builders-DYqyzzbb.mjs → file-builders-DYFnJF60.mjs} +9 -26
- package/dist/{file-builders-DYqyzzbb.mjs.map → file-builders-DYFnJF60.mjs.map} +1 -1
- package/dist/{index-DqWWfHAz.d.mts → index-DtbVU1fc.d.mts} +2 -3
- package/dist/index-DtbVU1fc.d.mts.map +1 -0
- package/dist/index.d.mts +3 -4
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +64 -67
- package/dist/index.mjs.map +1 -1
- package/dist/src/file-builders/index.d.mts +2 -2
- package/dist/src/file-builders/index.mjs +2 -2
- package/dist/src/name-builders/index.d.mts +1 -1
- package/dist/src/name-builders/index.mjs +1 -1
- package/dist/src/templates/index.d.mts +1 -1
- package/dist/src/templates/index.d.mts.map +1 -1
- package/dist/src/templates/index.mjs +1 -1
- package/dist/src/utils/index.d.mts +1 -1
- package/dist/src/utils/index.mjs +1 -1
- package/package.json +3 -3
- package/dist/index-DqWWfHAz.d.mts.map +0 -1
|
@@ -5387,10 +5387,9 @@ function getDocumentModelVariableNames(documentModelName) {
|
|
|
5387
5387
|
//#endregion
|
|
5388
5388
|
//#region src/templates/document-model/gen/modules/actions.ts
|
|
5389
5389
|
function getActionTypeExport(operation) {
|
|
5390
|
-
const baseActionTypeName = operationHasAttachment(operation) ? "ActionWithAttachment" : "Action";
|
|
5391
5390
|
const actionTypeName = getActionTypeName(operation);
|
|
5392
5391
|
const actionInputName = getActionInputName(operation) ?? `"{}"`;
|
|
5393
|
-
return ts$1`export type ${actionTypeName} =
|
|
5392
|
+
return ts$1`export type ${actionTypeName} = Action & { type: "${getActionType(operation)}"; input: ${actionInputName} };`.raw;
|
|
5394
5393
|
}
|
|
5395
5394
|
function getActionTypeExports(args) {
|
|
5396
5395
|
return args.module.operations.map(getActionTypeExport).join("\n");
|
|
@@ -5400,17 +5399,12 @@ function getModuleExportType(args) {
|
|
|
5400
5399
|
const actionTypeNames = module.operations.map(getActionTypeName).join(" |\n");
|
|
5401
5400
|
return ts$1`export type ${pascalCaseDocumentType}${pascalCase(module.name)}Action = ${actionTypeNames};`.raw;
|
|
5402
5401
|
}
|
|
5403
|
-
function getDocumentModelActionTypeImportNames(args) {
|
|
5404
|
-
const actionTypeImports = ["Action"];
|
|
5405
|
-
if (args.module.operations.some((a) => operationHasAttachment(a))) actionTypeImports.push("ActionWithAttachment");
|
|
5406
|
-
return actionTypeImports.join(",\n");
|
|
5407
|
-
}
|
|
5408
5402
|
const documentModelOperationModuleActionsFileTemplate = (v) => ts$1`
|
|
5409
5403
|
/**
|
|
5410
5404
|
* WARNING: DO NOT EDIT
|
|
5411
5405
|
* This file is auto-generated and updated by codegen
|
|
5412
5406
|
*/
|
|
5413
|
-
import type {
|
|
5407
|
+
import type { Action } from 'document-model';
|
|
5414
5408
|
import type {
|
|
5415
5409
|
${getActionInputTypeNames(v)}
|
|
5416
5410
|
} from '../types.js';
|
|
@@ -5421,11 +5415,6 @@ ${getModuleExportType(v)}
|
|
|
5421
5415
|
`.raw;
|
|
5422
5416
|
//#endregion
|
|
5423
5417
|
//#region src/templates/document-model/gen/modules/creators.ts
|
|
5424
|
-
function makeDocumentModelTypeImports(args) {
|
|
5425
|
-
const actionTypeImports = ["createAction"];
|
|
5426
|
-
if (args.module.operations.some((a) => operationHasAttachment(a))) actionTypeImports.push("AttachmentInput");
|
|
5427
|
-
return actionTypeImports.join(",\n");
|
|
5428
|
-
}
|
|
5429
5418
|
function makeActionInputSchemaName(action) {
|
|
5430
5419
|
if (!action.name || !action.schema) return;
|
|
5431
5420
|
return `${pascalCase(action.name)}InputSchema`;
|
|
@@ -5454,15 +5443,12 @@ function makeActionCreatorWithInput(operation) {
|
|
|
5454
5443
|
const actionTypeName = makeActionTypeName(operation);
|
|
5455
5444
|
const inputSchemaName = makeActionInputSchemaName(operation);
|
|
5456
5445
|
const inputTypeName = makeActionInputTypeName(operation);
|
|
5457
|
-
const hasAttachment = operationHasAttachment(operation);
|
|
5458
|
-
const argsArray = [operationHasEmptyInput(operation) ? `input: ${inputTypeName} = {}` : `input: ${inputTypeName}`];
|
|
5459
|
-
if (hasAttachment) argsArray.push(`attachments: AttachmentInput[]`);
|
|
5460
5446
|
return ts$1`
|
|
5461
|
-
export const ${camelCaseActionName} = (${
|
|
5447
|
+
export const ${camelCaseActionName} = (${operationHasEmptyInput(operation) ? `input: ${inputTypeName} = {}` : `input: ${inputTypeName}`}) =>
|
|
5462
5448
|
createAction<${actionTypeName}>(
|
|
5463
5449
|
"${constantCaseActionName}",
|
|
5464
5450
|
{...input},
|
|
5465
|
-
|
|
5451
|
+
undefined,
|
|
5466
5452
|
${inputSchemaName},
|
|
5467
5453
|
"${operation.scope}"
|
|
5468
5454
|
);`.raw;
|
|
@@ -5486,7 +5472,7 @@ const documentModelOperationsModuleCreatorsFileTemplate = (v) => ts$1`
|
|
|
5486
5472
|
* WARNING: DO NOT EDIT
|
|
5487
5473
|
* This file is auto-generated and updated by codegen
|
|
5488
5474
|
*/
|
|
5489
|
-
import {
|
|
5475
|
+
import { createAction } from "document-model";
|
|
5490
5476
|
import {
|
|
5491
5477
|
${makeActionInputSchemaImports(v)}
|
|
5492
5478
|
} from '../schema/zod.js';
|
|
@@ -7409,15 +7395,15 @@ async function makeEditorComponent(args) {
|
|
|
7409
7395
|
const scalars = {
|
|
7410
7396
|
Unknown: "unknown",
|
|
7411
7397
|
DateTime: "string",
|
|
7412
|
-
Attachment: "string",
|
|
7413
7398
|
Address: "`${string}:0x${string}`",
|
|
7399
|
+
AttachmentRef: "`attachment://v${number}:${string}`",
|
|
7414
7400
|
...generatorTypeDefs
|
|
7415
7401
|
};
|
|
7416
7402
|
const scalarsValidation = {
|
|
7417
7403
|
Unknown: "z.unknown()",
|
|
7418
7404
|
DateTime: "z.string().datetime()",
|
|
7419
|
-
Attachment: "z.string()",
|
|
7420
7405
|
Address: "z.custom<`${string}:0x${string}`>((val) => /^[a-zA-Z0-9]+:0x[a-fA-F0-9]{40}$/.test(val as string))",
|
|
7406
|
+
AttachmentRef: "z.custom<`attachment://v${number}:${string}`>((val) => /^attachment:\\/\\/v\\d+:.+$/.test(val as string))",
|
|
7421
7407
|
...validationSchema
|
|
7422
7408
|
};
|
|
7423
7409
|
const avoidOptionals = {
|
|
@@ -8231,9 +8217,6 @@ function operationHasInput(operation) {
|
|
|
8231
8217
|
function operationHasEmptyInput(operation) {
|
|
8232
8218
|
return operation.schema?.includes("_empty") && !operation.schema.replace(/_empty:\s*Boolean/, "").match(/\w+:\s*\w+/);
|
|
8233
8219
|
}
|
|
8234
|
-
function operationHasAttachment(operation) {
|
|
8235
|
-
return operation.schema?.includes(": Attachment");
|
|
8236
|
-
}
|
|
8237
8220
|
//#endregion
|
|
8238
8221
|
//#region src/file-builders/index-files.ts
|
|
8239
8222
|
/**
|
|
@@ -8559,6 +8542,6 @@ async function makeSubgraphsIndexFile(args) {
|
|
|
8559
8542
|
await formatSourceFileWithPrettier(sourceFile);
|
|
8560
8543
|
}
|
|
8561
8544
|
//#endregion
|
|
8562
|
-
export {
|
|
8545
|
+
export { buildStringLiteral as $, cursorMcpTemplate as $n, getModuleExportType as $t, writeModuleFiles as A, pnpmWorkspaceTemplate as An, analyticsFactoryTemplate as At, buildTsMorphProject as B, gitIgnoreTemplate as Bn, documentModelSrcIndexFileTemplate as Bt, writeAllGeneratedProjectFiles as C, subgraphsIndexTemplate as Cn, relationalDbIndexTemplate as Ct, writeGeneratedProcessorsFiles as D, buildPowerhouseConfigTemplate as Dn, factoryBuildersTemplate as Dt, writeGeneratedEditorsFiles as E, ManifestTemplate as En, processorsFactoryTemplate as Et, makeEditorsIndexFile as F, mainTsxTemplate as Fn, makeOperationImportNames as Ft, getObjectLiteral as G, editorsTemplate as Gn, documentModelGenTypesTemplate as Gt, getAllImportModuleSpecifiers as H, geminiSettingsTemplate as Hn, documentModelIndexTemplate as Ht, validateDocumentModelState as I, licenseTemplate as In, makeOperationsImports as It, getStringArrayPropertyElements as J, documentModelsTemplate as Jn, documentModelPhFactoriesFileTemplate as Jt, getObjectProperty as K, upgradeManifestsTemplate as Kn, documentModelSchemaIndexTemplate as Kt, updateVersionedImports as L, indexTsTemplate as Ln, makeTestCaseForOperation as Lt, tsMorphGenerateApp as M, packageJsonTemplate as Mn, upgradeTransitionTemplate as Mt, makeEditorModuleFile as N, npmrcTemplate as Nn, upgradeManifestTemplate as Nt, writeGeneratedProjectRootFiles as O, packageJsonExportsTemplate as On, analyticsProcessorTemplate as Ot, makeEditorsFile as P, mcpTemplate as Pn, documentModelOperationsModuleTestFileTemplate as Pt, buildObjectLiteral as Q, connectEntrypointTemplate as Qn, documentModelOperationModuleActionsFileTemplate as Qt, getInitialStates as R, legacyIndexHtmlTemplate as Rn, documentModelTestFileTemplate as Rt, writeAiConfigFiles as S, tsconfigPathsTemplate as Sn, relationalDbMigrationsTemplate as St, writeGeneratedDocumentModelsFiles as T, readmeTemplate as Tn, processorsIndexTemplate as Tt, getAllImportNames as U, eslintConfigTemplate as Un, documentModelHooksFileTemplate as Ut, getDefaultProjectOptions as V, syncAndPublishWorkflowTemplate as Vn, documentModelModuleFileTemplate as Vt, getBooleanPropertyValue as W, editorsIndexTemplate as Wn, documentModelGenUtilsTemplate as Wt, getVariableDeclarationByTypeName as X, nginxConfTemplate as Xn, documentModelOperationsModuleErrorFileTemplate as Xt, getStringPropertyValue as Y, switchboardEntrypointTemplate as Yn, documentModelOperationsModuleOperationsFileTemplate as Yt, loadDocumentModelInDir as Z, dockerfileTemplate as Zn, documentModelOperationsModuleCreatorsFileTemplate as Zt, getCommandsHelpInfo as _, documentEditorModuleFileTemplate as _n, customSubgraphSchemaTemplate as _t, getOrCreateManifestFile as a, getLatestDocumentModelSpecVersionNumber as an, folderTreeFileTemplate as ar, getProcessorMetadata as at, buildBoilerplatePackageJson as b, vitestConfigTemplate as bn, relationalDbSchemaTemplate as bt, operationHasEmptyInput as c, getActionType as cn, emptyStateFileTemplate as cr, formatSafe as ct, generateDocumentModelZodSchemas as d, documentModelDocumentTypeTemplate as dn, createDocumentFileTemplate as dr, getDocumentTypeMetadata as dt, getDocumentModelDirName as en, claudeSettingsLocalTemplate as er, ensureDirectoriesExist as et, generateTypesAndZodSchemasFromGraphql as f, documentModelDocumentSchemaFileTemplate as fn, documentModelDocumentTypeMetadata as ft, getCommandHelpInfo as g, documentModelRootActionsFileTemplate as gn, customSubgraphResolversTemplate as gt, tsMorphGenerateDocumentEditor as h, documentModelGenActionsFileTemplate as hn, parseConfig as ht, createOrUpdateManifest as i, getLatestDocumentModelSpec as in, driveExplorerNavigationBreadcrumbsFileTemplate as ir, getSubgraphMetadata as it, writeProjectRootFiles as j, exportsTemplate as jn, documentModelUtilsTemplate as jt, writeGeneratedSubgraphsFiles as k, packageJsonScriptsTemplate as kn, analyticsIndexTemplate as kt, operationHasInput as l, getActionTypeName as ln, driveExplorerFileTemplate as lr, formatSourceFileWithPrettier as lt, scalarsValidation as m, documentModelGenControllerFileTemplate as mn, parseArgs as mt, tsMorphGenerateSubgraph as n, getDocumentModelVariableNames as nn, appEditorFileTemplate as nr, getOrCreateSourceFile as nt, pruneManifestSection as o, getActionInputName as on, appFoldersFileTemplate as or, getAppMetadata as ot, scalars as p, documentModelGenCreatorsFileTemplate as pn, configSpec as pt, getProperyAssignmentByName as q, documentModelsIndexTemplate as qn, documentModelGenReducerFileTemplate as qt, tsMorphGenerateProcessor as r, getEditorVariableNames as rn, appConfigFileTemplate as rr, getPreviousVersionSourceFile as rt, makeModulesIndexFile as s, getActionInputTypeNames as sn, appFilesFileTemplate as sr, getEditorMetadata as st, makeSubgraphsIndexFile as t, getDocumentModelSpecByVersionNumber as tn, agentsTemplate as tr, getOrCreateDirectory as tt, tsMorphGenerateDocumentModel as u, documentModelGenIndexFileTemplate as un, appDriveContentsFileTemplate as ur, runPrettier as ut, makeCliDocsFromHelp as v, documentEditorEditorFileTemplate as vn, subgraphLibFileTemplate as vt, writeCIFiles as w, styleTemplate as wn, relationalDbFactoryTemplate as wt, applyProjectCustomizations as x, tsConfigTemplate as xn, relationalDbProcessorTemplate as xt, writeCliDocsMarkdownFile as y, docsFromCliHelpTemplate as yn, subgraphIndexFileTemplate as yt, DEFAULT_PROJECT_OPTIONS as z, indexHtmlTemplate as zn, documentModelSrcUtilsTemplate as zt };
|
|
8563
8546
|
|
|
8564
|
-
//# sourceMappingURL=file-builders-
|
|
8547
|
+
//# sourceMappingURL=file-builders-DYFnJF60.mjs.map
|