Skip to content

Releases: MrRefactoring/trello.js

v2.1.6

Choose a tag to compare

@github-actions github-actions released this 05 Jul 20:22
5bd9e20

Fixed

  • Card.dueReminder is now typed as number instead of string. The live Trello API returns this field as a number (minutes before the due date), so every card-returning endpoint could reject with ZodError: expected string, received number — surfaced on getBoardCards / getListCards as path [n, "dueReminder"]. Now matches the already-correct CheckItem.dueReminder.
  • ColorSchema now accepts the _light / _dark shade variants (e.g. sky_dark, green_light). The documented palette is 10 base colors, but the live API also returns the shade variants introduced in the May 2023 label redesign (30 values total); a label using one raised ZodError: invalid_value on labels[].color, breaking getBoardCards / getListCards. Closes #48 — thanks to @sampgoes97-ux for the detailed report.

v2.1.5

Choose a tag to compare

@github-actions github-actions released this 04 Jul 18:28
4ecf5ce

Fixed

  • Card.aiMetadata added to CardSchema. The live Trello API now returns this field on Card objects (present when a card is created or modified by an agent rather than a human member); it was silently stripped in normal mode and raised ZodError: unrecognized_keys in strict/audit mode (pnpm audit:schemas), breaking every card-returning endpoint — getCard, getActionCard, getNotificationCard, createCard, updateCard, getBoardCards, getBoardCardsByFilter, getListCards, getMemberCards, and getChecklistCards.

Internal

  • Dev dependencies bumped: eslint 10.5.0 → 10.6.0, prettier 3.8.4 → 3.9.4, tsx 4.22.4 → 4.22.5, typescript-eslint 8.62.0 → 8.62.1, vite 8.1.0 → 8.1.3.

v2.1.4

Choose a tag to compare

@github-actions github-actions released this 24 Jun 20:12
3593419

Fixed

  • BoardMyPrefs.aiGoogleChatEnabled added to BoardMyPrefsSchema. The live Trello API now returns this field on BoardMyPrefs objects; it was silently stripped in normal mode and raised ZodError: unrecognized_keys in strict/audit mode (pnpm audit:schemas), breaking the myPrefs-returning board endpoints updateBoardShowSidebar, updateBoardShowSidebarMembers, updateBoardShowSidebarBoardActions, updateBoardShowSidebarActivity, updateBoardEmailPosition, updateBoardEmailList, and generateBoardEmailKey.

Internal

  • Dev dependencies bumped: eslint 10.4.1 → 10.5.0, typescript-eslint 8.60.1 → 8.62.0, vite 8.0.16 → 8.1.0, vitest / @vitest/coverage-v8 4.1.8 → 4.1.9, prettier 3.8.3 → 3.8.4, globals 17.6.0 → 17.7.0, @arethetypeswrong/cli 0.18.3 → 0.18.4, @types/node 22.19.20 → 22.20.0.

v2.1.3

Choose a tag to compare

@github-actions github-actions released this 07 Jun 19:45
3ad4ae6

Fixed

  • Action.agenticIdentity added to ActionSchema. The live Trello API now returns this field on Action objects; it was silently stripped in normal mode and raised ZodError: unrecognized_keys in strict/audit mode (pnpm audit:schemas), breaking the action-returning endpoints getCardActions, getListActions, getMemberActions, getOrganizationActions, and createCardComment.

v2.1.2

Choose a tag to compare

@github-actions github-actions released this 01 Jun 15:09
2de500f

Fixed

  • Label.idOrganization and Label.nodeId added to LabelSchema. The live Trello API returns both fields on every Label object; they were silently stripped in normal mode and raised ZodError: unrecognized_keys in strict/audit mode (pnpm audit:schemas).

Internal

  • Live tests (pnpm test:live) now always run with TRELLO_STRICT_SCHEMAS=true. Previously strict validation was only applied in the daily pnpm audit:schemas run, meaning new undocumented API fields could go undetected until the nightly workflow.
  • vite added as a direct dev dependency at ^8.0.0. vitest@4 dropped support for vite 5; without an explicit vite@8 entry the startup error ERR_PACKAGE_PATH_NOT_EXPORTED: Package subpath './module-runner' is not defined blocked all test runs.
  • batch namespace wiring (createBatchRunner) is now emitted directly by apis-code-gen via a new namespaceOverrides mechanism in the generator config — no manual post-sync patch required.
  • ActionFieldValue and CardFieldValue are now included in the generated API reference (previously suppressed via intentionallyNotExported in typedoc.json).
  • Regenerated src/api, src/models, src/parameters from the latest Trello OpenAPI spec (JSDoc line-wrapping only — no functional changes).

v2.1.1

Choose a tag to compare

@github-actions github-actions released this 31 May 11:20
6d72b32

Added

  • skipParsing client option. When true, schema.parse() is not called on successful responses — neither Zod validation nor transforms run, so date fields remain plain strings rather than Date objects. Defaults to false. Use as an escape hatch against schema drift or to skip parsing overhead on large responses.
  • Typed enum literals for params whose valid values were listed inline as plain prose — no backticks and no [fields](...) doc link — so the previous heuristics skipped them. The colon after comma-separated list of is now optional, covering bare-prose descriptions such as search.organizationFields ("All or a comma-separated list of billableMemberCount, desc…"). getBoard.fields and search.organizationFields now accept z.enum([...]) or an array thereof alongside the free-form string | string[], and their JSDoc renders each valid value as inline code. Loose string branches retained — non-breaking.

Fixed

  • Card.agent is now nullable in the response schema. The live API returns agent: null, which previously raised ZodError: expected object, received null on every endpoint that returns a Card or Card[] — including getListCards and getBoardCards, where it surfaced as path [0, "agent"]. Closes #42 — thanks to @Phyroks for the detailed report.
  • Card.checkItemStates is now typed as CheckItemState[] (objects with idCheckItem and state) instead of string[]. The live API returns objects here, so getBoardCards / getListCards could reject with ZodError: expected string, received object. Surfaced while adding regression tests for #42.

v2.1.0

Choose a tag to compare

@MrRefactoring MrRefactoring released this 25 May 19:37

✨ Highlights

v2.1.0 brings typed enum branches across parameters and native $ref resolution in the codegen — fully backward-compatible.

Added

  • Native $ref resolution in codegenapis-code-gen now resolves $ref schemas in parameter and request-body positions instead of falling back to z.unknown(). The per-config inlining patches are gone.
  • Typed id path params — every {id} operation now generates id: TrelloIDSchema instead of z.unknown() (200+ parameter files).
  • Typed fields paramsfields/memberFields/stickerFields/etc. now accept a documented z.enum([...]) (or array) in addition to the free-form string | string[]. Covers Action, Attachment, Board, Card, Member, Notification, Organization, Token, plus newly-seeded enums for List, Checklist, Sticker, Label, CustomEmoji.
  • Typed enum paramscolor, filter, positioning (pos: top / bottom / number) and inline-documented enums are now proper z.union / z.enum types.
  • New generated models: ChecklistFieldsSchema, StickerFieldsSchema, LabelFieldsSchema, CustomEmojiFieldsSchema, expanded ListFieldsSchema / OrganizationFieldsSchema / MemberFieldsSchema.

Fixed

  • Card.labels is now correctly typed as an array of Label objects, not IDs.

Deprecated

  • TrelloID type alias and TrelloIDSchema export are deprecated (inlined in codegen).

ℹ️ All loose string / string[] branches are retained — non-breaking, undocumented field names still accepted.

Full changelog: CHANGELOG.md

v2.0.0

Choose a tag to compare

@MrRefactoring MrRefactoring released this 19 May 20:59
04e82df

A substantial rewrite. The public surface changed in several places — see the v1 → v2 migration guide for upgrade steps.

Breaking

  • Client construction: new TrelloClient({ key, token })createTrelloClient({ apiKey, apiToken }). The class form is gone — replaced by a factory function.
  • Tree-shaking imports: BaseClient and the trello.js/out/api subpath are removed. Use createClient from trello.js/core plus per-namespace subpath imports (trello.js/boards, trello.js/cards, …).
  • Module system: package is now ESM-only ("type": "module"). No CJS build is shipped. Consumers must use "type": "module" or a bundler.
  • Node baseline: minimum Node.js 22.
  • Zod 4: dependency upgraded from zod@3 to zod@4. ZodTypeDef was removed in Zod 4 — if you typed schemas manually with ZodType<T, ZodTypeDef, unknown>, switch to ZodType<T>.
  • TypeScript 6: built with TypeScript 6, verbatimModuleSyntax, stripInternal.
  • Removed phantom applications namespace that was previously listed but never implemented.

Added

  • Subpath exports for every namespace — trello.js/core, trello.js/actions, trello.js/batch, trello.js/boards, trello.js/cards, trello.js/checklists, trello.js/customFields, trello.js/emoji, trello.js/enterprises, trello.js/labels, trello.js/lists, trello.js/members, trello.js/notifications, trello.js/organizations, trello.js/plugins, trello.js/search, trello.js/tokens, trello.js/webhooks. Bundlers tree-shake unused namespaces.
  • Runtime response validation via Zod 4 schemas on every successful response. Drift between docs and reality surfaces as ZodError at the call site instead of silently corrupted data.
  • Automatic 429 retry with exponential backoff (2 s, 4 s, 8 s, then a final attempt).
  • Documentation site at https://mrrefactoring.github.io/trello.js/ — guides, recipes, full API reference, English + Russian.
  • Test suite — 71 unit tests (covering createClient, buildUrl, public API contract snapshot, codemod, actions-list query params) plus live integration tests for boards, cards, search, webhooks, organizations, plugins, tokens.
  • "files": ["dist", "CHANGELOG.md"] in package.json — restricts npm tarball contents (previously leaked .claude/settings.local.json, .prettierrc).
  • "publishConfig" with access: public and provenance: true.

Fixed

  • search.search return type — Trello returns {cards, boards, members, organizations}, not a flat array.
  • organizations.createOrganization, getOrganizationMembership, createOrganizationTag, updateOrganizationMember, deactivateOrganizationMember, uploadOrganizationLogo, updateOrganizationMembers return types corrected.
  • plugins.getPluginMemberPrivacyCompliance typed as void (was unknown).
  • tokens.updateTokenWebhook typed as void.
  • *Field endpoints (getActionField, getBoardField, getCardField, getChecklistField, getMemberField, getNotificationField, getOrganizationField, getWebhookField) return a generic FieldValue<T> ({ _value: T }) — previously some discarded the response body (void) or were typed as the full entity.
  • Response schemas reconciled with the live API: every entity always carries a required id; nullability is now precise — fields the API genuinely returns as null are typed T | null | undefined, the rest are just T | undefined (no spurious null in the type); corrected field types on Member, Board, Checklist, CheckItem, Emoji, Memberships, and several enums (avatarSource, loginTypes, permissionLevel, voting, modelType); added many real response fields the swagger omitted (Board/Card/Member/Organization/Prefs and more).

Internal

  • All API/model/parameter source is now generated from the Trello OpenAPI spec — generated directories should not be hand-edited.
  • Response object schemas strip unknown keys by default, so a new field added by the Trello API never breaks validation. Setting TRELLO_STRICT_SCHEMAS=true switches them to strict mode (pnpm audit:schemas) — undocumented keys then raise a ZodError, used to surface gaps between the schemas and the live API.
  • Stronger typing of nested data: shared shapes (Limits, LimitValue, ImageDescriptor, SwitcherView) are extracted into reusable schemas, and previously untyped limits, image-scaled arrays, plugin metadata, board prefs and similar objects are now fully typed instead of loose records.
  • Removed runtime dependency on tslib and axios.
  • Test framework migrated from ava to vitest.
  • ESLint config consolidated; flat config (eslint.config.ts).

v1.2.8

Choose a tag to compare

@MrRefactoring MrRefactoring released this 20 Apr 18:40
3ea6d5d
  • Fixes
    • Fixed return type interface for the following methods:
      • boards.getBoardCustomFields
      • customFields.createCustomField
      • customFields.getCustomField
      • customFields.updateCustomField

Thanks to FiliRezGelly for the fix in PR #28.

v1.2.7

Choose a tag to compare

@MrRefactoring MrRefactoring released this 07 May 16:33

What's Changed

Changelog

  • #25: before and since parameters added to getMemberActions endpoint.