Add initial version of dijkstra backend cloudron image
This commit is contained in:
21
node_modules/pg-connection-string/LICENSE
generated
vendored
Normal file
21
node_modules/pg-connection-string/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Iced Development
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
21
node_modules/pg-connection-string/README.md
generated
vendored
Normal file
21
node_modules/pg-connection-string/README.md
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
pg-connection-string
|
||||
====================
|
||||
|
||||
[](https://nodei.co/npm/pg-connection-string/)
|
||||
|
||||
[](https://travis-ci.org/iceddev/pg-connection-string)
|
||||
[](https://coveralls.io/r/iceddev/pg-connection-string?branch=master)
|
||||
|
||||
Functions for dealing with a PostgresSQL connection string
|
||||
|
||||
`parse` method taken from [node-postgres](https://github.com/brianc/node-postgres.git)
|
||||
Copyright (c) 2010-2014 Brian Carlson (brian.m.carlson@gmail.com)
|
||||
MIT License
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var parse = require('pg-connection-string').parse;
|
||||
|
||||
var config = parse('postgres://someuser:somepassword@somehost:381/somedatabase')
|
||||
```
|
||||
14
node_modules/pg-connection-string/index.d.ts
generated
vendored
Normal file
14
node_modules/pg-connection-string/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
export function parse(connectionString: string): ConnectionOptions;
|
||||
|
||||
export interface ConnectionOptions {
|
||||
host: string | null;
|
||||
password?: string;
|
||||
user?: string;
|
||||
port?: string | null;
|
||||
database: string | null | undefined;
|
||||
client_encoding?: string;
|
||||
ssl?: boolean | string;
|
||||
|
||||
application_name?: string;
|
||||
fallback_application_name?: string;
|
||||
}
|
||||
78
node_modules/pg-connection-string/index.js
generated
vendored
Normal file
78
node_modules/pg-connection-string/index.js
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
'use strict';
|
||||
|
||||
var url = require('url');
|
||||
var fs = require('fs');
|
||||
|
||||
//Parse method copied from https://github.com/brianc/node-postgres
|
||||
//Copyright (c) 2010-2014 Brian Carlson (brian.m.carlson@gmail.com)
|
||||
//MIT License
|
||||
|
||||
//parses a connection string
|
||||
function parse(str) {
|
||||
//unix socket
|
||||
if(str.charAt(0) === '/') {
|
||||
var config = str.split(' ');
|
||||
return { host: config[0], database: config[1] };
|
||||
}
|
||||
|
||||
// url parse expects spaces encoded as %20
|
||||
var result = url.parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(str) ? encodeURI(str).replace(/\%25(\d\d)/g, "%$1") : str, true);
|
||||
var config = result.query;
|
||||
for (var k in config) {
|
||||
if (Array.isArray(config[k])) {
|
||||
config[k] = config[k][config[k].length-1];
|
||||
}
|
||||
}
|
||||
|
||||
var auth = (result.auth || ':').split(':');
|
||||
config.user = auth[0];
|
||||
config.password = auth.splice(1).join(':');
|
||||
|
||||
config.port = result.port;
|
||||
if(result.protocol == 'socket:') {
|
||||
config.host = decodeURI(result.pathname);
|
||||
config.database = result.query.db;
|
||||
config.client_encoding = result.query.encoding;
|
||||
return config;
|
||||
}
|
||||
config.host = result.hostname;
|
||||
|
||||
// result.pathname is not always guaranteed to have a '/' prefix (e.g. relative urls)
|
||||
// only strip the slash if it is present.
|
||||
var pathname = result.pathname;
|
||||
if (pathname && pathname.charAt(0) === '/') {
|
||||
pathname = result.pathname.slice(1) || null;
|
||||
}
|
||||
config.database = pathname && decodeURI(pathname);
|
||||
|
||||
if (config.ssl === 'true' || config.ssl === '1') {
|
||||
config.ssl = true;
|
||||
}
|
||||
|
||||
if (config.ssl === '0') {
|
||||
config.ssl = false;
|
||||
}
|
||||
|
||||
if (config.sslcert || config.sslkey || config.sslrootcert) {
|
||||
config.ssl = {};
|
||||
}
|
||||
|
||||
if (config.sslcert) {
|
||||
config.ssl.cert = fs.readFileSync(config.sslcert).toString();
|
||||
}
|
||||
|
||||
if (config.sslkey) {
|
||||
config.ssl.key = fs.readFileSync(config.sslkey).toString();
|
||||
}
|
||||
|
||||
if (config.sslrootcert) {
|
||||
config.ssl.ca = fs.readFileSync(config.sslrootcert).toString();
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
|
||||
module.exports = parse;
|
||||
|
||||
parse.parse = parse;
|
||||
70
node_modules/pg-connection-string/package.json
generated
vendored
Normal file
70
node_modules/pg-connection-string/package.json
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"pg-connection-string@2.1.0",
|
||||
"/home/rui/code/personal/dijkstra-app/backend-dijkstra"
|
||||
]
|
||||
],
|
||||
"_from": "pg-connection-string@2.1.0",
|
||||
"_id": "pg-connection-string@2.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-bhlV7Eq09JrRIvo1eKngpwuqKtJnNhZdpdOlvrPrA4dxqXPjxSrbNrfnIDmTpwMyRszrcV4kU5ZA4mMsQUrjdg==",
|
||||
"_location": "/pg-connection-string",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "pg-connection-string@2.1.0",
|
||||
"name": "pg-connection-string",
|
||||
"escapedName": "pg-connection-string",
|
||||
"rawSpec": "2.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/knex"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.1.0.tgz",
|
||||
"_spec": "2.1.0",
|
||||
"_where": "/home/rui/code/personal/dijkstra-app/backend-dijkstra",
|
||||
"author": {
|
||||
"name": "Blaine Bublitz",
|
||||
"email": "blaine@iceddev.com",
|
||||
"url": "http://iceddev.com/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/iceddev/pg-connection-string/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Functions for dealing with a PostgresSQL connection string",
|
||||
"devDependencies": {
|
||||
"chai": "^4.1.1",
|
||||
"istanbul": "^0.4.5",
|
||||
"mocha": "^3.5.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"homepage": "https://github.com/iceddev/pg-connection-string",
|
||||
"keywords": [
|
||||
"pg",
|
||||
"connection",
|
||||
"string",
|
||||
"parse"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./index.js",
|
||||
"name": "pg-connection-string",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/iceddev/pg-connection-string.git"
|
||||
},
|
||||
"scripts": {
|
||||
"check-coverage": "istanbul check-coverage --statements 100 --branches 100 --lines 100 --functions 100",
|
||||
"coveralls": "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls",
|
||||
"test": "istanbul cover _mocha && npm run check-coverage"
|
||||
},
|
||||
"types": "./index.d.ts",
|
||||
"version": "2.1.0"
|
||||
}
|
||||
Reference in New Issue
Block a user