@rtsee/live-storage 0.0.3 → 0.0.4
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/dist/live-storage/src/index.d.ts +3 -0
- package/dist/live-storage/src/index.d.ts.map +1 -0
- package/dist/live-storage/src/index.js +15 -0
- package/dist/live-storage/src/index.js.map +1 -0
- package/dist/live-storage/src/interfaces/LiveStorageOptions.d.ts +8 -0
- package/dist/live-storage/src/interfaces/LiveStorageOptions.d.ts.map +1 -0
- package/dist/live-storage/src/interfaces/LiveStorageOptions.js +3 -0
- package/dist/live-storage/src/interfaces/LiveStorageOptions.js.map +1 -0
- package/dist/live-storage/src/interfaces/MessengerHandlers.d.ts +13 -0
- package/dist/live-storage/src/interfaces/MessengerHandlers.d.ts.map +1 -0
- package/dist/live-storage/src/interfaces/MessengerHandlers.js +3 -0
- package/dist/live-storage/src/interfaces/MessengerHandlers.js.map +1 -0
- package/dist/live-storage/src/interfaces/MessengerStorageOptions.d.ts +5 -0
- package/dist/live-storage/src/interfaces/MessengerStorageOptions.d.ts.map +1 -0
- package/dist/live-storage/src/interfaces/MessengerStorageOptions.js +3 -0
- package/dist/live-storage/src/interfaces/MessengerStorageOptions.js.map +1 -0
- package/dist/live-storage/src/interfaces/index.d.ts +4 -0
- package/dist/live-storage/src/interfaces/index.d.ts.map +1 -0
- package/dist/live-storage/src/interfaces/index.js +16 -0
- package/dist/live-storage/src/interfaces/index.js.map +1 -0
- package/dist/live-storage/src/messenger/MessengerStorage.d.ts +5 -0
- package/dist/live-storage/src/messenger/MessengerStorage.d.ts.map +1 -0
- package/dist/live-storage/src/messenger/MessengerStorage.js +7 -0
- package/dist/live-storage/src/messenger/MessengerStorage.js.map +1 -0
- package/dist/live-storage/src/models/LiveStorage.d.ts +12 -0
- package/dist/live-storage/src/models/LiveStorage.d.ts.map +1 -0
- package/dist/live-storage/src/models/LiveStorage.js +51 -0
- package/dist/live-storage/src/models/LiveStorage.js.map +1 -0
- package/dist/live-storage/src/models/index.d.ts +2 -0
- package/dist/live-storage/src/models/index.d.ts.map +1 -0
- package/dist/live-storage/src/models/index.js +14 -0
- package/dist/live-storage/src/models/index.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./models"), exports);
|
|
14
|
+
__exportStar(require("./interfaces"), exports);
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyB;AACzB,+CAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveStorageOptions.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/LiveStorageOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveStorageOptions.js","sourceRoot":"","sources":["../../../../src/interfaces/LiveStorageOptions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IRTSeeChatBase, IRTSeeChatsQuery, IRTSeeChatsResult, IRTSeeCreateChatOptions, IRTSeeMessageBase, IRTSeeMessagesQuery, IRTSeeMessagesResult, IRTSeeMessengerSearchOptions, IRTSeeMessengerSearchResults } from "@rtsee/common";
|
|
2
|
+
export interface IMessengerHandlers {
|
|
3
|
+
getMessages?: (options: IRTSeeMessagesQuery) => Promise<IRTSeeMessagesResult>;
|
|
4
|
+
getChats?: (options: IRTSeeChatsQuery) => Promise<IRTSeeChatsResult>;
|
|
5
|
+
getChat?: (options: IRTSeeChatsQuery) => Promise<IRTSeeChatBase | null>;
|
|
6
|
+
isAllowedToChat?: (senderId: string, chatId?: string, receiverId?: string) => Promise<boolean>;
|
|
7
|
+
onMessageSent?: (message: IRTSeeMessageBase) => Promise<IRTSeeMessageBase>;
|
|
8
|
+
onChatCreated?: (chat: IRTSeeCreateChatOptions) => Promise<IRTSeeChatBase | null>;
|
|
9
|
+
onMessagesReceived?: (clientId: string, messagesIds: string[]) => Promise<void>;
|
|
10
|
+
onMessagesSeen?: (clientId: string, messagesIds: string[]) => Promise<void>;
|
|
11
|
+
search?: (options: IRTSeeMessengerSearchOptions) => Promise<IRTSeeMessengerSearchResults>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=MessengerHandlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessengerHandlers.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/MessengerHandlers.ts"],"names":[],"mapp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engerHandlers.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessengerStorageOptions.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/MessengerStorageOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,kBAAkB,CAAC;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessengerStorageOptions.js","sourceRoot":"","sources":["../../../../src/interfaces/MessengerStorageOptions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./LiveStorageOptions"), exports);
|
|
14
|
+
__exportStar(require("./MessengerStorageOptions"), exports);
|
|
15
|
+
__exportStar(require("./MessengerHandlers"), exports);
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uDAAqC;AACrC,4DAA0C;AAC1C,sDAAoC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessengerStorage.d.ts","sourceRoot":"","sources":["../../../../src/messenger/MessengerStorage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,qBAAa,gBAAgB;IAC3B,KAAK,EAAE,cAAc,EAAE,CAAC;CAIzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessengerStorage.js","sourceRoot":"","sources":["../../../../src/messenger/MessengerStorage.ts"],"names":[],"mappings":";;;AAEA,MAAa,gBAAgB;CAK5B;AALD,4CAKC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IRTSeeLiveStorageOptions } from "@rtsee/live-storage";
|
|
2
|
+
import { RedisClientType } from "redis";
|
|
3
|
+
import { Client } from "redis-om";
|
|
4
|
+
export declare class RTSeeLiveStorage {
|
|
5
|
+
redisClient?: RedisClientType;
|
|
6
|
+
redisOmClient?: Client;
|
|
7
|
+
redisUrl?: string;
|
|
8
|
+
constructor(options: IRTSeeLiveStorageOptions);
|
|
9
|
+
init(): Promise<void>;
|
|
10
|
+
initRedisOm(): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=LiveStorage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveStorage.d.ts","sourceRoot":"","sources":["../../../../src/models/LiveStorage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAgB,eAAe,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,qBAAa,gBAAgB;IAC3B,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;gBAEN,OAAO,EAAE,wBAAwB;IAYvC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,WAAW;CAelB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RTSeeLiveStorage = void 0;
|
|
13
|
+
const redis_1 = require("redis");
|
|
14
|
+
const redis_om_1 = require("redis-om");
|
|
15
|
+
class RTSeeLiveStorage {
|
|
16
|
+
constructor(options) {
|
|
17
|
+
if (options.redisClient) {
|
|
18
|
+
this.redisClient = options.redisClient;
|
|
19
|
+
}
|
|
20
|
+
if (options.redisUrl) {
|
|
21
|
+
this.redisUrl = options.redisUrl;
|
|
22
|
+
}
|
|
23
|
+
if (options.redisOmClient) {
|
|
24
|
+
this.redisOmClient = options.redisOmClient;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
init() {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
yield this.initRedisOm();
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
initRedisOm() {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
if (this.redisOmClient) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (this.redisClient) {
|
|
38
|
+
this.redisOmClient = new redis_om_1.Client();
|
|
39
|
+
yield this.redisOmClient.use(this.redisClient);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (this.redisUrl) {
|
|
43
|
+
this.redisClient = (0, redis_1.createClient)({ url: this.redisUrl });
|
|
44
|
+
this.redisOmClient = new redis_om_1.Client();
|
|
45
|
+
yield this.redisOmClient.use(this.redisClient);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.RTSeeLiveStorage = RTSeeLiveStorage;
|
|
51
|
+
//# sourceMappingURL=LiveStorage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveStorage.js","sourceRoot":"","sources":["../../../../src/models/LiveStorage.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,iCAAsD;AACtD,uCAAkC;AAElC,MAAa,gBAAgB;IAK3B,YAAY,OAAiC;QAC3C,IAAI,OAAO,CAAC,WAAW,EAAE;YACvB,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;SACxC;QACD,IAAI,OAAO,CAAC,QAAQ,EAAE;YACpB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;SAClC;QACD,IAAI,OAAO,CAAC,aAAa,EAAE;YACzB,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;SAC5C;IACH,CAAC;IAEK,IAAI;;YACR,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC3B,CAAC;KAAA;IAEK,WAAW;;YACf,IAAI,IAAI,CAAC,aAAa,EAAE;gBACtB,OAAO;aACR;YACD,IAAI,IAAI,CAAC,WAAW,EAAE;gBACpB,IAAI,CAAC,aAAa,GAAG,IAAI,iBAAM,EAAE,CAAC;gBAClC,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBAC/C,OAAO;aACR;YACD,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACjB,IAAI,CAAC,WAAW,GAAG,IAAA,oBAAY,EAAC,EAAE,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;gBACxD,IAAI,CAAC,aAAa,GAAG,IAAI,iBAAM,EAAE,CAAC;gBAClC,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;aAChD;QACH,CAAC;KAAA;CACF;AApCD,4CAoCC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./LiveStorage"), exports);
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAA8B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rtsee/live-storage",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "dist/live-storage/src/index",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"redis": "^4.3.1",
|
|
46
46
|
"redis-om": "^0.3.6"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "7eafa27f637f246f4a9f8f3d947db75c502c9f64"
|
|
49
49
|
}
|