@servicetitan/toolbelt-shared-registry 1.3.1 → 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.
@@ -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
- interface ChatPanelEntityData {
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' ? ChatPanelEntityData : EmailPanelData;
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,mBAAmB;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,cAAc;IACpB,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,sBAAsB;I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,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 +1 @@
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';\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\ninterface ChatPanelEntityData {\n id: string;\n name: string;\n type: string;\n typeName: 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 ? ChatPanelEntityData\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;AAyDvD,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"}
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/toolbelt-shared-registry",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
4
4
  "description": "",
5
5
  "files": [
6
6
  "dist",
@@ -24,5 +24,5 @@
24
24
  "cli": {
25
25
  "webpack": false
26
26
  },
27
- "gitHead": "39e76910a22a9f965cb4fde2d81e79788f91d100"
27
+ "gitHead": "930c7c7f1b8a81ecc2317bb677c10ba6d9db2621"
28
28
  }
@@ -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
- interface ChatPanelEntityData {
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
- ? ChatPanelEntityData
64
- : EmailPanelData;
76
+ ? PanelEntityData
77
+ : T extends 'email:entity'
78
+ ? PanelEntityData
79
+ : EmailPanelData;
65
80
  }
66
81
 
67
82
  @injectable()