@servicetitan/toolbelt-shared-registry 1.1.2 → 1.3.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.
@@ -0,0 +1,21 @@
1
+ import { RegistryReader, RegistryService, RegistryWriter } from '@servicetitan/shared-data-registry';
2
+ import { RegistryStore } from '@servicetitan/shared-data-registry/mobx';
3
+ export declare const commHubNotificationsRegistryId = "toolbelt:comm-hub-notif-registry-id";
4
+ export declare const CommHubNotificationsItemId = "notifications-count";
5
+ export interface CommHubNotificationsRegistryItem {
6
+ count: number;
7
+ }
8
+ export declare class CommHubNotificationsRegistry extends RegistryService<CommHubNotificationsRegistryItem> {
9
+ constructor();
10
+ }
11
+ export declare class CommHubNotificationsRegistryReader extends RegistryReader<CommHubNotificationsRegistryItem> {
12
+ constructor();
13
+ }
14
+ export declare class CommHubNotificationsRegistryWriter extends RegistryWriter<CommHubNotificationsRegistryItem> {
15
+ constructor();
16
+ }
17
+ export declare class CommHubNotificationsRegistryStore extends RegistryStore<CommHubNotificationsRegistryItem> {
18
+ constructor();
19
+ }
20
+ export declare const CommHubNotificationsRegistryProvider: (({ children }: any) => any) & import("@servicetitan/react-ioc/dist/provide").WrappedComponent<({ children }: any) => any>;
21
+ //# sourceMappingURL=comm-hub-notifications-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comm-hub-notifications-registry.d.ts","sourceRoot":"","sources":["../src/comm-hub-notifications-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,8BAA8B,wCAAwC,CAAC;AACpF,eAAO,MAAM,0BAA0B,wBAAwB,CAAC;AAEhE,MAAM,WAAW,gCAAgC;IAC7C,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,qBACa,4BAA6B,SAAQ,eAAe,CAAC,gCAAgC,CAAC;;CAIlG;AAED,qBACa,kCAAmC,SAAQ,cAAc,CAAC,gCAAgC,CAAC;;CAIvG;AAED,qBACa,kCAAmC,SAAQ,cAAc,CAAC,gCAAgC,CAAC;;CAIvG;AAED,qBACa,iCAAkC,SAAQ,aAAa,CAAC,gCAAgC,CAAC;;CAIrG;AAED,eAAO,MAAM,oCAAoC,4HAU/C,CAAC"}
@@ -0,0 +1,65 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { injectable, provide, useDependencies } from '@servicetitan/react-ioc';
11
+ import { RegistryReader, RegistryService, RegistryWriter, } from '@servicetitan/shared-data-registry';
12
+ import { RegistryStore } from '@servicetitan/shared-data-registry/mobx';
13
+ export const commHubNotificationsRegistryId = 'toolbelt:comm-hub-notif-registry-id';
14
+ export const CommHubNotificationsItemId = 'notifications-count';
15
+ let CommHubNotificationsRegistry = class CommHubNotificationsRegistry extends RegistryService {
16
+ constructor() {
17
+ super(commHubNotificationsRegistryId);
18
+ }
19
+ };
20
+ CommHubNotificationsRegistry = __decorate([
21
+ injectable(),
22
+ __metadata("design:paramtypes", [])
23
+ ], CommHubNotificationsRegistry);
24
+ export { CommHubNotificationsRegistry };
25
+ let CommHubNotificationsRegistryReader = class CommHubNotificationsRegistryReader extends RegistryReader {
26
+ constructor() {
27
+ super(commHubNotificationsRegistryId);
28
+ }
29
+ };
30
+ CommHubNotificationsRegistryReader = __decorate([
31
+ injectable(),
32
+ __metadata("design:paramtypes", [])
33
+ ], CommHubNotificationsRegistryReader);
34
+ export { CommHubNotificationsRegistryReader };
35
+ let CommHubNotificationsRegistryWriter = class CommHubNotificationsRegistryWriter extends RegistryWriter {
36
+ constructor() {
37
+ super(commHubNotificationsRegistryId);
38
+ }
39
+ };
40
+ CommHubNotificationsRegistryWriter = __decorate([
41
+ injectable(),
42
+ __metadata("design:paramtypes", [])
43
+ ], CommHubNotificationsRegistryWriter);
44
+ export { CommHubNotificationsRegistryWriter };
45
+ let CommHubNotificationsRegistryStore = class CommHubNotificationsRegistryStore extends RegistryStore {
46
+ constructor() {
47
+ super(commHubNotificationsRegistryId);
48
+ }
49
+ };
50
+ CommHubNotificationsRegistryStore = __decorate([
51
+ injectable(),
52
+ __metadata("design:paramtypes", [])
53
+ ], CommHubNotificationsRegistryStore);
54
+ export { CommHubNotificationsRegistryStore };
55
+ export const CommHubNotificationsRegistryProvider = provide({
56
+ singletons: [
57
+ CommHubNotificationsRegistry,
58
+ CommHubNotificationsRegistryWriter,
59
+ CommHubNotificationsRegistryReader,
60
+ ],
61
+ })(({ children }) => {
62
+ useDependencies(CommHubNotificationsRegistry);
63
+ return children;
64
+ });
65
+ //# sourceMappingURL=comm-hub-notifications-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comm-hub-notifications-registry.js","sourceRoot":"","sources":["../src/comm-hub-notifications-registry.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EACH,cAAc,EACd,eAAe,EACf,cAAc,GACjB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAExE,MAAM,CAAC,MAAM,8BAA8B,GAAG,qCAAqC,CAAC;AACpF,MAAM,CAAC,MAAM,0BAA0B,GAAG,qBAAqB,CAAC;AAOzD,IAAM,4BAA4B,GAAlC,MAAM,4BAA6B,SAAQ,eAAiD;IAC/F;QACI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAC1C,CAAC;CACJ,CAAA;AAJY,4BAA4B;IADxC,UAAU,EAAE;;GACA,4BAA4B,CAIxC;;AAGM,IAAM,kCAAkC,GAAxC,MAAM,kCAAmC,SAAQ,cAAgD;IACpG;QACI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAC1C,CAAC;CACJ,CAAA;AAJY,kCAAkC;IAD9C,UAAU,EAAE;;GACA,kCAAkC,CAI9C;;AAGM,IAAM,kCAAkC,GAAxC,MAAM,kCAAmC,SAAQ,cAAgD;IACpG;QACI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAC1C,CAAC;CACJ,CAAA;AAJY,kCAAkC;IAD9C,UAAU,EAAE;;GACA,kCAAkC,CAI9C;;AAGM,IAAM,iCAAiC,GAAvC,MAAM,iCAAkC,SAAQ,aAA+C;IAClG;QACI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAC1C,CAAC;CACJ,CAAA;AAJY,iCAAiC;IAD7C,UAAU,EAAE;;GACA,iCAAiC,CAI7C;;AAED,MAAM,CAAC,MAAM,oCAAoC,GAAG,OAAO,CAAC;IACxD,UAAU,EAAE;QACR,4BAA4B;QAC5B,kCAAkC;QAClC,kCAAkC;KACrC;CACJ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAChB,eAAe,CAAC,4BAA4B,CAAC,CAAC;IAE9C,OAAO,QAAQ,CAAC;AACpB,CAAC,CAAC,CAAC"}
@@ -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' | 'email';
5
+ export type CommHubActivePanelType = 'chat:channel' | 'chat:thread' | 'chat:mention' | 'chat:entity' | 'email';
6
6
  interface ChatPanelChannelData {
7
7
  conversationId: string;
8
8
  }
@@ -17,13 +17,24 @@ interface ChatPanelThreadData {
17
17
  interface ChatPanelMentionData {
18
18
  conversationId: string;
19
19
  mentionMessageChatId: string;
20
+ parentConversation?: {
21
+ conversationId: string;
22
+ conversationThreadId: string;
23
+ };
24
+ parentMessageChatId?: string;
25
+ }
26
+ interface ChatPanelEntityData {
27
+ id: string;
28
+ name: string;
29
+ type: string;
30
+ typeName: string;
20
31
  }
21
32
  interface EmailPanelData {
22
33
  conversationId: string;
23
34
  }
24
35
  export interface CommHubRegistryItem<T extends CommHubActivePanelType> {
25
36
  type: T;
26
- data: T extends 'chat:channel' ? ChatPanelChannelData : T extends 'chat:thread' ? ChatPanelThreadData : T extends 'chat:mention' ? ChatPanelMentionData : EmailPanelData;
37
+ data: T extends 'chat:channel' ? ChatPanelChannelData : T extends 'chat:thread' ? ChatPanelThreadData : T extends 'chat:mention' ? ChatPanelMentionData : T extends 'chat:entity' ? ChatPanelEntityData : EmailPanelData;
27
38
  }
28
39
  export declare class CommHubRegistry<T extends CommHubActivePanelType> extends RegistryService<CommHubRegistryItem<T>> {
29
40
  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,GAAG,cAAc,GAAG,aAAa,GAAG,cAAc,GAAG,OAAO,CAAC;AAE/F,UAAU,oBAAoB;IAC1B,cA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AqB;IADjC,UAAU,EAAE;;GACA,qBAAqB,CAMjC;;AAGM,IAAM,qBAAqB,GAA3B,MAAM,qBAAwD,SAAQ,cAE5E;IACG;QACI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC7B,CAAC;CACJ,CAAA;AANY,qBAAqB;IADjC,UAAU,EAAE;;GACA,qBAAqB,CAMjC;;AAGM,IAAM,oBAAoB,GAA1B,MAAM,oBAAuD,SAAQ,aAE3E;IACG;QACI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC7B,CAAC;CACJ,CAAA;AANY,oBAAoB;IADhC,UAAU,EAAE;;GACA,oBAAoB,CAMhC;;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG,OAAO,CAAC;IAC3C,UAAU,EAAE,CAAC,eAAe,EAAE,qBAAqB,EAAE,qBAAqB,CAAC;CAC9E,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAChB,eAAe,CAAC,eAAe,CAAC,CAAC;IAEjC,OAAO,QAAQ,CAAC;AACpB,CAAC,CAAC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './comm-hub-registry';
2
+ export * from './comm-hub-notifications-registry';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,mCAAmC,CAAC"}
package/dist/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './comm-hub-registry';
2
+ export * from './comm-hub-notifications-registry';
2
3
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,mCAAmC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/toolbelt-shared-registry",
3
- "version": "1.1.2",
3
+ "version": "1.3.0",
4
4
  "description": "",
5
5
  "files": [
6
6
  "dist",
@@ -28,5 +28,5 @@
28
28
  "cli": {
29
29
  "webpack": false
30
30
  },
31
- "gitHead": "0e77cf9e7a29dbb46d7d425468d347ef220d3320"
31
+ "gitHead": "bd863ea73ea2c32d04f624d63c52ffba426df8a0"
32
32
  }
@@ -0,0 +1,54 @@
1
+ import { injectable, provide, useDependencies } from '@servicetitan/react-ioc';
2
+ import {
3
+ RegistryReader,
4
+ RegistryService,
5
+ RegistryWriter,
6
+ } from '@servicetitan/shared-data-registry';
7
+ import { RegistryStore } from '@servicetitan/shared-data-registry/mobx';
8
+
9
+ export const commHubNotificationsRegistryId = 'toolbelt:comm-hub-notif-registry-id';
10
+ export const CommHubNotificationsItemId = 'notifications-count';
11
+
12
+ export interface CommHubNotificationsRegistryItem {
13
+ count: number;
14
+ }
15
+
16
+ @injectable()
17
+ export class CommHubNotificationsRegistry extends RegistryService<CommHubNotificationsRegistryItem> {
18
+ constructor() {
19
+ super(commHubNotificationsRegistryId);
20
+ }
21
+ }
22
+
23
+ @injectable()
24
+ export class CommHubNotificationsRegistryReader extends RegistryReader<CommHubNotificationsRegistryItem> {
25
+ constructor() {
26
+ super(commHubNotificationsRegistryId);
27
+ }
28
+ }
29
+
30
+ @injectable()
31
+ export class CommHubNotificationsRegistryWriter extends RegistryWriter<CommHubNotificationsRegistryItem> {
32
+ constructor() {
33
+ super(commHubNotificationsRegistryId);
34
+ }
35
+ }
36
+
37
+ @injectable()
38
+ export class CommHubNotificationsRegistryStore extends RegistryStore<CommHubNotificationsRegistryItem> {
39
+ constructor() {
40
+ super(commHubNotificationsRegistryId);
41
+ }
42
+ }
43
+
44
+ export const CommHubNotificationsRegistryProvider = provide({
45
+ singletons: [
46
+ CommHubNotificationsRegistry,
47
+ CommHubNotificationsRegistryWriter,
48
+ CommHubNotificationsRegistryReader,
49
+ ],
50
+ })(({ children }) => {
51
+ useDependencies(CommHubNotificationsRegistry);
52
+
53
+ return children;
54
+ });
@@ -10,7 +10,12 @@ export const commHubRegistryId = 'toolbelt:comm-hub-registry-id';
10
10
 
11
11
  export const CommHubActivePanelItemId = 'active-panel';
12
12
 
13
- export type CommHubActivePanelType = 'chat:channel' | 'chat:thread' | 'chat:mention' | 'email';
13
+ export type CommHubActivePanelType =
14
+ | 'chat:channel'
15
+ | 'chat:thread'
16
+ | 'chat:mention'
17
+ | 'chat:entity'
18
+ | 'email';
14
19
 
15
20
  interface ChatPanelChannelData {
16
21
  conversationId: string;
@@ -28,6 +33,18 @@ interface ChatPanelThreadData {
28
33
  interface ChatPanelMentionData {
29
34
  conversationId: string;
30
35
  mentionMessageChatId: string;
36
+ parentConversation?: {
37
+ conversationId: string;
38
+ conversationThreadId: string;
39
+ };
40
+ parentMessageChatId?: string;
41
+ }
42
+
43
+ interface ChatPanelEntityData {
44
+ id: string;
45
+ name: string;
46
+ type: string;
47
+ typeName: string;
31
48
  }
32
49
 
33
50
  interface EmailPanelData {
@@ -42,7 +59,9 @@ export interface CommHubRegistryItem<T extends CommHubActivePanelType> {
42
59
  ? ChatPanelThreadData
43
60
  : T extends 'chat:mention'
44
61
  ? ChatPanelMentionData
45
- : EmailPanelData;
62
+ : T extends 'chat:entity'
63
+ ? ChatPanelEntityData
64
+ : EmailPanelData;
46
65
  }
47
66
 
48
67
  @injectable()
package/src/index.ts CHANGED
@@ -1 +1,2 @@
1
1
  export * from './comm-hub-registry';
2
+ export * from './comm-hub-notifications-registry';