pixl-server-storage 3.1.15 → 3.1.17
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/engines/S3.js +5 -3
- package/indexer.js +5 -0
- package/package.json +4 -4
- package/storage.js +1 -1
package/engines/S3.js
CHANGED
|
@@ -33,14 +33,15 @@ module.exports = Class.create({
|
|
|
33
33
|
var aws_config = this.storage.config.get('AWS') || this.server.config.get('AWS');
|
|
34
34
|
var s3_config = this.config.get();
|
|
35
35
|
|
|
36
|
-
this.logDebug(
|
|
37
|
-
this.logDebug(
|
|
36
|
+
this.logDebug(5, "Setting up Amazon S3 (" + aws_config.region + ")");
|
|
37
|
+
this.logDebug(6, "S3 Bucket ID: " + s3_config.params.Bucket);
|
|
38
38
|
|
|
39
39
|
this.keyPrefix = (s3_config.keyPrefix || '').replace(/^\//, '');
|
|
40
40
|
if (this.keyPrefix && !this.keyPrefix.match(/\/$/)) this.keyPrefix += '/';
|
|
41
41
|
|
|
42
42
|
this.keyTemplate = (s3_config.keyTemplate || '').replace(/^\//, '').replace(/\/$/, '');
|
|
43
43
|
this.fileExtensions = !!s3_config.fileExtensions;
|
|
44
|
+
this.pretty = !!s3_config.pretty;
|
|
44
45
|
|
|
45
46
|
// optional LRU cache
|
|
46
47
|
this.cache = null;
|
|
@@ -81,6 +82,7 @@ module.exports = Class.create({
|
|
|
81
82
|
delete combo_config.keyPrefix;
|
|
82
83
|
delete combo_config.keyTemplate;
|
|
83
84
|
delete combo_config.fileExtensions;
|
|
85
|
+
delete combo_config.pretty;
|
|
84
86
|
delete combo_config.cache;
|
|
85
87
|
|
|
86
88
|
this.s3Params = combo_config.params || {};
|
|
@@ -146,7 +148,7 @@ module.exports = Class.create({
|
|
|
146
148
|
}
|
|
147
149
|
else {
|
|
148
150
|
this.logDebug(9, "Storing S3 JSON Object: " + key, this.debugLevel(10) ? params.Body : null);
|
|
149
|
-
params.Body = JSON.stringify( params.Body );
|
|
151
|
+
params.Body = this.pretty ? JSON.stringify( params.Body, null, "\t" ) : JSON.stringify( params.Body );
|
|
150
152
|
params.ContentType = 'application/json';
|
|
151
153
|
}
|
|
152
154
|
|
package/indexer.js
CHANGED
|
@@ -975,6 +975,11 @@ module.exports = Class.create({
|
|
|
975
975
|
return value.replace(/\W+/g, '_').replace(/_+/g, '_');
|
|
976
976
|
},
|
|
977
977
|
|
|
978
|
+
filterWords_alphanum_array: function(value) {
|
|
979
|
+
// filter out everything except alphanum + underscore + comma, suitable for JSON arrays
|
|
980
|
+
return value.replace(/[\[\]\"\']+/g, '').replace(/[^\w\,]+/g, '_').replace(/_+/g, '_');
|
|
981
|
+
},
|
|
982
|
+
|
|
978
983
|
getWordList: function(value, def, config) {
|
|
979
984
|
// clean and filter text down to list of alphanumeric words
|
|
980
985
|
// return array of clean words
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pixl-server-storage",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.17",
|
|
4
4
|
"description": "A key/value/list storage component for the pixl-server framework.",
|
|
5
5
|
"author": "Joseph Huckaby <jhuckaby@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/jhuckaby/pixl-server-storage",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"sqlite"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@aws-sdk/client-s3": "3.
|
|
26
|
-
"@aws-sdk/lib-storage": "3.
|
|
27
|
-
"@smithy/node-http-handler": "2.
|
|
25
|
+
"@aws-sdk/client-s3": "3.414.0",
|
|
26
|
+
"@aws-sdk/lib-storage": "3.414.0",
|
|
27
|
+
"@smithy/node-http-handler": "2.1.4",
|
|
28
28
|
"async": "2.6.4",
|
|
29
29
|
"fast-stream-to-buffer": "1.0.0",
|
|
30
30
|
"he": "1.1.1",
|
package/storage.js
CHANGED
|
@@ -56,7 +56,7 @@ module.exports = Class.create({
|
|
|
56
56
|
startup: function(callback) {
|
|
57
57
|
// setup storage plugin
|
|
58
58
|
var self = this;
|
|
59
|
-
this.logDebug(
|
|
59
|
+
this.logDebug(5, "Setting up storage system v" + this.version);
|
|
60
60
|
|
|
61
61
|
// advisory locking system (in RAM, single process only)
|
|
62
62
|
this.locks = {};
|