@sixb/client 0.1.6 → 0.1.8

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 (65) hide show
  1. package/README.md +25 -0
  2. package/dist/api.d.ts +5 -0
  3. package/dist/api.d.ts.map +1 -1
  4. package/dist/browser.d.ts +18 -1
  5. package/dist/browser.d.ts.map +1 -1
  6. package/dist/browser.js +180 -35
  7. package/dist/browser.js.map +3 -3
  8. package/dist/{chunk-hwg7mwq7.js → chunk-0g4bg41z.js} +46 -7
  9. package/dist/chunk-0g4bg41z.js.map +17 -0
  10. package/dist/chunk-3gvmb0w6.js +23 -0
  11. package/dist/chunk-3gvmb0w6.js.map +10 -0
  12. package/dist/{chunk-g19v53kt.js → chunk-cmfd585n.js} +17 -2
  13. package/dist/chunk-cmfd585n.js.map +10 -0
  14. package/dist/{chunk-ehjnq01h.js → chunk-n4160ht2.js} +179 -28
  15. package/dist/chunk-n4160ht2.js.map +19 -0
  16. package/dist/{chunk-ks27bq5b.js → chunk-se1tydhh.js} +2 -2
  17. package/dist/{chunk-9bwme2g7.js → chunk-v8q8185t.js} +61 -6
  18. package/dist/chunk-v8q8185t.js.map +10 -0
  19. package/dist/{chunk-5y58b4tr.js → chunk-x6pk2xhn.js} +21 -4
  20. package/dist/chunk-x6pk2xhn.js.map +12 -0
  21. package/dist/client-authority.d.ts +6 -0
  22. package/dist/client-authority.d.ts.map +1 -0
  23. package/dist/connectors/queries.d.ts.map +1 -1
  24. package/dist/events-builder.d.ts.map +1 -1
  25. package/dist/file.d.ts +11 -0
  26. package/dist/file.d.ts.map +1 -1
  27. package/dist/generated/@tanstack/react-query.gen.d.ts +2687 -378
  28. package/dist/generated/@tanstack/react-query.gen.d.ts.map +1 -1
  29. package/dist/generated/index.d.ts +2 -2
  30. package/dist/generated/index.d.ts.map +1 -1
  31. package/dist/generated/sdk.gen.d.ts +65 -7
  32. package/dist/generated/sdk.gen.d.ts.map +1 -1
  33. package/dist/generated/types.gen.d.ts +3539 -2377
  34. package/dist/generated/types.gen.d.ts.map +1 -1
  35. package/dist/hooks.js +280 -22
  36. package/dist/hooks.js.map +3 -3
  37. package/dist/index.js +41 -8
  38. package/dist/index.js.map +1 -1
  39. package/dist/logs-builder.d.ts.map +1 -1
  40. package/dist/logs.js +5 -4
  41. package/dist/logs.js.map +1 -1
  42. package/dist/models.js +32 -4
  43. package/dist/models.js.map +1 -1
  44. package/dist/query.js +5 -4
  45. package/dist/query.js.map +1 -1
  46. package/dist/ws-socket.d.ts.map +1 -1
  47. package/package.json +2 -2
  48. package/src/agent-streams.ts +0 -1
  49. package/src/api.ts +92 -3
  50. package/src/browser.ts +257 -48
  51. package/src/client-authority.ts +31 -0
  52. package/src/events-builder.ts +18 -1
  53. package/src/file.ts +36 -0
  54. package/src/generated/@tanstack/react-query.gen.ts +549 -31
  55. package/src/generated/index.ts +88 -4
  56. package/src/generated/sdk.gen.ts +375 -30
  57. package/src/generated/types.gen.ts +1746 -227
  58. package/src/logs-builder.ts +14 -1
  59. package/src/ws-socket.ts +11 -0
  60. package/dist/chunk-5y58b4tr.js.map +0 -12
  61. package/dist/chunk-9bwme2g7.js.map +0 -10
  62. package/dist/chunk-ehjnq01h.js.map +0 -19
  63. package/dist/chunk-g19v53kt.js.map +0 -10
  64. package/dist/chunk-hwg7mwq7.js.map +0 -17
  65. /package/dist/{chunk-ks27bq5b.js.map → chunk-se1tydhh.js.map} +0 -0
@@ -19,13 +19,18 @@ import {
19
19
  completeFileUpload,
20
20
  countObjects,
21
21
  createAgentThread,
22
+ createAiLimitPolicy,
22
23
  createAuthInvitation,
23
24
  createAuthPersonalAccessToken,
24
25
  createAuthServiceAccount,
25
26
  createAuthServiceAccountAccessToken,
27
+ createDeviceAuthorization,
26
28
  createFileUpload,
29
+ deleteAiLimitPolicy,
27
30
  disableAuthServiceAccount,
28
31
  disconnectConnectorConnection,
32
+ exchangeDeviceAuthorization,
33
+ exchangeSharedAccess,
29
34
  existsObjects,
30
35
  facetObjects,
31
36
  getAction,
@@ -36,6 +41,8 @@ import {
36
41
  getAgentRun,
37
42
  getAgentThread,
38
43
  getAiAccountingOverview,
44
+ getAiLimitStatus,
45
+ getAiLimitSubjectOptions,
39
46
  getAuthAccessManagementOptions,
40
47
  getAuthInvitationOptions,
41
48
  getAuthMembershipOptions,
@@ -55,6 +62,7 @@ import {
55
62
  getProjection,
56
63
  getProjectionRun,
57
64
  getRule,
65
+ getSharedAccessSession,
58
66
  getStatus,
59
67
  getSync,
60
68
  getTelemetryHistory,
@@ -64,12 +72,14 @@ import {
64
72
  getWorkflowNodeRunFileContent,
65
73
  getWorkflowRun,
66
74
  getWorkflowRunFileContent,
75
+ issueSharedAccessGrant,
67
76
  listActionRuns,
68
77
  listActions,
69
- listAgents,
70
78
  listAgentThreadMessages,
71
79
  listAgentThreadRuns,
72
80
  listAgentThreads,
81
+ listAiLimitPolicies,
82
+ listAiModelCallGroups,
73
83
  listAiModelCalls,
74
84
  listAuthAccessTokens,
75
85
  listAuthInvitations,
@@ -93,6 +103,7 @@ import {
93
103
  listProjections,
94
104
  listRuleStates,
95
105
  listRules,
106
+ listSharedAccessGrants,
96
107
  listSyncRuns,
97
108
  listSyncs,
98
109
  listWebhookRuns,
@@ -116,14 +127,17 @@ import {
116
127
  revokeAuthServiceAccountAccessToken,
117
128
  revokeAuthSession,
118
129
  revokeConnectorConnection,
130
+ revokeSharedAccessGrant,
119
131
  searchObjects,
120
132
  selectConnectorConnectionRunAccount,
121
133
  signFileUploadPart,
122
134
  signOut,
123
135
  signOutAll,
136
+ signOutSharedAccess,
124
137
  startConnectorConnectionRun,
125
138
  submitWorkflowIntervention,
126
139
  suspendAuthMember,
140
+ updateAiLimitPolicy,
127
141
  updateAuthMemberGroups,
128
142
  uploadFileContent,
129
143
  uploadFileRaw,
@@ -158,6 +172,9 @@ import type {
158
172
  CreateAgentThreadData,
159
173
  CreateAgentThreadError,
160
174
  CreateAgentThreadResponse,
175
+ CreateAiLimitPolicyData,
176
+ CreateAiLimitPolicyError,
177
+ CreateAiLimitPolicyResponse,
161
178
  CreateAuthInvitationData,
162
179
  CreateAuthInvitationError,
163
180
  CreateAuthInvitationResponse,
@@ -170,15 +187,26 @@ import type {
170
187
  CreateAuthServiceAccountData,
171
188
  CreateAuthServiceAccountError,
172
189
  CreateAuthServiceAccountResponse,
190
+ CreateDeviceAuthorizationData,
191
+ CreateDeviceAuthorizationError,
192
+ CreateDeviceAuthorizationResponse,
173
193
  CreateFileUploadData,
174
194
  CreateFileUploadError,
175
195
  CreateFileUploadResponse,
196
+ DeleteAiLimitPolicyData,
197
+ DeleteAiLimitPolicyError,
198
+ DeleteAiLimitPolicyResponse,
176
199
  DisableAuthServiceAccountData,
177
200
  DisableAuthServiceAccountError,
178
201
  DisableAuthServiceAccountResponse,
179
202
  DisconnectConnectorConnectionData,
180
203
  DisconnectConnectorConnectionError,
181
204
  DisconnectConnectorConnectionResponse,
205
+ ExchangeDeviceAuthorizationData,
206
+ ExchangeDeviceAuthorizationResponse,
207
+ ExchangeSharedAccessData,
208
+ ExchangeSharedAccessError,
209
+ ExchangeSharedAccessResponse,
182
210
  ExistsObjectsData,
183
211
  ExistsObjectsError,
184
212
  ExistsObjectsResponse,
@@ -209,6 +237,12 @@ import type {
209
237
  GetAiAccountingOverviewData,
210
238
  GetAiAccountingOverviewError,
211
239
  GetAiAccountingOverviewResponse,
240
+ GetAiLimitStatusData,
241
+ GetAiLimitStatusError,
242
+ GetAiLimitStatusResponse,
243
+ GetAiLimitSubjectOptionsData,
244
+ GetAiLimitSubjectOptionsError,
245
+ GetAiLimitSubjectOptionsResponse,
212
246
  GetAuthAccessManagementOptionsData,
213
247
  GetAuthAccessManagementOptionsError,
214
248
  GetAuthAccessManagementOptionsResponse,
@@ -264,6 +298,9 @@ import type {
264
298
  GetRuleData,
265
299
  GetRuleError,
266
300
  GetRuleResponse,
301
+ GetSharedAccessSessionData,
302
+ GetSharedAccessSessionError,
303
+ GetSharedAccessSessionResponse,
267
304
  GetStatusData,
268
305
  GetStatusResponse,
269
306
  GetSyncData,
@@ -290,13 +327,14 @@ import type {
290
327
  GetWorkflowRunFileContentError,
291
328
  GetWorkflowRunFileContentResponse,
292
329
  GetWorkflowRunResponse,
330
+ IssueSharedAccessGrantData,
331
+ IssueSharedAccessGrantError,
332
+ IssueSharedAccessGrantResponse,
293
333
  ListActionRunsData,
294
334
  ListActionRunsError,
295
335
  ListActionRunsResponse,
296
336
  ListActionsData,
297
337
  ListActionsResponse,
298
- ListAgentsData,
299
- ListAgentsResponse,
300
338
  ListAgentThreadMessagesData,
301
339
  ListAgentThreadMessagesError,
302
340
  ListAgentThreadMessagesResponse,
@@ -306,6 +344,12 @@ import type {
306
344
  ListAgentThreadsData,
307
345
  ListAgentThreadsError,
308
346
  ListAgentThreadsResponse,
347
+ ListAiLimitPoliciesData,
348
+ ListAiLimitPoliciesError,
349
+ ListAiLimitPoliciesResponse,
350
+ ListAiModelCallGroupsData,
351
+ ListAiModelCallGroupsError,
352
+ ListAiModelCallGroupsResponse,
309
353
  ListAiModelCallsData,
310
354
  ListAiModelCallsError,
311
355
  ListAiModelCallsResponse,
@@ -369,6 +413,9 @@ import type {
369
413
  ListRuleStatesResponse,
370
414
  ListRulesData,
371
415
  ListRulesResponse,
416
+ ListSharedAccessGrantsData,
417
+ ListSharedAccessGrantsError,
418
+ ListSharedAccessGrantsResponse,
372
419
  ListSyncRunsData,
373
420
  ListSyncRunsError,
374
421
  ListSyncRunsResponse,
@@ -433,6 +480,9 @@ import type {
433
480
  RevokeConnectorConnectionData,
434
481
  RevokeConnectorConnectionError,
435
482
  RevokeConnectorConnectionResponse,
483
+ RevokeSharedAccessGrantData,
484
+ RevokeSharedAccessGrantError,
485
+ RevokeSharedAccessGrantResponse,
436
486
  SearchObjectsData,
437
487
  SearchObjectsError,
438
488
  SearchObjectsResponse,
@@ -448,6 +498,9 @@ import type {
448
498
  SignOutData,
449
499
  SignOutError,
450
500
  SignOutResponse,
501
+ SignOutSharedAccessData,
502
+ SignOutSharedAccessError,
503
+ SignOutSharedAccessResponse,
451
504
  StartConnectorConnectionRunData,
452
505
  StartConnectorConnectionRunError,
453
506
  StartConnectorConnectionRunResponse,
@@ -457,6 +510,9 @@ import type {
457
510
  SuspendAuthMemberData,
458
511
  SuspendAuthMemberError,
459
512
  SuspendAuthMemberResponse,
513
+ UpdateAiLimitPolicyData,
514
+ UpdateAiLimitPolicyError,
515
+ UpdateAiLimitPolicyResponse,
460
516
  UpdateAuthMemberGroupsData,
461
517
  UpdateAuthMemberGroupsError,
462
518
  UpdateAuthMemberGroupsResponse,
@@ -474,6 +530,60 @@ import type {
474
530
  UpsertObjectResponse,
475
531
  } from "../types.gen"
476
532
 
533
+ /**
534
+ * Start device authorization
535
+ */
536
+ export const createDeviceAuthorizationMutation = (
537
+ options?: Partial<Options<CreateDeviceAuthorizationData>>
538
+ ): UseMutationOptions<
539
+ CreateDeviceAuthorizationResponse,
540
+ CreateDeviceAuthorizationError,
541
+ Options<CreateDeviceAuthorizationData>
542
+ > => {
543
+ const mutationOptions: UseMutationOptions<
544
+ CreateDeviceAuthorizationResponse,
545
+ CreateDeviceAuthorizationError,
546
+ Options<CreateDeviceAuthorizationData>
547
+ > = {
548
+ mutationFn: async (fnOptions) => {
549
+ const { data } = await createDeviceAuthorization({
550
+ ...options,
551
+ ...fnOptions,
552
+ throwOnError: true,
553
+ })
554
+ return data
555
+ },
556
+ }
557
+ return mutationOptions
558
+ }
559
+
560
+ /**
561
+ * Exchange an approved device authorization
562
+ */
563
+ export const exchangeDeviceAuthorizationMutation = (
564
+ options?: Partial<Options<ExchangeDeviceAuthorizationData>>
565
+ ): UseMutationOptions<
566
+ ExchangeDeviceAuthorizationResponse,
567
+ DefaultError,
568
+ Options<ExchangeDeviceAuthorizationData>
569
+ > => {
570
+ const mutationOptions: UseMutationOptions<
571
+ ExchangeDeviceAuthorizationResponse,
572
+ DefaultError,
573
+ Options<ExchangeDeviceAuthorizationData>
574
+ > = {
575
+ mutationFn: async (fnOptions) => {
576
+ const { data } = await exchangeDeviceAuthorization({
577
+ ...options,
578
+ ...fnOptions,
579
+ throwOnError: true,
580
+ })
581
+ return data
582
+ },
583
+ }
584
+ return mutationOptions
585
+ }
586
+
477
587
  export type QueryKey<TOptions extends Options> = [
478
588
  Pick<TOptions, "baseUrl" | "body" | "headers" | "path" | "query"> & {
479
589
  _id: string
@@ -1350,6 +1460,234 @@ export const listAiModelCallsInfiniteOptions = (options: Options<ListAiModelCall
1350
1460
  }
1351
1461
  )
1352
1462
 
1463
+ export const listAiLimitPoliciesQueryKey = (options?: Options<ListAiLimitPoliciesData>) =>
1464
+ createQueryKey("listAiLimitPolicies", options)
1465
+
1466
+ /**
1467
+ * List project AI usage-limit policies
1468
+ */
1469
+ export const listAiLimitPoliciesOptions = (options?: Options<ListAiLimitPoliciesData>) =>
1470
+ queryOptions<
1471
+ ListAiLimitPoliciesResponse,
1472
+ ListAiLimitPoliciesError,
1473
+ ListAiLimitPoliciesResponse,
1474
+ ReturnType<typeof listAiLimitPoliciesQueryKey>
1475
+ >({
1476
+ queryFn: async ({ queryKey, signal }) => {
1477
+ const { data } = await listAiLimitPolicies({
1478
+ ...options,
1479
+ ...queryKey[0],
1480
+ signal,
1481
+ throwOnError: true,
1482
+ })
1483
+ return data
1484
+ },
1485
+ queryKey: listAiLimitPoliciesQueryKey(options),
1486
+ })
1487
+
1488
+ /**
1489
+ * Create an AI usage-limit policy
1490
+ */
1491
+ export const createAiLimitPolicyMutation = (
1492
+ options?: Partial<Options<CreateAiLimitPolicyData>>
1493
+ ): UseMutationOptions<
1494
+ CreateAiLimitPolicyResponse,
1495
+ CreateAiLimitPolicyError,
1496
+ Options<CreateAiLimitPolicyData>
1497
+ > => {
1498
+ const mutationOptions: UseMutationOptions<
1499
+ CreateAiLimitPolicyResponse,
1500
+ CreateAiLimitPolicyError,
1501
+ Options<CreateAiLimitPolicyData>
1502
+ > = {
1503
+ mutationFn: async (fnOptions) => {
1504
+ const { data } = await createAiLimitPolicy({
1505
+ ...options,
1506
+ ...fnOptions,
1507
+ throwOnError: true,
1508
+ })
1509
+ return data
1510
+ },
1511
+ }
1512
+ return mutationOptions
1513
+ }
1514
+
1515
+ export const getAiLimitStatusQueryKey = (options?: Options<GetAiLimitStatusData>) =>
1516
+ createQueryKey("getAiLimitStatus", options)
1517
+
1518
+ /**
1519
+ * Get current project AI usage-limit status
1520
+ */
1521
+ export const getAiLimitStatusOptions = (options?: Options<GetAiLimitStatusData>) =>
1522
+ queryOptions<
1523
+ GetAiLimitStatusResponse,
1524
+ GetAiLimitStatusError,
1525
+ GetAiLimitStatusResponse,
1526
+ ReturnType<typeof getAiLimitStatusQueryKey>
1527
+ >({
1528
+ queryFn: async ({ queryKey, signal }) => {
1529
+ const { data } = await getAiLimitStatus({
1530
+ ...options,
1531
+ ...queryKey[0],
1532
+ signal,
1533
+ throwOnError: true,
1534
+ })
1535
+ return data
1536
+ },
1537
+ queryKey: getAiLimitStatusQueryKey(options),
1538
+ })
1539
+
1540
+ export const getAiLimitSubjectOptionsQueryKey = (options?: Options<GetAiLimitSubjectOptionsData>) =>
1541
+ createQueryKey("getAiLimitSubjectOptions", options)
1542
+
1543
+ /**
1544
+ * Get selectable AI usage-limit subjects
1545
+ *
1546
+ * Lists registered groups and auth principals available for AI usage-limit policies.
1547
+ */
1548
+ export const getAiLimitSubjectOptionsOptions = (options?: Options<GetAiLimitSubjectOptionsData>) =>
1549
+ queryOptions<
1550
+ GetAiLimitSubjectOptionsResponse,
1551
+ GetAiLimitSubjectOptionsError,
1552
+ GetAiLimitSubjectOptionsResponse,
1553
+ ReturnType<typeof getAiLimitSubjectOptionsQueryKey>
1554
+ >({
1555
+ queryFn: async ({ queryKey, signal }) => {
1556
+ const { data } = await getAiLimitSubjectOptions({
1557
+ ...options,
1558
+ ...queryKey[0],
1559
+ signal,
1560
+ throwOnError: true,
1561
+ })
1562
+ return data
1563
+ },
1564
+ queryKey: getAiLimitSubjectOptionsQueryKey(options),
1565
+ })
1566
+
1567
+ /**
1568
+ * Delete an AI usage-limit policy
1569
+ */
1570
+ export const deleteAiLimitPolicyMutation = (
1571
+ options?: Partial<Options<DeleteAiLimitPolicyData>>
1572
+ ): UseMutationOptions<
1573
+ DeleteAiLimitPolicyResponse,
1574
+ DeleteAiLimitPolicyError,
1575
+ Options<DeleteAiLimitPolicyData>
1576
+ > => {
1577
+ const mutationOptions: UseMutationOptions<
1578
+ DeleteAiLimitPolicyResponse,
1579
+ DeleteAiLimitPolicyError,
1580
+ Options<DeleteAiLimitPolicyData>
1581
+ > = {
1582
+ mutationFn: async (fnOptions) => {
1583
+ const { data } = await deleteAiLimitPolicy({
1584
+ ...options,
1585
+ ...fnOptions,
1586
+ throwOnError: true,
1587
+ })
1588
+ return data
1589
+ },
1590
+ }
1591
+ return mutationOptions
1592
+ }
1593
+
1594
+ /**
1595
+ * Update an AI usage-limit policy
1596
+ */
1597
+ export const updateAiLimitPolicyMutation = (
1598
+ options?: Partial<Options<UpdateAiLimitPolicyData>>
1599
+ ): UseMutationOptions<
1600
+ UpdateAiLimitPolicyResponse,
1601
+ UpdateAiLimitPolicyError,
1602
+ Options<UpdateAiLimitPolicyData>
1603
+ > => {
1604
+ const mutationOptions: UseMutationOptions<
1605
+ UpdateAiLimitPolicyResponse,
1606
+ UpdateAiLimitPolicyError,
1607
+ Options<UpdateAiLimitPolicyData>
1608
+ > = {
1609
+ mutationFn: async (fnOptions) => {
1610
+ const { data } = await updateAiLimitPolicy({
1611
+ ...options,
1612
+ ...fnOptions,
1613
+ throwOnError: true,
1614
+ })
1615
+ return data
1616
+ },
1617
+ }
1618
+ return mutationOptions
1619
+ }
1620
+
1621
+ export const listAiModelCallGroupsQueryKey = (options: Options<ListAiModelCallGroupsData>) =>
1622
+ createQueryKey("listAiModelCallGroups", options)
1623
+
1624
+ /**
1625
+ * List AI model calls grouped by initiating execution
1626
+ */
1627
+ export const listAiModelCallGroupsOptions = (options: Options<ListAiModelCallGroupsData>) =>
1628
+ queryOptions<
1629
+ ListAiModelCallGroupsResponse,
1630
+ ListAiModelCallGroupsError,
1631
+ ListAiModelCallGroupsResponse,
1632
+ ReturnType<typeof listAiModelCallGroupsQueryKey>
1633
+ >({
1634
+ queryFn: async ({ queryKey, signal }) => {
1635
+ const { data } = await listAiModelCallGroups({
1636
+ ...options,
1637
+ ...queryKey[0],
1638
+ signal,
1639
+ throwOnError: true,
1640
+ })
1641
+ return data
1642
+ },
1643
+ queryKey: listAiModelCallGroupsQueryKey(options),
1644
+ })
1645
+
1646
+ export const listAiModelCallGroupsInfiniteQueryKey = (
1647
+ options: Options<ListAiModelCallGroupsData>
1648
+ ): QueryKey<Options<ListAiModelCallGroupsData>> =>
1649
+ createQueryKey("listAiModelCallGroups", options, true)
1650
+
1651
+ /**
1652
+ * List AI model calls grouped by initiating execution
1653
+ */
1654
+ export const listAiModelCallGroupsInfiniteOptions = (options: Options<ListAiModelCallGroupsData>) =>
1655
+ infiniteQueryOptions<
1656
+ ListAiModelCallGroupsResponse,
1657
+ ListAiModelCallGroupsError,
1658
+ InfiniteData<ListAiModelCallGroupsResponse>,
1659
+ QueryKey<Options<ListAiModelCallGroupsData>>,
1660
+ | string
1661
+ | Pick<QueryKey<Options<ListAiModelCallGroupsData>>[0], "body" | "headers" | "path" | "query">
1662
+ >(
1663
+ // @ts-ignore
1664
+ {
1665
+ queryFn: async ({ pageParam, queryKey, signal }) => {
1666
+ // @ts-ignore
1667
+ const page: Pick<
1668
+ QueryKey<Options<ListAiModelCallGroupsData>>[0],
1669
+ "body" | "headers" | "path" | "query"
1670
+ > =
1671
+ typeof pageParam === "object"
1672
+ ? pageParam
1673
+ : {
1674
+ query: {
1675
+ offset: pageParam,
1676
+ },
1677
+ }
1678
+ const params = createInfiniteParams(queryKey, page)
1679
+ const { data } = await listAiModelCallGroups({
1680
+ ...options,
1681
+ ...params,
1682
+ signal,
1683
+ throwOnError: true,
1684
+ })
1685
+ return data
1686
+ },
1687
+ queryKey: listAiModelCallGroupsInfiniteQueryKey(options),
1688
+ }
1689
+ )
1690
+
1353
1691
  export const getProjectInfoQueryKey = (options?: Options<GetProjectInfoData>) =>
1354
1692
  createQueryKey("getProjectInfo", options)
1355
1693
 
@@ -2684,6 +3022,211 @@ export const listRuleStatesInfiniteOptions = (options?: Options<ListRuleStatesDa
2684
3022
  }
2685
3023
  )
2686
3024
 
3025
+ export const listSharedAccessGrantsQueryKey = (options: Options<ListSharedAccessGrantsData>) =>
3026
+ createQueryKey("listSharedAccessGrants", options)
3027
+
3028
+ /**
3029
+ * List shared-access grants
3030
+ */
3031
+ export const listSharedAccessGrantsOptions = (options: Options<ListSharedAccessGrantsData>) =>
3032
+ queryOptions<
3033
+ ListSharedAccessGrantsResponse,
3034
+ ListSharedAccessGrantsError,
3035
+ ListSharedAccessGrantsResponse,
3036
+ ReturnType<typeof listSharedAccessGrantsQueryKey>
3037
+ >({
3038
+ queryFn: async ({ queryKey, signal }) => {
3039
+ const { data } = await listSharedAccessGrants({
3040
+ ...options,
3041
+ ...queryKey[0],
3042
+ signal,
3043
+ throwOnError: true,
3044
+ })
3045
+ return data
3046
+ },
3047
+ queryKey: listSharedAccessGrantsQueryKey(options),
3048
+ })
3049
+
3050
+ export const listSharedAccessGrantsInfiniteQueryKey = (
3051
+ options: Options<ListSharedAccessGrantsData>
3052
+ ): QueryKey<Options<ListSharedAccessGrantsData>> =>
3053
+ createQueryKey("listSharedAccessGrants", options, true)
3054
+
3055
+ /**
3056
+ * List shared-access grants
3057
+ */
3058
+ export const listSharedAccessGrantsInfiniteOptions = (
3059
+ options: Options<ListSharedAccessGrantsData>
3060
+ ) =>
3061
+ infiniteQueryOptions<
3062
+ ListSharedAccessGrantsResponse,
3063
+ ListSharedAccessGrantsError,
3064
+ InfiniteData<ListSharedAccessGrantsResponse>,
3065
+ QueryKey<Options<ListSharedAccessGrantsData>>,
3066
+ | number
3067
+ | Pick<QueryKey<Options<ListSharedAccessGrantsData>>[0], "body" | "headers" | "path" | "query">
3068
+ >(
3069
+ // @ts-ignore
3070
+ {
3071
+ queryFn: async ({ pageParam, queryKey, signal }) => {
3072
+ // @ts-ignore
3073
+ const page: Pick<
3074
+ QueryKey<Options<ListSharedAccessGrantsData>>[0],
3075
+ "body" | "headers" | "path" | "query"
3076
+ > =
3077
+ typeof pageParam === "object"
3078
+ ? pageParam
3079
+ : {
3080
+ query: {
3081
+ offset: pageParam,
3082
+ },
3083
+ }
3084
+ const params = createInfiniteParams(queryKey, page)
3085
+ const { data } = await listSharedAccessGrants({
3086
+ ...options,
3087
+ ...params,
3088
+ signal,
3089
+ throwOnError: true,
3090
+ })
3091
+ return data
3092
+ },
3093
+ queryKey: listSharedAccessGrantsInfiniteQueryKey(options),
3094
+ }
3095
+ )
3096
+
3097
+ /**
3098
+ * Issue a shared-access grant
3099
+ */
3100
+ export const issueSharedAccessGrantMutation = (
3101
+ options?: Partial<Options<IssueSharedAccessGrantData>>
3102
+ ): UseMutationOptions<
3103
+ IssueSharedAccessGrantResponse,
3104
+ IssueSharedAccessGrantError,
3105
+ Options<IssueSharedAccessGrantData>
3106
+ > => {
3107
+ const mutationOptions: UseMutationOptions<
3108
+ IssueSharedAccessGrantResponse,
3109
+ IssueSharedAccessGrantError,
3110
+ Options<IssueSharedAccessGrantData>
3111
+ > = {
3112
+ mutationFn: async (fnOptions) => {
3113
+ const { data } = await issueSharedAccessGrant({
3114
+ ...options,
3115
+ ...fnOptions,
3116
+ throwOnError: true,
3117
+ })
3118
+ return data
3119
+ },
3120
+ }
3121
+ return mutationOptions
3122
+ }
3123
+
3124
+ /**
3125
+ * Revoke a shared-access grant
3126
+ */
3127
+ export const revokeSharedAccessGrantMutation = (
3128
+ options?: Partial<Options<RevokeSharedAccessGrantData>>
3129
+ ): UseMutationOptions<
3130
+ RevokeSharedAccessGrantResponse,
3131
+ RevokeSharedAccessGrantError,
3132
+ Options<RevokeSharedAccessGrantData>
3133
+ > => {
3134
+ const mutationOptions: UseMutationOptions<
3135
+ RevokeSharedAccessGrantResponse,
3136
+ RevokeSharedAccessGrantError,
3137
+ Options<RevokeSharedAccessGrantData>
3138
+ > = {
3139
+ mutationFn: async (fnOptions) => {
3140
+ const { data } = await revokeSharedAccessGrant({
3141
+ ...options,
3142
+ ...fnOptions,
3143
+ throwOnError: true,
3144
+ })
3145
+ return data
3146
+ },
3147
+ }
3148
+ return mutationOptions
3149
+ }
3150
+
3151
+ /**
3152
+ * Exchange a shared link for a short-lived session
3153
+ */
3154
+ export const exchangeSharedAccessMutation = (
3155
+ options?: Partial<Options<ExchangeSharedAccessData>>
3156
+ ): UseMutationOptions<
3157
+ ExchangeSharedAccessResponse,
3158
+ ExchangeSharedAccessError,
3159
+ Options<ExchangeSharedAccessData>
3160
+ > => {
3161
+ const mutationOptions: UseMutationOptions<
3162
+ ExchangeSharedAccessResponse,
3163
+ ExchangeSharedAccessError,
3164
+ Options<ExchangeSharedAccessData>
3165
+ > = {
3166
+ mutationFn: async (fnOptions) => {
3167
+ const { data } = await exchangeSharedAccess({
3168
+ ...options,
3169
+ ...fnOptions,
3170
+ throwOnError: true,
3171
+ })
3172
+ return data
3173
+ },
3174
+ }
3175
+ return mutationOptions
3176
+ }
3177
+
3178
+ export const getSharedAccessSessionQueryKey = (options: Options<GetSharedAccessSessionData>) =>
3179
+ createQueryKey("getSharedAccessSession", options)
3180
+
3181
+ /**
3182
+ * Get the current shared-access session
3183
+ */
3184
+ export const getSharedAccessSessionOptions = (options: Options<GetSharedAccessSessionData>) =>
3185
+ queryOptions<
3186
+ GetSharedAccessSessionResponse,
3187
+ GetSharedAccessSessionError,
3188
+ GetSharedAccessSessionResponse,
3189
+ ReturnType<typeof getSharedAccessSessionQueryKey>
3190
+ >({
3191
+ queryFn: async ({ queryKey, signal }) => {
3192
+ const { data } = await getSharedAccessSession({
3193
+ ...options,
3194
+ ...queryKey[0],
3195
+ signal,
3196
+ throwOnError: true,
3197
+ })
3198
+ return data
3199
+ },
3200
+ queryKey: getSharedAccessSessionQueryKey(options),
3201
+ })
3202
+
3203
+ /**
3204
+ * Sign out a shared-access session
3205
+ */
3206
+ export const signOutSharedAccessMutation = (
3207
+ options?: Partial<Options<SignOutSharedAccessData>>
3208
+ ): UseMutationOptions<
3209
+ SignOutSharedAccessResponse,
3210
+ SignOutSharedAccessError,
3211
+ Options<SignOutSharedAccessData>
3212
+ > => {
3213
+ const mutationOptions: UseMutationOptions<
3214
+ SignOutSharedAccessResponse,
3215
+ SignOutSharedAccessError,
3216
+ Options<SignOutSharedAccessData>
3217
+ > = {
3218
+ mutationFn: async (fnOptions) => {
3219
+ const { data } = await signOutSharedAccess({
3220
+ ...options,
3221
+ ...fnOptions,
3222
+ throwOnError: true,
3223
+ })
3224
+ return data
3225
+ },
3226
+ }
3227
+ return mutationOptions
3228
+ }
3229
+
2687
3230
  export const listObjectTypesQueryKey = (options?: Options<ListObjectTypesData>) =>
2688
3231
  createQueryKey("listObjectTypes", options)
2689
3232
 
@@ -3368,38 +3911,13 @@ export const getActionRunFileContentOptions = (options: Options<GetActionRunFile
3368
3911
  queryKey: getActionRunFileContentQueryKey(options),
3369
3912
  })
3370
3913
 
3371
- export const listAgentsQueryKey = (options?: Options<ListAgentsData>) =>
3372
- createQueryKey("listAgents", options)
3373
-
3374
- /**
3375
- * List registered agents
3376
- */
3377
- export const listAgentsOptions = (options?: Options<ListAgentsData>) =>
3378
- queryOptions<
3379
- ListAgentsResponse,
3380
- DefaultError,
3381
- ListAgentsResponse,
3382
- ReturnType<typeof listAgentsQueryKey>
3383
- >({
3384
- queryFn: async ({ queryKey, signal }) => {
3385
- const { data } = await listAgents({
3386
- ...options,
3387
- ...queryKey[0],
3388
- signal,
3389
- throwOnError: true,
3390
- })
3391
- return data
3392
- },
3393
- queryKey: listAgentsQueryKey(options),
3394
- })
3395
-
3396
- export const getAgentQueryKey = (options: Options<GetAgentData>) =>
3914
+ export const getAgentQueryKey = (options?: Options<GetAgentData>) =>
3397
3915
  createQueryKey("getAgent", options)
3398
3916
 
3399
3917
  /**
3400
- * Get agent metadata
3918
+ * Get the project Agent
3401
3919
  */
3402
- export const getAgentOptions = (options: Options<GetAgentData>) =>
3920
+ export const getAgentOptions = (options?: Options<GetAgentData>) =>
3403
3921
  queryOptions<
3404
3922
  GetAgentResponse,
3405
3923
  GetAgentError,