Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/aep-mobile/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@adobe/griffon-toolkit-aep-mobile",
"description": "Events definitions for the AEP Mobile SDK",
"version": "0.13.0",
"version": "0.14.0",
"repository": {
"type": "git",
"url": "https://github.com/adobe/griffon-toolkit.git",
Expand Down
22 changes: 17 additions & 5 deletions packages/aep-mobile/schemas/personalizationEdgeRequest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
"$id": "http://griffon.adobe.com/schemas/aep-mobile/personalizationEdgeRequest",
"shortDesc": "Edge Personalization Request",
"group": "event",
"allOf": [{ "$ref": "http://griffon.adobe.com/schemas/aep-mobile/edgeRequest" }],
"allOf": [
{
"$ref": "http://griffon.adobe.com/schemas/aep-mobile/edgeRequest"
}
],
"type": "object",
"properties": {
"payload": {
Expand All @@ -21,22 +25,30 @@
"description": "The type of event on the edge to execute",
"alias": "edgeEventType",
"type": "string",
"const": "personalization.request"
"enum": [
"personalization.request",
"decisioning.propositionFetch"
]
}
},
"required": [ "eventType" ]
"required": [
"eventType"
]
},
"query": {
"inherit": true,
"type": "object"
}
},
"required": [ "xdm", "query" ]
"required": [
"xdm",
"query"
]
}
},
"required": [
"ACPExtensionEventData"
]
}
}
}
}
12 changes: 10 additions & 2 deletions packages/aep-mobile/src/iamMessagesRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ governing permissions and limitations under the License.

import * as kit from '@adobe/griffon-toolkit';
import schema from '../schemas/iamMessagesRequest.json';
import {
edgeEventTypeMatcher,
LEGACY_EDGE_EVENT_TYPE,
PROPOSITION_FETCH_EDGE_EVENT_TYPE
} from './personalizationFetchEventTypes';

/**
* Contains constants and functions for a IAM Messages Request.
Expand Down Expand Up @@ -245,7 +250,7 @@ const getSurfaces = kit.search(path.surfaces);
*/
const matcher = kit.combineAll([
'payload.ACPExtensionEventData.query.personalization.surfaces',
'payload.ACPExtensionEventData.xdm.eventType==`personalization.request`',
edgeEventTypeMatcher,
kit.combineAny([
'payload.ACPExtensionEventSource==`com.adobe.eventSource.requestContent`',
'payload.ACPExtensionEventSource==`com.adobe.eventsource.requestcontent`'
Expand Down Expand Up @@ -312,7 +317,10 @@ const mock = (input) => kit.expandWithPaths(path, {
/* ADD CUSTOM CONTENT BELOW */

// additional exports should be added here:
const customExports = {};
const customExports = {
LEGACY_EDGE_EVENT_TYPE,
PROPOSITION_FETCH_EDGE_EVENT_TYPE
};

/* END CUSTOM CONTENT */
/* The content below is autogenerated. Do not make any changes */
Expand Down
1 change: 1 addition & 0 deletions packages/aep-mobile/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// created from ctix

export * from './personalizationFetchEventTypes';
export { default as analyticsResponse } from './analyticsResponse';
export { default as applicationLaunch } from './applicationLaunch';
export { default as applicationUpgrade } from './applicationUpgrade';
Expand Down
12 changes: 10 additions & 2 deletions packages/aep-mobile/src/optimizeMessagesRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ governing permissions and limitations under the License.

import * as kit from '@adobe/griffon-toolkit';
import schema from '../schemas/optimizeMessagesRequest.json';
import {
edgeEventTypeMatcher,
LEGACY_EDGE_EVENT_TYPE,
PROPOSITION_FETCH_EDGE_EVENT_TYPE
} from './personalizationFetchEventTypes';

/**
* Contains constants and functions for a Optimize Messages Request.
Expand Down Expand Up @@ -245,7 +250,7 @@ const getDecisionScopes = kit.search(path.decisionScopes);
*/
const matcher = kit.combineAll([
'payload.ACPExtensionEventData.query.personalization.decisionScopes',
'payload.ACPExtensionEventData.xdm.eventType==`personalization.request`',
edgeEventTypeMatcher,
kit.combineAny([
'payload.ACPExtensionEventSource==`com.adobe.eventSource.requestContent`',
'payload.ACPExtensionEventSource==`com.adobe.eventsource.requestcontent`'
Expand Down Expand Up @@ -312,7 +317,10 @@ const mock = (input) => kit.expandWithPaths(path, {
/* ADD CUSTOM CONTENT BELOW */

// additional exports should be added here:
const customExports = {};
const customExports = {
LEGACY_EDGE_EVENT_TYPE,
PROPOSITION_FETCH_EDGE_EVENT_TYPE
};

/* END CUSTOM CONTENT */
/* The content below is autogenerated. Do not make any changes */
Expand Down
12 changes: 10 additions & 2 deletions packages/aep-mobile/src/personalizationEdgeRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ governing permissions and limitations under the License.

import * as kit from '@adobe/griffon-toolkit';
import schema from '../schemas/personalizationEdgeRequest.json';
import {
edgeEventTypeMatcher,
LEGACY_EDGE_EVENT_TYPE,
PROPOSITION_FETCH_EDGE_EVENT_TYPE
} from './personalizationFetchEventTypes';

/**
* Contains constants and functions for a Edge Personalization Request.
Expand Down Expand Up @@ -209,7 +214,7 @@ const getEdgeEventType = kit.search(path.edgeEventType);
* @constant
*/
const matcher = kit.combineAll([
'payload.ACPExtensionEventData.xdm.eventType==`personalization.request`',
edgeEventTypeMatcher,
kit.combineAny([
'payload.ACPExtensionEventSource==`com.adobe.eventSource.requestContent`',
'payload.ACPExtensionEventSource==`com.adobe.eventsource.requestcontent`'
Expand Down Expand Up @@ -276,7 +281,10 @@ const mock = (input) => kit.expandWithPaths(path, {
/* ADD CUSTOM CONTENT BELOW */

// additional exports should be added here:
const customExports = {};
const customExports = {
LEGACY_EDGE_EVENT_TYPE,
PROPOSITION_FETCH_EDGE_EVENT_TYPE
};

/* END CUSTOM CONTENT */
/* The content below is autogenerated. Do not make any changes */
Expand Down
38 changes: 38 additions & 0 deletions packages/aep-mobile/src/personalizationFetchEventTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
Copyright 2026 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/

import * as kit from '@adobe/griffon-toolkit';

/**
* XDM eventType sent by Mobile SDKs prior to Optimize 5.x.
* Kept for backward compatibility — Assurance must continue matching sessions
* from older SDK builds that still emit this value.
*/
export const LEGACY_EDGE_EVENT_TYPE = 'personalization.request';

/**
* XDM eventType introduced in Optimize 5.x (aepsdk-optimize-ios PR #159).
* Aligns Mobile SDK with the current XDM spec already used by Web SDK.
* Ref: MOB-24547 / PLATIR-51299
*/
export const PROPOSITION_FETCH_EDGE_EVENT_TYPE = 'decisioning.propositionFetch';

/**
* JMESPath matcher expression that accepts both the legacy and current
* XDM eventType for a personalization fetch edge request.
* Drop-in replacement for the single-value eventType clause inside
* kit.combineAll([...]) matcher definitions.
*/
export const edgeEventTypeMatcher = kit.combineAny([
`payload.ACPExtensionEventData.xdm.eventType==\`${LEGACY_EDGE_EVENT_TYPE}\``,
`payload.ACPExtensionEventData.xdm.eventType==\`${PROPOSITION_FETCH_EDGE_EVENT_TYPE}\``
]);
106 changes: 106 additions & 0 deletions packages/aep-mobile/test/personalizationFetchEventTypes.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/*
Copyright 2026 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/

import optimizeMessagesRequest from '../src/optimizeMessagesRequest';
import personalizationEdgeRequest from '../src/personalizationEdgeRequest';
import iamMessagesRequest from '../src/iamMessagesRequest';
import {
LEGACY_EDGE_EVENT_TYPE,
PROPOSITION_FETCH_EDGE_EVENT_TYPE
} from '../src/personalizationFetchEventTypes';

describe('personalizationFetchEventTypes', () => {
describe('constants', () => {
it('LEGACY_EDGE_EVENT_TYPE is the deprecated personalization.request value', () => {
expect(LEGACY_EDGE_EVENT_TYPE).toBe('personalization.request');
});

it('PROPOSITION_FETCH_EDGE_EVENT_TYPE is the current decisioning.propositionFetch value', () => {
expect(PROPOSITION_FETCH_EDGE_EVENT_TYPE).toBe('decisioning.propositionFetch');
});
});

describe('optimizeMessagesRequest backward compatibility', () => {
it('matches a legacy personalization.request optimize event', () => {
const event = optimizeMessagesRequest.mock({
edgeEventType: LEGACY_EDGE_EVENT_TYPE,
decisionScopes: ['demoLoc1']
});
expect(optimizeMessagesRequest.isMatch(event)).toBe(true);
});

it('matches a new decisioning.propositionFetch optimize event', () => {
const event = optimizeMessagesRequest.mock({
edgeEventType: PROPOSITION_FETCH_EDGE_EVENT_TYPE,
decisionScopes: ['demoLoc1']
});
expect(optimizeMessagesRequest.isMatch(event)).toBe(true);
});

it('does not match an unrelated edge event type', () => {
const event = optimizeMessagesRequest.mock({
edgeEventType: 'decisioning.propositionDisplay',
decisionScopes: ['demoLoc1']
});
expect(optimizeMessagesRequest.isMatch(event)).toBe(false);
});
});

describe('personalizationEdgeRequest backward compatibility', () => {
it('matches a legacy personalization.request edge event', () => {
const event = personalizationEdgeRequest.mock({
edgeEventType: LEGACY_EDGE_EVENT_TYPE
});
expect(personalizationEdgeRequest.isMatch(event)).toBe(true);
});

it('matches a new decisioning.propositionFetch edge event', () => {
const event = personalizationEdgeRequest.mock({
edgeEventType: PROPOSITION_FETCH_EDGE_EVENT_TYPE
});
expect(personalizationEdgeRequest.isMatch(event)).toBe(true);
});

it('does not match an unrelated edge event type', () => {
const event = personalizationEdgeRequest.mock({
edgeEventType: 'decisioning.propositionDisplay'
});
expect(personalizationEdgeRequest.isMatch(event)).toBe(false);
});
});

describe('iamMessagesRequest backward compatibility', () => {
it('matches a legacy personalization.request IAM event', () => {
const event = iamMessagesRequest.mock({
edgeEventType: LEGACY_EDGE_EVENT_TYPE,
surfaces: ['mobileapp://com.example.app']
});
expect(iamMessagesRequest.isMatch(event)).toBe(true);
});

it('matches a new decisioning.propositionFetch IAM event', () => {
const event = iamMessagesRequest.mock({
edgeEventType: PROPOSITION_FETCH_EDGE_EVENT_TYPE,
surfaces: ['mobileapp://com.example.app']
});
expect(iamMessagesRequest.isMatch(event)).toBe(true);
});

it('does not match an unrelated edge event type', () => {
const event = iamMessagesRequest.mock({
edgeEventType: 'decisioning.propositionDisplay',
surfaces: ['mobileapp://com.example.app']
});
expect(iamMessagesRequest.isMatch(event)).toBe(false);
});
});
});