{"record":{"id":"2a10e9e2dbb3c955","repo":"ruvnet/ruflo","slug":"oldapi-is-deprecated-since-mapping-since","errorCode":null,"errorMessage":"'${oldAPI}' is deprecated since ${mapping.since}. Use '${mapping.replacement}' instead.","messagePattern":"'(.+?)' is deprecated since (.+?)\\. Use '(.+?)' instead\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/integration/src/sdk-bridge.ts","lineNumber":199,"sourceCode":"   */\n  translateDeprecatedAPI(\n    oldAPI: string,\n    args: unknown[]\n  ): { newAPI: string; args: unknown[] } | null {\n    const mapping = DEPRECATED_API_MAP[oldAPI];\n    if (!mapping) {\n      return null;\n    }\n\n    // Emit deprecation warning (once per API)\n    if (!this.deprecationWarnings.has(oldAPI)) {\n      this.deprecationWarnings.add(oldAPI);\n      const message = `'${oldAPI}' is deprecated since ${mapping.since}. ` +\n        `Use '${mapping.replacement}' instead.`;\n\n      switch (this.config.fallbackBehavior) {\n        case 'error':\n          throw new Error(message);\n        case 'warn':\n          console.warn(`[DEPRECATED] ${message}`);\n          this.emit('deprecation-warning', { oldAPI, mapping });\n          break;\n        case 'silent':\n          // Log but don't warn\n          break;\n      }\n    }\n\n    const newArgs = mapping.transformer ? mapping.transformer(args) : args;\n    return { newAPI: mapping.replacement, args: newArgs };\n  }\n\n  /**\n   * Wrap an API call with compatibility handling\n   */\n  async wrapAPICall<T>(","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/integration/src/sdk-bridge.ts#L181-L217","documentation":"When a call goes through a mapped deprecated API, SDKBridge emits a deprecation once per API; with config.fallbackBehavior set to 'error' that warning becomes a thrown Error instead of an automatic migration, halting the legacy call.","triggerScenarios":"Invoking any oldAPI present in the bridge's deprecation mapping while fallbackBehavior === 'error' — the first such call for that API throws (the deprecationWarning fires once per API per bridge instance).","commonSituations":"Upgrading the integration package where fallbackBehavior changed to (or defaulted to) 'error'; CI setups that enforce migration by failing on legacy calls; older code paths still using pre-migration API names.","solutions":["Migrate the call: use mapping.replacement (the bridge generates before/after snippets — use them)","During migration, set fallbackBehavior to 'warn' so legacy calls keep working while you port them; flip to 'error' once the inventory is empty","Subscribe to the 'deprecation-warning' event to enumerate every legacy call still in use"],"exampleFix":"// before\nconst bridge = new SDKBridge({ fallbackBehavior: 'error' }); // first legacy call throws\nawait bridge.call('old.api.name', args);\n\n// after\nconst bridge = new SDKBridge({ fallbackBehavior: 'warn' }); // keep shipping while migrating\nawait bridge.call('new.api.name', args); // per the mapping's replacement","handlingStrategy":"fallback","validationCode":"// Inventory legacy usage before enforcing 'error' mode\nconst legacyCalls = new Set<string>();\nbridge.on('deprecation-warning', ({ oldAPI, mapping }) => {\n  legacyCalls.add(`${oldAPI} -> ${mapping.replacement}`);\n});\nif (legacyCalls.size > 0) console.warn('still deprecated:', [...legacyCalls]);","typeGuard":null,"tryCatchPattern":"try {\n  await bridge.call(api, args);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('is deprecated since')) {\n    // parse the replacement name from the message and route to it — a migration signal, not a transient fault\n  }\n  throw e;\n}","preventionTips":["Run with fallbackBehavior 'warn' in dev to collect the full deprecation inventory","Gate CI on zero deprecation-warning events before switching to 'error'","Wrap bridged calls behind your own facade so renames happen in one place"],"tags":["deprecation","migration","sdk","configuration"],"backgroundTag":"deprecated-api-called","analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}