logto-io / logto

🧑‍🚀 The better identity infrastructure for developers and the open-source alternative to Auth0.
https://logto.io
Mozilla Public License 2.0
8.15k stars 395 forks source link

feat(core,schemas): introduce new PUT experience API #6212

Closed simeng-li closed 1 month ago

simeng-li commented 1 month ago

Summary

Introduce new PUT experience API. See RFC update for more details.

This PR adds two new experience root-level endpoints:

Also includes the following refactoring:

  1. Update the identification endpoint payload. InteractionEvent is removed from the body. Per our latest design, the interaction event should be specified ahead by calling the newly added PUT /experience API.
  2. Update the ExperienceInteraction class constructor. Make the interactionDetails input optional. If no interactionDetails value is provided, create a brand new empty instance.
  3. Append the "interaction-data" to all the logEntries on save. This can attach the latest interaction status context to all the audit logs created during the interaction.

Testing

Interaction case added.

Checklist

github-actions[bot] commented 1 month ago

COMPARE TO master

Total Size Diff :chart_with_upwards_trend: +3.64 KB

Diff by File |Name|Diff| |---|---| |packages/core/src/routes/experience/classes/experience-interaction.ts|:chart_with_upwards_trend: +143 Bytes| |packages/core/src/routes/experience/index.ts|:chart_with_upwards_trend: +1.22 KB| |packages/core/src/routes/experience/middleware/koa-experience-interaction.ts|:chart_with_upwards_trend: +129 Bytes| |packages/integration-tests/src/client/experience/index.ts|:chart_with_upwards_trend: +533 Bytes| |packages/integration-tests/src/helpers/experience/index.ts|:chart_with_upwards_trend: +103 Bytes| |packages/integration-tests/src/tests/api/experience-api/interaction.test.ts|:chart_with_upwards_trend: +1.26 KB| |packages/schemas/src/types/interactions.ts|:chart_with_upwards_trend: +285 Bytes|