@adobe-commerce/aio-toolkit 1.0.16 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +4 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2970,12 +2970,13 @@ var _PublishEvent = class _PublishEvent {
|
|
|
2970
2970
|
* @param providerId - The Adobe I/O Events provider ID
|
|
2971
2971
|
* @param eventCode - The event type identifier (e.g., 'commerce.order.created')
|
|
2972
2972
|
* @param payload - The event payload data
|
|
2973
|
+
* @param eventId - Optional custom event ID; if not provided, a UUID will be generated
|
|
2973
2974
|
* @param subject - Optional subject for the event
|
|
2974
2975
|
* @returns Promise<PublishEventResult> - The publish result
|
|
2975
2976
|
*
|
|
2976
2977
|
* @throws Error when providerId or eventCode is invalid or publishing fails
|
|
2977
2978
|
*/
|
|
2978
|
-
async execute(providerId, eventCode, payload, subject) {
|
|
2979
|
+
async execute(providerId, eventCode, payload, eventId, subject) {
|
|
2979
2980
|
try {
|
|
2980
2981
|
if (!providerId?.trim()) {
|
|
2981
2982
|
throw new Error("providerId is required and cannot be empty");
|
|
@@ -2987,7 +2988,7 @@ var _PublishEvent = class _PublishEvent {
|
|
|
2987
2988
|
throw new Error("payload is required");
|
|
2988
2989
|
}
|
|
2989
2990
|
this.customLogger.info(`Publishing event to provider: ${providerId}`);
|
|
2990
|
-
|
|
2991
|
+
eventId = eventId ?? uuidv4();
|
|
2991
2992
|
const cloudEvent = new CloudEvent({
|
|
2992
2993
|
id: eventId,
|
|
2993
2994
|
source: `urn:uuid:${providerId}`,
|