@collective-intelligence/extensions-sdk-frontend-react 0.6.0 → 0.7.1
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 +2 -0
- package/dist/effect/effect-runtime/runtime-provider.d.ts +1 -1
- package/dist/effect.d.ts +2 -2
- package/dist/effect.js +1 -1
- package/dist/studio-api/@tanstack/react-query.gen.d.ts +13 -0
- package/dist/studio-api/index.d.ts +1 -1
- package/dist/studio-api/index.js +2 -2
- package/dist/studio-api/types.gen.d.ts +30 -4
- package/dist/workflow.js +1 -1
- package/docs/guide/develop/extensions.md +34 -29
- package/docs/guide/develop/sdks.md +3 -3
- package/docs/guide/platform/access.md +4 -4
- package/docs/guide/platform/architecture.md +2 -2
- package/docs/guide/platform/entrypoints.md +17 -19
- package/docs/guide/template/index.md +106 -93
- package/docs/guide/template/state-machines.md +5 -5
- package/package.json +7 -6
- package/dist/effect/effect-runtime/from-effect.d.ts +0 -14
package/README.md
CHANGED
|
@@ -331,6 +331,8 @@ and after the write the actor refreshes the reads through `QueryCache`.
|
|
|
331
331
|
- `fromEffect(run)` makes XState actor logic that runs the effect of `run` on
|
|
332
332
|
`input.runtime`. A stop of the actor interrupts the fiber; after a stop, no
|
|
333
333
|
result of that run gets to the actor, also in a React Strict Mode remount.
|
|
334
|
+
It is the `fromEffect` of `@collective-intelligence/effect-xstate/actors`,
|
|
335
|
+
which the package depends on at the release version.
|
|
334
336
|
- `QueryCache` has `fetch`, `invalidate`, `cancel`, `setData`, `update`,
|
|
335
337
|
`remove` and `optimisticUpdate`. `invalidate`, `cancel`, `update` and `remove` apply to the key and
|
|
336
338
|
to each key below it. `fetch` runs its query once, without a retry, and fails
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { EffectRunner } from "@collective-intelligence/effect-xstate/actors";
|
|
1
2
|
import type { ReactNode } from "react";
|
|
2
|
-
import type { EffectRunner } from "./from-effect";
|
|
3
3
|
import type { QueryCache } from "./query-cache";
|
|
4
4
|
/**
|
|
5
5
|
* Gives its tree an Effect runtime with the `QueryCache` over the nearest
|
package/dist/effect.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
export { fromEffect } from "@collective-intelligence/effect-xstate/actors";
|
|
1
2
|
export { StudioApiError, StudioApiTransportError } from "./errors.js";
|
|
2
|
-
export { fromEffect } from "./effect/effect-runtime/from-effect.js";
|
|
3
3
|
export { QueryCache } from "./effect/effect-runtime/query-cache.js";
|
|
4
4
|
export { makeTestQueryCache } from "./effect/effect-runtime/query-cache-testing.js";
|
|
5
5
|
export { EffectRuntimeProvider, useEffectRuntime } from "./effect/effect-runtime/runtime-provider.js";
|
|
6
6
|
export { StudioApi, layer as layerStudioApi, layerConfig as layerStudioApiConfig } from "./effect/studio-api/service.js";
|
|
7
|
-
export type { EffectRunner } from "
|
|
7
|
+
export type { EffectRunner } from "@collective-intelligence/effect-xstate/actors";
|
|
8
8
|
export type { QueryCacheFetchOptions } from "./effect/effect-runtime/query-cache.js";
|
|
9
9
|
export type { QueryCacheCall, TestQueryCache, TestQueryCacheOptions } from "./effect/effect-runtime/query-cache-testing.js";
|
|
10
10
|
export type { StudioApiOperation, StudioApiOperationName, StudioApiOptions, StudioApiRequest, StudioApiSuccess, StudioApiValue } from "./effect/studio-api/service.js";
|
package/dist/effect.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import{fromEffect as Le}from"@collective-intelligence/effect-xstate/actors";import*as d from"effect/Schema";class S extends d.TaggedError()("StudioApiError",{body:d.Unknown,status:d.Int}){}class f extends d.TaggedError()("StudioApiTransportError",{cause:d.Defect()}){}import{hashKey as T,isCancelledError as I,QueryObserver as K}from"@tanstack/react-query";import*as Q from"effect/Brand";import*as x from"effect/Context";import*as i from"effect/Effect";import*as c from"effect/Exit";import{constVoid as M}from"effect/Function";import*as g from"effect/Layer";import*as D from"effect/Schema";import*as C from"effect/Semaphore";class p extends x.Service()("@collective-intelligence/extensions-sdk-frontend-react/QueryCache"){}var A=new WeakMap,q=(r,n)=>(o)=>{let e=T(n),t=A.get(r)??new Map;return A.set(r,t),i.acquireUseRelease(i.sync(()=>{let s=t.get(e)??{semaphore:C.makeUnsafe(1),users:0};return s.users+=1,t.set(e,s),s}),(s)=>s.semaphore.withPermits(1)(o),(s)=>i.sync(()=>{if(s.users-=1,s.users===0)t.delete(e)}))},P=Q.nominal(),B=(r,n,o)=>{let e=r.getQueryData(n);if(e===void 0)return;r.setQueryData(n,o(e));let t=r.getQueryCache().find({exact:!0,queryKey:n});return t===void 0?void 0:P({dataUpdateCount:t.state.dataUpdateCount,query:t,snapshot:e})},F=(r,n)=>{let{query:o}=n;if(r.getQueryCache().get(o.queryHash)===o&&o.state.dataUpdateCount===n.dataUpdateCount)r.setQueryData(o.queryKey,n.snapshot)},w=(r)=>{let n=async({query:e,...t},s)=>{try{return c.succeed(await r.fetchQuery({...t,queryFn:({signal:a})=>i.runPromiseWith(s)(e,{signal:a}),retry:!1}))}catch(a){if(I(a))return c.interrupt();return D.is(S)(a)||D.is(f)(a)?c.fail(a):c.die(a)}},o=(e)=>i.sync(()=>new K(r,{enabled:!1,queryKey:e}).subscribe(M));return p.of({cancel:(e)=>i.promise(()=>r.cancelQueries({queryKey:e})),fetch:(e)=>i.flatMap(i.context(),(t)=>i.acquireUseRelease(o(e.queryKey),()=>i.flatten(i.promise(()=>n(e,t))),(s)=>i.sync(s))),invalidate:(e)=>i.promise(()=>r.invalidateQueries({queryKey:e})),optimisticUpdate:(e,t,s)=>q(r,e)(i.acquireUseRelease(i.promise(()=>r.cancelQueries({exact:!0,queryKey:e})).pipe(i.andThen(i.sync(()=>B(r,e,t)))),()=>s,(a,u)=>i.sync(()=>{if(a!==void 0&&c.isFailure(u))F(r,a);r.invalidateQueries({exact:!0,queryKey:e})}))),remove:(e)=>i.sync(()=>{r.removeQueries({queryKey:e})}),setData:(e,t)=>i.sync(()=>{r.setQueryData(e,t)}),update:(e,t)=>i.sync(()=>{r.setQueriesData({queryKey:e},t)})})},k=(r)=>g.succeed(p,w(r));import{QueryClient as H}from"@tanstack/react-query";import*as V from"effect/Effect";import*as v from"effect/Layer";var j=(r={})=>{let n=r.queryClient??new H({defaultOptions:{queries:{gcTime:1/0}}});for(let[a,u]of r.seed??[])n.setQueryData(a,u);let o=w(n),e=r.overrides??{},t=[],s=(a,u,m)=>V.suspend(()=>(t.push({member:a,queryKey:u}),m()));return{calls:t,layer:v.succeed(p,p.of({cancel:(a)=>s("cancel",a,()=>(e.cancel??o.cancel)(a)),fetch:(a)=>s("fetch",a.queryKey,()=>(e.fetch??o.fetch)(a)),invalidate:(a)=>s("invalidate",a,()=>(e.invalidate??o.invalidate)(a)),optimisticUpdate:(a,u,m)=>s("optimisticUpdate",a,()=>(e.optimisticUpdate??o.optimisticUpdate)(a,u,m)),remove:(a)=>s("remove",a,()=>(e.remove??o.remove)(a)),setData:(a,u)=>s("setData",a,()=>(e.setData??o.setData)(a,u)),update:(a,u)=>s("update",a,()=>(e.update??o.update)(a,u))})),queryClient:n}};import{EffectRuntimeProvider as z,makeEffectRuntimeContext as J,useEffectRuntime as X}from"@collective-intelligence/effect-xstate/react";import{useQueryClient as Y}from"@tanstack/react-query";import*as G from"effect/ManagedRuntime";import{useMemo as Z}from"react";import{jsx as te}from"react/jsx-runtime";var O=J(),_=({children:r})=>{let n=Y(),o=Z(()=>G.make(k(n)),[n]);return te(z,{context:O,runtime:o,children:r})},ee=()=>X(O);import{client as re,studioAgentRunsGet as ae,studioAgentRunsList as oe,studioViewDataGetItem as ie,studioViewDataSearch as se,studioViewDataSearchMembers as ne,studioViewDataUpdateItem as ue,studioWorkflowRunsGet as ce,studioWorkflowRunsList as de}from"@collective-intelligence/extensions-sdk-frontend-react/studio-api";import*as L from"effect/Config";import*as U from"effect/Context";import*as E from"effect/Effect";import*as R from"effect/Layer";class h extends U.Service()("@collective-intelligence/extensions-sdk-frontend-react/StudioApi"){}var fe=(r={})=>{let n=r.baseUrl===void 0?{}:{baseUrl:r.baseUrl},o=(e,t)=>E.fn(`StudioApi.${e}`)(function*(a){let u=!1,m=re.getConfig().fetch??globalThis.fetch,W=Object.assign(async(l,N)=>(u=!0,await m(l,N)),m),y=yield*E.tryPromise({catch:(l)=>{if(u)return new f({cause:l});throw l},try:(l)=>t(a,{...n,fetch:W,responseStyle:"fields",signal:l,throwOnError:!1})});if(y.response===void 0)return yield*new f({cause:y.error});if(!y.response.ok)return yield*new S({body:y.error,status:y.response.status});return y.data});return h.of({studioAgentRunsGet:o("studioAgentRunsGet",(e,t)=>ae({...e,...t})),studioAgentRunsList:o("studioAgentRunsList",(e,t)=>oe({...e,...t})),studioViewDataGetItem:o("studioViewDataGetItem",(e,t)=>ie({...e,...t})),studioViewDataSearch:o("studioViewDataSearch",(e,t)=>se({...e,...t})),studioViewDataSearchMembers:o("studioViewDataSearchMembers",(e,t)=>ne({...e,...t})),studioViewDataUpdateItem:o("studioViewDataUpdateItem",(e,t)=>ue({...e,...t})),studioWorkflowRunsGet:o("studioWorkflowRunsGet",(e,t)=>ce({...e,...t})),studioWorkflowRunsList:o("studioWorkflowRunsList",(e,t)=>de({...e,...t}))})},b=(r={})=>R.sync(h,()=>fe(r)),pe=(r)=>R.unwrap(E.map(L.unwrap(r),b));export{_ as EffectRuntimeProvider,p as QueryCache,h as StudioApi,S as StudioApiError,f as StudioApiTransportError,Le as fromEffect,b as layerStudioApi,pe as layerStudioApiConfig,j as makeTestQueryCache,ee as useEffectRuntime};
|
|
@@ -23,6 +23,7 @@ export declare const studioAgentRunsListOptions: (options: Options<StudioAgentRu
|
|
|
23
23
|
createdAt: string;
|
|
24
24
|
errorCode: string | null;
|
|
25
25
|
errorMessage: string | null;
|
|
26
|
+
harnessInvocationId: string | null;
|
|
26
27
|
id: string;
|
|
27
28
|
initiator: {
|
|
28
29
|
kind: "user";
|
|
@@ -47,6 +48,7 @@ export declare const studioAgentRunsListOptions: (options: Options<StudioAgentRu
|
|
|
47
48
|
createdAt: string;
|
|
48
49
|
errorCode: string | null;
|
|
49
50
|
errorMessage: string | null;
|
|
51
|
+
harnessInvocationId: string | null;
|
|
50
52
|
id: string;
|
|
51
53
|
initiator: {
|
|
52
54
|
kind: "user";
|
|
@@ -76,6 +78,7 @@ export declare const studioAgentRunsListOptions: (options: Options<StudioAgentRu
|
|
|
76
78
|
createdAt: string;
|
|
77
79
|
errorCode: string | null;
|
|
78
80
|
errorMessage: string | null;
|
|
81
|
+
harnessInvocationId: string | null;
|
|
79
82
|
id: string;
|
|
80
83
|
initiator: {
|
|
81
84
|
kind: "user";
|
|
@@ -111,6 +114,7 @@ export declare const studioAgentRunsListOptions: (options: Options<StudioAgentRu
|
|
|
111
114
|
createdAt: string;
|
|
112
115
|
errorCode: string | null;
|
|
113
116
|
errorMessage: string | null;
|
|
117
|
+
harnessInvocationId: string | null;
|
|
114
118
|
id: string;
|
|
115
119
|
initiator: {
|
|
116
120
|
kind: "user";
|
|
@@ -140,6 +144,7 @@ export declare const studioAgentRunsListInfiniteOptions: (options: Options<Studi
|
|
|
140
144
|
createdAt: string;
|
|
141
145
|
errorCode: string | null;
|
|
142
146
|
errorMessage: string | null;
|
|
147
|
+
harnessInvocationId: string | null;
|
|
143
148
|
id: string;
|
|
144
149
|
initiator: {
|
|
145
150
|
kind: "user";
|
|
@@ -164,6 +169,7 @@ export declare const studioAgentRunsListInfiniteOptions: (options: Options<Studi
|
|
|
164
169
|
createdAt: string;
|
|
165
170
|
errorCode: string | null;
|
|
166
171
|
errorMessage: string | null;
|
|
172
|
+
harnessInvocationId: string | null;
|
|
167
173
|
id: string;
|
|
168
174
|
initiator: {
|
|
169
175
|
kind: "user";
|
|
@@ -193,6 +199,7 @@ export declare const studioAgentRunsListInfiniteOptions: (options: Options<Studi
|
|
|
193
199
|
createdAt: string;
|
|
194
200
|
errorCode: string | null;
|
|
195
201
|
errorMessage: string | null;
|
|
202
|
+
harnessInvocationId: string | null;
|
|
196
203
|
id: string;
|
|
197
204
|
initiator: {
|
|
198
205
|
kind: "user";
|
|
@@ -221,6 +228,7 @@ export declare const studioAgentRunsListInfiniteOptions: (options: Options<Studi
|
|
|
221
228
|
createdAt: string;
|
|
222
229
|
errorCode: string | null;
|
|
223
230
|
errorMessage: string | null;
|
|
231
|
+
harnessInvocationId: string | null;
|
|
224
232
|
id: string;
|
|
225
233
|
initiator: {
|
|
226
234
|
kind: "user";
|
|
@@ -252,6 +260,7 @@ export declare const studioAgentRunsListInfiniteOptions: (options: Options<Studi
|
|
|
252
260
|
createdAt: string;
|
|
253
261
|
errorCode: string | null;
|
|
254
262
|
errorMessage: string | null;
|
|
263
|
+
harnessInvocationId: string | null;
|
|
255
264
|
id: string;
|
|
256
265
|
initiator: {
|
|
257
266
|
kind: "user";
|
|
@@ -283,6 +292,7 @@ export declare const studioAgentRunsGetOptions: (options: Options<StudioAgentRun
|
|
|
283
292
|
createdAt: string;
|
|
284
293
|
errorCode: string | null;
|
|
285
294
|
errorMessage: string | null;
|
|
295
|
+
harnessInvocationId: string | null;
|
|
286
296
|
id: string;
|
|
287
297
|
initiator: {
|
|
288
298
|
kind: "user";
|
|
@@ -298,6 +308,7 @@ export declare const studioAgentRunsGetOptions: (options: Options<StudioAgentRun
|
|
|
298
308
|
createdAt: string;
|
|
299
309
|
errorCode: string | null;
|
|
300
310
|
errorMessage: string | null;
|
|
311
|
+
harnessInvocationId: string | null;
|
|
301
312
|
id: string;
|
|
302
313
|
initiator: {
|
|
303
314
|
kind: "user";
|
|
@@ -318,6 +329,7 @@ export declare const studioAgentRunsGetOptions: (options: Options<StudioAgentRun
|
|
|
318
329
|
createdAt: string;
|
|
319
330
|
errorCode: string | null;
|
|
320
331
|
errorMessage: string | null;
|
|
332
|
+
harnessInvocationId: string | null;
|
|
321
333
|
id: string;
|
|
322
334
|
initiator: {
|
|
323
335
|
kind: "user";
|
|
@@ -344,6 +356,7 @@ export declare const studioAgentRunsGetOptions: (options: Options<StudioAgentRun
|
|
|
344
356
|
createdAt: string;
|
|
345
357
|
errorCode: string | null;
|
|
346
358
|
errorMessage: string | null;
|
|
359
|
+
harnessInvocationId: string | null;
|
|
347
360
|
id: string;
|
|
348
361
|
initiator: {
|
|
349
362
|
kind: "user";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { type QueryKey, studioAgentRunsGetOptions, studioAgentRunsGetQueryKey, studioAgentRunsListInfiniteOptions, studioAgentRunsListInfiniteQueryKey, studioAgentRunsListOptions, studioAgentRunsListQueryKey, studioViewDataGetItemOptions, studioViewDataGetItemQueryKey, studioViewDataSearchInfiniteOptions, studioViewDataSearchInfiniteQueryKey, studioViewDataSearchMembersInfiniteOptions, studioViewDataSearchMembersInfiniteQueryKey, studioViewDataSearchMembersOptions, studioViewDataSearchMembersQueryKey, studioViewDataSearchOptions, studioViewDataSearchQueryKey, studioViewDataUpdateItemMutation, studioWorkflowRunsGetOptions, studioWorkflowRunsGetQueryKey, studioWorkflowRunsListInfiniteOptions, studioWorkflowRunsListInfiniteQueryKey, studioWorkflowRunsListOptions, studioWorkflowRunsListQueryKey } from "./@tanstack/react-query.gen";
|
|
2
2
|
export { client, type CreateClientConfig } from "./client.gen";
|
|
3
3
|
export { type Options, studioAgentRunsGet, studioAgentRunsList, studioViewDataGetItem, studioViewDataSearch, studioViewDataSearchMembers, studioViewDataUpdateItem, studioWorkflowRunsGet, studioWorkflowRunsList } from "./sdk.gen";
|
|
4
|
-
export type { ClientOptions, EffectHttpApiErrorBadRequestEncoded, EffectHttpApiErrorForbiddenEncoded, EffectHttpApiErrorInternalServerErrorEncoded, EffectHttpApiErrorNotFoundEncoded, EffectHttpApiErrorUnauthorizedEncoded, EntityFileFieldConflictDiagnosticEncoded, EntityFileFieldDiagnosticEncoded, EntityRelationFieldDiagnosticEncoded, EntityUniqueFieldConflictDiagnosticEncoded, EntityValueDiagnosticEncoded, InvalidIncludePathEncoded, KnowledgePageDepthExceededEncoded, KnowledgeReadLimitExceededEncoded, StudioAgentRunsGetData, StudioAgentRunsGetError, StudioAgentRunsGetErrors, StudioAgentRunsGetResponse, StudioAgentRunsGetResponses, StudioAgentRunsListData, StudioAgentRunsListError, StudioAgentRunsListErrors, StudioAgentRunsListResponse, StudioAgentRunsListResponses, StudioViewDataGetItemData, StudioViewDataGetItemError, StudioViewDataGetItemErrors, StudioViewDataGetItemResponses, StudioViewDataSearchData, StudioViewDataSearchError, StudioViewDataSearchErrors, StudioViewDataSearchMembersData, StudioViewDataSearchMembersError, StudioViewDataSearchMembersErrors, StudioViewDataSearchMembersResponses, StudioViewDataSearchResponses, StudioViewDataUpdateItemData, StudioViewDataUpdateItemError, StudioViewDataUpdateItemErrors, StudioViewDataUpdateItemResponse, StudioViewDataUpdateItemResponses, StudioWorkflowRunsGetData, StudioWorkflowRunsGetError, StudioWorkflowRunsGetErrors, StudioWorkflowRunsGetResponse, StudioWorkflowRunsGetResponses, StudioWorkflowRunsListData, StudioWorkflowRunsListError, StudioWorkflowRunsListErrors, StudioWorkflowRunsListResponse, StudioWorkflowRunsListResponses, Suspend4 } from "./types.gen";
|
|
4
|
+
export type { ClientOptions, EffectHttpApiErrorBadRequestEncoded, EffectHttpApiErrorForbiddenEncoded, EffectHttpApiErrorInternalServerErrorEncoded, EffectHttpApiErrorNotFoundEncoded, EffectHttpApiErrorUnauthorizedEncoded, EntityFileFieldConflictDiagnosticEncoded, EntityFileFieldDiagnosticEncoded, EntityRelationFieldDiagnosticEncoded, EntityRemoteFirstConflictDiagnosticEncoded, EntityRemoteFirstDiagnosticEncoded, EntityRemoteFirstUnavailableDiagnosticEncoded, EntityUniqueFieldConflictDiagnosticEncoded, EntityValueDiagnosticEncoded, InvalidIncludePathEncoded, KnowledgePageDepthExceededEncoded, KnowledgeReadLimitExceededEncoded, StudioAgentRunsGetData, StudioAgentRunsGetError, StudioAgentRunsGetErrors, StudioAgentRunsGetResponse, StudioAgentRunsGetResponses, StudioAgentRunsListData, StudioAgentRunsListError, StudioAgentRunsListErrors, StudioAgentRunsListResponse, StudioAgentRunsListResponses, StudioViewDataGetItemData, StudioViewDataGetItemError, StudioViewDataGetItemErrors, StudioViewDataGetItemResponses, StudioViewDataSearchData, StudioViewDataSearchError, StudioViewDataSearchErrors, StudioViewDataSearchMembersData, StudioViewDataSearchMembersError, StudioViewDataSearchMembersErrors, StudioViewDataSearchMembersResponses, StudioViewDataSearchResponses, StudioViewDataUpdateItemData, StudioViewDataUpdateItemError, StudioViewDataUpdateItemErrors, StudioViewDataUpdateItemResponse, StudioViewDataUpdateItemResponses, StudioWorkflowRunsGetData, StudioWorkflowRunsGetError, StudioWorkflowRunsGetErrors, StudioWorkflowRunsGetResponse, StudioWorkflowRunsGetResponses, StudioWorkflowRunsListData, StudioWorkflowRunsListError, StudioWorkflowRunsListErrors, StudioWorkflowRunsListResponse, StudioWorkflowRunsListResponses, Suspend4 } from "./types.gen";
|
package/dist/studio-api/index.js
CHANGED
|
@@ -2,5 +2,5 @@ import{infiniteQueryOptions as P,queryOptions as x}from"@tanstack/react-query";f
|
|
|
2
2
|
`);let Z=y.split(`
|
|
3
3
|
|
|
4
4
|
`);y=Z.pop()??"";for(let Ee of Z){let ke=Ee.split(`
|
|
5
|
-
`),
|
|
6
|
-
`);try{k=JSON.parse(g),te=!0}catch{k=g}}if(te){if(o)await o(k);if(n)k=await n(k)}if(r?.({data:k,event:ee,id:i,retry:O}),L.length)yield k}}}finally{h.removeEventListener("abort",Y),f.releaseLock()}break}catch(b){if(t?.(b),s!==void 0&&p>=s)break;let E=Math.min(O*2**(p-1),a??30000);await w(E)}}}()}}var xe=(e)=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Ae=(e)=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},Ie=(e)=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},C=({allowReserved:e,explode:t,name:r,style:n,value:o})=>{if(!t){let a=(e?o:o.map((u)=>encodeURIComponent(u))).join(Ae(n));switch(n){case"label":return`.${a}`;case"matrix":return`;${r}=${a}`;case"simple":return a;default:return`${r}=${a}`}}let d=xe(n),s=o.map((a)=>{if(n==="label"||n==="simple")return e?a:encodeURIComponent(a);return V({allowReserved:e,name:r,value:a})}).join(d);return n==="label"||n==="matrix"?d+s:s},V=({allowReserved:e,name:t,value:r})=>{if(r===void 0||r===null)return"";if(typeof r==="object")throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?r:encodeURIComponent(r)}`},z=({allowReserved:e,explode:t,name:r,style:n,value:o,valueOnly:d})=>{if(o instanceof Date)return d?o.toISOString():`${r}=${o.toISOString()}`;if(n!=="deepObject"&&!t){let u=[];Object.entries(o).forEach(([c,i])=>{u=[...u,c,e?i:encodeURIComponent(i)]});let S=u.join(",");switch(n){case"form":return`${r}=${S}`;case"label":return`.${S}`;case"matrix":return`;${r}=${S}`;default:return S}}let s=Ie(n),a=Object.entries(o).map(([u,S])=>V({allowReserved:e,name:n==="deepObject"?`${r}[${u}]`:u,value:S})).join(s);return n==="label"||n==="matrix"?s+a:a};var Ve=/\{[^{}]+\}/g,qe=({path:e,url:t})=>{let r=t,n=t.match(Ve);if(n)for(let o of n){let d=!1,s=o.substring(1,o.length-1),a="simple";if(s.endsWith("*"))d=!0,s=s.substring(0,s.length-1);if(s.startsWith("."))s=s.substring(1),a="label";else if(s.startsWith(";"))s=s.substring(1),a="matrix";let u=e[s];if(u===void 0||u===null)continue;if(Array.isArray(u)){r=r.replace(o,C({explode:d,name:s,style:a,value:u}));continue}if(typeof u==="object"){r=r.replace(o,z({explode:d,name:s,style:a,value:u,valueOnly:!0}));continue}if(a==="matrix"){r=r.replace(o,`;${V({name:s,value:u})}`);continue}let S=encodeURIComponent(a==="label"?`.${u}`:u);r=r.replace(o,S)}return r},oe=({baseUrl:e,path:t,query:r,querySerializer:n,url:o})=>{let d=o.startsWith("/")?o:`/${o}`,s=(e??"")+d;if(t)s=qe({path:t,url:s});let a=r?n(r):"";if(a.startsWith("?"))a=a.substring(1);if(a)s+=`?${a}`;return s};function v(e){let t=e.body!==void 0;if(t&&e.bodySerializer){if("serializedBody"in e)return e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null;return e.body!==""?e.body:null}if(t)return e.body;return}var se=async(e,t)=>{let r=typeof t==="function"?await t(e):t;if(!r)return;if(e.scheme==="bearer")return`Bearer ${r}`;if(e.scheme==="basic")return`Basic ${btoa(r)}`;return r};var ie={bodySerializer:(e)=>JSON.stringify(e,(t,r)=>typeof r==="bigint"?r.toString():r)};var ae=({parameters:e={},...t}={})=>(n)=>{let o=[];if(n&&typeof n==="object")for(let d in n){let s=n[d];if(s===void 0||s===null)continue;let a=e[d]||t;if(Array.isArray(s)){let u=C({allowReserved:a.allowReserved,explode:!0,name:d,style:"form",value:s,...a.array});if(u)o.push(u)}else if(typeof s==="object"){let u=z({allowReserved:a.allowReserved,explode:!0,name:d,style:"deepObject",value:s,...a.object});if(u)o.push(u)}else{let u=V({allowReserved:a.allowReserved,name:d,value:s});if(u)o.push(u)}}return o.join("&")},ue=(e)=>{if(!e)return"stream";let t=e.split(";")[0]?.trim();if(!t)return;if(t.startsWith("application/json")||t.endsWith("+json"))return"json";if(t==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some((r)=>t.startsWith(r)))return"blob";if(t.startsWith("text/"))return"text";return},Te=(e,t)=>{if(!t)return!1;if(e.headers.has(t)||e.query?.[t]||e.headers.get("Cookie")?.includes(`${t}=`))return!0;return!1},de=async({security:e,...t})=>{for(let r of e){if(Te(t,r.name))continue;let n=await se(r,t.auth);if(!n)continue;let o=r.name??"Authorization";switch(r.in){case"query":if(!t.query)t.query={};t.query[o]=n;break;case"cookie":t.headers.append("Cookie",`${o}=${n}`);break;case"header":default:t.headers.set(o,n);break}}},B=(e)=>oe({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer==="function"?e.querySerializer:ae(e.querySerializer),url:e.url}),F=(e,t)=>{let r={...e,...t};if(r.baseUrl?.endsWith("/"))r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1);return r.headers=G(e.headers,t.headers),r},Le=(e)=>{let t=[];return e.forEach((r,n)=>{t.push([n,r])}),t},G=(...e)=>{let t=new Headers;for(let r of e){if(!r)continue;let n=r instanceof Headers?Le(r):Object.entries(r);for(let[o,d]of n)if(d===null)t.delete(o);else if(Array.isArray(d))for(let s of d)t.append(o,s);else if(d!==void 0)t.set(o,typeof d==="object"?JSON.stringify(d):d)}return t};class W{fns=[];clear(){this.fns=[]}eject(e){let t=this.getInterceptorIndex(e);if(this.fns[t])this.fns[t]=null}exists(e){let t=this.getInterceptorIndex(e);return Boolean(this.fns[t])}getInterceptorIndex(e){if(typeof e==="number")return this.fns[e]?e:-1;return this.fns.indexOf(e)}update(e,t){let r=this.getInterceptorIndex(e);if(this.fns[r])return this.fns[r]=t,e;return!1}use(e){return this.fns.push(e),this.fns.length-1}}var pe=()=>({error:new W,request:new W,response:new W}),Ce=ae({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),ze={"Content-Type":"application/json"},T=(e={})=>({...ie,headers:ze,parseAs:"auto",querySerializer:Ce,...e});var H=(e={})=>{let t=F(T(),e),r=()=>({...t}),n=(c)=>(t=F(t,c),r()),o=pe(),d=async(c)=>{let i={...t,...c,fetch:c.fetch??t.fetch??globalThis.fetch,headers:G(t.headers,c.headers),serializedBody:void 0};if(i.security)await de({...i,security:i.security});if(i.requestValidator)await i.requestValidator(i);if(i.body!==void 0&&i.bodySerializer)i.serializedBody=i.bodySerializer(i.body);if(i.body===void 0||i.serializedBody==="")i.headers.delete("Content-Type");let w=i,A=B(w);return{opts:w,url:A}},s=async(c)=>{let{opts:i,url:w}=await d(c),A={redirect:"follow",...i,body:v(i)},m=new Request(w,A);for(let l of o.request.fns)if(l)m=await l(m,i);let O=i.fetch,p;try{p=await O(m)}catch(l){let f=l;for(let y of o.error.fns)if(y)f=await y(l,void 0,m,i);if(f=f||{},i.throwOnError)throw f;return i.responseStyle==="data"?void 0:{error:f,request:m,response:void 0}}for(let l of o.response.fns)if(l)p=await l(p,m,i);let h={request:m,response:p};if(p.ok){let l=(i.parseAs==="auto"?ue(p.headers.get("Content-Type")):i.parseAs)??"json";if(p.status===204||p.headers.get("Content-Length")==="0"){let y;switch(l){case"arrayBuffer":case"blob":case"text":y=await p[l]();break;case"formData":y=new FormData;break;case"stream":y=p.body;break;case"json":default:y={};break}return i.responseStyle==="data"?y:{data:y,...h}}let f;switch(l){case"arrayBuffer":case"blob":case"formData":case"text":f=await p[l]();break;case"json":{let y=await p.text();f=y?JSON.parse(y):{};break}case"stream":return i.responseStyle==="data"?p.body:{data:p.body,...h}}if(l==="json"){if(i.responseValidator)await i.responseValidator(f);if(i.responseTransformer)f=await i.responseTransformer(f)}return i.responseStyle==="data"?f:{data:f,...h}}let q=await p.text(),b;try{b=JSON.parse(q)}catch{}let E=b??q,I=E;for(let l of o.error.fns)if(l)I=await l(E,p,m,i);if(I=I||{},i.throwOnError)throw I;return i.responseStyle==="data"?void 0:{error:I,...h}},a=(c)=>(i)=>s({...i,method:c}),u=(c)=>async(i)=>{let{opts:w,url:A}=await d(i);return ne({...w,body:w.body,headers:w.headers,method:c,onRequest:async(m,O)=>{let p=new Request(m,O);for(let h of o.request.fns)if(h)p=await h(p,w);return p},serializedBody:v(w),url:A})};return{buildUrl:(c)=>B({...t,...c}),connect:a("CONNECT"),delete:a("DELETE"),get:a("GET"),getConfig:r,head:a("HEAD"),interceptors:o,options:a("OPTIONS"),patch:a("PATCH"),post:a("POST"),put:a("PUT"),request:s,setConfig:n,sse:{connect:u("CONNECT"),delete:u("DELETE"),get:u("GET"),head:u("HEAD"),options:u("OPTIONS"),patch:u("PATCH"),post:u("POST"),put:u("PUT"),trace:u("TRACE")},trace:a("TRACE")}};var R=H(T());var Q=(e)=>(e.client??R).get({security:[{scheme:"bearer",type:"http"}],url:"/studio/agent-runs",...e}),N=(e)=>(e.client??R).get({security:[{scheme:"bearer",type:"http"}],url:"/studio/agent-runs/{runId}",...e}),U=(e)=>(e.client??R).post({security:[{scheme:"bearer",type:"http"}],url:"/studio/apps/by-slug/{slug}/views/{viewId}/data/{instanceId}/relation-members/search",...e,headers:{"Content-Type":"application/json",...e.headers}}),K=(e)=>(e.client??R).post({security:[{scheme:"bearer",type:"http"}],url:"/studio/apps/by-slug/{slug}/views/{viewId}/data/search",...e,headers:{"Content-Type":"application/json",...e.headers}}),_=(e)=>(e.client??R).get({security:[{scheme:"bearer",type:"http"}],url:"/studio/apps/by-slug/{slug}/views/{viewId}/data/{instanceId}",...e}),J=(e)=>(e.client??R).patch({security:[{scheme:"bearer",type:"http"}],url:"/studio/apps/by-slug/{slug}/views/{viewId}/data/{instanceId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),j=(e)=>(e.client??R).get({security:[{scheme:"bearer",type:"http"}],url:"/studio/workflow-runs",...e}),X=(e)=>(e.client??R).get({security:[{scheme:"bearer",type:"http"}],url:"/studio/workflow-runs/{runId}",...e});var D=(e,t,r,n)=>{let o={_id:e,baseUrl:t?.baseUrl||(t?.client??R).getConfig().baseUrl};if(r)o._infinite=r;if(n)o.tags=n;if(t?.body)o.body=t.body;if(t?.headers)o.headers=t.headers;if(t?.path)o.path=t.path;if(t?.query)o.query=t.query;return[o]},ce=(e)=>D("studioAgentRunsList",e),We=(e)=>x({queryFn:async({queryKey:t,signal:r})=>{let{data:n}=await Q({...e,...t[0],signal:r,throwOnError:!0});return n},queryKey:ce(e)}),M=(e,t)=>{let r={...e[0]};if(t.body)r.body={...e[0].body,...t.body};if(t.headers)r.headers={...e[0].headers,...t.headers};if(t.path)r.path={...e[0].path,...t.path};if(t.query)r.query={...e[0].query,...t.query};return r},le=(e)=>D("studioAgentRunsList",e,!0),Ge=(e)=>P({queryFn:async({pageParam:t,queryKey:r,signal:n})=>{let d=M(r,typeof t==="object"?t:{query:{page:t}}),{data:s}=await Q({...e,...d,signal:n,throwOnError:!0});return s},queryKey:le(e)}),ye=(e)=>D("studioAgentRunsGet",e),Qe=(e)=>x({queryFn:async({queryKey:t,signal:r})=>{let{data:n}=await N({...e,...t[0],signal:r,throwOnError:!0});return n},queryKey:ye(e)}),fe=(e)=>D("studioViewDataSearchMembers",e),Ue=(e)=>x({queryFn:async({queryKey:t,signal:r})=>{let{data:n}=await U({...e,...t[0],signal:r,throwOnError:!0});return n},queryKey:fe(e)}),Se=(e)=>D("studioViewDataSearchMembers",e,!0),Ke=(e)=>P({queryFn:async({pageParam:t,queryKey:r,signal:n})=>{let d=M(r,typeof t==="object"?t:{body:{cursor:t}}),{data:s}=await U({...e,...d,signal:n,throwOnError:!0});return s},queryKey:Se(e)}),we=(e)=>D("studioViewDataSearch",e),je=(e)=>x({queryFn:async({queryKey:t,signal:r})=>{let{data:n}=await K({...e,...t[0],signal:r,throwOnError:!0});return n},queryKey:we(e)}),he=(e)=>D("studioViewDataSearch",e,!0),Pe=(e)=>P({queryFn:async({pageParam:t,queryKey:r,signal:n})=>{let d=M(r,typeof t==="object"?t:{body:{cursor:t}}),{data:s}=await K({...e,...d,signal:n,throwOnError:!0});return s},queryKey:he(e)}),Re=(e)=>D("studioViewDataGetItem",e),Me=(e)=>x({queryFn:async({queryKey:t,signal:r})=>{let{data:n}=await _({...e,...t[0],signal:r,throwOnError:!0});return n},queryKey:Re(e)}),ve=(e)=>({mutationFn:async(r)=>{let{data:n}=await J({...e,...r,throwOnError:!0});return n}}),me=(e)=>D("studioWorkflowRunsList",e),Be=(e)=>x({queryFn:async({queryKey:t,signal:r})=>{let{data:n}=await j({...e,...t[0],signal:r,throwOnError:!0});return n},queryKey:me(e)}),ge=(e)=>D("studioWorkflowRunsList",e,!0),Fe=(e)=>P({queryFn:async({pageParam:t,queryKey:r,signal:n})=>{let d=M(r,typeof t==="object"?t:{query:{page:t}}),{data:s}=await j({...e,...d,signal:n,throwOnError:!0});return s},queryKey:ge(e)}),De=(e)=>D("studioWorkflowRunsGet",e),He=(e)=>x({queryFn:async({queryKey:t,signal:r})=>{let{data:n}=await X({...e,...t[0],signal:r,throwOnError:!0});return n},queryKey:De(e)});export{R as client,N as studioAgentRunsGet,Qe as studioAgentRunsGetOptions,ye as studioAgentRunsGetQueryKey,Q as studioAgentRunsList,Ge as studioAgentRunsListInfiniteOptions,le as studioAgentRunsListInfiniteQueryKey,We as studioAgentRunsListOptions,ce as studioAgentRunsListQueryKey,_ as studioViewDataGetItem,Me as studioViewDataGetItemOptions,Re as studioViewDataGetItemQueryKey,K as studioViewDataSearch,Pe as studioViewDataSearchInfiniteOptions,he as studioViewDataSearchInfiniteQueryKey,U as studioViewDataSearchMembers,Ke as studioViewDataSearchMembersInfiniteOptions,Se as studioViewDataSearchMembersInfiniteQueryKey,Ue as studioViewDataSearchMembersOptions,fe as studioViewDataSearchMembersQueryKey,je as studioViewDataSearchOptions,we as studioViewDataSearchQueryKey,J as studioViewDataUpdateItem,ve as studioViewDataUpdateItemMutation,X as studioWorkflowRunsGet,He as studioWorkflowRunsGetOptions,De as studioWorkflowRunsGetQueryKey,j as studioWorkflowRunsList,Fe as studioWorkflowRunsListInfiniteOptions,ge as studioWorkflowRunsListInfiniteQueryKey,Be as studioWorkflowRunsListOptions,me as studioWorkflowRunsListQueryKey};
|
|
5
|
+
`),C=[],ee;for(let g of ke)if(g.startsWith("data:"))C.push(g.replace(/^data:\s*/,""));else if(g.startsWith("event:"))ee=g.replace(/^event:\s*/,"");else if(g.startsWith("id:"))i=g.replace(/^id:\s*/,"");else if(g.startsWith("retry:")){let re=Number.parseInt(g.replace(/^retry:\s*/,""),10);if(!Number.isNaN(re))O=re}let k,te=!1;if(C.length){let g=C.join(`
|
|
6
|
+
`);try{k=JSON.parse(g),te=!0}catch{k=g}}if(te){if(o)await o(k);if(n)k=await n(k)}if(r?.({data:k,event:ee,id:i,retry:O}),C.length)yield k}}}finally{h.removeEventListener("abort",Y),f.releaseLock()}break}catch(b){if(t?.(b),s!==void 0&&p>=s)break;let E=Math.min(O*2**(p-1),a??30000);await w(E)}}}()}}var xe=(e)=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Ae=(e)=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},Ie=(e)=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},L=({allowReserved:e,explode:t,name:r,style:n,value:o})=>{if(!t){let a=(e?o:o.map((u)=>encodeURIComponent(u))).join(Ae(n));switch(n){case"label":return`.${a}`;case"matrix":return`;${r}=${a}`;case"simple":return a;default:return`${r}=${a}`}}let d=xe(n),s=o.map((a)=>{if(n==="label"||n==="simple")return e?a:encodeURIComponent(a);return V({allowReserved:e,name:r,value:a})}).join(d);return n==="label"||n==="matrix"?d+s:s},V=({allowReserved:e,name:t,value:r})=>{if(r===void 0||r===null)return"";if(typeof r==="object")throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?r:encodeURIComponent(r)}`},z=({allowReserved:e,explode:t,name:r,style:n,value:o,valueOnly:d})=>{if(o instanceof Date)return d?o.toISOString():`${r}=${o.toISOString()}`;if(n!=="deepObject"&&!t){let u=[];Object.entries(o).forEach(([c,i])=>{u=[...u,c,e?i:encodeURIComponent(i)]});let S=u.join(",");switch(n){case"form":return`${r}=${S}`;case"label":return`.${S}`;case"matrix":return`;${r}=${S}`;default:return S}}let s=Ie(n),a=Object.entries(o).map(([u,S])=>V({allowReserved:e,name:n==="deepObject"?`${r}[${u}]`:u,value:S})).join(s);return n==="label"||n==="matrix"?s+a:a};var Ve=/\{[^{}]+\}/g,qe=({path:e,url:t})=>{let r=t,n=t.match(Ve);if(n)for(let o of n){let d=!1,s=o.substring(1,o.length-1),a="simple";if(s.endsWith("*"))d=!0,s=s.substring(0,s.length-1);if(s.startsWith("."))s=s.substring(1),a="label";else if(s.startsWith(";"))s=s.substring(1),a="matrix";let u=e[s];if(u===void 0||u===null)continue;if(Array.isArray(u)){r=r.replace(o,L({explode:d,name:s,style:a,value:u}));continue}if(typeof u==="object"){r=r.replace(o,z({explode:d,name:s,style:a,value:u,valueOnly:!0}));continue}if(a==="matrix"){r=r.replace(o,`;${V({name:s,value:u})}`);continue}let S=encodeURIComponent(a==="label"?`.${u}`:u);r=r.replace(o,S)}return r},oe=({baseUrl:e,path:t,query:r,querySerializer:n,url:o})=>{let d=o.startsWith("/")?o:`/${o}`,s=(e??"")+d;if(t)s=qe({path:t,url:s});let a=r?n(r):"";if(a.startsWith("?"))a=a.substring(1);if(a)s+=`?${a}`;return s};function v(e){let t=e.body!==void 0;if(t&&e.bodySerializer){if("serializedBody"in e)return e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null;return e.body!==""?e.body:null}if(t)return e.body;return}var se=async(e,t)=>{let r=typeof t==="function"?await t(e):t;if(!r)return;if(e.scheme==="bearer")return`Bearer ${r}`;if(e.scheme==="basic")return`Basic ${btoa(r)}`;return r};var ie={bodySerializer:(e)=>JSON.stringify(e,(t,r)=>typeof r==="bigint"?r.toString():r)};var ae=({parameters:e={},...t}={})=>(n)=>{let o=[];if(n&&typeof n==="object")for(let d in n){let s=n[d];if(s===void 0||s===null)continue;let a=e[d]||t;if(Array.isArray(s)){let u=L({allowReserved:a.allowReserved,explode:!0,name:d,style:"form",value:s,...a.array});if(u)o.push(u)}else if(typeof s==="object"){let u=z({allowReserved:a.allowReserved,explode:!0,name:d,style:"deepObject",value:s,...a.object});if(u)o.push(u)}else{let u=V({allowReserved:a.allowReserved,name:d,value:s});if(u)o.push(u)}}return o.join("&")},ue=(e)=>{if(!e)return"stream";let t=e.split(";")[0]?.trim();if(!t)return;if(t.startsWith("application/json")||t.endsWith("+json"))return"json";if(t==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some((r)=>t.startsWith(r)))return"blob";if(t.startsWith("text/"))return"text";return},Te=(e,t)=>{if(!t)return!1;if(e.headers.has(t)||e.query?.[t]||e.headers.get("Cookie")?.includes(`${t}=`))return!0;return!1},de=async({security:e,...t})=>{for(let r of e){if(Te(t,r.name))continue;let n=await se(r,t.auth);if(!n)continue;let o=r.name??"Authorization";switch(r.in){case"query":if(!t.query)t.query={};t.query[o]=n;break;case"cookie":t.headers.append("Cookie",`${o}=${n}`);break;case"header":default:t.headers.set(o,n);break}}},B=(e)=>oe({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer==="function"?e.querySerializer:ae(e.querySerializer),url:e.url}),F=(e,t)=>{let r={...e,...t};if(r.baseUrl?.endsWith("/"))r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1);return r.headers=G(e.headers,t.headers),r},Ce=(e)=>{let t=[];return e.forEach((r,n)=>{t.push([n,r])}),t},G=(...e)=>{let t=new Headers;for(let r of e){if(!r)continue;let n=r instanceof Headers?Ce(r):Object.entries(r);for(let[o,d]of n)if(d===null)t.delete(o);else if(Array.isArray(d))for(let s of d)t.append(o,s);else if(d!==void 0)t.set(o,typeof d==="object"?JSON.stringify(d):d)}return t};class W{fns=[];clear(){this.fns=[]}eject(e){let t=this.getInterceptorIndex(e);if(this.fns[t])this.fns[t]=null}exists(e){let t=this.getInterceptorIndex(e);return Boolean(this.fns[t])}getInterceptorIndex(e){if(typeof e==="number")return this.fns[e]?e:-1;return this.fns.indexOf(e)}update(e,t){let r=this.getInterceptorIndex(e);if(this.fns[r])return this.fns[r]=t,e;return!1}use(e){return this.fns.push(e),this.fns.length-1}}var pe=()=>({error:new W,request:new W,response:new W}),Le=ae({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),ze={"Content-Type":"application/json"},T=(e={})=>({...ie,headers:ze,parseAs:"auto",querySerializer:Le,...e});var H=(e={})=>{let t=F(T(),e),r=()=>({...t}),n=(c)=>(t=F(t,c),r()),o=pe(),d=async(c)=>{let i={...t,...c,fetch:c.fetch??t.fetch??globalThis.fetch,headers:G(t.headers,c.headers),serializedBody:void 0};if(i.security)await de({...i,security:i.security});if(i.requestValidator)await i.requestValidator(i);if(i.body!==void 0&&i.bodySerializer)i.serializedBody=i.bodySerializer(i.body);if(i.body===void 0||i.serializedBody==="")i.headers.delete("Content-Type");let w=i,A=B(w);return{opts:w,url:A}},s=async(c)=>{let{opts:i,url:w}=await d(c),A={redirect:"follow",...i,body:v(i)},m=new Request(w,A);for(let l of o.request.fns)if(l)m=await l(m,i);let O=i.fetch,p;try{p=await O(m)}catch(l){let f=l;for(let y of o.error.fns)if(y)f=await y(l,void 0,m,i);if(f=f||{},i.throwOnError)throw f;return i.responseStyle==="data"?void 0:{error:f,request:m,response:void 0}}for(let l of o.response.fns)if(l)p=await l(p,m,i);let h={request:m,response:p};if(p.ok){let l=(i.parseAs==="auto"?ue(p.headers.get("Content-Type")):i.parseAs)??"json";if(p.status===204||p.headers.get("Content-Length")==="0"){let y;switch(l){case"arrayBuffer":case"blob":case"text":y=await p[l]();break;case"formData":y=new FormData;break;case"stream":y=p.body;break;case"json":default:y={};break}return i.responseStyle==="data"?y:{data:y,...h}}let f;switch(l){case"arrayBuffer":case"blob":case"formData":case"text":f=await p[l]();break;case"json":{let y=await p.text();f=y?JSON.parse(y):{};break}case"stream":return i.responseStyle==="data"?p.body:{data:p.body,...h}}if(l==="json"){if(i.responseValidator)await i.responseValidator(f);if(i.responseTransformer)f=await i.responseTransformer(f)}return i.responseStyle==="data"?f:{data:f,...h}}let q=await p.text(),b;try{b=JSON.parse(q)}catch{}let E=b??q,I=E;for(let l of o.error.fns)if(l)I=await l(E,p,m,i);if(I=I||{},i.throwOnError)throw I;return i.responseStyle==="data"?void 0:{error:I,...h}},a=(c)=>(i)=>s({...i,method:c}),u=(c)=>async(i)=>{let{opts:w,url:A}=await d(i);return ne({...w,body:w.body,headers:w.headers,method:c,onRequest:async(m,O)=>{let p=new Request(m,O);for(let h of o.request.fns)if(h)p=await h(p,w);return p},serializedBody:v(w),url:A})};return{buildUrl:(c)=>B({...t,...c}),connect:a("CONNECT"),delete:a("DELETE"),get:a("GET"),getConfig:r,head:a("HEAD"),interceptors:o,options:a("OPTIONS"),patch:a("PATCH"),post:a("POST"),put:a("PUT"),request:s,setConfig:n,sse:{connect:u("CONNECT"),delete:u("DELETE"),get:u("GET"),head:u("HEAD"),options:u("OPTIONS"),patch:u("PATCH"),post:u("POST"),put:u("PUT"),trace:u("TRACE")},trace:a("TRACE")}};var R=H(T());var U=(e)=>(e.client??R).get({security:[{scheme:"bearer",type:"http"}],url:"/studio/agent-runs",...e}),N=(e)=>(e.client??R).get({security:[{scheme:"bearer",type:"http"}],url:"/studio/agent-runs/{runId}",...e}),Q=(e)=>(e.client??R).post({security:[{scheme:"bearer",type:"http"}],url:"/studio/apps/by-slug/{slug}/views/{viewId}/data/{instanceId}/relation-members/search",...e,headers:{"Content-Type":"application/json",...e.headers}}),K=(e)=>(e.client??R).post({security:[{scheme:"bearer",type:"http"}],url:"/studio/apps/by-slug/{slug}/views/{viewId}/data/search",...e,headers:{"Content-Type":"application/json",...e.headers}}),_=(e)=>(e.client??R).get({security:[{scheme:"bearer",type:"http"}],url:"/studio/apps/by-slug/{slug}/views/{viewId}/data/{instanceId}",...e}),J=(e)=>(e.client??R).patch({security:[{scheme:"bearer",type:"http"}],url:"/studio/apps/by-slug/{slug}/views/{viewId}/data/{instanceId}",...e,headers:{"Content-Type":"application/json",...e.headers}}),j=(e)=>(e.client??R).get({security:[{scheme:"bearer",type:"http"}],url:"/studio/workflow-runs",...e}),X=(e)=>(e.client??R).get({security:[{scheme:"bearer",type:"http"}],url:"/studio/workflow-runs/{runId}",...e});var D=(e,t,r,n)=>{let o={_id:e,baseUrl:t?.baseUrl||(t?.client??R).getConfig().baseUrl};if(r)o._infinite=r;if(n)o.tags=n;if(t?.body)o.body=t.body;if(t?.headers)o.headers=t.headers;if(t?.path)o.path=t.path;if(t?.query)o.query=t.query;return[o]},ce=(e)=>D("studioAgentRunsList",e),We=(e)=>x({queryFn:async({queryKey:t,signal:r})=>{let{data:n}=await U({...e,...t[0],signal:r,throwOnError:!0});return n},queryKey:ce(e)}),M=(e,t)=>{let r={...e[0]};if(t.body)r.body={...e[0].body,...t.body};if(t.headers)r.headers={...e[0].headers,...t.headers};if(t.path)r.path={...e[0].path,...t.path};if(t.query)r.query={...e[0].query,...t.query};return r},le=(e)=>D("studioAgentRunsList",e,!0),Ge=(e)=>P({queryFn:async({pageParam:t,queryKey:r,signal:n})=>{let d=M(r,typeof t==="object"?t:{query:{page:t}}),{data:s}=await U({...e,...d,signal:n,throwOnError:!0});return s},queryKey:le(e)}),ye=(e)=>D("studioAgentRunsGet",e),Ue=(e)=>x({queryFn:async({queryKey:t,signal:r})=>{let{data:n}=await N({...e,...t[0],signal:r,throwOnError:!0});return n},queryKey:ye(e)}),fe=(e)=>D("studioViewDataSearchMembers",e),Qe=(e)=>x({queryFn:async({queryKey:t,signal:r})=>{let{data:n}=await Q({...e,...t[0],signal:r,throwOnError:!0});return n},queryKey:fe(e)}),Se=(e)=>D("studioViewDataSearchMembers",e,!0),Ke=(e)=>P({queryFn:async({pageParam:t,queryKey:r,signal:n})=>{let d=M(r,typeof t==="object"?t:{body:{cursor:t}}),{data:s}=await Q({...e,...d,signal:n,throwOnError:!0});return s},queryKey:Se(e)}),we=(e)=>D("studioViewDataSearch",e),je=(e)=>x({queryFn:async({queryKey:t,signal:r})=>{let{data:n}=await K({...e,...t[0],signal:r,throwOnError:!0});return n},queryKey:we(e)}),he=(e)=>D("studioViewDataSearch",e,!0),Pe=(e)=>P({queryFn:async({pageParam:t,queryKey:r,signal:n})=>{let d=M(r,typeof t==="object"?t:{body:{cursor:t}}),{data:s}=await K({...e,...d,signal:n,throwOnError:!0});return s},queryKey:he(e)}),Re=(e)=>D("studioViewDataGetItem",e),Me=(e)=>x({queryFn:async({queryKey:t,signal:r})=>{let{data:n}=await _({...e,...t[0],signal:r,throwOnError:!0});return n},queryKey:Re(e)}),ve=(e)=>({mutationFn:async(r)=>{let{data:n}=await J({...e,...r,throwOnError:!0});return n}}),me=(e)=>D("studioWorkflowRunsList",e),Be=(e)=>x({queryFn:async({queryKey:t,signal:r})=>{let{data:n}=await j({...e,...t[0],signal:r,throwOnError:!0});return n},queryKey:me(e)}),ge=(e)=>D("studioWorkflowRunsList",e,!0),Fe=(e)=>P({queryFn:async({pageParam:t,queryKey:r,signal:n})=>{let d=M(r,typeof t==="object"?t:{query:{page:t}}),{data:s}=await j({...e,...d,signal:n,throwOnError:!0});return s},queryKey:ge(e)}),De=(e)=>D("studioWorkflowRunsGet",e),He=(e)=>x({queryFn:async({queryKey:t,signal:r})=>{let{data:n}=await X({...e,...t[0],signal:r,throwOnError:!0});return n},queryKey:De(e)});export{R as client,N as studioAgentRunsGet,Ue as studioAgentRunsGetOptions,ye as studioAgentRunsGetQueryKey,U as studioAgentRunsList,Ge as studioAgentRunsListInfiniteOptions,le as studioAgentRunsListInfiniteQueryKey,We as studioAgentRunsListOptions,ce as studioAgentRunsListQueryKey,_ as studioViewDataGetItem,Me as studioViewDataGetItemOptions,Re as studioViewDataGetItemQueryKey,K as studioViewDataSearch,Pe as studioViewDataSearchInfiniteOptions,he as studioViewDataSearchInfiniteQueryKey,Q as studioViewDataSearchMembers,Ke as studioViewDataSearchMembersInfiniteOptions,Se as studioViewDataSearchMembersInfiniteQueryKey,Qe as studioViewDataSearchMembersOptions,fe as studioViewDataSearchMembersQueryKey,je as studioViewDataSearchOptions,we as studioViewDataSearchQueryKey,J as studioViewDataUpdateItem,ve as studioViewDataUpdateItemMutation,X as studioWorkflowRunsGet,He as studioWorkflowRunsGetOptions,De as studioWorkflowRunsGetQueryKey,j as studioWorkflowRunsList,Fe as studioWorkflowRunsListInfiniteOptions,ge as studioWorkflowRunsListInfiniteQueryKey,Be as studioWorkflowRunsListOptions,me as studioWorkflowRunsListQueryKey};
|
|
@@ -39,6 +39,26 @@ export type EntityFileFieldConflictDiagnosticEncoded = {
|
|
|
39
39
|
field: string;
|
|
40
40
|
message: string;
|
|
41
41
|
};
|
|
42
|
+
export type EntityRemoteFirstConflictDiagnosticEncoded = {
|
|
43
|
+
_tag: "EntityRemoteFirstConflictDiagnostic";
|
|
44
|
+
code: "remote_first_conflict";
|
|
45
|
+
message: string;
|
|
46
|
+
};
|
|
47
|
+
export type EntityRemoteFirstDiagnosticEncoded = {
|
|
48
|
+
_tag: "EntityRemoteFirstDiagnostic";
|
|
49
|
+
code: "remote_first_refused" | "remote_first_rejected";
|
|
50
|
+
field?: string;
|
|
51
|
+
fieldType?: string;
|
|
52
|
+
message: string;
|
|
53
|
+
refusal?: string;
|
|
54
|
+
remoteCode?: string;
|
|
55
|
+
};
|
|
56
|
+
export type EntityRemoteFirstUnavailableDiagnosticEncoded = {
|
|
57
|
+
_tag: "EntityRemoteFirstUnavailableDiagnostic";
|
|
58
|
+
code: "remote_first_realigning" | "remote_first_unavailable";
|
|
59
|
+
message: string;
|
|
60
|
+
remoteCode?: string;
|
|
61
|
+
};
|
|
42
62
|
export type Suspend4 = null | boolean | number | string | Array<Suspend4> | {
|
|
43
63
|
[key: string]: Suspend4;
|
|
44
64
|
};
|
|
@@ -123,6 +143,7 @@ export type StudioAgentRunsListResponses = {
|
|
|
123
143
|
createdAt: string;
|
|
124
144
|
errorCode: string | null;
|
|
125
145
|
errorMessage: string | null;
|
|
146
|
+
harnessInvocationId: string | null;
|
|
126
147
|
id: string;
|
|
127
148
|
initiator: {
|
|
128
149
|
kind: "user";
|
|
@@ -192,6 +213,7 @@ export type StudioAgentRunsGetResponses = {
|
|
|
192
213
|
createdAt: string;
|
|
193
214
|
errorCode: string | null;
|
|
194
215
|
errorMessage: string | null;
|
|
216
|
+
harnessInvocationId: string | null;
|
|
195
217
|
id: string;
|
|
196
218
|
initiator: {
|
|
197
219
|
kind: "user";
|
|
@@ -387,9 +409,9 @@ export type StudioViewDataUpdateItemData = {
|
|
|
387
409
|
};
|
|
388
410
|
export type StudioViewDataUpdateItemErrors = {
|
|
389
411
|
/**
|
|
390
|
-
* EntityValueDiagnostic | EntityFileFieldDiagnostic | EntityRelationFieldDiagnostic | KnowledgeReadLimitExceeded | KnowledgePageDepthExceeded | BadRequest
|
|
412
|
+
* EntityValueDiagnostic | EntityFileFieldDiagnostic | EntityRelationFieldDiagnostic | EntityRemoteFirstDiagnostic | KnowledgeReadLimitExceeded | KnowledgePageDepthExceeded | BadRequest
|
|
391
413
|
*/
|
|
392
|
-
400: EntityValueDiagnosticEncoded | EntityFileFieldDiagnosticEncoded | EntityRelationFieldDiagnosticEncoded | KnowledgeReadLimitExceededEncoded | KnowledgePageDepthExceededEncoded | EffectHttpApiErrorBadRequestEncoded;
|
|
414
|
+
400: EntityValueDiagnosticEncoded | EntityFileFieldDiagnosticEncoded | EntityRelationFieldDiagnosticEncoded | EntityRemoteFirstDiagnosticEncoded | KnowledgeReadLimitExceededEncoded | KnowledgePageDepthExceededEncoded | EffectHttpApiErrorBadRequestEncoded;
|
|
393
415
|
/**
|
|
394
416
|
* Unauthorized
|
|
395
417
|
*/
|
|
@@ -403,13 +425,17 @@ export type StudioViewDataUpdateItemErrors = {
|
|
|
403
425
|
*/
|
|
404
426
|
404: EffectHttpApiErrorNotFoundEncoded;
|
|
405
427
|
/**
|
|
406
|
-
* EntityUniqueFieldConflictDiagnostic | EntityFileFieldConflictDiagnostic
|
|
428
|
+
* EntityUniqueFieldConflictDiagnostic | EntityFileFieldConflictDiagnostic | EntityRemoteFirstConflictDiagnostic
|
|
407
429
|
*/
|
|
408
|
-
409: EntityUniqueFieldConflictDiagnosticEncoded | EntityFileFieldConflictDiagnosticEncoded;
|
|
430
|
+
409: EntityUniqueFieldConflictDiagnosticEncoded | EntityFileFieldConflictDiagnosticEncoded | EntityRemoteFirstConflictDiagnosticEncoded;
|
|
409
431
|
/**
|
|
410
432
|
* InternalServerError
|
|
411
433
|
*/
|
|
412
434
|
500: EffectHttpApiErrorInternalServerErrorEncoded;
|
|
435
|
+
/**
|
|
436
|
+
* EntityRemoteFirstUnavailableDiagnostic
|
|
437
|
+
*/
|
|
438
|
+
503: EntityRemoteFirstUnavailableDiagnosticEncoded;
|
|
413
439
|
};
|
|
414
440
|
export type StudioViewDataUpdateItemError = StudioViewDataUpdateItemErrors[keyof StudioViewDataUpdateItemErrors];
|
|
415
441
|
export type StudioViewDataUpdateItemResponses = {
|