@runloop/reflex-client 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +4 -0
  2. package/dist/generated/model/adminSetOrgSandboxProviderBody.d.ts +11 -0
  3. package/dist/generated/model/adminSetOrgSandboxProviderBody.d.ts.map +1 -0
  4. package/dist/generated/model/adminSetOrgSandboxProviderBody.js +8 -0
  5. package/dist/generated/model/adminSetOrgSandboxProviderBody.js.map +1 -0
  6. package/dist/generated/model/adminSetOrgSecretBody.d.ts +11 -0
  7. package/dist/generated/model/adminSetOrgSecretBody.d.ts.map +1 -0
  8. package/dist/generated/model/adminSetOrgSecretBody.js +8 -0
  9. package/dist/generated/model/adminSetOrgSecretBody.js.map +1 -0
  10. package/dist/generated/model/adminValidateOrgSandboxProviderBody.d.ts +11 -0
  11. package/dist/generated/model/adminValidateOrgSandboxProviderBody.d.ts.map +1 -0
  12. package/dist/generated/model/adminValidateOrgSandboxProviderBody.js +8 -0
  13. package/dist/generated/model/adminValidateOrgSandboxProviderBody.js.map +1 -0
  14. package/dist/generated/model/index.d.ts +3 -0
  15. package/dist/generated/model/index.d.ts.map +1 -1
  16. package/dist/generated/model/index.js +3 -0
  17. package/dist/generated/model/index.js.map +1 -1
  18. package/dist/generated/org-setup.d.ts +197 -0
  19. package/dist/generated/org-setup.d.ts.map +1 -0
  20. package/dist/generated/org-setup.js +179 -0
  21. package/dist/generated/org-setup.js.map +1 -0
  22. package/dist/generated/organizations.d.ts +37 -161
  23. package/dist/generated/organizations.d.ts.map +1 -1
  24. package/dist/generated/organizations.js +27 -133
  25. package/dist/generated/organizations.js.map +1 -1
  26. package/dist/index.d.ts +1 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +1 -0
  29. package/dist/index.js.map +1 -1
  30. package/dist/react/model/adminSetOrgSandboxProviderBody.d.ts +11 -0
  31. package/dist/react/model/adminSetOrgSandboxProviderBody.d.ts.map +1 -0
  32. package/dist/react/model/adminSetOrgSandboxProviderBody.js +8 -0
  33. package/dist/react/model/adminSetOrgSandboxProviderBody.js.map +1 -0
  34. package/dist/react/model/adminSetOrgSecretBody.d.ts +11 -0
  35. package/dist/react/model/adminSetOrgSecretBody.d.ts.map +1 -0
  36. package/dist/react/model/adminSetOrgSecretBody.js +8 -0
  37. package/dist/react/model/adminSetOrgSecretBody.js.map +1 -0
  38. package/dist/react/model/adminValidateOrgSandboxProviderBody.d.ts +11 -0
  39. package/dist/react/model/adminValidateOrgSandboxProviderBody.d.ts.map +1 -0
  40. package/dist/react/model/adminValidateOrgSandboxProviderBody.js +8 -0
  41. package/dist/react/model/adminValidateOrgSandboxProviderBody.js.map +1 -0
  42. package/dist/react/org-setup.d.ts +324 -0
  43. package/dist/react/org-setup.d.ts.map +1 -0
  44. package/dist/react/org-setup.js +369 -0
  45. package/dist/react/org-setup.js.map +1 -0
  46. package/dist/react/organizations.d.ts +85 -304
  47. package/dist/react/organizations.d.ts.map +1 -1
  48. package/dist/react/organizations.js +55 -266
  49. package/dist/react/organizations.js.map +1 -1
  50. package/package.json +1 -1
  51. package/src/generated/model/adminSetOrgSandboxProviderBody.ts +11 -0
  52. package/src/generated/model/adminSetOrgSecretBody.ts +11 -0
  53. package/src/generated/model/adminValidateOrgSandboxProviderBody.ts +11 -0
  54. package/src/generated/model/index.ts +3 -0
  55. package/src/generated/org-setup.ts +501 -0
  56. package/src/generated/organizations.ts +52 -367
  57. package/src/index.ts +1 -0
  58. package/src/react/model/adminSetOrgSandboxProviderBody.ts +11 -0
  59. package/src/react/model/adminSetOrgSecretBody.ts +11 -0
  60. package/src/react/model/adminValidateOrgSandboxProviderBody.ts +11 -0
  61. package/src/react/org-setup.ts +911 -0
  62. package/src/react/organizations.ts +108 -630
@@ -0,0 +1,911 @@
1
+ /**
2
+ * Generated by orval v8.18.0 🍺
3
+ * Do not edit manually.
4
+ * Reflex API
5
+ * OpenAPI spec version: 1.0.0
6
+ */
7
+ import {
8
+ useMutation,
9
+ useQuery
10
+ } from '@tanstack/react-query';
11
+ import type {
12
+ MutationFunction,
13
+ QueryFunction,
14
+ QueryKey,
15
+ UseMutationOptions,
16
+ UseMutationResult,
17
+ UseQueryOptions,
18
+ UseQueryResult
19
+ } from '@tanstack/react-query';
20
+
21
+ import type {
22
+ CopyOrgKeyMaterialBody
23
+ } from './model/copyOrgKeyMaterialBody.js';
24
+
25
+ import type {
26
+ ErrorEnvelope
27
+ } from './model/errorEnvelope.js';
28
+
29
+ import type {
30
+ ProvisionOrganizationRunloopAccount200
31
+ } from './model/provisionOrganizationRunloopAccount200.js';
32
+
33
+ import type {
34
+ SetOrgSecretBody
35
+ } from './model/setOrgSecretBody.js';
36
+
37
+ import type {
38
+ SetSandboxProviderBody
39
+ } from './model/setSandboxProviderBody.js';
40
+
41
+ import type {
42
+ ValidateSandboxProviderBody
43
+ } from './model/validateSandboxProviderBody.js';
44
+
45
+ import { apiFetch } from '../react-mutator.js';
46
+
47
+
48
+ type AwaitedInput<T> = PromiseLike<T> | T;
49
+
50
+ type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
51
+
52
+
53
+ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
54
+
55
+
56
+
57
+ const withQueryKey = <T extends object, K>(query: T, queryKey: K): T & { queryKey: K } => {
58
+ const result = { queryKey } as T & { queryKey: K };
59
+ for (const key of Object.keys(query)) {
60
+ // The explicit queryKey always wins, matching the previous
61
+ // `{ ...query, queryKey }` spread where it was set last.
62
+ if (key === 'queryKey') continue;
63
+ Object.defineProperty(result, key, {
64
+ enumerable: true,
65
+ configurable: true,
66
+ get: () => (query as Record<string, unknown>)[key],
67
+ });
68
+ }
69
+ return result;
70
+ };
71
+
72
+ /**
73
+ * @summary Mark the org's guided setup as complete.
74
+ */
75
+ export const completeOrgBootstrap = (
76
+
77
+ options?: SecondParameter<typeof apiFetch>,signal?: AbortSignal
78
+ ) => {
79
+
80
+
81
+ return apiFetch<void>(
82
+ {url: `/org-setup/bootstrap-complete`, method: 'POST', signal
83
+ },
84
+ options);
85
+ }
86
+
87
+
88
+
89
+ export const getCompleteOrgBootstrapMutationOptions = <TError = unknown,
90
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof completeOrgBootstrap>>, TError,void, TContext>, request?: SecondParameter<typeof apiFetch>}
91
+ ): UseMutationOptions<Awaited<ReturnType<typeof completeOrgBootstrap>>, TError,void, TContext> => {
92
+
93
+ const mutationKey = ['completeOrgBootstrap'];
94
+ const {mutation: mutationOptions, request: requestOptions} = options ?
95
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
96
+ options
97
+ : {...options, mutation: {...options.mutation, mutationKey}}
98
+ : {mutation: { mutationKey, }, request: undefined};
99
+
100
+
101
+
102
+
103
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof completeOrgBootstrap>>, void> = () => {
104
+
105
+
106
+ return completeOrgBootstrap(requestOptions)
107
+ }
108
+
109
+
110
+
111
+
112
+
113
+
114
+ return { mutationFn, ...mutationOptions }}
115
+
116
+ export type CompleteOrgBootstrapMutationResult = NonNullable<Awaited<ReturnType<typeof completeOrgBootstrap>>>
117
+
118
+ export type CompleteOrgBootstrapMutationError = unknown
119
+
120
+ /**
121
+ * @summary Mark the org's guided setup as complete.
122
+ */
123
+ export const useCompleteOrgBootstrap = <TError = unknown,
124
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof completeOrgBootstrap>>, TError,void, TContext>, request?: SecondParameter<typeof apiFetch>}
125
+ ): UseMutationResult<
126
+ Awaited<ReturnType<typeof completeOrgBootstrap>>,
127
+ TError,
128
+ void,
129
+ TContext
130
+ > => {
131
+ return useMutation(getCompleteOrgBootstrapMutationOptions(options));
132
+ }
133
+ /**
134
+ * The caller needs secrets access on both the source and target orgs.
135
+ * @summary Copy sandbox and model provider keys from another org.
136
+ */
137
+ export const copyOrgKeyMaterial = (
138
+ copyOrgKeyMaterialBody: CopyOrgKeyMaterialBody,
139
+ options?: SecondParameter<typeof apiFetch>,signal?: AbortSignal
140
+ ) => {
141
+
142
+
143
+ return apiFetch<void>(
144
+ {url: `/org-setup/copy-key-material`, method: 'POST',
145
+ headers: {'Content-Type': 'application/json', },
146
+ data: copyOrgKeyMaterialBody, signal
147
+ },
148
+ options);
149
+ }
150
+
151
+
152
+
153
+ export const getCopyOrgKeyMaterialMutationOptions = <TError = unknown,
154
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof copyOrgKeyMaterial>>, TError,{data: CopyOrgKeyMaterialBody}, TContext>, request?: SecondParameter<typeof apiFetch>}
155
+ ): UseMutationOptions<Awaited<ReturnType<typeof copyOrgKeyMaterial>>, TError,{data: CopyOrgKeyMaterialBody}, TContext> => {
156
+
157
+ const mutationKey = ['copyOrgKeyMaterial'];
158
+ const {mutation: mutationOptions, request: requestOptions} = options ?
159
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
160
+ options
161
+ : {...options, mutation: {...options.mutation, mutationKey}}
162
+ : {mutation: { mutationKey, }, request: undefined};
163
+
164
+
165
+
166
+
167
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof copyOrgKeyMaterial>>, {data: CopyOrgKeyMaterialBody}> = (props) => {
168
+ const {data} = props ?? {};
169
+
170
+ return copyOrgKeyMaterial(data,requestOptions)
171
+ }
172
+
173
+
174
+
175
+
176
+
177
+
178
+ return { mutationFn, ...mutationOptions }}
179
+
180
+ export type CopyOrgKeyMaterialMutationResult = NonNullable<Awaited<ReturnType<typeof copyOrgKeyMaterial>>>
181
+ export type CopyOrgKeyMaterialMutationBody = CopyOrgKeyMaterialBody
182
+ export type CopyOrgKeyMaterialMutationError = unknown
183
+
184
+ /**
185
+ * @summary Copy sandbox and model provider keys from another org.
186
+ */
187
+ export const useCopyOrgKeyMaterial = <TError = unknown,
188
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof copyOrgKeyMaterial>>, TError,{data: CopyOrgKeyMaterialBody}, TContext>, request?: SecondParameter<typeof apiFetch>}
189
+ ): UseMutationResult<
190
+ Awaited<ReturnType<typeof copyOrgKeyMaterial>>,
191
+ TError,
192
+ {data: CopyOrgKeyMaterialBody},
193
+ TContext
194
+ > => {
195
+ return useMutation(getCopyOrgKeyMaterialMutationOptions(options));
196
+ }
197
+ /**
198
+ * @summary Mark a plugin setup step as complete.
199
+ */
200
+ export const completePluginSetupStep = (
201
+ plugin: string,
202
+ step: string,
203
+ options?: SecondParameter<typeof apiFetch>,signal?: AbortSignal
204
+ ) => {
205
+
206
+
207
+ return apiFetch<void>(
208
+ {url: `/org-setup/plugins/${encodeURIComponent(String(plugin))}/setup-steps/${encodeURIComponent(String(step))}/complete`, method: 'POST', signal
209
+ },
210
+ options);
211
+ }
212
+
213
+
214
+
215
+ export const getCompletePluginSetupStepMutationOptions = <TError = unknown,
216
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof completePluginSetupStep>>, TError,{plugin: string;step: string}, TContext>, request?: SecondParameter<typeof apiFetch>}
217
+ ): UseMutationOptions<Awaited<ReturnType<typeof completePluginSetupStep>>, TError,{plugin: string;step: string}, TContext> => {
218
+
219
+ const mutationKey = ['completePluginSetupStep'];
220
+ const {mutation: mutationOptions, request: requestOptions} = options ?
221
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
222
+ options
223
+ : {...options, mutation: {...options.mutation, mutationKey}}
224
+ : {mutation: { mutationKey, }, request: undefined};
225
+
226
+
227
+
228
+
229
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof completePluginSetupStep>>, {plugin: string;step: string}> = (props) => {
230
+ const {plugin,step} = props ?? {};
231
+
232
+ return completePluginSetupStep(plugin,step,requestOptions)
233
+ }
234
+
235
+
236
+
237
+
238
+
239
+
240
+ return { mutationFn, ...mutationOptions }}
241
+
242
+ export type CompletePluginSetupStepMutationResult = NonNullable<Awaited<ReturnType<typeof completePluginSetupStep>>>
243
+
244
+ export type CompletePluginSetupStepMutationError = unknown
245
+
246
+ /**
247
+ * @summary Mark a plugin setup step as complete.
248
+ */
249
+ export const useCompletePluginSetupStep = <TError = unknown,
250
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof completePluginSetupStep>>, TError,{plugin: string;step: string}, TContext>, request?: SecondParameter<typeof apiFetch>}
251
+ ): UseMutationResult<
252
+ Awaited<ReturnType<typeof completePluginSetupStep>>,
253
+ TError,
254
+ {plugin: string;step: string},
255
+ TContext
256
+ > => {
257
+ return useMutation(getCompletePluginSetupStepMutationOptions(options));
258
+ }
259
+ /**
260
+ * @summary Run a plugin setup step's connection test.
261
+ */
262
+ export const testPluginSetupStep = (
263
+ plugin: string,
264
+ step: string,
265
+ options?: SecondParameter<typeof apiFetch>,signal?: AbortSignal
266
+ ) => {
267
+
268
+
269
+ return apiFetch<void>(
270
+ {url: `/org-setup/plugins/${encodeURIComponent(String(plugin))}/setup-steps/${encodeURIComponent(String(step))}/test`, method: 'POST', signal
271
+ },
272
+ options);
273
+ }
274
+
275
+
276
+
277
+ export const getTestPluginSetupStepMutationOptions = <TError = unknown,
278
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof testPluginSetupStep>>, TError,{plugin: string;step: string}, TContext>, request?: SecondParameter<typeof apiFetch>}
279
+ ): UseMutationOptions<Awaited<ReturnType<typeof testPluginSetupStep>>, TError,{plugin: string;step: string}, TContext> => {
280
+
281
+ const mutationKey = ['testPluginSetupStep'];
282
+ const {mutation: mutationOptions, request: requestOptions} = options ?
283
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
284
+ options
285
+ : {...options, mutation: {...options.mutation, mutationKey}}
286
+ : {mutation: { mutationKey, }, request: undefined};
287
+
288
+
289
+
290
+
291
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof testPluginSetupStep>>, {plugin: string;step: string}> = (props) => {
292
+ const {plugin,step} = props ?? {};
293
+
294
+ return testPluginSetupStep(plugin,step,requestOptions)
295
+ }
296
+
297
+
298
+
299
+
300
+
301
+
302
+ return { mutationFn, ...mutationOptions }}
303
+
304
+ export type TestPluginSetupStepMutationResult = NonNullable<Awaited<ReturnType<typeof testPluginSetupStep>>>
305
+
306
+ export type TestPluginSetupStepMutationError = unknown
307
+
308
+ /**
309
+ * @summary Run a plugin setup step's connection test.
310
+ */
311
+ export const useTestPluginSetupStep = <TError = unknown,
312
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof testPluginSetupStep>>, TError,{plugin: string;step: string}, TContext>, request?: SecondParameter<typeof apiFetch>}
313
+ ): UseMutationResult<
314
+ Awaited<ReturnType<typeof testPluginSetupStep>>,
315
+ TError,
316
+ {plugin: string;step: string},
317
+ TContext
318
+ > => {
319
+ return useMutation(getTestPluginSetupStepMutationOptions(options));
320
+ }
321
+ /**
322
+ * @summary List setup steps for the org's active plugins.
323
+ */
324
+ export const listPluginSetupSteps = (
325
+
326
+ options?: SecondParameter<typeof apiFetch>,signal?: AbortSignal
327
+ ) => {
328
+
329
+
330
+ return apiFetch<void>(
331
+ {url: `/org-setup/plugins/setup-steps`, method: 'GET', signal
332
+ },
333
+ options);
334
+ }
335
+
336
+
337
+
338
+
339
+ export const getListPluginSetupStepsQueryKey = () => {
340
+ return [
341
+ `/org-setup/plugins/setup-steps`
342
+ ] as const;
343
+ }
344
+
345
+
346
+ export const getListPluginSetupStepsQueryOptions = <TData = Awaited<ReturnType<typeof listPluginSetupSteps>>, TError = unknown>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof listPluginSetupSteps>>, TError, TData>, request?: SecondParameter<typeof apiFetch>}
347
+ ) => {
348
+
349
+ const {query: queryOptions, request: requestOptions} = options ?? {};
350
+
351
+ const queryKey = queryOptions?.queryKey ?? getListPluginSetupStepsQueryKey();
352
+
353
+
354
+
355
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof listPluginSetupSteps>>> = ({ signal }) => listPluginSetupSteps(requestOptions, signal);
356
+
357
+
358
+
359
+
360
+
361
+ return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listPluginSetupSteps>>, TError, TData> & { queryKey: QueryKey }
362
+ }
363
+
364
+ export type ListPluginSetupStepsQueryResult = NonNullable<Awaited<ReturnType<typeof listPluginSetupSteps>>>
365
+ export type ListPluginSetupStepsQueryError = unknown
366
+
367
+
368
+ /**
369
+ * @summary List setup steps for the org's active plugins.
370
+ */
371
+
372
+ export function useListPluginSetupSteps<TData = Awaited<ReturnType<typeof listPluginSetupSteps>>, TError = unknown>(
373
+ options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof listPluginSetupSteps>>, TError, TData>, request?: SecondParameter<typeof apiFetch>}
374
+
375
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
376
+
377
+ const queryOptions = getListPluginSetupStepsQueryOptions(options)
378
+
379
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
380
+
381
+ return withQueryKey(query, queryOptions.queryKey);
382
+ }
383
+
384
+
385
+
386
+
387
+
388
+
389
+ /**
390
+ * @summary Provision a Runloop account for an organization
391
+ */
392
+ export const provisionOrganizationRunloopAccount = (
393
+
394
+ options?: SecondParameter<typeof apiFetch>,signal?: AbortSignal
395
+ ) => {
396
+
397
+
398
+ return apiFetch<ProvisionOrganizationRunloopAccount200>(
399
+ {url: `/org-setup/runloop-provider/provision`, method: 'POST', signal
400
+ },
401
+ options);
402
+ }
403
+
404
+
405
+
406
+ export const getProvisionOrganizationRunloopAccountMutationOptions = <TError = ErrorEnvelope,
407
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof provisionOrganizationRunloopAccount>>, TError,void, TContext>, request?: SecondParameter<typeof apiFetch>}
408
+ ): UseMutationOptions<Awaited<ReturnType<typeof provisionOrganizationRunloopAccount>>, TError,void, TContext> => {
409
+
410
+ const mutationKey = ['provisionOrganizationRunloopAccount'];
411
+ const {mutation: mutationOptions, request: requestOptions} = options ?
412
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
413
+ options
414
+ : {...options, mutation: {...options.mutation, mutationKey}}
415
+ : {mutation: { mutationKey, }, request: undefined};
416
+
417
+
418
+
419
+
420
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof provisionOrganizationRunloopAccount>>, void> = () => {
421
+
422
+
423
+ return provisionOrganizationRunloopAccount(requestOptions)
424
+ }
425
+
426
+
427
+
428
+
429
+
430
+
431
+ return { mutationFn, ...mutationOptions }}
432
+
433
+ export type ProvisionOrganizationRunloopAccountMutationResult = NonNullable<Awaited<ReturnType<typeof provisionOrganizationRunloopAccount>>>
434
+
435
+ export type ProvisionOrganizationRunloopAccountMutationError = ErrorEnvelope
436
+
437
+ /**
438
+ * @summary Provision a Runloop account for an organization
439
+ */
440
+ export const useProvisionOrganizationRunloopAccount = <TError = ErrorEnvelope,
441
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof provisionOrganizationRunloopAccount>>, TError,void, TContext>, request?: SecondParameter<typeof apiFetch>}
442
+ ): UseMutationResult<
443
+ Awaited<ReturnType<typeof provisionOrganizationRunloopAccount>>,
444
+ TError,
445
+ void,
446
+ TContext
447
+ > => {
448
+ return useMutation(getProvisionOrganizationRunloopAccountMutationOptions(options));
449
+ }
450
+ /**
451
+ * @summary Report the org's sandbox provider key and account.
452
+ */
453
+ export const getSandboxProvider = (
454
+
455
+ options?: SecondParameter<typeof apiFetch>,signal?: AbortSignal
456
+ ) => {
457
+
458
+
459
+ return apiFetch<void>(
460
+ {url: `/org-setup/sandbox-provider`, method: 'GET', signal
461
+ },
462
+ options);
463
+ }
464
+
465
+
466
+
467
+
468
+ export const getGetSandboxProviderQueryKey = () => {
469
+ return [
470
+ `/org-setup/sandbox-provider`
471
+ ] as const;
472
+ }
473
+
474
+
475
+ export const getGetSandboxProviderQueryOptions = <TData = Awaited<ReturnType<typeof getSandboxProvider>>, TError = unknown>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getSandboxProvider>>, TError, TData>, request?: SecondParameter<typeof apiFetch>}
476
+ ) => {
477
+
478
+ const {query: queryOptions, request: requestOptions} = options ?? {};
479
+
480
+ const queryKey = queryOptions?.queryKey ?? getGetSandboxProviderQueryKey();
481
+
482
+
483
+
484
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getSandboxProvider>>> = ({ signal }) => getSandboxProvider(requestOptions, signal);
485
+
486
+
487
+
488
+
489
+
490
+ return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getSandboxProvider>>, TError, TData> & { queryKey: QueryKey }
491
+ }
492
+
493
+ export type GetSandboxProviderQueryResult = NonNullable<Awaited<ReturnType<typeof getSandboxProvider>>>
494
+ export type GetSandboxProviderQueryError = unknown
495
+
496
+
497
+ /**
498
+ * @summary Report the org's sandbox provider key and account.
499
+ */
500
+
501
+ export function useGetSandboxProvider<TData = Awaited<ReturnType<typeof getSandboxProvider>>, TError = unknown>(
502
+ options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getSandboxProvider>>, TError, TData>, request?: SecondParameter<typeof apiFetch>}
503
+
504
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
505
+
506
+ const queryOptions = getGetSandboxProviderQueryOptions(options)
507
+
508
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
509
+
510
+ return withQueryKey(query, queryOptions.queryKey);
511
+ }
512
+
513
+
514
+
515
+
516
+
517
+
518
+ /**
519
+ * @summary Validate and save the org's sandbox provider API key.
520
+ */
521
+ export const setSandboxProvider = (
522
+ setSandboxProviderBody: SetSandboxProviderBody,
523
+ options?: SecondParameter<typeof apiFetch>,signal?: AbortSignal
524
+ ) => {
525
+
526
+
527
+ return apiFetch<void>(
528
+ {url: `/org-setup/sandbox-provider`, method: 'PUT',
529
+ headers: {'Content-Type': 'application/json', },
530
+ data: setSandboxProviderBody, signal
531
+ },
532
+ options);
533
+ }
534
+
535
+
536
+
537
+ export const getSetSandboxProviderMutationOptions = <TError = unknown,
538
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof setSandboxProvider>>, TError,{data: SetSandboxProviderBody}, TContext>, request?: SecondParameter<typeof apiFetch>}
539
+ ): UseMutationOptions<Awaited<ReturnType<typeof setSandboxProvider>>, TError,{data: SetSandboxProviderBody}, TContext> => {
540
+
541
+ const mutationKey = ['setSandboxProvider'];
542
+ const {mutation: mutationOptions, request: requestOptions} = options ?
543
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
544
+ options
545
+ : {...options, mutation: {...options.mutation, mutationKey}}
546
+ : {mutation: { mutationKey, }, request: undefined};
547
+
548
+
549
+
550
+
551
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof setSandboxProvider>>, {data: SetSandboxProviderBody}> = (props) => {
552
+ const {data} = props ?? {};
553
+
554
+ return setSandboxProvider(data,requestOptions)
555
+ }
556
+
557
+
558
+
559
+
560
+
561
+
562
+ return { mutationFn, ...mutationOptions }}
563
+
564
+ export type SetSandboxProviderMutationResult = NonNullable<Awaited<ReturnType<typeof setSandboxProvider>>>
565
+ export type SetSandboxProviderMutationBody = SetSandboxProviderBody
566
+ export type SetSandboxProviderMutationError = unknown
567
+
568
+ /**
569
+ * @summary Validate and save the org's sandbox provider API key.
570
+ */
571
+ export const useSetSandboxProvider = <TError = unknown,
572
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof setSandboxProvider>>, TError,{data: SetSandboxProviderBody}, TContext>, request?: SecondParameter<typeof apiFetch>}
573
+ ): UseMutationResult<
574
+ Awaited<ReturnType<typeof setSandboxProvider>>,
575
+ TError,
576
+ {data: SetSandboxProviderBody},
577
+ TContext
578
+ > => {
579
+ return useMutation(getSetSandboxProviderMutationOptions(options));
580
+ }
581
+ /**
582
+ * @summary Report whether the org's stored sandbox key works.
583
+ */
584
+ export const getSandboxProviderHealth = (
585
+
586
+ options?: SecondParameter<typeof apiFetch>,signal?: AbortSignal
587
+ ) => {
588
+
589
+
590
+ return apiFetch<void>(
591
+ {url: `/org-setup/sandbox-provider/health`, method: 'GET', signal
592
+ },
593
+ options);
594
+ }
595
+
596
+
597
+
598
+
599
+ export const getGetSandboxProviderHealthQueryKey = () => {
600
+ return [
601
+ `/org-setup/sandbox-provider/health`
602
+ ] as const;
603
+ }
604
+
605
+
606
+ export const getGetSandboxProviderHealthQueryOptions = <TData = Awaited<ReturnType<typeof getSandboxProviderHealth>>, TError = unknown>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getSandboxProviderHealth>>, TError, TData>, request?: SecondParameter<typeof apiFetch>}
607
+ ) => {
608
+
609
+ const {query: queryOptions, request: requestOptions} = options ?? {};
610
+
611
+ const queryKey = queryOptions?.queryKey ?? getGetSandboxProviderHealthQueryKey();
612
+
613
+
614
+
615
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getSandboxProviderHealth>>> = ({ signal }) => getSandboxProviderHealth(requestOptions, signal);
616
+
617
+
618
+
619
+
620
+
621
+ return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getSandboxProviderHealth>>, TError, TData> & { queryKey: QueryKey }
622
+ }
623
+
624
+ export type GetSandboxProviderHealthQueryResult = NonNullable<Awaited<ReturnType<typeof getSandboxProviderHealth>>>
625
+ export type GetSandboxProviderHealthQueryError = unknown
626
+
627
+
628
+ /**
629
+ * @summary Report whether the org's stored sandbox key works.
630
+ */
631
+
632
+ export function useGetSandboxProviderHealth<TData = Awaited<ReturnType<typeof getSandboxProviderHealth>>, TError = unknown>(
633
+ options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getSandboxProviderHealth>>, TError, TData>, request?: SecondParameter<typeof apiFetch>}
634
+
635
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
636
+
637
+ const queryOptions = getGetSandboxProviderHealthQueryOptions(options)
638
+
639
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
640
+
641
+ return withQueryKey(query, queryOptions.queryKey);
642
+ }
643
+
644
+
645
+
646
+
647
+
648
+
649
+ /**
650
+ * @summary Check a sandbox provider API key without saving it.
651
+ */
652
+ export const validateSandboxProvider = (
653
+ validateSandboxProviderBody: ValidateSandboxProviderBody,
654
+ options?: SecondParameter<typeof apiFetch>,signal?: AbortSignal
655
+ ) => {
656
+
657
+
658
+ return apiFetch<void>(
659
+ {url: `/org-setup/sandbox-provider/validate`, method: 'POST',
660
+ headers: {'Content-Type': 'application/json', },
661
+ data: validateSandboxProviderBody, signal
662
+ },
663
+ options);
664
+ }
665
+
666
+
667
+
668
+ export const getValidateSandboxProviderMutationOptions = <TError = unknown,
669
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof validateSandboxProvider>>, TError,{data: ValidateSandboxProviderBody}, TContext>, request?: SecondParameter<typeof apiFetch>}
670
+ ): UseMutationOptions<Awaited<ReturnType<typeof validateSandboxProvider>>, TError,{data: ValidateSandboxProviderBody}, TContext> => {
671
+
672
+ const mutationKey = ['validateSandboxProvider'];
673
+ const {mutation: mutationOptions, request: requestOptions} = options ?
674
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
675
+ options
676
+ : {...options, mutation: {...options.mutation, mutationKey}}
677
+ : {mutation: { mutationKey, }, request: undefined};
678
+
679
+
680
+
681
+
682
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof validateSandboxProvider>>, {data: ValidateSandboxProviderBody}> = (props) => {
683
+ const {data} = props ?? {};
684
+
685
+ return validateSandboxProvider(data,requestOptions)
686
+ }
687
+
688
+
689
+
690
+
691
+
692
+
693
+ return { mutationFn, ...mutationOptions }}
694
+
695
+ export type ValidateSandboxProviderMutationResult = NonNullable<Awaited<ReturnType<typeof validateSandboxProvider>>>
696
+ export type ValidateSandboxProviderMutationBody = ValidateSandboxProviderBody
697
+ export type ValidateSandboxProviderMutationError = unknown
698
+
699
+ /**
700
+ * @summary Check a sandbox provider API key without saving it.
701
+ */
702
+ export const useValidateSandboxProvider = <TError = unknown,
703
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof validateSandboxProvider>>, TError,{data: ValidateSandboxProviderBody}, TContext>, request?: SecondParameter<typeof apiFetch>}
704
+ ): UseMutationResult<
705
+ Awaited<ReturnType<typeof validateSandboxProvider>>,
706
+ TError,
707
+ {data: ValidateSandboxProviderBody},
708
+ TContext
709
+ > => {
710
+ return useMutation(getValidateSandboxProviderMutationOptions(options));
711
+ }
712
+ /**
713
+ * @summary Save an org secret by name.
714
+ */
715
+ export const setOrgSecret = (
716
+ name: string,
717
+ setOrgSecretBody: SetOrgSecretBody,
718
+ options?: SecondParameter<typeof apiFetch>,signal?: AbortSignal
719
+ ) => {
720
+
721
+
722
+ return apiFetch<void>(
723
+ {url: `/org-setup/secrets/${encodeURIComponent(String(name))}`, method: 'PUT',
724
+ headers: {'Content-Type': 'application/json', },
725
+ data: setOrgSecretBody, signal
726
+ },
727
+ options);
728
+ }
729
+
730
+
731
+
732
+ export const getSetOrgSecretMutationOptions = <TError = unknown,
733
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof setOrgSecret>>, TError,{name: string;data: SetOrgSecretBody}, TContext>, request?: SecondParameter<typeof apiFetch>}
734
+ ): UseMutationOptions<Awaited<ReturnType<typeof setOrgSecret>>, TError,{name: string;data: SetOrgSecretBody}, TContext> => {
735
+
736
+ const mutationKey = ['setOrgSecret'];
737
+ const {mutation: mutationOptions, request: requestOptions} = options ?
738
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
739
+ options
740
+ : {...options, mutation: {...options.mutation, mutationKey}}
741
+ : {mutation: { mutationKey, }, request: undefined};
742
+
743
+
744
+
745
+
746
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof setOrgSecret>>, {name: string;data: SetOrgSecretBody}> = (props) => {
747
+ const {name,data} = props ?? {};
748
+
749
+ return setOrgSecret(name,data,requestOptions)
750
+ }
751
+
752
+
753
+
754
+
755
+
756
+
757
+ return { mutationFn, ...mutationOptions }}
758
+
759
+ export type SetOrgSecretMutationResult = NonNullable<Awaited<ReturnType<typeof setOrgSecret>>>
760
+ export type SetOrgSecretMutationBody = SetOrgSecretBody
761
+ export type SetOrgSecretMutationError = unknown
762
+
763
+ /**
764
+ * @summary Save an org secret by name.
765
+ */
766
+ export const useSetOrgSecret = <TError = unknown,
767
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof setOrgSecret>>, TError,{name: string;data: SetOrgSecretBody}, TContext>, request?: SecondParameter<typeof apiFetch>}
768
+ ): UseMutationResult<
769
+ Awaited<ReturnType<typeof setOrgSecret>>,
770
+ TError,
771
+ {name: string;data: SetOrgSecretBody},
772
+ TContext
773
+ > => {
774
+ return useMutation(getSetOrgSecretMutationOptions(options));
775
+ }
776
+ /**
777
+ * @summary Report which of the org's secrets are set.
778
+ */
779
+ export const getOrgSecretsStatus = (
780
+
781
+ options?: SecondParameter<typeof apiFetch>,signal?: AbortSignal
782
+ ) => {
783
+
784
+
785
+ return apiFetch<void>(
786
+ {url: `/org-setup/secrets/status`, method: 'GET', signal
787
+ },
788
+ options);
789
+ }
790
+
791
+
792
+
793
+
794
+ export const getGetOrgSecretsStatusQueryKey = () => {
795
+ return [
796
+ `/org-setup/secrets/status`
797
+ ] as const;
798
+ }
799
+
800
+
801
+ export const getGetOrgSecretsStatusQueryOptions = <TData = Awaited<ReturnType<typeof getOrgSecretsStatus>>, TError = unknown>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getOrgSecretsStatus>>, TError, TData>, request?: SecondParameter<typeof apiFetch>}
802
+ ) => {
803
+
804
+ const {query: queryOptions, request: requestOptions} = options ?? {};
805
+
806
+ const queryKey = queryOptions?.queryKey ?? getGetOrgSecretsStatusQueryKey();
807
+
808
+
809
+
810
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrgSecretsStatus>>> = ({ signal }) => getOrgSecretsStatus(requestOptions, signal);
811
+
812
+
813
+
814
+
815
+
816
+ return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrgSecretsStatus>>, TError, TData> & { queryKey: QueryKey }
817
+ }
818
+
819
+ export type GetOrgSecretsStatusQueryResult = NonNullable<Awaited<ReturnType<typeof getOrgSecretsStatus>>>
820
+ export type GetOrgSecretsStatusQueryError = unknown
821
+
822
+
823
+ /**
824
+ * @summary Report which of the org's secrets are set.
825
+ */
826
+
827
+ export function useGetOrgSecretsStatus<TData = Awaited<ReturnType<typeof getOrgSecretsStatus>>, TError = unknown>(
828
+ options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getOrgSecretsStatus>>, TError, TData>, request?: SecondParameter<typeof apiFetch>}
829
+
830
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
831
+
832
+ const queryOptions = getGetOrgSecretsStatusQueryOptions(options)
833
+
834
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
835
+
836
+ return withQueryKey(query, queryOptions.queryKey);
837
+ }
838
+
839
+
840
+
841
+
842
+
843
+
844
+ /**
845
+ * @summary Report the org's guided setup progress.
846
+ */
847
+ export const getOrgSetupState = (
848
+
849
+ options?: SecondParameter<typeof apiFetch>,signal?: AbortSignal
850
+ ) => {
851
+
852
+
853
+ return apiFetch<void>(
854
+ {url: `/org-setup/state`, method: 'GET', signal
855
+ },
856
+ options);
857
+ }
858
+
859
+
860
+
861
+
862
+ export const getGetOrgSetupStateQueryKey = () => {
863
+ return [
864
+ `/org-setup/state`
865
+ ] as const;
866
+ }
867
+
868
+
869
+ export const getGetOrgSetupStateQueryOptions = <TData = Awaited<ReturnType<typeof getOrgSetupState>>, TError = unknown>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getOrgSetupState>>, TError, TData>, request?: SecondParameter<typeof apiFetch>}
870
+ ) => {
871
+
872
+ const {query: queryOptions, request: requestOptions} = options ?? {};
873
+
874
+ const queryKey = queryOptions?.queryKey ?? getGetOrgSetupStateQueryKey();
875
+
876
+
877
+
878
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrgSetupState>>> = ({ signal }) => getOrgSetupState(requestOptions, signal);
879
+
880
+
881
+
882
+
883
+
884
+ return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrgSetupState>>, TError, TData> & { queryKey: QueryKey }
885
+ }
886
+
887
+ export type GetOrgSetupStateQueryResult = NonNullable<Awaited<ReturnType<typeof getOrgSetupState>>>
888
+ export type GetOrgSetupStateQueryError = unknown
889
+
890
+
891
+ /**
892
+ * @summary Report the org's guided setup progress.
893
+ */
894
+
895
+ export function useGetOrgSetupState<TData = Awaited<ReturnType<typeof getOrgSetupState>>, TError = unknown>(
896
+ options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getOrgSetupState>>, TError, TData>, request?: SecondParameter<typeof apiFetch>}
897
+
898
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
899
+
900
+ const queryOptions = getGetOrgSetupStateQueryOptions(options)
901
+
902
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
903
+
904
+ return withQueryKey(query, queryOptions.queryKey);
905
+ }
906
+
907
+
908
+
909
+
910
+
911
+