@sixb/client 0.0.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/LICENSE +21 -0
- package/README.md +193 -0
- package/dist/actions.d.ts +61 -0
- package/dist/actions.d.ts.map +1 -0
- package/dist/agent-streams.d.ts +72 -0
- package/dist/agent-streams.d.ts.map +1 -0
- package/dist/api.d.ts +54 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/browser.d.ts +41 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +174 -0
- package/dist/browser.js.map +10 -0
- package/dist/chunk-05yz32g0.js +240 -0
- package/dist/chunk-05yz32g0.js.map +10 -0
- package/dist/chunk-2d7239yx.js +1181 -0
- package/dist/chunk-2d7239yx.js.map +17 -0
- package/dist/chunk-3g6ad4jc.js +147 -0
- package/dist/chunk-3g6ad4jc.js.map +10 -0
- package/dist/chunk-aw8rcsq3.js +145 -0
- package/dist/chunk-aw8rcsq3.js.map +10 -0
- package/dist/chunk-ctsdm59b.js +1477 -0
- package/dist/chunk-ctsdm59b.js.map +19 -0
- package/dist/chunk-fxrh83wy.js +180 -0
- package/dist/chunk-fxrh83wy.js.map +12 -0
- package/dist/chunk-pey7nh0d.js +123 -0
- package/dist/chunk-pey7nh0d.js.map +10 -0
- package/dist/chunk-trpg18dp.js +3 -0
- package/dist/chunk-trpg18dp.js.map +9 -0
- package/dist/events-builder.d.ts +218 -0
- package/dist/events-builder.d.ts.map +1 -0
- package/dist/events-hooks.d.ts +50 -0
- package/dist/events-hooks.d.ts.map +1 -0
- package/dist/events-model.d.ts +12 -0
- package/dist/events-model.d.ts.map +1 -0
- package/dist/events-provider.d.ts +56 -0
- package/dist/events-provider.d.ts.map +1 -0
- package/dist/events-transport.d.ts +62 -0
- package/dist/events-transport.d.ts.map +1 -0
- package/dist/events.d.ts +5 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/file.d.ts +27 -0
- package/dist/file.d.ts.map +1 -0
- package/dist/generated/@tanstack/react-query.gen.d.ts +17064 -0
- package/dist/generated/@tanstack/react-query.gen.d.ts.map +1 -0
- package/dist/generated/client/client.gen.d.ts +3 -0
- package/dist/generated/client/client.gen.d.ts.map +1 -0
- package/dist/generated/client/index.d.ts +9 -0
- package/dist/generated/client/index.d.ts.map +1 -0
- package/dist/generated/client/types.gen.d.ts +118 -0
- package/dist/generated/client/types.gen.d.ts.map +1 -0
- package/dist/generated/client/utils.gen.d.ts +34 -0
- package/dist/generated/client/utils.gen.d.ts.map +1 -0
- package/dist/generated/client.gen.d.ts +13 -0
- package/dist/generated/client.gen.d.ts.map +1 -0
- package/dist/generated/core/auth.gen.d.ts +19 -0
- package/dist/generated/core/auth.gen.d.ts.map +1 -0
- package/dist/generated/core/bodySerializer.gen.d.ts +26 -0
- package/dist/generated/core/bodySerializer.gen.d.ts.map +1 -0
- package/dist/generated/core/params.gen.d.ts +44 -0
- package/dist/generated/core/params.gen.d.ts.map +1 -0
- package/dist/generated/core/pathSerializer.gen.d.ts +34 -0
- package/dist/generated/core/pathSerializer.gen.d.ts.map +1 -0
- package/dist/generated/core/queryKeySerializer.gen.d.ts +19 -0
- package/dist/generated/core/queryKeySerializer.gen.d.ts.map +1 -0
- package/dist/generated/core/serverSentEvents.gen.d.ts +72 -0
- package/dist/generated/core/serverSentEvents.gen.d.ts.map +1 -0
- package/dist/generated/core/types.gen.d.ts +79 -0
- package/dist/generated/core/types.gen.d.ts.map +1 -0
- package/dist/generated/core/utils.gen.d.ts +20 -0
- package/dist/generated/core/utils.gen.d.ts.map +1 -0
- package/dist/generated/index.d.ts +3 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/sdk.gen.d.ts +464 -0
- package/dist/generated/sdk.gen.d.ts.map +1 -0
- package/dist/generated/types.gen.d.ts +7672 -0
- package/dist/generated/types.gen.d.ts.map +1 -0
- package/dist/hooks.d.ts +123 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +3179 -0
- package/dist/hooks.js.map +16 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +329 -0
- package/dist/index.js.map +9 -0
- package/dist/logs-builder.d.ts +59 -0
- package/dist/logs-builder.d.ts.map +1 -0
- package/dist/logs-hooks.d.ts +30 -0
- package/dist/logs-hooks.d.ts.map +1 -0
- package/dist/logs-transport.d.ts +38 -0
- package/dist/logs-transport.d.ts.map +1 -0
- package/dist/logs.d.ts +7 -0
- package/dist/logs.d.ts.map +1 -0
- package/dist/logs.js +22 -0
- package/dist/logs.js.map +9 -0
- package/dist/models.d.ts +126 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +252 -0
- package/dist/models.js.map +9 -0
- package/dist/query-hooks.d.ts +365 -0
- package/dist/query-hooks.d.ts.map +1 -0
- package/dist/query.d.ts +27 -0
- package/dist/query.d.ts.map +1 -0
- package/dist/query.js +15 -0
- package/dist/query.js.map +9 -0
- package/dist/sha256.d.ts +15 -0
- package/dist/sha256.d.ts.map +1 -0
- package/dist/telemetry-events.d.ts +25 -0
- package/dist/telemetry-events.d.ts.map +1 -0
- package/dist/tsconfig.json +5 -0
- package/dist/useAgentRunStream.d.ts +21 -0
- package/dist/useAgentRunStream.d.ts.map +1 -0
- package/dist/ws-socket.d.ts +45 -0
- package/dist/ws-socket.d.ts.map +1 -0
- package/package.json +105 -0
- package/src/actions.ts +310 -0
- package/src/agent-streams.ts +275 -0
- package/src/api.ts +229 -0
- package/src/browser.ts +267 -0
- package/src/events-builder.ts +735 -0
- package/src/events-hooks.ts +233 -0
- package/src/events-model.ts +40 -0
- package/src/events-provider.ts +161 -0
- package/src/events-transport.ts +193 -0
- package/src/events.ts +6 -0
- package/src/file.ts +367 -0
- package/src/generated/@tanstack/react-query.gen.ts +3876 -0
- package/src/generated/client/client.gen.ts +288 -0
- package/src/generated/client/index.ts +25 -0
- package/src/generated/client/types.gen.ts +209 -0
- package/src/generated/client/utils.gen.ts +316 -0
- package/src/generated/client.gen.ts +18 -0
- package/src/generated/core/auth.gen.ts +41 -0
- package/src/generated/core/bodySerializer.gen.ts +84 -0
- package/src/generated/core/params.gen.ts +169 -0
- package/src/generated/core/pathSerializer.gen.ts +171 -0
- package/src/generated/core/queryKeySerializer.gen.ts +117 -0
- package/src/generated/core/serverSentEvents.gen.ts +243 -0
- package/src/generated/core/types.gen.ts +104 -0
- package/src/generated/core/utils.gen.ts +140 -0
- package/src/generated/index.ts +672 -0
- package/src/generated/sdk.gen.ts +1984 -0
- package/src/generated/types.gen.ts +9049 -0
- package/src/hooks.ts +404 -0
- package/src/index.ts +18 -0
- package/src/logs-builder.ts +171 -0
- package/src/logs-hooks.ts +112 -0
- package/src/logs-transport.ts +112 -0
- package/src/logs.ts +15 -0
- package/src/models.ts +420 -0
- package/src/query-hooks.ts +1021 -0
- package/src/query.ts +175 -0
- package/src/sha256.ts +159 -0
- package/src/telemetry-events.ts +71 -0
- package/src/useAgentRunStream.ts +62 -0
- package/src/ws-socket.ts +202 -0
|
@@ -0,0 +1,3876 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
type DefaultError,
|
|
5
|
+
type InfiniteData,
|
|
6
|
+
infiniteQueryOptions,
|
|
7
|
+
queryOptions,
|
|
8
|
+
type UseMutationOptions,
|
|
9
|
+
} from "@tanstack/react-query"
|
|
10
|
+
|
|
11
|
+
import { client } from "../client.gen"
|
|
12
|
+
import {
|
|
13
|
+
abortFileUpload,
|
|
14
|
+
appendTelemetry,
|
|
15
|
+
cancelAgentRun,
|
|
16
|
+
cancelWorkflowIntervention,
|
|
17
|
+
cancelWorkflowRun,
|
|
18
|
+
completeFileUpload,
|
|
19
|
+
countObjects,
|
|
20
|
+
createAgentThread,
|
|
21
|
+
createAuthInvitation,
|
|
22
|
+
createAuthPersonalAccessToken,
|
|
23
|
+
createAuthServiceAccount,
|
|
24
|
+
createAuthServiceAccountAccessToken,
|
|
25
|
+
createFileUpload,
|
|
26
|
+
disableAuthServiceAccount,
|
|
27
|
+
existsObjects,
|
|
28
|
+
facetObjects,
|
|
29
|
+
getAction,
|
|
30
|
+
getActionRun,
|
|
31
|
+
getActionRunFileContent,
|
|
32
|
+
getAgent,
|
|
33
|
+
getAgentMessageFileContent,
|
|
34
|
+
getAgentRun,
|
|
35
|
+
getAgentThread,
|
|
36
|
+
getAuthAccessManagementOptions,
|
|
37
|
+
getAuthInvitationOptions,
|
|
38
|
+
getAuthMembershipOptions,
|
|
39
|
+
getAuthSession,
|
|
40
|
+
getBulkTelemetryHistory,
|
|
41
|
+
getConnector,
|
|
42
|
+
getDataset,
|
|
43
|
+
getDatasetVersion,
|
|
44
|
+
getLatestTelemetry,
|
|
45
|
+
getObject,
|
|
46
|
+
getObjectFileContent,
|
|
47
|
+
getObjectType,
|
|
48
|
+
getPipeline,
|
|
49
|
+
getPipelineRun,
|
|
50
|
+
getProjectInfo,
|
|
51
|
+
getProjection,
|
|
52
|
+
getProjectionRun,
|
|
53
|
+
getRule,
|
|
54
|
+
getStatus,
|
|
55
|
+
getSync,
|
|
56
|
+
getTelemetryHistory,
|
|
57
|
+
getWorkflow,
|
|
58
|
+
getWorkflowAgentNodeExecution,
|
|
59
|
+
getWorkflowIntervention,
|
|
60
|
+
getWorkflowNodeRunFileContent,
|
|
61
|
+
getWorkflowRun,
|
|
62
|
+
getWorkflowRunFileContent,
|
|
63
|
+
listActionRuns,
|
|
64
|
+
listActions,
|
|
65
|
+
listAgents,
|
|
66
|
+
listAgentThreadMessages,
|
|
67
|
+
listAgentThreadRuns,
|
|
68
|
+
listAgentThreads,
|
|
69
|
+
listAuthAccessTokens,
|
|
70
|
+
listAuthInvitations,
|
|
71
|
+
listAuthMembers,
|
|
72
|
+
listAuthServiceAccountAccessTokens,
|
|
73
|
+
listAuthServiceAccounts,
|
|
74
|
+
listAuthSessions,
|
|
75
|
+
listConnectors,
|
|
76
|
+
listDatasetRows,
|
|
77
|
+
listDatasets,
|
|
78
|
+
listDatasetVersions,
|
|
79
|
+
listEvents,
|
|
80
|
+
listLogs,
|
|
81
|
+
listObjectLinks,
|
|
82
|
+
listObjects,
|
|
83
|
+
listObjectTypes,
|
|
84
|
+
listPipelineRuns,
|
|
85
|
+
listPipelines,
|
|
86
|
+
listProjectionRuns,
|
|
87
|
+
listProjections,
|
|
88
|
+
listRuleStates,
|
|
89
|
+
listRules,
|
|
90
|
+
listSyncRuns,
|
|
91
|
+
listSyncs,
|
|
92
|
+
listWebhookRuns,
|
|
93
|
+
listWorkflowInterventions,
|
|
94
|
+
listWorkflowRuns,
|
|
95
|
+
listWorkflows,
|
|
96
|
+
type Options,
|
|
97
|
+
postAgentThreadMessage,
|
|
98
|
+
queryObjects,
|
|
99
|
+
reactivateAuthMember,
|
|
100
|
+
removeObjectLink,
|
|
101
|
+
requestAction,
|
|
102
|
+
requestPipelineRun,
|
|
103
|
+
requestSyncRun,
|
|
104
|
+
requestWorkflowRun,
|
|
105
|
+
retryAgentRun,
|
|
106
|
+
revokeAuthAccessToken,
|
|
107
|
+
revokeAuthInvitation,
|
|
108
|
+
revokeAuthServiceAccountAccessToken,
|
|
109
|
+
revokeAuthSession,
|
|
110
|
+
searchObjects,
|
|
111
|
+
signFileUploadPart,
|
|
112
|
+
signOut,
|
|
113
|
+
signOutAll,
|
|
114
|
+
submitWorkflowIntervention,
|
|
115
|
+
suspendAuthMember,
|
|
116
|
+
updateAuthMemberGroups,
|
|
117
|
+
uploadFileContent,
|
|
118
|
+
uploadFileRaw,
|
|
119
|
+
upsertObject,
|
|
120
|
+
upsertObjectLink,
|
|
121
|
+
} from "../sdk.gen"
|
|
122
|
+
import type {
|
|
123
|
+
AbortFileUploadData,
|
|
124
|
+
AbortFileUploadError,
|
|
125
|
+
AbortFileUploadResponse,
|
|
126
|
+
AppendTelemetryData,
|
|
127
|
+
AppendTelemetryError,
|
|
128
|
+
AppendTelemetryResponse,
|
|
129
|
+
CancelAgentRunData,
|
|
130
|
+
CancelAgentRunError,
|
|
131
|
+
CancelAgentRunResponse,
|
|
132
|
+
CancelWorkflowInterventionData,
|
|
133
|
+
CancelWorkflowInterventionError,
|
|
134
|
+
CancelWorkflowInterventionResponse,
|
|
135
|
+
CancelWorkflowRunData,
|
|
136
|
+
CancelWorkflowRunError,
|
|
137
|
+
CancelWorkflowRunResponse,
|
|
138
|
+
CompleteFileUploadData,
|
|
139
|
+
CompleteFileUploadError,
|
|
140
|
+
CompleteFileUploadResponse,
|
|
141
|
+
CountObjectsData,
|
|
142
|
+
CountObjectsError,
|
|
143
|
+
CountObjectsResponse,
|
|
144
|
+
CreateAgentThreadData,
|
|
145
|
+
CreateAgentThreadError,
|
|
146
|
+
CreateAgentThreadResponse,
|
|
147
|
+
CreateAuthInvitationData,
|
|
148
|
+
CreateAuthInvitationError,
|
|
149
|
+
CreateAuthInvitationResponse,
|
|
150
|
+
CreateAuthPersonalAccessTokenData,
|
|
151
|
+
CreateAuthPersonalAccessTokenError,
|
|
152
|
+
CreateAuthPersonalAccessTokenResponse,
|
|
153
|
+
CreateAuthServiceAccountAccessTokenData,
|
|
154
|
+
CreateAuthServiceAccountAccessTokenError,
|
|
155
|
+
CreateAuthServiceAccountAccessTokenResponse,
|
|
156
|
+
CreateAuthServiceAccountData,
|
|
157
|
+
CreateAuthServiceAccountError,
|
|
158
|
+
CreateAuthServiceAccountResponse,
|
|
159
|
+
CreateFileUploadData,
|
|
160
|
+
CreateFileUploadError,
|
|
161
|
+
CreateFileUploadResponse,
|
|
162
|
+
DisableAuthServiceAccountData,
|
|
163
|
+
DisableAuthServiceAccountError,
|
|
164
|
+
DisableAuthServiceAccountResponse,
|
|
165
|
+
ExistsObjectsData,
|
|
166
|
+
ExistsObjectsError,
|
|
167
|
+
ExistsObjectsResponse,
|
|
168
|
+
FacetObjectsData,
|
|
169
|
+
FacetObjectsError,
|
|
170
|
+
FacetObjectsResponse,
|
|
171
|
+
GetActionData,
|
|
172
|
+
GetActionError,
|
|
173
|
+
GetActionResponse,
|
|
174
|
+
GetActionRunData,
|
|
175
|
+
GetActionRunError,
|
|
176
|
+
GetActionRunFileContentData,
|
|
177
|
+
GetActionRunFileContentError,
|
|
178
|
+
GetActionRunFileContentResponse,
|
|
179
|
+
GetActionRunResponse,
|
|
180
|
+
GetAgentData,
|
|
181
|
+
GetAgentError,
|
|
182
|
+
GetAgentMessageFileContentData,
|
|
183
|
+
GetAgentMessageFileContentError,
|
|
184
|
+
GetAgentMessageFileContentResponse,
|
|
185
|
+
GetAgentResponse,
|
|
186
|
+
GetAgentRunData,
|
|
187
|
+
GetAgentRunError,
|
|
188
|
+
GetAgentRunResponse,
|
|
189
|
+
GetAgentThreadData,
|
|
190
|
+
GetAgentThreadError,
|
|
191
|
+
GetAgentThreadResponse,
|
|
192
|
+
GetAuthAccessManagementOptionsData,
|
|
193
|
+
GetAuthAccessManagementOptionsError,
|
|
194
|
+
GetAuthAccessManagementOptionsResponse,
|
|
195
|
+
GetAuthInvitationOptionsData,
|
|
196
|
+
GetAuthInvitationOptionsError,
|
|
197
|
+
GetAuthInvitationOptionsResponse,
|
|
198
|
+
GetAuthMembershipOptionsData,
|
|
199
|
+
GetAuthMembershipOptionsError,
|
|
200
|
+
GetAuthMembershipOptionsResponse,
|
|
201
|
+
GetAuthSessionData,
|
|
202
|
+
GetAuthSessionResponse,
|
|
203
|
+
GetBulkTelemetryHistoryData,
|
|
204
|
+
GetBulkTelemetryHistoryError,
|
|
205
|
+
GetBulkTelemetryHistoryResponse,
|
|
206
|
+
GetConnectorData,
|
|
207
|
+
GetConnectorError,
|
|
208
|
+
GetConnectorResponse,
|
|
209
|
+
GetDatasetData,
|
|
210
|
+
GetDatasetError,
|
|
211
|
+
GetDatasetResponse,
|
|
212
|
+
GetDatasetVersionData,
|
|
213
|
+
GetDatasetVersionError,
|
|
214
|
+
GetDatasetVersionResponse,
|
|
215
|
+
GetLatestTelemetryData,
|
|
216
|
+
GetLatestTelemetryError,
|
|
217
|
+
GetLatestTelemetryResponse,
|
|
218
|
+
GetObjectData,
|
|
219
|
+
GetObjectError,
|
|
220
|
+
GetObjectFileContentData,
|
|
221
|
+
GetObjectFileContentError,
|
|
222
|
+
GetObjectFileContentResponse,
|
|
223
|
+
GetObjectResponse,
|
|
224
|
+
GetObjectTypeData,
|
|
225
|
+
GetObjectTypeError,
|
|
226
|
+
GetObjectTypeResponse,
|
|
227
|
+
GetPipelineData,
|
|
228
|
+
GetPipelineError,
|
|
229
|
+
GetPipelineResponse,
|
|
230
|
+
GetPipelineRunData,
|
|
231
|
+
GetPipelineRunError,
|
|
232
|
+
GetPipelineRunResponse,
|
|
233
|
+
GetProjectInfoData,
|
|
234
|
+
GetProjectInfoResponse,
|
|
235
|
+
GetProjectionData,
|
|
236
|
+
GetProjectionError,
|
|
237
|
+
GetProjectionResponse,
|
|
238
|
+
GetProjectionRunData,
|
|
239
|
+
GetProjectionRunError,
|
|
240
|
+
GetProjectionRunResponse,
|
|
241
|
+
GetRuleData,
|
|
242
|
+
GetRuleError,
|
|
243
|
+
GetRuleResponse,
|
|
244
|
+
GetStatusData,
|
|
245
|
+
GetStatusResponse,
|
|
246
|
+
GetSyncData,
|
|
247
|
+
GetSyncError,
|
|
248
|
+
GetSyncResponse,
|
|
249
|
+
GetTelemetryHistoryData,
|
|
250
|
+
GetTelemetryHistoryError,
|
|
251
|
+
GetTelemetryHistoryResponse,
|
|
252
|
+
GetWorkflowAgentNodeExecutionData,
|
|
253
|
+
GetWorkflowAgentNodeExecutionError,
|
|
254
|
+
GetWorkflowAgentNodeExecutionResponse,
|
|
255
|
+
GetWorkflowData,
|
|
256
|
+
GetWorkflowError,
|
|
257
|
+
GetWorkflowInterventionData,
|
|
258
|
+
GetWorkflowInterventionError,
|
|
259
|
+
GetWorkflowInterventionResponse,
|
|
260
|
+
GetWorkflowNodeRunFileContentData,
|
|
261
|
+
GetWorkflowNodeRunFileContentError,
|
|
262
|
+
GetWorkflowNodeRunFileContentResponse,
|
|
263
|
+
GetWorkflowResponse,
|
|
264
|
+
GetWorkflowRunData,
|
|
265
|
+
GetWorkflowRunError,
|
|
266
|
+
GetWorkflowRunFileContentData,
|
|
267
|
+
GetWorkflowRunFileContentError,
|
|
268
|
+
GetWorkflowRunFileContentResponse,
|
|
269
|
+
GetWorkflowRunResponse,
|
|
270
|
+
ListActionRunsData,
|
|
271
|
+
ListActionRunsError,
|
|
272
|
+
ListActionRunsResponse,
|
|
273
|
+
ListActionsData,
|
|
274
|
+
ListActionsResponse,
|
|
275
|
+
ListAgentsData,
|
|
276
|
+
ListAgentsResponse,
|
|
277
|
+
ListAgentThreadMessagesData,
|
|
278
|
+
ListAgentThreadMessagesError,
|
|
279
|
+
ListAgentThreadMessagesResponse,
|
|
280
|
+
ListAgentThreadRunsData,
|
|
281
|
+
ListAgentThreadRunsError,
|
|
282
|
+
ListAgentThreadRunsResponse,
|
|
283
|
+
ListAgentThreadsData,
|
|
284
|
+
ListAgentThreadsError,
|
|
285
|
+
ListAgentThreadsResponse,
|
|
286
|
+
ListAuthAccessTokensData,
|
|
287
|
+
ListAuthAccessTokensError,
|
|
288
|
+
ListAuthAccessTokensResponse,
|
|
289
|
+
ListAuthInvitationsData,
|
|
290
|
+
ListAuthInvitationsError,
|
|
291
|
+
ListAuthInvitationsResponse,
|
|
292
|
+
ListAuthMembersData,
|
|
293
|
+
ListAuthMembersError,
|
|
294
|
+
ListAuthMembersResponse,
|
|
295
|
+
ListAuthServiceAccountAccessTokensData,
|
|
296
|
+
ListAuthServiceAccountAccessTokensError,
|
|
297
|
+
ListAuthServiceAccountAccessTokensResponse,
|
|
298
|
+
ListAuthServiceAccountsData,
|
|
299
|
+
ListAuthServiceAccountsError,
|
|
300
|
+
ListAuthServiceAccountsResponse,
|
|
301
|
+
ListAuthSessionsData,
|
|
302
|
+
ListAuthSessionsError,
|
|
303
|
+
ListAuthSessionsResponse,
|
|
304
|
+
ListConnectorsData,
|
|
305
|
+
ListConnectorsResponse,
|
|
306
|
+
ListDatasetRowsData,
|
|
307
|
+
ListDatasetRowsError,
|
|
308
|
+
ListDatasetRowsResponse,
|
|
309
|
+
ListDatasetsData,
|
|
310
|
+
ListDatasetsError,
|
|
311
|
+
ListDatasetsResponse,
|
|
312
|
+
ListDatasetVersionsData,
|
|
313
|
+
ListDatasetVersionsError,
|
|
314
|
+
ListDatasetVersionsResponse,
|
|
315
|
+
ListEventsData,
|
|
316
|
+
ListEventsError,
|
|
317
|
+
ListEventsResponse,
|
|
318
|
+
ListLogsData,
|
|
319
|
+
ListLogsError,
|
|
320
|
+
ListLogsResponse,
|
|
321
|
+
ListObjectLinksData,
|
|
322
|
+
ListObjectLinksError,
|
|
323
|
+
ListObjectLinksResponse,
|
|
324
|
+
ListObjectsData,
|
|
325
|
+
ListObjectsError,
|
|
326
|
+
ListObjectsResponse,
|
|
327
|
+
ListObjectTypesData,
|
|
328
|
+
ListObjectTypesResponse,
|
|
329
|
+
ListPipelineRunsData,
|
|
330
|
+
ListPipelineRunsError,
|
|
331
|
+
ListPipelineRunsResponse,
|
|
332
|
+
ListPipelinesData,
|
|
333
|
+
ListPipelinesResponse,
|
|
334
|
+
ListProjectionRunsData,
|
|
335
|
+
ListProjectionRunsError,
|
|
336
|
+
ListProjectionRunsResponse,
|
|
337
|
+
ListProjectionsData,
|
|
338
|
+
ListProjectionsResponse,
|
|
339
|
+
ListRuleStatesData,
|
|
340
|
+
ListRuleStatesError,
|
|
341
|
+
ListRuleStatesResponse,
|
|
342
|
+
ListRulesData,
|
|
343
|
+
ListRulesResponse,
|
|
344
|
+
ListSyncRunsData,
|
|
345
|
+
ListSyncRunsError,
|
|
346
|
+
ListSyncRunsResponse,
|
|
347
|
+
ListSyncsData,
|
|
348
|
+
ListSyncsResponse,
|
|
349
|
+
ListWebhookRunsData,
|
|
350
|
+
ListWebhookRunsError,
|
|
351
|
+
ListWebhookRunsResponse,
|
|
352
|
+
ListWorkflowInterventionsData,
|
|
353
|
+
ListWorkflowInterventionsError,
|
|
354
|
+
ListWorkflowInterventionsResponse,
|
|
355
|
+
ListWorkflowRunsData,
|
|
356
|
+
ListWorkflowRunsError,
|
|
357
|
+
ListWorkflowRunsResponse,
|
|
358
|
+
ListWorkflowsData,
|
|
359
|
+
ListWorkflowsResponse,
|
|
360
|
+
PostAgentThreadMessageData,
|
|
361
|
+
PostAgentThreadMessageError,
|
|
362
|
+
PostAgentThreadMessageResponse,
|
|
363
|
+
QueryObjectsData,
|
|
364
|
+
QueryObjectsError,
|
|
365
|
+
QueryObjectsResponse,
|
|
366
|
+
ReactivateAuthMemberData,
|
|
367
|
+
ReactivateAuthMemberError,
|
|
368
|
+
ReactivateAuthMemberResponse,
|
|
369
|
+
RemoveObjectLinkData,
|
|
370
|
+
RemoveObjectLinkError,
|
|
371
|
+
RemoveObjectLinkResponse,
|
|
372
|
+
RequestActionData,
|
|
373
|
+
RequestActionError,
|
|
374
|
+
RequestActionResponse,
|
|
375
|
+
RequestPipelineRunData,
|
|
376
|
+
RequestPipelineRunError,
|
|
377
|
+
RequestPipelineRunResponse,
|
|
378
|
+
RequestSyncRunData,
|
|
379
|
+
RequestSyncRunError,
|
|
380
|
+
RequestSyncRunResponse,
|
|
381
|
+
RequestWorkflowRunData,
|
|
382
|
+
RequestWorkflowRunError,
|
|
383
|
+
RequestWorkflowRunResponse,
|
|
384
|
+
RetryAgentRunData,
|
|
385
|
+
RetryAgentRunError,
|
|
386
|
+
RetryAgentRunResponse,
|
|
387
|
+
RevokeAuthAccessTokenData,
|
|
388
|
+
RevokeAuthAccessTokenError,
|
|
389
|
+
RevokeAuthAccessTokenResponse,
|
|
390
|
+
RevokeAuthInvitationData,
|
|
391
|
+
RevokeAuthInvitationError,
|
|
392
|
+
RevokeAuthInvitationResponse,
|
|
393
|
+
RevokeAuthServiceAccountAccessTokenData,
|
|
394
|
+
RevokeAuthServiceAccountAccessTokenError,
|
|
395
|
+
RevokeAuthServiceAccountAccessTokenResponse,
|
|
396
|
+
RevokeAuthSessionData,
|
|
397
|
+
RevokeAuthSessionError,
|
|
398
|
+
RevokeAuthSessionResponse,
|
|
399
|
+
SearchObjectsData,
|
|
400
|
+
SearchObjectsError,
|
|
401
|
+
SearchObjectsResponse,
|
|
402
|
+
SignFileUploadPartData,
|
|
403
|
+
SignFileUploadPartError,
|
|
404
|
+
SignFileUploadPartResponse,
|
|
405
|
+
SignOutAllData,
|
|
406
|
+
SignOutAllError,
|
|
407
|
+
SignOutAllResponse,
|
|
408
|
+
SignOutData,
|
|
409
|
+
SignOutError,
|
|
410
|
+
SignOutResponse,
|
|
411
|
+
SubmitWorkflowInterventionData,
|
|
412
|
+
SubmitWorkflowInterventionError,
|
|
413
|
+
SubmitWorkflowInterventionResponse,
|
|
414
|
+
SuspendAuthMemberData,
|
|
415
|
+
SuspendAuthMemberError,
|
|
416
|
+
SuspendAuthMemberResponse,
|
|
417
|
+
UpdateAuthMemberGroupsData,
|
|
418
|
+
UpdateAuthMemberGroupsError,
|
|
419
|
+
UpdateAuthMemberGroupsResponse,
|
|
420
|
+
UploadFileContentData,
|
|
421
|
+
UploadFileContentError,
|
|
422
|
+
UploadFileContentResponse,
|
|
423
|
+
UploadFileRawData,
|
|
424
|
+
UploadFileRawError,
|
|
425
|
+
UploadFileRawResponse,
|
|
426
|
+
UpsertObjectData,
|
|
427
|
+
UpsertObjectError,
|
|
428
|
+
UpsertObjectLinkData,
|
|
429
|
+
UpsertObjectLinkError,
|
|
430
|
+
UpsertObjectLinkResponse,
|
|
431
|
+
UpsertObjectResponse,
|
|
432
|
+
} from "../types.gen"
|
|
433
|
+
|
|
434
|
+
export type QueryKey<TOptions extends Options> = [
|
|
435
|
+
Pick<TOptions, "baseUrl" | "body" | "headers" | "path" | "query"> & {
|
|
436
|
+
_id: string
|
|
437
|
+
_infinite?: boolean
|
|
438
|
+
tags?: ReadonlyArray<string>
|
|
439
|
+
},
|
|
440
|
+
]
|
|
441
|
+
|
|
442
|
+
const createQueryKey = <TOptions extends Options>(
|
|
443
|
+
id: string,
|
|
444
|
+
options?: TOptions,
|
|
445
|
+
infinite?: boolean,
|
|
446
|
+
tags?: ReadonlyArray<string>
|
|
447
|
+
): [QueryKey<TOptions>[0]] => {
|
|
448
|
+
const params: QueryKey<TOptions>[0] = {
|
|
449
|
+
_id: id,
|
|
450
|
+
baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl,
|
|
451
|
+
} as QueryKey<TOptions>[0]
|
|
452
|
+
if (infinite) {
|
|
453
|
+
params._infinite = infinite
|
|
454
|
+
}
|
|
455
|
+
if (tags) {
|
|
456
|
+
params.tags = tags
|
|
457
|
+
}
|
|
458
|
+
if (options?.body) {
|
|
459
|
+
params.body = options.body
|
|
460
|
+
}
|
|
461
|
+
if (options?.headers) {
|
|
462
|
+
params.headers = options.headers
|
|
463
|
+
}
|
|
464
|
+
if (options?.path) {
|
|
465
|
+
params.path = options.path
|
|
466
|
+
}
|
|
467
|
+
if (options?.query) {
|
|
468
|
+
params.query = options.query
|
|
469
|
+
}
|
|
470
|
+
return [params]
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
export const getAuthSessionQueryKey = (options?: Options<GetAuthSessionData>) =>
|
|
474
|
+
createQueryKey("getAuthSession", options)
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* Get current auth session
|
|
478
|
+
*/
|
|
479
|
+
export const getAuthSessionOptions = (options?: Options<GetAuthSessionData>) =>
|
|
480
|
+
queryOptions<
|
|
481
|
+
GetAuthSessionResponse,
|
|
482
|
+
DefaultError,
|
|
483
|
+
GetAuthSessionResponse,
|
|
484
|
+
ReturnType<typeof getAuthSessionQueryKey>
|
|
485
|
+
>({
|
|
486
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
487
|
+
const { data } = await getAuthSession({
|
|
488
|
+
...options,
|
|
489
|
+
...queryKey[0],
|
|
490
|
+
signal,
|
|
491
|
+
throwOnError: true,
|
|
492
|
+
})
|
|
493
|
+
return data
|
|
494
|
+
},
|
|
495
|
+
queryKey: getAuthSessionQueryKey(options),
|
|
496
|
+
})
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Sign out current auth session
|
|
500
|
+
*/
|
|
501
|
+
export const signOutMutation = (
|
|
502
|
+
options?: Partial<Options<SignOutData>>
|
|
503
|
+
): UseMutationOptions<SignOutResponse, SignOutError, Options<SignOutData>> => {
|
|
504
|
+
const mutationOptions: UseMutationOptions<SignOutResponse, SignOutError, Options<SignOutData>> = {
|
|
505
|
+
mutationFn: async (fnOptions) => {
|
|
506
|
+
const { data } = await signOut({
|
|
507
|
+
...options,
|
|
508
|
+
...fnOptions,
|
|
509
|
+
throwOnError: true,
|
|
510
|
+
})
|
|
511
|
+
return data
|
|
512
|
+
},
|
|
513
|
+
}
|
|
514
|
+
return mutationOptions
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
export const listAuthSessionsQueryKey = (options?: Options<ListAuthSessionsData>) =>
|
|
518
|
+
createQueryKey("listAuthSessions", options)
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* List active sessions for the current user
|
|
522
|
+
*/
|
|
523
|
+
export const listAuthSessionsOptions = (options?: Options<ListAuthSessionsData>) =>
|
|
524
|
+
queryOptions<
|
|
525
|
+
ListAuthSessionsResponse,
|
|
526
|
+
ListAuthSessionsError,
|
|
527
|
+
ListAuthSessionsResponse,
|
|
528
|
+
ReturnType<typeof listAuthSessionsQueryKey>
|
|
529
|
+
>({
|
|
530
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
531
|
+
const { data } = await listAuthSessions({
|
|
532
|
+
...options,
|
|
533
|
+
...queryKey[0],
|
|
534
|
+
signal,
|
|
535
|
+
throwOnError: true,
|
|
536
|
+
})
|
|
537
|
+
return data
|
|
538
|
+
},
|
|
539
|
+
queryKey: listAuthSessionsQueryKey(options),
|
|
540
|
+
})
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* Revoke one of the current user's sessions
|
|
544
|
+
*/
|
|
545
|
+
export const revokeAuthSessionMutation = (
|
|
546
|
+
options?: Partial<Options<RevokeAuthSessionData>>
|
|
547
|
+
): UseMutationOptions<
|
|
548
|
+
RevokeAuthSessionResponse,
|
|
549
|
+
RevokeAuthSessionError,
|
|
550
|
+
Options<RevokeAuthSessionData>
|
|
551
|
+
> => {
|
|
552
|
+
const mutationOptions: UseMutationOptions<
|
|
553
|
+
RevokeAuthSessionResponse,
|
|
554
|
+
RevokeAuthSessionError,
|
|
555
|
+
Options<RevokeAuthSessionData>
|
|
556
|
+
> = {
|
|
557
|
+
mutationFn: async (fnOptions) => {
|
|
558
|
+
const { data } = await revokeAuthSession({
|
|
559
|
+
...options,
|
|
560
|
+
...fnOptions,
|
|
561
|
+
throwOnError: true,
|
|
562
|
+
})
|
|
563
|
+
return data
|
|
564
|
+
},
|
|
565
|
+
}
|
|
566
|
+
return mutationOptions
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* Sign out the current user everywhere (all devices and apps)
|
|
571
|
+
*/
|
|
572
|
+
export const signOutAllMutation = (
|
|
573
|
+
options?: Partial<Options<SignOutAllData>>
|
|
574
|
+
): UseMutationOptions<SignOutAllResponse, SignOutAllError, Options<SignOutAllData>> => {
|
|
575
|
+
const mutationOptions: UseMutationOptions<
|
|
576
|
+
SignOutAllResponse,
|
|
577
|
+
SignOutAllError,
|
|
578
|
+
Options<SignOutAllData>
|
|
579
|
+
> = {
|
|
580
|
+
mutationFn: async (fnOptions) => {
|
|
581
|
+
const { data } = await signOutAll({
|
|
582
|
+
...options,
|
|
583
|
+
...fnOptions,
|
|
584
|
+
throwOnError: true,
|
|
585
|
+
})
|
|
586
|
+
return data
|
|
587
|
+
},
|
|
588
|
+
}
|
|
589
|
+
return mutationOptions
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
export const getAuthAccessManagementOptionsQueryKey = (
|
|
593
|
+
options?: Options<GetAuthAccessManagementOptionsData>
|
|
594
|
+
) => createQueryKey("getAuthAccessManagementOptions", options)
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* Get auth access-token management options
|
|
598
|
+
*/
|
|
599
|
+
export const getAuthAccessManagementOptionsOptions = (
|
|
600
|
+
options?: Options<GetAuthAccessManagementOptionsData>
|
|
601
|
+
) =>
|
|
602
|
+
queryOptions<
|
|
603
|
+
GetAuthAccessManagementOptionsResponse,
|
|
604
|
+
GetAuthAccessManagementOptionsError,
|
|
605
|
+
GetAuthAccessManagementOptionsResponse,
|
|
606
|
+
ReturnType<typeof getAuthAccessManagementOptionsQueryKey>
|
|
607
|
+
>({
|
|
608
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
609
|
+
const { data } = await getAuthAccessManagementOptions({
|
|
610
|
+
...options,
|
|
611
|
+
...queryKey[0],
|
|
612
|
+
signal,
|
|
613
|
+
throwOnError: true,
|
|
614
|
+
})
|
|
615
|
+
return data
|
|
616
|
+
},
|
|
617
|
+
queryKey: getAuthAccessManagementOptionsQueryKey(options),
|
|
618
|
+
})
|
|
619
|
+
|
|
620
|
+
export const listAuthAccessTokensQueryKey = (options?: Options<ListAuthAccessTokensData>) =>
|
|
621
|
+
createQueryKey("listAuthAccessTokens", options)
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* List personal access tokens for the current user
|
|
625
|
+
*/
|
|
626
|
+
export const listAuthAccessTokensOptions = (options?: Options<ListAuthAccessTokensData>) =>
|
|
627
|
+
queryOptions<
|
|
628
|
+
ListAuthAccessTokensResponse,
|
|
629
|
+
ListAuthAccessTokensError,
|
|
630
|
+
ListAuthAccessTokensResponse,
|
|
631
|
+
ReturnType<typeof listAuthAccessTokensQueryKey>
|
|
632
|
+
>({
|
|
633
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
634
|
+
const { data } = await listAuthAccessTokens({
|
|
635
|
+
...options,
|
|
636
|
+
...queryKey[0],
|
|
637
|
+
signal,
|
|
638
|
+
throwOnError: true,
|
|
639
|
+
})
|
|
640
|
+
return data
|
|
641
|
+
},
|
|
642
|
+
queryKey: listAuthAccessTokensQueryKey(options),
|
|
643
|
+
})
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* Create a personal access token
|
|
647
|
+
*/
|
|
648
|
+
export const createAuthPersonalAccessTokenMutation = (
|
|
649
|
+
options?: Partial<Options<CreateAuthPersonalAccessTokenData>>
|
|
650
|
+
): UseMutationOptions<
|
|
651
|
+
CreateAuthPersonalAccessTokenResponse,
|
|
652
|
+
CreateAuthPersonalAccessTokenError,
|
|
653
|
+
Options<CreateAuthPersonalAccessTokenData>
|
|
654
|
+
> => {
|
|
655
|
+
const mutationOptions: UseMutationOptions<
|
|
656
|
+
CreateAuthPersonalAccessTokenResponse,
|
|
657
|
+
CreateAuthPersonalAccessTokenError,
|
|
658
|
+
Options<CreateAuthPersonalAccessTokenData>
|
|
659
|
+
> = {
|
|
660
|
+
mutationFn: async (fnOptions) => {
|
|
661
|
+
const { data } = await createAuthPersonalAccessToken({
|
|
662
|
+
...options,
|
|
663
|
+
...fnOptions,
|
|
664
|
+
throwOnError: true,
|
|
665
|
+
})
|
|
666
|
+
return data
|
|
667
|
+
},
|
|
668
|
+
}
|
|
669
|
+
return mutationOptions
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
/**
|
|
673
|
+
* Revoke one of the current user's personal access tokens
|
|
674
|
+
*/
|
|
675
|
+
export const revokeAuthAccessTokenMutation = (
|
|
676
|
+
options?: Partial<Options<RevokeAuthAccessTokenData>>
|
|
677
|
+
): UseMutationOptions<
|
|
678
|
+
RevokeAuthAccessTokenResponse,
|
|
679
|
+
RevokeAuthAccessTokenError,
|
|
680
|
+
Options<RevokeAuthAccessTokenData>
|
|
681
|
+
> => {
|
|
682
|
+
const mutationOptions: UseMutationOptions<
|
|
683
|
+
RevokeAuthAccessTokenResponse,
|
|
684
|
+
RevokeAuthAccessTokenError,
|
|
685
|
+
Options<RevokeAuthAccessTokenData>
|
|
686
|
+
> = {
|
|
687
|
+
mutationFn: async (fnOptions) => {
|
|
688
|
+
const { data } = await revokeAuthAccessToken({
|
|
689
|
+
...options,
|
|
690
|
+
...fnOptions,
|
|
691
|
+
throwOnError: true,
|
|
692
|
+
})
|
|
693
|
+
return data
|
|
694
|
+
},
|
|
695
|
+
}
|
|
696
|
+
return mutationOptions
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
export const listAuthServiceAccountsQueryKey = (options?: Options<ListAuthServiceAccountsData>) =>
|
|
700
|
+
createQueryKey("listAuthServiceAccounts", options)
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* List auth service accounts
|
|
704
|
+
*/
|
|
705
|
+
export const listAuthServiceAccountsOptions = (options?: Options<ListAuthServiceAccountsData>) =>
|
|
706
|
+
queryOptions<
|
|
707
|
+
ListAuthServiceAccountsResponse,
|
|
708
|
+
ListAuthServiceAccountsError,
|
|
709
|
+
ListAuthServiceAccountsResponse,
|
|
710
|
+
ReturnType<typeof listAuthServiceAccountsQueryKey>
|
|
711
|
+
>({
|
|
712
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
713
|
+
const { data } = await listAuthServiceAccounts({
|
|
714
|
+
...options,
|
|
715
|
+
...queryKey[0],
|
|
716
|
+
signal,
|
|
717
|
+
throwOnError: true,
|
|
718
|
+
})
|
|
719
|
+
return data
|
|
720
|
+
},
|
|
721
|
+
queryKey: listAuthServiceAccountsQueryKey(options),
|
|
722
|
+
})
|
|
723
|
+
|
|
724
|
+
/**
|
|
725
|
+
* Create an auth service account
|
|
726
|
+
*/
|
|
727
|
+
export const createAuthServiceAccountMutation = (
|
|
728
|
+
options?: Partial<Options<CreateAuthServiceAccountData>>
|
|
729
|
+
): UseMutationOptions<
|
|
730
|
+
CreateAuthServiceAccountResponse,
|
|
731
|
+
CreateAuthServiceAccountError,
|
|
732
|
+
Options<CreateAuthServiceAccountData>
|
|
733
|
+
> => {
|
|
734
|
+
const mutationOptions: UseMutationOptions<
|
|
735
|
+
CreateAuthServiceAccountResponse,
|
|
736
|
+
CreateAuthServiceAccountError,
|
|
737
|
+
Options<CreateAuthServiceAccountData>
|
|
738
|
+
> = {
|
|
739
|
+
mutationFn: async (fnOptions) => {
|
|
740
|
+
const { data } = await createAuthServiceAccount({
|
|
741
|
+
...options,
|
|
742
|
+
...fnOptions,
|
|
743
|
+
throwOnError: true,
|
|
744
|
+
})
|
|
745
|
+
return data
|
|
746
|
+
},
|
|
747
|
+
}
|
|
748
|
+
return mutationOptions
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
/**
|
|
752
|
+
* Disable an auth service account
|
|
753
|
+
*/
|
|
754
|
+
export const disableAuthServiceAccountMutation = (
|
|
755
|
+
options?: Partial<Options<DisableAuthServiceAccountData>>
|
|
756
|
+
): UseMutationOptions<
|
|
757
|
+
DisableAuthServiceAccountResponse,
|
|
758
|
+
DisableAuthServiceAccountError,
|
|
759
|
+
Options<DisableAuthServiceAccountData>
|
|
760
|
+
> => {
|
|
761
|
+
const mutationOptions: UseMutationOptions<
|
|
762
|
+
DisableAuthServiceAccountResponse,
|
|
763
|
+
DisableAuthServiceAccountError,
|
|
764
|
+
Options<DisableAuthServiceAccountData>
|
|
765
|
+
> = {
|
|
766
|
+
mutationFn: async (fnOptions) => {
|
|
767
|
+
const { data } = await disableAuthServiceAccount({
|
|
768
|
+
...options,
|
|
769
|
+
...fnOptions,
|
|
770
|
+
throwOnError: true,
|
|
771
|
+
})
|
|
772
|
+
return data
|
|
773
|
+
},
|
|
774
|
+
}
|
|
775
|
+
return mutationOptions
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
export const listAuthServiceAccountAccessTokensQueryKey = (
|
|
779
|
+
options: Options<ListAuthServiceAccountAccessTokensData>
|
|
780
|
+
) => createQueryKey("listAuthServiceAccountAccessTokens", options)
|
|
781
|
+
|
|
782
|
+
/**
|
|
783
|
+
* List access tokens for an auth service account
|
|
784
|
+
*/
|
|
785
|
+
export const listAuthServiceAccountAccessTokensOptions = (
|
|
786
|
+
options: Options<ListAuthServiceAccountAccessTokensData>
|
|
787
|
+
) =>
|
|
788
|
+
queryOptions<
|
|
789
|
+
ListAuthServiceAccountAccessTokensResponse,
|
|
790
|
+
ListAuthServiceAccountAccessTokensError,
|
|
791
|
+
ListAuthServiceAccountAccessTokensResponse,
|
|
792
|
+
ReturnType<typeof listAuthServiceAccountAccessTokensQueryKey>
|
|
793
|
+
>({
|
|
794
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
795
|
+
const { data } = await listAuthServiceAccountAccessTokens({
|
|
796
|
+
...options,
|
|
797
|
+
...queryKey[0],
|
|
798
|
+
signal,
|
|
799
|
+
throwOnError: true,
|
|
800
|
+
})
|
|
801
|
+
return data
|
|
802
|
+
},
|
|
803
|
+
queryKey: listAuthServiceAccountAccessTokensQueryKey(options),
|
|
804
|
+
})
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* Create an access token for an auth service account
|
|
808
|
+
*/
|
|
809
|
+
export const createAuthServiceAccountAccessTokenMutation = (
|
|
810
|
+
options?: Partial<Options<CreateAuthServiceAccountAccessTokenData>>
|
|
811
|
+
): UseMutationOptions<
|
|
812
|
+
CreateAuthServiceAccountAccessTokenResponse,
|
|
813
|
+
CreateAuthServiceAccountAccessTokenError,
|
|
814
|
+
Options<CreateAuthServiceAccountAccessTokenData>
|
|
815
|
+
> => {
|
|
816
|
+
const mutationOptions: UseMutationOptions<
|
|
817
|
+
CreateAuthServiceAccountAccessTokenResponse,
|
|
818
|
+
CreateAuthServiceAccountAccessTokenError,
|
|
819
|
+
Options<CreateAuthServiceAccountAccessTokenData>
|
|
820
|
+
> = {
|
|
821
|
+
mutationFn: async (fnOptions) => {
|
|
822
|
+
const { data } = await createAuthServiceAccountAccessToken({
|
|
823
|
+
...options,
|
|
824
|
+
...fnOptions,
|
|
825
|
+
throwOnError: true,
|
|
826
|
+
})
|
|
827
|
+
return data
|
|
828
|
+
},
|
|
829
|
+
}
|
|
830
|
+
return mutationOptions
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
/**
|
|
834
|
+
* Revoke an access token for an auth service account
|
|
835
|
+
*/
|
|
836
|
+
export const revokeAuthServiceAccountAccessTokenMutation = (
|
|
837
|
+
options?: Partial<Options<RevokeAuthServiceAccountAccessTokenData>>
|
|
838
|
+
): UseMutationOptions<
|
|
839
|
+
RevokeAuthServiceAccountAccessTokenResponse,
|
|
840
|
+
RevokeAuthServiceAccountAccessTokenError,
|
|
841
|
+
Options<RevokeAuthServiceAccountAccessTokenData>
|
|
842
|
+
> => {
|
|
843
|
+
const mutationOptions: UseMutationOptions<
|
|
844
|
+
RevokeAuthServiceAccountAccessTokenResponse,
|
|
845
|
+
RevokeAuthServiceAccountAccessTokenError,
|
|
846
|
+
Options<RevokeAuthServiceAccountAccessTokenData>
|
|
847
|
+
> = {
|
|
848
|
+
mutationFn: async (fnOptions) => {
|
|
849
|
+
const { data } = await revokeAuthServiceAccountAccessToken({
|
|
850
|
+
...options,
|
|
851
|
+
...fnOptions,
|
|
852
|
+
throwOnError: true,
|
|
853
|
+
})
|
|
854
|
+
return data
|
|
855
|
+
},
|
|
856
|
+
}
|
|
857
|
+
return mutationOptions
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
export const listAuthInvitationsQueryKey = (options?: Options<ListAuthInvitationsData>) =>
|
|
861
|
+
createQueryKey("listAuthInvitations", options)
|
|
862
|
+
|
|
863
|
+
/**
|
|
864
|
+
* List auth invitations
|
|
865
|
+
*/
|
|
866
|
+
export const listAuthInvitationsOptions = (options?: Options<ListAuthInvitationsData>) =>
|
|
867
|
+
queryOptions<
|
|
868
|
+
ListAuthInvitationsResponse,
|
|
869
|
+
ListAuthInvitationsError,
|
|
870
|
+
ListAuthInvitationsResponse,
|
|
871
|
+
ReturnType<typeof listAuthInvitationsQueryKey>
|
|
872
|
+
>({
|
|
873
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
874
|
+
const { data } = await listAuthInvitations({
|
|
875
|
+
...options,
|
|
876
|
+
...queryKey[0],
|
|
877
|
+
signal,
|
|
878
|
+
throwOnError: true,
|
|
879
|
+
})
|
|
880
|
+
return data
|
|
881
|
+
},
|
|
882
|
+
queryKey: listAuthInvitationsQueryKey(options),
|
|
883
|
+
})
|
|
884
|
+
|
|
885
|
+
const createInfiniteParams = <
|
|
886
|
+
K extends Pick<QueryKey<Options>[0], "body" | "headers" | "path" | "query">,
|
|
887
|
+
>(
|
|
888
|
+
queryKey: QueryKey<Options>,
|
|
889
|
+
page: K
|
|
890
|
+
) => {
|
|
891
|
+
const params = { ...queryKey[0] }
|
|
892
|
+
if (page.body) {
|
|
893
|
+
params.body = {
|
|
894
|
+
...(queryKey[0].body as any),
|
|
895
|
+
...(page.body as any),
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
if (page.headers) {
|
|
899
|
+
params.headers = {
|
|
900
|
+
...queryKey[0].headers,
|
|
901
|
+
...page.headers,
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
if (page.path) {
|
|
905
|
+
params.path = {
|
|
906
|
+
...(queryKey[0].path as any),
|
|
907
|
+
...(page.path as any),
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
if (page.query) {
|
|
911
|
+
params.query = {
|
|
912
|
+
...(queryKey[0].query as any),
|
|
913
|
+
...(page.query as any),
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
return params as unknown as typeof page
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
export const listAuthInvitationsInfiniteQueryKey = (
|
|
920
|
+
options?: Options<ListAuthInvitationsData>
|
|
921
|
+
): QueryKey<Options<ListAuthInvitationsData>> =>
|
|
922
|
+
createQueryKey("listAuthInvitations", options, true)
|
|
923
|
+
|
|
924
|
+
/**
|
|
925
|
+
* List auth invitations
|
|
926
|
+
*/
|
|
927
|
+
export const listAuthInvitationsInfiniteOptions = (options?: Options<ListAuthInvitationsData>) =>
|
|
928
|
+
infiniteQueryOptions<
|
|
929
|
+
ListAuthInvitationsResponse,
|
|
930
|
+
ListAuthInvitationsError,
|
|
931
|
+
InfiniteData<ListAuthInvitationsResponse>,
|
|
932
|
+
QueryKey<Options<ListAuthInvitationsData>>,
|
|
933
|
+
| string
|
|
934
|
+
| Pick<QueryKey<Options<ListAuthInvitationsData>>[0], "body" | "headers" | "path" | "query">
|
|
935
|
+
>(
|
|
936
|
+
// @ts-ignore
|
|
937
|
+
{
|
|
938
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
939
|
+
// @ts-ignore
|
|
940
|
+
const page: Pick<
|
|
941
|
+
QueryKey<Options<ListAuthInvitationsData>>[0],
|
|
942
|
+
"body" | "headers" | "path" | "query"
|
|
943
|
+
> =
|
|
944
|
+
typeof pageParam === "object"
|
|
945
|
+
? pageParam
|
|
946
|
+
: {
|
|
947
|
+
query: {
|
|
948
|
+
offset: pageParam,
|
|
949
|
+
},
|
|
950
|
+
}
|
|
951
|
+
const params = createInfiniteParams(queryKey, page)
|
|
952
|
+
const { data } = await listAuthInvitations({
|
|
953
|
+
...options,
|
|
954
|
+
...params,
|
|
955
|
+
signal,
|
|
956
|
+
throwOnError: true,
|
|
957
|
+
})
|
|
958
|
+
return data
|
|
959
|
+
},
|
|
960
|
+
queryKey: listAuthInvitationsInfiniteQueryKey(options),
|
|
961
|
+
}
|
|
962
|
+
)
|
|
963
|
+
|
|
964
|
+
/**
|
|
965
|
+
* Create an auth invitation
|
|
966
|
+
*/
|
|
967
|
+
export const createAuthInvitationMutation = (
|
|
968
|
+
options?: Partial<Options<CreateAuthInvitationData>>
|
|
969
|
+
): UseMutationOptions<
|
|
970
|
+
CreateAuthInvitationResponse,
|
|
971
|
+
CreateAuthInvitationError,
|
|
972
|
+
Options<CreateAuthInvitationData>
|
|
973
|
+
> => {
|
|
974
|
+
const mutationOptions: UseMutationOptions<
|
|
975
|
+
CreateAuthInvitationResponse,
|
|
976
|
+
CreateAuthInvitationError,
|
|
977
|
+
Options<CreateAuthInvitationData>
|
|
978
|
+
> = {
|
|
979
|
+
mutationFn: async (fnOptions) => {
|
|
980
|
+
const { data } = await createAuthInvitation({
|
|
981
|
+
...options,
|
|
982
|
+
...fnOptions,
|
|
983
|
+
throwOnError: true,
|
|
984
|
+
})
|
|
985
|
+
return data
|
|
986
|
+
},
|
|
987
|
+
}
|
|
988
|
+
return mutationOptions
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
export const getAuthInvitationOptionsQueryKey = (options?: Options<GetAuthInvitationOptionsData>) =>
|
|
992
|
+
createQueryKey("getAuthInvitationOptions", options)
|
|
993
|
+
|
|
994
|
+
/**
|
|
995
|
+
* Get auth invitation options
|
|
996
|
+
*/
|
|
997
|
+
export const getAuthInvitationOptionsOptions = (options?: Options<GetAuthInvitationOptionsData>) =>
|
|
998
|
+
queryOptions<
|
|
999
|
+
GetAuthInvitationOptionsResponse,
|
|
1000
|
+
GetAuthInvitationOptionsError,
|
|
1001
|
+
GetAuthInvitationOptionsResponse,
|
|
1002
|
+
ReturnType<typeof getAuthInvitationOptionsQueryKey>
|
|
1003
|
+
>({
|
|
1004
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1005
|
+
const { data } = await getAuthInvitationOptions({
|
|
1006
|
+
...options,
|
|
1007
|
+
...queryKey[0],
|
|
1008
|
+
signal,
|
|
1009
|
+
throwOnError: true,
|
|
1010
|
+
})
|
|
1011
|
+
return data
|
|
1012
|
+
},
|
|
1013
|
+
queryKey: getAuthInvitationOptionsQueryKey(options),
|
|
1014
|
+
})
|
|
1015
|
+
|
|
1016
|
+
/**
|
|
1017
|
+
* Revoke an auth invitation
|
|
1018
|
+
*/
|
|
1019
|
+
export const revokeAuthInvitationMutation = (
|
|
1020
|
+
options?: Partial<Options<RevokeAuthInvitationData>>
|
|
1021
|
+
): UseMutationOptions<
|
|
1022
|
+
RevokeAuthInvitationResponse,
|
|
1023
|
+
RevokeAuthInvitationError,
|
|
1024
|
+
Options<RevokeAuthInvitationData>
|
|
1025
|
+
> => {
|
|
1026
|
+
const mutationOptions: UseMutationOptions<
|
|
1027
|
+
RevokeAuthInvitationResponse,
|
|
1028
|
+
RevokeAuthInvitationError,
|
|
1029
|
+
Options<RevokeAuthInvitationData>
|
|
1030
|
+
> = {
|
|
1031
|
+
mutationFn: async (fnOptions) => {
|
|
1032
|
+
const { data } = await revokeAuthInvitation({
|
|
1033
|
+
...options,
|
|
1034
|
+
...fnOptions,
|
|
1035
|
+
throwOnError: true,
|
|
1036
|
+
})
|
|
1037
|
+
return data
|
|
1038
|
+
},
|
|
1039
|
+
}
|
|
1040
|
+
return mutationOptions
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
export const getAuthMembershipOptionsQueryKey = (options?: Options<GetAuthMembershipOptionsData>) =>
|
|
1044
|
+
createQueryKey("getAuthMembershipOptions", options)
|
|
1045
|
+
|
|
1046
|
+
/**
|
|
1047
|
+
* Get auth membership management options
|
|
1048
|
+
*/
|
|
1049
|
+
export const getAuthMembershipOptionsOptions = (options?: Options<GetAuthMembershipOptionsData>) =>
|
|
1050
|
+
queryOptions<
|
|
1051
|
+
GetAuthMembershipOptionsResponse,
|
|
1052
|
+
GetAuthMembershipOptionsError,
|
|
1053
|
+
GetAuthMembershipOptionsResponse,
|
|
1054
|
+
ReturnType<typeof getAuthMembershipOptionsQueryKey>
|
|
1055
|
+
>({
|
|
1056
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1057
|
+
const { data } = await getAuthMembershipOptions({
|
|
1058
|
+
...options,
|
|
1059
|
+
...queryKey[0],
|
|
1060
|
+
signal,
|
|
1061
|
+
throwOnError: true,
|
|
1062
|
+
})
|
|
1063
|
+
return data
|
|
1064
|
+
},
|
|
1065
|
+
queryKey: getAuthMembershipOptionsQueryKey(options),
|
|
1066
|
+
})
|
|
1067
|
+
|
|
1068
|
+
export const listAuthMembersQueryKey = (options?: Options<ListAuthMembersData>) =>
|
|
1069
|
+
createQueryKey("listAuthMembers", options)
|
|
1070
|
+
|
|
1071
|
+
/**
|
|
1072
|
+
* List auth members
|
|
1073
|
+
*/
|
|
1074
|
+
export const listAuthMembersOptions = (options?: Options<ListAuthMembersData>) =>
|
|
1075
|
+
queryOptions<
|
|
1076
|
+
ListAuthMembersResponse,
|
|
1077
|
+
ListAuthMembersError,
|
|
1078
|
+
ListAuthMembersResponse,
|
|
1079
|
+
ReturnType<typeof listAuthMembersQueryKey>
|
|
1080
|
+
>({
|
|
1081
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1082
|
+
const { data } = await listAuthMembers({
|
|
1083
|
+
...options,
|
|
1084
|
+
...queryKey[0],
|
|
1085
|
+
signal,
|
|
1086
|
+
throwOnError: true,
|
|
1087
|
+
})
|
|
1088
|
+
return data
|
|
1089
|
+
},
|
|
1090
|
+
queryKey: listAuthMembersQueryKey(options),
|
|
1091
|
+
})
|
|
1092
|
+
|
|
1093
|
+
export const listAuthMembersInfiniteQueryKey = (
|
|
1094
|
+
options?: Options<ListAuthMembersData>
|
|
1095
|
+
): QueryKey<Options<ListAuthMembersData>> => createQueryKey("listAuthMembers", options, true)
|
|
1096
|
+
|
|
1097
|
+
/**
|
|
1098
|
+
* List auth members
|
|
1099
|
+
*/
|
|
1100
|
+
export const listAuthMembersInfiniteOptions = (options?: Options<ListAuthMembersData>) =>
|
|
1101
|
+
infiniteQueryOptions<
|
|
1102
|
+
ListAuthMembersResponse,
|
|
1103
|
+
ListAuthMembersError,
|
|
1104
|
+
InfiniteData<ListAuthMembersResponse>,
|
|
1105
|
+
QueryKey<Options<ListAuthMembersData>>,
|
|
1106
|
+
string | Pick<QueryKey<Options<ListAuthMembersData>>[0], "body" | "headers" | "path" | "query">
|
|
1107
|
+
>(
|
|
1108
|
+
// @ts-ignore
|
|
1109
|
+
{
|
|
1110
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
1111
|
+
// @ts-ignore
|
|
1112
|
+
const page: Pick<
|
|
1113
|
+
QueryKey<Options<ListAuthMembersData>>[0],
|
|
1114
|
+
"body" | "headers" | "path" | "query"
|
|
1115
|
+
> =
|
|
1116
|
+
typeof pageParam === "object"
|
|
1117
|
+
? pageParam
|
|
1118
|
+
: {
|
|
1119
|
+
query: {
|
|
1120
|
+
offset: pageParam,
|
|
1121
|
+
},
|
|
1122
|
+
}
|
|
1123
|
+
const params = createInfiniteParams(queryKey, page)
|
|
1124
|
+
const { data } = await listAuthMembers({
|
|
1125
|
+
...options,
|
|
1126
|
+
...params,
|
|
1127
|
+
signal,
|
|
1128
|
+
throwOnError: true,
|
|
1129
|
+
})
|
|
1130
|
+
return data
|
|
1131
|
+
},
|
|
1132
|
+
queryKey: listAuthMembersInfiniteQueryKey(options),
|
|
1133
|
+
}
|
|
1134
|
+
)
|
|
1135
|
+
|
|
1136
|
+
/**
|
|
1137
|
+
* Update an auth member's groups
|
|
1138
|
+
*/
|
|
1139
|
+
export const updateAuthMemberGroupsMutation = (
|
|
1140
|
+
options?: Partial<Options<UpdateAuthMemberGroupsData>>
|
|
1141
|
+
): UseMutationOptions<
|
|
1142
|
+
UpdateAuthMemberGroupsResponse,
|
|
1143
|
+
UpdateAuthMemberGroupsError,
|
|
1144
|
+
Options<UpdateAuthMemberGroupsData>
|
|
1145
|
+
> => {
|
|
1146
|
+
const mutationOptions: UseMutationOptions<
|
|
1147
|
+
UpdateAuthMemberGroupsResponse,
|
|
1148
|
+
UpdateAuthMemberGroupsError,
|
|
1149
|
+
Options<UpdateAuthMemberGroupsData>
|
|
1150
|
+
> = {
|
|
1151
|
+
mutationFn: async (fnOptions) => {
|
|
1152
|
+
const { data } = await updateAuthMemberGroups({
|
|
1153
|
+
...options,
|
|
1154
|
+
...fnOptions,
|
|
1155
|
+
throwOnError: true,
|
|
1156
|
+
})
|
|
1157
|
+
return data
|
|
1158
|
+
},
|
|
1159
|
+
}
|
|
1160
|
+
return mutationOptions
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
/**
|
|
1164
|
+
* Suspend an auth member
|
|
1165
|
+
*/
|
|
1166
|
+
export const suspendAuthMemberMutation = (
|
|
1167
|
+
options?: Partial<Options<SuspendAuthMemberData>>
|
|
1168
|
+
): UseMutationOptions<
|
|
1169
|
+
SuspendAuthMemberResponse,
|
|
1170
|
+
SuspendAuthMemberError,
|
|
1171
|
+
Options<SuspendAuthMemberData>
|
|
1172
|
+
> => {
|
|
1173
|
+
const mutationOptions: UseMutationOptions<
|
|
1174
|
+
SuspendAuthMemberResponse,
|
|
1175
|
+
SuspendAuthMemberError,
|
|
1176
|
+
Options<SuspendAuthMemberData>
|
|
1177
|
+
> = {
|
|
1178
|
+
mutationFn: async (fnOptions) => {
|
|
1179
|
+
const { data } = await suspendAuthMember({
|
|
1180
|
+
...options,
|
|
1181
|
+
...fnOptions,
|
|
1182
|
+
throwOnError: true,
|
|
1183
|
+
})
|
|
1184
|
+
return data
|
|
1185
|
+
},
|
|
1186
|
+
}
|
|
1187
|
+
return mutationOptions
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
/**
|
|
1191
|
+
* Reactivate an auth member
|
|
1192
|
+
*/
|
|
1193
|
+
export const reactivateAuthMemberMutation = (
|
|
1194
|
+
options?: Partial<Options<ReactivateAuthMemberData>>
|
|
1195
|
+
): UseMutationOptions<
|
|
1196
|
+
ReactivateAuthMemberResponse,
|
|
1197
|
+
ReactivateAuthMemberError,
|
|
1198
|
+
Options<ReactivateAuthMemberData>
|
|
1199
|
+
> => {
|
|
1200
|
+
const mutationOptions: UseMutationOptions<
|
|
1201
|
+
ReactivateAuthMemberResponse,
|
|
1202
|
+
ReactivateAuthMemberError,
|
|
1203
|
+
Options<ReactivateAuthMemberData>
|
|
1204
|
+
> = {
|
|
1205
|
+
mutationFn: async (fnOptions) => {
|
|
1206
|
+
const { data } = await reactivateAuthMember({
|
|
1207
|
+
...options,
|
|
1208
|
+
...fnOptions,
|
|
1209
|
+
throwOnError: true,
|
|
1210
|
+
})
|
|
1211
|
+
return data
|
|
1212
|
+
},
|
|
1213
|
+
}
|
|
1214
|
+
return mutationOptions
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
export const getProjectInfoQueryKey = (options?: Options<GetProjectInfoData>) =>
|
|
1218
|
+
createQueryKey("getProjectInfo", options)
|
|
1219
|
+
|
|
1220
|
+
/**
|
|
1221
|
+
* Get current project metadata
|
|
1222
|
+
*/
|
|
1223
|
+
export const getProjectInfoOptions = (options?: Options<GetProjectInfoData>) =>
|
|
1224
|
+
queryOptions<
|
|
1225
|
+
GetProjectInfoResponse,
|
|
1226
|
+
DefaultError,
|
|
1227
|
+
GetProjectInfoResponse,
|
|
1228
|
+
ReturnType<typeof getProjectInfoQueryKey>
|
|
1229
|
+
>({
|
|
1230
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1231
|
+
const { data } = await getProjectInfo({
|
|
1232
|
+
...options,
|
|
1233
|
+
...queryKey[0],
|
|
1234
|
+
signal,
|
|
1235
|
+
throwOnError: true,
|
|
1236
|
+
})
|
|
1237
|
+
return data
|
|
1238
|
+
},
|
|
1239
|
+
queryKey: getProjectInfoQueryKey(options),
|
|
1240
|
+
})
|
|
1241
|
+
|
|
1242
|
+
export const getStatusQueryKey = (options?: Options<GetStatusData>) =>
|
|
1243
|
+
createQueryKey("getStatus", options)
|
|
1244
|
+
|
|
1245
|
+
/**
|
|
1246
|
+
* Get runtime status
|
|
1247
|
+
*/
|
|
1248
|
+
export const getStatusOptions = (options?: Options<GetStatusData>) =>
|
|
1249
|
+
queryOptions<
|
|
1250
|
+
GetStatusResponse,
|
|
1251
|
+
DefaultError,
|
|
1252
|
+
GetStatusResponse,
|
|
1253
|
+
ReturnType<typeof getStatusQueryKey>
|
|
1254
|
+
>({
|
|
1255
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1256
|
+
const { data } = await getStatus({
|
|
1257
|
+
...options,
|
|
1258
|
+
...queryKey[0],
|
|
1259
|
+
signal,
|
|
1260
|
+
throwOnError: true,
|
|
1261
|
+
})
|
|
1262
|
+
return data
|
|
1263
|
+
},
|
|
1264
|
+
queryKey: getStatusQueryKey(options),
|
|
1265
|
+
})
|
|
1266
|
+
|
|
1267
|
+
export const listConnectorsQueryKey = (options?: Options<ListConnectorsData>) =>
|
|
1268
|
+
createQueryKey("listConnectors", options)
|
|
1269
|
+
|
|
1270
|
+
/**
|
|
1271
|
+
* List registered connectors
|
|
1272
|
+
*/
|
|
1273
|
+
export const listConnectorsOptions = (options?: Options<ListConnectorsData>) =>
|
|
1274
|
+
queryOptions<
|
|
1275
|
+
ListConnectorsResponse,
|
|
1276
|
+
DefaultError,
|
|
1277
|
+
ListConnectorsResponse,
|
|
1278
|
+
ReturnType<typeof listConnectorsQueryKey>
|
|
1279
|
+
>({
|
|
1280
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1281
|
+
const { data } = await listConnectors({
|
|
1282
|
+
...options,
|
|
1283
|
+
...queryKey[0],
|
|
1284
|
+
signal,
|
|
1285
|
+
throwOnError: true,
|
|
1286
|
+
})
|
|
1287
|
+
return data
|
|
1288
|
+
},
|
|
1289
|
+
queryKey: listConnectorsQueryKey(options),
|
|
1290
|
+
})
|
|
1291
|
+
|
|
1292
|
+
export const getConnectorQueryKey = (options: Options<GetConnectorData>) =>
|
|
1293
|
+
createQueryKey("getConnector", options)
|
|
1294
|
+
|
|
1295
|
+
/**
|
|
1296
|
+
* Get connector metadata
|
|
1297
|
+
*/
|
|
1298
|
+
export const getConnectorOptions = (options: Options<GetConnectorData>) =>
|
|
1299
|
+
queryOptions<
|
|
1300
|
+
GetConnectorResponse,
|
|
1301
|
+
GetConnectorError,
|
|
1302
|
+
GetConnectorResponse,
|
|
1303
|
+
ReturnType<typeof getConnectorQueryKey>
|
|
1304
|
+
>({
|
|
1305
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1306
|
+
const { data } = await getConnector({
|
|
1307
|
+
...options,
|
|
1308
|
+
...queryKey[0],
|
|
1309
|
+
signal,
|
|
1310
|
+
throwOnError: true,
|
|
1311
|
+
})
|
|
1312
|
+
return data
|
|
1313
|
+
},
|
|
1314
|
+
queryKey: getConnectorQueryKey(options),
|
|
1315
|
+
})
|
|
1316
|
+
|
|
1317
|
+
export const listDatasetsQueryKey = (options?: Options<ListDatasetsData>) =>
|
|
1318
|
+
createQueryKey("listDatasets", options)
|
|
1319
|
+
|
|
1320
|
+
/**
|
|
1321
|
+
* List registered datasets
|
|
1322
|
+
*/
|
|
1323
|
+
export const listDatasetsOptions = (options?: Options<ListDatasetsData>) =>
|
|
1324
|
+
queryOptions<
|
|
1325
|
+
ListDatasetsResponse,
|
|
1326
|
+
ListDatasetsError,
|
|
1327
|
+
ListDatasetsResponse,
|
|
1328
|
+
ReturnType<typeof listDatasetsQueryKey>
|
|
1329
|
+
>({
|
|
1330
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1331
|
+
const { data } = await listDatasets({
|
|
1332
|
+
...options,
|
|
1333
|
+
...queryKey[0],
|
|
1334
|
+
signal,
|
|
1335
|
+
throwOnError: true,
|
|
1336
|
+
})
|
|
1337
|
+
return data
|
|
1338
|
+
},
|
|
1339
|
+
queryKey: listDatasetsQueryKey(options),
|
|
1340
|
+
})
|
|
1341
|
+
|
|
1342
|
+
export const getDatasetQueryKey = (options: Options<GetDatasetData>) =>
|
|
1343
|
+
createQueryKey("getDataset", options)
|
|
1344
|
+
|
|
1345
|
+
/**
|
|
1346
|
+
* Get dataset metadata
|
|
1347
|
+
*/
|
|
1348
|
+
export const getDatasetOptions = (options: Options<GetDatasetData>) =>
|
|
1349
|
+
queryOptions<
|
|
1350
|
+
GetDatasetResponse,
|
|
1351
|
+
GetDatasetError,
|
|
1352
|
+
GetDatasetResponse,
|
|
1353
|
+
ReturnType<typeof getDatasetQueryKey>
|
|
1354
|
+
>({
|
|
1355
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1356
|
+
const { data } = await getDataset({
|
|
1357
|
+
...options,
|
|
1358
|
+
...queryKey[0],
|
|
1359
|
+
signal,
|
|
1360
|
+
throwOnError: true,
|
|
1361
|
+
})
|
|
1362
|
+
return data
|
|
1363
|
+
},
|
|
1364
|
+
queryKey: getDatasetQueryKey(options),
|
|
1365
|
+
})
|
|
1366
|
+
|
|
1367
|
+
export const listDatasetVersionsQueryKey = (options: Options<ListDatasetVersionsData>) =>
|
|
1368
|
+
createQueryKey("listDatasetVersions", options)
|
|
1369
|
+
|
|
1370
|
+
/**
|
|
1371
|
+
* List dataset versions
|
|
1372
|
+
*/
|
|
1373
|
+
export const listDatasetVersionsOptions = (options: Options<ListDatasetVersionsData>) =>
|
|
1374
|
+
queryOptions<
|
|
1375
|
+
ListDatasetVersionsResponse,
|
|
1376
|
+
ListDatasetVersionsError,
|
|
1377
|
+
ListDatasetVersionsResponse,
|
|
1378
|
+
ReturnType<typeof listDatasetVersionsQueryKey>
|
|
1379
|
+
>({
|
|
1380
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1381
|
+
const { data } = await listDatasetVersions({
|
|
1382
|
+
...options,
|
|
1383
|
+
...queryKey[0],
|
|
1384
|
+
signal,
|
|
1385
|
+
throwOnError: true,
|
|
1386
|
+
})
|
|
1387
|
+
return data
|
|
1388
|
+
},
|
|
1389
|
+
queryKey: listDatasetVersionsQueryKey(options),
|
|
1390
|
+
})
|
|
1391
|
+
|
|
1392
|
+
export const getDatasetVersionQueryKey = (options: Options<GetDatasetVersionData>) =>
|
|
1393
|
+
createQueryKey("getDatasetVersion", options)
|
|
1394
|
+
|
|
1395
|
+
/**
|
|
1396
|
+
* Get dataset version
|
|
1397
|
+
*/
|
|
1398
|
+
export const getDatasetVersionOptions = (options: Options<GetDatasetVersionData>) =>
|
|
1399
|
+
queryOptions<
|
|
1400
|
+
GetDatasetVersionResponse,
|
|
1401
|
+
GetDatasetVersionError,
|
|
1402
|
+
GetDatasetVersionResponse,
|
|
1403
|
+
ReturnType<typeof getDatasetVersionQueryKey>
|
|
1404
|
+
>({
|
|
1405
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1406
|
+
const { data } = await getDatasetVersion({
|
|
1407
|
+
...options,
|
|
1408
|
+
...queryKey[0],
|
|
1409
|
+
signal,
|
|
1410
|
+
throwOnError: true,
|
|
1411
|
+
})
|
|
1412
|
+
return data
|
|
1413
|
+
},
|
|
1414
|
+
queryKey: getDatasetVersionQueryKey(options),
|
|
1415
|
+
})
|
|
1416
|
+
|
|
1417
|
+
export const listDatasetRowsQueryKey = (options: Options<ListDatasetRowsData>) =>
|
|
1418
|
+
createQueryKey("listDatasetRows", options)
|
|
1419
|
+
|
|
1420
|
+
/**
|
|
1421
|
+
* Preview dataset rows
|
|
1422
|
+
*/
|
|
1423
|
+
export const listDatasetRowsOptions = (options: Options<ListDatasetRowsData>) =>
|
|
1424
|
+
queryOptions<
|
|
1425
|
+
ListDatasetRowsResponse,
|
|
1426
|
+
ListDatasetRowsError,
|
|
1427
|
+
ListDatasetRowsResponse,
|
|
1428
|
+
ReturnType<typeof listDatasetRowsQueryKey>
|
|
1429
|
+
>({
|
|
1430
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1431
|
+
const { data } = await listDatasetRows({
|
|
1432
|
+
...options,
|
|
1433
|
+
...queryKey[0],
|
|
1434
|
+
signal,
|
|
1435
|
+
throwOnError: true,
|
|
1436
|
+
})
|
|
1437
|
+
return data
|
|
1438
|
+
},
|
|
1439
|
+
queryKey: listDatasetRowsQueryKey(options),
|
|
1440
|
+
})
|
|
1441
|
+
|
|
1442
|
+
export const listDatasetRowsInfiniteQueryKey = (
|
|
1443
|
+
options: Options<ListDatasetRowsData>
|
|
1444
|
+
): QueryKey<Options<ListDatasetRowsData>> => createQueryKey("listDatasetRows", options, true)
|
|
1445
|
+
|
|
1446
|
+
/**
|
|
1447
|
+
* Preview dataset rows
|
|
1448
|
+
*/
|
|
1449
|
+
export const listDatasetRowsInfiniteOptions = (options: Options<ListDatasetRowsData>) =>
|
|
1450
|
+
infiniteQueryOptions<
|
|
1451
|
+
ListDatasetRowsResponse,
|
|
1452
|
+
ListDatasetRowsError,
|
|
1453
|
+
InfiniteData<ListDatasetRowsResponse>,
|
|
1454
|
+
QueryKey<Options<ListDatasetRowsData>>,
|
|
1455
|
+
string | Pick<QueryKey<Options<ListDatasetRowsData>>[0], "body" | "headers" | "path" | "query">
|
|
1456
|
+
>(
|
|
1457
|
+
// @ts-ignore
|
|
1458
|
+
{
|
|
1459
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
1460
|
+
// @ts-ignore
|
|
1461
|
+
const page: Pick<
|
|
1462
|
+
QueryKey<Options<ListDatasetRowsData>>[0],
|
|
1463
|
+
"body" | "headers" | "path" | "query"
|
|
1464
|
+
> =
|
|
1465
|
+
typeof pageParam === "object"
|
|
1466
|
+
? pageParam
|
|
1467
|
+
: {
|
|
1468
|
+
query: {
|
|
1469
|
+
offset: pageParam,
|
|
1470
|
+
},
|
|
1471
|
+
}
|
|
1472
|
+
const params = createInfiniteParams(queryKey, page)
|
|
1473
|
+
const { data } = await listDatasetRows({
|
|
1474
|
+
...options,
|
|
1475
|
+
...params,
|
|
1476
|
+
signal,
|
|
1477
|
+
throwOnError: true,
|
|
1478
|
+
})
|
|
1479
|
+
return data
|
|
1480
|
+
},
|
|
1481
|
+
queryKey: listDatasetRowsInfiniteQueryKey(options),
|
|
1482
|
+
}
|
|
1483
|
+
)
|
|
1484
|
+
|
|
1485
|
+
export const listSyncsQueryKey = (options?: Options<ListSyncsData>) =>
|
|
1486
|
+
createQueryKey("listSyncs", options)
|
|
1487
|
+
|
|
1488
|
+
/**
|
|
1489
|
+
* List registered syncs
|
|
1490
|
+
*/
|
|
1491
|
+
export const listSyncsOptions = (options?: Options<ListSyncsData>) =>
|
|
1492
|
+
queryOptions<
|
|
1493
|
+
ListSyncsResponse,
|
|
1494
|
+
DefaultError,
|
|
1495
|
+
ListSyncsResponse,
|
|
1496
|
+
ReturnType<typeof listSyncsQueryKey>
|
|
1497
|
+
>({
|
|
1498
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1499
|
+
const { data } = await listSyncs({
|
|
1500
|
+
...options,
|
|
1501
|
+
...queryKey[0],
|
|
1502
|
+
signal,
|
|
1503
|
+
throwOnError: true,
|
|
1504
|
+
})
|
|
1505
|
+
return data
|
|
1506
|
+
},
|
|
1507
|
+
queryKey: listSyncsQueryKey(options),
|
|
1508
|
+
})
|
|
1509
|
+
|
|
1510
|
+
export const getSyncQueryKey = (options: Options<GetSyncData>) => createQueryKey("getSync", options)
|
|
1511
|
+
|
|
1512
|
+
/**
|
|
1513
|
+
* Get sync metadata
|
|
1514
|
+
*/
|
|
1515
|
+
export const getSyncOptions = (options: Options<GetSyncData>) =>
|
|
1516
|
+
queryOptions<GetSyncResponse, GetSyncError, GetSyncResponse, ReturnType<typeof getSyncQueryKey>>({
|
|
1517
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1518
|
+
const { data } = await getSync({
|
|
1519
|
+
...options,
|
|
1520
|
+
...queryKey[0],
|
|
1521
|
+
signal,
|
|
1522
|
+
throwOnError: true,
|
|
1523
|
+
})
|
|
1524
|
+
return data
|
|
1525
|
+
},
|
|
1526
|
+
queryKey: getSyncQueryKey(options),
|
|
1527
|
+
})
|
|
1528
|
+
|
|
1529
|
+
export const listSyncRunsQueryKey = (options?: Options<ListSyncRunsData>) =>
|
|
1530
|
+
createQueryKey("listSyncRuns", options)
|
|
1531
|
+
|
|
1532
|
+
/**
|
|
1533
|
+
* List sync run history
|
|
1534
|
+
*/
|
|
1535
|
+
export const listSyncRunsOptions = (options?: Options<ListSyncRunsData>) =>
|
|
1536
|
+
queryOptions<
|
|
1537
|
+
ListSyncRunsResponse,
|
|
1538
|
+
ListSyncRunsError,
|
|
1539
|
+
ListSyncRunsResponse,
|
|
1540
|
+
ReturnType<typeof listSyncRunsQueryKey>
|
|
1541
|
+
>({
|
|
1542
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1543
|
+
const { data } = await listSyncRuns({
|
|
1544
|
+
...options,
|
|
1545
|
+
...queryKey[0],
|
|
1546
|
+
signal,
|
|
1547
|
+
throwOnError: true,
|
|
1548
|
+
})
|
|
1549
|
+
return data
|
|
1550
|
+
},
|
|
1551
|
+
queryKey: listSyncRunsQueryKey(options),
|
|
1552
|
+
})
|
|
1553
|
+
|
|
1554
|
+
export const listSyncRunsInfiniteQueryKey = (
|
|
1555
|
+
options?: Options<ListSyncRunsData>
|
|
1556
|
+
): QueryKey<Options<ListSyncRunsData>> => createQueryKey("listSyncRuns", options, true)
|
|
1557
|
+
|
|
1558
|
+
/**
|
|
1559
|
+
* List sync run history
|
|
1560
|
+
*/
|
|
1561
|
+
export const listSyncRunsInfiniteOptions = (options?: Options<ListSyncRunsData>) =>
|
|
1562
|
+
infiniteQueryOptions<
|
|
1563
|
+
ListSyncRunsResponse,
|
|
1564
|
+
ListSyncRunsError,
|
|
1565
|
+
InfiniteData<ListSyncRunsResponse>,
|
|
1566
|
+
QueryKey<Options<ListSyncRunsData>>,
|
|
1567
|
+
string | Pick<QueryKey<Options<ListSyncRunsData>>[0], "body" | "headers" | "path" | "query">
|
|
1568
|
+
>(
|
|
1569
|
+
// @ts-ignore
|
|
1570
|
+
{
|
|
1571
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
1572
|
+
// @ts-ignore
|
|
1573
|
+
const page: Pick<
|
|
1574
|
+
QueryKey<Options<ListSyncRunsData>>[0],
|
|
1575
|
+
"body" | "headers" | "path" | "query"
|
|
1576
|
+
> =
|
|
1577
|
+
typeof pageParam === "object"
|
|
1578
|
+
? pageParam
|
|
1579
|
+
: {
|
|
1580
|
+
query: {
|
|
1581
|
+
offset: pageParam,
|
|
1582
|
+
},
|
|
1583
|
+
}
|
|
1584
|
+
const params = createInfiniteParams(queryKey, page)
|
|
1585
|
+
const { data } = await listSyncRuns({
|
|
1586
|
+
...options,
|
|
1587
|
+
...params,
|
|
1588
|
+
signal,
|
|
1589
|
+
throwOnError: true,
|
|
1590
|
+
})
|
|
1591
|
+
return data
|
|
1592
|
+
},
|
|
1593
|
+
queryKey: listSyncRunsInfiniteQueryKey(options),
|
|
1594
|
+
}
|
|
1595
|
+
)
|
|
1596
|
+
|
|
1597
|
+
/**
|
|
1598
|
+
* Request a sync run
|
|
1599
|
+
*/
|
|
1600
|
+
export const requestSyncRunMutation = (
|
|
1601
|
+
options?: Partial<Options<RequestSyncRunData>>
|
|
1602
|
+
): UseMutationOptions<RequestSyncRunResponse, RequestSyncRunError, Options<RequestSyncRunData>> => {
|
|
1603
|
+
const mutationOptions: UseMutationOptions<
|
|
1604
|
+
RequestSyncRunResponse,
|
|
1605
|
+
RequestSyncRunError,
|
|
1606
|
+
Options<RequestSyncRunData>
|
|
1607
|
+
> = {
|
|
1608
|
+
mutationFn: async (fnOptions) => {
|
|
1609
|
+
const { data } = await requestSyncRun({
|
|
1610
|
+
...options,
|
|
1611
|
+
...fnOptions,
|
|
1612
|
+
throwOnError: true,
|
|
1613
|
+
})
|
|
1614
|
+
return data
|
|
1615
|
+
},
|
|
1616
|
+
}
|
|
1617
|
+
return mutationOptions
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
export const listPipelinesQueryKey = (options?: Options<ListPipelinesData>) =>
|
|
1621
|
+
createQueryKey("listPipelines", options)
|
|
1622
|
+
|
|
1623
|
+
/**
|
|
1624
|
+
* List registered pipelines
|
|
1625
|
+
*/
|
|
1626
|
+
export const listPipelinesOptions = (options?: Options<ListPipelinesData>) =>
|
|
1627
|
+
queryOptions<
|
|
1628
|
+
ListPipelinesResponse,
|
|
1629
|
+
DefaultError,
|
|
1630
|
+
ListPipelinesResponse,
|
|
1631
|
+
ReturnType<typeof listPipelinesQueryKey>
|
|
1632
|
+
>({
|
|
1633
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1634
|
+
const { data } = await listPipelines({
|
|
1635
|
+
...options,
|
|
1636
|
+
...queryKey[0],
|
|
1637
|
+
signal,
|
|
1638
|
+
throwOnError: true,
|
|
1639
|
+
})
|
|
1640
|
+
return data
|
|
1641
|
+
},
|
|
1642
|
+
queryKey: listPipelinesQueryKey(options),
|
|
1643
|
+
})
|
|
1644
|
+
|
|
1645
|
+
export const getPipelineQueryKey = (options: Options<GetPipelineData>) =>
|
|
1646
|
+
createQueryKey("getPipeline", options)
|
|
1647
|
+
|
|
1648
|
+
/**
|
|
1649
|
+
* Get pipeline metadata
|
|
1650
|
+
*/
|
|
1651
|
+
export const getPipelineOptions = (options: Options<GetPipelineData>) =>
|
|
1652
|
+
queryOptions<
|
|
1653
|
+
GetPipelineResponse,
|
|
1654
|
+
GetPipelineError,
|
|
1655
|
+
GetPipelineResponse,
|
|
1656
|
+
ReturnType<typeof getPipelineQueryKey>
|
|
1657
|
+
>({
|
|
1658
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1659
|
+
const { data } = await getPipeline({
|
|
1660
|
+
...options,
|
|
1661
|
+
...queryKey[0],
|
|
1662
|
+
signal,
|
|
1663
|
+
throwOnError: true,
|
|
1664
|
+
})
|
|
1665
|
+
return data
|
|
1666
|
+
},
|
|
1667
|
+
queryKey: getPipelineQueryKey(options),
|
|
1668
|
+
})
|
|
1669
|
+
|
|
1670
|
+
export const listPipelineRunsQueryKey = (options?: Options<ListPipelineRunsData>) =>
|
|
1671
|
+
createQueryKey("listPipelineRuns", options)
|
|
1672
|
+
|
|
1673
|
+
/**
|
|
1674
|
+
* List pipeline run history
|
|
1675
|
+
*/
|
|
1676
|
+
export const listPipelineRunsOptions = (options?: Options<ListPipelineRunsData>) =>
|
|
1677
|
+
queryOptions<
|
|
1678
|
+
ListPipelineRunsResponse,
|
|
1679
|
+
ListPipelineRunsError,
|
|
1680
|
+
ListPipelineRunsResponse,
|
|
1681
|
+
ReturnType<typeof listPipelineRunsQueryKey>
|
|
1682
|
+
>({
|
|
1683
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1684
|
+
const { data } = await listPipelineRuns({
|
|
1685
|
+
...options,
|
|
1686
|
+
...queryKey[0],
|
|
1687
|
+
signal,
|
|
1688
|
+
throwOnError: true,
|
|
1689
|
+
})
|
|
1690
|
+
return data
|
|
1691
|
+
},
|
|
1692
|
+
queryKey: listPipelineRunsQueryKey(options),
|
|
1693
|
+
})
|
|
1694
|
+
|
|
1695
|
+
export const listPipelineRunsInfiniteQueryKey = (
|
|
1696
|
+
options?: Options<ListPipelineRunsData>
|
|
1697
|
+
): QueryKey<Options<ListPipelineRunsData>> => createQueryKey("listPipelineRuns", options, true)
|
|
1698
|
+
|
|
1699
|
+
/**
|
|
1700
|
+
* List pipeline run history
|
|
1701
|
+
*/
|
|
1702
|
+
export const listPipelineRunsInfiniteOptions = (options?: Options<ListPipelineRunsData>) =>
|
|
1703
|
+
infiniteQueryOptions<
|
|
1704
|
+
ListPipelineRunsResponse,
|
|
1705
|
+
ListPipelineRunsError,
|
|
1706
|
+
InfiniteData<ListPipelineRunsResponse>,
|
|
1707
|
+
QueryKey<Options<ListPipelineRunsData>>,
|
|
1708
|
+
string | Pick<QueryKey<Options<ListPipelineRunsData>>[0], "body" | "headers" | "path" | "query">
|
|
1709
|
+
>(
|
|
1710
|
+
// @ts-ignore
|
|
1711
|
+
{
|
|
1712
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
1713
|
+
// @ts-ignore
|
|
1714
|
+
const page: Pick<
|
|
1715
|
+
QueryKey<Options<ListPipelineRunsData>>[0],
|
|
1716
|
+
"body" | "headers" | "path" | "query"
|
|
1717
|
+
> =
|
|
1718
|
+
typeof pageParam === "object"
|
|
1719
|
+
? pageParam
|
|
1720
|
+
: {
|
|
1721
|
+
query: {
|
|
1722
|
+
offset: pageParam,
|
|
1723
|
+
},
|
|
1724
|
+
}
|
|
1725
|
+
const params = createInfiniteParams(queryKey, page)
|
|
1726
|
+
const { data } = await listPipelineRuns({
|
|
1727
|
+
...options,
|
|
1728
|
+
...params,
|
|
1729
|
+
signal,
|
|
1730
|
+
throwOnError: true,
|
|
1731
|
+
})
|
|
1732
|
+
return data
|
|
1733
|
+
},
|
|
1734
|
+
queryKey: listPipelineRunsInfiniteQueryKey(options),
|
|
1735
|
+
}
|
|
1736
|
+
)
|
|
1737
|
+
|
|
1738
|
+
export const getPipelineRunQueryKey = (options: Options<GetPipelineRunData>) =>
|
|
1739
|
+
createQueryKey("getPipelineRun", options)
|
|
1740
|
+
|
|
1741
|
+
/**
|
|
1742
|
+
* Get pipeline run detail
|
|
1743
|
+
*/
|
|
1744
|
+
export const getPipelineRunOptions = (options: Options<GetPipelineRunData>) =>
|
|
1745
|
+
queryOptions<
|
|
1746
|
+
GetPipelineRunResponse,
|
|
1747
|
+
GetPipelineRunError,
|
|
1748
|
+
GetPipelineRunResponse,
|
|
1749
|
+
ReturnType<typeof getPipelineRunQueryKey>
|
|
1750
|
+
>({
|
|
1751
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1752
|
+
const { data } = await getPipelineRun({
|
|
1753
|
+
...options,
|
|
1754
|
+
...queryKey[0],
|
|
1755
|
+
signal,
|
|
1756
|
+
throwOnError: true,
|
|
1757
|
+
})
|
|
1758
|
+
return data
|
|
1759
|
+
},
|
|
1760
|
+
queryKey: getPipelineRunQueryKey(options),
|
|
1761
|
+
})
|
|
1762
|
+
|
|
1763
|
+
/**
|
|
1764
|
+
* Request a pipeline run
|
|
1765
|
+
*/
|
|
1766
|
+
export const requestPipelineRunMutation = (
|
|
1767
|
+
options?: Partial<Options<RequestPipelineRunData>>
|
|
1768
|
+
): UseMutationOptions<
|
|
1769
|
+
RequestPipelineRunResponse,
|
|
1770
|
+
RequestPipelineRunError,
|
|
1771
|
+
Options<RequestPipelineRunData>
|
|
1772
|
+
> => {
|
|
1773
|
+
const mutationOptions: UseMutationOptions<
|
|
1774
|
+
RequestPipelineRunResponse,
|
|
1775
|
+
RequestPipelineRunError,
|
|
1776
|
+
Options<RequestPipelineRunData>
|
|
1777
|
+
> = {
|
|
1778
|
+
mutationFn: async (fnOptions) => {
|
|
1779
|
+
const { data } = await requestPipelineRun({
|
|
1780
|
+
...options,
|
|
1781
|
+
...fnOptions,
|
|
1782
|
+
throwOnError: true,
|
|
1783
|
+
})
|
|
1784
|
+
return data
|
|
1785
|
+
},
|
|
1786
|
+
}
|
|
1787
|
+
return mutationOptions
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
export const listWorkflowsQueryKey = (options?: Options<ListWorkflowsData>) =>
|
|
1791
|
+
createQueryKey("listWorkflows", options)
|
|
1792
|
+
|
|
1793
|
+
/**
|
|
1794
|
+
* List registered workflows
|
|
1795
|
+
*/
|
|
1796
|
+
export const listWorkflowsOptions = (options?: Options<ListWorkflowsData>) =>
|
|
1797
|
+
queryOptions<
|
|
1798
|
+
ListWorkflowsResponse,
|
|
1799
|
+
DefaultError,
|
|
1800
|
+
ListWorkflowsResponse,
|
|
1801
|
+
ReturnType<typeof listWorkflowsQueryKey>
|
|
1802
|
+
>({
|
|
1803
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1804
|
+
const { data } = await listWorkflows({
|
|
1805
|
+
...options,
|
|
1806
|
+
...queryKey[0],
|
|
1807
|
+
signal,
|
|
1808
|
+
throwOnError: true,
|
|
1809
|
+
})
|
|
1810
|
+
return data
|
|
1811
|
+
},
|
|
1812
|
+
queryKey: listWorkflowsQueryKey(options),
|
|
1813
|
+
})
|
|
1814
|
+
|
|
1815
|
+
export const getWorkflowQueryKey = (options: Options<GetWorkflowData>) =>
|
|
1816
|
+
createQueryKey("getWorkflow", options)
|
|
1817
|
+
|
|
1818
|
+
/**
|
|
1819
|
+
* Get workflow metadata
|
|
1820
|
+
*/
|
|
1821
|
+
export const getWorkflowOptions = (options: Options<GetWorkflowData>) =>
|
|
1822
|
+
queryOptions<
|
|
1823
|
+
GetWorkflowResponse,
|
|
1824
|
+
GetWorkflowError,
|
|
1825
|
+
GetWorkflowResponse,
|
|
1826
|
+
ReturnType<typeof getWorkflowQueryKey>
|
|
1827
|
+
>({
|
|
1828
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1829
|
+
const { data } = await getWorkflow({
|
|
1830
|
+
...options,
|
|
1831
|
+
...queryKey[0],
|
|
1832
|
+
signal,
|
|
1833
|
+
throwOnError: true,
|
|
1834
|
+
})
|
|
1835
|
+
return data
|
|
1836
|
+
},
|
|
1837
|
+
queryKey: getWorkflowQueryKey(options),
|
|
1838
|
+
})
|
|
1839
|
+
|
|
1840
|
+
export const listWorkflowInterventionsQueryKey = (
|
|
1841
|
+
options?: Options<ListWorkflowInterventionsData>
|
|
1842
|
+
) => createQueryKey("listWorkflowInterventions", options)
|
|
1843
|
+
|
|
1844
|
+
/**
|
|
1845
|
+
* List workflow interventions
|
|
1846
|
+
*/
|
|
1847
|
+
export const listWorkflowInterventionsOptions = (
|
|
1848
|
+
options?: Options<ListWorkflowInterventionsData>
|
|
1849
|
+
) =>
|
|
1850
|
+
queryOptions<
|
|
1851
|
+
ListWorkflowInterventionsResponse,
|
|
1852
|
+
ListWorkflowInterventionsError,
|
|
1853
|
+
ListWorkflowInterventionsResponse,
|
|
1854
|
+
ReturnType<typeof listWorkflowInterventionsQueryKey>
|
|
1855
|
+
>({
|
|
1856
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1857
|
+
const { data } = await listWorkflowInterventions({
|
|
1858
|
+
...options,
|
|
1859
|
+
...queryKey[0],
|
|
1860
|
+
signal,
|
|
1861
|
+
throwOnError: true,
|
|
1862
|
+
})
|
|
1863
|
+
return data
|
|
1864
|
+
},
|
|
1865
|
+
queryKey: listWorkflowInterventionsQueryKey(options),
|
|
1866
|
+
})
|
|
1867
|
+
|
|
1868
|
+
export const listWorkflowInterventionsInfiniteQueryKey = (
|
|
1869
|
+
options?: Options<ListWorkflowInterventionsData>
|
|
1870
|
+
): QueryKey<Options<ListWorkflowInterventionsData>> =>
|
|
1871
|
+
createQueryKey("listWorkflowInterventions", options, true)
|
|
1872
|
+
|
|
1873
|
+
/**
|
|
1874
|
+
* List workflow interventions
|
|
1875
|
+
*/
|
|
1876
|
+
export const listWorkflowInterventionsInfiniteOptions = (
|
|
1877
|
+
options?: Options<ListWorkflowInterventionsData>
|
|
1878
|
+
) =>
|
|
1879
|
+
infiniteQueryOptions<
|
|
1880
|
+
ListWorkflowInterventionsResponse,
|
|
1881
|
+
ListWorkflowInterventionsError,
|
|
1882
|
+
InfiniteData<ListWorkflowInterventionsResponse>,
|
|
1883
|
+
QueryKey<Options<ListWorkflowInterventionsData>>,
|
|
1884
|
+
| string
|
|
1885
|
+
| Pick<
|
|
1886
|
+
QueryKey<Options<ListWorkflowInterventionsData>>[0],
|
|
1887
|
+
"body" | "headers" | "path" | "query"
|
|
1888
|
+
>
|
|
1889
|
+
>(
|
|
1890
|
+
// @ts-ignore
|
|
1891
|
+
{
|
|
1892
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
1893
|
+
// @ts-ignore
|
|
1894
|
+
const page: Pick<
|
|
1895
|
+
QueryKey<Options<ListWorkflowInterventionsData>>[0],
|
|
1896
|
+
"body" | "headers" | "path" | "query"
|
|
1897
|
+
> =
|
|
1898
|
+
typeof pageParam === "object"
|
|
1899
|
+
? pageParam
|
|
1900
|
+
: {
|
|
1901
|
+
query: {
|
|
1902
|
+
offset: pageParam,
|
|
1903
|
+
},
|
|
1904
|
+
}
|
|
1905
|
+
const params = createInfiniteParams(queryKey, page)
|
|
1906
|
+
const { data } = await listWorkflowInterventions({
|
|
1907
|
+
...options,
|
|
1908
|
+
...params,
|
|
1909
|
+
signal,
|
|
1910
|
+
throwOnError: true,
|
|
1911
|
+
})
|
|
1912
|
+
return data
|
|
1913
|
+
},
|
|
1914
|
+
queryKey: listWorkflowInterventionsInfiniteQueryKey(options),
|
|
1915
|
+
}
|
|
1916
|
+
)
|
|
1917
|
+
|
|
1918
|
+
export const getWorkflowInterventionQueryKey = (options: Options<GetWorkflowInterventionData>) =>
|
|
1919
|
+
createQueryKey("getWorkflowIntervention", options)
|
|
1920
|
+
|
|
1921
|
+
/**
|
|
1922
|
+
* Get workflow intervention detail
|
|
1923
|
+
*/
|
|
1924
|
+
export const getWorkflowInterventionOptions = (options: Options<GetWorkflowInterventionData>) =>
|
|
1925
|
+
queryOptions<
|
|
1926
|
+
GetWorkflowInterventionResponse,
|
|
1927
|
+
GetWorkflowInterventionError,
|
|
1928
|
+
GetWorkflowInterventionResponse,
|
|
1929
|
+
ReturnType<typeof getWorkflowInterventionQueryKey>
|
|
1930
|
+
>({
|
|
1931
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1932
|
+
const { data } = await getWorkflowIntervention({
|
|
1933
|
+
...options,
|
|
1934
|
+
...queryKey[0],
|
|
1935
|
+
signal,
|
|
1936
|
+
throwOnError: true,
|
|
1937
|
+
})
|
|
1938
|
+
return data
|
|
1939
|
+
},
|
|
1940
|
+
queryKey: getWorkflowInterventionQueryKey(options),
|
|
1941
|
+
})
|
|
1942
|
+
|
|
1943
|
+
/**
|
|
1944
|
+
* Submit a workflow intervention response
|
|
1945
|
+
*/
|
|
1946
|
+
export const submitWorkflowInterventionMutation = (
|
|
1947
|
+
options?: Partial<Options<SubmitWorkflowInterventionData>>
|
|
1948
|
+
): UseMutationOptions<
|
|
1949
|
+
SubmitWorkflowInterventionResponse,
|
|
1950
|
+
SubmitWorkflowInterventionError,
|
|
1951
|
+
Options<SubmitWorkflowInterventionData>
|
|
1952
|
+
> => {
|
|
1953
|
+
const mutationOptions: UseMutationOptions<
|
|
1954
|
+
SubmitWorkflowInterventionResponse,
|
|
1955
|
+
SubmitWorkflowInterventionError,
|
|
1956
|
+
Options<SubmitWorkflowInterventionData>
|
|
1957
|
+
> = {
|
|
1958
|
+
mutationFn: async (fnOptions) => {
|
|
1959
|
+
const { data } = await submitWorkflowIntervention({
|
|
1960
|
+
...options,
|
|
1961
|
+
...fnOptions,
|
|
1962
|
+
throwOnError: true,
|
|
1963
|
+
})
|
|
1964
|
+
return data
|
|
1965
|
+
},
|
|
1966
|
+
}
|
|
1967
|
+
return mutationOptions
|
|
1968
|
+
}
|
|
1969
|
+
|
|
1970
|
+
/**
|
|
1971
|
+
* Cancel a workflow intervention
|
|
1972
|
+
*/
|
|
1973
|
+
export const cancelWorkflowInterventionMutation = (
|
|
1974
|
+
options?: Partial<Options<CancelWorkflowInterventionData>>
|
|
1975
|
+
): UseMutationOptions<
|
|
1976
|
+
CancelWorkflowInterventionResponse,
|
|
1977
|
+
CancelWorkflowInterventionError,
|
|
1978
|
+
Options<CancelWorkflowInterventionData>
|
|
1979
|
+
> => {
|
|
1980
|
+
const mutationOptions: UseMutationOptions<
|
|
1981
|
+
CancelWorkflowInterventionResponse,
|
|
1982
|
+
CancelWorkflowInterventionError,
|
|
1983
|
+
Options<CancelWorkflowInterventionData>
|
|
1984
|
+
> = {
|
|
1985
|
+
mutationFn: async (fnOptions) => {
|
|
1986
|
+
const { data } = await cancelWorkflowIntervention({
|
|
1987
|
+
...options,
|
|
1988
|
+
...fnOptions,
|
|
1989
|
+
throwOnError: true,
|
|
1990
|
+
})
|
|
1991
|
+
return data
|
|
1992
|
+
},
|
|
1993
|
+
}
|
|
1994
|
+
return mutationOptions
|
|
1995
|
+
}
|
|
1996
|
+
|
|
1997
|
+
export const listWorkflowRunsQueryKey = (options?: Options<ListWorkflowRunsData>) =>
|
|
1998
|
+
createQueryKey("listWorkflowRuns", options)
|
|
1999
|
+
|
|
2000
|
+
/**
|
|
2001
|
+
* List workflow run history
|
|
2002
|
+
*/
|
|
2003
|
+
export const listWorkflowRunsOptions = (options?: Options<ListWorkflowRunsData>) =>
|
|
2004
|
+
queryOptions<
|
|
2005
|
+
ListWorkflowRunsResponse,
|
|
2006
|
+
ListWorkflowRunsError,
|
|
2007
|
+
ListWorkflowRunsResponse,
|
|
2008
|
+
ReturnType<typeof listWorkflowRunsQueryKey>
|
|
2009
|
+
>({
|
|
2010
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2011
|
+
const { data } = await listWorkflowRuns({
|
|
2012
|
+
...options,
|
|
2013
|
+
...queryKey[0],
|
|
2014
|
+
signal,
|
|
2015
|
+
throwOnError: true,
|
|
2016
|
+
})
|
|
2017
|
+
return data
|
|
2018
|
+
},
|
|
2019
|
+
queryKey: listWorkflowRunsQueryKey(options),
|
|
2020
|
+
})
|
|
2021
|
+
|
|
2022
|
+
export const listWorkflowRunsInfiniteQueryKey = (
|
|
2023
|
+
options?: Options<ListWorkflowRunsData>
|
|
2024
|
+
): QueryKey<Options<ListWorkflowRunsData>> => createQueryKey("listWorkflowRuns", options, true)
|
|
2025
|
+
|
|
2026
|
+
/**
|
|
2027
|
+
* List workflow run history
|
|
2028
|
+
*/
|
|
2029
|
+
export const listWorkflowRunsInfiniteOptions = (options?: Options<ListWorkflowRunsData>) =>
|
|
2030
|
+
infiniteQueryOptions<
|
|
2031
|
+
ListWorkflowRunsResponse,
|
|
2032
|
+
ListWorkflowRunsError,
|
|
2033
|
+
InfiniteData<ListWorkflowRunsResponse>,
|
|
2034
|
+
QueryKey<Options<ListWorkflowRunsData>>,
|
|
2035
|
+
string | Pick<QueryKey<Options<ListWorkflowRunsData>>[0], "body" | "headers" | "path" | "query">
|
|
2036
|
+
>(
|
|
2037
|
+
// @ts-ignore
|
|
2038
|
+
{
|
|
2039
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
2040
|
+
// @ts-ignore
|
|
2041
|
+
const page: Pick<
|
|
2042
|
+
QueryKey<Options<ListWorkflowRunsData>>[0],
|
|
2043
|
+
"body" | "headers" | "path" | "query"
|
|
2044
|
+
> =
|
|
2045
|
+
typeof pageParam === "object"
|
|
2046
|
+
? pageParam
|
|
2047
|
+
: {
|
|
2048
|
+
query: {
|
|
2049
|
+
offset: pageParam,
|
|
2050
|
+
},
|
|
2051
|
+
}
|
|
2052
|
+
const params = createInfiniteParams(queryKey, page)
|
|
2053
|
+
const { data } = await listWorkflowRuns({
|
|
2054
|
+
...options,
|
|
2055
|
+
...params,
|
|
2056
|
+
signal,
|
|
2057
|
+
throwOnError: true,
|
|
2058
|
+
})
|
|
2059
|
+
return data
|
|
2060
|
+
},
|
|
2061
|
+
queryKey: listWorkflowRunsInfiniteQueryKey(options),
|
|
2062
|
+
}
|
|
2063
|
+
)
|
|
2064
|
+
|
|
2065
|
+
export const getWorkflowRunQueryKey = (options: Options<GetWorkflowRunData>) =>
|
|
2066
|
+
createQueryKey("getWorkflowRun", options)
|
|
2067
|
+
|
|
2068
|
+
/**
|
|
2069
|
+
* Get workflow run detail
|
|
2070
|
+
*/
|
|
2071
|
+
export const getWorkflowRunOptions = (options: Options<GetWorkflowRunData>) =>
|
|
2072
|
+
queryOptions<
|
|
2073
|
+
GetWorkflowRunResponse,
|
|
2074
|
+
GetWorkflowRunError,
|
|
2075
|
+
GetWorkflowRunResponse,
|
|
2076
|
+
ReturnType<typeof getWorkflowRunQueryKey>
|
|
2077
|
+
>({
|
|
2078
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2079
|
+
const { data } = await getWorkflowRun({
|
|
2080
|
+
...options,
|
|
2081
|
+
...queryKey[0],
|
|
2082
|
+
signal,
|
|
2083
|
+
throwOnError: true,
|
|
2084
|
+
})
|
|
2085
|
+
return data
|
|
2086
|
+
},
|
|
2087
|
+
queryKey: getWorkflowRunQueryKey(options),
|
|
2088
|
+
})
|
|
2089
|
+
|
|
2090
|
+
export const getWorkflowAgentNodeExecutionQueryKey = (
|
|
2091
|
+
options: Options<GetWorkflowAgentNodeExecutionData>
|
|
2092
|
+
) => createQueryKey("getWorkflowAgentNodeExecution", options)
|
|
2093
|
+
|
|
2094
|
+
/**
|
|
2095
|
+
* Get workflow agent node execution detail
|
|
2096
|
+
*/
|
|
2097
|
+
export const getWorkflowAgentNodeExecutionOptions = (
|
|
2098
|
+
options: Options<GetWorkflowAgentNodeExecutionData>
|
|
2099
|
+
) =>
|
|
2100
|
+
queryOptions<
|
|
2101
|
+
GetWorkflowAgentNodeExecutionResponse,
|
|
2102
|
+
GetWorkflowAgentNodeExecutionError,
|
|
2103
|
+
GetWorkflowAgentNodeExecutionResponse,
|
|
2104
|
+
ReturnType<typeof getWorkflowAgentNodeExecutionQueryKey>
|
|
2105
|
+
>({
|
|
2106
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2107
|
+
const { data } = await getWorkflowAgentNodeExecution({
|
|
2108
|
+
...options,
|
|
2109
|
+
...queryKey[0],
|
|
2110
|
+
signal,
|
|
2111
|
+
throwOnError: true,
|
|
2112
|
+
})
|
|
2113
|
+
return data
|
|
2114
|
+
},
|
|
2115
|
+
queryKey: getWorkflowAgentNodeExecutionQueryKey(options),
|
|
2116
|
+
})
|
|
2117
|
+
|
|
2118
|
+
/**
|
|
2119
|
+
* Cancel a workflow run
|
|
2120
|
+
*/
|
|
2121
|
+
export const cancelWorkflowRunMutation = (
|
|
2122
|
+
options?: Partial<Options<CancelWorkflowRunData>>
|
|
2123
|
+
): UseMutationOptions<
|
|
2124
|
+
CancelWorkflowRunResponse,
|
|
2125
|
+
CancelWorkflowRunError,
|
|
2126
|
+
Options<CancelWorkflowRunData>
|
|
2127
|
+
> => {
|
|
2128
|
+
const mutationOptions: UseMutationOptions<
|
|
2129
|
+
CancelWorkflowRunResponse,
|
|
2130
|
+
CancelWorkflowRunError,
|
|
2131
|
+
Options<CancelWorkflowRunData>
|
|
2132
|
+
> = {
|
|
2133
|
+
mutationFn: async (fnOptions) => {
|
|
2134
|
+
const { data } = await cancelWorkflowRun({
|
|
2135
|
+
...options,
|
|
2136
|
+
...fnOptions,
|
|
2137
|
+
throwOnError: true,
|
|
2138
|
+
})
|
|
2139
|
+
return data
|
|
2140
|
+
},
|
|
2141
|
+
}
|
|
2142
|
+
return mutationOptions
|
|
2143
|
+
}
|
|
2144
|
+
|
|
2145
|
+
export const getWorkflowRunFileContentQueryKey = (
|
|
2146
|
+
options: Options<GetWorkflowRunFileContentData>
|
|
2147
|
+
) => createQueryKey("getWorkflowRunFileContent", options)
|
|
2148
|
+
|
|
2149
|
+
/**
|
|
2150
|
+
* Get workflow run file content
|
|
2151
|
+
*/
|
|
2152
|
+
export const getWorkflowRunFileContentOptions = (options: Options<GetWorkflowRunFileContentData>) =>
|
|
2153
|
+
queryOptions<
|
|
2154
|
+
GetWorkflowRunFileContentResponse,
|
|
2155
|
+
GetWorkflowRunFileContentError,
|
|
2156
|
+
GetWorkflowRunFileContentResponse,
|
|
2157
|
+
ReturnType<typeof getWorkflowRunFileContentQueryKey>
|
|
2158
|
+
>({
|
|
2159
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2160
|
+
const { data } = await getWorkflowRunFileContent({
|
|
2161
|
+
...options,
|
|
2162
|
+
...queryKey[0],
|
|
2163
|
+
signal,
|
|
2164
|
+
throwOnError: true,
|
|
2165
|
+
})
|
|
2166
|
+
return data
|
|
2167
|
+
},
|
|
2168
|
+
queryKey: getWorkflowRunFileContentQueryKey(options),
|
|
2169
|
+
})
|
|
2170
|
+
|
|
2171
|
+
export const getWorkflowNodeRunFileContentQueryKey = (
|
|
2172
|
+
options: Options<GetWorkflowNodeRunFileContentData>
|
|
2173
|
+
) => createQueryKey("getWorkflowNodeRunFileContent", options)
|
|
2174
|
+
|
|
2175
|
+
/**
|
|
2176
|
+
* Get workflow node run file content
|
|
2177
|
+
*/
|
|
2178
|
+
export const getWorkflowNodeRunFileContentOptions = (
|
|
2179
|
+
options: Options<GetWorkflowNodeRunFileContentData>
|
|
2180
|
+
) =>
|
|
2181
|
+
queryOptions<
|
|
2182
|
+
GetWorkflowNodeRunFileContentResponse,
|
|
2183
|
+
GetWorkflowNodeRunFileContentError,
|
|
2184
|
+
GetWorkflowNodeRunFileContentResponse,
|
|
2185
|
+
ReturnType<typeof getWorkflowNodeRunFileContentQueryKey>
|
|
2186
|
+
>({
|
|
2187
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2188
|
+
const { data } = await getWorkflowNodeRunFileContent({
|
|
2189
|
+
...options,
|
|
2190
|
+
...queryKey[0],
|
|
2191
|
+
signal,
|
|
2192
|
+
throwOnError: true,
|
|
2193
|
+
})
|
|
2194
|
+
return data
|
|
2195
|
+
},
|
|
2196
|
+
queryKey: getWorkflowNodeRunFileContentQueryKey(options),
|
|
2197
|
+
})
|
|
2198
|
+
|
|
2199
|
+
/**
|
|
2200
|
+
* Request a workflow run
|
|
2201
|
+
*/
|
|
2202
|
+
export const requestWorkflowRunMutation = (
|
|
2203
|
+
options?: Partial<Options<RequestWorkflowRunData>>
|
|
2204
|
+
): UseMutationOptions<
|
|
2205
|
+
RequestWorkflowRunResponse,
|
|
2206
|
+
RequestWorkflowRunError,
|
|
2207
|
+
Options<RequestWorkflowRunData>
|
|
2208
|
+
> => {
|
|
2209
|
+
const mutationOptions: UseMutationOptions<
|
|
2210
|
+
RequestWorkflowRunResponse,
|
|
2211
|
+
RequestWorkflowRunError,
|
|
2212
|
+
Options<RequestWorkflowRunData>
|
|
2213
|
+
> = {
|
|
2214
|
+
mutationFn: async (fnOptions) => {
|
|
2215
|
+
const { data } = await requestWorkflowRun({
|
|
2216
|
+
...options,
|
|
2217
|
+
...fnOptions,
|
|
2218
|
+
throwOnError: true,
|
|
2219
|
+
})
|
|
2220
|
+
return data
|
|
2221
|
+
},
|
|
2222
|
+
}
|
|
2223
|
+
return mutationOptions
|
|
2224
|
+
}
|
|
2225
|
+
|
|
2226
|
+
export const listRulesQueryKey = (options?: Options<ListRulesData>) =>
|
|
2227
|
+
createQueryKey("listRules", options)
|
|
2228
|
+
|
|
2229
|
+
/**
|
|
2230
|
+
* List registered rules
|
|
2231
|
+
*/
|
|
2232
|
+
export const listRulesOptions = (options?: Options<ListRulesData>) =>
|
|
2233
|
+
queryOptions<
|
|
2234
|
+
ListRulesResponse,
|
|
2235
|
+
DefaultError,
|
|
2236
|
+
ListRulesResponse,
|
|
2237
|
+
ReturnType<typeof listRulesQueryKey>
|
|
2238
|
+
>({
|
|
2239
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2240
|
+
const { data } = await listRules({
|
|
2241
|
+
...options,
|
|
2242
|
+
...queryKey[0],
|
|
2243
|
+
signal,
|
|
2244
|
+
throwOnError: true,
|
|
2245
|
+
})
|
|
2246
|
+
return data
|
|
2247
|
+
},
|
|
2248
|
+
queryKey: listRulesQueryKey(options),
|
|
2249
|
+
})
|
|
2250
|
+
|
|
2251
|
+
export const getRuleQueryKey = (options: Options<GetRuleData>) => createQueryKey("getRule", options)
|
|
2252
|
+
|
|
2253
|
+
/**
|
|
2254
|
+
* Get rule metadata
|
|
2255
|
+
*/
|
|
2256
|
+
export const getRuleOptions = (options: Options<GetRuleData>) =>
|
|
2257
|
+
queryOptions<GetRuleResponse, GetRuleError, GetRuleResponse, ReturnType<typeof getRuleQueryKey>>({
|
|
2258
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2259
|
+
const { data } = await getRule({
|
|
2260
|
+
...options,
|
|
2261
|
+
...queryKey[0],
|
|
2262
|
+
signal,
|
|
2263
|
+
throwOnError: true,
|
|
2264
|
+
})
|
|
2265
|
+
return data
|
|
2266
|
+
},
|
|
2267
|
+
queryKey: getRuleQueryKey(options),
|
|
2268
|
+
})
|
|
2269
|
+
|
|
2270
|
+
export const listRuleStatesQueryKey = (options?: Options<ListRuleStatesData>) =>
|
|
2271
|
+
createQueryKey("listRuleStates", options)
|
|
2272
|
+
|
|
2273
|
+
/**
|
|
2274
|
+
* List active rule states
|
|
2275
|
+
*/
|
|
2276
|
+
export const listRuleStatesOptions = (options?: Options<ListRuleStatesData>) =>
|
|
2277
|
+
queryOptions<
|
|
2278
|
+
ListRuleStatesResponse,
|
|
2279
|
+
ListRuleStatesError,
|
|
2280
|
+
ListRuleStatesResponse,
|
|
2281
|
+
ReturnType<typeof listRuleStatesQueryKey>
|
|
2282
|
+
>({
|
|
2283
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2284
|
+
const { data } = await listRuleStates({
|
|
2285
|
+
...options,
|
|
2286
|
+
...queryKey[0],
|
|
2287
|
+
signal,
|
|
2288
|
+
throwOnError: true,
|
|
2289
|
+
})
|
|
2290
|
+
return data
|
|
2291
|
+
},
|
|
2292
|
+
queryKey: listRuleStatesQueryKey(options),
|
|
2293
|
+
})
|
|
2294
|
+
|
|
2295
|
+
export const listRuleStatesInfiniteQueryKey = (
|
|
2296
|
+
options?: Options<ListRuleStatesData>
|
|
2297
|
+
): QueryKey<Options<ListRuleStatesData>> => createQueryKey("listRuleStates", options, true)
|
|
2298
|
+
|
|
2299
|
+
/**
|
|
2300
|
+
* List active rule states
|
|
2301
|
+
*/
|
|
2302
|
+
export const listRuleStatesInfiniteOptions = (options?: Options<ListRuleStatesData>) =>
|
|
2303
|
+
infiniteQueryOptions<
|
|
2304
|
+
ListRuleStatesResponse,
|
|
2305
|
+
ListRuleStatesError,
|
|
2306
|
+
InfiniteData<ListRuleStatesResponse>,
|
|
2307
|
+
QueryKey<Options<ListRuleStatesData>>,
|
|
2308
|
+
string | Pick<QueryKey<Options<ListRuleStatesData>>[0], "body" | "headers" | "path" | "query">
|
|
2309
|
+
>(
|
|
2310
|
+
// @ts-ignore
|
|
2311
|
+
{
|
|
2312
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
2313
|
+
// @ts-ignore
|
|
2314
|
+
const page: Pick<
|
|
2315
|
+
QueryKey<Options<ListRuleStatesData>>[0],
|
|
2316
|
+
"body" | "headers" | "path" | "query"
|
|
2317
|
+
> =
|
|
2318
|
+
typeof pageParam === "object"
|
|
2319
|
+
? pageParam
|
|
2320
|
+
: {
|
|
2321
|
+
query: {
|
|
2322
|
+
offset: pageParam,
|
|
2323
|
+
},
|
|
2324
|
+
}
|
|
2325
|
+
const params = createInfiniteParams(queryKey, page)
|
|
2326
|
+
const { data } = await listRuleStates({
|
|
2327
|
+
...options,
|
|
2328
|
+
...params,
|
|
2329
|
+
signal,
|
|
2330
|
+
throwOnError: true,
|
|
2331
|
+
})
|
|
2332
|
+
return data
|
|
2333
|
+
},
|
|
2334
|
+
queryKey: listRuleStatesInfiniteQueryKey(options),
|
|
2335
|
+
}
|
|
2336
|
+
)
|
|
2337
|
+
|
|
2338
|
+
export const listObjectTypesQueryKey = (options?: Options<ListObjectTypesData>) =>
|
|
2339
|
+
createQueryKey("listObjectTypes", options)
|
|
2340
|
+
|
|
2341
|
+
/**
|
|
2342
|
+
* List registered object types
|
|
2343
|
+
*/
|
|
2344
|
+
export const listObjectTypesOptions = (options?: Options<ListObjectTypesData>) =>
|
|
2345
|
+
queryOptions<
|
|
2346
|
+
ListObjectTypesResponse,
|
|
2347
|
+
DefaultError,
|
|
2348
|
+
ListObjectTypesResponse,
|
|
2349
|
+
ReturnType<typeof listObjectTypesQueryKey>
|
|
2350
|
+
>({
|
|
2351
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2352
|
+
const { data } = await listObjectTypes({
|
|
2353
|
+
...options,
|
|
2354
|
+
...queryKey[0],
|
|
2355
|
+
signal,
|
|
2356
|
+
throwOnError: true,
|
|
2357
|
+
})
|
|
2358
|
+
return data
|
|
2359
|
+
},
|
|
2360
|
+
queryKey: listObjectTypesQueryKey(options),
|
|
2361
|
+
})
|
|
2362
|
+
|
|
2363
|
+
export const getObjectTypeQueryKey = (options: Options<GetObjectTypeData>) =>
|
|
2364
|
+
createQueryKey("getObjectType", options)
|
|
2365
|
+
|
|
2366
|
+
/**
|
|
2367
|
+
* Get object type definition
|
|
2368
|
+
*/
|
|
2369
|
+
export const getObjectTypeOptions = (options: Options<GetObjectTypeData>) =>
|
|
2370
|
+
queryOptions<
|
|
2371
|
+
GetObjectTypeResponse,
|
|
2372
|
+
GetObjectTypeError,
|
|
2373
|
+
GetObjectTypeResponse,
|
|
2374
|
+
ReturnType<typeof getObjectTypeQueryKey>
|
|
2375
|
+
>({
|
|
2376
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2377
|
+
const { data } = await getObjectType({
|
|
2378
|
+
...options,
|
|
2379
|
+
...queryKey[0],
|
|
2380
|
+
signal,
|
|
2381
|
+
throwOnError: true,
|
|
2382
|
+
})
|
|
2383
|
+
return data
|
|
2384
|
+
},
|
|
2385
|
+
queryKey: getObjectTypeQueryKey(options),
|
|
2386
|
+
})
|
|
2387
|
+
|
|
2388
|
+
export const searchObjectsQueryKey = (options: Options<SearchObjectsData>) =>
|
|
2389
|
+
createQueryKey("searchObjects", options)
|
|
2390
|
+
|
|
2391
|
+
/**
|
|
2392
|
+
* Search objects
|
|
2393
|
+
*/
|
|
2394
|
+
export const searchObjectsOptions = (options: Options<SearchObjectsData>) =>
|
|
2395
|
+
queryOptions<
|
|
2396
|
+
SearchObjectsResponse,
|
|
2397
|
+
SearchObjectsError,
|
|
2398
|
+
SearchObjectsResponse,
|
|
2399
|
+
ReturnType<typeof searchObjectsQueryKey>
|
|
2400
|
+
>({
|
|
2401
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2402
|
+
const { data } = await searchObjects({
|
|
2403
|
+
...options,
|
|
2404
|
+
...queryKey[0],
|
|
2405
|
+
signal,
|
|
2406
|
+
throwOnError: true,
|
|
2407
|
+
})
|
|
2408
|
+
return data
|
|
2409
|
+
},
|
|
2410
|
+
queryKey: searchObjectsQueryKey(options),
|
|
2411
|
+
})
|
|
2412
|
+
|
|
2413
|
+
export const listObjectsQueryKey = (options?: Options<ListObjectsData>) =>
|
|
2414
|
+
createQueryKey("listObjects", options)
|
|
2415
|
+
|
|
2416
|
+
/**
|
|
2417
|
+
* List objects
|
|
2418
|
+
*/
|
|
2419
|
+
export const listObjectsOptions = (options?: Options<ListObjectsData>) =>
|
|
2420
|
+
queryOptions<
|
|
2421
|
+
ListObjectsResponse,
|
|
2422
|
+
ListObjectsError,
|
|
2423
|
+
ListObjectsResponse,
|
|
2424
|
+
ReturnType<typeof listObjectsQueryKey>
|
|
2425
|
+
>({
|
|
2426
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2427
|
+
const { data } = await listObjects({
|
|
2428
|
+
...options,
|
|
2429
|
+
...queryKey[0],
|
|
2430
|
+
signal,
|
|
2431
|
+
throwOnError: true,
|
|
2432
|
+
})
|
|
2433
|
+
return data
|
|
2434
|
+
},
|
|
2435
|
+
queryKey: listObjectsQueryKey(options),
|
|
2436
|
+
})
|
|
2437
|
+
|
|
2438
|
+
export const listObjectsInfiniteQueryKey = (
|
|
2439
|
+
options?: Options<ListObjectsData>
|
|
2440
|
+
): QueryKey<Options<ListObjectsData>> => createQueryKey("listObjects", options, true)
|
|
2441
|
+
|
|
2442
|
+
/**
|
|
2443
|
+
* List objects
|
|
2444
|
+
*/
|
|
2445
|
+
export const listObjectsInfiniteOptions = (options?: Options<ListObjectsData>) =>
|
|
2446
|
+
infiniteQueryOptions<
|
|
2447
|
+
ListObjectsResponse,
|
|
2448
|
+
ListObjectsError,
|
|
2449
|
+
InfiniteData<ListObjectsResponse>,
|
|
2450
|
+
QueryKey<Options<ListObjectsData>>,
|
|
2451
|
+
string | Pick<QueryKey<Options<ListObjectsData>>[0], "body" | "headers" | "path" | "query">
|
|
2452
|
+
>(
|
|
2453
|
+
// @ts-ignore
|
|
2454
|
+
{
|
|
2455
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
2456
|
+
// @ts-ignore
|
|
2457
|
+
const page: Pick<
|
|
2458
|
+
QueryKey<Options<ListObjectsData>>[0],
|
|
2459
|
+
"body" | "headers" | "path" | "query"
|
|
2460
|
+
> =
|
|
2461
|
+
typeof pageParam === "object"
|
|
2462
|
+
? pageParam
|
|
2463
|
+
: {
|
|
2464
|
+
query: {
|
|
2465
|
+
offset: pageParam,
|
|
2466
|
+
},
|
|
2467
|
+
}
|
|
2468
|
+
const params = createInfiniteParams(queryKey, page)
|
|
2469
|
+
const { data } = await listObjects({
|
|
2470
|
+
...options,
|
|
2471
|
+
...params,
|
|
2472
|
+
signal,
|
|
2473
|
+
throwOnError: true,
|
|
2474
|
+
})
|
|
2475
|
+
return data
|
|
2476
|
+
},
|
|
2477
|
+
queryKey: listObjectsInfiniteQueryKey(options),
|
|
2478
|
+
}
|
|
2479
|
+
)
|
|
2480
|
+
|
|
2481
|
+
/**
|
|
2482
|
+
* Query objects
|
|
2483
|
+
*/
|
|
2484
|
+
export const queryObjectsMutation = (
|
|
2485
|
+
options?: Partial<Options<QueryObjectsData>>
|
|
2486
|
+
): UseMutationOptions<QueryObjectsResponse, QueryObjectsError, Options<QueryObjectsData>> => {
|
|
2487
|
+
const mutationOptions: UseMutationOptions<
|
|
2488
|
+
QueryObjectsResponse,
|
|
2489
|
+
QueryObjectsError,
|
|
2490
|
+
Options<QueryObjectsData>
|
|
2491
|
+
> = {
|
|
2492
|
+
mutationFn: async (fnOptions) => {
|
|
2493
|
+
const { data } = await queryObjects({
|
|
2494
|
+
...options,
|
|
2495
|
+
...fnOptions,
|
|
2496
|
+
throwOnError: true,
|
|
2497
|
+
})
|
|
2498
|
+
return data
|
|
2499
|
+
},
|
|
2500
|
+
}
|
|
2501
|
+
return mutationOptions
|
|
2502
|
+
}
|
|
2503
|
+
|
|
2504
|
+
/**
|
|
2505
|
+
* Count objects
|
|
2506
|
+
*/
|
|
2507
|
+
export const countObjectsMutation = (
|
|
2508
|
+
options?: Partial<Options<CountObjectsData>>
|
|
2509
|
+
): UseMutationOptions<CountObjectsResponse, CountObjectsError, Options<CountObjectsData>> => {
|
|
2510
|
+
const mutationOptions: UseMutationOptions<
|
|
2511
|
+
CountObjectsResponse,
|
|
2512
|
+
CountObjectsError,
|
|
2513
|
+
Options<CountObjectsData>
|
|
2514
|
+
> = {
|
|
2515
|
+
mutationFn: async (fnOptions) => {
|
|
2516
|
+
const { data } = await countObjects({
|
|
2517
|
+
...options,
|
|
2518
|
+
...fnOptions,
|
|
2519
|
+
throwOnError: true,
|
|
2520
|
+
})
|
|
2521
|
+
return data
|
|
2522
|
+
},
|
|
2523
|
+
}
|
|
2524
|
+
return mutationOptions
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2527
|
+
/**
|
|
2528
|
+
* Check object existence
|
|
2529
|
+
*/
|
|
2530
|
+
export const existsObjectsMutation = (
|
|
2531
|
+
options?: Partial<Options<ExistsObjectsData>>
|
|
2532
|
+
): UseMutationOptions<ExistsObjectsResponse, ExistsObjectsError, Options<ExistsObjectsData>> => {
|
|
2533
|
+
const mutationOptions: UseMutationOptions<
|
|
2534
|
+
ExistsObjectsResponse,
|
|
2535
|
+
ExistsObjectsError,
|
|
2536
|
+
Options<ExistsObjectsData>
|
|
2537
|
+
> = {
|
|
2538
|
+
mutationFn: async (fnOptions) => {
|
|
2539
|
+
const { data } = await existsObjects({
|
|
2540
|
+
...options,
|
|
2541
|
+
...fnOptions,
|
|
2542
|
+
throwOnError: true,
|
|
2543
|
+
})
|
|
2544
|
+
return data
|
|
2545
|
+
},
|
|
2546
|
+
}
|
|
2547
|
+
return mutationOptions
|
|
2548
|
+
}
|
|
2549
|
+
|
|
2550
|
+
/**
|
|
2551
|
+
* Facet objects
|
|
2552
|
+
*/
|
|
2553
|
+
export const facetObjectsMutation = (
|
|
2554
|
+
options?: Partial<Options<FacetObjectsData>>
|
|
2555
|
+
): UseMutationOptions<FacetObjectsResponse, FacetObjectsError, Options<FacetObjectsData>> => {
|
|
2556
|
+
const mutationOptions: UseMutationOptions<
|
|
2557
|
+
FacetObjectsResponse,
|
|
2558
|
+
FacetObjectsError,
|
|
2559
|
+
Options<FacetObjectsData>
|
|
2560
|
+
> = {
|
|
2561
|
+
mutationFn: async (fnOptions) => {
|
|
2562
|
+
const { data } = await facetObjects({
|
|
2563
|
+
...options,
|
|
2564
|
+
...fnOptions,
|
|
2565
|
+
throwOnError: true,
|
|
2566
|
+
})
|
|
2567
|
+
return data
|
|
2568
|
+
},
|
|
2569
|
+
}
|
|
2570
|
+
return mutationOptions
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2573
|
+
export const getObjectFileContentQueryKey = (options: Options<GetObjectFileContentData>) =>
|
|
2574
|
+
createQueryKey("getObjectFileContent", options)
|
|
2575
|
+
|
|
2576
|
+
/**
|
|
2577
|
+
* Get object file content
|
|
2578
|
+
*/
|
|
2579
|
+
export const getObjectFileContentOptions = (options: Options<GetObjectFileContentData>) =>
|
|
2580
|
+
queryOptions<
|
|
2581
|
+
GetObjectFileContentResponse,
|
|
2582
|
+
GetObjectFileContentError,
|
|
2583
|
+
GetObjectFileContentResponse,
|
|
2584
|
+
ReturnType<typeof getObjectFileContentQueryKey>
|
|
2585
|
+
>({
|
|
2586
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2587
|
+
const { data } = await getObjectFileContent({
|
|
2588
|
+
...options,
|
|
2589
|
+
...queryKey[0],
|
|
2590
|
+
signal,
|
|
2591
|
+
throwOnError: true,
|
|
2592
|
+
})
|
|
2593
|
+
return data
|
|
2594
|
+
},
|
|
2595
|
+
queryKey: getObjectFileContentQueryKey(options),
|
|
2596
|
+
})
|
|
2597
|
+
|
|
2598
|
+
export const getObjectQueryKey = (options: Options<GetObjectData>) =>
|
|
2599
|
+
createQueryKey("getObject", options)
|
|
2600
|
+
|
|
2601
|
+
/**
|
|
2602
|
+
* Get object by id
|
|
2603
|
+
*/
|
|
2604
|
+
export const getObjectOptions = (options: Options<GetObjectData>) =>
|
|
2605
|
+
queryOptions<
|
|
2606
|
+
GetObjectResponse,
|
|
2607
|
+
GetObjectError,
|
|
2608
|
+
GetObjectResponse,
|
|
2609
|
+
ReturnType<typeof getObjectQueryKey>
|
|
2610
|
+
>({
|
|
2611
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2612
|
+
const { data } = await getObject({
|
|
2613
|
+
...options,
|
|
2614
|
+
...queryKey[0],
|
|
2615
|
+
signal,
|
|
2616
|
+
throwOnError: true,
|
|
2617
|
+
})
|
|
2618
|
+
return data
|
|
2619
|
+
},
|
|
2620
|
+
queryKey: getObjectQueryKey(options),
|
|
2621
|
+
})
|
|
2622
|
+
|
|
2623
|
+
/**
|
|
2624
|
+
* Create or update object
|
|
2625
|
+
*/
|
|
2626
|
+
export const upsertObjectMutation = (
|
|
2627
|
+
options?: Partial<Options<UpsertObjectData>>
|
|
2628
|
+
): UseMutationOptions<UpsertObjectResponse, UpsertObjectError, Options<UpsertObjectData>> => {
|
|
2629
|
+
const mutationOptions: UseMutationOptions<
|
|
2630
|
+
UpsertObjectResponse,
|
|
2631
|
+
UpsertObjectError,
|
|
2632
|
+
Options<UpsertObjectData>
|
|
2633
|
+
> = {
|
|
2634
|
+
mutationFn: async (fnOptions) => {
|
|
2635
|
+
const { data } = await upsertObject({
|
|
2636
|
+
...options,
|
|
2637
|
+
...fnOptions,
|
|
2638
|
+
throwOnError: true,
|
|
2639
|
+
})
|
|
2640
|
+
return data
|
|
2641
|
+
},
|
|
2642
|
+
}
|
|
2643
|
+
return mutationOptions
|
|
2644
|
+
}
|
|
2645
|
+
|
|
2646
|
+
export const listActionsQueryKey = (options?: Options<ListActionsData>) =>
|
|
2647
|
+
createQueryKey("listActions", options)
|
|
2648
|
+
|
|
2649
|
+
/**
|
|
2650
|
+
* List registered actions
|
|
2651
|
+
*/
|
|
2652
|
+
export const listActionsOptions = (options?: Options<ListActionsData>) =>
|
|
2653
|
+
queryOptions<
|
|
2654
|
+
ListActionsResponse,
|
|
2655
|
+
DefaultError,
|
|
2656
|
+
ListActionsResponse,
|
|
2657
|
+
ReturnType<typeof listActionsQueryKey>
|
|
2658
|
+
>({
|
|
2659
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2660
|
+
const { data } = await listActions({
|
|
2661
|
+
...options,
|
|
2662
|
+
...queryKey[0],
|
|
2663
|
+
signal,
|
|
2664
|
+
throwOnError: true,
|
|
2665
|
+
})
|
|
2666
|
+
return data
|
|
2667
|
+
},
|
|
2668
|
+
queryKey: listActionsQueryKey(options),
|
|
2669
|
+
})
|
|
2670
|
+
|
|
2671
|
+
export const getActionQueryKey = (options: Options<GetActionData>) =>
|
|
2672
|
+
createQueryKey("getAction", options)
|
|
2673
|
+
|
|
2674
|
+
/**
|
|
2675
|
+
* Get action metadata
|
|
2676
|
+
*/
|
|
2677
|
+
export const getActionOptions = (options: Options<GetActionData>) =>
|
|
2678
|
+
queryOptions<
|
|
2679
|
+
GetActionResponse,
|
|
2680
|
+
GetActionError,
|
|
2681
|
+
GetActionResponse,
|
|
2682
|
+
ReturnType<typeof getActionQueryKey>
|
|
2683
|
+
>({
|
|
2684
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2685
|
+
const { data } = await getAction({
|
|
2686
|
+
...options,
|
|
2687
|
+
...queryKey[0],
|
|
2688
|
+
signal,
|
|
2689
|
+
throwOnError: true,
|
|
2690
|
+
})
|
|
2691
|
+
return data
|
|
2692
|
+
},
|
|
2693
|
+
queryKey: getActionQueryKey(options),
|
|
2694
|
+
})
|
|
2695
|
+
|
|
2696
|
+
/**
|
|
2697
|
+
* Request an action
|
|
2698
|
+
*/
|
|
2699
|
+
export const requestActionMutation = (
|
|
2700
|
+
options?: Partial<Options<RequestActionData>>
|
|
2701
|
+
): UseMutationOptions<RequestActionResponse, RequestActionError, Options<RequestActionData>> => {
|
|
2702
|
+
const mutationOptions: UseMutationOptions<
|
|
2703
|
+
RequestActionResponse,
|
|
2704
|
+
RequestActionError,
|
|
2705
|
+
Options<RequestActionData>
|
|
2706
|
+
> = {
|
|
2707
|
+
mutationFn: async (fnOptions) => {
|
|
2708
|
+
const { data } = await requestAction({
|
|
2709
|
+
...options,
|
|
2710
|
+
...fnOptions,
|
|
2711
|
+
throwOnError: true,
|
|
2712
|
+
})
|
|
2713
|
+
return data
|
|
2714
|
+
},
|
|
2715
|
+
}
|
|
2716
|
+
return mutationOptions
|
|
2717
|
+
}
|
|
2718
|
+
|
|
2719
|
+
/**
|
|
2720
|
+
* Upload a file
|
|
2721
|
+
*/
|
|
2722
|
+
export const uploadFileRawMutation = (
|
|
2723
|
+
options?: Partial<Options<UploadFileRawData>>
|
|
2724
|
+
): UseMutationOptions<UploadFileRawResponse, UploadFileRawError, Options<UploadFileRawData>> => {
|
|
2725
|
+
const mutationOptions: UseMutationOptions<
|
|
2726
|
+
UploadFileRawResponse,
|
|
2727
|
+
UploadFileRawError,
|
|
2728
|
+
Options<UploadFileRawData>
|
|
2729
|
+
> = {
|
|
2730
|
+
mutationFn: async (fnOptions) => {
|
|
2731
|
+
const { data } = await uploadFileRaw({
|
|
2732
|
+
...options,
|
|
2733
|
+
...fnOptions,
|
|
2734
|
+
throwOnError: true,
|
|
2735
|
+
})
|
|
2736
|
+
return data
|
|
2737
|
+
},
|
|
2738
|
+
}
|
|
2739
|
+
return mutationOptions
|
|
2740
|
+
}
|
|
2741
|
+
|
|
2742
|
+
/**
|
|
2743
|
+
* Create a staged file upload
|
|
2744
|
+
*/
|
|
2745
|
+
export const createFileUploadMutation = (
|
|
2746
|
+
options?: Partial<Options<CreateFileUploadData>>
|
|
2747
|
+
): UseMutationOptions<
|
|
2748
|
+
CreateFileUploadResponse,
|
|
2749
|
+
CreateFileUploadError,
|
|
2750
|
+
Options<CreateFileUploadData>
|
|
2751
|
+
> => {
|
|
2752
|
+
const mutationOptions: UseMutationOptions<
|
|
2753
|
+
CreateFileUploadResponse,
|
|
2754
|
+
CreateFileUploadError,
|
|
2755
|
+
Options<CreateFileUploadData>
|
|
2756
|
+
> = {
|
|
2757
|
+
mutationFn: async (fnOptions) => {
|
|
2758
|
+
const { data } = await createFileUpload({
|
|
2759
|
+
...options,
|
|
2760
|
+
...fnOptions,
|
|
2761
|
+
throwOnError: true,
|
|
2762
|
+
})
|
|
2763
|
+
return data
|
|
2764
|
+
},
|
|
2765
|
+
}
|
|
2766
|
+
return mutationOptions
|
|
2767
|
+
}
|
|
2768
|
+
|
|
2769
|
+
/**
|
|
2770
|
+
* Upload staged file content through Sixb
|
|
2771
|
+
*/
|
|
2772
|
+
export const uploadFileContentMutation = (
|
|
2773
|
+
options?: Partial<Options<UploadFileContentData>>
|
|
2774
|
+
): UseMutationOptions<
|
|
2775
|
+
UploadFileContentResponse,
|
|
2776
|
+
UploadFileContentError,
|
|
2777
|
+
Options<UploadFileContentData>
|
|
2778
|
+
> => {
|
|
2779
|
+
const mutationOptions: UseMutationOptions<
|
|
2780
|
+
UploadFileContentResponse,
|
|
2781
|
+
UploadFileContentError,
|
|
2782
|
+
Options<UploadFileContentData>
|
|
2783
|
+
> = {
|
|
2784
|
+
mutationFn: async (fnOptions) => {
|
|
2785
|
+
const { data } = await uploadFileContent({
|
|
2786
|
+
...options,
|
|
2787
|
+
...fnOptions,
|
|
2788
|
+
throwOnError: true,
|
|
2789
|
+
})
|
|
2790
|
+
return data
|
|
2791
|
+
},
|
|
2792
|
+
}
|
|
2793
|
+
return mutationOptions
|
|
2794
|
+
}
|
|
2795
|
+
|
|
2796
|
+
/**
|
|
2797
|
+
* Sign a staged multipart upload part
|
|
2798
|
+
*/
|
|
2799
|
+
export const signFileUploadPartMutation = (
|
|
2800
|
+
options?: Partial<Options<SignFileUploadPartData>>
|
|
2801
|
+
): UseMutationOptions<
|
|
2802
|
+
SignFileUploadPartResponse,
|
|
2803
|
+
SignFileUploadPartError,
|
|
2804
|
+
Options<SignFileUploadPartData>
|
|
2805
|
+
> => {
|
|
2806
|
+
const mutationOptions: UseMutationOptions<
|
|
2807
|
+
SignFileUploadPartResponse,
|
|
2808
|
+
SignFileUploadPartError,
|
|
2809
|
+
Options<SignFileUploadPartData>
|
|
2810
|
+
> = {
|
|
2811
|
+
mutationFn: async (fnOptions) => {
|
|
2812
|
+
const { data } = await signFileUploadPart({
|
|
2813
|
+
...options,
|
|
2814
|
+
...fnOptions,
|
|
2815
|
+
throwOnError: true,
|
|
2816
|
+
})
|
|
2817
|
+
return data
|
|
2818
|
+
},
|
|
2819
|
+
}
|
|
2820
|
+
return mutationOptions
|
|
2821
|
+
}
|
|
2822
|
+
|
|
2823
|
+
/**
|
|
2824
|
+
* Complete a staged file upload
|
|
2825
|
+
*/
|
|
2826
|
+
export const completeFileUploadMutation = (
|
|
2827
|
+
options?: Partial<Options<CompleteFileUploadData>>
|
|
2828
|
+
): UseMutationOptions<
|
|
2829
|
+
CompleteFileUploadResponse,
|
|
2830
|
+
CompleteFileUploadError,
|
|
2831
|
+
Options<CompleteFileUploadData>
|
|
2832
|
+
> => {
|
|
2833
|
+
const mutationOptions: UseMutationOptions<
|
|
2834
|
+
CompleteFileUploadResponse,
|
|
2835
|
+
CompleteFileUploadError,
|
|
2836
|
+
Options<CompleteFileUploadData>
|
|
2837
|
+
> = {
|
|
2838
|
+
mutationFn: async (fnOptions) => {
|
|
2839
|
+
const { data } = await completeFileUpload({
|
|
2840
|
+
...options,
|
|
2841
|
+
...fnOptions,
|
|
2842
|
+
throwOnError: true,
|
|
2843
|
+
})
|
|
2844
|
+
return data
|
|
2845
|
+
},
|
|
2846
|
+
}
|
|
2847
|
+
return mutationOptions
|
|
2848
|
+
}
|
|
2849
|
+
|
|
2850
|
+
/**
|
|
2851
|
+
* Abort a staged file upload
|
|
2852
|
+
*/
|
|
2853
|
+
export const abortFileUploadMutation = (
|
|
2854
|
+
options?: Partial<Options<AbortFileUploadData>>
|
|
2855
|
+
): UseMutationOptions<
|
|
2856
|
+
AbortFileUploadResponse,
|
|
2857
|
+
AbortFileUploadError,
|
|
2858
|
+
Options<AbortFileUploadData>
|
|
2859
|
+
> => {
|
|
2860
|
+
const mutationOptions: UseMutationOptions<
|
|
2861
|
+
AbortFileUploadResponse,
|
|
2862
|
+
AbortFileUploadError,
|
|
2863
|
+
Options<AbortFileUploadData>
|
|
2864
|
+
> = {
|
|
2865
|
+
mutationFn: async (fnOptions) => {
|
|
2866
|
+
const { data } = await abortFileUpload({
|
|
2867
|
+
...options,
|
|
2868
|
+
...fnOptions,
|
|
2869
|
+
throwOnError: true,
|
|
2870
|
+
})
|
|
2871
|
+
return data
|
|
2872
|
+
},
|
|
2873
|
+
}
|
|
2874
|
+
return mutationOptions
|
|
2875
|
+
}
|
|
2876
|
+
|
|
2877
|
+
export const listActionRunsQueryKey = (options?: Options<ListActionRunsData>) =>
|
|
2878
|
+
createQueryKey("listActionRuns", options)
|
|
2879
|
+
|
|
2880
|
+
/**
|
|
2881
|
+
* List action run history
|
|
2882
|
+
*/
|
|
2883
|
+
export const listActionRunsOptions = (options?: Options<ListActionRunsData>) =>
|
|
2884
|
+
queryOptions<
|
|
2885
|
+
ListActionRunsResponse,
|
|
2886
|
+
ListActionRunsError,
|
|
2887
|
+
ListActionRunsResponse,
|
|
2888
|
+
ReturnType<typeof listActionRunsQueryKey>
|
|
2889
|
+
>({
|
|
2890
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2891
|
+
const { data } = await listActionRuns({
|
|
2892
|
+
...options,
|
|
2893
|
+
...queryKey[0],
|
|
2894
|
+
signal,
|
|
2895
|
+
throwOnError: true,
|
|
2896
|
+
})
|
|
2897
|
+
return data
|
|
2898
|
+
},
|
|
2899
|
+
queryKey: listActionRunsQueryKey(options),
|
|
2900
|
+
})
|
|
2901
|
+
|
|
2902
|
+
export const listActionRunsInfiniteQueryKey = (
|
|
2903
|
+
options?: Options<ListActionRunsData>
|
|
2904
|
+
): QueryKey<Options<ListActionRunsData>> => createQueryKey("listActionRuns", options, true)
|
|
2905
|
+
|
|
2906
|
+
/**
|
|
2907
|
+
* List action run history
|
|
2908
|
+
*/
|
|
2909
|
+
export const listActionRunsInfiniteOptions = (options?: Options<ListActionRunsData>) =>
|
|
2910
|
+
infiniteQueryOptions<
|
|
2911
|
+
ListActionRunsResponse,
|
|
2912
|
+
ListActionRunsError,
|
|
2913
|
+
InfiniteData<ListActionRunsResponse>,
|
|
2914
|
+
QueryKey<Options<ListActionRunsData>>,
|
|
2915
|
+
string | Pick<QueryKey<Options<ListActionRunsData>>[0], "body" | "headers" | "path" | "query">
|
|
2916
|
+
>(
|
|
2917
|
+
// @ts-ignore
|
|
2918
|
+
{
|
|
2919
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
2920
|
+
// @ts-ignore
|
|
2921
|
+
const page: Pick<
|
|
2922
|
+
QueryKey<Options<ListActionRunsData>>[0],
|
|
2923
|
+
"body" | "headers" | "path" | "query"
|
|
2924
|
+
> =
|
|
2925
|
+
typeof pageParam === "object"
|
|
2926
|
+
? pageParam
|
|
2927
|
+
: {
|
|
2928
|
+
query: {
|
|
2929
|
+
offset: pageParam,
|
|
2930
|
+
},
|
|
2931
|
+
}
|
|
2932
|
+
const params = createInfiniteParams(queryKey, page)
|
|
2933
|
+
const { data } = await listActionRuns({
|
|
2934
|
+
...options,
|
|
2935
|
+
...params,
|
|
2936
|
+
signal,
|
|
2937
|
+
throwOnError: true,
|
|
2938
|
+
})
|
|
2939
|
+
return data
|
|
2940
|
+
},
|
|
2941
|
+
queryKey: listActionRunsInfiniteQueryKey(options),
|
|
2942
|
+
}
|
|
2943
|
+
)
|
|
2944
|
+
|
|
2945
|
+
export const getActionRunQueryKey = (options: Options<GetActionRunData>) =>
|
|
2946
|
+
createQueryKey("getActionRun", options)
|
|
2947
|
+
|
|
2948
|
+
/**
|
|
2949
|
+
* Get action run detail
|
|
2950
|
+
*/
|
|
2951
|
+
export const getActionRunOptions = (options: Options<GetActionRunData>) =>
|
|
2952
|
+
queryOptions<
|
|
2953
|
+
GetActionRunResponse,
|
|
2954
|
+
GetActionRunError,
|
|
2955
|
+
GetActionRunResponse,
|
|
2956
|
+
ReturnType<typeof getActionRunQueryKey>
|
|
2957
|
+
>({
|
|
2958
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2959
|
+
const { data } = await getActionRun({
|
|
2960
|
+
...options,
|
|
2961
|
+
...queryKey[0],
|
|
2962
|
+
signal,
|
|
2963
|
+
throwOnError: true,
|
|
2964
|
+
})
|
|
2965
|
+
return data
|
|
2966
|
+
},
|
|
2967
|
+
queryKey: getActionRunQueryKey(options),
|
|
2968
|
+
})
|
|
2969
|
+
|
|
2970
|
+
export const getActionRunFileContentQueryKey = (options: Options<GetActionRunFileContentData>) =>
|
|
2971
|
+
createQueryKey("getActionRunFileContent", options)
|
|
2972
|
+
|
|
2973
|
+
/**
|
|
2974
|
+
* Get action run file content
|
|
2975
|
+
*/
|
|
2976
|
+
export const getActionRunFileContentOptions = (options: Options<GetActionRunFileContentData>) =>
|
|
2977
|
+
queryOptions<
|
|
2978
|
+
GetActionRunFileContentResponse,
|
|
2979
|
+
GetActionRunFileContentError,
|
|
2980
|
+
GetActionRunFileContentResponse,
|
|
2981
|
+
ReturnType<typeof getActionRunFileContentQueryKey>
|
|
2982
|
+
>({
|
|
2983
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2984
|
+
const { data } = await getActionRunFileContent({
|
|
2985
|
+
...options,
|
|
2986
|
+
...queryKey[0],
|
|
2987
|
+
signal,
|
|
2988
|
+
throwOnError: true,
|
|
2989
|
+
})
|
|
2990
|
+
return data
|
|
2991
|
+
},
|
|
2992
|
+
queryKey: getActionRunFileContentQueryKey(options),
|
|
2993
|
+
})
|
|
2994
|
+
|
|
2995
|
+
export const listAgentsQueryKey = (options?: Options<ListAgentsData>) =>
|
|
2996
|
+
createQueryKey("listAgents", options)
|
|
2997
|
+
|
|
2998
|
+
/**
|
|
2999
|
+
* List registered agents
|
|
3000
|
+
*/
|
|
3001
|
+
export const listAgentsOptions = (options?: Options<ListAgentsData>) =>
|
|
3002
|
+
queryOptions<
|
|
3003
|
+
ListAgentsResponse,
|
|
3004
|
+
DefaultError,
|
|
3005
|
+
ListAgentsResponse,
|
|
3006
|
+
ReturnType<typeof listAgentsQueryKey>
|
|
3007
|
+
>({
|
|
3008
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3009
|
+
const { data } = await listAgents({
|
|
3010
|
+
...options,
|
|
3011
|
+
...queryKey[0],
|
|
3012
|
+
signal,
|
|
3013
|
+
throwOnError: true,
|
|
3014
|
+
})
|
|
3015
|
+
return data
|
|
3016
|
+
},
|
|
3017
|
+
queryKey: listAgentsQueryKey(options),
|
|
3018
|
+
})
|
|
3019
|
+
|
|
3020
|
+
export const getAgentQueryKey = (options: Options<GetAgentData>) =>
|
|
3021
|
+
createQueryKey("getAgent", options)
|
|
3022
|
+
|
|
3023
|
+
/**
|
|
3024
|
+
* Get agent metadata
|
|
3025
|
+
*/
|
|
3026
|
+
export const getAgentOptions = (options: Options<GetAgentData>) =>
|
|
3027
|
+
queryOptions<
|
|
3028
|
+
GetAgentResponse,
|
|
3029
|
+
GetAgentError,
|
|
3030
|
+
GetAgentResponse,
|
|
3031
|
+
ReturnType<typeof getAgentQueryKey>
|
|
3032
|
+
>({
|
|
3033
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3034
|
+
const { data } = await getAgent({
|
|
3035
|
+
...options,
|
|
3036
|
+
...queryKey[0],
|
|
3037
|
+
signal,
|
|
3038
|
+
throwOnError: true,
|
|
3039
|
+
})
|
|
3040
|
+
return data
|
|
3041
|
+
},
|
|
3042
|
+
queryKey: getAgentQueryKey(options),
|
|
3043
|
+
})
|
|
3044
|
+
|
|
3045
|
+
export const listAgentThreadsQueryKey = (options?: Options<ListAgentThreadsData>) =>
|
|
3046
|
+
createQueryKey("listAgentThreads", options)
|
|
3047
|
+
|
|
3048
|
+
/**
|
|
3049
|
+
* List agent threads
|
|
3050
|
+
*/
|
|
3051
|
+
export const listAgentThreadsOptions = (options?: Options<ListAgentThreadsData>) =>
|
|
3052
|
+
queryOptions<
|
|
3053
|
+
ListAgentThreadsResponse,
|
|
3054
|
+
ListAgentThreadsError,
|
|
3055
|
+
ListAgentThreadsResponse,
|
|
3056
|
+
ReturnType<typeof listAgentThreadsQueryKey>
|
|
3057
|
+
>({
|
|
3058
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3059
|
+
const { data } = await listAgentThreads({
|
|
3060
|
+
...options,
|
|
3061
|
+
...queryKey[0],
|
|
3062
|
+
signal,
|
|
3063
|
+
throwOnError: true,
|
|
3064
|
+
})
|
|
3065
|
+
return data
|
|
3066
|
+
},
|
|
3067
|
+
queryKey: listAgentThreadsQueryKey(options),
|
|
3068
|
+
})
|
|
3069
|
+
|
|
3070
|
+
export const listAgentThreadsInfiniteQueryKey = (
|
|
3071
|
+
options?: Options<ListAgentThreadsData>
|
|
3072
|
+
): QueryKey<Options<ListAgentThreadsData>> => createQueryKey("listAgentThreads", options, true)
|
|
3073
|
+
|
|
3074
|
+
/**
|
|
3075
|
+
* List agent threads
|
|
3076
|
+
*/
|
|
3077
|
+
export const listAgentThreadsInfiniteOptions = (options?: Options<ListAgentThreadsData>) =>
|
|
3078
|
+
infiniteQueryOptions<
|
|
3079
|
+
ListAgentThreadsResponse,
|
|
3080
|
+
ListAgentThreadsError,
|
|
3081
|
+
InfiniteData<ListAgentThreadsResponse>,
|
|
3082
|
+
QueryKey<Options<ListAgentThreadsData>>,
|
|
3083
|
+
string | Pick<QueryKey<Options<ListAgentThreadsData>>[0], "body" | "headers" | "path" | "query">
|
|
3084
|
+
>(
|
|
3085
|
+
// @ts-ignore
|
|
3086
|
+
{
|
|
3087
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
3088
|
+
// @ts-ignore
|
|
3089
|
+
const page: Pick<
|
|
3090
|
+
QueryKey<Options<ListAgentThreadsData>>[0],
|
|
3091
|
+
"body" | "headers" | "path" | "query"
|
|
3092
|
+
> =
|
|
3093
|
+
typeof pageParam === "object"
|
|
3094
|
+
? pageParam
|
|
3095
|
+
: {
|
|
3096
|
+
query: {
|
|
3097
|
+
offset: pageParam,
|
|
3098
|
+
},
|
|
3099
|
+
}
|
|
3100
|
+
const params = createInfiniteParams(queryKey, page)
|
|
3101
|
+
const { data } = await listAgentThreads({
|
|
3102
|
+
...options,
|
|
3103
|
+
...params,
|
|
3104
|
+
signal,
|
|
3105
|
+
throwOnError: true,
|
|
3106
|
+
})
|
|
3107
|
+
return data
|
|
3108
|
+
},
|
|
3109
|
+
queryKey: listAgentThreadsInfiniteQueryKey(options),
|
|
3110
|
+
}
|
|
3111
|
+
)
|
|
3112
|
+
|
|
3113
|
+
/**
|
|
3114
|
+
* Create an agent thread
|
|
3115
|
+
*/
|
|
3116
|
+
export const createAgentThreadMutation = (
|
|
3117
|
+
options?: Partial<Options<CreateAgentThreadData>>
|
|
3118
|
+
): UseMutationOptions<
|
|
3119
|
+
CreateAgentThreadResponse,
|
|
3120
|
+
CreateAgentThreadError,
|
|
3121
|
+
Options<CreateAgentThreadData>
|
|
3122
|
+
> => {
|
|
3123
|
+
const mutationOptions: UseMutationOptions<
|
|
3124
|
+
CreateAgentThreadResponse,
|
|
3125
|
+
CreateAgentThreadError,
|
|
3126
|
+
Options<CreateAgentThreadData>
|
|
3127
|
+
> = {
|
|
3128
|
+
mutationFn: async (fnOptions) => {
|
|
3129
|
+
const { data } = await createAgentThread({
|
|
3130
|
+
...options,
|
|
3131
|
+
...fnOptions,
|
|
3132
|
+
throwOnError: true,
|
|
3133
|
+
})
|
|
3134
|
+
return data
|
|
3135
|
+
},
|
|
3136
|
+
}
|
|
3137
|
+
return mutationOptions
|
|
3138
|
+
}
|
|
3139
|
+
|
|
3140
|
+
export const getAgentThreadQueryKey = (options: Options<GetAgentThreadData>) =>
|
|
3141
|
+
createQueryKey("getAgentThread", options)
|
|
3142
|
+
|
|
3143
|
+
/**
|
|
3144
|
+
* Get agent thread
|
|
3145
|
+
*/
|
|
3146
|
+
export const getAgentThreadOptions = (options: Options<GetAgentThreadData>) =>
|
|
3147
|
+
queryOptions<
|
|
3148
|
+
GetAgentThreadResponse,
|
|
3149
|
+
GetAgentThreadError,
|
|
3150
|
+
GetAgentThreadResponse,
|
|
3151
|
+
ReturnType<typeof getAgentThreadQueryKey>
|
|
3152
|
+
>({
|
|
3153
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3154
|
+
const { data } = await getAgentThread({
|
|
3155
|
+
...options,
|
|
3156
|
+
...queryKey[0],
|
|
3157
|
+
signal,
|
|
3158
|
+
throwOnError: true,
|
|
3159
|
+
})
|
|
3160
|
+
return data
|
|
3161
|
+
},
|
|
3162
|
+
queryKey: getAgentThreadQueryKey(options),
|
|
3163
|
+
})
|
|
3164
|
+
|
|
3165
|
+
export const listAgentThreadMessagesQueryKey = (options: Options<ListAgentThreadMessagesData>) =>
|
|
3166
|
+
createQueryKey("listAgentThreadMessages", options)
|
|
3167
|
+
|
|
3168
|
+
/**
|
|
3169
|
+
* List agent thread messages
|
|
3170
|
+
*/
|
|
3171
|
+
export const listAgentThreadMessagesOptions = (options: Options<ListAgentThreadMessagesData>) =>
|
|
3172
|
+
queryOptions<
|
|
3173
|
+
ListAgentThreadMessagesResponse,
|
|
3174
|
+
ListAgentThreadMessagesError,
|
|
3175
|
+
ListAgentThreadMessagesResponse,
|
|
3176
|
+
ReturnType<typeof listAgentThreadMessagesQueryKey>
|
|
3177
|
+
>({
|
|
3178
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3179
|
+
const { data } = await listAgentThreadMessages({
|
|
3180
|
+
...options,
|
|
3181
|
+
...queryKey[0],
|
|
3182
|
+
signal,
|
|
3183
|
+
throwOnError: true,
|
|
3184
|
+
})
|
|
3185
|
+
return data
|
|
3186
|
+
},
|
|
3187
|
+
queryKey: listAgentThreadMessagesQueryKey(options),
|
|
3188
|
+
})
|
|
3189
|
+
|
|
3190
|
+
export const listAgentThreadMessagesInfiniteQueryKey = (
|
|
3191
|
+
options: Options<ListAgentThreadMessagesData>
|
|
3192
|
+
): QueryKey<Options<ListAgentThreadMessagesData>> =>
|
|
3193
|
+
createQueryKey("listAgentThreadMessages", options, true)
|
|
3194
|
+
|
|
3195
|
+
/**
|
|
3196
|
+
* List agent thread messages
|
|
3197
|
+
*/
|
|
3198
|
+
export const listAgentThreadMessagesInfiniteOptions = (
|
|
3199
|
+
options: Options<ListAgentThreadMessagesData>
|
|
3200
|
+
) =>
|
|
3201
|
+
infiniteQueryOptions<
|
|
3202
|
+
ListAgentThreadMessagesResponse,
|
|
3203
|
+
ListAgentThreadMessagesError,
|
|
3204
|
+
InfiniteData<ListAgentThreadMessagesResponse>,
|
|
3205
|
+
QueryKey<Options<ListAgentThreadMessagesData>>,
|
|
3206
|
+
| string
|
|
3207
|
+
| Pick<QueryKey<Options<ListAgentThreadMessagesData>>[0], "body" | "headers" | "path" | "query">
|
|
3208
|
+
>(
|
|
3209
|
+
// @ts-ignore
|
|
3210
|
+
{
|
|
3211
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
3212
|
+
// @ts-ignore
|
|
3213
|
+
const page: Pick<
|
|
3214
|
+
QueryKey<Options<ListAgentThreadMessagesData>>[0],
|
|
3215
|
+
"body" | "headers" | "path" | "query"
|
|
3216
|
+
> =
|
|
3217
|
+
typeof pageParam === "object"
|
|
3218
|
+
? pageParam
|
|
3219
|
+
: {
|
|
3220
|
+
query: {
|
|
3221
|
+
offset: pageParam,
|
|
3222
|
+
},
|
|
3223
|
+
}
|
|
3224
|
+
const params = createInfiniteParams(queryKey, page)
|
|
3225
|
+
const { data } = await listAgentThreadMessages({
|
|
3226
|
+
...options,
|
|
3227
|
+
...params,
|
|
3228
|
+
signal,
|
|
3229
|
+
throwOnError: true,
|
|
3230
|
+
})
|
|
3231
|
+
return data
|
|
3232
|
+
},
|
|
3233
|
+
queryKey: listAgentThreadMessagesInfiniteQueryKey(options),
|
|
3234
|
+
}
|
|
3235
|
+
)
|
|
3236
|
+
|
|
3237
|
+
/**
|
|
3238
|
+
* Post an agent thread message
|
|
3239
|
+
*/
|
|
3240
|
+
export const postAgentThreadMessageMutation = (
|
|
3241
|
+
options?: Partial<Options<PostAgentThreadMessageData>>
|
|
3242
|
+
): UseMutationOptions<
|
|
3243
|
+
PostAgentThreadMessageResponse,
|
|
3244
|
+
PostAgentThreadMessageError,
|
|
3245
|
+
Options<PostAgentThreadMessageData>
|
|
3246
|
+
> => {
|
|
3247
|
+
const mutationOptions: UseMutationOptions<
|
|
3248
|
+
PostAgentThreadMessageResponse,
|
|
3249
|
+
PostAgentThreadMessageError,
|
|
3250
|
+
Options<PostAgentThreadMessageData>
|
|
3251
|
+
> = {
|
|
3252
|
+
mutationFn: async (fnOptions) => {
|
|
3253
|
+
const { data } = await postAgentThreadMessage({
|
|
3254
|
+
...options,
|
|
3255
|
+
...fnOptions,
|
|
3256
|
+
throwOnError: true,
|
|
3257
|
+
})
|
|
3258
|
+
return data
|
|
3259
|
+
},
|
|
3260
|
+
}
|
|
3261
|
+
return mutationOptions
|
|
3262
|
+
}
|
|
3263
|
+
|
|
3264
|
+
export const getAgentMessageFileContentQueryKey = (
|
|
3265
|
+
options: Options<GetAgentMessageFileContentData>
|
|
3266
|
+
) => createQueryKey("getAgentMessageFileContent", options)
|
|
3267
|
+
|
|
3268
|
+
/**
|
|
3269
|
+
* Get agent message file content
|
|
3270
|
+
*/
|
|
3271
|
+
export const getAgentMessageFileContentOptions = (
|
|
3272
|
+
options: Options<GetAgentMessageFileContentData>
|
|
3273
|
+
) =>
|
|
3274
|
+
queryOptions<
|
|
3275
|
+
GetAgentMessageFileContentResponse,
|
|
3276
|
+
GetAgentMessageFileContentError,
|
|
3277
|
+
GetAgentMessageFileContentResponse,
|
|
3278
|
+
ReturnType<typeof getAgentMessageFileContentQueryKey>
|
|
3279
|
+
>({
|
|
3280
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3281
|
+
const { data } = await getAgentMessageFileContent({
|
|
3282
|
+
...options,
|
|
3283
|
+
...queryKey[0],
|
|
3284
|
+
signal,
|
|
3285
|
+
throwOnError: true,
|
|
3286
|
+
})
|
|
3287
|
+
return data
|
|
3288
|
+
},
|
|
3289
|
+
queryKey: getAgentMessageFileContentQueryKey(options),
|
|
3290
|
+
})
|
|
3291
|
+
|
|
3292
|
+
/**
|
|
3293
|
+
* Cancel an agent thread's active run
|
|
3294
|
+
*/
|
|
3295
|
+
export const cancelAgentRunMutation = (
|
|
3296
|
+
options?: Partial<Options<CancelAgentRunData>>
|
|
3297
|
+
): UseMutationOptions<CancelAgentRunResponse, CancelAgentRunError, Options<CancelAgentRunData>> => {
|
|
3298
|
+
const mutationOptions: UseMutationOptions<
|
|
3299
|
+
CancelAgentRunResponse,
|
|
3300
|
+
CancelAgentRunError,
|
|
3301
|
+
Options<CancelAgentRunData>
|
|
3302
|
+
> = {
|
|
3303
|
+
mutationFn: async (fnOptions) => {
|
|
3304
|
+
const { data } = await cancelAgentRun({
|
|
3305
|
+
...options,
|
|
3306
|
+
...fnOptions,
|
|
3307
|
+
throwOnError: true,
|
|
3308
|
+
})
|
|
3309
|
+
return data
|
|
3310
|
+
},
|
|
3311
|
+
}
|
|
3312
|
+
return mutationOptions
|
|
3313
|
+
}
|
|
3314
|
+
|
|
3315
|
+
/**
|
|
3316
|
+
* Retry a failed agent run
|
|
3317
|
+
*/
|
|
3318
|
+
export const retryAgentRunMutation = (
|
|
3319
|
+
options?: Partial<Options<RetryAgentRunData>>
|
|
3320
|
+
): UseMutationOptions<RetryAgentRunResponse, RetryAgentRunError, Options<RetryAgentRunData>> => {
|
|
3321
|
+
const mutationOptions: UseMutationOptions<
|
|
3322
|
+
RetryAgentRunResponse,
|
|
3323
|
+
RetryAgentRunError,
|
|
3324
|
+
Options<RetryAgentRunData>
|
|
3325
|
+
> = {
|
|
3326
|
+
mutationFn: async (fnOptions) => {
|
|
3327
|
+
const { data } = await retryAgentRun({
|
|
3328
|
+
...options,
|
|
3329
|
+
...fnOptions,
|
|
3330
|
+
throwOnError: true,
|
|
3331
|
+
})
|
|
3332
|
+
return data
|
|
3333
|
+
},
|
|
3334
|
+
}
|
|
3335
|
+
return mutationOptions
|
|
3336
|
+
}
|
|
3337
|
+
|
|
3338
|
+
export const listAgentThreadRunsQueryKey = (options: Options<ListAgentThreadRunsData>) =>
|
|
3339
|
+
createQueryKey("listAgentThreadRuns", options)
|
|
3340
|
+
|
|
3341
|
+
/**
|
|
3342
|
+
* List an agent thread's runs
|
|
3343
|
+
*/
|
|
3344
|
+
export const listAgentThreadRunsOptions = (options: Options<ListAgentThreadRunsData>) =>
|
|
3345
|
+
queryOptions<
|
|
3346
|
+
ListAgentThreadRunsResponse,
|
|
3347
|
+
ListAgentThreadRunsError,
|
|
3348
|
+
ListAgentThreadRunsResponse,
|
|
3349
|
+
ReturnType<typeof listAgentThreadRunsQueryKey>
|
|
3350
|
+
>({
|
|
3351
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3352
|
+
const { data } = await listAgentThreadRuns({
|
|
3353
|
+
...options,
|
|
3354
|
+
...queryKey[0],
|
|
3355
|
+
signal,
|
|
3356
|
+
throwOnError: true,
|
|
3357
|
+
})
|
|
3358
|
+
return data
|
|
3359
|
+
},
|
|
3360
|
+
queryKey: listAgentThreadRunsQueryKey(options),
|
|
3361
|
+
})
|
|
3362
|
+
|
|
3363
|
+
export const listAgentThreadRunsInfiniteQueryKey = (
|
|
3364
|
+
options: Options<ListAgentThreadRunsData>
|
|
3365
|
+
): QueryKey<Options<ListAgentThreadRunsData>> =>
|
|
3366
|
+
createQueryKey("listAgentThreadRuns", options, true)
|
|
3367
|
+
|
|
3368
|
+
/**
|
|
3369
|
+
* List an agent thread's runs
|
|
3370
|
+
*/
|
|
3371
|
+
export const listAgentThreadRunsInfiniteOptions = (options: Options<ListAgentThreadRunsData>) =>
|
|
3372
|
+
infiniteQueryOptions<
|
|
3373
|
+
ListAgentThreadRunsResponse,
|
|
3374
|
+
ListAgentThreadRunsError,
|
|
3375
|
+
InfiniteData<ListAgentThreadRunsResponse>,
|
|
3376
|
+
QueryKey<Options<ListAgentThreadRunsData>>,
|
|
3377
|
+
| string
|
|
3378
|
+
| Pick<QueryKey<Options<ListAgentThreadRunsData>>[0], "body" | "headers" | "path" | "query">
|
|
3379
|
+
>(
|
|
3380
|
+
// @ts-ignore
|
|
3381
|
+
{
|
|
3382
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
3383
|
+
// @ts-ignore
|
|
3384
|
+
const page: Pick<
|
|
3385
|
+
QueryKey<Options<ListAgentThreadRunsData>>[0],
|
|
3386
|
+
"body" | "headers" | "path" | "query"
|
|
3387
|
+
> =
|
|
3388
|
+
typeof pageParam === "object"
|
|
3389
|
+
? pageParam
|
|
3390
|
+
: {
|
|
3391
|
+
query: {
|
|
3392
|
+
offset: pageParam,
|
|
3393
|
+
},
|
|
3394
|
+
}
|
|
3395
|
+
const params = createInfiniteParams(queryKey, page)
|
|
3396
|
+
const { data } = await listAgentThreadRuns({
|
|
3397
|
+
...options,
|
|
3398
|
+
...params,
|
|
3399
|
+
signal,
|
|
3400
|
+
throwOnError: true,
|
|
3401
|
+
})
|
|
3402
|
+
return data
|
|
3403
|
+
},
|
|
3404
|
+
queryKey: listAgentThreadRunsInfiniteQueryKey(options),
|
|
3405
|
+
}
|
|
3406
|
+
)
|
|
3407
|
+
|
|
3408
|
+
export const getAgentRunQueryKey = (options: Options<GetAgentRunData>) =>
|
|
3409
|
+
createQueryKey("getAgentRun", options)
|
|
3410
|
+
|
|
3411
|
+
/**
|
|
3412
|
+
* Get agent run
|
|
3413
|
+
*/
|
|
3414
|
+
export const getAgentRunOptions = (options: Options<GetAgentRunData>) =>
|
|
3415
|
+
queryOptions<
|
|
3416
|
+
GetAgentRunResponse,
|
|
3417
|
+
GetAgentRunError,
|
|
3418
|
+
GetAgentRunResponse,
|
|
3419
|
+
ReturnType<typeof getAgentRunQueryKey>
|
|
3420
|
+
>({
|
|
3421
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3422
|
+
const { data } = await getAgentRun({
|
|
3423
|
+
...options,
|
|
3424
|
+
...queryKey[0],
|
|
3425
|
+
signal,
|
|
3426
|
+
throwOnError: true,
|
|
3427
|
+
})
|
|
3428
|
+
return data
|
|
3429
|
+
},
|
|
3430
|
+
queryKey: getAgentRunQueryKey(options),
|
|
3431
|
+
})
|
|
3432
|
+
|
|
3433
|
+
export const listObjectLinksQueryKey = (options: Options<ListObjectLinksData>) =>
|
|
3434
|
+
createQueryKey("listObjectLinks", options)
|
|
3435
|
+
|
|
3436
|
+
/**
|
|
3437
|
+
* List object links
|
|
3438
|
+
*/
|
|
3439
|
+
export const listObjectLinksOptions = (options: Options<ListObjectLinksData>) =>
|
|
3440
|
+
queryOptions<
|
|
3441
|
+
ListObjectLinksResponse,
|
|
3442
|
+
ListObjectLinksError,
|
|
3443
|
+
ListObjectLinksResponse,
|
|
3444
|
+
ReturnType<typeof listObjectLinksQueryKey>
|
|
3445
|
+
>({
|
|
3446
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3447
|
+
const { data } = await listObjectLinks({
|
|
3448
|
+
...options,
|
|
3449
|
+
...queryKey[0],
|
|
3450
|
+
signal,
|
|
3451
|
+
throwOnError: true,
|
|
3452
|
+
})
|
|
3453
|
+
return data
|
|
3454
|
+
},
|
|
3455
|
+
queryKey: listObjectLinksQueryKey(options),
|
|
3456
|
+
})
|
|
3457
|
+
|
|
3458
|
+
/**
|
|
3459
|
+
* Remove object link
|
|
3460
|
+
*/
|
|
3461
|
+
export const removeObjectLinkMutation = (
|
|
3462
|
+
options?: Partial<Options<RemoveObjectLinkData>>
|
|
3463
|
+
): UseMutationOptions<
|
|
3464
|
+
RemoveObjectLinkResponse,
|
|
3465
|
+
RemoveObjectLinkError,
|
|
3466
|
+
Options<RemoveObjectLinkData>
|
|
3467
|
+
> => {
|
|
3468
|
+
const mutationOptions: UseMutationOptions<
|
|
3469
|
+
RemoveObjectLinkResponse,
|
|
3470
|
+
RemoveObjectLinkError,
|
|
3471
|
+
Options<RemoveObjectLinkData>
|
|
3472
|
+
> = {
|
|
3473
|
+
mutationFn: async (fnOptions) => {
|
|
3474
|
+
const { data } = await removeObjectLink({
|
|
3475
|
+
...options,
|
|
3476
|
+
...fnOptions,
|
|
3477
|
+
throwOnError: true,
|
|
3478
|
+
})
|
|
3479
|
+
return data
|
|
3480
|
+
},
|
|
3481
|
+
}
|
|
3482
|
+
return mutationOptions
|
|
3483
|
+
}
|
|
3484
|
+
|
|
3485
|
+
/**
|
|
3486
|
+
* Create or update object link
|
|
3487
|
+
*/
|
|
3488
|
+
export const upsertObjectLinkMutation = (
|
|
3489
|
+
options?: Partial<Options<UpsertObjectLinkData>>
|
|
3490
|
+
): UseMutationOptions<
|
|
3491
|
+
UpsertObjectLinkResponse,
|
|
3492
|
+
UpsertObjectLinkError,
|
|
3493
|
+
Options<UpsertObjectLinkData>
|
|
3494
|
+
> => {
|
|
3495
|
+
const mutationOptions: UseMutationOptions<
|
|
3496
|
+
UpsertObjectLinkResponse,
|
|
3497
|
+
UpsertObjectLinkError,
|
|
3498
|
+
Options<UpsertObjectLinkData>
|
|
3499
|
+
> = {
|
|
3500
|
+
mutationFn: async (fnOptions) => {
|
|
3501
|
+
const { data } = await upsertObjectLink({
|
|
3502
|
+
...options,
|
|
3503
|
+
...fnOptions,
|
|
3504
|
+
throwOnError: true,
|
|
3505
|
+
})
|
|
3506
|
+
return data
|
|
3507
|
+
},
|
|
3508
|
+
}
|
|
3509
|
+
return mutationOptions
|
|
3510
|
+
}
|
|
3511
|
+
|
|
3512
|
+
/**
|
|
3513
|
+
* Append telemetry point
|
|
3514
|
+
*/
|
|
3515
|
+
export const appendTelemetryMutation = (
|
|
3516
|
+
options?: Partial<Options<AppendTelemetryData>>
|
|
3517
|
+
): UseMutationOptions<
|
|
3518
|
+
AppendTelemetryResponse,
|
|
3519
|
+
AppendTelemetryError,
|
|
3520
|
+
Options<AppendTelemetryData>
|
|
3521
|
+
> => {
|
|
3522
|
+
const mutationOptions: UseMutationOptions<
|
|
3523
|
+
AppendTelemetryResponse,
|
|
3524
|
+
AppendTelemetryError,
|
|
3525
|
+
Options<AppendTelemetryData>
|
|
3526
|
+
> = {
|
|
3527
|
+
mutationFn: async (fnOptions) => {
|
|
3528
|
+
const { data } = await appendTelemetry({
|
|
3529
|
+
...options,
|
|
3530
|
+
...fnOptions,
|
|
3531
|
+
throwOnError: true,
|
|
3532
|
+
})
|
|
3533
|
+
return data
|
|
3534
|
+
},
|
|
3535
|
+
}
|
|
3536
|
+
return mutationOptions
|
|
3537
|
+
}
|
|
3538
|
+
|
|
3539
|
+
/**
|
|
3540
|
+
* Get bulk telemetry history
|
|
3541
|
+
*/
|
|
3542
|
+
export const getBulkTelemetryHistoryMutation = (
|
|
3543
|
+
options?: Partial<Options<GetBulkTelemetryHistoryData>>
|
|
3544
|
+
): UseMutationOptions<
|
|
3545
|
+
GetBulkTelemetryHistoryResponse,
|
|
3546
|
+
GetBulkTelemetryHistoryError,
|
|
3547
|
+
Options<GetBulkTelemetryHistoryData>
|
|
3548
|
+
> => {
|
|
3549
|
+
const mutationOptions: UseMutationOptions<
|
|
3550
|
+
GetBulkTelemetryHistoryResponse,
|
|
3551
|
+
GetBulkTelemetryHistoryError,
|
|
3552
|
+
Options<GetBulkTelemetryHistoryData>
|
|
3553
|
+
> = {
|
|
3554
|
+
mutationFn: async (fnOptions) => {
|
|
3555
|
+
const { data } = await getBulkTelemetryHistory({
|
|
3556
|
+
...options,
|
|
3557
|
+
...fnOptions,
|
|
3558
|
+
throwOnError: true,
|
|
3559
|
+
})
|
|
3560
|
+
return data
|
|
3561
|
+
},
|
|
3562
|
+
}
|
|
3563
|
+
return mutationOptions
|
|
3564
|
+
}
|
|
3565
|
+
|
|
3566
|
+
export const getTelemetryHistoryQueryKey = (options: Options<GetTelemetryHistoryData>) =>
|
|
3567
|
+
createQueryKey("getTelemetryHistory", options)
|
|
3568
|
+
|
|
3569
|
+
/**
|
|
3570
|
+
* Get telemetry history
|
|
3571
|
+
*/
|
|
3572
|
+
export const getTelemetryHistoryOptions = (options: Options<GetTelemetryHistoryData>) =>
|
|
3573
|
+
queryOptions<
|
|
3574
|
+
GetTelemetryHistoryResponse,
|
|
3575
|
+
GetTelemetryHistoryError,
|
|
3576
|
+
GetTelemetryHistoryResponse,
|
|
3577
|
+
ReturnType<typeof getTelemetryHistoryQueryKey>
|
|
3578
|
+
>({
|
|
3579
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3580
|
+
const { data } = await getTelemetryHistory({
|
|
3581
|
+
...options,
|
|
3582
|
+
...queryKey[0],
|
|
3583
|
+
signal,
|
|
3584
|
+
throwOnError: true,
|
|
3585
|
+
})
|
|
3586
|
+
return data
|
|
3587
|
+
},
|
|
3588
|
+
queryKey: getTelemetryHistoryQueryKey(options),
|
|
3589
|
+
})
|
|
3590
|
+
|
|
3591
|
+
export const getLatestTelemetryQueryKey = (options: Options<GetLatestTelemetryData>) =>
|
|
3592
|
+
createQueryKey("getLatestTelemetry", options)
|
|
3593
|
+
|
|
3594
|
+
/**
|
|
3595
|
+
* Get latest telemetry point
|
|
3596
|
+
*/
|
|
3597
|
+
export const getLatestTelemetryOptions = (options: Options<GetLatestTelemetryData>) =>
|
|
3598
|
+
queryOptions<
|
|
3599
|
+
GetLatestTelemetryResponse,
|
|
3600
|
+
GetLatestTelemetryError,
|
|
3601
|
+
GetLatestTelemetryResponse,
|
|
3602
|
+
ReturnType<typeof getLatestTelemetryQueryKey>
|
|
3603
|
+
>({
|
|
3604
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3605
|
+
const { data } = await getLatestTelemetry({
|
|
3606
|
+
...options,
|
|
3607
|
+
...queryKey[0],
|
|
3608
|
+
signal,
|
|
3609
|
+
throwOnError: true,
|
|
3610
|
+
})
|
|
3611
|
+
return data
|
|
3612
|
+
},
|
|
3613
|
+
queryKey: getLatestTelemetryQueryKey(options),
|
|
3614
|
+
})
|
|
3615
|
+
|
|
3616
|
+
export const listEventsQueryKey = (options?: Options<ListEventsData>) =>
|
|
3617
|
+
createQueryKey("listEvents", options)
|
|
3618
|
+
|
|
3619
|
+
/**
|
|
3620
|
+
* Read domain events
|
|
3621
|
+
*/
|
|
3622
|
+
export const listEventsOptions = (options?: Options<ListEventsData>) =>
|
|
3623
|
+
queryOptions<
|
|
3624
|
+
ListEventsResponse,
|
|
3625
|
+
ListEventsError,
|
|
3626
|
+
ListEventsResponse,
|
|
3627
|
+
ReturnType<typeof listEventsQueryKey>
|
|
3628
|
+
>({
|
|
3629
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3630
|
+
const { data } = await listEvents({
|
|
3631
|
+
...options,
|
|
3632
|
+
...queryKey[0],
|
|
3633
|
+
signal,
|
|
3634
|
+
throwOnError: true,
|
|
3635
|
+
})
|
|
3636
|
+
return data
|
|
3637
|
+
},
|
|
3638
|
+
queryKey: listEventsQueryKey(options),
|
|
3639
|
+
})
|
|
3640
|
+
|
|
3641
|
+
export const listLogsQueryKey = (options?: Options<ListLogsData>) =>
|
|
3642
|
+
createQueryKey("listLogs", options)
|
|
3643
|
+
|
|
3644
|
+
/**
|
|
3645
|
+
* Read run logs
|
|
3646
|
+
*/
|
|
3647
|
+
export const listLogsOptions = (options?: Options<ListLogsData>) =>
|
|
3648
|
+
queryOptions<
|
|
3649
|
+
ListLogsResponse,
|
|
3650
|
+
ListLogsError,
|
|
3651
|
+
ListLogsResponse,
|
|
3652
|
+
ReturnType<typeof listLogsQueryKey>
|
|
3653
|
+
>({
|
|
3654
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3655
|
+
const { data } = await listLogs({
|
|
3656
|
+
...options,
|
|
3657
|
+
...queryKey[0],
|
|
3658
|
+
signal,
|
|
3659
|
+
throwOnError: true,
|
|
3660
|
+
})
|
|
3661
|
+
return data
|
|
3662
|
+
},
|
|
3663
|
+
queryKey: listLogsQueryKey(options),
|
|
3664
|
+
})
|
|
3665
|
+
|
|
3666
|
+
export const listProjectionsQueryKey = (options?: Options<ListProjectionsData>) =>
|
|
3667
|
+
createQueryKey("listProjections", options)
|
|
3668
|
+
|
|
3669
|
+
/**
|
|
3670
|
+
* List all projection definitions
|
|
3671
|
+
*/
|
|
3672
|
+
export const listProjectionsOptions = (options?: Options<ListProjectionsData>) =>
|
|
3673
|
+
queryOptions<
|
|
3674
|
+
ListProjectionsResponse,
|
|
3675
|
+
DefaultError,
|
|
3676
|
+
ListProjectionsResponse,
|
|
3677
|
+
ReturnType<typeof listProjectionsQueryKey>
|
|
3678
|
+
>({
|
|
3679
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3680
|
+
const { data } = await listProjections({
|
|
3681
|
+
...options,
|
|
3682
|
+
...queryKey[0],
|
|
3683
|
+
signal,
|
|
3684
|
+
throwOnError: true,
|
|
3685
|
+
})
|
|
3686
|
+
return data
|
|
3687
|
+
},
|
|
3688
|
+
queryKey: listProjectionsQueryKey(options),
|
|
3689
|
+
})
|
|
3690
|
+
|
|
3691
|
+
export const getProjectionQueryKey = (options: Options<GetProjectionData>) =>
|
|
3692
|
+
createQueryKey("getProjection", options)
|
|
3693
|
+
|
|
3694
|
+
/**
|
|
3695
|
+
* Get a projection definition by id
|
|
3696
|
+
*/
|
|
3697
|
+
export const getProjectionOptions = (options: Options<GetProjectionData>) =>
|
|
3698
|
+
queryOptions<
|
|
3699
|
+
GetProjectionResponse,
|
|
3700
|
+
GetProjectionError,
|
|
3701
|
+
GetProjectionResponse,
|
|
3702
|
+
ReturnType<typeof getProjectionQueryKey>
|
|
3703
|
+
>({
|
|
3704
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3705
|
+
const { data } = await getProjection({
|
|
3706
|
+
...options,
|
|
3707
|
+
...queryKey[0],
|
|
3708
|
+
signal,
|
|
3709
|
+
throwOnError: true,
|
|
3710
|
+
})
|
|
3711
|
+
return data
|
|
3712
|
+
},
|
|
3713
|
+
queryKey: getProjectionQueryKey(options),
|
|
3714
|
+
})
|
|
3715
|
+
|
|
3716
|
+
export const listProjectionRunsQueryKey = (options?: Options<ListProjectionRunsData>) =>
|
|
3717
|
+
createQueryKey("listProjectionRuns", options)
|
|
3718
|
+
|
|
3719
|
+
/**
|
|
3720
|
+
* List projection run history
|
|
3721
|
+
*/
|
|
3722
|
+
export const listProjectionRunsOptions = (options?: Options<ListProjectionRunsData>) =>
|
|
3723
|
+
queryOptions<
|
|
3724
|
+
ListProjectionRunsResponse,
|
|
3725
|
+
ListProjectionRunsError,
|
|
3726
|
+
ListProjectionRunsResponse,
|
|
3727
|
+
ReturnType<typeof listProjectionRunsQueryKey>
|
|
3728
|
+
>({
|
|
3729
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3730
|
+
const { data } = await listProjectionRuns({
|
|
3731
|
+
...options,
|
|
3732
|
+
...queryKey[0],
|
|
3733
|
+
signal,
|
|
3734
|
+
throwOnError: true,
|
|
3735
|
+
})
|
|
3736
|
+
return data
|
|
3737
|
+
},
|
|
3738
|
+
queryKey: listProjectionRunsQueryKey(options),
|
|
3739
|
+
})
|
|
3740
|
+
|
|
3741
|
+
export const listProjectionRunsInfiniteQueryKey = (
|
|
3742
|
+
options?: Options<ListProjectionRunsData>
|
|
3743
|
+
): QueryKey<Options<ListProjectionRunsData>> => createQueryKey("listProjectionRuns", options, true)
|
|
3744
|
+
|
|
3745
|
+
/**
|
|
3746
|
+
* List projection run history
|
|
3747
|
+
*/
|
|
3748
|
+
export const listProjectionRunsInfiniteOptions = (options?: Options<ListProjectionRunsData>) =>
|
|
3749
|
+
infiniteQueryOptions<
|
|
3750
|
+
ListProjectionRunsResponse,
|
|
3751
|
+
ListProjectionRunsError,
|
|
3752
|
+
InfiniteData<ListProjectionRunsResponse>,
|
|
3753
|
+
QueryKey<Options<ListProjectionRunsData>>,
|
|
3754
|
+
| string
|
|
3755
|
+
| Pick<QueryKey<Options<ListProjectionRunsData>>[0], "body" | "headers" | "path" | "query">
|
|
3756
|
+
>(
|
|
3757
|
+
// @ts-ignore
|
|
3758
|
+
{
|
|
3759
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
3760
|
+
// @ts-ignore
|
|
3761
|
+
const page: Pick<
|
|
3762
|
+
QueryKey<Options<ListProjectionRunsData>>[0],
|
|
3763
|
+
"body" | "headers" | "path" | "query"
|
|
3764
|
+
> =
|
|
3765
|
+
typeof pageParam === "object"
|
|
3766
|
+
? pageParam
|
|
3767
|
+
: {
|
|
3768
|
+
query: {
|
|
3769
|
+
offset: pageParam,
|
|
3770
|
+
},
|
|
3771
|
+
}
|
|
3772
|
+
const params = createInfiniteParams(queryKey, page)
|
|
3773
|
+
const { data } = await listProjectionRuns({
|
|
3774
|
+
...options,
|
|
3775
|
+
...params,
|
|
3776
|
+
signal,
|
|
3777
|
+
throwOnError: true,
|
|
3778
|
+
})
|
|
3779
|
+
return data
|
|
3780
|
+
},
|
|
3781
|
+
queryKey: listProjectionRunsInfiniteQueryKey(options),
|
|
3782
|
+
}
|
|
3783
|
+
)
|
|
3784
|
+
|
|
3785
|
+
export const getProjectionRunQueryKey = (options: Options<GetProjectionRunData>) =>
|
|
3786
|
+
createQueryKey("getProjectionRun", options)
|
|
3787
|
+
|
|
3788
|
+
/**
|
|
3789
|
+
* Get a projection run by id
|
|
3790
|
+
*/
|
|
3791
|
+
export const getProjectionRunOptions = (options: Options<GetProjectionRunData>) =>
|
|
3792
|
+
queryOptions<
|
|
3793
|
+
GetProjectionRunResponse,
|
|
3794
|
+
GetProjectionRunError,
|
|
3795
|
+
GetProjectionRunResponse,
|
|
3796
|
+
ReturnType<typeof getProjectionRunQueryKey>
|
|
3797
|
+
>({
|
|
3798
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3799
|
+
const { data } = await getProjectionRun({
|
|
3800
|
+
...options,
|
|
3801
|
+
...queryKey[0],
|
|
3802
|
+
signal,
|
|
3803
|
+
throwOnError: true,
|
|
3804
|
+
})
|
|
3805
|
+
return data
|
|
3806
|
+
},
|
|
3807
|
+
queryKey: getProjectionRunQueryKey(options),
|
|
3808
|
+
})
|
|
3809
|
+
|
|
3810
|
+
export const listWebhookRunsQueryKey = (options?: Options<ListWebhookRunsData>) =>
|
|
3811
|
+
createQueryKey("listWebhookRuns", options)
|
|
3812
|
+
|
|
3813
|
+
/**
|
|
3814
|
+
* List webhook run history
|
|
3815
|
+
*/
|
|
3816
|
+
export const listWebhookRunsOptions = (options?: Options<ListWebhookRunsData>) =>
|
|
3817
|
+
queryOptions<
|
|
3818
|
+
ListWebhookRunsResponse,
|
|
3819
|
+
ListWebhookRunsError,
|
|
3820
|
+
ListWebhookRunsResponse,
|
|
3821
|
+
ReturnType<typeof listWebhookRunsQueryKey>
|
|
3822
|
+
>({
|
|
3823
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
3824
|
+
const { data } = await listWebhookRuns({
|
|
3825
|
+
...options,
|
|
3826
|
+
...queryKey[0],
|
|
3827
|
+
signal,
|
|
3828
|
+
throwOnError: true,
|
|
3829
|
+
})
|
|
3830
|
+
return data
|
|
3831
|
+
},
|
|
3832
|
+
queryKey: listWebhookRunsQueryKey(options),
|
|
3833
|
+
})
|
|
3834
|
+
|
|
3835
|
+
export const listWebhookRunsInfiniteQueryKey = (
|
|
3836
|
+
options?: Options<ListWebhookRunsData>
|
|
3837
|
+
): QueryKey<Options<ListWebhookRunsData>> => createQueryKey("listWebhookRuns", options, true)
|
|
3838
|
+
|
|
3839
|
+
/**
|
|
3840
|
+
* List webhook run history
|
|
3841
|
+
*/
|
|
3842
|
+
export const listWebhookRunsInfiniteOptions = (options?: Options<ListWebhookRunsData>) =>
|
|
3843
|
+
infiniteQueryOptions<
|
|
3844
|
+
ListWebhookRunsResponse,
|
|
3845
|
+
ListWebhookRunsError,
|
|
3846
|
+
InfiniteData<ListWebhookRunsResponse>,
|
|
3847
|
+
QueryKey<Options<ListWebhookRunsData>>,
|
|
3848
|
+
string | Pick<QueryKey<Options<ListWebhookRunsData>>[0], "body" | "headers" | "path" | "query">
|
|
3849
|
+
>(
|
|
3850
|
+
// @ts-ignore
|
|
3851
|
+
{
|
|
3852
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
3853
|
+
// @ts-ignore
|
|
3854
|
+
const page: Pick<
|
|
3855
|
+
QueryKey<Options<ListWebhookRunsData>>[0],
|
|
3856
|
+
"body" | "headers" | "path" | "query"
|
|
3857
|
+
> =
|
|
3858
|
+
typeof pageParam === "object"
|
|
3859
|
+
? pageParam
|
|
3860
|
+
: {
|
|
3861
|
+
query: {
|
|
3862
|
+
offset: pageParam,
|
|
3863
|
+
},
|
|
3864
|
+
}
|
|
3865
|
+
const params = createInfiniteParams(queryKey, page)
|
|
3866
|
+
const { data } = await listWebhookRuns({
|
|
3867
|
+
...options,
|
|
3868
|
+
...params,
|
|
3869
|
+
signal,
|
|
3870
|
+
throwOnError: true,
|
|
3871
|
+
})
|
|
3872
|
+
return data
|
|
3873
|
+
},
|
|
3874
|
+
queryKey: listWebhookRunsInfiniteQueryKey(options),
|
|
3875
|
+
}
|
|
3876
|
+
)
|