@noatgnu/cupcake-mint-chocolate 1.2.4 → 1.2.6

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/README.md CHANGED
@@ -1,63 +1,110 @@
1
- # CupcakeMintChocolate
1
+ # Cupcake Mint Chocolate
2
2
 
3
- This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.1.0.
3
+ The `cupcake-mint-chocolate` library provides a comprehensive suite of services and models for handling real-time messaging and user notifications within the Cupcake ecosystem.
4
4
 
5
- ## Code scaffolding
5
+ ## Key Features
6
6
 
7
- Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
7
+ - **Messaging System:** A complete messaging system with support for public and private threads, user participation, and message replies.
8
+ - **Notification Service:** A robust system for delivering notifications to users, with support for different types, priorities, and delivery statuses.
9
+ - **Real-time Communication:** WebSocket integration for real-time updates on new messages and notifications.
8
10
 
9
- ```bash
10
- ng generate component component-name
11
- ```
11
+ ## Installation
12
12
 
13
- For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
13
+ To install the `@noatgnu/cupcake-mint-chocolate` library, run the following command:
14
14
 
15
15
  ```bash
16
- ng generate --help
16
+ npm install @noatgnu/cupcake-mint-chocolate
17
17
  ```
18
18
 
19
- ## Building
19
+ This library is an extension of `@noatgnu/cupcake-core` and depends on it. Make sure you have `@noatgnu/cupcake-core` installed and configured in your application.
20
20
 
21
- To build the library, run:
21
+ ## Services
22
22
 
23
- ```bash
24
- ng build cupcake-mint-chocolate
25
- ```
23
+ ### MessageThreadService
26
24
 
27
- This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
25
+ The `MessageThreadService` is responsible for managing message threads:
28
26
 
29
- ### Publishing the Library
27
+ - **CRUD Operations:** Create, read, update, and delete message threads.
28
+ - **Participant Management:** Add, remove, and list participants in a thread.
29
+ - **Thread Actions:** Archive, unarchive, and mark threads as read.
30
+ - **Querying:** Filter and search for threads based on privacy, archive status, and creator.
30
31
 
31
- Once the project is built, you can publish your library by following these steps:
32
+ **Usage:**
32
33
 
33
- 1. Navigate to the `dist` directory:
34
- ```bash
35
- cd dist/cupcake-mint-chocolate
36
- ```
34
+ ```typescript
35
+ import { MessageThreadService } from '@noatgnu/cupcake-mint-chocolate';
37
36
 
38
- 2. Run the `npm publish` command to publish your library to the npm registry:
39
- ```bash
40
- npm publish
41
- ```
37
+ @Component({ ... })
38
+ export class MyComponent {
39
+ constructor(private messageThreadService: MessageThreadService) {
40
+ // Get all active public threads
41
+ this.messageThreadService.getMessageThreads({ isPrivate: false, isArchived: false }).subscribe(response => {
42
+ // ...
43
+ });
44
+ }
45
+ }
46
+ ```
42
47
 
43
- ## Running unit tests
48
+ ### MessageService
44
49
 
45
- To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
50
+ The `MessageService` handles the messages within threads:
46
51
 
47
- ```bash
48
- ng test
52
+ - **CRUD Operations:** Create, read, update, and (soft) delete messages.
53
+ - **Querying:** Fetch messages by thread, sender, type, or content.
54
+ - **Replies:** Create messages that are replies to other messages.
55
+
56
+ **Usage:**
57
+
58
+ ```typescript
59
+ import { MessageService } from '@noatgnu/cupcake-mint-chocolate';
60
+
61
+ @Component({ ... })
62
+ export class MyComponent {
63
+ constructor(private messageService: MessageService) {
64
+ const threadId = '...'; // ID of the message thread
65
+ this.messageService.getThreadMessages(threadId).subscribe(response => {
66
+ // ...
67
+ });
68
+ }
69
+ }
49
70
  ```
50
71
 
51
- ## Running end-to-end tests
72
+ ### NotificationService
52
73
 
53
- For end-to-end (e2e) testing, run:
74
+ The `NotificationService` manages user notifications:
54
75
 
55
- ```bash
56
- ng e2e
76
+ - **CRUD Operations:** Create, read, update, and delete notifications.
77
+ - **Notification Management:** Mark notifications as read (individually or all at once).
78
+ - **Statistics:** Get statistics about a user's notifications (total, unread, etc.).
79
+ - **Querying:** Filter notifications by type, priority, sender, and delivery status.
80
+
81
+ **Usage:**
82
+
83
+ ```typescript
84
+ import { NotificationService } from '@noatgnu/cupcake-mint-chocolate';
85
+
86
+ @Component({ ... })
87
+ export class MyComponent {
88
+ constructor(private notificationService: NotificationService) {
89
+ // Get all unread notifications
90
+ this.notificationService.getUnreadNotifications().subscribe(response => {
91
+ // ...
92
+ });
93
+ }
94
+ }
57
95
  ```
58
96
 
59
- Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
97
+ ### Real-time Communication
98
+
99
+ This library also includes a WebSocket service (`CommunicationWebsocketService`) that provides real-time updates for new messages and notifications, ensuring that the user interface is always up-to-date without the need for polling.
100
+
101
+ ## Models
102
+
103
+ The `cupcake-mint-chocolate` library provides a set of models for type-safe interaction with the messaging and notification APIs. Key models include:
60
104
 
61
- ## Additional Resources
105
+ - `MessageThread`
106
+ - `Message`
107
+ - `Notification`
108
+ - `ThreadParticipant`
62
109
 
63
- For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
110
+ This library is a crucial component for building interactive and engaging applications on the Cupcake platform.