Agent skill

appfolio-upgrade-migration

Migrate between AppFolio API versions and handle endpoint changes. Trigger: "appfolio upgrade".

Stars 1,803
Forks 241

Install this agent skill to your Project

npx add-skill https://github.com/jeremylongshore/claude-code-plugins-plus-skills/tree/main/plugins/saas-packs/appfolio-pack/skills/appfolio-upgrade-migration

SKILL.md

appfolio upgrade migration | sed 's/\b(.)/\u\1/g'

API Version Migration

typescript
// Adapter pattern for API version changes
class AppFolioVersionAdapter {
  private version: "v1" | "v2";
  private client: any;

  constructor(version: "v1" | "v2" = "v1") {
    this.version = version;
  }

  async getProperties(): Promise<any[]> {
    if (this.version === "v2") {
      // v2 may return paginated results
      return this.paginatedGet("/properties");
    }
    return (await this.client.get("/properties")).data;
  }

  private async paginatedGet(path: string): Promise<any[]> {
    const results: any[] = [];
    let cursor: string | null = null;
    do {
      const { data } = await this.client.get(path, { params: { cursor } });
      results.push(...data.results);
      cursor = data.next_cursor;
    } while (cursor);
    return results;
  }
}

Resources

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results