@corto-ai/integrations-messenger 0.0.8-dev.1 → 0.0.8-test.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.
package/README.md CHANGED
@@ -74,6 +74,7 @@ messenger.registerChild(iframe.contentWindow, 'my-integration-app');
74
74
  | `settings` | `sendOpenSettings` / `handleOpenSettings` | Open the host application's settings. |
75
75
  | `branding` | `sendGetBranding` / `handleGetBranding` | Request the active brand name and logo URL, or pass an optional `brandName` to request a specific brand instead of the active one. |
76
76
  | `auth` | `sendExchangeTokenRequest` / `handleExchangeTokenRequest` | Exchange a `clientId` for an auth token. |
77
+ | `auth` | `sendUserDataRequest` / `handleUserDataRequest` | Request the current user's data from the host (currently returns `userId`). |
77
78
  | `pubsub` | `sendNotificationRequest` / `handleNotificationRequest` | Subscribe to (or publish) notifications on a `channel`, supporting multiple responses over time. |
78
79
 
79
80
  All `matter`, `contact`, and `settings` actions accept an optional `newTab` flag to indicate the host should open the target in a new tab, and `matter` actions also accept an optional `matterId` beyond what's called out above.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@corto-ai/integrations-messenger",
3
- "version": "0.0.8-dev.1",
4
- "devVersion": "1",
3
+ "version": "0.0.8-test.2",
4
+ "devVersion": "2",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "main": "./src/index.js",
package/src/index.d.ts CHANGED
@@ -8,6 +8,8 @@ declare const _default: {
8
8
  registerChild: (child: Window, id: string) => Promise<void>;
9
9
  actions: {
10
10
  auth: {
11
+ sendUserDataRequest: import(".").ActionCreatorFn<import(".").ActionTypeEnum.RequestUserData>;
12
+ handleUserDataRequest: import(".").ActionHandlerFn<import(".").ActionTypeEnum.RequestUserData>;
11
13
  sendExchangeTokenRequest: import(".").ActionCreatorFn<import(".").ActionTypeEnum.RequestExchangeToken>;
12
14
  handleExchangeTokenRequest: import(".").ActionHandlerFn<import(".").ActionTypeEnum.RequestExchangeToken>;
13
15
  };
@@ -1,4 +1,6 @@
1
1
  declare const _default: {
2
+ sendUserDataRequest: import("../../models").ActionCreatorFn<import("../base").ActionTypeEnum.RequestUserData>;
3
+ handleUserDataRequest: import("../../models").ActionHandlerFn<import("../base").ActionTypeEnum.RequestUserData>;
2
4
  sendExchangeTokenRequest: import("../../models").ActionCreatorFn<import("../base").ActionTypeEnum.RequestExchangeToken>;
3
5
  handleExchangeTokenRequest: import("../../models").ActionHandlerFn<import("../base").ActionTypeEnum.RequestExchangeToken>;
4
6
  };
@@ -1,5 +1,7 @@
1
1
  import exchangeToken from './exchange-token';
2
+ import userData from './user-data';
2
3
  export default {
3
- ...exchangeToken
4
+ ...exchangeToken,
5
+ ...userData
4
6
  };
5
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../libs/integrations-messenger/src/lib/actions/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAE7C,eAAe;IACb,GAAG,aAAa;CACjB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../libs/integrations-messenger/src/lib/actions/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC,eAAe;IACb,GAAG,aAAa;IAChB,GAAG,QAAQ;CACZ,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { ActionTypeEnum } from '../base';
2
+ import { type ActionDataTypeDTO } from '../utils';
3
+ type UserDataResponseDTO = {
4
+ userId: string;
5
+ };
6
+ export type UserDataDataTypeDTO = ActionDataTypeDTO<void, UserDataResponseDTO>;
7
+ declare const _default: {
8
+ sendUserDataRequest: import("../../models").ActionCreatorFn<ActionTypeEnum.RequestUserData>;
9
+ handleUserDataRequest: import("../../models").ActionHandlerFn<ActionTypeEnum.RequestUserData>;
10
+ };
11
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import { ActionTypeEnum } from '../base';
2
+ import { buildActionCreatorFn, buildActionHandlerFn } from '../utils';
3
+ const sendUserDataRequest = buildActionCreatorFn(ActionTypeEnum.RequestUserData);
4
+ const handleUserDataRequest = buildActionHandlerFn(ActionTypeEnum.RequestUserData);
5
+ export default { sendUserDataRequest, handleUserDataRequest };
6
+ //# sourceMappingURL=user-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-data.js","sourceRoot":"","sources":["../../../../../../../libs/integrations-messenger/src/lib/actions/auth/user-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAA0B,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAQ9F,MAAM,mBAAmB,GAAG,oBAAoB,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;AACjF,MAAM,qBAAqB,GAAG,oBAAoB,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;AAEnF,eAAe,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { type AdditionalMessageConfigDTO } from '../models';
2
2
  import { type ExchangeTokenDataTypeDTO } from './auth/exchange-token';
3
+ import { type UserDataDataTypeDTO } from './auth/user-data';
3
4
  import { type GetBrandingDataTypeDTO } from './branding/get-branding';
4
5
  import { type ContactOpenDataTypeDTO } from './contact/open';
5
6
  import { type ContactOpenEditDataTypeDTO } from './contact/open-edit';
@@ -33,7 +34,8 @@ export declare enum ActionTypeEnum {
33
34
  SettingsOpen = "SettingsOpen",
34
35
  GetBranding = "GetBranding",
35
36
  PubsubNotification = "PubsubNotification",
36
- RequestExchangeToken = "RequestExchangeToken"
37
+ RequestExchangeToken = "RequestExchangeToken",
38
+ RequestUserData = "RequestUserData"
37
39
  }
38
40
  export declare const AdditionalMessageConfig: {
39
41
  [key in ActionTypeEnum]?: AdditionalMessageConfigDTO;
@@ -55,4 +57,5 @@ export type DataTypeMapDTO = {
55
57
  [ActionTypeEnum.GetBranding]: GetBrandingDataTypeDTO;
56
58
  [ActionTypeEnum.PubsubNotification]: PubsubNotificationDataTypeDTO;
57
59
  [ActionTypeEnum.RequestExchangeToken]: ExchangeTokenDataTypeDTO;
60
+ [ActionTypeEnum.RequestUserData]: UserDataDataTypeDTO;
58
61
  };
@@ -19,6 +19,7 @@ export var ActionTypeEnum;
19
19
  ActionTypeEnum["GetBranding"] = "GetBranding";
20
20
  ActionTypeEnum["PubsubNotification"] = "PubsubNotification";
21
21
  ActionTypeEnum["RequestExchangeToken"] = "RequestExchangeToken";
22
+ ActionTypeEnum["RequestUserData"] = "RequestUserData";
22
23
  })(ActionTypeEnum || (ActionTypeEnum = {}));
23
24
  export const AdditionalMessageConfig = {
24
25
  [ActionTypeEnum.PubsubNotification]: { keepAlive: true }
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../../../libs/integrations-messenger/src/lib/actions/base.ts"],"names":[],"mappings":"AAkBA,MAAM,CAAN,IAAY,sBAEX;AAFD,WAAY,sBAAsB;IAChC,iDAAuB,CAAA;AACzB,CAAC,EAFW,sBAAsB,KAAtB,sBAAsB,QAEjC;AAED,MAAM,CAAN,IAAY,cAqBX;AArBD,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;IAEzB,6CAA2B,CAAA;IAC3B,qDAAmC,CAAA;IAEnC,+CAA6B,CAAA;IAE7B,6CAA2B,CAAA;IAE3B,2DAAyC,CAAA;IAEzC,+DAA6C,CAAA;AAC/C,CAAC,EArBW,cAAc,KAAd,cAAc,QAqBzB;AAED,MAAM,CAAC,MAAM,uBAAuB,GAA6D;IAC/F,CAAC,cAAc,CAAC,kBAAkB,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;CACzD,CAAC"}
1
+ {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../../../libs/integrations-messenger/src/lib/actions/base.ts"],"names":[],"mappings":"AAmBA,MAAM,CAAN,IAAY,sBAEX;AAFD,WAAY,sBAAsB;IAChC,iDAAuB,CAAA;AACzB,CAAC,EAFW,sBAAsB,KAAtB,sBAAsB,QAEjC;AAED,MAAM,CAAN,IAAY,cAsBX;AAtBD,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;IAEzB,6CAA2B,CAAA;IAC3B,qDAAmC,CAAA;IAEnC,+CAA6B,CAAA;IAE7B,6CAA2B,CAAA;IAE3B,2DAAyC,CAAA;IAEzC,+DAA6C,CAAA;IAC7C,qDAAmC,CAAA;AACrC,CAAC,EAtBW,cAAc,KAAd,cAAc,QAsBzB;AAED,MAAM,CAAC,MAAM,uBAAuB,GAA6D;IAC/F,CAAC,cAAc,CAAC,kBAAkB,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;CACzD,CAAC"}
@@ -1,5 +1,7 @@
1
1
  declare const _default: {
2
2
  auth: {
3
+ sendUserDataRequest: import("../models").ActionCreatorFn<import("./base").ActionTypeEnum.RequestUserData>;
4
+ handleUserDataRequest: import("../models").ActionHandlerFn<import("./base").ActionTypeEnum.RequestUserData>;
3
5
  sendExchangeTokenRequest: import("../models").ActionCreatorFn<import("./base").ActionTypeEnum.RequestExchangeToken>;
4
6
  handleExchangeTokenRequest: import("../models").ActionHandlerFn<import("./base").ActionTypeEnum.RequestExchangeToken>;
5
7
  };