repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
danilo-p/iextrading-dashboard | src/utils/Api.ts | <reponame>danilo-p/iextrading-dashboard<gh_stars>0
import Axios, { AxiosInstance, AxiosRequestConfig } from 'axios';
import config from './config';
class Api {
public static singleInstance?: Api
public axios: AxiosInstance
static get instance(): Api {
if (!this.singleInstance) {
this.singleInstance = ... |
danilo-p/iextrading-dashboard | src/pages/StockDetail/StockDetail.tsx | <reponame>danilo-p/iextrading-dashboard
import Button from '@material-ui/core/Button';
import * as React from 'react';
import { Link, RouteComponentProps } from 'react-router-dom';
import CompanyCard from '../../components/CompanyCard';
import StockChart from '../../components/StockChart';
import { ICompanyState } from... |
danilo-p/iextrading-dashboard | src/index.tsx | <filename>src/index.tsx
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { Provider } from 'react-redux'
import { BrowserRouter } from 'react-router-dom'
import { applyMiddleware, createStore } from 'redux'
import { composeWithDevTools } from 'redux-devtools-extension'
import thunk from 're... |
danilo-p/iextrading-dashboard | src/pages/App/App.test.tsx | import { shallow } from 'enzyme';
import * as React from 'react';
import App from './App';
jest.mock('../../components/StockChart', () => () => null);
describe('App', () => {
const wrapper = shallow(<App />);
it('renders without crashing', () => {
expect(wrapper).toMatchSnapshot();
});
})
|
danilo-p/iextrading-dashboard | src/pages/Home/Home.test.tsx | import { shallow } from 'enzyme';
import * as React from 'react';
import Home, { IHomeProps } from './Home';
describe('Home Page', () => {
const mockLoadStocks = jest.fn();
const props:IHomeProps = {
loadStocks: mockLoadStocks,
stocks: {
data: null,
error: null,
loading: false,
}
};... |
danilo-p/iextrading-dashboard | src/ducks/symbols.test.ts | <reponame>danilo-p/iextrading-dashboard
import configureMockStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import Api from '../utils/Api';
import {
default as reducer,
INITIAL_STATE,
ISymbol,
LOAD_SYMBOLS_FAILED,
LOAD_SYMBOLS_STARTED,
LOAD_SYMBOLS_SUCCEED,
loadSymbols,
loadSymbolsFailed... |
danilo-p/iextrading-dashboard | src/components/CompanyCard/CompanyCard.tsx | <reponame>danilo-p/iextrading-dashboard
import Card from '@material-ui/core/Card';
import CardContent from '@material-ui/core/CardContent';
import Chip from '@material-ui/core/Chip';
import Icon from '@material-ui/core/Icon';
import Typography from '@material-ui/core/Typography';
import * as React from 'react';
import ... |
danilo-p/iextrading-dashboard | src/utils/config.ts | export default {
IEX_API_URL: 'https://api.iextrading.com/1.0',
}; |
danilo-p/iextrading-dashboard | src/components/StockCard/index.ts | import StockCard from './StockCard';
export default StockCard;
|
rocketbase-io/vue-eventing | src/emit-integration.ts | <reponame>rocketbase-io/vue-eventing
import { EmitFn, EventingInstance } from "src/types";
export function installEmitIntegration(instance: EventingInstance): void {
instance.$emit = wrapEmitter(instance.$emit);
}
export function wrapEmitter(emitter?: EmitFn): EmitFn {
return function (this: EventingInstance, eve... |
rocketbase-io/vue-eventing | src/config.ts | export interface VueEventingOptions {
instanceMethods?: boolean;
emitIntegration?: boolean;
}
export const config: Required<VueEventingOptions> = {
instanceMethods: false,
emitIntegration: false,
};
|
rocketbase-io/vue-eventing | test/bus.test.ts | import { bus } from "src/bus";
describe("bus", () => {
it("should generate on, off and emit methods", () => {
const { on, off, emit } = bus();
expect(on).toBeDefined();
expect(off).toBeDefined();
expect(emit).toBeDefined();
});
it("should pass all arguments to the handler", () => {
const { o... |
rocketbase-io/vue-eventing | test/mixin.test.ts | import { MixEventing, VueEventing } from "src/index";
describe("MixEventing", () => {
const settings = (instanceMethods: boolean, emitIntegration: boolean) => VueEventing({ instanceMethods, emitIntegration });
beforeEach(() => settings(false, false));
it("should add a $mitt instance variable to the mixed class ... |
rocketbase-io/vue-eventing | test/index.test.ts | <gh_stars>0
import { VueEventing } from "src/index";
import { config } from "src/config";
describe("VueEventing", () => {
it("should configure the eventing plugin", () => {
expect(config.instanceMethods).toBeFalsy();
expect(config.emitIntegration).toBeFalsy();
VueEventing({
instanceMethods: true,
... |
rocketbase-io/vue-eventing | src/bus.ts | import { Emitter, Handler } from "src/types";
export function bus(handlers?: Record<string, Handler | Handler[]>): Emitter {
const listeners: Record<string, Handler[]> = {};
/* eslint-disable-next-line */
if (handlers) for (const [event, handler] of Object.entries(handlers))
listeners[event] = typeof handler... |
rocketbase-io/vue-eventing | src/mixin.ts | import { bus } from "src/bus";
import { config } from "src/config";
import { installEmitIntegration } from "src/emit-integration";
import { installInstanceMethods } from "src/instance-methods";
import { EventingInstance } from "src/types";
export function MixEventing<T, Args extends []>(base: new (...args: Args) => T)... |
rocketbase-io/vue-eventing | test/instance-methods.test.ts | <gh_stars>0
import { VueEventing } from "src/index";
import { MixEventing } from "src/mixin";
VueEventing({ instanceMethods: true, emitIntegration: true });
class Mixed extends MixEventing(Object) {}
const instance = new Mixed();
describe("instanceMethodOn", () => {
it("should attach an event handler", () => {
... |
rocketbase-io/vue-eventing | test/decorator.test.ts | import { Eventing } from "src/decorator";
import { VueEventing } from "src/index";
import { EventingInstance } from "src/types";
describe("@Eventing", () => {
const settings = (instanceMethods: boolean, emitIntegration: boolean) => VueEventing({ instanceMethods, emitIntegration });
beforeEach(() => settings(false,... |
rocketbase-io/vue-eventing | src/instance-methods.ts | import { bus } from "src/bus";
import { EventingInstance, Handler } from "src/types";
export function installInstanceMethods(cxt: EventingInstance): void {
cxt.$on = instanceMethodOn;
cxt.$off = instanceMethodOff;
cxt.$once = instanceMethodOnce;
}
export function instanceMethodOn(this: EventingInstance, events:... |
rocketbase-io/vue-eventing | src/index.ts | <gh_stars>0
import { config, VueEventingOptions } from "src/config";
export * from "src/mixin";
export * from "src/decorator";
export * from "src/bus";
export * from "src/types";
export function VueEventing({ instanceMethods, emitIntegration }: VueEventingOptions = {}): void {
if (instanceMethods) config.instanceMet... |
rocketbase-io/vue-eventing | src/types.ts | export type Handler = (...args: unknown[]) => unknown;
export type EmitFn = (event: string, ...args: unknown[]) => EventingInstance;
export interface EventingInstance<T = unknown> {
$on(event: string, handler: Handler): this;
$on(events: string[], handler: Handler): this;
$once(event: string, handler: Handler): ... |
rocketbase-io/vue-eventing | src/decorator.ts | import { bus } from "src/bus";
import { config } from "src/config";
import { installEmitIntegration } from "src/emit-integration";
import { EventingInstance } from "src/types";
import { installInstanceMethods } from "src/instance-methods";
export function Eventing<T, Args extends []>(cls: new (...args: Args) => T): ne... |
Itsthatotherguy/notetaking-app-backend | src/config/jwt.config.ts | import { JwtModuleOptions } from '@nestjs/jwt';
export const jwtConfig: JwtModuleOptions = {
secret: 'topsecret',
signOptions: {
expiresIn: 3600,
},
};
|
Itsthatotherguy/notetaking-app-backend | src/note/note.service.ts | <reponame>Itsthatotherguy/notetaking-app-backend
import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { User } from 'src/auth/entities/user.entity';
import { CreateNoteDto } from './dto/create-note.dto';
import { DeleteNoteResponseDto } from './dto/delete-note-response... |
Itsthatotherguy/notetaking-app-backend | src/note/note.controller.ts | <reponame>Itsthatotherguy/notetaking-app-backend
import {
Controller,
Get,
Post,
Body,
Patch,
Param,
Delete,
UseGuards,
UsePipes,
ValidationPipe,
} from '@nestjs/common';
import { NoteService } from './note.service';
import { CreateNoteDto } from './dto/create-note.dto';
import { Note } from './enti... |
Itsthatotherguy/notetaking-app-backend | src/note/note.repository.ts | import { AbstractRepository, EntityRepository } from 'typeorm';
import { CreateNoteDto } from './dto/create-note.dto';
import { Note } from './entities/note.entity';
import { v4 as uuid } from 'uuid';
import {
InternalServerErrorException,
NotFoundException,
} from '@nestjs/common';
import { NoteErrors } from './no... |
Itsthatotherguy/notetaking-app-backend | src/auth/dto/login.dto.ts | import { IsEmail, IsNotEmpty } from 'class-validator';
import { AuthErrors } from '../auth.errors';
export class LoginDto {
@IsEmail({}, { message: AuthErrors.INVALID_CREDENTIALS })
emailAddress: string;
@IsNotEmpty({ message: AuthErrors.INVALID_CREDENTIALS })
password: string;
}
|
Itsthatotherguy/notetaking-app-backend | src/auth/auth.errors.ts | export enum AuthErrors {
INVALID_EMAIL = 'INVALID_EMAIL',
MISSING_NAME = 'MISSING_NAME',
MISSING_PASSWORD = '<PASSWORD>',
DUPLICATE_EMAIL = 'DUPLICATE_EMAIL',
INVALID_CREDENTIALS = 'INVALID_CREDENTIALS',
UNAUTHORIZED = 'UNAUTHORIZED',
}
|
Itsthatotherguy/notetaking-app-backend | src/config/passport.config.ts | import { IAuthModuleOptions } from '@nestjs/passport';
export const passportConfig: IAuthModuleOptions<any> = {
defaultStrategy: 'jwt',
};
|
Itsthatotherguy/notetaking-app-backend | src/auth/dto/jwt-payload.dto.ts | <gh_stars>0
export interface JwtPayloadDto {
emailAddress: string;
}
|
Itsthatotherguy/notetaking-app-backend | src/auth/dto/signup.dto.ts | <filename>src/auth/dto/signup.dto.ts
import { IsEmail, IsNotEmpty } from 'class-validator';
import { AuthErrors } from '../auth.errors';
export class SignupDto {
@IsNotEmpty({ message: AuthErrors.MISSING_NAME })
name: string;
@IsEmail({}, { message: AuthErrors.INVALID_EMAIL })
emailAddress: string;
@IsNotE... |
Itsthatotherguy/notetaking-app-backend | src/note/entities/note.entity.ts | import { User } from 'src/auth/entities/user.entity';
import {
Column,
CreateDateColumn,
Entity,
ManyToOne,
PrimaryColumn,
} from 'typeorm';
@Entity()
export class Note {
@PrimaryColumn()
id: string;
@Column()
title: string;
@Column()
body: string;
@Column()
createdAt: Date;
@ManyToOne(... |
Itsthatotherguy/notetaking-app-backend | src/note/dto/create-note.dto.ts | <filename>src/note/dto/create-note.dto.ts
import { IsNotEmpty } from 'class-validator';
import { NoteErrors } from '../note.errors';
export class CreateNoteDto {
@IsNotEmpty({ message: NoteErrors.MISSING_TITLE })
title: string;
@IsNotEmpty({ message: NoteErrors.MISSING_BODY })
body: string;
}
|
Itsthatotherguy/notetaking-app-backend | src/note/note.errors.ts | export enum NoteErrors {
MISSING_ID = 'MISSING_ID',
MISSING_TITLE = 'MISSING_TITLE',
MISSING_BODY = 'MISSING_BODY',
NOTE_NOT_FOUND = 'NOTE_NOT_FOUND',
}
|
Itsthatotherguy/notetaking-app-backend | src/auth/auth.controller.ts | <reponame>Itsthatotherguy/notetaking-app-backend<filename>src/auth/auth.controller.ts
import {
Body,
Controller,
Post,
UsePipes,
ValidationPipe,
} from '@nestjs/common';
import { AuthService } from './auth.service';
import { AuthResponseDto } from './dto/auth-response.dto';
import { LoginDto } from './dto/log... |
Itsthatotherguy/notetaking-app-backend | src/auth/entities/user.entity.ts | import { Note } from 'src/note/entities/note.entity';
import { Column, Entity, OneToMany, PrimaryColumn, Unique } from 'typeorm';
import * as bcrypt from 'bcryptjs';
@Entity()
@Unique(['emailAddress'])
export class User {
@PrimaryColumn()
id: string;
@Column()
name: string;
@Column()
emailAddress: string... |
h3xag0nx/iron-autocompound | src/utils.ts | <reponame>h3xag0nx/iron-autocompound
import { promises as fs } from 'fs';
import toml from '@iarna/toml';
import { Config } from './model';
const isValidConfig = (data: any) => {
return (
typeof data === 'object' &&
typeof data.rpc === 'string' &&
data.rpc.match(/https?:\/\//) &&
Array.isArray(data.v... |
h3xag0nx/iron-autocompound | src/contracts/vault-factory.ts | import VaultFactoryAbi from '../abis/VaultFactory.json';
import { Contract } from '@ethersproject/contracts';
import { BaseProvider } from '@ethersproject/providers';
export class VaultFactory extends Contract {
constructor(provider: BaseProvider) {
super(
'0x3631B6bBf1E51D18dAbd1D0e1b1589668DDF250B',
... |
h3xag0nx/iron-autocompound | src/index.ts | #! /usr/bin/env node
import { Command } from 'commander';
import generateConfig from './commands/generate-config';
import compound from './commands/compound';
import explorer from './commands/explorer';
const program = new Command().version('1.0.0');
program
.addCommand(generateConfig)
.addCommand(compound)
.a... |
h3xag0nx/iron-autocompound | src/commands/generate-config.ts | <reponame>h3xag0nx/iron-autocompound<filename>src/commands/generate-config.ts
import { JsonRpcProvider } from '@ethersproject/providers';
import { isAddress } from '@ethersproject/address';
import { Command } from 'commander';
import { VaultFactory } from '../contracts/vault-factory';
import toml from '@iarna/toml';
im... |
h3xag0nx/iron-autocompound | src/commands/explorer.ts | <gh_stars>1-10
import { Command } from 'commander';
import { resolve } from 'path';
import { readConfig } from '../utils';
const Explorer = 'https://polygonscan.com';
const command = new Command('explorer')
.description('Generate explorer link to contract')
.option('-c, --config <string>', 'Config file path', './c... |
h3xag0nx/iron-autocompound | src/commands/compound.ts | import { Command } from 'commander';
import { resolve } from 'path';
import { log, readConfig } from '../utils';
import { Wallet } from '@ethersproject/wallet';
import schedule from 'node-schedule';
import { JsonRpcProvider, TransactionResponse } from '@ethersproject/providers';
import { Vault } from '../contracts/vaul... |
h3xag0nx/iron-autocompound | src/contracts/vault.ts | import { Contract } from '@ethersproject/contracts';
import { BaseProvider } from '@ethersproject/providers';
import { Signer } from '@ethersproject/abstract-signer';
import { Interface } from '@ethersproject/abi';
const signature = [
'function compound() external',
'function abandoned() view returns (bool)',
];
... |
h3xag0nx/iron-autocompound | src/model.ts | export type VaultConfig = {
address: string;
schedule?: string;
disabled?: boolean;
};
export type Config = {
rpc: string;
privateKey: string;
harvester: string;
schedule: string;
vaults: VaultConfig[];
};
|
danielivert/captainduckduck | src/routes/LoginRouter.ts | import express = require('express')
import BaseApi = require('../api/BaseApi')
import ApiStatusCodes = require('../api/ApiStatusCodes')
import CaptainConstants = require('../utils/CaptainConstants')
import InjectionExtractor = require('../injection/InjectionExtractor')
import DataStoreProvider = require('../datastore/D... |
danielivert/captainduckduck | src/api/BaseApi.ts | class BaseApi {
public data: any
constructor(private status: number, private description: string) {
//
}
}
export = BaseApi
|
danielivert/captainduckduck | src/api/ApiStatusCodes.ts | import { CaptainError } from './CaptainError'
import { Response } from 'express'
import BaseApi = require('./BaseApi')
import Logger = require('../utils/Logger')
class ApiStatusCodes {
static createError(code: number, message: string) {
return new CaptainError(code, message || 'NONE')
}
static cre... |
danielivert/captainduckduck | src/user/system/CaptainManager.ts | <reponame>danielivert/captainduckduck
import uuid = require('uuid/v4')
import SshClientImport = require('ssh2')
import request = require('request')
import fs = require('fs-extra')
import CaptainConstants = require('../../utils/CaptainConstants')
import Logger = require('../../utils/Logger')
import LoadBalancerManager =... |
danielivert/captainduckduck | src/models/ServerDockerInfo.ts | <filename>src/models/ServerDockerInfo.ts
interface ServerDockerInfo {
nodeId: string
type: string
isLeader: boolean
hostname: string
architecture: string
operatingSystem: string
nanoCpu: number
memoryBytes: number
dockerEngineVersion: string
ip: string
state: string
statu... |
danielivert/captainduckduck | src/models/IServerBlockDetails.ts | <filename>src/models/IServerBlockDetails.ts
interface IServerBlockDetails {
hasSsl: boolean
forceSsl: boolean
publicDomain: string
localDomain: string
nginxConfigTemplate: string
containerHttpPort: number
crtPath?: string
keyPath?: string
customErrorPagesDirectory: string
static... |
danielivert/captainduckduck | src/utils/GitHelper.ts | <reponame>danielivert/captainduckduck
import { AnyError } from '../models/OtherTypes'
import Utils from './Utils'
const git = require('simple-git')
class GitHelper {
static getLastHash(directory: string) {
return new Promise<string>(function(resolve, reject) {
git(directory)
.s... |
danielivert/captainduckduck | src/utils/Utils.ts | export default class Utils {
static removeHttpHttps(input: string) {
input = input.trim()
input = input.replace(/^(?:http?:\/\/)?/i, '')
input = input.replace(/^(?:https?:\/\/)?/i, '')
return input
}
}
|
xtitusx/event-bus | src/index.ts | export * from './event-bus';
export * from './event';
export * from './i-event-bus';
export * from './subscriber';
|
xtitusx/event-bus | src/event.ts | export abstract class Event {
name = this.constructor.name;
}
|
xtitusx/event-bus | src/event-bus.ts | <gh_stars>0
import { v4 as uuidv4 } from 'uuid';
import { Event } from './event';
import { IEventBus, ISubscription, ISubscribersByEvent } from './i-event-bus';
import { ISubscriber } from './i-subscriber';
export class EventBus implements IEventBus {
private subscribersByEvent: ISubscribersByEvent;
public c... |
xtitusx/event-bus | test/index-test.ts | import { assert } from 'chai';
describe('Basic Mocha String Test', function () {
it('should return number of charachters in a string', function () {
assert.equal('Hello'.length, 5);
});
it('should return first charachter of the string', function () {
assert.equal('Hello'.charAt(0), 'H');
... |
xtitusx/event-bus | src/i-subscriber.ts | <filename>src/i-subscriber.ts<gh_stars>0
import { Event } from './event';
export interface ISubscriber<T extends Event> {
event: new () => T;
callback: Function;
}
|
xtitusx/event-bus | src/i-event-bus.ts | import { Event } from './event';
import { ISubscriber } from './i-subscriber';
export interface ISubscription {
id: string;
eventName: string;
unsubscribe: () => void;
}
export interface ICallable {
[key: string]: { callback: Function; once: boolean };
}
export interface ISubscribersByEvent {
[ke... |
xtitusx/event-bus | src/subscriber.ts | import { Event } from './event';
import { ISubscriber } from './i-subscriber';
export class Subscriber<T extends Event> implements ISubscriber<T> {
event: new () => T;
callback: Function;
constructor(event: new () => T) {
this.event = event;
}
}
|
brandinio/slashcord | src/utilities/buttons/awaitButtons.ts | import { Collection, Message } from "discord.js";
import { ButtonCollector } from "./ButtonCollector";
import { ButtonInteraction } from "./ButtonInteraction";
import Slasherror from "../extras/error";
import { ButtonCollectorOptions } from "../types";
function awaitButtons(
message: Message,
filter: Function,
o... |
brandinio/slashcord | dist/utilities/awaitButtons.d.ts | <gh_stars>1-10
import { Collection, Message } from "discord.js";
import { ButtonInteraction } from "./ButtonInteraction";
import { ButtonCollectorOptions } from "./types";
declare function awaitButtons(message: Message, filter: Function, options: ButtonCollectorOptions): Promise<Collection<string, ButtonInteraction>>;
... |
brandinio/slashcord | src/utilities/buttons/ActionRow.ts | <filename>src/utilities/buttons/ActionRow.ts
import { MessageButton } from "./MessageButton";
type Component = MessageButton;
class ActionRow {
type = 1;
components: Component[] = [];
constructor(components: Component[]) {
this.components = components;
}
addComponent(component: Component) {
this.c... |
brandinio/slashcord | src/utilities/extras/utils.ts | <reponame>brandinio/slashcord
//@ts-nocheck
import {
GuildMember,
GuildMemberEditData,
PermissionResolvable,
} from "discord.js";
import { MessageButton } from "../buttons/MessageButton";
import { ActionRow } from "../buttons/ActionRow";
import Slasherror from "./error";
type Component = MessageButton;
function... |
brandinio/slashcord | src/utilities/slash.ts | <filename>src/utilities/slash.ts<gh_stars>1-10
import { APIMessage, Channel, Client } from "discord.js";
import Slashcord from "..";
class Slashcmds {
private _client: Client;
private _handler: Slashcord;
constructor(handler: Slashcord) {
this._client = handler.client;
this._handler = handler;
}
pub... |
brandinio/slashcord | dist/utilities/extras/error.d.ts | declare class Slasherror extends Error {
constructor(message: string);
}
export = Slasherror;
|
brandinio/slashcord | dist/utilities/slash.d.ts | import { Channel } from "discord.js";
import Slashcord from "..";
declare class Slashcmds {
private _client;
private _handler;
constructor(handler: Slashcord);
get(guildId?: string): Promise<any>;
create(name: string, description: string, options?: object[], guildId?: string): Promise<any>;
dele... |
brandinio/slashcord | src/handlers/CommandHandler.ts | import { Client, Collection, DiscordAPIError } from "discord.js";
import { existsSync } from "fs";
import { isAbsolute, join } from "path";
import Slashcord from "..";
import Slasherror from "../utilities/extras/error";
import getFiles from "../utilities/getFiles";
import { Interaction } from "../utilities/interaction"... |
brandinio/slashcord | dist/utilities/command.d.ts | <filename>dist/utilities/command.d.ts
import { Client, PermissionResolvable } from "discord.js";
import Slashcord from "..";
import { Interaction } from "./interaction";
declare type Options = {
name?: string;
description?: string;
type: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
required?: boolean;
};
interfac... |
brandinio/slashcord | dist/utilities/ButtonInteraction.d.ts | <reponame>brandinio/slashcord<filename>dist/utilities/ButtonInteraction.d.ts
import { Client, Guild, GuildMember, Message, TextChannel } from "discord.js";
import Slashcord from "..";
import { ActionRow } from "./ActionRow";
import { Component } from "./types";
declare type Options = {
tts?: boolean;
type?: num... |
brandinio/slashcord | dist/utilities/buttons/ButtonCollector.d.ts | <reponame>brandinio/slashcord
import { Collector } from "discord.js";
import { ButtonInteraction } from "./ButtonInteraction";
import { ButtonCollectorOptions } from "../types";
declare class ButtonCollector extends Collector<string, ButtonInteraction> {
constructor(message: any, filter: any, options: ButtonCollect... |
brandinio/slashcord | dist/utilities/extras/utils.d.ts | import { GuildMember, PermissionResolvable } from "discord.js";
import { MessageButton } from "../buttons/MessageButton";
import { ActionRow } from "../buttons/ActionRow";
declare type Component = MessageButton;
declare function msToTime(ms: number): string;
declare function missingPermissions(member: GuildMember, perm... |
brandinio/slashcord | src/utilities/command.ts | <gh_stars>1-10
import { Client, Collection, PermissionResolvable } from "discord.js";
import Slashcord from "..";
import { Interaction } from "./interaction";
type Options = {
name?: string;
description?: string;
type: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
required?: boolean;
};
interface Command {
name: strin... |
brandinio/slashcord | src/utilities/buttons/ButtonInteraction.ts | //@ts-nocheck
import axios from "axios";
import {
Client,
Guild,
GuildMember,
Message,
MessageEmbed,
TextChannel,
} from "discord.js";
import Slashcord from "../..";
import { ActionRow } from "./ActionRow";
import Slasherror from "../extras/error";
import {
isComponent,
resolveActionRow,
resolveComp... |
brandinio/slashcord | dist/utilities/buttons/MessageButton.d.ts | <gh_stars>1-10
declare type Style = "blurple" | "grey" | "green" | "red" | "link";
declare type Emoji = {
id?: string | null;
name?: string | null;
};
declare class MessageButton {
type: number;
style: number;
label: string;
emoji: Emoji;
url: string;
customId: string;
disabled: bool... |
brandinio/slashcord | src/utilities/buttons/MessageButton.ts | <reponame>brandinio/slashcord
import { isEmoji } from "../extras/utils";
const styles = {
blurple: 1,
grey: 2,
green: 3,
red: 4,
link: 5,
};
type Style = "blurple" | "grey" | "green" | "red" | "link";
type Emoji = {
id?: string | null;
name?: string | null;
};
class MessageButton {
type = 2;
style... |
brandinio/slashcord | dist/utilities/buttons/ActionRow.d.ts | <reponame>brandinio/slashcord
import { MessageButton } from "./MessageButton";
declare type Component = MessageButton;
declare class ActionRow {
type: number;
components: Component[];
constructor(components: Component[]);
addComponent(component: Component): this;
}
export { ActionRow };
|
brandinio/slashcord | src/utilities/getFiles.ts | import { readdirSync } from "fs";
function getFiles(dir: string) {
const files = readdirSync(dir, {
withFileTypes: true,
});
// Array with the files.
let allFiles: [string, string][] = [];
for (const file of files) {
if (file.isDirectory()) {
allFiles = [...allFiles, ...getFiles(`${dir}/${fil... |
brandinio/slashcord | dist/utilities/types.d.ts | <filename>dist/utilities/types.d.ts
import { MessageButton } from "./buttons/MessageButton";
declare type Component = MessageButton;
declare type ButtonCollectorOptions = {
time: null;
max: number;
errors: string[];
maxProcessed: number;
};
export type { Component, ButtonCollectorOptions };
|
brandinio/slashcord | dist/utilities/getFiles.d.ts | declare function getFiles(dir: string): [string, string][];
export = getFiles;
|
brandinio/slashcord | dist/handlers/CommandHandler.d.ts | import Slashcord from "..";
declare class CommandHandler {
private _client;
constructor(handler: Slashcord, directory: string);
}
export { CommandHandler };
|
brandinio/slashcord | src/index.ts | <reponame>brandinio/slashcord
import { Client, Collection, Structures } from "discord.js";
import { CommandHandler } from "./handlers/CommandHandler";
import Slasherror from "./utilities/extras/error";
import Slashcmds from "./utilities/slash";
import { ActionRow } from "./utilities/buttons/ActionRow";
import { Message... |
brandinio/slashcord | src/utilities/types.ts | <reponame>brandinio/slashcord
import { TextChannel } from "discord.js";
import { MessageButton } from "./buttons/MessageButton";
type Component = MessageButton;
type ButtonCollectorOptions = {
time: null;
max: number;
errors: string[];
maxProcessed: number;
};
export type { Component, ButtonCollectorOptions }... |
brandinio/slashcord | src/utilities/buttons/ButtonCollector.ts | <filename>src/utilities/buttons/ButtonCollector.ts
//@ts-nocheck
import { Collection, Collector, Constants } from "discord.js";
import { ButtonInteraction } from "./ButtonInteraction";
import { ButtonCollectorOptions } from "../types";
const { Events } = Constants;
class ButtonCollector extends Collector<string, Butt... |
brandinio/slashcord | dist/index.d.ts | import { Client, Collection } from "discord.js";
import Slashcmds from "./utilities/slash";
import { ActionRow } from "./utilities/buttons/ActionRow";
import { MessageButton } from "./utilities/buttons/MessageButton";
import { Command } from "./utilities/command";
import { awaitButtons } from "./utilities/buttons/await... |
jvm-odoo/jvm | src/user/user.entity.ts | <reponame>jvm-odoo/jvm
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
import { Field, Int, ObjectType } from '@nestjs/graphql'
@Entity('user')
@ObjectType()
export class UserEntity {
@PrimaryGeneratedColumn()
@Field((type) => Int)
id: number
@Column({ nullable: true })
@Field({ n... |
jvm-odoo/jvm | src/user/user.service.ts | import { Repository } from 'typeorm'
import { sign } from 'jsonwebtoken'
import { InjectRepository } from '@nestjs/typeorm'
import { HttpException, HttpStatus } from '@nestjs/common'
import { UserEntity } from './user.entity'
import { UserLoginDto } from './dto/user-login.dto'
import { EmailService } from '../email/em... |
jvm-odoo/jvm | src/journey/journey.module.ts | import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common'
import { TypeOrmModule } from '@nestjs/typeorm'
import { JourneyService } from './journey.service'
import { JourneyResolver } from './journey.resolver'
import { JourneyEntity } from './journey.entity'
@Module({
imports: [TypeOrmModule.forFeatu... |
jvm-odoo/jvm | src/user/auth.controller.ts | <reponame>jvm-odoo/jvm
import { Controller, Get, Param, Res } from '@nestjs/common'
import { UserService } from './user.service'
@Controller('auth')
export class AuthController {
constructor(private userService: UserService) {}
@Get(':email/:otp/:source')
async authenticate(@Param() params, @Res() res): P... |
jvm-odoo/jvm | src/experience/experience.resolver.ts | import { Resolver, Query, Mutation, Args } from '@nestjs/graphql'
import { ExperienceEntity } from './experience.entity'
import { ExperienceService } from './experience.service'
import { UseGuards } from '@nestjs/common'
import { AuthGuard } from '../user/auth.guard'
@Resolver((of) => ExperienceEntity)
export class Ex... |
jvm-odoo/jvm | src/email/email.service.ts | import mailjet from 'node-mailjet'
import { Config } from '../config'
import {
getTemplate,
IEmailTemplate,
IEmailTemplateCoordinates,
} from '../emailTemplates'
type EmailTemplateVariable = { [key: string]: string }
export class EmailService {
private mailjetUtility
constructor() {
cons... |
jvm-odoo/jvm | src/visitor/visitor.gateway.ts | <gh_stars>0
import {
SubscribeMessage,
WebSocketGateway,
WebSocketServer,
OnGatewayConnection,
OnGatewayDisconnect,
} from '@nestjs/websockets'
import { Logger } from '@nestjs/common'
import { Socket, Server } from 'socket.io'
import {
uniqueNamesGenerator,
adjectives,
colors,
animal... |
jvm-odoo/jvm | src/user/dto/user-login.dto.ts | import { Field, InputType } from '@nestjs/graphql'
@InputType()
export class UserLoginDto {
@Field()
readonly email: string
@Field({ nullable: true })
readonly source?: string
}
|
jvm-odoo/jvm | src/health/health.resolver.ts | import { Resolver, Query, Mutation, Args } from '@nestjs/graphql'
import { UseGuards } from '@nestjs/common'
import { HealthEntity } from './health.entity'
import { HealthService } from './health.service'
import { UpdateHealthDTO } from './dto/updateHealth'
import { AuthGuard } from '../user/auth.guard'
@Resolver((of... |
jvm-odoo/jvm | src/health/health.service.ts | import { InjectRepository } from '@nestjs/typeorm'
import { Repository } from 'typeorm'
import { HealthEntity } from './health.entity'
import { UpdateHealthDTO } from './dto/updateHealth'
export class HealthService {
constructor(
@InjectRepository(HealthEntity)
private readonly healthRepository: R... |
jvm-odoo/jvm | src/url/url.module.ts | <reponame>jvm-odoo/jvm
import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common'
import { TypeOrmModule } from '@nestjs/typeorm'
import { UrlService } from './url.service'
import { UrlEntity } from './url.entity'
import { UrlController } from './url.controller'
import { UrlResolver } from './url.resolver... |
jvm-odoo/jvm | src/development/development.entity.ts | import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
import { Field, Int, ObjectType } from '@nestjs/graphql'
@Entity('development')
@ObjectType()
export class DevelopmentEntity {
@PrimaryGeneratedColumn()
@Field((type) => Int)
id: number
@Column({ nullable: true })
@Field({ nullable: ... |
jvm-odoo/jvm | src/technology/technology.module.ts | <filename>src/technology/technology.module.ts
import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common'
import { TypeOrmModule } from '@nestjs/typeorm'
import { TechnologyEntity } from './technology.entity'
import { TechnologyService } from './technology.service'
import { TechnologyResolver } from './tech... |
jvm-odoo/jvm | src/app.controller.ts | <reponame>jvm-odoo/jvm<gh_stars>0
import { Controller, Get, Res } from '@nestjs/common'
@Controller()
export class AppController {
constructor() {}
@Get('/')
async specialRewardForCuriousGuys(@Res() res): Promise<void> {
res.send(`
<!DOCTYPE html>
<html>
<head... |
jvm-odoo/jvm | src/journey/journey.resolver.ts | <filename>src/journey/journey.resolver.ts
import { Args, Int, Query, Resolver } from '@nestjs/graphql'
import { JourneyEntity } from './journey.entity'
import { JourneyService } from './journey.service'
@Resolver((of) => JourneyEntity)
export class JourneyResolver {
constructor(private journeyService: JourneyServi... |
jvm-odoo/jvm | src/health/health.entity.ts | import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
import { Field, Int, ObjectType } from '@nestjs/graphql'
export enum HealthStatus {
maintenance,
available,
}
@Entity('health')
@ObjectType()
export class HealthEntity {
@PrimaryGeneratedColumn()
@Field((type) => Int)
id: number
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.