@hiver/connector-agent 4.15.1 → 4.16.0-uauthv4-beta.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/app/connector-cards.d.ts.map +1 -1
- package/app/provider.d.ts.map +1 -1
- package/constants/api.d.ts +5 -5
- package/constants/api.d.ts.map +1 -1
- package/constants/card.d.ts +2 -0
- package/constants/card.d.ts.map +1 -1
- package/features/connector-cards/__tests__/resolveCardLevelErrorMessage.test.d.ts +2 -0
- package/features/connector-cards/__tests__/resolveCardLevelErrorMessage.test.d.ts.map +1 -0
- package/features/connector-cards/api/userAuth.d.ts +25 -0
- package/features/connector-cards/api/userAuth.d.ts.map +1 -0
- package/features/connector-cards/components/card-list/CardWithUserAuth.d.ts +33 -0
- package/features/connector-cards/components/card-list/CardWithUserAuth.d.ts.map +1 -0
- package/features/connector-cards/components/card-list/ListCards.d.ts.map +1 -1
- package/features/connector-cards/components/card-list/NoCardsUserAuthGate.d.ts +24 -0
- package/features/connector-cards/components/card-list/NoCardsUserAuthGate.d.ts.map +1 -0
- package/features/connector-cards/components/card-list/__tests__/NoCardsUserAuthGate.test.d.ts +2 -0
- package/features/connector-cards/components/card-list/__tests__/NoCardsUserAuthGate.test.d.ts.map +1 -0
- package/features/connector-cards/components/card-list/card-content-value.d.ts.map +1 -1
- package/features/connector-cards/components/connection-in-progress-modal/index.d.ts +23 -0
- package/features/connector-cards/components/connection-in-progress-modal/index.d.ts.map +1 -0
- package/features/connector-cards/components/user-auth-card/__tests__/UserAuthCard.test.d.ts +2 -0
- package/features/connector-cards/components/user-auth-card/__tests__/UserAuthCard.test.d.ts.map +1 -0
- package/features/connector-cards/components/user-auth-card/index.d.ts +33 -0
- package/features/connector-cards/components/user-auth-card/index.d.ts.map +1 -0
- package/features/connector-cards/components/user-auth-card/style.d.ts +32 -0
- package/features/connector-cards/components/user-auth-card/style.d.ts.map +1 -0
- package/features/connector-cards/constants/api.d.ts +2 -0
- package/features/connector-cards/constants/api.d.ts.map +1 -1
- package/features/connector-cards/hooks/useUserAuthFlow.d.ts +61 -0
- package/features/connector-cards/hooks/useUserAuthFlow.d.ts.map +1 -0
- package/features/connector-cards/store/slice.d.ts.map +1 -1
- package/features/connector-cards/store/userAuth.d.ts +88 -0
- package/features/connector-cards/store/userAuth.d.ts.map +1 -0
- package/features/connector-cards/store/userAuth.test.d.ts +2 -0
- package/features/connector-cards/store/userAuth.test.d.ts.map +1 -0
- package/features/connector-cards/utils/registerUserAuthCallback.d.ts +13 -0
- package/features/connector-cards/utils/registerUserAuthCallback.d.ts.map +1 -0
- package/features/connector-cards/utils.d.ts +9 -0
- package/features/connector-cards/utils.d.ts.map +1 -1
- package/features/write-form/components/write-form/index.d.ts.map +1 -1
- package/features/write-form/store/slice.d.ts.map +1 -1
- package/features/write-form/utils/response.d.ts.map +1 -1
- package/index.es.js +8537 -7658
- package/index.umd.js +376 -306
- package/package.json +1 -1
- package/store/hooks.d.ts +2 -0
- package/store/hooks.d.ts.map +1 -1
- package/store/index.d.ts +6 -0
- package/store/index.d.ts.map +1 -1
- package/store/slice.d.ts +3 -2
- package/store/slice.d.ts.map +1 -1
- package/testing/mocks/handlers/fetch-cards.d.ts.map +1 -1
- package/testing/mocks/handlers/user-auth.d.ts +31 -0
- package/testing/mocks/handlers/user-auth.d.ts.map +1 -0
- package/testing/mocks/handlers/write-capability.d.ts.map +1 -1
- package/testing/mocks/handlers.d.ts.map +1 -1
- package/types/cards.d.ts +1 -0
- package/types/cards.d.ts.map +1 -1
- package/types/form.d.ts +2 -0
- package/types/form.d.ts.map +1 -1
- package/utils/userAuth.d.ts +18 -0
- package/utils/userAuth.d.ts.map +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connector-cards.d.ts","sourceRoot":"","sources":["../../src/app/connector-cards.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAkF,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"connector-cards.d.ts","sourceRoot":"","sources":["../../src/app/connector-cards.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAkF,MAAM,OAAO,CAAC;AAyG3G,UAAU,SAAS;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,SAAS,CAkrBxC,CAAC"}
|
package/app/provider.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/app/provider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/app/provider.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,KAAK,gBAAgB,GAAG;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,iBAAiB,CAAC,EAAE,aAAa,CAAC;IAClC,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,eAAe,EAAE,eAAe,CAAC;IACjC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,WAAW,oKAYrB,gBAAgB,4CAqClB,CAAC"}
|
package/constants/api.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export type ApiStatus = 'idle' | 'loading' | 'failed';
|
|
2
2
|
export declare const API_METHODS: {
|
|
3
|
-
GET:
|
|
4
|
-
POST:
|
|
5
|
-
DELETE:
|
|
6
|
-
PATCH:
|
|
7
|
-
PUT:
|
|
3
|
+
readonly GET: "GET";
|
|
4
|
+
readonly POST: "POST";
|
|
5
|
+
readonly DELETE: "DELETE";
|
|
6
|
+
readonly PATCH: "PATCH";
|
|
7
|
+
readonly PUT: "PUT";
|
|
8
8
|
};
|
|
9
9
|
export declare const API_STATUS: {
|
|
10
10
|
[key: string]: ApiStatus;
|
package/constants/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/constants/api.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEtD,eAAO,MAAM,WAAW;;;;;;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/constants/api.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEtD,eAAO,MAAM,WAAW;;;;;;CAMd,CAAC;AAEX,eAAO,MAAM,UAAU,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAIlD,CAAC;AAEF,eAAO,MAAM,QAAQ,YAAY,CAAC;AAClC,eAAO,MAAM,aAAa,EAAE,MAAgD,CAAC"}
|
package/constants/card.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ export declare const EXPANDED_STATE = "Expanded";
|
|
|
26
26
|
export declare const COLLAPSED_STATE = "Collapsed";
|
|
27
27
|
export declare const CONNECTOR_CARD_COMMON_ERROR = "Something is wrong with the {{connector_name}} Connector setup. Please check our help guide <>here<>.";
|
|
28
28
|
export declare const UNKNOWN_ERROR = "UNKNOWN_ERROR";
|
|
29
|
+
export declare const WORKSPACE_ACCESS_DENIED_CODE = "WORKSPACE_ACCESS_DENIED";
|
|
30
|
+
export declare const WORKSPACE_ACCESS_DENIED_MESSAGE = "You don't have access to this card's workspace";
|
|
29
31
|
export declare const SUPPORT_LINK = "https://help.hiverhq.com/custom-connectors/common-connector-errors";
|
|
30
32
|
export declare const CREATE_OBJECT_SOURCE: {
|
|
31
33
|
MAIN_BUTTON: string;
|
package/constants/card.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/constants/card.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,SAAS,CAAC;AAC3B,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,SAAS,iCAAiC,CAAC;AACxD,eAAO,MAAM,OAAO,sBAAsB,CAAC;AAC3C,eAAO,MAAM,IAAI,MAAM,CAAC;AACxB,eAAO,MAAM,OAAO,YAAY,CAAC;AACjC,eAAO,MAAM,QAAQ,aAAa,CAAC;AACnC,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,UAAU,eAAe,CAAC;AACvC,eAAO,MAAM,IAAI,SAAS,CAAC;AAC3B,eAAO,MAAM,SAAS,aAAa,CAAC;AACpC,eAAO,MAAM,KAAK,UAAU,CAAC;AAC7B,eAAO,MAAM,IAAI,SAAS,CAAC;AAC3B,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,IAAI,SAAS,CAAC;AAC3B,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,eAAe,sBAAsB,CAAC;AACnD,eAAO,MAAM,kBAAkB,yBAAyB,CAAC;AACzD,eAAO,MAAM,iBAAiB,iDAAiD,CAAC;AAChF,eAAO,MAAM,gBAAgB,kLAAkL,CAAC;AAChN,eAAO,MAAM,SAAS,cAAc,CAAC;AAErC,eAAO,MAAM,gBAAgB,gBAAgB,CAAC;AAE9C,eAAO,MAAM,cAAc,aAAa,CAAC;AACzC,eAAO,MAAM,eAAe,cAAc,CAAC;AAC3C,eAAO,MAAM,2BAA2B,0GACiE,CAAC;AAC1G,eAAO,MAAM,aAAa,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/constants/card.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,SAAS,CAAC;AAC3B,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,SAAS,iCAAiC,CAAC;AACxD,eAAO,MAAM,OAAO,sBAAsB,CAAC;AAC3C,eAAO,MAAM,IAAI,MAAM,CAAC;AACxB,eAAO,MAAM,OAAO,YAAY,CAAC;AACjC,eAAO,MAAM,QAAQ,aAAa,CAAC;AACnC,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,UAAU,eAAe,CAAC;AACvC,eAAO,MAAM,IAAI,SAAS,CAAC;AAC3B,eAAO,MAAM,SAAS,aAAa,CAAC;AACpC,eAAO,MAAM,KAAK,UAAU,CAAC;AAC7B,eAAO,MAAM,IAAI,SAAS,CAAC;AAC3B,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,IAAI,SAAS,CAAC;AAC3B,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,eAAe,sBAAsB,CAAC;AACnD,eAAO,MAAM,kBAAkB,yBAAyB,CAAC;AACzD,eAAO,MAAM,iBAAiB,iDAAiD,CAAC;AAChF,eAAO,MAAM,gBAAgB,kLAAkL,CAAC;AAChN,eAAO,MAAM,SAAS,cAAc,CAAC;AAErC,eAAO,MAAM,gBAAgB,gBAAgB,CAAC;AAE9C,eAAO,MAAM,cAAc,aAAa,CAAC;AACzC,eAAO,MAAM,eAAe,cAAc,CAAC;AAC3C,eAAO,MAAM,2BAA2B,0GACiE,CAAC;AAC1G,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAK7C,eAAO,MAAM,4BAA4B,4BAA4B,CAAC;AACtE,eAAO,MAAM,+BAA+B,mDAAmD,CAAC;AAChG,eAAO,MAAM,YAAY,uEAAuE,CAAC;AACjG,eAAO,MAAM,oBAAoB;;;CAGhC,CAAC;AACF,eAAO,MAAM,qBAAqB,mCAAmC,CAAC;AACtE,eAAO,MAAM,gBAAgB,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveCardLevelErrorMessage.test.d.ts","sourceRoot":"","sources":["../../../../src/features/connector-cards/__tests__/resolveCardLevelErrorMessage.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { UserAuthState } from '../store/userAuth';
|
|
2
|
+
export interface IUserAuthStatusResponse {
|
|
3
|
+
state: UserAuthState;
|
|
4
|
+
reason?: string;
|
|
5
|
+
external_user_id?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface IUserAuthStartResponse {
|
|
8
|
+
auth_url: string;
|
|
9
|
+
tier: 'user';
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Reads the signed-in agent's user-tier connection state for a
|
|
13
|
+
* connector. Called on card mount when `connector.userAuthEnabled`
|
|
14
|
+
* is true; not called for legacy connectors so legacy mount paths
|
|
15
|
+
* stay byte-for-byte unchanged.
|
|
16
|
+
*/
|
|
17
|
+
export declare const getUserAuthStatus: (connectorId: string) => Promise<import('axios').AxiosResponse<any, any> | undefined>;
|
|
18
|
+
/**
|
|
19
|
+
* Builds the OAuth authorization URL the agent visits in a popup to
|
|
20
|
+
* connect their personal account. The BE encodes `state.tier=user`
|
|
21
|
+
* + `state.user_id` so the callback knows to land in
|
|
22
|
+
* /process_user_callback rather than the workspace flow.
|
|
23
|
+
*/
|
|
24
|
+
export declare const startUserAuth: (connectorId: string) => Promise<import('axios').AxiosResponse<any, any> | undefined>;
|
|
25
|
+
//# sourceMappingURL=userAuth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userAuth.d.ts","sourceRoot":"","sources":["../../../../src/features/connector-cards/api/userAuth.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE/E,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,gBAAiB,MAAM,iEAKpD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,gBAAiB,MAAM,iEAKhD,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ICard, ISpecificCard } from '../../../../types/cards';
|
|
3
|
+
import { ApiStatus } from '../../../../types/api';
|
|
4
|
+
interface IProps {
|
|
5
|
+
card: ICard;
|
|
6
|
+
email: string;
|
|
7
|
+
specificCardData: Record<string, ISpecificCard> | null;
|
|
8
|
+
specificConnectorApiStatus: Record<string, ApiStatus> | null;
|
|
9
|
+
defaultOpenState: boolean;
|
|
10
|
+
onCardUnlinking: () => void;
|
|
11
|
+
isPrimaryUserAuthCard?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Wraps the regular Card render with the user-tier auth gate.
|
|
15
|
+
*
|
|
16
|
+
* - When the install has not opted into user-tier auth
|
|
17
|
+
* (`card.userAuthEnabled !== true`) → renders the regular Card.
|
|
18
|
+
* Zero behavior change for legacy connectors.
|
|
19
|
+
*
|
|
20
|
+
* - When opted in:
|
|
21
|
+
* * On mount, fetches /user-auth/status once via tanstack-query
|
|
22
|
+
* (30s staleTime → batches across cards sharing the connector).
|
|
23
|
+
* * If the resolved state is `connected` (or `unknown` while the
|
|
24
|
+
* fetch is in-flight) → renders the regular Card.
|
|
25
|
+
* * Otherwise renders <UserAuthCard /> with the right variant.
|
|
26
|
+
*
|
|
27
|
+
* The `onConnected` callback invalidates the card data query so
|
|
28
|
+
* the regular Card mounts immediately after the popup completes,
|
|
29
|
+
* without forcing the user to refresh or remount.
|
|
30
|
+
*/
|
|
31
|
+
export declare const CardWithUserAuth: FC<IProps>;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=CardWithUserAuth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardWithUserAuth.d.ts","sourceRoot":"","sources":["../../../../../src/features/connector-cards/components/card-list/CardWithUserAuth.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAW3B,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,UAAU,MAAM;IACd,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,IAAI,CAAC;IACvD,0BAA0B,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAI,CAAC;IAC7D,gBAAgB,EAAE,OAAO,CAAC;IAC1B,eAAe,EAAE,MAAM,IAAI,CAAC;IAK5B,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,MAAM,CAkGvC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListCards.d.ts","sourceRoot":"","sources":["../../../../../src/features/connector-cards/components/card-list/ListCards.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAI7C,UAAU,MAAM;IACd,KAAK,EAAE,KAAK,EAAE,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,IAAI,CAAC;IACvD,0BAA0B,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAI,CAAC;IAC7D,eAAe,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"ListCards.d.ts","sourceRoot":"","sources":["../../../../../src/features/connector-cards/components/card-list/ListCards.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAI7C,UAAU,MAAM;IACd,KAAK,EAAE,KAAK,EAAE,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,IAAI,CAAC;IACvD,0BAA0B,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAI,CAAC;IAC7D,eAAe,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,MAAM,CAwChC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
export interface IUserAuthConnector {
|
|
3
|
+
connectorId: string;
|
|
4
|
+
connectorName: string;
|
|
5
|
+
connectorLogo: string;
|
|
6
|
+
}
|
|
7
|
+
interface IProps {
|
|
8
|
+
connectors: IUserAuthConnector[];
|
|
9
|
+
onConnected: () => void;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Renders the "Sign in to use X" card on the agent panel when there are no
|
|
14
|
+
* linked cards yet but the connector is opted into user-tier auth and the
|
|
15
|
+
* agent hasn't connected. Without this, the sign-in CTA only ever appeared
|
|
16
|
+
* inside ListCards (per linked card), so a brand-new install showed the
|
|
17
|
+
* create/link banner with no way to authenticate.
|
|
18
|
+
*
|
|
19
|
+
* When no connector is blocking (all connected, or status still unknown)
|
|
20
|
+
* the children (create banner) render as before.
|
|
21
|
+
*/
|
|
22
|
+
export declare const NoCardsUserAuthGate: FC<IProps>;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=NoCardsUserAuthGate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoCardsUserAuthGate.d.ts","sourceRoot":"","sources":["../../../../../src/features/connector-cards/components/card-list/NoCardsUserAuthGate.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUtC,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,MAAM;IAGd,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACjC,WAAW,EAAE,MAAM,IAAI,CAAC;IAGxB,QAAQ,EAAE,SAAS,CAAC;CACrB;AA8CD;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,MAAM,CAa1C,CAAC"}
|
package/features/connector-cards/components/card-list/__tests__/NoCardsUserAuthGate.test.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoCardsUserAuthGate.test.d.ts","sourceRoot":"","sources":["../../../../../../src/features/connector-cards/components/card-list/__tests__/NoCardsUserAuthGate.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-content-value.d.ts","sourceRoot":"","sources":["../../../../../src/features/connector-cards/components/card-list/card-content-value.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"card-content-value.d.ts","sourceRoot":"","sources":["../../../../../src/features/connector-cards/components/card-list/card-content-value.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEtD,UAAU,MAAM;IACd,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACpC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,eAAO,MAAM,gBAAgB,UAAW,MAAM,4CA6K7C,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Renders Figma frame 2 — the centered "Connection in progress"
|
|
4
|
+
* overlay shown while a user-tier OAuth popup is open.
|
|
5
|
+
*
|
|
6
|
+
* Mounted once at the app/connector-cards.tsx level rather than
|
|
7
|
+
* per-card. The slice's selectAnyInProgressConnectorId selector
|
|
8
|
+
* naturally dedupes across concurrent connect attempts (which
|
|
9
|
+
* shouldn't happen — the bifrost interceptor only kicks in for
|
|
10
|
+
* one connector at a time — but the design is defensive).
|
|
11
|
+
*
|
|
12
|
+
* The modal exposes a "Cancel" affordance. Closing the OAuth popup is
|
|
13
|
+
* auto-detected (useUserAuthFlow's popup-close watcher), but some providers'
|
|
14
|
+
* own Cancel button navigates the popup to their app *without* redirecting
|
|
15
|
+
* back to us — so the popup stays open, never fires `closed`, and we get no
|
|
16
|
+
* callback. There's no cross-origin way to detect that, so the user needs an
|
|
17
|
+
* explicit escape: Cancel drops the in-progress state (recoverable →
|
|
18
|
+
* Sign-in card) and the per-connector hook closes any orphaned popup. The
|
|
19
|
+
* 5-min in-progress timeout in useUserAuthFlow remains as a final backstop.
|
|
20
|
+
*/
|
|
21
|
+
declare const ConnectionInProgressModal: FC;
|
|
22
|
+
export default ConnectionInProgressModal;
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/connector-cards/components/connection-in-progress-modal/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;AAkBpC;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,yBAAyB,EAAE,EAmGhC,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
|
package/features/connector-cards/components/user-auth-card/__tests__/UserAuthCard.test.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserAuthCard.test.d.ts","sourceRoot":"","sources":["../../../../../../src/features/connector-cards/components/user-auth-card/__tests__/UserAuthCard.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { UserAuthState } from '../../store/userAuth';
|
|
3
|
+
interface IUserAuthCardProps {
|
|
4
|
+
connectorId: string;
|
|
5
|
+
connectorName: string;
|
|
6
|
+
connectorLogo: string;
|
|
7
|
+
variant: UserAuthState;
|
|
8
|
+
/** Optional reason from the backend (e.g. `workspace_mismatch`,
|
|
9
|
+
* `site_access_denied`, `refresh_failed`). Used to pick
|
|
10
|
+
* variant-specific copy below. */
|
|
11
|
+
reason?: string;
|
|
12
|
+
/** Called once the connect popup flow lands at `connected`.
|
|
13
|
+
* Typically retries the original API call that surfaced the
|
|
14
|
+
* 412. Pass-through to useUserAuthFlow. */
|
|
15
|
+
onConnected?: () => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Renders Figma frames 1 and 4 (and their variants). Same component
|
|
19
|
+
* for both — the only difference is the badge + copy.
|
|
20
|
+
*
|
|
21
|
+
* - `disconnected` / `unknown` → frame 1: "Sign in to use X"
|
|
22
|
+
* - `reauth_required` → frame 4: "Authentication failed"
|
|
23
|
+
* - `workspace_mismatch` → frame 4 with workspace-specific copy
|
|
24
|
+
* - `in_progress` → button disabled + spinner; the
|
|
25
|
+
* centered modal owns the user's attention but the card body
|
|
26
|
+
* stays mounted so layout doesn't shift when the modal closes.
|
|
27
|
+
* - `connected` → this component shouldn't render
|
|
28
|
+
* when state === connected; the parent routes to the normal card.
|
|
29
|
+
* Defensive fall-through renders nothing.
|
|
30
|
+
*/
|
|
31
|
+
declare const UserAuthCard: FC<IUserAuthCardProps>;
|
|
32
|
+
export default UserAuthCard;
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/connector-cards/components/user-auth-card/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAe,MAAM,OAAO,CAAC;AAKxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAiB/E,UAAU,kBAAkB;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,aAAa,CAAC;IACvB;;uCAEmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;gDAE4C;IAC5C,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,YAAY,EAAE,EAAE,CAAC,kBAAkB,CAgIxC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { HTMLAttributes, ImgHTMLAttributes } from 'react';
|
|
2
|
+
import { StackProps, BoxProps, ButtonProps } from '@hiver/hiver-ui-kit';
|
|
3
|
+
import { StyledComponent } from '@emotion/styled';
|
|
4
|
+
/**
|
|
5
|
+
* Outer card — cool near-white wash (Gray 6a) with a hairline Gray 6
|
|
6
|
+
* border, matching Figma node 10:2945. Two visually-distinct sections
|
|
7
|
+
* inside: the logo block on top, the title/body/CTA below. Tight
|
|
8
|
+
* 4px inset on top/sides, 24px breathing room at the bottom.
|
|
9
|
+
*/
|
|
10
|
+
export declare const CardWrapper: StyledComponent<BoxProps>;
|
|
11
|
+
/**
|
|
12
|
+
* The two-logo block sits in its own white panel at the top of the
|
|
13
|
+
* card (Figma 9:2924) — bordered, 10px radius, generous 48px vertical
|
|
14
|
+
* padding so the logo row floats centered.
|
|
15
|
+
*/
|
|
16
|
+
export declare const LogoPanel: StyledComponent<BoxProps>;
|
|
17
|
+
export declare const LogoRow: StyledComponent<StackProps>;
|
|
18
|
+
export declare const LogoImage: StyledComponent<ImgHTMLAttributes<HTMLImageElement>>;
|
|
19
|
+
/**
|
|
20
|
+
* Red exclamation badge overlaid on the app logo for the
|
|
21
|
+
* reauth_required / workspace_mismatch variants. Matches Figma
|
|
22
|
+
* node 11:4260 — a red disc with a white "!" sitting in a white
|
|
23
|
+
* ring, overflowing the top-right corner of the connector logo.
|
|
24
|
+
*/
|
|
25
|
+
export declare const ErrorBadge: StyledComponent<HTMLAttributes<HTMLSpanElement>>;
|
|
26
|
+
/**
|
|
27
|
+
* Bold indigo CTA matching Figma. theme.palette.purple.primary is
|
|
28
|
+
* the same token the no-connectors card uses for its accent border
|
|
29
|
+
* and text, so the button locks into the existing design system.
|
|
30
|
+
*/
|
|
31
|
+
export declare const AuthenticateButton: StyledComponent<ButtonProps>;
|
|
32
|
+
//# sourceMappingURL=style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../../../src/features/connector-cards/components/user-auth-card/style.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,eAAe,CAAC,QAAQ,CAajD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,eAAe,CAAC,QAAQ,CAQ/C,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,eAAe,CAAC,UAAU,CAM/C,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,eAAe,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAK1E,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,EAAE,eAAe,CAAC,cAAc,CAAC,eAAe,CAAC,CAgBvE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAAC,WAAW,CAsB3D,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export declare const BASE_URL = "/v1/api";
|
|
2
2
|
export declare const FETCH_ALL_CARDS_API: string;
|
|
3
3
|
export declare const FETCH_SPECIFIC_CARD_API: string;
|
|
4
|
+
export declare const USER_AUTH_STATUS_API: string;
|
|
5
|
+
export declare const USER_AUTH_START_API: string;
|
|
4
6
|
//# sourceMappingURL=api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/features/connector-cards/constants/api.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,YAAY,CAAC;AAClC,eAAO,MAAM,mBAAmB,EAAE,MAAuC,CAAC;AAC1E,eAAO,MAAM,uBAAuB,EAAE,MAAgD,CAAC"}
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/features/connector-cards/constants/api.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,YAAY,CAAC;AAClC,eAAO,MAAM,mBAAmB,EAAE,MAAuC,CAAC;AAC1E,eAAO,MAAM,uBAAuB,EAAE,MAAgD,CAAC;AAIvF,eAAO,MAAM,oBAAoB,EAAE,MAA+D,CAAC;AACnG,eAAO,MAAM,mBAAmB,EAAE,MAA8D,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { IUserAuthEntry, UserAuthState } from '../store/userAuth';
|
|
2
|
+
interface UseUserAuthFlowOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Called when the polling loop transitions to `connected`.
|
|
5
|
+
* Typically used to retry the original failed API call.
|
|
6
|
+
*/
|
|
7
|
+
onConnected?: () => void;
|
|
8
|
+
}
|
|
9
|
+
interface UseUserAuthFlowReturn {
|
|
10
|
+
entry: IUserAuthEntry;
|
|
11
|
+
state: UserAuthState;
|
|
12
|
+
connect: () => Promise<void>;
|
|
13
|
+
isStarting: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Orchestrates a user-tier connect flow:
|
|
17
|
+
* 1. `connect()` calls POST /user-auth/start and opens the
|
|
18
|
+
* authorization URL in a popup.
|
|
19
|
+
* 2. Marks the connector in_progress in redux.
|
|
20
|
+
* 3. Polls GET /user-auth/status every 2s via tanstack-query;
|
|
21
|
+
* stops polling on a terminal state.
|
|
22
|
+
* 4. On `connected`, calls onConnected so the caller can retry
|
|
23
|
+
* the original failed API call without forcing a remount.
|
|
24
|
+
*
|
|
25
|
+
* Polling cadence + tanstack-query usage mirrors the admin app's
|
|
26
|
+
* authSuccessQuery — same pattern, scoped per-connector here.
|
|
27
|
+
*/
|
|
28
|
+
export declare function useUserAuthFlow(connectorId: string, options?: UseUserAuthFlowOptions): UseUserAuthFlowReturn;
|
|
29
|
+
/**
|
|
30
|
+
* One-shot fetcher used at card-mount time. Doesn't poll — drops
|
|
31
|
+
* the result into the slice and exits. The polling-on-in_progress
|
|
32
|
+
* behavior is handled separately by useUserAuthFlow above.
|
|
33
|
+
*/
|
|
34
|
+
export declare function useFetchUserAuthStatus(connectorId: string, enabled: boolean): {
|
|
35
|
+
isLoading: boolean;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Panel-level pre-resolver. Given the user-tier connectorIds backing the
|
|
39
|
+
* current panel, fires the initial /user-auth/status fetch for all of them up
|
|
40
|
+
* front (via useQueries — same keys as the per-card hook, so it's deduped) and
|
|
41
|
+
* reports whether ANY is still in flight.
|
|
42
|
+
*
|
|
43
|
+
* The panel uses this to keep the unified loading skeleton up until status has
|
|
44
|
+
* resolved, so it paints its final state (auth card OR real cards) directly
|
|
45
|
+
* instead of flashing the full card view — header, email selector, card
|
|
46
|
+
* skeletons — and then yanking it for the sign-in card (the "blip"). isResolving
|
|
47
|
+
* is false for an empty list and once every query settles (success OR error),
|
|
48
|
+
* so a connector without user-auth, or a failed status fetch, never strands the
|
|
49
|
+
* skeleton.
|
|
50
|
+
*/
|
|
51
|
+
export declare function useUserAuthInitialStatus(connectorIds: string[]): {
|
|
52
|
+
isResolving: boolean;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Exposed for tests + the rare "user clicked Disconnect from the
|
|
56
|
+
* customer-identity-mapping menu" path — wipes the slice entry so
|
|
57
|
+
* the next card mount triggers a fresh status fetch.
|
|
58
|
+
*/
|
|
59
|
+
export declare function useResetUserAuth(): (connectorId: string) => void;
|
|
60
|
+
export {};
|
|
61
|
+
//# sourceMappingURL=useUserAuthFlow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUserAuthFlow.d.ts","sourceRoot":"","sources":["../../../../src/features/connector-cards/hooks/useUserAuthFlow.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAkB/F,UAAU,sBAAsB;IAC9B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,UAAU,qBAAqB;IAC7B,KAAK,EAAE,cAAc,CAAC;IACtB,KAAK,EAAE,aAAa,CAAC;IACrB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,GAAE,sBAA2B,GAAG,qBAAqB,CA8OhH;AA8BD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,CASpG;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG;IAAE,WAAW,EAAE,OAAO,CAAA;CAAE,CAMzF;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,kBAGd,MAAM,UAKvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slice.d.ts","sourceRoot":"","sources":["../../../../src/features/connector-cards/store/slice.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,KAAK,EAAE,aAAa,EAAsB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"slice.d.ts","sourceRoot":"","sources":["../../../../src/features/connector-cards/store/slice.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,KAAK,EAAE,aAAa,EAAsB,MAAM,eAAe,CAAC;AAMzE,eAAO,MAAM,oBAAoB;;;;;;uKAuE/B,CAAC;AAIH,QAAA,MAAM,iBAAiB;;;;cAQT,MAAM,EAAE;kBACJ,MAAM;oBACJ,MAAM;kBACR,MAAM;;;;;;;;;;EAevB,CAAC;AAEF,QAAA,MAAM,qBAAqB;;;;;;;QAUjB,MAAM;WACH,MAAM;qBACI,MAAM;gBACX,OAAO;yBACE,MAAM;;;;;;;;;;EA8BhC,CAAC;;AAEF,wBAA4C;AAC5C,eAAO,MAAM,OAAO;;;;;;0BAA+B,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
+
import { RootState } from '../../../store';
|
|
3
|
+
/**
|
|
4
|
+
* Per-connector user-tier authentication state.
|
|
5
|
+
*
|
|
6
|
+
* The resolver on the backend reads three gates: an LD flag,
|
|
7
|
+
* `connector.user_auth_enabled`, and the API's `auth_tier`. When all
|
|
8
|
+
* three open the flow lands at `user_connectors` lookup. This slice
|
|
9
|
+
* mirrors that lookup's result on the client so the right-panel can
|
|
10
|
+
* render the appropriate state without re-hitting the BE on every
|
|
11
|
+
* card mount.
|
|
12
|
+
*/
|
|
13
|
+
export type UserAuthState = 'unknown' | 'disconnected' | 'in_progress' | 'connected' | 'reauth_required' | 'workspace_mismatch';
|
|
14
|
+
export interface IUserAuthEntry {
|
|
15
|
+
state: UserAuthState;
|
|
16
|
+
reason?: string;
|
|
17
|
+
externalUserId?: string;
|
|
18
|
+
connectUrl?: string;
|
|
19
|
+
lastChecked?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface IUserAuthSlice {
|
|
22
|
+
byConnectorId: {
|
|
23
|
+
[connectorId: string]: IUserAuthEntry;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
interface StatusReceivedPayload {
|
|
27
|
+
connectorId: string;
|
|
28
|
+
state: UserAuthState;
|
|
29
|
+
reason?: string;
|
|
30
|
+
externalUserId?: string;
|
|
31
|
+
authoritative?: boolean;
|
|
32
|
+
}
|
|
33
|
+
interface AuthRequiredPayload {
|
|
34
|
+
connectorId: string;
|
|
35
|
+
connectUrl: string;
|
|
36
|
+
reason?: string;
|
|
37
|
+
}
|
|
38
|
+
interface InProgressPayload {
|
|
39
|
+
connectorId: string;
|
|
40
|
+
}
|
|
41
|
+
interface CompletedPayload {
|
|
42
|
+
connectorId: string;
|
|
43
|
+
externalUserId?: string;
|
|
44
|
+
}
|
|
45
|
+
interface FailedPayload {
|
|
46
|
+
connectorId: string;
|
|
47
|
+
reason: string;
|
|
48
|
+
}
|
|
49
|
+
interface ResetPayload {
|
|
50
|
+
connectorId: string;
|
|
51
|
+
}
|
|
52
|
+
export declare const userAuthSlice: import('@reduxjs/toolkit').Slice<IUserAuthSlice, {
|
|
53
|
+
/**
|
|
54
|
+
* Result of GET /user-auth/status — full picture from the server.
|
|
55
|
+
* Replaces any local in-progress state too: if a poll comes back
|
|
56
|
+
* with `connected` while we thought we were `in_progress`, we
|
|
57
|
+
* adopt the server's view.
|
|
58
|
+
*/
|
|
59
|
+
userAuthStatusReceived(state: import('immer').WritableDraft<IUserAuthSlice>, action: PayloadAction<StatusReceivedPayload>): void;
|
|
60
|
+
/**
|
|
61
|
+
* Fired from the bifrost 412 interceptor. Carries the connect URL
|
|
62
|
+
* so the UI can launch the popup without a separate
|
|
63
|
+
* /user-auth/start round-trip when the user opts to connect.
|
|
64
|
+
* Multiple concurrent 412s for the same connector are naturally
|
|
65
|
+
* deduped because we key on connectorId.
|
|
66
|
+
*/
|
|
67
|
+
userAuthRequired(state: import('immer').WritableDraft<IUserAuthSlice>, action: PayloadAction<AuthRequiredPayload>): void;
|
|
68
|
+
userAuthInProgress(state: import('immer').WritableDraft<IUserAuthSlice>, action: PayloadAction<InProgressPayload>): void;
|
|
69
|
+
userAuthCompleted(state: import('immer').WritableDraft<IUserAuthSlice>, action: PayloadAction<CompletedPayload>): void;
|
|
70
|
+
userAuthFailed(state: import('immer').WritableDraft<IUserAuthSlice>, action: PayloadAction<FailedPayload>): void;
|
|
71
|
+
userAuthReset(state: import('immer').WritableDraft<IUserAuthSlice>, action: PayloadAction<ResetPayload>): void;
|
|
72
|
+
}, "userAuth", "userAuth", import('@reduxjs/toolkit').SliceSelectors<IUserAuthSlice>>;
|
|
73
|
+
export declare const userAuthStatusReceived: import('@reduxjs/toolkit').ActionCreatorWithPayload<StatusReceivedPayload, "userAuth/userAuthStatusReceived">, userAuthRequired: import('@reduxjs/toolkit').ActionCreatorWithPayload<AuthRequiredPayload, "userAuth/userAuthRequired">, userAuthInProgress: import('@reduxjs/toolkit').ActionCreatorWithPayload<InProgressPayload, "userAuth/userAuthInProgress">, userAuthCompleted: import('@reduxjs/toolkit').ActionCreatorWithPayload<CompletedPayload, "userAuth/userAuthCompleted">, userAuthFailed: import('@reduxjs/toolkit').ActionCreatorWithPayload<FailedPayload, "userAuth/userAuthFailed">, userAuthReset: import('@reduxjs/toolkit').ActionCreatorWithPayload<ResetPayload, "userAuth/userAuthReset">;
|
|
74
|
+
declare const _default: import('redux').Reducer<IUserAuthSlice>;
|
|
75
|
+
export default _default;
|
|
76
|
+
export declare const selectUserAuthEntry: (state: RootState, connectorId: string) => IUserAuthEntry;
|
|
77
|
+
export declare const selectUserAuthState: (state: RootState, connectorId: string) => UserAuthState;
|
|
78
|
+
export declare const selectIsUserConnected: (state: RootState, connectorId: string) => boolean;
|
|
79
|
+
export declare const USER_AUTH_BLOCKING_STATES: ReadonlySet<UserAuthState>;
|
|
80
|
+
export declare const selectIsConnectorAuthBlocked: (state: RootState, connectorId: string) => boolean;
|
|
81
|
+
export declare const selectConnectUrl: (state: RootState, connectorId: string) => string | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Any connector currently in the in_progress state. The modal mounts
|
|
84
|
+
* once at the app level rather than per-card; this selector tells it
|
|
85
|
+
* whether to render.
|
|
86
|
+
*/
|
|
87
|
+
export declare const selectAnyInProgressConnectorId: (state: RootState) => string | undefined;
|
|
88
|
+
//# sourceMappingURL=userAuth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userAuth.d.ts","sourceRoot":"","sources":["../../../../src/features/connector-cards/store/userAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC;;;;;;;;;GASG;AAEH,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,cAAc,GACd,aAAa,GACb,WAAW,GACX,iBAAiB,GACjB,oBAAoB,CAAC;AAEzB,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE;QAAE,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc,CAAA;KAAE,CAAC;CAC1D;AAMD,UAAU,qBAAqB;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IAKxB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,UAAU,mBAAmB;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,iBAAiB;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,gBAAgB;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,aAAa;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAuBD,UAAU,YAAY;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,aAAa;IAItB;;;;;OAKG;yFACmC,aAAa,CAAC,qBAAqB,CAAC;IAwB1E;;;;;;OAMG;mFAC6B,aAAa,CAAC,mBAAmB,CAAC;qFAiBhC,aAAa,CAAC,iBAAiB,CAAC;oFAUjC,aAAa,CAAC,gBAAgB,CAAC;iFASlC,aAAa,CAAC,aAAa,CAAC;gFAW7B,aAAa,CAAC,YAAY,CAAC;qFAI1D,CAAC;AAEH,eAAO,MACL,sBAAsB,iHACtB,gBAAgB,yGAChB,kBAAkB,yGAClB,iBAAiB,uGACjB,cAAc,iGACd,aAAa,6FACU,CAAC;;AAE1B,wBAAqC;AAMrC,eAAO,MAAM,mBAAmB,UAAW,SAAS,eAAe,MAAM,KAAG,cACxB,CAAC;AAErD,eAAO,MAAM,mBAAmB,UAAW,SAAS,eAAe,MAAM,KAAG,aAC7B,CAAC;AAEhD,eAAO,MAAM,qBAAqB,UAAW,SAAS,eAAe,MAAM,KAAG,OACf,CAAC;AAMhE,eAAO,MAAM,yBAAyB,EAAE,WAAW,CAAC,aAAa,CAK/D,CAAC;AAEH,eAAO,MAAM,4BAA4B,UAAW,SAAS,eAAe,MAAM,KAAG,OACP,CAAC;AAE/E,eAAO,MAAM,gBAAgB,UAAW,SAAS,eAAe,MAAM,KAAG,MAAM,GAAG,SAC9B,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,UAAW,SAAS,KAAG,MAAM,GAAG,SAK1E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userAuth.test.d.ts","sourceRoot":"","sources":["../../../../src/features/connector-cards/store/userAuth.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wires the bifrost transport's 412 USER_AUTH_REQUIRED hook to the
|
|
3
|
+
* agent app's redux store. Bifrost is host-agnostic by design — it
|
|
4
|
+
* holds a callback reference rather than importing redux directly,
|
|
5
|
+
* so we attach the dispatcher here on the agent side.
|
|
6
|
+
*
|
|
7
|
+
* Idempotent: hosts that initialize the agent multiple times in
|
|
8
|
+
* one page session (rare but possible in single-page consumers)
|
|
9
|
+
* won't double-fire the dispatch because the callback assignment
|
|
10
|
+
* just overwrites the previous reference.
|
|
11
|
+
*/
|
|
12
|
+
export declare const registerUserAuthCallback: () => void;
|
|
13
|
+
//# sourceMappingURL=registerUserAuthCallback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registerUserAuthCallback.d.ts","sourceRoot":"","sources":["../../../../src/features/connector-cards/utils/registerUserAuthCallback.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,wBAAwB,QAAO,IAsB3C,CAAC"}
|
|
@@ -5,6 +5,15 @@ export declare const extractErrorParams: (cardErrorMessage: string) => {
|
|
|
5
5
|
error_message: string;
|
|
6
6
|
};
|
|
7
7
|
export declare const processCommonErrorMessage: (apiErrorCode: string, connectorNames?: string[]) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the copy shown for a card-level error. Normally this is the BE's
|
|
10
|
+
* message (sans the trailing `(Error code: XXX)`), but for a user-tier card
|
|
11
|
+
* whose workspace the agent's connected account can no longer access
|
|
12
|
+
* (`WORKSPACE_ACCESS_DENIED`) we swap in precise messaging — the raw BE copy
|
|
13
|
+
* otherwise reads like a generic connection/expiry error. Guarded on
|
|
14
|
+
* `isUserAuthEnabled` so it can never override a legacy connector's error.
|
|
15
|
+
*/
|
|
16
|
+
export declare const resolveCardLevelErrorMessage: (rawError: string, isUserAuthEnabled?: boolean) => string;
|
|
8
17
|
export declare const isCardEmpty: (card: ICard, specificCardData: SpecificCardData, specificConnectorApiStatus: SpecificConnectorApiStatus) => boolean;
|
|
9
18
|
export declare const isCardError: (card: ICard, specificCardData: SpecificCardData, specificConnectorApiStatus: SpecificConnectorApiStatus) => string | boolean | undefined;
|
|
10
19
|
export declare function getConnectorCardsMetrics(cards: ICard[], specificCardData: SpecificCardData, specificConnectorApiStatus: SpecificConnectorApiStatus): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/features/connector-cards/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/features/connector-cards/utils.ts"],"names":[],"mappings":"AAMA,OAAO,EAAY,mBAAmB,EAAE,KAAK,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAKnH,eAAO,MAAM,eAAe,SAAU,MAAM,GAAG,MAAM,GAAG,OAAO,WACG,CAAC;AAEnE,eAAO,MAAM,kBAAkB,qBAAsB,MAAM;;;CAQ1D,CAAC;AAEF,eAAO,MAAM,yBAAyB,iBAAkB,MAAM,mBAAmB,MAAM,EAAE,WAIxF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,aAAc,MAAM,sBAAsB,OAAO,KAAG,MAM5F,CAAC;AAEF,eAAO,MAAM,WAAW,SAChB,KAAK,oBACO,gBAAgB,8BACN,0BAA0B,YAgBvD,CAAC;AAEF,eAAO,MAAM,WAAW,SAChB,KAAK,oBACO,gBAAgB,8BACN,0BAA0B,iCAWvD,CAAC;AAEF,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,KAAK,EAAE,EACd,gBAAgB,EAAE,gBAAgB,EAClC,0BAA0B,EAAE,0BAA0B;;;;EAkDvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/write-form/components/write-form/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/write-form/components/write-form/index.tsx"],"names":[],"mappings":"AAgDA,OAAO,KAAK,EAA+B,UAAU,EAAE,MAAM,eAAe,CAAC;AAyB7E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,KAAK,EAA+B,UAAU,EAAc,MAAM,cAAc,CAAC;AAGxF,eAAO,MAAM,iBAAiB,wCAAwC,CAAC;AAEvE,UAAU,cAAc;IACtB,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAClC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC,CAAC;IACxE,cAAc,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/D,eAAe,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IAC3E,iBAAiB,CAAC,EAAE,CAAC,aAAa,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;CAC1D;AACD,QAAA,MAAM,SAAS,gJAWZ,cAAc,4CA0lBhB,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slice.d.ts","sourceRoot":"","sources":["../../../../src/features/write-form/store/slice.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"slice.d.ts","sourceRoot":"","sources":["../../../../src/features/write-form/store/slice.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAOrD,OAAO,KAAK,EAAsB,eAAe,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACzF,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,eAAO,MAAM,oBAAoB;;;;;;;;;;;mIAkH/B,CAAC;AAEH,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;cAGP,MAAM,EAAE;iBACL,MAAM;oBACH,MAAM;2BACC,OAAO;kBAChB,MAAM;;;;;;;;;;EAkHvB,CAAC;AAEF,QAAA,MAAM,UAAU;YAIF,MAAM;UACR;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAA;KAAE;oBACrB,MAAM;iBACT,MAAM;sBACD,MAAM,IAAI;sBACV,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI;;;;;;;;;;EAmB7C,CAAC;AAEF,QAAA,MAAM,UAAU;YAIF,MAAM;UACR;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAA;KAAE;oBACrB,MAAM;iBACT,MAAM;wBACC,MAAM;kBACZ;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAA;KAAE;sBAC3B,MAAM,IAAI;sBACV,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI;;;;;;;;;;EAyB7C,CAAC;AAEF,QAAA,MAAM,UAAU;QAQR,MAAM;kBACI,MAAM;wBACA,MAAM;oBACV,MAAM;;;;;;;;;;EAIzB,CAAC;AAEF,QAAA,MAAM,QAAQ;QAUJ,MAAM;wBACU,MAAM;kBACZ,MAAM;oBACJ,MAAM;YACd,MAAM;;;;;;;;;;EAanB,CAAC;AAEF,QAAA,MAAM,2BAA2B;;;;QAIvB,MAAM;iBACG,MAAM;oBACH,MAAM;wBACF,MAAM;kBACZ,MAAM;;;;;;;;;;EA8CzB,CAAC;AAEF,QAAA,MAAQ,UAAU,wFAAE,oBAAoB,oGAAE,2BAA2B,yGAAE,oBAAoB,kGAC7D,CAAC;;AAC/B,wBAA4C;AAC5C,OAAO,EACL,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,UAAU,EACV,QAAQ,EACR,UAAU,EACV,UAAU,EACV,2BAA2B,EAC3B,oBAAoB,EACpB,2BAA2B,EAC3B,oBAAoB,EACrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../../src/features/write-form/utils/response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAGlE,eAAO,MAAM,gBAAgB,UAAW,iBAAiB,cAAc,OAAO,CAAC,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../../src/features/write-form/utils/response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAGlE,eAAO,MAAM,gBAAgB,UAAW,iBAAiB,cAAc,OAAO,CAAC,UAAU,CAAC,eAuFzF,CAAC"}
|