This file contains hidden or 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 {Context} from 'koa'; | |
| import Router from 'koa-router'; | |
| import db from '../db/connection'; | |
| import {getAuth} from './session'; | |
| import {validationFailed} from './errors'; | |
| import {User} from '../db/users'; | |
| import {IBaseProtocol} from 'pg-promise'; | |
| import * as t from 'io-ts'; | |
| import koaBody from 'koa-body'; |
This file contains hidden or 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 * as t from 'io-ts'; | |
| import {DateFromISOString} from 'io-ts-types/lib/Date/DateFromISOString'; | |
| const Type = t.type({ | |
| time: DateFromISOString | |
| }); | |
| console.log(Type.decode({time:'2018-05-18T12:43:55.709Z'})); | |
This file contains hidden or 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
| WITH RECURSIVE folder_tree(id, depth) AS ( | |
| SELECT | |
| fo.id, | |
| 1 | |
| FROM | |
| folder AS fo | |
| WHERE ( | |
| (${ids}::bigint[] IS NULL AND fo.parent_folder_id IS NULL) | |
| OR fo.id = ANY (${ids}::bigint[]) | |
| ) AND fo.user_group_id = ${userGroupId} |
This file contains hidden or 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
| service: backend | |
| provider: | |
| name: aws | |
| runtime: nodejs8.10 | |
| stage: dev | |
| region: eu-west-1 | |
| # you can add statements to the Lambda function's IAM Role here |
This file contains hidden or 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
| declare module 'serverless-http' { | |
| import {Express} from 'express'; | |
| type Handler = (input:any) => any; | |
| function mkHandler(app:Express):Handler; | |
| export = mkHandler; | |
| } |
This file contains hidden or 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
| server { | |
| listen 80; | |
| server_name app.oma-domain.fi; | |
| root /var/www; | |
| location =/ { | |
| rewrite ^ https://app.oma-domain.fi$request_uri? permanent; | |
| } | |
| } | |
| server { | |
| listen 443 ssl; # managed by Certbot |
This file contains hidden or 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
| package db | |
| import ( | |
| "github.com/jmoiron/sqlx" | |
| "github.com/lib/pq" | |
| "gopkg.in/guregu/null.v3" | |
| "pipekeeper/testutil" | |
| "testing" | |
| ) |
This file contains hidden or 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
| package db | |
| import ( | |
| "github.com/jmoiron/sqlx" | |
| "github.com/lib/pq" | |
| "gopkg.in/guregu/null.v3" | |
| ) | |
| type UserGroup struct { | |
| Id int64 |
This file contains hidden or 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 * as crud from './crud'; | |
| import configureMockStore from 'redux-mock-store'; | |
| import createSagaMiddleware from 'redux-saga'; | |
| import {select, put, call} from 'redux-saga/effects'; | |
| interface Dummy { | |
| id: string; | |
| name: string; | |
| } |
This file contains hidden or 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 * as crud from './crud'; | |
| import {RootState} from '../reducers'; | |
| export interface Query { | |
| offset?: number; | |
| limit?: number; | |
| } | |
| export interface Project { | |
| id: string; | |
| name: string; |