repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
elernal-tree/elernal-tree
src/app/pages/home/component/weapon/model.ts
<gh_stars>1-10 import { CoreElement, Robot } from '@src/app/constants/enum'; export interface Section { normal: number; maguna: number; ex: number; } export interface PanelData { element: CoreElement; mainRobot: Robot; mainRobotValue: number; subRobot: Robot; subRobotValue: number; atk: Section; h...
elernal-tree/elernal-tree
src/app/share/widget/etimg/etimg/etimg.component.ts
import { Component, OnInit, Input } from '@angular/core'; import { Core, Skill } from '@src/app/model/core'; import {environment } from '@src/environments/environment' const Rarity = ['', 'R', 'SR', 'SSR']; @Component({ selector: 'app-etimg', templateUrl: './etimg.component.html', styleUrls: ['./etimg.componen...
elernal-tree/elernal-tree
src/app/core/core.module.ts
<gh_stars>1-10 import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { CacheReuseStrategy } from './router-config/cacheReuseStrategy'; import { RouteReuseStrategy } from '@angular/router'; @NgModule({ declarations: [], imports: [ CommonModule ], providers: [ ...
elernal-tree/elernal-tree
src/app/share/directives/darg-drop/drag-drop-box.directive.ts
<reponame>elernal-tree/elernal-tree import { DOCUMENT } from '@angular/common'; import { Directive, ElementRef, EventEmitter, Inject, Input, NgZone, OnDestroy, Output, } from '@angular/core'; @Directive({ selector: '[appDragDropBox]', }) export class DragDropBoxDirective implements OnDestroy { @Out...
elernal-tree/elernal-tree
src/app/pages/home/component/weapon/weapon-item/weapon-item.component.ts
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { WeaponItem } from '@src/app/model/weapon'; @Component({ selector: 'app-weapon-item', templateUrl: './weapon-item.component.html', styleUrls: ['./weapon-item.component.scss'] }) export class WeaponItemComponent { @Input() ...
elernal-tree/elernal-tree
src/app/pages/home/component/arsenal/arsenal.component.ts
<filename>src/app/pages/home/component/arsenal/arsenal.component.ts import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'; import { Core } from '@src/app/model/core'; import { HttpClient } from '@angular/common/http'; import { CoreElement, CoreSeries } from '@src/app/constants/enum'; import { CdkDrag...
elernal-tree/elernal-tree
src/app/pages/home/component/weapon/data-panel/combo-critical/combo-critical.component.ts
<gh_stars>1-10 import { Component, Input, OnInit } from '@angular/core'; import { DaTaRatio, CriRatio } from '@src/app/constants/constants'; import { AtkType } from '@src/app/constants/enum'; import { ShushuService } from '@src/app/core/service/shushu.service'; import { ExtraInfo } from '../../model'; // TODO 如果da+ta满...
elernal-tree/elernal-tree
src/environments/environment.prod.ts
<gh_stars>1-10 export const environment = { production: true, ImgUrl:"https://yjzs-core.oss-cn-beijing.aliyuncs.com/core/{id}.png" };
elernal-tree/elernal-tree
src/app/model/core.ts
<reponame>elernal-tree/elernal-tree export interface Core { id: number; data: CoreData; } export interface CoreData { canUseSpItem: number; coreAddAtk: number; coreAddHp: number; coreCanDepose: number; coreCanSell: number; coreElement: number; coreMaxLevel: number; ...
elernal-tree/elernal-tree
src/app/pages/home/component/weapon/data-panel/skl-ub/skl-ub.component.ts
import { Component, Input, OnInit } from '@angular/core'; import { AtkRatio, Limit } from '@src/app/constants/constants'; @Component({ selector: 'app-skl-ub', templateUrl: './skl-ub.component.html', styleUrls: ['./skl-ub.component.scss'], }) export class SklUbComponent { constructor() {} @Input() atkDamage: ...
elernal-tree/elernal-tree
src/app/share/widget/etimg/etimg.module.ts
import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { EtimgComponent } from './etimg/etimg.component'; import { NzPopoverModule } from 'ng-zorro-antd/popover' @NgModule({ declarations: [ EtimgComponent ], imports: [ CommonModule, NzPopoverModule ], e...
Shinerising/easyblog
src/app/app.component.spec.ts
<filename>src/app/app.component.spec.ts import { TestBed, waitForAsync } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { AppComponent } from './app.component'; import { ConfigService } from './service/config.service'; describe('AppComponent', () => { beforeEach(w...
Shinerising/easyblog
src/app/service/markdown.service.ts
import { Injectable, Inject } from '@angular/core'; import { ConfigService } from '../service/config.service'; import marked from 'marked'; import hljs from 'highlight.js'; import bash from 'highlight.js/lib/languages/bash'; import cs from 'highlight.js/lib/languages/csharp'; import cpp from 'highlight.js/lib/language...
Shinerising/easyblog
src/app/service/config.service.ts
import { Injectable, Injector } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { firstValueFrom } from 'rxjs'; export interface Config { User: string; Repo: string; Path: string; Title: string; RAWRoot: string; Theme: string; } @Injectable({ providedIn: 'root', }) export...
Shinerising/easyblog
src/app/pipe/sanitize.pipe.ts
import { Pipe, PipeTransform } from '@angular/core'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; @Pipe({ name: 'sanitizeHTML' }) export class SanitizehtmlPipe implements PipeTransform { constructor( private sanitizer: DomSanitizer) { } transform(value: string, exponent?: string): Sa...
Shinerising/easyblog
src/app/post.component.ts
import { Apollo, gql } from 'apollo-angular'; import { Component, OnInit, OnDestroy } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { Subscription } from 'rxjs'; import { HttpService } from './service/http.service'; import { Title } from '@angular/platform-browser'; import { Com...
Shinerising/easyblog
src/app/app.component.ts
import { Component, Inject } from '@angular/core'; import { ConfigService } from './service/config.service'; import { DOCUMENT } from '@angular/common'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { public header: strin...
Shinerising/easyblog
src/app/app.module.ts
import { BrowserModule } from '@angular/platform-browser'; import { HttpClientModule } from '@angular/common/http'; import { NgModule, APP_INITIALIZER } from '@angular/core'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { ListComponent } from './list.c...
Shinerising/easyblog
src/app/interface/commit.interface.ts
<filename>src/app/interface/commit.interface.ts export interface Commit { commit: { oid: string; commitUrl: string, committedDate: Date, committer: { name: string, email: string, avatarUrl: string, date: Date } }; } export interface Commits { repo: { content: { ...
Shinerising/easyblog
src/app/pipe/filename.pipe.ts
<gh_stars>1-10 import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'filename' }) export class FileNamePipe implements PipeTransform { transform(value: string, exponent?: string): string { const name = value.substr(0, value.lastIndexOf('.')); if (exponent === 'img') { return name + '.jpg'...
Shinerising/easyblog
src/app/list.component.ts
import { Apollo, gql } from 'apollo-angular'; import { Component } from '@angular/core'; import { Title } from '@angular/platform-browser'; import { Contents, Content } from './interface/content.interface'; import { ConfigService } from './service/config.service'; import { firstValueFrom } from 'rxjs'; @Component({ ...
Shinerising/easyblog
src/app/interface/content.interface.ts
<reponame>Shinerising/easyblog<gh_stars>1-10 export interface Contents { repo: { content: { entries: Array<Content> } }; } export interface Content { name: string; type: string; oid: string; commitedDate: Date; }
Shinerising/easyblog
src/app/service/http.service.ts
<filename>src/app/service/http.service.ts import { Injectable, Inject } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { firstValueFrom } from 'rxjs'; @Injectable({ providedIn: 'root', }) export class HttpService { public constructor( private http: HttpClient) { } public ...
ekoirsyad/chonky-website
landing/src/sections/Header.tsx
/** * @author <NAME> <<EMAIL>> * @copyright 2020 * @license MIT */ import { Theme } from '@material-ui/core/styles/createMuiTheme'; import createStyles from '@material-ui/core/styles/createStyles'; import makeStyles from '@material-ui/core/styles/makeStyles'; import Typography from '@material-ui/core/Typography'; ...
ekoirsyad/chonky-website
landing/src/demo/demo-component.tsx
<gh_stars>1-10 import { faSyncAlt } from '@fortawesome/free-solid-svg-icons/faSyncAlt'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import Button from '@material-ui/core/Button'; import Paper from '@material-ui/core/Paper'; import { Theme } from '@material-ui/core/styles/createMuiTheme'; import cr...
ekoirsyad/chonky-website
landing/src/sections/Docs.tsx
/** * @author <NAME> <<EMAIL>> * @copyright 2020 * @license MIT */ import Grid from '@material-ui/core/Grid'; import React from 'react'; import { LinkCard } from '../components/LinkCard'; import { Title } from '../components/Title'; import { Docs0x, Docs1x, Docs2x, Storybook2x } from '../util/links'; export inter...
ekoirsyad/chonky-website
landing/src/components/LinkButton.tsx
/** * @author <NAME> <<EMAIL>> * @copyright 2020 * @license MIT */ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import Button from '@material-ui/core/Button'; import { Theme } from '@material-ui/core/styles/createMuiTheme'; import createStyles from '@material-ui/core/styles/createStyles'; impo...
ekoirsyad/chonky-website
landing/src/demo/demo-util.tsx
<gh_stars>1-10 import { ChonkyActions, ChonkyFileActionData } from 'chonky'; import Noty from 'noty'; import 'noty/lib/noty.css'; import 'noty/lib/themes/relax.css'; import './demo-styles.css'; // We ignore some actions to avoid creating noise const ignoredActions = new Set<String>(); ignoredActions.add(ChonkyActions....
ekoirsyad/chonky-website
landing/src/sections/Features.tsx
<reponame>ekoirsyad/chonky-website<gh_stars>1-10 /** * @author <NAME> <<EMAIL>> * @copyright 2020 * @license MIT */ import Avatar from '@material-ui/core/Avatar'; import Box from '@material-ui/core/Box'; import ListItem from '@material-ui/core/ListItem'; import ListItemAvatar from '@material-ui/core/ListItemAvatar...
ekoirsyad/chonky-website
landing/src/sections/Demo.tsx
/** * @author <NAME> <<EMAIL>> * @copyright 2020 * @license MIT */ import React from 'react'; import { Title } from '../components/Title'; import { DemoComponent } from '../demo/demo-component'; export interface DemoProps {} export const Demo: React.FC<DemoProps> = (props) => { return ( <> ...
ekoirsyad/chonky-website
landing/src/components/Title.tsx
/** * @author <NAME> <<EMAIL>> * @copyright 2020 * @license MIT */ import { Theme } from '@material-ui/core/styles/createMuiTheme'; import createStyles from '@material-ui/core/styles/createStyles'; import makeStyles from '@material-ui/core/styles/makeStyles'; import Typography from '@material-ui/core/Typography'; ...
ekoirsyad/chonky-website
landing/src/sections/Links.tsx
<filename>landing/src/sections/Links.tsx /** * @author <NAME> <<EMAIL>> * @copyright 2020 * @license MIT */ import Box from '@material-ui/core/Box'; import { Theme } from '@material-ui/core/styles/createMuiTheme'; import createStyles from '@material-ui/core/styles/createStyles'; import makeStyles from '@material-u...
ekoirsyad/chonky-website
landing/src/App.tsx
/** * @author <NAME> <<EMAIL>> * @copyright 2020 * @license MIT */ import Container from '@material-ui/core/Container'; import React from 'react'; import { Demo } from './sections/Demo'; import { Docs } from './sections/Docs'; import { Features } from './sections/Features'; import { Header } from './sections/Heade...
mkloubert/vs-cron
src/workspace.ts
/// <reference types="node" /> // The MIT License (MIT) // // vs-cron (https://github.com/mkloubert/vs-cron) // Copyright (c) <NAME> <<EMAIL>> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to // dea...
mkloubert/vs-cron
src/contracts.ts
<gh_stars>1-10 /// <reference types="node" /> // The MIT License (MIT) // // vs-cron (https://github.com/mkloubert/vs-cron) // Copyright (c) <NAME> <<EMAIL>> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Softwar...
mkloubert/vs-cron
src/objects.ts
<filename>src/objects.ts /// <reference types="node" /> // The MIT License (MIT) // // vs-cron (https://github.com/mkloubert/vs-cron) // Copyright (c) <NAME> <<EMAIL>> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (th...
mkloubert/vs-cron
src/extension.ts
<filename>src/extension.ts 'use strict'; /// <reference types="node" /> // The MIT License (MIT) // // vs-cron (https://github.com/mkloubert/vs-cron) // Copyright (c) <NAME> <<EMAIL>> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation ...
mkloubert/vs-cron
src/helpers.ts
<filename>src/helpers.ts /// <reference types="node" /> // The MIT License (MIT) // // vs-cron (https://github.com/mkloubert/vs-cron) // Copyright (c) <NAME> <<EMAIL>> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (th...
mkloubert/vs-cron
src/controller.ts
<reponame>mkloubert/vs-cron<gh_stars>1-10 'use strict'; /// <reference types="node" /> // The MIT License (MIT) // // vs-cron (https://github.com/mkloubert/vs-cron) // Copyright (c) <NAME> <<EMAIL>> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and ...
cane4044/fast-dna
packages/fast-element/src/directives/index.ts
<filename>packages/fast-element/src/directives/index.ts export * from "./behavior"; export * from "./binding"; export * from "./directive"; export * from "./ref"; export * from "./repeat"; export * from "./when";
cane4044/fast-dna
packages/fast-element/src/observation/observable.ts
<reponame>cane4044/fast-dna import { Controller } from "../controller"; import { FastElement } from "../fast-element"; import { Notifier, PropertyChangeNotifier } from "./notifier"; import { Expression, ExpressionContext } from "../interfaces"; export interface GetterInspector { inspect(source: unknown, propertyNa...
cane4044/fast-dna
packages/fast-components/src/design-system-provider/design-system-provider.template.ts
import { accentFill, accentFillLarge, accentForeground, accentForegroundCut, accentForegroundLarge, neutralDividerRest, neutralFill, neutralFillCard, neutralFillInput, neutralFillStealth, neutralFillToggle, neutralFocus, neutralFocusInnerAccent, neut...
cane4044/fast-dna
packages/fast-element/src/template.ts
import { compileTemplate } from "./template-compiler"; import { HTMLView, ElementView, SyntheticView, View } from "./view"; import { DOM } from "./dom"; import { Behavior, BehaviorFactory } from "./directives/behavior"; import { Expression } from "./interfaces"; import { Directive } from "./directives/directive"; ...
cane4044/fast-dna
packages/fast-element/src/dom.ts
import { Callable } from "./interfaces"; const markerClass = `fast-${Math.random() .toString(36) .substring(7)}`; const updateQueue = [] as Callable[]; export const DOM = { isMarker(node: Node): node is Comment { return node.nodeType === 8 && (node as Comment).data.startsWith(markerClass); }, ...
cane4044/fast-dna
packages/fast-element/src/template-compiler.ts
import { ExpressionContext } from "./interfaces"; import { HTMLTemplate } from "./template"; import { BehaviorFactory } from "./directives/behavior"; import { DOM } from "./dom"; import { BindingDirective, BindingType } from "./directives/binding"; import { Directive, AttachedBehaviorDirective } from "./directives...
cane4044/fast-dna
packages/fast-element/src/directives/behavior.ts
<gh_stars>1-10 export interface Behavior { bind(source: unknown): void; unbind(): void; } export interface BehaviorFactory { targetIndex: number; createBehavior(target: any): Behavior; }
cane4044/fast-dna
packages/fast-element/src/interfaces.ts
export type Callable = typeof Function.prototype.call | { call(): void }; export const emptyArray = Object.freeze([]); /** * Provides additional contextual information available to arrow functions * evaluated in the context of a template update. */ export interface ExpressionContext { event: Event; }...
cane4044/fast-dna
packages/fast-element/src/directives/binding.ts
import { Directive } from "./directive"; import { Expression } from "../interfaces"; import { Subscriber } from "../observation/subscriber-collection"; import { Observable, GetterInspector, inspectAndEvaluate, } from "../observation/observable"; import { DOM } from "../dom"; import { Behavior } from "./beha...
cane4044/fast-dna
packages/fast-components/src/design-system-provider/design-system-provider.ts
<reponame>cane4044/fast-dna import { parseColorHexRGB } from "@microsoft/fast-colors"; import { createColorPalette, DesignSystem, DesignSystemDefaults, } from "@microsoft/fast-components-styles-msft"; import { FastElement, observable, Observable } from "@microsoft/fast-element"; /** * The followi...
cane4044/fast-dna
packages/fast-element/src/index.ts
<filename>packages/fast-element/src/index.ts export * from "./template"; export * from "./fast-element"; export * from "./attributes"; export * from "./controller"; export * from "./interfaces"; export * from "./template-compiler"; export * from "./styles"; export * from "./di"; export * from "./view"; export * from "....
cane4044/fast-dna
packages/fast-element/src/fast-element.ts
import { Controller } from "./controller"; import { emptyArray } from "./interfaces"; import { Observable } from "./observation/observable"; import { ElementViewTemplate } from "./template"; import { ElementStyles } from "./styles"; import { AttributeDefinition, AttributeConfiguration } from "./attributes"; impor...
cane4044/fast-dna
packages/fast-element/src/directives/repeat.ts
import { Expression } from "../interfaces"; import { SyntheticViewTemplate, CaptureType } from "../template"; import { Behavior } from "./behavior"; import { DOM } from "../dom"; import { Observable, GetterInspector, inspectAndEvaluate, } from "../observation/observable"; import { SyntheticView, HTMLView } ...
cane4044/fast-dna
packages/fast-element/src/directives/when.ts
<reponame>cane4044/fast-dna import { DOM } from "../dom"; import { SyntheticViewTemplate, CaptureType } from "../template"; import { SyntheticView } from "../view"; import { Expression } from "../interfaces"; import { Behavior } from "./behavior"; import { Observable, GetterInspector, inspectAndEvaluate, } ...
BestDingSheng/zarm-web
components/button/button.tsx
<gh_stars>0 import React, { Component } from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import ButtonProps from './PropsType'; import Icon from '../icon'; class Button extends Component<ButtonProps, any> { static Group; static defaultProps = { prefixCls: 'za-button', ...
BestDingSheng/zarm-web
components/notification/PropsType.tsx
<reponame>BestDingSheng/zarm-web<gh_stars>0 import React from 'react'; export default interface PropsType { prefixCls?: string; style?: React.CSSProperties; top?: number | string; theme?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'loading'; title?: string; message?: string; stayTime?: nu...
BestDingSheng/zarm-web
components/grid/row.tsx
<reponame>BestDingSheng/zarm-web import React, { PureComponent, cloneElement } from 'react'; import classnames from 'classnames'; import PropTypes from 'prop-types'; type Align = 'top' | 'middle' | 'top'; type Justify = 'start' | 'end' | 'center' | 'space-around' | 'space-between'; export interface IProps { gutter?...
BestDingSheng/zarm-web
components/time-picker/TimePicker.tsx
import React, { Component, Fragment } from 'react'; import classnames from 'classnames'; import Dropdown from '../dropdown'; import Icon from '../icon'; import TimeSelect from './TimeSelect'; import LocaleReceiver from '../locale/LocaleReceiver'; type placement = 'bottomLeft' | 'bottomCenter' | 'bottomRight' | 'topLef...
BestDingSheng/zarm-web
components/button/PropsType.tsx
import { ButtonHTMLAttributes, MouseEvent, CSSProperties } from 'react'; export type theme = 'default' | 'primary' | 'danger'; export type size = 'xl' | 'lg' | 'sm' | 'xs'; export type shape = 'circle' | 'round' | 'rect' | 'radius'; export type buttonType = 'button' | 'submit' | 'reset'; interface BasicPropsType { ...
BestDingSheng/zarm-web
components/select/Option.tsx
import React, { Component } from 'react'; import cn from 'classnames'; import Icon from '../icon'; import { OptionProps } from './PropsType'; class Option extends Component<OptionProps, any> { static defaultProps = { isDisabled: false, onChange: () => { }, }; render() { const { props } = this; c...
EffectiveXf5/joandjane-back
src/blog/dto/blog.dto.ts
export class BlogDTO { readonly author: string; readonly reading_time: string; readonly title: string; readonly img: string; readonly description: string; readonly createdAt: Date; }
EffectiveXf5/joandjane-back
src/blog/blog.controller.spec.ts
<gh_stars>0 import { Test, TestingModule } from '@nestjs/testing'; import { BlogController } from './blog.controller'; import { BlogService } from './blog.service'; describe('BlogController', () => { let controller: BlogController; const mockBlogService = { createOneBlog: jest.fn((dto) => { return { ...
EffectiveXf5/joandjane-back
src/activity/schema/activity.schema.ts
<reponame>EffectiveXf5/joandjane-back<gh_stars>0 import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose"; import { Document } from "mongoose"; export type ActivityDocument = Activity & Document; @Schema() export class Activity { @Prop( { required: true } ) title: string; @Prop() price: string;...
EffectiveXf5/joandjane-back
src/blog/blog.controller.ts
import { Body, Controller, Delete, Get, Param, Post, Put } from '@nestjs/common'; import { BlogService } from './blog.service'; import { Blog } from './interfaces/blog.interface'; import { BlogDTO } from './dto/blog.dto'; @Controller('blog') export class BlogController { constructor(private blogService: BlogServic...
EffectiveXf5/joandjane-back
src/destination/destination.controller.spec.ts
<gh_stars>0 import { Test, TestingModule } from '@nestjs/testing'; import { DestinationController } from './destination.controller'; import { DestinationService } from './destination.service'; describe('DestinationController', () => { let controller: DestinationController; const mockDestinationService = { cre...
EffectiveXf5/joandjane-back
src/database/database.service.ts
import { ConfigModule } from '@nestjs/config'; import { MongooseModule } from '@nestjs/mongoose'; export const DatabaseConection = [ //isGlobal nos permite usar la configuracion en otros modulos de las app ConfigModule.forRoot({ isGlobal: true }), MongooseModule.forRoot(process.env.MONGODB_URL), ]
EffectiveXf5/joandjane-back
src/destination/destination.service.spec.ts
import { getModelToken } from '@nestjs/mongoose'; import { Test, TestingModule } from '@nestjs/testing'; import { DestinationService } from './destination.service'; describe('DestinationService', () => { let service: DestinationService; const mockDestinationModel = { create: jest.fn().mockImplementation( dto ...
EffectiveXf5/joandjane-back
src/destination/destination.controller.ts
<reponame>EffectiveXf5/joandjane-back import { Get, Param, Post, Body, Put, Delete } from '@nestjs/common'; import { Controller } from '@nestjs/common'; import { DestinationService } from './destination.service'; import { Destination } from './interface/destination.interface'; import { DestinationDTO } from './dto/dest...
EffectiveXf5/joandjane-back
src/destination/destination.service.ts
import { Injectable } from '@nestjs/common'; import { InjectModel } from '@nestjs/mongoose'; import { Model } from 'mongoose'; import { Destination } from './interface/destination.interface'; import { DestinationDTO } from './dto/destination.dto'; @Injectable() export class DestinationService { constructor(@Inject...
EffectiveXf5/joandjane-back
src/activity/activity.controller.ts
<gh_stars>0 import { Body, Controller, Delete, Get, Param, Post, Put } from '@nestjs/common'; import { ActivityService } from './activity.service'; import { ActivityDTO } from './dto/activity.dto'; import { Activity } from './interfaces/activity.interface'; @Controller('activity') export class ActivityController { ...
EffectiveXf5/joandjane-back
src/destination/dto/destination.dto.ts
<gh_stars>0 export class DestinationDTO { readonly title: string; readonly img: string; readonly numberOfActivities: string; readonly createdAt: Date; }
EffectiveXf5/joandjane-back
src/blog/schema/blog.schema.ts
import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose"; import { Document } from 'mongoose'; export type BlogDocument = Blog & Document; @Schema() export class Blog { @Prop( { required: true } ) author: string; @Prop( { required: true } ) reading_time: string; @Prop( { required: true } )...
EffectiveXf5/joandjane-back
src/activity/activity.controller.spec.ts
<filename>src/activity/activity.controller.spec.ts import { Test, TestingModule } from '@nestjs/testing'; import { ActivityController } from './activity.controller'; import { ActivityService } from './activity.service'; describe('ActivityController', () => { let controller: ActivityController; const mockActivityS...
EffectiveXf5/joandjane-back
src/destination/schema/destination.schema.ts
import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose"; import { Document } from "mongoose"; export type DestinationDocument = Destination & Document; @Schema() export class Destination { @Prop() title: string; @Prop() img: string; @Prop() numberOfActivities: string; @Prop( { de...
EffectiveXf5/joandjane-back
src/destination/interface/destination.interface.ts
import { Document } from "mongoose" export interface Destination extends Document { readonly title: string; readonly img: string; readonly numberOfActivities: string; readonly createdAt: Date; }
EffectiveXf5/joandjane-back
src/activity/activity.service.ts
import { Injectable } from '@nestjs/common'; import { InjectModel } from '@nestjs/mongoose'; import { Model } from 'mongoose'; import { Activity } from './interfaces/activity.interface'; import { ActivityDTO } from './dto/activity.dto'; @Injectable() export class ActivityService { constructor(@InjectModel('Activit...
EffectiveXf5/joandjane-back
src/blog/blog.service.spec.ts
<filename>src/blog/blog.service.spec.ts import { Test, TestingModule } from '@nestjs/testing'; import { BlogService } from './blog.service'; import { getModelToken } from '@nestjs/mongoose'; describe('BlogService', () => { let service: BlogService; const mockBlogModel = { create: jest.fn().mockImplementation(...
EffectiveXf5/joandjane-back
src/blog/interfaces/blog.interface.ts
import { Document } from 'mongoose' export interface Blog extends Document { readonly author: string; readonly reading_time: string; readonly title: string; readonly img: string; readonly description: string; readonly createdAt: Date; }
EffectiveXf5/joandjane-back
src/destination/destination.module.ts
<gh_stars>0 import { Module } from '@nestjs/common'; import { MongooseModule } from '@nestjs/mongoose'; import { DestinationService } from './destination.service'; import { DestinationSchema } from './schema/destination.schema'; import { DestinationController } from './destination.controller'; @Module({ imports : [ ...
EffectiveXf5/joandjane-back
src/activity/dto/activity.dto.ts
export class ActivityDTO { readonly title: string; readonly price: string; readonly img: string; readonly destination: string[]; readonly type: string[]; readonly sumary: string; readonly duration: string; readonly cancelation: string; readonly instant_confirmation: str...
EffectiveXf5/joandjane-back
src/activity/activity.service.spec.ts
import { Test, TestingModule } from '@nestjs/testing'; import { ActivityService } from './activity.service'; import { getModelToken } from '@nestjs/mongoose'; describe('ActivitiesService', () => { let service: ActivityService; const mockActivityModel = { create: jest.fn().mockImplementation( dto => dto ), ...
EffectiveXf5/joandjane-back
src/blog/blog.service.ts
<gh_stars>0 import { Injectable } from '@nestjs/common'; import { InjectModel } from '@nestjs/mongoose'; import { Model } from 'mongoose'; import { Blog } from './interfaces/blog.interface'; import { BlogDTO } from './dto/blog.dto'; @Injectable() export class BlogService { constructor(@InjectModel('Blog') private ...
olujedai/sw-api
src/all-exception.filter.ts
<gh_stars>0 import { ExceptionFilter, Catch, ArgumentsHost, HttpException, HttpStatus } from '@nestjs/common'; @Catch() export class AllExceptionsFilter implements ExceptionFilter { catch(exception: any, host: ArgumentsHost) { const ctx = host.switchToHttp(); const response = ctx.getResponse(); const req...
olujedai/sw-api
src/character/dto/character.query.dto.ts
<filename>src/character/dto/character.query.dto.ts import { ApiModelProperty } from '@nestjs/swagger'; import { IsOptional, IsIn } from 'class-validator'; /** * Data Transfer Object that defines rules for documenting the query parameters on swagger UI * as well as the rules for validating the queries */ export clas...
olujedai/sw-api
src/comment/dto/comment.dto.ts
import { ApiModelProperty } from '@nestjs/swagger'; import { IsNotEmpty, Length } from 'class-validator'; /** * Comment Data Transfer Object for creating a new movie comment along with the swagger api definition and * field validations are defined here. */ export class CommentBodyDto { @ApiModelProperty( ...
olujedai/sw-api
src/character/dto/characters.dto.ts
import { Meta } from './characterMeta.dto'; import { CharacterDto } from './character.dto'; import { ApiModelProperty } from '@nestjs/swagger'; /** * Data transfer object for describing the character response object */ export class CharactersDto { @ApiModelProperty( { description: 'Response m...
olujedai/sw-api
src/movies/movies.validator.ts
<filename>src/movies/movies.validator.ts<gh_stars>0 import { Injectable, NotFoundException } from '@nestjs/common'; import { MoviesService } from './movies.service'; import { MovieDto } from './dto/movies.dto'; /** * Custom validator that checks if a movieId exists */ @Injectable() export class MovieValidator { ...
olujedai/sw-api
src/movies/dto/remoteMovie.dto.ts
// tslint:disable:variable-name /** * Data Transfer Object for specifying the one movie object */ export interface RemoteMovieObjectDto { readonly title: string; readonly episode_id: number; readonly opening_crawl: string; readonly director: string; readonly producer: string; readonly release...
olujedai/sw-api
src/ormconfig.ts
import { ConnectionOptions } from 'typeorm'; console.log(__dirname); export let config: ConnectionOptions; if (process.env.NODE_ENV !== 'test') { config = { name: 'default', type: 'postgres', host: String(process.env.DATABASE_HOST), port: Number(process.env.DATABASE_PORT), username: String(proces...
olujedai/sw-api
src/comment/comment.service.ts
import { Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { Comment } from './comment.entity'; import { Repository } from 'typeorm'; /** * The methods that provide the logic for interacting with the Comments database table are defined here. */ @Injectable() export class...
olujedai/sw-api
src/comment/comment.module.ts
import { Module } from '@nestjs/common'; import { CommentService } from './comment.service'; import { TypeOrmModule } from '@nestjs/typeorm'; import { Comment } from './comment.entity'; import { UtilsModule } from '../utils/utils.module'; /** * The providers, imports and exports of the Comment module are registered h...
olujedai/sw-api
src/character/dto/heightMeta.dto.ts
<filename>src/character/dto/heightMeta.dto.ts import { ApiModelProperty } from '@nestjs/swagger'; import { FeetDto } from './feet.dto'; /** * Data Transfer Object for describing the height field in the character metadata */ export class HeightMeta { @ApiModelProperty( { description: 'Height i...
olujedai/sw-api
src/request/request.module.ts
import { Module } from '@nestjs/common'; import { RequestService } from './request.service'; /** * The providers exports of the Request module are registered here */ @Module({ providers: [RequestService], exports: [RequestService], }) export class RequestModule {}
olujedai/sw-api
src/character/character.module.ts
<reponame>olujedai/sw-api<filename>src/character/character.module.ts import { Module } from '@nestjs/common'; import { CharacterService } from './character.service'; import { RequestModule } from '../request/request.module'; import { UtilsModule } from '../utils/utils.module'; @Module({ providers: [CharacterService]...
olujedai/sw-api
src/comment/comment.service.spec.ts
<gh_stars>0 import { Test, TestingModule } from '@nestjs/testing'; import { CommentService } from './comment.service'; import { getRepositoryToken } from '@nestjs/typeorm'; import { Comment } from './comment.entity'; import { Repository } from 'typeorm'; const testComment: Comment = { movieId: 1, ipAddress: '...
olujedai/sw-api
src/movies/movies.controller.ts
<filename>src/movies/movies.controller.ts import { Request } from 'express'; import { Controller, Get, Query, Param, Req, Body, Post, Header } from '@nestjs/common'; import { ApiUseTags, ApiResponse } from '@nestjs/swagger'; import { CommentService } from '../comment/comment.service'; import { CommentBodyDto } from '.....
olujedai/sw-api
src/app.controller.ts
<filename>src/app.controller.ts import { Controller, Get } from '@nestjs/common'; import { AppService } from './app.service'; import { ApiUseTags } from '@nestjs/swagger'; @ApiUseTags('server') @Controller('is-alive') export class AppController { constructor(private readonly appService: AppService) {} @Get() ge...
olujedai/sw-api
src/movies/movies.service.spec.ts
import { Test, TestingModule } from '@nestjs/testing'; import { getRepositoryToken } from '@nestjs/typeorm'; import { MoviesService } from './movies.service'; import { RequestService } from '../request/request.service'; import { UtilsService } from '../utils/utils.service'; import { CommentService } from '../comment/co...
olujedai/sw-api
src/comment/comment.entity.ts
<filename>src/comment/comment.entity.ts import { Entity, Column, CreateDateColumn, PrimaryGeneratedColumn } from 'typeorm'; import { ApiModelProperty } from '@nestjs/swagger'; /** * Comment database table definition */ @Entity() export class Comment { @PrimaryGeneratedColumn() @ApiModelProperty( { de...
olujedai/sw-api
src/main.ts
import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger'; import { AllExceptionsFilter } from './all-exception.filter'; import { ValidationPipe404 } from './validatation.pipe'; import * as helmet from 'helmet'; import { Logger...
olujedai/sw-api
src/character/character.service.spec.ts
<gh_stars>0 import { Test, TestingModule } from '@nestjs/testing'; import { CharacterService } from './character.service'; import { RequestService } from '../request/request.service'; import { UtilsService } from '../utils/utils.service'; import * as fs from 'fs'; import { CharacterDto } from './dto/character.dto'; imp...