@corto-ai/integrations-messenger 0.0.10 → 0.0.11-dev.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.
- package/README-internal.md +11 -1
- package/README.md +7 -0
- package/package.json +2 -2
- package/src/index.d.ts +4 -0
- package/src/lib/actions/base.d.ts +3 -0
- package/src/lib/actions/base.js +3 -1
- package/src/lib/actions/base.js.map +1 -1
- package/src/lib/actions/index.d.ts +4 -0
- package/src/lib/actions/pubsub/index.d.ts +4 -0
- package/src/lib/actions/pubsub/index.js +3 -1
- package/src/lib/actions/pubsub/index.js.map +1 -1
- package/src/lib/actions/pubsub/status.d.ts +13 -0
- package/src/lib/actions/pubsub/status.js +10 -0
- package/src/lib/actions/pubsub/status.js.map +1 -0
package/README-internal.md
CHANGED
|
@@ -174,7 +174,17 @@ This keeps publishing idempotent:
|
|
|
174
174
|
|
|
175
175
|
### Versioning policy
|
|
176
176
|
|
|
177
|
-
`integrations-messenger`
|
|
177
|
+
`integrations-messenger` runs the monorepo `check-version` target, but with devVersion-aware rules:
|
|
178
|
+
|
|
179
|
+
1. If the branch `devVersion` matches the `devVersion` on `master-integrations-messenger`, the check passes and no bump is required.
|
|
180
|
+
2. If `devVersion` differs, the branch `version` must be ahead of the version on `master-integrations-messenger`. A bump
|
|
181
|
+
that only exists on `test` does not count - the branch itself has to carry it.
|
|
182
|
+
|
|
183
|
+
Examples (live = `master-integrations-messenger`):
|
|
184
|
+
|
|
185
|
+
1. live `1.0.1` / devVersion `5`, branch `1.0.1` / devVersion `5` -> passes, nothing to do.
|
|
186
|
+
2. live `1.0.1` / devVersion `5`, branch `1.0.1` / devVersion `6` -> fails, bump `version` to `1.0.2`.
|
|
187
|
+
3. live `1.0.1` / devVersion `5`, branch `1.0.2` / devVersion `6` -> passes.
|
|
178
188
|
|
|
179
189
|
Reason:
|
|
180
190
|
|
package/README.md
CHANGED
|
@@ -77,6 +77,7 @@ messenger.registerChild(iframe.contentWindow, 'my-integration-app');
|
|
|
77
77
|
| `auth` | `sendExchangeTokenRequest` / `handleExchangeTokenRequest` | Exchange a `clientId` for an auth token. |
|
|
78
78
|
| `auth` | `sendUserDataRequest` / `handleUserDataRequest` | Request the current user's data from the host (currently returns `userId`). |
|
|
79
79
|
| `pubsub` | `sendNotificationRequest` / `handleNotificationRequest` | Subscribe to (or publish) notifications on a `channel`, supporting multiple responses over time. |
|
|
80
|
+
| `pubsub` | `sendStatusRequest` / `handleStatusRequest` | Subscribe to the host SignalR hub connection state (`Connected`, `Reconnecting`, `Disconnected`, and the other hub states). |
|
|
80
81
|
| `window` | `sendUpdateUrl` / `handleUpdateUrl` | Update the url in the host application _without navigating_. Used to support routing/refreshing within an integration |
|
|
81
82
|
| `window` | `sendOpenModal` / `handleOpenModal` | Opens a modal overlay that can be used to host integration iframes. Appends the provided path to the root target origin. |
|
|
82
83
|
| `window` | `sendCloseModal` / `handleCloseModal` | Closes a modal overlay that was previously opened with the `sendOpenModal` command |
|
|
@@ -130,6 +131,12 @@ const handle = messenger.actions.pubsub.sendNotificationRequest({ channel: 'docu
|
|
|
130
131
|
|
|
131
132
|
// later, stop listening
|
|
132
133
|
handle.remove();
|
|
134
|
+
|
|
135
|
+
const statusHandle = messenger.actions.pubsub.sendStatusRequest(({ status }) => {
|
|
136
|
+
console.log(status);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
statusHandle.remove();
|
|
133
140
|
```
|
|
134
141
|
|
|
135
142
|
#### Modal communication
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -42,6 +42,10 @@ declare const _default: {
|
|
|
42
42
|
handleOpenAgentSession: import(".").ActionHandlerFn<import(".").ActionTypeEnum.MatterOpenAgentSession>;
|
|
43
43
|
};
|
|
44
44
|
pubsub: {
|
|
45
|
+
sendStatusRequest: (handler: (response: {
|
|
46
|
+
status: import("./lib/actions/pubsub/status").PubsubConnectionStatusDTO;
|
|
47
|
+
}) => void) => import(".").MessageHandlerResponseDTO;
|
|
48
|
+
handleStatusRequest: import(".").StreamActionHandlerFn<import(".").ActionTypeEnum.PubsubStatus>;
|
|
45
49
|
sendNotificationRequest: import(".").StreamActionCreatorFn<import(".").ActionTypeEnum.PubsubNotification>;
|
|
46
50
|
handleNotificationRequest: import(".").StreamActionHandlerFn<import(".").ActionTypeEnum.PubsubNotification>;
|
|
47
51
|
};
|
|
@@ -16,6 +16,7 @@ import { type MatterOpenPromptLibraryDataTypeDTO } from './matter/open-prompt-li
|
|
|
16
16
|
import { type MatterPreviewDocumentDataTypeDTO } from './matter/preview-document';
|
|
17
17
|
import { type MatterSetFullScreenDataTypeDTO } from './matter/set-fullscreen';
|
|
18
18
|
import { type PubsubNotificationDataTypeDTO } from './pubsub/notification';
|
|
19
|
+
import { type PubsubStatusDataTypeDTO } from './pubsub/status';
|
|
19
20
|
import { type SettingsOpenDataTypeDTO } from './settings/open';
|
|
20
21
|
import { type WindowCloseModalDataTypeDTO } from './window/close-modal';
|
|
21
22
|
import { type WindowOpenConfirmationDataTypeDTO } from './window/open-confirmation';
|
|
@@ -42,6 +43,7 @@ export declare enum ActionTypeEnum {
|
|
|
42
43
|
SettingsOpen = "SettingsOpen",
|
|
43
44
|
GetBranding = "GetBranding",
|
|
44
45
|
PubsubNotification = "PubsubNotification",
|
|
46
|
+
PubsubStatus = "PubsubStatus",
|
|
45
47
|
RequestExchangeToken = "RequestExchangeToken",
|
|
46
48
|
RequestUserData = "RequestUserData",
|
|
47
49
|
WindowUpdateUrl = "WindowUpdateUrl",
|
|
@@ -71,6 +73,7 @@ export type DataTypeMapDTO = {
|
|
|
71
73
|
[ActionTypeEnum.SettingsOpen]: SettingsOpenDataTypeDTO;
|
|
72
74
|
[ActionTypeEnum.GetBranding]: GetBrandingDataTypeDTO;
|
|
73
75
|
[ActionTypeEnum.PubsubNotification]: PubsubNotificationDataTypeDTO;
|
|
76
|
+
[ActionTypeEnum.PubsubStatus]: PubsubStatusDataTypeDTO;
|
|
74
77
|
[ActionTypeEnum.RequestExchangeToken]: ExchangeTokenDataTypeDTO;
|
|
75
78
|
[ActionTypeEnum.RequestUserData]: UserDataDataTypeDTO;
|
|
76
79
|
[ActionTypeEnum.WindowUpdateUrl]: WindowUpdateUrlDataTypeDTO;
|
package/src/lib/actions/base.js
CHANGED
|
@@ -19,6 +19,7 @@ export var ActionTypeEnum;
|
|
|
19
19
|
ActionTypeEnum["SettingsOpen"] = "SettingsOpen";
|
|
20
20
|
ActionTypeEnum["GetBranding"] = "GetBranding";
|
|
21
21
|
ActionTypeEnum["PubsubNotification"] = "PubsubNotification";
|
|
22
|
+
ActionTypeEnum["PubsubStatus"] = "PubsubStatus";
|
|
22
23
|
ActionTypeEnum["RequestExchangeToken"] = "RequestExchangeToken";
|
|
23
24
|
ActionTypeEnum["RequestUserData"] = "RequestUserData";
|
|
24
25
|
ActionTypeEnum["WindowUpdateUrl"] = "WindowUpdateUrl";
|
|
@@ -29,6 +30,7 @@ export var ActionTypeEnum;
|
|
|
29
30
|
ActionTypeEnum["WindowSetUnsavedChanges"] = "WindowSetUnsavedChanges";
|
|
30
31
|
})(ActionTypeEnum || (ActionTypeEnum = {}));
|
|
31
32
|
export const AdditionalMessageConfig = {
|
|
32
|
-
[ActionTypeEnum.PubsubNotification]: { keepAlive: true }
|
|
33
|
+
[ActionTypeEnum.PubsubNotification]: { keepAlive: true },
|
|
34
|
+
[ActionTypeEnum.PubsubStatus]: { keepAlive: true }
|
|
33
35
|
};
|
|
34
36
|
//# sourceMappingURL=base.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../../../libs/integrations-messenger/src/lib/actions/base.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../../../libs/integrations-messenger/src/lib/actions/base.ts"],"names":[],"mappings":"AA2BA,MAAM,CAAN,IAAY,sBAEX;AAFD,WAAY,sBAAsB;IAChC,iDAAuB,CAAA;AACzB,CAAC,EAFW,sBAAsB,KAAtB,sBAAsB,QAEjC;AAED,MAAM,CAAN,IAAY,cAiCX;AAjCD,WAAY,cAAc;IACxB,iEAA+C,CAAA;IAC/C,mEAAiD,CAAA;IACjD,qEAAmD,CAAA;IACnD,uDAAqC,CAAA;IACrC,yDAAuC,CAAA;IACvC,mDAAiC,CAAA;IACjC,uEAAqD,CAAA;IACrD,iEAA+C,CAAA;IAC/C,2CAAyB,CAAA;IACzB,6DAA2C,CAAA;IAE3C,6CAA2B,CAAA;IAC3B,qDAAmC,CAAA;IAEnC,+CAA6B,CAAA;IAE7B,6CAA2B,CAAA;IAE3B,2DAAyC,CAAA;IACzC,+CAA6B,CAAA;IAE7B,+DAA6C,CAAA;IAC7C,qDAAmC,CAAA;IAEnC,qDAAmC,CAAA;IAEnC,qDAAmC,CAAA;IAEnC,qDAAmC,CAAA;IACnC,uDAAqC,CAAA;IACrC,mEAAiD,CAAA;IACjD,qEAAmD,CAAA;AACrD,CAAC,EAjCW,cAAc,KAAd,cAAc,QAiCzB;AAED,MAAM,CAAC,MAAM,uBAAuB,GAA6D;IAC/F,CAAC,cAAc,CAAC,kBAAkB,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;IACxD,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;CACnD,CAAC"}
|
|
@@ -34,6 +34,10 @@ declare const _default: {
|
|
|
34
34
|
handleOpenAgentSession: import("../models").ActionHandlerFn<import("./base").ActionTypeEnum.MatterOpenAgentSession>;
|
|
35
35
|
};
|
|
36
36
|
pubsub: {
|
|
37
|
+
sendStatusRequest: (handler: (response: {
|
|
38
|
+
status: import("./pubsub/status").PubsubConnectionStatusDTO;
|
|
39
|
+
}) => void) => import("../models").MessageHandlerResponseDTO;
|
|
40
|
+
handleStatusRequest: import("../models").StreamActionHandlerFn<import("./base").ActionTypeEnum.PubsubStatus>;
|
|
37
41
|
sendNotificationRequest: import("../models").StreamActionCreatorFn<import("./base").ActionTypeEnum.PubsubNotification>;
|
|
38
42
|
handleNotificationRequest: import("../models").StreamActionHandlerFn<import("./base").ActionTypeEnum.PubsubNotification>;
|
|
39
43
|
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
+
sendStatusRequest: (handler: (response: {
|
|
3
|
+
status: import("./status").PubsubConnectionStatusDTO;
|
|
4
|
+
}) => void) => import("../../models").MessageHandlerResponseDTO;
|
|
5
|
+
handleStatusRequest: import("../../models").StreamActionHandlerFn<import("../base").ActionTypeEnum.PubsubStatus>;
|
|
2
6
|
sendNotificationRequest: import("../../models").StreamActionCreatorFn<import("../base").ActionTypeEnum.PubsubNotification>;
|
|
3
7
|
handleNotificationRequest: import("../../models").StreamActionHandlerFn<import("../base").ActionTypeEnum.PubsubNotification>;
|
|
4
8
|
};
|
|
@@ -1 +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;
|
|
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;AAC1C,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,eAAe;IACb,GAAG,YAAY;IACf,GAAG,MAAM;CACV,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type MessageHandlerResponseDTO } from '../../models';
|
|
2
|
+
import { ActionTypeEnum } from '../base';
|
|
3
|
+
import { type ActionDataTypeDTO } from '../utils';
|
|
4
|
+
export type PubsubConnectionStatusDTO = 'Disconnected' | 'Connecting' | 'Connected' | 'Disconnecting' | 'Reconnecting';
|
|
5
|
+
type PubsubStatusResponseDTO = {
|
|
6
|
+
status: PubsubConnectionStatusDTO;
|
|
7
|
+
};
|
|
8
|
+
export type PubsubStatusDataTypeDTO = ActionDataTypeDTO<void, PubsubStatusResponseDTO>;
|
|
9
|
+
declare const _default: {
|
|
10
|
+
sendStatusRequest: (handler: (response: PubsubStatusResponseDTO) => void) => MessageHandlerResponseDTO;
|
|
11
|
+
handleStatusRequest: import("../../models").StreamActionHandlerFn<ActionTypeEnum.PubsubStatus>;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ActionTypeEnum } from '../base';
|
|
2
|
+
import { buildAsyncActionCreatorFn, buildAsyncActionHandlerFn } from '../utils';
|
|
3
|
+
const handleStatusRequest = buildAsyncActionHandlerFn(ActionTypeEnum.PubsubStatus);
|
|
4
|
+
const sendStatusRequestBase = buildAsyncActionCreatorFn(ActionTypeEnum.PubsubStatus);
|
|
5
|
+
const sendStatusRequest = (handler) => sendStatusRequestBase(undefined, handler);
|
|
6
|
+
export default {
|
|
7
|
+
sendStatusRequest,
|
|
8
|
+
handleStatusRequest
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../../../../../libs/integrations-messenger/src/lib/actions/pubsub/status.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAA0B,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAUxG,MAAM,mBAAmB,GAAG,yBAAyB,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;AAEnF,MAAM,qBAAqB,GAAG,yBAAyB,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;AAErF,MAAM,iBAAiB,GAAG,CAAC,OAAoD,EAA6B,EAAE,CAC5G,qBAAqB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAE5C,eAAe;IACb,iBAAiB;IACjB,mBAAmB;CACpB,CAAC"}
|