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

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();
});
});
});
});
})();