{"version":3,"file":"storage-list-messages-by-id.mjs","names":[],"sources":["../../../src/codemods/v1/storage-list-messages-by-id.ts"],"sourcesContent":["import { createTransformer } from '../lib/create-transformer';\nimport { trackMultipleClassInstances, renameMethod } from '../lib/utils';\n\n/**\n * Renames storage.getMessagesById() to storage.listMessagesById().\n * This aligns with the convention that list* methods return collections.\n *\n * Before:\n * const result = await storage.getMessagesById({\n *   messageIds: ['msg-1', 'msg-2'],\n * });\n *\n * After:\n * const result = await storage.listMessagesById({\n *   messageIds: ['msg-1', 'msg-2'],\n * });\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, 'getMessagesById', 'listMessagesById');\n\n  if (count > 0) {\n    context.hasChanges = true;\n    context.messages.push('Renamed getMessagesById to listMessagesById on storage instances');\n  }\n});\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,IAAA,sCAAe,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"}