@sixb/client 0.2.5 → 0.2.6
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/dist/agent-streams.d.ts +11 -2
- package/dist/agent-streams.d.ts.map +1 -1
- package/dist/artifact-live.js +1 -1
- package/dist/browser.js +1 -1
- package/dist/{chunk-ktqfenfd.js → chunk-3dxa8d3r.js} +46 -6
- package/dist/chunk-3dxa8d3r.js.map +10 -0
- package/dist/{chunk-zta9jf24.js → chunk-4t68c4gf.js} +10 -3
- package/dist/{chunk-zta9jf24.js.map → chunk-4t68c4gf.js.map} +3 -3
- package/dist/{chunk-tm588tr7.js → chunk-6caavk8p.js} +1 -1
- package/dist/{chunk-pn4b10k4.js → chunk-pzz6gtn5.js} +2 -2
- package/dist/{chunk-60fdvjxa.js → chunk-vydypkf1.js} +39 -2
- package/dist/chunk-vydypkf1.js.map +10 -0
- package/dist/connectors/connection.d.ts +12 -0
- package/dist/connectors/connection.d.ts.map +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.d.ts.map +1 -1
- package/dist/connectors/queries.d.ts.map +1 -1
- package/dist/generated/@tanstack/react-query.gen.d.ts +940 -113
- package/dist/generated/@tanstack/react-query.gen.d.ts.map +1 -1
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/sdk.gen.d.ts +27 -3
- package/dist/generated/sdk.gen.d.ts.map +1 -1
- package/dist/generated/types.gen.d.ts +884 -12
- package/dist/generated/types.gen.d.ts.map +1 -1
- package/dist/hooks.js +87 -5
- package/dist/hooks.js.map +4 -4
- package/dist/index.js +13 -5
- package/dist/index.js.map +1 -1
- package/dist/logs.js +3 -3
- package/dist/models.js +10 -2
- package/dist/models.js.map +1 -1
- package/dist/query.js +2 -2
- package/dist/users-hooks.d.ts.map +1 -1
- package/dist/ws-socket.d.ts +2 -0
- package/dist/ws-socket.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/agent-streams.ts +22 -0
- package/src/connectors/connection.ts +59 -0
- package/src/connectors/index.ts +1 -0
- package/src/generated/@tanstack/react-query.gen.ts +131 -2
- package/src/generated/index.ts +20 -0
- package/src/generated/sdk.gen.ts +93 -2
- package/src/generated/types.gen.ts +1341 -15
- package/src/ws-socket.ts +62 -7
- package/dist/chunk-60fdvjxa.js.map +0 -10
- package/dist/chunk-ktqfenfd.js.map +0 -10
- /package/dist/{chunk-tm588tr7.js.map → chunk-6caavk8p.js.map} +0 -0
- /package/dist/{chunk-pn4b10k4.js.map → chunk-pzz6gtn5.js.map} +0 -0
package/dist/hooks.js
CHANGED
|
@@ -32,15 +32,15 @@ import {
|
|
|
32
32
|
ActionRunFailedError2,
|
|
33
33
|
isFailedActionRun,
|
|
34
34
|
uploadFile2
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-4t68c4gf.js";
|
|
36
36
|
import {
|
|
37
37
|
isSixbApiError2
|
|
38
38
|
} from "./chunk-br10prhs.js";
|
|
39
39
|
import {
|
|
40
40
|
objectQueryReadsAny,
|
|
41
41
|
createHttpQueryExecutor2
|
|
42
|
-
} from "./chunk-
|
|
43
|
-
import"./chunk-
|
|
42
|
+
} from "./chunk-6caavk8p.js";
|
|
43
|
+
import"./chunk-3dxa8d3r.js";
|
|
44
44
|
import"./chunk-0ka9ykez.js";
|
|
45
45
|
import {
|
|
46
46
|
createDeviceAuthorization2,
|
|
@@ -109,6 +109,8 @@ import {
|
|
|
109
109
|
getLakeHealth2,
|
|
110
110
|
listSyncs2,
|
|
111
111
|
getSync2,
|
|
112
|
+
listConnectorAccounts2,
|
|
113
|
+
listConnectorConnectionSyncRuns2,
|
|
112
114
|
listSyncRuns2,
|
|
113
115
|
requestSyncRun2,
|
|
114
116
|
listPipelines2,
|
|
@@ -179,12 +181,14 @@ import {
|
|
|
179
181
|
listAgentThreadInbox2,
|
|
180
182
|
withdrawAgentThreadInboxItem2,
|
|
181
183
|
updateAgentThreadInboxItem2,
|
|
184
|
+
editAgentThreadMessage2,
|
|
182
185
|
cancelAgentRun2,
|
|
183
186
|
retryAgentRun2,
|
|
184
187
|
getAgentThreadContext2,
|
|
185
188
|
listAgentThreadRuns2,
|
|
186
189
|
getAgentRun2,
|
|
187
190
|
cancelAgentRunById2,
|
|
191
|
+
markAgentThreadRead2,
|
|
188
192
|
listAgentThreadChildren2,
|
|
189
193
|
getAgentChildFileContent2,
|
|
190
194
|
listAgentComputers2,
|
|
@@ -257,7 +261,7 @@ import {
|
|
|
257
261
|
listProjectionRuns2,
|
|
258
262
|
getProjectionRun2,
|
|
259
263
|
listWebhookRuns2
|
|
260
|
-
} from "./chunk-
|
|
264
|
+
} from "./chunk-vydypkf1.js";
|
|
261
265
|
|
|
262
266
|
// src/hooks.ts
|
|
263
267
|
import { infiniteQueryOptions as infiniteQueryOptions3, queryOptions as queryOptions5 } from "@tanstack/react-query";
|
|
@@ -1286,6 +1290,32 @@ var getSyncOptions = (options) => queryOptions({
|
|
|
1286
1290
|
},
|
|
1287
1291
|
queryKey: getSyncQueryKey(options)
|
|
1288
1292
|
});
|
|
1293
|
+
var listConnectorAccountsQueryKey = (options) => createQueryKey("listConnectorAccounts", options);
|
|
1294
|
+
var listConnectorAccountsOptions = (options) => queryOptions({
|
|
1295
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1296
|
+
const { data } = await listConnectorAccounts2({
|
|
1297
|
+
...options,
|
|
1298
|
+
...queryKey[0],
|
|
1299
|
+
signal,
|
|
1300
|
+
throwOnError: true
|
|
1301
|
+
});
|
|
1302
|
+
return data;
|
|
1303
|
+
},
|
|
1304
|
+
queryKey: listConnectorAccountsQueryKey(options)
|
|
1305
|
+
});
|
|
1306
|
+
var listConnectorConnectionSyncRunsQueryKey = (options) => createQueryKey("listConnectorConnectionSyncRuns", options);
|
|
1307
|
+
var listConnectorConnectionSyncRunsOptions = (options) => queryOptions({
|
|
1308
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1309
|
+
const { data } = await listConnectorConnectionSyncRuns2({
|
|
1310
|
+
...options,
|
|
1311
|
+
...queryKey[0],
|
|
1312
|
+
signal,
|
|
1313
|
+
throwOnError: true
|
|
1314
|
+
});
|
|
1315
|
+
return data;
|
|
1316
|
+
},
|
|
1317
|
+
queryKey: listConnectorConnectionSyncRunsQueryKey(options)
|
|
1318
|
+
});
|
|
1289
1319
|
var listSyncRunsQueryKey = (options) => createQueryKey("listSyncRuns", options);
|
|
1290
1320
|
var listSyncRunsOptions = (options) => queryOptions({
|
|
1291
1321
|
queryFn: async ({ queryKey, signal }) => {
|
|
@@ -2341,6 +2371,19 @@ var updateAgentThreadInboxItemMutation = (options) => {
|
|
|
2341
2371
|
};
|
|
2342
2372
|
return mutationOptions;
|
|
2343
2373
|
};
|
|
2374
|
+
var editAgentThreadMessageMutation = (options) => {
|
|
2375
|
+
const mutationOptions = {
|
|
2376
|
+
mutationFn: async (fnOptions) => {
|
|
2377
|
+
const { data } = await editAgentThreadMessage2({
|
|
2378
|
+
...options,
|
|
2379
|
+
...fnOptions,
|
|
2380
|
+
throwOnError: true
|
|
2381
|
+
});
|
|
2382
|
+
return data;
|
|
2383
|
+
}
|
|
2384
|
+
};
|
|
2385
|
+
return mutationOptions;
|
|
2386
|
+
};
|
|
2344
2387
|
var cancelAgentRunMutation = (options) => {
|
|
2345
2388
|
const mutationOptions = {
|
|
2346
2389
|
mutationFn: async (fnOptions) => {
|
|
@@ -2438,6 +2481,19 @@ var cancelAgentRunByIdMutation = (options) => {
|
|
|
2438
2481
|
};
|
|
2439
2482
|
return mutationOptions;
|
|
2440
2483
|
};
|
|
2484
|
+
var markAgentThreadReadMutation = (options) => {
|
|
2485
|
+
const mutationOptions = {
|
|
2486
|
+
mutationFn: async (fnOptions) => {
|
|
2487
|
+
const { data } = await markAgentThreadRead2({
|
|
2488
|
+
...options,
|
|
2489
|
+
...fnOptions,
|
|
2490
|
+
throwOnError: true
|
|
2491
|
+
});
|
|
2492
|
+
return data;
|
|
2493
|
+
}
|
|
2494
|
+
};
|
|
2495
|
+
return mutationOptions;
|
|
2496
|
+
};
|
|
2441
2497
|
var listAgentThreadChildrenQueryKey = (options) => createQueryKey("listAgentThreadChildren", options);
|
|
2442
2498
|
var listAgentThreadChildrenOptions = (options) => queryOptions({
|
|
2443
2499
|
queryFn: async ({ queryKey, signal }) => {
|
|
@@ -3874,6 +3930,7 @@ function optionalNonblank(value, field) {
|
|
|
3874
3930
|
var CONNECTOR_CALLBACK_CONNECTOR_PARAM = "connectionConnectorId";
|
|
3875
3931
|
var CONNECTOR_CALLBACK_RUN_PARAM = "connectionRunId";
|
|
3876
3932
|
var RUN_POLL_INTERVAL_MS = 1000;
|
|
3933
|
+
var SYNC_POLL_INTERVAL_MS = 5000;
|
|
3877
3934
|
function useConnectorConnection({
|
|
3878
3935
|
connectorId,
|
|
3879
3936
|
owner = "project",
|
|
@@ -3911,6 +3968,14 @@ function useConnectorConnection({
|
|
|
3911
3968
|
refetchInterval: (query) => isRunInProgress(query.state.data) ? RUN_POLL_INTERVAL_MS : false
|
|
3912
3969
|
});
|
|
3913
3970
|
const resumedRun = runQuery.data && fillsSlot(runQuery.data) ? runQuery.data : undefined;
|
|
3971
|
+
const syncRunsQuery = useQuery2({
|
|
3972
|
+
...listConnectorConnectionSyncRunsOptions({
|
|
3973
|
+
client: providerClient,
|
|
3974
|
+
path: { connectorId, connectionId: connection?.id ?? "" }
|
|
3975
|
+
}),
|
|
3976
|
+
enabled: connection !== undefined,
|
|
3977
|
+
refetchInterval: (query) => summarizeSync(query.state.data?.runs)?.status === "syncing" ? SYNC_POLL_INTERVAL_MS : false
|
|
3978
|
+
});
|
|
3914
3979
|
const resolvedReturnTo = returnTo ?? connectorConnectionReturnTo();
|
|
3915
3980
|
const connectMutation = useConnectConnector({
|
|
3916
3981
|
connectorId,
|
|
@@ -4013,6 +4078,8 @@ function useConnectorConnection({
|
|
|
4013
4078
|
}
|
|
4014
4079
|
}
|
|
4015
4080
|
await refreshConnectionsAndConsumeCallback(completedCallback);
|
|
4081
|
+
if (connection)
|
|
4082
|
+
await syncRunsQuery.refetch();
|
|
4016
4083
|
}
|
|
4017
4084
|
function dismiss() {
|
|
4018
4085
|
if (!callback)
|
|
@@ -4055,6 +4122,7 @@ function useConnectorConnection({
|
|
|
4055
4122
|
canConnect,
|
|
4056
4123
|
isPending: status === "loading" || status === "authorizing" || mutationPending,
|
|
4057
4124
|
selectedAccountId: selectMutation.variables?.accountId,
|
|
4125
|
+
sync: connection ? summarizeSync(syncRunsQuery.data?.runs) : undefined,
|
|
4058
4126
|
connect,
|
|
4059
4127
|
selectAccount,
|
|
4060
4128
|
disconnect,
|
|
@@ -4064,6 +4132,14 @@ function useConnectorConnection({
|
|
|
4064
4132
|
resetError
|
|
4065
4133
|
};
|
|
4066
4134
|
}
|
|
4135
|
+
function summarizeSync(runs) {
|
|
4136
|
+
const latest = (status, matching) => {
|
|
4137
|
+
const at = matching.map((run) => status === "syncing" ? run.startedAt ?? run.queuedAt : run.finishedAt).filter((value) => value !== undefined).sort().at(-1);
|
|
4138
|
+
return at === undefined ? undefined : { status, at };
|
|
4139
|
+
};
|
|
4140
|
+
const all = runs ?? [];
|
|
4141
|
+
return latest("syncing", all.filter((run) => run.status === "queued" || run.status === "running")) ?? latest("failed", all.filter((run) => run.status === "failed")) ?? latest("synced", all.filter((run) => run.status === "succeeded"));
|
|
4142
|
+
}
|
|
4067
4143
|
function isConnectorReplacementRequired(error) {
|
|
4068
4144
|
if (isSixbApiError2(error))
|
|
4069
4145
|
return error.code === "connector.replacement_required";
|
|
@@ -5628,6 +5704,7 @@ export {
|
|
|
5628
5704
|
disableAuthServiceAccountMutation,
|
|
5629
5705
|
disconnectConnectorConnectionMutation,
|
|
5630
5706
|
disconnectConnectorMutationOptions,
|
|
5707
|
+
editAgentThreadMessageMutation,
|
|
5631
5708
|
events2 as events,
|
|
5632
5709
|
exchangeDeviceAuthorizationMutation,
|
|
5633
5710
|
exchangeSharedAccessMutation,
|
|
@@ -5862,6 +5939,10 @@ export {
|
|
|
5862
5939
|
listAuthServiceAccountsQueryKey,
|
|
5863
5940
|
listAuthSessionsOptions,
|
|
5864
5941
|
listAuthSessionsQueryKey,
|
|
5942
|
+
listConnectorAccountsOptions,
|
|
5943
|
+
listConnectorAccountsQueryKey,
|
|
5944
|
+
listConnectorConnectionSyncRunsOptions,
|
|
5945
|
+
listConnectorConnectionSyncRunsQueryKey,
|
|
5865
5946
|
listConnectorConnectionsOptions,
|
|
5866
5947
|
listConnectorConnectionsQueryKey,
|
|
5867
5948
|
listConnectorsOptions,
|
|
@@ -5948,6 +6029,7 @@ export {
|
|
|
5948
6029
|
listWorkflowRunsQueryKey,
|
|
5949
6030
|
listWorkflowsOptions,
|
|
5950
6031
|
listWorkflowsQueryKey,
|
|
6032
|
+
markAgentThreadReadMutation,
|
|
5951
6033
|
matchesSubscription2 as matchesSubscription,
|
|
5952
6034
|
moveAgentThreadToCloudMutation,
|
|
5953
6035
|
moveAgentThreadToComputerMutation,
|
|
@@ -6052,4 +6134,4 @@ export {
|
|
|
6052
6134
|
withdrawAgentThreadInboxItemMutation
|
|
6053
6135
|
};
|
|
6054
6136
|
|
|
6055
|
-
//# debugId=
|
|
6137
|
+
//# debugId=7DF982258C28817364756E2164756E21
|