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 Analytics = require('analytics-node'); | |
import { inject, injectable, named } from 'inversify'; | |
import { getRepository } from 'typeorm'; | |
import { ApplicationCharge } from '../entities/ApplicationCharge'; | |
import { ChargeMapper } from '../entities/mappers/ChargeMapper'; | |
import { Merchant } from '../entities/Merchant'; | |
import { MerchantGateway } from '../gateway/MerchantGateway'; | |
export interface Query { | |
shop: 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 { inject, injectable } from 'inversify'; | |
import { Controller, Get, Patch } from 'inversify-restify-utils'; | |
import { Next, Request, Response } from 'restify'; | |
import { Merchant } from '../entities/Merchant'; | |
import authenticate from '../helpers/JwtAuthenticator'; | |
import { MerchantService } from '../services/MerchantService'; | |
@injectable() | |
@Controller('/merchant') | |
export class MerchantController { |
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 { Container } from 'inversify'; | |
import { TYPE } from 'inversify-restify-utils'; | |
import 'reflect-metadata'; | |
import * as ShopifyToken from 'shopify-token'; | |
import { Connection, ConnectionOptions, createConnection } from 'typeorm'; | |
import { ApiController } from './controllers/ApiController'; | |
import { ApplicationChargeController } from './controllers/ApplicationChargeController'; | |
import { AuthController } from './controllers/AuthController'; |
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 { CircuitBreaker } from '@ssense/circuit-breaker'; | |
@CircuitBreaker.wrap({ | |
timeout: 5000, | |
errorThresholdPercentage: 55, | |
resetTimeout: 15000, | |
rollingCountTimeout: 10000, | |
volumeThreshold: 3, | |
fallback: (thisObject: ProductGateway) => thisObject.cbFallback, | |
}) | |
public async getProductsByIds(requestId: string, entry: GetProductsByIdsInterface): Promise<Product[]> { |
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
export class Calculator { | |
public add(firstAddend: number, secondAddend: number): number { | |
return firstAddend + secondAddend; | |
} | |
public subtract(minuend: number, subtrahend: number): number { | |
return minuend - subtrahend; | |
} |
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
export class Calculator { | |
public add(firstAddend: number, secondAddend: number): number { | |
return firstAddend + secondAddend; | |
} | |
public subtract(minuend: number, subtrahend: number): number { | |
return minuend - subtrahend; | |
} |
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
export class Calculator { | |
public add(firstAddend: number, secondAddend: number): number { | |
return firstAddend + secondAddend; | |
} | |
public subtract(minuend: number, subtrahend: number): number { | |
return minuend - subtrahend; | |
} |
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
export class Calculator { | |
public add(firstAddend: number, secondAddend: number): number { | |
return firstAddend + secondAddend; | |
} | |
public subtract(minuend: number, subtrahend: number): number { | |
return minuend + subtrahend; | |
} |
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
export class Calculator { | |
public add(firstAddend: number, secondAddend: number): number { | |
return firstAddend + secondAddend; | |
} | |
public subtract(minuend: number, subtrahend: number): number { | |
return minuend + subtrahend; | |
} |
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
export class Calculator() { | |
public add(firstAddend: number, secondAddend: number): number { | |
return firstAddend + secondAddend; | |
} | |
} | |
// ✅test passes, we're all happy | |
describe('Calculator', () => { | |
it('sums up two numbers properly', () => { | |
calculator = new Calculator(); |
NewerOlder