Initial hDiyanetProxy backend scaffold (Express + MySQL + Diyanet setup)

This commit is contained in:
hbt22bot
2026-02-27 05:01:41 +00:00
commit 94d5388864
4399 changed files with 464304 additions and 0 deletions

85
node_modules/pg-hstore/.jshintrc generated vendored Normal file
View File

@@ -0,0 +1,85 @@
{
// See http://jshint.com/docs/ for more details
"maxerr" : 50, // {int} Maximum error before stopping
// Enforcing
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : false, // true: Identifiers must be in camelCase
"curly" : true, // true: Require {} for every new block or scope
"eqeqeq" : true, // true: Require triple equals (===) for comparison
"forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty()
"immed" : true, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
"indent" : 2, // {int} Number of spaces to use for indentation
"latedef" : true, // true: Require variables/functions to be defined before being used
"newcap" : false, // true: Require capitalization of all constructor functions e.g. `new F()`
"noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
"noempty" : true, // true: Prohibit use of empty blocks
"nonew" : true, // true: Prohibit use of constructors for side-effects (without assignment)
"plusplus" : false, // true: Prohibit use of `++` & `--`
"quotmark" : true, // Quotation mark consistency:
// false : do nothing (default)
// true : ensure whatever is used is consistent
// "single" : require single quotes
// "double" : require double quotes
"undef" : true, // true: Require all non-global variables to be declared (prevents global leaks)
"unused" : true, // true: Require all defined variables be used
"strict" : true, // true: Requires all functions run in ES5 Strict Mode
"trailing" : true, // true: Prohibit trailing whitespaces
"maxparams" : false, // {int} Max number of formal params allowed per function
"maxdepth" : false, // {int} Max depth of nested blocks (within functions)
"maxstatements" : false, // {int} Max number statements per function
"maxcomplexity" : false, // {int} Max cyclomatic complexity per function
"maxlen" : false, // {int} Max number of characters per line
// Relaxing
"asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
"boss" : false, // true: Tolerate assignments where comparisons would be expected
"debug" : false, // true: Allow debugger statements e.g. browser breakpoints.
"eqnull" : false, // true: Tolerate use of `== null`
"es5" : false, // true: Allow ES5 syntax (ex: getters and setters)
"esnext" : false, // true: Allow ES.next (ES6) syntax (ex: `const`)
"moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features)
// (ex: `for each`, multiple try/catch, function expression…)
"evil" : false, // true: Tolerate use of `eval` and `new Function()`
"expr" : false, // true: Tolerate `ExpressionStatement` as Programs
"funcscope" : false, // true: Tolerate defining variables inside control statements"
"globalstrict" : false, // true: Allow global "use strict" (also enables 'strict')
"iterator" : false, // true: Tolerate using the `__iterator__` property
"lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block
"laxbreak" : false, // true: Tolerate possibly unsafe line breakings
"laxcomma" : false, // true: Tolerate comma-first style coding
"loopfunc" : false, // true: Tolerate functions being defined in loops
"multistr" : false, // true: Tolerate multi-line strings
"proto" : false, // true: Tolerate using the `__proto__` property
"scripturl" : false, // true: Tolerate script-targeted URLs
"smarttabs" : false, // true: Tolerate mixed tabs/spaces when used for alignment
"shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
"sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation
"supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;`
"validthis" : false, // true: Tolerate using this in a non-constructor function
// Environments
"browser" : true, // Web Browser (window, document, etc)
"couch" : false, // CouchDB
"devel" : true, // Development/debugging (alert, confirm, etc)
"dojo" : false, // Dojo Toolkit
"jquery" : false, // jQuery
"mootools" : false, // MooTools
"node" : true, // Node.js
"nonstandard" : false, // Widely adopted globals (escape, unescape, etc)
"prototypejs" : false, // Prototype and Scriptaculous
"rhino" : false, // Rhino
"worker" : false, // Web Workers
"wsh" : false, // Windows Scripting Host
"yui" : false, // Yahoo User Interface
// Legacy
"nomen" : false, // true: Prohibit dangling `_` in variables
"onevar" : true, // true: Allow only one `var` statement per function
"passfail" : false, // true: Stop on first error
"white" : true, // true: Check against strict whitespace and indentation rules
// Custom Globals
"globals" : { "angular": false, "_": false, "moment": false } // additional predefined global variables
}

3
node_modules/pg-hstore/.travis.yml generated vendored Normal file
View File

@@ -0,0 +1,3 @@
language: node_js
node_js:
- "0.10"

9
node_modules/pg-hstore/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,9 @@
The MIT License (MIT)
Copyright (C) 2012 Eloqua
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.

37
node_modules/pg-hstore/README.md generated vendored Normal file
View File

@@ -0,0 +1,37 @@
[![Build Status](https://travis-ci.org/scarney81/pg-hstore.png)](https://travis-ci.org/[YOUR_GITHUB_USERNAME]/[YOUR_PROJECT_NAME])
pg-hstore
===========
A node package for serializing and deserializing JSON data to hstore format
## Install pg-hstore
```bash
$ npm install pg-hstore
```
## Usage
### stringify
```javascript
var hstore = require('pg-hstore')();
var source = { foo: "oof", bar: "rab", baz: "zab" };
hstore.stringify(source, function(result) {
...
// result = '"foo"=>"oof", "bar"=>"rab", "baz"=>"zab"'
...
});
```
### parse
```javascript
var hstore = require('pg-hstore')();
var source = '"foo"=>"oof", "bar"=>"rab", "baz"=>"zab"';
hstore.parse(source, function(result) {
...
// result = { foo: "oof", bar: "rab", baz: "zab" }
...
});
```

79
node_modules/pg-hstore/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,79 @@
(function () {
var _ = require('underscore');
function sanitize_input(input) {
// http://www.postgresql.org/docs/9.0/static/sql-syntax-lexical.html [4.1.2.1-4.1.2.2]
// single quotes (') must be replaced with double single quotes ('')
input = input.replace(/'/g, '\'\'');
// backslashes (\) must be replaced with double backslashes (\\)
input = input.replace(/\\/g, '\\\\');
// double quotes (") must be replaced with escaped quotes (\\")
input = input.replace(/"/g, '\\"');
return input;
}
function to_string(input, sanitize) {
switch(typeof input) {
case 'boolean':
case 'number':
case 'object':
return String(input);
case 'string':
return sanitize ? sanitize_input(input) : input;
default:
return '';
}
}
module.exports = function (options) {
options = _.defaults({}, options, { sanitize: false });
return {
stringify: function (data, callback) {
var hstore = Object.keys(data).map(function (key) {
if (data[key] === null) {
return '"'+to_string(key, options.sanitize)+'"=>NULL';
} else {
return '"'+to_string(key, options.sanitize)+'"=>"'+to_string(data[key], options.sanitize)+'"';
}
});
var joined = hstore.join();
if (!callback || callback === null) return joined;
callback(joined);
},
parse: function(string, callback) {
var result = {},
//using [\s\S] to match any character, including line feed and carriage return,
r = /(["])(?:\\\1|\\\\|[\s\S])*?\1|NULL/g,
matches = string.match(r),
i,
l,
clean = function (value) {
// Remove leading double quotes
value = value.replace(/^\"|\"$/g, "");
// Unescape quotes
value = value.replace(/\\"/g, "\"");
//Unescape backslashes
value = value.replace(/\\\\/g,"\\");
//Unescape single quotes
value = value.replace(/''/g,"'");
return value;
};
if(matches) {
for (i = 0, l = matches.length; i < l; i+= 2) {
if (matches[i] && matches[i + 1]) {
var key = clean(matches[i]);
var value = matches[i + 1];
result[key] = value=="NULL"?null:clean(value);
}
}
}
if (!callback || callback === null) return result;
callback(result);
}
};
};
})();

35
node_modules/pg-hstore/package.json generated vendored Normal file
View File

@@ -0,0 +1,35 @@
{
"author": "Seth Carney <scarney81@gmail.com> (https://github.com/scarney81)",
"name": "pg-hstore",
"description": "A module for serializing and deserializing JSON data into hstore format",
"private": false,
"keywords": [
"pg",
"postgres",
"hstore"
],
"license": "MIT",
"version": "2.3.4",
"main": "lib/index.js",
"homepage": "https://github.com/scarney81/pg-hstore",
"bugs": {
"url": "https://github.com/scarney81/pg-hstore/issues"
},
"repository": {
"type": "git",
"url": "git@github.com:scarney81/pg-hstore.git"
},
"dependencies": {
"underscore": "^1.13.1"
},
"devDependencies": {
"mocha": "^2.1.0",
"should": "^4.4.2"
},
"engines": {
"node": ">= 0.8.x"
},
"scripts": {
"test": "./node_modules/.bin/mocha --reporter spec -u bdd --require should --recursive --timeout 10000"
}
}

11
node_modules/pg-hstore/test/index.js generated vendored Normal file
View File

@@ -0,0 +1,11 @@
/*globals it, describe */
var mocha = require('mocha'),
should = require('should'),
hstore = require('../lib/index.js')({sanitize : true});
describe('pg-hstore.index', function() {
it('should get out the same object it put in when sanitizing', function() {
var testObj = {foo : "bar", count : "1", emptyString : "", quotyString : '""', extraQuotyString : '"""a"""""', singleQuotyString : "'a''", backslashes : '\\f023', moreBackslashes : '\\f\\0\\2\\1', backslashesAndQuotes : '\\"\\"uhoh"\\"', nully : null};
hstore.parse(hstore.stringify(testObj)).should.eql(testObj);
});
});

3
node_modules/pg-hstore/test/mocha.opts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
--require should
--reporter spec
--ui bdd

121
node_modules/pg-hstore/test/parse.js generated vendored Normal file
View File

@@ -0,0 +1,121 @@
/*globals it, describe, beforeEach */
(function () {
'use strict';
var should = require('should'),
assert= require('assert'),
HStore = require('../lib/index.js'),
hstore;
describe('pg-hstore.parse', function () {
beforeEach(function () {
hstore = new HStore();
});
it('should hstore parse an hstore string', function (done) {
var source = '"foo"=>"bar"';
hstore.parse(source, function (target) {
should.exist(target);
target.foo.should.equal('bar');
done();
});
});
it('should hstore parse an empty hstore string', function (done) {
var source = '';
hstore.parse(source, function (target) {
should.exist(target);
target.should.eql({});
done();
});
});
it('should hstore parse an hstore string with multiple values', function (done) {
var source = '"foo"=>"oof","bar"=>"rab","baz"=>"zab"';
hstore.parse(source, function (target) {
should.exist(target);
target.foo.should.equal('oof');
target.bar.should.equal('rab');
target.baz.should.equal('zab');
done();
});
});
it('should hstore parse an escaped quoted string with quotes', function (done) {
var source = '"foo"=>"\\"bar\\""';
hstore.parse(source, function (target) {
should.exist(target);
target.foo.should.equal('"bar"');
done();
});
});
it('should hstore parse an escaped quoted string with single quotes', function (done) {
var source = '"foo"=>"\'\'bar\'\'"';
hstore.parse(source, function (target) {
should.exist(target);
target.foo.should.equal('\'bar\'');
done();
});
});
it('should hstore parse a string with escaped backslashes', function (done) {
var source = '"foo"=>"\\\\f0123"';
hstore.parse(source, function (target) {
should.exist(target);
target.foo.should.equal('\\f0123');
done();
});
});
it('should hstore parse a string with commas', function (done) {
var source = '"foo"=>"bar,foo,bar"';
hstore.parse(source, function (target) {
should.exist(target);
target.foo.should.equal('bar,foo,bar');
done();
});
});
it('should hstore parse a string with advanced types', function (done) {
var source = '"foo"=>"{\\"key\\":\\"value\\",\\"key2\\":\\"value\\"}"';
hstore.parse(source, function (target) {
should.exist(target);
target.foo.should.equal('{"key":"value","key2":"value"}');
done();
});
});
it('should hstore parse a string with NULL values', function (done) {
var source = '"foo"=>"oof","bar"=>NULL,"baz"=>"zab"';
hstore.parse(source, function (target) {
should.exist(target);
target.foo.should.equal('oof');
assert.equal(target.bar, null);
target.baz.should.equal('zab');
done();
});
});
it('should hstore parse a string with \n values', function (done) {
var source = '"foo"=>"o\rof","bar"=>NULL,"baz"=>"z\nab"';
hstore.parse(source, function (target) {
should.exist(target);
target.foo.should.equal('o\rof');
assert.equal(target.bar, null);
target.baz.should.equal('z\nab');
done();
});
});
it('should hstore parse a string ending with \\', function (done) {
var source = '"url"=>"http://google.com\\\\","foo"=>"bar"';
hstore.parse(source, function (target) {
should.exist(target);
target.url.should.equal('http://google.com\\');
target.foo.should.equal('bar');
done();
});
});
});
})();

202
node_modules/pg-hstore/test/stringify.js generated vendored Normal file
View File

@@ -0,0 +1,202 @@
/*globals it, describe, beforeEach */
(function () {
'use strict';
var should = require('should'),
HStore = require('../lib/index.js'),
hstore;
describe('pg-hstore.stringify', function () {
describe('without sanitization', function(){
beforeEach(function () {
hstore = new HStore();
});
it('should hstore encode a string', function (done) {
var source = { foo: 'bar' };
hstore.stringify(source, function (target) {
should.exist(target);
target.should.equal('"foo"=>"bar"');
done();
});
});
it('should hstore encode a number', function (done) {
var source = { foo: 1000 };
hstore.stringify(source, function (target) {
should.exist(target);
target.should.equal('"foo"=>"1000"');
done();
});
});
it('should hstore encode a boolean', function (done) {
var source = { foo: true };
hstore.stringify(source, function (target) {
should.exist(target);
target.should.equal('"foo"=>"true"');
done();
});
});
it('should hstore encode an object', function (done) {
var source = { foo: { bar: 1000 } };
hstore.stringify(source, function (target) {
should.exist(target);
target.should.equal('"foo"=>"[object Object]"');
done();
});
});
it('should hstore encode a null value', function (done) {
var source = { foo: null };
hstore.stringify(source, function (target) {
should.exist(target);
target.should.equal('"foo"=>NULL');
done();
});
});
it('should hstore encode a null string value', function (done) {
var source = { foo: 'null' };
hstore.stringify(source, function (target) {
should.exist(target);
target.should.equal('"foo"=>"null"');
done();
});
});
it('should hstore encode single quotes correctly', function (done) {
var source = { 'foo \'quotes\'': 'with \'quotes\'' };
hstore.stringify(source, function (target) {
should.exist(target);
target.should.equal('"foo \'quotes\'"=>"with \'quotes\'"');
done();
});
});
it('should hstore encode double quotes correctly', function (done) {
var source = { foo: 'with \"quotes\"' };
hstore.stringify(source, function (target) {
should.exist(target);
target.should.equal('"foo"=>"with "quotes""');
done();
});
});
it('should hstore encode double quote keys correctly', function (done) {
var source = { 'foo \"quotes\"': 'with \"quotes\"' };
hstore.stringify(source, function (target) {
should.exist(target);
target.should.equal('"foo "quotes""=>"with "quotes""');
done();
});
});
it('should hstore encode colon correctly', function (done) {
var source = { 'foo': 'with:colon' };
hstore.stringify(source, function (target) {
should.exist(target);
target.should.equal('"foo"=>"with:colon"');
done();
});
});
it('should not sanitize output', function (done) {
var source = { 'foo\'"\\': 'bar' };
hstore.stringify(source, function (target) {
should.exist(target);
target.should.equal('"foo\'"\\"=>"bar"');
done();
}, true);
});
});
describe('with sanitization', function(){
beforeEach(function () {
hstore = new HStore({sanitize : true});
});
it('should hstore encode a string', function (done) {
var source = { foo: 'bar' };
hstore.stringify(source, function (target) {
should.exist(target);
target.should.equal('"foo"=>"bar"');
done();
});
});
it('should hstore encode a number', function (done) {
var source = { foo: 1000 };
hstore.stringify(source, function (target) {
should.exist(target);
target.should.equal('"foo"=>"1000"');
done();
});
});
it('should hstore encode a boolean', function (done) {
var source = { foo: true };
hstore.stringify(source, function (target) {
should.exist(target);
target.should.equal('"foo"=>"true"');
done();
});
});
it('should hstore encode a null value', function (done) {
var source = { foo: null };
hstore.stringify(source, function (target) {
should.exist(target);
target.should.equal('"foo"=>NULL');
done();
});
});
it('should hstore encode a null string value', function (done) {
var source = { foo: 'null' };
hstore.stringify(source, function (target) {
should.exist(target);
target.should.equal('"foo"=>"null"');
done();
});
});
it('should hstore encode single quotes correctly', function (done) {
var source = { 'foo \'quotes\'': 'with \'quotes\'' };
hstore.stringify(source, function (target) {
should.exist(target);
target.should.equal('"foo \'\'quotes\'\'"=>"with \'\'quotes\'\'"');
done();
});
});
it('should hstore encode double quotes correctly', function (done) {
var source = { foo: 'with "quotes"' };
hstore.stringify(source, function (target) {
should.exist(target);
target.should.equal('"foo"=>"with \\"quotes\\""');
done();
});
});
it('should hstore encode backslashes correctly', function (done) {
var source = { '\\f0122': '\\f0123' };
hstore.stringify(source, function (target) {
should.exist(target);
target.should.equal('"\\\\f0122"=>"\\\\f0123"');
done();
});
});
it('should hstore encode colon correctly', function (done) {
var source = { 'foo': 'with:colon' };
hstore.stringify(source, function (target) {
should.exist(target);
target.should.equal('"foo"=>"with:colon"');
done();
});
});
});
});
})();