Skip to content

Update d2-api version and use D2ApiOptions instead of auth and baseUrl #13

Merged
adrianq merged 3 commits intodevelopmentfrom
feature/change-auth-url-api-options
Feb 24, 2026
Merged

Update d2-api version and use D2ApiOptions instead of auth and baseUrl #13
adrianq merged 3 commits intodevelopmentfrom
feature/change-auth-url-api-options

Conversation

@anagperal
Copy link
Copy Markdown
Contributor

📌 References

📝 Implementation

  • update d2-api to new version v1.20.0
  • Use D2ApiOptions instead of auth and baseUrl to config logger and expose D2ApiOptions from library: because D2Api supports additional options that may be required for certain setups to work (e.g., using a backend Axios instance or a custom agent).

📹 Screenshots/Screen capture

🔥 Notes to the tester

@anagperal anagperal changed the title Feature/change auth url api options Update d2-api version and use D2ApiOptions instead of auth and baseUrl Feb 17, 2026
@adrianq adrianq requested a review from tokland February 17, 2026 21:28
Copy link
Copy Markdown
Contributor

@tokland tokland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good

(
acc: D2TrackerEventToPost["dataValues"],
message: TrackerProgramMessages
): D2TrackerEventToPost["dataValues"] => [
Copy link
Copy Markdown
Contributor

@tokland tokland Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the reduce was already there, but just as a note -> That code looks equivalent to:

const dataValuesFromMessages = messages.map(message => ({
    dataElement: message.id,
    value: message.value,
}));
return _.concat(dataValues, dataValuesFromMessages); // or [..., ...]

It’s also more efficient, since reduce is O(n²). But more importantly, it’s more declarative. Typically, we don’t need reduce unless we’re doing some kind of stateful folding, and we use other abstractions that better capture the intent (map/fromItems/...)

@adrianq adrianq merged commit 21ecff2 into development Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants