Skip to content

CEXT-6834: Add update endpoints to lib-events - #719

Merged
iivvaannxx merged 1 commit into
mainfrom
CEXT-6834/lib-events-update-apis
Oct 2, 2026
Merged

iivvaannxx merged 1 commit into
mainfrom
CEXT-6834/lib-events-update-apis

Conversation

@iivvaannxx

Copy link
Copy Markdown
Collaborator

Description

Adds update functions to @adobe/aio-commerce-lib-events:

  • updateEventProvider (I/O): PUT {org}/{project}/{workspace}/providers/{id}. Replaces the provider; an omitted description or docsUrl resets to the provider type default.
  • updateEventMetadataForProvider (I/O): PUT .../providers/{id}/eventmetadata/{code}. Replaces the metadata; an omitted sampleEventTemplate clears the stored sample.
  • updateEventProvider (Commerce): PUT eventing/eventProvider with { eventProvider: { id, ... } }. Merges; omitted label, description and workspace_configuration keep their values.

All three are wired into the default API clients, with tests and usage.md examples.

Related Issue

CEXT-6834

Motivation and Context

CEXT-6834 plans app upgrades from live state. For events, the plan needs to update a provider's or event metadata's label and description in place instead of recreating them. The library had no update calls for these.

Notes from testing against a real ACCS SaaS sandbox:

  • PATCH on I/O providers and metadata returns a gateway 403 on the workspace path, so all three use PUT. The bare path (without org/project/workspace) also returns 403.
  • The documented PUT eventing/eventProvider/{providerId} returns 404 on SaaS. The working call is PUT eventing/eventProvider with the numeric Commerce id in the body.
  • Commerce finds the provider by id and overwrites provider_id and instance_id with the body values. Callers should read the provider first and pass its own values. The JSDoc and usage.md say so.
  • Not tested: PUT on I/O metadata that Commerce created when subscribing an event.

How Has This Been Tested?

  • Unit and msw integration tests for the new functions: method, path, body mapping, auth headers, error handling, schema validation.
  • pnpm test, pnpm typecheck and pnpm lint pass.
  • Endpoint behavior checked manually against an ACCS SaaS sandbox.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have read the DEVELOPMENT document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@changeset-bot

changeset-bot Bot commented Oct 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7f7f929

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@adobe/aio-commerce-lib-events Minor
@adobe/aio-commerce-lib-app Patch
@adobe/aio-commerce-sdk Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added with-changeset The PR contains a Changeset file. pkg: aio-commerce-lib-events Includes changes in `packages/aio-commerce-lib-events` labels Oct 2, 2026
@iivvaannxx
iivvaannxx merged commit f513024 into main Oct 2, 2026
5 checks passed
@iivvaannxx
iivvaannxx deleted the CEXT-6834/lib-events-update-apis branch October 2, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: aio-commerce-lib-events Includes changes in `packages/aio-commerce-lib-events` with-changeset The PR contains a Changeset file.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants