@nu-art/ts-messaging-frontend 0.400.2
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/ModuleFE_Message.d.ts +38 -0
- package/ModuleFE_Message.js +39 -0
- package/ModuleFE_Message.js.map +1 -0
- package/ModuleFE_Topic.d.ts +38 -0
- package/ModuleFE_Topic.js +39 -0
- package/ModuleFE_Topic.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +2 -0
- package/index.js.map +1 -0
- package/module-pack.d.ts +1 -0
- package/module-pack.js +7 -0
- package/module-pack.js.map +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frontend module for handling messaging functionality in the Thunderstorm framework.
|
|
3
|
+
* Provides message creation and management capabilities.
|
|
4
|
+
*/
|
|
5
|
+
import { ModuleFE_BaseApi } from '@nu-art/thunderstorm/frontend/index';
|
|
6
|
+
import { DispatcherDef, ThunderDispatcherV3 } from '@nu-art/thunderstorm/frontend/core/db-api-gen/types';
|
|
7
|
+
import { DBProto_Message } from '@nu-art/ts-messaging-shared/index';
|
|
8
|
+
/**
|
|
9
|
+
* Type definition for the message dispatcher
|
|
10
|
+
* Handles updates to messages in the system
|
|
11
|
+
*/
|
|
12
|
+
export type DispatcherType_Message = DispatcherDef<DBProto_Message, `__onMessagesUpdated`>;
|
|
13
|
+
/**
|
|
14
|
+
* Dispatcher instance for handling message updates
|
|
15
|
+
*/
|
|
16
|
+
export declare const dispatch_onMessagesUpdated: ThunderDispatcherV3<DispatcherType_Message>;
|
|
17
|
+
/**
|
|
18
|
+
* Frontend module class for handling messages
|
|
19
|
+
* Extends the base API module with message-specific functionality
|
|
20
|
+
*/
|
|
21
|
+
export declare class ModuleFE_Message_Class extends ModuleFE_BaseApi<DBProto_Message> {
|
|
22
|
+
/**
|
|
23
|
+
* Initializes the message module with message definition and dispatcher
|
|
24
|
+
*/
|
|
25
|
+
constructor();
|
|
26
|
+
/**
|
|
27
|
+
* Creates a new text message in the specified topic
|
|
28
|
+
*
|
|
29
|
+
* @param topicId - The ID of the topic to create the message in
|
|
30
|
+
* @param msg - The text content of the message
|
|
31
|
+
* @returns Promise that resolves when message is created
|
|
32
|
+
*/
|
|
33
|
+
createMessage(topicId: string, msg: string): Promise<void>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Singleton instance of the frontend message module
|
|
37
|
+
*/
|
|
38
|
+
export declare const ModuleFE_Message: ModuleFE_Message_Class;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frontend module for handling messaging functionality in the Thunderstorm framework.
|
|
3
|
+
* Provides message creation and management capabilities.
|
|
4
|
+
*/
|
|
5
|
+
import { ModuleFE_BaseApi } from '@nu-art/thunderstorm/frontend/index';
|
|
6
|
+
import { ThunderDispatcherV3 } from '@nu-art/thunderstorm/frontend/core/db-api-gen/types';
|
|
7
|
+
import { DBDef_message, MessageType_Text } from '@nu-art/ts-messaging-shared/index';
|
|
8
|
+
/**
|
|
9
|
+
* Dispatcher instance for handling message updates
|
|
10
|
+
*/
|
|
11
|
+
export const dispatch_onMessagesUpdated = new ThunderDispatcherV3('__onMessagesUpdated');
|
|
12
|
+
/**
|
|
13
|
+
* Frontend module class for handling messages
|
|
14
|
+
* Extends the base API module with message-specific functionality
|
|
15
|
+
*/
|
|
16
|
+
export class ModuleFE_Message_Class extends ModuleFE_BaseApi {
|
|
17
|
+
/**
|
|
18
|
+
* Initializes the message module with message definition and dispatcher
|
|
19
|
+
*/
|
|
20
|
+
constructor() {
|
|
21
|
+
super(DBDef_message, dispatch_onMessagesUpdated);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Creates a new text message in the specified topic
|
|
25
|
+
*
|
|
26
|
+
* @param topicId - The ID of the topic to create the message in
|
|
27
|
+
* @param msg - The text content of the message
|
|
28
|
+
* @returns Promise that resolves when message is created
|
|
29
|
+
*/
|
|
30
|
+
async createMessage(topicId, msg) {
|
|
31
|
+
const newMessage = { type: MessageType_Text, topicId, text: msg };
|
|
32
|
+
await this.v1.upsert(newMessage).executeSync();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Singleton instance of the frontend message module
|
|
37
|
+
*/
|
|
38
|
+
export const ModuleFE_Message = new ModuleFE_Message_Class();
|
|
39
|
+
//# sourceMappingURL=ModuleFE_Message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModuleFE_Message.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/ts-messaging/frontend/src/main/","sources":["ModuleFE_Message.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAC,gBAAgB,EAAC,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAgB,mBAAmB,EAAC,MAAM,qDAAqD,CAAC;AACvG,OAAO,EAAC,aAAa,EAAmB,gBAAgB,EAAC,MAAM,mCAAmC,CAAC;AASnG;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,mBAAmB,CAAyB,qBAAqB,CAAC,CAAC;AAEjH;;;GAGG;AACH,MAAM,OAAO,sBACZ,SAAQ,gBAAiC;IAEzC;;OAEG;IACH;QACC,KAAK,CAAC,aAAa,EAAE,0BAA0B,CAAC,CAAC;IAClD,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,aAAa,CAAC,OAAe,EAAE,GAAW;QAC/C,MAAM,UAAU,GAAG,EAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAC,CAAC;QAChE,MAAM,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,UAA0C,CAAC,CAAC,WAAW,EAAE,CAAC;IAChF,CAAC;CACD;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,sBAAsB,EAAE,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frontend module for topic management in the messaging system.
|
|
3
|
+
* Provides functionality for handling topic-related operations, state management,
|
|
4
|
+
* and topic filtering based on collection and reference criteria.
|
|
5
|
+
*/
|
|
6
|
+
import { DispatcherDef, ThunderDispatcherV3 } from '@nu-art/thunderstorm/frontend/core/db-api-gen/types';
|
|
7
|
+
import { ModuleFE_BaseApi } from '@nu-art/thunderstorm/frontend/index';
|
|
8
|
+
import { DBProto_Topic, UI_Topic } from '@nu-art/ts-messaging-shared/index';
|
|
9
|
+
/**
|
|
10
|
+
* Dispatcher type definition for topic updates, used to handle topic-related state changes
|
|
11
|
+
*/
|
|
12
|
+
export type DispatcherType_Topic = DispatcherDef<DBProto_Topic, `__onTopicsUpdated`>;
|
|
13
|
+
/**
|
|
14
|
+
* Dispatcher instance for handling topic updates across the application.
|
|
15
|
+
* Used to broadcast and handle topic-related state changes throughout the application.
|
|
16
|
+
* Implements the ThunderDispatcherV3 pattern for consistent state management.
|
|
17
|
+
*/
|
|
18
|
+
export declare const dispatch_onTopicsUpdated: ThunderDispatcherV3<DispatcherType_Topic>;
|
|
19
|
+
/**
|
|
20
|
+
* Frontend module for managing topics
|
|
21
|
+
* Handles topic-related operations and state management in the frontend
|
|
22
|
+
*/
|
|
23
|
+
export declare class ModuleFE_topic_Class extends ModuleFE_BaseApi<DBProto_Topic> {
|
|
24
|
+
/**
|
|
25
|
+
* Initializes a new instance of ModuleFE_topic_Class.
|
|
26
|
+
* Sets up the base API configuration with DBDef_Topic definition
|
|
27
|
+
* and configures the dispatcher for topic updates.
|
|
28
|
+
*/
|
|
29
|
+
constructor();
|
|
30
|
+
/**
|
|
31
|
+
* Retrieves topics based on collection name and reference ID
|
|
32
|
+
* @param collectionName - The name of the collection to filter topics (e.g., 'messages', 'channels')
|
|
33
|
+
* @param refId - The unique identifier used to reference specific topics within the collection
|
|
34
|
+
* @returns Array of UI_Topic objects matching the specified collection name and reference ID
|
|
35
|
+
*/
|
|
36
|
+
getTopics(collectionName: string, refId: string): UI_Topic[];
|
|
37
|
+
}
|
|
38
|
+
export declare const ModuleFE_Topic: ModuleFE_topic_Class;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frontend module for topic management in the messaging system.
|
|
3
|
+
* Provides functionality for handling topic-related operations, state management,
|
|
4
|
+
* and topic filtering based on collection and reference criteria.
|
|
5
|
+
*/
|
|
6
|
+
import { ThunderDispatcherV3 } from '@nu-art/thunderstorm/frontend/core/db-api-gen/types';
|
|
7
|
+
import { ModuleFE_BaseApi } from '@nu-art/thunderstorm/frontend/index';
|
|
8
|
+
import { DBDef_Topic } from '@nu-art/ts-messaging-shared/index';
|
|
9
|
+
/**
|
|
10
|
+
* Dispatcher instance for handling topic updates across the application.
|
|
11
|
+
* Used to broadcast and handle topic-related state changes throughout the application.
|
|
12
|
+
* Implements the ThunderDispatcherV3 pattern for consistent state management.
|
|
13
|
+
*/
|
|
14
|
+
export const dispatch_onTopicsUpdated = new ThunderDispatcherV3('__onTopicsUpdated');
|
|
15
|
+
/**
|
|
16
|
+
* Frontend module for managing topics
|
|
17
|
+
* Handles topic-related operations and state management in the frontend
|
|
18
|
+
*/
|
|
19
|
+
export class ModuleFE_topic_Class extends ModuleFE_BaseApi {
|
|
20
|
+
/**
|
|
21
|
+
* Initializes a new instance of ModuleFE_topic_Class.
|
|
22
|
+
* Sets up the base API configuration with DBDef_Topic definition
|
|
23
|
+
* and configures the dispatcher for topic updates.
|
|
24
|
+
*/
|
|
25
|
+
constructor() {
|
|
26
|
+
super(DBDef_Topic, dispatch_onTopicsUpdated);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves topics based on collection name and reference ID
|
|
30
|
+
* @param collectionName - The name of the collection to filter topics (e.g., 'messages', 'channels')
|
|
31
|
+
* @param refId - The unique identifier used to reference specific topics within the collection
|
|
32
|
+
* @returns Array of UI_Topic objects matching the specified collection name and reference ID
|
|
33
|
+
*/
|
|
34
|
+
getTopics(collectionName, refId) {
|
|
35
|
+
return this.cache.filter(topic => topic.type === collectionName && topic.refId === refId);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export const ModuleFE_Topic = new ModuleFE_topic_Class();
|
|
39
|
+
//# sourceMappingURL=ModuleFE_Topic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModuleFE_Topic.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/ts-messaging/frontend/src/main/","sources":["ModuleFE_Topic.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAgB,mBAAmB,EAAC,MAAM,qDAAqD,CAAC;AACvG,OAAO,EAAC,gBAAgB,EAAC,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAC,WAAW,EAA0B,MAAM,mCAAmC,CAAC;AAQvF;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,mBAAmB,CAAuB,mBAAmB,CAAC,CAAC;AAE3G;;;GAGG;AACH,MAAM,OAAO,oBACZ,SAAQ,gBAA+B;IAGvC;;;;OAIG;IACH;QACC,KAAK,CAAC,WAAW,EAAE,wBAAwB,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;OAKG;IACI,SAAS,CAAC,cAAsB,EAAE,KAAa;QACrD,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,cAAc,IAAI,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;IAC3F,CAAC;CAED;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,oBAAoB,EAAE,CAAC"}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './module-pack.js';
|
package/index.js
ADDED
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/ts-messaging/frontend/src/main/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
|
package/module-pack.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ModulePackFE_Messaging: (import("./ModuleFE_Message.js").ModuleFE_Message_Class | import("./ModuleFE_Topic.js").ModuleFE_topic_Class)[];
|
package/module-pack.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-pack.js","sourceRoot":"/Users/tacb0ss/dev/nu-art/beamz/_thunderstorm/ts-messaging/frontend/src/main/","sources":["module-pack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAGnD,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACrC,gBAAgB;IAChB,cAAc;CACd,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nu-art/ts-messaging-frontend",
|
|
3
|
+
"version": "0.400.2",
|
|
4
|
+
"description": "Frontend messaging module for Thunderstorm framework providing topic-based messaging system with support for text, image, and video messages",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"TacB0sS",
|
|
7
|
+
"infra",
|
|
8
|
+
"nu-art",
|
|
9
|
+
"thunderstorm",
|
|
10
|
+
"typescript",
|
|
11
|
+
"ts-messaging"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://github.com/nu-art-js/thunderstorm",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/nu-art-js/thunderstorm/issues"
|
|
16
|
+
},
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"directory": "dist",
|
|
19
|
+
"linkDirectory": true
|
|
20
|
+
},
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+ssh://git@github.com:nu-art-js/thunderstorm.git"
|
|
24
|
+
},
|
|
25
|
+
"license": "Apache-2.0",
|
|
26
|
+
"author": "TacB0sS",
|
|
27
|
+
"files": [
|
|
28
|
+
"**/*"
|
|
29
|
+
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "tsc"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@nu-art/ts-common": "0.400.2",
|
|
35
|
+
"@nu-art/thunderstorm": "0.400.2",
|
|
36
|
+
"@nu-art/user-account": "0.400.2",
|
|
37
|
+
"@nu-art/permissions": "0.400.2",
|
|
38
|
+
"@nu-art/ts-messaging-shared": "0.400.2",
|
|
39
|
+
"firebase": "^11.9.0",
|
|
40
|
+
"firebase-admin": "13.4.0",
|
|
41
|
+
"firebase-functions": "6.3.2",
|
|
42
|
+
"react": "^18.0.0"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/react": "^18.0.0",
|
|
46
|
+
"@types/chai": "^4.3.4",
|
|
47
|
+
"@types/mocha": "^10.0.1"
|
|
48
|
+
},
|
|
49
|
+
"unitConfig": {
|
|
50
|
+
"type": "typescript-lib"
|
|
51
|
+
},
|
|
52
|
+
"type": "module",
|
|
53
|
+
"exports": {
|
|
54
|
+
".": {
|
|
55
|
+
"types": "./index.d.ts",
|
|
56
|
+
"import": "./index.js"
|
|
57
|
+
},
|
|
58
|
+
"./*": {
|
|
59
|
+
"types": "./*.d.ts",
|
|
60
|
+
"import": "./*.js"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|