This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AccountsClient } from '@accounts/client'; | |
import { LoginResult, CreateUser } from '@accounts/types'; | |
import { AccountsClientPasswordOptions } from './types'; | |
export declare class AccountsClientPassword { | |
private client; | |
private options; | |
constructor(client: AccountsClient, options?: AccountsClientPasswordOptions); | |
/** | |
* Create a new user. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AccountsClient } from '@accounts/client'; | |
import { LoginResult, CreateUser } from '@accounts/types'; | |
import { AccountsClientPasswordOptions } from './types'; | |
export declare class AccountsClientPassword { | |
private client; | |
private options; | |
constructor(client: AccountsClient, options?: AccountsClientPasswordOptions); | |
/** | |
* Create a new user. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable, OnInit } from '@angular/core'; | |
import { AccountsClient } from '@accounts/client'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class LoginService implements OnInit { | |
public userLoginStatus = 'defaultLoginData'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'reflect-metadata'; | |
import { MongoClient } from 'mongodb'; | |
import { AccountsServer } from '@accounts/server'; | |
import { AccountsPassword } from '@accounts/password'; | |
import AccountsMongoDB from '@accounts/mongo'; | |
import { ApolloServer, attachDirectiveResolvers } from 'apollo-server'; | |
import { AppModule } from '@modules/app/app.module'; | |
import * as dotenv from "dotenv"; | |
dotenv.config(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { QueryResolvers } from "@models"; | |
import { UsersProvider } from "../providers/users.provider"; | |
export const Query: QueryResolvers = { | |
allUsers: (root, args, { injector }) => injector.get(UsersProvider).getAllUsers(), | |
userById: (_, { id }, { injector }) => injector.get(UsersProvider).getUserById(id), | |
userByUsername: (_, { username }, { injector }) => injector.get(UsersProvider).getUserByUsername(username), | |
getUserByToken: (_, { id }, { injector }) => injector.get(UsersProvider).getUserByToken(id) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Resolver, Query, Ctx, Mutation, Arg, FieldResolver, Root } from "type-graphql"; | |
import { User, RegisterInput } from '../entities/User'; | |
import * as crypto from "crypto-js"; | |
import { File } from "../entities/File"; | |
import { GraphQLUpload } from 'graphql-upload'; | |
import { createWriteStream } from "fs"; | |
@Resolver(User) | |
export class UserResolver { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Resolver, Query, Ctx, Mutation, Arg, FieldResolver, Root } from 'type-graphql'; | |
import { User, CreateUserInput } from '../entities/User'; | |
import * as crypto from 'crypto-js'; | |
import { File } from '../entities/File'; | |
import { GraphQLUpload } from 'graphql-upload'; | |
import { createWriteStream } from 'fs'; | |
import { Like, getRepository } from 'typeorm'; | |
@Resolver(User) | |
export class UserResolver { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Resolver, Query, Args, Arg, Mutation } from "type-graphql"; | |
import { Book, BookFilter, BooksFilter, CreateBookInput } from './book.entity'; | |
import { Like } from 'typeorm'; | |
@Resolver(Book) | |
export class BookResolver { | |
@Query(returns => [Book]) | |
async allBooks( | |
@Args() { title, skip, take }: BooksFilter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Entity, PrimaryGeneratedColumn, Column, BaseEntity } from 'typeorm'; | |
import { ObjectType, Field, ID, Int, ArgsType, InputType } from 'type-graphql'; | |
@Entity() | |
@ObjectType() | |
export class Book extends BaseEntity { | |
@PrimaryGeneratedColumn("uuid") | |
@Field(type => ID) | |
id: string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit } from '@angular/core'; | |
import { MatSnackBar } from '@angular/material'; | |
import { Router } from '@angular/router'; | |
import { slugify } from '../../helpers/slugify'; | |
import { SEOService } from '../../services/seo.service'; | |
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; | |
import { MustMatch } from '../../helpers/must-match-validator'; | |
import { MAT_MOMENT_DATE_FORMATS, MomentDateAdapter } from '@angular/material-moment-adapter'; |
OlderNewer