@sixb/client 0.1.18 → 0.1.20
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 +13 -31
- package/dist/actions.d.ts +9 -50
- package/dist/actions.d.ts.map +1 -1
- package/dist/browser.d.ts +1 -4
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +2 -4
- package/dist/browser.js.map +3 -3
- package/dist/{chunk-pvmd5f18.js → chunk-g05ar78c.js} +13 -223
- package/dist/chunk-g05ar78c.js.map +17 -0
- package/dist/{chunk-jh4ts8mt.js → chunk-m2rmbshc.js} +3 -2
- package/dist/{chunk-jh4ts8mt.js.map → chunk-m2rmbshc.js.map} +3 -3
- package/dist/chunk-tkjkrcdt.js.map +2 -2
- package/dist/connectors/queries.d.ts.map +1 -1
- package/dist/events-builder.d.ts +1 -26
- package/dist/events-builder.d.ts.map +1 -1
- package/dist/events-transport.d.ts +1 -3
- package/dist/events-transport.d.ts.map +1 -1
- package/dist/file.d.ts +1 -3
- package/dist/file.d.ts.map +1 -1
- package/dist/generated/@tanstack/react-query.gen.d.ts +177 -200
- package/dist/generated/@tanstack/react-query.gen.d.ts.map +1 -1
- package/dist/generated/sdk.gen.d.ts +2 -0
- package/dist/generated/sdk.gen.d.ts.map +1 -1
- package/dist/generated/types.gen.d.ts +142 -78
- package/dist/generated/types.gen.d.ts.map +1 -1
- package/dist/hooks.js +15 -26
- package/dist/hooks.js.map +4 -4
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -12
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js +1 -1
- package/dist/query-hooks.d.ts +5 -5
- package/dist/query-hooks.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/actions.ts +9 -288
- package/src/agent-streams.ts +1 -1
- package/src/browser.ts +1 -6
- package/src/events-builder.ts +2 -78
- package/src/events-transport.ts +2 -5
- package/src/file.ts +6 -6
- package/src/generated/@tanstack/react-query.gen.ts +2 -0
- package/src/generated/sdk.gen.ts +2 -0
- package/src/generated/types.gen.ts +207 -114
- package/src/index.ts +2 -1
- package/src/models.ts +5 -3
- package/src/query-hooks.ts +29 -44
- package/dist/chunk-pvmd5f18.js.map +0 -17
package/dist/hooks.js
CHANGED
|
@@ -143,7 +143,7 @@ import {
|
|
|
143
143
|
toObjectSummary2,
|
|
144
144
|
toObjectDetail2,
|
|
145
145
|
toTelemetryHistoryWithRange2
|
|
146
|
-
} from "./chunk-
|
|
146
|
+
} from "./chunk-m2rmbshc.js";
|
|
147
147
|
import"./chunk-j9t5h44d.js";
|
|
148
148
|
import {
|
|
149
149
|
createSixbAgentsWebSocketUrl2,
|
|
@@ -162,9 +162,9 @@ import {
|
|
|
162
162
|
objectIdAliases2,
|
|
163
163
|
telemetryUpdateKey2,
|
|
164
164
|
ActionRunFailedError2,
|
|
165
|
-
|
|
165
|
+
isFailedActionRun,
|
|
166
166
|
uploadFile2
|
|
167
|
-
} from "./chunk-
|
|
167
|
+
} from "./chunk-g05ar78c.js";
|
|
168
168
|
import {
|
|
169
169
|
isSixbApiError2
|
|
170
170
|
} from "./chunk-awbb496e.js";
|
|
@@ -3330,11 +3330,6 @@ function createActionRunMutationOptions(options) {
|
|
|
3330
3330
|
actionId,
|
|
3331
3331
|
subject,
|
|
3332
3332
|
runId,
|
|
3333
|
-
timeoutMs,
|
|
3334
|
-
fallbackPollIntervalMs,
|
|
3335
|
-
disconnectedPollIntervalMs,
|
|
3336
|
-
signal,
|
|
3337
|
-
rejectOnTerminalFailure,
|
|
3338
3333
|
client,
|
|
3339
3334
|
invalidateOnCommit = false,
|
|
3340
3335
|
queryClient,
|
|
@@ -3342,22 +3337,18 @@ function createActionRunMutationOptions(options) {
|
|
|
3342
3337
|
onError,
|
|
3343
3338
|
...mutationOptions
|
|
3344
3339
|
} = options ?? {};
|
|
3345
|
-
const waitOptions = {
|
|
3346
|
-
timeoutMs,
|
|
3347
|
-
fallbackPollIntervalMs,
|
|
3348
|
-
disconnectedPollIntervalMs,
|
|
3349
|
-
signal,
|
|
3350
|
-
rejectOnTerminalFailure
|
|
3351
|
-
};
|
|
3352
3340
|
return {
|
|
3353
3341
|
...mutationOptions,
|
|
3354
|
-
mutationFn: (variables) =>
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3342
|
+
mutationFn: async (variables) => {
|
|
3343
|
+
const { data: run } = await requestAction2({
|
|
3344
|
+
...buildActionRunMutationRequest(variables, { actionId, subject, runId, client }),
|
|
3345
|
+
throwOnError: true
|
|
3346
|
+
});
|
|
3347
|
+
if (isFailedActionRun(run)) {
|
|
3348
|
+
throw new ActionRunFailedError2(run);
|
|
3349
|
+
}
|
|
3350
|
+
return run;
|
|
3351
|
+
},
|
|
3361
3352
|
onSuccess: async (run, variables, context, mutation) => {
|
|
3362
3353
|
if (invalidateOnCommit && queryClient) {
|
|
3363
3354
|
await invalidateActionRunMutationCaches(queryClient, run);
|
|
@@ -3386,7 +3377,6 @@ function buildActionRunMutationRequest(variables, options) {
|
|
|
3386
3377
|
const params = variables === undefined ? undefined : variables;
|
|
3387
3378
|
const subject = normalizeActionRunMutationSubject(options.subject);
|
|
3388
3379
|
return {
|
|
3389
|
-
...options.waitOptions,
|
|
3390
3380
|
client: options.client,
|
|
3391
3381
|
path: { actionId: options.actionId },
|
|
3392
3382
|
body: {
|
|
@@ -3399,7 +3389,6 @@ function buildActionRunMutationRequest(variables, options) {
|
|
|
3399
3389
|
if (isActionRunMutationRequest(variables)) {
|
|
3400
3390
|
const subject = normalizeActionRunMutationSubject(variables.body.subject);
|
|
3401
3391
|
return {
|
|
3402
|
-
...options.waitOptions,
|
|
3403
3392
|
client: options.client,
|
|
3404
3393
|
...variables,
|
|
3405
3394
|
body: {
|
|
@@ -3436,7 +3425,7 @@ async function invalidateActionRunMutationCaches(queryClient, run) {
|
|
|
3436
3425
|
queryClient.invalidateQueries({ queryKey: listActionRunsQueryKey() }),
|
|
3437
3426
|
queryClient.invalidateQueries({ queryKey: listActionRunsInfiniteQueryKey() })
|
|
3438
3427
|
];
|
|
3439
|
-
if (run.phase === "commit" || run.phase === "effects") {
|
|
3428
|
+
if (run.status === "succeeded" && (run.phase === "commit" || run.phase === "effects")) {
|
|
3440
3429
|
invalidations.push(invalidateObjectQueries(queryClient), queryClient.invalidateQueries({ predicate: isGeneratedObjectRead }));
|
|
3441
3430
|
}
|
|
3442
3431
|
await Promise.all(invalidations);
|
|
@@ -4365,4 +4354,4 @@ export {
|
|
|
4365
4354
|
useUploadFile
|
|
4366
4355
|
};
|
|
4367
4356
|
|
|
4368
|
-
//# debugId=
|
|
4357
|
+
//# debugId=6D60173612B093BA64756E2164756E21
|