anear-js-api 1.3.3 → 1.4.0

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.
@@ -2298,6 +2298,15 @@ const AnearEventMachineFunctions = ({
2298
2298
  // Log and proceed without rehydration
2299
2299
  logger.warn('[AEM] Failed to fetch or parse app_event_context. Starting clean.', e)
2300
2300
  }
2301
+ } else {
2302
+ // For CREATE_EVENT, check for initial_context from event attributes
2303
+ // This is a partial context object that will be merged with defaults in the AppM
2304
+ const initialContext = context.anearEvent.attributes['initial-context'] ||
2305
+ context.anearEvent.attributes.initial_context
2306
+ if (initialContext && typeof initialContext === 'object' && !Array.isArray(initialContext)) {
2307
+ actorInput = initialContext
2308
+ logger.debug(`[AEM] Using initial_context (partial) from event for ${context.anearEvent.id}`, initialContext)
2309
+ }
2301
2310
  }
2302
2311
 
2303
2312
  // Observe AppM transitions with full event payloads.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anear-js-api",
3
- "version": "1.3.3",
3
+ "version": "1.4.0",
4
4
  "description": "Javascript Developer API for Anear Apps",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {