Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
2d544b3
Upgrade newrelic from 6.4.0 to 7.3.0
zarathustra323 Apr 8, 2021
aff5488
Upgrade eslint from 5.16.0 to 7.23.0
zarathustra323 Apr 8, 2021
cc7674a
Upgrade eslint-plugin-import from 2.17.2 to 2.22.1
zarathustra323 Apr 8, 2021
302f3ae
Upgrade eslint-config-airbnb-base from 13.1.0 to 14.2.1
zarathustra323 Apr 8, 2021
4fefb58
Upgrade gulp-eslint from 5.0.0 to 6.0.0
zarathustra323 Apr 8, 2021
726db23
Fix missed eslint upgrades
zarathustra323 Apr 8, 2021
a1873e3
Upgrade lerna from 3.14.1 to 4.0.0
zarathustra323 Apr 8, 2021
53c6f3d
Upgrade @base-cms dependencies
zarathustra323 Apr 8, 2021
eb7022a
Upgrade mongoose and mongodb
zarathustra323 Apr 8, 2021
6834137
Replace deepmerge with lodash.merge
zarathustra323 Apr 8, 2021
e9f94f6
Replace deep assign with lodash.merge
zarathustra323 Apr 8, 2021
4685411
Upgrade mongodb-extended-json from 1.10.1 to 1.11.0
zarathustra323 Apr 8, 2021
0bb4119
Upgrade graphql related deps; remove no longer needed
zarathustra323 Apr 8, 2021
a19713f
Upgrade @godaddy/terminus from 4.2.0 to 4.7.1
zarathustra323 Apr 8, 2021
f459bad
Upgrade validator from 11.0.0 to 13.5.2
zarathustra323 Apr 8, 2021
c7e7ef9
Remove unused apollo newrelic extension
zarathustra323 Apr 8, 2021
c872aaa
Upgrade remaining non-manage deps
zarathustra323 Apr 8, 2021
094521f
Upgrade manage deps to latest minors/patches
zarathustra323 Apr 8, 2021
587745d
Fix lint errors
zarathustra323 Apr 8, 2021
f49ea66
Fix lint error
zarathustra323 Apr 8, 2021
64b5ce4
Fix lint errors
zarathustra323 Apr 8, 2021
59276b5
Fix lint errors
zarathustra323 Apr 8, 2021
7433e0e
Fix lint errors
zarathustra323 Apr 8, 2021
92271cd
Update env defaults
zarathustra323 Apr 8, 2021
05068ed
Fix lint errors
zarathustra323 Apr 8, 2021
93d7a4d
Update support and sending vars
zarathustra323 Apr 8, 2021
96af3db
Fix lint errors
zarathustra323 Apr 8, 2021
368f421
Fix lint errors
zarathustra323 Apr 8, 2021
22e7044
Fix lint errors
zarathustra323 Apr 8, 2021
0e5fe3a
Fix lint errors
zarathustra323 Apr 8, 2021
c2f1258
Fix lint errors
zarathustra323 Apr 8, 2021
443deed
Update app url and sending domain vars
zarathustra323 Apr 8, 2021
8a663bc
Fix lint errors
zarathustra323 Apr 8, 2021
08123c7
Fix lint errors
zarathustra323 Apr 8, 2021
fc88ddb
Fix lint errors
zarathustra323 Apr 8, 2021
aa4d063
Fix lint errors
zarathustra323 Apr 8, 2021
bc07061
Add lerna script
zarathustra323 Apr 8, 2021
bc66767
Set node to v14.16 (alpine for Docker)
zarathustra323 Apr 8, 2021
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 .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: node_js
node_js: "10.15"
node_js: "14.16"
cache: yarn

_production-job: &production-job
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:10.15
FROM node:14.16-alpine
WORKDIR /identity-x
ENV NODE_ENV production
ARG SERVICE
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ x-env-defaults: &env
x-node-defaults: &node
tty: true
init: true
image: node:10.15
image: node:14.16-alpine
working_dir: /identity-x
restart: always
volumes:
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"private": true,
"repository": "https://github.com/base-cms/id-me.git",
"scripts": {
"lerna": "lerna",
"test": "lerna run test",
"lint": "lerna run lint"
},
Expand All @@ -13,6 +14,9 @@
"services/*"
],
"devDependencies": {
"lerna": "^3.14.1"
"lerna": "^4.0.0"
},
"resolutions": {
"eslint": "^7.23.0"
}
}
4 changes: 2 additions & 2 deletions packages/mongoose-plugins/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module.exports = {
extends: 'airbnb-base',
plugins: [
'import'
'import',
],
rules: {
'no-underscore-dangle': [ 'error', { allow: ['_id'] } ],
'no-underscore-dangle': ['error', { allow: ['_id'] }],
},
};
10 changes: 5 additions & 5 deletions packages/mongoose-plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
"dependencies": {
"@identity-x/pagination": "^1.0.0",
"@identity-x/utils": "^1.0.0",
"mongoose": "^5.5.11",
"validator": "^11.0.0"
"mongoose": "^5.12.3",
"validator": "^13.5.2"
},
"devDependencies": {
"eslint": "^5.16.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.17.2"
"eslint": "^7.23.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-import": "^2.22.1"
}
}
2 changes: 1 addition & 1 deletion packages/mongoose-plugins/src/domain-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { isArray } = Array;

module.exports = {
validator(value) {
if (isArray(value)) return value.every(v => validator.isFQDN(v));
if (isArray(value)) return value.every((v) => validator.isFQDN(v));
return validator.isFQDN(value);
},
message: 'Invalid domain name address {VALUE}',
Expand Down
2 changes: 1 addition & 1 deletion packages/mongoose-plugins/src/ip-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { isArray } = Array;

module.exports = {
validator(value) {
if (isArray(value)) return value.every(v => validator.isIP(v));
if (isArray(value)) return value.every((v) => validator.isIP(v));
return validator.isIP(value);
},
message: 'Invalid IP address {VALUE}',
Expand Down
4 changes: 2 additions & 2 deletions packages/pagination/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module.exports = {
extends: 'airbnb-base',
plugins: [
'import'
'import',
],
rules: {
'no-underscore-dangle': [ 'error', { allow: ['_id'] } ],
'no-underscore-dangle': ['error', { allow: ['_id'] }],
},
};
12 changes: 6 additions & 6 deletions packages/pagination/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
"license": "MIT",
"private": true,
"dependencies": {
"base64-url": "^2.2.2",
"deepmerge": "^3.2.1",
"mongodb-extended-json": "^1.10.1"
"base64-url": "^2.3.3",
"lodash.merge": "^4.6.2",
"mongodb-extended-json": "^1.11.0"
},
"devDependencies": {
"eslint": "^5.16.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.17.2"
"eslint": "^7.23.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-import": "^2.22.1"
}
}
2 changes: 1 addition & 1 deletion packages/pagination/src/find.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = async (Model, {
[$sort.field]: 1,
} : undefined;
if ($projection && isArray(excludeProjection)) {
excludeProjection.forEach(key => delete $projection[key]);
excludeProjection.forEach((key) => delete $projection[key]);
}

const params = {
Expand Down
4 changes: 1 addition & 3 deletions packages/pagination/src/limit.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const { assign } = Object;

class Limit {
/**
* Contructor.
Expand Down Expand Up @@ -32,7 +30,7 @@ class Limit {
* @return {object}
*/
get options() {
return assign({}, this.opts);
return { ...this.opts };
}

/**
Expand Down
10 changes: 5 additions & 5 deletions packages/pagination/src/sort.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const deepMerge = require('deepmerge');
const merge = require('lodash.merge');

const { assign, keys } = Object;
const { keys } = Object;

class Sort {
/**
Expand Down Expand Up @@ -38,7 +38,7 @@ class Sort {
* @return {object}
*/
get options() {
return deepMerge({}, this.opts);
return merge({}, this.opts);
}

/**
Expand All @@ -60,7 +60,7 @@ class Sort {
*/
get valueReversed() {
const { value } = this;
return keys(value).reduce((obj, key) => assign(obj, { [key]: value[key] === 1 ? -1 : 1 }), {});
return keys(value).reduce((obj, key) => ({ ...obj, [key]: value[key] === 1 ? -1 : 1 }), {});
}

/**
Expand Down Expand Up @@ -123,7 +123,7 @@ class Sort {
*/
set collation(options) {
const defaults = { locale: 'en_US' };
this.opts.collation = assign({}, defaults, options);
this.opts.collation = { ...defaults, ...options };
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/pagination/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {
};
return {
...additionalData,
edges: results.map(node => ({ node, cursor: () => cursor.encode(node._id) })),
edges: results.map((node) => ({ node, cursor: () => cursor.encode(node._id) })),
pageInfo,
totalCount,
};
Expand Down
2 changes: 1 addition & 1 deletion packages/service-clients/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
extends: 'airbnb-base',
plugins: [
'import'
'import',
],
};
10 changes: 5 additions & 5 deletions packages/service-clients/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
"license": "MIT",
"private": true,
"dependencies": {
"@base-cms/env": "^1.0.0",
"@base-cms/micro": "^1.21.5",
"@base-cms/env": "^1.37.0",
"@base-cms/micro": "^1.37.0",
"micro": "^9.3.4"
},
"devDependencies": {
"eslint": "^5.16.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.17.2"
"eslint": "^7.23.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-import": "^2.22.1"
}
}
2 changes: 1 addition & 1 deletion packages/service-clients/src/create-env-var.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = key => `${key.toUpperCase()}_SERVICE_URL`;
module.exports = (key) => `${key.toUpperCase()}_SERVICE_URL`;
4 changes: 2 additions & 2 deletions packages/utils/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module.exports = {
extends: 'airbnb-base',
plugins: [
'import'
'import',
],
rules: {
'no-underscore-dangle': [ 'error', { allow: ['_id'] } ],
'no-underscore-dangle': ['error', { allow: ['_id'] }],
},
};
10 changes: 5 additions & 5 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
"license": "MIT",
"private": true,
"dependencies": {
"escape-string-regexp": "^2.0.0"
"escape-string-regexp": "^4.0.0"
},
"peerDependencies": {
"@base-cms/micro": "^1.21.5"
"@base-cms/micro": "^1.37.0"
},
"devDependencies": {
"eslint": "^5.16.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.17.2"
"eslint": "^7.23.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-import": "^2.22.1"
}
}
2 changes: 1 addition & 1 deletion packages/utils/src/mongoose/handle-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const isValidationError = require('./is-validation-error');
module.exports = (createError, e, statusCode = 422) => {
if (isValidationError(e)) {
const fields = e.errors && typeof e.errors === 'object' ? e.errors : {};
const messages = Object.keys(fields).map(name => fields[name]);
const messages = Object.keys(fields).map((name) => fields[name]);
const error = createError(422, `${messages.join('\n')}`, e);
error.isValidationError = true;
return error;
Expand Down
8 changes: 4 additions & 4 deletions packages/utils/src/mongoose/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ const start = (promise, name, url) => {
});
};

const indexModel = Model => new Promise((resolve, reject) => {
const indexModel = (Model) => new Promise((resolve, reject) => {
Model.on('index', (err) => {
if (err) { reject(err); } else { resolve(); }
});
});

const indexModels = models => Promise
.all(Object.keys(models).map(name => indexModel(models[name])));
const indexModels = (models) => Promise
.all(Object.keys(models).map((name) => indexModel(models[name])));

module.exports = ({
connection,
models,
} = {}) => () => {
const p = [];
if (models) p.push(indexModels(models).then(() => log('> Model indexes created.')));
if (connection) p.push(start(connection, 'MongoDB', m => m.client.s.url));
if (connection) p.push(start(connection, 'MongoDB', (m) => m.client.s.url));
return Promise.all(p);
};
4 changes: 2 additions & 2 deletions services/application/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module.exports = {
extends: 'airbnb-base',
plugins: [
'import'
'import',
],
rules: {
'no-underscore-dangle': [ 'error', { allow: ['_id'] } ],
'no-underscore-dangle': ['error', { allow: ['_id'] }],
},
};
24 changes: 12 additions & 12 deletions services/application/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@
"test": "yarn lint"
},
"dependencies": {
"@base-cms/env": "^1.0.0",
"@base-cms/micro": "^1.21.5",
"@base-cms/object-path": "^1.9.0",
"@base-cms/utils": "^1.9.0",
"@base-cms/env": "^1.37.0",
"@base-cms/micro": "^1.37.0",
"@base-cms/object-path": "^1.37.0",
"@base-cms/utils": "^1.37.0",
"@identity-x/mongoose-plugins": "^1.0.0",
"@identity-x/pagination": "^1.0.0",
"@identity-x/service-clients": "^1.0.0",
"@identity-x/utils": "^1.0.0",
"burner-email-providers": "^1.0.13",
"burner-email-providers": "^1.0.41",
"micro": "^9.3.4",
"mongoose": "^5.5.11",
"newrelic": "^6.4.0",
"validator": "^11.0.0"
"mongoose": "^5.12.3",
"newrelic": "^7.3.0",
"validator": "^13.5.2"
},
"devDependencies": {
"eslint": "^5.16.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.17.2",
"eslint": "^7.23.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-import": "^2.22.1",
"gulp": "^4.0.2",
"gulp-cached": "^1.1.1",
"gulp-eslint": "^5.0.0"
"gulp-eslint": "^6.0.0"
}
}
5 changes: 2 additions & 3 deletions services/application/src/actions/access-level/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ const create = require('./create');
const updateOne = require('./update-one');
const AccessLevel = require('../../mongodb/models/access-level');


module.exports = {
create,
find: ({ query, fields }) => find(AccessLevel, { query, fields }),
findById: ({ id, fields }) => findById(AccessLevel, { id, fields }),
listForApp: params => listForApp(AccessLevel, params),
matchForApp: params => matchForApp(AccessLevel, params),
listForApp: (params) => listForApp(AccessLevel, params),
matchForApp: (params) => matchForApp(AccessLevel, params),
updateOne,
};
8 changes: 4 additions & 4 deletions services/application/src/actions/check-access.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const loadContext = require('./load-context');

const { isArray } = Array;

const getAsArray = v => (isArray(v) ? v : []);
const getAsArray = (v) => (isArray(v) ? v : []);

const isLoggedIn = ({ hasUser, hasTeams }) => (hasUser || hasTeams);

Expand Down Expand Up @@ -36,14 +36,14 @@ module.exports = async ({
const requiresAccessLevel = Boolean(requiredAccessLevels.length);

// The access level IDs found in the current context.
const foundAccessLevelIds = context.mergedAccessLevels.map(level => `${level.id}`);
const foundAccessLevelIds = context.mergedAccessLevels.map((level) => `${level.id}`);

// The required access level IDs (that were found/verified in the database).
const verifiedAccessLevelIds = requiredAccessLevels.map(level => `${level.id}`);
const verifiedAccessLevelIds = requiredAccessLevels.map((level) => `${level.id}`);

// Whether the context contains at least one required access level.
const hasRequiredAccessLevel = verifiedAccessLevelIds
.some(id => foundAccessLevelIds.includes(id));
.some((id) => foundAccessLevelIds.includes(id));

return {
canAccess: canAccess(isEnabled, {
Expand Down
6 changes: 3 additions & 3 deletions services/application/src/actions/comment-stream/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
findByIdentifier,
find: ({ query, fields }) => find(CommentStream, { query, fields }),
findById: ({ id, fields }) => findById(CommentStream, { id, fields }),
listForApp: params => listForApp(CommentStream, params),
matchForApp: params => matchForApp(CommentStream, params),
updateFieldWithApp: params => updateFieldWithApp(CommentStream, params),
listForApp: (params) => listForApp(CommentStream, params),
matchForApp: (params) => matchForApp(CommentStream, params),
updateFieldWithApp: (params) => updateFieldWithApp(CommentStream, params),
};
Loading