@intuitionrobotics/push-pub-sub 0.41.69 → 0.41.72
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/app-backend/api/_push.js +1 -1
- package/app-backend/api/_push.js.map +1 -1
- package/app-backend/api/v1/push/read.js +12 -60
- package/app-backend/api/v1/push/read.js.map +1 -1
- package/app-backend/api/v1/push/register.js +12 -60
- package/app-backend/api/v1/push/register.js.map +1 -1
- package/app-backend/core/module-pack.js +2 -2
- package/app-backend/core/module-pack.js.map +1 -1
- package/app-backend/modules/PushKey.js +8 -39
- package/app-backend/modules/PushKey.js.map +1 -1
- package/app-backend/modules/PushPubSubModule.js +156 -326
- package/app-backend/modules/PushPubSubModule.js.map +1 -1
- package/app-backend/modules/ScheduledPushCleanup.js +10 -55
- package/app-backend/modules/ScheduledPushCleanup.js.map +1 -1
- package/app-frontend/core/module-pack.js +3 -3
- package/app-frontend/core/module-pack.js.map +1 -1
- package/app-frontend/modules/NotificationModule.js +24 -40
- package/app-frontend/modules/NotificationModule.js.map +1 -1
- package/app-frontend/modules/PushPubSubModule.js +110 -192
- package/app-frontend/modules/PushPubSubModule.js.map +1 -1
- package/package.json +3 -3
package/app-backend/api/_push.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
const backend_1 = require("@intuitionrobotics/thunderstorm/backend");
|
|
4
4
|
module.exports = new backend_1.RouteResolver(require, __dirname);
|
|
5
5
|
//# sourceMappingURL=_push.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_push.js","sourceRoot":"","sources":["../../../src/main/app-backend/api/_push.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"_push.js","sourceRoot":"","sources":["../../../src/main/app-backend/api/_push.ts"],"names":[],"mappings":";;AAAA,qEAAsE;AAEtE,MAAM,CAAC,OAAO,GAAG,IAAI,uBAAa,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC"}
|
|
@@ -1,17 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -21,55 +8,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
21
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
9
|
});
|
|
23
10
|
};
|
|
24
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
25
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
26
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
27
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
28
|
-
function step(op) {
|
|
29
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
30
|
-
while (_) try {
|
|
31
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
32
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
33
|
-
switch (op[0]) {
|
|
34
|
-
case 0: case 1: t = op; break;
|
|
35
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
36
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
37
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
38
|
-
default:
|
|
39
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
40
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
41
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
42
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
43
|
-
if (t[2]) _.ops.pop();
|
|
44
|
-
_.trys.pop(); continue;
|
|
45
|
-
}
|
|
46
|
-
op = body.call(thisArg, _);
|
|
47
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
48
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return _super.call(this, thunderstorm_1.HttpMethod.POST, "read") || this;
|
|
12
|
+
const backend_1 = require("@intuitionrobotics/thunderstorm/backend");
|
|
13
|
+
const thunderstorm_1 = require("@intuitionrobotics/thunderstorm");
|
|
14
|
+
const PushPubSubModule_1 = require("../../../modules/PushPubSubModule");
|
|
15
|
+
class ServerApi_PushRead extends backend_1.ServerApi {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(thunderstorm_1.HttpMethod.POST, "read");
|
|
59
18
|
}
|
|
60
|
-
|
|
61
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
case 0: return [4 /*yield*/, PushPubSubModule_1.PushPubSubModule.readNotification(body._id, body.read)];
|
|
65
|
-
case 1:
|
|
66
|
-
// const user = await KasperoProxy.validateSession(request);
|
|
67
|
-
return [2 /*return*/, _a.sent()];
|
|
68
|
-
}
|
|
69
|
-
});
|
|
19
|
+
process(request, response, queryParams, body) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
// const user = await KasperoProxy.validateSession(request);
|
|
22
|
+
return yield PushPubSubModule_1.PushPubSubModule.readNotification(body._id, body.read);
|
|
70
23
|
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
}(backend_1.ServerApi));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
74
26
|
module.exports = new ServerApi_PushRead();
|
|
75
27
|
//# sourceMappingURL=read.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../../../../src/main/app-backend/api/v1/push/read.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../../../../src/main/app-backend/api/v1/push/read.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,qEAIiD;AAGjD,kEAA2D;AAC3D,wEAAmE;AAMnE,MAAM,kBACL,SAAQ,mBAAiC;IAEzC;QACC,KAAK,CAAC,yBAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAChC,CAAC;IAEe,OAAO,CAAC,OAAuB,EAAE,QAAqB,EAAE,WAAe,EAAE,IAAsB;;YAC9G,4DAA4D;YAC5D,OAAO,MAAM,mCAAgB,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QACrE,CAAC;KAAA;CACD;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,kBAAkB,EAAE,CAAC"}
|
|
@@ -1,17 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -21,55 +8,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
21
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
9
|
});
|
|
23
10
|
};
|
|
24
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
25
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
26
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
27
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
28
|
-
function step(op) {
|
|
29
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
30
|
-
while (_) try {
|
|
31
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
32
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
33
|
-
switch (op[0]) {
|
|
34
|
-
case 0: case 1: t = op; break;
|
|
35
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
36
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
37
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
38
|
-
default:
|
|
39
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
40
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
41
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
42
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
43
|
-
if (t[2]) _.ops.pop();
|
|
44
|
-
_.trys.pop(); continue;
|
|
45
|
-
}
|
|
46
|
-
op = body.call(thisArg, _);
|
|
47
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
48
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return _super.call(this, thunderstorm_1.HttpMethod.POST, "register") || this;
|
|
12
|
+
const backend_1 = require("@intuitionrobotics/thunderstorm/backend");
|
|
13
|
+
const thunderstorm_1 = require("@intuitionrobotics/thunderstorm");
|
|
14
|
+
const PushPubSubModule_1 = require("../../../modules/PushPubSubModule");
|
|
15
|
+
class ServerApi_PushRegister extends backend_1.ServerApi {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(thunderstorm_1.HttpMethod.POST, "register");
|
|
59
18
|
}
|
|
60
|
-
|
|
61
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
case 0: return [4 /*yield*/, PushPubSubModule_1.PushPubSubModule.register(body, request)];
|
|
65
|
-
case 1:
|
|
66
|
-
// const user = await KasperoProxy.validateSession(request);
|
|
67
|
-
return [2 /*return*/, _a.sent()];
|
|
68
|
-
}
|
|
69
|
-
});
|
|
19
|
+
process(request, response, queryParams, body) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
// const user = await KasperoProxy.validateSession(request);
|
|
22
|
+
return yield PushPubSubModule_1.PushPubSubModule.register(body, request);
|
|
70
23
|
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
}(backend_1.ServerApi));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
74
26
|
module.exports = new ServerApi_PushRegister();
|
|
75
27
|
//# sourceMappingURL=register.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../../../src/main/app-backend/api/v1/push/register.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../../../src/main/app-backend/api/v1/push/register.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,qEAIiD;AAGjD,kEAA2D;AAC3D,wEAAmE;AAMnE,MAAM,sBACL,SAAQ,mBAA+B;IAEvC;QACC,KAAK,CAAC,yBAAU,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACpC,CAAC;IAEe,OAAO,CAAC,OAAuB,EAAE,QAAqB,EAAE,WAAe,EAAE,IAA0B;;YAClH,4DAA4D;YAC5D,OAAO,MAAM,mCAAgB,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACvD,CAAC;KAAA;CACD;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,sBAAsB,EAAE,CAAC"}
|
|
@@ -29,8 +29,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
29
29
|
};
|
|
30
30
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
31
|
exports.Backend_ModulePack_PushPubSub = void 0;
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
const PushPubSubModule_1 = require("../modules/PushPubSubModule");
|
|
33
|
+
const ScheduledPushCleanup_1 = require("../modules/ScheduledPushCleanup");
|
|
34
34
|
exports.Backend_ModulePack_PushPubSub = [
|
|
35
35
|
PushPubSubModule_1.PushPubSubModule,
|
|
36
36
|
ScheduledPushCleanup_1.ScheduledCleanup
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-pack.js","sourceRoot":"","sources":["../../../src/main/app-backend/core/module-pack.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"module-pack.js","sourceRoot":"","sources":["../../../src/main/app-backend/core/module-pack.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;;AAEH,kEAA6D;AAC7D,0EAAiE;AAEpD,QAAA,6BAA6B,GAAG;IAC5C,mCAAgB;IAChB,uCAAgB;CAChB,CAAC;AAEF,8DAA2C;AAC3C,kEAA+C;AAC/C,qDAAkC"}
|
|
@@ -26,51 +26,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
26
26
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
30
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
31
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
32
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
33
|
-
function step(op) {
|
|
34
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
35
|
-
while (_) try {
|
|
36
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
37
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
38
|
-
switch (op[0]) {
|
|
39
|
-
case 0: case 1: t = op; break;
|
|
40
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
41
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
42
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
43
|
-
default:
|
|
44
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
45
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
46
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
47
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
48
|
-
if (t[2]) _.ops.pop();
|
|
49
|
-
_.trys.pop(); continue;
|
|
50
|
-
}
|
|
51
|
-
op = body.call(thisArg, _);
|
|
52
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
53
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
30
|
exports.PushKey = void 0;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
if (persist === void 0) { persist = false; }
|
|
31
|
+
const PushPubSubModule_1 = require("./PushPubSubModule");
|
|
32
|
+
class PushKey {
|
|
33
|
+
constructor(key, persist = false) {
|
|
62
34
|
this.key = key;
|
|
63
35
|
this.persist = persist;
|
|
64
36
|
}
|
|
65
|
-
|
|
66
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
67
|
-
return
|
|
68
|
-
return [2 /*return*/, PushPubSubModule_1.PushPubSubModule.pushToKey(this.key, props, data, this.persist)];
|
|
69
|
-
});
|
|
37
|
+
push(data, props) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
return PushPubSubModule_1.PushPubSubModule.pushToKey(this.key, props, data, this.persist);
|
|
70
40
|
});
|
|
71
|
-
}
|
|
41
|
+
}
|
|
72
42
|
;
|
|
73
|
-
|
|
74
|
-
}());
|
|
43
|
+
}
|
|
75
44
|
exports.PushKey = PushKey;
|
|
76
45
|
//# sourceMappingURL=PushKey.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PushKey.js","sourceRoot":"","sources":["../../../src/main/app-backend/modules/PushKey.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG
|
|
1
|
+
{"version":3,"file":"PushKey.js","sourceRoot":"","sources":["../../../src/main/app-backend/modules/PushKey.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;AAGH,yDAAoD;AAGpD,MAAa,OAAO;IAKnB,YAAY,GAAM,EAAE,OAAO,GAAG,KAAK;QAClC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACxB,CAAC;IAEK,IAAI,CAAC,IAAO,EAAE,KAAS;;YAC5B,OAAO,mCAAgB,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACxE,CAAC;KAAA;IAAA,CAAC;CACF;AAbD,0BAaC"}
|