diff --git a/lib/constants.js b/lib/constants.js index e9ce2d5..e228ebf 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -45,7 +45,8 @@ module.exports = { NOTIFICATION_API_ENDPOINT_SANDBOX: 'https://api.sandbox.ebay.com/commerce/notification/v1/public_key/', SHA256: 'sha256', TOPICS: { - MARKETPLACE_ACCOUNT_DELETION: 'MARKETPLACE_ACCOUNT_DELETION' + MARKETPLACE_ACCOUNT_DELETION: 'MARKETPLACE_ACCOUNT_DELETION', + PRIORITY_LISTING_REVISION: 'PRIORITY_LISTING_REVISION' }, X_EBAY_SIGNATURE: 'x-ebay-signature' }; diff --git a/lib/processor/priorityListingRevisionMessageProcessor.js b/lib/processor/priorityListingRevisionMessageProcessor.js new file mode 100644 index 0000000..a5bdbdf --- /dev/null +++ b/lib/processor/priorityListingRevisionMessageProcessor.js @@ -0,0 +1,31 @@ +/* + * * + * * Copyright 2023 eBay Inc. + * * + * * Licensed 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 CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * * + */ + +'use strict'; + +/** + * Process the message + * + * @param {JSON} message + */ +const processInternal = (message) => { + const data = message.notification.data; + console.log(`\n==========================\PriorityListingRevision Date :` + JSON.stringify(data, null, 2)) +}; + +module.exports = { process: processInternal }; diff --git a/lib/processor/processor.js b/lib/processor/processor.js index ee8d53d..b454eaa 100644 --- a/lib/processor/processor.js +++ b/lib/processor/processor.js @@ -20,6 +20,7 @@ const topics = require('../constants').TOPICS; const accountDeletionMessageProcessor = require('./accountDeletionMessageProcessor'); +const priorityListingRevisionMessageProcessor = require('./priorityListingRevisionMessageProcessor'); /** * Get the Processor for the given topic @@ -30,6 +31,8 @@ const getProcessor = (topic) => { switch (topic) { case topics.MARKETPLACE_ACCOUNT_DELETION: return accountDeletionMessageProcessor; + case topics.PRIORITY_LISTING_REVISION: + return priorityListingRevisionMessageProcessor; default: // eslint-disable-next-line no-throw-literal throw `Message processor not registered for: ${topic}`; diff --git a/package.json b/package.json index f5895e1..fd76e03 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "event-notification-nodejs-sdk", - "version": "1.0.2", + "version": "1.0.3", "description": "A NodeJS SDK for processing eBay event notifications", "main": "lib/index.js", "repository": {