Releases: MrRefactoring/trello.js
Releases · MrRefactoring/trello.js
Release list
v2.1.6
Fixed
Card.dueReminderis now typed asnumberinstead ofstring. The live Trello API returns this field as a number (minutes before the due date), so every card-returning endpoint could reject withZodError: expected string, received number— surfaced ongetBoardCards/getListCardsaspath [n, "dueReminder"]. Now matches the already-correctCheckItem.dueReminder.ColorSchemanow accepts the_light/_darkshade 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 raisedZodError: invalid_valueonlabels[].color, breakinggetBoardCards/getListCards. Closes #48 — thanks to @sampgoes97-ux for the detailed report.
v2.1.5
Fixed
Card.aiMetadataadded toCardSchema. The live Trello API now returns this field onCardobjects (present when a card is created or modified by an agent rather than a human member); it was silently stripped in normal mode and raisedZodError: unrecognized_keysin strict/audit mode (pnpm audit:schemas), breaking every card-returning endpoint —getCard,getActionCard,getNotificationCard,createCard,updateCard,getBoardCards,getBoardCardsByFilter,getListCards,getMemberCards, andgetChecklistCards.
Internal
- Dev dependencies bumped:
eslint10.5.0 → 10.6.0,prettier3.8.4 → 3.9.4,tsx4.22.4 → 4.22.5,typescript-eslint8.62.0 → 8.62.1,vite8.1.0 → 8.1.3.
v2.1.4
Fixed
BoardMyPrefs.aiGoogleChatEnabledadded toBoardMyPrefsSchema. The live Trello API now returns this field onBoardMyPrefsobjects; it was silently stripped in normal mode and raisedZodError: unrecognized_keysin strict/audit mode (pnpm audit:schemas), breaking themyPrefs-returning board endpointsupdateBoardShowSidebar,updateBoardShowSidebarMembers,updateBoardShowSidebarBoardActions,updateBoardShowSidebarActivity,updateBoardEmailPosition,updateBoardEmailList, andgenerateBoardEmailKey.
Internal
- Dev dependencies bumped:
eslint10.4.1 → 10.5.0,typescript-eslint8.60.1 → 8.62.0,vite8.0.16 → 8.1.0,vitest/@vitest/coverage-v84.1.8 → 4.1.9,prettier3.8.3 → 3.8.4,globals17.6.0 → 17.7.0,@arethetypeswrong/cli0.18.3 → 0.18.4,@types/node22.19.20 → 22.20.0.
v2.1.3
Fixed
Action.agenticIdentityadded toActionSchema. The live Trello API now returns this field onActionobjects; it was silently stripped in normal mode and raisedZodError: unrecognized_keysin strict/audit mode (pnpm audit:schemas), breaking the action-returning endpointsgetCardActions,getListActions,getMemberActions,getOrganizationActions, andcreateCardComment.
v2.1.2
Fixed
Label.idOrganizationandLabel.nodeIdadded toLabelSchema. The live Trello API returns both fields on everyLabelobject; they were silently stripped in normal mode and raisedZodError: unrecognized_keysin strict/audit mode (pnpm audit:schemas).
Internal
- Live tests (
pnpm test:live) now always run withTRELLO_STRICT_SCHEMAS=true. Previously strict validation was only applied in the dailypnpm audit:schemasrun, meaning new undocumented API fields could go undetected until the nightly workflow. viteadded as a direct dev dependency at^8.0.0.vitest@4dropped support for vite 5; without an explicitvite@8entry the startup errorERR_PACKAGE_PATH_NOT_EXPORTED: Package subpath './module-runner' is not definedblocked all test runs.batchnamespace wiring (createBatchRunner) is now emitted directly byapis-code-genvia a newnamespaceOverridesmechanism in the generator config — no manual post-sync patch required.ActionFieldValueandCardFieldValueare now included in the generated API reference (previously suppressed viaintentionallyNotExportedintypedoc.json).- Regenerated
src/api,src/models,src/parametersfrom the latest Trello OpenAPI spec (JSDoc line-wrapping only — no functional changes).
v2.1.1
Added
skipParsingclient option. Whentrue,schema.parse()is not called on successful responses — neither Zod validation nor transforms run, so date fields remain plain strings rather thanDateobjects. Defaults tofalse. 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 aftercomma-separated list ofis now optional, covering bare-prose descriptions such assearch.organizationFields("All or a comma-separated list of billableMemberCount, desc…").getBoard.fieldsandsearch.organizationFieldsnow acceptz.enum([...])or an array thereof alongside the free-formstring | string[], and their JSDoc renders each valid value as inline code. Loose string branches retained — non-breaking.
Fixed
Card.agentis now nullable in the response schema. The live API returnsagent: null, which previously raisedZodError: expected object, received nullon every endpoint that returns aCardorCard[]— includinggetListCardsandgetBoardCards, where it surfaced aspath [0, "agent"]. Closes #42 — thanks to @Phyroks for the detailed report.Card.checkItemStatesis now typed asCheckItemState[](objects withidCheckItemandstate) instead ofstring[]. The live API returns objects here, sogetBoardCards/getListCardscould reject withZodError: expected string, received object. Surfaced while adding regression tests for #42.
v2.1.0
✨ Highlights
v2.1.0 brings typed enum branches across parameters and native $ref resolution in the codegen — fully backward-compatible.
Added
- Native
$refresolution in codegen —apis-code-gennow resolves$refschemas in parameter and request-body positions instead of falling back toz.unknown(). The per-config inlining patches are gone. - Typed
idpath params — every{id}operation now generatesid: TrelloIDSchemainstead ofz.unknown()(200+ parameter files). - Typed
fieldsparams —fields/memberFields/stickerFields/etc. now accept a documentedz.enum([...])(or array) in addition to the free-formstring | string[]. CoversAction,Attachment,Board,Card,Member,Notification,Organization,Token, plus newly-seeded enums forList,Checklist,Sticker,Label,CustomEmoji. - Typed enum params —
color,filter, positioning (pos:top/bottom/ number) and inline-documented enums are now properz.union/z.enumtypes. - New generated models:
ChecklistFieldsSchema,StickerFieldsSchema,LabelFieldsSchema,CustomEmojiFieldsSchema, expandedListFieldsSchema/OrganizationFieldsSchema/MemberFieldsSchema.
Fixed
Card.labelsis now correctly typed as an array ofLabelobjects, not IDs.
Deprecated
TrelloIDtype alias andTrelloIDSchemaexport 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
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:
BaseClientand thetrello.js/out/apisubpath are removed. UsecreateClientfromtrello.js/coreplus 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@3tozod@4.ZodTypeDefwas removed in Zod 4 — if you typed schemas manually withZodType<T, ZodTypeDef, unknown>, switch toZodType<T>. - TypeScript 6: built with TypeScript 6,
verbatimModuleSyntax,stripInternal. - Removed phantom
applicationsnamespace 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
ZodErrorat 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"]inpackage.json— restricts npm tarball contents (previously leaked.claude/settings.local.json,.prettierrc)."publishConfig"withaccess: publicandprovenance: true.
Fixed
search.searchreturn type — Trello returns{cards, boards, members, organizations}, not a flat array.organizations.createOrganization,getOrganizationMembership,createOrganizationTag,updateOrganizationMember,deactivateOrganizationMember,uploadOrganizationLogo,updateOrganizationMembersreturn types corrected.plugins.getPluginMemberPrivacyCompliancetyped asvoid(wasunknown).tokens.updateTokenWebhooktyped asvoid.*Fieldendpoints (getActionField,getBoardField,getCardField,getChecklistField,getMemberField,getNotificationField,getOrganizationField,getWebhookField) return a genericFieldValue<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 asnullare typedT | null | undefined, the rest are justT | undefined(no spuriousnullin the type); corrected field types onMember,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/Prefsand 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=trueswitches them to strict mode (pnpm audit:schemas) — undocumented keys then raise aZodError, 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 untypedlimits, image-scaled arrays, plugin metadata, board prefs and similar objects are now fully typed instead of loose records. - Removed runtime dependency on
tslibandaxios. - Test framework migrated from
avatovitest. - ESLint config consolidated; flat config (
eslint.config.ts).
v1.2.8
- Fixes
- Fixed return type interface for the following methods:
boards.getBoardCustomFieldscustomFields.createCustomFieldcustomFields.getCustomFieldcustomFields.updateCustomField
- Fixed return type interface for the following methods:
Thanks to FiliRezGelly for the fix in PR #28.
v1.2.7
What's Changed
- v1.2.7 by @MrRefactoring in #26
Changelog
- #25:
beforeandsinceparameters added togetMemberActionsendpoint.