cloudcms-server 3.2.321 → 3.2.324

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.
Files changed (100) hide show
  1. package/README.md +1 -7
  2. package/index.js +0 -17
  3. package/middleware/authentication/authentication.js +0 -5
  4. package/middleware/authentication/providers/saml.js +8 -4
  5. package/middleware/config/adapter.js +0 -44
  6. package/middleware/deployment/deployment.js +0 -10
  7. package/middleware/registration/registration.js +0 -5
  8. package/middleware/stores/engines/empty.js +0 -4
  9. package/middleware/stores/engines/fs-caching-adapter.js +0 -5
  10. package/middleware/stores/engines/fs.js +0 -9
  11. package/middleware/stores/engines/s3.js +0 -5
  12. package/middleware/stores/engines/s3fs.js +0 -5
  13. package/middleware/stores/multistore.js +0 -29
  14. package/middleware/stores/store.js +0 -9
  15. package/middleware/virtual-config/virtual-config.js +127 -124
  16. package/old_package.json +119 -0
  17. package/package.json +44 -55
  18. package/server/index.js +42 -81
  19. package/server/standalone.js +0 -5
  20. package/util/util.js +12 -6
  21. package/duster/helpers/core/cloudcms/associations.js +0 -34
  22. package/duster/helpers/core/cloudcms/beta/markdown.js +0 -46
  23. package/duster/helpers/core/cloudcms/beta/nodeAttachmentText.js +0 -46
  24. package/duster/helpers/core/cloudcms/beta/params.js +0 -33
  25. package/duster/helpers/core/cloudcms/beta/processTemplate.js +0 -82
  26. package/duster/helpers/core/cloudcms/content.js +0 -34
  27. package/duster/helpers/core/cloudcms/expand.js +0 -38
  28. package/duster/helpers/core/cloudcms/form.js +0 -34
  29. package/duster/helpers/core/cloudcms/query.js +0 -34
  30. package/duster/helpers/core/cloudcms/queryOne.js +0 -34
  31. package/duster/helpers/core/cloudcms/relatives.js +0 -34
  32. package/duster/helpers/core/cloudcms/search.js +0 -34
  33. package/duster/helpers/core/cloudcms/searchOne.js +0 -34
  34. package/duster/helpers/core/cloudcms/wcm/dependency.js +0 -83
  35. package/duster/helpers/core/cloudcms/wcm/fragment.js +0 -34
  36. package/duster/helpers/core/dev/debug.js +0 -42
  37. package/duster/helpers/core/dom/block.js +0 -49
  38. package/duster/helpers/core/dom/include.js +0 -38
  39. package/duster/helpers/core/dom/layout.js +0 -49
  40. package/duster/helpers/core/dom/link.js +0 -81
  41. package/duster/helpers/core/dom/resource.js +0 -77
  42. package/duster/helpers/core/engine.js +0 -1580
  43. package/duster/helpers/core/ice/value.js +0 -65
  44. package/duster/helpers/core/index.js +0 -49
  45. package/duster/helpers/core/operators/if.js +0 -64
  46. package/duster/helpers/core/operators/iter.js +0 -45
  47. package/duster/helpers/core/operators/iterate.js +0 -129
  48. package/duster/helpers/sample/nyt.js +0 -114
  49. package/duster/index.js +0 -319
  50. package/duster/support.js +0 -436
  51. package/duster/tracker.js +0 -262
  52. package/middleware/authentication/providers/cas.js +0 -73
  53. package/middleware/authentication/providers/facebook.js +0 -120
  54. package/middleware/authentication/providers/github.js +0 -88
  55. package/middleware/authentication/providers/linkedin.js +0 -112
  56. package/middleware/authentication/providers/twitter.js +0 -120
  57. package/middleware/server-tags/server-tags.js +0 -113
  58. package/middleware/wcm/wcm.js +0 -1437
  59. package/temp/clusterlock/README.md +0 -6
  60. package/temp/clusterlock/index.js +0 -198
  61. package/temp/clusterlock/package.json +0 -24
  62. package/temp/passport-saml/LICENSE +0 -23
  63. package/temp/passport-saml/README.md +0 -406
  64. package/temp/passport-saml/lib/node-saml/algorithms.d.ts +0 -5
  65. package/temp/passport-saml/lib/node-saml/algorithms.js +0 -41
  66. package/temp/passport-saml/lib/node-saml/algorithms.js.map +0 -1
  67. package/temp/passport-saml/lib/node-saml/index.d.ts +0 -3
  68. package/temp/passport-saml/lib/node-saml/index.js +0 -6
  69. package/temp/passport-saml/lib/node-saml/index.js.map +0 -1
  70. package/temp/passport-saml/lib/node-saml/inmemory-cache-provider.d.ts +0 -45
  71. package/temp/passport-saml/lib/node-saml/inmemory-cache-provider.js +0 -86
  72. package/temp/passport-saml/lib/node-saml/inmemory-cache-provider.js.map +0 -1
  73. package/temp/passport-saml/lib/node-saml/saml-post-signing.d.ts +0 -3
  74. package/temp/passport-saml/lib/node-saml/saml-post-signing.js +0 -15
  75. package/temp/passport-saml/lib/node-saml/saml-post-signing.js.map +0 -1
  76. package/temp/passport-saml/lib/node-saml/saml.d.ts +0 -77
  77. package/temp/passport-saml/lib/node-saml/saml.js +0 -1170
  78. package/temp/passport-saml/lib/node-saml/saml.js.map +0 -1
  79. package/temp/passport-saml/lib/node-saml/types.d.ts +0 -95
  80. package/temp/passport-saml/lib/node-saml/types.js +0 -8
  81. package/temp/passport-saml/lib/node-saml/types.js.map +0 -1
  82. package/temp/passport-saml/lib/node-saml/utility.d.ts +0 -3
  83. package/temp/passport-saml/lib/node-saml/utility.js +0 -19
  84. package/temp/passport-saml/lib/node-saml/utility.js.map +0 -1
  85. package/temp/passport-saml/lib/node-saml/xml.d.ts +0 -21
  86. package/temp/passport-saml/lib/node-saml/xml.js +0 -140
  87. package/temp/passport-saml/lib/node-saml/xml.js.map +0 -1
  88. package/temp/passport-saml/lib/passport-saml/index.d.ts +0 -6
  89. package/temp/passport-saml/lib/passport-saml/index.js +0 -11
  90. package/temp/passport-saml/lib/passport-saml/index.js.map +0 -1
  91. package/temp/passport-saml/lib/passport-saml/multiSamlStrategy.d.ts +0 -13
  92. package/temp/passport-saml/lib/passport-saml/multiSamlStrategy.js +0 -63
  93. package/temp/passport-saml/lib/passport-saml/multiSamlStrategy.js.map +0 -1
  94. package/temp/passport-saml/lib/passport-saml/strategy.d.ts +0 -20
  95. package/temp/passport-saml/lib/passport-saml/strategy.js +0 -167
  96. package/temp/passport-saml/lib/passport-saml/strategy.js.map +0 -1
  97. package/temp/passport-saml/lib/passport-saml/types.d.ts +0 -51
  98. package/temp/passport-saml/lib/passport-saml/types.js +0 -11
  99. package/temp/passport-saml/lib/passport-saml/types.js.map +0 -1
  100. package/temp/passport-saml/package.json +0 -96
@@ -0,0 +1,119 @@
1
+ {
2
+ "author": {
3
+ "name": "Gitana Software, Inc.",
4
+ "email": "info@gitana.io",
5
+ "url": "https://gitana.io"
6
+ },
7
+ "name": "cloudcms-server",
8
+ "description": "Cloud CMS Application Server Module",
9
+ "version": "3.2.323",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git://github.com/gitana/cloudcms-server.git"
13
+ },
14
+ "dependencies": {
15
+ "@socket.io/cluster-adapter": "^0.2.2",
16
+ "@socket.io/redis-adapter": "^8.3.0",
17
+ "@socket.io/sticky": "^1.0.4",
18
+ "accepts": "^1.3.8",
19
+ "agentkeepalive": "^4.5.0",
20
+ "alpaca": "^1.5.27",
21
+ "archiver": "^7.0.1",
22
+ "async": "^3.2.6",
23
+ "async-lock": "^1.4.1",
24
+ "aws-sdk": "^2.1692.0",
25
+ "axios": "^1.7.9",
26
+ "basic-auth": "^2.0.1",
27
+ "body-parser": "^1.20.3",
28
+ "bytes": "^3.1.2",
29
+ "cacheable-lookup": "^6.1.0",
30
+ "canoe": "^0.3.3",
31
+ "clone": "^2.1.2",
32
+ "connect-flash": "^0.1.1",
33
+ "connect-multiparty": "^2.2.0",
34
+ "connect-redis": "^8.0.1",
35
+ "cookie-parser": "^1.4.7",
36
+ "debug": "^4.4.0",
37
+ "errorhandler": "^1.5.1",
38
+ "express": "^4.21.2",
39
+ "express-session": "^1.18.1",
40
+ "express-useragent": "^1.0.15",
41
+ "fast-proxy": "^2.2.0",
42
+ "gitana": "^1.0.330",
43
+ "handlebars": "^4.7.8",
44
+ "hbs": "^4.2.0",
45
+ "helmet": "^8.0.0",
46
+ "ioredis": "5.4.1",
47
+ "json5": "^2.2.3",
48
+ "jsonwebtoken": "^9.0.2",
49
+ "klaw": "^4.1.0",
50
+ "lru-cache": "^7.14.0",
51
+ "marked": "^15.0.4",
52
+ "memored": "^1.1.1",
53
+ "memorystore": "^1.6.4",
54
+ "mime": "^2.4.6",
55
+ "moment": "^2.30.1",
56
+ "morgan": "^1.10.0",
57
+ "object-hash": "^3.0.0",
58
+ "object-merge": "^2.5.1",
59
+ "on-headers": "^1.0.2",
60
+ "passport": "^0.7.0",
61
+ "passport-cas": "^0.1.1",
62
+ "passport-facebook": "^3.0.0",
63
+ "passport-github": "^1.1.0",
64
+ "passport-google-oauth": "^2.0.0",
65
+ "passport-linkedin": "^1.0.0",
66
+ "passport-local": "^1.0.0",
67
+ "passport-oauth": "^1.0.0",
68
+ "passport-saml": "^2.2.0",
69
+ "passport-twitter": "^1.0.4",
70
+ "random-js": "^2.1.0",
71
+ "recursive-readdir": "^2.2.3",
72
+ "redis": "^4.7.0",
73
+ "redlock": "4.2.0",
74
+ "request-param": "^1.0.1",
75
+ "response-time": "^2.3.3",
76
+ "semver": "^7.6.3",
77
+ "serve-favicon": "^2.5.0",
78
+ "session-file-store": "^1.5.0",
79
+ "sha1": "^1.1.1",
80
+ "socket.io": "^4.8.1",
81
+ "ssl-root-cas": "^1.3.1",
82
+ "stomp-client": "^0.9.0",
83
+ "targz": "^1.0.1",
84
+ "temp": "^0.9.4",
85
+ "uuid": "^11.0.3",
86
+ "vm2": "^3.9.19",
87
+ "watch": "^1.0.2",
88
+ "winston": "^3.17.0"
89
+ },
90
+ "contributors": [
91
+ {
92
+ "name": "Michael Uzquiano",
93
+ "email": "uzi@cloudcms.com"
94
+ },
95
+ {
96
+ "name": "Harry Moore",
97
+ "email": "harry.moore@cloudcms.com"
98
+ }
99
+ ],
100
+ "keywords": [
101
+ "wcm",
102
+ "web",
103
+ "cloudcms",
104
+ "cms",
105
+ "content",
106
+ "json",
107
+ "rest",
108
+ "mobile",
109
+ "content management",
110
+ "javascript",
111
+ "nodejs",
112
+ "api",
113
+ "jsoncms",
114
+ "baas",
115
+ "caching",
116
+ "renditions"
117
+ ],
118
+ "main": "index"
119
+ }
package/package.json CHANGED
@@ -6,92 +6,81 @@
6
6
  },
7
7
  "name": "cloudcms-server",
8
8
  "description": "Cloud CMS Application Server Module",
9
- "version": "3.2.321",
9
+ "version": "3.2.324",
10
10
  "repository": {
11
11
  "type": "git",
12
12
  "url": "git://github.com/gitana/cloudcms-server.git"
13
13
  },
14
14
  "dependencies": {
15
- "@socket.io/cluster-adapter": "^0.2.0",
16
- "@socket.io/redis-adapter": "^7.2.0",
17
- "@socket.io/sticky": "^1.0.1",
15
+ "@socket.io/cluster-adapter": "^0.2.2",
16
+ "@socket.io/redis-adapter": "^8.3.0",
17
+ "@socket.io/sticky": "^1.0.4",
18
18
  "accepts": "^1.3.8",
19
19
  "agentkeepalive": "^4.5.0",
20
20
  "alpaca": "^1.5.27",
21
- "archiver": "^1.3.0",
22
- "async": "^3.2.3",
21
+ "archiver": "^7.0.1",
22
+ "async": "^3.2.6",
23
23
  "async-lock": "^1.4.1",
24
- "aws-sdk": "^2.1208.0",
25
- "axios": "^1.5.0",
24
+ "aws-sdk": "^2.1692.0",
25
+ "axios": "^1.7.9",
26
26
  "basic-auth": "^2.0.1",
27
- "body-parser": "^1.20.0",
28
- "bytes": "^2.5.0",
27
+ "body-parser": "^1.20.3",
28
+ "bytes": "^3.1.2",
29
29
  "cacheable-lookup": "^6.1.0",
30
30
  "canoe": "^0.3.3",
31
31
  "clone": "^2.1.2",
32
32
  "connect-flash": "^0.1.1",
33
33
  "connect-multiparty": "^2.2.0",
34
- "connect-redis": "^6.1.3",
35
- "consolidate": "^0.14.5",
36
- "cookie-parser": "^1.4.4",
37
- "debug": "^2.6.9",
38
- "dustjs-helpers": "1.7.4",
39
- "dustjs-linkedin": "3.0.1",
34
+ "connect-redis": "^8.0.1",
35
+ "cookie-parser": "^1.4.7",
36
+ "debug": "^4.4.0",
40
37
  "errorhandler": "^1.5.1",
41
- "express": "^4.18.2",
42
- "express-session": "^1.17.3",
38
+ "express": "^4.21.2",
39
+ "express-session": "^1.18.1",
43
40
  "express-useragent": "^1.0.15",
44
- "extend-with-super": "^2.0.0",
45
41
  "fast-proxy": "^2.2.0",
46
- "gitana": "^1.0.326",
47
- "handlebars": "^4.4.2",
48
- "hbs": "^4.0.5",
49
- "helmet": "^4.6.0",
50
- "ioredis": "4.28.5",
51
- "json5": "^1.0.1",
52
- "jsonwebtoken": "^8.5.1",
53
- "klaw": "^1.3.1",
42
+ "gitana": "^1.0.330",
43
+ "handlebars": "^4.7.8",
44
+ "hbs": "^4.2.0",
45
+ "helmet": "^8.0.0",
46
+ "ioredis": "5.4.1",
47
+ "isolated-vm": "5.0.3",
48
+ "json5": "^2.2.3",
49
+ "jsonwebtoken": "^9.0.2",
50
+ "klaw": "^4.1.0",
54
51
  "lru-cache": "^7.14.0",
55
- "marked": "^4.0.14",
52
+ "marked": "^15.0.4",
56
53
  "memored": "^1.1.1",
57
- "memorystore": "^1.6.1",
58
- "mime": "^1.6.0",
59
- "mkdirp": "^0.5.1",
60
- "moment": "^2.24.0",
61
- "morgan": "^1.9.1",
62
- "object-hash": "^1.3.1",
54
+ "memorystore": "^1.6.4",
55
+ "mime": "^2.4.6",
56
+ "moment": "^2.30.1",
57
+ "morgan": "^1.10.0",
58
+ "object-hash": "^3.0.0",
63
59
  "object-merge": "^2.5.1",
64
60
  "on-headers": "^1.0.2",
65
- "passport": "^0.4.0",
66
- "passport-cas": "^0.0.3",
67
- "passport-facebook": "^2.1.1",
68
- "passport-github": "^1.1.0",
69
- "passport-google-oauth": "^1.0.0",
70
- "passport-linkedin": "^1.0.0",
61
+ "passport": "^0.7.0",
62
+ "passport-google-oauth": "^2.0.0",
71
63
  "passport-local": "^1.0.0",
72
64
  "passport-oauth": "^1.0.0",
73
- "passport-saml": "^2.2.0",
74
- "passport-twitter": "^0.1.5",
75
- "pkginfo": "^0.4.1",
76
- "random-js": "^1.0.8",
77
- "recursive-readdir": "^2.2.2",
78
- "redis": "^4.2.0",
65
+ "@node-saml/passport-saml": "5.0.0",
66
+ "random-js": "^2.1.0",
67
+ "recursive-readdir": "^2.2.3",
68
+ "redis": "^4.7.0",
79
69
  "redlock": "4.2.0",
80
70
  "request-param": "^1.0.1",
81
- "response-time": "^2.3.2",
82
- "semver": "^7.3.7",
71
+ "response-time": "^2.3.3",
72
+ "semver": "^7.6.3",
83
73
  "serve-favicon": "^2.5.0",
84
- "session-file-store": "^0.2.2",
74
+ "session-file-store": "^1.5.0",
85
75
  "sha1": "^1.1.1",
86
- "socket.io": "^4.5.1",
76
+ "socket.io": "^4.8.1",
87
77
  "ssl-root-cas": "^1.3.1",
88
78
  "stomp-client": "^0.9.0",
89
79
  "targz": "^1.0.1",
90
- "temp": "^0.8.3",
91
- "uuid": "^3.3.2",
92
- "vm2": "^3.8.4",
93
- "watch": "^0.13.0",
94
- "winston": "^3.3.3"
80
+ "temp": "^0.9.4",
81
+ "uuid": "^11.0.3",
82
+ "underscore": "^1.13.7",
83
+ "winston": "^3.17.0"
95
84
  },
96
85
  "contributors": [
97
86
  {
package/server/index.js CHANGED
@@ -33,11 +33,6 @@ var requestParam = require("request-param")();
33
33
  // cloudcms app server support
34
34
  var main = require("../index");
35
35
 
36
- // duster service
37
- var duster = require("../duster/index");
38
-
39
- var coreHelpers = require("../duster/helpers/core/index");
40
-
41
36
  var helmet = require("helmet");
42
37
 
43
38
  var responseTime = require("response-time");
@@ -71,7 +66,6 @@ var SETTINGS = {
71
66
  "beforeFunctions": [],
72
67
  "afterFunctions": [],
73
68
  "reportFunctions": [],
74
- "dustFunctions": [],
75
69
  "initFunctions": [],
76
70
  "filterFunctions": [],
77
71
  "driverFunctions": [],
@@ -175,11 +169,6 @@ var SETTINGS = {
175
169
  "modules": "hosts_s3fs"
176
170
  }
177
171
  },
178
- "duster": {
179
- "fragments": {
180
- "cache": true
181
- }
182
- },
183
172
  "virtualHost": {
184
173
  "enabled": false
185
174
  },
@@ -317,9 +306,6 @@ var SETTINGS = {
317
306
  }
318
307
  };
319
308
 
320
- // always push core tag helpers to the front
321
- SETTINGS.dustFunctions.unshift(coreHelpers);
322
-
323
309
  // if SETTINGS.errorFunctions is empty, plug in a default error handler
324
310
  if (SETTINGS.errorFunctions.length === 0)
325
311
  {
@@ -441,17 +427,6 @@ exports.error = function (fn) {
441
427
  SETTINGS.errorFunctions.push(fn);
442
428
  };
443
429
 
444
- /**
445
- * Adds an initialization function to set up dust.
446
- *
447
- * The function must have signature fn(app, dust)
448
- *
449
- * @param helperFn
450
- */
451
- var dust = exports.dust = function(fn) {
452
- SETTINGS.dustFunctions.push(fn);
453
- };
454
-
455
430
  /**
456
431
  * Registers a function to run before the server starts.
457
432
  *
@@ -821,7 +796,6 @@ var startServer = function(config, startServerFinishedFn)
821
796
  //
822
797
  // BASE CONFIGURATION
823
798
  //
824
- // Configures NodeJS app server using dustjs templating engine
825
799
  // Runs on port 3000 by default
826
800
  //
827
801
  ////////////////////////////////////////////////////////////////////////////
@@ -830,16 +804,7 @@ var startServer = function(config, startServerFinishedFn)
830
804
  app.set('port', process.env.PORT);
831
805
  app.set('views', process.env.CLOUDCMS_APPSERVER_BASE_PATH + "/views");
832
806
 
833
- if (config.viewEngine === "dust")
834
- {
835
- var cons = require('consolidate');
836
-
837
- app.set('view engine', 'html');
838
- app.set('view engine', 'dust');
839
- app.engine('html', cons.dust);
840
- app.engine('dust', cons.dust);
841
- }
842
- else if (config.viewEngine === "handlebars" || config.viewEngine === "hbs")
807
+ if (config.viewEngine === "handlebars" || config.viewEngine === "hbs")
843
808
  {
844
809
  var hbs = require('hbs');
845
810
 
@@ -1359,52 +1324,48 @@ var configureServer = function(config, app, httpServer, configureServerFinishedF
1359
1324
  // SET INITIAL VALUE FOR SERVER TIMESTAMP
1360
1325
  process.env.CLOUDCMS_APPSERVER_TIMESTAMP = Date.now();
1361
1326
 
1362
- // DUST
1363
- runFunctions(config.dustFunctions, [app, duster.getDust()], function (err) {
1364
-
1365
- // APPLY SERVER BEFORE START FUNCTIONS
1366
- runFunctions(config.beforeFunctions, [app], function (err) {
1367
-
1368
- // AFTER SERVER START
1369
- runFunctions(config.afterFunctions, [app], function (err) {
1370
-
1371
- function cleanup() {
1372
-
1373
- if (cluster.isMaster)
1374
- {
1375
- console.log("");
1376
- console.log("");
1377
-
1378
- console.log("Cloud CMS Module shutting down");
1379
-
1380
- // close server connections as cleanly as we can
1381
- console.log(" -> Closing server connections");
1382
- }
1383
-
1384
- try
1385
- {
1386
- httpServer.close();
1387
- }
1388
- catch (e)
1389
- {
1390
- console.log("Server.close produced error: " + JSON.stringify(e));
1391
- }
1392
-
1393
- if (cluster.isMaster)
1394
- {
1395
- console.log("");
1396
- }
1397
-
1398
- // tell the process to exit
1399
- process.exit();
1327
+ // APPLY SERVER BEFORE START FUNCTIONS
1328
+ runFunctions(config.beforeFunctions, [app], function (err) {
1329
+
1330
+ // AFTER SERVER START
1331
+ runFunctions(config.afterFunctions, [app], function (err) {
1332
+
1333
+ function cleanup() {
1334
+
1335
+ if (cluster.isMaster)
1336
+ {
1337
+ console.log("");
1338
+ console.log("");
1339
+
1340
+ console.log("Cloud CMS Module shutting down");
1341
+
1342
+ // close server connections as cleanly as we can
1343
+ console.log(" -> Closing server connections");
1400
1344
  }
1401
-
1402
- // listen for kill or interrupt so that we can shut down cleanly
1403
- process.on('SIGINT', cleanup);
1404
- process.on('SIGTERM', cleanup);
1405
-
1406
- configureServerFinishedFn();
1407
- });
1345
+
1346
+ try
1347
+ {
1348
+ httpServer.close();
1349
+ }
1350
+ catch (e)
1351
+ {
1352
+ console.log("Server.close produced error: " + JSON.stringify(e));
1353
+ }
1354
+
1355
+ if (cluster.isMaster)
1356
+ {
1357
+ console.log("");
1358
+ }
1359
+
1360
+ // tell the process to exit
1361
+ process.exit();
1362
+ }
1363
+
1364
+ // listen for kill or interrupt so that we can shut down cleanly
1365
+ process.on('SIGINT', cleanup);
1366
+ process.on('SIGTERM', cleanup);
1367
+
1368
+ configureServerFinishedFn();
1408
1369
  });
1409
1370
  });
1410
1371
  };
@@ -104,11 +104,6 @@ server.start({
104
104
  },
105
105
  "insight": {
106
106
  "enabled": true
107
- },
108
- "duster": {
109
- "fragments": {
110
- "cache": true
111
- }
112
107
  }
113
108
  }, function() {
114
109
  // all done
package/util/util.js CHANGED
@@ -1,8 +1,10 @@
1
+ var mime = require("mime");
2
+ const { v4: uuidv4 } = require("uuid");
3
+
1
4
  var fs = require("fs");
2
5
  var path = require("path");
3
- var mkdirp = require('mkdirp');
4
- var mime = require("mime");
5
- var uuidv4 = require("uuid/v4");
6
+ //var mime = require("mime");
7
+ //var uuidv4 = require("uuid/v4");
6
8
  var os = require("os");
7
9
  var async = require("async");
8
10
  var temp = require("temp");
@@ -544,7 +546,9 @@ var rmdir = exports.rmdir = function(directoryPath)
544
546
 
545
547
  var mkdirs = exports.mkdirs = function(directoryPath, callback)
546
548
  {
547
- mkdirp(directoryPath, function(err) {
549
+ fs.mkdir(directoryPath, {
550
+ recursive: true
551
+ }, function(err) {
548
552
  callback(err);
549
553
  });
550
554
  };
@@ -1205,7 +1209,9 @@ var handleSendFileError = exports.handleSendFileError = function(req, res, fileP
1205
1209
 
1206
1210
  var createDirectory = exports.createDirectory = function(directoryPath, callback)
1207
1211
  {
1208
- mkdirp(directoryPath, function(err) {
1212
+ fs.mkdir(directoryPath, {
1213
+ "recursive": true
1214
+ }, function(err) {
1209
1215
 
1210
1216
  if (err) {
1211
1217
  return callback(err);
@@ -1376,7 +1382,7 @@ var isUndefined = exports.isUndefined = function(obj) {
1376
1382
  var lookupMimeType = exports.lookupMimeType = function(ext) {
1377
1383
 
1378
1384
  // rely on the mimetype library for base handling
1379
- var mimetype = mime.lookup(ext);
1385
+ var mimetype = mime.getType(ext);
1380
1386
 
1381
1387
  var extension = ext;
1382
1388
  if (extension && extension.indexOf(".") === 0)
@@ -1,34 +0,0 @@
1
- /**
2
- * @associations
3
- *
4
- * @param app
5
- * @param dust
6
- * @param callback
7
- */
8
- module.exports = function(app, dust, callback)
9
- {
10
- var engine = require("../engine")(app, dust);
11
-
12
- /**
13
- * ASSOCIATIONS
14
- *
15
- * Finds associations around a node.
16
- *
17
- * Syntax:
18
- *
19
- * {@associations node="<nodeId>" type="<association_type>" limit="" skip="" as=""}
20
- * {+templateIdentifier/}
21
- * {/associations}
22
- *
23
- * @param chunk
24
- * @param context
25
- * @param bodies
26
- * @param params
27
- */
28
- dust.helpers.associations = function(chunk, context, bodies, params)
29
- {
30
- return engine.handleAssociations(chunk, context, bodies, params);
31
- };
32
-
33
- callback();
34
- };
@@ -1,46 +0,0 @@
1
- var marked = require("marked");
2
- marked.setOptions({
3
- renderer: new marked.Renderer(),
4
- gfm: true,
5
- tables: true,
6
- breaks: false,
7
- pedantic: false,
8
- sanitize: true,
9
- smartLists: true,
10
- smartypants: false
11
- });
12
-
13
- /**
14
- * @markdown
15
- *
16
- * @param app
17
- * @param dust
18
- * @param callback
19
- */
20
- module.exports = function(app, dust, callback)
21
- {
22
- /**
23
- * Renders markdown into the Dust template.
24
- *
25
- * @param chunk
26
- * @param context
27
- * @param bodies
28
- * @param params
29
- * @returns {*}
30
- */
31
- dust.helpers.markdown = function(chunk, context, bodies, params) {
32
-
33
- params = params || {};
34
-
35
- var text = context.resolve(params.text);
36
- if (!text) {
37
- return chunk;
38
- }
39
-
40
- text = marked(text);
41
-
42
- return chunk.write(text);
43
- };
44
-
45
- callback();
46
- };
@@ -1,46 +0,0 @@
1
- /**
2
- * @nodeAttachmentText
3
- *
4
- * @param app
5
- * @param dust
6
- * @param callback
7
- */
8
- module.exports = function(app, dust, callback)
9
- {
10
- var engine = require("../../engine")(app, dust);
11
-
12
- var map = engine.map;
13
- var end = engine.end;
14
-
15
- dust.helpers.nodeAttachmentText = dust.helpers.nodeAttachmentValue = function(chunk, context, bodies, params)
16
- {
17
- params = params || {};
18
-
19
- var nodeId = context.resolve(params.node);
20
- var attachmentId = context.resolve(params.attachment);
21
- if (!attachmentId)
22
- {
23
- attachmentId = "default";
24
- }
25
-
26
- return map(chunk, function(chunk) {
27
-
28
- var req = context.get("req");
29
- req.branch(function(err, branch) {
30
-
31
- if (err) {
32
- return end(chunk, context);
33
- }
34
-
35
- branch.readNode(nodeId).attachment(attachmentId).download(function(text) {
36
-
37
- chunk.write(text);
38
-
39
- end(chunk, context);
40
- });
41
- });
42
- });
43
- };
44
-
45
- callback();
46
- };
@@ -1,33 +0,0 @@
1
- /**
2
- * @params
3
- *
4
- * @param app
5
- * @param dust
6
- * @param callback
7
- */
8
- module.exports = function(app, dust, callback)
9
- {
10
- /**
11
- * Allows parameters to be passed into blocks or partials
12
- */
13
- dust.helpers.params = function( chunk, context, bodies, params ){
14
-
15
- var partial = {};
16
- if( params)
17
- {
18
- for (var key in params)
19
- {
20
- partial[key] = params[key];
21
- }
22
- }
23
-
24
- // render
25
- var newContext = context.push(partial);
26
-
27
- //return bodies.block(chunk, dust.makeBase(partial))
28
- return bodies.block(chunk, newContext);
29
- };
30
- dust.helpers.parameters = dust.helpers.params;
31
-
32
- callback();
33
- };