@cloudfleet/sdk 0.0.1-bbca6e3 → 0.0.1-bd45f1a

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.
@@ -24,16 +24,13 @@ const createQueryKey = (id, options, infinite, tags) => {
24
24
  }
25
25
  return [params];
26
26
  };
27
- export const getUsageQueryKey = (options) => createQueryKey('getUsage', options);
27
+ export const listUserOrganizationsQueryKey = (options) => createQueryKey('listUserOrganizations', options);
28
28
  /**
29
- * Get billing usage information.
30
- *
31
- * Returns aggregated usage information for the organization with facets for filtering. For more information on billing and payments, see [Billing and pricing](https://cloudfleet.ai/docs/organization/billing/) section of documentaiton. This endpoint is available to all users in the organization.
32
- *
29
+ * Get a list of organizations the user belongs to. Used during authentication process.
33
30
  */
34
- export const getUsageOptions = (options) => queryOptions({
31
+ export const listUserOrganizationsOptions = (options) => queryOptions({
35
32
  queryFn: async ({ queryKey, signal }) => {
36
- const { data } = await BillingService.getUsage({
33
+ const { data } = await UsersService.listUserOrganizations({
37
34
  ...options,
38
35
  ...queryKey[0],
39
36
  signal,
@@ -41,37 +38,20 @@ export const getUsageOptions = (options) => queryOptions({
41
38
  });
42
39
  return data;
43
40
  },
44
- queryKey: getUsageQueryKey(options)
41
+ queryKey: listUserOrganizationsQueryKey(options)
45
42
  });
43
+ export const listUsersQueryKey = (options) => createQueryKey('listUsers', options);
46
44
  /**
47
- * Get Stripe client secret.
48
- *
49
- * Endpoint returns the Stripe secret key for the organization. This key is used to securely update the payment method in the Cloudfleet console only, please visit https://console.cloudfleet.ai. This endpoint is available to administrators of the organization only.
45
+ * List users in organization.
50
46
  *
51
- */
52
- export const getPaymentMethodSecretMutation = (options) => {
53
- const mutationOptions = {
54
- mutationFn: async (fnOptions) => {
55
- const { data } = await BillingService.getPaymentMethodSecret({
56
- ...options,
57
- ...fnOptions,
58
- throwOnError: true
59
- });
60
- return data;
61
- }
62
- };
63
- return mutationOptions;
64
- };
65
- export const listPaymentMethodsQueryKey = (options) => createQueryKey('listPaymentMethods', options);
66
- /**
67
- * List organization payment methods.
47
+ * Returns a list of user details and their roles. For more information on identity access management, see [Users](https://cloudfleet.ai/docs/organization/users/) section of documentaiton.
68
48
  *
69
- * Returns all payment methods (cards and SEPA Direct Debit) attached to the organization, most recently added first, with the default flagged. This endpoint is available to all users in the organization.
49
+ * This endpoint is available to all users in the organization.
70
50
  *
71
51
  */
72
- export const listPaymentMethodsOptions = (options) => queryOptions({
52
+ export const listUsersOptions = (options) => queryOptions({
73
53
  queryFn: async ({ queryKey, signal }) => {
74
- const { data } = await BillingService.listPaymentMethods({
54
+ const { data } = await UsersService.listUsers({
75
55
  ...options,
76
56
  ...queryKey[0],
77
57
  signal,
@@ -79,18 +59,18 @@ export const listPaymentMethodsOptions = (options) => queryOptions({
79
59
  });
80
60
  return data;
81
61
  },
82
- queryKey: listPaymentMethodsQueryKey(options)
62
+ queryKey: listUsersQueryKey(options)
83
63
  });
84
64
  /**
85
- * Set the default payment method.
65
+ * Create a new user.
86
66
  *
87
- * Sets the given payment method as the default used for invoices and active subscriptions. Requires the Administrator role.
67
+ * Create a new user in your Cloudfleet organization. Requires a valid invite code generated by the `invites create` command. The invite code is a unique string that can be used only once to create a new user. The invite code is generated by the `POST /invites` endpoint.
88
68
  *
89
69
  */
90
- export const setDefaultPaymentMethodMutation = (options) => {
70
+ export const createUserMutation = (options) => {
91
71
  const mutationOptions = {
92
72
  mutationFn: async (fnOptions) => {
93
- const { data } = await BillingService.setDefaultPaymentMethod({
73
+ const { data } = await UsersService.createUser({
94
74
  ...options,
95
75
  ...fnOptions,
96
76
  throwOnError: true
@@ -101,15 +81,15 @@ export const setDefaultPaymentMethodMutation = (options) => {
101
81
  return mutationOptions;
102
82
  };
103
83
  /**
104
- * Delete a payment method.
84
+ * Delete user by id.
105
85
  *
106
- * Detaches the given payment method from the organization. Requires the Administrator role. An organization must keep at least one payment method, so deleting the only remaining method is rejected.
86
+ * Sets user status to `inactive`. Inactive users cannot log in and manage organization resources. This endpoint is available to administrators of the organization only.
107
87
  *
108
88
  */
109
- export const deletePaymentMethodMutation = (options) => {
89
+ export const deleteUserMutation = (options) => {
110
90
  const mutationOptions = {
111
91
  mutationFn: async (fnOptions) => {
112
- const { data } = await BillingService.deletePaymentMethod({
92
+ const { data } = await UsersService.deleteUser({
113
93
  ...options,
114
94
  ...fnOptions,
115
95
  throwOnError: true
@@ -119,35 +99,18 @@ export const deletePaymentMethodMutation = (options) => {
119
99
  };
120
100
  return mutationOptions;
121
101
  };
122
- export const listInvoicesQueryKey = (options) => createQueryKey('listInvoices', options);
102
+ export const getUserQueryKey = (options) => createQueryKey('getUser', options);
123
103
  /**
124
- * List issued invoices.
125
- *
126
- * Returns a list of invoices for the organization. For more information on billing and payments, see [Billing and pricing](https://cloudfleet.ai/docs/organization/billing/) section of documentaiton. This endpoint is available to all users in the organization.
104
+ * Get user profile information by id.
127
105
  *
128
- */
129
- export const listInvoicesOptions = (options) => queryOptions({
130
- queryFn: async ({ queryKey, signal }) => {
131
- const { data } = await BillingService.listInvoices({
132
- ...options,
133
- ...queryKey[0],
134
- signal,
135
- throwOnError: true
136
- });
137
- return data;
138
- },
139
- queryKey: listInvoicesQueryKey(options)
140
- });
141
- export const getContactQueryKey = (options) => createQueryKey('getContact', options);
142
- /**
143
- * Get organization contact and billing address information.
106
+ * Returns user details including their roles. For more information on identity access management, see [Users](https://cloudfleet.ai/docs/organization/users/) section of documentaiton.
144
107
  *
145
- * Returns the organization contact and billing address information. This endpoint is available to all users in the organization.
108
+ * This endpoint is available to all users in the organization.
146
109
  *
147
110
  */
148
- export const getContactOptions = (options) => queryOptions({
111
+ export const getUserOptions = (options) => queryOptions({
149
112
  queryFn: async ({ queryKey, signal }) => {
150
- const { data } = await BillingService.getContact({
113
+ const { data } = await UsersService.getUser({
151
114
  ...options,
152
115
  ...queryKey[0],
153
116
  signal,
@@ -155,18 +118,18 @@ export const getContactOptions = (options) => queryOptions({
155
118
  });
156
119
  return data;
157
120
  },
158
- queryKey: getContactQueryKey(options)
121
+ queryKey: getUserQueryKey(options)
159
122
  });
160
123
  /**
161
- * Update organization contact information and billing address.
124
+ * Update user profile information.
162
125
  *
163
- * This endpoint allows you to update organization details with its contact information. This endpoint is available to administrators of the organization only.
126
+ * Update user profile information: email, first name, last name, role. This endpoint can be accessed by administrators and the user itself. Role and status can be changed by administrators only.
164
127
  *
165
128
  */
166
- export const updateContactMutation = (options) => {
129
+ export const updateUserMutation = (options) => {
167
130
  const mutationOptions = {
168
131
  mutationFn: async (fnOptions) => {
169
- const { data } = await BillingService.updateContact({
132
+ const { data } = await UsersService.updateUser({
170
133
  ...options,
171
134
  ...fnOptions,
172
135
  throwOnError: true
@@ -176,16 +139,16 @@ export const updateContactMutation = (options) => {
176
139
  };
177
140
  return mutationOptions;
178
141
  };
179
- export const getCreditsQueryKey = (options) => createQueryKey('getCredits', options);
142
+ export const listTokensQueryKey = (options) => createQueryKey('listTokens', options);
180
143
  /**
181
- * Get applied promotional credits
144
+ * List access tokens in organization.
182
145
  *
183
- * Returns applied promotional credits for the organization. For more information on billing and payments, see [Billing and pricing](https://cloudfleet.ai/docs/organization/billing/) section of documentaiton. This endpoint is available to all users in the organization.
146
+ * This endpoint allows you to get a list of all access tokens details in organization. For more information about identity access management and security, see [Service Accounts](https://cloudfleet.ai/docs/organization/api-tokens/) section of documentaiton. This endpoint is available to all users in the organization.
184
147
  *
185
148
  */
186
- export const getCreditsOptions = (options) => queryOptions({
149
+ export const listTokensOptions = (options) => queryOptions({
187
150
  queryFn: async ({ queryKey, signal }) => {
188
- const { data } = await BillingService.getCredits({
151
+ const { data } = await TokensService.listTokens({
189
152
  ...options,
190
153
  ...queryKey[0],
191
154
  signal,
@@ -193,18 +156,20 @@ export const getCreditsOptions = (options) => queryOptions({
193
156
  });
194
157
  return data;
195
158
  },
196
- queryKey: getCreditsQueryKey(options)
159
+ queryKey: listTokensQueryKey(options)
197
160
  });
198
161
  /**
199
- * Redeem promotional credits code.
162
+ * Create a new access token.
200
163
  *
201
- * Applies promotional credits for the organization. For more information on billing and payments, see [Billing and pricing](https://cloudfleet.ai/docs/organization/billing/) section of documentaiton. This endpoint is available to all users in the organization.
164
+ * This endpoint allows you to create a new access token. For more information about identity access management and security, see [Service Accounts](https://cloudfleet.ai/docs/organization/api-tokens/) section of documentaiton.
165
+ *
166
+ * This endpoint is available to administrators of the organization only.
202
167
  *
203
168
  */
204
- export const redeemCreditsMutation = (options) => {
169
+ export const createTokenMutation = (options) => {
205
170
  const mutationOptions = {
206
171
  mutationFn: async (fnOptions) => {
207
- const { data } = await BillingService.redeemCredits({
172
+ const { data } = await TokensService.createToken({
208
173
  ...options,
209
174
  ...fnOptions,
210
175
  throwOnError: true
@@ -214,18 +179,35 @@ export const redeemCreditsMutation = (options) => {
214
179
  };
215
180
  return mutationOptions;
216
181
  };
217
- export const listChartsQueryKey = (options) => createQueryKey('listCharts', options);
218
182
  /**
219
- * List charts.
183
+ * Permanently delete access token.
220
184
  *
221
- * Returns a list of charts in the cluster.
185
+ * This endpoint allows you to delete an access token. For more information about identity access management and security, see [Service Accounts](https://cloudfleet.ai/docs/organization/api-tokens/) section of documentaiton. This endpoint is available to administrators of the organization only.
222
186
  *
223
- * This endpoint is available to all users in the organization.
187
+ */
188
+ export const deleteTokenMutation = (options) => {
189
+ const mutationOptions = {
190
+ mutationFn: async (fnOptions) => {
191
+ const { data } = await TokensService.deleteToken({
192
+ ...options,
193
+ ...fnOptions,
194
+ throwOnError: true
195
+ });
196
+ return data;
197
+ }
198
+ };
199
+ return mutationOptions;
200
+ };
201
+ export const getTokenQueryKey = (options) => createQueryKey('getToken', options);
202
+ /**
203
+ * Get access token information.
204
+ *
205
+ * This endpoint allows you to get access token details. For more information about identity access management and security, see [Service Accounts](https://cloudfleet.ai/docs/organization/api-tokens/) section of documentaiton. This endpoint is available to all users in the organization.
224
206
  *
225
207
  */
226
- export const listChartsOptions = (options) => queryOptions({
208
+ export const getTokenOptions = (options) => queryOptions({
227
209
  queryFn: async ({ queryKey, signal }) => {
228
- const { data } = await ClustersService.listCharts({
210
+ const { data } = await TokensService.getToken({
229
211
  ...options,
230
212
  ...queryKey[0],
231
213
  signal,
@@ -233,20 +215,20 @@ export const listChartsOptions = (options) => queryOptions({
233
215
  });
234
216
  return data;
235
217
  },
236
- queryKey: listChartsQueryKey(options)
218
+ queryKey: getTokenQueryKey(options)
237
219
  });
238
220
  /**
239
- * Create a new chart.
221
+ * Update access token information.
240
222
  *
241
- * Create a new chart deployment.
223
+ * This endpoint allows you to update access token details. For more information about identity access management and security, see [Service Accounts](https://cloudfleet.ai/docs/organization/api-tokens/) section of documentaiton.
242
224
  *
243
225
  * This endpoint is available to administrators of the organization only.
244
226
  *
245
227
  */
246
- export const createChartMutation = (options) => {
228
+ export const updateTokenMutation = (options) => {
247
229
  const mutationOptions = {
248
230
  mutationFn: async (fnOptions) => {
249
- const { data } = await ClustersService.createChart({
231
+ const { data } = await TokensService.updateToken({
250
232
  ...options,
251
233
  ...fnOptions,
252
234
  throwOnError: true
@@ -257,17 +239,14 @@ export const createChartMutation = (options) => {
257
239
  return mutationOptions;
258
240
  };
259
241
  /**
260
- * Permanently delete the chart deployment from the cluster.
261
- *
262
- * This endpoint will permanently delete chart. This operation cannot be undone.
263
- *
264
- * This endpoint is available to administrators of the organization only.
242
+ * Regenerate access token secret key.
265
243
  *
244
+ * Generates a new access token secret. Old secret will not be valid anymore.
266
245
  */
267
- export const deleteChartMutation = (options) => {
246
+ export const regenerateTokenMutation = (options) => {
268
247
  const mutationOptions = {
269
248
  mutationFn: async (fnOptions) => {
270
- const { data } = await ClustersService.deleteChart({
249
+ const { data } = await TokensService.regenerateToken({
271
250
  ...options,
272
251
  ...fnOptions,
273
252
  throwOnError: true
@@ -277,18 +256,16 @@ export const deleteChartMutation = (options) => {
277
256
  };
278
257
  return mutationOptions;
279
258
  };
280
- export const getChartQueryKey = (options) => createQueryKey('getChart', options);
259
+ export const listTicketsQueryKey = (options) => createQueryKey('listTickets', options);
281
260
  /**
282
- * Get chart information.
283
- *
284
- * Returns the details of the chart deployment.
261
+ * List tickets for the current organization.
285
262
  *
286
- * This endpoint is available to all users in the organization.
263
+ * Returns all tickets belonging to the caller's organization, newest first.
287
264
  *
288
265
  */
289
- export const getChartOptions = (options) => queryOptions({
266
+ export const listTicketsOptions = (options) => queryOptions({
290
267
  queryFn: async ({ queryKey, signal }) => {
291
- const { data } = await ClustersService.getChart({
268
+ const { data } = await TicketsService.listTickets({
292
269
  ...options,
293
270
  ...queryKey[0],
294
271
  signal,
@@ -296,20 +273,18 @@ export const getChartOptions = (options) => queryOptions({
296
273
  });
297
274
  return data;
298
275
  },
299
- queryKey: getChartQueryKey(options)
276
+ queryKey: listTicketsQueryKey(options)
300
277
  });
301
278
  /**
302
- * Update chart information.
303
- *
304
- * This endpoint allows you to update the values of a chart deployment.
279
+ * Create a new support ticket.
305
280
  *
306
- * This endpoint is available to administrators of the organization only.
281
+ * Creates a new support ticket with an initial customer message. The request is `multipart/form-data` with a JSON-encoded `payload` field carrying `category`, `body`, and optional `properties`, plus up to 3 `attachments` files (10 MB max each).
307
282
  *
308
283
  */
309
- export const updateChartMutation = (options) => {
284
+ export const createTicketMutation = (options) => {
310
285
  const mutationOptions = {
311
286
  mutationFn: async (fnOptions) => {
312
- const { data } = await ClustersService.updateChart({
287
+ const { data } = await TicketsService.createTicket({
313
288
  ...options,
314
289
  ...fnOptions,
315
290
  throwOnError: true
@@ -319,39 +294,16 @@ export const updateChartMutation = (options) => {
319
294
  };
320
295
  return mutationOptions;
321
296
  };
322
- export const listFleetsQueryKey = (options) => createQueryKey('listFleets', options);
323
- /**
324
- * List fleets.
325
- *
326
- * Returns a list of fleets belonging to the cluster. For more information, see [Fleets](https://cloudfleet.ai/docs/cloud-infrastructure/fleets/) section of documentaiton.
327
- *
328
- * This endpoint is available to all users in the organization.
329
- *
330
- */
331
- export const listFleetsOptions = (options) => queryOptions({
332
- queryFn: async ({ queryKey, signal }) => {
333
- const { data } = await ClustersService.listFleets({
334
- ...options,
335
- ...queryKey[0],
336
- signal,
337
- throwOnError: true
338
- });
339
- return data;
340
- },
341
- queryKey: listFleetsQueryKey(options)
342
- });
343
297
  /**
344
- * Create a new fleet.
345
- *
346
- * Create a new fleet under the current organization. fleets allow you to to schedule workloads in cloud service provider accounts owned by you. For more information, see [Fleets](https://cloudfleet.ai/docs/cloud-infrastructure/fleets/) section of documentaiton.
298
+ * Close a ticket (soft close).
347
299
  *
348
- * This endpoint is available to administrators of the organization only.
300
+ * Marks the ticket as closed. Closed is a terminal state — users cannot reply to a closed ticket; a new ticket must be opened instead.
349
301
  *
350
302
  */
351
- export const createFleetMutation = (options) => {
303
+ export const closeTicketMutation = (options) => {
352
304
  const mutationOptions = {
353
305
  mutationFn: async (fnOptions) => {
354
- const { data } = await ClustersService.createFleet({
306
+ const { data } = await TicketsService.closeTicket({
355
307
  ...options,
356
308
  ...fnOptions,
357
309
  throwOnError: true
@@ -361,18 +313,32 @@ export const createFleetMutation = (options) => {
361
313
  };
362
314
  return mutationOptions;
363
315
  };
316
+ export const getTicketQueryKey = (options) => createQueryKey('getTicket', options);
364
317
  /**
365
- * Permanently delete fleet.
366
- *
367
- * This endpoint will permanently delete fleet. This operation cannot be undone. Your subscription will end by the end of the current billing period and you will not be able to receive credit for unused time. For more information, see [Fleets](https://cloudfleet.ai/docs/cloud-infrastructure/fleets/) section of documentaiton.
318
+ * Get a ticket and its messages.
319
+ */
320
+ export const getTicketOptions = (options) => queryOptions({
321
+ queryFn: async ({ queryKey, signal }) => {
322
+ const { data } = await TicketsService.getTicket({
323
+ ...options,
324
+ ...queryKey[0],
325
+ signal,
326
+ throwOnError: true
327
+ });
328
+ return data;
329
+ },
330
+ queryKey: getTicketQueryKey(options)
331
+ });
332
+ /**
333
+ * Append a customer reply to a ticket.
368
334
  *
369
- * This endpoint is available to administrators of the organization only.
335
+ * Multipart form-data with a JSON-encoded `payload` field carrying `body`, plus up to 3 `attachments` files. Returns 409 if the ticket is closed.
370
336
  *
371
337
  */
372
- export const deleteFleetMutation = (options) => {
338
+ export const replyTicketMutation = (options) => {
373
339
  const mutationOptions = {
374
340
  mutationFn: async (fnOptions) => {
375
- const { data } = await ClustersService.deleteFleet({
341
+ const { data } = await TicketsService.replyTicket({
376
342
  ...options,
377
343
  ...fnOptions,
378
344
  throwOnError: true
@@ -382,18 +348,32 @@ export const deleteFleetMutation = (options) => {
382
348
  };
383
349
  return mutationOptions;
384
350
  };
385
- export const getFleetQueryKey = (options) => createQueryKey('getFleet', options);
351
+ export const getTicketAttachmentQueryKey = (options) => createQueryKey('getTicketAttachment', options);
386
352
  /**
387
- * Get fleet information.
388
- *
389
- * Returns fleet details. For more information, see [Fleets](https://cloudfleet.ai/docs/cloud-infrastructure/fleets/) section of documentaiton.
353
+ * Download a ticket attachment.
354
+ */
355
+ export const getTicketAttachmentOptions = (options) => queryOptions({
356
+ queryFn: async ({ queryKey, signal }) => {
357
+ const { data } = await TicketsService.getTicketAttachment({
358
+ ...options,
359
+ ...queryKey[0],
360
+ signal,
361
+ throwOnError: true
362
+ });
363
+ return data;
364
+ },
365
+ queryKey: getTicketAttachmentQueryKey(options)
366
+ });
367
+ export const listRepositoriesQueryKey = (options) => createQueryKey('listRepositories', options);
368
+ /**
369
+ * List repositories
390
370
  *
391
- * This endpoint is available to all users in the organization.
371
+ * Returns a list of repositories in the registry across all regions. This endpoint is available to all users in the organization.
392
372
  *
393
373
  */
394
- export const getFleetOptions = (options) => queryOptions({
374
+ export const listRepositoriesOptions = (options) => queryOptions({
395
375
  queryFn: async ({ queryKey, signal }) => {
396
- const { data } = await ClustersService.getFleet({
376
+ const { data } = await RegistryService.listRepositories({
397
377
  ...options,
398
378
  ...queryKey[0],
399
379
  signal,
@@ -401,22 +381,37 @@ export const getFleetOptions = (options) => queryOptions({
401
381
  });
402
382
  return data;
403
383
  },
404
- queryKey: getFleetQueryKey(options)
384
+ queryKey: listRepositoriesQueryKey(options)
405
385
  });
386
+ export const listTagsQueryKey = (options) => createQueryKey('listTags', options);
406
387
  /**
407
- * Update fleet information.
388
+ * List tags for a repository
408
389
  *
409
- * This endpoint allows you to update fleet details.
390
+ * Returns a list of tags for a specific repository, including size and metadata for each tag. This endpoint is available to all users in the organization.
410
391
  *
411
- * For more information, see [Fleets](https://cloudfleet.ai/docs/cloud-infrastructure/fleets/) section of documentaiton.
392
+ */
393
+ export const listTagsOptions = (options) => queryOptions({
394
+ queryFn: async ({ queryKey, signal }) => {
395
+ const { data } = await RegistryService.listTags({
396
+ ...options,
397
+ ...queryKey[0],
398
+ signal,
399
+ throwOnError: true
400
+ });
401
+ return data;
402
+ },
403
+ queryKey: listTagsQueryKey(options)
404
+ });
405
+ /**
406
+ * Delete tag
412
407
  *
413
- * This endpoint is available to administrators of the organization only.
408
+ * Permanently deletes a specific tag from a repository. This endpoint is available to administrators of the organization only.
414
409
  *
415
410
  */
416
- export const updateFleetMutation = (options) => {
411
+ export const deleteTagMutation = (options) => {
417
412
  const mutationOptions = {
418
413
  mutationFn: async (fnOptions) => {
419
- const { data } = await ClustersService.updateFleet({
414
+ const { data } = await RegistryService.deleteTag({
420
415
  ...options,
421
416
  ...fnOptions,
422
417
  throwOnError: true
@@ -426,15 +421,16 @@ export const updateFleetMutation = (options) => {
426
421
  };
427
422
  return mutationOptions;
428
423
  };
429
- export const queryClusterQueryKey = (options) => createQueryKey('queryCluster', options);
424
+ export const getTagQueryKey = (options) => createQueryKey('getTag', options);
430
425
  /**
431
- * Query Kubernetes cluster API
426
+ * Get tag details
427
+ *
428
+ * Returns detailed information for a specific tag in a repository, including manifest details, size, and URI. This endpoint is available to all users in the organization.
432
429
  *
433
- * An API endpoint for directly querying a Kubernetes cluster API without requiring kubectl or other tools. This endpoint is ideal for automation and scripting, as well as for internal use in fetching data for the Cloudfleet Console. It acts as a passthrough to the Kubernetes API, allowing access to any valid Kubernetes API endpoint, including those not exposed in the Cloudfleet Console. The endpoint is strictly read-only, ensuring no modifications to the cluster state. It is accessible to all users within the organization and uses the same authentication mechanisms as other Cloudfleet API endpoints.
434
430
  */
435
- export const queryClusterOptions = (options) => queryOptions({
431
+ export const getTagOptions = (options) => queryOptions({
436
432
  queryFn: async ({ queryKey, signal }) => {
437
- const { data } = await ClustersService.queryCluster({
433
+ const { data } = await RegistryService.getTag({
438
434
  ...options,
439
435
  ...queryKey[0],
440
436
  signal,
@@ -442,20 +438,20 @@ export const queryClusterOptions = (options) => queryOptions({
442
438
  });
443
439
  return data;
444
440
  },
445
- queryKey: queryClusterQueryKey(options)
441
+ queryKey: getTagQueryKey(options)
446
442
  });
447
- export const listClustersQueryKey = (options) => createQueryKey('listClusters', options);
443
+ export const getOrganizationQueryKey = (options) => createQueryKey('getOrganization', options);
448
444
  /**
449
- * List clusters.
445
+ * Get organization information.
450
446
  *
451
- * Returns a list of clusters under the current organization.
447
+ * Returns organization details including quota. For more information about quotas, see [Quotas and limits](https://cloudfleet.ai/docs/organization/quotas/) section of documentaiton.
452
448
  *
453
449
  * This endpoint is available to all users in the organization.
454
450
  *
455
451
  */
456
- export const listClustersOptions = (options) => queryOptions({
452
+ export const getOrganizationOptions = (options) => queryOptions({
457
453
  queryFn: async ({ queryKey, signal }) => {
458
- const { data } = await ClustersService.listClusters({
454
+ const { data } = await OrganizationService.getOrganization({
459
455
  ...options,
460
456
  ...queryKey[0],
461
457
  signal,
@@ -463,20 +459,18 @@ export const listClustersOptions = (options) => queryOptions({
463
459
  });
464
460
  return data;
465
461
  },
466
- queryKey: listClustersQueryKey(options)
462
+ queryKey: getOrganizationQueryKey(options)
467
463
  });
468
464
  /**
469
- * Create a new cluster.
470
- *
471
- * Create a new cluster under the current organization. Clusters allow you to group resources and you can create multiple clusters under the same organization, with billing delegated to the parent organization.
465
+ * Create a new organization / Cloudfleet account signup.
472
466
  *
473
- * This endpoint is available to administrators of the organization only.
467
+ * This endpoint allows you to create a new Cloudfleet organization and an administrator user.
474
468
  *
475
469
  */
476
- export const createClusterMutation = (options) => {
470
+ export const createOrganizationMutation = (options) => {
477
471
  const mutationOptions = {
478
472
  mutationFn: async (fnOptions) => {
479
- const { data } = await ClustersService.createCluster({
473
+ const { data } = await OrganizationService.createOrganization({
480
474
  ...options,
481
475
  ...fnOptions,
482
476
  throwOnError: true
@@ -487,19 +481,14 @@ export const createClusterMutation = (options) => {
487
481
  return mutationOptions;
488
482
  };
489
483
  /**
490
- * Permanently delete cluster.
491
- *
492
- * This endpoint will permanently delete the cluster. This operation cannot be undone.
493
- *
494
- * Deletion is synchronous: a `200` response means the cluster has been torn down (this can take some time for larger clusters). Deleting a cluster that does not exist or has already been deleted returns `404`.
495
- *
496
- * This endpoint is available to administrators of the organization only.
484
+ * MCP endpoint
497
485
  *
486
+ * MCP endpoint for handling Model Context Protocol JSON-RPC 2.0 messages.
498
487
  */
499
- export const deleteClusterMutation = (options) => {
488
+ export const postMcpMutation = (options) => {
500
489
  const mutationOptions = {
501
490
  mutationFn: async (fnOptions) => {
502
- const { data } = await ClustersService.deleteCluster({
491
+ const { data } = await McpService.postMcp({
503
492
  ...options,
504
493
  ...fnOptions,
505
494
  throwOnError: true
@@ -509,18 +498,18 @@ export const deleteClusterMutation = (options) => {
509
498
  };
510
499
  return mutationOptions;
511
500
  };
512
- export const getClusterQueryKey = (options) => createQueryKey('getCluster', options);
501
+ export const listMarketplaceChartsQueryKey = (options) => createQueryKey('listMarketplaceCharts', options);
513
502
  /**
514
- * Get cluster information.
503
+ * List chart listings available in the marketplace.
515
504
  *
516
- * Returns cluster details.
505
+ * Returns a list of available charts in the marketplace.
517
506
  *
518
507
  * This endpoint is available to all users in the organization.
519
508
  *
520
509
  */
521
- export const getClusterOptions = (options) => queryOptions({
510
+ export const listMarketplaceChartsOptions = (options) => queryOptions({
522
511
  queryFn: async ({ queryKey, signal }) => {
523
- const { data } = await ClustersService.getCluster({
512
+ const { data } = await ChartsMarketplaceService.listMarketplaceCharts({
524
513
  ...options,
525
514
  ...queryKey[0],
526
515
  signal,
@@ -528,48 +517,31 @@ export const getClusterOptions = (options) => queryOptions({
528
517
  });
529
518
  return data;
530
519
  },
531
- queryKey: getClusterQueryKey(options)
520
+ queryKey: listMarketplaceChartsQueryKey(options)
532
521
  });
522
+ export const getMarketplaceChartFilesQueryKey = (options) => createQueryKey('getMarketplaceChartFiles', options);
533
523
  /**
534
- * Update cluster information.
535
- *
536
- * This endpoint allows you to update cluster details such as name, tier, and Kubernetes version. For more information about clusters, see [Clusters](https://cloudfleet.ai/docs/cluster-management/cluster-types/) section of documentation.
524
+ * Get chart files for a specific version channel.
537
525
  *
538
- * This endpoint is available to administrators of the organization only.
526
+ * Returns the Chart.yaml, values.yaml, and values.schema.json files for the latest version matching the specified version channel.
539
527
  *
540
- */
541
- export const updateClusterMutation = (options) => {
542
- const mutationOptions = {
543
- mutationFn: async (fnOptions) => {
544
- const { data } = await ClustersService.updateCluster({
545
- ...options,
546
- ...fnOptions,
547
- throwOnError: true
548
- });
549
- return data;
550
- }
551
- };
552
- return mutationOptions;
553
- };
554
- /**
555
- * Node join information for the cluster
528
+ * Version channels use patterns like "1.31.x-cfke.x" to match the latest patch version, or "1.x.x-cfke.x" to match the latest minor version.
556
529
  *
557
- * Returns the join information for the cluster. This information is used to add a self-managed nodes to the CFKE cluster. This endpoint is available to only admins of the organization.
530
+ * This endpoint is available to all users in the organization.
558
531
  *
559
532
  */
560
- export const getJoinInformationMutation = (options) => {
561
- const mutationOptions = {
562
- mutationFn: async (fnOptions) => {
563
- const { data } = await ClustersService.getJoinInformation({
564
- ...options,
565
- ...fnOptions,
566
- throwOnError: true
567
- });
568
- return data;
569
- }
570
- };
571
- return mutationOptions;
572
- };
533
+ export const getMarketplaceChartFilesOptions = (options) => queryOptions({
534
+ queryFn: async ({ queryKey, signal }) => {
535
+ const { data } = await ChartsMarketplaceService.getMarketplaceChartFiles({
536
+ ...options,
537
+ ...queryKey[0],
538
+ signal,
539
+ throwOnError: true
540
+ });
541
+ return data;
542
+ },
543
+ queryKey: getMarketplaceChartFilesQueryKey(options)
544
+ });
573
545
  export const listInvitesQueryKey = (options) => createQueryKey('listInvites', options);
574
546
  /**
575
547
  * List invites.
@@ -646,18 +618,15 @@ export const deleteInviteMutation = (options) => {
646
618
  };
647
619
  return mutationOptions;
648
620
  };
649
- export const listMarketplaceChartsQueryKey = (options) => createQueryKey('listMarketplaceCharts', options);
621
+ export const queryClusterQueryKey = (options) => createQueryKey('queryCluster', options);
650
622
  /**
651
- * List chart listings available in the marketplace.
652
- *
653
- * Returns a list of available charts in the marketplace.
654
- *
655
- * This endpoint is available to all users in the organization.
623
+ * Query Kubernetes cluster API
656
624
  *
625
+ * An API endpoint for directly querying a Kubernetes cluster API without requiring kubectl or other tools. This endpoint is ideal for automation and scripting, as well as for internal use in fetching data for the Cloudfleet Console. It acts as a passthrough to the Kubernetes API, allowing access to any valid Kubernetes API endpoint, including those not exposed in the Cloudfleet Console. The endpoint is strictly read-only, ensuring no modifications to the cluster state. It is accessible to all users within the organization and uses the same authentication mechanisms as other Cloudfleet API endpoints.
657
626
  */
658
- export const listMarketplaceChartsOptions = (options) => queryOptions({
627
+ export const queryClusterOptions = (options) => queryOptions({
659
628
  queryFn: async ({ queryKey, signal }) => {
660
- const { data } = await ChartsMarketplaceService.listMarketplaceCharts({
629
+ const { data } = await ClustersService.queryCluster({
661
630
  ...options,
662
631
  ...queryKey[0],
663
632
  signal,
@@ -665,22 +634,20 @@ export const listMarketplaceChartsOptions = (options) => queryOptions({
665
634
  });
666
635
  return data;
667
636
  },
668
- queryKey: listMarketplaceChartsQueryKey(options)
637
+ queryKey: queryClusterQueryKey(options)
669
638
  });
670
- export const getMarketplaceChartFilesQueryKey = (options) => createQueryKey('getMarketplaceChartFiles', options);
639
+ export const listFleetsQueryKey = (options) => createQueryKey('listFleets', options);
671
640
  /**
672
- * Get chart files for a specific version channel.
673
- *
674
- * Returns the Chart.yaml, values.yaml, and values.schema.json files for the latest version matching the specified version channel.
641
+ * List fleets.
675
642
  *
676
- * Version channels use patterns like "1.31.x-cfke.x" to match the latest patch version, or "1.x.x-cfke.x" to match the latest minor version.
643
+ * Returns a list of fleets belonging to the cluster. For more information, see [Fleets](https://cloudfleet.ai/docs/cloud-infrastructure/fleets/) section of documentaiton.
677
644
  *
678
645
  * This endpoint is available to all users in the organization.
679
646
  *
680
647
  */
681
- export const getMarketplaceChartFilesOptions = (options) => queryOptions({
648
+ export const listFleetsOptions = (options) => queryOptions({
682
649
  queryFn: async ({ queryKey, signal }) => {
683
- const { data } = await ChartsMarketplaceService.getMarketplaceChartFiles({
650
+ const { data } = await ClustersService.listFleets({
684
651
  ...options,
685
652
  ...queryKey[0],
686
653
  signal,
@@ -688,17 +655,20 @@ export const getMarketplaceChartFilesOptions = (options) => queryOptions({
688
655
  });
689
656
  return data;
690
657
  },
691
- queryKey: getMarketplaceChartFilesQueryKey(options)
658
+ queryKey: listFleetsQueryKey(options)
692
659
  });
693
660
  /**
694
- * MCP endpoint
661
+ * Create a new fleet.
662
+ *
663
+ * Create a new fleet under the current organization. fleets allow you to to schedule workloads in cloud service provider accounts owned by you. For more information, see [Fleets](https://cloudfleet.ai/docs/cloud-infrastructure/fleets/) section of documentaiton.
664
+ *
665
+ * This endpoint is available to administrators of the organization only.
695
666
  *
696
- * MCP endpoint for handling Model Context Protocol JSON-RPC 2.0 messages.
697
667
  */
698
- export const postMcpMutation = (options) => {
668
+ export const createFleetMutation = (options) => {
699
669
  const mutationOptions = {
700
670
  mutationFn: async (fnOptions) => {
701
- const { data } = await McpService.postMcp({
671
+ const { data } = await ClustersService.createFleet({
702
672
  ...options,
703
673
  ...fnOptions,
704
674
  throwOnError: true
@@ -708,37 +678,18 @@ export const postMcpMutation = (options) => {
708
678
  };
709
679
  return mutationOptions;
710
680
  };
711
- export const getOrganizationQueryKey = (options) => createQueryKey('getOrganization', options);
712
681
  /**
713
- * Get organization information.
714
- *
715
- * Returns organization details including quota. For more information about quotas, see [Quotas and limits](https://cloudfleet.ai/docs/organization/quotas/) section of documentaiton.
716
- *
717
- * This endpoint is available to all users in the organization.
682
+ * Permanently delete fleet.
718
683
  *
719
- */
720
- export const getOrganizationOptions = (options) => queryOptions({
721
- queryFn: async ({ queryKey, signal }) => {
722
- const { data } = await OrganizationService.getOrganization({
723
- ...options,
724
- ...queryKey[0],
725
- signal,
726
- throwOnError: true
727
- });
728
- return data;
729
- },
730
- queryKey: getOrganizationQueryKey(options)
731
- });
732
- /**
733
- * Create a new organization / Cloudfleet account signup.
684
+ * This endpoint will permanently delete fleet. This operation cannot be undone. Your subscription will end by the end of the current billing period and you will not be able to receive credit for unused time. For more information, see [Fleets](https://cloudfleet.ai/docs/cloud-infrastructure/fleets/) section of documentaiton.
734
685
  *
735
- * This endpoint allows you to create a new Cloudfleet organization and an administrator user.
686
+ * This endpoint is available to administrators of the organization only.
736
687
  *
737
688
  */
738
- export const createOrganizationMutation = (options) => {
689
+ export const deleteFleetMutation = (options) => {
739
690
  const mutationOptions = {
740
691
  mutationFn: async (fnOptions) => {
741
- const { data } = await OrganizationService.createOrganization({
692
+ const { data } = await ClustersService.deleteFleet({
742
693
  ...options,
743
694
  ...fnOptions,
744
695
  throwOnError: true
@@ -748,16 +699,18 @@ export const createOrganizationMutation = (options) => {
748
699
  };
749
700
  return mutationOptions;
750
701
  };
751
- export const listRepositoriesQueryKey = (options) => createQueryKey('listRepositories', options);
702
+ export const getFleetQueryKey = (options) => createQueryKey('getFleet', options);
752
703
  /**
753
- * List repositories
704
+ * Get fleet information.
754
705
  *
755
- * Returns a list of repositories in the registry across all regions. This endpoint is available to all users in the organization.
706
+ * Returns fleet details. For more information, see [Fleets](https://cloudfleet.ai/docs/cloud-infrastructure/fleets/) section of documentaiton.
707
+ *
708
+ * This endpoint is available to all users in the organization.
756
709
  *
757
710
  */
758
- export const listRepositoriesOptions = (options) => queryOptions({
711
+ export const getFleetOptions = (options) => queryOptions({
759
712
  queryFn: async ({ queryKey, signal }) => {
760
- const { data } = await RegistryService.listRepositories({
713
+ const { data } = await ClustersService.getFleet({
761
714
  ...options,
762
715
  ...queryKey[0],
763
716
  signal,
@@ -765,37 +718,22 @@ export const listRepositoriesOptions = (options) => queryOptions({
765
718
  });
766
719
  return data;
767
720
  },
768
- queryKey: listRepositoriesQueryKey(options)
721
+ queryKey: getFleetQueryKey(options)
769
722
  });
770
- export const listTagsQueryKey = (options) => createQueryKey('listTags', options);
771
723
  /**
772
- * List tags for a repository
724
+ * Update fleet information.
773
725
  *
774
- * Returns a list of tags for a specific repository, including size and metadata for each tag. This endpoint is available to all users in the organization.
726
+ * This endpoint allows you to update fleet details.
775
727
  *
776
- */
777
- export const listTagsOptions = (options) => queryOptions({
778
- queryFn: async ({ queryKey, signal }) => {
779
- const { data } = await RegistryService.listTags({
780
- ...options,
781
- ...queryKey[0],
782
- signal,
783
- throwOnError: true
784
- });
785
- return data;
786
- },
787
- queryKey: listTagsQueryKey(options)
788
- });
789
- /**
790
- * Delete tag
728
+ * For more information, see [Fleets](https://cloudfleet.ai/docs/cloud-infrastructure/fleets/) section of documentaiton.
791
729
  *
792
- * Permanently deletes a specific tag from a repository. This endpoint is available to administrators of the organization only.
730
+ * This endpoint is available to administrators of the organization only.
793
731
  *
794
732
  */
795
- export const deleteTagMutation = (options) => {
733
+ export const updateFleetMutation = (options) => {
796
734
  const mutationOptions = {
797
735
  mutationFn: async (fnOptions) => {
798
- const { data } = await RegistryService.deleteTag({
736
+ const { data } = await ClustersService.updateFleet({
799
737
  ...options,
800
738
  ...fnOptions,
801
739
  throwOnError: true
@@ -805,35 +743,18 @@ export const deleteTagMutation = (options) => {
805
743
  };
806
744
  return mutationOptions;
807
745
  };
808
- export const getTagQueryKey = (options) => createQueryKey('getTag', options);
746
+ export const listChartsQueryKey = (options) => createQueryKey('listCharts', options);
809
747
  /**
810
- * Get tag details
811
- *
812
- * Returns detailed information for a specific tag in a repository, including manifest details, size, and URI. This endpoint is available to all users in the organization.
748
+ * List charts.
813
749
  *
814
- */
815
- export const getTagOptions = (options) => queryOptions({
816
- queryFn: async ({ queryKey, signal }) => {
817
- const { data } = await RegistryService.getTag({
818
- ...options,
819
- ...queryKey[0],
820
- signal,
821
- throwOnError: true
822
- });
823
- return data;
824
- },
825
- queryKey: getTagQueryKey(options)
826
- });
827
- export const listTicketsQueryKey = (options) => createQueryKey('listTickets', options);
828
- /**
829
- * List tickets for the current organization.
750
+ * Returns a list of charts in the cluster.
830
751
  *
831
- * Returns all tickets belonging to the caller's organization, newest first.
752
+ * This endpoint is available to all users in the organization.
832
753
  *
833
754
  */
834
- export const listTicketsOptions = (options) => queryOptions({
755
+ export const listChartsOptions = (options) => queryOptions({
835
756
  queryFn: async ({ queryKey, signal }) => {
836
- const { data } = await TicketsService.listTickets({
757
+ const { data } = await ClustersService.listCharts({
837
758
  ...options,
838
759
  ...queryKey[0],
839
760
  signal,
@@ -841,18 +762,20 @@ export const listTicketsOptions = (options) => queryOptions({
841
762
  });
842
763
  return data;
843
764
  },
844
- queryKey: listTicketsQueryKey(options)
765
+ queryKey: listChartsQueryKey(options)
845
766
  });
846
767
  /**
847
- * Create a new support ticket.
768
+ * Create a new chart.
769
+ *
770
+ * Create a new chart deployment.
848
771
  *
849
- * Creates a new support ticket with an initial customer message. The request is `multipart/form-data` with a JSON-encoded `payload` field carrying `category`, `body`, and optional `properties`, plus up to 3 `attachments` files (10 MB max each).
772
+ * This endpoint is available to administrators of the organization only.
850
773
  *
851
774
  */
852
- export const createTicketMutation = (options) => {
775
+ export const createChartMutation = (options) => {
853
776
  const mutationOptions = {
854
777
  mutationFn: async (fnOptions) => {
855
- const { data } = await TicketsService.createTicket({
778
+ const { data } = await ClustersService.createChart({
856
779
  ...options,
857
780
  ...fnOptions,
858
781
  throwOnError: true
@@ -863,15 +786,17 @@ export const createTicketMutation = (options) => {
863
786
  return mutationOptions;
864
787
  };
865
788
  /**
866
- * Close a ticket (soft close).
789
+ * Permanently delete the chart deployment from the cluster.
867
790
  *
868
- * Marks the ticket as closed. Closed is a terminal state — users cannot reply to a closed ticket; a new ticket must be opened instead.
791
+ * This endpoint will permanently delete chart. This operation cannot be undone.
792
+ *
793
+ * This endpoint is available to administrators of the organization only.
869
794
  *
870
795
  */
871
- export const closeTicketMutation = (options) => {
796
+ export const deleteChartMutation = (options) => {
872
797
  const mutationOptions = {
873
798
  mutationFn: async (fnOptions) => {
874
- const { data } = await TicketsService.closeTicket({
799
+ const { data } = await ClustersService.deleteChart({
875
800
  ...options,
876
801
  ...fnOptions,
877
802
  throwOnError: true
@@ -881,13 +806,18 @@ export const closeTicketMutation = (options) => {
881
806
  };
882
807
  return mutationOptions;
883
808
  };
884
- export const getTicketQueryKey = (options) => createQueryKey('getTicket', options);
809
+ export const getChartQueryKey = (options) => createQueryKey('getChart', options);
885
810
  /**
886
- * Get a ticket and its messages.
811
+ * Get chart information.
812
+ *
813
+ * Returns the details of the chart deployment.
814
+ *
815
+ * This endpoint is available to all users in the organization.
816
+ *
887
817
  */
888
- export const getTicketOptions = (options) => queryOptions({
818
+ export const getChartOptions = (options) => queryOptions({
889
819
  queryFn: async ({ queryKey, signal }) => {
890
- const { data } = await TicketsService.getTicket({
820
+ const { data } = await ClustersService.getChart({
891
821
  ...options,
892
822
  ...queryKey[0],
893
823
  signal,
@@ -895,18 +825,20 @@ export const getTicketOptions = (options) => queryOptions({
895
825
  });
896
826
  return data;
897
827
  },
898
- queryKey: getTicketQueryKey(options)
828
+ queryKey: getChartQueryKey(options)
899
829
  });
900
830
  /**
901
- * Append a customer reply to a ticket.
831
+ * Update chart information.
902
832
  *
903
- * Multipart form-data with a JSON-encoded `payload` field carrying `body`, plus up to 3 `attachments` files. Returns 409 if the ticket is closed.
833
+ * This endpoint allows you to update the values of a chart deployment.
834
+ *
835
+ * This endpoint is available to administrators of the organization only.
904
836
  *
905
837
  */
906
- export const replyTicketMutation = (options) => {
838
+ export const updateChartMutation = (options) => {
907
839
  const mutationOptions = {
908
840
  mutationFn: async (fnOptions) => {
909
- const { data } = await TicketsService.replyTicket({
841
+ const { data } = await ClustersService.updateChart({
910
842
  ...options,
911
843
  ...fnOptions,
912
844
  throwOnError: true
@@ -916,32 +848,18 @@ export const replyTicketMutation = (options) => {
916
848
  };
917
849
  return mutationOptions;
918
850
  };
919
- export const getTicketAttachmentQueryKey = (options) => createQueryKey('getTicketAttachment', options);
920
- /**
921
- * Download a ticket attachment.
922
- */
923
- export const getTicketAttachmentOptions = (options) => queryOptions({
924
- queryFn: async ({ queryKey, signal }) => {
925
- const { data } = await TicketsService.getTicketAttachment({
926
- ...options,
927
- ...queryKey[0],
928
- signal,
929
- throwOnError: true
930
- });
931
- return data;
932
- },
933
- queryKey: getTicketAttachmentQueryKey(options)
934
- });
935
- export const listTokensQueryKey = (options) => createQueryKey('listTokens', options);
851
+ export const listClustersQueryKey = (options) => createQueryKey('listClusters', options);
936
852
  /**
937
- * List access tokens in organization.
853
+ * List clusters.
938
854
  *
939
- * This endpoint allows you to get a list of all access tokens details in organization. For more information about identity access management and security, see [Service Accounts](https://cloudfleet.ai/docs/organization/api-tokens/) section of documentaiton. This endpoint is available to all users in the organization.
855
+ * Returns a list of clusters under the current organization.
856
+ *
857
+ * This endpoint is available to all users in the organization.
940
858
  *
941
859
  */
942
- export const listTokensOptions = (options) => queryOptions({
860
+ export const listClustersOptions = (options) => queryOptions({
943
861
  queryFn: async ({ queryKey, signal }) => {
944
- const { data } = await TokensService.listTokens({
862
+ const { data } = await ClustersService.listClusters({
945
863
  ...options,
946
864
  ...queryKey[0],
947
865
  signal,
@@ -949,20 +867,20 @@ export const listTokensOptions = (options) => queryOptions({
949
867
  });
950
868
  return data;
951
869
  },
952
- queryKey: listTokensQueryKey(options)
870
+ queryKey: listClustersQueryKey(options)
953
871
  });
954
872
  /**
955
- * Create a new access token.
873
+ * Create a new cluster.
956
874
  *
957
- * This endpoint allows you to create a new access token. For more information about identity access management and security, see [Service Accounts](https://cloudfleet.ai/docs/organization/api-tokens/) section of documentaiton.
875
+ * Create a new cluster under the current organization. Clusters allow you to group resources and you can create multiple clusters under the same organization, with billing delegated to the parent organization.
958
876
  *
959
877
  * This endpoint is available to administrators of the organization only.
960
878
  *
961
879
  */
962
- export const createTokenMutation = (options) => {
880
+ export const createClusterMutation = (options) => {
963
881
  const mutationOptions = {
964
882
  mutationFn: async (fnOptions) => {
965
- const { data } = await TokensService.createToken({
883
+ const { data } = await ClustersService.createCluster({
966
884
  ...options,
967
885
  ...fnOptions,
968
886
  throwOnError: true
@@ -973,15 +891,17 @@ export const createTokenMutation = (options) => {
973
891
  return mutationOptions;
974
892
  };
975
893
  /**
976
- * Permanently delete access token.
894
+ * Permanently delete cluster.
977
895
  *
978
- * This endpoint allows you to delete an access token. For more information about identity access management and security, see [Service Accounts](https://cloudfleet.ai/docs/organization/api-tokens/) section of documentaiton. This endpoint is available to administrators of the organization only.
896
+ * This endpoint will permanently delete the cluster. This operation cannot be undone.
897
+ *
898
+ * This endpoint is available to administrators of the organization only.
979
899
  *
980
900
  */
981
- export const deleteTokenMutation = (options) => {
901
+ export const deleteClusterMutation = (options) => {
982
902
  const mutationOptions = {
983
903
  mutationFn: async (fnOptions) => {
984
- const { data } = await TokensService.deleteToken({
904
+ const { data } = await ClustersService.deleteCluster({
985
905
  ...options,
986
906
  ...fnOptions,
987
907
  throwOnError: true
@@ -991,16 +911,18 @@ export const deleteTokenMutation = (options) => {
991
911
  };
992
912
  return mutationOptions;
993
913
  };
994
- export const getTokenQueryKey = (options) => createQueryKey('getToken', options);
914
+ export const getClusterQueryKey = (options) => createQueryKey('getCluster', options);
995
915
  /**
996
- * Get access token information.
916
+ * Get cluster information.
997
917
  *
998
- * This endpoint allows you to get access token details. For more information about identity access management and security, see [Service Accounts](https://cloudfleet.ai/docs/organization/api-tokens/) section of documentaiton. This endpoint is available to all users in the organization.
918
+ * Returns cluster details.
919
+ *
920
+ * This endpoint is available to all users in the organization.
999
921
  *
1000
922
  */
1001
- export const getTokenOptions = (options) => queryOptions({
923
+ export const getClusterOptions = (options) => queryOptions({
1002
924
  queryFn: async ({ queryKey, signal }) => {
1003
- const { data } = await TokensService.getToken({
925
+ const { data } = await ClustersService.getCluster({
1004
926
  ...options,
1005
927
  ...queryKey[0],
1006
928
  signal,
@@ -1008,20 +930,20 @@ export const getTokenOptions = (options) => queryOptions({
1008
930
  });
1009
931
  return data;
1010
932
  },
1011
- queryKey: getTokenQueryKey(options)
933
+ queryKey: getClusterQueryKey(options)
1012
934
  });
1013
935
  /**
1014
- * Update access token information.
936
+ * Update cluster information.
1015
937
  *
1016
- * This endpoint allows you to update access token details. For more information about identity access management and security, see [Service Accounts](https://cloudfleet.ai/docs/organization/api-tokens/) section of documentaiton.
938
+ * This endpoint allows you to update cluster details. For more information about clusters, see [Clusters](https://cloudfleet.ai/docs/cluster-management/cluster-types/) section of documentation.
1017
939
  *
1018
940
  * This endpoint is available to administrators of the organization only.
1019
941
  *
1020
942
  */
1021
- export const updateTokenMutation = (options) => {
943
+ export const updateClusterMutation = (options) => {
1022
944
  const mutationOptions = {
1023
945
  mutationFn: async (fnOptions) => {
1024
- const { data } = await TokensService.updateToken({
946
+ const { data } = await ClustersService.updateCluster({
1025
947
  ...options,
1026
948
  ...fnOptions,
1027
949
  throwOnError: true
@@ -1032,14 +954,15 @@ export const updateTokenMutation = (options) => {
1032
954
  return mutationOptions;
1033
955
  };
1034
956
  /**
1035
- * Regenerate access token secret key.
957
+ * Node join information for the cluster
958
+ *
959
+ * Returns the join information for the cluster. This information is used to add a self-managed nodes to the CFKE cluster. This endpoint is available to only admins of the organization.
1036
960
  *
1037
- * Generates a new access token secret. Old secret will not be valid anymore.
1038
961
  */
1039
- export const regenerateTokenMutation = (options) => {
962
+ export const getJoinInformationMutation = (options) => {
1040
963
  const mutationOptions = {
1041
964
  mutationFn: async (fnOptions) => {
1042
- const { data } = await TokensService.regenerateToken({
965
+ const { data } = await ClustersService.getJoinInformation({
1043
966
  ...options,
1044
967
  ...fnOptions,
1045
968
  throwOnError: true
@@ -1049,13 +972,16 @@ export const regenerateTokenMutation = (options) => {
1049
972
  };
1050
973
  return mutationOptions;
1051
974
  };
1052
- export const listUserOrganizationsQueryKey = (options) => createQueryKey('listUserOrganizations', options);
975
+ export const getUsageQueryKey = (options) => createQueryKey('getUsage', options);
1053
976
  /**
1054
- * Get a list of organizations the user belongs to. Used during authentication process.
977
+ * Get billing usage information.
978
+ *
979
+ * Returns aggregated usage information for the organization with facets for filtering. For more information on billing and payments, see [Billing and pricing](https://cloudfleet.ai/docs/organization/billing/) section of documentaiton. This endpoint is available to all users in the organization.
980
+ *
1055
981
  */
1056
- export const listUserOrganizationsOptions = (options) => queryOptions({
982
+ export const getUsageOptions = (options) => queryOptions({
1057
983
  queryFn: async ({ queryKey, signal }) => {
1058
- const { data } = await UsersService.listUserOrganizations({
984
+ const { data } = await BillingService.getUsage({
1059
985
  ...options,
1060
986
  ...queryKey[0],
1061
987
  signal,
@@ -1063,20 +989,37 @@ export const listUserOrganizationsOptions = (options) => queryOptions({
1063
989
  });
1064
990
  return data;
1065
991
  },
1066
- queryKey: listUserOrganizationsQueryKey(options)
992
+ queryKey: getUsageQueryKey(options)
1067
993
  });
1068
- export const listUsersQueryKey = (options) => createQueryKey('listUsers', options);
1069
994
  /**
1070
- * List users in organization.
995
+ * Get Stripe client secret.
1071
996
  *
1072
- * Returns a list of user details and their roles. For more information on identity access management, see [Users](https://cloudfleet.ai/docs/organization/users/) section of documentaiton.
997
+ * Endpoint returns the Stripe secret key for the organization. This key is used to securely update the payment method in the Cloudfleet console only, please visit https://console.cloudfleet.ai. This endpoint is available to administrators of the organization only.
1073
998
  *
1074
- * This endpoint is available to all users in the organization.
999
+ */
1000
+ export const getPaymentMethodSecretMutation = (options) => {
1001
+ const mutationOptions = {
1002
+ mutationFn: async (fnOptions) => {
1003
+ const { data } = await BillingService.getPaymentMethodSecret({
1004
+ ...options,
1005
+ ...fnOptions,
1006
+ throwOnError: true
1007
+ });
1008
+ return data;
1009
+ }
1010
+ };
1011
+ return mutationOptions;
1012
+ };
1013
+ export const listPaymentMethodsQueryKey = (options) => createQueryKey('listPaymentMethods', options);
1014
+ /**
1015
+ * List organization payment methods.
1016
+ *
1017
+ * Returns all payment methods (cards and SEPA Direct Debit) attached to the organization, most recently added first, with the default flagged. This endpoint is available to all users in the organization.
1075
1018
  *
1076
1019
  */
1077
- export const listUsersOptions = (options) => queryOptions({
1020
+ export const listPaymentMethodsOptions = (options) => queryOptions({
1078
1021
  queryFn: async ({ queryKey, signal }) => {
1079
- const { data } = await UsersService.listUsers({
1022
+ const { data } = await BillingService.listPaymentMethods({
1080
1023
  ...options,
1081
1024
  ...queryKey[0],
1082
1025
  signal,
@@ -1084,18 +1027,18 @@ export const listUsersOptions = (options) => queryOptions({
1084
1027
  });
1085
1028
  return data;
1086
1029
  },
1087
- queryKey: listUsersQueryKey(options)
1030
+ queryKey: listPaymentMethodsQueryKey(options)
1088
1031
  });
1089
1032
  /**
1090
- * Create a new user.
1033
+ * Set the default payment method.
1091
1034
  *
1092
- * Create a new user in your Cloudfleet organization. Requires a valid invite code generated by the `invites create` command. The invite code is a unique string that can be used only once to create a new user. The invite code is generated by the `POST /invites` endpoint.
1035
+ * Sets the given payment method as the default used for invoices and active subscriptions. Requires the Administrator role.
1093
1036
  *
1094
1037
  */
1095
- export const createUserMutation = (options) => {
1038
+ export const setDefaultPaymentMethodMutation = (options) => {
1096
1039
  const mutationOptions = {
1097
1040
  mutationFn: async (fnOptions) => {
1098
- const { data } = await UsersService.createUser({
1041
+ const { data } = await BillingService.setDefaultPaymentMethod({
1099
1042
  ...options,
1100
1043
  ...fnOptions,
1101
1044
  throwOnError: true
@@ -1106,15 +1049,15 @@ export const createUserMutation = (options) => {
1106
1049
  return mutationOptions;
1107
1050
  };
1108
1051
  /**
1109
- * Delete user by id.
1052
+ * Delete a payment method.
1110
1053
  *
1111
- * Sets user status to `inactive`. Inactive users cannot log in and manage organization resources. This endpoint is available to administrators of the organization only.
1054
+ * Detaches the given payment method from the organization. Requires the Administrator role. An organization must keep at least one payment method, so deleting the only remaining method is rejected.
1112
1055
  *
1113
1056
  */
1114
- export const deleteUserMutation = (options) => {
1057
+ export const deletePaymentMethodMutation = (options) => {
1115
1058
  const mutationOptions = {
1116
1059
  mutationFn: async (fnOptions) => {
1117
- const { data } = await UsersService.deleteUser({
1060
+ const { data } = await BillingService.deletePaymentMethod({
1118
1061
  ...options,
1119
1062
  ...fnOptions,
1120
1063
  throwOnError: true
@@ -1124,18 +1067,35 @@ export const deleteUserMutation = (options) => {
1124
1067
  };
1125
1068
  return mutationOptions;
1126
1069
  };
1127
- export const getUserQueryKey = (options) => createQueryKey('getUser', options);
1070
+ export const listInvoicesQueryKey = (options) => createQueryKey('listInvoices', options);
1128
1071
  /**
1129
- * Get user profile information by id.
1072
+ * List issued invoices.
1130
1073
  *
1131
- * Returns user details including their roles. For more information on identity access management, see [Users](https://cloudfleet.ai/docs/organization/users/) section of documentaiton.
1074
+ * Returns a list of invoices for the organization. For more information on billing and payments, see [Billing and pricing](https://cloudfleet.ai/docs/organization/billing/) section of documentaiton. This endpoint is available to all users in the organization.
1132
1075
  *
1133
- * This endpoint is available to all users in the organization.
1076
+ */
1077
+ export const listInvoicesOptions = (options) => queryOptions({
1078
+ queryFn: async ({ queryKey, signal }) => {
1079
+ const { data } = await BillingService.listInvoices({
1080
+ ...options,
1081
+ ...queryKey[0],
1082
+ signal,
1083
+ throwOnError: true
1084
+ });
1085
+ return data;
1086
+ },
1087
+ queryKey: listInvoicesQueryKey(options)
1088
+ });
1089
+ export const getContactQueryKey = (options) => createQueryKey('getContact', options);
1090
+ /**
1091
+ * Get organization contact and billing address information.
1092
+ *
1093
+ * Returns the organization contact and billing address information. This endpoint is available to all users in the organization.
1134
1094
  *
1135
1095
  */
1136
- export const getUserOptions = (options) => queryOptions({
1096
+ export const getContactOptions = (options) => queryOptions({
1137
1097
  queryFn: async ({ queryKey, signal }) => {
1138
- const { data } = await UsersService.getUser({
1098
+ const { data } = await BillingService.getContact({
1139
1099
  ...options,
1140
1100
  ...queryKey[0],
1141
1101
  signal,
@@ -1143,18 +1103,56 @@ export const getUserOptions = (options) => queryOptions({
1143
1103
  });
1144
1104
  return data;
1145
1105
  },
1146
- queryKey: getUserQueryKey(options)
1106
+ queryKey: getContactQueryKey(options)
1147
1107
  });
1148
1108
  /**
1149
- * Update user profile information.
1109
+ * Update organization contact information and billing address.
1150
1110
  *
1151
- * Update user profile information: email, first name, last name, role. This endpoint can be accessed by administrators and the user itself. Role and status can be changed by administrators only.
1111
+ * This endpoint allows you to update organization details with its contact information. This endpoint is available to administrators of the organization only.
1152
1112
  *
1153
1113
  */
1154
- export const updateUserMutation = (options) => {
1114
+ export const updateContactMutation = (options) => {
1155
1115
  const mutationOptions = {
1156
1116
  mutationFn: async (fnOptions) => {
1157
- const { data } = await UsersService.updateUser({
1117
+ const { data } = await BillingService.updateContact({
1118
+ ...options,
1119
+ ...fnOptions,
1120
+ throwOnError: true
1121
+ });
1122
+ return data;
1123
+ }
1124
+ };
1125
+ return mutationOptions;
1126
+ };
1127
+ export const getCreditsQueryKey = (options) => createQueryKey('getCredits', options);
1128
+ /**
1129
+ * Get applied promotional credits
1130
+ *
1131
+ * Returns applied promotional credits for the organization. For more information on billing and payments, see [Billing and pricing](https://cloudfleet.ai/docs/organization/billing/) section of documentaiton. This endpoint is available to all users in the organization.
1132
+ *
1133
+ */
1134
+ export const getCreditsOptions = (options) => queryOptions({
1135
+ queryFn: async ({ queryKey, signal }) => {
1136
+ const { data } = await BillingService.getCredits({
1137
+ ...options,
1138
+ ...queryKey[0],
1139
+ signal,
1140
+ throwOnError: true
1141
+ });
1142
+ return data;
1143
+ },
1144
+ queryKey: getCreditsQueryKey(options)
1145
+ });
1146
+ /**
1147
+ * Redeem promotional credits code.
1148
+ *
1149
+ * Applies promotional credits for the organization. For more information on billing and payments, see [Billing and pricing](https://cloudfleet.ai/docs/organization/billing/) section of documentaiton. This endpoint is available to all users in the organization.
1150
+ *
1151
+ */
1152
+ export const redeemCreditsMutation = (options) => {
1153
+ const mutationOptions = {
1154
+ mutationFn: async (fnOptions) => {
1155
+ const { data } = await BillingService.redeemCredits({
1158
1156
  ...options,
1159
1157
  ...fnOptions,
1160
1158
  throwOnError: true