@hiver/connector-agent 4.14.0-userauthv4-beta.0 → 4.14.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/features/connector-cards/components/card-list/ListCards.d.ts.map +1 -1
- package/features/connector-cards/components/card-list/card-content-value.d.ts +2 -2
- package/features/connector-cards/components/card-list/card-content-value.d.ts.map +1 -1
- package/features/connector-cards/components/card-list/list-item-modal.d.ts.map +1 -1
- package/features/connector-cards/components/card-list/style.d.ts +2 -0
- package/features/connector-cards/components/card-list/style.d.ts.map +1 -1
- package/features/connector-cards/constants/api.d.ts +0 -2
- package/features/connector-cards/constants/api.d.ts.map +1 -1
- package/features/connector-cards/utils.d.ts +1 -0
- package/features/connector-cards/utils.d.ts.map +1 -1
- package/features/write-form/components/map-form-defaults/index.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/types/form.d.ts +1 -0
- package/features/write-form/types/form.d.ts.map +1 -1
- package/features/write-form/utils/response.d.ts.map +1 -1
- package/index.es.js +7639 -7973
- package/index.umd.js +423 -464
- package/package.json +1 -1
- package/store/hooks.d.ts +0 -2
- package/store/hooks.d.ts.map +1 -1
- package/store/index.d.ts +0 -6
- package/store/index.d.ts.map +1 -1
- package/store/slice.d.ts +4 -4
- package/store/slice.d.ts.map +1 -1
- package/testing/mocks/handlers/fetch-cards.d.ts +2 -2
- package/testing/mocks/handlers/fetch-cards.d.ts.map +1 -1
- 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 +6 -6
- package/types/cards.d.ts.map +1 -1
- package/types/form.d.ts +2 -3
- package/types/form.d.ts.map +1 -1
- package/utils/form.d.ts +3 -3
- package/utils/form.d.ts.map +1 -1
- package/features/connector-cards/api/userAuth.d.ts +0 -25
- package/features/connector-cards/api/userAuth.d.ts.map +0 -1
- package/features/connector-cards/components/card-list/CardWithUserAuth.d.ts +0 -33
- package/features/connector-cards/components/card-list/CardWithUserAuth.d.ts.map +0 -1
- package/features/connector-cards/components/card-list/NoCardsUserAuthGate.d.ts +0 -24
- package/features/connector-cards/components/card-list/NoCardsUserAuthGate.d.ts.map +0 -1
- package/features/connector-cards/components/connection-in-progress-modal/index.d.ts +0 -19
- package/features/connector-cards/components/connection-in-progress-modal/index.d.ts.map +0 -1
- package/features/connector-cards/components/user-auth-card/__tests__/UserAuthCard.test.d.ts +0 -2
- package/features/connector-cards/components/user-auth-card/__tests__/UserAuthCard.test.d.ts.map +0 -1
- package/features/connector-cards/components/user-auth-card/index.d.ts +0 -33
- package/features/connector-cards/components/user-auth-card/index.d.ts.map +0 -1
- package/features/connector-cards/components/user-auth-card/style.d.ts +0 -29
- package/features/connector-cards/components/user-auth-card/style.d.ts.map +0 -1
- package/features/connector-cards/hooks/useUserAuthFlow.d.ts +0 -42
- package/features/connector-cards/hooks/useUserAuthFlow.d.ts.map +0 -1
- package/features/connector-cards/store/userAuth.d.ts +0 -85
- package/features/connector-cards/store/userAuth.d.ts.map +0 -1
- package/features/connector-cards/store/userAuth.test.d.ts +0 -2
- package/features/connector-cards/store/userAuth.test.d.ts.map +0 -1
- package/features/connector-cards/utils/registerUserAuthCallback.d.ts +0 -13
- package/features/connector-cards/utils/registerUserAuthCallback.d.ts.map +0 -1
- package/testing/mocks/handlers/user-auth.d.ts +0 -31
- package/testing/mocks/handlers/user-auth.d.ts.map +0 -1
|
@@ -1,85 +0,0 @@
|
|
|
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 UserAuthEntry {
|
|
15
|
-
state: UserAuthState;
|
|
16
|
-
reason?: string;
|
|
17
|
-
externalUserId?: string;
|
|
18
|
-
connectUrl?: string;
|
|
19
|
-
lastChecked?: number;
|
|
20
|
-
}
|
|
21
|
-
export interface UserAuthSlice {
|
|
22
|
-
byConnectorId: {
|
|
23
|
-
[connectorId: string]: UserAuthEntry;
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
interface StatusReceivedPayload {
|
|
27
|
-
connectorId: string;
|
|
28
|
-
state: UserAuthState;
|
|
29
|
-
reason?: string;
|
|
30
|
-
externalUserId?: string;
|
|
31
|
-
}
|
|
32
|
-
interface AuthRequiredPayload {
|
|
33
|
-
connectorId: string;
|
|
34
|
-
connectUrl: string;
|
|
35
|
-
reason?: string;
|
|
36
|
-
}
|
|
37
|
-
interface InProgressPayload {
|
|
38
|
-
connectorId: string;
|
|
39
|
-
}
|
|
40
|
-
interface CompletedPayload {
|
|
41
|
-
connectorId: string;
|
|
42
|
-
externalUserId?: string;
|
|
43
|
-
}
|
|
44
|
-
interface FailedPayload {
|
|
45
|
-
connectorId: string;
|
|
46
|
-
reason: string;
|
|
47
|
-
}
|
|
48
|
-
interface ResetPayload {
|
|
49
|
-
connectorId: string;
|
|
50
|
-
}
|
|
51
|
-
export declare const userAuthSlice: import('@reduxjs/toolkit').Slice<UserAuthSlice, {
|
|
52
|
-
/**
|
|
53
|
-
* Result of GET /user-auth/status — full picture from the server.
|
|
54
|
-
* Replaces any local in-progress state too: if a poll comes back
|
|
55
|
-
* with `connected` while we thought we were `in_progress`, we
|
|
56
|
-
* adopt the server's view.
|
|
57
|
-
*/
|
|
58
|
-
userAuthStatusReceived(state: import('immer').WritableDraft<UserAuthSlice>, action: PayloadAction<StatusReceivedPayload>): void;
|
|
59
|
-
/**
|
|
60
|
-
* Fired from the bifrost 412 interceptor. Carries the connect URL
|
|
61
|
-
* so the UI can launch the popup without a separate
|
|
62
|
-
* /user-auth/start round-trip when the user opts to connect.
|
|
63
|
-
* Multiple concurrent 412s for the same connector are naturally
|
|
64
|
-
* deduped because we key on connectorId.
|
|
65
|
-
*/
|
|
66
|
-
userAuthRequired(state: import('immer').WritableDraft<UserAuthSlice>, action: PayloadAction<AuthRequiredPayload>): void;
|
|
67
|
-
userAuthInProgress(state: import('immer').WritableDraft<UserAuthSlice>, action: PayloadAction<InProgressPayload>): void;
|
|
68
|
-
userAuthCompleted(state: import('immer').WritableDraft<UserAuthSlice>, action: PayloadAction<CompletedPayload>): void;
|
|
69
|
-
userAuthFailed(state: import('immer').WritableDraft<UserAuthSlice>, action: PayloadAction<FailedPayload>): void;
|
|
70
|
-
userAuthReset(state: import('immer').WritableDraft<UserAuthSlice>, action: PayloadAction<ResetPayload>): void;
|
|
71
|
-
}, "userAuth", "userAuth", import('@reduxjs/toolkit').SliceSelectors<UserAuthSlice>>;
|
|
72
|
-
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">;
|
|
73
|
-
declare const _default: import('redux').Reducer<UserAuthSlice>;
|
|
74
|
-
export default _default;
|
|
75
|
-
export declare const selectUserAuthEntry: (state: RootState, connectorId: string) => UserAuthEntry;
|
|
76
|
-
export declare const selectUserAuthState: (state: RootState, connectorId: string) => UserAuthState;
|
|
77
|
-
export declare const selectIsUserConnected: (state: RootState, connectorId: string) => boolean;
|
|
78
|
-
export declare const selectConnectUrl: (state: RootState, connectorId: string) => string | undefined;
|
|
79
|
-
/**
|
|
80
|
-
* Any connector currently in the in_progress state. The modal mounts
|
|
81
|
-
* once at the app level rather than per-card; this selector tells it
|
|
82
|
-
* whether to render.
|
|
83
|
-
*/
|
|
84
|
-
export declare const selectAnyInProgressConnectorId: (state: RootState) => string | undefined;
|
|
85
|
-
//# sourceMappingURL=userAuth.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,aAAa;IAC5B,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,aAAa;IAC5B,aAAa,EAAE;QAAE,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,CAAA;KAAE,CAAC;CACzD;AAMD,UAAU,qBAAqB;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,a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UAAW,SAAS,KAAG,MAAM,GAAG,SAK1E,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"userAuth.test.d.ts","sourceRoot":"","sources":["../../../../src/features/connector-cards/store/userAuth.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,13 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MSW handlers for the user-tier auth lifecycle endpoints (see
|
|
3
|
-
* custom-integrations qa-user-auth-framework).
|
|
4
|
-
*
|
|
5
|
-
* The mock cycles per-connector through a deterministic state for
|
|
6
|
-
* dev exploration:
|
|
7
|
-
* - First read for any unknown connectorId returns `disconnected`.
|
|
8
|
-
* - After POST /user-auth/start completes, subsequent reads return
|
|
9
|
-
* `in_progress` for the first 4 seconds (so the in-progress
|
|
10
|
-
* modal is visible without needing a real OAuth round-trip),
|
|
11
|
-
* then flip to `connected`.
|
|
12
|
-
*
|
|
13
|
-
* Override the default for specific connectorIds via the
|
|
14
|
-
* VITE_USER_AUTH_MOCK_STATE env var (JSON map). Useful for
|
|
15
|
-
* Storybook / Chromatic snapshots of the four states.
|
|
16
|
-
*/
|
|
17
|
-
interface MockEntry {
|
|
18
|
-
state: 'disconnected' | 'in_progress' | 'connected' | 'reauth_required' | 'workspace_mismatch';
|
|
19
|
-
reason?: string;
|
|
20
|
-
externalUserId?: string;
|
|
21
|
-
inProgressUntil?: number;
|
|
22
|
-
}
|
|
23
|
-
export declare const handlers: import('msw').HttpHandler[];
|
|
24
|
-
/**
|
|
25
|
-
* Test helpers — reset state between test cases so each test starts
|
|
26
|
-
* from a clean slate.
|
|
27
|
-
*/
|
|
28
|
-
export declare const __resetUserAuthMockState: () => void;
|
|
29
|
-
export declare const __setUserAuthMockEntry: (connectorId: string, entry: MockEntry) => void;
|
|
30
|
-
export {};
|
|
31
|
-
//# sourceMappingURL=user-auth.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user-auth.d.ts","sourceRoot":"","sources":["../../../../src/testing/mocks/handlers/user-auth.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;GAeG;AAEH,UAAU,SAAS;IACjB,KAAK,EAAE,cAAc,GAAG,aAAa,GAAG,WAAW,GAAG,iBAAiB,GAAG,oBAAoB,CAAC;IAC/F,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AA0FD,eAAO,MAAM,QAAQ,6BAAqE,CAAC;AAE3F;;;GAGG;AACH,eAAO,MAAM,wBAAwB,YAEpC,CAAC;AAEF,eAAO,MAAM,sBAAsB,gBAAiB,MAAM,SAAS,SAAS,SAE3E,CAAC"}
|