@limetech/lime-web-components 5.33.0 → 5.33.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [5.33.1](https://github.com/Lundalogik/lime-web-components/compare/v5.33.0...v5.33.1) (2024-09-03)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+
7
+ * **notifications:** update interfaces to better align with other services ([900b937](https://github.com/Lundalogik/lime-web-components/commit/900b93711ff3e7ade43010536948afcd58fae753)), closes [Lundalogik/crm-feature#4341](https://github.com/Lundalogik/crm-feature/issues/4341)
8
+
1
9
  ## [5.33.0](https://github.com/Lundalogik/lime-web-components/compare/v5.32.0...v5.33.0) (2024-08-30)
2
10
 
3
11
 
@@ -4,9 +4,46 @@
4
4
  * @alpha
5
5
  * @group NotificationRepository
6
6
  */
7
- export type Notification = {
7
+ export type Notification<T = unknown> = {
8
+ /**
9
+ * The notification id
10
+ */
8
11
  id: number;
9
- iduser: number;
10
- read: Boolean;
12
+ /**
13
+ * Type of notification
14
+ */
15
+ type?: NotificationType;
16
+ /**
17
+ * ID of the user the notification belongs to
18
+ */
19
+ userId: number;
20
+ /**
21
+ * Date when the notification was marked as read
22
+ */
23
+ read?: Date;
24
+ /**
25
+ * Date when the notification was created
26
+ */
27
+ createdTime: Date;
28
+ /**
29
+ * ID of the user that created the notification
30
+ */
31
+ createdUser: number;
32
+ /**
33
+ * Limetype that the notification is attached to
34
+ */
35
+ limetype?: string;
36
+ /**
37
+ * ID of the object the notification is attached to
38
+ */
39
+ objectId?: number;
40
+ /**
41
+ * Data attached to the notification
42
+ */
43
+ data?: T;
11
44
  };
45
+ /**
46
+ * @alpha
47
+ */
48
+ export type NotificationType = 'mention';
12
49
  //# sourceMappingURL=notification.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../src/notification-service/notification.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;CACjB,CAAC"}
1
+ {"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../src/notification-service/notification.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,OAAO,IAAI;IACpC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IAExB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ;;OAEG;IACH,WAAW,EAAE,IAAI,CAAC;IAElB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,IAAI,CAAC,EAAE,CAAC,CAAC;CACZ,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC"}
@@ -7,39 +7,33 @@ import { Notification } from './notification';
7
7
  */
8
8
  export interface NotificationRepository {
9
9
  /**
10
- * Gets all notifications
10
+ * Load all notifications belonging to the logged in user from the server
11
11
  *
12
12
  * @param options - options to provide when loading notifications
13
13
  *
14
14
  * @returns the saved notifications
15
15
  */
16
- loadNotifications(options?: NotificationLoadOptions): Promise<NotificationResponse | undefined>;
16
+ loadAll(options?: NotificationLoadOptions): Promise<NotificationResponse>;
17
17
  /**
18
- * Creates a notification
19
- *
20
- * @returns the created notification
21
- */
22
- createNotification(): Promise<Notification | undefined>;
23
- /**
24
- * Gets a notification by its id
18
+ * Gets a loaded notification by its id
25
19
  *
26
20
  * @param notificationId - the id of the notification to get
27
21
  * @returns the fetched notification
28
22
  */
29
- getNotification(notificationId: number): Promise<Notification | undefined>;
23
+ get(notificationId: number): Notification | undefined;
30
24
  /**
31
- * Deletes a notification by its id
25
+ * Delete a notification
32
26
  *
33
- * @param notificationId - the id of the notification to delete
27
+ * @param notification - the notification to delete
34
28
  */
35
- deleteNotification(notificationId: number): Promise<void>;
29
+ delete(notification: Notification): Promise<void>;
36
30
  /**
37
31
  * Marks a notification as read
38
32
  *
39
- * @param notificationId - the id of the notification to mark as read
40
- * @returns the read notification
33
+ * @param notification - the notification to mark as read
34
+ * @returns the updated notification
41
35
  */
42
- markNotificationAsRead(notificationId: number): Promise<Notification | undefined>;
36
+ markAsRead(notification: Notification): Promise<Notification>;
43
37
  }
44
38
  /**
45
39
  * The count response of loaded notifications
@@ -1 +1 @@
1
- {"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../src/notification-service/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACnC;;;;;;OAMG;IACH,iBAAiB,CACb,OAAO,CAAC,EAAE,uBAAuB,GAClC,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC,CAAC;IAE7C;;;;OAIG;IACH,kBAAkB,IAAI,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC;IAExD;;;;;OAKG;IACH,eAAe,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC;IAE3E;;;;OAIG;IACH,kBAAkB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1D;;;;;OAKG;IACH,sBAAsB,CAClB,cAAc,EAAE,MAAM,GACvB,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC;CACxC;AAED;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAC/B,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,KAAK,EAAE,iBAAiB,CAAC;CAC5B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACpC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB"}
1
+ {"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../src/notification-service/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACnC;;;;;;OAMG;IACH,OAAO,CAAC,OAAO,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAE1E;;;;;OAKG;IACH,GAAG,CAAC,cAAc,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAAC;IAEtD;;;;OAIG;IACH,MAAM,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD;;;;;OAKG;IACH,UAAU,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACjE;AAED;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAC/B,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,KAAK,EAAE,iBAAiB,CAAC;CAC5B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACpC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-web-components",
3
- "version": "5.33.0",
3
+ "version": "5.33.1",
4
4
  "description": "Lime Web Components",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",