@onecx/integration-interface 7.0.0-rc.9 → 7.0.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/package.json +8 -4
- package/src/index.d.ts +10 -2
- package/src/index.js +10 -2
- package/src/index.js.map +1 -1
- package/src/lib/services/image-repository.service.d.ts +9 -0
- package/src/lib/services/image-repository.service.js +37 -0
- package/src/lib/services/image-repository.service.js.map +1 -0
- package/src/lib/topics/events/v1/event-type.d.ts +1 -3
- package/src/lib/topics/events/v1/event-type.js +0 -2
- package/src/lib/topics/events/v1/event-type.js.map +1 -1
- package/src/lib/topics/image-repository/image-repository.model.d.ts +5 -0
- package/src/lib/topics/image-repository/image-repository.model.js +3 -0
- package/src/lib/topics/image-repository/image-repository.model.js.map +1 -0
- package/src/lib/topics/image-repository/image-repository.topic.d.ts +5 -0
- package/src/lib/topics/image-repository/image-repository.topic.js +11 -0
- package/src/lib/topics/image-repository/image-repository.topic.js.map +1 -0
- package/src/lib/topics/permissions-rpc/v1/permissions-rpc.topic.js +1 -1
- package/src/lib/topics/permissions-rpc/v1/permissions-rpc.topic.js.map +1 -1
- package/src/lib/topics/resized-events/v1/resized-event-type.d.ts +5 -0
- package/src/lib/topics/resized-events/v1/resized-event-type.js +10 -0
- package/src/lib/topics/resized-events/v1/resized-event-type.js.map +1 -0
- package/src/lib/topics/resized-events/v1/resized-events.topic.d.ts +27 -0
- package/src/lib/topics/resized-events/v1/resized-events.topic.js +73 -0
- package/src/lib/topics/resized-events/v1/resized-events.topic.js.map +1 -0
- package/src/lib/topics/resized-events/v1/resized-update-requested-type.d.ts +9 -0
- package/src/lib/topics/resized-events/v1/resized-update-requested-type.js +3 -0
- package/src/lib/topics/resized-events/v1/resized-update-requested-type.js.map +1 -0
- package/src/lib/topics/{events → resized-events}/v1/slot-groups-resized-type.d.ts +2 -2
- package/src/lib/topics/{events → resized-events}/v1/slot-groups-resized-type.js.map +1 -1
- package/src/lib/topics/{events → resized-events}/v1/slots-resized-type.d.ts +2 -2
- package/src/lib/topics/{events → resized-events}/v1/slots-resized-type.js.map +1 -1
- package/src/lib/topics/resized-events/v1/topic-resized-event-type.d.ts +4 -0
- package/src/lib/topics/resized-events/v1/topic-resized-event-type.js +3 -0
- package/src/lib/topics/resized-events/v1/topic-resized-event-type.js.map +1 -0
- /package/src/lib/topics/{events → resized-events}/v1/slot-groups-resized-type.js +0 -0
- /package/src/lib/topics/{events → resized-events}/v1/slots-resized-type.js +0 -0
package/package.json
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onecx/integration-interface",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/onecx/onecx-portal-ui-libs"
|
|
8
|
+
},
|
|
5
9
|
"peerDependencies": {
|
|
6
10
|
"tslib": "^2.6.3",
|
|
7
11
|
"rxjs": "^7.8.1",
|
|
8
|
-
"@
|
|
9
|
-
"@onecx/
|
|
10
|
-
"@nx
|
|
12
|
+
"@nx/devkit": "^22.0.2",
|
|
13
|
+
"@onecx/accelerator": "^7.0.1",
|
|
14
|
+
"@onecx/nx-migration-utils": "^7.0.1",
|
|
11
15
|
"@phenomnomnominal/tsquery": "^6",
|
|
12
16
|
"typescript": "^5.5.4"
|
|
13
17
|
},
|
package/src/index.d.ts
CHANGED
|
@@ -27,10 +27,18 @@ export * from './lib/topics/permissions-rpc/v1/permissions-rpc.model';
|
|
|
27
27
|
export * from './lib/topics/events/v1/events-topic';
|
|
28
28
|
export * from './lib/topics/events/v1/topic-event-type';
|
|
29
29
|
export * from './lib/topics/events/v1/event-type';
|
|
30
|
-
export * from './lib/topics/events/v1/slots-resized-type';
|
|
31
|
-
export * from './lib/topics/events/v1/slot-groups-resized-type';
|
|
32
30
|
export * from './lib/topics/events/v1/navigated-event-type';
|
|
33
31
|
export * from './lib/topics/events/v1/navigated-event-payload';
|
|
32
|
+
export * from './lib/topics/resized-events/v1/resized-event-type';
|
|
33
|
+
export * from './lib/topics/resized-events/v1/resized-events.topic';
|
|
34
|
+
export * from './lib/topics/resized-events/v1/resized-update-requested-type';
|
|
35
|
+
export * from './lib/topics/resized-events/v1/slot-groups-resized-type';
|
|
36
|
+
export * from './lib/topics/resized-events/v1/slots-resized-type';
|
|
37
|
+
export * from './lib/topics/resized-events/v1/topic-resized-event-type';
|
|
34
38
|
export * from './lib/topics/current-location/v1/current-location.model';
|
|
35
39
|
export * from './lib/topics/current-location/v1/current-location.topic';
|
|
36
40
|
export * from './lib/topics/parameters/v1/parameters.topic';
|
|
41
|
+
export * from './lib/topics/resized-events/v1/resized-events.topic';
|
|
42
|
+
export * from './lib/topics/image-repository/image-repository.model';
|
|
43
|
+
export * from './lib/topics/image-repository/image-repository.topic';
|
|
44
|
+
export * from './lib/services/image-repository.service';
|
package/src/index.js
CHANGED
|
@@ -30,11 +30,19 @@ tslib_1.__exportStar(require("./lib/topics/permissions-rpc/v1/permissions-rpc.mo
|
|
|
30
30
|
tslib_1.__exportStar(require("./lib/topics/events/v1/events-topic"), exports);
|
|
31
31
|
tslib_1.__exportStar(require("./lib/topics/events/v1/topic-event-type"), exports);
|
|
32
32
|
tslib_1.__exportStar(require("./lib/topics/events/v1/event-type"), exports);
|
|
33
|
-
tslib_1.__exportStar(require("./lib/topics/events/v1/slots-resized-type"), exports);
|
|
34
|
-
tslib_1.__exportStar(require("./lib/topics/events/v1/slot-groups-resized-type"), exports);
|
|
35
33
|
tslib_1.__exportStar(require("./lib/topics/events/v1/navigated-event-type"), exports);
|
|
36
34
|
tslib_1.__exportStar(require("./lib/topics/events/v1/navigated-event-payload"), exports);
|
|
35
|
+
tslib_1.__exportStar(require("./lib/topics/resized-events/v1/resized-event-type"), exports);
|
|
36
|
+
tslib_1.__exportStar(require("./lib/topics/resized-events/v1/resized-events.topic"), exports);
|
|
37
|
+
tslib_1.__exportStar(require("./lib/topics/resized-events/v1/resized-update-requested-type"), exports);
|
|
38
|
+
tslib_1.__exportStar(require("./lib/topics/resized-events/v1/slot-groups-resized-type"), exports);
|
|
39
|
+
tslib_1.__exportStar(require("./lib/topics/resized-events/v1/slots-resized-type"), exports);
|
|
40
|
+
tslib_1.__exportStar(require("./lib/topics/resized-events/v1/topic-resized-event-type"), exports);
|
|
37
41
|
tslib_1.__exportStar(require("./lib/topics/current-location/v1/current-location.model"), exports);
|
|
38
42
|
tslib_1.__exportStar(require("./lib/topics/current-location/v1/current-location.topic"), exports);
|
|
39
43
|
tslib_1.__exportStar(require("./lib/topics/parameters/v1/parameters.topic"), exports);
|
|
44
|
+
tslib_1.__exportStar(require("./lib/topics/resized-events/v1/resized-events.topic"), exports);
|
|
45
|
+
tslib_1.__exportStar(require("./lib/topics/image-repository/image-repository.model"), exports);
|
|
46
|
+
tslib_1.__exportStar(require("./lib/topics/image-repository/image-repository.topic"), exports);
|
|
47
|
+
tslib_1.__exportStar(require("./lib/services/image-repository.service"), exports);
|
|
40
48
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/integration-interface/src/index.ts"],"names":[],"mappings":";;;AAAA,wFAA6D;AAC7D,qFAA0D;AAC1D,0FAA+D;AAC/D,uFAA4D;AAE5D,0FAA+D;AAE/D,8FAAmE;AAEnE,4FAAiE;AACjE,oFAAyD;AAEzD,0FAA+D;AAC/D,0FAA+D;AAE/D,4FAAiE;AAEjE,oGAAyE;AACzE,0GAA+E;AAC/E,4FAAiE;AACjE,wFAA6D;AAC7D,2FAAgE;AAEhE,iGAAsE;AAEtE,gFAAqD;AACrD,gFAAqD;AAErD,mGAAwE;AACxE,yGAA8E;AAC9E,uFAA4D;AAC5D,oGAAyE;AAEzE,wFAA6D;AAE7D,gGAAqE;AACrE,gGAAqE;AAErE,8EAAmD;AACnD,kFAAuD;AACvD,4EAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/integration-interface/src/index.ts"],"names":[],"mappings":";;;AAAA,wFAA6D;AAC7D,qFAA0D;AAC1D,0FAA+D;AAC/D,uFAA4D;AAE5D,0FAA+D;AAE/D,8FAAmE;AAEnE,4FAAiE;AACjE,oFAAyD;AAEzD,0FAA+D;AAC/D,0FAA+D;AAE/D,4FAAiE;AAEjE,oGAAyE;AACzE,0GAA+E;AAC/E,4FAAiE;AACjE,wFAA6D;AAC7D,2FAAgE;AAEhE,iGAAsE;AAEtE,gFAAqD;AACrD,gFAAqD;AAErD,mGAAwE;AACxE,yGAA8E;AAC9E,uFAA4D;AAC5D,oGAAyE;AAEzE,wFAA6D;AAE7D,gGAAqE;AACrE,gGAAqE;AAErE,8EAAmD;AACnD,kFAAuD;AACvD,4EAAiD;AACjD,sFAA2D;AAC3D,yFAA8D;AAE9D,4FAAiE;AACjE,8FAAmE;AACnE,uGAA4E;AAC5E,kGAAuE;AACvE,4FAAiE;AACjE,kGAAuE;AAEvE,kGAAuE;AACvE,kGAAuE;AAEvE,sFAA2D;AAE3D,8FAAmE;AAEnE,+FAAoE;AACpE,+FAAoE;AACpE,kFAAuD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ImageRepositoryTopic } from "../topics/image-repository/image-repository.topic";
|
|
2
|
+
export declare class ImageRepositoryService {
|
|
3
|
+
private _imageRepositoryTopic$;
|
|
4
|
+
get imageRepositoryTopic(): ImageRepositoryTopic;
|
|
5
|
+
set imageRepositoryTopic(source: ImageRepositoryTopic);
|
|
6
|
+
getUrl(names: string[]): Promise<string | undefined>;
|
|
7
|
+
getUrl(names: string[], fallbackUrl: string): Promise<string>;
|
|
8
|
+
destroy(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ImageRepositoryService = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const image_repository_topic_1 = require("../topics/image-repository/image-repository.topic");
|
|
6
|
+
class ImageRepositoryService {
|
|
7
|
+
_imageRepositoryTopic$;
|
|
8
|
+
get imageRepositoryTopic() {
|
|
9
|
+
this._imageRepositoryTopic$ ??= new image_repository_topic_1.ImageRepositoryTopic();
|
|
10
|
+
return this._imageRepositoryTopic$;
|
|
11
|
+
}
|
|
12
|
+
set imageRepositoryTopic(source) {
|
|
13
|
+
this._imageRepositoryTopic$ = source;
|
|
14
|
+
}
|
|
15
|
+
async getUrl(names, fallbackUrl) {
|
|
16
|
+
if (!names || names.length === 0) {
|
|
17
|
+
return fallbackUrl;
|
|
18
|
+
}
|
|
19
|
+
const imagePaths = await (0, rxjs_1.firstValueFrom)(this.imageRepositoryTopic.asObservable());
|
|
20
|
+
const urls = imagePaths.images || {};
|
|
21
|
+
const isUrlListEmpty = Object.entries(urls).length === 0;
|
|
22
|
+
if (isUrlListEmpty) {
|
|
23
|
+
return fallbackUrl;
|
|
24
|
+
}
|
|
25
|
+
for (const name of names) {
|
|
26
|
+
if (name in urls) {
|
|
27
|
+
return urls[name];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return fallbackUrl;
|
|
31
|
+
}
|
|
32
|
+
destroy() {
|
|
33
|
+
this.imageRepositoryTopic.destroy();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.ImageRepositoryService = ImageRepositoryService;
|
|
37
|
+
//# sourceMappingURL=image-repository.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-repository.service.js","sourceRoot":"","sources":["../../../../../../libs/integration-interface/src/lib/services/image-repository.service.ts"],"names":[],"mappings":";;;AAAA,+BAAsC;AACtC,8FAAyF;AAEzF,MAAa,sBAAsB;IACvB,sBAAsB,CAAmC;IAEjE,IAAI,oBAAoB;QACpB,IAAI,CAAC,sBAAsB,KAAK,IAAI,6CAAoB,EAAE,CAAA;QAC1D,OAAO,IAAI,CAAC,sBAAsB,CAAA;IACtC,CAAC;IACD,IAAI,oBAAoB,CAAC,MAA4B;QACjD,IAAI,CAAC,sBAAsB,GAAG,MAAM,CAAA;IACxC,CAAC;IAID,KAAK,CAAC,MAAM,CAAC,KAAe,EAAE,WAAoB;QAC9C,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/B,OAAO,WAAW,CAAC;QACvB,CAAC;QACD,MAAM,UAAU,GAAG,MAAM,IAAA,qBAAc,EAAC,IAAI,CAAC,oBAAoB,CAAC,YAAY,EAAE,CAAC,CAAC;QAClF,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,IAAI,EAAE,CAAC;QACrC,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;QACzD,IAAI,cAAc,EAAE,CAAC;YACjB,OAAO,WAAW,CAAC;QACvB,CAAC;QACD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACvB,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;gBACf,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC;YACtB,CAAC;QACL,CAAC;QACD,OAAO,WAAW,CAAC;IACvB,CAAC;IAED,OAAO;QACH,IAAI,CAAC,oBAAoB,CAAC,OAAO,EAAE,CAAC;IACxC,CAAC;CACJ;AAlCD,wDAkCC"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export declare enum EventType {
|
|
2
2
|
NAVIGATED = "navigated",
|
|
3
|
-
AUTH_LOGOUT_BUTTON_CLICKED = "authentication#logoutButtonClicked"
|
|
4
|
-
SLOT_RESIZED = "slot#resized",
|
|
5
|
-
SLOT_GROUP_RESIZED = "slotGroup#resized"
|
|
3
|
+
AUTH_LOGOUT_BUTTON_CLICKED = "authentication#logoutButtonClicked"
|
|
6
4
|
}
|
|
@@ -5,7 +5,5 @@ var EventType;
|
|
|
5
5
|
(function (EventType) {
|
|
6
6
|
EventType["NAVIGATED"] = "navigated";
|
|
7
7
|
EventType["AUTH_LOGOUT_BUTTON_CLICKED"] = "authentication#logoutButtonClicked";
|
|
8
|
-
EventType["SLOT_RESIZED"] = "slot#resized";
|
|
9
|
-
EventType["SLOT_GROUP_RESIZED"] = "slotGroup#resized";
|
|
10
8
|
})(EventType || (exports.EventType = EventType = {}));
|
|
11
9
|
//# sourceMappingURL=event-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-type.js","sourceRoot":"","sources":["../../../../../../../../libs/integration-interface/src/lib/topics/events/v1/event-type.ts"],"names":[],"mappings":";;;AAAA,IAAY,
|
|
1
|
+
{"version":3,"file":"event-type.js","sourceRoot":"","sources":["../../../../../../../../libs/integration-interface/src/lib/topics/events/v1/event-type.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,oCAAuB,CAAA;IACvB,8EAAiE,CAAA;AACnE,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-repository.model.js","sourceRoot":"","sources":["../../../../../../../libs/integration-interface/src/lib/topics/image-repository/image-repository.model.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ImageRepositoryTopic = void 0;
|
|
4
|
+
const accelerator_1 = require("@onecx/accelerator");
|
|
5
|
+
class ImageRepositoryTopic extends accelerator_1.Topic {
|
|
6
|
+
constructor() {
|
|
7
|
+
super('imageRepository', 1);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.ImageRepositoryTopic = ImageRepositoryTopic;
|
|
11
|
+
//# sourceMappingURL=image-repository.topic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-repository.topic.js","sourceRoot":"","sources":["../../../../../../../libs/integration-interface/src/lib/topics/image-repository/image-repository.topic.ts"],"names":[],"mappings":";;;AAAA,oDAA2C;AAG3C,MAAa,oBAAqB,SAAQ,mBAA0B;IAClE;QACE,KAAK,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAA;IAC7B,CAAC;CACF;AAJD,oDAIC"}
|
|
@@ -4,7 +4,7 @@ exports.PermissionsRpcTopic = void 0;
|
|
|
4
4
|
const accelerator_1 = require("@onecx/accelerator");
|
|
5
5
|
class PermissionsRpcTopic extends accelerator_1.Topic {
|
|
6
6
|
constructor() {
|
|
7
|
-
super('permissionsRpc', 1);
|
|
7
|
+
super('permissionsRpc', 1, false);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
exports.PermissionsRpcTopic = PermissionsRpcTopic;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions-rpc.topic.js","sourceRoot":"","sources":["../../../../../../../../libs/integration-interface/src/lib/topics/permissions-rpc/v1/permissions-rpc.topic.ts"],"names":[],"mappings":";;;AAAA,oDAA0C;AAG1C,MAAa,mBAAoB,SAAQ,mBAAqB;IAC5D;QACE,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"permissions-rpc.topic.js","sourceRoot":"","sources":["../../../../../../../../libs/integration-interface/src/lib/topics/permissions-rpc/v1/permissions-rpc.topic.ts"],"names":[],"mappings":";;;AAAA,oDAA0C;AAG1C,MAAa,mBAAoB,SAAQ,mBAAqB;IAC5D;QACE,KAAK,CAAC,gBAAgB,EAAE,CAAC,EAAE,KAAK,CAAC,CAAA;IACnC,CAAC;CACF;AAJD,kDAIC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResizedEventType = void 0;
|
|
4
|
+
var ResizedEventType;
|
|
5
|
+
(function (ResizedEventType) {
|
|
6
|
+
ResizedEventType["SLOT_RESIZED"] = "slot_resized";
|
|
7
|
+
ResizedEventType["SLOT_GROUP_RESIZED"] = "slot_group_resized";
|
|
8
|
+
ResizedEventType["REQUESTED_EVENTS_CHANGED"] = "requested_events_changed";
|
|
9
|
+
})(ResizedEventType || (exports.ResizedEventType = ResizedEventType = {}));
|
|
10
|
+
//# sourceMappingURL=resized-event-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resized-event-type.js","sourceRoot":"","sources":["../../../../../../../../libs/integration-interface/src/lib/topics/resized-events/v1/resized-event-type.ts"],"names":[],"mappings":";;;AAAA,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,iDAA6B,CAAA;IAC7B,6DAAyC,CAAA;IACzC,yEAAqD,CAAA;AACvD,CAAC,EAJW,gBAAgB,gCAAhB,gBAAgB,QAI3B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Topic, TopicPublisher } from '@onecx/accelerator';
|
|
2
|
+
import { TopicResizedEventType } from './topic-resized-event-type';
|
|
3
|
+
import { ResizedEventType } from './resized-event-type';
|
|
4
|
+
declare global {
|
|
5
|
+
interface Window {
|
|
6
|
+
'@onecx/integration-interface': {
|
|
7
|
+
resizedEvents?: {
|
|
8
|
+
slot_resized?: string[];
|
|
9
|
+
slot_group_resized?: string[];
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export declare class ResizedEventsPublisher extends TopicPublisher<TopicResizedEventType> {
|
|
15
|
+
constructor();
|
|
16
|
+
publish(event: TopicResizedEventType): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
export declare class ResizedEventsTopic extends Topic<TopicResizedEventType> {
|
|
19
|
+
constructor();
|
|
20
|
+
/**
|
|
21
|
+
* Request resized update events for a specific entity
|
|
22
|
+
* @param eventType - The type of resized event to request
|
|
23
|
+
* @param entityName - The name of the entity (slot or slot group) to request events for
|
|
24
|
+
*/
|
|
25
|
+
static requestEvent(eventType: ResizedEventType.SLOT_RESIZED | ResizedEventType.SLOT_GROUP_RESIZED, entityName: string): void;
|
|
26
|
+
publish(event: TopicResizedEventType): Promise<void>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResizedEventsTopic = exports.ResizedEventsPublisher = void 0;
|
|
4
|
+
const accelerator_1 = require("@onecx/accelerator");
|
|
5
|
+
const resized_event_type_1 = require("./resized-event-type");
|
|
6
|
+
class ResizedEventsPublisher extends accelerator_1.TopicPublisher {
|
|
7
|
+
constructor() {
|
|
8
|
+
super('resizedEvents', 1);
|
|
9
|
+
}
|
|
10
|
+
//NOSONAR
|
|
11
|
+
publish(event) {
|
|
12
|
+
if (![resized_event_type_1.ResizedEventType.SLOT_GROUP_RESIZED, resized_event_type_1.ResizedEventType.SLOT_RESIZED].includes(event.type)) {
|
|
13
|
+
return super.publish(event);
|
|
14
|
+
}
|
|
15
|
+
const resizedEvent = event;
|
|
16
|
+
const entityName = eventToEntityName(resizedEvent);
|
|
17
|
+
if (window['@onecx/integration-interface']['resizedEvents']?.[resizedEvent.type]?.includes(entityName)) {
|
|
18
|
+
return super.publish(event);
|
|
19
|
+
}
|
|
20
|
+
return Promise.resolve();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.ResizedEventsPublisher = ResizedEventsPublisher;
|
|
24
|
+
class ResizedEventsTopic extends accelerator_1.Topic {
|
|
25
|
+
constructor() {
|
|
26
|
+
super('resizedEvents', 1, false);
|
|
27
|
+
window['@onecx/integration-interface'] ??= {};
|
|
28
|
+
window['@onecx/integration-interface']['resizedEvents'] ??= {};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Request resized update events for a specific entity
|
|
32
|
+
* @param eventType - The type of resized event to request
|
|
33
|
+
* @param entityName - The name of the entity (slot or slot group) to request events for
|
|
34
|
+
*/
|
|
35
|
+
static requestEvent(eventType, entityName) {
|
|
36
|
+
window['@onecx/integration-interface'] ??= {};
|
|
37
|
+
window['@onecx/integration-interface']['resizedEvents'] ??= {};
|
|
38
|
+
window['@onecx/integration-interface']['resizedEvents'][eventType] ??= [];
|
|
39
|
+
window['@onecx/integration-interface']['resizedEvents'][eventType].push(entityName);
|
|
40
|
+
// Request an initial update when registering to make sure the listener has the latest information
|
|
41
|
+
// Without this, the listener might have to wait until the next resize to get any data
|
|
42
|
+
// Its important that this is called after the listener is registered
|
|
43
|
+
new ResizedEventsPublisher().publish({
|
|
44
|
+
type: resized_event_type_1.ResizedEventType.REQUESTED_EVENTS_CHANGED,
|
|
45
|
+
payload: {
|
|
46
|
+
type: eventType,
|
|
47
|
+
name: entityName,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
//NOSONAR
|
|
52
|
+
publish(event) {
|
|
53
|
+
if (![resized_event_type_1.ResizedEventType.SLOT_GROUP_RESIZED, resized_event_type_1.ResizedEventType.SLOT_RESIZED].includes(event.type)) {
|
|
54
|
+
return super.publish(event);
|
|
55
|
+
}
|
|
56
|
+
const resizedEvent = event;
|
|
57
|
+
const entityName = eventToEntityName(resizedEvent);
|
|
58
|
+
if (window['@onecx/integration-interface']['resizedEvents']?.[resizedEvent.type]?.includes(entityName)) {
|
|
59
|
+
return super.publish(event);
|
|
60
|
+
}
|
|
61
|
+
return Promise.resolve();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.ResizedEventsTopic = ResizedEventsTopic;
|
|
65
|
+
function eventToEntityName(event) {
|
|
66
|
+
switch (event.type) {
|
|
67
|
+
case resized_event_type_1.ResizedEventType.SLOT_RESIZED:
|
|
68
|
+
return event.payload.slotName;
|
|
69
|
+
case resized_event_type_1.ResizedEventType.SLOT_GROUP_RESIZED:
|
|
70
|
+
return event.payload.slotGroupName;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=resized-events.topic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resized-events.topic.js","sourceRoot":"","sources":["../../../../../../../../libs/integration-interface/src/lib/topics/resized-events/v1/resized-events.topic.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ResizedEventType } from './resized-event-type';
|
|
2
|
+
export type RequestedEventsChangedEventPayload = {
|
|
3
|
+
type: ResizedEventType.SLOT_GROUP_RESIZED | ResizedEventType.SLOT_RESIZED;
|
|
4
|
+
name: string;
|
|
5
|
+
};
|
|
6
|
+
export type RequestedEventsChangedEvent = {
|
|
7
|
+
type: ResizedEventType.REQUESTED_EVENTS_CHANGED;
|
|
8
|
+
payload: RequestedEventsChangedEventPayload;
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resized-update-requested-type.js","sourceRoot":"","sources":["../../../../../../../../libs/integration-interface/src/lib/topics/resized-events/v1/resized-update-requested-type.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ResizedEventType } from './resized-event-type';
|
|
2
2
|
export type SlotGroupResizedDetails = {
|
|
3
3
|
width: number;
|
|
4
4
|
height: number;
|
|
@@ -8,6 +8,6 @@ export type SlotGroupResizedEventPayload = {
|
|
|
8
8
|
slotGroupDetails: SlotGroupResizedDetails;
|
|
9
9
|
};
|
|
10
10
|
export type SlotGroupResizedEvent = {
|
|
11
|
-
type:
|
|
11
|
+
type: ResizedEventType.SLOT_GROUP_RESIZED;
|
|
12
12
|
payload: SlotGroupResizedEventPayload;
|
|
13
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slot-groups-resized-type.js","sourceRoot":"","sources":["../../../../../../../../libs/integration-interface/src/lib/topics/events/v1/slot-groups-resized-type.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"slot-groups-resized-type.js","sourceRoot":"","sources":["../../../../../../../../libs/integration-interface/src/lib/topics/resized-events/v1/slot-groups-resized-type.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ResizedEventType } from './resized-event-type';
|
|
2
2
|
export type SlotResizedDetails = {
|
|
3
3
|
width: number;
|
|
4
4
|
height: number;
|
|
@@ -8,6 +8,6 @@ export type SlotResizedEventPayload = {
|
|
|
8
8
|
slotDetails: SlotResizedDetails;
|
|
9
9
|
};
|
|
10
10
|
export type SlotResizedEvent = {
|
|
11
|
-
type:
|
|
11
|
+
type: ResizedEventType.SLOT_RESIZED;
|
|
12
12
|
payload: SlotResizedEventPayload;
|
|
13
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slots-resized-type.js","sourceRoot":"","sources":["../../../../../../../../libs/integration-interface/src/lib/topics/events/v1/slots-resized-type.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"slots-resized-type.js","sourceRoot":"","sources":["../../../../../../../../libs/integration-interface/src/lib/topics/resized-events/v1/slots-resized-type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RequestedEventsChangedEvent } from './resized-update-requested-type';
|
|
2
|
+
import { SlotGroupResizedEvent } from './slot-groups-resized-type';
|
|
3
|
+
import { SlotResizedEvent } from './slots-resized-type';
|
|
4
|
+
export type TopicResizedEventType = SlotGroupResizedEvent | SlotResizedEvent | RequestedEventsChangedEvent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topic-resized-event-type.js","sourceRoot":"","sources":["../../../../../../../../libs/integration-interface/src/lib/topics/resized-events/v1/topic-resized-event-type.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|