@servicetitan/toolbelt-shared-registry 1.3.0 → 1.4.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/dist/comm-hub-notifications-registry.js +34 -33
- package/dist/comm-hub-notifications-registry.js.map +1 -1
- package/dist/comm-hub-registry.d.ts +15 -3
- package/dist/comm-hub-registry.d.ts.map +1 -1
- package/dist/comm-hub-registry.js +37 -32
- package/dist/comm-hub-registry.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +6 -10
- package/src/comm-hub-registry.ts +18 -3
|
@@ -1,65 +1,66 @@
|
|
|
1
|
-
|
|
1
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
2
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for
|
|
4
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
}
|
|
7
|
-
|
|
6
|
+
}
|
|
7
|
+
function _ts_metadata(k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
}
|
|
9
|
+
}
|
|
10
10
|
import { injectable, provide, useDependencies } from '@servicetitan/react-ioc';
|
|
11
|
-
import { RegistryReader, RegistryService, RegistryWriter
|
|
11
|
+
import { RegistryReader, RegistryService, RegistryWriter } from '@servicetitan/shared-data-registry';
|
|
12
12
|
import { RegistryStore } from '@servicetitan/shared-data-registry/mobx';
|
|
13
13
|
export const commHubNotificationsRegistryId = 'toolbelt:comm-hub-notif-registry-id';
|
|
14
14
|
export const CommHubNotificationsItemId = 'notifications-count';
|
|
15
|
-
|
|
16
|
-
constructor()
|
|
15
|
+
export class CommHubNotificationsRegistry extends RegistryService {
|
|
16
|
+
constructor(){
|
|
17
17
|
super(commHubNotificationsRegistryId);
|
|
18
18
|
}
|
|
19
|
-
}
|
|
20
|
-
CommHubNotificationsRegistry =
|
|
19
|
+
}
|
|
20
|
+
CommHubNotificationsRegistry = _ts_decorate([
|
|
21
21
|
injectable(),
|
|
22
|
-
|
|
22
|
+
_ts_metadata("design:type", Function),
|
|
23
|
+
_ts_metadata("design:paramtypes", [])
|
|
23
24
|
], CommHubNotificationsRegistry);
|
|
24
|
-
export
|
|
25
|
-
|
|
26
|
-
constructor() {
|
|
25
|
+
export class CommHubNotificationsRegistryReader extends RegistryReader {
|
|
26
|
+
constructor(){
|
|
27
27
|
super(commHubNotificationsRegistryId);
|
|
28
28
|
}
|
|
29
|
-
}
|
|
30
|
-
CommHubNotificationsRegistryReader =
|
|
29
|
+
}
|
|
30
|
+
CommHubNotificationsRegistryReader = _ts_decorate([
|
|
31
31
|
injectable(),
|
|
32
|
-
|
|
32
|
+
_ts_metadata("design:type", Function),
|
|
33
|
+
_ts_metadata("design:paramtypes", [])
|
|
33
34
|
], CommHubNotificationsRegistryReader);
|
|
34
|
-
export
|
|
35
|
-
|
|
36
|
-
constructor() {
|
|
35
|
+
export class CommHubNotificationsRegistryWriter extends RegistryWriter {
|
|
36
|
+
constructor(){
|
|
37
37
|
super(commHubNotificationsRegistryId);
|
|
38
38
|
}
|
|
39
|
-
}
|
|
40
|
-
CommHubNotificationsRegistryWriter =
|
|
39
|
+
}
|
|
40
|
+
CommHubNotificationsRegistryWriter = _ts_decorate([
|
|
41
41
|
injectable(),
|
|
42
|
-
|
|
42
|
+
_ts_metadata("design:type", Function),
|
|
43
|
+
_ts_metadata("design:paramtypes", [])
|
|
43
44
|
], CommHubNotificationsRegistryWriter);
|
|
44
|
-
export
|
|
45
|
-
|
|
46
|
-
constructor() {
|
|
45
|
+
export class CommHubNotificationsRegistryStore extends RegistryStore {
|
|
46
|
+
constructor(){
|
|
47
47
|
super(commHubNotificationsRegistryId);
|
|
48
48
|
}
|
|
49
|
-
}
|
|
50
|
-
CommHubNotificationsRegistryStore =
|
|
49
|
+
}
|
|
50
|
+
CommHubNotificationsRegistryStore = _ts_decorate([
|
|
51
51
|
injectable(),
|
|
52
|
-
|
|
52
|
+
_ts_metadata("design:type", Function),
|
|
53
|
+
_ts_metadata("design:paramtypes", [])
|
|
53
54
|
], CommHubNotificationsRegistryStore);
|
|
54
|
-
export { CommHubNotificationsRegistryStore };
|
|
55
55
|
export const CommHubNotificationsRegistryProvider = provide({
|
|
56
56
|
singletons: [
|
|
57
57
|
CommHubNotificationsRegistry,
|
|
58
58
|
CommHubNotificationsRegistryWriter,
|
|
59
|
-
CommHubNotificationsRegistryReader
|
|
60
|
-
]
|
|
61
|
-
})(({ children })
|
|
59
|
+
CommHubNotificationsRegistryReader
|
|
60
|
+
]
|
|
61
|
+
})(({ children })=>{
|
|
62
62
|
useDependencies(CommHubNotificationsRegistry);
|
|
63
63
|
return children;
|
|
64
64
|
});
|
|
65
|
+
|
|
65
66
|
//# sourceMappingURL=comm-hub-notifications-registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/comm-hub-notifications-registry.ts"],"sourcesContent":["import { injectable, provide, useDependencies } from '@servicetitan/react-ioc';\nimport {\n RegistryReader,\n RegistryService,\n RegistryWriter,\n} from '@servicetitan/shared-data-registry';\nimport { RegistryStore } from '@servicetitan/shared-data-registry/mobx';\n\nexport const commHubNotificationsRegistryId = 'toolbelt:comm-hub-notif-registry-id';\nexport const CommHubNotificationsItemId = 'notifications-count';\n\nexport interface CommHubNotificationsRegistryItem {\n count: number;\n}\n\n@injectable()\nexport class CommHubNotificationsRegistry extends RegistryService<CommHubNotificationsRegistryItem> {\n constructor() {\n super(commHubNotificationsRegistryId);\n }\n}\n\n@injectable()\nexport class CommHubNotificationsRegistryReader extends RegistryReader<CommHubNotificationsRegistryItem> {\n constructor() {\n super(commHubNotificationsRegistryId);\n }\n}\n\n@injectable()\nexport class CommHubNotificationsRegistryWriter extends RegistryWriter<CommHubNotificationsRegistryItem> {\n constructor() {\n super(commHubNotificationsRegistryId);\n }\n}\n\n@injectable()\nexport class CommHubNotificationsRegistryStore extends RegistryStore<CommHubNotificationsRegistryItem> {\n constructor() {\n super(commHubNotificationsRegistryId);\n }\n}\n\nexport const CommHubNotificationsRegistryProvider = provide({\n singletons: [\n CommHubNotificationsRegistry,\n CommHubNotificationsRegistryWriter,\n CommHubNotificationsRegistryReader,\n ],\n})(({ children }) => {\n useDependencies(CommHubNotificationsRegistry);\n\n return children;\n});\n"],"names":["injectable","provide","useDependencies","RegistryReader","RegistryService","RegistryWriter","RegistryStore","commHubNotificationsRegistryId","CommHubNotificationsItemId","CommHubNotificationsRegistry","constructor","CommHubNotificationsRegistryReader","CommHubNotificationsRegistryWriter","CommHubNotificationsRegistryStore","CommHubNotificationsRegistryProvider","singletons","children"],"mappings":";;;;;;;;;AAAA,SAASA,UAAU,EAAEC,OAAO,EAAEC,eAAe,QAAQ,0BAA0B;AAC/E,SACIC,cAAc,EACdC,eAAe,EACfC,cAAc,QACX,qCAAqC;AAC5C,SAASC,aAAa,QAAQ,0CAA0C;AAExE,OAAO,MAAMC,iCAAiC,sCAAsC;AACpF,OAAO,MAAMC,6BAA6B,sBAAsB;AAOhE,OAAO,MAAMC,qCAAqCL;IAC9CM,aAAc;QACV,KAAK,CAACH;IACV;AACJ;;;;;;AAGA,OAAO,MAAMI,2CAA2CR;IACpDO,aAAc;QACV,KAAK,CAACH;IACV;AACJ;;;;;;AAGA,OAAO,MAAMK,2CAA2CP;IACpDK,aAAc;QACV,KAAK,CAACH;IACV;AACJ;;;;;;AAGA,OAAO,MAAMM,0CAA0CP;IACnDI,aAAc;QACV,KAAK,CAACH;IACV;AACJ;;;;;;AAEA,OAAO,MAAMO,uCAAuCb,QAAQ;IACxDc,YAAY;QACRN;QACAG;QACAD;KACH;AACL,GAAG,CAAC,EAAEK,QAAQ,EAAE;IACZd,gBAAgBO;IAEhB,OAAOO;AACX,GAAG"}
|
|
@@ -2,7 +2,7 @@ import { RegistryReader, RegistryService, RegistryWriter } from '@servicetitan/s
|
|
|
2
2
|
import { RegistryStore } from '@servicetitan/shared-data-registry/mobx';
|
|
3
3
|
export declare const commHubRegistryId = "toolbelt:comm-hub-registry-id";
|
|
4
4
|
export declare const CommHubActivePanelItemId = "active-panel";
|
|
5
|
-
export type CommHubActivePanelType = 'chat:channel' | 'chat:thread' | 'chat:mention' | 'chat:entity' | 'email';
|
|
5
|
+
export type CommHubActivePanelType = 'chat:channel' | 'chat:thread' | 'chat:mention' | 'chat:entity' | 'email:entity' | 'email';
|
|
6
6
|
interface ChatPanelChannelData {
|
|
7
7
|
conversationId: string;
|
|
8
8
|
}
|
|
@@ -23,18 +23,30 @@ interface ChatPanelMentionData {
|
|
|
23
23
|
};
|
|
24
24
|
parentMessageChatId?: string;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Data structure for entity panel information in the communication hub.
|
|
28
|
+
* Used for both chat and email entity panels.
|
|
29
|
+
*/
|
|
30
|
+
interface PanelEntityData {
|
|
31
|
+
/** Unique identifier for the entity */
|
|
27
32
|
id: string;
|
|
33
|
+
/** Display name of the entity */
|
|
28
34
|
name: string;
|
|
35
|
+
/** Entity type identifier */
|
|
29
36
|
type: string;
|
|
37
|
+
/** Human-readable type name */
|
|
30
38
|
typeName: string;
|
|
39
|
+
/** Panel title text (including id, type name and name) */
|
|
40
|
+
title: string;
|
|
41
|
+
/** Optional URL link to the entity */
|
|
42
|
+
link?: string;
|
|
31
43
|
}
|
|
32
44
|
interface EmailPanelData {
|
|
33
45
|
conversationId: string;
|
|
34
46
|
}
|
|
35
47
|
export interface CommHubRegistryItem<T extends CommHubActivePanelType> {
|
|
36
48
|
type: T;
|
|
37
|
-
data: T extends 'chat:channel' ? ChatPanelChannelData : T extends 'chat:thread' ? ChatPanelThreadData : T extends 'chat:mention' ? ChatPanelMentionData : T extends 'chat:entity' ?
|
|
49
|
+
data: T extends 'chat:channel' ? ChatPanelChannelData : T extends 'chat:thread' ? ChatPanelThreadData : T extends 'chat:mention' ? ChatPanelMentionData : T extends 'chat:entity' ? PanelEntityData : T extends 'email:entity' ? PanelEntityData : EmailPanelData;
|
|
38
50
|
}
|
|
39
51
|
export declare class CommHubRegistry<T extends CommHubActivePanelType> extends RegistryService<CommHubRegistryItem<T>> {
|
|
40
52
|
constructor();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comm-hub-registry.d.ts","sourceRoot":"","sources":["../src/comm-hub-registry.ts"],"names":[],"mappings":"AACA,OAAO,EACH,cAAc,EACd,eAAe,EACf,cAAc,EACjB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAExE,eAAO,MAAM,iBAAiB,kCAAkC,CAAC;AAEjE,eAAO,MAAM,wBAAwB,iBAAiB,CAAC;AAEvD,MAAM,MAAM,sBAAsB,GAC5B,cAAc,GACd,aAAa,GACb,cAAc,GACd,aAAa,GACb,OAAO,CAAC;AAEd,UAAU,oBAAoB;IAC1B,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,UAAU,mBAAmB;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE;QAChB,cAAc,EAAE,MAAM,CAAC;QACvB,oBAAoB,EAAE,MAAM,CAAC;KAChC,CAAC;IACF,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,oBAAoB;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,kBAAkB,CAAC,EAAE;QACjB,cAAc,EAAE,MAAM,CAAC;QACvB,oBAAoB,EAAE,MAAM,CAAC;KAChC,CAAC;IACF,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,UAAU,
|
|
1
|
+
{"version":3,"file":"comm-hub-registry.d.ts","sourceRoot":"","sources":["../src/comm-hub-registry.ts"],"names":[],"mappings":"AACA,OAAO,EACH,cAAc,EACd,eAAe,EACf,cAAc,EACjB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAExE,eAAO,MAAM,iBAAiB,kCAAkC,CAAC;AAEjE,eAAO,MAAM,wBAAwB,iBAAiB,CAAC;AAEvD,MAAM,MAAM,sBAAsB,GAC5B,cAAc,GACd,aAAa,GACb,cAAc,GACd,aAAa,GACb,cAAc,GACd,OAAO,CAAC;AAEd,UAAU,oBAAoB;IAC1B,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,UAAU,mBAAmB;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE;QAChB,cAAc,EAAE,MAAM,CAAC;QACvB,oBAAoB,EAAE,MAAM,CAAC;KAChC,CAAC;IACF,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,oBAAoB;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,kBAAkB,CAAC,EAAE;QACjB,cAAc,EAAE,MAAM,CAAC;QACvB,oBAAoB,EAAE,MAAM,CAAC;KAChC,CAAC;IACF,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED;;;GAGG;AACH,UAAU,eAAe;IACrB,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,cAAc;IACpB,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,sBAAsB;IACjE,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,EAAE,CAAC,SAAS,cAAc,GACxB,oBAAoB,GACpB,CAAC,SAAS,aAAa,GACrB,mBAAmB,GACnB,CAAC,SAAS,cAAc,GACtB,oBAAoB,GACpB,CAAC,SAAS,aAAa,GACrB,eAAe,GACf,CAAC,SAAS,cAAc,GACtB,eAAe,GACf,cAAc,CAAC;CAChC;AAED,qBACa,eAAe,CAAC,CAAC,SAAS,sBAAsB,CAAE,SAAQ,eAAe,CAClF,mBAAmB,CAAC,CAAC,CAAC,CACzB;;CAIA;AAED,qBACa,qBAAqB,CAAC,CAAC,SAAS,sBAAsB,CAAE,SAAQ,cAAc,CACvF,mBAAmB,CAAC,CAAC,CAAC,CACzB;;CAIA;AAED,qBACa,qBAAqB,CAAC,CAAC,SAAS,sBAAsB,CAAE,SAAQ,cAAc,CACvF,mBAAmB,CAAC,CAAC,CAAC,CACzB;;CAIA;AAED,qBACa,oBAAoB,CAAC,CAAC,SAAS,sBAAsB,CAAE,SAAQ,aAAa,CACrF,mBAAmB,CAAC,CAAC,CAAC,CACzB;;CAIA;AAED,eAAO,MAAM,uBAAuB,4HAMlC,CAAC"}
|
|
@@ -1,61 +1,66 @@
|
|
|
1
|
-
|
|
1
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
2
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for
|
|
4
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
}
|
|
7
|
-
|
|
6
|
+
}
|
|
7
|
+
function _ts_metadata(k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
}
|
|
9
|
+
}
|
|
10
10
|
import { injectable, provide, useDependencies } from '@servicetitan/react-ioc';
|
|
11
|
-
import { RegistryReader, RegistryService, RegistryWriter
|
|
11
|
+
import { RegistryReader, RegistryService, RegistryWriter } from '@servicetitan/shared-data-registry';
|
|
12
12
|
import { RegistryStore } from '@servicetitan/shared-data-registry/mobx';
|
|
13
13
|
export const commHubRegistryId = 'toolbelt:comm-hub-registry-id';
|
|
14
14
|
export const CommHubActivePanelItemId = 'active-panel';
|
|
15
|
-
|
|
16
|
-
constructor()
|
|
15
|
+
export class CommHubRegistry extends RegistryService {
|
|
16
|
+
constructor(){
|
|
17
17
|
super(commHubRegistryId);
|
|
18
18
|
}
|
|
19
|
-
}
|
|
20
|
-
CommHubRegistry =
|
|
19
|
+
}
|
|
20
|
+
CommHubRegistry = _ts_decorate([
|
|
21
21
|
injectable(),
|
|
22
|
-
|
|
22
|
+
_ts_metadata("design:type", Function),
|
|
23
|
+
_ts_metadata("design:paramtypes", [])
|
|
23
24
|
], CommHubRegistry);
|
|
24
|
-
export
|
|
25
|
-
|
|
26
|
-
constructor() {
|
|
25
|
+
export class CommHubRegistryReader extends RegistryReader {
|
|
26
|
+
constructor(){
|
|
27
27
|
super(commHubRegistryId);
|
|
28
28
|
}
|
|
29
|
-
}
|
|
30
|
-
CommHubRegistryReader =
|
|
29
|
+
}
|
|
30
|
+
CommHubRegistryReader = _ts_decorate([
|
|
31
31
|
injectable(),
|
|
32
|
-
|
|
32
|
+
_ts_metadata("design:type", Function),
|
|
33
|
+
_ts_metadata("design:paramtypes", [])
|
|
33
34
|
], CommHubRegistryReader);
|
|
34
|
-
export
|
|
35
|
-
|
|
36
|
-
constructor() {
|
|
35
|
+
export class CommHubRegistryWriter extends RegistryWriter {
|
|
36
|
+
constructor(){
|
|
37
37
|
super(commHubRegistryId);
|
|
38
38
|
}
|
|
39
|
-
}
|
|
40
|
-
CommHubRegistryWriter =
|
|
39
|
+
}
|
|
40
|
+
CommHubRegistryWriter = _ts_decorate([
|
|
41
41
|
injectable(),
|
|
42
|
-
|
|
42
|
+
_ts_metadata("design:type", Function),
|
|
43
|
+
_ts_metadata("design:paramtypes", [])
|
|
43
44
|
], CommHubRegistryWriter);
|
|
44
|
-
export
|
|
45
|
-
|
|
46
|
-
constructor() {
|
|
45
|
+
export class CommHubRegistryStore extends RegistryStore {
|
|
46
|
+
constructor(){
|
|
47
47
|
super(commHubRegistryId);
|
|
48
48
|
}
|
|
49
|
-
}
|
|
50
|
-
CommHubRegistryStore =
|
|
49
|
+
}
|
|
50
|
+
CommHubRegistryStore = _ts_decorate([
|
|
51
51
|
injectable(),
|
|
52
|
-
|
|
52
|
+
_ts_metadata("design:type", Function),
|
|
53
|
+
_ts_metadata("design:paramtypes", [])
|
|
53
54
|
], CommHubRegistryStore);
|
|
54
|
-
export { CommHubRegistryStore };
|
|
55
55
|
export const CommHubRegistryProvider = provide({
|
|
56
|
-
singletons: [
|
|
57
|
-
|
|
56
|
+
singletons: [
|
|
57
|
+
CommHubRegistry,
|
|
58
|
+
CommHubRegistryWriter,
|
|
59
|
+
CommHubRegistryReader
|
|
60
|
+
]
|
|
61
|
+
})(({ children })=>{
|
|
58
62
|
useDependencies(CommHubRegistry);
|
|
59
63
|
return children;
|
|
60
64
|
});
|
|
65
|
+
|
|
61
66
|
//# sourceMappingURL=comm-hub-registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/comm-hub-registry.ts"],"sourcesContent":["import { injectable, provide, useDependencies } from '@servicetitan/react-ioc';\nimport {\n RegistryReader,\n RegistryService,\n RegistryWriter,\n} from '@servicetitan/shared-data-registry';\nimport { RegistryStore } from '@servicetitan/shared-data-registry/mobx';\n\nexport const commHubRegistryId = 'toolbelt:comm-hub-registry-id';\n\nexport const CommHubActivePanelItemId = 'active-panel';\n\nexport type CommHubActivePanelType =\n | 'chat:channel'\n | 'chat:thread'\n | 'chat:mention'\n | 'chat:entity'\n | 'email:entity'\n | 'email';\n\ninterface ChatPanelChannelData {\n conversationId: string;\n}\n\ninterface ChatPanelThreadData {\n conversationId: string;\n parentConversation: {\n conversationId: string;\n conversationThreadId: string;\n };\n chatMessageId: string;\n}\n\ninterface ChatPanelMentionData {\n conversationId: string;\n mentionMessageChatId: string;\n parentConversation?: {\n conversationId: string;\n conversationThreadId: string;\n };\n parentMessageChatId?: string;\n}\n\n/**\n * Data structure for entity panel information in the communication hub.\n * Used for both chat and email entity panels.\n */\ninterface PanelEntityData {\n /** Unique identifier for the entity */\n id: string;\n /** Display name of the entity */\n name: string;\n /** Entity type identifier */\n type: string;\n /** Human-readable type name */\n typeName: string;\n /** Panel title text (including id, type name and name) */\n title: string;\n /** Optional URL link to the entity */\n link?: string;\n}\n\ninterface EmailPanelData {\n conversationId: string;\n}\n\nexport interface CommHubRegistryItem<T extends CommHubActivePanelType> {\n type: T;\n data: T extends 'chat:channel'\n ? ChatPanelChannelData\n : T extends 'chat:thread'\n ? ChatPanelThreadData\n : T extends 'chat:mention'\n ? ChatPanelMentionData\n : T extends 'chat:entity'\n ? PanelEntityData\n : T extends 'email:entity'\n ? PanelEntityData\n : EmailPanelData;\n}\n\n@injectable()\nexport class CommHubRegistry<T extends CommHubActivePanelType> extends RegistryService<\n CommHubRegistryItem<T>\n> {\n constructor() {\n super(commHubRegistryId);\n }\n}\n\n@injectable()\nexport class CommHubRegistryReader<T extends CommHubActivePanelType> extends RegistryReader<\n CommHubRegistryItem<T>\n> {\n constructor() {\n super(commHubRegistryId);\n }\n}\n\n@injectable()\nexport class CommHubRegistryWriter<T extends CommHubActivePanelType> extends RegistryWriter<\n CommHubRegistryItem<T>\n> {\n constructor() {\n super(commHubRegistryId);\n }\n}\n\n@injectable()\nexport class CommHubRegistryStore<T extends CommHubActivePanelType> extends RegistryStore<\n CommHubRegistryItem<T>\n> {\n constructor() {\n super(commHubRegistryId);\n }\n}\n\nexport const CommHubRegistryProvider = provide({\n singletons: [CommHubRegistry, CommHubRegistryWriter, CommHubRegistryReader],\n})(({ children }) => {\n useDependencies(CommHubRegistry);\n\n return children;\n});\n"],"names":["injectable","provide","useDependencies","RegistryReader","RegistryService","RegistryWriter","RegistryStore","commHubRegistryId","CommHubActivePanelItemId","CommHubRegistry","constructor","CommHubRegistryReader","CommHubRegistryWriter","CommHubRegistryStore","CommHubRegistryProvider","singletons","children"],"mappings":";;;;;;;;;AAAA,SAASA,UAAU,EAAEC,OAAO,EAAEC,eAAe,QAAQ,0BAA0B;AAC/E,SACIC,cAAc,EACdC,eAAe,EACfC,cAAc,QACX,qCAAqC;AAC5C,SAASC,aAAa,QAAQ,0CAA0C;AAExE,OAAO,MAAMC,oBAAoB,gCAAgC;AAEjE,OAAO,MAAMC,2BAA2B,eAAe;AAwEvD,OAAO,MAAMC,wBAA0DL;IAGnEM,aAAc;QACV,KAAK,CAACH;IACV;AACJ;;;;;;AAGA,OAAO,MAAMI,8BAAgER;IAGzEO,aAAc;QACV,KAAK,CAACH;IACV;AACJ;;;;;;AAGA,OAAO,MAAMK,8BAAgEP;IAGzEK,aAAc;QACV,KAAK,CAACH;IACV;AACJ;;;;;;AAGA,OAAO,MAAMM,6BAA+DP;IAGxEI,aAAc;QACV,KAAK,CAACH;IACV;AACJ;;;;;;AAEA,OAAO,MAAMO,0BAA0Bb,QAAQ;IAC3Cc,YAAY;QAACN;QAAiBG;QAAuBD;KAAsB;AAC/E,GAAG,CAAC,EAAEK,QAAQ,EAAE;IACZd,gBAAgBO;IAEhB,OAAOO;AACX,GAAG"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './comm-hub-registry';\nexport * from './comm-hub-notifications-registry';\n"],"names":[],"mappings":"AAAA,cAAc,sBAAsB;AACpC,cAAc,oCAAoC"}
|
package/package.json
CHANGED
|
@@ -1,32 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/toolbelt-shared-registry",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
7
7
|
"src"
|
|
8
8
|
],
|
|
9
9
|
"main": "./dist/index.js",
|
|
10
|
-
"
|
|
11
|
-
"@servicetitan/
|
|
12
|
-
"@servicetitan/react-ioc": "~30.1.1",
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@servicetitan/react-ioc": "^31.4.0",
|
|
13
12
|
"@servicetitan/shared-data-registry": "~1.1.0",
|
|
13
|
+
"@types/react": "^18.3.11",
|
|
14
14
|
"react": "^18.3.1"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@servicetitan/log-service": ">=30.1.1",
|
|
18
17
|
"@servicetitan/react-ioc": ">=30.1.1",
|
|
19
|
-
"@servicetitan/shared-data-registry": "
|
|
18
|
+
"@servicetitan/shared-data-registry": ">=1.0.0",
|
|
20
19
|
"react": ">=18.0.0"
|
|
21
20
|
},
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@types/react": "^18.3.11"
|
|
24
|
-
},
|
|
25
21
|
"publishConfig": {
|
|
26
22
|
"access": "public"
|
|
27
23
|
},
|
|
28
24
|
"cli": {
|
|
29
25
|
"webpack": false
|
|
30
26
|
},
|
|
31
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "930c7c7f1b8a81ecc2317bb677c10ba6d9db2621"
|
|
32
28
|
}
|
package/src/comm-hub-registry.ts
CHANGED
|
@@ -15,6 +15,7 @@ export type CommHubActivePanelType =
|
|
|
15
15
|
| 'chat:thread'
|
|
16
16
|
| 'chat:mention'
|
|
17
17
|
| 'chat:entity'
|
|
18
|
+
| 'email:entity'
|
|
18
19
|
| 'email';
|
|
19
20
|
|
|
20
21
|
interface ChatPanelChannelData {
|
|
@@ -40,11 +41,23 @@ interface ChatPanelMentionData {
|
|
|
40
41
|
parentMessageChatId?: string;
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Data structure for entity panel information in the communication hub.
|
|
46
|
+
* Used for both chat and email entity panels.
|
|
47
|
+
*/
|
|
48
|
+
interface PanelEntityData {
|
|
49
|
+
/** Unique identifier for the entity */
|
|
44
50
|
id: string;
|
|
51
|
+
/** Display name of the entity */
|
|
45
52
|
name: string;
|
|
53
|
+
/** Entity type identifier */
|
|
46
54
|
type: string;
|
|
55
|
+
/** Human-readable type name */
|
|
47
56
|
typeName: string;
|
|
57
|
+
/** Panel title text (including id, type name and name) */
|
|
58
|
+
title: string;
|
|
59
|
+
/** Optional URL link to the entity */
|
|
60
|
+
link?: string;
|
|
48
61
|
}
|
|
49
62
|
|
|
50
63
|
interface EmailPanelData {
|
|
@@ -60,8 +73,10 @@ export interface CommHubRegistryItem<T extends CommHubActivePanelType> {
|
|
|
60
73
|
: T extends 'chat:mention'
|
|
61
74
|
? ChatPanelMentionData
|
|
62
75
|
: T extends 'chat:entity'
|
|
63
|
-
?
|
|
64
|
-
:
|
|
76
|
+
? PanelEntityData
|
|
77
|
+
: T extends 'email:entity'
|
|
78
|
+
? PanelEntityData
|
|
79
|
+
: EmailPanelData;
|
|
65
80
|
}
|
|
66
81
|
|
|
67
82
|
@injectable()
|