Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@metrichor/epi2me-api

Package Overview
Dependencies
Maintainers
3
Versions
231
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metrichor/epi2me-api - npm Package Compare versions

Comparing version 6.0.7479716 to 6.0.7581324

3

cjs/src/epi2me-fs.d.ts

@@ -23,2 +23,5 @@ /// <reference types="node" />

static GraphQL: typeof GraphQLFS;
/**
* @deprecated use `getExperiments` instead
*/
SampleReader: SampleReader;

@@ -25,0 +28,0 @@ telemetryLogStream?: fs.WriteStream;

13

cjs/src/epi2me-fs.js

@@ -77,2 +77,5 @@ /**

constructor(opts) {
/**
* @deprecated use `getExperiments` instead
*/
this.SampleReader = new sampleReader.SampleReader();

@@ -214,3 +217,3 @@ this.stopped = true;

async stopAnalysis() {
// If we stop the cloud, there's no point uploading anymore
// If we stop the cloud, there's no point uploading any more
this.stopUpload();

@@ -242,3 +245,3 @@ // This will stop all the intervals on their next call

const credentials$1 = new credentials.Epi2meCredentials(this.fetchToken, this.config.options.sessionGrace);
// Will need to prefetch a token to acccess region before creating the S3 service
// Will need to prefetch a token to access region before creating the S3 service
return new AWS__namespace.S3(Object.assign(Object.assign({ useAccelerateEndpoint: this.config.options.awsAcceleration === 'on' }, options), { region: this.config.instance.region, credentials: credentials$1, httpOptions: {

@@ -685,3 +688,3 @@ agent: this.proxyAgent,

catch (err) {
this.log.error(NodeError.NestedError.formatMessage('error writing telemtry', err));
this.log.error(NodeError.NestedError.formatMessage('error writing telemetry', err));
}

@@ -698,3 +701,3 @@ if (this.config.options.telemetryCb) {

const idWorkflowInstance = this.config.instance.id_workflow_instance;
let folder = path__default["default"].join(tsRuntimeTypecheck.asString(this.config.options.outputFolder), tsRuntimeTypecheck.isUndefined(idWorkflowInstance) ? '' : tsRuntimeTypecheck.makeString(idWorkflowInstance));
let folder = path__default["default"].join(tsRuntimeTypecheck.asString(this.config.options.outputFolder), `${idWorkflowInstance !== null && idWorkflowInstance !== void 0 ? idWorkflowInstance : ''}`);
const telemetryHintsFolder = tsRuntimeTypecheck.asOptString((_a = tsRuntimeTypecheck.asOptDictionary(telemetry === null || telemetry === void 0 ? void 0 : telemetry.hints)) === null || _a === void 0 ? void 0 : _a.folder);

@@ -710,3 +713,3 @@ /* MC-940: use folder hinting if present */

.map((o) => o.toUpperCase()); // MC-5612 cross-platform uppercase "pass" folder
folder = path__default["default"].join.apply(null, [folder, ...codes]);
folder = path__default["default"].join(...[folder, ...codes]);
}

@@ -713,0 +716,0 @@ try {

@@ -25,2 +25,5 @@ /// <reference types="node" />

get graphQL(): GraphQLFS;
/**
* @deprecated use `getExperiments` instead
*/
get sampleReader(): SampleReader;

@@ -27,0 +30,0 @@ get proxyAgent(): Agent | undefined;

@@ -51,2 +51,5 @@ /**

}
/**
* @deprecated use `getExperiments` instead
*/
get sampleReader() {

@@ -53,0 +56,0 @@ return this.primary.SampleReader;

@@ -1,4 +0,2 @@

export declare function genericFileStatistics(filePath: string): Promise<{
type: string;
bytes: number;
}>;
import type { DefaultStats } from './filestats.type';
export declare function genericFileStatistics(filePath: string): Promise<DefaultStats>;

@@ -16,5 +16,4 @@ /**

async function genericFileStatistics(filePath) {
return fs__default["default"].promises.stat(filePath).then((d) => {
return { type: 'bytes', bytes: d.size };
});
const { size: bytes } = await fs__default["default"].promises.stat(filePath);
return { type: 'bytes', bytes };
}

@@ -21,0 +20,0 @@

@@ -1,5 +0,2 @@

export declare function fastaFileStatistics(filePath: string): Promise<{
type: string;
bytes: number;
sequences: number;
}>;
import type { FastaStats } from './filestats.type';
export declare function fastaFileStatistics(filePath: string): Promise<FastaStats>;

@@ -19,3 +19,2 @@ /**

let lineCount = 1;
let idx = -1;
if (stat.size === 0) {

@@ -29,3 +28,3 @@ return {

const readStream = fs__default["default"].createReadStream(filePath).on('data', (buffer) => {
idx = -1;
let idx = -1;
lineCount -= 1;

@@ -32,0 +31,0 @@ do {

@@ -1,5 +0,2 @@

export declare function fastqFileStatistics(filePath: string): Promise<{
type: string;
bytes: number;
reads: number;
}>;
import type { FastqStats } from './filestats.type';
export declare function fastqFileStatistics(filePath: string): Promise<FastqStats>;

@@ -15,31 +15,27 @@ /**

function fastqFileStatistics(filePath) {
const LINES_PER_READ = 4;
async function fastqFileStatistics(filePath) {
let lineCount = 1;
const stat = await fs__default["default"].promises.stat(filePath);
if (stat.size === 0) {
return {
type: 'fastq',
bytes: 0,
reads: 0,
};
}
const readStream = fs__default["default"].createReadStream(filePath).on('data', (buffer) => {
let idx = -1;
lineCount -= 1;
do {
idx = buffer.indexOf(10, idx + 1);
lineCount += 1;
} while (idx !== -1);
});
return new Promise((resolve, reject) => {
const linesPerRead = 4;
let lineCount = 1;
let idx = -1;
let stat = {
size: 0,
};
try {
// TODO make this async
stat = fs__default["default"].statSync(filePath);
}
catch (e) {
reject(e);
return;
}
fs__default["default"].createReadStream(filePath)
.on('data', (buffer) => {
idx = -1;
lineCount -= 1;
do {
idx = buffer.indexOf(10, idx + 1);
lineCount += 1;
} while (idx !== -1);
})
readStream
.on('end', () => resolve({
type: 'fastq',
bytes: stat.size,
reads: Math.floor(lineCount / linesPerRead),
reads: Math.floor(lineCount / LINES_PER_READ),
}))

@@ -46,0 +42,0 @@ .on('error', reject);

@@ -1,5 +0,2 @@

export declare function fastqgzFileStatistics(filePath: string): Promise<{
type: string;
bytes: number;
reads: number;
}>;
import type { FastqGZStats } from './filestats.type';
export declare function fastqgzFileStatistics(filePath: string): Promise<FastqGZStats>;

@@ -27,3 +27,2 @@ /**

let lineCount = 1;
let idx = -1;
const gunzipStream = fs__default["default"]

@@ -33,3 +32,3 @@ .createReadStream(filePath)

.on('data', (buffer) => {
idx = -1;
let idx = -1;
lineCount -= 1;

@@ -36,0 +35,0 @@ do {

@@ -0,1 +1,20 @@

export interface FastqStats {
type: 'fastq';
bytes: number;
reads: number;
}
export interface FastaStats {
type: 'fasta';
bytes: number;
sequences: number;
}
export interface FastqGZStats {
type: 'gz';
bytes: number;
reads: number;
}
export interface DefaultStats {
type: 'bytes';
bytes: number;
}
export interface MappedFileStats {

@@ -2,0 +21,0 @@ type: string;

@@ -23,2 +23,5 @@ /// <reference types="node" />

static GraphQL: typeof GraphQLFS;
/**
* @deprecated use `getExperiments` instead
*/
SampleReader: SampleReader;

@@ -25,0 +28,0 @@ telemetryLogStream?: fs.WriteStream;

@@ -25,2 +25,5 @@ /// <reference types="node" />

get graphQL(): GraphQLFS;
/**
* @deprecated use `getExperiments` instead
*/
get sampleReader(): SampleReader;

@@ -27,0 +30,0 @@ get proxyAgent(): Agent | undefined;

@@ -1,4 +0,2 @@

export declare function genericFileStatistics(filePath: string): Promise<{
type: string;
bytes: number;
}>;
import type { DefaultStats } from './filestats.type';
export declare function genericFileStatistics(filePath: string): Promise<DefaultStats>;

@@ -1,5 +0,2 @@

export declare function fastaFileStatistics(filePath: string): Promise<{
type: string;
bytes: number;
sequences: number;
}>;
import type { FastaStats } from './filestats.type';
export declare function fastaFileStatistics(filePath: string): Promise<FastaStats>;

@@ -1,5 +0,2 @@

export declare function fastqFileStatistics(filePath: string): Promise<{
type: string;
bytes: number;
reads: number;
}>;
import type { FastqStats } from './filestats.type';
export declare function fastqFileStatistics(filePath: string): Promise<FastqStats>;

@@ -1,5 +0,2 @@

export declare function fastqgzFileStatistics(filePath: string): Promise<{
type: string;
bytes: number;
reads: number;
}>;
import type { FastqGZStats } from './filestats.type';
export declare function fastqgzFileStatistics(filePath: string): Promise<FastqGZStats>;

@@ -0,1 +1,20 @@

export interface FastqStats {
type: 'fastq';
bytes: number;
reads: number;
}
export interface FastaStats {
type: 'fasta';
bytes: number;
sequences: number;
}
export interface FastqGZStats {
type: 'gz';
bytes: number;
reads: number;
}
export interface DefaultStats {
type: 'bytes';
bytes: number;
}
export interface MappedFileStats {

@@ -2,0 +21,0 @@ type: string;

{
"name": "@metrichor/epi2me-api",
"version": "6.0.7479716",
"version": "6.0.7581324",
"license": "MPL-2.0",

@@ -17,5 +17,2 @@ "repository": "git@github.com:nanoporetech/epi2me-api.git",

"@apollo/client": "^3.4.16",
"@grpc/grpc-js": "^1.3.7",
"@improbable-eng/grpc-web": "^0.14.1",
"@improbable-eng/grpc-web-node-http-transport": "^0.14.1",
"@types/socket.io-client": "^3.0.0",

@@ -27,3 +24,2 @@ "aws-sdk": "^2.1002.0",

"fs-inspect": "^1.0.3",
"google-protobuf": "^3.18.1",
"graphql": "^15.6.1",

@@ -30,0 +26,0 @@ "graphql-tag": "^2.12.5",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc