@rise-x/apps-sdk 0.6.0 → 0.8.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.md +192 -10
- package/build/connectors/agents.js +1 -1
- package/build/connectors/assets.d.ts +9 -3
- package/build/connectors/assets.js +32 -1
- package/build/connectors/index.d.ts +3 -2
- package/build/connectors/index.js +4 -1
- package/build/connectors/search.d.ts +34 -0
- package/build/connectors/search.js +63 -0
- package/build/connectors/types.d.ts +51 -0
- package/build/connectors/types.js +71 -0
- package/build/connectors/work.d.ts +7 -1
- package/build/connectors/work.js +13 -0
- package/build/index.d.ts +1 -1
- package/build/mockShell.d.ts +11 -0
- package/build/mockShell.js +159 -2
- package/build/query/assets.d.ts +19 -6
- package/build/query/assets.js +35 -3
- package/build/query/context.d.ts +14 -0
- package/build/query/context.js +16 -0
- package/build/query/index.d.ts +4 -3
- package/build/query/index.js +14 -2
- package/build/query/keys.d.ts +4 -0
- package/build/query/keys.js +7 -0
- package/build/query/layer.d.ts +25 -3
- package/build/query/work.d.ts +14 -1
- package/build/query/work.js +32 -1
- package/build/shellBridge.d.ts +1 -1
- package/build/ui/components/accordion.d.ts +7 -0
- package/build/ui/components/aspect-ratio.d.ts +4 -0
- package/build/ui/components/button-group.d.ts +7 -0
- package/build/ui/components/carousel.d.ts +18 -0
- package/build/ui/components/chart.d.ts +45 -94
- package/build/ui/components/collapsible.d.ts +6 -0
- package/build/ui/components/combobox.d.ts +19 -0
- package/build/ui/components/command.d.ts +18 -0
- package/build/ui/components/context-menu.d.ts +29 -0
- package/build/ui/components/data-table.d.ts +13 -2
- package/build/ui/components/date-picker.d.ts +16 -0
- package/build/ui/components/direction.d.ts +6 -0
- package/build/ui/components/field.d.ts +25 -0
- package/build/ui/components/hover-card.d.ts +6 -0
- package/build/ui/components/input-group.d.ts +13 -0
- package/build/ui/components/input-otp.d.ts +34 -0
- package/build/ui/components/input.d.ts +1 -3
- package/build/ui/components/item.d.ts +23 -0
- package/build/ui/components/kbd.d.ts +4 -0
- package/build/ui/components/menubar.d.ts +26 -0
- package/build/ui/components/message-scroller.d.ts +15 -0
- package/build/ui/components/navigation-menu.d.ts +13 -0
- package/build/ui/components/page-header.d.ts +7 -1
- package/build/ui/components/table.d.ts +7 -1
- package/build/ui/index.d.ts +19 -0
- package/build/ui/reference/components/accordion.tsx +85 -0
- package/build/ui/reference/components/alert-dialog.tsx +7 -2
- package/build/ui/reference/components/aspect-ratio.tsx +28 -0
- package/build/ui/reference/components/button-group.tsx +77 -0
- package/build/ui/reference/components/button.tsx +8 -1
- package/build/ui/reference/components/carousel.tsx +248 -0
- package/build/ui/reference/components/chart.tsx +441 -1131
- package/build/ui/reference/components/collapsible.tsx +43 -0
- package/build/ui/reference/components/combobox.tsx +141 -0
- package/build/ui/reference/components/command.tsx +181 -0
- package/build/ui/reference/components/context-menu.tsx +243 -0
- package/build/ui/reference/components/data-table.tsx +199 -29
- package/build/ui/reference/components/date-picker.tsx +218 -0
- package/build/ui/reference/components/dialog.tsx +2 -2
- package/build/ui/reference/components/direction.tsx +22 -0
- package/build/ui/reference/components/dropdown-menu.tsx +2 -2
- package/build/ui/reference/components/field.tsx +252 -0
- package/build/ui/reference/components/hover-card.tsx +64 -0
- package/build/ui/reference/components/input-group.tsx +157 -0
- package/build/ui/reference/components/input-otp.tsx +106 -0
- package/build/ui/reference/components/input.tsx +4 -32
- package/build/ui/reference/components/item.tsx +188 -0
- package/build/ui/reference/components/kbd.tsx +43 -0
- package/build/ui/reference/components/label.tsx +1 -1
- package/build/ui/reference/components/menubar.tsx +275 -0
- package/build/ui/reference/components/message-scroller.tsx +141 -0
- package/build/ui/reference/components/nav.tsx +9 -0
- package/build/ui/reference/components/navigation-menu.tsx +191 -0
- package/build/ui/reference/components/page-header.tsx +32 -0
- package/build/ui/reference/components/popover.tsx +2 -2
- package/build/ui/reference/components/select.tsx +11 -8
- package/build/ui/reference/components/sheet.tsx +14 -3
- package/build/ui/reference/components/table.tsx +15 -2
- package/build/ui/reference/components/timeline.tsx +7 -0
- package/build/ui/reference/components/toggle.tsx +1 -1
- package/build/ui/reference/index.ts +19 -0
- package/build/ui/standalone.js +167 -28
- package/build/ui/styles.css +1 -1
- package/package.json +15 -9
- package/template/README.md +6 -0
- package/template/src/App.tsx +10 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ConnectorDeps } from "./deps";
|
|
2
|
-
import { type
|
|
2
|
+
import { type SearchArgs, type SearchFilter, type SearchPage } from "./search";
|
|
3
|
+
import { type WorkAuditEvent, type WorkDetail, type WorkRow, type WorkSummary } from "./types";
|
|
3
4
|
export interface StartWorkArgs {
|
|
4
5
|
flowId: string;
|
|
5
6
|
stepName?: string;
|
|
@@ -48,6 +49,10 @@ export interface WorkRowPage {
|
|
|
48
49
|
export interface IterateWorkRowsArgs extends Omit<ListWorkRowsArgs, "skip"> {
|
|
49
50
|
maxItems?: number;
|
|
50
51
|
}
|
|
52
|
+
export type SearchWorkArgs = SearchArgs & {
|
|
53
|
+
filter: SearchFilter;
|
|
54
|
+
};
|
|
55
|
+
export type WorkSearchPage = SearchPage<WorkSummary>;
|
|
51
56
|
export interface ListRelatedWorkArgs {
|
|
52
57
|
workId: string;
|
|
53
58
|
relationships: string[];
|
|
@@ -72,6 +77,7 @@ export interface WorkConnector {
|
|
|
72
77
|
signal?: AbortSignal;
|
|
73
78
|
}): Promise<void>;
|
|
74
79
|
list(args: ListWorkRowsArgs): Promise<WorkRowPage>;
|
|
80
|
+
search(args: SearchWorkArgs): Promise<WorkSearchPage>;
|
|
75
81
|
iterate(args: IterateWorkRowsArgs): AsyncIterable<WorkRow>;
|
|
76
82
|
listRelated(args: ListRelatedWorkArgs): Promise<WorkRow[]>;
|
|
77
83
|
getAudit(workId: string, opts?: {
|
package/build/connectors/work.js
CHANGED
|
@@ -5,6 +5,7 @@ exports.buildAdditionalProperties = buildAdditionalProperties;
|
|
|
5
5
|
exports.createWorkConnector = createWorkConnector;
|
|
6
6
|
const _internal_1 = require("../_internal");
|
|
7
7
|
const errors_1 = require("./errors");
|
|
8
|
+
const search_1 = require("./search");
|
|
8
9
|
const types_1 = require("./types");
|
|
9
10
|
// Wire codes of the platform's PatchOperation enum.
|
|
10
11
|
const PATCH_OPERATION_CODES = {
|
|
@@ -176,6 +177,17 @@ function createWorkConnector(deps = { shell: _internal_1.requireShell }) {
|
|
|
176
177
|
skip += newInPage;
|
|
177
178
|
}
|
|
178
179
|
};
|
|
180
|
+
const search = async (args) => {
|
|
181
|
+
try {
|
|
182
|
+
const page = args.page ?? 1;
|
|
183
|
+
const pageSize = args.pageSize ?? search_1.DEFAULT_SEARCH_PAGE_SIZE;
|
|
184
|
+
const { data } = await workApi().post("/api/v4/work/search", (0, search_1.buildSearchBody)(args, page, pageSize), { signal: args.signal });
|
|
185
|
+
return (0, search_1.toSearchPage)(data, types_1.mapWorkSummary, page, pageSize);
|
|
186
|
+
}
|
|
187
|
+
catch (e) {
|
|
188
|
+
throw (0, errors_1.toConnectorError)(e);
|
|
189
|
+
}
|
|
190
|
+
};
|
|
179
191
|
const listRelated = async (args) => {
|
|
180
192
|
try {
|
|
181
193
|
const { data } = await deps
|
|
@@ -215,6 +227,7 @@ function createWorkConnector(deps = { shell: _internal_1.requireShell }) {
|
|
|
215
227
|
submit,
|
|
216
228
|
delete: del,
|
|
217
229
|
list,
|
|
230
|
+
search,
|
|
218
231
|
iterate,
|
|
219
232
|
listRelated,
|
|
220
233
|
getAudit,
|
package/build/index.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ export * from "./shellBridge";
|
|
|
2
2
|
export * from "./lifecycle";
|
|
3
3
|
export { useShellUser, useShellEnvironment, useShellNavigate } from "./hooks";
|
|
4
4
|
export { getShell, getShellAi, getShellApi, getShellApiV4, getShellEnvironment, getShellUser, } from "./accessors";
|
|
5
|
-
export { createMockShell, type CreateMockShellOptions } from "./mockShell";
|
|
5
|
+
export { createMockShell, type CreateMockShellOptions, type MockShellFixtures, } from "./mockShell";
|
|
6
6
|
export { registerTopBarActions, type TopBarAction } from "./topBar";
|
package/build/mockShell.d.ts
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
import type { DianaShell, ShellAiApi, ShellEnvironment, ShellUser } from "./shellBridge";
|
|
2
|
+
export interface MockShellFixtures {
|
|
3
|
+
workRows?: Record<string, unknown[]>;
|
|
4
|
+
workSearch?: unknown[];
|
|
5
|
+
workDetail?: Record<string, unknown>;
|
|
6
|
+
workData?: Record<string, unknown>;
|
|
7
|
+
assetRows?: Record<string, unknown[]>;
|
|
8
|
+
assetSearch?: unknown[];
|
|
9
|
+
assetDetail?: Record<string, unknown>;
|
|
10
|
+
assetTypes?: unknown[];
|
|
11
|
+
}
|
|
2
12
|
export interface CreateMockShellOptions {
|
|
3
13
|
user?: ShellUser | null;
|
|
4
14
|
environment?: ShellEnvironment | null;
|
|
5
15
|
api?: DianaShell["getApi"];
|
|
6
16
|
apiV4?: DianaShell["getApiV4"];
|
|
17
|
+
fixtures?: MockShellFixtures;
|
|
7
18
|
ai?: ShellAiApi | null;
|
|
8
19
|
}
|
|
9
20
|
export declare function createMockShell(overrides?: CreateMockShellOptions): DianaShell;
|
package/build/mockShell.js
CHANGED
|
@@ -3,7 +3,144 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createMockShell = createMockShell;
|
|
4
4
|
exports.isMockShell = isMockShell;
|
|
5
5
|
const errors_1 = require("./connectors/errors");
|
|
6
|
+
const search_1 = require("./connectors/search");
|
|
6
7
|
const shellBridge_1 = require("./shellBridge");
|
|
8
|
+
// Both helpers return the error rather than throwing it, so every call site
|
|
9
|
+
// reads as an explicit `throw` instead of a function call that never returns.
|
|
10
|
+
const notSeeded = (route, key) => new errors_1.ConnectorError("SHELL_UNAVAILABLE", `[@rise-x/apps-sdk] no fixture for ${route} — seed \`fixtures.${key}\` in createMockShell`);
|
|
11
|
+
// Rows are stored per flow so one fixture set can serve several screens.
|
|
12
|
+
const rowsFor = (byFlow, flowOriginId) => byFlow?.[typeof flowOriginId === "string" ? flowOriginId : ""] ??
|
|
13
|
+
byFlow?.["*"];
|
|
14
|
+
const slice = (rows, body) => {
|
|
15
|
+
const { skip = 0, limit } = (body ?? {});
|
|
16
|
+
return typeof limit === "number"
|
|
17
|
+
? rows.slice(skip, skip + limit)
|
|
18
|
+
: rows.slice(skip);
|
|
19
|
+
};
|
|
20
|
+
// Both v4 search endpoints 400 on any search whose filter lacks a
|
|
21
|
+
// `flowOriginId` equals/in leaf reachable through `and` groups only — an
|
|
22
|
+
// or-nested pin doesn't narrow the search, and the server rejects it too
|
|
23
|
+
// (verified live). The mock has to match, or a search that fails in every
|
|
24
|
+
// host would look fine locally.
|
|
25
|
+
const hasFlowOriginIdPin = (filter) => {
|
|
26
|
+
if (!filter || typeof filter !== "object")
|
|
27
|
+
return false;
|
|
28
|
+
const node = filter;
|
|
29
|
+
if (Array.isArray(node.and))
|
|
30
|
+
return node.and.some(hasFlowOriginIdPin);
|
|
31
|
+
return (node.field === "flowOriginId" &&
|
|
32
|
+
(node.operator === "equals" || node.operator === "in"));
|
|
33
|
+
};
|
|
34
|
+
// The v4 search page envelope, paged with the request's page/pageSize. No
|
|
35
|
+
// filtering: fixtures answer the shape of a search, not its semantics.
|
|
36
|
+
const searchPage = (resource, rows, body) => {
|
|
37
|
+
const { page = 1, pageSize = search_1.DEFAULT_SEARCH_PAGE_SIZE, filter, } = (body ?? {});
|
|
38
|
+
if (!hasFlowOriginIdPin(filter)) {
|
|
39
|
+
throw new errors_1.ConnectorError("HTTP_ERROR", `Searching ${resource} requires a 'flowOriginId' filter ('equals' or 'in') to narrow the search to one or more flows.`, { status: 400 });
|
|
40
|
+
}
|
|
41
|
+
const start = (page - 1) * pageSize;
|
|
42
|
+
return {
|
|
43
|
+
items: rows.slice(start, start + pageSize),
|
|
44
|
+
page,
|
|
45
|
+
pageSize,
|
|
46
|
+
hasMore: start + pageSize < rows.length,
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
// Writes are deliberately unimplemented: a fixture that pretended to persist
|
|
50
|
+
// would make a standalone app look like it worked when it never wrote anything.
|
|
51
|
+
const notServed = (method, url) => new errors_1.ConnectorError("SHELL_UNAVAILABLE", `[@rise-x/apps-sdk] ${method.toUpperCase()} ${url} is not served by fixtures — run inside a host, or pass \`api\`/\`apiV4\` to createMockShell`);
|
|
52
|
+
const rejects = (method) => (url) => {
|
|
53
|
+
throw notServed(method, url);
|
|
54
|
+
};
|
|
55
|
+
function createFixtureClients(fixtures) {
|
|
56
|
+
const unwritable = {
|
|
57
|
+
patch: rejects("patch"),
|
|
58
|
+
put: rejects("put"),
|
|
59
|
+
delete: rejects("delete"),
|
|
60
|
+
};
|
|
61
|
+
// Seeded lookup: only an absent key is a miss, so a fixture deliberately set
|
|
62
|
+
// to null still serves.
|
|
63
|
+
const fromMap = (map, id, url, key) => {
|
|
64
|
+
const decoded = decodeURIComponent(id);
|
|
65
|
+
if (!map || !(decoded in map))
|
|
66
|
+
throw notSeeded(url, key);
|
|
67
|
+
return map[decoded];
|
|
68
|
+
};
|
|
69
|
+
const api = {
|
|
70
|
+
...unwritable,
|
|
71
|
+
get: async (url) => {
|
|
72
|
+
if (url === "/api/v3/asset/typesByEcosystem") {
|
|
73
|
+
if (!fixtures.assetTypes)
|
|
74
|
+
throw notSeeded(url, "assetTypes");
|
|
75
|
+
return { data: fixtures.assetTypes };
|
|
76
|
+
}
|
|
77
|
+
const asset = /^\/api\/v3\/asset\/([^/]+)$/.exec(url);
|
|
78
|
+
if (asset) {
|
|
79
|
+
return {
|
|
80
|
+
data: fromMap(fixtures.assetDetail, asset[1], url, "assetDetail"),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
throw notServed("get", url);
|
|
84
|
+
},
|
|
85
|
+
post: async (url, body) => {
|
|
86
|
+
if (url === "/api/v3/data-grid/work-rows") {
|
|
87
|
+
const { flowOriginIds } = (body ?? {});
|
|
88
|
+
const rows = rowsFor(fixtures.workRows, flowOriginIds?.[0]);
|
|
89
|
+
if (!rows)
|
|
90
|
+
throw notSeeded(url, "workRows");
|
|
91
|
+
return { data: slice(rows, body) };
|
|
92
|
+
}
|
|
93
|
+
if (url === "/api/v3/data-grid/asset-rows") {
|
|
94
|
+
const { flowOriginIds } = (body ?? {});
|
|
95
|
+
const rows = rowsFor(fixtures.assetRows, flowOriginIds?.[0]);
|
|
96
|
+
if (!rows)
|
|
97
|
+
throw notSeeded(url, "assetRows");
|
|
98
|
+
return { data: slice(rows, body) };
|
|
99
|
+
}
|
|
100
|
+
throw notServed("post", url);
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
const work = {
|
|
104
|
+
...unwritable,
|
|
105
|
+
get: async (url) => {
|
|
106
|
+
const data = /^\/api\/v4\/work\/([^/]+)\/data$/.exec(url);
|
|
107
|
+
if (data) {
|
|
108
|
+
return { data: fromMap(fixtures.workData, data[1], url, "workData") };
|
|
109
|
+
}
|
|
110
|
+
const detail = /^\/api\/v4\/work\/([^/]+)$/.exec(url);
|
|
111
|
+
if (detail) {
|
|
112
|
+
return {
|
|
113
|
+
data: fromMap(fixtures.workDetail, detail[1], url, "workDetail"),
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
throw notServed("get", url);
|
|
117
|
+
},
|
|
118
|
+
post: async (url, body) => {
|
|
119
|
+
if (url === "/api/v4/work/search") {
|
|
120
|
+
const rows = fixtures.workSearch;
|
|
121
|
+
if (!rows)
|
|
122
|
+
throw notSeeded(url, "workSearch");
|
|
123
|
+
return { data: searchPage("Work", rows, body) };
|
|
124
|
+
}
|
|
125
|
+
throw notServed("post", url);
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
// Asset search has its own v4 client — see assets.ts's searchApi.
|
|
129
|
+
const asset = {
|
|
130
|
+
...unwritable,
|
|
131
|
+
get: rejects("get"),
|
|
132
|
+
post: async (url, body) => {
|
|
133
|
+
if (url === "/api/v4/asset/search") {
|
|
134
|
+
const rows = fixtures.assetSearch;
|
|
135
|
+
if (!rows)
|
|
136
|
+
throw notSeeded(url, "assetSearch");
|
|
137
|
+
return { data: searchPage("Asset", rows, body) };
|
|
138
|
+
}
|
|
139
|
+
throw notServed("post", url);
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
return { api, work, asset };
|
|
143
|
+
}
|
|
7
144
|
// Mock shell for standalone dev bundles. getApi/getApiV4 throw unless handlers
|
|
8
145
|
// are passed via options — apps that need a backend either run inside the real
|
|
9
146
|
// shell or supply their own instances. Navigate falls back to window.location.
|
|
@@ -32,14 +169,34 @@ function createMockShell(overrides = {}) {
|
|
|
32
169
|
const t = to;
|
|
33
170
|
window.location.assign(`${t?.pathname ?? ""}${t?.search ?? ""}${t?.hash ?? ""}`);
|
|
34
171
|
});
|
|
172
|
+
// Only the v4 'work' and 'asset' clients are fixture-backed; the other keys
|
|
173
|
+
// keep throwing, since nothing in the fixtures set answers for them.
|
|
174
|
+
const fixtureClients = overrides.fixtures
|
|
175
|
+
? createFixtureClients(overrides.fixtures)
|
|
176
|
+
: null;
|
|
177
|
+
const fixtureApiV4 = fixtureClients
|
|
178
|
+
? ((name) => {
|
|
179
|
+
if (name === "work")
|
|
180
|
+
return fixtureClients.work;
|
|
181
|
+
if (name === "asset")
|
|
182
|
+
return fixtureClients.asset;
|
|
183
|
+
throw new errors_1.ConnectorError("SHELL_UNAVAILABLE", `[@rise-x/apps-sdk] the '${name}' v4 client is not fixture-backed — ` +
|
|
184
|
+
`run inside a host, or pass \`apiV4\` to createMockShell`);
|
|
185
|
+
})
|
|
186
|
+
: null;
|
|
35
187
|
const shell = {
|
|
36
188
|
version: shellBridge_1.SHELL_BRIDGE_VERSION,
|
|
37
189
|
getUser: () => user,
|
|
38
190
|
getEnvironment: () => environment,
|
|
39
191
|
subscribeUser: () => () => { },
|
|
40
192
|
subscribeEnvironment: () => () => { },
|
|
41
|
-
getApi: overrides.api ??
|
|
42
|
-
|
|
193
|
+
getApi: overrides.api ??
|
|
194
|
+
(fixtureClients
|
|
195
|
+
? (() => fixtureClients.api)
|
|
196
|
+
: notAvailable("getApi")),
|
|
197
|
+
getApiV4: overrides.apiV4 ??
|
|
198
|
+
fixtureApiV4 ??
|
|
199
|
+
notAvailable("getApiV4"),
|
|
43
200
|
getAi: () => ai,
|
|
44
201
|
navigate,
|
|
45
202
|
};
|
package/build/query/assets.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { type InfiniteData, type UseInfiniteQueryResult, type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
-
import { type AssetRowPage, type AssetsConnector, type CreateAssetArgs, type ListAssetRowsArgs, type ListRelatedAssetsArgs, type SearchAssetsArgs, type StartEditAssetArgs } from "../connectors/assets";
|
|
2
|
+
import { type AssetRowPage, type AssetSearchPage, type AssetsConnector, type CreateAssetArgs, type ListAssetRowsArgs, type ListRelatedAssetsArgs, type QuickSearchAssetsArgs, type SearchAssetsArgs, type StartEditAssetArgs } from "../connectors/assets";
|
|
3
3
|
import type { ConnectorError } from "../connectors/errors";
|
|
4
4
|
import type { AssetDetail, AssetSummary, AssetType, WorkDetail } from "../connectors/types";
|
|
5
5
|
import { type QueryEnvId } from "./keys";
|
|
6
6
|
import { type SdkMutationOptions, type SdkQueryOptions } from "./shared";
|
|
7
|
-
export type SearchAssetsQueryArgs = Omit<SearchAssetsArgs, "signal">;
|
|
7
|
+
export type SearchAssetsQueryArgs = Omit<SearchAssetsArgs, "page" | "signal">;
|
|
8
|
+
export type QuickSearchAssetsQueryArgs = Omit<QuickSearchAssetsArgs, "signal">;
|
|
8
9
|
export type ListAssetRowsQueryArgs = Omit<ListAssetRowsArgs, "skip" | "signal">;
|
|
9
10
|
export type ListRelatedAssetsQueryArgs = Omit<ListRelatedAssetsArgs, "signal">;
|
|
10
11
|
export declare function createAssetQueries(connector: AssetsConnector, getEnvId: () => QueryEnvId): {
|
|
@@ -18,14 +19,25 @@ export declare function createAssetQueries(connector: AssetsConnector, getEnvId:
|
|
|
18
19
|
} & {
|
|
19
20
|
queryKey: import("@tanstack/react-query").DataTag<readonly ["rise-apps-sdk", QueryEnvId, "assets", "detail", string], AssetDetail>;
|
|
20
21
|
};
|
|
21
|
-
search: (args: SearchAssetsQueryArgs) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").
|
|
22
|
+
search: (args: SearchAssetsQueryArgs) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseInfiniteQueryOptions<AssetSearchPage, Error, InfiniteData<AssetSearchPage, unknown>, AssetSearchPage, readonly ["rise-apps-sdk", QueryEnvId, "assets", "search", {
|
|
23
|
+
[x: string]: unknown;
|
|
24
|
+
}], number>, "queryFn"> & {
|
|
25
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<AssetSearchPage, readonly ["rise-apps-sdk", QueryEnvId, "assets", "search", {
|
|
26
|
+
[x: string]: unknown;
|
|
27
|
+
}], number> | undefined;
|
|
28
|
+
} & {
|
|
29
|
+
queryKey: import("@tanstack/react-query").DataTag<readonly ["rise-apps-sdk", QueryEnvId, "assets", "search", {
|
|
30
|
+
[x: string]: unknown;
|
|
31
|
+
}], InfiniteData<AssetSearchPage, unknown>>;
|
|
32
|
+
};
|
|
33
|
+
quickSearch: (args: QuickSearchAssetsQueryArgs) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<AssetSummary[], Error, AssetSummary[], readonly ["rise-apps-sdk", QueryEnvId, "assets", "quickSearch", {
|
|
22
34
|
[x: string]: unknown;
|
|
23
35
|
}]>, "queryFn"> & {
|
|
24
|
-
queryFn?: import("@tanstack/react-query").QueryFunction<AssetSummary[], readonly ["rise-apps-sdk", QueryEnvId, "assets", "
|
|
36
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<AssetSummary[], readonly ["rise-apps-sdk", QueryEnvId, "assets", "quickSearch", {
|
|
25
37
|
[x: string]: unknown;
|
|
26
38
|
}], never> | undefined;
|
|
27
39
|
} & {
|
|
28
|
-
queryKey: import("@tanstack/react-query").DataTag<readonly ["rise-apps-sdk", QueryEnvId, "assets", "
|
|
40
|
+
queryKey: import("@tanstack/react-query").DataTag<readonly ["rise-apps-sdk", QueryEnvId, "assets", "quickSearch", {
|
|
29
41
|
[x: string]: unknown;
|
|
30
42
|
}], AssetSummary[]>;
|
|
31
43
|
};
|
|
@@ -56,7 +68,8 @@ export type AssetQueries = ReturnType<typeof createAssetQueries>;
|
|
|
56
68
|
export declare const assetQueries: AssetQueries;
|
|
57
69
|
export declare function useAssetTypes(options?: SdkQueryOptions): UseQueryResult<AssetType[], ConnectorError>;
|
|
58
70
|
export declare function useAsset(assetId: string, options?: SdkQueryOptions): UseQueryResult<AssetDetail, ConnectorError>;
|
|
59
|
-
export declare function useAssetSearch(args: SearchAssetsQueryArgs, options?: SdkQueryOptions):
|
|
71
|
+
export declare function useAssetSearch(args: SearchAssetsQueryArgs, options?: SdkQueryOptions): UseInfiniteQueryResult<InfiniteData<AssetSearchPage>, ConnectorError>;
|
|
72
|
+
export declare function useAssetQuickSearch(args: QuickSearchAssetsQueryArgs, options?: SdkQueryOptions): UseQueryResult<AssetSummary[], ConnectorError>;
|
|
60
73
|
export declare function useAssetRows(args: ListAssetRowsQueryArgs, options?: SdkQueryOptions): UseInfiniteQueryResult<InfiniteData<AssetRowPage>, ConnectorError>;
|
|
61
74
|
export declare function useRelatedAssets(args: ListRelatedAssetsQueryArgs, options?: SdkQueryOptions): UseQueryResult<AssetSummary[], ConnectorError>;
|
|
62
75
|
export type CreateAssetVariables = Omit<CreateAssetArgs, "signal">;
|
package/build/query/assets.js
CHANGED
|
@@ -5,6 +5,7 @@ exports.createAssetQueries = createAssetQueries;
|
|
|
5
5
|
exports.useAssetTypes = useAssetTypes;
|
|
6
6
|
exports.useAsset = useAsset;
|
|
7
7
|
exports.useAssetSearch = useAssetSearch;
|
|
8
|
+
exports.useAssetQuickSearch = useAssetQuickSearch;
|
|
8
9
|
exports.useAssetRows = useAssetRows;
|
|
9
10
|
exports.useRelatedAssets = useRelatedAssets;
|
|
10
11
|
exports.useCreateAsset = useCreateAsset;
|
|
@@ -21,6 +22,7 @@ exports.useDeleteAsset = useDeleteAsset;
|
|
|
21
22
|
// here and useSubmitWork (query/work.ts) invalidates the assets scope.
|
|
22
23
|
const react_query_1 = require("@tanstack/react-query");
|
|
23
24
|
const assets_1 = require("../connectors/assets");
|
|
25
|
+
const search_1 = require("../connectors/search");
|
|
24
26
|
const keys_1 = require("./keys");
|
|
25
27
|
const shared_1 = require("./shared");
|
|
26
28
|
// Key-side view of an AssetTypeRef. Never throws (unlike the connector's
|
|
@@ -51,11 +53,24 @@ function createAssetQueries(connector, getEnvId) {
|
|
|
51
53
|
enabled: envId != null && !!assetId,
|
|
52
54
|
});
|
|
53
55
|
},
|
|
56
|
+
// Infinite page-based search over the v4 index. Unlike rows() the server
|
|
57
|
+
// reports hasMore exactly, so the advance rule is just "next page while
|
|
58
|
+
// hasMore". `args.filter` must pin flowOriginId — see SearchAssetsArgs.
|
|
54
59
|
search: (args) => {
|
|
60
|
+
const envId = getEnvId();
|
|
61
|
+
return (0, react_query_1.infiniteQueryOptions)({
|
|
62
|
+
queryKey: keys_1.queryKeys.assets.search(envId, (0, search_1.searchCacheShape)(args)),
|
|
63
|
+
queryFn: ({ pageParam, signal }) => connector.search({ ...args, page: pageParam, signal }),
|
|
64
|
+
initialPageParam: 1,
|
|
65
|
+
getNextPageParam: (last) => last.hasMore ? last.page + 1 : undefined,
|
|
66
|
+
enabled: envId != null && args.filter != null,
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
quickSearch: (args) => {
|
|
55
70
|
const envId = getEnvId();
|
|
56
71
|
return (0, react_query_1.queryOptions)({
|
|
57
|
-
queryKey: keys_1.queryKeys.assets.
|
|
58
|
-
queryFn: ({ signal }) => connector.
|
|
72
|
+
queryKey: keys_1.queryKeys.assets.quickSearch(envId, (0, keys_1.normalizeArgs)(args)),
|
|
73
|
+
queryFn: ({ signal }) => connector.quickSearch({ ...args, signal }),
|
|
59
74
|
enabled: envId != null && (args.type != null || args.typeOriginId != null),
|
|
60
75
|
});
|
|
61
76
|
},
|
|
@@ -91,8 +106,13 @@ function useAssetTypes(options) {
|
|
|
91
106
|
function useAsset(assetId, options) {
|
|
92
107
|
return (0, shared_1.useSdkQuery)(exports.assetQueries.detail(assetId), options);
|
|
93
108
|
}
|
|
109
|
+
// Infinite page-based search; flatten pages with dedupeRows(data).
|
|
94
110
|
function useAssetSearch(args, options) {
|
|
95
|
-
return (0, shared_1.
|
|
111
|
+
return (0, shared_1.useSdkInfiniteQuery)(exports.assetQueries.search(args), options);
|
|
112
|
+
}
|
|
113
|
+
// v3 free-text search within one asset type — see assets.quickSearch.
|
|
114
|
+
function useAssetQuickSearch(args, options) {
|
|
115
|
+
return (0, shared_1.useSdkQuery)(exports.assetQueries.quickSearch(args), options);
|
|
96
116
|
}
|
|
97
117
|
// Infinite skip-paged listing; flatten pages with dedupeRows(data).
|
|
98
118
|
function useAssetRows(args, options) {
|
|
@@ -111,6 +131,9 @@ function useCreateAsset(options) {
|
|
|
111
131
|
void client.invalidateQueries({
|
|
112
132
|
queryKey: keys_1.queryKeys.work.allRows(envId),
|
|
113
133
|
});
|
|
134
|
+
void client.invalidateQueries({
|
|
135
|
+
queryKey: keys_1.queryKeys.work.searchAll(envId),
|
|
136
|
+
});
|
|
114
137
|
}, options);
|
|
115
138
|
}
|
|
116
139
|
function useStartEditAsset(options) {
|
|
@@ -120,6 +143,9 @@ function useStartEditAsset(options) {
|
|
|
120
143
|
void client.invalidateQueries({
|
|
121
144
|
queryKey: keys_1.queryKeys.work.allRows(envId),
|
|
122
145
|
});
|
|
146
|
+
void client.invalidateQueries({
|
|
147
|
+
queryKey: keys_1.queryKeys.work.searchAll(envId),
|
|
148
|
+
});
|
|
123
149
|
}, options);
|
|
124
150
|
}
|
|
125
151
|
function useCloneAsset(options) {
|
|
@@ -131,6 +157,9 @@ function useCloneAsset(options) {
|
|
|
131
157
|
void client.invalidateQueries({
|
|
132
158
|
queryKey: keys_1.queryKeys.assets.searchAll(envId),
|
|
133
159
|
});
|
|
160
|
+
void client.invalidateQueries({
|
|
161
|
+
queryKey: keys_1.queryKeys.assets.quickSearchAll(envId),
|
|
162
|
+
});
|
|
134
163
|
}, options);
|
|
135
164
|
}
|
|
136
165
|
function useDeleteAsset(options) {
|
|
@@ -145,6 +174,9 @@ function useDeleteAsset(options) {
|
|
|
145
174
|
void client.invalidateQueries({
|
|
146
175
|
queryKey: keys_1.queryKeys.assets.searchAll(envId),
|
|
147
176
|
});
|
|
177
|
+
void client.invalidateQueries({
|
|
178
|
+
queryKey: keys_1.queryKeys.assets.quickSearchAll(envId),
|
|
179
|
+
});
|
|
148
180
|
void client.invalidateQueries({
|
|
149
181
|
queryKey: keys_1.queryKeys.assets.relatedAll(envId),
|
|
150
182
|
});
|
package/build/query/context.d.ts
CHANGED
|
@@ -1,2 +1,16 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
1
2
|
import { type QueryClient } from "@tanstack/react-query";
|
|
2
3
|
export declare function useAppQueryClient(): QueryClient;
|
|
4
|
+
/**
|
|
5
|
+
* Publishes the resolved client into React context so plain react-query APIs
|
|
6
|
+
* work — `useQuery(flowQueries.list(args))`, `useQueryClient()`, devtools.
|
|
7
|
+
* The SDK's own hooks never need it: they pass the client explicitly.
|
|
8
|
+
*
|
|
9
|
+
* Safe in both worlds, and that is the point: inside a host it re-publishes
|
|
10
|
+
* the very client the shell already mounted, so nothing is shadowed and the
|
|
11
|
+
* cache stays shell-managed; standalone it publishes the per-bundle fallback.
|
|
12
|
+
* Mounting a client of your own is what breaks the shell's caching.
|
|
13
|
+
*/
|
|
14
|
+
export declare function AppQueryProvider({ children }: {
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|
package/build/query/context.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useAppQueryClient = useAppQueryClient;
|
|
4
|
+
exports.AppQueryProvider = AppQueryProvider;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
6
|
const react_1 = require("react");
|
|
5
7
|
const react_query_1 = require("@tanstack/react-query");
|
|
6
8
|
const accessors_1 = require("../accessors");
|
|
@@ -32,3 +34,17 @@ function useAppQueryClient() {
|
|
|
32
34
|
}
|
|
33
35
|
return (0, client_1.getFallbackAppClient)();
|
|
34
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Publishes the resolved client into React context so plain react-query APIs
|
|
39
|
+
* work — `useQuery(flowQueries.list(args))`, `useQueryClient()`, devtools.
|
|
40
|
+
* The SDK's own hooks never need it: they pass the client explicitly.
|
|
41
|
+
*
|
|
42
|
+
* Safe in both worlds, and that is the point: inside a host it re-publishes
|
|
43
|
+
* the very client the shell already mounted, so nothing is shadowed and the
|
|
44
|
+
* cache stays shell-managed; standalone it publishes the per-bundle fallback.
|
|
45
|
+
* Mounting a client of your own is what breaks the shell's caching.
|
|
46
|
+
*/
|
|
47
|
+
function AppQueryProvider({ children }) {
|
|
48
|
+
const client = useAppQueryClient();
|
|
49
|
+
return (0, jsx_runtime_1.jsx)(react_query_1.QueryClientProvider, { client: client, children: children });
|
|
50
|
+
}
|
package/build/query/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export { normalizeArgs, queryKeys, QUERY_KEY_ROOT, type QueryEnvId, } from "./keys";
|
|
2
|
+
export { searchCacheShape } from "../connectors/search";
|
|
2
3
|
export { createAppQueryClient, getFallbackAppClient, shouldRetryConnectorError, type AppQueryClientDefaults, } from "./client";
|
|
3
|
-
export { useAppQueryClient } from "./context";
|
|
4
|
+
export { AppQueryProvider, useAppQueryClient } from "./context";
|
|
4
5
|
export { getLiveEnvId, invalidateAppSdkQueries, type SdkMutationOptions, type SdkQueryOptions, } from "./shared";
|
|
5
6
|
export { createQueryLayer, type QueryLayer } from "./layer";
|
|
6
7
|
export { createFlowQueries, flowQueries, useFlow, useFlowConfig, useFlowLayout, useFlows, useFlowTask, type FindTaskQueryArgs, type FlowQueries, type ListFlowsQueryArgs, } from "./flows";
|
|
7
|
-
export { createWorkQueries, dedupeRows, useDeleteWork, usePatchWorkData, useRelatedWork, useStartWork, useSubmitWork, useWork, useWorkAudit, useWorkData, useWorkRows, workQueries, type DeleteWorkVariables, type ListRelatedWorkQueryArgs, type ListWorkRowsQueryArgs, type PatchWorkDataVariables, type StartWorkVariables, type SubmitWorkVariables, type WorkQueries, } from "./work";
|
|
8
|
-
export { assetQueries, createAssetQueries, useAsset, useAssetRows, useAssetSearch, useAssetTypes, useCloneAsset, useCreateAsset, useDeleteAsset, useRelatedAssets, useStartEditAsset, type AssetQueries, type CloneAssetVariables, type CreateAssetVariables, type DeleteAssetVariables, type ListAssetRowsQueryArgs, type ListRelatedAssetsQueryArgs, type SearchAssetsQueryArgs, type StartEditAssetVariables, } from "./assets";
|
|
8
|
+
export { createWorkQueries, dedupeRows, useDeleteWork, usePatchWorkData, useRelatedWork, useStartWork, useSubmitWork, useWork, useWorkAudit, useWorkData, useWorkRows, useWorkSearch, workQueries, type DeleteWorkVariables, type ListRelatedWorkQueryArgs, type ListWorkRowsQueryArgs, type PatchWorkDataVariables, type SearchWorkQueryArgs, type StartWorkVariables, type SubmitWorkVariables, type WorkQueries, } from "./work";
|
|
9
|
+
export { assetQueries, createAssetQueries, useAsset, useAssetQuickSearch, useAssetRows, useAssetSearch, useAssetTypes, useCloneAsset, useCreateAsset, useDeleteAsset, useRelatedAssets, useStartEditAsset, type AssetQueries, type CloneAssetVariables, type CreateAssetVariables, type DeleteAssetVariables, type ListAssetRowsQueryArgs, type ListRelatedAssetsQueryArgs, type QuickSearchAssetsQueryArgs, type SearchAssetsQueryArgs, type StartEditAssetVariables, } from "./assets";
|
|
9
10
|
export { agentQueries, createAgentQueries, useAgent, useAgentChat, useAgentChatMessages, useAgentChats, useAgents, useCreateAgent, useDeleteAgent, useDeleteAgentChat, useRenameAgentChat, useUpdateAgent, type AgentQueries, type DeleteAgentChatVariables, type DeleteAgentVariables, type GetChatMessagesQueryArgs, type ListAgentsQueryArgs, type ListChatsQueryArgs, type RenameAgentChatVariables, type UpdateAgentVariables, } from "./agents";
|
|
10
11
|
export { ConnectorError, type ConnectorErrorCode } from "../connectors/errors";
|
package/build/query/index.js
CHANGED
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
// Requires the app to share '@tanstack/react-query' (singleton) in its
|
|
10
10
|
// webpack ModuleFederation config for the shell-managed client to reach it.
|
|
11
11
|
//
|
|
12
|
+
// Plain react-query APIs (useQuery on a factory, useQueryClient, devtools)
|
|
13
|
+
// read the client from context instead, which standalone dev has no provider
|
|
14
|
+
// for — wrap the app in <AppQueryProvider> to publish the resolved client.
|
|
15
|
+
//
|
|
12
16
|
// Layout: one file per domain (flows/work/assets/agents), each holding its
|
|
13
17
|
// queryOptions factory, live singleton, read hooks, and mutations — including
|
|
14
18
|
// the invalidation those mutations perform. Cross-domain invalidations are
|
|
@@ -17,17 +21,23 @@
|
|
|
17
21
|
// Deliberately NOT re-exported from the package root: apps that don't import
|
|
18
22
|
// this subpath never load react-query.
|
|
19
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.
|
|
21
|
-
exports.ConnectorError = exports.useUpdateAgent = exports.useRenameAgentChat = void 0;
|
|
24
|
+
exports.useAgentChats = exports.useAgentChatMessages = exports.useAgentChat = exports.useAgent = exports.createAgentQueries = exports.agentQueries = exports.useStartEditAsset = exports.useRelatedAssets = exports.useDeleteAsset = exports.useCreateAsset = exports.useCloneAsset = exports.useAssetTypes = exports.useAssetSearch = exports.useAssetRows = exports.useAssetQuickSearch = exports.useAsset = exports.createAssetQueries = exports.assetQueries = exports.workQueries = exports.useWorkSearch = exports.useWorkRows = exports.useWorkData = exports.useWorkAudit = exports.useWork = exports.useSubmitWork = exports.useStartWork = exports.useRelatedWork = exports.usePatchWorkData = exports.useDeleteWork = exports.dedupeRows = exports.createWorkQueries = exports.useFlowTask = exports.useFlows = exports.useFlowLayout = exports.useFlowConfig = exports.useFlow = exports.flowQueries = exports.createFlowQueries = exports.createQueryLayer = exports.invalidateAppSdkQueries = exports.getLiveEnvId = exports.useAppQueryClient = exports.AppQueryProvider = exports.shouldRetryConnectorError = exports.getFallbackAppClient = exports.createAppQueryClient = exports.searchCacheShape = exports.QUERY_KEY_ROOT = exports.queryKeys = exports.normalizeArgs = void 0;
|
|
25
|
+
exports.ConnectorError = exports.useUpdateAgent = exports.useRenameAgentChat = exports.useDeleteAgentChat = exports.useDeleteAgent = exports.useCreateAgent = exports.useAgents = void 0;
|
|
22
26
|
var keys_1 = require("./keys");
|
|
23
27
|
Object.defineProperty(exports, "normalizeArgs", { enumerable: true, get: function () { return keys_1.normalizeArgs; } });
|
|
24
28
|
Object.defineProperty(exports, "queryKeys", { enumerable: true, get: function () { return keys_1.queryKeys; } });
|
|
25
29
|
Object.defineProperty(exports, "QUERY_KEY_ROOT", { enumerable: true, get: function () { return keys_1.QUERY_KEY_ROOT; } });
|
|
30
|
+
// Re-exported here, not just from /connectors: hand-building a search key needs
|
|
31
|
+
// it, and that is a query-layer job — `normalizeArgs` alone would miss the entry
|
|
32
|
+
// the hook created whenever an arg carries one of buildSearchBody's defaults.
|
|
33
|
+
var search_1 = require("../connectors/search");
|
|
34
|
+
Object.defineProperty(exports, "searchCacheShape", { enumerable: true, get: function () { return search_1.searchCacheShape; } });
|
|
26
35
|
var client_1 = require("./client");
|
|
27
36
|
Object.defineProperty(exports, "createAppQueryClient", { enumerable: true, get: function () { return client_1.createAppQueryClient; } });
|
|
28
37
|
Object.defineProperty(exports, "getFallbackAppClient", { enumerable: true, get: function () { return client_1.getFallbackAppClient; } });
|
|
29
38
|
Object.defineProperty(exports, "shouldRetryConnectorError", { enumerable: true, get: function () { return client_1.shouldRetryConnectorError; } });
|
|
30
39
|
var context_1 = require("./context");
|
|
40
|
+
Object.defineProperty(exports, "AppQueryProvider", { enumerable: true, get: function () { return context_1.AppQueryProvider; } });
|
|
31
41
|
Object.defineProperty(exports, "useAppQueryClient", { enumerable: true, get: function () { return context_1.useAppQueryClient; } });
|
|
32
42
|
var shared_1 = require("./shared");
|
|
33
43
|
Object.defineProperty(exports, "getLiveEnvId", { enumerable: true, get: function () { return shared_1.getLiveEnvId; } });
|
|
@@ -54,11 +64,13 @@ Object.defineProperty(exports, "useWork", { enumerable: true, get: function () {
|
|
|
54
64
|
Object.defineProperty(exports, "useWorkAudit", { enumerable: true, get: function () { return work_1.useWorkAudit; } });
|
|
55
65
|
Object.defineProperty(exports, "useWorkData", { enumerable: true, get: function () { return work_1.useWorkData; } });
|
|
56
66
|
Object.defineProperty(exports, "useWorkRows", { enumerable: true, get: function () { return work_1.useWorkRows; } });
|
|
67
|
+
Object.defineProperty(exports, "useWorkSearch", { enumerable: true, get: function () { return work_1.useWorkSearch; } });
|
|
57
68
|
Object.defineProperty(exports, "workQueries", { enumerable: true, get: function () { return work_1.workQueries; } });
|
|
58
69
|
var assets_1 = require("./assets");
|
|
59
70
|
Object.defineProperty(exports, "assetQueries", { enumerable: true, get: function () { return assets_1.assetQueries; } });
|
|
60
71
|
Object.defineProperty(exports, "createAssetQueries", { enumerable: true, get: function () { return assets_1.createAssetQueries; } });
|
|
61
72
|
Object.defineProperty(exports, "useAsset", { enumerable: true, get: function () { return assets_1.useAsset; } });
|
|
73
|
+
Object.defineProperty(exports, "useAssetQuickSearch", { enumerable: true, get: function () { return assets_1.useAssetQuickSearch; } });
|
|
62
74
|
Object.defineProperty(exports, "useAssetRows", { enumerable: true, get: function () { return assets_1.useAssetRows; } });
|
|
63
75
|
Object.defineProperty(exports, "useAssetSearch", { enumerable: true, get: function () { return assets_1.useAssetSearch; } });
|
|
64
76
|
Object.defineProperty(exports, "useAssetTypes", { enumerable: true, get: function () { return assets_1.useAssetTypes; } });
|
package/build/query/keys.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ export declare const queryKeys: {
|
|
|
21
21
|
readonly data: (envId: QueryEnvId, workId: string, path?: string) => readonly ["rise-apps-sdk", QueryEnvId, "work", "data", string, string | null];
|
|
22
22
|
readonly allRows: (envId: QueryEnvId) => readonly ["rise-apps-sdk", QueryEnvId, "work", "rows"];
|
|
23
23
|
readonly rows: (envId: QueryEnvId, args: Args) => readonly ["rise-apps-sdk", QueryEnvId, "work", "rows", Args];
|
|
24
|
+
readonly searchAll: (envId: QueryEnvId) => readonly ["rise-apps-sdk", QueryEnvId, "work", "search"];
|
|
25
|
+
readonly search: (envId: QueryEnvId, args: Args) => readonly ["rise-apps-sdk", QueryEnvId, "work", "search", Args];
|
|
24
26
|
readonly relatedAll: (envId: QueryEnvId) => readonly ["rise-apps-sdk", QueryEnvId, "work", "related"];
|
|
25
27
|
readonly related: (envId: QueryEnvId, args: Args) => readonly ["rise-apps-sdk", QueryEnvId, "work", "related", Args];
|
|
26
28
|
readonly audit: (envId: QueryEnvId, workId: string) => readonly ["rise-apps-sdk", QueryEnvId, "work", "audit", string];
|
|
@@ -31,6 +33,8 @@ export declare const queryKeys: {
|
|
|
31
33
|
readonly detail: (envId: QueryEnvId, assetId: string) => readonly ["rise-apps-sdk", QueryEnvId, "assets", "detail", string];
|
|
32
34
|
readonly searchAll: (envId: QueryEnvId) => readonly ["rise-apps-sdk", QueryEnvId, "assets", "search"];
|
|
33
35
|
readonly search: (envId: QueryEnvId, args: Args) => readonly ["rise-apps-sdk", QueryEnvId, "assets", "search", Args];
|
|
36
|
+
readonly quickSearchAll: (envId: QueryEnvId) => readonly ["rise-apps-sdk", QueryEnvId, "assets", "quickSearch"];
|
|
37
|
+
readonly quickSearch: (envId: QueryEnvId, args: Args) => readonly ["rise-apps-sdk", QueryEnvId, "assets", "quickSearch", Args];
|
|
34
38
|
readonly allRows: (envId: QueryEnvId) => readonly ["rise-apps-sdk", QueryEnvId, "assets", "rows"];
|
|
35
39
|
readonly rows: (envId: QueryEnvId, args: Args) => readonly ["rise-apps-sdk", QueryEnvId, "assets", "rows", Args];
|
|
36
40
|
readonly relatedAll: (envId: QueryEnvId) => readonly ["rise-apps-sdk", QueryEnvId, "assets", "related"];
|
package/build/query/keys.js
CHANGED
|
@@ -50,6 +50,9 @@ exports.queryKeys = {
|
|
|
50
50
|
// Prefix over every rows() listing — invalidation target.
|
|
51
51
|
allRows: (envId) => [ROOT, envId, "work", "rows"],
|
|
52
52
|
rows: (envId, args) => [ROOT, envId, "work", "rows", args],
|
|
53
|
+
// Prefix over every search() listing — invalidation target.
|
|
54
|
+
searchAll: (envId) => [ROOT, envId, "work", "search"],
|
|
55
|
+
search: (envId, args) => [ROOT, envId, "work", "search", args],
|
|
53
56
|
relatedAll: (envId) => [ROOT, envId, "work", "related"],
|
|
54
57
|
related: (envId, args) => [ROOT, envId, "work", "related", args],
|
|
55
58
|
audit: (envId, workId) => [ROOT, envId, "work", "audit", workId],
|
|
@@ -58,8 +61,12 @@ exports.queryKeys = {
|
|
|
58
61
|
all: (envId) => [ROOT, envId, "assets"],
|
|
59
62
|
types: (envId) => [ROOT, envId, "assets", "types"],
|
|
60
63
|
detail: (envId, assetId) => [ROOT, envId, "assets", "detail", assetId],
|
|
64
|
+
// Prefix over every v4 search() listing — invalidation target.
|
|
61
65
|
searchAll: (envId) => [ROOT, envId, "assets", "search"],
|
|
62
66
|
search: (envId, args) => [ROOT, envId, "assets", "search", args],
|
|
67
|
+
// Prefix over every v3 quickSearch() listing — invalidation target.
|
|
68
|
+
quickSearchAll: (envId) => [ROOT, envId, "assets", "quickSearch"],
|
|
69
|
+
quickSearch: (envId, args) => [ROOT, envId, "assets", "quickSearch", args],
|
|
63
70
|
allRows: (envId) => [ROOT, envId, "assets", "rows"],
|
|
64
71
|
rows: (envId, args) => [ROOT, envId, "assets", "rows", args],
|
|
65
72
|
relatedAll: (envId) => [ROOT, envId, "assets", "related"],
|
package/build/query/layer.d.ts
CHANGED
|
@@ -64,6 +64,17 @@ export declare function createQueryLayer(deps?: ConnectorDeps): {
|
|
|
64
64
|
[x: string]: unknown;
|
|
65
65
|
}], import("@tanstack/query-core").InfiniteData<import("../connectors/work").WorkRowPage, unknown>>;
|
|
66
66
|
};
|
|
67
|
+
search: (args: import("./work").SearchWorkQueryArgs) => import("@tanstack/query-core").OmitKeyof<import("@tanstack/react-query").UseInfiniteQueryOptions<import("../connectors/work").WorkSearchPage, Error, import("@tanstack/query-core").InfiniteData<import("../connectors/work").WorkSearchPage, unknown>, import("../connectors/work").WorkSearchPage, readonly ["rise-apps-sdk", QueryEnvId, "work", "search", {
|
|
68
|
+
[x: string]: unknown;
|
|
69
|
+
}], number>, "queryFn"> & {
|
|
70
|
+
queryFn?: import("@tanstack/query-core").QueryFunction<import("../connectors/work").WorkSearchPage, readonly ["rise-apps-sdk", QueryEnvId, "work", "search", {
|
|
71
|
+
[x: string]: unknown;
|
|
72
|
+
}], number> | undefined;
|
|
73
|
+
} & {
|
|
74
|
+
queryKey: import("@tanstack/query-core").DataTag<readonly ["rise-apps-sdk", QueryEnvId, "work", "search", {
|
|
75
|
+
[x: string]: unknown;
|
|
76
|
+
}], import("@tanstack/query-core").InfiniteData<import("../connectors/work").WorkSearchPage, unknown>>;
|
|
77
|
+
};
|
|
67
78
|
related: (args: import("./work").ListRelatedWorkQueryArgs) => import("@tanstack/query-core").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("../connectors").WorkRow[], Error, import("../connectors").WorkRow[], readonly ["rise-apps-sdk", QueryEnvId, "work", "related", {
|
|
68
79
|
[x: string]: unknown;
|
|
69
80
|
}]>, "queryFn"> & {
|
|
@@ -92,14 +103,25 @@ export declare function createQueryLayer(deps?: ConnectorDeps): {
|
|
|
92
103
|
} & {
|
|
93
104
|
queryKey: import("@tanstack/query-core").DataTag<readonly ["rise-apps-sdk", QueryEnvId, "assets", "detail", string], import("../connectors").AssetDetail>;
|
|
94
105
|
};
|
|
95
|
-
search: (args: import("./assets").SearchAssetsQueryArgs) => import("@tanstack/query-core").OmitKeyof<import("@tanstack/react-query").
|
|
106
|
+
search: (args: import("./assets").SearchAssetsQueryArgs) => import("@tanstack/query-core").OmitKeyof<import("@tanstack/react-query").UseInfiniteQueryOptions<import("../connectors/assets").AssetSearchPage, Error, import("@tanstack/query-core").InfiniteData<import("../connectors/assets").AssetSearchPage, unknown>, import("../connectors/assets").AssetSearchPage, readonly ["rise-apps-sdk", QueryEnvId, "assets", "search", {
|
|
107
|
+
[x: string]: unknown;
|
|
108
|
+
}], number>, "queryFn"> & {
|
|
109
|
+
queryFn?: import("@tanstack/query-core").QueryFunction<import("../connectors/assets").AssetSearchPage, readonly ["rise-apps-sdk", QueryEnvId, "assets", "search", {
|
|
110
|
+
[x: string]: unknown;
|
|
111
|
+
}], number> | undefined;
|
|
112
|
+
} & {
|
|
113
|
+
queryKey: import("@tanstack/query-core").DataTag<readonly ["rise-apps-sdk", QueryEnvId, "assets", "search", {
|
|
114
|
+
[x: string]: unknown;
|
|
115
|
+
}], import("@tanstack/query-core").InfiniteData<import("../connectors/assets").AssetSearchPage, unknown>>;
|
|
116
|
+
};
|
|
117
|
+
quickSearch: (args: import("./assets").QuickSearchAssetsQueryArgs) => import("@tanstack/query-core").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("../connectors").AssetSummary[], Error, import("../connectors").AssetSummary[], readonly ["rise-apps-sdk", QueryEnvId, "assets", "quickSearch", {
|
|
96
118
|
[x: string]: unknown;
|
|
97
119
|
}]>, "queryFn"> & {
|
|
98
|
-
queryFn?: import("@tanstack/query-core").QueryFunction<import("../connectors").AssetSummary[], readonly ["rise-apps-sdk", QueryEnvId, "assets", "
|
|
120
|
+
queryFn?: import("@tanstack/query-core").QueryFunction<import("../connectors").AssetSummary[], readonly ["rise-apps-sdk", QueryEnvId, "assets", "quickSearch", {
|
|
99
121
|
[x: string]: unknown;
|
|
100
122
|
}], never> | undefined;
|
|
101
123
|
} & {
|
|
102
|
-
queryKey: import("@tanstack/query-core").DataTag<readonly ["rise-apps-sdk", QueryEnvId, "assets", "
|
|
124
|
+
queryKey: import("@tanstack/query-core").DataTag<readonly ["rise-apps-sdk", QueryEnvId, "assets", "quickSearch", {
|
|
103
125
|
[x: string]: unknown;
|
|
104
126
|
}], import("../connectors").AssetSummary[]>;
|
|
105
127
|
};
|