Skip to content

Commit

Permalink
Update metadata field name
Browse files Browse the repository at this point in the history
  • Loading branch information
limhjgrace committed Jan 18, 2023
1 parent 2213696 commit 5521627
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/event-cache/EventCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export class EventCache {
...this.sessionManager.getAttributes(),
...this.pageManager.getAttributes(),
version: webClientVersion,
'aws:installationMethod': this.installationMethod
'aws:client': this.installationMethod
};

this.events.push({
Expand Down
4 changes: 2 additions & 2 deletions src/event-cache/__tests__/EventCache.integ.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('EventCache tests', () => {
const eventCache: EventCache = Utils.createEventCache(config);
const expectedMetaData = {
version: WEB_CLIENT_VERSION,
'aws:installationMethod': INSTALL_MODULE,
'aws:client': INSTALL_MODULE,
domain: 'us-east-1.console.aws.amazon.com',
browserLanguage: 'en-US',
browserName: 'WebKit',
Expand Down Expand Up @@ -101,7 +101,7 @@ describe('EventCache tests', () => {
const eventCache: EventCache = Utils.createEventCache(config);
const expectedMetaData = {
version: WEB_CLIENT_VERSION,
'aws:installationMethod': INSTALL_MODULE,
'aws:client': INSTALL_MODULE,
domain: 'us-east-1.console.aws.amazon.com',
browserLanguage: 'en-US',
browserName: 'WebKit',
Expand Down
18 changes: 9 additions & 9 deletions src/event-cache/__tests__/EventCache.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ describe('EventCache tests', () => {
id: expect.stringMatching(/[0-9a-f\-]+/),
timestamp: new Date(),
type: EVENT1_SCHEMA,
metadata: `{"version":"${WEB_CLIENT_VERSION}","aws:installationMethod":"${INSTALL_MODULE}"}`,
metadata: `{"version":"${WEB_CLIENT_VERSION}","aws:client":"${INSTALL_MODULE}"}`,
details: '{}'
},
{
id: expect.stringMatching(/[0-9a-f\-]+/),
timestamp: new Date(),
type: EVENT2_SCHEMA,
metadata: `{"version":"${WEB_CLIENT_VERSION}","aws:installationMethod":"${INSTALL_MODULE}"}`,
metadata: `{"version":"${WEB_CLIENT_VERSION}","aws:client":"${INSTALL_MODULE}"}`,
details: '{}'
}
];
Expand Down Expand Up @@ -177,7 +177,7 @@ describe('EventCache tests', () => {
id: expect.stringMatching(/[0-9a-f\-]+/),
timestamp: new Date(),
type: EVENT2_SCHEMA,
metadata: `{"version":"${WEB_CLIENT_VERSION}","aws:installationMethod":"${INSTALL_MODULE}"}`,
metadata: `{"version":"${WEB_CLIENT_VERSION}","aws:client":"${INSTALL_MODULE}"}`,
details: '{}'
}
];
Expand Down Expand Up @@ -221,7 +221,7 @@ describe('EventCache tests', () => {
id: expect.stringMatching(/[0-9a-f\-]+/),
timestamp: new Date(),
type: EVENT1_SCHEMA,
metadata: `{"version":"${WEB_CLIENT_VERSION}","aws:installationMethod":"${INSTALL_MODULE}"}`,
metadata: `{"version":"${WEB_CLIENT_VERSION}","aws:client":"${INSTALL_MODULE}"}`,
details: '{}'
}
];
Expand All @@ -246,7 +246,7 @@ describe('EventCache tests', () => {
id: expect.stringMatching(/[0-9a-f\-]+/),
timestamp: new Date(),
type: EVENT1_SCHEMA,
metadata: `{"title":"","pageId":"/rum/home","pageTags":["pageGroup1"],"version":"${WEB_CLIENT_VERSION}","aws:installationMethod":"${INSTALL_MODULE}"}`,
metadata: `{"title":"","pageId":"/rum/home","pageTags":["pageGroup1"],"version":"${WEB_CLIENT_VERSION}","aws:client":"${INSTALL_MODULE}"}`,
details: '{"version":"1.0.0","pageId":"/rum/home"}'
}
];
Expand Down Expand Up @@ -274,7 +274,7 @@ describe('EventCache tests', () => {
id: expect.stringMatching(/[0-9a-f\-]+/),
timestamp: new Date(),
type: EVENT1_SCHEMA,
metadata: `{"customPageAttributeString":"customPageAttributeValue","customPageAttributeNumber":1,"customPageAttributeBoolean":true,"title":"","pageId":"/rum/home","pageTags":["pageGroup1"],"version":"${WEB_CLIENT_VERSION}","aws:installationMethod":"${INSTALL_MODULE}"}`,
metadata: `{"customPageAttributeString":"customPageAttributeValue","customPageAttributeNumber":1,"customPageAttributeBoolean":true,"title":"","pageId":"/rum/home","pageTags":["pageGroup1"],"version":"${WEB_CLIENT_VERSION}","aws:client":"${INSTALL_MODULE}"}`,
details: '{"version":"1.0.0","pageId":"/rum/home"}'
}
];
Expand Down Expand Up @@ -349,7 +349,7 @@ describe('EventCache tests', () => {
id: expect.stringMatching(/[0-9a-f\-]+/),
timestamp: new Date(),
type: EVENT1_SCHEMA,
metadata: `{"version":"${WEB_CLIENT_VERSION}","aws:installationMethod":"${INSTALL_MODULE}"}`,
metadata: `{"version":"${WEB_CLIENT_VERSION}","aws:client":"${INSTALL_MODULE}"}`,
details: '{}'
}
];
Expand All @@ -375,7 +375,7 @@ describe('EventCache tests', () => {
id: expect.stringMatching(/[0-9a-f\-]+/),
timestamp: new Date(),
type: EVENT1_SCHEMA,
metadata: `{"version":"${WEB_CLIENT_VERSION}","aws:installationMethod":"${INSTALL_SCRIPT}"}`,
metadata: `{"version":"${WEB_CLIENT_VERSION}","aws:client":"${INSTALL_SCRIPT}"}`,
details: '{}'
}
];
Expand All @@ -397,7 +397,7 @@ describe('EventCache tests', () => {
id: expect.stringMatching(/[0-9a-f\-]+/),
timestamp: new Date(),
type: EVENT1_SCHEMA,
metadata: `{"version":"${WEB_CLIENT_VERSION}","aws:installationMethod":"${INSTALL_MODULE}"}`,
metadata: `{"version":"${WEB_CLIENT_VERSION}","aws:client":"${INSTALL_MODULE}"}`,
details: '{}'
}
];
Expand Down
2 changes: 1 addition & 1 deletion src/event-schemas/meta-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"type": "string"
},
"pageTags": { "type": "array", "items": { "type": "string" } },
"aws:installationMethod": {
"aws:client": {
"type": "string"
}
},
Expand Down

0 comments on commit 5521627

Please sign in to comment.