@cloudfleet/sdk 0.12.2 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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,17 +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
- * This endpoint is available to administrators of the organization only.
484
+ * MCP endpoint
495
485
  *
486
+ * MCP endpoint for handling Model Context Protocol JSON-RPC 2.0 messages.
496
487
  */
497
- export const deleteClusterMutation = (options) => {
488
+ export const postMcpMutation = (options) => {
498
489
  const mutationOptions = {
499
490
  mutationFn: async (fnOptions) => {
500
- const { data } = await ClustersService.deleteCluster({
491
+ const { data } = await McpService.postMcp({
501
492
  ...options,
502
493
  ...fnOptions,
503
494
  throwOnError: true
@@ -507,18 +498,18 @@ export const deleteClusterMutation = (options) => {
507
498
  };
508
499
  return mutationOptions;
509
500
  };
510
- export const getClusterQueryKey = (options) => createQueryKey('getCluster', options);
501
+ export const listMarketplaceChartsQueryKey = (options) => createQueryKey('listMarketplaceCharts', options);
511
502
  /**
512
- * Get cluster information.
503
+ * List chart listings available in the marketplace.
513
504
  *
514
- * Returns cluster details.
505
+ * Returns a list of available charts in the marketplace.
515
506
  *
516
507
  * This endpoint is available to all users in the organization.
517
508
  *
518
509
  */
519
- export const getClusterOptions = (options) => queryOptions({
510
+ export const listMarketplaceChartsOptions = (options) => queryOptions({
520
511
  queryFn: async ({ queryKey, signal }) => {
521
- const { data } = await ClustersService.getCluster({
512
+ const { data } = await ChartsMarketplaceService.listMarketplaceCharts({
522
513
  ...options,
523
514
  ...queryKey[0],
524
515
  signal,
@@ -526,48 +517,31 @@ export const getClusterOptions = (options) => queryOptions({
526
517
  });
527
518
  return data;
528
519
  },
529
- queryKey: getClusterQueryKey(options)
520
+ queryKey: listMarketplaceChartsQueryKey(options)
530
521
  });
522
+ export const getMarketplaceChartFilesQueryKey = (options) => createQueryKey('getMarketplaceChartFiles', options);
531
523
  /**
532
- * Update cluster information.
533
- *
534
- * 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.
535
525
  *
536
- * 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.
537
527
  *
538
- */
539
- export const updateClusterMutation = (options) => {
540
- const mutationOptions = {
541
- mutationFn: async (fnOptions) => {
542
- const { data } = await ClustersService.updateCluster({
543
- ...options,
544
- ...fnOptions,
545
- throwOnError: true
546
- });
547
- return data;
548
- }
549
- };
550
- return mutationOptions;
551
- };
552
- /**
553
- * 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.
554
529
  *
555
- * 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.
556
531
  *
557
532
  */
558
- export const getJoinInformationMutation = (options) => {
559
- const mutationOptions = {
560
- mutationFn: async (fnOptions) => {
561
- const { data } = await ClustersService.getJoinInformation({
562
- ...options,
563
- ...fnOptions,
564
- throwOnError: true
565
- });
566
- return data;
567
- }
568
- };
569
- return mutationOptions;
570
- };
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
+ });
571
545
  export const listInvitesQueryKey = (options) => createQueryKey('listInvites', options);
572
546
  /**
573
547
  * List invites.
@@ -644,18 +618,15 @@ export const deleteInviteMutation = (options) => {
644
618
  };
645
619
  return mutationOptions;
646
620
  };
647
- export const listMarketplaceChartsQueryKey = (options) => createQueryKey('listMarketplaceCharts', options);
621
+ export const queryClusterQueryKey = (options) => createQueryKey('queryCluster', options);
648
622
  /**
649
- * List chart listings available in the marketplace.
650
- *
651
- * Returns a list of available charts in the marketplace.
652
- *
653
- * This endpoint is available to all users in the organization.
623
+ * Query Kubernetes cluster API
654
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.
655
626
  */
656
- export const listMarketplaceChartsOptions = (options) => queryOptions({
627
+ export const queryClusterOptions = (options) => queryOptions({
657
628
  queryFn: async ({ queryKey, signal }) => {
658
- const { data } = await ChartsMarketplaceService.listMarketplaceCharts({
629
+ const { data } = await ClustersService.queryCluster({
659
630
  ...options,
660
631
  ...queryKey[0],
661
632
  signal,
@@ -663,22 +634,20 @@ export const listMarketplaceChartsOptions = (options) => queryOptions({
663
634
  });
664
635
  return data;
665
636
  },
666
- queryKey: listMarketplaceChartsQueryKey(options)
637
+ queryKey: queryClusterQueryKey(options)
667
638
  });
668
- export const getMarketplaceChartFilesQueryKey = (options) => createQueryKey('getMarketplaceChartFiles', options);
639
+ export const listFleetsQueryKey = (options) => createQueryKey('listFleets', options);
669
640
  /**
670
- * Get chart files for a specific version channel.
671
- *
672
- * Returns the Chart.yaml, values.yaml, and values.schema.json files for the latest version matching the specified version channel.
641
+ * List fleets.
673
642
  *
674
- * 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.
675
644
  *
676
645
  * This endpoint is available to all users in the organization.
677
646
  *
678
647
  */
679
- export const getMarketplaceChartFilesOptions = (options) => queryOptions({
648
+ export const listFleetsOptions = (options) => queryOptions({
680
649
  queryFn: async ({ queryKey, signal }) => {
681
- const { data } = await ChartsMarketplaceService.getMarketplaceChartFiles({
650
+ const { data } = await ClustersService.listFleets({
682
651
  ...options,
683
652
  ...queryKey[0],
684
653
  signal,
@@ -686,17 +655,22 @@ export const getMarketplaceChartFilesOptions = (options) => queryOptions({
686
655
  });
687
656
  return data;
688
657
  },
689
- queryKey: getMarketplaceChartFilesQueryKey(options)
658
+ queryKey: listFleetsQueryKey(options)
690
659
  });
691
660
  /**
692
- * 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
+ * The cluster must be ready (status `deployed`) before a fleet can be added. Adding a fleet while the cluster is still provisioning returns `409`.
666
+ *
667
+ * This endpoint is available to administrators of the organization only.
693
668
  *
694
- * MCP endpoint for handling Model Context Protocol JSON-RPC 2.0 messages.
695
669
  */
696
- export const postMcpMutation = (options) => {
670
+ export const createFleetMutation = (options) => {
697
671
  const mutationOptions = {
698
672
  mutationFn: async (fnOptions) => {
699
- const { data } = await McpService.postMcp({
673
+ const { data } = await ClustersService.createFleet({
700
674
  ...options,
701
675
  ...fnOptions,
702
676
  throwOnError: true
@@ -706,37 +680,20 @@ export const postMcpMutation = (options) => {
706
680
  };
707
681
  return mutationOptions;
708
682
  };
709
- export const getOrganizationQueryKey = (options) => createQueryKey('getOrganization', options);
710
683
  /**
711
- * Get organization information.
712
- *
713
- * Returns organization details including quota. For more information about quotas, see [Quotas and limits](https://cloudfleet.ai/docs/organization/quotas/) section of documentaiton.
684
+ * Permanently delete fleet.
714
685
  *
715
- * This endpoint is available to all users in the organization.
686
+ * 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.
716
687
  *
717
- */
718
- export const getOrganizationOptions = (options) => queryOptions({
719
- queryFn: async ({ queryKey, signal }) => {
720
- const { data } = await OrganizationService.getOrganization({
721
- ...options,
722
- ...queryKey[0],
723
- signal,
724
- throwOnError: true
725
- });
726
- return data;
727
- },
728
- queryKey: getOrganizationQueryKey(options)
729
- });
730
- /**
731
- * Create a new organization / Cloudfleet account signup.
688
+ * Deleting a fleet does not deprovision the cloud infrastructure it provisioned: nodes and other resources keep running. Scale the cluster down first, or remove the infrastructure manually, to avoid orphaned resources.
732
689
  *
733
- * This endpoint allows you to create a new Cloudfleet organization and an administrator user.
690
+ * This endpoint is available to administrators of the organization only.
734
691
  *
735
692
  */
736
- export const createOrganizationMutation = (options) => {
693
+ export const deleteFleetMutation = (options) => {
737
694
  const mutationOptions = {
738
695
  mutationFn: async (fnOptions) => {
739
- const { data } = await OrganizationService.createOrganization({
696
+ const { data } = await ClustersService.deleteFleet({
740
697
  ...options,
741
698
  ...fnOptions,
742
699
  throwOnError: true
@@ -746,16 +703,18 @@ export const createOrganizationMutation = (options) => {
746
703
  };
747
704
  return mutationOptions;
748
705
  };
749
- export const listRepositoriesQueryKey = (options) => createQueryKey('listRepositories', options);
706
+ export const getFleetQueryKey = (options) => createQueryKey('getFleet', options);
750
707
  /**
751
- * List repositories
708
+ * Get fleet information.
752
709
  *
753
- * Returns a list of repositories in the registry across all regions. This endpoint is available to all users in the organization.
710
+ * Returns fleet details. For more information, see [Fleets](https://cloudfleet.ai/docs/cloud-infrastructure/fleets/) section of documentaiton.
711
+ *
712
+ * This endpoint is available to all users in the organization.
754
713
  *
755
714
  */
756
- export const listRepositoriesOptions = (options) => queryOptions({
715
+ export const getFleetOptions = (options) => queryOptions({
757
716
  queryFn: async ({ queryKey, signal }) => {
758
- const { data } = await RegistryService.listRepositories({
717
+ const { data } = await ClustersService.getFleet({
759
718
  ...options,
760
719
  ...queryKey[0],
761
720
  signal,
@@ -763,37 +722,24 @@ export const listRepositoriesOptions = (options) => queryOptions({
763
722
  });
764
723
  return data;
765
724
  },
766
- queryKey: listRepositoriesQueryKey(options)
725
+ queryKey: getFleetQueryKey(options)
767
726
  });
768
- export const listTagsQueryKey = (options) => createQueryKey('listTags', options);
769
727
  /**
770
- * List tags for a repository
728
+ * Update fleet information.
771
729
  *
772
- * 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.
730
+ * This endpoint allows you to update fleet details.
773
731
  *
774
- */
775
- export const listTagsOptions = (options) => queryOptions({
776
- queryFn: async ({ queryKey, signal }) => {
777
- const { data } = await RegistryService.listTags({
778
- ...options,
779
- ...queryKey[0],
780
- signal,
781
- throwOnError: true
782
- });
783
- return data;
784
- },
785
- queryKey: listTagsQueryKey(options)
786
- });
787
- /**
788
- * Delete tag
732
+ * For more information, see [Fleets](https://cloudfleet.ai/docs/cloud-infrastructure/fleets/) section of documentaiton.
789
733
  *
790
- * Permanently deletes a specific tag from a repository. This endpoint is available to administrators of the organization only.
734
+ * This is a full overwrite: any field omitted from the request is reset to its default rather than left unchanged. The Hetzner API key is the exception: it is kept when omitted (send a new value to rotate it).
735
+ *
736
+ * This endpoint is available to administrators of the organization only.
791
737
  *
792
738
  */
793
- export const deleteTagMutation = (options) => {
739
+ export const updateFleetMutation = (options) => {
794
740
  const mutationOptions = {
795
741
  mutationFn: async (fnOptions) => {
796
- const { data } = await RegistryService.deleteTag({
742
+ const { data } = await ClustersService.updateFleet({
797
743
  ...options,
798
744
  ...fnOptions,
799
745
  throwOnError: true
@@ -803,35 +749,18 @@ export const deleteTagMutation = (options) => {
803
749
  };
804
750
  return mutationOptions;
805
751
  };
806
- export const getTagQueryKey = (options) => createQueryKey('getTag', options);
752
+ export const listChartsQueryKey = (options) => createQueryKey('listCharts', options);
807
753
  /**
808
- * Get tag details
809
- *
810
- * 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.
754
+ * List charts.
811
755
  *
812
- */
813
- export const getTagOptions = (options) => queryOptions({
814
- queryFn: async ({ queryKey, signal }) => {
815
- const { data } = await RegistryService.getTag({
816
- ...options,
817
- ...queryKey[0],
818
- signal,
819
- throwOnError: true
820
- });
821
- return data;
822
- },
823
- queryKey: getTagQueryKey(options)
824
- });
825
- export const listTicketsQueryKey = (options) => createQueryKey('listTickets', options);
826
- /**
827
- * List tickets for the current organization.
756
+ * Returns a list of charts in the cluster.
828
757
  *
829
- * Returns all tickets belonging to the caller's organization, newest first.
758
+ * This endpoint is available to all users in the organization.
830
759
  *
831
760
  */
832
- export const listTicketsOptions = (options) => queryOptions({
761
+ export const listChartsOptions = (options) => queryOptions({
833
762
  queryFn: async ({ queryKey, signal }) => {
834
- const { data } = await TicketsService.listTickets({
763
+ const { data } = await ClustersService.listCharts({
835
764
  ...options,
836
765
  ...queryKey[0],
837
766
  signal,
@@ -839,18 +768,20 @@ export const listTicketsOptions = (options) => queryOptions({
839
768
  });
840
769
  return data;
841
770
  },
842
- queryKey: listTicketsQueryKey(options)
771
+ queryKey: listChartsQueryKey(options)
843
772
  });
844
773
  /**
845
- * Create a new support ticket.
774
+ * Create a new chart.
846
775
  *
847
- * 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).
776
+ * Create a new chart deployment.
777
+ *
778
+ * This endpoint is available to administrators of the organization only.
848
779
  *
849
780
  */
850
- export const createTicketMutation = (options) => {
781
+ export const createChartMutation = (options) => {
851
782
  const mutationOptions = {
852
783
  mutationFn: async (fnOptions) => {
853
- const { data } = await TicketsService.createTicket({
784
+ const { data } = await ClustersService.createChart({
854
785
  ...options,
855
786
  ...fnOptions,
856
787
  throwOnError: true
@@ -861,15 +792,17 @@ export const createTicketMutation = (options) => {
861
792
  return mutationOptions;
862
793
  };
863
794
  /**
864
- * Close a ticket (soft close).
795
+ * Permanently delete the chart deployment from the cluster.
865
796
  *
866
- * Marks the ticket as closed. Closed is a terminal state — users cannot reply to a closed ticket; a new ticket must be opened instead.
797
+ * This endpoint will permanently delete chart. This operation cannot be undone.
798
+ *
799
+ * This endpoint is available to administrators of the organization only.
867
800
  *
868
801
  */
869
- export const closeTicketMutation = (options) => {
802
+ export const deleteChartMutation = (options) => {
870
803
  const mutationOptions = {
871
804
  mutationFn: async (fnOptions) => {
872
- const { data } = await TicketsService.closeTicket({
805
+ const { data } = await ClustersService.deleteChart({
873
806
  ...options,
874
807
  ...fnOptions,
875
808
  throwOnError: true
@@ -879,13 +812,18 @@ export const closeTicketMutation = (options) => {
879
812
  };
880
813
  return mutationOptions;
881
814
  };
882
- export const getTicketQueryKey = (options) => createQueryKey('getTicket', options);
815
+ export const getChartQueryKey = (options) => createQueryKey('getChart', options);
883
816
  /**
884
- * Get a ticket and its messages.
817
+ * Get chart information.
818
+ *
819
+ * Returns the details of the chart deployment.
820
+ *
821
+ * This endpoint is available to all users in the organization.
822
+ *
885
823
  */
886
- export const getTicketOptions = (options) => queryOptions({
824
+ export const getChartOptions = (options) => queryOptions({
887
825
  queryFn: async ({ queryKey, signal }) => {
888
- const { data } = await TicketsService.getTicket({
826
+ const { data } = await ClustersService.getChart({
889
827
  ...options,
890
828
  ...queryKey[0],
891
829
  signal,
@@ -893,18 +831,20 @@ export const getTicketOptions = (options) => queryOptions({
893
831
  });
894
832
  return data;
895
833
  },
896
- queryKey: getTicketQueryKey(options)
834
+ queryKey: getChartQueryKey(options)
897
835
  });
898
836
  /**
899
- * Append a customer reply to a ticket.
837
+ * Update chart information.
900
838
  *
901
- * Multipart form-data with a JSON-encoded `payload` field carrying `body`, plus up to 3 `attachments` files. Returns 409 if the ticket is closed.
839
+ * This endpoint allows you to update the values of a chart deployment.
840
+ *
841
+ * This endpoint is available to administrators of the organization only.
902
842
  *
903
843
  */
904
- export const replyTicketMutation = (options) => {
844
+ export const updateChartMutation = (options) => {
905
845
  const mutationOptions = {
906
846
  mutationFn: async (fnOptions) => {
907
- const { data } = await TicketsService.replyTicket({
847
+ const { data } = await ClustersService.updateChart({
908
848
  ...options,
909
849
  ...fnOptions,
910
850
  throwOnError: true
@@ -914,32 +854,18 @@ export const replyTicketMutation = (options) => {
914
854
  };
915
855
  return mutationOptions;
916
856
  };
917
- export const getTicketAttachmentQueryKey = (options) => createQueryKey('getTicketAttachment', options);
918
- /**
919
- * Download a ticket attachment.
920
- */
921
- export const getTicketAttachmentOptions = (options) => queryOptions({
922
- queryFn: async ({ queryKey, signal }) => {
923
- const { data } = await TicketsService.getTicketAttachment({
924
- ...options,
925
- ...queryKey[0],
926
- signal,
927
- throwOnError: true
928
- });
929
- return data;
930
- },
931
- queryKey: getTicketAttachmentQueryKey(options)
932
- });
933
- export const listTokensQueryKey = (options) => createQueryKey('listTokens', options);
857
+ export const listClustersQueryKey = (options) => createQueryKey('listClusters', options);
934
858
  /**
935
- * List access tokens in organization.
859
+ * List clusters.
936
860
  *
937
- * 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.
861
+ * Returns a list of clusters under the current organization.
862
+ *
863
+ * This endpoint is available to all users in the organization.
938
864
  *
939
865
  */
940
- export const listTokensOptions = (options) => queryOptions({
866
+ export const listClustersOptions = (options) => queryOptions({
941
867
  queryFn: async ({ queryKey, signal }) => {
942
- const { data } = await TokensService.listTokens({
868
+ const { data } = await ClustersService.listClusters({
943
869
  ...options,
944
870
  ...queryKey[0],
945
871
  signal,
@@ -947,20 +873,20 @@ export const listTokensOptions = (options) => queryOptions({
947
873
  });
948
874
  return data;
949
875
  },
950
- queryKey: listTokensQueryKey(options)
876
+ queryKey: listClustersQueryKey(options)
951
877
  });
952
878
  /**
953
- * Create a new access token.
879
+ * Create a new cluster.
954
880
  *
955
- * 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.
881
+ * 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.
956
882
  *
957
883
  * This endpoint is available to administrators of the organization only.
958
884
  *
959
885
  */
960
- export const createTokenMutation = (options) => {
886
+ export const createClusterMutation = (options) => {
961
887
  const mutationOptions = {
962
888
  mutationFn: async (fnOptions) => {
963
- const { data } = await TokensService.createToken({
889
+ const { data } = await ClustersService.createCluster({
964
890
  ...options,
965
891
  ...fnOptions,
966
892
  throwOnError: true
@@ -971,15 +897,19 @@ export const createTokenMutation = (options) => {
971
897
  return mutationOptions;
972
898
  };
973
899
  /**
974
- * Permanently delete access token.
900
+ * Permanently delete cluster.
975
901
  *
976
- * 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.
902
+ * This endpoint will permanently delete the cluster. This operation cannot be undone.
903
+ *
904
+ * Deleting a cluster also deletes its fleets. This does not deprovision the cloud infrastructure those fleets provisioned: nodes and other resources keep running. Scale the cluster down first, or remove the infrastructure manually, to avoid orphaned resources.
905
+ *
906
+ * This endpoint is available to administrators of the organization only.
977
907
  *
978
908
  */
979
- export const deleteTokenMutation = (options) => {
909
+ export const deleteClusterMutation = (options) => {
980
910
  const mutationOptions = {
981
911
  mutationFn: async (fnOptions) => {
982
- const { data } = await TokensService.deleteToken({
912
+ const { data } = await ClustersService.deleteCluster({
983
913
  ...options,
984
914
  ...fnOptions,
985
915
  throwOnError: true
@@ -989,16 +919,18 @@ export const deleteTokenMutation = (options) => {
989
919
  };
990
920
  return mutationOptions;
991
921
  };
992
- export const getTokenQueryKey = (options) => createQueryKey('getToken', options);
922
+ export const getClusterQueryKey = (options) => createQueryKey('getCluster', options);
993
923
  /**
994
- * Get access token information.
924
+ * Get cluster information.
995
925
  *
996
- * 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.
926
+ * Returns cluster details.
927
+ *
928
+ * This endpoint is available to all users in the organization.
997
929
  *
998
930
  */
999
- export const getTokenOptions = (options) => queryOptions({
931
+ export const getClusterOptions = (options) => queryOptions({
1000
932
  queryFn: async ({ queryKey, signal }) => {
1001
- const { data } = await TokensService.getToken({
933
+ const { data } = await ClustersService.getCluster({
1002
934
  ...options,
1003
935
  ...queryKey[0],
1004
936
  signal,
@@ -1006,20 +938,22 @@ export const getTokenOptions = (options) => queryOptions({
1006
938
  });
1007
939
  return data;
1008
940
  },
1009
- queryKey: getTokenQueryKey(options)
941
+ queryKey: getClusterQueryKey(options)
1010
942
  });
1011
943
  /**
1012
- * Update access token information.
944
+ * Update cluster information.
1013
945
  *
1014
- * 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.
946
+ * 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.
947
+ *
948
+ * This is a full overwrite: any field omitted from the request is reset to its default rather than left unchanged.
1015
949
  *
1016
950
  * This endpoint is available to administrators of the organization only.
1017
951
  *
1018
952
  */
1019
- export const updateTokenMutation = (options) => {
953
+ export const updateClusterMutation = (options) => {
1020
954
  const mutationOptions = {
1021
955
  mutationFn: async (fnOptions) => {
1022
- const { data } = await TokensService.updateToken({
956
+ const { data } = await ClustersService.updateCluster({
1023
957
  ...options,
1024
958
  ...fnOptions,
1025
959
  throwOnError: true
@@ -1030,14 +964,15 @@ export const updateTokenMutation = (options) => {
1030
964
  return mutationOptions;
1031
965
  };
1032
966
  /**
1033
- * Regenerate access token secret key.
967
+ * Node join information for the cluster
968
+ *
969
+ * 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.
1034
970
  *
1035
- * Generates a new access token secret. Old secret will not be valid anymore.
1036
971
  */
1037
- export const regenerateTokenMutation = (options) => {
972
+ export const getJoinInformationMutation = (options) => {
1038
973
  const mutationOptions = {
1039
974
  mutationFn: async (fnOptions) => {
1040
- const { data } = await TokensService.regenerateToken({
975
+ const { data } = await ClustersService.getJoinInformation({
1041
976
  ...options,
1042
977
  ...fnOptions,
1043
978
  throwOnError: true
@@ -1047,13 +982,16 @@ export const regenerateTokenMutation = (options) => {
1047
982
  };
1048
983
  return mutationOptions;
1049
984
  };
1050
- export const listUserOrganizationsQueryKey = (options) => createQueryKey('listUserOrganizations', options);
985
+ export const getUsageQueryKey = (options) => createQueryKey('getUsage', options);
1051
986
  /**
1052
- * Get a list of organizations the user belongs to. Used during authentication process.
987
+ * Get billing usage information.
988
+ *
989
+ * 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.
990
+ *
1053
991
  */
1054
- export const listUserOrganizationsOptions = (options) => queryOptions({
992
+ export const getUsageOptions = (options) => queryOptions({
1055
993
  queryFn: async ({ queryKey, signal }) => {
1056
- const { data } = await UsersService.listUserOrganizations({
994
+ const { data } = await BillingService.getUsage({
1057
995
  ...options,
1058
996
  ...queryKey[0],
1059
997
  signal,
@@ -1061,20 +999,37 @@ export const listUserOrganizationsOptions = (options) => queryOptions({
1061
999
  });
1062
1000
  return data;
1063
1001
  },
1064
- queryKey: listUserOrganizationsQueryKey(options)
1002
+ queryKey: getUsageQueryKey(options)
1065
1003
  });
1066
- export const listUsersQueryKey = (options) => createQueryKey('listUsers', options);
1067
1004
  /**
1068
- * List users in organization.
1005
+ * Get Stripe client secret.
1069
1006
  *
1070
- * 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.
1007
+ * 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.
1071
1008
  *
1072
- * This endpoint is available to all users in the organization.
1009
+ */
1010
+ export const getPaymentMethodSecretMutation = (options) => {
1011
+ const mutationOptions = {
1012
+ mutationFn: async (fnOptions) => {
1013
+ const { data } = await BillingService.getPaymentMethodSecret({
1014
+ ...options,
1015
+ ...fnOptions,
1016
+ throwOnError: true
1017
+ });
1018
+ return data;
1019
+ }
1020
+ };
1021
+ return mutationOptions;
1022
+ };
1023
+ export const listPaymentMethodsQueryKey = (options) => createQueryKey('listPaymentMethods', options);
1024
+ /**
1025
+ * List organization payment methods.
1026
+ *
1027
+ * 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.
1073
1028
  *
1074
1029
  */
1075
- export const listUsersOptions = (options) => queryOptions({
1030
+ export const listPaymentMethodsOptions = (options) => queryOptions({
1076
1031
  queryFn: async ({ queryKey, signal }) => {
1077
- const { data } = await UsersService.listUsers({
1032
+ const { data } = await BillingService.listPaymentMethods({
1078
1033
  ...options,
1079
1034
  ...queryKey[0],
1080
1035
  signal,
@@ -1082,18 +1037,18 @@ export const listUsersOptions = (options) => queryOptions({
1082
1037
  });
1083
1038
  return data;
1084
1039
  },
1085
- queryKey: listUsersQueryKey(options)
1040
+ queryKey: listPaymentMethodsQueryKey(options)
1086
1041
  });
1087
1042
  /**
1088
- * Create a new user.
1043
+ * Set the default payment method.
1089
1044
  *
1090
- * 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.
1045
+ * Sets the given payment method as the default used for invoices and active subscriptions. Requires the Administrator role.
1091
1046
  *
1092
1047
  */
1093
- export const createUserMutation = (options) => {
1048
+ export const setDefaultPaymentMethodMutation = (options) => {
1094
1049
  const mutationOptions = {
1095
1050
  mutationFn: async (fnOptions) => {
1096
- const { data } = await UsersService.createUser({
1051
+ const { data } = await BillingService.setDefaultPaymentMethod({
1097
1052
  ...options,
1098
1053
  ...fnOptions,
1099
1054
  throwOnError: true
@@ -1104,15 +1059,15 @@ export const createUserMutation = (options) => {
1104
1059
  return mutationOptions;
1105
1060
  };
1106
1061
  /**
1107
- * Delete user by id.
1062
+ * Delete a payment method.
1108
1063
  *
1109
- * Sets user status to `inactive`. Inactive users cannot log in and manage organization resources. This endpoint is available to administrators of the organization only.
1064
+ * 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.
1110
1065
  *
1111
1066
  */
1112
- export const deleteUserMutation = (options) => {
1067
+ export const deletePaymentMethodMutation = (options) => {
1113
1068
  const mutationOptions = {
1114
1069
  mutationFn: async (fnOptions) => {
1115
- const { data } = await UsersService.deleteUser({
1070
+ const { data } = await BillingService.deletePaymentMethod({
1116
1071
  ...options,
1117
1072
  ...fnOptions,
1118
1073
  throwOnError: true
@@ -1122,18 +1077,35 @@ export const deleteUserMutation = (options) => {
1122
1077
  };
1123
1078
  return mutationOptions;
1124
1079
  };
1125
- export const getUserQueryKey = (options) => createQueryKey('getUser', options);
1080
+ export const listInvoicesQueryKey = (options) => createQueryKey('listInvoices', options);
1126
1081
  /**
1127
- * Get user profile information by id.
1082
+ * List issued invoices.
1128
1083
  *
1129
- * Returns user details including their roles. For more information on identity access management, see [Users](https://cloudfleet.ai/docs/organization/users/) section of documentaiton.
1084
+ * 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.
1130
1085
  *
1131
- * This endpoint is available to all users in the organization.
1086
+ */
1087
+ export const listInvoicesOptions = (options) => queryOptions({
1088
+ queryFn: async ({ queryKey, signal }) => {
1089
+ const { data } = await BillingService.listInvoices({
1090
+ ...options,
1091
+ ...queryKey[0],
1092
+ signal,
1093
+ throwOnError: true
1094
+ });
1095
+ return data;
1096
+ },
1097
+ queryKey: listInvoicesQueryKey(options)
1098
+ });
1099
+ export const getContactQueryKey = (options) => createQueryKey('getContact', options);
1100
+ /**
1101
+ * Get organization contact and billing address information.
1102
+ *
1103
+ * Returns the organization contact and billing address information. This endpoint is available to all users in the organization.
1132
1104
  *
1133
1105
  */
1134
- export const getUserOptions = (options) => queryOptions({
1106
+ export const getContactOptions = (options) => queryOptions({
1135
1107
  queryFn: async ({ queryKey, signal }) => {
1136
- const { data } = await UsersService.getUser({
1108
+ const { data } = await BillingService.getContact({
1137
1109
  ...options,
1138
1110
  ...queryKey[0],
1139
1111
  signal,
@@ -1141,18 +1113,56 @@ export const getUserOptions = (options) => queryOptions({
1141
1113
  });
1142
1114
  return data;
1143
1115
  },
1144
- queryKey: getUserQueryKey(options)
1116
+ queryKey: getContactQueryKey(options)
1145
1117
  });
1146
1118
  /**
1147
- * Update user profile information.
1119
+ * Update organization contact information and billing address.
1148
1120
  *
1149
- * 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.
1121
+ * This endpoint allows you to update organization details with its contact information. This endpoint is available to administrators of the organization only.
1150
1122
  *
1151
1123
  */
1152
- export const updateUserMutation = (options) => {
1124
+ export const updateContactMutation = (options) => {
1153
1125
  const mutationOptions = {
1154
1126
  mutationFn: async (fnOptions) => {
1155
- const { data } = await UsersService.updateUser({
1127
+ const { data } = await BillingService.updateContact({
1128
+ ...options,
1129
+ ...fnOptions,
1130
+ throwOnError: true
1131
+ });
1132
+ return data;
1133
+ }
1134
+ };
1135
+ return mutationOptions;
1136
+ };
1137
+ export const getCreditsQueryKey = (options) => createQueryKey('getCredits', options);
1138
+ /**
1139
+ * Get applied promotional credits
1140
+ *
1141
+ * 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.
1142
+ *
1143
+ */
1144
+ export const getCreditsOptions = (options) => queryOptions({
1145
+ queryFn: async ({ queryKey, signal }) => {
1146
+ const { data } = await BillingService.getCredits({
1147
+ ...options,
1148
+ ...queryKey[0],
1149
+ signal,
1150
+ throwOnError: true
1151
+ });
1152
+ return data;
1153
+ },
1154
+ queryKey: getCreditsQueryKey(options)
1155
+ });
1156
+ /**
1157
+ * Redeem promotional credits code.
1158
+ *
1159
+ * 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.
1160
+ *
1161
+ */
1162
+ export const redeemCreditsMutation = (options) => {
1163
+ const mutationOptions = {
1164
+ mutationFn: async (fnOptions) => {
1165
+ const { data } = await BillingService.redeemCredits({
1156
1166
  ...options,
1157
1167
  ...fnOptions,
1158
1168
  throwOnError: true