@limetech/lime-web-components 5.33.0 → 5.34.0

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,19 @@
1
+ ## [5.34.0](https://github.com/Lundalogik/lime-web-components/compare/v5.33.1...v5.34.0) (2024-09-05)
2
+
3
+
4
+ ### Features
5
+
6
+
7
+ * **notifications:** mark notification as unread ([32acc44](https://github.com/Lundalogik/lime-web-components/commit/32acc44e5e3170c8c2a6d7ddb67ff002fed111d5))
8
+
9
+ ## [5.33.1](https://github.com/Lundalogik/lime-web-components/compare/v5.33.0...v5.33.1) (2024-09-03)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+
15
+ * **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)
16
+
1
17
  ## [5.33.0](https://github.com/Lundalogik/lime-web-components/compare/v5.32.0...v5.33.0) (2024-08-30)
2
18
 
3
19
 
package/README.md CHANGED
@@ -17,15 +17,12 @@ not updated, the GitHub build will fail when the API is verified.
17
17
 
18
18
  ## Deploy documentation
19
19
 
20
- Documentation is deployed to GitHub Pages when a new release is built by GitHub Actions. It can also be deployed manually from a Linux or macOS computer. *NB! Running the publish script locally will update your git config for the repository with the values of the GIT_AUTHOR_EMAIL and GIT_AUTHOR_NAME environment variables. If you set these to anything other than your own user, you may wish to update your config again after publishing. The script will also make changes to a few files, and will checkout these again at the end. Any uncommitted changes you've made to these files **will be lost**. The script also removes the local copy of the branch gh-pages.*
20
+ Documentation is deployed to GitHub Pages when a new release is built by GitHub Actions. It can also be deployed manually from a Linux or macOS computer.
21
21
 
22
22
  Follow these steps:
23
23
 
24
24
  1. The following environment variables must be set:
25
- - GIT_AUTHOR_EMAIL - the email address for the user making the commit
26
- - GIT_AUTHOR_NAME - the name of the user making the commit
27
- - GH_TOKEN - a GitHub access-token with write-access to the repository
28
- - GH_USERNAME - the GitHub user to which the above access-token belongs
25
+ - GITHUB_TOKEN - a GitHub access-token with write-access to the repository
29
26
  2. Run `git fetch`.
30
27
  3. Run `git branch` and make sure you do *not* have a local copy of the branch `gh-pages`. If you do, push anything that should be pushed, and remove the local branch.
31
28
  4. From the repo-root, run `npm run docs:publish -- --v=<version>`, where `<version>` is the version of lime-elements you are building the documentation for. **Any existing documentation for this version number will be overwritten.** If no version is supplied, the version will be set to `0.0.0-dev`. If `--dryRun=true` is supplied, the entire script will run, except the push to GitHub.
@@ -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,34 @@ 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
+ * Get 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
- * Marks a notification as read
31
+ * Mark a notification as read or unread
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 update
34
+ * @param read - optional - whether the notification should be marked as read or unread. Defaults to `true`
35
+ * @returns the updated notification
41
36
  */
42
- markNotificationAsRead(notificationId: number): Promise<Notification | undefined>;
37
+ markAsRead(notification: Notification, read: boolean): Promise<Notification>;
43
38
  }
44
39
  /**
45
40
  * 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;;;;;;OAMG;IACH,UAAU,CACN,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,OAAO,GACd,OAAO,CAAC,YAAY,CAAC,CAAC;CAC5B;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.34.0",
4
4
  "description": "Lime Web Components",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",
@@ -16,7 +16,7 @@
16
16
  "build": "tsc && tsc -p tsconfig.es5.json",
17
17
  "start": "tsc --watch",
18
18
  "test": "stencil test --spec",
19
- "docs": "typedoc",
19
+ "docs:build": "typedoc",
20
20
  "docs:publish": "node publish-docs.js",
21
21
  "api:update": "npm run build && api-extractor run --local --verbose",
22
22
  "api:verify": "api-extractor run",
@@ -25,14 +25,12 @@
25
25
  "lint:json": "prettier -l '{!(package*).json,packages/*/!(package*).json,.prettierrc}'",
26
26
  "lint:json:fix": "prettier --write '{!(package*).json,packages/*/!(package*).json,.prettierrc}'",
27
27
  "lint:src": "eslint '**/*.{ts,js}' --max-warnings=0",
28
- "lint:src:fix": "eslint '**/*.{ts,js}' --fix --max-warnings=0",
29
- "postpublish": "npm run docs:publish -- --v=current",
30
- "postpublish:dry-run": "npm run docs:publish -- --v=current --dryRun"
28
+ "lint:src:fix": "eslint '**/*.{ts,js}' --fix --max-warnings=0"
31
29
  },
32
30
  "dependencies": {
33
31
  "@stencil/core": "^2.22.3",
34
32
  "rxjs": "^7.8.1",
35
- "tslib": "^2.6.3"
33
+ "tslib": "^2.7.0"
36
34
  },
37
35
  "devDependencies": {
38
36
  "@commitlint/config-conventional": "^19.4.1",