1
0
mirror of https://github.com/seejohnrun/haste-server.git synced 2026-01-27 18:27:12 +00:00

add relative paths

This commit is contained in:
Yusuf Yilmaz
2022-06-06 19:38:20 +02:00
parent ab47249505
commit 21aa23dd28
26 changed files with 71 additions and 67 deletions

View File

@@ -1,6 +1,6 @@
import type { Config } from '../../types/config'
import buildGenerator from '../key-generators/builder'
import buildStore from '../document-stores/builder'
import buildGenerator from 'src/lib/key-generators/builder'
import type { Config } from 'src/types/config'
import buildStore from 'src/lib/document-stores/builder'
import DocumentHandler from "./index"
const build = async (config: Config) => {

View File

@@ -1,11 +1,11 @@
import { Request, Response } from 'express'
import * as winston from 'winston'
import Busboy from 'busboy'
import type { Config } from '../../types/config'
import type { Store } from '../../types/store'
import type { KeyGenerator } from '../../types/key-generator'
import type { Document } from '../../types/document'
import constants from '../../constants'
import type { Config } from 'src/types/config'
import type { Store } from 'src/types/store'
import type { KeyGenerator } from 'src/types/key-generator'
import type { Document } from 'src/types/document'
import constants from 'src/constants'
class DocumentHandler {
keyLength: number

View File

@@ -1,7 +1,7 @@
import * as winston from 'winston'
import AWS from 'aws-sdk'
import type { Callback, Store } from '../../types/store'
import type { AmazonStoreConfig } from '../../types/config'
import type { Callback, Store } from 'src/types/store'
import type { AmazonStoreConfig } from 'src/types/config'
class AmazonS3DocumentStore implements Store {
bucket: string | undefined

View File

@@ -1,5 +1,5 @@
import type { Config } from '../../types/config'
import type { Store } from '../../types/store'
import type { Config } from 'src/types/config'
import type { Store } from 'src/types/store'
const build = async (config: Config): Promise<Store> => {
const DocumentStore = (

View File

@@ -2,8 +2,8 @@ import * as winston from 'winston'
import * as fs from 'fs'
import * as crypto from 'crypto'
import type { Callback, Store } from '../../types/store'
import type { FileStoreConfig } from '../../types/config'
import type { Callback, Store } from 'src/types/store'
import type { FileStoreConfig } from 'src/types/config'
// Generate md5 of a string
const md5 = (str: string) => {

View File

@@ -1,8 +1,8 @@
import { Datastore, PathType } from '@google-cloud/datastore'
import * as winston from 'winston'
import type { Callback, Store } from '../../types/store'
import type { GoogleStoreConfig } from '../../types/config'
import type { Callback, Store } from 'src/types/store'
import type { GoogleStoreConfig } from 'src/types/config'
class GoogleDatastoreDocumentStore implements Store {
kind: string

View File

@@ -1,8 +1,8 @@
import * as winston from 'winston'
import Memcached = require('memcached')
import type { Callback, Store } from '../../types/store'
import type { MemcachedStoreConfig } from '../../types/config'
import type { Callback, Store } from 'src/types/store'
import type { MemcachedStoreConfig } from 'src/types/config'
class MemcachedDocumentStore implements Store {
expire: number | undefined

View File

@@ -1,8 +1,8 @@
import * as winston from 'winston'
import { MongoClient } from 'mongodb'
import type { Callback, Store } from '../../types/store'
import type { MongoStoreConfig } from '../../types/config'
import type { Callback, Store } from 'src/types/store'
import type { MongoStoreConfig } from 'src/types/config'
type ConnectCallback = (error?: Error, db?: MongoClient) => void

View File

@@ -1,8 +1,8 @@
import * as winston from 'winston'
import { Pool, PoolClient } from 'pg'
import type { Callback, Store } from '../../types/store'
import type { PostgresStoreConfig } from '../../types/config'
import type { Callback, Store } from 'src/types/store'
import type { PostgresStoreConfig } from 'src/types/config'
type ConnectCallback = (
error?: Error,

View File

@@ -1,8 +1,8 @@
import * as winston from 'winston'
import { createClient } from 'redis'
import { bool } from 'aws-sdk/clients/redshiftdata'
import { Callback, Store } from '../../types/store'
import { RedisStoreConfig } from '../../types/config'
import { Callback, Store } from 'src/types/store'
import { RedisStoreConfig } from 'src/types/config'
export type RedisClientType = ReturnType<typeof createClient>

View File

@@ -3,8 +3,8 @@ import * as crypto from 'crypto'
import rethink, { RethinkClient } from 'rethinkdbdash'
import type { RethinkDbStoreConfig } from '../../types/config'
import type { Callback } from '../../types/store'
import type { RethinkDbStoreConfig } from 'src/types/config'
import type { Callback } from 'src/types/store'
const md5 = (str: string) => {
const md5sum = crypto.createHash('md5')

View File

@@ -1,7 +1,7 @@
import * as fs from 'fs'
import * as path from 'path'
import { Config } from '../../types/config'
import { Config } from 'src/types/config'
const getConfig = (): Config => {
const configPath =

View File

@@ -1,5 +1,5 @@
import * as winston from 'winston'
import type { Config } from '../../types/config'
import type { Config } from 'src/types/config'
const addLogging = (config: Config) => {
try {

View File

@@ -1,5 +1,5 @@
import type { KeyGenerator } from '../../types/key-generator'
import type { Config } from '../../types/config'
import type { KeyGenerator } from 'src/types/key-generator'
import type { Config } from 'src/types/config'
const build = async (config: Config): Promise<KeyGenerator> => {
const pwOptions = config.keyGenerator

View File

@@ -1,6 +1,6 @@
import * as fs from 'fs'
import type { KeyGeneratorConfig } from '../../types/config'
import type { KeyGenerator } from '../../types/key-generator'
import type { KeyGeneratorConfig } from 'src/types/config'
import type { KeyGenerator } from 'src/types/key-generator'
class DictionaryGenerator implements KeyGenerator {
type: string

View File

@@ -1,7 +1,7 @@
// Draws inspiration from pwgen and http://tools.arantius.com/password
import type { KeyGeneratorConfig } from '../../types/config'
import type { KeyGenerator } from '../../types/key-generator'
import type { KeyGeneratorConfig } from 'src/types/config'
import type { KeyGenerator } from 'src/types/key-generator'
const randOf = (collection: string) => () =>
collection[Math.floor(Math.random() * collection.length)]

View File

@@ -1,5 +1,5 @@
import type { KeyGeneratorConfig } from '../../types/config'
import type { KeyGenerator } from '../../types/key-generator'
import type { KeyGeneratorConfig } from 'src/types/config'
import type { KeyGenerator } from 'src/types/key-generator'
class RandomKeyGenerator implements KeyGenerator {
type: string

View File

@@ -4,15 +4,15 @@ import * as winston from 'winston'
import uglify from 'uglify-js'
import connectSt from 'st'
import connectRateLimit from 'connect-ratelimit'
import getConfig from './lib/helpers/config'
import addLogging from './lib/helpers/log'
import buildDocumenthandler from './lib/document-handler/builder'
import DocumentHandler from './lib/document-handler'
import { Config } from './types/config'
import { Config } from 'src/types/config'
import getConfig from 'src/lib/helpers/config'
import addLogging from 'src/lib/helpers/log'
import DocumentHandler from 'src/lib/document-handler'
import buildDocumenthandler from 'src/lib/document-handler/builder'
import {
getStaticDirectory,
getStaticItemDirectory,
} from './lib/helpers/directory'
} from 'src/lib/helpers/directory'
const config: Config = getConfig()