repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
mtolley/seeker-github-actions
src/seeker-compliance-report.ts
// seeker-compliance-report // //////////////////////// // // Downloads the Seeker Compliance report for the specified project and uploads // it to the workflow results as a build artefact. import * as core from '@actions/core' import {generateSeekerComplianceReportPDF, getInputOrEnvironmentVariable, uploadSeekerCompl...
mtolley/seeker-github-actions
src/list-seeker-vulnerabilities.ts
<reponame>mtolley/seeker-github-actions<filename>src/list-seeker-vulnerabilities.ts // list-seeker-vulnerabilities // /////////////////////////// // // Lists vulnerabilities from the Seeker server apply these filters: // // * Project key // * (Optional) Project version // * (Optional) Only Seeker-Verified vulnerabilit...
mtolley/seeker-github-actions
src/testme.ts
// fix-undetected-vulnerabilities // ////////////////////////////// // // Search for any vulnerabilities in the project that currently have a status of // DETECTED but which were not detected during testing of the specified version of // the project. If any such vulnerabilties are found, set the Status to FIXED. // //...
mtolley/seeker-github-actions
src/fix-undetected-vulnerabilities.ts
<reponame>mtolley/seeker-github-actions // fix-undetected-vulnerabilities // ////////////////////////////// // // Search for any vulnerabilities in the project that currently have a status of // DETECTED but which were not detected during testing of the specified version of // the project. If any such vulnerabilties a...
mtolley/seeker-github-actions
src/utils.ts
import * as core from '@actions/core' import axios, { AxiosError, AxiosResponse } from 'axios' import { writeFileSync } from 'fs' import * as artifact from '@actions/artifact' export interface Vulnerability { Owner: string, ProjectKey: string, ItemKey: string, CheckerKey: string, VulnerabilityName: string, ...
allboatsrise/gigya-react-native-plugin-for-sap-customer-data-cloud
src/resolvers.d.ts
import { GigyaError } from "."; import { GigyaDictionary, GigyaSocialProviders } from "./Models"; export class ResolverFactory { getResolver(error: GigyaError) : IResolver } export class IResolver { regToken: string; constructor(regToken: string) } export interface LinkAccountResolver extends IResolver ...
allboatsrise/gigya-react-native-plugin-for-sap-customer-data-cloud
src/models.ts
export type GigyaDictionary = Record<string, any>; export type GigyaSocialProviders = "facebook" | "google" | "yahoo" | "twitter" | "line" | "wechat" | "amazon" | "apple" | "instagram" | "linkedin" export enum GigyaInterruption { pendingRegistration = 206001, pendingVerification = 206002, conflictingAcc...
Nike-Inc/actions-cerberus-secrets
src/utils.ts
<gh_stars>1-10 /* * Copyright 2020-present, Nike, Inc. * All rights reserved. * * This source code is licensed under the Apache-2.0 license found in * the LICENSE file in the root directory of this source tree. * */ /* eslint-disable i18n-text/no-en */ import * as core from '@actions/core' import * as exec fro...
Nike-Inc/actions-cerberus-secrets
src/main.ts
/* * Copyright 2020-present, Nike, Inc. * All rights reserved. * * This source code is licensed under the Apache-2.0 license found in * the LICENSE file in the root directory of this source tree. * */ /* eslint-disable i18n-text/no-en */ import * as core from '@actions/core' import Cerberus from './cerberus' i...
Nike-Inc/actions-cerberus-secrets
src/cerberus.ts
<reponame>Nike-Inc/actions-cerberus-secrets /* * Copyright 2020-present, Nike, Inc. * All rights reserved. * * This source code is licensed under the Apache-2.0 license found in * the LICENSE file in the root directory of this source tree. * */ /* eslint-disable github/array-foreach */ /* eslint-disable github/...
sheva007/imdb-crawler
src/controller/CrawlLinksAction.ts
<filename>src/controller/CrawlLinksAction.ts import { Request, Response } from "express"; import axois from 'axios'; import * as cheerio from 'cheerio'; import { movieSave } from "../module/movies"; import * as fs from 'fs'; /** * crawl links */ export async function crawlLinksAction(request: Request, response: Respo...
sheva007/imdb-crawler
src/controller/MovieGetAllAction.ts
import { Request, Response } from "express"; import { movieGetAll } from "../module/movies"; /** * return all movies */ export async function movieGetAllAction(request: Request, response: Response) { response.send(await movieGetAll()) }
sheva007/imdb-crawler
src/index.ts
<reponame>sheva007/imdb-crawler import "reflect-metadata"; import { createConnection } from "typeorm"; import { Request, Response } from "express"; import * as express from "express"; import * as cors from "cors"; import * as bodyParser from "body-parser"; import AppRoutes from "./routes"; var helmet = require('helmet'...
sheva007/imdb-crawler
src/controller/HomeAction.ts
import { Request, Response } from "express"; import * as path from 'path'; /** * home page */ export async function homeAction(request: Request, response: Response) { response.sendFile(path.join(__dirname + '/../../assets/links_form.html')); }
sheva007/imdb-crawler
src/routes.ts
<filename>src/routes.ts import { homeAction } from "./controller/HomeAction"; import { crawlLinksAction } from "./controller/CrawlLinksAction"; import { movieGetAllAction } from "./controller/MovieGetAllAction"; /** * All routes. */ const Routes = [ { path: "/", method: "get", action: hom...
sheva007/imdb-crawler
src/module/movies.ts
<reponame>sheva007/imdb-crawler<filename>src/module/movies.ts import { getManager } from "typeorm"; import { Movie } from "../entities/Movie"; /** * get all Movies. */ export async function movieGetAll() { const repository = getManager().getRepository(Movie); const entities = await repository.find(); ...
sheva007/imdb-crawler
src/entities/Movie.ts
<reponame>sheva007/imdb-crawler<gh_stars>0 import { Entity, PrimaryGeneratedColumn, CreateDateColumn, Column, UpdateDateColumn } from "typeorm"; @Entity() export class Movie { @PrimaryGeneratedColumn() id: number; @Column({ type: "varchar", length: 11, nullable: false }) im...
gigicupp/code-challenge
test/pages/create_account.test.tsx
import { fireEvent, render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import fetchMock from 'jest-fetch-mock'; import CreateAccount from 'src/pages/create_account'; describe('CreateAccount', () => { beforeEach(() => { fetchMock.enableMocks(); }); afterEach(...
gigicupp/code-challenge
src/pages/success.tsx
import React from 'react'; import style from '../styles/success.module.scss'; import Image from 'next/image'; export default () => { return ( <div className={style.container}> <h2>Congratulations!</h2> <p>Your account has been created successfully.</p> <Image src='/images/giphy.gif' ...
gigicupp/code-challenge
test/pages/api/create_new_account.test.ts
<gh_stars>0 import { expect } from '@jest/globals'; import createNewAccount from 'src/pages/api/create_new_account'; import { mockRequest } from 'test/utils'; describe('/api/create_new_account', () => { test('returns true', async () => { const { req, res } = mockRequest({ method: 'POST', body: { ...
gigicupp/code-challenge
src/pages/api/create_new_account.ts
<filename>src/pages/api/create_new_account.ts import type { NextApiRequest, NextApiResponse } from 'next'; import checkErrors from '../../utils/checkErrors'; interface CreateNewAccountParameters { username: string; password: string; password1: string; errors: object; } interface BooleanResult { result: bool...
gigicupp/code-challenge
src/pages/create_account.tsx
<filename>src/pages/create_account.tsx import Head from 'next/head'; import React, { FormEvent } from 'react'; import styles from 'src/styles/create_account.module.scss'; import Image from 'next/image'; import Router from 'next/router'; import checkErrors from '../utils/checkErrors'; import checkRetypePass from '../uti...
MaBeuLux88/mongosh
packages/service-provider-core/src/service-provider.ts
<filename>packages/service-provider-core/src/service-provider.ts<gh_stars>0 import Readable from './readable'; import Writable from './writable'; import Closable from './closable'; import Admin from './admin'; /** * Interface for all service providers. */ interface ServiceProvider extends Readable, Writable, Closabl...
MaBeuLux88/mongosh
packages/browser-repl/src/components/editor.tsx
<filename>packages/browser-repl/src/components/editor.tsx import React, { Component } from 'react'; import PropTypes from 'prop-types'; import AceEditor from 'react-ace'; import { Autocompleter } from '@mongosh/browser-runtime-core'; import { AceAutocompleterAdapter } from './ace-autocompleter-adapter'; import 'brace/...
MaBeuLux88/mongosh
packages/browser-repl/src/components/utils/inspect.spec.ts
<reponame>MaBeuLux88/mongosh<gh_stars>0 import { ObjectId } from 'bson'; import { expect } from 'chai'; import { inspect } from './inspect'; describe('inspect', () => { context('with simple types', () => { it('inspects numbers', () => { expect( inspect(1) ).to.equal('1'); }); it('ins...
MaBeuLux88/mongosh
packages/build/src/release.ts
<filename>packages/build/src/release.ts<gh_stars>0 import os from 'os'; import Config from './config'; import compileExec from './compile-exec'; import uploadDownloadCenterConfig from './download-center'; import Platform from './platform'; import zip from './zip'; import S3 from 'aws-sdk/clients/s3'; /** * Run the re...
MaBeuLux88/mongosh
packages/shell-api/src/cursor-iteration-result.ts
export class CursorIterationResult extends Array { toReplString: () => this; shellApiType: () => string; constructor(...args) { super(...args); Object.defineProperty(this, 'toReplString', { value: () => { return this; }, enumerable: false }); Object.defineProperty(this, 'shellApiTyp...
MaBeuLux88/mongosh
packages/shell-api/src/explainable.spec.ts
<reponame>MaBeuLux88/mongosh<gh_stars>0 import sinon from 'sinon'; import Mapper from '../../mapper/lib'; import { Collection, Database, Explainable } from './shell-api'; import * as signatures from './shell-api-signatures'; import { expect } from 'chai'; /** * Test that an explainable method proxies the respective M...
MaBeuLux88/mongosh
packages/shell-api/src/shell-bson.ts
<filename>packages/shell-api/src/shell-bson.ts import bson from 'bson'; type DateConstructorArguments = [ any?, any?, ...any[] ]; function dateHelper(...args: DateConstructorArguments): Date { if (args.length === 0) { return new Date(); } if (args.length === 1) { return new Date(args[0]); } return n...
MaBeuLux88/mongosh
packages/browser-repl/src/components/shell-output-line.tsx
<reponame>MaBeuLux88/mongosh import React, { Component } from 'react'; import classnames from 'classnames'; import PropTypes from 'prop-types'; import Icon from '@leafygreen-ui/icon'; import { LineWithIcon } from './utils/line-with-icon'; import { HelpOutput } from './types/help-output'; import { ShowDbsOutput } fro...
MaBeuLux88/mongosh
packages/build/src/config.ts
/** * Defines the configuration interface for the build system. */ interface Config { [key: string]: any; } export default Config;
MaBeuLux88/mongosh
packages/build/src/zip.ts
<filename>packages/build/src/zip.ts import path from 'path'; import tar from 'tar'; import AdmZip from 'adm-zip'; import Platform from './platform'; /** * Get the path to the zip. * * @param {string} outputDir - The output directory. * @param {string} platform - The platform. * @param {string} version - The versi...
MaBeuLux88/mongosh
packages/shell-api/src/index.ts
import * as signatures from './shell-api-signatures'; import ShellBson from './shell-bson'; import toIterator from './toIterator'; export { signatures, ShellBson, toIterator }; export { Help } from './help'; export { CursorIterationResult } from './cursor-iteration-result'; export * from './shell-api';
MaBeuLux88/mongosh
packages/browser-runtime-electron/src/electron-runtime.ts
import { ElectronInterpreterEnvironment } from './electron-interpreter-environment'; import { Runtime, EvaluationResult, OpenContextRuntime, Completion } from '@mongosh/browser-runtime-core'; import { ServiceProvider } from '@mongosh/service-provider-core'; export class ElectronRuntime implements Runtime {...
MaBeuLux88/mongosh
packages/service-provider-core/src/command-options.ts
import WriteConcern from "./write-concern"; export default interface CommandOptions { writeConcern?: WriteConcern }
MaBeuLux88/mongosh
packages/shell-api/src/database.spec.ts
<reponame>MaBeuLux88/mongosh import sinon from 'sinon'; import Mapper from '../../mapper/lib'; import { Database, Collection } from './shell-api'; import * as signatures from './shell-api-signatures'; import { expect } from 'chai'; /** * Test that a database method proxies the respective Mapper method correctly, * w...
MaBeuLux88/mongosh
packages/cli-repl/src/connect-info.ts
import getBuildInfo from 'mongodb-build-info'; interface ConnectInfo { isAtlas: boolean; isLocalhost: boolean; serverVersion: string; isEnterprise: boolean; uri: string; authType?: string; isDataLake: boolean; dlVersion?: string; isGenuine: boolean; serverName: string; } export default function ge...
MaBeuLux88/mongosh
packages/service-provider-browser/src/stitch-transport.spec.ts
<gh_stars>0 import StitchTransport from './stitch-transport'; import { expect } from 'chai'; import sinon from 'sinon'; import StitchClient from './stitch-client'; import StitchMongoClient from './stitch-mongo-client'; /** * Create a client stub from the provided collection stub. * * @note: We basically only care a...
MaBeuLux88/mongosh
packages/shell-evaluator/src/index.ts
<filename>packages/shell-evaluator/src/index.ts import ShellEvaluator from './shell-evaluator'; export default ShellEvaluator; import shellApiSignature from './shell-api-signature'; export { shellApiSignature };
MaBeuLux88/mongosh
packages/shell-api/src/help.ts
<reponame>MaBeuLux88/mongosh<filename>packages/shell-api/src/help.ts<gh_stars>0 import i18n from '@mongosh/i18n'; type HelpProperties = { help: string; docs?: string; attr?: HelpPropertiesAttr[]; }; type HelpPropertiesAttr = { name?: string; description: string; }; type HelpOptions = { translate?(string)...
MaBeuLux88/mongosh
packages/cli-repl/src/logger.ts
<gh_stars>0 /* eslint no-console:0, no-empty-function: 0 */ import redactInfo from 'mongodb-redact'; import Analytics from 'analytics-node'; import redactPwd from './redact-pwd'; import { ObjectId } from 'bson'; import pino from 'pino'; import path from 'path'; interface ApiEventArguments { pipeline?: any[]; quer...
MaBeuLux88/mongosh
packages/browser-repl/src/iframe-runtime/iframe-runtime.ts
import { IframeInterpreterEnvironment } from './iframe-interpreter-environment'; import { Runtime, EvaluationResult, Completion, OpenContextRuntime } from '@mongosh/browser-runtime-core'; import { ServiceProvider } from '@mongosh/service-provider-core'; export class IframeRuntime implements Runtime { pri...
MaBeuLux88/mongosh
packages/browser-runtime-core/src/interpreter/interpreter.ts
import { Preprocessor } from './preprocessor'; const LAST_EXPRESSION_CALLBACK_FUNCTION_NAME = '___MONGOSH_LAST_EXPRESSION_CALLBACK'; const LEXICAL_CONTEXT_VARIABLE_NAME = '___MONGOSH_LEXCON'; export type ContextValue = any; export type EvaluationResult = { shellApiType: string; value: ContextValue; }; export in...
MaBeuLux88/mongosh
packages/service-provider-core/src/cursor.ts
<gh_stars>0 import Document from './document'; interface Cursor { /** * Add a cursor flag as an option to the cursor. * * @param {number} option - The flag number. * * @returns {Cursor} The cursor. */ addOption(option: number): Cursor /** * Set cursor to allow partial results. * * @re...
MaBeuLux88/mongosh
packages/build/src/download-center.spec.ts
import path from 'path'; import { promises as fs } from 'fs'; import { expect } from 'chai'; import { createDownloadCenterConfig } from './download-center'; describe('download center module', () => { describe('.createDownloadCenterConfig', () => { let config; before(() => { config = createDownloadCent...
MaBeuLux88/mongosh
packages/shell-api/src/shell-api.spec.ts
<reponame>MaBeuLux88/mongosh import { AggregationCursor, BulkWriteResult, Collection, Cursor, Database, DeleteResult, InsertManyResult, InsertOneResult, ReplicaSet, Shard, UpdateResult } from './shell-api'; import { expect } from 'chai'; [ AggregationCursor, BulkWriteResult, Collection, ...
MaBeuLux88/mongosh
packages/mapper/src/mapper.integration.spec.ts
<filename>packages/mapper/src/mapper.integration.spec.ts import { expect } from 'chai'; import { CliServiceProvider } from '@mongosh/service-provider-server'; import Mapper from './mapper'; import { Collection, Cursor, Database, Explainable, AggregationCursor } from '@mongosh/shell-api'; const mongodbRunnerBefore = re...
MaBeuLux88/mongosh
packages/i18n/src/catalog.ts
<reponame>MaBeuLux88/mongosh<filename>packages/i18n/src/catalog.ts interface Catalog { [prop: string]: any; } export default Catalog;
MaBeuLux88/mongosh
packages/mapper/src/index.ts
import Mapper from './mapper'; export default Mapper;
MaBeuLux88/mongosh
packages/browser-repl/src/components/editor.spec.tsx
<filename>packages/browser-repl/src/components/editor.spec.tsx import sinon from 'sinon'; import React from 'react'; import { expect } from '../../testing/chai'; import { mount } from '../../testing/enzyme'; import { Editor } from './editor'; import AceEditor from 'react-ace'; describe('<Editor />', () => { const ge...
MaBeuLux88/mongosh
packages/service-provider-core/src/bulk-write-result.ts
<gh_stars>0 export default interface BulkWriteResult { result: { ok: number }; /** * The number of documents inserted. */ insertedCount: number; /** * The number of existing documents selected for update or replacement. */ matchedCount: number; /** * The number of existing documents ...
MaBeuLux88/mongosh
packages/mapper/src/mapper.spec.ts
<gh_stars>0 /* eslint-disable @typescript-eslint/camelcase */ import chai from 'chai'; import sinonChai from 'sinon-chai'; import { stubInterface, StubbedInstance } from 'ts-sinon'; chai.use(sinonChai); const { expect } = chai; import Mapper from './mapper'; import sinon from 'sinon'; import { ServiceProvider, Curso...
MaBeuLux88/mongosh
packages/browser-repl/src/components/shell-output-line.spec.tsx
<gh_stars>0 import React from 'react'; import { expect } from '../../testing/chai'; import { shallow, mount } from '../../testing/enzyme'; import { ShellOutputLine } from './shell-output-line'; import { HelpOutput } from './types/help-output'; import { CursorOutput } from './types/cursor-output'; import { CursorIterat...
MaBeuLux88/mongosh
packages/service-provider-browser/src/stitch-service-provider-browser.ts
import { ServiceProvider, Result, BulkWriteResult, Document, Cursor, DatabaseOptions, CommandOptions, WriteConcern } from '@mongosh/service-provider-core'; import StitchTransport from './stitch-transport'; import i18n from '@mongosh/i18n'; import { AnonymousCredential, RemoteMongoClient, Stitch,...
MaBeuLux88/mongosh
packages/history/src/history.ts
import redactInfo from 'mongodb-redact'; /** * Modifies command history array based on sensitive information. * If redact option is passed, also redacts sensitive info. * * @param {array} History - Array of commands, where the first command is the * most recent. * * @param {boolean} Redact - Option to redact se...
MaBeuLux88/mongosh
packages/cli-repl/test/helpers.ts
<gh_stars>0 import { spawn } from 'child_process'; import path from 'path'; import stripAnsi from 'strip-ansi'; export async function eventually(fn, options: { frequency?: number; timeout?: number } = {}): Promise<any> { options = { frequency: 100, timeout: 10000, ...options }; let attempts = Math.r...
MaBeuLux88/mongosh
packages/service-provider-server/src/compass/compass-service-provider.ts
<filename>packages/service-provider-server/src/compass/compass-service-provider.ts import CliServiceProvider from '../cli-service-provider'; import { MongoClient } from 'mongodb'; interface DataService { client: { client: MongoClient; }; } /** * A service provider that is meant to be used in compass. */ cla...
MaBeuLux88/mongosh
packages/shell-api/src/help.spec.ts
<filename>packages/shell-api/src/help.spec.ts import sinon from 'sinon'; import { Help } from './help'; import { expect } from 'chai'; describe('Help', () => { let translate; beforeEach(() => { translate = sinon.fake((x) => `translated: ${x}`); }); describe('#shellApiType', () => { it('returns Help',...
MaBeuLux88/mongosh
packages/shell-evaluator/src/shell-evaluator.ts
import AsyncWriter from '@mongosh/async-rewriter'; import Mapper from '@mongosh/mapper'; import { signatures, Help, ShellBson, toIterator } from '@mongosh/shell-api'; import { ServiceProvider } from '@mongosh/service-provider-core'; interface Bus { emit(...args: any[]): void; } interface Container { toggleTelemet...
MaBeuLux88/mongosh
packages/browser-runtime-core/src/interpreter/preprocessor/wrap-in-async-function-call.spec.ts
import { expect } from 'chai'; import { parse } from '@babel/parser'; import generate from '@babel/generator'; import { wrapInAsyncFunctionCall } from './wrap-in-async-function-call'; describe('wrapInAsyncFunctionCall', () => { const testAllowTopLevelAwait = (code: string): string => { const ast = wrapInAsyncFun...
MaBeuLux88/mongosh
packages/build/src/compile-exec.ts
<filename>packages/build/src/compile-exec.ts<gh_stars>0 import path from 'path'; import { exec as compile } from 'pkg'; import Platform from './platform'; /** * The executable name enum. */ enum ExecName { Windows = 'mongosh.exe', Posix = 'mongosh' }; /** * Target enum. */ enum Target { Windows = 'win', M...
MaBeuLux88/mongosh
packages/shell-api/src/collection.spec.ts
import sinon from 'sinon'; import Mapper from '../../mapper'; import { Collection, Database } from './shell-api'; import * as signatures from './shell-api-signatures'; import { expect } from 'chai'; /** * Test that a collection method proxies the respective Mapper method correctly, * with the right arguments and ret...
MaBeuLux88/mongosh
packages/browser-runtime-core/src/runtime.ts
<gh_stars>0 import { Completion } from './autocompleter/autocompleter'; export type ContextValue = any; export type EvaluationResult = { shellApiType: string; value: any; }; export interface Runtime { /** * Evaluates code * * @param {string} code - A string of code * @return {Promise<EvaluationResu...
MaBeuLux88/mongosh
packages/shell-api/src/cursor.spec.ts
<gh_stars>0 import sinon from 'sinon'; import { Cursor } from './shell-api'; import { expect } from 'chai'; describe('Cursor', () => { describe('fluent interface', () => { ['limit', 'skip'].forEach((method) => { describe(method, () => { let wrappee; let cursor; beforeEach(() => { ...
MaBeuLux88/mongosh
packages/service-provider-server/src/index.ts
import NodeOptions from './node/node-options'; import CliServiceProvider from './cli-service-provider'; import CompassServiceProvider from './compass/compass-service-provider'; export { CliServiceProvider, CompassServiceProvider, NodeOptions };
MaBeuLux88/mongosh
packages/service-provider-server/src/node/node-options.ts
import NodeAuthOptions from './node-auth-options'; import NodeFleOptions from './node-fle-options'; /** * Valid options that can be used with the Node driver. This is a * partial list of things that need to be mapped. */ export default interface NodeOptions { auth?: NodeAuthOptions; authSource?: string; authM...
MaBeuLux88/mongosh
packages/service-provider-core/src/closable.ts
<gh_stars>0 export default interface Closable { /** * Close the connection. * * @param {boolean} force - Whether to force close. */ close(boolean): Promise<void>; }
MaBeuLux88/mongosh
packages/mapper/src/mapper.ts
/* eslint-disable @typescript-eslint/camelcase */ import { AggregationCursor, BulkWriteResult, Collection, Cursor, Database, DeleteResult, InsertManyResult, InsertOneResult, UpdateResult, CursorIterationResult, CommandResult, Explainable } from '@mongosh/shell-api'; import { ServiceProvider, ...
MaBeuLux88/mongosh
packages/service-provider-core/src/document.ts
interface Document { [prop: string]: any }; export default Document;
MaBeuLux88/mongosh
packages/cli-repl/test/e2e.spec.ts
<reponame>MaBeuLux88/mongosh import { expect } from 'chai'; import { MongoClient } from 'mongodb'; import { eventually, startShell, killOpenShells } from './helpers'; describe('e2e', function() { before(require('mongodb-runner/mocha/before')({ port: 27018, timeout: 60000 })); after(require('mongodb-runner/mocha/af...
MaBeuLux88/mongosh
packages/cli-repl/src/cli-repl.ts
<gh_stars>0 /* eslint no-console: 0, no-sync: 0*/ import { CliServiceProvider, NodeOptions } from '@mongosh/service-provider-server'; import formatOutput, { formatError } from './format-output'; import ShellEvaluator from '@mongosh/shell-evaluator'; import isRecoverableError from 'is-recoverable-error'; import { Mongo...
MaBeuLux88/mongosh
packages/shell-evaluator/src/shell-evaluator.spec.ts
<gh_stars>0 import chai from 'chai'; import sinon from 'sinon'; import sinonChai from 'sinon-chai'; chai.use(sinonChai); const { expect } = chai; import ShellEvaluator from './shell-evaluator'; import { EventEmitter } from 'events'; describe('ShellEvaluator', () => { let shellEvaluator: ShellEvaluator; let servic...
MaBeuLux88/mongosh
packages/shell-api/src/command-result.spec.ts
<gh_stars>0 import { CommandResult } from './shell-api'; import { expect } from 'chai'; describe('CommandResult', () => { describe('#shellApiType', () => { it('returns the type', () => { const commandResult = new CommandResult('ResultType', 'value'); expect(commandResult.shellApiType()).to.equal('Res...
MaBeuLux88/mongosh
packages/service-provider-browser/src/unsupported-cursor.ts
<gh_stars>0 import { Document, Cursor } from '@mongosh/service-provider-core'; /** * Defines a cursor for an unsupported operation. */ class UnsupportedCursor implements Cursor { private readonly message: string; /** * Create the unsupported cursor with a rejection message. * * @param {String} message ...
MaBeuLux88/mongosh
packages/build/src/compile-exec.spec.ts
import path from 'path'; import os from 'os'; import fs from 'fs'; import { expect } from 'chai'; import compileExec, { ExecName, Target, determineExecName, determineTarget, executablePath } from './compile-exec'; import Platform from './platform'; describe('compile module', () => { describe('ExecName', ()...
avgust13/Account-Manager
src/renderer/utils/toast.tsx
import React, {ReactNode} from 'react'; import {toast} from 'react-toastify'; import Toast, {ToastType} from '@renderer/components/Toast'; export const displayErrorToast = (error: any) => { let errorStr: string; if (typeof error === 'string') { errorStr = error; } else if (error?.response?.data) { error...
avgust13/Account-Manager
src/renderer/components/Tiles/TileSigningKey/index.tsx
import React, {FC, useEffect} from 'react'; import clsx from 'clsx'; import {useBooleanState} from '@renderer/hooks'; import {getCustomClassNames} from '@renderer/utils/components'; import Tile from '../Tile'; import './TileSigningKey.scss'; interface ComponentProps { accountNumber: string; className?: string; ...
avgust13/Account-Manager
src/renderer/components/PageTabs/index.tsx
<gh_stars>100-1000 import React, {FC} from 'react'; import {NavLink} from 'react-router-dom'; import clsx from 'clsx'; import './PageTabs.scss'; interface Item { name: string; page: string; } interface ComponentProps { baseUrl: string; breakpoint?: 'small' | 'large'; items: Item[]; } const PageTabs: FC<Co...
avgust13/Account-Manager
src/renderer/utils/accounts.ts
<filename>src/renderer/utils/accounts.ts import {sign} from 'tweetnacl'; import {getKeyPairDetails} from '@renderer/utils/signing'; export const generateAccount = () => { const keyPair = sign.keyPair(); return getKeyPairDetails(keyPair); };
avgust13/Account-Manager
src/renderer/selectors/validators.ts
<reponame>avgust13/Account-Manager<filename>src/renderer/selectors/validators.ts import {createCachedSelector} from 're-reselect'; import {RootState} from '@renderer/types'; import {formatAddressFromNode} from '@renderer/utils/address'; import {getActivePrimaryValidator} from './app'; import {getManagedValidators} fr...
avgust13/Account-Manager
src/renderer/types/declarations/yup.d.ts
<gh_stars>1-10 import {NumberSchema, NumberSchemaConstructor, Ref, StringSchema, StringSchemaConstructor} from 'yup'; declare module 'yup' { interface NumberSchema { callbackWithRef(ref: any, cb: (thisValue: number, refValue: any) => boolean, message: string): NumberSchema; } interface StringSchema { equ...
avgust13/Account-Manager
src/renderer/store/app/index.ts
<gh_stars>1-10 import {combineReducers} from '@reduxjs/toolkit'; import managedAccounts, { clearManagedAccounts, setManagedAccount, setManagedAccountBalance, unsetManagedAccount, } from './managedAccounts'; import managedBanks, {clearManagedBanks, setManagedBank, unsetActiveBank, unsetManagedBank} from './mana...
avgust13/Account-Manager
src/renderer/components/NodeLink/index.tsx
<reponame>avgust13/Account-Manager<filename>src/renderer/components/NodeLink/index.tsx<gh_stars>100-1000 import React, {FC, memo} from 'react'; import {NavLink} from 'react-router-dom'; import {AddressData} from '@renderer/types'; import {formatPathFromNode} from '@renderer/utils/address'; import './NodeLink.scss'; ...
avgust13/Account-Manager
src/renderer/containers/Friend/AddFriendModal/index.tsx
<reponame>avgust13/Account-Manager import React, {FC, useMemo} from 'react'; import {useDispatch, useSelector} from 'react-redux'; import {useHistory} from 'react-router-dom'; import {FormInput, FormTextArea} from '@renderer/components/FormComponents'; import Modal from '@renderer/components/Modal'; import {getManaged...
avgust13/Account-Manager
src/renderer/containers/Bank/BankTransactions/index.tsx
<reponame>avgust13/Account-Manager import React, {FC, useMemo} from 'react'; import AccountLink from '@renderer/components/AccountLink'; import PageTable, {PageTableData, PageTableItems} from '@renderer/components/PageTable'; import Pagination from '@renderer/components/Pagination'; import {BANK_BANK_TRANSACTIONS} fro...
avgust13/Account-Manager
src/renderer/containers/Account/CreateAccountModal/CreateAccountModalFields.tsx
import React, {FC, useEffect} from 'react'; import {FormInput, FormRadioGroup, FormTextArea} from '@renderer/components/FormComponents'; import {useFormContext} from '@renderer/hooks'; export const initialValues = { nickname: '', signingKey: '', type: 'create', }; export type FormValues = typeof initialValues; ...
avgust13/Account-Manager
src/renderer/containers/Bank/BankConfirmationBlocks/index.tsx
import React, {FC, useMemo} from 'react'; import PageTable, {PageTableData, PageTableItems} from '@renderer/components/PageTable'; import Pagination from '@renderer/components/Pagination'; import {BANK_CONFIRMATION_BLOCKS} from '@renderer/constants'; import {useAddress, usePaginatedNetworkDataFetcher} from '@renderer/...
avgust13/Account-Manager
src/renderer/containers/Validator/ValidatorOverview/index.tsx
import React, {FC} from 'react'; import A from '@renderer/components/A'; import DetailPanel from '@renderer/components/DetailPanel'; import {Loader} from '@renderer/components/FormElements'; import {VALIDATOR_CONFIGS} from '@renderer/constants'; import {useNetworkConfigFetcher} from '@renderer/hooks'; import {Validato...
avgust13/Account-Manager
src/renderer/store/validators/index.ts
<filename>src/renderer/store/validators/index.ts import {combineReducers} from '@reduxjs/toolkit'; import {ACCOUNTS, BANKS, CONFIGS, VALIDATORS} from '@renderer/constants'; import validatorAccounts, { setValidatorAccounts, setValidatorAccountsError, unsetValidatorAccounts, } from './validatorAccounts'; import va...
avgust13/Account-Manager
src/renderer/selectors/banks.ts
<filename>src/renderer/selectors/banks.ts import {createCachedSelector} from 're-reselect'; import {getNthArg} from '@renderer/selectors/utils'; import {RootState} from '@renderer/types'; import {formatAddressFromNode} from '@renderer/utils/address'; import {getActiveBank} from './app'; import {getManagedBanks} from ...
avgust13/Account-Manager
src/renderer/components/PageTable/index.tsx
<gh_stars>1-10 import React, {FC, ReactNode, useState} from 'react'; import clsx from 'clsx'; import ArrowToggle from '@renderer/components/ArrowToggle'; import Loader from '@renderer/components/FormElements/Loader'; import PaginationSummary from '@renderer/components/PaginationSummary'; import {getCustomClassNames} f...
avgust13/Account-Manager
src/renderer/components/AccountLink/index.tsx
<gh_stars>1-10 import React, {FC, memo} from 'react'; import {NavLink} from 'react-router-dom'; import './AccountLink.scss'; interface ComponentProps { accountNumber: string; } const AccountLink: FC<ComponentProps> = ({accountNumber}) => { return ( <NavLink className="AccountLink" to={`/account/${accountNumb...
avgust13/Account-Manager
src/renderer/components/Tiles/Tile/index.tsx
import React, {FC, ReactNode} from 'react'; import clsx from 'clsx'; import './Tile.scss'; interface ComponentProps { children: ReactNode; className?: string; } const Tile: FC<ComponentProps> = ({children, className}) => { return <div className={clsx('Tile', className)}>{children}</div>; }; export default Til...
avgust13/Account-Manager
src/renderer/containers/ChangeActiveBankModal/index.tsx
import React, {FC, useState} from 'react'; import {useDispatch} from 'react-redux'; import {useHistory} from 'react-router-dom'; import {connectAndStoreLocalData} from '@renderer/dispatchers/app'; import {FormInput, FormSelect} from '@renderer/components/FormComponents'; import Modal from '@renderer/components/Modal';...
avgust13/Account-Manager
src/renderer/containers/Validator/EditValidatorNicknameModal/index.tsx
<reponame>avgust13/Account-Manager<filename>src/renderer/containers/Validator/EditValidatorNicknameModal/index.tsx import React, {FC} from 'react'; import {useDispatch} from 'react-redux'; import {FormInput} from '@renderer/components/FormComponents'; import Modal from '@renderer/components/Modal'; import {setManagedV...
avgust13/Account-Manager
src/renderer/containers/Friend/DeleteFriendModal/index.tsx
import React, {FC} from 'react'; import {useDispatch} from 'react-redux'; import Modal from '@renderer/components/Modal'; import {unsetManagedFriend} from '@renderer/store/app'; import {AppDispatch, ManagedFriend} from '@renderer/types'; interface ComponentProps { close(): void; managedFriend: ManagedFriend; } co...
avgust13/Account-Manager
src/renderer/types/notifications.ts
import {ValidatorConfirmationBlock} from './network'; export interface Notification { notificationTime: number; notificationType: string; payload: ValidatorConfirmationBlock; } export enum NotificationType { confirmationBlockNotification = 'CONFIRMATION_BLOCK_NOTIFICATION', }
avgust13/Account-Manager
src/renderer/store/app/managedAccounts.ts
<reponame>avgust13/Account-Manager import {createSlice, PayloadAction} from '@reduxjs/toolkit'; import {MANAGED_ACCOUNTS} from '@renderer/constants'; import localStore from '@renderer/store/localStore'; import {AccountNumber, Balance, Dict, ManagedAccount} from '@renderer/types'; import { clearLocalAndStateReducer, ...
avgust13/Account-Manager
src/renderer/components/FormElements/index.tsx
<reponame>avgust13/Account-Manager<filename>src/renderer/components/FormElements/index.tsx import Button, {BaseButtonProps} from './Button'; import Input, {BaseInputProps} from './Input'; import Loader from './Loader'; import Radio, {BaseRadioProps} from './Radio'; import Select, {BaseSelectProps} from './Select'; impo...
avgust13/Account-Manager
src/renderer/store/app/managedValidators.ts
<gh_stars>1-10 import {createSlice} from '@reduxjs/toolkit'; import {MANAGED_VALIDATORS} from '@renderer/constants'; import localStore from '@renderer/store/localStore'; import {Dict, ManagedNode} from '@renderer/types'; import { clearLocalAndStateReducer, getStateName, setLocalAndAddressReducer, unsetActiveNo...