@mjhls/mjh-framework 1.0.811 → 1.0.812

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- # mjh-framework v. 1.0.811
2
+ # mjh-framework v. 1.0.812
3
3
 
4
4
 
5
5
  [![NPM](https://img.shields.io/npm/v/mjh-framework.svg)](https://www.npmjs.com/package/mjh-framework) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
package/dist/cjs/Auth.js CHANGED
@@ -15,6 +15,7 @@ var Local = require('passport-local');
15
15
  var mysql = require('mysql');
16
16
  var util = require('./util-6f784d85.js');
17
17
  var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
18
+ var md5 = require('./md5-e1ca5797.js');
18
19
  require('./es6.string.iterator-c2573ffd.js');
19
20
  require('./_to-object-6de10e57.js');
20
21
  require('./web.dom.iterable-46657b5c.js');
@@ -2812,324 +2813,6 @@ function connect() {
2812
2813
 
2813
2814
  var db = connect;
2814
2815
 
2815
- var crypt = _commonjsHelpers.createCommonjsModule(function (module) {
2816
- (function() {
2817
- var base64map
2818
- = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
2819
-
2820
- crypt = {
2821
- // Bit-wise rotation left
2822
- rotl: function(n, b) {
2823
- return (n << b) | (n >>> (32 - b));
2824
- },
2825
-
2826
- // Bit-wise rotation right
2827
- rotr: function(n, b) {
2828
- return (n << (32 - b)) | (n >>> b);
2829
- },
2830
-
2831
- // Swap big-endian to little-endian and vice versa
2832
- endian: function(n) {
2833
- // If number given, swap endian
2834
- if (n.constructor == Number) {
2835
- return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;
2836
- }
2837
-
2838
- // Else, assume array and swap all items
2839
- for (var i = 0; i < n.length; i++)
2840
- n[i] = crypt.endian(n[i]);
2841
- return n;
2842
- },
2843
-
2844
- // Generate an array of any length of random bytes
2845
- randomBytes: function(n) {
2846
- for (var bytes = []; n > 0; n--)
2847
- bytes.push(Math.floor(Math.random() * 256));
2848
- return bytes;
2849
- },
2850
-
2851
- // Convert a byte array to big-endian 32-bit words
2852
- bytesToWords: function(bytes) {
2853
- for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)
2854
- words[b >>> 5] |= bytes[i] << (24 - b % 32);
2855
- return words;
2856
- },
2857
-
2858
- // Convert big-endian 32-bit words to a byte array
2859
- wordsToBytes: function(words) {
2860
- for (var bytes = [], b = 0; b < words.length * 32; b += 8)
2861
- bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);
2862
- return bytes;
2863
- },
2864
-
2865
- // Convert a byte array to a hex string
2866
- bytesToHex: function(bytes) {
2867
- for (var hex = [], i = 0; i < bytes.length; i++) {
2868
- hex.push((bytes[i] >>> 4).toString(16));
2869
- hex.push((bytes[i] & 0xF).toString(16));
2870
- }
2871
- return hex.join('');
2872
- },
2873
-
2874
- // Convert a hex string to a byte array
2875
- hexToBytes: function(hex) {
2876
- for (var bytes = [], c = 0; c < hex.length; c += 2)
2877
- bytes.push(parseInt(hex.substr(c, 2), 16));
2878
- return bytes;
2879
- },
2880
-
2881
- // Convert a byte array to a base-64 string
2882
- bytesToBase64: function(bytes) {
2883
- for (var base64 = [], i = 0; i < bytes.length; i += 3) {
2884
- var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];
2885
- for (var j = 0; j < 4; j++)
2886
- if (i * 8 + j * 6 <= bytes.length * 8)
2887
- base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));
2888
- else
2889
- base64.push('=');
2890
- }
2891
- return base64.join('');
2892
- },
2893
-
2894
- // Convert a base-64 string to a byte array
2895
- base64ToBytes: function(base64) {
2896
- // Remove non-base-64 characters
2897
- base64 = base64.replace(/[^A-Z0-9+\/]/ig, '');
2898
-
2899
- for (var bytes = [], i = 0, imod4 = 0; i < base64.length;
2900
- imod4 = ++i % 4) {
2901
- if (imod4 == 0) continue;
2902
- bytes.push(((base64map.indexOf(base64.charAt(i - 1))
2903
- & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))
2904
- | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));
2905
- }
2906
- return bytes;
2907
- }
2908
- };
2909
-
2910
- module.exports = crypt;
2911
- })();
2912
- });
2913
-
2914
- var charenc = {
2915
- // UTF-8 encoding
2916
- utf8: {
2917
- // Convert a string to a byte array
2918
- stringToBytes: function(str) {
2919
- return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));
2920
- },
2921
-
2922
- // Convert a byte array to a string
2923
- bytesToString: function(bytes) {
2924
- return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));
2925
- }
2926
- },
2927
-
2928
- // Binary encoding
2929
- bin: {
2930
- // Convert a string to a byte array
2931
- stringToBytes: function(str) {
2932
- for (var bytes = [], i = 0; i < str.length; i++)
2933
- bytes.push(str.charCodeAt(i) & 0xFF);
2934
- return bytes;
2935
- },
2936
-
2937
- // Convert a byte array to a string
2938
- bytesToString: function(bytes) {
2939
- for (var str = [], i = 0; i < bytes.length; i++)
2940
- str.push(String.fromCharCode(bytes[i]));
2941
- return str.join('');
2942
- }
2943
- }
2944
- };
2945
-
2946
- var charenc_1 = charenc;
2947
-
2948
- /*!
2949
- * Determine if an object is a Buffer
2950
- *
2951
- * @author Feross Aboukhadijeh <https://feross.org>
2952
- * @license MIT
2953
- */
2954
-
2955
- // The _isBuffer check is for Safari 5-7 support, because it's missing
2956
- // Object.prototype.constructor. Remove this eventually
2957
- var isBuffer_1 = function (obj) {
2958
- return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
2959
- };
2960
-
2961
- function isBuffer (obj) {
2962
- return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
2963
- }
2964
-
2965
- // For Node v0.10 support. Remove this eventually.
2966
- function isSlowBuffer (obj) {
2967
- return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
2968
- }
2969
-
2970
- var md5 = _commonjsHelpers.createCommonjsModule(function (module) {
2971
- (function(){
2972
- var crypt$1 = crypt,
2973
- utf8 = charenc_1.utf8,
2974
- isBuffer = isBuffer_1,
2975
- bin = charenc_1.bin,
2976
-
2977
- // The core
2978
- md5 = function (message, options) {
2979
- // Convert to byte array
2980
- if (message.constructor == String)
2981
- if (options && options.encoding === 'binary')
2982
- message = bin.stringToBytes(message);
2983
- else
2984
- message = utf8.stringToBytes(message);
2985
- else if (isBuffer(message))
2986
- message = Array.prototype.slice.call(message, 0);
2987
- else if (!Array.isArray(message) && message.constructor !== Uint8Array)
2988
- message = message.toString();
2989
- // else, assume byte array already
2990
-
2991
- var m = crypt$1.bytesToWords(message),
2992
- l = message.length * 8,
2993
- a = 1732584193,
2994
- b = -271733879,
2995
- c = -1732584194,
2996
- d = 271733878;
2997
-
2998
- // Swap endian
2999
- for (var i = 0; i < m.length; i++) {
3000
- m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |
3001
- ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;
3002
- }
3003
-
3004
- // Padding
3005
- m[l >>> 5] |= 0x80 << (l % 32);
3006
- m[(((l + 64) >>> 9) << 4) + 14] = l;
3007
-
3008
- // Method shortcuts
3009
- var FF = md5._ff,
3010
- GG = md5._gg,
3011
- HH = md5._hh,
3012
- II = md5._ii;
3013
-
3014
- for (var i = 0; i < m.length; i += 16) {
3015
-
3016
- var aa = a,
3017
- bb = b,
3018
- cc = c,
3019
- dd = d;
3020
-
3021
- a = FF(a, b, c, d, m[i+ 0], 7, -680876936);
3022
- d = FF(d, a, b, c, m[i+ 1], 12, -389564586);
3023
- c = FF(c, d, a, b, m[i+ 2], 17, 606105819);
3024
- b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);
3025
- a = FF(a, b, c, d, m[i+ 4], 7, -176418897);
3026
- d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);
3027
- c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);
3028
- b = FF(b, c, d, a, m[i+ 7], 22, -45705983);
3029
- a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);
3030
- d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);
3031
- c = FF(c, d, a, b, m[i+10], 17, -42063);
3032
- b = FF(b, c, d, a, m[i+11], 22, -1990404162);
3033
- a = FF(a, b, c, d, m[i+12], 7, 1804603682);
3034
- d = FF(d, a, b, c, m[i+13], 12, -40341101);
3035
- c = FF(c, d, a, b, m[i+14], 17, -1502002290);
3036
- b = FF(b, c, d, a, m[i+15], 22, 1236535329);
3037
-
3038
- a = GG(a, b, c, d, m[i+ 1], 5, -165796510);
3039
- d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);
3040
- c = GG(c, d, a, b, m[i+11], 14, 643717713);
3041
- b = GG(b, c, d, a, m[i+ 0], 20, -373897302);
3042
- a = GG(a, b, c, d, m[i+ 5], 5, -701558691);
3043
- d = GG(d, a, b, c, m[i+10], 9, 38016083);
3044
- c = GG(c, d, a, b, m[i+15], 14, -660478335);
3045
- b = GG(b, c, d, a, m[i+ 4], 20, -405537848);
3046
- a = GG(a, b, c, d, m[i+ 9], 5, 568446438);
3047
- d = GG(d, a, b, c, m[i+14], 9, -1019803690);
3048
- c = GG(c, d, a, b, m[i+ 3], 14, -187363961);
3049
- b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);
3050
- a = GG(a, b, c, d, m[i+13], 5, -1444681467);
3051
- d = GG(d, a, b, c, m[i+ 2], 9, -51403784);
3052
- c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);
3053
- b = GG(b, c, d, a, m[i+12], 20, -1926607734);
3054
-
3055
- a = HH(a, b, c, d, m[i+ 5], 4, -378558);
3056
- d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);
3057
- c = HH(c, d, a, b, m[i+11], 16, 1839030562);
3058
- b = HH(b, c, d, a, m[i+14], 23, -35309556);
3059
- a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);
3060
- d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);
3061
- c = HH(c, d, a, b, m[i+ 7], 16, -155497632);
3062
- b = HH(b, c, d, a, m[i+10], 23, -1094730640);
3063
- a = HH(a, b, c, d, m[i+13], 4, 681279174);
3064
- d = HH(d, a, b, c, m[i+ 0], 11, -358537222);
3065
- c = HH(c, d, a, b, m[i+ 3], 16, -722521979);
3066
- b = HH(b, c, d, a, m[i+ 6], 23, 76029189);
3067
- a = HH(a, b, c, d, m[i+ 9], 4, -640364487);
3068
- d = HH(d, a, b, c, m[i+12], 11, -421815835);
3069
- c = HH(c, d, a, b, m[i+15], 16, 530742520);
3070
- b = HH(b, c, d, a, m[i+ 2], 23, -995338651);
3071
-
3072
- a = II(a, b, c, d, m[i+ 0], 6, -198630844);
3073
- d = II(d, a, b, c, m[i+ 7], 10, 1126891415);
3074
- c = II(c, d, a, b, m[i+14], 15, -1416354905);
3075
- b = II(b, c, d, a, m[i+ 5], 21, -57434055);
3076
- a = II(a, b, c, d, m[i+12], 6, 1700485571);
3077
- d = II(d, a, b, c, m[i+ 3], 10, -1894986606);
3078
- c = II(c, d, a, b, m[i+10], 15, -1051523);
3079
- b = II(b, c, d, a, m[i+ 1], 21, -2054922799);
3080
- a = II(a, b, c, d, m[i+ 8], 6, 1873313359);
3081
- d = II(d, a, b, c, m[i+15], 10, -30611744);
3082
- c = II(c, d, a, b, m[i+ 6], 15, -1560198380);
3083
- b = II(b, c, d, a, m[i+13], 21, 1309151649);
3084
- a = II(a, b, c, d, m[i+ 4], 6, -145523070);
3085
- d = II(d, a, b, c, m[i+11], 10, -1120210379);
3086
- c = II(c, d, a, b, m[i+ 2], 15, 718787259);
3087
- b = II(b, c, d, a, m[i+ 9], 21, -343485551);
3088
-
3089
- a = (a + aa) >>> 0;
3090
- b = (b + bb) >>> 0;
3091
- c = (c + cc) >>> 0;
3092
- d = (d + dd) >>> 0;
3093
- }
3094
-
3095
- return crypt$1.endian([a, b, c, d]);
3096
- };
3097
-
3098
- // Auxiliary functions
3099
- md5._ff = function (a, b, c, d, x, s, t) {
3100
- var n = a + (b & c | ~b & d) + (x >>> 0) + t;
3101
- return ((n << s) | (n >>> (32 - s))) + b;
3102
- };
3103
- md5._gg = function (a, b, c, d, x, s, t) {
3104
- var n = a + (b & d | c & ~d) + (x >>> 0) + t;
3105
- return ((n << s) | (n >>> (32 - s))) + b;
3106
- };
3107
- md5._hh = function (a, b, c, d, x, s, t) {
3108
- var n = a + (b ^ c ^ d) + (x >>> 0) + t;
3109
- return ((n << s) | (n >>> (32 - s))) + b;
3110
- };
3111
- md5._ii = function (a, b, c, d, x, s, t) {
3112
- var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;
3113
- return ((n << s) | (n >>> (32 - s))) + b;
3114
- };
3115
-
3116
- // Package private blocksize
3117
- md5._blocksize = 16;
3118
- md5._digestsize = 16;
3119
-
3120
- module.exports = function (message, options) {
3121
- if (message === undefined || message === null)
3122
- throw new Error('Illegal argument ' + message);
3123
-
3124
- var digestbytes = crypt$1.wordsToBytes(md5(message, options));
3125
- return options && options.asBytes ? digestbytes :
3126
- options && options.asString ? bin.bytesToString(digestbytes) :
3127
- crypt$1.bytesToHex(digestbytes);
3128
- };
3129
-
3130
- })();
3131
- });
3132
-
3133
2816
  var _this$1 = undefined;
3134
2817
 
3135
2818
  var config$1 = {
@@ -3174,7 +2857,7 @@ var findUser$1 = function () {
3174
2857
  break;
3175
2858
  }
3176
2859
 
3177
- hash = md5(password);
2860
+ hash = md5.md5(password);
3178
2861
  passwordsMatch = hash === user.password;
3179
2862
 
3180
2863
  if (passwordsMatch) {
@@ -3298,7 +2981,7 @@ var updateUser$1 = function () {
3298
2981
  break;
3299
2982
  }
3300
2983
 
3301
- hash = md5(data.password);
2984
+ hash = md5.md5(data.password);
3302
2985
 
3303
2986
  query = '\n update user \n set password = ?\n where user_id = ?\n ';
3304
2987
  _context2.next = 20;
@@ -3525,7 +3208,7 @@ var createUser$1 = function () {
3525
3208
  throw new Error('User already exists');
3526
3209
 
3527
3210
  case 13:
3528
- hash = md5(data.password);
3211
+ hash = md5.md5(data.password);
3529
3212
 
3530
3213
  // basic user info
3531
3214