@limetech/lime-web-components 5.31.0 → 5.33.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.33.0](https://github.com/Lundalogik/lime-web-components/compare/v5.32.0...v5.33.0) (2024-08-30)
2
+
3
+
4
+ ### Features
5
+
6
+
7
+ * **notifications:** update load response and provide load options ([dd6aa7c](https://github.com/Lundalogik/lime-web-components/commit/dd6aa7c8f83dd80416552b5acc232c518eff9d59))
8
+
9
+ ## [5.32.0](https://github.com/Lundalogik/lime-web-components/compare/v5.31.0...v5.32.0) (2024-08-23)
10
+
11
+
12
+ ### Features
13
+
14
+
15
+ * **notifications:** add notification interfaces ([fde53f6](https://github.com/Lundalogik/lime-web-components/commit/fde53f68701853246d3327f94ee2f6c175d567a1))
16
+
1
17
  ## [5.31.0](https://github.com/Lundalogik/lime-web-components/compare/v5.30.0...v5.31.0) (2024-03-25)
2
18
 
3
19
 
package/dist/es5/index.js CHANGED
@@ -26,3 +26,4 @@ tslib_1.__exportStar(require("./datetimeformatter"), exports);
26
26
  tslib_1.__exportStar(require("./conditionregistry"), exports);
27
27
  tslib_1.__exportStar(require("./view"), exports);
28
28
  tslib_1.__exportStar(require("./webcomponent"), exports);
29
+ tslib_1.__exportStar(require("./notification-service"), exports);
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./repository"), exports);
5
+ tslib_1.__exportStar(require("./notification"), exports);
6
+ tslib_1.__exportStar(require("./types"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var platform_1 = require("../core/platform");
4
+ var SERVICE_NAME = 'state.notifications';
5
+ platform_1.PlatformServiceName.NotificationRepository = SERVICE_NAME;
package/dist/index.d.ts CHANGED
@@ -45,4 +45,5 @@ export * from './datetimeformatter';
45
45
  export * from './conditionregistry';
46
46
  export * from './view';
47
47
  export * from './webcomponent';
48
+ export * from './notification-service';
48
49
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC"}
package/dist/index.js CHANGED
@@ -45,3 +45,4 @@ export * from './datetimeformatter';
45
45
  export * from './conditionregistry';
46
46
  export * from './view';
47
47
  export * from './webcomponent';
48
+ export * from './notification-service';
@@ -0,0 +1,4 @@
1
+ export * from './repository';
2
+ export * from './notification';
3
+ export * from './types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notification-service/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './repository';
2
+ export * from './notification';
3
+ export * from './types';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * A Notification object
3
+ *
4
+ * @alpha
5
+ * @group NotificationRepository
6
+ */
7
+ export type Notification = {
8
+ id: number;
9
+ iduser: number;
10
+ read: Boolean;
11
+ };
12
+ //# sourceMappingURL=notification.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,76 @@
1
+ import { Notification } from './notification';
2
+ /**
3
+ * Service for handling notifications
4
+ *
5
+ * @alpha
6
+ * @group NotificationRepository
7
+ */
8
+ export interface NotificationRepository {
9
+ /**
10
+ * Gets all notifications
11
+ *
12
+ * @param options - options to provide when loading notifications
13
+ *
14
+ * @returns the saved notifications
15
+ */
16
+ loadNotifications(options?: NotificationLoadOptions): Promise<NotificationResponse | undefined>;
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
25
+ *
26
+ * @param notificationId - the id of the notification to get
27
+ * @returns the fetched notification
28
+ */
29
+ getNotification(notificationId: number): Promise<Notification | undefined>;
30
+ /**
31
+ * Deletes a notification by its id
32
+ *
33
+ * @param notificationId - the id of the notification to delete
34
+ */
35
+ deleteNotification(notificationId: number): Promise<void>;
36
+ /**
37
+ * Marks a notification as read
38
+ *
39
+ * @param notificationId - the id of the notification to mark as read
40
+ * @returns the read notification
41
+ */
42
+ markNotificationAsRead(notificationId: number): Promise<Notification | undefined>;
43
+ }
44
+ /**
45
+ * The count response of loaded notifications
46
+ *
47
+ * @alpha
48
+ * @group NotificationRepository
49
+ */
50
+ export type NotificationCount = {
51
+ total: number;
52
+ unread: number;
53
+ };
54
+ /**
55
+ * The response of loaded notifications
56
+ *
57
+ * @alpha
58
+ * @group NotificationRepository
59
+ */
60
+ export type NotificationResponse = {
61
+ items: Notification[];
62
+ count: NotificationCount;
63
+ };
64
+ /**
65
+ * The options to load notifications with
66
+ *
67
+ * @alpha
68
+ * @group NotificationRepository
69
+ */
70
+ export interface NotificationLoadOptions {
71
+ /**
72
+ * Maximum number of notifications to load
73
+ */
74
+ limit?: number;
75
+ }
76
+ //# sourceMappingURL=repository.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ import { NotificationRepository } from './repository';
2
+ declare const SERVICE_NAME = "state.notifications";
3
+ declare module '../core/platform' {
4
+ interface PlatformServiceNameType {
5
+ /**
6
+ * @see {@link NotificationRepository}
7
+ */
8
+ NotificationRepository: typeof SERVICE_NAME;
9
+ }
10
+ interface LimeWebComponentPlatform {
11
+ get(name: PlatformServiceNameType['NotificationRepository']): NotificationRepository;
12
+ }
13
+ }
14
+ export {};
15
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/notification-service/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAGtD,QAAA,MAAM,YAAY,wBAAwB,CAAC;AAI3C,OAAO,QAAQ,kBAAkB,CAAC;IAC9B,UAAU,uBAAuB;QAC7B;;WAEG;QACH,sBAAsB,EAAE,OAAO,YAAY,CAAC;KAC/C;IAED,UAAU,wBAAwB;QAC9B,GAAG,CACC,IAAI,EAAE,uBAAuB,CAAC,wBAAwB,CAAC,GACxD,sBAAsB,CAAC;KAC7B;CACJ"}
@@ -0,0 +1,3 @@
1
+ import { PlatformServiceName } from '../core/platform';
2
+ const SERVICE_NAME = 'state.notifications';
3
+ PlatformServiceName.NotificationRepository = SERVICE_NAME;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-web-components",
3
- "version": "5.31.0",
3
+ "version": "5.33.0",
4
4
  "description": "Lime Web Components",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",
@@ -32,14 +32,14 @@
32
32
  "dependencies": {
33
33
  "@stencil/core": "^2.22.3",
34
34
  "rxjs": "^7.8.1",
35
- "tslib": "^2.6.2"
35
+ "tslib": "^2.6.3"
36
36
  },
37
37
  "devDependencies": {
38
- "@commitlint/config-conventional": "^19.1.0",
39
- "@microsoft/api-extractor": "^7.43.0",
38
+ "@commitlint/config-conventional": "^19.4.1",
39
+ "@microsoft/api-extractor": "^7.47.7",
40
40
  "@types/jest": "^27.5.0",
41
- "@typescript-eslint/eslint-plugin": "^7.3.1",
42
- "@typescript-eslint/parser": "^7.3.1",
41
+ "@typescript-eslint/eslint-plugin": "^7.5.0",
42
+ "@typescript-eslint/parser": "^7.5.0",
43
43
  "commitizen": "^4.3.0",
44
44
  "cz-conventional-changelog": "^3.3.0",
45
45
  "eslint": "^8.57.0",
@@ -48,12 +48,12 @@
48
48
  "eslint-plugin-prefer-arrow": "^1.2.3",
49
49
  "eslint-plugin-prettier": "^5.1.3",
50
50
  "eslint-plugin-react": "^7.34.1",
51
- "eslint-plugin-sonarjs": "^0.24.0",
51
+ "eslint-plugin-sonarjs": "^0.25.1",
52
52
  "eslint-plugin-tsdoc": "^0.2.17",
53
53
  "jest": "^27.5.1",
54
54
  "jest-cli": "^27.5.1",
55
55
  "prettier": "^3.2.5",
56
- "replace-in-file": "^7.1.0",
56
+ "replace-in-file": "^8.1.0",
57
57
  "shelljs": "0.8.5",
58
58
  "typedoc": "^0.23.24",
59
59
  "typedoc-plugin-markdown": "~3.15.0",