@servicetitan/toolbelt-shared-registry 1.7.4 → 1.8.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.
|
@@ -3,30 +3,13 @@ import { RegistryReader, RegistryService, RegistryWriter } from '@servicetitan/s
|
|
|
3
3
|
import { RegistryStore } from '@servicetitan/shared-data-registry/mobx';
|
|
4
4
|
export declare const commHubRegistryId = "toolbelt:comm-hub-registry-id";
|
|
5
5
|
export declare const CommHubActivePanelItemId = "active-panel";
|
|
6
|
-
export type CommHubActivePanelType = '
|
|
7
|
-
interface
|
|
6
|
+
export type CommHubActivePanelType = 'conversation' | 'chat:entity';
|
|
7
|
+
interface ConversationPanelData {
|
|
8
8
|
conversationId: string;
|
|
9
|
-
|
|
10
|
-
interface ChatPanelThreadData {
|
|
11
|
-
conversationId: string;
|
|
12
|
-
parentConversation: {
|
|
13
|
-
conversationId: string;
|
|
14
|
-
conversationThreadId: string;
|
|
15
|
-
};
|
|
16
|
-
chatMessageId: string;
|
|
17
|
-
}
|
|
18
|
-
interface ChatPanelMentionData {
|
|
19
|
-
conversationId: string;
|
|
20
|
-
mentionMessageChatId: string;
|
|
21
|
-
parentConversation?: {
|
|
22
|
-
conversationId: string;
|
|
23
|
-
conversationThreadId: string;
|
|
24
|
-
};
|
|
25
|
-
parentMessageChatId?: string;
|
|
9
|
+
goToMessageChatId?: string;
|
|
26
10
|
}
|
|
27
11
|
/**
|
|
28
12
|
* Data structure for entity panel information in the communication hub.
|
|
29
|
-
* Used for both chat and email entity panels.
|
|
30
13
|
*/
|
|
31
14
|
interface PanelEntityData {
|
|
32
15
|
/** Unique identifier for the entity */
|
|
@@ -43,15 +26,17 @@ interface PanelEntityData {
|
|
|
43
26
|
link?: string;
|
|
44
27
|
/** Optional subtitle text for the entity */
|
|
45
28
|
subtitle?: string;
|
|
29
|
+
/** Optional root entity reference for related comms feed */
|
|
30
|
+
rootEntity?: {
|
|
31
|
+
type: string;
|
|
32
|
+
id: string;
|
|
33
|
+
};
|
|
46
34
|
/** Optional additional data associated with the entity */
|
|
47
35
|
data?: Record<string, JSON>;
|
|
48
36
|
}
|
|
49
|
-
interface EmailPanelData {
|
|
50
|
-
conversationId: string;
|
|
51
|
-
}
|
|
52
37
|
export interface CommHubRegistryItem<T extends CommHubActivePanelType> {
|
|
53
38
|
type: T;
|
|
54
|
-
data: T extends '
|
|
39
|
+
data: T extends 'conversation' ? ConversationPanelData : PanelEntityData;
|
|
55
40
|
}
|
|
56
41
|
export declare class CommHubRegistry<T extends CommHubActivePanelType> extends RegistryService<CommHubRegistryItem<T>> {
|
|
57
42
|
constructor();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comm-hub-registry.d.ts","sourceRoot":"","sources":["../src/comm-hub-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAEzD,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,
|
|
1
|
+
{"version":3,"file":"comm-hub-registry.d.ts","sourceRoot":"","sources":["../src/comm-hub-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAEzD,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,GAAG,cAAc,GAAG,aAAa,CAAC;AAEpE,UAAU,qBA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,eAAO,MAAM,uBAAuB,4HAMlC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/comm-hub-registry.ts"],"sourcesContent":["import type { JSON } from '@servicetitan/web-components';\nimport { 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
|
|
1
|
+
{"version":3,"sources":["../src/comm-hub-registry.ts"],"sourcesContent":["import type { JSON } from '@servicetitan/web-components';\nimport { 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 = 'conversation' | 'chat:entity';\n\ninterface ConversationPanelData {\n conversationId: string;\n goToMessageChatId?: string;\n}\n\n/**\n * Data structure for entity panel information in the communication hub.\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 /** Optional subtitle text for the entity */\n subtitle?: string;\n /** Optional root entity reference for related comms feed */\n rootEntity?: {\n type: string;\n id: string;\n };\n /** Optional additional data associated with the entity */\n data?: Record<string, JSON>;\n}\n\nexport interface CommHubRegistryItem<T extends CommHubActivePanelType> {\n type: T;\n data: T extends 'conversation' ? ConversationPanelData : PanelEntityData;\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","CommHubRegistryReader","CommHubRegistryWriter","CommHubRegistryStore","CommHubRegistryProvider","singletons","children"],"mappings":";;;;;;;;;AACA,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;AA0CvD,OAAO,MAAMC,wBAA0DL;IAGnE,aAAc;QACV,KAAK,CAACG;IACV;AACJ;;;;;;AAGA,OAAO,MAAMG,8BAAgEP;IAGzE,aAAc;QACV,KAAK,CAACI;IACV;AACJ;;;;;;AAGA,OAAO,MAAMI,8BAAgEN;IAGzE,aAAc;QACV,KAAK,CAACE;IACV;AACJ;;;;;;AAGA,OAAO,MAAMK,6BAA+DN;IAGxE,aAAc;QACV,KAAK,CAACC;IACV;AACJ;;;;;;AAEA,OAAO,MAAMM,0BAA0BZ,QAAQ;IAC3Ca,YAAY;QAACL;QAAiBE;QAAuBD;KAAsB;AAC/E,GAAG,CAAC,EAAEK,QAAQ,EAAE;IACZb,gBAAgBO;IAEhB,OAAOM;AACX,GAAG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/toolbelt-shared-registry",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"cli": {
|
|
27
27
|
"webpack": false
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "2e5f8c93c56840425e4137190213a24837316290"
|
|
30
30
|
}
|
package/src/comm-hub-registry.ts
CHANGED
|
@@ -11,40 +11,15 @@ export const commHubRegistryId = 'toolbelt:comm-hub-registry-id';
|
|
|
11
11
|
|
|
12
12
|
export const CommHubActivePanelItemId = 'active-panel';
|
|
13
13
|
|
|
14
|
-
export type CommHubActivePanelType =
|
|
15
|
-
| 'chat:channel'
|
|
16
|
-
| 'chat:thread'
|
|
17
|
-
| 'chat:mention'
|
|
18
|
-
| 'chat:entity'
|
|
19
|
-
| 'email:entity'
|
|
20
|
-
| 'email';
|
|
14
|
+
export type CommHubActivePanelType = 'conversation' | 'chat:entity';
|
|
21
15
|
|
|
22
|
-
interface
|
|
16
|
+
interface ConversationPanelData {
|
|
23
17
|
conversationId: string;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
interface ChatPanelThreadData {
|
|
27
|
-
conversationId: string;
|
|
28
|
-
parentConversation: {
|
|
29
|
-
conversationId: string;
|
|
30
|
-
conversationThreadId: string;
|
|
31
|
-
};
|
|
32
|
-
chatMessageId: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
interface ChatPanelMentionData {
|
|
36
|
-
conversationId: string;
|
|
37
|
-
mentionMessageChatId: string;
|
|
38
|
-
parentConversation?: {
|
|
39
|
-
conversationId: string;
|
|
40
|
-
conversationThreadId: string;
|
|
41
|
-
};
|
|
42
|
-
parentMessageChatId?: string;
|
|
18
|
+
goToMessageChatId?: string;
|
|
43
19
|
}
|
|
44
20
|
|
|
45
21
|
/**
|
|
46
22
|
* Data structure for entity panel information in the communication hub.
|
|
47
|
-
* Used for both chat and email entity panels.
|
|
48
23
|
*/
|
|
49
24
|
interface PanelEntityData {
|
|
50
25
|
/** Unique identifier for the entity */
|
|
@@ -61,27 +36,18 @@ interface PanelEntityData {
|
|
|
61
36
|
link?: string;
|
|
62
37
|
/** Optional subtitle text for the entity */
|
|
63
38
|
subtitle?: string;
|
|
39
|
+
/** Optional root entity reference for related comms feed */
|
|
40
|
+
rootEntity?: {
|
|
41
|
+
type: string;
|
|
42
|
+
id: string;
|
|
43
|
+
};
|
|
64
44
|
/** Optional additional data associated with the entity */
|
|
65
45
|
data?: Record<string, JSON>;
|
|
66
46
|
}
|
|
67
47
|
|
|
68
|
-
interface EmailPanelData {
|
|
69
|
-
conversationId: string;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
48
|
export interface CommHubRegistryItem<T extends CommHubActivePanelType> {
|
|
73
49
|
type: T;
|
|
74
|
-
data: T extends '
|
|
75
|
-
? ChatPanelChannelData
|
|
76
|
-
: T extends 'chat:thread'
|
|
77
|
-
? ChatPanelThreadData
|
|
78
|
-
: T extends 'chat:mention'
|
|
79
|
-
? ChatPanelMentionData
|
|
80
|
-
: T extends 'chat:entity'
|
|
81
|
-
? PanelEntityData
|
|
82
|
-
: T extends 'email:entity'
|
|
83
|
-
? PanelEntityData
|
|
84
|
-
: EmailPanelData;
|
|
50
|
+
data: T extends 'conversation' ? ConversationPanelData : PanelEntityData;
|
|
85
51
|
}
|
|
86
52
|
|
|
87
53
|
@injectable()
|