Skip to content

Commit

Permalink
Auto-merge pull request #660 from atomist/automation-client
Browse files Browse the repository at this point in the history
Update 49 npm dependencies
    
Pull request auto merged:

* Protection rule for branch `main` passed
* No reviews
* 3 successful checks
  • Loading branch information
atomist[bot] authored Feb 9, 2021
2 parents ce2e5ac + 5091d1a commit 272d57c
Show file tree
Hide file tree
Showing 7 changed files with 2,814 additions and 11,370 deletions.
9 changes: 4 additions & 5 deletions lib/internal/graph/graphQL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,14 +299,14 @@ function inlineFragments(q: string, name: string, moduleDir: string, fragmentDir
const content = fs.readFileSync(p.join(fragmentDir, f)).toString();
const graphql = gql(content);
return {
name: (graphql.definitions[0]).name.value,
kind: (graphql.definitions[0]).kind,
name: (graphql.definitions[0] as any).name?.value,
kind: graphql.definitions[0].kind,
body: content.slice(content.indexOf("{") + 1, content.lastIndexOf("}") - 1),
};
}).filter(f => f.kind === "FragmentDefinition");

FragmentExpression.lastIndex = 0;
let result;
let result: RegExpExecArray;

// tslint:disable-next-line:no-conditional-assignment
while (result = FragmentExpression.exec(q)) {
Expand All @@ -329,7 +329,6 @@ function locateAndLoadGraphql(
): string {

let path = options.path;
const name = options.name;
// Read subscription from file if given
if (options.path) {
if (!path.endsWith(".graphql")) {
Expand All @@ -346,7 +345,7 @@ function locateAndLoadGraphql(
const queries = fs.readdirSync(queryDir).filter(f => f.endsWith(".graphql")).filter(f => {
const content = fs.readFileSync(p.join(queryDir, f)).toString();
const graphql = gql(content);
return (graphql.definitions[0]).name.value === options.name;
return (graphql.definitions[0] as any).name?.value === options.name;
});
if (queries.length === 1) {
path = p.join(queryDir, queries[0]);
Expand Down
10 changes: 5 additions & 5 deletions lib/internal/transport/express/ExpressServer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as GitHubApi from "@octokit/rest";
import { Octokit } from "@octokit/rest";
import * as bodyParser from "body-parser";
import * as express from "express";
import * as passport from "passport";
Expand Down Expand Up @@ -112,19 +112,19 @@ export class ExpressServer {
this.exp.options(`${this.apiBase}/log/events`, cors());
this.exp.get(`${this.apiBase}/log/events`, cors(), this.adminRoute, this.authenticate,
(req, res) => {
res.json(globals.eventStore().events(req.query.from));
res.json(globals.eventStore().events(req.query.from as unknown as number));
});

this.exp.options(`${this.apiBase}/log/commands`, cors());
this.exp.get(`${this.apiBase}/log/commands`, cors(), this.adminRoute, this.authenticate,
(req, res) => {
res.json(globals.eventStore().commands(req.query.from));
res.json(globals.eventStore().commands(req.query.from as unknown as number));
});

this.exp.options(`${this.apiBase}/log/messages`, cors());
this.exp.get(`${this.apiBase}/log/messages`, cors(), this.adminRoute, this.authenticate,
(req, res) => {
res.json(globals.eventStore().messages(req.query.from));
res.json(globals.eventStore().messages(req.query.from as unknown as number));
});

this.exp.options(`${this.apiBase}/series/events`, cors());
Expand Down Expand Up @@ -242,7 +242,7 @@ export class ExpressServer {
passReqToCallback: true,
} as bearer.IStrategyOptions,
(req, token, done) => {
const api = new GitHubApi();
const api = new Octokit();
api.authenticate({ type: "token", token });
api.users.getAuthenticated({})
.then(user => {
Expand Down
4 changes: 2 additions & 2 deletions lib/internal/util/memory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function initMemoryMonitoring(dataDirectory: string = `${appRoot.path}/he
* Create a head dump that can be downloaded and used to profile head usage.
* @returns {string}
*/
export function mtrace(): string {
export function mtrace(): void {
try {
logger.debug("Memory statistics '%j'", memoryUsage());
const mtrace = require("mtrace");
Expand All @@ -39,7 +39,7 @@ export function mtrace(): string {
}
broadcast({ type: "atomist:gc" });
broadcast({ type: "atomist:mtrace" });
return name;
return;
} catch (err) {
logger.error("Failed to initialise mtrace. Required 'mtrace' module is missing or can't be" +
" loaded. Please install with 'npm install --save mtrace'");
Expand Down
4 changes: 0 additions & 4 deletions lib/project/fileGlobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ export const AllFiles = "**/**";

/**
* Negative glob to exclude .git directory
* @type {string}
*/
export const ExcludeGit = "!.git/**";

/**
* Negative glob to exclude node_modules directory. We nearly always want to exclude
* this when handling node projects, for performance reasons.
* @type {string}
*/
export const ExcludeNodeModules = "!**/node_modules/**";

Expand All @@ -21,12 +19,10 @@ export const ExcludeTarget = "!target/**";
/**
* Default exclusions (git and node modules).
* Must be combined with a positive glob.
* @type {[string , string]}
*/
export const DefaultExcludes = [ExcludeGit, ExcludeNodeModules, ExcludeTarget];

/**
* Include all files except with default exclusions (git and node modules)
* @type {[string , string , string]}
*/
export const DefaultFiles = [AllFiles].concat(DefaultExcludes);
Loading

0 comments on commit 272d57c

Please sign in to comment.