@hiver/connector-agent 4.22.0-slackM2-beta.8 → 4.22.0-slackM2-beta.9
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/omni-slack/SharedOmniSlackQueryClientProvider.d.ts +6 -0
- package/app/omni-slack/SharedOmniSlackQueryClientProvider.d.ts.map +1 -0
- package/app/omni-slack/provider.d.ts +6 -0
- package/app/omni-slack/provider.d.ts.map +1 -1
- package/app/omni-slack/shared-query-client.d.ts +27 -0
- package/app/omni-slack/shared-query-client.d.ts.map +1 -0
- package/context/react-query-client-provider/create-client.d.ts +20 -0
- package/context/react-query-client-provider/create-client.d.ts.map +1 -0
- package/context/react-query-client-provider/index.d.ts.map +1 -1
- package/index.es.js +3378 -3378
- package/index.umd.js +388 -388
- package/package.json +1 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
/** See shared-query-client.ts for why this is a singleton, not per-mount. */
|
|
3
|
+
export declare const SharedOmniSlackQueryClientProvider: FC<{
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}>;
|
|
6
|
+
//# sourceMappingURL=SharedOmniSlackQueryClientProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SharedOmniSlackQueryClientProvider.d.ts","sourceRoot":"","sources":["../../../src/app/omni-slack/SharedOmniSlackQueryClientProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKtC,6EAA6E;AAC7E,eAAO,MAAM,kCAAkC,EAAE,EAAE,CAAC;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,CAE1E,CAAC"}
|
|
@@ -11,6 +11,12 @@ interface OmniSlackProviderProps extends SlackContextData {
|
|
|
11
11
|
* react-query + feature context, in that order. Slack feature reads
|
|
12
12
|
* `hiverConvId` + `connectorId` from SlackContextProvider via
|
|
13
13
|
* useSlackContext().
|
|
14
|
+
*
|
|
15
|
+
* Uses the SHARED singleton QueryClient (not a fresh one per mount) —
|
|
16
|
+
* OmniSlackTab and SlackLinkActionsIsland are separate mount points that
|
|
17
|
+
* must observe/invalidate the same `useLinks`/`useLinkedConversation`
|
|
18
|
+
* cache for a newly created link to show up without a full remount. See
|
|
19
|
+
* shared-query-client.ts.
|
|
14
20
|
*/
|
|
15
21
|
export declare const OmniSlackProvider: FC<OmniSlackProviderProps>;
|
|
16
22
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/app/omni-slack/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/app/omni-slack/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAGjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAKpE,UAAU,sBAAuB,SAAQ,gBAAgB;IACvD,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,oBAAoB,CAAC;CAC9B;AAqBD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAYxD,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ONE QueryClient shared by every Omni Slack mount point (OmniSlackTab,
|
|
3
|
+
* SlackLinkActionsIsland) for the lifetime of the page. Omni mounts these
|
|
4
|
+
* as SEPARATE React trees — the host's "+"/kebab chrome drives
|
|
5
|
+
* SlackLinkActionsIsland while the content area mounts a separate,
|
|
6
|
+
* persistent OmniSlackTab pinned to the selected link (M2-E2 host
|
|
7
|
+
* contract). A per-mount QueryClient (the OmniSlackProvider default) means
|
|
8
|
+
* a mutation's `invalidateQueries({ queryKey: linksQueryKey(...) })` inside
|
|
9
|
+
* the island — e.g. StartModal/LinkExistingModal on a successful
|
|
10
|
+
* start/link — only ever clears the island's OWN empty cache. The
|
|
11
|
+
* already-mounted OmniSlackTab keeps serving its stale pre-creation
|
|
12
|
+
* `useLinks` snapshot, so pinning it to the brand-new linkId falls into
|
|
13
|
+
* the "no longer linked" branch (SlackConversationTab's pinned-mount gate
|
|
14
|
+
* can't find the id in that stale list) until its own poll eventually
|
|
15
|
+
* catches up or the tab is unmounted/remounted.
|
|
16
|
+
*
|
|
17
|
+
* Module-level singleton (created once, not per-mount) so every Omni
|
|
18
|
+
* surface observes and invalidates the SAME cache — mirrors the `store`
|
|
19
|
+
* singleton these providers already share. Safe to share across
|
|
20
|
+
* conversations: every query key here is namespaced by hiverConvId.
|
|
21
|
+
*
|
|
22
|
+
* Exported (not just used internally) so test setup can `.clear()` it
|
|
23
|
+
* between tests — a module singleton otherwise leaks cached query data
|
|
24
|
+
* across `it()` blocks in the same test file.
|
|
25
|
+
*/
|
|
26
|
+
export declare const sharedOmniSlackQueryClient: import('@tanstack/query-core').QueryClient;
|
|
27
|
+
//# sourceMappingURL=shared-query-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-query-client.d.ts","sourceRoot":"","sources":["../../../src/app/omni-slack/shared-query-client.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,0BAA0B,4CAA+B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
2
|
+
/**
|
|
3
|
+
* Global re-auth trip-wire. When ANY Slack query or mutation fails because
|
|
4
|
+
* the agent's Slack user-token expired/was revoked (401 slack_invalid_auth,
|
|
5
|
+
* or 412 user_slack_auth_missing once the connector is already flagged),
|
|
6
|
+
* refetch /user-auth/status so SlackConversationTab swaps in the inline
|
|
7
|
+
* re-auth screen the moment the call fails — no page reload, and without
|
|
8
|
+
* every call site wiring its own error handler.
|
|
9
|
+
*
|
|
10
|
+
* Invalidating the ['userAuthStatus'] prefix refetches the active
|
|
11
|
+
* initial-status query (['userAuthStatus', <connectorId>, 'initial']),
|
|
12
|
+
* whose queryFn dispatches the fresh state (reauth_required) into redux.
|
|
13
|
+
* isSlackAuthError gates this, so non-Slack / non-auth errors are ignored.
|
|
14
|
+
*
|
|
15
|
+
* Exported so any surface that needs its OWN QueryClient (e.g. a shared
|
|
16
|
+
* singleton spanning several mount points) gets the same trip-wire instead
|
|
17
|
+
* of silently losing it.
|
|
18
|
+
*/
|
|
19
|
+
export declare const createConnectorQueryClient: () => QueryClient;
|
|
20
|
+
//# sourceMappingURL=create-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-client.d.ts","sourceRoot":"","sources":["../../../src/context/react-query-client-provider/create-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAI/E;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,0BAA0B,mBAWtC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/context/react-query-client-provider/index.tsx"],"names":[],"mappings":"AAKA,KAAK,uBAAuB,GAAG;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,QAAA,MAAM,wBAAwB,iBAAkB,uBAAuB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/context/react-query-client-provider/index.tsx"],"names":[],"mappings":"AAKA,KAAK,uBAAuB,GAAG;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,QAAA,MAAM,wBAAwB,iBAAkB,uBAAuB,4CAGtE,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|