{"version":3,"file":"storage-list-workflow-runs.mjs","names":[],"sources":["../../../src/codemods/v1/storage-list-workflow-runs.ts"],"sourcesContent":["import { createTransformer } from '../lib/create-transformer';\nimport { trackMultipleClassInstances, renameMethod } from '../lib/utils';\n\n/**\n * Renames storage.getWorkflowRuns() to storage.listWorkflowRuns().\n * This aligns with the convention that list* methods return collections.\n *\n * Before:\n * const runs = await storage.getWorkflowRuns({ fromDate, toDate });\n *\n * After:\n * const runs = await storage.listWorkflowRuns({ fromDate, toDate });\n */\nexport default createTransformer((_fileInfo, _api, _options, context) => {\n  const { j, root } = context;\n\n  const storeTypes = ['PostgresStore', 'LibSQLStore', 'PgStore', 'DynamoDBStore', 'MongoDBStore', 'MSSQLStore'];\n\n  // Track all store instances in a single optimized pass\n  const storageInstances = trackMultipleClassInstances(j, root, storeTypes);\n  const count = renameMethod(j, root, storageInstances, 'getWorkflowRuns', 'listWorkflowRuns');\n\n  if (count > 0) {\n    context.hasChanges = true;\n    context.messages.push('Renamed getWorkflowRuns to listWorkflowRuns on storage instances');\n  }\n});\n"],"mappings":";;;;;;;;;;;;;AAaA,IAAA,qCAAe,mBAAmB,WAAW,MAAM,UAAU,YAAY;CACvE,MAAM,EAAE,GAAG,SAAS;CAQpB,IAFc,aAAa,GAAG,MADL,4BAA4B,GAAG,MAAM;EAH1C;EAAiB;EAAe;EAAW;EAAiB;EAAgB;CAGzB,CACpB,GAAG,mBAAmB,kBAEjE,IAAI,GAAG;EACb,QAAQ,aAAa;EACrB,QAAQ,SAAS,KAAK,kEAAkE;CAC1F;AACF,CAAC"}