From 2218c6ebf945c2d277f8adf9ea683959b55a86e5 Mon Sep 17 00:00:00 2001 From: Jonathon Adams <24870903+jonathonadams@users.noreply.github.com> Date: Wed, 9 Sep 2020 16:56:58 +0930 Subject: [PATCH] test: fix e2e test setup --- apps/server/api/src/environments/test.ts | 2 +- .../api/src/server/api/todos/todo.e2e.spec.ts | 9 +- .../api/src/server/api/users/user.e2e.spec.ts | 14 +- libs/tests/src/lib/server/graphQLSpec.ts | 1 - libs/tests/src/lib/server/helpers.ts | 23 - package-lock.json | 464 ++++++++---------- package.json | 9 +- 7 files changed, 226 insertions(+), 296 deletions(-) diff --git a/apps/server/api/src/environments/test.ts b/apps/server/api/src/environments/test.ts index 6b8f94b9..53477d67 100644 --- a/apps/server/api/src/environments/test.ts +++ b/apps/server/api/src/environments/test.ts @@ -3,7 +3,7 @@ import { TestServerConfig } from '@ztp/data'; import { AuthEnv } from '@ztp/server/auth'; -const audience = 'http://localhost:3000'; +const audience = `http://localhost:${process.env.PORT}`; const authServerHost = audience; const privateKey = `-----BEGIN PRIVATE KEY----- diff --git a/apps/server/api/src/server/api/todos/todo.e2e.spec.ts b/apps/server/api/src/server/api/todos/todo.e2e.spec.ts index e432e80b..aa7d1497 100644 --- a/apps/server/api/src/server/api/todos/todo.e2e.spec.ts +++ b/apps/server/api/src/server/api/todos/todo.e2e.spec.ts @@ -1,3 +1,6 @@ +process.env.PORT = '9999'; + +import { createHash } from 'crypto'; import Koa from 'koa'; import { ITodo } from '@ztp/data'; import { authConfig } from '../../../environments/index'; @@ -7,6 +10,10 @@ import { createGraphQLSpec } from '@ztp/tests/server'; import { Todo } from './todo.model'; import { User } from '../users'; +const keyId = createHash('md5') + .update(authConfig.accessToken.publicKey as string) + .digest('hex'); + // Need to import and run the server because // the server is also our "auth server" // and the Auth guard needs to be able to retrieve the JWKS @@ -23,7 +30,7 @@ const updatedTodo = { createGraphQLSpec( schema, - { ...authConfig.accessToken, keyId: 'keyId' }, + { ...authConfig.accessToken, keyId }, server, /*userResource */ true )(Todo, 'Todo', todo, updatedTodo, User); diff --git a/apps/server/api/src/server/api/users/user.e2e.spec.ts b/apps/server/api/src/server/api/users/user.e2e.spec.ts index 21e435ca..e3e8e07f 100644 --- a/apps/server/api/src/server/api/users/user.e2e.spec.ts +++ b/apps/server/api/src/server/api/users/user.e2e.spec.ts @@ -1,3 +1,5 @@ +process.env.PORT = '9999'; + import Koa from 'koa'; import { MongoMemoryServer } from 'mongodb-memory-server'; import { runQuery, setupTestDB, signTestAccessToken } from '@ztp/tests/server'; @@ -8,6 +10,11 @@ import { IUser } from '@ztp/data'; import ApiServer from '../../server'; import { Server } from 'http'; import { User } from './user.model'; +import { createHash } from 'crypto'; + +const keyId = createHash('md5') + .update(authConfig.accessToken.publicKey as string) + .digest('hex'); // Need to import and run the server because // the server is also our "auth server" @@ -41,10 +48,11 @@ describe(`GraphQL / User`, () => { testServer = await server.initializeServer(dbUri); createdUser = await User.create(user); + [createdUser.id, createdUser._id] = [createdUser._id, createdUser.id]; - jwt = signTestAccessToken({ ...authConfig.accessToken, keyId: 'id' })( - createdUser - ); + + const config = { ...authConfig.accessToken, keyId }; + jwt = signTestAccessToken(config)(createdUser); }); afterAll(async () => { diff --git a/libs/tests/src/lib/server/graphQLSpec.ts b/libs/tests/src/lib/server/graphQLSpec.ts index ebec1f1f..1ecea4d1 100644 --- a/libs/tests/src/lib/server/graphQLSpec.ts +++ b/libs/tests/src/lib/server/graphQLSpec.ts @@ -1,5 +1,4 @@ /* istanbul ignore file */ - import 'jest-extended'; import { GraphQLSchema } from 'graphql'; import { MongoMemoryServer } from 'mongodb-memory-server'; diff --git a/libs/tests/src/lib/server/helpers.ts b/libs/tests/src/lib/server/helpers.ts index 8b382783..e04f0de1 100644 --- a/libs/tests/src/lib/server/helpers.ts +++ b/libs/tests/src/lib/server/helpers.ts @@ -2,29 +2,6 @@ import mongoose from 'mongoose'; import { MongoMemoryServer } from 'mongodb-memory-server'; import { graphql, GraphQLSchema } from 'graphql'; -// export interface RESTTestResource { -// model: any; -// resourceName: string; -// urlString: string; -// resourceToCreate: any; -// resourceToUpdate: any; -// testDependents?: TestDependents[]; -// } - -// export interface GraphQLTestResource { -// model: any; -// resourceName: string; -// queryName: string; -// resourceToCreate: any; -// resourceToUpdate: any; -// testDependents?: TestDependents[]; -// } - -// export interface TestDependents { -// model: any; -// resource: any; -// } - /** * Helper function to generate ObjectID, note it returns the hex string of the ObjectId */ diff --git a/package-lock.json b/package-lock.json index 29e210cc..fe2172b5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -518,9 +518,9 @@ }, "dependencies": { "@types/node": { - "version": "10.17.29", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.29.tgz", - "integrity": "sha512-zLo9rjUeQ5+QVhOufDwrb3XKyso31fJBJnk9wUUQIBDExF/O4LryvpOfozfUaxgqifTnlt7FyqsAPXUq5yFZSA==" + "version": "10.17.30", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.30.tgz", + "integrity": "sha512-euU8QLX0ipj+5mOYa4ZqZoTv+53BY7yTg9I2ZIhDXgiI3M+0n4mdAt9TQCuvxVAgU179g8OsRLaBt0qEi0T6xA==" } } }, @@ -2512,9 +2512,9 @@ } }, "@grpc/grpc-js": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.1.5.tgz", - "integrity": "sha512-2huf5z85TdZI4nLmJQ9Zdfd+6vmIyBDs7B4L71bTaHKA9pRsGKAH24XaktMk/xneKJIqAgeIZtg1cyivVZtvrg==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.1.6.tgz", + "integrity": "sha512-bUeaMN/dHTkt9AqU0Tc1xdHMB3jVLyPNfg8gZ5cMyhFyMeCwoJbFcJrNBgYqRCbvYhvtaEgzQwkw91NnY4Oktg==", "optional": true, "requires": { "@grpc/proto-loader": "^0.6.0-pre14", @@ -2537,9 +2537,9 @@ } }, "@types/node": { - "version": "12.12.55", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.55.tgz", - "integrity": "sha512-Vd6xQUVvPCTm7Nx1N7XHcpX6t047ltm7TgcsOr4gFHjeYgwZevo+V7I1lfzHnj5BT5frztZ42+RTG4MwYw63dw==", + "version": "12.12.56", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.56.tgz", + "integrity": "sha512-8OdIupOIZtmObR13fvGyTvpcuzKmMugkATeVcfNwCjGtHxhjEKmOvLqXwR8U9VOtNnZ4EXaSfNiLVsPinaCXkQ==", "optional": true } } @@ -7582,23 +7582,53 @@ "@sendgrid/helpers": "^7.2.4" } }, - "@serverless/cli": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/@serverless/cli/-/cli-1.5.2.tgz", - "integrity": "sha512-FMACx0qPD6Uj8U+7jDmAxEe1tdF9DsuY5VsG45nvZ3olC9xYJe/PMwxWsjXfK3tg1HUNywYAGCsy7p5fdXhNzw==", + "@serverless/component-metrics": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@serverless/component-metrics/-/component-metrics-1.0.8.tgz", + "integrity": "sha512-lOUyRopNTKJYVEU9T6stp2irwlTDsYMmUKBOUjnMcwGveuUfIJqrCOtFLtIPPj3XJlbZy5F68l4KP9rZ8Ipang==", "dev": true, "requires": { - "@serverless/core": "^1.1.2", - "@serverless/template": "^1.1.3", + "node-fetch": "^2.6.0", + "shortid": "^2.2.14" + } + }, + "@serverless/components": { + "version": "2.34.9", + "resolved": "https://registry.npmjs.org/@serverless/components/-/components-2.34.9.tgz", + "integrity": "sha512-qFjIeGgR4SjS32Tbl4BvoxOtLpv3Vx4s/81HdmmpdIrMPe7ePGUfkBVBu3axxAXHf4ajlb4WC1HmhTmZAHHSLQ==", + "dev": true, + "requires": { + "@serverless/inquirer": "^1.1.2", + "@serverless/platform-client": "^1.1.3", + "@serverless/platform-client-china": "^1.0.37", + "@serverless/platform-sdk": "^2.3.1", "@serverless/utils": "^1.2.0", + "adm-zip": "^0.4.16", "ansi-escapes": "^4.3.1", "chalk": "^2.4.2", + "child-process-ext": "^2.1.1", "chokidar": "^3.4.1", "dotenv": "^8.2.0", "figures": "^3.2.0", + "fs-extra": "^8.1.0", + "globby": "^10.0.2", + "got": "^9.6.0", + "graphlib": "^2.1.8", + "https-proxy-agent": "^5.0.0", + "ini": "^1.3.5", + "inquirer-autocomplete-prompt": "^1.0.2", + "js-yaml": "^3.14.0", "minimist": "^1.2.5", + "moment": "^2.27.0", + "open": "^7.1.0", "prettyoutput": "^1.2.0", - "strip-ansi": "^5.2.0" + "ramda": "^0.26.1", + "semver": "^7.3.2", + "stream.pipeline-shim": "^1.1.0", + "strip-ansi": "^5.2.0", + "traverse": "^0.6.6", + "uuid": "^3.4.0", + "ws": "^7.3.1" }, "dependencies": { "ansi-regex": { @@ -7607,6 +7637,45 @@ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "globby": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", + "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==", + "dev": true, + "requires": { + "@types/glob": "^7.1.1", + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.0.3", + "glob": "^7.1.3", + "ignore": "^5.1.1", + "merge2": "^1.2.3", + "slash": "^3.0.0" + } + }, + "ramda": { + "version": "0.26.1", + "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.26.1.tgz", + "integrity": "sha512-hLWjpy7EnsDBb0p+Z3B7rPi3GDeRG5ZtiI33kJhTt+ORCd38AbAIjB/9zRIUoeTbE/AVX5ZkU7m6bznsvrf8eQ==", + "dev": true + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "dev": true + }, "strip-ansi": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", @@ -7615,19 +7684,27 @@ "requires": { "ansi-regex": "^4.1.0" } + }, + "traverse": { + "version": "0.6.6", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", + "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=", + "dev": true + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + }, + "ws": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.1.tgz", + "integrity": "sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA==", + "dev": true } } }, - "@serverless/component-metrics": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@serverless/component-metrics/-/component-metrics-1.0.8.tgz", - "integrity": "sha512-lOUyRopNTKJYVEU9T6stp2irwlTDsYMmUKBOUjnMcwGveuUfIJqrCOtFLtIPPj3XJlbZy5F68l4KP9rZ8Ipang==", - "dev": true, - "requires": { - "node-fetch": "^2.6.0", - "shortid": "^2.2.14" - } - }, "@serverless/core": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@serverless/core/-/core-1.1.2.tgz", @@ -7889,9 +7966,9 @@ } }, "@serverless/platform-client": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/@serverless/platform-client/-/platform-client-1.1.8.tgz", - "integrity": "sha512-DmU71Lh0ALOMumGD7k2HfO6WwaFpJCA4ech1S9Kd8AQvpKZrT8fyUl9Ymc/E6GJLRC4s3a5wzcsLbu5AiDNyHA==", + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/@serverless/platform-client/-/platform-client-1.1.10.tgz", + "integrity": "sha512-vMCYRdDaqQjPDlny3+mVNy0lr1P6RJ7hVkR2w9Bk783ZB894hobtMrTm8V8OQPwOvlAypmLnQsLPXwRNM+AMsw==", "dev": true, "requires": { "adm-zip": "^0.4.13", @@ -8440,9 +8517,9 @@ } }, "@types/babel__traverse": { - "version": "7.0.13", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.13.tgz", - "integrity": "sha512-i+zS7t6/s9cdQvbqKDARrcbrPvtJGlbYsMkazo03nTAK3RX9FNrLllXys22uiTGJapPOTZTQ35nHh4ISph4SLQ==", + "version": "7.0.14", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.14.tgz", + "integrity": "sha512-8w9szzKs14ZtBVuP6Wn7nMLRJ0D6dfB0VEBEyRgxrZ/Ln49aNMykrghM2FaNn4FJRzNppCSa0Rv9pBRM5Xc3wg==", "dev": true, "requires": { "@babel/types": "^7.3.0" @@ -8530,27 +8607,6 @@ "@types/express": "*" } }, - "@types/cross-spawn": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@types/cross-spawn/-/cross-spawn-6.0.2.tgz", - "integrity": "sha512-KuwNhp3eza+Rhu8IFI5HUXRP0LIhqH5cAjubUvGXXthh4YYBuP2ntwEX+Cz8GJoZUHlKo247wPWOfA9LYEq4cw==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/debug": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.5.tgz", - "integrity": "sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ==", - "dev": true - }, - "@types/dedent": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@types/dedent/-/dedent-0.7.0.tgz", - "integrity": "sha512-EGlKlgMhnLt/cM4DbUSafFdrkeJoC9Mvnj0PUCU7tFmTjMjNRT957kXCx0wYm3JuEq4o4ZsS5vG+NlkM2DMd2A==", - "dev": true - }, "@types/duplexify": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/@types/duplexify/-/duplexify-3.6.0.tgz", @@ -8610,21 +8666,6 @@ "@types/express": "*" } }, - "@types/find-cache-dir": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@types/find-cache-dir/-/find-cache-dir-3.2.0.tgz", - "integrity": "sha512-+JeT9qb2Jwzw72WdjU+TSvD5O1QRPWCeRpDJV+guiIq+2hwR0DFGw+nZNbTFjMIVe6Bf4GgAKeB/6Ytx6+MbeQ==", - "dev": true - }, - "@types/find-package-json": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@types/find-package-json/-/find-package-json-1.1.1.tgz", - "integrity": "sha512-XMCocYkg6VUpkbOQMKa3M5cgc3MvU/LJKQwd3VUJrWZbLr2ARUggupsCAF8DxjEEIuSO6HlnH+vl+XV4bgVeEQ==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, "@types/fs-capacitor": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@types/fs-capacitor/-/fs-capacitor-2.0.0.tgz", @@ -8812,12 +8853,6 @@ "@types/koa": "*" } }, - "@types/lockfile": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/lockfile/-/lockfile-1.0.1.tgz", - "integrity": "sha512-65WZedEm4AnOsBDdsapJJG42MhROu3n4aSSiu87JXF/pSdlubxZxp3S1yz3kTfkJ2KBPud4CpjoHVAptOm9Zmw==", - "dev": true - }, "@types/lodash": { "version": "4.14.161", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.161.tgz", @@ -8829,12 +8864,6 @@ "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" }, - "@types/md5-file": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/md5-file/-/md5-file-4.0.2.tgz", - "integrity": "sha512-8gacRfEqLrmZ6KofpFfxyjsm/LYepeWUWUJGaf5A9W9J5B2/dRZMdkDqFDL6YDa9IweH12IO76jO7mpsK2B3wg==", - "dev": true - }, "@types/mime": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.3.tgz", @@ -8852,15 +8881,6 @@ "integrity": "sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=", "dev": true }, - "@types/mkdirp": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/mkdirp/-/mkdirp-1.0.1.tgz", - "integrity": "sha512-HkGSK7CGAXncr8Qn/0VqNtExEE+PHMWb+qlR1faHMao7ng6P3tAaoWWBMdva0gL5h4zprjIO89GJOLXsMcDm1Q==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, "@types/mongodb": { "version": "3.5.27", "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.5.27.tgz", @@ -8944,9 +8964,9 @@ "integrity": "sha512-+wYo+L6ZF6BMoEjtf8zB2esQsqdV6WsjRK/GP9WOgLPrq87PbNWgIxS76dS5uvl/QXtHGakZmwTznIfcPXcKlQ==" }, "@types/ramda": { - "version": "0.27.14", - "resolved": "https://registry.npmjs.org/@types/ramda/-/ramda-0.27.14.tgz", - "integrity": "sha512-vbw/VAtEJeSJ6Z61QT+epirlnBeJiJIO7ndK1BJ0fKswnfbiTNga/jBG6R3OnBaFYx+UJv6Iv7ZfWDFSsSzNqA==", + "version": "0.27.15", + "resolved": "https://registry.npmjs.org/@types/ramda/-/ramda-0.27.15.tgz", + "integrity": "sha512-LICBW+pNs9ZA23Ao9SoonwYH/AsmOiA90SmR/VtDZc61NQmXgTIOc/TtSrVoCeuKFgfUhGVhmcQ2hkHMJ72kWA==", "dev": true, "requires": { "ts-toolbelt": "^6.3.3" @@ -8997,12 +9017,6 @@ "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==", "dev": true }, - "@types/semver": { - "version": "7.3.3", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.3.tgz", - "integrity": "sha512-jQxClWFzv9IXdLdhSaTf16XI3NYe6zrEbckSpb5xhKfPbWgIyAY0AFyWWWfaiDcBuj3UHmMkCIwSRqpKMTZL2Q==", - "dev": true - }, "@types/serve-static": { "version": "1.13.5", "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.5.tgz", @@ -9055,12 +9069,6 @@ "integrity": "sha512-I99sngh224D0M7XgW1s120zxCt3VYQ3IQsuw3P3jbq5GG4yc79+ZjyKznyOGIQrflfylLgcfekeZW/vk0yng6A==", "dev": true }, - "@types/uuid": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.0.tgz", - "integrity": "sha512-eQ9qFW/fhfGJF8WKHGEHZEyVWfZxrT+6CLIJGBcZPfxUh/+BnEj+UCGYMlr9qZuX/2AltsvwrGqp0LhEW8D0zQ==", - "dev": true - }, "@types/webpack-sources": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/@types/webpack-sources/-/webpack-sources-0.1.8.tgz", @@ -9317,9 +9325,9 @@ }, "dependencies": { "@types/node": { - "version": "13.13.16", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.16.tgz", - "integrity": "sha512-dJ9vXxJ8MEwzNn4GkoAGauejhXoKuJyYKegsA6Af25ZpEDXomeVXt5HUWUNVHk5UN7+U0f6ghC6otwt+7PdSDg==", + "version": "13.13.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.17.tgz", + "integrity": "sha512-rGZftvdDpsYtG/rOlDOwny1f6Aq4FHJdGSVfPg5vC2DaR9Rt4W2OpsOF5GTU2bSqZmwTkfnsvJhhzpMWYxxlEA==", "dev": true }, "ansi-styles": { @@ -10304,9 +10312,9 @@ } }, "aws-sdk": { - "version": "2.747.0", - "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.747.0.tgz", - "integrity": "sha512-JA2ygLXFw0tLjc6nlauH3wnc6haoPU023fJCZN01xrw22l+s4rRjVGxJmG83VrfCmq+lrqCv0kVwlzyxbixGhA==", + "version": "2.748.0", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.748.0.tgz", + "integrity": "sha512-H+DCioQ4AChoBxGMtagcJ3a0mM0lOh3ta/dWIrfPTECAlRIuxlrBDp78cRhPgvdYYUxW54kB/IaHGR2xPP8JXw==", "dev": true, "requires": { "buffer": "4.9.2", @@ -12536,9 +12544,9 @@ "dev": true }, "buffer-indexof-polyfill": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-indexof-polyfill/-/buffer-indexof-polyfill-1.0.1.tgz", - "integrity": "sha1-qfuAbOgUXVQoUQznLyeLs2OmOL8=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/buffer-indexof-polyfill/-/buffer-indexof-polyfill-1.0.2.tgz", + "integrity": "sha512-I7wzHwA3t1/lwXQh+A5PbNvJxgfo5r3xulgpYDB5zckTu/Z9oUK9biouBKQUjEqzaz3HnAT6TYoovmE+GqSf7A==", "dev": true }, "buffer-xor": { @@ -12789,9 +12797,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001124", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001124.tgz", - "integrity": "sha512-zQW8V3CdND7GHRH6rxm6s59Ww4g/qGWTheoboW9nfeMg7sUoopIfKCcNZUjwYRCOrvereh3kwDpZj4VLQ7zGtA==", + "version": "1.0.30001125", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001125.tgz", + "integrity": "sha512-9f+r7BW8Qli917mU3j0fUaTweT3f3vnX/Lcs+1C73V+RADmFme+Ih0Br8vONQi3X0lseOe6ZHfsZLCA8MSjxUA==", "dev": true }, "canonical-path": { @@ -15587,9 +15595,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.3.562", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.562.tgz", - "integrity": "sha512-WhRe6liQ2q/w1MZc8mD8INkenHivuHdrr4r5EQHNomy3NJux+incP6M6lDMd0paShP3MD0WGe5R1TWmEClf+Bg==", + "version": "1.3.564", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.564.tgz", + "integrity": "sha512-fNaYN3EtKQWLQsrKXui8mzcryJXuA0LbCLoizeX6oayG2emBaS5MauKjCPAvc29NEY4FpLHIUWiP+Y0Bfrs5dg==", "dev": true }, "elegant-spinner": { @@ -16945,9 +16953,9 @@ }, "dependencies": { "@types/node": { - "version": "10.17.29", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.29.tgz", - "integrity": "sha512-zLo9rjUeQ5+QVhOufDwrb3XKyso31fJBJnk9wUUQIBDExF/O4LryvpOfozfUaxgqifTnlt7FyqsAPXUq5yFZSA==" + "version": "10.17.30", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.30.tgz", + "integrity": "sha512-euU8QLX0ipj+5mOYa4ZqZoTv+53BY7yTg9I2ZIhDXgiI3M+0n4mdAt9TQCuvxVAgU179g8OsRLaBt0qEi0T6xA==" } } }, @@ -25360,31 +25368,21 @@ } }, "mongodb-memory-server": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/mongodb-memory-server/-/mongodb-memory-server-6.6.7.tgz", - "integrity": "sha512-azRGr5csTAl0MCLR/amPCJrmV5TFwRcVtal56dHrPy1o2T8wZRc3AaJyukob8a/JP38JYa/pQnw1AQH7lFA2Cg==", + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/mongodb-memory-server/-/mongodb-memory-server-6.7.0.tgz", + "integrity": "sha512-vCXvDfi2Sbvg6/Ww0LBRbp5FZtqeFA1zLJeF4wlwU7IBwcop3zI75nq+dm6hlMzLGVIsLhN5fb1Ps8hztz3TFw==", "dev": true, "requires": { - "mongodb-memory-server-core": "6.6.7" + "mongodb-memory-server-core": "6.7.0" } }, "mongodb-memory-server-core": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/mongodb-memory-server-core/-/mongodb-memory-server-core-6.6.7.tgz", - "integrity": "sha512-21g2FpQdgqN3sFsj5lbGje1BhrSRGNHgz6gMAl8bvmdpRpoZErclkImVtjBXNHCNmCc1Dxr+EBvH11KaVE+9iQ==", - "dev": true, - "requires": { - "@types/cross-spawn": "^6.0.2", - "@types/debug": "^4.1.5", - "@types/dedent": "^0.7.0", - "@types/find-cache-dir": "^3.2.0", - "@types/find-package-json": "^1.1.1", - "@types/lockfile": "^1.0.1", - "@types/md5-file": "^4.0.2", - "@types/mkdirp": "^1.0.1", - "@types/semver": "^7.3.3", + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/mongodb-memory-server-core/-/mongodb-memory-server-core-6.7.0.tgz", + "integrity": "sha512-N6pQqS6KjOGcfdydDgJ0ddaaifM8Ee6BtP+nFQIDjon76pvOtPuR8PddXM/tWeSv5fNhPx00/ILZCmpE8IiwLw==", + "dev": true, + "requires": { "@types/tmp": "^0.2.0", - "@types/uuid": "^8.0.0", "camelcase": "^6.0.0", "cross-spawn": "^7.0.3", "debug": "^4.1.1", @@ -25395,11 +25393,11 @@ "lockfile": "^1.0.4", "md5-file": "^5.0.0", "mkdirp": "^1.0.4", - "mongodb": "^3.5.9", + "mongodb": "3.6.1", "semver": "^7.3.2", "tar-stream": "^2.1.3", "tmp": "^0.2.1", - "uuid": "^8.2.0", + "uuid": "8.3.0", "yauzl": "^2.10.0" }, "dependencies": { @@ -25963,9 +25961,9 @@ } }, "node-releases": { - "version": "1.1.60", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.60.tgz", - "integrity": "sha512-gsO4vjEdQaTusZAEebUWp2a5d7dF5DYoIpDG7WySnk7BuZDW+GPpHXoXXuYawRBr/9t5q54tirPz79kFIWg4dA==", + "version": "1.1.61", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.61.tgz", + "integrity": "sha512-DD5vebQLg8jLCOzwupn954fbIiZht05DAZs0k2u8NStSe6h9XdsuIQL8hSRKYiU8WUQRznmSDrKGbv3ObOmC7g==", "dev": true }, "node-schedule": { @@ -31955,9 +31953,9 @@ }, "dependencies": { "@types/node": { - "version": "13.13.16", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.16.tgz", - "integrity": "sha512-dJ9vXxJ8MEwzNn4GkoAGauejhXoKuJyYKegsA6Af25ZpEDXomeVXt5HUWUNVHk5UN7+U0f6ghC6otwt+7PdSDg==" + "version": "13.13.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.17.tgz", + "integrity": "sha512-rGZftvdDpsYtG/rOlDOwny1f6Aq4FHJdGSVfPg5vC2DaR9Rt4W2OpsOF5GTU2bSqZmwTkfnsvJhhzpMWYxxlEA==" } } }, @@ -33865,67 +33863,23 @@ "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", "dev": true }, - "@serverless/components": { - "version": "2.34.9", - "resolved": "https://registry.npmjs.org/@serverless/components/-/components-2.34.9.tgz", - "integrity": "sha512-qFjIeGgR4SjS32Tbl4BvoxOtLpv3Vx4s/81HdmmpdIrMPe7ePGUfkBVBu3axxAXHf4ajlb4WC1HmhTmZAHHSLQ==", + "@serverless/cli": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@serverless/cli/-/cli-1.5.2.tgz", + "integrity": "sha512-FMACx0qPD6Uj8U+7jDmAxEe1tdF9DsuY5VsG45nvZ3olC9xYJe/PMwxWsjXfK3tg1HUNywYAGCsy7p5fdXhNzw==", "dev": true, "requires": { - "@serverless/inquirer": "^1.1.2", - "@serverless/platform-client": "^1.1.3", - "@serverless/platform-client-china": "^1.0.37", - "@serverless/platform-sdk": "^2.3.1", + "@serverless/core": "^1.1.2", + "@serverless/template": "^1.1.3", "@serverless/utils": "^1.2.0", - "adm-zip": "^0.4.16", "ansi-escapes": "^4.3.1", "chalk": "^2.4.2", - "child-process-ext": "^2.1.1", "chokidar": "^3.4.1", "dotenv": "^8.2.0", "figures": "^3.2.0", - "fs-extra": "^8.1.0", - "globby": "^10.0.2", - "got": "^9.6.0", - "graphlib": "^2.1.8", - "https-proxy-agent": "^5.0.0", - "ini": "^1.3.5", - "inquirer-autocomplete-prompt": "^1.0.2", - "js-yaml": "^3.14.0", "minimist": "^1.2.5", - "moment": "^2.27.0", - "open": "^7.1.0", "prettyoutput": "^1.2.0", - "ramda": "^0.26.1", - "semver": "^7.3.2", - "stream.pipeline-shim": "^1.1.0", - "strip-ansi": "^5.2.0", - "traverse": "^0.6.6", - "uuid": "^3.4.0", - "ws": "^7.3.1" - }, - "dependencies": { - "globby": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", - "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==", - "dev": true, - "requires": { - "@types/glob": "^7.1.1", - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.0.3", - "glob": "^7.1.3", - "ignore": "^5.1.1", - "merge2": "^1.2.3", - "slash": "^3.0.0" - } - }, - "semver": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", - "dev": true - } + "strip-ansi": "^5.2.0" } }, "ansi-regex": { @@ -33934,6 +33888,15 @@ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "^1.0.1" + } + }, "bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -33996,6 +33959,15 @@ "which": "^1.2.9" } }, + "dir-glob": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz", + "integrity": "sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw==", + "dev": true, + "requires": { + "path-type": "^3.0.0" + } + }, "emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", @@ -34017,6 +33989,20 @@ "strip-eof": "^1.0.0" } }, + "fast-glob": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz", + "integrity": "sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==", + "dev": true, + "requires": { + "@mrmlnc/readdir-enhanced": "^2.2.1", + "@nodelib/fs.stat": "^1.1.2", + "glob-parent": "^3.1.0", + "is-glob": "^4.0.0", + "merge2": "^1.2.3", + "micromatch": "^3.1.10" + } + }, "fill-range": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", @@ -34098,54 +34084,14 @@ "ignore": "^4.0.3", "pify": "^4.0.1", "slash": "^2.0.0" - }, - "dependencies": { - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "dev": true, - "requires": { - "array-uniq": "^1.0.1" - } - }, - "dir-glob": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz", - "integrity": "sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw==", - "dev": true, - "requires": { - "path-type": "^3.0.0" - } - }, - "fast-glob": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz", - "integrity": "sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==", - "dev": true, - "requires": { - "@mrmlnc/readdir-enhanced": "^2.2.1", - "@nodelib/fs.stat": "^1.1.2", - "glob-parent": "^3.1.0", - "is-glob": "^4.0.0", - "merge2": "^1.2.3", - "micromatch": "^3.1.10" - } - }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true - }, - "slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", - "dev": true - } } }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, "is-docker": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-1.1.0.tgz", @@ -34232,10 +34178,10 @@ } } }, - "ramda": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.26.1.tgz", - "integrity": "sha512-hLWjpy7EnsDBb0p+Z3B7rPi3GDeRG5ZtiI33kJhTt+ORCd38AbAIjB/9zRIUoeTbE/AVX5ZkU7m6bznsvrf8eQ==", + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", "dev": true }, "string-width": { @@ -34277,12 +34223,6 @@ "repeat-string": "^1.6.1" } }, - "traverse": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", - "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=", - "dev": true - }, "type": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/type/-/type-2.1.0.tgz", @@ -34348,12 +34288,6 @@ "signal-exit": "^3.0.2" } }, - "ws": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.1.tgz", - "integrity": "sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA==", - "dev": true - }, "yallist": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", @@ -36737,9 +36671,9 @@ "dev": true }, "@types/node": { - "version": "10.17.29", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.29.tgz", - "integrity": "sha512-zLo9rjUeQ5+QVhOufDwrb3XKyso31fJBJnk9wUUQIBDExF/O4LryvpOfozfUaxgqifTnlt7FyqsAPXUq5yFZSA==", + "version": "10.17.30", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.30.tgz", + "integrity": "sha512-euU8QLX0ipj+5mOYa4ZqZoTv+53BY7yTg9I2ZIhDXgiI3M+0n4mdAt9TQCuvxVAgU179g8OsRLaBt0qEi0T6xA==", "dev": true }, "array-union": { diff --git a/package.json b/package.json index f3c97af8..28f1983f 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "lint-staged": "lint-staged", "bundle:analyze": "webpack-bundle-analyzer", "build:scripts": "tsc -p tools/scripts/tsconfig.json", - "validate-packages": "node ./tools/scripts/bin/validate-packages.js && git add \\*/package.json", + "validate-packages": "node ./tools/scripts/bin/validate-packages.js && git add */package.json", "semantic-release": "semantic-release", "nx": "nx" }, @@ -133,7 +133,7 @@ "jest-marbles": "^2.5.1", "jest-preset-angular": "^8.3.1", "lint-staged": "^10.2.11", - "mongodb-memory-server": "^6.6.4", + "mongodb-memory-server": "^6.7.0", "prettier": "^2.0.5", "pretty-quick": "^3.0.0", "semantic-release": "^17.1.1", @@ -160,5 +160,10 @@ "@semantic-release/release-notes-generator", "@semantic-release/github" ] + }, + "config": { + "mongodbMemoryServer": { + "version": "4.2.3" + } } }