@servicetitan/toolbelt-shared-registry 1.2.0 → 1.3.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.
@@ -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,66 @@
1
+ function _ts_decorate(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
+ function _ts_metadata(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
+ export class CommHubNotificationsRegistry extends RegistryService {
16
+ constructor(){
17
+ super(commHubNotificationsRegistryId);
18
+ }
19
+ }
20
+ CommHubNotificationsRegistry = _ts_decorate([
21
+ injectable(),
22
+ _ts_metadata("design:type", Function),
23
+ _ts_metadata("design:paramtypes", [])
24
+ ], CommHubNotificationsRegistry);
25
+ export class CommHubNotificationsRegistryReader extends RegistryReader {
26
+ constructor(){
27
+ super(commHubNotificationsRegistryId);
28
+ }
29
+ }
30
+ CommHubNotificationsRegistryReader = _ts_decorate([
31
+ injectable(),
32
+ _ts_metadata("design:type", Function),
33
+ _ts_metadata("design:paramtypes", [])
34
+ ], CommHubNotificationsRegistryReader);
35
+ export class CommHubNotificationsRegistryWriter extends RegistryWriter {
36
+ constructor(){
37
+ super(commHubNotificationsRegistryId);
38
+ }
39
+ }
40
+ CommHubNotificationsRegistryWriter = _ts_decorate([
41
+ injectable(),
42
+ _ts_metadata("design:type", Function),
43
+ _ts_metadata("design:paramtypes", [])
44
+ ], CommHubNotificationsRegistryWriter);
45
+ export class CommHubNotificationsRegistryStore extends RegistryStore {
46
+ constructor(){
47
+ super(commHubNotificationsRegistryId);
48
+ }
49
+ }
50
+ CommHubNotificationsRegistryStore = _ts_decorate([
51
+ injectable(),
52
+ _ts_metadata("design:type", Function),
53
+ _ts_metadata("design:paramtypes", [])
54
+ ], 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
+
66
+ //# sourceMappingURL=comm-hub-notifications-registry.js.map
@@ -0,0 +1 @@
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"}
@@ -1,61 +1,66 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
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 (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;
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
- var __metadata = (this && this.__metadata) || function (k, v) {
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, } from '@servicetitan/shared-data-registry';
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
- let CommHubRegistry = class CommHubRegistry extends RegistryService {
16
- constructor() {
15
+ export class CommHubRegistry extends RegistryService {
16
+ constructor(){
17
17
  super(commHubRegistryId);
18
18
  }
19
- };
20
- CommHubRegistry = __decorate([
19
+ }
20
+ CommHubRegistry = _ts_decorate([
21
21
  injectable(),
22
- __metadata("design:paramtypes", [])
22
+ _ts_metadata("design:type", Function),
23
+ _ts_metadata("design:paramtypes", [])
23
24
  ], CommHubRegistry);
24
- export { CommHubRegistry };
25
- let CommHubRegistryReader = class CommHubRegistryReader extends RegistryReader {
26
- constructor() {
25
+ export class CommHubRegistryReader extends RegistryReader {
26
+ constructor(){
27
27
  super(commHubRegistryId);
28
28
  }
29
- };
30
- CommHubRegistryReader = __decorate([
29
+ }
30
+ CommHubRegistryReader = _ts_decorate([
31
31
  injectable(),
32
- __metadata("design:paramtypes", [])
32
+ _ts_metadata("design:type", Function),
33
+ _ts_metadata("design:paramtypes", [])
33
34
  ], CommHubRegistryReader);
34
- export { CommHubRegistryReader };
35
- let CommHubRegistryWriter = class CommHubRegistryWriter extends RegistryWriter {
36
- constructor() {
35
+ export class CommHubRegistryWriter extends RegistryWriter {
36
+ constructor(){
37
37
  super(commHubRegistryId);
38
38
  }
39
- };
40
- CommHubRegistryWriter = __decorate([
39
+ }
40
+ CommHubRegistryWriter = _ts_decorate([
41
41
  injectable(),
42
- __metadata("design:paramtypes", [])
42
+ _ts_metadata("design:type", Function),
43
+ _ts_metadata("design:paramtypes", [])
43
44
  ], CommHubRegistryWriter);
44
- export { CommHubRegistryWriter };
45
- let CommHubRegistryStore = class CommHubRegistryStore extends RegistryStore {
46
- constructor() {
45
+ export class CommHubRegistryStore extends RegistryStore {
46
+ constructor(){
47
47
  super(commHubRegistryId);
48
48
  }
49
- };
50
- CommHubRegistryStore = __decorate([
49
+ }
50
+ CommHubRegistryStore = _ts_decorate([
51
51
  injectable(),
52
- __metadata("design:paramtypes", [])
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: [CommHubRegistry, CommHubRegistryWriter, CommHubRegistryReader],
57
- })(({ children }) => {
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,"file":"comm-hub-registry.js","sourceRoot":"","sources":["../src/comm-hub-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,iBAAiB,GAAG,+BAA+B,CAAC;AAEjE,MAAM,CAAC,MAAM,wBAAwB,GAAG,cAAc,CAAC;AAyDhD,IAAM,eAAe,GAArB,MAAM,eAAkD,SAAQ,eAEtE;IACG;QACI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC7B,CAAC;CACJ,CAAA;AANY,eAAe;IAD3B,UAAU,EAAE;;GACA,eAAe,CAM3B;;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,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"}
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"}
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,4 @@
1
1
  export * from './comm-hub-registry';
2
+ export * from './comm-hub-notifications-registry';
3
+
2
4
  //# 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,"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.2.0",
3
+ "version": "1.3.1",
4
4
  "description": "",
5
5
  "files": [
6
6
  "dist",
7
7
  "src"
8
8
  ],
9
9
  "main": "./dist/index.js",
10
- "dependencies": {
11
- "@servicetitan/log-service": "~30.1.1",
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": "^1.0.0",
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": "08e7b3fb8bfe3867d9c9c08f86ff6141c2b470f7"
27
+ "gitHead": "39e76910a22a9f965cb4fde2d81e79788f91d100"
32
28
  }
@@ -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
+ });
package/src/index.ts CHANGED
@@ -1 +1,2 @@
1
1
  export * from './comm-hub-registry';
2
+ export * from './comm-hub-notifications-registry';