cloudcms-server 3.3.1-beta.9 → 4.0.0-beta.10
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/LICENSE +1 -1
- package/README.md +1 -1
- package/broadcast/broadcast.js +6 -3
- package/broadcast/providers/redis.js +24 -49
- package/clients/nrp.js +117 -0
- package/clients/redis.js +64 -0
- package/cloudcms-server.iml +1 -0
- package/d1/index.js +629 -0
- package/d1/index.js.works +203 -0
- package/d1/package.json +86 -0
- package/d1/package.json.works +14 -0
- package/duster/helpers/sample/nyt.js +2 -1
- package/framework/controllers.js +4 -4
- package/index.js +21 -14
- package/insight/insight.js +1 -1
- package/launchpad/index.js +203 -11
- package/launchpad/launchers/cluster.js +103 -110
- package/launchpad/launchers/redis.js +70 -0
- package/launchpad/launchers/single.js +36 -22
- package/locks/locks.js +63 -9
- package/locks/providers/cluster.js +3 -1
- package/locks/providers/memory.js +10 -7
- package/locks/providers/redis.js +62 -82
- package/middleware/admin/admin.js +3 -3
- package/middleware/authentication/adapters/session.js +11 -8
- package/middleware/authentication/authentication.js +28 -16
- package/middleware/authentication/authenticators/default.js +5 -2
- package/middleware/authentication/authenticators/session.js +5 -2
- package/middleware/authentication/providers/saml.js +2 -2
- package/middleware/authorization/authorization.js +11 -8
- package/middleware/awareness/awareness.js +63 -38
- package/middleware/awareness/plugins/api_event.js +105 -0
- package/middleware/awareness/plugins/editorial.js +8 -7
- package/middleware/awareness/plugins/resources.js +13 -5
- package/middleware/awareness/providers/abstract-async.js +107 -84
- package/middleware/awareness/providers/abstract.js +1 -1
- package/middleware/awareness/providers/memory.js +0 -14
- package/middleware/awareness/providers/redis.js +186 -279
- package/middleware/cache/cache.js +4 -2
- package/middleware/cache/providers/redis.js +127 -89
- package/middleware/cache/providers/shared-memory.js +3 -3
- package/middleware/cloudcms/cloudcms.js +22 -16
- package/middleware/driver-config/driver-config.js +0 -6
- package/middleware/form/form.js +3 -3
- package/middleware/modules/modules.js +17 -8
- package/middleware/perf/perf.js +3 -2
- package/middleware/proxy/proxy.js +8 -21
- package/middleware/stores/store.js +0 -1
- package/middleware/stores/stores.js +4 -4
- package/middleware/virtual-config/virtual-config.js +11 -11
- package/middleware/virtual-files/virtual-files.js +0 -3
- package/middleware/wcm/wcm.js +4 -4
- package/middleware/welcome/welcome.js +0 -3
- package/notifications/notifications.js +74 -12
- package/notifications/providers/kafka.js +182 -0
- package/notifications/providers/stomp.js +4 -0
- package/package.json +33 -30
- package/server/index.js +508 -416
- package/server/standalone.js +9 -0
- package/temp/clusterlock/index.js +3 -3
- package/temp/clusterlock/package.json +1 -1
- package/temp/passport-saml/LICENSE +23 -0
- package/temp/passport-saml/README.md +406 -0
- package/temp/passport-saml/lib/node-saml/algorithms.d.ts +5 -0
- package/temp/passport-saml/lib/node-saml/algorithms.js +41 -0
- package/temp/passport-saml/lib/node-saml/algorithms.js.map +1 -0
- package/temp/passport-saml/lib/node-saml/index.d.ts +3 -0
- package/temp/passport-saml/lib/node-saml/index.js +6 -0
- package/temp/passport-saml/lib/node-saml/index.js.map +1 -0
- package/temp/passport-saml/lib/node-saml/inmemory-cache-provider.d.ts +45 -0
- package/temp/passport-saml/lib/node-saml/inmemory-cache-provider.js +86 -0
- package/temp/passport-saml/lib/node-saml/inmemory-cache-provider.js.map +1 -0
- package/temp/passport-saml/lib/node-saml/saml-post-signing.d.ts +3 -0
- package/temp/passport-saml/lib/node-saml/saml-post-signing.js +15 -0
- package/temp/passport-saml/lib/node-saml/saml-post-signing.js.map +1 -0
- package/temp/passport-saml/lib/node-saml/saml.d.ts +77 -0
- package/temp/passport-saml/lib/node-saml/saml.js +1170 -0
- package/temp/passport-saml/lib/node-saml/saml.js.map +1 -0
- package/temp/passport-saml/lib/node-saml/types.d.ts +95 -0
- package/temp/passport-saml/lib/node-saml/types.js +8 -0
- package/temp/passport-saml/lib/node-saml/types.js.map +1 -0
- package/temp/passport-saml/lib/node-saml/utility.d.ts +3 -0
- package/temp/passport-saml/lib/node-saml/utility.js +19 -0
- package/temp/passport-saml/lib/node-saml/utility.js.map +1 -0
- package/temp/passport-saml/lib/node-saml/xml.d.ts +21 -0
- package/temp/passport-saml/lib/node-saml/xml.js +140 -0
- package/temp/passport-saml/lib/node-saml/xml.js.map +1 -0
- package/temp/passport-saml/lib/passport-saml/index.d.ts +6 -0
- package/temp/passport-saml/lib/passport-saml/index.js +11 -0
- package/temp/passport-saml/lib/passport-saml/index.js.map +1 -0
- package/temp/passport-saml/lib/passport-saml/multiSamlStrategy.d.ts +13 -0
- package/temp/passport-saml/lib/passport-saml/multiSamlStrategy.js +63 -0
- package/temp/passport-saml/lib/passport-saml/multiSamlStrategy.js.map +1 -0
- package/temp/passport-saml/lib/passport-saml/strategy.d.ts +20 -0
- package/temp/passport-saml/lib/passport-saml/strategy.js +167 -0
- package/temp/passport-saml/lib/passport-saml/strategy.js.map +1 -0
- package/temp/passport-saml/lib/passport-saml/types.d.ts +51 -0
- package/temp/passport-saml/lib/passport-saml/types.js +11 -0
- package/temp/passport-saml/lib/passport-saml/types.js.map +1 -0
- package/temp/passport-saml/package.json +96 -0
- package/util/auth.js +16 -10
- package/util/cloudcms.js +108 -120
- package/util/proxy-factory.js +103 -237
- package/util/redis.js +113 -0
- package/util/renditions.js +12 -6
- package/util/request.js +12 -6
- package/util/util.js +16 -2
- package/.last_command +0 -7
- package/launchpad/launchers/sticky-cluster.js +0 -43
- package/temp/memored/.jshintrc +0 -4
- package/temp/memored/README.md +0 -240
- package/temp/memored/demo/demo1.js +0 -37
- package/temp/memored/demo/demo2.js +0 -32
- package/temp/memored/gulpfile.js +0 -8
- package/temp/memored/index.js +0 -343
- package/temp/memored/package.json +0 -54
- package/temp/memored/spec/memored.spec.js +0 -265
- package/web/cms/ice.js +0 -109
- package/web/cms/preview.js +0 -106
package/middleware/wcm/wcm.js
CHANGED
|
@@ -309,7 +309,7 @@ exports = module.exports = function()
|
|
|
309
309
|
req.application(function (err, application) {
|
|
310
310
|
|
|
311
311
|
var loadingPagesCacheKey = application._doc + "-wcm-loading-pages";
|
|
312
|
-
_LOCK(null, loadingPagesCacheKey, function (releaseLockFn) {
|
|
312
|
+
_LOCK(null, loadingPagesCacheKey, function (err, releaseLockFn) {
|
|
313
313
|
|
|
314
314
|
// check again inside lock in case another request preloaded this before we arrived
|
|
315
315
|
req.cache.read(WCM_PAGES, function (err, cachedPages) {
|
|
@@ -716,7 +716,7 @@ exports = module.exports = function()
|
|
|
716
716
|
var cacheFilePath = cloudcms.toCacheFilePath(pageFilePath);
|
|
717
717
|
|
|
718
718
|
// take out a lock so that only one "request" can write to cache at a time for this path
|
|
719
|
-
_LOCK(contentStore, _lock_identifier(pageBasePath), function(releaseLockFn) {
|
|
719
|
+
_LOCK(contentStore, _lock_identifier(pageBasePath), function(err, releaseLockFn) {
|
|
720
720
|
|
|
721
721
|
// write page file
|
|
722
722
|
contentStore.writeFile(pageFilePath, text, function (err) {
|
|
@@ -773,7 +773,7 @@ exports = module.exports = function()
|
|
|
773
773
|
var cacheFilePath = cloudcms.toCacheFilePath(pageFilePath);
|
|
774
774
|
|
|
775
775
|
// take out a lock so that only one "request" can read from cache at a time for this path
|
|
776
|
-
_LOCK(contentStore, _lock_identifier(pageBasePath), function(releaseLockFn) {
|
|
776
|
+
_LOCK(contentStore, _lock_identifier(pageBasePath), function(err, releaseLockFn) {
|
|
777
777
|
|
|
778
778
|
contentStore.readFile(cacheFilePath, function(err, cacheInfoString) {
|
|
779
779
|
|
|
@@ -858,7 +858,7 @@ exports = module.exports = function()
|
|
|
858
858
|
|
|
859
859
|
var _handleCachePageInvalidate = function(contentStore, pageBasePath, callback)
|
|
860
860
|
{
|
|
861
|
-
_LOCK(contentStore, _lock_identifier(pageBasePath), function(releaseLockFn) {
|
|
861
|
+
_LOCK(contentStore, _lock_identifier(pageBasePath), function(err, releaseLockFn) {
|
|
862
862
|
|
|
863
863
|
contentStore.existsDirectory(pageBasePath, function (exists) {
|
|
864
864
|
|
|
@@ -72,11 +72,11 @@ var handleNotificationMessages = function(items, callback) {
|
|
|
72
72
|
var fns = [];
|
|
73
73
|
for (var i = 0; i < items.length; i++)
|
|
74
74
|
{
|
|
75
|
-
var fn = function(item,
|
|
75
|
+
var fn = function(item, index) {
|
|
76
76
|
return function(done) {
|
|
77
77
|
|
|
78
78
|
//logFn("WORKING ON ITEM: " + i + ", item: " + JSON.stringify(item, null, " "));
|
|
79
|
-
console.log("WORKING ON ITEM: " +
|
|
79
|
+
console.log("WORKING ON ITEM: " + index + ", item: " + JSON.stringify(item, null, " "));
|
|
80
80
|
|
|
81
81
|
var operation = item.operation;
|
|
82
82
|
|
|
@@ -540,6 +540,8 @@ var handleNotificationMessages = function(items, callback) {
|
|
|
540
540
|
|
|
541
541
|
var host = determineHost(item);
|
|
542
542
|
|
|
543
|
+
var _fns = [];
|
|
544
|
+
|
|
543
545
|
var deployments = item.deployments;
|
|
544
546
|
if (deployments && deployments.length > 0)
|
|
545
547
|
{
|
|
@@ -554,17 +556,77 @@ var handleNotificationMessages = function(items, callback) {
|
|
|
554
556
|
"host": host,
|
|
555
557
|
"deployment": deployment
|
|
556
558
|
};
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
559
|
+
|
|
560
|
+
var _fn = function(message) {
|
|
561
|
+
return function(d) {
|
|
562
|
+
// broadcast event
|
|
563
|
+
process.broadcast.publish("deployment_synced", message, function(err) {
|
|
564
|
+
if (err) {
|
|
565
|
+
logInfo("published deployment_synced message. err:" + err + "\nmessage: " + JSON.stringify(message,null,2));
|
|
566
|
+
}
|
|
567
|
+
return done(err);
|
|
568
|
+
});
|
|
562
569
|
}
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
570
|
+
}(message);
|
|
571
|
+
_fns.push(_fn);
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
async.parallelLimit(_fns, 4, function(err) {
|
|
576
|
+
done(err);
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
else if (operation === "api_event")
|
|
580
|
+
{
|
|
581
|
+
var eventType = item.type;
|
|
582
|
+
var eventId = item.id;
|
|
583
|
+
var objects = item.objects;
|
|
584
|
+
|
|
585
|
+
var host = determineHost(item);
|
|
586
|
+
|
|
587
|
+
var _fns = [];
|
|
588
|
+
if (objects && objects.length > 0)
|
|
589
|
+
{
|
|
590
|
+
for (var z = 0; z < objects.length; z++)
|
|
591
|
+
{
|
|
592
|
+
var object = objects[z];
|
|
593
|
+
|
|
594
|
+
var applicationId = object.applicationId;
|
|
595
|
+
var deploymentKey = item.deploymentKey;
|
|
596
|
+
|
|
597
|
+
var objectType = object.type; // sidekickMessage
|
|
598
|
+
var objectId = object.id;
|
|
599
|
+
var objectRef = object.ref;
|
|
600
|
+
|
|
601
|
+
var publishMessage = {
|
|
602
|
+
"applicationId": applicationId,
|
|
603
|
+
"deploymentKey": deploymentKey,
|
|
604
|
+
"host": host,
|
|
605
|
+
"eventType": eventType,
|
|
606
|
+
"eventId": eventId,
|
|
607
|
+
"objectType": objectType,
|
|
608
|
+
"objectId": objectId,
|
|
609
|
+
"objectRef": objectRef,
|
|
610
|
+
"object": object.object
|
|
611
|
+
};
|
|
612
|
+
|
|
613
|
+
var _fn = function(publishMessage) {
|
|
614
|
+
return function(d) {
|
|
615
|
+
// broadcast event
|
|
616
|
+
process.broadcast.publish("api_event", publishMessage, function(err) {
|
|
617
|
+
if (err) {
|
|
618
|
+
logInfo("published api_event message. err:" + err + "\nmessage: " + JSON.stringify(publishMessage,null,2));
|
|
619
|
+
}
|
|
620
|
+
return d(err);
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
}(publishMessage);
|
|
624
|
+
_fns.push(_fn);
|
|
566
625
|
}
|
|
567
626
|
}
|
|
627
|
+
async.parallelLimit(_fns, 4, function(err) {
|
|
628
|
+
done(err);
|
|
629
|
+
});
|
|
568
630
|
}
|
|
569
631
|
else
|
|
570
632
|
{
|
|
@@ -659,7 +721,7 @@ module.exports = function()
|
|
|
659
721
|
var r = {};
|
|
660
722
|
|
|
661
723
|
r.start = function(callback) {
|
|
662
|
-
|
|
724
|
+
|
|
663
725
|
var config = process.configuration;
|
|
664
726
|
if (!config["notifications"])
|
|
665
727
|
{
|
|
@@ -686,7 +748,7 @@ module.exports = function()
|
|
|
686
748
|
notifications.enabled = true;
|
|
687
749
|
}
|
|
688
750
|
}
|
|
689
|
-
|
|
751
|
+
|
|
690
752
|
if (notifications.enabled)
|
|
691
753
|
{
|
|
692
754
|
if (process.env.CLOUDCMS_NOTIFICATIONS_TYPE)
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
const { Kafka } = require("kafkajs");
|
|
2
|
+
const util = require("../../util/util");
|
|
3
|
+
|
|
4
|
+
var holder = {};
|
|
5
|
+
|
|
6
|
+
module.exports = {};
|
|
7
|
+
module.exports.start = function(configuration, callback)
|
|
8
|
+
{
|
|
9
|
+
// clientId
|
|
10
|
+
if (!configuration.clientId)
|
|
11
|
+
{
|
|
12
|
+
if (process.env.CLOUDCMS_NOTIFICATIONS_KAFKA_CLIENT_ID)
|
|
13
|
+
{
|
|
14
|
+
configuration.clientId = process.env.CLOUDCMS_NOTIFICATIONS_KAFKA_CLIENT_ID;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
if (!configuration.clientId)
|
|
18
|
+
{
|
|
19
|
+
configuration.clientId = "cloudcms-ui-kafka-notifications-client";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// topic
|
|
23
|
+
if (!configuration.topic)
|
|
24
|
+
{
|
|
25
|
+
if (process.env.CLOUDCMS_NOTIFICATIONS_KAFKA_TOPIC)
|
|
26
|
+
{
|
|
27
|
+
configuration.topic = process.env.CLOUDCMS_NOTIFICATIONS_KAFKA_TOPIC;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (!configuration.topic)
|
|
31
|
+
{
|
|
32
|
+
configuration.topic = "cloudcms.ui.topic";
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// group
|
|
36
|
+
if (!configuration.group)
|
|
37
|
+
{
|
|
38
|
+
if (process.env.CLOUDCMS_NOTIFICATIONS_KAFKA_GROUP)
|
|
39
|
+
{
|
|
40
|
+
configuration.group = process.env.CLOUDCMS_NOTIFICATIONS_KAFKA_GROUP;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (!configuration.group) {
|
|
44
|
+
configuration.group = "cloudcms-ui-kafka-notifications-group";
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// brokers
|
|
48
|
+
if (!configuration.brokers)
|
|
49
|
+
{
|
|
50
|
+
if (process.env.CLOUDCMS_NOTIFICATIONS_KAFKA_BROKERS)
|
|
51
|
+
{
|
|
52
|
+
configuration.brokers = process.env.CLOUDCMS_NOTIFICATIONS_KAFKA_BROKERS;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
var clientId = configuration.clientId;
|
|
57
|
+
var brokers = configuration.brokers.split(",");
|
|
58
|
+
var topic = configuration.topic;
|
|
59
|
+
var group = configuration.group;
|
|
60
|
+
|
|
61
|
+
process.log("Connecting to kafka, client ID: " + clientId + ", brokers: " + brokers + ", topic: " + topic + ", group: " + group);
|
|
62
|
+
|
|
63
|
+
if (holder.consumer)
|
|
64
|
+
{
|
|
65
|
+
return callback();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// console.log("a1");
|
|
69
|
+
var kafka = new Kafka({
|
|
70
|
+
clientId: clientId,
|
|
71
|
+
brokers: brokers
|
|
72
|
+
});
|
|
73
|
+
// console.log("a2: " + kafka);
|
|
74
|
+
// console.log("a3: " + kafka.consumer);
|
|
75
|
+
|
|
76
|
+
var consumer = holder.consumer = kafka.consumer({ groupId: group });
|
|
77
|
+
|
|
78
|
+
// connect
|
|
79
|
+
(async function() {
|
|
80
|
+
await consumer.connect()
|
|
81
|
+
}());
|
|
82
|
+
|
|
83
|
+
(async function() {
|
|
84
|
+
await consumer.subscribe({topic: topic, fromBeginning: true})
|
|
85
|
+
}());
|
|
86
|
+
|
|
87
|
+
callback();
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
module.exports.process = function(callback)
|
|
91
|
+
{
|
|
92
|
+
var consumer = holder.consumer;
|
|
93
|
+
if (!consumer)
|
|
94
|
+
{
|
|
95
|
+
return callback();
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
(async function() {
|
|
99
|
+
await consumer.run({
|
|
100
|
+
eachMessage: async ({ topic, partition, message, heartbeat, pause }) => {
|
|
101
|
+
handleMessage(topic, partition, message, heartbeat, pause, callback);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}());
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
var handleMessage = function(topic, partition, messageObject, heartbeat, pause, callback)
|
|
108
|
+
{
|
|
109
|
+
// console.log("Topic: " + topic);
|
|
110
|
+
// console.log("Partition: " + partition);
|
|
111
|
+
// console.log("Message: " + JSON.stringify(messageObject, null, 2));
|
|
112
|
+
|
|
113
|
+
if (!messageObject || !messageObject.value)
|
|
114
|
+
{
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
//var key = message.key.toString();
|
|
119
|
+
var valueString = messageObject.value.toString();
|
|
120
|
+
var headers = messageObject.headers || {};
|
|
121
|
+
|
|
122
|
+
var json = null;
|
|
123
|
+
if (valueString) {
|
|
124
|
+
json = JSON.parse("" + valueString);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// console.log("b1: " + valueString);
|
|
128
|
+
// console.log("b2: " + data);
|
|
129
|
+
|
|
130
|
+
if (json)
|
|
131
|
+
{
|
|
132
|
+
console.log("JSON: " + JSON.stringify(json));
|
|
133
|
+
console.log("HEADERS: " + JSON.stringify(headers));
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* kafka1-ui-1 | VAL: {"subject":"invalidate_objects:aea334cb8accb0bd698e","message":"","data":"{\"operation\":\"invalidate_objects\",\"invalidations\":[{\"applicationId\":\"1785c4b13f74b3aa4b31\",\"ref\":\"application://826a3ebefe4c1e006a60/1785c4b13f74b3aa4b31\",\"id\":\"1785c4b13f74b3aa4b31\",\"type\":\"application\",\"stackId\":\"a17879ca0923f6d9696b\",\"stackMembers\":{\"archives\":{\"typeId\":\"vault\",\"id\":\"385e37eb07bc3d16dca1\"},\"console\":{\"typeId\":\"application\",\"id\":\"1785c4b13f74b3aa4b31\"},\"content\":{\"typeId\":\"repository\",\"id\":\"9904550a6b2a2a71f015\"},\"hosting\":{\"typeId\":\"webhost\",\"id\":\"5d2db66ced26608dc355\"},\"oneteam\":{\"typeId\":\"application\",\"id\":\"8d5ba57420ce31a3172c\"},\"principals\":{\"typeId\":\"domain\",\"id\":\"32cbffafe9f2de4d1b9a\"},\"root\":{\"typeId\":\"directory\",\"id\":\"6db38348323d001c2c10\"}}}]}"}
|
|
137
|
+
* kafka1-ui-1 | HEADERS: [object Object]
|
|
138
|
+
* @type {*[]}
|
|
139
|
+
*/
|
|
140
|
+
|
|
141
|
+
var subject = json.subject;
|
|
142
|
+
var message = json.message;
|
|
143
|
+
|
|
144
|
+
// build out the notification message items
|
|
145
|
+
var items = [];
|
|
146
|
+
|
|
147
|
+
if (json.data)
|
|
148
|
+
{
|
|
149
|
+
var data = JSON.parse("" + json.data);
|
|
150
|
+
|
|
151
|
+
// timestamp from headers
|
|
152
|
+
//var timestamp = parseInt(headers.timestamp);
|
|
153
|
+
var timestamp = new Date().getTime();
|
|
154
|
+
|
|
155
|
+
// copy data as item
|
|
156
|
+
var item = util.clone(data, true);
|
|
157
|
+
if (!item)
|
|
158
|
+
{
|
|
159
|
+
item = {};
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// other properties
|
|
163
|
+
item.timestamp = timestamp;
|
|
164
|
+
item.sentTimestamp = timestamp;
|
|
165
|
+
item.subject = subject;
|
|
166
|
+
|
|
167
|
+
// raw message
|
|
168
|
+
item.rawMessage = json.data; // string
|
|
169
|
+
|
|
170
|
+
items.push(item);
|
|
171
|
+
|
|
172
|
+
//console.log("ITEM: " + JSON.stringify(item));
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// call back to notifications engine to process these items
|
|
177
|
+
// when they're done processing, our callback is fired so that we can handle deletes and things
|
|
178
|
+
// we call the done() method when we're finished
|
|
179
|
+
callback(null, items, function(err, items, done) {
|
|
180
|
+
done(err, items, items);
|
|
181
|
+
});
|
|
182
|
+
};
|
|
@@ -63,6 +63,7 @@ module.exports.start = function(configuration, callback)
|
|
|
63
63
|
var MessageConsumer = function MessageConsumer() { };
|
|
64
64
|
MessageConsumer.prototype.init = function init(done) {
|
|
65
65
|
console.log("STOMP client initializing to host: " + host + ", port: " + port);
|
|
66
|
+
var self = this;
|
|
66
67
|
var stompClient = new Stomp({
|
|
67
68
|
"host": host,
|
|
68
69
|
"port": port,
|
|
@@ -85,6 +86,9 @@ module.exports.start = function(configuration, callback)
|
|
|
85
86
|
});
|
|
86
87
|
|
|
87
88
|
done();
|
|
89
|
+
}, function(err) {
|
|
90
|
+
console.error("STOMP Error: " + err);
|
|
91
|
+
done(err);
|
|
88
92
|
});
|
|
89
93
|
};
|
|
90
94
|
holder.consumer = new MessageConsumer();
|
package/package.json
CHANGED
|
@@ -6,56 +6,63 @@
|
|
|
6
6
|
},
|
|
7
7
|
"name": "cloudcms-server",
|
|
8
8
|
"description": "Cloud CMS Application Server Module",
|
|
9
|
-
"version": "
|
|
9
|
+
"version": "4.0.0-beta.10",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "git://github.com/gitana/cloudcms-server.git"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"
|
|
16
|
-
"
|
|
15
|
+
"@socket.io/cluster-adapter": "^0.2.0",
|
|
16
|
+
"@socket.io/redis-adapter": "^7.2.0",
|
|
17
|
+
"@socket.io/sticky": "^1.0.1",
|
|
18
|
+
"accepts": "^1.3.8",
|
|
19
|
+
"agentkeepalive": "^4.5.0",
|
|
17
20
|
"alpaca": "^1.5.27",
|
|
18
21
|
"archiver": "^5.1.0",
|
|
19
|
-
"async": "^3.2.
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
+
"async": "^3.2.3",
|
|
23
|
+
"async-lock": "^1.3.2",
|
|
24
|
+
"aws-sdk": "^2.1208.0",
|
|
25
|
+
"axios": "^1.5.0",
|
|
22
26
|
"basic-auth": "^2.0.1",
|
|
23
|
-
"body-parser": "^1.
|
|
27
|
+
"body-parser": "^1.20.0",
|
|
24
28
|
"bytes": "^3.1.0",
|
|
25
29
|
"canoe": "^0.3.3",
|
|
26
30
|
"clone": "^2.1.2",
|
|
27
31
|
"connect-flash": "^0.1.1",
|
|
28
32
|
"connect-multiparty": "^2.2.0",
|
|
29
|
-
"connect-redis": "^
|
|
33
|
+
"connect-redis": "^6.1.3",
|
|
30
34
|
"consolidate": "^0.16.0",
|
|
31
35
|
"cookie-parser": "^1.4.5",
|
|
32
36
|
"debug": "^4.3.1",
|
|
33
37
|
"dustjs-helpers": "^1.7.4",
|
|
34
|
-
"dustjs-linkedin": "^
|
|
38
|
+
"dustjs-linkedin": "^3.0.1",
|
|
35
39
|
"errorhandler": "^1.5.1",
|
|
36
|
-
"express": "^4.
|
|
37
|
-
"express-session": "^1.17.
|
|
40
|
+
"express": "^4.18.2",
|
|
41
|
+
"express-session": "^1.17.3",
|
|
38
42
|
"express-useragent": "^1.0.15",
|
|
39
43
|
"extend-with-super": "^2.0.0",
|
|
40
|
-
"
|
|
41
|
-
"gitana": "^1.0.
|
|
44
|
+
"fast-proxy": "^2.2.0",
|
|
45
|
+
"gitana": "^1.0.325",
|
|
42
46
|
"handlebars": "^4.7.6",
|
|
43
47
|
"hbs": "^4.1.1",
|
|
44
|
-
"
|
|
48
|
+
"helmet": "^4.6.0",
|
|
49
|
+
"ioredis": "4.28.5",
|
|
45
50
|
"json5": "^2.1.3",
|
|
46
|
-
"jsonwebtoken": "^
|
|
51
|
+
"jsonwebtoken": "^9.0.2",
|
|
52
|
+
"kafkajs": "^2.2.4",
|
|
47
53
|
"klaw": "^3.0.0",
|
|
48
|
-
"lru-cache": "^
|
|
49
|
-
"marked": "^
|
|
54
|
+
"lru-cache": "^7.14.0",
|
|
55
|
+
"marked": "^4.0.14",
|
|
56
|
+
"memored": "^1.1.1",
|
|
50
57
|
"memorystore": "^1.6.4",
|
|
51
58
|
"mime": "^2.4.6",
|
|
59
|
+
"mkdirp": "^0.5.1",
|
|
52
60
|
"moment": "^2.29.1",
|
|
53
61
|
"morgan": "^1.10.0",
|
|
54
|
-
"node-redis-pubsub": "^4.0.0",
|
|
55
62
|
"object-hash": "^2.0.3",
|
|
56
63
|
"object-merge": "^2.5.1",
|
|
57
64
|
"on-headers": "^1.0.2",
|
|
58
|
-
"passport": "^0.
|
|
65
|
+
"passport": "^0.7.0",
|
|
59
66
|
"passport-cas": "^0.1.1",
|
|
60
67
|
"passport-facebook": "^3.0.0",
|
|
61
68
|
"passport-github": "^1.1.0",
|
|
@@ -63,31 +70,27 @@
|
|
|
63
70
|
"passport-linkedin": "^1.0.0",
|
|
64
71
|
"passport-local": "^1.0.0",
|
|
65
72
|
"passport-oauth": "^1.0.0",
|
|
66
|
-
"passport-saml": "^
|
|
67
|
-
"passport-twitter": "^1.
|
|
73
|
+
"@node-saml/passport-saml": "^4.0.4",
|
|
74
|
+
"passport-twitter": "^0.1.5",
|
|
68
75
|
"pkginfo": "^0.4.1",
|
|
69
|
-
"q": "^1.5.1",
|
|
70
76
|
"random-js": "^2.1.0",
|
|
71
77
|
"recursive-readdir": "^2.2.2",
|
|
72
|
-
"redis": "^
|
|
73
|
-
"
|
|
78
|
+
"redis": "^4.2.0",
|
|
79
|
+
"redlock": "4.2.0",
|
|
74
80
|
"request-param": "^1.0.1",
|
|
75
81
|
"response-time": "^2.3.2",
|
|
76
|
-
"
|
|
77
|
-
"semver": "^7.3.4",
|
|
82
|
+
"semver": "^7.3.7",
|
|
78
83
|
"serve-favicon": "^2.5.0",
|
|
79
84
|
"session-file-store": "^1.5.0",
|
|
80
85
|
"sha1": "^1.1.1",
|
|
81
|
-
"socket.io": "4.1
|
|
86
|
+
"socket.io": "^4.5.1",
|
|
82
87
|
"ssl-root-cas": "^1.3.1",
|
|
83
|
-
"sticky-session": "^1.1.2",
|
|
84
88
|
"stomp-client": "^0.9.0",
|
|
85
89
|
"targz": "^1.0.1",
|
|
86
90
|
"temp": "^0.9.4",
|
|
87
|
-
"toobusy-js": "^0.5.1",
|
|
88
91
|
"uuid": "^8.3.2",
|
|
89
92
|
"vm2": "^3.9.2",
|
|
90
|
-
"watch": "^
|
|
93
|
+
"watch": "^0.13.0",
|
|
91
94
|
"winston": "^3.3.3"
|
|
92
95
|
},
|
|
93
96
|
"contributors": [
|