@corto-ai/integrations-messenger 0.0.2

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.
Files changed (108) hide show
  1. package/README-internal.md +151 -0
  2. package/README.md +46 -0
  3. package/package.json +11 -0
  4. package/src/index.d.ts +48 -0
  5. package/src/index.js +5 -0
  6. package/src/index.js.map +1 -0
  7. package/src/lib/actions/auth/exchange-token.d.ts +16 -0
  8. package/src/lib/actions/auth/exchange-token.js +6 -0
  9. package/src/lib/actions/auth/exchange-token.js.map +1 -0
  10. package/src/lib/actions/auth/index.d.ts +5 -0
  11. package/src/lib/actions/auth/index.js +5 -0
  12. package/src/lib/actions/auth/index.js.map +1 -0
  13. package/src/lib/actions/base.d.ts +52 -0
  14. package/src/lib/actions/base.js +24 -0
  15. package/src/lib/actions/base.js.map +1 -0
  16. package/src/lib/actions/contact/base.d.ts +4 -0
  17. package/src/lib/actions/contact/base.js +1 -0
  18. package/src/lib/actions/contact/base.js.map +1 -0
  19. package/src/lib/actions/contact/index.d.ts +7 -0
  20. package/src/lib/actions/contact/index.js +7 -0
  21. package/src/lib/actions/contact/index.js.map +1 -0
  22. package/src/lib/actions/contact/open-edit.d.ts +12 -0
  23. package/src/lib/actions/contact/open-edit.js +6 -0
  24. package/src/lib/actions/contact/open-edit.js.map +1 -0
  25. package/src/lib/actions/contact/open.d.ts +12 -0
  26. package/src/lib/actions/contact/open.js +6 -0
  27. package/src/lib/actions/contact/open.js.map +1 -0
  28. package/src/lib/actions/index.d.ts +39 -0
  29. package/src/lib/actions/index.js +13 -0
  30. package/src/lib/actions/index.js.map +1 -0
  31. package/src/lib/actions/internal/handshake.d.ts +2 -0
  32. package/src/lib/actions/internal/handshake.js +1 -0
  33. package/src/lib/actions/internal/handshake.js.map +1 -0
  34. package/src/lib/actions/matter/base.d.ts +4 -0
  35. package/src/lib/actions/matter/base.js +1 -0
  36. package/src/lib/actions/matter/base.js.map +1 -0
  37. package/src/lib/actions/matter/index.d.ts +19 -0
  38. package/src/lib/actions/matter/index.js +19 -0
  39. package/src/lib/actions/matter/index.js.map +1 -0
  40. package/src/lib/actions/matter/open-agent-session.d.ts +14 -0
  41. package/src/lib/actions/matter/open-agent-session.js +6 -0
  42. package/src/lib/actions/matter/open-agent-session.js.map +1 -0
  43. package/src/lib/actions/matter/open-chat-session.d.ts +14 -0
  44. package/src/lib/actions/matter/open-chat-session.js +6 -0
  45. package/src/lib/actions/matter/open-chat-session.js.map +1 -0
  46. package/src/lib/actions/matter/open-details.d.ts +12 -0
  47. package/src/lib/actions/matter/open-details.js +6 -0
  48. package/src/lib/actions/matter/open-details.js.map +1 -0
  49. package/src/lib/actions/matter/open-document-status.d.ts +12 -0
  50. package/src/lib/actions/matter/open-document-status.js +6 -0
  51. package/src/lib/actions/matter/open-document-status.js.map +1 -0
  52. package/src/lib/actions/matter/open-edit.d.ts +12 -0
  53. package/src/lib/actions/matter/open-edit.js +6 -0
  54. package/src/lib/actions/matter/open-edit.js.map +1 -0
  55. package/src/lib/actions/matter/open-prompt-library.d.ts +12 -0
  56. package/src/lib/actions/matter/open-prompt-library.js +6 -0
  57. package/src/lib/actions/matter/open-prompt-library.js.map +1 -0
  58. package/src/lib/actions/matter/open-prompt.d.ts +14 -0
  59. package/src/lib/actions/matter/open-prompt.js +6 -0
  60. package/src/lib/actions/matter/open-prompt.js.map +1 -0
  61. package/src/lib/actions/matter/open.d.ts +14 -0
  62. package/src/lib/actions/matter/open.js +6 -0
  63. package/src/lib/actions/matter/open.js.map +1 -0
  64. package/src/lib/actions/pubsub/index.d.ts +5 -0
  65. package/src/lib/actions/pubsub/index.js +5 -0
  66. package/src/lib/actions/pubsub/index.js.map +1 -0
  67. package/src/lib/actions/pubsub/notification.d.ts +15 -0
  68. package/src/lib/actions/pubsub/notification.js +11 -0
  69. package/src/lib/actions/pubsub/notification.js.map +1 -0
  70. package/src/lib/actions/settings/index.d.ts +5 -0
  71. package/src/lib/actions/settings/index.js +5 -0
  72. package/src/lib/actions/settings/index.js.map +1 -0
  73. package/src/lib/actions/settings/open.d.ts +13 -0
  74. package/src/lib/actions/settings/open.js +6 -0
  75. package/src/lib/actions/settings/open.js.map +1 -0
  76. package/src/lib/actions/utils.d.ts +11 -0
  77. package/src/lib/actions/utils.js +68 -0
  78. package/src/lib/actions/utils.js.map +1 -0
  79. package/src/lib/core/emitter.d.ts +10 -0
  80. package/src/lib/core/emitter.js +79 -0
  81. package/src/lib/core/emitter.js.map +1 -0
  82. package/src/lib/core/index.d.ts +9 -0
  83. package/src/lib/core/index.js +15 -0
  84. package/src/lib/core/index.js.map +1 -0
  85. package/src/lib/core/listener.d.ts +7 -0
  86. package/src/lib/core/listener.js +86 -0
  87. package/src/lib/core/listener.js.map +1 -0
  88. package/src/lib/core/logger.d.ts +7 -0
  89. package/src/lib/core/logger.js +32 -0
  90. package/src/lib/core/logger.js.map +1 -0
  91. package/src/lib/core/target.d.ts +13 -0
  92. package/src/lib/core/target.js +39 -0
  93. package/src/lib/core/target.js.map +1 -0
  94. package/src/lib/models/configs.d.ts +9 -0
  95. package/src/lib/models/configs.js +1 -0
  96. package/src/lib/models/configs.js.map +1 -0
  97. package/src/lib/models/handlers.d.ts +21 -0
  98. package/src/lib/models/handlers.js +1 -0
  99. package/src/lib/models/handlers.js.map +1 -0
  100. package/src/lib/models/index.d.ts +4 -0
  101. package/src/lib/models/index.js +5 -0
  102. package/src/lib/models/index.js.map +1 -0
  103. package/src/lib/models/messages.d.ts +22 -0
  104. package/src/lib/models/messages.js +7 -0
  105. package/src/lib/models/messages.js.map +1 -0
  106. package/src/lib/models/target.d.ts +7 -0
  107. package/src/lib/models/target.js +2 -0
  108. package/src/lib/models/target.js.map +1 -0
@@ -0,0 +1,14 @@
1
+ import { type ActionResponseBaseDTO } from '../../models';
2
+ import { ActionTypeEnum } from '../base';
3
+ import { type ActionDataTypeDTO } from '../utils';
4
+ import { type MatterRequestBaseDTO } from './base';
5
+ type OpenAgentSessionDTO = MatterRequestBaseDTO & {
6
+ sessionId: string;
7
+ };
8
+ type OpenAgentSessionResponseDTO = ActionResponseBaseDTO;
9
+ export type MatterOpenAgentSessionDataTypeDTO = ActionDataTypeDTO<OpenAgentSessionDTO, OpenAgentSessionResponseDTO>;
10
+ declare const _default: {
11
+ sendOpenAgentSession: import("../../models").ActionCreatorFn<ActionTypeEnum.MatterOpenAgentSession>;
12
+ handleOpenAgentSession: import("../../models").ActionHandlerFn<ActionTypeEnum.MatterOpenAgentSession>;
13
+ };
14
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import { ActionTypeEnum } from '../base';
2
+ import { buildActionCreatorFn, buildActionHandlerFn } from '../utils';
3
+ const sendOpenAgentSession = buildActionCreatorFn(ActionTypeEnum.MatterOpenAgentSession);
4
+ const handleOpenAgentSession = buildActionHandlerFn(ActionTypeEnum.MatterOpenAgentSession);
5
+ export default { sendOpenAgentSession, handleOpenAgentSession };
6
+ //# sourceMappingURL=open-agent-session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-agent-session.js","sourceRoot":"","sources":["../../../../../../../libs/integrations-messenger/src/lib/actions/matter/open-agent-session.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAA0B,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAW9F,MAAM,oBAAoB,GAAG,oBAAoB,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;AACzF,MAAM,sBAAsB,GAAG,oBAAoB,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;AAE3F,eAAe,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { type ActionResponseBaseDTO } from '../../models';
2
+ import { ActionTypeEnum } from '../base';
3
+ import { type ActionDataTypeDTO } from '../utils';
4
+ import { type MatterRequestBaseDTO } from './base';
5
+ type OpenChatSessionDTO = MatterRequestBaseDTO & {
6
+ sessionId: string;
7
+ };
8
+ type OpenChatSessionResponseDTO = ActionResponseBaseDTO;
9
+ export type MatterOpenChatSessionDataTypeDTO = ActionDataTypeDTO<OpenChatSessionDTO, OpenChatSessionResponseDTO>;
10
+ declare const _default: {
11
+ sendOpenChatSession: import("../../models").ActionCreatorFn<ActionTypeEnum.MatterOpenChatSession>;
12
+ handleOpenChatSession: import("../../models").ActionHandlerFn<ActionTypeEnum.MatterOpenChatSession>;
13
+ };
14
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import { ActionTypeEnum } from '../base';
2
+ import { buildActionCreatorFn, buildActionHandlerFn } from '../utils';
3
+ const sendOpenChatSession = buildActionCreatorFn(ActionTypeEnum.MatterOpenChatSession);
4
+ const handleOpenChatSession = buildActionHandlerFn(ActionTypeEnum.MatterOpenChatSession);
5
+ export default { sendOpenChatSession, handleOpenChatSession };
6
+ //# sourceMappingURL=open-chat-session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-chat-session.js","sourceRoot":"","sources":["../../../../../../../libs/integrations-messenger/src/lib/actions/matter/open-chat-session.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAA0B,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAW9F,MAAM,mBAAmB,GAAG,oBAAoB,CAAC,cAAc,CAAC,qBAAqB,CAAC,CAAC;AACvF,MAAM,qBAAqB,GAAG,oBAAoB,CAAC,cAAc,CAAC,qBAAqB,CAAC,CAAC;AAEzF,eAAe,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { type ActionResponseBaseDTO } from '../../models';
2
+ import { ActionTypeEnum } from '../base';
3
+ import { type ActionDataTypeDTO } from '../utils';
4
+ import { type MatterRequestBaseDTO } from './base';
5
+ type OpenDetailsDTO = MatterRequestBaseDTO;
6
+ type OpenDetailsResponseDTO = ActionResponseBaseDTO;
7
+ export type MatterOpenDetailsDataTypeDTO = ActionDataTypeDTO<OpenDetailsDTO, OpenDetailsResponseDTO>;
8
+ declare const _default: {
9
+ sendOpenDetails: import("../../models").ActionCreatorFn<ActionTypeEnum.MatterOpenDetails>;
10
+ handleOpenDetails: import("../../models").ActionHandlerFn<ActionTypeEnum.MatterOpenDetails>;
11
+ };
12
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import { ActionTypeEnum } from '../base';
2
+ import { buildActionCreatorFn, buildActionHandlerFn } from '../utils';
3
+ const sendOpenDetails = buildActionCreatorFn(ActionTypeEnum.MatterOpenDetails);
4
+ const handleOpenDetails = buildActionHandlerFn(ActionTypeEnum.MatterOpenDetails);
5
+ export default { sendOpenDetails, handleOpenDetails };
6
+ //# sourceMappingURL=open-details.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-details.js","sourceRoot":"","sources":["../../../../../../../libs/integrations-messenger/src/lib/actions/matter/open-details.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAA0B,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAS9F,MAAM,eAAe,GAAG,oBAAoB,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;AAC/E,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;AAEjF,eAAe,EAAE,eAAe,EAAE,iBAAiB,EAAE,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { type ActionResponseBaseDTO } from '../../models';
2
+ import { ActionTypeEnum } from '../base';
3
+ import { type ActionDataTypeDTO } from '../utils';
4
+ import { type MatterRequestBaseDTO } from './base';
5
+ type OpenDocumentStatusDTO = MatterRequestBaseDTO;
6
+ type OpenDocumentStatusResponseDTO = ActionResponseBaseDTO;
7
+ export type MatterOpenDocumentStatusDataTypeDTO = ActionDataTypeDTO<OpenDocumentStatusDTO, OpenDocumentStatusResponseDTO>;
8
+ declare const _default: {
9
+ sendOpenDocumentStatus: import("../../models").ActionCreatorFn<ActionTypeEnum.MatterOpenDocumentStatus>;
10
+ handleOpenDocumentStatus: import("../../models").ActionHandlerFn<ActionTypeEnum.MatterOpenDocumentStatus>;
11
+ };
12
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import { ActionTypeEnum } from '../base';
2
+ import { buildActionCreatorFn, buildActionHandlerFn } from '../utils';
3
+ const sendOpenDocumentStatus = buildActionCreatorFn(ActionTypeEnum.MatterOpenDocumentStatus);
4
+ const handleOpenDocumentStatus = buildActionHandlerFn(ActionTypeEnum.MatterOpenDocumentStatus);
5
+ export default { sendOpenDocumentStatus, handleOpenDocumentStatus };
6
+ //# sourceMappingURL=open-document-status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-document-status.js","sourceRoot":"","sources":["../../../../../../../libs/integrations-messenger/src/lib/actions/matter/open-document-status.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAA0B,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAY9F,MAAM,sBAAsB,GAAG,oBAAoB,CAAC,cAAc,CAAC,wBAAwB,CAAC,CAAC;AAC7F,MAAM,wBAAwB,GAAG,oBAAoB,CAAC,cAAc,CAAC,wBAAwB,CAAC,CAAC;AAE/F,eAAe,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { type ActionResponseBaseDTO } from '../../models';
2
+ import { ActionTypeEnum } from '../base';
3
+ import { type ActionDataTypeDTO } from '../utils';
4
+ import { type MatterRequestBaseDTO } from './base';
5
+ type OpenEditDTO = MatterRequestBaseDTO;
6
+ type OpenEditResponseDTO = ActionResponseBaseDTO;
7
+ export type MatterOpenEditDataTypeDTO = ActionDataTypeDTO<OpenEditDTO, OpenEditResponseDTO>;
8
+ declare const _default: {
9
+ sendOpenEdit: import("../../models").ActionCreatorFn<ActionTypeEnum.MatterOpenEdit>;
10
+ handleOpenEdit: import("../../models").ActionHandlerFn<ActionTypeEnum.MatterOpenEdit>;
11
+ };
12
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import { ActionTypeEnum } from '../base';
2
+ import { buildActionCreatorFn, buildActionHandlerFn } from '../utils';
3
+ const sendOpenEdit = buildActionCreatorFn(ActionTypeEnum.MatterOpenEdit);
4
+ const handleOpenEdit = buildActionHandlerFn(ActionTypeEnum.MatterOpenEdit);
5
+ export default { sendOpenEdit, handleOpenEdit };
6
+ //# sourceMappingURL=open-edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-edit.js","sourceRoot":"","sources":["../../../../../../../libs/integrations-messenger/src/lib/actions/matter/open-edit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAA0B,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAS9F,MAAM,YAAY,GAAG,oBAAoB,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AACzE,MAAM,cAAc,GAAG,oBAAoB,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AAE3E,eAAe,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { type ActionResponseBaseDTO } from '../../models';
2
+ import { ActionTypeEnum } from '../base';
3
+ import { type ActionDataTypeDTO } from '../utils';
4
+ import { type MatterRequestBaseDTO } from './base';
5
+ type OpenPromptLibraryDTO = MatterRequestBaseDTO;
6
+ type OpenPromptLibraryResponseDTO = ActionResponseBaseDTO;
7
+ export type MatterOpenPromptLibraryDataTypeDTO = ActionDataTypeDTO<OpenPromptLibraryDTO, OpenPromptLibraryResponseDTO>;
8
+ declare const _default: {
9
+ sendOpenPromptLibrary: import("../../models").ActionCreatorFn<ActionTypeEnum.MatterOpenPromptLibrary>;
10
+ handleOpenPromptLibrary: import("../../models").ActionHandlerFn<ActionTypeEnum.MatterOpenPromptLibrary>;
11
+ };
12
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import { ActionTypeEnum } from '../base';
2
+ import { buildActionCreatorFn, buildActionHandlerFn } from '../utils';
3
+ const sendOpenPromptLibrary = buildActionCreatorFn(ActionTypeEnum.MatterOpenPromptLibrary);
4
+ const handleOpenPromptLibrary = buildActionHandlerFn(ActionTypeEnum.MatterOpenPromptLibrary);
5
+ export default { sendOpenPromptLibrary, handleOpenPromptLibrary };
6
+ //# sourceMappingURL=open-prompt-library.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-prompt-library.js","sourceRoot":"","sources":["../../../../../../../libs/integrations-messenger/src/lib/actions/matter/open-prompt-library.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAA0B,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAS9F,MAAM,qBAAqB,GAAG,oBAAoB,CAAC,cAAc,CAAC,uBAAuB,CAAC,CAAC;AAC3F,MAAM,uBAAuB,GAAG,oBAAoB,CAAC,cAAc,CAAC,uBAAuB,CAAC,CAAC;AAE7F,eAAe,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { type ActionResponseBaseDTO } from '../../models';
2
+ import { ActionTypeEnum } from '../base';
3
+ import { type ActionDataTypeDTO } from '../utils';
4
+ import { type MatterRequestBaseDTO } from './base';
5
+ type OpenPromptDTO = MatterRequestBaseDTO & {
6
+ promptId: string;
7
+ };
8
+ type OpenPromptResponseDTO = ActionResponseBaseDTO;
9
+ export type MatterOpenPromptDataTypeDTO = ActionDataTypeDTO<OpenPromptDTO, OpenPromptResponseDTO>;
10
+ declare const _default: {
11
+ sendOpenPrompt: import("../../models").ActionCreatorFn<ActionTypeEnum.MatterOpenPrompt>;
12
+ handleOpenPrompt: import("../../models").ActionHandlerFn<ActionTypeEnum.MatterOpenPrompt>;
13
+ };
14
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import { ActionTypeEnum } from '../base';
2
+ import { buildActionCreatorFn, buildActionHandlerFn } from '../utils';
3
+ const sendOpenPrompt = buildActionCreatorFn(ActionTypeEnum.MatterOpenPrompt);
4
+ const handleOpenPrompt = buildActionHandlerFn(ActionTypeEnum.MatterOpenPrompt);
5
+ export default { sendOpenPrompt, handleOpenPrompt };
6
+ //# sourceMappingURL=open-prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-prompt.js","sourceRoot":"","sources":["../../../../../../../libs/integrations-messenger/src/lib/actions/matter/open-prompt.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAA0B,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAW9F,MAAM,cAAc,GAAG,oBAAoB,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;AAC7E,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;AAE/E,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { type ActionResponseBaseDTO } from '../../models';
2
+ import { ActionTypeEnum } from '../base';
3
+ import { type ActionDataTypeDTO } from '../utils';
4
+ import { type MatterRequestBaseDTO } from './base';
5
+ type OpenMatterDTO = MatterRequestBaseDTO & {
6
+ matterId: string;
7
+ };
8
+ type OpenMatterResponseDTO = ActionResponseBaseDTO;
9
+ export type MatterOpenDataTypeDTO = ActionDataTypeDTO<OpenMatterDTO, OpenMatterResponseDTO>;
10
+ declare const _default: {
11
+ sendOpenMatter: import("../../models").ActionCreatorFn<ActionTypeEnum.MatterOpen>;
12
+ handleOpenMatter: import("../../models").ActionHandlerFn<ActionTypeEnum.MatterOpen>;
13
+ };
14
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import { ActionTypeEnum } from '../base';
2
+ import { buildActionCreatorFn, buildActionHandlerFn } from '../utils';
3
+ const sendOpenMatter = buildActionCreatorFn(ActionTypeEnum.MatterOpen);
4
+ const handleOpenMatter = buildActionHandlerFn(ActionTypeEnum.MatterOpen);
5
+ export default { sendOpenMatter, handleOpenMatter };
6
+ //# sourceMappingURL=open.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open.js","sourceRoot":"","sources":["../../../../../../../libs/integrations-messenger/src/lib/actions/matter/open.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAA0B,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAW9F,MAAM,cAAc,GAAG,oBAAoB,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;AACvE,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;AAEzE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ sendNotificationRequest: import("../../models").StreamActionCreatorFn<import("../base").ActionTypeEnum.PubsubNotification>;
3
+ handleNotificationRequest: import("../../models").StreamActionHandlerFn<import("../base").ActionTypeEnum.PubsubNotification>;
4
+ };
5
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import notification from './notification';
2
+ export default {
3
+ ...notification
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../libs/integrations-messenger/src/lib/actions/pubsub/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,eAAe;IACb,GAAG,YAAY;CAChB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { ActionTypeEnum } from '../base';
2
+ import { type ActionDataTypeDTO } from '../utils';
3
+ type PubsubNotificationRequestDTO = {
4
+ channel: string;
5
+ };
6
+ type PubsubNotificationDTO<T = unknown> = {
7
+ channel: string;
8
+ data: T;
9
+ };
10
+ export type PubsubNotificationDataTypeDTO = ActionDataTypeDTO<PubsubNotificationRequestDTO, PubsubNotificationDTO>;
11
+ declare const _default: {
12
+ sendNotificationRequest: import("../../models").StreamActionCreatorFn<ActionTypeEnum.PubsubNotification>;
13
+ handleNotificationRequest: import("../../models").StreamActionHandlerFn<ActionTypeEnum.PubsubNotification>;
14
+ };
15
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { ActionTypeEnum } from '../base';
2
+ import { buildAsyncActionCreatorFn, buildAsyncActionHandlerFn } from '../utils';
3
+ const handleNotificationRequest = buildAsyncActionHandlerFn(ActionTypeEnum.PubsubNotification);
4
+ const sendNotificationRequest = buildAsyncActionCreatorFn(ActionTypeEnum.PubsubNotification, {
5
+ skipWhen: (request, response) => request.channel !== response.channel
6
+ });
7
+ export default {
8
+ sendNotificationRequest,
9
+ handleNotificationRequest
10
+ };
11
+ //# sourceMappingURL=notification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification.js","sourceRoot":"","sources":["../../../../../../../libs/integrations-messenger/src/lib/actions/pubsub/notification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAA0B,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAaxG,MAAM,yBAAyB,GAAG,yBAAyB,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC;AAE/F,MAAM,uBAAuB,GAAG,yBAAyB,CAAC,cAAc,CAAC,kBAAkB,EAAE;IAC3F,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,KAAK,QAAQ,CAAC,OAAO;CACtE,CAAC,CAAC;AAEH,eAAe;IACb,uBAAuB;IACvB,yBAAyB;CAC1B,CAAC"}
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ sendOpenSettings: import("../../models").ActionCreatorFn<import("../base").ActionTypeEnum.SettingsOpen>;
3
+ handleOpenSettings: import("../../models").ActionHandlerFn<import("../base").ActionTypeEnum.SettingsOpen>;
4
+ };
5
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import open from './open';
2
+ export default {
3
+ ...open
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../libs/integrations-messenger/src/lib/actions/settings/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,eAAe;IACb,GAAG,IAAI;CACR,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { type ActionResponseBaseDTO } from '../../models';
2
+ import { ActionTypeEnum } from '../base';
3
+ import { type ActionDataTypeDTO } from '../utils';
4
+ type OpenSettingsDTO = {
5
+ newTab?: boolean;
6
+ };
7
+ type OpenSettingsResponseDTO = ActionResponseBaseDTO;
8
+ export type SettingsOpenDataTypeDTO = ActionDataTypeDTO<OpenSettingsDTO, OpenSettingsResponseDTO>;
9
+ declare const _default: {
10
+ sendOpenSettings: import("../../models").ActionCreatorFn<ActionTypeEnum.SettingsOpen>;
11
+ handleOpenSettings: import("../../models").ActionHandlerFn<ActionTypeEnum.SettingsOpen>;
12
+ };
13
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import { ActionTypeEnum } from '../base';
2
+ import { buildActionCreatorFn, buildActionHandlerFn } from '../utils';
3
+ const sendOpenSettings = buildActionCreatorFn(ActionTypeEnum.SettingsOpen);
4
+ const handleOpenSettings = buildActionHandlerFn(ActionTypeEnum.SettingsOpen);
5
+ export default { sendOpenSettings, handleOpenSettings };
6
+ //# sourceMappingURL=open.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open.js","sourceRoot":"","sources":["../../../../../../../libs/integrations-messenger/src/lib/actions/settings/open.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAA0B,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAU9F,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;AAC3E,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;AAE7E,eAAe,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { type ActionTypeEnum } from './base';
2
+ import { type ActionCreatorConfigDTO, type ActionCreatorFn, type ActionHandlerFn, type StreamActionCreatorFn, type StreamActionHandlerFn } from '../models';
3
+ export declare const buildActionCreatorFn: <T extends ActionTypeEnum>(type: T, opts?: ActionCreatorConfigDTO<T>) => ActionCreatorFn<T>;
4
+ export declare const buildActionHandlerFn: <T extends ActionTypeEnum>(type: T) => ActionHandlerFn<T>;
5
+ export declare const buildAsyncActionCreatorFn: <T extends ActionTypeEnum>(type: T, opts?: ActionCreatorConfigDTO<T>) => StreamActionCreatorFn<T>;
6
+ export declare const buildAsyncActionHandlerFn: <T extends ActionTypeEnum>(type: T) => StreamActionHandlerFn<T>;
7
+ export declare const isInternalActionType: (type: string) => boolean;
8
+ export type ActionDataTypeDTO<Request, Response> = {
9
+ request: Request;
10
+ response: Response;
11
+ };
@@ -0,0 +1,68 @@
1
+ import { v4 as uuid } from 'uuid';
2
+ import { InternalActionTypeEnum } from './base';
3
+ import emitter from '../core/emitter';
4
+ import listener from '../core/listener';
5
+ import logger from '../core/logger';
6
+ import target from '../core/target';
7
+ export const buildActionCreatorFn = (type, opts = {}) => (request) => new Promise((resolve) => {
8
+ const parentId = target.getParentId();
9
+ if (!parentId) {
10
+ logger.error('Parent not found -- did you remember to call core.init?');
11
+ throw new Error('Parent not found -- did you remember to call core.init?');
12
+ }
13
+ const requestId = uuid();
14
+ const handler = listener.addMessageHandler(`${type}Response`, ({ data: response }) => {
15
+ if (requestId !== response.id || opts.skipWhen?.(request, response.data))
16
+ return;
17
+ resolve(response.data);
18
+ handler.remove();
19
+ });
20
+ emitter.sendData({
21
+ id: requestId,
22
+ type,
23
+ data: request,
24
+ target: parentId
25
+ });
26
+ });
27
+ export const buildActionHandlerFn = (type) => (handler) => listener.addMessageHandler(type, async ({ data: request }) => {
28
+ const response = await handler(request.data);
29
+ emitter.sendData({
30
+ id: request.id,
31
+ type: `${type}Response`,
32
+ target: request.src,
33
+ data: response
34
+ });
35
+ });
36
+ export const buildAsyncActionCreatorFn = (type, opts = {}) => (request, resolve) => {
37
+ const parentId = target.getParentId();
38
+ if (!parentId) {
39
+ logger.error('Parent not found -- did you remember to call core.init?');
40
+ throw new Error('Parent not found -- did you remember to call core.init?');
41
+ }
42
+ const requestId = uuid();
43
+ const handler = listener.addMessageHandler(`${type}Response`, ({ data: response }) => {
44
+ if (requestId !== response.id || opts.skipWhen?.(request, response.data)) {
45
+ return;
46
+ }
47
+ resolve(response.data);
48
+ });
49
+ emitter.sendData({
50
+ id: requestId,
51
+ type,
52
+ data: request,
53
+ target: parentId
54
+ });
55
+ return handler;
56
+ };
57
+ export const buildAsyncActionHandlerFn = (type) => (handler) => listener.addMessageHandler(type, ({ data: request }) => {
58
+ handler(request.data, (response) => {
59
+ emitter.sendData({
60
+ id: request.id,
61
+ type: `${type}Response`,
62
+ target: request.src,
63
+ data: response
64
+ });
65
+ });
66
+ });
67
+ export const isInternalActionType = (type) => Object.keys(InternalActionTypeEnum).includes(type.replace('Response', ''));
68
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../libs/integrations-messenger/src/lib/actions/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAElC,OAAO,EAAuB,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,OAAO,MAAM,iBAAiB,CAAC;AACtC,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AACxC,OAAO,MAAM,MAAM,gBAAgB,CAAC;AACpC,OAAO,MA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AI,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;IACrD,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE;QACjC,OAAO,CAAC,QAAQ,CAAC;YACf,EAAE,EAAE,OAAO,CAAC,EAAE;YACd,IAAI,EAAE,GAAG,IAAI,UAAU;YACvB,MAAM,EAAE,OAAO,CAAC,GAAG;YACnB,IAAI,EAAE,QAA+C;SACtD,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEP,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,IAAY,EAAW,EAAE,CAC5D,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { type AllMessageTypeDTO, type MessageForwardingConfigDTO, type PlatformMessageBaseDTO, type TargetDTO } from '../models';
2
+ declare const _default: {
3
+ sendData: <T extends AllMessageTypeDTO>(params: Omit<PlatformMessageBaseDTO<T>, "src">) => void;
4
+ sendDataInternal: <T extends AllMessageTypeDTO>(data: PlatformMessageBaseDTO<T>, targetRef: TargetDTO | undefined) => void;
5
+ forward: (params: PlatformMessageBaseDTO<unknown>, config?: MessageForwardingConfigDTO) => void;
6
+ init: (parentRef?: Window) => Promise<{
7
+ parentId: string | undefined;
8
+ }>;
9
+ };
10
+ export default _default;
@@ -0,0 +1,79 @@
1
+ import { v4 as uuid } from 'uuid';
2
+ import listener from './listener';
3
+ import logger from './logger';
4
+ import target from './target';
5
+ import { ActionTypeEnum, InternalActionTypeEnum } from '../actions/base';
6
+ import { isInternalActionType } from '../actions/utils';
7
+ import { TARGET_WILDCARD } from '../models';
8
+ const expectedResponseMap = new Map();
9
+ const forward = (params, config = {}) => {
10
+ // the message is an internal message, which should be handled. Throw an error
11
+ if (isInternalActionType(params.type)) {
12
+ logger.error(`Tried to forward internal message ${params.type} -- this should be handled internally`);
13
+ throw new Error(`Tried to forward internal message ${params.type} -- this should be handled internally`);
14
+ }
15
+ const parentId = target.getParentId();
16
+ // the message is intended for the parent, so forward it to the parent
17
+ // also, add an entry to the expectedResponseMap, so that we know where to forward the response when we get it back
18
+ if (Object.keys(ActionTypeEnum).includes(params.type) && parentId) {
19
+ expectedResponseMap.set(params.id, params.src);
20
+ sendData({ ...params, target: parentId });
21
+ return;
22
+ }
23
+ const targetId = expectedResponseMap.get(params.id);
24
+ // otherwise, we received a response to a message we forwarded, so send it down to the original source
25
+ // and remove the entry from the expectedResponseMap, since we don't need to track it anymore
26
+ if (!targetId)
27
+ return;
28
+ sendData({ ...params, target: targetId });
29
+ if (!config.keepAlive) {
30
+ expectedResponseMap.delete(params.id);
31
+ }
32
+ return;
33
+ };
34
+ const sendData = (params) => {
35
+ const targetRef = target.getTarget(params.target);
36
+ sendDataInternal({
37
+ ...params,
38
+ src: target.getSourceId()
39
+ }, targetRef);
40
+ };
41
+ const sendDataInternal = (data, targetRef) => {
42
+ if (!targetRef) {
43
+ logger.error('Unable to send message to target undefined');
44
+ throw new Error('Unable to send message to target undefined');
45
+ }
46
+ logger.info('sending message', data);
47
+ targetRef.window.postMessage(data, targetRef.origin);
48
+ };
49
+ const init = (parentRef = window.parent) => new Promise((resolve) => {
50
+ if (parentRef === window) {
51
+ resolve({ parentId: undefined });
52
+ return;
53
+ }
54
+ listener.addMessageHandler(`${InternalActionTypeEnum.Handshake}Response`, (event) => {
55
+ if (event?.source !== parentRef) {
56
+ logger.error('Received handshake response from unexpected source');
57
+ return;
58
+ }
59
+ const data = event.data;
60
+ logger.info('handshake complete received', data);
61
+ target.setParentId(data.src);
62
+ target.addTarget(data.src, {
63
+ window: parentRef,
64
+ origin: event.origin
65
+ });
66
+ resolve({ parentId: data.src });
67
+ });
68
+ sendDataInternal({
69
+ id: uuid(),
70
+ type: InternalActionTypeEnum.Handshake,
71
+ target: TARGET_WILDCARD,
72
+ src: target.getSourceId(),
73
+ data: void 0
74
+ },
75
+ // Bootstrap only: parent origin is unknown before handshake; subsequent sends use the pinned target origin.
76
+ { window: parentRef, origin: '*', id: '' });
77
+ });
78
+ export default { sendData, sendDataInternal, forward, init };
79
+ //# sourceMappingURL=emitter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emitter.js","sourceRoot":"","sources":["../../../../../../libs/integrations-messenger/src/lib/core/emitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAElC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAIL,eAAe,EAEhB,MAAM,WAAW,CAAC;AAEnB,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAkB,CAAC;AAEtD,MAAM,OAAO,GAAG,CAAC,MAAuC,EAAE,SAAqC,EAAE,EAAQ,EAAE;IACzG,8EAA8E;IAC9E,IAAI,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACtC,MAAM,CAAC,KAAK,CAAC,qCAAqC,MAAM,CAAC,IAAI,uCAAuC,CAAC,CAAC;QACtG,MAAM,IAAI,KAAK,CAAC,qCAAqC,MAAM,CAAC,IAAI,uCAAuC,CAAC,CAAC;IAC3G,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IACtC,sEAAsE;IACtE,mHAAmH;IACnH,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,QAAQ,EAAE,CAAC;QAClE,mBAAmB,CAAC,GAAG,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9 @@
1
+ declare const _default: {
2
+ init: (params: {
3
+ id: string;
4
+ parentRef?: Window;
5
+ withLogging?: boolean;
6
+ }) => Promise<void>;
7
+ registerChild: (child: Window, id: string) => Promise<void>;
8
+ };
9
+ export default _default;
@@ -0,0 +1,15 @@
1
+ import emitter from './emitter';
2
+ import listener from './listener';
3
+ import logger from './logger';
4
+ import target from './target';
5
+ const init = async (params) => {
6
+ target.setSourceId(params.id);
7
+ logger.init(!!params.withLogging);
8
+ listener.init();
9
+ await emitter.init(params?.parentRef);
10
+ };
11
+ export default {
12
+ init,
13
+ registerChild: listener.registerChild
14
+ };
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/integrations-messenger/src/lib/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,MAAM,IAAI,GAAG,KAAK,EAAE,MAAiE,EAAiB,EAAE;IACtG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC9B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,CAAC;IAChB,MAAM,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AACxC,CAAC,CAAC;AAEF,eAAe;IACb,IAAI;IACJ,aAAa,EAAE,QAAQ,CAAC,aAAa;CACtC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type AllMessageTypeDTO, type MessageHandlerConfigDTO, type MessageHandlerFn, type MessageHandlerResponseDTO } from '../models';
2
+ declare const _default: {
3
+ addMessageHandler: <T extends AllMessageTypeDTO>(type: T, callback: MessageHandlerFn<T>, config?: MessageHandlerConfigDTO) => MessageHandlerResponseDTO;
4
+ init: () => void;
5
+ registerChild: (child: Window, id: string) => Promise<void>;
6
+ };
7
+ export default _default;