Skip to content
Open

init #35

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
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2.1
parameters:
node-version:
type: string
default: "18.13.0"
default: "24.10.0"
orbs:
node: circleci/node@5.0.0
slack: circleci/slack@4.5.3
Expand Down Expand Up @@ -72,7 +72,7 @@ commands:
jobs:
test:
docker:
- image: cimg/node:18.13.0
- image: cimg/node:24.10.0
steps:
- checkout
- node/install:
Expand All @@ -85,14 +85,14 @@ jobs:
command: npm test
build:
docker:
- image: cimg/node:18.13.0
- image: cimg/node:24.10.0
user: root
steps:
- checkout
- node/install:
node-version: << pipeline.parameters.node-version >>
- setup_remote_docker:
version: 19.03.13
version: default
docker_layer_caching: true
# build and push Docker image
- run:
Expand Down
23 changes: 19 additions & 4 deletions .grype-ignore.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
ignore:
- vulnerability: CVE-2023-2650
- vulnerability: CVE-2022-3996
package:
name: libssl3
version: 3.1.0-r4
version: 3.0.7-r0

- vulnerability: CVE-2023-2650
- vulnerability: CVE-2022-3996
package:
name: libcrypto3
version: 3.1.0-r4
version: 3.0.7-r0

- vulnerability: CVE-2023-5363
package:
name: libssl3
version: 3.1.3-r0

- vulnerability: CVE-2023-5363
package:
name: libcrypto3
version: 3.1.3-r0

- vulnerability: CVE-2023-45853
package:
name: zlib
version: 1.3.1-r2
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.0.5 (December 03, 2025)

* Update Sailor version to 2.7.7
* Remove unused `elasticio-node` dependency
* Update the Node engine to version 24.x.

## 1.0.4 (June 12, 2022)
* Fixed credential verification
* Upgrade to Sailor 2.7.1
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "MailChimp",
"description": "Online email marketing solution to manage contacts, send emails and track results.",
"version": "1.0.4",
"version": "1.0.5-dev.1",
"credentials": {
"fields": {
"apiKey": {
Expand Down
3 changes: 1 addition & 2 deletions lib/actions/subscribe.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const { messages } = require('elasticio-node');
const mailchimp = require('mailchimp-v3');
const moment = require('moment');
const md5 = require('md5');
Expand Down Expand Up @@ -53,7 +52,7 @@ async function processAction(msg, conf) {
const hash = md5(body.email.toLowerCase());
const response = await mailchimp.put(`/lists/${listId}/members/${hash}`, payload);
self.logger.info('Received response');
await this.emit('data', messages.newMessageWithBody(response));
await this.emit('data', common.messages.newMessageWithBody(response));
this.emit('end');
} catch (err) {
self.logger.error('Error occured: ', JSON.stringify(err));
Expand Down
3 changes: 1 addition & 2 deletions lib/actions/unsubscribe.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const { messages } = require('elasticio-node');
const mailchimp = require('mailchimp-v3');
const md5 = require('md5');

Expand Down Expand Up @@ -27,7 +26,7 @@ async function processAction(msg, conf) {
self.logger.info('Trying to delete the resource');
const response = await mailchimp.delete(resource);
self.logger.info('Response received');
await this.emit('data', messages.newMessageWithBody(response));
await this.emit('data', common.messages.newMessageWithBody(response));
this.emit('end');
} catch (err) {
self.logger.error('Error occurred!');
Expand Down
4 changes: 1 addition & 3 deletions lib/actions/upsertCustomer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
const { messages } = require('elasticio-node');
const mailchimp = require('mailchimp-v3');

const common = require('../common.js');

/**
Expand Down Expand Up @@ -33,7 +31,7 @@ async function processAction(msg, conf) {
self.logger.info('Pushing data to mailchimp payload...');
const response = await mailchimp.put(`/ecommerce/stores/${storeId}/customers/${body.id}`, body);
self.logger.info('Response received');
await this.emit('data', messages.newMessageWithBody(response));
await this.emit('data', common.messages.newMessageWithBody(response));
this.emit('end');
} catch (err) {
self.logger.error('Error occurred');
Expand Down
6 changes: 6 additions & 0 deletions lib/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,11 @@ async function getStores(conf) {
}
}

const messages = {
newMessageWithBody: body => ({ body, headers: {} }),
newEmptyMessage: () => ({ body: {}, headers: {} }),
};

exports.getLists = getLists;
exports.getStores = getStores;
exports.messages = messages;
Loading